mmc: fsl_esdhc: workaround for hardware 3.3v IO reliability issue
[oweals/u-boot.git] / include / vsprintf.h
index 60e91d119eeed301799b3321d36d1616cdb9ae91..d9fb68add0c9ac70e2423a2e855aa5ef6920e412 100644 (file)
@@ -1,14 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * (C) Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef __VSPRINTF_H
 #define __VSPRINTF_H
 
 #include <stdarg.h>
+#include <linux/types.h>
 
 ulong simple_strtoul(const char *cp, char **endp, unsigned int base);
 
@@ -72,7 +72,7 @@ long trailing_strtoln(const char *str, const char *end);
  * panic() - Print a message and reset/hang
  *
  * Prints a message on the console(s) and then resets. If CONFIG_PANIC_HANG is
- * defined, then it will hang instead of reseting.
+ * defined, then it will hang instead of resetting.
  *
  * @param fmt: printf() format string for message, which should not include
  *             \n, followed by arguments
@@ -84,7 +84,7 @@ void panic(const char *fmt, ...)
  * panic_str() - Print a message and reset/hang
  *
  * Prints a message on the console(s) and then resets. If CONFIG_PANIC_HANG is
- * defined, then it will hang instead of reseting.
+ * defined, then it will hang instead of resetting.
  *
  * This function can be used instead of panic() when your board does not
  * already use printf(), * to keep code size small.
@@ -112,12 +112,10 @@ int sprintf(char *buf, const char *fmt, ...)
  * Format a string and place it in a buffer (va_list version)
  *
  * @param buf  The buffer to place the result into
- * @param size The size of the buffer, including the trailing null space
  * @param fmt  The format string to use
  * @param args Arguments for the format string
  * @return the number of characters which have been written into
- * the @buf not including the trailing '\0'. If @size is == 0 the function
- * returns 0.
+ * the @buf not including the trailing '\0'.
  *
  * If you're not already dealing with a va_list consider using scnprintf().
  *
@@ -214,4 +212,26 @@ void print_grouped_ull(unsigned long long int_val, int digits);
 
 bool str2off(const char *p, loff_t *num);
 bool str2long(const char *p, ulong *num);
+
+/**
+ * strmhz() - Convert a value to a Hz string
+ *
+ * This creates a string indicating the number of MHz of a value. For example,
+ * 2700000 produces "2.7".
+ * @buf: Buffer to hold output string, which must be large enough
+ * @hz: Value to convert
+ */
+char *strmhz(char *buf, unsigned long hz);
+
+/**
+ * str_to_upper() - Convert a string to upper case
+ *
+ * This simply uses toupper() on each character of the string.
+ *
+ * @in: String to convert (must be large enough to hold the output string)
+ * @out: Buffer to put converted string
+ * @len: Number of bytes available in @out (SIZE_MAX for all)
+ */
+void str_to_upper(const char *in, char *out, size_t len);
+
 #endif