spi-topcliff-pch: Fix issue for transmitting over 4KByte
[zen-stable.git] / include / linux / pinctrl / pinconf.h
blob477922cf043ad26a17c31afc09b0448252fbd1c2
1 /*
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
15 #ifdef CONFIG_PINCONF
17 struct pinctrl_dev;
18 struct seq_file;
20 /**
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
35 struct pinconf_ops {
36 int (*pin_config_get) (struct pinctrl_dev *pctldev,
37 unsigned pin,
38 unsigned long *config);
39 int (*pin_config_set) (struct pinctrl_dev *pctldev,
40 unsigned pin,
41 unsigned long config);
42 int (*pin_config_group_get) (struct pinctrl_dev *pctldev,
43 unsigned selector,
44 unsigned long *config);
45 int (*pin_config_group_set) (struct pinctrl_dev *pctldev,
46 unsigned selector,
47 unsigned long config);
48 void (*pin_config_dbg_show) (struct pinctrl_dev *pctldev,
49 struct seq_file *s,
50 unsigned offset);
51 void (*pin_config_group_dbg_show) (struct pinctrl_dev *pctldev,
52 struct seq_file *s,
53 unsigned selector);
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);
67 #else
69 static inline int pin_config_get(const char *dev_name, const char *name,
70 unsigned long *config)
72 return 0;
75 static inline int pin_config_set(const char *dev_name, const char *name,
76 unsigned long config)
78 return 0;
81 static inline int pin_config_group_get(const char *dev_name,
82 const char *pin_group,
83 unsigned long *config)
85 return 0;
88 static inline int pin_config_group_set(const char *dev_name,
89 const char *pin_group,
90 unsigned long config)
92 return 0;
95 #endif
97 #endif /* __LINUX_PINCTRL_PINCONF_H */