Linux-GPIO Archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linusw@kernel.org>
To: Petar Stepanovic <pstepanovic@axiado.com>
Cc: Tzu-Hao Wei <twei@axiado.com>, Swark Yang <syang@axiado.com>,
	 Prasad Bolisetty <pbolisetty@axiado.com>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	 Harshit Shah <hshah@axiado.com>,
	SriNavmani A <srinavmani@axiado.com>,
	linux-gpio@vger.kernel.org,  devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] gpio: axiado: add SGPIO controller support
Date: Fri, 24 Apr 2026 09:44:04 +0200	[thread overview]
Message-ID: <CAD++jLkqD25mudwd0wBCz=-FCzgzssOv5bXTNDdizxdCOY0j=A@mail.gmail.com> (raw)
In-Reply-To: <20260414-axiado-ax3000-sgpio-controller-v1-2-b5c7e4c2e69b@axiado.com>

Hi Petar,

thanks for your patch!

On Tue, Apr 14, 2026 at 3:48 PM Petar Stepanovic <pstepanovic@axiado.com> wrote:

> Add support for the Axiado SGPIO controller.
>
> The controller provides a serialized interface for GPIOs with
> configurable direction and interrupt support.
>
> The driver registers the controller as a gpio_chip and uses
> regmap for register access.
>
> Signed-off-by: Petar Stepanovic <pstepanovic@axiado.com>

(...)

> +static void ax3000_sgpio_set(struct gpio_chip *chip, unsigned int offset,
> +                            int value)
> +{
> +       struct ax3000_sgpio *sgpio = gpiochip_get_data(chip);
> +       unsigned long flags;
> +       u32 bank = (offset / 2) / 32;
> +       u32 position = (offset / 2) % 32;

This systematic calculation of offsets from bank and position and the
whole bank concept makes me feel that perhaps the bindings are
better off reflecting the bank structure either by defining several banks
using 2 cells or by using a 3-cell binding?

For 3-cell see:
commit bd3ce71078bde4ecbfc60d49c96d1c55de0635cc
"gpiolib: of: Handle threecell GPIO chips"
for some details on how this can help.

Either of these approaches will further probably help you to
use GPIO_GENERIC (gpio-mmio) helper functions with this hardware,

Yours,
Linus Walleij

  parent reply	other threads:[~2026-04-24  7:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-14 13:48 [PATCH 0/3] Subject: [PATCH 0/3] gpio: add support for Axiado SGPIO controller Petar Stepanovic
2026-04-14 13:48 ` [PATCH 1/3] dt-bindings: gpio: add " Petar Stepanovic
2026-04-14 14:06   ` Krzysztof Kozlowski
2026-04-24  7:26   ` Linus Walleij
2026-05-07  8:05     ` Petar Stepanovic
2026-05-07  9:44       ` Linus Walleij
2026-05-08  7:57         ` Petar Stepanovic
2026-05-11  8:36           ` Linus Walleij
2026-05-13  8:59             ` Petar Stepanovic
2026-05-23  9:13               ` Linus Walleij
2026-04-14 13:48 ` [PATCH 2/3] gpio: axiado: add SGPIO controller support Petar Stepanovic
2026-04-14 14:04   ` Krzysztof Kozlowski
2026-04-20  9:25   ` Bartosz Golaszewski
2026-04-24  7:44   ` Linus Walleij [this message]
2026-04-14 13:48 ` [PATCH 3/3] MAINTAINERS: add Axiado SGPIO controller Petar Stepanovic
2026-04-14 14:12   ` Krzysztof Kozlowski
2026-04-22  1:48     ` Prasad Bolisetty

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='CAD++jLkqD25mudwd0wBCz=-FCzgzssOv5bXTNDdizxdCOY0j=A@mail.gmail.com' \
    --to=linusw@kernel.org \
    --cc=brgl@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hshah@axiado.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbolisetty@axiado.com \
    --cc=pstepanovic@axiado.com \
    --cc=robh@kernel.org \
    --cc=srinavmani@axiado.com \
    --cc=syang@axiado.com \
    --cc=twei@axiado.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).