]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/hwconfig.h
powerpc/p2040: Add various p2040 specific information
[people/ms/u-boot.git] / include / hwconfig.h
CommitLineData
93f9dcf9
AV
1/*
2 * An inteface for configuring a hardware via u-boot environment.
3 *
4 * Copyright (c) 2009 MontaVista Software, Inc.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 */
13
14#ifndef _HWCONFIG_H
15#define _HWCONFIG_H
16
17#include <linux/types.h>
18#include <asm/errno.h>
19
20#ifdef CONFIG_HWCONFIG
21
22extern int hwconfig(const char *opt);
23extern const char *hwconfig_arg(const char *opt, size_t *arglen);
24extern int hwconfig_arg_cmp(const char *opt, const char *arg);
25extern int hwconfig_sub(const char *opt, const char *subopt);
26extern const char *hwconfig_subarg(const char *opt, const char *subopt,
27 size_t *subarglen);
28extern int hwconfig_subarg_cmp(const char *opt, const char *subopt,
29 const char *subarg);
30
31#else
32
33static inline int hwconfig(const char *opt)
34{
35 return -ENOSYS;
36}
37
38static inline const char *hwconfig_arg(const char *opt, size_t *arglen)
39{
40 *arglen = 0;
41 return "";
42}
43
44static inline int hwconfig_arg_cmp(const char *opt, const char *arg)
45{
46 return -ENOSYS;
47}
48
49static inline int hwconfig_sub(const char *opt, const char *subopt)
50{
51 return -ENOSYS;
52}
53
54static inline const char *hwconfig_subarg(const char *opt, const char *subopt,
55 size_t *subarglen)
56{
57 *subarglen = 0;
58 return "";
59}
60
61static inline int hwconfig_subarg_cmp(const char *opt, const char *subopt,
62 const char *subarg)
63{
64 return -ENOSYS;
65}
66
67#endif /* CONFIG_HWCONFIG */
68
69#endif /* _HWCONFIG_H */