From: Michal Simek Date: Wed, 11 Apr 2018 13:55:01 +0000 (+0200) Subject: gpio: zynq: Setup chip->base based on alias ID X-Git-Tag: rel_imx_4.19.35_1.1.0~9947^2~21 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=060f3ebf6a9a4a92dd92149e6ebffae10679ed17;p=linux.git gpio: zynq: Setup chip->base based on alias ID In past Xilinx gpio-zynq driver was setting up gpio chip->base as 0 which was chagned to autodetection when driver was upstreamed. Older systems, which were using this old version, setup SW stack which expects zynq gpio base as 0 and right now there is no way how to set this up. The patch is adding an option to setup chip->base based on aliases which is something what some other drivers are doing too. It means when gpio0 alias is setup then chip->base is 0. When gpio alias is not setup gpiochip_find_base() set it up properly which is current behavior. Signed-off-by: Michal Simek Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 6c61e15cf322..3f5fcdd5a429 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -827,7 +827,7 @@ static int zynq_gpio_probe(struct platform_device *pdev) chip->free = zynq_gpio_free; chip->direction_input = zynq_gpio_dir_in; chip->direction_output = zynq_gpio_dir_out; - chip->base = -1; + chip->base = of_alias_get_id(pdev->dev.of_node, "gpio"); chip->ngpio = gpio->p_data->ngpio; /* Retrieve GPIO clock */