Thread (13 messages) 13 messages, 3 authors, 2018-03-20

Re: [PATCH v5 7/9] gpio: Add gpio driver for Actions OWL S900 SoC

From: Andy Shevchenko <hidden>
Date: 2018-03-10 18:41:04
Also in: linux-arm-kernel, linux-gpio, lkml

On Fri, Mar 9, 2018 at 7:13 AM, Manivannan Sadhasivam
[off-list ref] 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.
+static void owl_gpio_set_reg(void __iomem *base, unsigned int pin, int flag)
+{
+       u32 val;
+
+       val = readl_relaxed(base);
+
+       if (flag)
+               val |= BIT(pin);
+       else
+               val &= ~BIT(pin);
+
+       writel_relaxed(val, base);
+}
The name is confusing. It's not exclusively set, it's an update.
+static void owl_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
+{
+       struct owl_gpio *gpio = gpiochip_get_data(chip);
+       u32 val;
+
+       val = readl_relaxed(gpio->base + GPIO_DAT);
+
+       if (value)
+               val |= BIT(offset);
+       else
+               val &= ~BIT(offset);
+
+       writel_relaxed(val, gpio->base + GPIO_DAT);
Forgot to replace?
+}
-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help