diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-08-04 19:00:17 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-08-11 15:56:44 +0300 |
commit | f973be8ad5dfa2ceac19657444ba57abc205218c (patch) | |
tree | 0236a466fe1728f91685782a001cb4c8f6902686 /drivers/gpio | |
parent | c1b291e96a6d27ac83938596829086945ff8a36e (diff) | |
download | linux-f973be8ad5dfa2ceac19657444ba57abc205218c.tar.bz2 |
gpio: dwapb: Read GPIO base from gpio-base property
For backward compatibility with some legacy devices introduce
a new (*) property gpio-base to read GPIO base. This will allow
further cleaning up of the driver.
*) Note, it's not new for the GPIO library since the mockup driver
is using it already.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-dwapb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index 4c7153cb646c..674e91e69cc5 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -584,6 +584,10 @@ static struct dwapb_platform_data *dwapb_gpio_get_pdata(struct device *dev) pp->gpio_base = -1; + /* For internal use only, new platforms mustn't exercise this */ + if (is_software_node(fwnode)) + fwnode_property_read_u32(fwnode, "gpio-base", &pp->gpio_base); + /* * Only port A can provide interrupts in all configurations of * the IP. |