Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1618127

Re: [PATCH v2] Extend pca9532 device tree support

From Pavel Machek <pavel@ucw.cz>
Newsgroups linux.kernel
Subject Re: [PATCH v2] Extend pca9532 device tree support
Date 2017-04-06 18:00 +0200
Message-ID <tthZg-2Gn-9@gated-at.bofh.it> (permalink)
References <tqIsW-70Q-21@gated-at.bofh.it> <trOZj-1KM-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi!

> > diff --git a/Documentation/devicetree/bindings/leds/leds-pca9532.txt b/Documentation/devicetree/bindings/leds/leds-pca9532.txt
> > index 198f3ba..8374075 100644
> > --- a/Documentation/devicetree/bindings/leds/leds-pca9532.txt
> > +++ b/Documentation/devicetree/bindings/leds/leds-pca9532.txt
> > @@ -17,6 +17,8 @@ Optional sub-node properties:
> >  	- label: see Documentation/devicetree/bindings/leds/common.txt
> >  	- type: Output configuration, see dt-bindings/leds/leds-pca9532.h (default NONE)
> >  	- linux,default-trigger: see Documentation/devicetree/bindings/leds/common.txt
> > +	- default-state: see Documentation/devicetree/bindings/leds/common.txt
> > +	  This property is only valid for sub-nodes of type <PCA9532_TYPE_LED>.
> >  
> >  Example:
> >    #include <dt-bindings/leds/leds-pca9532.h>
> > @@ -33,6 +35,14 @@ Example:
> >        label = "pca:green:power";
> >        type = <PCA9532_TYPE_LED>;
> >      };
> > +    kernel-booting {
> > +    	type = <PCA9532_TYPE_LED>;
> > +    	default-state = "on";
> > +    };
> > +    sys-stat {
> > +    	type = <PCA9532_TYPE_LED>;
> > +    	default-state = "keep"; // don't touch, was set by U-Boot
> > +    };
> 
> Adjusted above indentation to match the preceding lines.

> > @@ -475,6 +494,16 @@ pca9532_of_populate_pdata(struct device *dev, struct device_node *np)
> >  		of_property_read_u32(child, "type", &pdata->leds[i].type);
> >  		of_property_read_string(child, "linux,default-trigger",
> >  					&pdata->leds[i].default_trigger);
> > +		if (!of_property_read_string(child, "default-state", &state)) {
> > +			if (!strcmp(state, "on"))
> > +				pdata->leds[i].state = PCA9532_ON;
> > +			else if (!strcmp(state, "keep"))
> > +				pdata->leds[i].state = PCA9532_KEEP;
> > +			else if (!strcmp(state, "pwm0"))
> > +				pdata->leds[i].state = PCA9532_PWM0;
> > +			else if (!strcmp(state, "pwm1"))
> > +				pdata->leds[i].state = PCA9532_PWM1;
> > +		}
> >  		if (++i >= maxleds) {
> >  			of_node_put(child);
> >  			break;

This seems to look for "pwm0" and "pwm1" strings, which do not seem to
be documented.

Plus... is it useful to have default-state? We already have default
trigger. If we keep the value by default (on PC, we do something like
that) this patch should not be neccessary?
									Pavel
									
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] Extend pca9532 device tree support Felix Brack <fb@ltec.ch> - 2017-03-30 15:40 +0200
  Re: [PATCH v2] Extend pca9532 device tree support Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2017-04-02 16:50 +0200
    Re: [PATCH v2] Extend pca9532 device tree support Pavel Machek <pavel@ucw.cz> - 2017-04-06 18:00 +0200
      Re: [PATCH v2] Extend pca9532 device tree support Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2017-04-06 21:10 +0200
        Re: [PATCH v2] Extend pca9532 device tree support Felix Brack <fb@ltec.ch> - 2017-04-07 10:30 +0200
          default-state LED property (was Re: [PATCH v2] Extend pca9532 device  tree support) Pavel Machek <pavel@ucw.cz> - 2017-04-07 14:00 +0200
          Re: [PATCH v2] Extend pca9532 device tree support Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2017-04-09 14:40 +0200
            Re: [PATCH v2] Extend pca9532 device tree support Felix Brack <fb@ltec.ch> - 2017-04-09 15:20 +0200

csiph-web