diff options
author | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2017-02-22 13:10:18 +0100 |
---|---|---|
committer | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2017-03-09 01:40:19 +0100 |
commit | b67e899ff11d64732dafede691cefcf368f8f877 (patch) | |
tree | 3038e6fea564e8a063f770318a29aec51ae0761c /drivers/pinctrl | |
parent | 9b001190edfeb4d8e456b612a06d3a2a0ff104b4 (diff) |
sunxi: CONFIG_DM_ALLOW_MULTIPLE_DRIVERS for gpio/pinctrl binding
Our gpio and pinctrl driver need to be bound against the same
node. While this can be done by hand (i.e. explicitly looking up the
driver, creating the driver-data and binding the device), it is much
easier done when the new option for the binding of multiple drivers
against a single node is configured.
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/sunxi/pinctrl-sunxi.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index 1e659fc017..dc1a1f7409 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -16,7 +16,9 @@ #include <asm/io.h> #include <asm/arch/clock.h> #include <asm/gpio.h> +#if defined(CONFIG_DM_GPIO) && !defined(CONFIG_DM_ALLOW_MULTIPLE_DRIVERS) #include <asm/arch/gpio-internal.h> +#endif #include <dm/device-internal.h> #include <dm/lists.h> #include <dm/pinctrl.h> @@ -29,7 +31,7 @@ DECLARE_GLOBAL_DATA_PTR; struct sunxi_pctrl_priv { void *base; -#if defined(CONFIG_DM_GPIO) +#if defined(CONFIG_DM_GPIO) && !defined(CONFIG_DM_ALLOW_MULTIPLE_DRIVERS) struct sunxi_gpio_soc_data gpio_soc_data; struct udevice *gpio_dev; #endif @@ -251,6 +253,7 @@ static int sunxi_pctrl_set_state(struct udevice *dev, struct udevice *config) return 0; } +#if defined(CONFIG_DM_GPIO) && !defined(CONFIG_DM_ALLOW_MULTIPLE_DRIVERS) static inline void soc_data_from_desc(const struct sunxi_pinctrl_desc *data, struct sunxi_gpio_soc_data *soc_data) { @@ -270,10 +273,11 @@ static inline void soc_data_from_desc(const struct sunxi_pinctrl_desc *data, soc_data->start = low; soc_data->no_banks = high - low + 1; } +#endif static int sunxi_pctrl_bind_gpio(struct udevice *dev) { -#if defined(CONFIG_DM_GPIO) +#if defined(CONFIG_DM_GPIO) && !defined(CONFIG_DM_ALLOW_MULTIPLE_DRIVERS) struct sunxi_pctrl_priv *priv = dev_get_priv(dev); const struct sunxi_pinctrl_desc *data = (struct sunxi_pinctrl_desc *)dev_get_driver_data(dev); |