linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add PM8350C PMIC PWM support for backlight
@ 2021-09-06 10:41 satya priya
  2021-09-06 10:41 ` [PATCH 1/3] dt-bindings: leds: Add pm8350c pmic support satya priya
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: satya priya @ 2021-09-06 10:41 UTC (permalink / raw)
  To: Pavel Machek, Rob Herring, Andy Gross, Bjorn Andersson
  Cc: swboyd, mka, kgunda, linux-leds, devicetree, linux-kernel,
	linux-arm-msm, satya priya

This series depends on [1], which adds driver for Qualcomm LPG.

[1] https://patchwork.kernel.org/project/linux-arm-msm/list/?series=505483&archive=both&state=*

satya priya (3):
  dt-bindings: leds: Add pm8350c pmic support
  leds: Add pm8350c support to Qualcomm LPG driver
  arm64: dts: qcom: pm8350c: Add pwm support

 Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml |  1 +
 arch/arm64/boot/dts/qcom/pm8350c.dtsi                     |  6 ++++++
 drivers/leds/rgb/leds-qcom-lpg.c                          | 10 ++++++++++
 3 files changed, 17 insertions(+)

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
of Code Aurora Forum, hosted by The Linux Foundation


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1/3] dt-bindings: leds: Add pm8350c pmic support
  2021-09-06 10:41 [PATCH 0/3] Add PM8350C PMIC PWM support for backlight satya priya
@ 2021-09-06 10:41 ` satya priya
  2021-09-07 17:48   ` Matthias Kaehlcke
                     ` (2 more replies)
  2021-09-06 10:41 ` [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver satya priya
  2021-09-06 10:41 ` [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support satya priya
  2 siblings, 3 replies; 20+ messages in thread
From: satya priya @ 2021-09-06 10:41 UTC (permalink / raw)
  To: Pavel Machek, Rob Herring, Andy Gross, Bjorn Andersson
  Cc: swboyd, mka, kgunda, linux-leds, devicetree, linux-kernel,
	linux-arm-msm, satya priya

Add pm8350c pmic pwm support.

Signed-off-by: satya priya <skakit@codeaurora.org>
---
 Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
index 10aee61..56d7a39 100644
--- a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
+++ b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
@@ -19,6 +19,7 @@ properties:
     enum:
       - qcom,pm8150b-lpg
       - qcom,pm8150l-lpg
+      - qcom,pm8350c-pwm
       - qcom,pm8916-pwm
       - qcom,pm8941-lpg
       - qcom,pm8994-lpg
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
of Code Aurora Forum, hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver
  2021-09-06 10:41 [PATCH 0/3] Add PM8350C PMIC PWM support for backlight satya priya
  2021-09-06 10:41 ` [PATCH 1/3] dt-bindings: leds: Add pm8350c pmic support satya priya
@ 2021-09-06 10:41 ` satya priya
  2021-09-07 17:54   ` Matthias Kaehlcke
                     ` (2 more replies)
  2021-09-06 10:41 ` [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support satya priya
  2 siblings, 3 replies; 20+ messages in thread
From: satya priya @ 2021-09-06 10:41 UTC (permalink / raw)
  To: Pavel Machek, Rob Herring, Andy Gross, Bjorn Andersson
  Cc: swboyd, mka, kgunda, linux-leds, devicetree, linux-kernel,
	linux-arm-msm, satya priya

Add pm8350c compatible and lpg_data to the driver.

Signed-off-by: satya priya <skakit@codeaurora.org>
---
 drivers/leds/rgb/leds-qcom-lpg.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
index 327e81a..6ee80d6 100644
--- a/drivers/leds/rgb/leds-qcom-lpg.c
+++ b/drivers/leds/rgb/leds-qcom-lpg.c
@@ -1275,9 +1275,19 @@ static const struct lpg_data pm8150l_lpg_data = {
 	},
 };
 
+static const struct lpg_data pm8350c_pwm_data = {
+	.pwm_9bit_mask = BIT(2),
+
+	.num_channels = 1,
+	.channels = (struct lpg_channel_data[]) {
+		{ .base = 0xeb00 },
+	},
+};
+
 static const struct of_device_id lpg_of_table[] = {
 	{ .compatible = "qcom,pm8150b-lpg", .data = &pm8150b_lpg_data },
 	{ .compatible = "qcom,pm8150l-lpg", .data = &pm8150l_lpg_data },
+	{ .compatible = "qcom,pm8350c-pwm", .data = &pm8350c_pwm_data },
 	{ .compatible = "qcom,pm8916-pwm", .data = &pm8916_pwm_data },
 	{ .compatible = "qcom,pm8941-lpg", .data = &pm8941_lpg_data },
 	{ .compatible = "qcom,pm8994-lpg", .data = &pm8994_lpg_data },
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
of Code Aurora Forum, hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support
  2021-09-06 10:41 [PATCH 0/3] Add PM8350C PMIC PWM support for backlight satya priya
  2021-09-06 10:41 ` [PATCH 1/3] dt-bindings: leds: Add pm8350c pmic support satya priya
  2021-09-06 10:41 ` [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver satya priya
@ 2021-09-06 10:41 ` satya priya
  2021-09-07 18:16   ` Matthias Kaehlcke
  2021-09-08  3:34   ` Stephen Boyd
  2 siblings, 2 replies; 20+ messages in thread
From: satya priya @ 2021-09-06 10:41 UTC (permalink / raw)
  To: Pavel Machek, Rob Herring, Andy Gross, Bjorn Andersson
  Cc: swboyd, mka, kgunda, linux-leds, devicetree, linux-kernel,
	linux-arm-msm, satya priya

Add pwm support for PM8350C pmic.

Signed-off-by: satya priya <skakit@codeaurora.org>
---
 arch/arm64/boot/dts/qcom/pm8350c.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pm8350c.dtsi b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
index e1b75ae..ecdae55 100644
--- a/arch/arm64/boot/dts/qcom/pm8350c.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
@@ -29,6 +29,12 @@
 			interrupt-controller;
 			#interrupt-cells = <2>;
 		};
