[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vcmtq_mpkqx4+Yr24nRQEHJZmcypbOJLukZpdXVYzizNQ@mail.gmail.com>
Date: Sun, 18 Feb 2018 16:45:09 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Andreas Färber <afaerber@...e.de>,
刘炜 <liuwei@...ions-semi.com>,
mp-cs@...ions-semi.com, 96boards@...obotics.com,
devicetree <devicetree@...r.kernel.org>,
Daniel Thompson <daniel.thompson@...aro.org>,
amit.kucheria@...aro.org,
linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 08/10] gpio: Add gpio driver for Actions OWL S900 SoC
On Sat, Feb 17, 2018 at 10:44 PM, Manivannan Sadhasivam
<manivannan.sadhasivam@...aro.org> wrote:
> Add gpio driver for Actions Semi OWL family S900 SoC. Set of registers
> controlling the gpio shares the same register range with pinctrl block.
>
> GPIO registers are organized as 6 banks and each bank controls the
> maximum of 32 gpios.
> +#include <linux/init.h>
> +#include <linux/module.h>
Choose one of them.
> + val = readl(gpio_base + GPIO_OUTEN);
> + val |= BIT(offset);
> + writel(val, gpio_base + GPIO_OUTEN);
out_en()
> + val = readl(gpio_base + GPIO_OUTEN);
> + val &= ~BIT(offset);
> + writel(val, gpio_base + GPIO_OUTEN);
out_dis()
> + val = readl(gpio_base + GPIO_INEN);
> + val &= ~BIT(offset);
> + writel(val, gpio_base + GPIO_INEN);
in_dis()
> + val = readl(gpio_base + GPIO_OUTEN);
> + val &= ~BIT(offset);
> + writel(val, gpio_base + GPIO_OUTEN);
out_dis()
> + val = readl(gpio_base + GPIO_INEN);
> + val |= BIT(offset);
> + writel(val, gpio_base + GPIO_INEN);
in_en()
> + val = readl(gpio_base + GPIO_INEN);
> + val &= ~BIT(pin);
> + writel(val, gpio_base + GPIO_INEN);
in_dis()
> + val = readl(gpio_base + GPIO_OUTEN);
> + val |= BIT(pin);
> + writel(val, gpio_base + GPIO_OUTEN);
out_en()
Find above code duplication.
> +static int owl_gpio_probe(struct platform_device *pdev)
> +{
> + gpio->base = of_iomap(pdev->dev.of_node, 0);
> + if (IS_ERR(gpio->base))
> + return PTR_ERR(gpio->base);
> + gpio->gpio.of_node = pdev->dev.of_node;
Isn't this done by GPIO library?
> +static int owl_gpio_remove(struct platform_device *pdev)
> +{
> + return 0;
> +}
Useless stub.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists