2 * An inteface for configuring a hardware via u-boot environment.
4 * Copyright (c) 2009 MontaVista Software, Inc.
5 * Copyright 2011 Freescale Semiconductor, Inc.
7 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
9 * SPDX-License-Identifier: GPL-2.0+
15 #include <linux/types.h>
16 #include <asm/errno.h>
18 #ifdef CONFIG_HWCONFIG
20 extern int hwconfig_f(const char *opt, char *buf);
21 extern const char *hwconfig_arg_f(const char *opt, size_t *arglen, char *buf);
22 extern int hwconfig_arg_cmp_f(const char *opt, const char *arg, char *buf);
23 extern int hwconfig_sub_f(const char *opt, const char *subopt, char *buf);
24 extern const char *hwconfig_subarg_f(const char *opt, const char *subopt,
25 size_t *subarglen, char *buf);
26 extern int hwconfig_subarg_cmp_f(const char *opt, const char *subopt,
27 const char *subarg, char *buf);
30 static inline int hwconfig_f(const char *opt, char *buf)
35 static inline const char *hwconfig_arg_f(const char *opt, size_t *arglen,
42 static inline int hwconfig_arg_cmp_f(const char *opt, const char *arg,
48 static inline int hwconfig_sub_f(const char *opt, const char *subopt, char *buf)
53 static inline const char *hwconfig_subarg_f(const char *opt, const char *subopt,
54 size_t *subarglen, char *buf)
60 static inline int hwconfig_subarg_cmp_f(const char *opt, const char *subopt,
61 const char *subarg, char *buf)
66 #endif /* CONFIG_HWCONFIG */
68 static inline int hwconfig(const char *opt)
70 return hwconfig_f(opt, NULL);
73 static inline const char *hwconfig_arg(const char *opt, size_t *arglen)
75 return hwconfig_arg_f(opt, arglen, NULL);
78 static inline int hwconfig_arg_cmp(const char *opt, const char *arg)
80 return hwconfig_arg_cmp_f(opt, arg, NULL);
83 static inline int hwconfig_sub(const char *opt, const char *subopt)
85 return hwconfig_sub_f(opt, subopt, NULL);
88 static inline const char *hwconfig_subarg(const char *opt, const char *subopt,
91 return hwconfig_subarg_f(opt, subopt, subarglen, NULL);
94 static inline int hwconfig_subarg_cmp(const char *opt, const char *subopt,
97 return hwconfig_subarg_cmp_f(opt, subopt, subarg, NULL);
100 #endif /* _HWCONFIG_H */