diff mbox series

[02/10] dt-bindings: power: Add rpm power domains for SDX75

Message ID 1688395346-3126-3-git-send-email-quic_rohiagar@quicinc.com (mailing list archive)
State Superseded
Headers show
Series Add Power Domains and Regulators in SDX75 | expand

Commit Message

Rohit Agarwal July 3, 2023, 2:42 p.m. UTC
Add RPM power domain bindings for the SDX75 SoC.

Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
---
 Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 1 +
 include/dt-bindings/power/qcom-rpmpd.h                  | 8 ++++++++
 2 files changed, 9 insertions(+)

Comments

Konrad Dybcio July 3, 2023, 2:59 p.m. UTC | #1
On 3.07.2023 16:42, Rohit Agarwal wrote:
> Add RPM power domain bindings for the SDX75 SoC.
> 
> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
> ---
>  Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 1 +
>  include/dt-bindings/power/qcom-rpmpd.h                  | 8 ++++++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
> index afad313..58e1be8 100644
> --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
> +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
> @@ -40,6 +40,7 @@ properties:
>        - qcom,sdm845-rpmhpd
>        - qcom,sdx55-rpmhpd
>        - qcom,sdx65-rpmhpd
> +      - qcom,sdx75-rpmhpd
>        - qcom,sm6115-rpmpd
>        - qcom,sm6125-rpmpd
>        - qcom,sm6350-rpmhpd
> diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
> index 1bf8e87..8092d0d 100644
> --- a/include/dt-bindings/power/qcom-rpmpd.h
> +++ b/include/dt-bindings/power/qcom-rpmpd.h
> @@ -57,6 +57,14 @@
>  #define SDX65_CX_AO	4
>  #define SDX65_MXC	5
>  
> +/* SDX75 Power Domain Indexes */
> +#define SDX75_CX	0
> +#define SDX75_CX_AO	1
> +#define SDX75_MSS	2
> +#define SDX75_MX	3
> +#define SDX75_MX_AO	4
> +#define SDX75_MXC	5
Please instead introduce a set of defines without the SoC prefix
(i.e. CX, CX_AO, MX etc.). We've been putting this off for too long
and you're the first unlucky guy that submitted new RPMhPD support after
we've concluded it'd be the way to go! :D Sadly, we can't replace the
existing ones retroactively..

Konrad
> +
>  /* SM6350 Power Domain Indexes */
>  #define SM6350_CX	0
>  #define SM6350_GFX	1
Rohit Agarwal July 4, 2023, 6:17 a.m. UTC | #2
On 7/3/2023 8:29 PM, Konrad Dybcio wrote:
> On 3.07.2023 16:42, Rohit Agarwal wrote:
>> Add RPM power domain bindings for the SDX75 SoC.
>>
>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>> ---
>>   Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 1 +
>>   include/dt-bindings/power/qcom-rpmpd.h                  | 8 ++++++++
>>   2 files changed, 9 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>> index afad313..58e1be8 100644
>> --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>> +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>> @@ -40,6 +40,7 @@ properties:
>>         - qcom,sdm845-rpmhpd
>>         - qcom,sdx55-rpmhpd
>>         - qcom,sdx65-rpmhpd
>> +      - qcom,sdx75-rpmhpd
>>         - qcom,sm6115-rpmpd
>>         - qcom,sm6125-rpmpd
>>         - qcom,sm6350-rpmhpd
>> diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
>> index 1bf8e87..8092d0d 100644
>> --- a/include/dt-bindings/power/qcom-rpmpd.h
>> +++ b/include/dt-bindings/power/qcom-rpmpd.h
>> @@ -57,6 +57,14 @@
>>   #define SDX65_CX_AO	4
>>   #define SDX65_MXC	5
>>   
>> +/* SDX75 Power Domain Indexes */
>> +#define SDX75_CX	0
>> +#define SDX75_CX_AO	1
>> +#define SDX75_MSS	2
>> +#define SDX75_MX	3
>> +#define SDX75_MX_AO	4
>> +#define SDX75_MXC	5
> Please instead introduce a set of defines without the SoC prefix
> (i.e. CX, CX_AO, MX etc.). We've been putting this off for too long
> and you're the first unlucky guy that submitted new RPMhPD support after
> we've concluded it'd be the way to go! :D Sadly, we can't replace the
> existing ones retroactively..
Surely No issues. Will update it.

Thanks,
Rohit.
> Konrad
>> +
>>   /* SM6350 Power Domain Indexes */
>>   #define SM6350_CX	0
>>   #define SM6350_GFX	1
Rohit Agarwal July 5, 2023, 8:54 a.m. UTC | #3
On 7/4/2023 11:47 AM, Rohit Agarwal wrote:
>
> On 7/3/2023 8:29 PM, Konrad Dybcio wrote:
>> On 3.07.2023 16:42, Rohit Agarwal wrote:
>>> Add RPM power domain bindings for the SDX75 SoC.
>>>
>>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>>> ---
>>>   Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 1 +
>>>   include/dt-bindings/power/qcom-rpmpd.h                  | 8 ++++++++
>>>   2 files changed, 9 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml 
>>> b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>>> index afad313..58e1be8 100644
>>> --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>>> +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>>> @@ -40,6 +40,7 @@ properties:
>>>         - qcom,sdm845-rpmhpd
>>>         - qcom,sdx55-rpmhpd
>>>         - qcom,sdx65-rpmhpd
>>> +      - qcom,sdx75-rpmhpd
>>>         - qcom,sm6115-rpmpd
>>>         - qcom,sm6125-rpmpd
>>>         - qcom,sm6350-rpmhpd
>>> diff --git a/include/dt-bindings/power/qcom-rpmpd.h 
>>> b/include/dt-bindings/power/qcom-rpmpd.h
>>> index 1bf8e87..8092d0d 100644
>>> --- a/include/dt-bindings/power/qcom-rpmpd.h
>>> +++ b/include/dt-bindings/power/qcom-rpmpd.h
>>> @@ -57,6 +57,14 @@
>>>   #define SDX65_CX_AO    4
>>>   #define SDX65_MXC    5
>>>   +/* SDX75 Power Domain Indexes */
>>> +#define SDX75_CX    0
>>> +#define SDX75_CX_AO    1
>>> +#define SDX75_MSS    2
>>> +#define SDX75_MX    3
>>> +#define SDX75_MX_AO    4
>>> +#define SDX75_MXC    5
>> Please instead introduce a set of defines without the SoC prefix
>> (i.e. CX, CX_AO, MX etc.). We've been putting this off for too long
>> and you're the first unlucky guy that submitted new RPMhPD support after
>> we've concluded it'd be the way to go! :D Sadly, we can't replace the
>> existing ones retroactively..
> Surely No issues. Will update it.

I have a doubt here. Cant we completely omit the #defines here and 
directly index this as 0,1,...
because if the intention of this #defines is to understand the name of 
the pd then we can get
it from the .name attribute in rpmhpd as well, right?

The problems with a common set of #define would be, lets say if we 
define CX_AO as 1 and some platform
doesn't have CX_AO then wouldnt it leave a null entry in the driver 
entry of that platform?

Thanks,
Rohit.

>
> Thanks,
> Rohit.
>> Konrad
>>> +
>>>   /* SM6350 Power Domain Indexes */
>>>   #define SM6350_CX    0
>>>   #define SM6350_GFX    1
Konrad Dybcio July 5, 2023, 10:43 a.m. UTC | #4
On 5.07.2023 10:54, Rohit Agarwal wrote:
> 
> On 7/4/2023 11:47 AM, Rohit Agarwal wrote:
>>
>> On 7/3/2023 8:29 PM, Konrad Dybcio wrote:
>>> On 3.07.2023 16:42, Rohit Agarwal wrote:
>>>> Add RPM power domain bindings for the SDX75 SoC.
>>>>
>>>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>>>> ---
>>>>   Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 1 +
>>>>   include/dt-bindings/power/qcom-rpmpd.h                  | 8 ++++++++
>>>>   2 files changed, 9 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>>>> index afad313..58e1be8 100644
>>>> --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>>>> +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>>>> @@ -40,6 +40,7 @@ properties:
>>>>         - qcom,sdm845-rpmhpd
>>>>         - qcom,sdx55-rpmhpd
>>>>         - qcom,sdx65-rpmhpd
>>>> +      - qcom,sdx75-rpmhpd
>>>>         - qcom,sm6115-rpmpd
>>>>         - qcom,sm6125-rpmpd
>>>>         - qcom,sm6350-rpmhpd
>>>> diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
>>>> index 1bf8e87..8092d0d 100644
>>>> --- a/include/dt-bindings/power/qcom-rpmpd.h
>>>> +++ b/include/dt-bindings/power/qcom-rpmpd.h
>>>> @@ -57,6 +57,14 @@
>>>>   #define SDX65_CX_AO    4
>>>>   #define SDX65_MXC    5
>>>>   +/* SDX75 Power Domain Indexes */
>>>> +#define SDX75_CX    0
>>>> +#define SDX75_CX_AO    1
>>>> +#define SDX75_MSS    2
>>>> +#define SDX75_MX    3
>>>> +#define SDX75_MX_AO    4
>>>> +#define SDX75_MXC    5
>>> Please instead introduce a set of defines without the SoC prefix
>>> (i.e. CX, CX_AO, MX etc.). We've been putting this off for too long
>>> and you're the first unlucky guy that submitted new RPMhPD support after
>>> we've concluded it'd be the way to go! :D Sadly, we can't replace the
>>> existing ones retroactively..
>> Surely No issues. Will update it.
> 
> I have a doubt here. Cant we completely omit the #defines here and directly index this as 0,1,...
> because if the intention of this #defines is to understand the name of the pd then we can get
> it from the .name attribute in rpmhpd as well, right?
> 
> The problems with a common set of #define would be, lets say if we define CX_AO as 1 and some platform
> doesn't have CX_AO then wouldnt it leave a null entry in the driver entry of that platform?
Yes.