+
+		pm8350c_pwm4: pwm {
+			compatible = "qcom,pm8350c-pwm";
+			#pwm-cells = <2>;
+			status = "okay";
+		};
 	};
 };
 
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
of Code Aurora Forum, hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/3] dt-bindings: leds: Add pm8350c pmic support
  2021-09-06 10:41 ` [PATCH 1/3] dt-bindings: leds: Add pm8350c pmic support satya priya
@ 2021-09-07 17:48   ` Matthias Kaehlcke
  2021-09-07 20:03   ` Stephen Boyd
  2021-09-08 13:52   ` Rob Herring
  2 siblings, 0 replies; 20+ messages in thread
From: Matthias Kaehlcke @ 2021-09-07 17:48 UTC (permalink / raw)
  To: satya priya
  Cc: Pavel Machek, Rob Herring, Andy Gross, Bjorn Andersson, swboyd,
	kgunda, linux-leds, devicetree, linux-kernel, linux-arm-msm

On Mon, Sep 06, 2021 at 04:11:05PM +0530, satya priya wrote:
> Add pm8350c pmic pwm support.
> 
> Signed-off-by: satya priya <skakit@codeaurora.org>

Reviewed-by: Matthias Kaehlcke <mka@chromium.org>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver
  2021-09-06 10:41 ` [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver satya priya
@ 2021-09-07 17:54   ` Matthias Kaehlcke
  2021-09-07 17:58     ` Matthias Kaehlcke
  2021-09-07 18:02   ` Matthias Kaehlcke
  2021-09-07 20:20   ` Stephen Boyd
  2 siblings, 1 reply; 20+ messages in thread
From: Matthias Kaehlcke @ 2021-09-07 17:54 UTC (permalink / raw)
  To: satya priya
  Cc: Pavel Machek, Rob Herring, Andy Gross, Bjorn Andersson, swboyd,
	kgunda, linux-leds, devicetree, linux-kernel, linux-arm-msm

On Mon, Sep 06, 2021 at 04:11:06PM +0530, satya priya wrote:
> Add pm8350c compatible and lpg_data to the driver.
> 
> Signed-off-by: satya priya <skakit@codeaurora.org>
> ---
>  drivers/leds/rgb/leds-qcom-lpg.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)

That driver does not exist in upstream or -next. Looks like this is a
patch from some downstream tree, which you should not use as base for
sending patches upstream.

It seems you need to send patches for the entire driver + bindings.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver
  2021-09-07 17:54   ` Matthias Kaehlcke
