diff mbox series

[2/3] leds: Add pm8350c support to Qualcomm LPG driver

Message ID 1630924867-4663-3-git-send-email-skakit@codeaurora.org
State New
Headers show
Series Add PM8350C PMIC PWM support for backlight | expand

Commit Message

Satya Priya Sept. 6, 2021, 10:41 a.m. UTC
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(+)

Comments

Matthias Kaehlcke Sept. 7, 2021, 5:54 p.m. UTC | #1
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.
Matthias Kaehlcke Sept. 7, 2021, 5:58 p.m. UTC | #2
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=*
Matthias Kaehlcke Sept. 7, 2021, 6:02 p.m. UTC | #3
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>
Stephen Boyd Sept. 7, 2021, 8:20 p.m. UTC | #4
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 },
Satya Priya Sept. 8, 2021, 9:17 a.m. UTC | #5
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 },
Bjorn Andersson Sept. 8, 2021, 5:11 p.m. UTC | #6
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 },
diff mbox series

Patch

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 },