We already do this in the rpmh clock driver, as:

1. there are domains that all chips share (like CX etc.)
2. wasting a couple of bytes lets us massively save on convolution

Konrad
> 
> Thanks,
> Rohit.
> 
>>
>> Thanks,
>> Rohit.
>>> Konrad
>>>> +
>>>>   /* SM6350 Power Domain Indexes */
>>>>   #define SM6350_CX    0
>>>>   #define SM6350_GFX    1
Rohit Agarwal July 5, 2023, 11:20 a.m. UTC | #5
On 7/5/2023 4:13 PM, Konrad Dybcio wrote:
> On 5.07.2023 10:54, Rohit Agarwal wrote:
>> On 7/4/2023 11:47 AM, Rohit Agarwal wrote:
>>> On 7/3/2023 8:29 PM, Konrad Dybcio wrote:
>>>> On 3.07.2023 16:42, Rohit Agarwal wrote:
>>>>> Add RPM power domain bindings for the SDX75 SoC.
>>>>>
>>>>> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>
>>>>> ---
>>>>>    Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 1 +
>>>>>    include/dt-bindings/power/qcom-rpmpd.h                  | 8 ++++++++
>>>>>    2 files changed, 9 insertions(+)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>>>>> index afad313..58e1be8 100644
>>>>> --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>>>>> +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
>>>>> @@ -40,6 +40,7 @@ properties:
>>>>>          - qcom,sdm845-rpmhpd
>>>>>          - qcom,sdx55-rpmhpd
>>>>>          - qcom,sdx65-rpmhpd
>>>>> +      - qcom,sdx75-rpmhpd
>>>>>          - qcom,sm6115-rpmpd
>>>>>          - qcom,sm6125-rpmpd
>>>>>          - qcom,sm6350-rpmhpd
>>>>> diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
>>>>> index 1bf8e87..8092d0d 100644
>>>>> --- a/include/dt-bindings/power/qcom-rpmpd.h
>>>>> +++ b/include/dt-bindings/power/qcom-rpmpd.h
>>>>> @@ -57,6 +57,14 @@
>>>>>    #define SDX65_CX_AO    4
>>>>>    #define SDX65_MXC    5
>>>>>    +/* SDX75 Power Domain Indexes */
>>>>> +#define SDX75_CX    0
>>>>> +#define SDX75_CX_AO    1
>>>>> +#define SDX75_MSS    2
>>>>> +#define SDX75_MX    3
>>>>> +#define SDX75_MX_AO    4
>>>>> +#define SDX75_MXC    5
>>>> Please instead introduce a set of defines without the SoC prefix
>>>> (i.e. CX, CX_AO, MX etc.). We've been putting this off for too long
>>>> and you're the first unlucky guy that submitted new RPMhPD support after
>>>> we've concluded it'd be the way to go! :D Sadly, we can't replace the
>>>> existing ones retroactively..
>>> Surely No issues. Will update it.
>> I have a doubt here. Cant we completely omit the #defines here and directly index this as 0,1,...
>> because if the intention of this #defines is to understand the name of the pd then we can get
>> it from the .name attribute in rpmhpd as well, right?
>>
>> The problems with a common set of #define would be, lets say if we define CX_AO as 1 and some platform
>> doesn't have CX_AO then wouldnt it leave a null entry in the driver entry of that platform?
> Yes.
>
> We already do this in the rpmh clock driver, as:
>
> 1. there are domains that all chips share (like CX etc.)
> 2. wasting a couple of bytes lets us massively save on convolution
Ok, got it. Looks cleaner.

Thanks,
Rohit.
>
> Konrad
>> Thanks,
>> Rohit.
>>
>>> Thanks,
>>> Rohit.
>>>> Konrad
>>>>> +
>>>>>    /* SM6350 Power Domain Indexes */
>>>>>    #define SM6350_CX    0
>>>>>    #define SM6350_GFX    1
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
index afad313..58e1be8 100644
--- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
+++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
@@ -40,6 +40,7 @@  properties:
       - qcom,sdm845-rpmhpd
       - qcom,sdx55-rpmhpd
       - qcom,sdx65-rpmhpd
+      - qcom,sdx75-rpmhpd
       - qcom,sm6115-rpmpd
       - qcom,sm6125-rpmpd
       - qcom,sm6350-rpmhpd
diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h
index 1bf8e87..8092d0d 100644
--- a/include/dt-bindings/power/qcom-rpmpd.h
+++ b/include/dt-bindings/power/qcom-rpmpd.h
@@ -57,6 +57,14 @@ 
 #define SDX65_CX_AO	4
 #define SDX65_MXC	5
 
+/* SDX75 Power Domain Indexes */
+#define SDX75_CX	0
+#define SDX75_CX_AO	1
+#define SDX75_MSS	2
+#define SDX75_MX	3
+#define SDX75_MX_AO	4
+#define SDX75_MXC	5
+
 /* SM6350 Power Domain Indexes */
 #define SM6350_CX	0
 #define SM6350_GFX	1