devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
To: "Ivan T. Ivanov" <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Richard Purdie <rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org>,
	Grant Likely
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"Cavin,
	Courtney"
	<Courtney.Cavin-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v2 2/2] leds: add Qualcomm PM8941 WLED driver
Date: Thu, 29 Jan 2015 11:07:55 -0800	[thread overview]
Message-ID: <20150129190753.GN11960@sonymobile.com> (raw)
In-Reply-To: <1422535712.28891.3.camel-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>

On Thu 29 Jan 04:48 PST 2015, Ivan T. Ivanov wrote:

> 
> Hi Bjorn,
> 
> Just few nitpick comments. 
> 

Thanks.

> On Fri, 2015-01-23 at 16:54 -0800, Bjorn Andersson wrote:
> > From: Courtney Cavin cavin-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
> > 
> > This adds support for the WLED ('White' LED) block on Qualcomm's
> > PM8941 PMICs.
> > 
> > Signed-off-by: Courtney Cavin cavin-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
> > Signed-off-by: Bjorn Andersson andersson-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
> > ---
> >  drivers/leds/Kconfig            |   8 +
> >  drivers/leds/Makefile           |   1 +
> >  drivers/leds/leds-pm8941-wled.c | 459 ++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 468 insertions(+)
> >  create mode 100644 drivers/leds/leds-pm8941-wled.c
> > 
> 
> <snip>
> 
> > +
> > +#define PM8941_WLED_REG_VAL_BASE               0x40
> > +#define  PM8941_WLED_REG_VAL_MAX               0xFFF
> > +
> > +#define PM8941_WLED_REG_MOD_EN                 0x46
> > +#define  PM8941_WLED_REG_MOD_EN_BIT            BIT(7)
> > +#define  PM8941_WLED_REG_MOD_EN_MASK           BIT(7)
> 
> Is it possible bit definitions to have same indentation like registers offsets?
> 

Well, yes ;)

But I like the separation, so unless Bryan would like me to change it I prefer
to leave it as is.

> > 
> > +struct pm8941_wled_config {
> > +       u32 i_boost_limit;
> > +       u32 ovp;
> > +       u32 switch_freq;
> > +       u32 num_strings;
> > +       u32 i_limit;
> > +       bool cs_out_en;
> > +       bool ext_gen;
> > +       bool cabc_en;
> > +};
> > +
> 
> Could this be further squashed to bellow structure?
> 

It could, but I see that it would simplify things.

> > +struct pm8941_wled {
> > +       struct regmap *regmap;
> > +       u16 addr;
> > +
> > +       struct led_classdev cdev;
> > +
> > +       struct pm8941_wled_config cfg;
> > +};
> > +
> > 
> 
> <snip>
> 
> > +static void pm8941_wled_set_brightness(struct led_classdev *cdev,
> > +                                                                                       enum 
> > led_brightness value)
> > +{
> > +       if (pm8941_wled_set(cdev, value)) {
> 
> pm8941_wled_set() is used only here, could it be merged into this function?
>  

It could, but that would just mean that we move these lines into the tail of
pm8941_wled_set and replace all the returns with a bunch of gotos. So I don't
think it's cleaner.

> > +               dev_err(cdev->dev, "Unable to set brightness\n");
> > +               return;
> > +       }
> > +       cdev->brightness = value;
> > +}
> > +
> > 
> 
> Otherwise it looks good. Driver is loaded and device is detected
> properly (i have added readings for type and subtype registers).
> Do you know where I can measure result from changing brightness 
> sysfs entry. I am using 8074 dragonboard?
> 

I'm not sure how this is exposed on the dragonboard. I've tested it on Xperia
Z1 (honami) and the display lights up nicely.

Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-01-29 19:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-24  0:54 [PATCH v2 1/2] leds: add DT binding for Qualcomm PM8941 WLED block Bjorn Andersson
2015-01-24  0:54 ` [PATCH v2 2/2] leds: add Qualcomm PM8941 WLED driver Bjorn Andersson
2015-01-24  1:22   ` Bjorn Andersson
     [not found]   ` <1422060853-1067-2-git-send-email-bjorn.andersson-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
2015-01-29 12:48     ` Ivan T. Ivanov
     [not found]       ` <1422535712.28891.3.camel-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2015-01-29 19:07         ` Bjorn Andersson [this message]
2015-02-12 19:20           ` Bryan Wu
2015-02-13  4:07       ` Stephen Boyd
2015-02-13  4:28         ` Ivan T. Ivanov
2015-02-13  4:34           ` Stephen Boyd
2015-02-17 23:05         ` Bjorn Andersson
2015-02-13  4:04   ` Stephen Boyd
2015-02-17 22:14     ` Bryan Wu
     [not found]       ` <CAK5ve-KJK_aT_8sVmhtnTTJRZpdAvSGc45dtH-XH-E59wB=jXQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-17 22:30         ` Bjorn Andersson
     [not found]           ` <CAJAp7OgkY+zsp_Yfgnri2H7yv8xrwVMR9UugFv8oEh4x-Fs82g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-17 22:32             ` Bryan Wu
2015-02-17 23:13     ` Bjorn Andersson
2015-02-13  4:26   ` Stephen Boyd
2015-02-17 23:02     ` Bjorn Andersson
2015-02-18  2:45       ` Stephen Boyd
2015-02-18 14:54         ` Bjorn Andersson
2015-02-12 19:11 ` [PATCH v2 1/2] leds: add DT binding for Qualcomm PM8941 WLED block Bryan Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150129190753.GN11960@sonymobile.com \
    --to=bjorn.andersson-/mt0ovthwylzjqsbc5gl+g@public.gmane.org \
    --cc=Courtney.Cavin-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org \
    --cc=cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).