[U-Boot,RFC] gpio: zynq: Setup bank_name to dev->name

Message ID 3a5a2fbe9d0aad4fdbbbf197c39dc0f973e5045e.1531404282.git.michal.simek@xilinx.com
State New
Headers show
Series
  • [U-Boot,RFC] gpio: zynq: Setup bank_name to dev->name
Related show

Commit Message

Michal Simek July 12, 2018, 2:04 p.m.
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(+)

Comments

Simon Glass July 16, 2018, 5:19 a.m. | #1
On 12 July 2018 at 08:04, Michal Simek <michal.simek@xilinx.com> wrote:
> 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(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

Normally these would be named A, B, C, etc. Is there no such naming
convention on zynq?

Regards,
Simon
Michal Simek July 16, 2018, 5:26 a.m. | #2
On 16.7.2018 07:19, Simon Glass wrote:
> On 12 July 2018 at 08:04, Michal Simek <michal.simek@xilinx.com> wrote:
>> 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(+)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> Normally these would be named A, B, C, etc. Is there no such naming
> convention on zynq?

PS(Hard) part has only one gpio controller with several banks with are
using the same address space. We are using from the beginning flat
number scheme that's why only one name is used for all banks.

Thanks,
Michal

Patch

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;