diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-04-26 23:57:25 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-05-11 11:14:14 +0200 |
commit | e98ea774c8d210364379329f042e7596f83ecc58 (patch) | |
tree | 95833bd464ee36b68abe4e3c5612dc7e804f771c /drivers/pinctrl/pinctrl-nomadik.h | |
parent | 072e82a18f72b7b7278130c79029aac59de7650b (diff) | |
download | talos-op-linux-e98ea774c8d210364379329f042e7596f83ecc58.tar.gz talos-op-linux-e98ea774c8d210364379329f042e7596f83ecc58.zip |
pinctrl/nomadik: basic Nomadik pinctrl interface
This adds a scratch pin control interface to the Nomadik pinctrl
driver, and defines the pins and groups in the DB8500 ASIC. We
define GPIO ranges to cover the pins exposed. The DB8500 has
more pins than this but we restrict the driver to the pins that
can be controlled from the combined GPIO and pin control hardware
to begin with.
ChangeLog v1->v2:
- Base on the latest pinctrl development from
pinctrl-mergebase-20120418 so we can get rid of legacy
group count mechanism. Also drop the range checks for group
index, this is handled by the core now.
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-nomadik.h')
-rw-r--r-- | drivers/pinctrl/pinctrl-nomadik.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-nomadik.h b/drivers/pinctrl/pinctrl-nomadik.h new file mode 100644 index 000000000000..e690accb5051 --- /dev/null +++ b/drivers/pinctrl/pinctrl-nomadik.h @@ -0,0 +1,61 @@ +#ifndef PINCTRL_PINCTRL_NOMADIK_H +#define PINCTRL_PINCTRL_NOMADIK_H + +#include <plat/gpio-nomadik.h> + +/* Package definitions */ +#define PINCTRL_NMK_STN8815 0 +#define PINCTRL_NMK_DB8500 1 + +/** + * struct nmk_pingroup - describes a Nomadik pin group + * @name: the name of this specific pin group + * @pins: an array of discrete physical pins used in this group, taken + * from the driver-local pin enumeration space + * @num_pins: the number of pins in this group array, i.e. the number of + * elements in .pins so we can iterate over that array + * @altsetting: the altsetting to apply to all pins in this group to + * configure them to be used by a function + */ +struct nmk_pingroup { + const char *name; + const unsigned int *pins; + const unsigned npins; + u32 altsetting; +}; + +/** + * struct nmk_pinctrl_soc_data - Nomadik pin controller per-SoC configuration + * @gpio_ranges: An array of GPIO ranges for this SoC + * @gpio_num_ranges: The number of GPIO ranges for this SoC + * @pins: An array describing all pins the pin controller affects. + * All pins which are also GPIOs must be listed first within the + * array, and be numbered identically to the GPIO controller's + * numbering. + * @npins: The numbmer of entries in @pins. + * @groups: An array describing all pin groups the pin SoC supports. + * @ngroups: The number of entries in @groups. + */ +struct nmk_pinctrl_soc_data { + struct pinctrl_gpio_range *gpio_ranges; + unsigned gpio_num_ranges; + const struct pinctrl_pin_desc *pins; + unsigned npins; + const struct nmk_pingroup *groups; + unsigned ngroups; +}; + +#ifdef CONFIG_PINCTRL_DB8500 + +void nmk_pinctrl_db8500_init(const struct nmk_pinctrl_soc_data **soc); + +#else + +static inline void +nmk_pinctrl_db8500_init(const struct nmk_pinctrl_soc_data **soc) +{ +} + +#endif + +#endif /* PINCTRL_PINCTRL_NOMADIK_H */ |