From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [PATCH v5 7/9] gpio: Add gpio driver for Actions OWL S900 SoC Date: Sat, 10 Mar 2018 20:41:00 +0200 Message-ID: References: <20180309051345.1011-1-manivannan.sadhasivam@linaro.org> <20180309051345.1011-8-manivannan.sadhasivam@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20180309051345.1011-8-manivannan.sadhasivam@linaro.org> Sender: linux-kernel-owner@vger.kernel.org To: Manivannan Sadhasivam Cc: Linus Walleij , Rob Herring , =?UTF-8?Q?Andreas_F=C3=A4rber?= , =?UTF-8?B?5YiY54Kc?= , mp-cs@actions-semi.com, 96boards@ucrobotics.com, devicetree , Daniel Thompson , amit.kucheria@linaro.org, linux-arm Mailing List , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , hzhang@ucrobotics.com, bdong@ucrobotics.com, Mani Sadhasivam List-Id: linux-gpio@vger.kernel.org On Fri, Mar 9, 2018 at 7:13 AM, Manivannan Sadhasivam 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