SPI pins of the SPICC Controller in Meson-GX needs to be controlled by
pin biais when idle. Therefore define three pinctrl names:
- default: SPI pins are controlled by spi function.
- idle-high: SCLK pin is pulled-up, but MOSI/MISO are still controlled
by spi function.
- idle-low: SCLK pin is pulled-down, but MOSI/MISO are still controlled
by spi function.
Reported-by: Da Xue <[email protected]>
Signed-off-by: Neil Armstrong <[email protected]>
Signed-off-by: Amjad Ouled-Ameur <[email protected]>
---
.../devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
index 0c10f7678178..53013e27f507 100644
--- a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
+++ b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
@@ -43,6 +43,14 @@ properties:
minItems: 1
maxItems: 2
+ pinctrl-0:
+ minItems: 1
+
+ pinctrl-1:
+ maxItems: 1
+
+ pinctrl-names: true
+
if:
properties:
compatible:
@@ -69,6 +77,13 @@ else:
items:
- const: core
+ pinctrl-names:
+ minItems: 1
+ items:
+ - const: default
+ - const: idle-high
+ - const: idle-low
+
required:
- compatible
- reg
--
b4 0.10.1
On 04/10/2022 13:10, Amjad Ouled-Ameur wrote:
> SPI pins of the SPICC Controller in Meson-GX needs to be controlled by
> pin biais when idle. Therefore define three pinctrl names:
> - default: SPI pins are controlled by spi function.
> - idle-high: SCLK pin is pulled-up, but MOSI/MISO are still controlled
> by spi function.
> - idle-low: SCLK pin is pulled-down, but MOSI/MISO are still controlled
> by spi function.
>
> Reported-by: Da Xue <[email protected]>
> Signed-off-by: Neil Armstrong <[email protected]>
> Signed-off-by: Amjad Ouled-Ameur <[email protected]>
> ---
> .../devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
> index 0c10f7678178..53013e27f507 100644
> --- a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
> +++ b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
> @@ -43,6 +43,14 @@ properties:
> minItems: 1
> maxItems: 2
>
> + pinctrl-0:
> + minItems: 1
maxItems?
> +
> + pinctrl-1:
> + maxItems: 1
> +
> + pinctrl-names: true
Why do you need all these in the bindings?
> +
> if:
> properties:
> compatible:
> @@ -69,6 +77,13 @@ else:
> items:
> - const: core
>
> + pinctrl-names:
> + minItems: 1
> + items:
> + - const: default
> + - const: idle-high
> + - const: idle-low
This does not match what you wrote in the bindings - you mentioned only
two set of pin controls.
Best regards,
Krzysztof
Hi Krzysztof,
Thank you for the review.
On 10/5/22 10:14, Krzysztof Kozlowski wrote:
> On 04/10/2022 13:10, Amjad Ouled-Ameur wrote:
>> SPI pins of the SPICC Controller in Meson-GX needs to be controlled by
>> pin biais when idle. Therefore define three pinctrl names:
>> - default: SPI pins are controlled by spi function.
>> - idle-high: SCLK pin is pulled-up, but MOSI/MISO are still controlled
>> by spi function.
>> - idle-low: SCLK pin is pulled-down, but MOSI/MISO are still controlled
>> by spi function.
>>
>> Reported-by: Da Xue <[email protected]>
>> Signed-off-by: Neil Armstrong <[email protected]>
>> Signed-off-by: Amjad Ouled-Ameur <[email protected]>
>> ---
>> .../devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>> index 0c10f7678178..53013e27f507 100644
>> --- a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>> +++ b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>> @@ -43,6 +43,14 @@ properties:
>> minItems: 1
>> maxItems: 2
>>
>> + pinctrl-0:
>> + minItems: 1
> maxItems?
>
Will fill it in next version.
>> +
>> + pinctrl-1:
>> + maxItems: 1
>> +
>> + pinctrl-names: true
> Why do you need all these in the bindings?
SPI clock bias needs to change at runtime depending on SPI mode, here is an example of
how this is supposed to be used ("spi_idle_low_pins" and "spi_idle_low_pins" are defined
in the second patch of this series):
&spicc {
pinctrl-0 = <&spi_pins>;
pinctrl-1 = <&spi_pins>, <&spi_idle_high_pins>;
pinctrl-2 = <&spi_pins>, <&spi_idle_low_pins>;
pinctrl-names = "default", "idle-high", "idle-low";
[...]
};
>> +
>> if:
>> properties:
>> compatible:
>> @@ -69,6 +77,13 @@ else:
>> items:
>> - const: core
>>
>> + pinctrl-names:
>> + minItems: 1
>> + items:
>> + - const: default
>> + - const: idle-high
>> + - const: idle-low
> This does not match what you wrote in the bindings - you mentioned only
> two set of pin controls.
Right, there are actually three set of pin controls, will correct the bindings above.
Regards,
Amjad
>
> Best regards,
> Krzysztof
>
On 06/10/2022 12:57, Amjad Ouled-Ameur wrote:
> Hi Krzysztof,
>
> Thank you for the review.
>
> On 10/5/22 10:14, Krzysztof Kozlowski wrote:
>> On 04/10/2022 13:10, Amjad Ouled-Ameur wrote:
>>> SPI pins of the SPICC Controller in Meson-GX needs to be controlled by
>>> pin biais when idle. Therefore define three pinctrl names:
>>> - default: SPI pins are controlled by spi function.
>>> - idle-high: SCLK pin is pulled-up, but MOSI/MISO are still controlled
>>> by spi function.
>>> - idle-low: SCLK pin is pulled-down, but MOSI/MISO are still controlled
>>> by spi function.
>>>
>>> Reported-by: Da Xue <[email protected]>
>>> Signed-off-by: Neil Armstrong <[email protected]>
>>> Signed-off-by: Amjad Ouled-Ameur <[email protected]>
>>> ---
>>> .../devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml | 15 +++++++++++++++
>>> 1 file changed, 15 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>> index 0c10f7678178..53013e27f507 100644
>>> --- a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>> +++ b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>> @@ -43,6 +43,14 @@ properties:
>>> minItems: 1
>>> maxItems: 2
>>>
>>> + pinctrl-0:
>>> + minItems: 1
>> maxItems?
>>
> Will fill it in next version.
>>> +
>>> + pinctrl-1:
>>> + maxItems: 1
>>> +
>>> + pinctrl-names: true
>> Why do you need all these in the bindings?
>
> SPI clock bias needs to change at runtime depending on SPI mode, here is an example of
>
> how this is supposed to be used ("spi_idle_low_pins" and "spi_idle_low_pins" are defined
>
> in the second patch of this series):
I know what it the point in general of pinctrl configuration... But the
question is why do you need to specify them in the bindings? Core
handles that. IOW, do you require them and missing/incomplete pinctrl
should be reported?
Best regards,
Krzysztof
On 06/10/2022 16:11, Krzysztof Kozlowski wrote:
> On 06/10/2022 12:57, Amjad Ouled-Ameur wrote:
>> Hi Krzysztof,
>>
>> Thank you for the review.
>>
>> On 10/5/22 10:14, Krzysztof Kozlowski wrote:
>>> On 04/10/2022 13:10, Amjad Ouled-Ameur wrote:
>>>> SPI pins of the SPICC Controller in Meson-GX needs to be controlled by
>>>> pin biais when idle. Therefore define three pinctrl names:
>>>> - default: SPI pins are controlled by spi function.
>>>> - idle-high: SCLK pin is pulled-up, but MOSI/MISO are still controlled
>>>> by spi function.
>>>> - idle-low: SCLK pin is pulled-down, but MOSI/MISO are still controlled
>>>> by spi function.
>>>>
>>>> Reported-by: Da Xue <[email protected]>
>>>> Signed-off-by: Neil Armstrong <[email protected]>
>>>> Signed-off-by: Amjad Ouled-Ameur <[email protected]>
>>>> ---
>>>> .../devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml | 15 +++++++++++++++
>>>> 1 file changed, 15 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>>> index 0c10f7678178..53013e27f507 100644
>>>> --- a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>>> +++ b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>>> @@ -43,6 +43,14 @@ properties:
>>>> minItems: 1
>>>> maxItems: 2
>>>>
>>>> + pinctrl-0:
>>>> + minItems: 1
>>> maxItems?
>>>
>> Will fill it in next version.
>>>> +
>>>> + pinctrl-1:
>>>> + maxItems: 1
>>>> +
>>>> + pinctrl-names: true
>>> Why do you need all these in the bindings?
>>
>> SPI clock bias needs to change at runtime depending on SPI mode, here is an example of
>>
>> how this is supposed to be used ("spi_idle_low_pins" and "spi_idle_low_pins" are defined
>>
>> in the second patch of this series):
>
> I know what it the point in general of pinctrl configuration... But the
> question is why do you need to specify them in the bindings? Core
> handles that. IOW, do you require them and missing/incomplete pinctrl
> should be reported?
Looking at other bindings, when specific pinctrl state names were requires, they were
documented.
There's some bindings with pinctrl-names for specific states like rockchip/rockchip,dw-hdmi.yaml,
mediatek/mediatek,dpi.yaml, mmc/mtk-sd.yaml or mmc/fsl-imx-esdhc.yaml
Neil
>
> Best regards,
> Krzysztof
>
On 06/10/2022 17:48, Neil Armstrong wrote:
> On 06/10/2022 16:11, Krzysztof Kozlowski wrote:
>> On 06/10/2022 12:57, Amjad Ouled-Ameur wrote:
>>> Hi Krzysztof,
>>>
>>> Thank you for the review.
>>>
>>> On 10/5/22 10:14, Krzysztof Kozlowski wrote:
>>>> On 04/10/2022 13:10, Amjad Ouled-Ameur wrote:
>>>>> SPI pins of the SPICC Controller in Meson-GX needs to be controlled by
>>>>> pin biais when idle. Therefore define three pinctrl names:
>>>>> - default: SPI pins are controlled by spi function.
>>>>> - idle-high: SCLK pin is pulled-up, but MOSI/MISO are still controlled
>>>>> by spi function.
>>>>> - idle-low: SCLK pin is pulled-down, but MOSI/MISO are still controlled
>>>>> by spi function.
>>>>>
>>>>> Reported-by: Da Xue <[email protected]>
>>>>> Signed-off-by: Neil Armstrong <[email protected]>
>>>>> Signed-off-by: Amjad Ouled-Ameur <[email protected]>
>>>>> ---
>>>>> .../devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml | 15 +++++++++++++++
>>>>> 1 file changed, 15 insertions(+)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>>>> index 0c10f7678178..53013e27f507 100644
>>>>> --- a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>>>> +++ b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>>>> @@ -43,6 +43,14 @@ properties:
>>>>> minItems: 1
>>>>> maxItems: 2
>>>>>
>>>>> + pinctrl-0:
>>>>> + minItems: 1
>>>> maxItems?
>>>>
>>> Will fill it in next version.
>>>>> +
>>>>> + pinctrl-1:
>>>>> + maxItems: 1
>>>>> +
>>>>> + pinctrl-names: true
>>>> Why do you need all these in the bindings?
>>>
>>> SPI clock bias needs to change at runtime depending on SPI mode, here is an example of
>>>
>>> how this is supposed to be used ("spi_idle_low_pins" and "spi_idle_low_pins" are defined
>>>
>>> in the second patch of this series):
>>
>> I know what it the point in general of pinctrl configuration... But the
>> question is why do you need to specify them in the bindings? Core
>> handles that. IOW, do you require them and missing/incomplete pinctrl
>> should be reported?
>
> Looking at other bindings, when specific pinctrl state names were requires, they were
> documented.
Yes, the required and/or necessary entries were added to few other
bindings. Since Amjad did not make them required, why adding them? So I
repeat the question for the third time - why do you need to add them to
the bindings?
> There's some bindings with pinctrl-names for specific states like rockchip/rockchip,dw-hdmi.yaml,
> mediatek/mediatek,dpi.yaml, mmc/mtk-sd.yaml or mmc/fsl-imx-esdhc.yaml
And? Just because someone did something is not itself an argument. They
might have their reasons. If their reasons are applicable here, please
state them.
Best regards,
Krzysztof
Hi,
On 07/10/2022 09:04, Krzysztof Kozlowski wrote:
> On 06/10/2022 17:48, Neil Armstrong wrote:
>> On 06/10/2022 16:11, Krzysztof Kozlowski wrote:
>>> On 06/10/2022 12:57, Amjad Ouled-Ameur wrote:
>>>> Hi Krzysztof,
>>>>
>>>> Thank you for the review.
>>>>
>>>> On 10/5/22 10:14, Krzysztof Kozlowski wrote:
>>>>> On 04/10/2022 13:10, Amjad Ouled-Ameur wrote:
>>>>>> SPI pins of the SPICC Controller in Meson-GX needs to be controlled by
>>>>>> pin biais when idle. Therefore define three pinctrl names:
>>>>>> - default: SPI pins are controlled by spi function.
>>>>>> - idle-high: SCLK pin is pulled-up, but MOSI/MISO are still controlled
>>>>>> by spi function.
>>>>>> - idle-low: SCLK pin is pulled-down, but MOSI/MISO are still controlled
>>>>>> by spi function.
>>>>>>
>>>>>> Reported-by: Da Xue <[email protected]>
>>>>>> Signed-off-by: Neil Armstrong <[email protected]>
>>>>>> Signed-off-by: Amjad Ouled-Ameur <[email protected]>
>>>>>> ---
>>>>>> .../devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml | 15 +++++++++++++++
>>>>>> 1 file changed, 15 insertions(+)
>>>>>>
>>>>>> diff --git a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>>>>> index 0c10f7678178..53013e27f507 100644
>>>>>> --- a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>>>>> +++ b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>>>>> @@ -43,6 +43,14 @@ properties:
>>>>>> minItems: 1
>>>>>> maxItems: 2
>>>>>>
>>>>>> + pinctrl-0:
>>>>>> + minItems: 1
>>>>> maxItems?
>>>>>
>>>> Will fill it in next version.
>>>>>> +
>>>>>> + pinctrl-1:
>>>>>> + maxItems: 1
>>>>>> +
>>>>>> + pinctrl-names: true
>>>>> Why do you need all these in the bindings?
>>>>
>>>> SPI clock bias needs to change at runtime depending on SPI mode, here is an example of
>>>>
>>>> how this is supposed to be used ("spi_idle_low_pins" and "spi_idle_low_pins" are defined
>>>>
>>>> in the second patch of this series):
>>>
>>> I know what it the point in general of pinctrl configuration... But the
>>> question is why do you need to specify them in the bindings? Core
>>> handles that. IOW, do you require them and missing/incomplete pinctrl
>>> should be reported?
>>
>> Looking at other bindings, when specific pinctrl state names were requires, they were
>> documented.
>
> Yes, the required and/or necessary entries were added to few other
> bindings. Since Amjad did not make them required, why adding them? So I
> repeat the question for the third time - why do you need to add them to
> the bindings?
>
>> There's some bindings with pinctrl-names for specific states like rockchip/rockchip,dw-hdmi.yaml,
>> mediatek/mediatek,dpi.yaml, mmc/mtk-sd.yaml or mmc/fsl-imx-esdhc.yaml
>
> And? Just because someone did something is not itself an argument. They
> might have their reasons. If their reasons are applicable here, please
> state them.
OK, I thought the reason was explicit, we find it worth documenting
those optional pinctrl states for when the spi lines are in idle state.
If it's not an enough good reason, we'll drop this patch.
>
> Best regards,
> Krzysztof
>
Thanks,
Neil
On 07/10/2022 09:45, [email protected] wrote:
> Hi,
>
> On 07/10/2022 09:04, Krzysztof Kozlowski wrote:
>> On 06/10/2022 17:48, Neil Armstrong wrote:
>>> On 06/10/2022 16:11, Krzysztof Kozlowski wrote:
>>>> On 06/10/2022 12:57, Amjad Ouled-Ameur wrote:
>>>>> Hi Krzysztof,
>>>>>
>>>>> Thank you for the review.
>>>>>
>>>>> On 10/5/22 10:14, Krzysztof Kozlowski wrote:
>>>>>> On 04/10/2022 13:10, Amjad Ouled-Ameur wrote:
>>>>>>> SPI pins of the SPICC Controller in Meson-GX needs to be controlled by
>>>>>>> pin biais when idle. Therefore define three pinctrl names:
>>>>>>> - default: SPI pins are controlled by spi function.
>>>>>>> - idle-high: SCLK pin is pulled-up, but MOSI/MISO are still controlled
>>>>>>> by spi function.
>>>>>>> - idle-low: SCLK pin is pulled-down, but MOSI/MISO are still controlled
>>>>>>> by spi function.
>>>>>>>
>>>>>>> Reported-by: Da Xue <[email protected]>
>>>>>>> Signed-off-by: Neil Armstrong <[email protected]>
>>>>>>> Signed-off-by: Amjad Ouled-Ameur <[email protected]>
>>>>>>> ---
>>>>>>> .../devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml | 15 +++++++++++++++
>>>>>>> 1 file changed, 15 insertions(+)
>>>>>>>
>>>>>>> diff --git a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>>>>>> index 0c10f7678178..53013e27f507 100644
>>>>>>> --- a/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>>>>>> +++ b/Documentation/devicetree/bindings/spi/amlogic,meson-gx-spicc.yaml
>>>>>>> @@ -43,6 +43,14 @@ properties:
>>>>>>> minItems: 1
>>>>>>> maxItems: 2
>>>>>>>
>>>>>>> + pinctrl-0:
>>>>>>> + minItems: 1
>>>>>> maxItems?
>>>>>>
>>>>> Will fill it in next version.
>>>>>>> +
>>>>>>> + pinctrl-1:
>>>>>>> + maxItems: 1
>>>>>>> +
>>>>>>> + pinctrl-names: true
>>>>>> Why do you need all these in the bindings?
>>>>>
>>>>> SPI clock bias needs to change at runtime depending on SPI mode, here is an example of
>>>>>
>>>>> how this is supposed to be used ("spi_idle_low_pins" and "spi_idle_low_pins" are defined
>>>>>
>>>>> in the second patch of this series):
>>>>
>>>> I know what it the point in general of pinctrl configuration... But the
>>>> question is why do you need to specify them in the bindings? Core
>>>> handles that. IOW, do you require them and missing/incomplete pinctrl
>>>> should be reported?
>>>
>>> Looking at other bindings, when specific pinctrl state names were requires, they were
>>> documented.
>>
>> Yes, the required and/or necessary entries were added to few other
>> bindings. Since Amjad did not make them required, why adding them? So I
>> repeat the question for the third time - why do you need to add them to
>> the bindings?
>>
>>> There's some bindings with pinctrl-names for specific states like rockchip/rockchip,dw-hdmi.yaml,
>>> mediatek/mediatek,dpi.yaml, mmc/mtk-sd.yaml or mmc/fsl-imx-esdhc.yaml
>>
>> And? Just because someone did something is not itself an argument. They
>> might have their reasons. If their reasons are applicable here, please
>> state them.
>
> OK, I thought the reason was explicit, we find it worth documenting
> those optional pinctrl states for when the spi lines are in idle state.
>
> If it's not an enough good reason, we'll drop this patch.
No one wrote here any reason... The post from Amjad was about DTS usage,
yours about other bindings. Neither of them are reasons.
Core schema already documents pinctrl states. This can be documented if
it is different than what core checks for, e.g. required or some
specific names are being enforced.
Best regards,
Krzysztof
On 07/10/2022 10:17, Krzysztof Kozlowski wrote:
>>>
>>>> There's some bindings with pinctrl-names for specific states like rockchip/rockchip,dw-hdmi.yaml,
>>>> mediatek/mediatek,dpi.yaml, mmc/mtk-sd.yaml or mmc/fsl-imx-esdhc.yaml
>>>
>>> And? Just because someone did something is not itself an argument. They
>>> might have their reasons. If their reasons are applicable here, please
>>> state them.
>>
>> OK, I thought the reason was explicit, we find it worth documenting
>> those optional pinctrl states for when the spi lines are in idle state.
>>
>> If it's not an enough good reason, we'll drop this patch.
>
> No one wrote here any reason... The post from Amjad was about DTS usage,
> yours about other bindings. Neither of them are reasons.
>
> Core schema already documents pinctrl states. This can be documented if
> it is different than what core checks for, e.g. required or some
> specific names are being enforced.
Looking at your driver, these seems required. I missed that part in
commit msg, because it actually explains these are needed. Then it seems
fine, but they should be made required in the bindings.
Best regards,
Krzysztof