@ 2021-09-07 17:58     ` Matthias Kaehlcke
  0 siblings, 0 replies; 20+ messages in thread
From: Matthias Kaehlcke @ 2021-09-07 17:58 UTC (permalink / raw)
  To: satya priya
  Cc: Pavel Machek, Rob Herring, Andy Gross, Bjorn Andersson, swboyd,
	kgunda, linux-leds, devicetree, linux-kernel, linux-arm-msm

On Tue, Sep 07, 2021 at 10:54:18AM -0700, Matthias Kaehlcke wrote:
> On Mon, Sep 06, 2021 at 04:11:06PM +0530, satya priya wrote:
> > Add pm8350c compatible and lpg_data to the driver.
> > 
> > Signed-off-by: satya priya <skakit@codeaurora.org>
> > ---
> >  drivers/leds/rgb/leds-qcom-lpg.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> 
> That driver does not exist in upstream or -next. Looks like this is a
> patch from some downstream tree, which you should not use as base for
> sending patches upstream.
> 
> It seems you need to send patches for the entire driver + bindings.

Sorry, my bad, I should have read the cover letter, which mentions the
dependency on https://patchwork.kernel.org/project/linux-arm-msm/list/?series=505483&archive=both&state=*

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver
  2021-09-06 10:41 ` [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver satya priya
  2021-09-07 17:54   ` Matthias Kaehlcke
@ 2021-09-07 18:02   ` Matthias Kaehlcke
  2021-09-07 20:20   ` Stephen Boyd
  2 siblings, 0 replies; 20+ messages in thread
From: Matthias Kaehlcke @ 2021-09-07 18:02 UTC (permalink / raw)
  To: satya priya
  Cc: Pavel Machek, Rob Herring, Andy Gross, Bjorn Andersson, swboyd,
	kgunda, linux-leds, devicetree, linux-kernel, linux-arm-msm

On Mon, Sep 06, 2021 at 04:11:06PM +0530, satya priya wrote:
> Add pm8350c compatible and lpg_data to the driver.
> 
> Signed-off-by: satya priya <skakit@codeaurora.org>

Reviewed-by: Matthias Kaehlcke <mka@chromium.org>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support
  2021-09-06 10:41 ` [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support satya priya
@ 2021-09-07 18:16   ` Matthias Kaehlcke
  2021-09-08  9:07     ` skakit
  2021-09-08  3:34   ` Stephen Boyd
  1 sibling, 1 reply; 20+ messages in thread
From: Matthias Kaehlcke @ 2021-09-07 18:16 UTC (permalink / raw)
  To: satya priya
  Cc: Pavel Machek, Rob Herring, Andy Gross, Bjorn Andersson, swboyd,
	kgunda, linux-leds, devicetree, linux-kernel, linux-arm-msm

On Mon, Sep 06, 2021 at 04:11:07PM +0530, satya priya wrote:
> Add pwm support for PM8350C pmic.
> 
> Signed-off-by: satya priya <skakit@codeaurora.org>
> ---
>  arch/arm64/boot/dts/qcom/pm8350c.dtsi | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/pm8350c.dtsi b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> index e1b75ae..ecdae55 100644
> --- a/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> @@ -29,6 +29,12 @@
>  			interrupt-controller;
>  			#interrupt-cells = <2>;
>  		};
> +
> +		pm8350c_pwm4: pwm {

What does the '4' represent, an internal channel number? It should
probably be omitted if the PM8350 only has a single output PWM
port.

> +			compatible = "qcom,pm8350c-pwm";
> +			#pwm-cells = <2>;
> +			status = "okay";

I don't think it should be enabled by default, there may be boards with
the PM8350C that don't use the PWM.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/3] dt-bindings: leds: Add pm8350c pmic support
  2021-09-06 10:41 ` [PATCH 1/3] dt-bindings: leds: Add pm8350c pmic support satya priya
  2021-09-07 17:48   ` Matthias Kaehlcke
@ 2021-09-07 20:03   ` Stephen Boyd
  2021-09-08 13:52   ` Rob Herring
  2 siblings, 0 replies; 20+ messages in thread
From: Stephen Boyd @ 2021-09-07 20:03 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Pavel Machek, Rob Herring, satya priya
  Cc: mka, kgunda, linux-leds, devicetree, linux-kernel, linux-arm-msm

Quoting satya priya (2021-09-06 03:41:05)
> Add pm8350c pmic pwm support.
>
> Signed-off-by: satya priya <skakit@codeaurora.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver
  2021-09-06 10:41 ` [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver satya priya
  2021-09-07 17:54   ` Matthias Kaehlcke
  2021-09-07 18:02   ` Matthias Kaehlcke
@ 2021-09-07 20:20   ` Stephen Boyd
  2021-09-08  9:17     ` skakit
  2 siblings, 1 reply; 20+ messages in thread
From: Stephen Boyd @ 2021-09-07 20:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Pavel Machek, Rob Herring, satya priya
  Cc: mka, kgunda, linux-leds, devicetree, linux-kernel, linux-arm-msm

Quoting satya priya (2021-09-06 03:41:06)
> Add pm8350c compatible and lpg_data to the driver.
>
> Signed-off-by: satya priya <skakit@codeaurora.org>
> ---
>  drivers/leds/rgb/leds-qcom-lpg.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
> index 327e81a..6ee80d6 100644
> --- a/drivers/leds/rgb/leds-qcom-lpg.c
> +++ b/drivers/leds/rgb/leds-qcom-lpg.c
> @@ -1275,9 +1275,19 @@ static const struct lpg_data pm8150l_lpg_data = {
>         },
>  };
>
> +static const struct lpg_data pm8350c_pwm_data = {
> +       .pwm_9bit_mask = BIT(2),
> +
> +       .num_channels = 1,
> +       .channels = (struct lpg_channel_data[]) {

Can this be const struct lpg_channel_data? I think that will move it to
rodata which is only a good thing.

> +               { .base = 0xeb00 },
> +       },
> +};
> +
>  static const struct of_device_id lpg_of_table[] = {
>         { .compatible = "qcom,pm8150b-lpg", .data = &pm8150b_lpg_data },
>         { .compatible = "qcom,pm8150l-lpg", .data = &pm8150l_lpg_data },
> +       { .compatible = "qcom,pm8350c-pwm", .data = &pm8350c_pwm_data },
>         { .compatible = "qcom,pm8916-pwm", .data = &pm8916_pwm_data },
>         { .compatible = "qcom,pm8941-lpg", .data = &pm8941_lpg_data },
>         { .compatible = "qcom,pm8994-lpg", .data = &pm8994_lpg_data },

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support
  2021-09-06 10:41 ` [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support satya priya
  2021-09-07 18:16   ` Matthias Kaehlcke
@ 2021-09-08  3:34   ` Stephen Boyd
  2021-09-08  9:14     ` skakit
  1 sibling, 1 reply; 20+ messages in thread
From: Stephen Boyd @ 2021-09-08  3:34 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Pavel Machek, Rob Herring, satya priya
  Cc: mka, kgunda, linux-leds, devicetree, linux-kernel, linux-arm-msm

Quoting satya priya (2021-09-06 03:41:07)
> Add pwm support for PM8350C pmic.
>
> Signed-off-by: satya priya <skakit@codeaurora.org>
> ---
>  arch/arm64/boot/dts/qcom/pm8350c.dtsi | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/pm8350c.dtsi b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> index e1b75ae..ecdae55 100644
> --- a/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> @@ -29,6 +29,12 @@
>                         interrupt-controller;
>                         #interrupt-cells = <2>;
>                 };
> +
> +               pm8350c_pwm4: pwm {
> +                       compatible = "qcom,pm8350c-pwm";

Shouldn't there be a reg property?

> +                       #pwm-cells = <2>;
> +                       status = "okay";
> +               };
>         };
>  };
>
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support
  2021-09-07 18:16   ` Matthias Kaehlcke
@ 2021-09-08  9:07     ` skakit
  2021-09-08 15:29       ` Matthias Kaehlcke
  0 siblings, 1 reply; 20+ messages in thread
From: skakit @ 2021-09-08  9:07 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: Pavel Machek, Rob Herring, Andy Gross, Bjorn Andersson, swboyd,
	kgunda, linux-leds, devicetree, linux-kernel, linux-arm-msm

On 2021-09-07 23:46, Matthias Kaehlcke wrote:
> On Mon, Sep 06, 2021 at 04:11:07PM +0530, satya priya wrote:
>> Add pwm support for PM8350C pmic.
>> 
>> Signed-off-by: satya priya <skakit@codeaurora.org>
>> ---
>>  arch/arm64/boot/dts/qcom/pm8350c.dtsi | 6 ++++++
>>  1 file changed, 6 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/qcom/pm8350c.dtsi 
>> b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
>> index e1b75ae..ecdae55 100644
>> --- a/arch/arm64/boot/dts/qcom/pm8350c.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
>> @@ -29,6 +29,12 @@
>>  			interrupt-controller;
>>  			#interrupt-cells = <2>;
>>  		};
>> +
>> +		pm8350c_pwm4: pwm {
> 
> What does the '4' represent, an internal channel number? It should
> probably be omitted if the PM8350 only has a single output PWM
> port.
> 

pm8350c has four PWMs, but I think we can drop the '4' here.

>> +			compatible = "qcom,pm8350c-pwm";
>> +			#pwm-cells = <2>;
>> +			status = "okay";
> 
> I don't think it should be enabled by default, there may be boards with
> the PM8350C that don't use the PWM.

Okay.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support
  2021-09-08  3:34   ` Stephen Boyd
@ 2021-09-08  9:14     ` skakit
  0 siblings, 0 replies; 20+ messages in thread
From: skakit @ 2021-09-08  9:14 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Andy Gross, Bjorn Andersson, Pavel Machek, Rob Herring, mka,
	kgunda, linux-leds, devicetree, linux-kernel, linux-arm-msm

On 2021-09-08 09:04, Stephen Boyd wrote:
> Quoting satya priya (2021-09-06 03:41:07)
>> Add pwm support for PM8350C pmic.
>> 
>> Signed-off-by: satya priya <skakit@codeaurora.org>
>> ---
>>  arch/arm64/boot/dts/qcom/pm8350c.dtsi | 6 ++++++
>>  1 file changed, 6 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/qcom/pm8350c.dtsi 
>> b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
>> index e1b75ae..ecdae55 100644
>> --- a/arch/arm64/boot/dts/qcom/pm8350c.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
>> @@ -29,6 +29,12 @@
>>                         interrupt-controller;
>>                         #interrupt-cells = <2>;
>>                 };
>> +
>> +               pm8350c_pwm4: pwm {
>> +                       compatible = "qcom,pm8350c-pwm";
> 
> Shouldn't there be a reg property?
> 

The bindings do not specify reg property. I think it is because we are 
adding the base address in struct "pm8350c_pwm_data".

>> +                       #pwm-cells = <2>;
>> +                       status = "okay";
>> +               };
>>         };
>>  };
>> 
>> --
>> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a 
>> member
>> of Code Aurora Forum, hosted by The Linux Foundation
>> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver
  2021-09-07 20:20   ` Stephen Boyd
