diff mbox series

[1/3] dt-bindings: power: Add power sequence for Amloigc WCN chips

Message ID 20240705-pwrseq-v1-1-31829b47fc72@amlogic.com (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series Add power sequence for Amlogic WCN chips | expand

Commit Message

Yang Li via B4 Relay July 5, 2024, 11:13 a.m. UTC
From: Yang Li <yang.li@amlogic.com>

Add binding document to introduce power sequence of
Amlogic WCN chips.

Signed-off-by: Yang Li <yang.li@amlogic.com>
---
 .../bindings/power/amlogic,w155s2-pwrseq.yaml      | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)

Comments

Bartosz Golaszewski July 5, 2024, 1:34 p.m. UTC | #1
On Fri, Jul 5, 2024 at 1:13 PM Yang Li via B4 Relay
<devnull+yang.li.amlogic.com@kernel.org> wrote:
>
> From: Yang Li <yang.li@amlogic.com>
>
> Add binding document to introduce power sequence of
> Amlogic WCN chips.
>

Hi! Thanks for the interest in this new subsystem.

> Signed-off-by: Yang Li <yang.li@amlogic.com>
> ---
>  .../bindings/power/amlogic,w155s2-pwrseq.yaml      | 62 ++++++++++++++++++++++
>  1 file changed, 62 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml b/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml
> new file mode 100644
> index 000000000000..f99a775fcf9b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml
> @@ -0,0 +1,62 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/amlogic,w155s2-pwrseq.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Amlogic power sequence for WCN chips
> +
> +maintainers:
> +  - Yang Li <yang.li@amlogic.com>
> +
> +description:
> +  The Amlogic WCN chip contains discrete modules for WLAN and Bluetooth. Power on
> +  Bluetooth and Wi-Fi respectively, including chip_en pull-up and bt_en pull-up,
> +  and generation of the 32.768KHz clock.
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: amlogic,w155s2-pwrseq
> +      - items:
> +          - enum:
> +              - amlogic,w265s1-pwrseq
> +              - amlogic,w265p1-pwrseq
> +              - amlogic,w265s2-pwrseq
> +          - const: amlogic,w155s2-pwrseq

The name is wrong. There's no such device as 'pwrseq'. There's most
likely some kind of a Power Management Unit and the compatible string
must reflect this.

> +
> +  clocks:
> +    maxItems: 1
> +    description: clock provided to the controller (32.768KHz)
> +
> +  clock-names:
> +    items:
> +      - const: ext_clock
> +
> +  amlogic,chip-enable-gpios:
> +    maxItems: 1
> +    description: gpio specifier used to enable chipset

Why not simply: chip-enable-gpios or even enable-gpios?

> +
> +  amlogic,bt-enable-gpios:
> +    maxItems: 1
> +    description: gpio specifier used to enable BT
> +

Same here: should be simply bt-enable-gpios.

Bart

> +required:
> +  - compatible
> +  - clocks
> +  - clock-names
> +  - amlogic,chip-enable-gpios
> +  - amlogic,bt-enable-gpios
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    wcn_pwrseq {
> +        compatible = "amlogic,w155s2-pwrseq";
> +        clocks = <&extclk>;
> +        clock-names = "ext_clock";
> +        amlogic,chip-enable-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
> +        amlogic,bt-enable-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
> +    };
>
> --
> 2.42.0
>
>
Krzysztof Kozlowski July 7, 2024, 12:59 p.m. UTC | #2
On 05/07/2024 13:13, Yang Li via B4 Relay wrote:
> From: Yang Li <yang.li@amlogic.com>
> 
> Add binding document to introduce power sequence of
> Amlogic WCN chips.
> 
> Signed-off-by: Yang Li <yang.li@amlogic.com>
> ---
>  .../bindings/power/amlogic,w155s2-pwrseq.yaml      | 62 ++++++++++++++++++++++
>  1 file changed, 62 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml b/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml
> new file mode 100644
> index 000000000000..f99a775fcf9b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml
> @@ -0,0 +1,62 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/amlogic,w155s2-pwrseq.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Amlogic power sequence for WCN chips
> +
> +maintainers:
> +  - Yang Li <yang.li@amlogic.com>
> +
> +description:
> +  The Amlogic WCN chip contains discrete modules for WLAN and Bluetooth. Power on
> +  Bluetooth and Wi-Fi respectively, including chip_en pull-up and bt_en pull-up,
> +  and generation of the 32.768KHz clock.
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: amlogic,w155s2-pwrseq
> +      - items:
> +          - enum:
> +              - amlogic,w265s1-pwrseq
> +              - amlogic,w265p1-pwrseq
> +              - amlogic,w265s2-pwrseq
> +          - const: amlogic,w155s2-pwrseq
> +
> +  clocks:
> +    maxItems: 1
> +    description: clock provided to the controller (32.768KHz)
> +
> +  clock-names:
> +    items:
> +      - const: ext_clock

