From: Jacky Huang <ychuang570808@gmail.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
linus.walleij@linaro.org, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
p.zabel@pengutronix.de, j.neuschaefer@gmx.net
Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
ychuang3@nuvoton.com, schung@nuvoton.com
Subject: Re: [PATCH v2 3/4] arm64: dts: nuvoton: Add pinctrl support for ma35d1
Date: Wed, 29 Nov 2023 18:14:07 +0800 [thread overview]
Message-ID: <6d511cc4-f22c-4c8f-a1ea-a8d99be95157@gmail.com> (raw)
In-Reply-To: <9ec2dd42-5173-40df-8e6b-9c09f2d77f67@linaro.org>
Dear Krzysztof,
On 2023/11/29 下午 06:02, Krzysztof Kozlowski wrote:
> On 29/11/2023 10:41, Jacky Huang wrote:
>> Dear Krzysztof,
>>
>>
>> On 2023/11/29 下午 04:11, Krzysztof Kozlowski wrote:
>>> On 29/11/2023 04:35, Jacky Huang wrote:
>>>>>>> Best regards,
>>>>>>> Krzysztof
>>>>>>>
>>>>>> Yes, it did pass the 'dtbs_check'. I guess the tool does not detect such
>>>>>> issues.
>>>>>> Anyway, I will fix it in the next version.
>>>>> Hm, I see your bindings indeed allow pin-.* and unit addresses, so it is
>>>>> the binding issue.
>>>>>
>>>>> The examples you used as reference - xlnx,zynqmp-pinctrl.yaml and
>>>>> realtek,rtd1315e-pinctrl.yaml - do not mix these as you do.
>>>>>
>>>>> I don't understand why do you need them yet. I don't see any populate of
>>>>> children. There are no compatibles, either.
>>>>>
>>>>> Which part of your driver uses them exactly?
>>>>>
>>>>> Best regards,
>>>>> Krzysztof
>>>>>
>>>> I will move the 'pcfg_default: pin-default' from dtsi to dts, like this:
>>>>
>>>> &pinctrl {
>>>> pcfg_default: pin-default {
>>>> slew-rate = <0>;
>>>> input-schmitt-disable;
>>>> bias-disable;
>>>> power-source = <1>;
>>>> drive-strength = <17100>;
>>>> };
>>> This solves nothing. It's the same placement.
>>>
>>>
>>> Best regards,
>>> Krzysztof
>>>
>> OK, it stil be the binding issues.
>> For "^pin-[a-z0-9]+$", I reference to the "pcfg-[a-z0-9-]+$" of
>> rockchip,pinctrl.yaml.
>>
>> My intention is to describe a generic pin configuration, aiming to make
>> the pin
>> description more concise. In actual testing, it proves to be effective.
> Can you instead respond to my actual questions?
>
> Best regards,
> Krzysztof
>
The the last one item of nuvoton,pins is a phandle, which can refer to
'&pin-default'. The following code of driver pinctrl-ma35.c parse
"nuvoton,pins", including the node reference by phandle. list =
of_get_property(np, "nuvoton,pins", &size); size /= sizeof(*list); if
(!size || size % 4) { dev_err(npctl->dev, "wrong setting!\n"); return
-EINVAL; } grp->npins = size / 4; grp->pins = devm_kzalloc(npctl->dev,
grp->npins * sizeof(*grp->pins), GFP_KERNEL); if (!grp->pins) return
-ENOMEM; pin = grp->settings = devm_kzalloc(npctl->dev, grp->npins *
sizeof(*grp->settings), GFP_KERNEL); if (!grp->settings) return -ENOMEM;
for (i = 0, j = 0; i < size; i += 4, j++) { struct device_node
*np_config; const __be32 *phandle; pin->offset = be32_to_cpu(*list++) *
MA35_MFP_REG_SZ_PER_BANK + MA35_MFP_REG_BASE; pin->shift =
(be32_to_cpu(*list++) * MA35_MFP_BITS_PER_PORT) % 32; pin->muxval =
be32_to_cpu(*list++); phandle = list++; if (!phandle) return -EINVAL;
np_config = of_find_node_by_phandle(be32_to_cpup(phandle)); ret =
pinconf_generic_parse_dt_config(np_config, NULL, &pin->configs,
&pin->nconfigs); if (ret) return ret; grp->pins[j] =
npctl->info->get_pin_num(pin->offset, pin->shift); pin++; } Best
Regards, Jacky Huang
next prev parent reply other threads:[~2023-11-29 10:14 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-28 6:11 [PATCH v2 0/4] Add support for nuvoton ma35d1 pin control Jacky Huang
2023-11-28 6:11 ` [PATCH v2 1/4] dt-bindings: reset: Add syscon to nuvoton ma35d1 system-management node Jacky Huang
2023-11-28 7:32 ` Krzysztof Kozlowski
2023-11-29 10:28 ` Philipp Zabel
2023-11-28 6:11 ` [PATCH v2 2/4] dt-bindings: pinctrl: Document nuvoton ma35d1 pin control Jacky Huang
2023-11-28 7:23 ` Rob Herring
2023-11-28 7:34 ` Krzysztof Kozlowski
2023-11-28 8:29 ` Jacky Huang
2023-11-28 8:33 ` Krzysztof Kozlowski
2023-11-28 9:32 ` Jacky Huang
2023-11-28 9:35 ` Krzysztof Kozlowski
2023-11-28 11:00 ` Jacky Huang
2023-11-28 6:11 ` [PATCH v2 3/4] arm64: dts: nuvoton: Add pinctrl support for ma35d1 Jacky Huang
2023-11-28 7:35 ` Krzysztof Kozlowski
2023-11-28 8:37 ` Jacky Huang
2023-11-28 9:34 ` Krzysztof Kozlowski
2023-11-28 10:45 ` Jacky Huang
2023-11-28 11:06 ` Krzysztof Kozlowski
2023-11-29 3:35 ` Jacky Huang
2023-11-29 8:11 ` Krzysztof Kozlowski
2023-11-29 9:41 ` Jacky Huang
2023-11-29 10:02 ` Krzysztof Kozlowski
2023-11-29 10:14 ` Jacky Huang [this message]
2023-11-29 10:54 ` Krzysztof Kozlowski
2023-11-30 1:10 ` Jacky Huang
2023-11-30 8:04 ` Krzysztof Kozlowski
2023-11-30 8:23 ` Jacky Huang
2023-11-28 11:03 ` Krzysztof Kozlowski
2023-11-28 11:05 ` Jacky Huang
2023-11-29 1:43 ` Jacky Huang
2023-11-28 11:04 ` Krzysztof Kozlowski
2023-11-29 1:11 ` kernel test robot
2023-11-29 1:11 ` kernel test robot
2023-11-28 6:11 ` [PATCH v2 4/4] pinctrl: nuvoton: Add ma35d1 pinctrl and GPIO driver Jacky Huang
2023-11-28 10:14 ` Linus Walleij
2023-11-29 4:18 ` Jacky Huang
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=6d511cc4-f22c-4c8f-a1ea-a8d99be95157@gmail.com \
--to=ychuang570808@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=j.neuschaefer@gmx.net \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--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=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=schung@nuvoton.com \
--cc=ychuang3@nuvoton.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 NNTP newsgroup(s).