@ 2021-09-08  9:17     ` skakit
  2021-09-08 17:11       ` Bjorn Andersson
  0 siblings, 1 reply; 20+ messages in thread
From: skakit @ 2021-09-08  9:17 UTC (permalink / raw)
  To: Stephen Boyd, Bjorn Andersson
  Cc: Andy Gross, Pavel Machek, Rob Herring, mka, kgunda, linux-leds,
	devicetree, linux-kernel, linux-arm-msm

On 2021-09-08 01:50, Stephen Boyd wrote:
> Quoting satya priya (2021-09-06 03:41:06)
>> Add pm8350c compatible and lpg_data to the driver.
>> 
>> Signed-off-by: satya priya <skakit@codeaurora.org>
>> ---
>>  drivers/leds/rgb/leds-qcom-lpg.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>> 
>> diff --git a/drivers/leds/rgb/leds-qcom-lpg.c 
>> b/drivers/leds/rgb/leds-qcom-lpg.c
>> index 327e81a..6ee80d6 100644
>> --- a/drivers/leds/rgb/leds-qcom-lpg.c
>> +++ b/drivers/leds/rgb/leds-qcom-lpg.c
>> @@ -1275,9 +1275,19 @@ static const struct lpg_data pm8150l_lpg_data = 
>> {
>>         },
>>  };
>> 
>> +static const struct lpg_data pm8350c_pwm_data = {
>> +       .pwm_9bit_mask = BIT(2),
>> +
>> +       .num_channels = 1,
>> +       .channels = (struct lpg_channel_data[]) {
> 
> Can this be const struct lpg_channel_data? I think that will move it to
> rodata which is only a good thing.
> 

I agree.
@Bjorn, can we make it const struct?

>> +               { .base = 0xeb00 },
>> +       },
>> +};
>> +
>>  static const struct of_device_id lpg_of_table[] = {
>>         { .compatible = "qcom,pm8150b-lpg", .data = &pm8150b_lpg_data 
>> },
>>         { .compatible = "qcom,pm8150l-lpg", .data = &pm8150l_lpg_data 
>> },
>> +       { .compatible = "qcom,pm8350c-pwm", .data = &pm8350c_pwm_data 
>> },
>>         { .compatible = "qcom,pm8916-pwm", .data = &pm8916_pwm_data },
>>         { .compatible = "qcom,pm8941-lpg", .data = &pm8941_lpg_data },
>>         { .compatible = "qcom,pm8994-lpg", .data = &pm8994_lpg_data },

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/3] dt-bindings: leds: Add pm8350c pmic support
  2021-09-06 10:41 ` [PATCH 1/3] dt-bindings: leds: Add pm8350c pmic support satya priya
  2021-09-07 17:48   ` Matthias Kaehlcke
  2021-09-07 20:03   ` Stephen Boyd
@ 2021-09-08 13:52   ` Rob Herring
  2 siblings, 0 replies; 20+ messages in thread