Drop _clock... or actually drop entire clock-names, not much helpful.

> +
> +  amlogic,chip-enable-gpios:
> +    maxItems: 1
> +    description: gpio specifier used to enable chipset

For entire chipset? Then enable-gpios

> +
> +  amlogic,bt-enable-gpios:
> +    maxItems: 1
> +    description: gpio specifier used to enable BT

Follow existing bindings for Qualcomm as example.

> +
> +required:
> +  - compatible
> +  - clocks
> +  - clock-names
> +  - amlogic,chip-enable-gpios
> +  - amlogic,bt-enable-gpios
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    wcn_pwrseq {

No underscores in node names, generic node names.

There is no device as "pwrseq". I also do not get what "wcn" means here.



Best regards,
Krzysztof
Yang Li July 8, 2024, 6:04 a.m. UTC | #3
Dear Krzysztof

Thanks for your immediate recovery and careful guidance.

> On 05/07/2024 13:13, Yang Li via B4 Relay wrote:
>> From: Yang Li <yang.li@amlogic.com>
>>
>> Add binding document to introduce power sequence of
>> Amlogic WCN chips.
>>
>> Signed-off-by: Yang Li <yang.li@amlogic.com>
>> ---
>>   .../bindings/power/amlogic,w155s2-pwrseq.yaml      | 62 ++++++++++++++++++++++
>>   1 file changed, 62 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml b/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml
>> new file mode 100644
>> index 000000000000..f99a775fcf9b
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml
>> @@ -0,0 +1,62 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/power/amlogic,w155s2-pwrseq.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Amlogic power sequence for WCN chips
>> +
>> +maintainers:
>> +  - Yang Li <yang.li@amlogic.com>
>> +
>> +description:
>> +  The Amlogic WCN chip contains discrete modules for WLAN and Bluetooth. Power on
>> +  Bluetooth and Wi-Fi respectively, including chip_en pull-up and bt_en pull-up,
>> +  and generation of the 32.768KHz clock.
>> +
>> +properties:
>> +  compatible:
>> +    oneOf:
>> +      - const: amlogic,w155s2-pwrseq
>> +      - items:
>> +          - enum:
>> +              - amlogic,w265s1-pwrseq
>> +              - amlogic,w265p1-pwrseq
>> +              - amlogic,w265s2-pwrseq
>> +          - const: amlogic,w155s2-pwrseq
>> +
>> +  clocks:
>> +    maxItems: 1
>> +    description: clock provided to the controller (32.768KHz)
>> +
>> +  clock-names:
>> +    items:
>> +      - const: ext_clock
> Drop _clock... or actually drop entire clock-names, not much helpful.
Got it~ will do.
>
>> +
>> +  amlogic,chip-enable-gpios:
>> +    maxItems: 1
>> +    description: gpio specifier used to enable chipset
> For entire chipset? Then enable-gpios
Yes, I will change "amlogic,chip-enable-gpios" to "enable-gpio"
>> +
>> +  amlogic,bt-enable-gpios:
>> +    maxItems: 1
>> +    description: gpio specifier used to enable BT
> Follow existing bindings for Qualcomm as example.

Okay, I will change "amlogic,bt-enable-gpios"to "bt-enable-gpios" follow

Qualcomm's example.

>> +
>> +required:
>> +  - compatible
>> +  - clocks
>> +  - clock-names
>> +  - amlogic,chip-enable-gpios
>> +  - amlogic,bt-enable-gpios
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> +  - |
>> +    #include <dt-bindings/gpio/gpio.h>
>> +    wcn_pwrseq {
> No underscores in node names, generic node names.
>
> There is no device as "pwrseq". I also do not get what "wcn" means here.

Yes, I understand.

Can I change "wcn_pwrseq" to "pmu", and do I need to change the binding 
file name to "amlogic,w155s2-pmu"

> Best regards,
> Krzysztof
>
Krzysztof Kozlowski July 8, 2024, 6:11 a.m. UTC | #4
On 08/07/2024 08:04, Yang Li wrote:
>>> +
>>> +required:
>>> +  - compatible
>>> +  - clocks
>>> +  - clock-names
>>> +  - amlogic,chip-enable-gpios
>>> +  - amlogic,bt-enable-gpios
>>> +
>>> +additionalProperties: false
>>> +
>>> +examples:
>>> +  - |
>>> +    #include <dt-bindings/gpio/gpio.h>
>>> +    wcn_pwrseq {
>> No underscores in node names, generic node names.
>>
>> There is no device as "pwrseq". I also do not get what "wcn" means here.
> 
> Yes, I understand.
> 
> Can I change "wcn_pwrseq" to "pmu", and do I need to change the binding 

What is pmu for your device? What is this device in the first place you
are documenting? Where is the datasheet?

> file name to "amlogic,w155s2-pmu"

Yes, compatible should also match proper device.


Best regards,
Krzysztof
Yang Li July 8, 2024, 6:12 a.m. UTC | #5
Dear Bartosz

Thanks for your careful guidance and suggestions.

> On Fri, Jul 5, 2024 at 1:13 PM Yang Li via B4 Relay
> <devnull+yang.li.amlogic.com@kernel.org> wrote:
>> From: Yang Li <yang.li@amlogic.com>
>>
>> Add binding document to introduce power sequence of
>> Amlogic WCN chips.
>>
> Hi! Thanks for the interest in this new subsystem.
>
>> Signed-off-by: Yang Li <yang.li@amlogic.com>
>> ---
>>   .../bindings/power/amlogic,w155s2-pwrseq.yaml      | 62 ++++++++++++++++++++++
>>   1 file changed, 62 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml b/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml
>> new file mode 100644
>> index 000000000000..f99a775fcf9b
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml
>> @@ -0,0 +1,62 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/power/amlogic,w155s2-pwrseq.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Amlogic power sequence for WCN chips
>> +
>> +maintainers:
>> +  - Yang Li <yang.li@amlogic.com>
>> +
>> +description:
>> +  The Amlogic WCN chip contains discrete modules for WLAN and Bluetooth. Power on
>> +  Bluetooth and Wi-Fi respectively, including chip_en pull-up and bt_en pull-up,
>> +  and generation of the 32.768KHz clock.
>> +
>> +properties:
>> +  compatible:
>> +    oneOf:
>> +      - const: amlogic,w155s2-pwrseq
>> +      - items:
>> +          - enum:
>> +              - amlogic,w265s1-pwrseq
>> +              - amlogic,w265p1-pwrseq
>> +              - amlogic,w265s2-pwrseq
>> +          - const: amlogic,w155s2-pwrseq
> The name is wrong. There's no such device as 'pwrseq'. There's most
> likely some kind of a Power Management Unit and the compatible string
> must reflect this.

Yes, I got it!

I will change "pwrseq" to "pmu".

>> +
>> +  clocks:
>> +    maxItems: 1
>> +    description: clock provided to the controller (32.768KHz)
>> +
>> +  clock-names:
>> +    items:
>> +      - const: ext_clock
>> +
>> +  amlogic,chip-enable-gpios:
>> +    maxItems: 1
>> +    description: gpio specifier used to enable chipset
> Why not simply: chip-enable-gpios or even enable-gpios?
Well, I will do. "amlogic,chip-enable-gpios" => "enable-gpios"
>
>> +
>> +  amlogic,bt-enable-gpios:
>> +    maxItems: 1
>> +    description: gpio specifier used to enable BT
>> +
> Same here: should be simply bt-enable-gpios.
>
> Bart
Well, I well change "amlogic,bt-enable-gpios" to "bt-enable-gpios".
>> +required:
>> +  - compatible
>> +  - clocks
>> +  - clock-names
>> +  - amlogic,chip-enable-gpios
>> +  - amlogic,bt-enable-gpios
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> +  - |
>> +    #include <dt-bindings/gpio/gpio.h>
>> +    wcn_pwrseq {
>> +        compatible = "amlogic,w155s2-pwrseq";
>> +        clocks = <&extclk>;
>> +        clock-names = "ext_clock";
>> +        amlogic,chip-enable-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
>> +        amlogic,bt-enable-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
>> +    };
>>
>> --
>> 2.42.0
>>
>>
Yang Li July 8, 2024, 6:32 a.m. UTC | #6
在 2024/7/8 14:11, Krzysztof Kozlowski 写道:
> [ EXTERNAL EMAIL ]
>
> On 08/07/2024 08:04, Yang Li wrote:
>>>> +
>>>> +required:
>>>> +  - compatible
>>>> +  - clocks
>>>> +  - clock-names
>>>> +  - amlogic,chip-enable-gpios
>>>> +  - amlogic,bt-enable-gpios
>>>> +
>>>> +additionalProperties: false
>>>> +
>>>> +examples:
>>>> +  - |
>>>> +    #include <dt-bindings/gpio/gpio.h>
>>>> +    wcn_pwrseq {
>>> No underscores in node names, generic node names.
>>>
>>> There is no device as "pwrseq". I also do not get what "wcn" means here.
>> Yes, I understand.
>>
>> Can I change "wcn_pwrseq" to "pmu", and do I need to change the binding
> What is pmu for your device? What is this device in the first place you
> are documenting? Where is the datasheet?

^_^ Well, You are right, the "pmu" wasn't really fit in here.

I'd like to explain the current usage first, and could you please give 
me a suggestion?

This module(pwrseq) used to power on Bluetooth & Wi-Fi combo chip, both 
Bluetooth and

Wi-Fi driver need to control "chip-en-gpios" pins, so we introduced the 
power sequence module.

What should we call it in this case?

>> file name to "amlogic,w155s2-pmu"
> Yes, compatible should also match proper device.
>
>
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski July 8, 2024, 7:32 a.m. UTC | #7
On 08/07/2024 08:32, Yang Li wrote:
> 
> 在 2024/7/8 14:11, Krzysztof Kozlowski 写道:
>> [ EXTERNAL EMAIL ]
>>
>> On 08/07/2024 08:04, Yang Li wrote:
>>>>> +
>>>>> +required:
>>>>> +  - compatible
>>>>> +  - clocks
>>>>> +  - clock-names
>>>>> +  - amlogic,chip-enable-gpios
>>>>> +  - amlogic,bt-enable-gpios
>>>>> +
>>>>> +additionalProperties: false
>>>>> +
>>>>> +examples:
>>>>> +  - |
>>>>> +    #include <dt-bindings/gpio/gpio.h>
>>>>> +    wcn_pwrseq {
>>>> No underscores in node names, generic node names.
>>>>
>>>> There is no device as "pwrseq". I also do not get what "wcn" means here.
>>> Yes, I understand.
>>>
>>> Can I change "wcn_pwrseq" to "pmu", and do I need to change the binding
>> What is pmu for your device? What is this device in the first place you
>> are documenting? Where is the datasheet?
> 
> ^_^ Well, You are right, the "pmu" wasn't really fit in here.
> 
> I'd like to explain the current usage first, and could you please give 
> me a suggestion?
> 
> This module(pwrseq) used to power on Bluetooth & Wi-Fi combo chip, both 
> Bluetooth and
> 
> Wi-Fi driver need to control "chip-en-gpios" pins, so we introduced the 
> power sequence module.
> 
> What should we call it in this case?

Sorry, you describe driver, not a device.

That would be a no-go for entire binding. Please describe the hardware,
not what you want to achieve in Linux drivers.


Best regards,
Krzysztof
Yang Li July 8, 2024, 8:21 a.m. UTC | #8
On 2024/7/8 15:32, Krzysztof Kozlowski wrote:
> On 08/07/2024 08:32, Yang Li wrote:
>> 在 2024/7/8 14:11, Krzysztof Kozlowski wrote:
>>> On 08/07/2024 08:04, Yang Li wrote:
>>>>>> +
>>>>>> +required:
>>>>>> +  - compatible
>>>>>> +  - clocks
>>>>>> +  - clock-names
>>>>>> +  - amlogic,chip-enable-gpios
>>>>>> +  - amlogic,bt-enable-gpios
>>>>>> +
>>>>>> +additionalProperties: false
>>>>>> +
>>>>>> +examples:
>>>>>> +  - |
>>>>>> +    #include <dt-bindings/gpio/gpio.h>
>>>>>> +    wcn_pwrseq {
>>>>> No underscores in node names, generic node names.
>>>>>
>>>>> There is no device as "pwrseq". I also do not get what "wcn" means here.
>>>> Yes, I understand.
>>>>
>>>> Can I change "wcn_pwrseq" to "pmu", and do I need to change the binding
>>> What is pmu for your device? What is this device in the first place you
>>> are documenting? Where is the datasheet?
>> ^_^ Well, You are right, the "pmu" wasn't really fit in here.
>>
>> I'd like to explain the current usage first, and could you please give
>> me a suggestion?
>>
>> This module(pwrseq) used to power on Bluetooth & Wi-Fi combo chip, both
>> Bluetooth and
>>
>> Wi-Fi driver need to control "chip-en-gpios" pins, so we introduced the
>> power sequence module.
>>
>> What should we call it in this case?
> Sorry, you describe driver, not a device.
>
> That would be a no-go for entire binding. Please describe the hardware,
> not what you want to achieve in Linux drivers.
W155s2 is a Bluetooth and WiFi combination chip. Bluetooth requires the 
bt-en pin to be pulled up, the chip-en pin to be pulled up, and the 
32.768KHz clock. WiFi requires the chip-en pin to be pulled up, and the 
32.768KHz clock. It can be seen that Bluetooth and WiFi are coupled to 
the chip-en pin and the 32.768KHz clock. When Bluetooth and WiFi are 
working at the same time, no matter which one is turned off, it will 
affect the other device. Therefore, a pwrseq device is now abstracted to 
manage the chip-en pin, bt-en pin, and the 32.768KHz clock.

There is currently no matching device name for the pwrseq composite device.

Could you please give me some advice?

>
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski July 8, 2024, 9:10 a.m. UTC | #9
On 08/07/2024 10:21, Yang Li wrote:
> 
> On 2024/7/8 15:32, Krzysztof Kozlowski wrote:
>> On 08/07/2024 08:32, Yang Li wrote:
>>> 在 2024/7/8 14:11, Krzysztof Kozlowski wrote:
>>>> On 08/07/2024 08:04, Yang Li wrote:
>>>>>>> +
>>>>>>> +required:
>>>>>>> +  - compatible
>>>>>>> +  - clocks
>>>>>>> +  - clock-names
>>>>>>> +  - amlogic,chip-enable-gpios
>>>>>>> +  - amlogic,bt-enable-gpios
>>>>>>> +
>>>>>>> +additionalProperties: false
>>>>>>> +
>>>>>>> +examples:
>>>>>>> +  - |
>>>>>>> +    #include <dt-bindings/gpio/gpio.h>
>>>>>>> +    wcn_pwrseq {
>>>>>> No underscores in node names, generic node names.
>>>>>>
>>>>>> There is no device as "pwrseq". I also do not get what "wcn" means here.
>>>>> Yes, I understand.
>>>>>
>>>>> Can I change "wcn_pwrseq" to "pmu", and do I need to change the binding
>>>> What is pmu for your device? What is this device in the first place you
>>>> are documenting? Where is the datasheet?
>>> ^_^ Well, You are right, the "pmu" wasn't really fit in here.

So no datasheet? Then you are on your own.

>>>
>>> I'd like to explain the current usage first, and could you please give
>>> me a suggestion?
>>>
>>> This module(pwrseq) used to power on Bluetooth & Wi-Fi combo chip, both
>>> Bluetooth and
>>>
>>> Wi-Fi driver need to control "chip-en-gpios" pins, so we introduced the
>>> power sequence module.
>>>
>>> What should we call it in this case?
>> Sorry, you describe driver, not a device.
>>
>> That would be a no-go for entire binding. Please describe the hardware,
>> not what you want to achieve in Linux drivers.
> W155s2 is a Bluetooth and WiFi combination chip. Bluetooth requires the 

I asked about this device here.

You speak now about W155s2 but everywhere else you were using "WCN".
What is that WCN?

> bt-en pin to be pulled up, the chip-en pin to be pulled up, and the 
> 32.768KHz clock. WiFi requires the chip-en pin to be pulled up, and the 
> 32.768KHz clock. It can be seen that Bluetooth and WiFi are coupled to 
> the chip-en pin and the 32.768KHz clock. When Bluetooth and WiFi are 
> working at the same time, no matter which one is turned off, it will 
> affect the other device. Therefore, a pwrseq device is now abstracted to 

It is the first time you mention pwrseq device from above paragraph.
Nothing above describes pwrseq.

Stop describing your problem, we all know it exactly if you follow the
discussions about power sequencing. Instead describe this particular
device you add binding for. What is this pwrseq in hardware? How does it
look? Where is it located? What are its pins? What are its supplies?

> manage the chip-en pin, bt-en pin, and the 32.768KHz clock.

> 
> There is currently no matching device name for the pwrseq composite device.

? No clue what does this mean.
> 
> Could you please give me some advice?

Again, you do not describe the device for the binding but something
else. Something for your drivers, sorry. No.

If you disagree, respond accurately to all questions above, not to only
some of them...

Best regards,
Krzysztof
Bartosz Golaszewski July 8, 2024, 9:36 a.m. UTC | #10
On Mon, Jul 8, 2024 at 11:10 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 08/07/2024 10:21, Yang Li wrote:
> >
> > On 2024/7/8 15:32, Krzysztof Kozlowski wrote:
> >> On 08/07/2024 08:32, Yang Li wrote:
> >>> 在 2024/7/8 14:11, Krzysztof Kozlowski wrote:
> >>>> On 08/07/2024 08:04, Yang Li wrote:
> >>>>>>> +
> >>>>>>> +required:
> >>>>>>> +  - compatible
> >>>>>>> +  - clocks
> >>>>>>> +  - clock-names
> >>>>>>> +  - amlogic,chip-enable-gpios
> >>>>>>> +  - amlogic,bt-enable-gpios
> >>>>>>> +
> >>>>>>> +additionalProperties: false
> >>>>>>> +
> >>>>>>> +examples:
> >>>>>>> +  - |
> >>>>>>> +    #include <dt-bindings/gpio/gpio.h>
> >>>>>>> +    wcn_pwrseq {
> >>>>>> No underscores in node names, generic node names.
> >>>>>>
> >>>>>> There is no device as "pwrseq". I also do not get what "wcn" means here.
> >>>>> Yes, I understand.
> >>>>>
> >>>>> Can I change "wcn_pwrseq" to "pmu", and do I need to change the binding
> >>>> What is pmu for your device? What is this device in the first place you
> >>>> are documenting? Where is the datasheet?
> >>> ^_^ Well, You are right, the "pmu" wasn't really fit in here.
>
> So no datasheet? Then you are on your own.
>
> >>>
> >>> I'd like to explain the current usage first, and could you please give
> >>> me a suggestion?
> >>>
> >>> This module(pwrseq) used to power on Bluetooth & Wi-Fi combo chip, both
> >>> Bluetooth and
> >>>
> >>> Wi-Fi driver need to control "chip-en-gpios" pins, so we introduced the
> >>> power sequence module.
> >>>
> >>> What should we call it in this case?
> >> Sorry, you describe driver, not a device.
> >>
> >> That would be a no-go for entire binding. Please describe the hardware,
> >> not what you want to achieve in Linux drivers.
> > W155s2 is a Bluetooth and WiFi combination chip. Bluetooth requires the
>
> I asked about this device here.
>
> You speak now about W155s2 but everywhere else you were using "WCN".
> What is that WCN?
>
> > bt-en pin to be pulled up, the chip-en pin to be pulled up, and the
> > 32.768KHz clock. WiFi requires the chip-en pin to be pulled up, and the
> > 32.768KHz clock. It can be seen that Bluetooth and WiFi are coupled to
> > the chip-en pin and the 32.768KHz clock. When Bluetooth and WiFi are
> > working at the same time, no matter which one is turned off, it will
> > affect the other device. Therefore, a pwrseq device is now abstracted to
>
> It is the first time you mention pwrseq device from above paragraph.
> Nothing above describes pwrseq.
>
> Stop describing your problem, we all know it exactly if you follow the
> discussions about power sequencing. Instead describe this particular
> device you add binding for. What is this pwrseq in hardware? How does it
> look? Where is it located? What are its pins? What are its supplies?
>
> > manage the chip-en pin, bt-en pin, and the 32.768KHz clock.
>
> >
> > There is currently no matching device name for the pwrseq composite device.
>
> ? No clue what does this mean.
> >
> > Could you please give me some advice?
>
> Again, you do not describe the device for the binding but something
> else. Something for your drivers, sorry. No.
>
> If you disagree, respond accurately to all questions above, not to only
> some of them...
>
> Best regards,
> Krzysztof
>

Yang, please look at the existing pwrseq-qcom-wcn.c driver and its
bindings. They do exactly what you most likely want to do here. They
describe the power management unit of the chipset, its inputs from
host and outputs consumed by the WLAN and BT modules. Please try to
follow it for your device.

Bart
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml b/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml
new file mode 100644
index 000000000000..f99a775fcf9b
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/amlogic,w155s2-pwrseq.yaml
@@ -0,0 +1,62 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/amlogic,w155s2-pwrseq.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic power sequence for WCN chips
+
+maintainers:
+  - Yang Li <yang.li@amlogic.com>
+
+description:
+  The Amlogic WCN chip contains discrete modules for WLAN and Bluetooth. Power on
+  Bluetooth and Wi-Fi respectively, including chip_en pull-up and bt_en pull-up,
+  and generation of the 32.768KHz clock.
+
+properties:
+  compatible:
+    oneOf:
+      - const: amlogic,w155s2-pwrseq
+      - items:
+          - enum:
+              - amlogic,w265s1-pwrseq
+              - amlogic,w265p1-pwrseq
+              - amlogic,w265s2-pwrseq
+          - const: amlogic,w155s2-pwrseq
+
+  clocks:
+    maxItems: 1
+    description: clock provided to the controller (32.768KHz)
+
+  clock-names:
+    items:
+      - const: ext_clock
+
+  amlogic,chip-enable-gpios:
+    maxItems: 1
+    description: gpio specifier used to enable chipset
+
+  amlogic,bt-enable-gpios:
+    maxItems: 1
+    description: gpio specifier used to enable BT
+
+required:
+  - compatible
+  - clocks
+  - clock-names
+  - amlogic,chip-enable-gpios
+  - amlogic,bt-enable-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    wcn_pwrseq {
+        compatible = "amlogic,w155s2-pwrseq";
+        clocks = <&extclk>;
+        clock-names = "ext_clock";
+        amlogic,chip-enable-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+        amlogic,bt-enable-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
+    };