mbox series

[00/10] Add Power Domains and Regulators in SDX75

Message ID 1688395346-3126-1-git-send-email-quic_rohiagar@quicinc.com
Headers show
Series Add Power Domains and Regulators in SDX75 | expand

Message

Rohit Agarwal July 3, 2023, 2:42 p.m. UTC
Hello,

This series adds driver and dt-bindings related changes
in SDX75 to add power domains and regulators.

Thanks,
Rohit.

Rohit Agarwal (10):
  dt-bindings: regulator: Add PMX75 compatibles
  dt-bindings: power: Add rpm power domains for SDX75
  dt-bindings: mfd: Add compatible for pm7550ba
  dt-bindings: pinctrl: qcom-pmic-gpio: Add pm7550ba support
  dt-bindings: mfd: Add compatible for pmx75
  dt-bindings: pinctrl: qcom-pmic-gpio: Add pmx75 support
  soc: qcom: rpmhpd: Add SDX75 power domains
  regulator: qcom-rpmh: Add support for SDX75
  pinctrl: qcom-pmic-gpio: Add support for pm7550ba
  pinctrl: qcom-pmic-gpio: Add support for pmx75

 .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml    |  2 ++
 .../bindings/pinctrl/qcom,pmic-gpio.yaml           |  6 ++++
 .../devicetree/bindings/power/qcom,rpmpd.yaml      |  1 +
 .../bindings/regulator/qcom,rpmh-regulator.yaml    |  2 ++
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           |  2 ++
 drivers/regulator/qcom-rpmh-regulator.c            | 38 ++++++++++++++++++++++
 drivers/soc/qcom/rpmhpd.c                          | 16 +++++++++
 include/dt-bindings/power/qcom-rpmpd.h             |  8 +++++
 8 files changed, 75 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
Bjorn Andersson July 3, 2023, 3:27 p.m. UTC | #2
On Mon, Jul 03, 2023 at 08:12:16PM +0530, Rohit Agarwal wrote:
> Hello,
> 
> This series adds driver and dt-bindings related changes
> in SDX75 to add power domains and regulators.
> 

Thanks for your patches, Rohit. Really nice to see the SDX75 support
being upstreamed.

This series is to be merged by five (5) different maintainers, with no
dependencies between them, afaict. The likely outcome is confusion and
some of the patches being left behind on the list.

To reduce this risk of confusion and to get your patches looked at, and
merged, faster, please send independent series/patches separately in the
future.

Regards,
Bjorn

> Thanks,
> Rohit.
> 
> Rohit Agarwal (10):
>   dt-bindings: regulator: Add PMX75 compatibles
>   dt-bindings: power: Add rpm power domains for SDX75
>   dt-bindings: mfd: Add compatible for pm7550ba
>   dt-bindings: pinctrl: qcom-pmic-gpio: Add pm7550ba support
>   dt-bindings: mfd: Add compatible for pmx75
>   dt-bindings: pinctrl: qcom-pmic-gpio: Add pmx75 support
>   soc: qcom: rpmhpd: Add SDX75 power domains
>   regulator: qcom-rpmh: Add support for SDX75
>   pinctrl: qcom-pmic-gpio: Add support for pm7550ba
>   pinctrl: qcom-pmic-gpio: Add support for pmx75
> 
>  .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml    |  2 ++
>  .../bindings/pinctrl/qcom,pmic-gpio.yaml           |  6 ++++
>  .../devicetree/bindings/power/qcom,rpmpd.yaml      |  1 +
>  .../bindings/regulator/qcom,rpmh-regulator.yaml    |  2 ++
>  drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           |  2 ++
>  drivers/regulator/qcom-rpmh-regulator.c            | 38 ++++++++++++++++++++++
>  drivers/soc/qcom/rpmhpd.c                          | 16 +++++++++
>  include/dt-bindings/power/qcom-rpmpd.h             |  8 +++++
>  8 files changed, 75 insertions(+)
> 
> -- 
> 2.7.4
>
Rohit Agarwal July 4, 2023, 6:16 a.m. UTC | #3
On 7/3/2023 8:57 PM, Bjorn Andersson wrote:
> On Mon, Jul 03, 2023 at 08:12:16PM +0530, Rohit Agarwal wrote:
>> Hello,
>>
>> This series adds driver and dt-bindings related changes
>> in SDX75 to add power domains and regulators.
>>
> Thanks for your patches, Rohit. Really nice to see the SDX75 support
> being upstreamed.
>
> This series is to be merged by five (5) different maintainers, with no
> dependencies between them, afaict. The likely outcome is confusion and
> some of the patches being left behind on the list.
>
> To reduce this risk of confusion and to get your patches looked at, and
> merged, faster, please send independent series/patches separately in the
> future.

Sure Bjorn, Thanks for the suggestion. Will surely work on this and keep 
in mind
while sending patches in future.

Thanks,
Rohit.

> Regards,
> Bjorn
>
>> Thanks,
>> Rohit.
>>
>> Rohit Agarwal (10):
>>    dt-bindings: regulator: Add PMX75 compatibles
>>    dt-bindings: power: Add rpm power domains for SDX75
>>    dt-bindings: mfd: Add compatible for pm7550ba
>>    dt-bindings: pinctrl: qcom-pmic-gpio: Add pm7550ba support
>>    dt-bindings: mfd: Add compatible for pmx75
>>    dt-bindings: pinctrl: qcom-pmic-gpio: Add pmx75 support
>>    soc: qcom: rpmhpd: Add SDX75 power domains
>>    regulator: qcom-rpmh: Add support for SDX75
>>    pinctrl: qcom-pmic-gpio: Add support for pm7550ba
>>    pinctrl: qcom-pmic-gpio: Add support for pmx75
>>
>>   .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml    |  2 ++
>>   .../bindings/pinctrl/qcom,pmic-gpio.yaml           |  6 ++++
>>   .../devicetree/bindings/power/qcom,rpmpd.yaml      |  1 +
>>   .../bindings/regulator/qcom,rpmh-regulator.yaml    |  2 ++
>>   drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           |  2 ++
>>   drivers/regulator/qcom-rpmh-regulator.c            | 38 ++++++++++++++++++++++
>>   drivers/soc/qcom/rpmhpd.c                          | 16 +++++++++
>>   include/dt-bindings/power/qcom-rpmpd.h             |  8 +++++
>>   8 files changed, 75 insertions(+)
>>
>> -- 
>> 2.7.4
>>
Rohit Agarwal July 4, 2023, 6:17 a.m. UTC | #4
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
Krzysztof Kozlowski July 4, 2023, 6:25 a.m. UTC | #5
On 03/07/2023 16:42, Rohit Agarwal wrote:
> Add support for the pmx75 GPIO support to the Qualcomm PMIC GPIO
> binding.
> 
> Signed-off-by: Rohit Agarwal <quic_rohiagar@quicinc.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Rohit Agarwal July 5, 2023, 8:54 a.m. UTC | #6
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 | #7
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 | #8
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