From: Krzysztof Kozlowski <krzk@kernel.org>
To: Conor Dooley <conor@kernel.org>, Bough Chen <haibo.chen@nxp.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Rob Herring <robh@kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"'devicetree@vger.kernel.org'" <devicetree@vger.kernel.org>,
"imx@lists.linux.dev" <imx@lists.linux.dev>,
Aisheng Dong <aisheng.dong@nxp.com>, Frank Li <frank.li@nxp.com>,
Shenwei Wang <shenwei.wang@nxp.com>
Subject: Re: Question about gpio-hog
Date: Thu, 18 Jul 2024 17:13:22 +0200 [thread overview]
Message-ID: <b61742b9-0767-4e28-8b26-dfeb240726c7@kernel.org> (raw)
In-Reply-To: <20240718-smudge-splashy-6e8addc80c02@spud>
On 18/07/2024 16:47, Conor Dooley wrote:
> On Thu, Jul 18, 2024 at 03:40:49AM +0000, Bough Chen wrote:
>> Hi All,
>>
>> I have a question of ‘gpio-hog’, the property gpio-hog seems to be used in GPIO node rather than in users device node, so we can’t use the device-link feature.
>> (sorry for resend, I use text/plain messages this time)
>>
>> e.g.
>>
>> pcal6524: gpio@22 {
>> …
>> /* usdhc3 and QSPI share the same pin, here select SD3 pins */
>> usdhc3-qspi-sel-hog {
>> gpio-hog;
>> gpios = <16 GPIO_ACTIVE_HIGH>;
>> output-high;
>> };
>> …
>> };
>>
>> &usdhc3 {
>> …
>> }
>>
>> The board share the pins of usdhc3 and QSPI, a MUX use one GPIO pad from one I2C GPIO expander to control the selection.
>> So before usdhc3 probe, need to make sure the gpio-hog is configed. Which means usdhc3 need to depend on usdhc3-qspi-sel-hog.
>>
>> To achieve that, I can add a fake GPIO properties like below:
>> &usdhc3{
>> …
>> hog-gpio = <&pcal6524 16 GPIO_ACTIVE_HIGH>;
>> }
>>
>> Usdhc driver do not handle the hog-gpio, just use this fake hog-gpio to let the usdhc3 depends on pcal6524 IO expander. Make sure when usdhc driver probe, already select the usdhc3 pads on board.
>>
>> But this will trigger the DT check warning if related device binding has ““additionalProperties: false” or “unevaluatedProperties: false”.
>>
>> Can this be acceptable? Any thoughts for this case? I think this might be common user case for gpio-hog.
>
> I've got no idea what this device you're talking about is - but it seems
> to me like the "hog-gpio" property is what you should be doing (although
> probably called something like "enable-gpios" instead.
> What you would do is send a patch for the dt-binding for this device,
> adding a property, in which case the *Properties: false will stop
> warning.
If there is device dependency on the hog, I would say by definition of a
hog that's not a hog. Hogs are for controller to initialize, but here
your device driver needs it. This sounds like simple pin configuration
for device.
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-07-18 15:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-18 3:40 Question about gpio-hog Bough Chen
2024-07-18 14:47 ` Conor Dooley
2024-07-18 15:13 ` Krzysztof Kozlowski [this message]
2024-07-18 19:53 ` Frank Li
2024-07-26 9:32 ` Bough Chen
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=b61742b9-0767-4e28-8b26-dfeb240726c7@kernel.org \
--to=krzk@kernel.org \
--cc=aisheng.dong@nxp.com \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frank.li@nxp.com \
--cc=haibo.chen@nxp.com \
--cc=imx@lists.linux.dev \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=robh@kernel.org \
--cc=shenwei.wang@nxp.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