From: "Heiko Stübner" <heiko@sntech.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Rob Herring <robh@kernel.org>, Levin Du <djw@t-chip.com.cn>,
"open list:ARM/Rockchip SoC..."
<linux-rockchip@lists.infradead.org>,
Wayne Chou <zxf@t-chip.com.cn>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 2/5] gpio: syscon: Add gpio-syscon for rockchip
Date: Thu, 24 May 2018 10:35:12 +0200 [thread overview]
Message-ID: <2044895.BqI5yRtle6@diego> (raw)
In-Reply-To: <CACRpkdYCdNZ=ASw1uz4zKXC4AMd1EGbvG_G5K5cwSpH5eGPgKA@mail.gmail.com>
Hi Linus,
Am Donnerstag, 24. Mai 2018, 10:28:44 CEST schrieb Linus Walleij:
> On Wed, May 23, 2018 at 5:12 PM, Heiko Stübner <heiko@sntech.de> wrote:
> > So the gpio controller should definitly also be a subnode.
> >
> > The gpio in question is called "mute", so I'd think the gpio-syscon driver
> > should just define a "rockchip,rk3328-gpio-mute" compatible and contain
> > all the register voodoo in the driver itself and not define it in the dt.
> >
> > So it should probably look like
> >
> > grf: syscon at ff100000 {
> >
> > compatible = "rockchip,rk3328-grf", "syscon", "simple-mfd";
> >
> > [all the other syscon sub-devices]
> >
> > gpio_mute: gpio-mute {
> >
> > compatible = "rockchip,rk3328-gpio-mute";
> > gpio-controller;
> > #gpio-cells = <2>;
> >
> > };
>
> I'm sceptic.
>
> That doesn't sound like "general purpose input output" at all.
>
> It sounds like special purpose, for a mute button.
>
> Does it use IRQ? I would recommend implementing
> drivers/input/keyboard/syscon-keys.c in the same vein
> as drivers/leds/leds-syscon.c so you can avoid indirection
> through GPIO for no good reason at all.
To quote Levin from the other mail:
--------
The "mute" pin is a output only GPIO, which is already supported by
setting flags in the gpio-syscon
driver. And yes, this pin has a defined function, but can also be used
for general purpose operation.
--------
So to summarize, the documentation calls it "mute", but it is usable as
a general pin, which is the reason Levin is working on it - because on his
board this pin is used to switch between two voltages (aka a gpio-regulator)
for the sdmmc controller [3.3V + 1.8V].
Available pin settings are output-enable + of course the high/low setting
and I think I remember there is even a pull setting for it in the GRF
somewhere - but my memory might be fuzzy here.
Heiko
WARNING: multiple messages have this Message-ID (diff)
From: heiko@sntech.de (Heiko Stübner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/5] gpio: syscon: Add gpio-syscon for rockchip
Date: Thu, 24 May 2018 10:35:12 +0200 [thread overview]
Message-ID: <2044895.BqI5yRtle6@diego> (raw)
In-Reply-To: <CACRpkdYCdNZ=ASw1uz4zKXC4AMd1EGbvG_G5K5cwSpH5eGPgKA@mail.gmail.com>
Hi Linus,
Am Donnerstag, 24. Mai 2018, 10:28:44 CEST schrieb Linus Walleij:
> On Wed, May 23, 2018 at 5:12 PM, Heiko St?bner <heiko@sntech.de> wrote:
> > So the gpio controller should definitly also be a subnode.
> >
> > The gpio in question is called "mute", so I'd think the gpio-syscon driver
> > should just define a "rockchip,rk3328-gpio-mute" compatible and contain
> > all the register voodoo in the driver itself and not define it in the dt.
> >
> > So it should probably look like
> >
> > grf: syscon at ff100000 {
> >
> > compatible = "rockchip,rk3328-grf", "syscon", "simple-mfd";
> >
> > [all the other syscon sub-devices]
> >
> > gpio_mute: gpio-mute {
> >
> > compatible = "rockchip,rk3328-gpio-mute";
> > gpio-controller;
> > #gpio-cells = <2>;
> >
> > };
>
> I'm sceptic.
>
> That doesn't sound like "general purpose input output" at all.
>
> It sounds like special purpose, for a mute button.
>
> Does it use IRQ? I would recommend implementing
> drivers/input/keyboard/syscon-keys.c in the same vein
> as drivers/leds/leds-syscon.c so you can avoid indirection
> through GPIO for no good reason at all.
To quote Levin from the other mail:
--------
The "mute" pin is a output only GPIO, which is already supported by
setting flags in the gpio-syscon
driver. And yes, this pin has a defined function, but can also be used
for general purpose operation.
--------
So to summarize, the documentation calls it "mute", but it is usable as
a general pin, which is the reason Levin is working on it - because on his
board this pin is used to switch between two voltages (aka a gpio-regulator)
for the sdmmc controller [3.3V + 1.8V].
Available pin settings are output-enable + of course the high/low setting
and I think I remember there is even a pull setting for it in the GRF
somewhere - but my memory might be fuzzy here.
Heiko
next prev parent reply other threads:[~2018-05-24 8:35 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-18 3:32 [PATCH v2 0/5] Add sdmmc UHS support to ROC-RK3328-CC board djw
2018-05-18 3:32 ` djw
2018-05-18 3:32 ` djw at t-chip.com.cn
2018-05-18 3:52 ` [PATCH v2 1/5] gpio: syscon: allow fetching syscon from parent node djw
2018-05-18 3:52 ` [PATCH v2 2/5] gpio: syscon: Add gpio-syscon for rockchip djw
2018-05-18 3:52 ` djw at t-chip.com.cn
2018-05-22 18:02 ` Rob Herring
2018-05-22 18:02 ` Rob Herring
2018-05-23 2:02 ` Levin Du
2018-05-23 2:02 ` Levin Du
2018-05-23 14:43 ` Rob Herring
2018-05-23 14:43 ` Rob Herring
2018-05-23 15:12 ` Heiko Stübner
2018-05-23 15:12 ` Heiko Stübner
2018-05-23 19:53 ` Rob Herring
2018-05-23 19:53 ` Rob Herring
2018-05-24 1:59 ` Levin Du
2018-05-24 1:59 ` Levin Du
2018-05-24 12:18 ` Heiko Stuebner
2018-05-24 12:18 ` Heiko Stuebner
2018-05-28 3:34 ` Levin
2018-05-28 3:34 ` Levin
2018-05-24 12:07 ` Heiko Stuebner
2018-05-24 12:07 ` Heiko Stuebner
2018-05-24 13:38 ` Rob Herring
2018-05-24 13:38 ` Rob Herring
2018-05-24 8:28 ` Linus Walleij
2018-05-24 8:28 ` Linus Walleij
2018-05-24 8:35 ` Heiko Stübner [this message]
2018-05-24 8:35 ` Heiko Stübner
2018-05-24 8:47 ` Linus Walleij
2018-05-24 8:47 ` Linus Walleij
2018-05-24 8:47 ` Linus Walleij
2018-05-18 3:52 ` [PATCH v2 3/5] arm64: dts: rockchip: Add gpio-mute to rk3328 djw
2018-05-18 3:52 ` djw at t-chip.com.cn
2018-05-18 3:52 ` [PATCH v2 4/5] arm64: dts: rockchip: Add io-domain to roc-rk3328-cc djw
2018-05-18 3:52 ` djw at t-chip.com.cn
2018-05-18 3:52 ` [PATCH v2 5/5] arm64: dts: rockchip: Add sdmmc UHS support for roc-rk3328-cc djw
2018-05-18 3:52 ` djw at t-chip.com.cn
2018-05-23 8:08 ` [PATCH v2 1/5] gpio: syscon: allow fetching syscon from parent node Linus Walleij
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=2044895.BqI5yRtle6@diego \
--to=heiko@sntech.de \
--cc=devicetree@vger.kernel.org \
--cc=djw@t-chip.com.cn \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=robh@kernel.org \
--cc=zxf@t-chip.com.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.