2 * Interface the pinconfig portions of the pinctrl subsystem
4 * Copyright (C) 2011 ST-Ericsson SA
5 * Written on behalf of Linaro for ST-Ericsson
6 * This interface is used in the core to keep track of pins.
8 * Author: Linus Walleij <linus.walleij@linaro.org>
10 * License terms: GNU General Public License (GPL) version 2
12 #ifndef __LINUX_PINCTRL_PINCONF_H
13 #define __LINUX_PINCTRL_PINCONF_H
21 * struct pinconf_ops - pin config operations, to be implemented by
22 * pin configuration capable drivers.
23 * @pin_config_get: get the config of a certain pin, if the requested config
24 * is not available on this controller this should return -ENOTSUPP
25 * and if it is available but disabled it should return -EINVAL
26 * @pin_config_get: get the config of a certain pin
27 * @pin_config_set: configure an individual pin
28 * @pin_config_group_get: get configurations for an entire pin group
29 * @pin_config_group_set: configure all pins in a group
30 * @pin_config_dbg_show: optional debugfs display hook that will provide
31 * per-device info for a certain pin in debugfs
32 * @pin_config_group_dbg_show: optional debugfs display hook that will provide
33 * per-device info for a certain group in debugfs
36 int (*pin_config_get
) (struct pinctrl_dev
*pctldev
,
38 unsigned long *config
);
39 int (*pin_config_set
) (struct pinctrl_dev
*pctldev
,
41 unsigned long config
);
42 int (*pin_config_group_get
) (struct pinctrl_dev
*pctldev
,
44 unsigned long *config
);
45 int (*pin_config_group_set
) (struct pinctrl_dev
*pctldev
,
47 unsigned long config
);
48 void (*pin_config_dbg_show
) (struct pinctrl_dev
*pctldev
,
51 void (*pin_config_group_dbg_show
) (struct pinctrl_dev
*pctldev
,
56 extern int pin_config_get(const char *dev_name
, const char *name
,
57 unsigned long *config
);
58 extern int pin_config_set(const char *dev_name
, const char *name
,
59 unsigned long config
);
60 extern int pin_config_group_get(const char *dev_name
,
61 const char *pin_group
,
62 unsigned long *config
);
63 extern int pin_config_group_set(const char *dev_name
,
64 const char *pin_group
,
65 unsigned long config
);
69 static inline int pin_config_get(const char *dev_name
, const char *name
,
70 unsigned long *config
)
75 static inline int pin_config_set(const char *dev_name
, const char *name
,
81 static inline int pin_config_group_get(const char *dev_name
,
82 const char *pin_group
,
83 unsigned long *config
)
88 static inline int pin_config_group_set(const char *dev_name
,
89 const char *pin_group
,
97 #endif /* __LINUX_PINCTRL_PINCONF_H */