From: Rob Herring @ 2021-09-08 13:52 UTC (permalink / raw)
  To: satya priya
  Cc: devicetree, linux-leds, linux-kernel, Bjorn Andersson, mka,
	Andy Gross, linux-arm-msm, kgunda, swboyd, Rob Herring,
	Pavel Machek

On Mon, 06 Sep 2021 16:11:05 +0530, satya priya wrote:
> Add pm8350c pmic pwm support.
> 
> Signed-off-by: satya priya <skakit@codeaurora.org>
> ---
>  Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support
  2021-09-08  9:07     ` skakit
@ 2021-09-08 15:29       ` Matthias Kaehlcke
  2021-09-08 17:08         ` Bjorn Andersson
  0 siblings, 1 reply; 20+ messages in thread
From: Matthias Kaehlcke @ 2021-09-08 15:29 UTC (permalink / raw)
  To: skakit
  Cc: Pavel Machek, Rob Herring, Andy Gross, Bjorn Andersson, swboyd,
	kgunda, linux-leds, devicetree, linux-kernel, linux-arm-msm

On Wed, Sep 08, 2021 at 02:37:39PM +0530, skakit@codeaurora.org wrote:
> On 2021-09-07 23:46, Matthias Kaehlcke wrote:
> > On Mon, Sep 06, 2021 at 04:11:07PM +0530, satya priya wrote:
> > > Add pwm support for PM8350C pmic.
> > > 
> > > Signed-off-by: satya priya <skakit@codeaurora.org>
> > > ---
> > >  arch/arm64/boot/dts/qcom/pm8350c.dtsi | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > > 
> > > diff --git a/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> > > b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> > > index e1b75ae..ecdae55 100644
> > > --- a/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> > > +++ b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> > > @@ -29,6 +29,12 @@
> > >  			interrupt-controller;
> > >  			#interrupt-cells = <2>;
> > >  		};
> > > +
> > > +		pm8350c_pwm4: pwm {
> > 
> > What does the '4' represent, an internal channel number? It should
> > probably be omitted if the PM8350 only has a single output PWM
> > port.
> > 
> 
> pm8350c has four PWMs, but I think we can drop the '4' here.

Why is only one PWM exposed if the PMIC has for of them? Why number 4
and not one of the others?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support
  2021-09-08 15:29       ` Matthias Kaehlcke
@ 2021-09-08 17:08         ` Bjorn Andersson
  2021-09-09  6:11           ` skakit
  0 siblings, 1 reply; 20+ messages in thread
From: Bjorn Andersson @ 2021-09-08 17:08 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: skakit, Pavel Machek, Rob Herring, Andy Gross, swboyd, kgunda,
	linux-leds, devicetree, linux-kernel, linux-arm-msm

