Message ID | 20180221160044.15089-1-manivannan.sadhasivam@linaro.org |
---|---|
Headers | show |
Series | Add Actions Semi S900 pinctrl and gpio support | expand |
Am 21.02.2018 um 20:13 schrieb Andy Shevchenko: > On Wed, Feb 21, 2018 at 6:00 PM, Manivannan Sadhasivam > <manivannan.sadhasivam@linaro.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. > >> +static void owl_gpio_set_reg(void __iomem *base, unsigned int pin, int flag) >> +{ >> + u32 val; >> + >> + if (flag) { >> + val = readl(base); >> + val |= BIT(pin); >> + writel(val, base); >> + } else { >> + val = readl(base); >> + val &= ~BIT(pin); >> + writel(val, base); >> + } >> +} > > Why not to use the same pattern as below? > > readl() > if () > ... > else > ... > writel() > > ? And shouldn't that be readl_relaxed() and writel_relaxed()? Regards, Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)
On Wed, Feb 21, 2018 at 5:00 PM, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> wrote: > Add pinctrl driver for Actions Semi S900 SoC. The driver supports > pinctrl, pinmux and pinconf functionalities through a range of registers > common to both gpio driver and pinctrl driver. > > Pinmux functionality is available only for the pin groups while the > pinconf functionality is available for both pin groups and individual > pins. > > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Looks very good overall. Can I get Andreas' feedback and ACK on this? It would be awesome if someone from Actions could also ACK or drop some comments. Actions was an early adopter of the pin control framework (it was used already on ATM7029), so I would appreciate their feedback. Yours, Linus Walleij