
Hi Michal,
On 23 July 2018 at 03:08, Michal Simek michal.simek@xilinx.com wrote:
On 20.7.2018 21:31, Stefan Herbrechtsmeier wrote:
Hi Michal,
Am 12.07.2018 um 16:04 schrieb Michal Simek:
There should be proper bank name setup to distiguish between different gpio drivers. Use dev->name for it.
Signed-off-by: Michal Simek michal.simek@xilinx.com
drivers/gpio/zynq_gpio.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/gpio/zynq_gpio.c b/drivers/gpio/zynq_gpio.c index 26f69b1a713f..f793ee5754a8 100644 --- a/drivers/gpio/zynq_gpio.c +++ b/drivers/gpio/zynq_gpio.c @@ -337,6 +337,8 @@ static int zynq_gpio_probe(struct udevice *dev) struct zynq_gpio_privdata *priv = dev_get_priv(dev); struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
- uc_priv->bank_name = dev->name;
if (priv->p_data) uc_priv->gpio_count = priv->p_data->ngpio;
Does this not lead to ugly names because the gpio number is append to the bank_name? Have you check the "gpio status -a" output?
Yes I was checking it. Names are composed together but also just numbers works as before.
gpio@ff0a00000: input: 0 [ ] gpio@ff0a00001: input: 0 [ ] gpio@ff0a00002: input: 0 [ ] gpio@ff0a00003: input: 0 [ ] gpio@ff0a00004: input: 0 [ ] gpio@ff0a00005: input: 0 [ ] gpio@ff0a00006: input: 0 [ ] gpio@ff0a00007: input: 0 [ ] gpio@ff0a00008: input: 0 [ ] gpio@ff0a00009: input: 0 [ ]
If you know better way how to setup a bank name please let me know but I need to distinguish ps gpio from pl one and for pl we need to know the address.
Other drivers use the gpio-bank-name from the device tree.
I can't see this property inside Linux kernel. If this has been reviewed by dt guys please let me know.
Linux doesn't have this concept and has no command line. I am skeptical they would be interested in adding the property.
If we can get this in by renaming it (e.g. to u-boot,gpio-bank-name) then that would be OK. Otherwise I think we just have to rely on having our own binding file.
Regards, Simon