On Wed 08 Sep 08:29 PDT 2021, Matthias Kaehlcke wrote:

> On Wed, Sep 08, 2021 at 02:37:39PM +0530, skakit@codeaurora.org wrote:
> > On 2021-09-07 23:46, Matthias Kaehlcke wrote:
> > > On Mon, Sep 06, 2021 at 04:11:07PM +0530, satya priya wrote:
> > > > Add pwm support for PM8350C pmic.
> > > > 
> > > > Signed-off-by: satya priya <skakit@codeaurora.org>
> > > > ---
> > > >  arch/arm64/boot/dts/qcom/pm8350c.dtsi | 6 ++++++
> > > >  1 file changed, 6 insertions(+)
> > > > 
> > > > diff --git a/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> > > > b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> > > > index e1b75ae..ecdae55 100644
> > > > --- a/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> > > > +++ b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
> > > > @@ -29,6 +29,12 @@
> > > >  			interrupt-controller;
> > > >  			#interrupt-cells = <2>;
> > > >  		};
> > > > +
> > > > +		pm8350c_pwm4: pwm {
> > > 
> > > What does the '4' represent, an internal channel number? It should
> > > probably be omitted if the PM8350 only has a single output PWM
> > > port.
> > > 
> > 
> > pm8350c has four PWMs, but I think we can drop the '4' here.
> 
> Why is only one PWM exposed if the PMIC has for of them? Why number 4
> and not one of the others?

The node should represent all 4 channels, which ones the board uses is
captured in how they are bound to other clients - or defines as LEDs by
additional child nodes.

Regards,
Bjorn

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver
  2021-09-08  9:17     ` skakit
@ 2021-09-08 17:11       ` Bjorn Andersson
  0 siblings, 0 replies; 20+ messages in thread
From: Bjorn Andersson @ 2021-09-08 17:11 UTC (permalink / raw)
  To: skakit
  Cc: Stephen Boyd, Andy Gross, Pavel Machek, Rob Herring, mka, kgunda,
	linux-leds, devicetree, linux-kernel, linux-arm-msm

On Wed 08 Sep 02:17 PDT 2021, skakit@codeaurora.org wrote:

> On 2021-09-08 01:50, Stephen Boyd wrote:
> > Quoting satya priya (2021-09-06 03:41:06)
> > > Add pm8350c compatible and lpg_data to the driver.
> > > 
> > > Signed-off-by: satya priya <skakit@codeaurora.org>
> > > ---
> > >  drivers/leds/rgb/leds-qcom-lpg.c | 10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > > 
> > > diff --git a/drivers/leds/rgb/leds-qcom-lpg.c
> > > b/drivers/leds/rgb/leds-qcom-lpg.c
> > > index 327e81a..6ee80d6 100644
> > > --- a/drivers/leds/rgb/leds-qcom-lpg.c
> > > +++ b/drivers/leds/rgb/leds-qcom-lpg.c
> > > @@ -1275,9 +1275,19 @@ static const struct lpg_data pm8150l_lpg_data
> > > = {
> > >         },
> > >  };
> > > 
> > > +static const struct lpg_data pm8350c_pwm_data = {
> > > +       .pwm_9bit_mask = BIT(2),
> > > +
> > > +       .num_channels = 1,
> > > +       .channels = (struct lpg_channel_data[]) {
> > 
> > Can this be const struct lpg_channel_data? I think that will move it to
> > rodata which is only a good thing.
> > 
> 
> I agree.
> @Bjorn, can we make it const struct?
> 

I like it and have updated the driver patches accordingly.


Seems like I still have a couple of more comments from Uwe left to
resolve on v9 of the driver, I'll fix those up and post the driver
again.

Thanks,
Bjorn

> > > +               { .base = 0xeb00 },
> > > +       },
> > > +};
> > > +
> > >  static const struct of_device_id lpg_of_table[] = {
> > >         { .compatible = "qcom,pm8150b-lpg", .data =
> > > &pm8150b_lpg_data },
> > >         { .compatible = "qcom,pm8150l-lpg", .data =
> > > &pm8150l_lpg_data },
> > > +       { .compatible = "qcom,pm8350c-pwm", .data =
> > > &pm8350c_pwm_data },
> > >         { .compatible = "qcom,pm8916-pwm", .data = &pm8916_pwm_data },
> > >         { .compatible = "qcom,pm8941-lpg", .data = &pm8941_lpg_data },
> > >         { .compatible = "qcom,pm8994-lpg", .data = &pm8994_lpg_data },

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support
  2021-09-08 17:08         ` Bjorn Andersson
@ 2021-09-09  6:11           ` skakit
  0 siblings, 0 replies; 20+ messages in thread
From: skakit @ 2021-09-09  6:11 UTC (permalink / raw)
  To: Bjorn Andersson, Matthias Kaehlcke
  Cc: Pavel Machek, Rob Herring, Andy Gross, swboyd, kgunda,
	linux-leds, devicetree, linux-kernel, linux-arm-msm

On 2021-09-08 22:38, Bjorn Andersson wrote:
> On Wed 08 Sep 08:29 PDT 2021, Matthias Kaehlcke wrote:
> 
>> On Wed, Sep 08, 2021 at 02:37:39PM +0530, skakit@codeaurora.org wrote:
>> > On 2021-09-07 23:46, Matthias Kaehlcke wrote:
>> > > On Mon, Sep 06, 2021 at 04:11:07PM +0530, satya priya wrote:
>> > > > Add pwm support for PM8350C pmic.
>> > > >
>> > > > Signed-off-by: satya priya <skakit@codeaurora.org>
>> > > > ---
>> > > >  arch/arm64/boot/dts/qcom/pm8350c.dtsi | 6 ++++++
>> > > >  1 file changed, 6 insertions(+)
>> > > >
>> > > > diff --git a/arch/arm64/boot/dts/qcom/pm8350c.dtsi
>> > > > b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
>> > > > index e1b75ae..ecdae55 100644
>> > > > --- a/arch/arm64/boot/dts/qcom/pm8350c.dtsi
>> > > > +++ b/arch/arm64/boot/dts/qcom/pm8350c.dtsi
>> > > > @@ -29,6 +29,12 @@
>> > > >  			interrupt-controller;
>> > > >  			#interrupt-cells = <2>;
>> > > >  		};
>> > > > +
>> > > > +		pm8350c_pwm4: pwm {
>> > >
>> > > What does the '4' represent, an internal channel number? It should
>> > > probably be omitted if the PM8350 only has a single output PWM
>> > > port.
>> > >
>> >
>> > pm8350c has four PWMs, but I think we can drop the '4' here.
>> 
>> Why is only one PWM exposed if the PMIC has for of them? Why number 4
>> and not one of the others?
> 

pwm4 is used for backlight support on kodiak crd board, so I mentioned 
4, thinking 4 nodes should be present for 4 pwms.
but I see that we need to represent all the four channels as one node. 
will drop the '4' in next version.

Thanks,
Satya Priya

> The node should represent all 4 channels, which ones the board uses is
> captured in how they are bound to other clients - or defines as LEDs by
> additional child nodes.
> 
> Regards,
> Bjorn

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-09-09  6:11 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06 10:41 [PATCH 0/3] Add PM8350C PMIC PWM support for backlight satya priya
2021-09-06 10:41 ` [PATCH 1/3] dt-bindings: leds: Add pm8350c pmic support satya priya
2021-09-07 17:48   ` Matthias Kaehlcke
2021-09-07 20:03   ` Stephen Boyd
2021-09-08 13:52   ` Rob Herring
2021-09-06 10:41 ` [PATCH 2/3] leds: Add pm8350c support to Qualcomm LPG driver satya priya
2021-09-07 17:54   ` Matthias Kaehlcke
2021-09-07 17:58     ` Matthias Kaehlcke
2021-09-07 18:02   ` Matthias Kaehlcke
2021-09-07 20:20   ` Stephen Boyd
2021-09-08  9:17     ` skakit
2021-09-08 17:11       ` Bjorn Andersson
2021-09-06 10:41 ` [PATCH 3/3] arm64: dts: qcom: pm8350c: Add pwm support satya priya
2021-09-07 18:16   ` Matthias Kaehlcke
2021-09-08  9:07     ` skakit
2021-09-08 15:29       ` Matthias Kaehlcke
2021-09-08 17:08         ` Bjorn Andersson
2021-09-09  6:11           ` skakit
2021-09-08  3:34   ` Stephen Boyd
2021-09-08  9:14     ` skakit

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).