linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: andy.shevchenko@gmail.com (Andy Shevchenko)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 7/9] gpio: Add gpio driver for Actions OWL S900 SoC
Date: Sat, 10 Mar 2018 20:41:00 +0200	[thread overview]
Message-ID: <CAHp75Vdecdw-Qp_cdfCTUcMFQtFosUhgNKehHHJfPTNM9FrrBA@mail.gmail.com> (raw)
In-Reply-To: <20180309051345.1011-8-manivannan.sadhasivam@linaro.org>

On Fri, Mar 9, 2018 at 7:13 AM, 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;
> +
> +       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

  reply	other threads:[~2018-03-10 18:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09  5:13 [PATCH v5 0/9] Add Actions Semi S900 pinctrl and gpio support Manivannan Sadhasivam
2018-03-09  5:13 ` [PATCH v5 1/9] arm64: dts: actions: Add pinctrl node for S900 Manivannan Sadhasivam
2018-03-09  5:13 ` [PATCH v5 2/9] arm64: actions: Enable PINCTRL in platforms Kconfig Manivannan Sadhasivam
2018-03-09  5:13 ` [PATCH v5 3/9] pinctrl: actions: Add Actions S900 pinctrl driver Manivannan Sadhasivam
2018-03-09  5:13 ` [PATCH v5 4/9] dt-bindings: gpio: Add gpio nodes for Actions S900 SoC Manivannan Sadhasivam
2018-03-18 12:53   ` Rob Herring
2018-03-20 10:28     ` Manivannan Sadhasivam
2018-03-09  5:13 ` [PATCH v5 5/9] arm64: dts: actions: Add S900 gpio nodes Manivannan Sadhasivam
2018-03-09  5:13 ` [PATCH v5 6/9] arm64: dts: actions: Add gpio line names to Bubblegum-96 board Manivannan Sadhasivam
2018-03-09  5:13 ` [PATCH v5 7/9] gpio: Add gpio driver for Actions OWL S900 SoC Manivannan Sadhasivam
2018-03-10 18:41   ` Andy Shevchenko [this message]
2018-03-09  5:13 ` [PATCH v5 8/9] MAINTAINERS: Add reviewer for ACTIONS platforms Manivannan Sadhasivam
2018-03-09  5:13 ` [PATCH v5 9/9] MAINTAINERS: Add Actions Semi S900 pinctrl and gpio entries Manivannan Sadhasivam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHp75Vdecdw-Qp_cdfCTUcMFQtFosUhgNKehHHJfPTNM9FrrBA@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).