Re: [PATCH v4 2/2] leds: lm3697: Introduce the lm3697 driver

2018-08-17 Thread Jacek Anaszewski
Dan, On 08/16/2018 10:44 PM, Dan Murphy wrote: > Jacek > > On 08/16/2018 02:58 PM, Jacek Anaszewski wrote: >> Dan, >> >> Thank you for the patch. >> >> I didn't review DT parsing details in v3, but now I've produced >> diff between v3 and v4 to chec

Re: [PATCH v4 2/2] leds: lm3697: Introduce the lm3697 driver

2018-08-16 Thread Jacek Anaszewski
llocate register map: %d\n", > + ret); > + return ret; > + } > + > + ret = lm3697_probe_dt(led); > + if (ret) > + return ret; > + > + ret = lm3697_init(led); Let's simplify it: return lm3697_init(led); > + > + return ret; > +} > + > +static int lm3697_remove(struct i2c_client *client) > +{ > + struct lm3697 *led = i2c_get_clientdata(client); > + int ret; > + > + ret = regmap_update_bits(led->regmap, LM3697_CTRL_ENABLE, > + LM3697_CTRL_A_B_EN, 0); > + if (ret) { > + dev_err(>client->dev, "Failed to disable the device\n"); > + return ret; > + } > + > + if (led->enable_gpio) > + gpiod_direction_output(led->enable_gpio, 0); > + > + if (led->regulator) { > + ret = regulator_disable(led->regulator); > + if (ret) > + dev_err(>client->dev, > + "Failed to disable regulator\n"); > + } > + > + mutex_destroy(>lock); > + > + return 0; > +} > + > +static const struct i2c_device_id lm3697_id[] = { > + { "lm3697", 0 }, > + { } > +}; > +MODULE_DEVICE_TABLE(i2c, lm3697_id); > + > +static const struct of_device_id of_lm3697_leds_match[] = { > + { .compatible = "ti,lm3697", }, > + {}, > +}; > +MODULE_DEVICE_TABLE(of, of_lm3697_leds_match); > + > +static struct i2c_driver lm3697_driver = { > + .driver = { > + .name = "lm3697", > + .of_match_table = of_lm3697_leds_match, > + }, > + .probe = lm3697_probe, > + .remove = lm3697_remove, > + .id_table = lm3697_id, > +}; > +module_i2c_driver(lm3697_driver); > + > +MODULE_DESCRIPTION("Texas Instruments LM3697 LED driver"); > +MODULE_AUTHOR("Dan Murphy "); > +MODULE_LICENSE("GPL v2"); > -- Best regards, Jacek Anaszewski

Re: [PATCH v4 2/2] leds: lm3697: Introduce the lm3697 driver

2018-08-16 Thread Jacek Anaszewski
llocate register map: %d\n", > + ret); > + return ret; > + } > + > + ret = lm3697_probe_dt(led); > + if (ret) > + return ret; > + > + ret = lm3697_init(led); Let's simplify it: return lm3697_init(led); > + > + return ret; > +} > + > +static int lm3697_remove(struct i2c_client *client) > +{ > + struct lm3697 *led = i2c_get_clientdata(client); > + int ret; > + > + ret = regmap_update_bits(led->regmap, LM3697_CTRL_ENABLE, > + LM3697_CTRL_A_B_EN, 0); > + if (ret) { > + dev_err(>client->dev, "Failed to disable the device\n"); > + return ret; > + } > + > + if (led->enable_gpio) > + gpiod_direction_output(led->enable_gpio, 0); > + > + if (led->regulator) { > + ret = regulator_disable(led->regulator); > + if (ret) > + dev_err(>client->dev, > + "Failed to disable regulator\n"); > + } > + > + mutex_destroy(>lock); > + > + return 0; > +} > + > +static const struct i2c_device_id lm3697_id[] = { > + { "lm3697", 0 }, > + { } > +}; > +MODULE_DEVICE_TABLE(i2c, lm3697_id); > + > +static const struct of_device_id of_lm3697_leds_match[] = { > + { .compatible = "ti,lm3697", }, > + {}, > +}; > +MODULE_DEVICE_TABLE(of, of_lm3697_leds_match); > + > +static struct i2c_driver lm3697_driver = { > + .driver = { > + .name = "lm3697", > + .of_match_table = of_lm3697_leds_match, > + }, > + .probe = lm3697_probe, > + .remove = lm3697_remove, > + .id_table = lm3697_id, > +}; > +module_i2c_driver(lm3697_driver); > + > +MODULE_DESCRIPTION("Texas Instruments LM3697 LED driver"); > +MODULE_AUTHOR("Dan Murphy "); > +MODULE_LICENSE("GPL v2"); > -- Best regards, Jacek Anaszewski

Re: [PATCH v4 1/2] dt-bindings: leds: Add bindings for lm3697 driver

2018-08-16 Thread Jacek Anaszewski
<0x36>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + enable-gpios = < 28 GPIO_ACTIVE_HIGH>; > + vled-supply = <>; > + > + led@0 { > + reg = <0>; > + led-sources = <1 1 1>; > + label = "white:backlight_cluster"; > + linux,default-trigger = "backlight"; > + }; > +} > + > +For more product information please see the link below: > +http://www.ti.com/lit/ds/symlink/lm3697.pdf > -- Best regards, Jacek Anaszewski

Re: [PATCH v4 1/2] dt-bindings: leds: Add bindings for lm3697 driver

2018-08-16 Thread Jacek Anaszewski
<0x36>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + enable-gpios = < 28 GPIO_ACTIVE_HIGH>; > + vled-supply = <>; > + > + led@0 { > + reg = <0>; > + led-sources = <1 1 1>; > + label = "white:backlight_cluster"; > + linux,default-trigger = "backlight"; > + }; > +} > + > +For more product information please see the link below: > +http://www.ti.com/lit/ds/symlink/lm3697.pdf > -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] dt-bindings: leds: Add bindings for lm3697 driver

2018-08-15 Thread Jacek Anaszewski
Dan, On 08/15/2018 07:30 PM, Dan Murphy wrote: > Jacek > > On 08/15/2018 11:56 AM, Jacek Anaszewski wrote: >> Hi Dan, >> >> Thank you for the update. >> >> On 08/15/2018 06:17 PM, Dan Murphy wrote: >>> Add the device tree bindings for the lm

Re: [PATCH v3 1/2] dt-bindings: leds: Add bindings for lm3697 driver

2018-08-15 Thread Jacek Anaszewski
Dan, On 08/15/2018 07:30 PM, Dan Murphy wrote: > Jacek > > On 08/15/2018 11:56 AM, Jacek Anaszewski wrote: >> Hi Dan, >> >> Thank you for the update. >> >> On 08/15/2018 06:17 PM, Dan Murphy wrote: >>> Add the device tree bindings for the lm

Re: [PATCH v3 1/2] dt-bindings: leds: Add bindings for lm3697 driver

2018-08-15 Thread Jacek Anaszewski
;0x36>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + enable-gpios = < 28 GPIO_ACTIVE_HIGH>; > + vled-supply = <>; > + > + led@0 { > + reg = <0>; > + led-sources = <0x1 0x2 0x3>; led-sources = <1 1 1>; > + label = "white:backlight_cluster"; > + linux,default-trigger = "backlight"; > + }; > +} > + > +For more product information please see the link below: > +http://www.ti.com/lit/ds/symlink/lm3697.pdf > -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] dt-bindings: leds: Add bindings for lm3697 driver

2018-08-15 Thread Jacek Anaszewski
;0x36>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + enable-gpios = < 28 GPIO_ACTIVE_HIGH>; > + vled-supply = <>; > + > + led@0 { > + reg = <0>; > + led-sources = <0x1 0x2 0x3>; led-sources = <1 1 1>; > + label = "white:backlight_cluster"; > + linux,default-trigger = "backlight"; > + }; > +} > + > +For more product information please see the link below: > +http://www.ti.com/lit/ds/symlink/lm3697.pdf > -- Best regards, Jacek Anaszewski

[GIT PULL] LED updates for 4.19-rc1

2018-08-13 Thread Jacek Anaszewski
who can actually test and confirm that the netdev trigger works for can devices. Thanks, Jacek Anaszewski The following changes since commit ce397d215ccd07b8ae3f71db689aedb85d56ab40: Linux 4.18-rc1 (2018-06-17 08:04:49 +0900) are available in the git repository at: git

[GIT PULL] LED updates for 4.19-rc1

2018-08-13 Thread Jacek Anaszewski
who can actually test and confirm that the netdev trigger works for can devices. Thanks, Jacek Anaszewski The following changes since commit ce397d215ccd07b8ae3f71db689aedb85d56ab40: Linux 4.18-rc1 (2018-06-17 08:04:49 +0900) are available in the git repository at: git

Re: [PATCH v5 1/2] leds: core: Introduce LED pattern trigger

2018-08-10 Thread Jacek Anaszewski
Hi Baolin, On 08/10/2018 05:26 PM, Baolin Wang wrote: > Hi Jacek, > > On 9 August 2018 at 21:21, Jacek Anaszewski > wrote: >> Hi Baolin, >> >> On 08/09/2018 07:48 AM, Baolin Wang wrote: >> [...] >>>>>>> +static int

Re: [PATCH v5 1/2] leds: core: Introduce LED pattern trigger

2018-08-10 Thread Jacek Anaszewski
Hi Baolin, On 08/10/2018 05:26 PM, Baolin Wang wrote: > Hi Jacek, > > On 9 August 2018 at 21:21, Jacek Anaszewski > wrote: >> Hi Baolin, >> >> On 08/09/2018 07:48 AM, Baolin Wang wrote: >> [...] >>>>>>> +static int

Re: [PATCH v2 1/2] dt: bindings: lm3697: Add bindings for lm3697 driver

2018-08-09 Thread Jacek Anaszewski
Dan, On 08/09/2018 03:30 PM, Dan Murphy wrote: > Jacek and Pavel > > On 08/09/2018 07:09 AM, Jacek Anaszewski wrote: >> Dan, >> >> On 08/08/2018 11:45 PM, Dan Murphy wrote: >>> Jacek >>> >>> On 08/08/2018 04:09 PM, Jacek Anaszewski wrote: >

Re: [PATCH v2 1/2] dt: bindings: lm3697: Add bindings for lm3697 driver

2018-08-09 Thread Jacek Anaszewski
Dan, On 08/09/2018 03:30 PM, Dan Murphy wrote: > Jacek and Pavel > > On 08/09/2018 07:09 AM, Jacek Anaszewski wrote: >> Dan, >> >> On 08/08/2018 11:45 PM, Dan Murphy wrote: >>> Jacek >>> >>> On 08/08/2018 04:09 PM, Jacek Anaszewski wrote: >

Re: [PATCH v5 1/2] leds: core: Introduce LED pattern trigger

2018-08-09 Thread Jacek Anaszewski
for rising edge could look like (assuming we stop at 254): 0 1 2 1 4 1 6 1 8 1 10 1 ... 254 1 Now, I'm starting to wonder if we shouldn't have specialized trigger for breathing patterns, that would accept brightness level change per time period. Pattern trigger needs more flexibility and inferring if the hardware can handle given series of pattern intervals would entail unnecessary code complexity. Such breathing trigger would require triplets comprised of start brightness, end brightness and a duration of the brightness transition. -- Best regards, Jacek Anaszewski

Re: [PATCH v5 1/2] leds: core: Introduce LED pattern trigger

2018-08-09 Thread Jacek Anaszewski
for rising edge could look like (assuming we stop at 254): 0 1 2 1 4 1 6 1 8 1 10 1 ... 254 1 Now, I'm starting to wonder if we shouldn't have specialized trigger for breathing patterns, that would accept brightness level change per time period. Pattern trigger needs more flexibility and inferring if the hardware can handle given series of pattern intervals would entail unnecessary code complexity. Such breathing trigger would require triplets comprised of start brightness, end brightness and a duration of the brightness transition. -- Best regards, Jacek Anaszewski

Re: [PATCH v2 1/2] dt: bindings: lm3697: Add bindings for lm3697 driver

2018-08-09 Thread Jacek Anaszewski
Dan, On 08/08/2018 11:45 PM, Dan Murphy wrote: > Jacek > > On 08/08/2018 04:09 PM, Jacek Anaszewski wrote: >> Hi Dan, >> >> On 08/08/2018 11:04 PM, Dan Murphy wrote: >>> On 08/08/2018 04:02 PM, Pavel Machek wrote: >>>> Hi! >>>> >>

Re: [PATCH v2 1/2] dt: bindings: lm3697: Add bindings for lm3697 driver

2018-08-09 Thread Jacek Anaszewski
Dan, On 08/08/2018 11:45 PM, Dan Murphy wrote: > Jacek > > On 08/08/2018 04:09 PM, Jacek Anaszewski wrote: >> Hi Dan, >> >> On 08/08/2018 11:04 PM, Dan Murphy wrote: >>> On 08/08/2018 04:02 PM, Pavel Machek wrote: >>>> Hi! >>>> >>

Re: [PATCH v5 1/2] leds: core: Introduce LED pattern trigger

2018-08-08 Thread Jacek Anaszewski
Hi Baolin, On 08/08/2018 08:01 AM, Baolin Wang wrote: > Hi Jacek, > > On 8 August 2018 at 05:54, Jacek Anaszewski > wrote: >> Hi Baolin, >> >> Thank you for addressing the review remarks. >> Since the patch set is targeted for 4.19, then we have thr

Re: [PATCH v5 1/2] leds: core: Introduce LED pattern trigger

2018-08-08 Thread Jacek Anaszewski
Hi Baolin, On 08/08/2018 08:01 AM, Baolin Wang wrote: > Hi Jacek, > > On 8 August 2018 at 05:54, Jacek Anaszewski > wrote: >> Hi Baolin, >> >> Thank you for addressing the review remarks. >> Since the patch set is targeted for 4.19, then we have thr

Re: [PATCH v2 1/2] dt: bindings: lm3697: Add bindings for lm3697 driver

2018-08-08 Thread Jacek Anaszewski
ank A can control 2 >>> LED strings and control >>> bank b can control 1 LED string. >>> >> >> Can we forget about the LED strings, and just expose the sinks as >> Linux LED devices? > > 2 sinks 3 LED strings. How do you know which LED string is which and what > bank it belongs > to when setting the brightness. Each Bank has a separate register for > brightness control. Just a blind shot, without going into details - could you please check if led-sources property documented in the common LED bindings couldn't help here? -- Best regards, Jacek Anaszewski

Re: [PATCH v2 1/2] dt: bindings: lm3697: Add bindings for lm3697 driver

2018-08-08 Thread Jacek Anaszewski
ank A can control 2 >>> LED strings and control >>> bank b can control 1 LED string. >>> >> >> Can we forget about the LED strings, and just expose the sinks as >> Linux LED devices? > > 2 sinks 3 LED strings. How do you know which LED string is which and what > bank it belongs > to when setting the brightness. Each Bank has a separate register for > brightness control. Just a blind shot, without going into details - could you please check if led-sources property documented in the common LED bindings couldn't help here? -- Best regards, Jacek Anaszewski

Re: [PATCH v2 1/2] dt: bindings: lm3697: Add bindings for lm3697 driver

2018-08-08 Thread Jacek Anaszewski
Hi Michal. Thanks for the heads-up. "dt-" prefix is indeed more preferred than "dt: ". Dan - I will fix it by myself, no need to resend. Best regards, Jacek Anaszewski On 08/08/2018 09:56 AM, Michal Vokáč wrote: > On 7.8.2018 18:04, Dan Murphy wrote: >>

Re: [PATCH v2 1/2] dt: bindings: lm3697: Add bindings for lm3697 driver

2018-08-08 Thread Jacek Anaszewski
Hi Michal. Thanks for the heads-up. "dt-" prefix is indeed more preferred than "dt: ". Dan - I will fix it by myself, no need to resend. Best regards, Jacek Anaszewski On 08/08/2018 09:56 AM, Michal Vokáč wrote: > On 7.8.2018 18:04, Dan Murphy wrote: >>

Re: [PATCH v5 1/2] leds: core: Introduce LED pattern trigger

2018-08-07 Thread Jacek Anaszewski
s coming to mind: - an interface will be provided to determine max difference between the settings supported by the hardware and the settings requested by the user, that will result in aligning user's setting to the hardware capabilities - the above alignment rate will be predefined instead - hardware engine will be used only if user requests supported settings on the whole span of the requested pattern - in each of the above cases it would be worth to think of the interface to show the scope of the settings supported by hardware The same issue applies to the already available timer trigger. So far the policy implemented by the drivers implementing blink_set op varies. -- Best regards, Jacek Anaszewski

Re: [PATCH v5 1/2] leds: core: Introduce LED pattern trigger

2018-08-07 Thread Jacek Anaszewski
s coming to mind: - an interface will be provided to determine max difference between the settings supported by the hardware and the settings requested by the user, that will result in aligning user's setting to the hardware capabilities - the above alignment rate will be predefined instead - hardware engine will be used only if user requests supported settings on the whole span of the requested pattern - in each of the above cases it would be worth to think of the interface to show the scope of the settings supported by hardware The same issue applies to the already available timer trigger. So far the policy implemented by the drivers implementing blink_set op varies. -- Best regards, Jacek Anaszewski

Re: [PATCH v4 1/2] leds: core: Introduce LED pattern trigger

2018-08-06 Thread Jacek Anaszewski
= led_cdev->trigger_data; >>> + unsigned long res; >>> + int err; >>> + >>> + err = kstrtoul(buf, 10, ); >>> + if (err) >>> + return err; >>> + >>> + if (!led_cdev->pattern_set) >>> + del_timer_sync(>timer); >> >> Is there a reason for not having this check under mutex? > > We will hold the mutex in pattern_trig_timer_function(), so if we do > del_timer_sync() under the mutex protection, we may meet dead-lock > issue. Moreover, the del_timer_sync() will make sure deactivating one > timer is safe. Ack. -- Best regards, Jacek Anaszewski

Re: [PATCH v4 1/2] leds: core: Introduce LED pattern trigger

2018-08-06 Thread Jacek Anaszewski
= led_cdev->trigger_data; >>> + unsigned long res; >>> + int err; >>> + >>> + err = kstrtoul(buf, 10, ); >>> + if (err) >>> + return err; >>> + >>> + if (!led_cdev->pattern_set) >>> + del_timer_sync(>timer); >> >> Is there a reason for not having this check under mutex? > > We will hold the mutex in pattern_trig_timer_function(), so if we do > del_timer_sync() under the mutex protection, we may meet dead-lock > issue. Moreover, the del_timer_sync() will make sure deactivating one > timer is safe. Ack. -- Best regards, Jacek Anaszewski

Re: [PATCH v4 1/2] leds: core: Introduce LED pattern trigger

2018-08-05 Thread Jacek Anaszewski
rn_trig_exit); > + > +MODULE_AUTHOR("Raphael Teysseyre +MODULE_AUTHOR("Baolin Wang +MODULE_DESCRIPTION("LED Pattern trigger"); > +MODULE_LICENSE("GPL v2"); > diff --git a/include/linux/leds.h b/include/linux/leds.h > index 834683d..c54712c 100644 > --- a/include/linux/leds.h > +++ b/include/linux/leds.h > @@ -22,6 +22,7 @@ > #include > > struct device; > +struct led_pattern; > /* > * LED Core > */ > @@ -88,6 +89,11 @@ struct led_classdev { >unsigned long *delay_on, >unsigned long *delay_off); > > + int (*pattern_set)(struct led_classdev *led_cdev, > +struct led_pattern *pattern, int len, > +unsigned repeat); > + int (*pattern_clear)(struct led_classdev *led_cdev); > + > struct device *dev; > const struct attribute_group**groups; > > @@ -472,4 +478,14 @@ static inline void > led_classdev_notify_brightness_hw_changed( > struct led_classdev *led_cdev, enum led_brightness brightness) { } > #endif > > +/** > + * struct led_pattern - brightness value in a pattern Since this structure describes single pattern interval and not the whole pattern, please change its description to: pattern interval settings > + * @delta_t: delay until next entry, in milliseconds @delta_t: pattern interval delay, in milliseconds > + * @brightness: brightness at time = 0 @brightness: pattern interval brightness > + */ > +struct led_pattern { > + int delta_t; > + int brightness; > +}; > + > #endif /* __LINUX_LEDS_H_INCLUDED */ > -- Best regards, Jacek Anaszewski

Re: [PATCH v4 1/2] leds: core: Introduce LED pattern trigger

2018-08-05 Thread Jacek Anaszewski
rn_trig_exit); > + > +MODULE_AUTHOR("Raphael Teysseyre +MODULE_AUTHOR("Baolin Wang +MODULE_DESCRIPTION("LED Pattern trigger"); > +MODULE_LICENSE("GPL v2"); > diff --git a/include/linux/leds.h b/include/linux/leds.h > index 834683d..c54712c 100644 > --- a/include/linux/leds.h > +++ b/include/linux/leds.h > @@ -22,6 +22,7 @@ > #include > > struct device; > +struct led_pattern; > /* > * LED Core > */ > @@ -88,6 +89,11 @@ struct led_classdev { >unsigned long *delay_on, >unsigned long *delay_off); > > + int (*pattern_set)(struct led_classdev *led_cdev, > +struct led_pattern *pattern, int len, > +unsigned repeat); > + int (*pattern_clear)(struct led_classdev *led_cdev); > + > struct device *dev; > const struct attribute_group**groups; > > @@ -472,4 +478,14 @@ static inline void > led_classdev_notify_brightness_hw_changed( > struct led_classdev *led_cdev, enum led_brightness brightness) { } > #endif > > +/** > + * struct led_pattern - brightness value in a pattern Since this structure describes single pattern interval and not the whole pattern, please change its description to: pattern interval settings > + * @delta_t: delay until next entry, in milliseconds @delta_t: pattern interval delay, in milliseconds > + * @brightness: brightness at time = 0 @brightness: pattern interval brightness > + */ > +struct led_pattern { > + int delta_t; > + int brightness; > +}; > + > #endif /* __LINUX_LEDS_H_INCLUDED */ > -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] leds: core: Introduce LED pattern trigger

2018-08-04 Thread Jacek Anaszewski
d_trigger_register(_led_trigger); > +} > + > +static void __exit pattern_trig_exit(void) > +{ > + led_trigger_unregister(_led_trigger); > +} > + > +module_init(pattern_trig_init); > +module_exit(pattern_trig_exit); > + > +MODULE_AUTHOR("Raphael Teysseyre +MODULE_AUTHOR("Baolin Wang +MODULE_DESCRIPTION("LED Pattern trigger"); > +MODULE_LICENSE("GPL v2"); > diff --git a/include/linux/leds.h b/include/linux/leds.h > index 834683d..c54712c 100644 > --- a/include/linux/leds.h > +++ b/include/linux/leds.h > @@ -22,6 +22,7 @@ > #include > > struct device; > +struct led_pattern; > /* > * LED Core > */ > @@ -88,6 +89,11 @@ struct led_classdev { >unsigned long *delay_on, >unsigned long *delay_off); > > + int (*pattern_set)(struct led_classdev *led_cdev, > +struct led_pattern *pattern, int len, > +unsigned repeat); > + int (*pattern_clear)(struct led_classdev *led_cdev); > + > struct device *dev; > const struct attribute_group**groups; > > @@ -472,4 +478,14 @@ static inline void > led_classdev_notify_brightness_hw_changed( > struct led_classdev *led_cdev, enum led_brightness brightness) { } > #endif > > +/** > + * struct led_pattern - brightness value in a pattern > + * @delta_t: delay until next entry, in milliseconds > + * @brightness: brightness at time = 0 > + */ > +struct led_pattern { > + int delta_t; > + int brightness; > +}; > + > #endif /* __LINUX_LEDS_H_INCLUDED */ > -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] leds: core: Introduce LED pattern trigger

2018-08-04 Thread Jacek Anaszewski
d_trigger_register(_led_trigger); > +} > + > +static void __exit pattern_trig_exit(void) > +{ > + led_trigger_unregister(_led_trigger); > +} > + > +module_init(pattern_trig_init); > +module_exit(pattern_trig_exit); > + > +MODULE_AUTHOR("Raphael Teysseyre +MODULE_AUTHOR("Baolin Wang +MODULE_DESCRIPTION("LED Pattern trigger"); > +MODULE_LICENSE("GPL v2"); > diff --git a/include/linux/leds.h b/include/linux/leds.h > index 834683d..c54712c 100644 > --- a/include/linux/leds.h > +++ b/include/linux/leds.h > @@ -22,6 +22,7 @@ > #include > > struct device; > +struct led_pattern; > /* > * LED Core > */ > @@ -88,6 +89,11 @@ struct led_classdev { >unsigned long *delay_on, >unsigned long *delay_off); > > + int (*pattern_set)(struct led_classdev *led_cdev, > +struct led_pattern *pattern, int len, > +unsigned repeat); > + int (*pattern_clear)(struct led_classdev *led_cdev); > + > struct device *dev; > const struct attribute_group**groups; > > @@ -472,4 +478,14 @@ static inline void > led_classdev_notify_brightness_hw_changed( > struct led_classdev *led_cdev, enum led_brightness brightness) { } > #endif > > +/** > + * struct led_pattern - brightness value in a pattern > + * @delta_t: delay until next entry, in milliseconds > + * @brightness: brightness at time = 0 > + */ > +struct led_pattern { > + int delta_t; > + int brightness; > +}; > + > #endif /* __LINUX_LEDS_H_INCLUDED */ > -- Best regards, Jacek Anaszewski

Re: [PATCH 1/2] di: bindings: lm3697: Introduce the lm3697 driver

2018-08-04 Thread Jacek Anaszewski
Hi Dan, Thank you for the patch. Typo in the patch title: s/di: /dt-/ And maybe let's change the following text to: "Add bindings for lm3697 LED driver" Best regards, Jacek Anaszewski On 08/03/2018 05:02 PM, Dan Murphy wrote: > Introduce the device tree bindings for the lm3697

Re: [PATCH 1/2] di: bindings: lm3697: Introduce the lm3697 driver

2018-08-04 Thread Jacek Anaszewski
Hi Dan, Thank you for the patch. Typo in the patch title: s/di: /dt-/ And maybe let's change the following text to: "Add bindings for lm3697 LED driver" Best regards, Jacek Anaszewski On 08/03/2018 05:02 PM, Dan Murphy wrote: > Introduce the device tree bindings for the lm3697

Re: [PATCH 1/2] di: bindings: lm3697: Introduce the lm3697 driver

2018-08-04 Thread Jacek Anaszewski
Hi Dan, Thank you for the patch. Typo in the patch title: s/di: /dt-/ And maybe let's change the following text to: "Add bindings for lm3697 LED driver" Best regards, Jacek Anaszewski On 08/03/2018 05:02 PM, Dan Murphy wrote: > Introduce the device tree bindings for the lm3697

Re: [PATCH 1/2] di: bindings: lm3697: Introduce the lm3697 driver

2018-08-04 Thread Jacek Anaszewski
Hi Dan, Thank you for the patch. Typo in the patch title: s/di: /dt-/ And maybe let's change the following text to: "Add bindings for lm3697 LED driver" Best regards, Jacek Anaszewski On 08/03/2018 05:02 PM, Dan Murphy wrote: > Introduce the device tree bindings for the lm3697

Re: [PATCH 2/2] leds: lm3697: Introduce the lm3697 driver

2018-08-04 Thread Jacek Anaszewski
697_probe_dt(led); > + if (ret) > + return ret; > + > + ret = lm3697_init(led); > + if (ret) > + return ret; > + > + return ret; > +} > + > +static int lm3697_remove(struct i2c_client *client) > +{ > + struct lm3697 *led = i2c_get_clientdata(client); > + int ret; > + > + ret = regmap_update_bits(led->regmap, LM3697_CTRL_ENABLE, > + LM3697_CTRL_A_B_EN, 0); > + if (ret) { > + dev_err(>client->dev, "Failed to disable regulator\n"); > + return ret; > + } > + > + if (led->enable_gpio) > + gpiod_direction_output(led->enable_gpio, 0); > + > + if (led->regulator) { > + ret = regulator_disable(led->regulator); > + if (ret) > + dev_err(>client->dev, > + "Failed to disable regulator\n"); > + } > + > + mutex_destroy(>lock); > + > + return 0; > +} > + > +static const struct i2c_device_id lm3697_id[] = { > + { "lm3697", 0 }, > + { } > +}; > +MODULE_DEVICE_TABLE(i2c, lm3697_id); > + > +static const struct of_device_id of_lm3697_leds_match[] = { > + { .compatible = "ti,lm3697", }, > + {}, > +}; > +MODULE_DEVICE_TABLE(of, of_lm3697_leds_match); > + > +static struct i2c_driver lm3697_driver = { > + .driver = { > + .name = "lm3697", > + .of_match_table = of_lm3697_leds_match, > + }, > + .probe = lm3697_probe, > + .remove = lm3697_remove, > + .id_table = lm3697_id, > +}; > +module_i2c_driver(lm3697_driver); > + > +MODULE_DESCRIPTION("Texas Instruments LM3697 LED driver"); > +MODULE_AUTHOR("Dan Murphy "); > +MODULE_LICENSE("GPL v2"); > -- Best regards, Jacek Anaszewski

Re: [PATCH 2/2] leds: lm3697: Introduce the lm3697 driver

2018-08-04 Thread Jacek Anaszewski
697_probe_dt(led); > + if (ret) > + return ret; > + > + ret = lm3697_init(led); > + if (ret) > + return ret; > + > + return ret; > +} > + > +static int lm3697_remove(struct i2c_client *client) > +{ > + struct lm3697 *led = i2c_get_clientdata(client); > + int ret; > + > + ret = regmap_update_bits(led->regmap, LM3697_CTRL_ENABLE, > + LM3697_CTRL_A_B_EN, 0); > + if (ret) { > + dev_err(>client->dev, "Failed to disable regulator\n"); > + return ret; > + } > + > + if (led->enable_gpio) > + gpiod_direction_output(led->enable_gpio, 0); > + > + if (led->regulator) { > + ret = regulator_disable(led->regulator); > + if (ret) > + dev_err(>client->dev, > + "Failed to disable regulator\n"); > + } > + > + mutex_destroy(>lock); > + > + return 0; > +} > + > +static const struct i2c_device_id lm3697_id[] = { > + { "lm3697", 0 }, > + { } > +}; > +MODULE_DEVICE_TABLE(i2c, lm3697_id); > + > +static const struct of_device_id of_lm3697_leds_match[] = { > + { .compatible = "ti,lm3697", }, > + {}, > +}; > +MODULE_DEVICE_TABLE(of, of_lm3697_leds_match); > + > +static struct i2c_driver lm3697_driver = { > + .driver = { > + .name = "lm3697", > + .of_match_table = of_lm3697_leds_match, > + }, > + .probe = lm3697_probe, > + .remove = lm3697_remove, > + .id_table = lm3697_id, > +}; > +module_i2c_driver(lm3697_driver); > + > +MODULE_DESCRIPTION("Texas Instruments LM3697 LED driver"); > +MODULE_AUTHOR("Dan Murphy "); > +MODULE_LICENSE("GPL v2"); > -- Best regards, Jacek Anaszewski

Re: [PATCH v2 1/2] leds: core: Introduce LED pattern trigger

2018-08-03 Thread Jacek Anaszewski
Hi Baolin, On 08/03/2018 10:05 AM, Baolin Wang wrote: > Hi Jacek, > > On 3 August 2018 at 05:21, Jacek Anaszewski > wrote: >> Hi Baolin, >> >> Thank you for addressing review remarks. >> >> I've played a bit with the interface and I have one concl

Re: [PATCH v2 1/2] leds: core: Introduce LED pattern trigger

2018-08-03 Thread Jacek Anaszewski
Hi Baolin, On 08/03/2018 10:05 AM, Baolin Wang wrote: > Hi Jacek, > > On 3 August 2018 at 05:21, Jacek Anaszewski > wrote: >> Hi Baolin, >> >> Thank you for addressing review remarks. >> >> I've played a bit with the interface and I have one concl

Re: [PATCH v2 1/2] leds: core: Introduce LED pattern trigger

2018-08-02 Thread Jacek Anaszewski
{ > + led_trigger_unregister(_led_trigger); > +} > + > +module_init(pattern_trig_init); > +module_exit(pattern_trig_exit); > + > +MODULE_AUTHOR("Raphael Teysseyre +MODULE_AUTHOR("Baolin Wang +MODULE_DESCRIPTION("LED Pattern trigger"); > +MODULE_LICENSE("GPL v2"); > diff --git a/include/linux/leds.h b/include/linux/leds.h > index 834683d..c54712c 100644 > --- a/include/linux/leds.h > +++ b/include/linux/leds.h > @@ -22,6 +22,7 @@ > #include > > struct device; > +struct led_pattern; > /* > * LED Core > */ > @@ -88,6 +89,11 @@ struct led_classdev { >unsigned long *delay_on, >unsigned long *delay_off); > > + int (*pattern_set)(struct led_classdev *led_cdev, > +struct led_pattern *pattern, int len, > +unsigned repeat); > + int (*pattern_clear)(struct led_classdev *led_cdev); > + > struct device *dev; > const struct attribute_group**groups; > > @@ -472,4 +478,14 @@ static inline void > led_classdev_notify_brightness_hw_changed( > struct led_classdev *led_cdev, enum led_brightness brightness) { } > #endif > > +/** > + * struct led_pattern - brightness value in a pattern > + * @delta_t: delay until next entry, in milliseconds > + * @brightness: brightness at time = 0 > + */ > +struct led_pattern { > + int delta_t; > + int brightness; > +}; > + > #endif /* __LINUX_LEDS_H_INCLUDED */ > -- Best regards, Jacek Anaszewski

Re: [PATCH v2 1/2] leds: core: Introduce LED pattern trigger

2018-08-02 Thread Jacek Anaszewski
{ > + led_trigger_unregister(_led_trigger); > +} > + > +module_init(pattern_trig_init); > +module_exit(pattern_trig_exit); > + > +MODULE_AUTHOR("Raphael Teysseyre +MODULE_AUTHOR("Baolin Wang +MODULE_DESCRIPTION("LED Pattern trigger"); > +MODULE_LICENSE("GPL v2"); > diff --git a/include/linux/leds.h b/include/linux/leds.h > index 834683d..c54712c 100644 > --- a/include/linux/leds.h > +++ b/include/linux/leds.h > @@ -22,6 +22,7 @@ > #include > > struct device; > +struct led_pattern; > /* > * LED Core > */ > @@ -88,6 +89,11 @@ struct led_classdev { >unsigned long *delay_on, >unsigned long *delay_off); > > + int (*pattern_set)(struct led_classdev *led_cdev, > +struct led_pattern *pattern, int len, > +unsigned repeat); > + int (*pattern_clear)(struct led_classdev *led_cdev); > + > struct device *dev; > const struct attribute_group**groups; > > @@ -472,4 +478,14 @@ static inline void > led_classdev_notify_brightness_hw_changed( > struct led_classdev *led_cdev, enum led_brightness brightness) { } > #endif > > +/** > + * struct led_pattern - brightness value in a pattern > + * @delta_t: delay until next entry, in milliseconds > + * @brightness: brightness at time = 0 > + */ > +struct led_pattern { > + int delta_t; > + int brightness; > +}; > + > #endif /* __LINUX_LEDS_H_INCLUDED */ > -- Best regards, Jacek Anaszewski

Re: [PATCH] leds: add APU3 dmi information to leds-apu

2018-07-31 Thread Jacek Anaszewski
Hi Florian, Thank you for the patch. Please check the patch, which is in linux-next already: https://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git/commit/?h=for-next=8cb21086cc6359c6d4f003a788050308afb211ad It seems to have added the support you want. Best regards, Jacek

Re: [PATCH] leds: add APU3 dmi information to leds-apu

2018-07-31 Thread Jacek Anaszewski
Hi Florian, Thank you for the patch. Please check the patch, which is in linux-next already: https://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git/commit/?h=for-next=8cb21086cc6359c6d4f003a788050308afb211ad It seems to have added the support you want. Best regards, Jacek

Re: [PATCH 1/2] leds: core: Introduce LED pattern trigger

2018-07-31 Thread Jacek Anaszewski
gt; +{ > + return led_trigger_register(_led_trigger); > +} > + > +static void __exit pattern_trig_exit(void) > +{ > + led_trigger_unregister(_led_trigger); > +} > + > +module_init(pattern_trig_init); > +module_exit(pattern_trig_exit); > + > +MODULE_AUTHOR("Raphael Teysseyre +MODULE_AUTHOR("Baolin Wang +MODULE_DESCRIPTION("LED Pattern trigger"); > +MODULE_LICENSE("GPL v2"); > diff --git a/include/linux/leds.h b/include/linux/leds.h > index b7e8255..bea02f0 100644 > --- a/include/linux/leds.h > +++ b/include/linux/leds.h > @@ -22,6 +22,7 @@ > #include > > struct device; > +struct led_pattern; > /* > * LED Core > */ > @@ -88,6 +89,14 @@ struct led_classdev { >unsigned long *delay_on, >unsigned long *delay_off); > > + int (*pattern_set)(struct led_classdev *led_cdev, > +struct led_pattern *pattern, int len, > +unsigned repeat); > + int (*pattern_get)(struct led_classdev *led_cdev, > +struct led_pattern *pattern, int *len, > +unsigned *repeat); > + int (*pattern_clear)(struct led_classdev *led_cdev); > + > struct device *dev; > const struct attribute_group**groups; > > @@ -446,4 +455,14 @@ static inline void > led_classdev_notify_brightness_hw_changed( > struct led_classdev *led_cdev, enum led_brightness brightness) { } > #endif > > +/** > + * struct led_pattern - brightness value in a pattern > + * @delta_t: delay until next entry, in milliseconds > + * @brightness: brightness at time = 0 > + */ > +struct led_pattern { > + int delta_t; > + int brightness; > +}; > + > #endif /* __LINUX_LEDS_H_INCLUDED */ > -- Best regards, Jacek Anaszewski

Re: [PATCH 1/2] leds: core: Introduce LED pattern trigger

2018-07-31 Thread Jacek Anaszewski
gt; +{ > + return led_trigger_register(_led_trigger); > +} > + > +static void __exit pattern_trig_exit(void) > +{ > + led_trigger_unregister(_led_trigger); > +} > + > +module_init(pattern_trig_init); > +module_exit(pattern_trig_exit); > + > +MODULE_AUTHOR("Raphael Teysseyre +MODULE_AUTHOR("Baolin Wang +MODULE_DESCRIPTION("LED Pattern trigger"); > +MODULE_LICENSE("GPL v2"); > diff --git a/include/linux/leds.h b/include/linux/leds.h > index b7e8255..bea02f0 100644 > --- a/include/linux/leds.h > +++ b/include/linux/leds.h > @@ -22,6 +22,7 @@ > #include > > struct device; > +struct led_pattern; > /* > * LED Core > */ > @@ -88,6 +89,14 @@ struct led_classdev { >unsigned long *delay_on, >unsigned long *delay_off); > > + int (*pattern_set)(struct led_classdev *led_cdev, > +struct led_pattern *pattern, int len, > +unsigned repeat); > + int (*pattern_get)(struct led_classdev *led_cdev, > +struct led_pattern *pattern, int *len, > +unsigned *repeat); > + int (*pattern_clear)(struct led_classdev *led_cdev); > + > struct device *dev; > const struct attribute_group**groups; > > @@ -446,4 +455,14 @@ static inline void > led_classdev_notify_brightness_hw_changed( > struct led_classdev *led_cdev, enum led_brightness brightness) { } > #endif > > +/** > + * struct led_pattern - brightness value in a pattern > + * @delta_t: delay until next entry, in milliseconds > + * @brightness: brightness at time = 0 > + */ > +struct led_pattern { > + int delta_t; > + int brightness; > +}; > + > #endif /* __LINUX_LEDS_H_INCLUDED */ > -- Best regards, Jacek Anaszewski

Re: [PATCH v3 2/2] leds: add Panasonic AN30259A support

2018-07-27 Thread Jacek Anaszewski
On 07/27/2018 10:08 PM, Jacek Anaszewski wrote: Hi Simon, Thank you for the updated patch. It looks good in general, with one reservation, please refer below. And one more issue: drivers/leds/leds-an30259a.c: In function 'an30259a_blink_set': drivers/leds/leds-an30259a.c:129:23: warning

Re: [PATCH v3 2/2] leds: add Panasonic AN30259A support

2018-07-27 Thread Jacek Anaszewski
On 07/27/2018 10:08 PM, Jacek Anaszewski wrote: Hi Simon, Thank you for the updated patch. It looks good in general, with one reservation, please refer below. And one more issue: drivers/leds/leds-an30259a.c: In function 'an30259a_blink_set': drivers/leds/leds-an30259a.c:129:23: warning

Re: [PATCH v3 2/2] leds: add Panasonic AN30259A support

2018-07-27 Thread Jacek Anaszewski
quot;, }, + { /* sentinel */ }, +}; + +MODULE_DEVICE_TABLE(of, an30259a_match_table); + +static const struct i2c_device_id an30259a_id[] = { + { "an30259a", 0 }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(i2c, an30259a_id); + +static struct i2c_driver an30259a_driver = { + .driver = { + .name = "leds-an32059a", + .of_match_table = of_match_ptr(an30259a_match_table), + }, + .probe_new = an30259a_probe, + .remove = an30259a_remove, + .id_table = an30259a_id, +}; + +module_i2c_driver(an30259a_driver); + +MODULE_AUTHOR("Simon Shields "); +MODULE_DESCRIPTION("AN32059A LED driver"); +MODULE_LICENSE("GPL v2"); -- Best regards, Jacek Anaszewski

Re: [PATCH v3 2/2] leds: add Panasonic AN30259A support

2018-07-27 Thread Jacek Anaszewski
quot;, }, + { /* sentinel */ }, +}; + +MODULE_DEVICE_TABLE(of, an30259a_match_table); + +static const struct i2c_device_id an30259a_id[] = { + { "an30259a", 0 }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(i2c, an30259a_id); + +static struct i2c_driver an30259a_driver = { + .driver = { + .name = "leds-an32059a", + .of_match_table = of_match_ptr(an30259a_match_table), + }, + .probe_new = an30259a_probe, + .remove = an30259a_remove, + .id_table = an30259a_id, +}; + +module_i2c_driver(an30259a_driver); + +MODULE_AUTHOR("Simon Shields "); +MODULE_DESCRIPTION("AN32059A LED driver"); +MODULE_LICENSE("GPL v2"); -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-20 Thread Jacek Anaszewski
g led_set_brightness_nosleep() would schedule call to led_trigger_set(led_cdev "pattern"), assuming that pattern trigger would be implemented as I explained above. -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-20 Thread Jacek Anaszewski
g led_set_brightness_nosleep() would schedule call to led_trigger_set(led_cdev "pattern"), assuming that pattern trigger would be implemented as I explained above. -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-20 Thread Jacek Anaszewski
n... needs more work). Thank you for the patch. I'll be able to comment on it in two weeks. I'll be offline during that time. Best regards, Jacek Anaszewski diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c index ede4fa0..8cf5962 100644 --- a/drivers/leds/led-core.c +++ b/drivers/leds/

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-20 Thread Jacek Anaszewski
n... needs more work). Thank you for the patch. I'll be able to comment on it in two weeks. I'll be offline during that time. Best regards, Jacek Anaszewski diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c index ede4fa0..8cf5962 100644 --- a/drivers/leds/led-core.c +++ b/drivers/leds/

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-18 Thread Jacek Anaszewski
On 07/18/2018 08:54 PM, Jacek Anaszewski wrote: On 07/18/2018 09:56 AM, Pavel Machek wrote: Hi! I believe I meant "changing patterns from kernel in response to events is probably overkill"... or something like that. Anyway -- to clean up the confusion -- I'd like to see ec

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-18 Thread Jacek Anaszewski
On 07/18/2018 08:54 PM, Jacek Anaszewski wrote: On 07/18/2018 09:56 AM, Pavel Machek wrote: Hi! I believe I meant "changing patterns from kernel in response to events is probably overkill"... or something like that. Anyway -- to clean up the confusion -- I'd like to see ec

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-18 Thread Jacek Anaszewski
er. In this case, I'd go for "echo 0 > brightness" as a command disabling pattern. The same operation disables triggers, so later transition to using pattern trigger will be seamless for userspace. -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-18 Thread Jacek Anaszewski
er. In this case, I'd go for "echo 0 > brightness" as a command disabling pattern. The same operation disables triggers, so later transition to using pattern trigger will be seamless for userspace. -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-17 Thread Jacek Anaszewski
nd :-). How about taking Baolin's patches as of v5? Later, provided that the pattern trigger yet to be implemented will create pattern file on activation, we'll need to initialize default-trigger DT property, to keep the interface unchanged. -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-17 Thread Jacek Anaszewski
nd :-). How about taking Baolin's patches as of v5? Later, provided that the pattern trigger yet to be implemented will create pattern file on activation, we'll need to initialize default-trigger DT property, to keep the interface unchanged. -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-16 Thread Jacek Anaszewski
Hi David, On 07/16/2018 03:00 AM, David Lechner wrote: On 07/15/2018 07:22 AM, Jacek Anaszewski wrote: On 07/15/2018 12:39 AM, Pavel Machek wrote: On Sun 2018-07-15 00:29:25, Pavel Machek wrote: On Sun 2018-07-15 00:02:57, Jacek Anaszewski wrote: Hi Pavel, On 07/14/2018 11:20 PM, Pavel

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-16 Thread Jacek Anaszewski
Hi David, On 07/16/2018 03:00 AM, David Lechner wrote: On 07/15/2018 07:22 AM, Jacek Anaszewski wrote: On 07/15/2018 12:39 AM, Pavel Machek wrote: On Sun 2018-07-15 00:29:25, Pavel Machek wrote: On Sun 2018-07-15 00:02:57, Jacek Anaszewski wrote: Hi Pavel, On 07/14/2018 11:20 PM, Pavel

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-15 Thread Jacek Anaszewski
On 07/15/2018 12:39 AM, Pavel Machek wrote: On Sun 2018-07-15 00:29:25, Pavel Machek wrote: On Sun 2018-07-15 00:02:57, Jacek Anaszewski wrote: Hi Pavel, On 07/14/2018 11:20 PM, Pavel Machek wrote: Hi! It also drew my attention to the issue of desired pattern sysfs interface semantics

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-15 Thread Jacek Anaszewski
On 07/15/2018 12:39 AM, Pavel Machek wrote: On Sun 2018-07-15 00:29:25, Pavel Machek wrote: On Sun 2018-07-15 00:02:57, Jacek Anaszewski wrote: Hi Pavel, On 07/14/2018 11:20 PM, Pavel Machek wrote: Hi! It also drew my attention to the issue of desired pattern sysfs interface semantics

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-14 Thread Jacek Anaszewski
related to possible pattern interface implementations, but you seemed not to be so enthusiastic in [0]. [0] https://lkml.org/lkml/2017/4/7/350 -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-14 Thread Jacek Anaszewski
related to possible pattern interface implementations, but you seemed not to be so enthusiastic in [0]. [0] https://lkml.org/lkml/2017/4/7/350 -- Best regards, Jacek Anaszewski

Re: [PATCH v4 1/2] leds: core: Introduce generic pattern interface

2018-07-13 Thread Jacek Anaszewski
brightness) { } #endif +/** + * struct led_pattern - brigheness value in a pattern + * @delta_t: delay until next entry, in milliseconds + * @brightness: brightness at time = 0 + */ +struct led_pattern { + int delta_t; + int brightness; +}; + #endif/* __LINUX_LEDS_H_INCLUDED */ -- Best regards, Jacek Anaszewski

Re: [PATCH v4 1/2] leds: core: Introduce generic pattern interface

2018-07-13 Thread Jacek Anaszewski
brightness) { } #endif +/** + * struct led_pattern - brigheness value in a pattern + * @delta_t: delay until next entry, in milliseconds + * @brightness: brightness at time = 0 + */ +struct led_pattern { + int delta_t; + int brightness; +}; + #endif/* __LINUX_LEDS_H_INCLUDED */ -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-12 Thread Jacek Anaszewski
Hi Baolin, On 07/12/2018 02:24 PM, Baolin Wang wrote: Hi Jacek, On 12 July 2018 at 05:10, Jacek Anaszewski wrote: Hi Baolin. On 07/11/2018 01:02 PM, Baolin Wang wrote: Hi Jacek and Pavel, On 29 June 2018 at 13:03, Baolin Wang wrote: From: Bjorn Andersson Some LED controllers have

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-12 Thread Jacek Anaszewski
Hi Baolin, On 07/12/2018 02:24 PM, Baolin Wang wrote: Hi Jacek, On 12 July 2018 at 05:10, Jacek Anaszewski wrote: Hi Baolin. On 07/11/2018 01:02 PM, Baolin Wang wrote: Hi Jacek and Pavel, On 29 June 2018 at 13:03, Baolin Wang wrote: From: Bjorn Andersson Some LED controllers have

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-11 Thread Jacek Anaszewski
+struct led_pattern { + int delta_t; + int brightness; +}; + #endif /* __LINUX_LEDS_H_INCLUDED */ -- 1.7.9.5 -- Best regards, Jacek Anaszewski

Re: [PATCH v3 1/2] leds: core: Introduce generic pattern interface

2018-07-11 Thread Jacek Anaszewski
+struct led_pattern { + int delta_t; + int brightness; +}; + #endif /* __LINUX_LEDS_H_INCLUDED */ -- 1.7.9.5 -- Best regards, Jacek Anaszewski

Re: [PATCH] Fix platform data in leds-pca955x.c

2018-07-05 Thread Jacek Anaszewski
that platform data can't provide because it's not in any header it can #include. That is clear omission. Nonetheless, I like the i2c_board_info related solution, proposed by Andy. Would you mind checking that approach? Best regards, Jacek Anaszewski This is disguised by dev_get_platdata

Re: [PATCH] Fix platform data in leds-pca955x.c

2018-07-05 Thread Jacek Anaszewski
that platform data can't provide because it's not in any header it can #include. That is clear omission. Nonetheless, I like the i2c_board_info related solution, proposed by Andy. Would you mind checking that approach? Best regards, Jacek Anaszewski This is disguised by dev_get_platdata

Re: [PATCH v2] leds: ledtrig-morse: send out morse code

2018-07-04 Thread Jacek Anaszewski
er obvious to the user). Pavel -- Best regards, Jacek Anaszewski

Re: [PATCH v2] leds: ledtrig-morse: send out morse code

2018-07-04 Thread Jacek Anaszewski
er obvious to the user). Pavel -- Best regards, Jacek Anaszewski

Re: [PATCH v2] leds: ledtrig-morse: send out morse code

2018-07-04 Thread Jacek Anaszewski
l.org/lkml/2018/5/12/142 [1] https://patchwork.kernel.org/patch/10495595/ -- Best regards, Jacek Anaszewski

Re: [PATCH v2] leds: ledtrig-morse: send out morse code

2018-07-04 Thread Jacek Anaszewski
l.org/lkml/2018/5/12/142 [1] https://patchwork.kernel.org/patch/10495595/ -- Best regards, Jacek Anaszewski

Re: [PATCH 1/4] leds: lm3692x: Update license header to SPDX

2018-07-03 Thread Jacek Anaszewski
Hi Dan, Thank you for the patch set, applied. Best regards, Jacek Anaszewski On 07/02/2018 08:12 PM, Dan Murphy wrote: Update the license header to the current SPDX licensing format. Signed-off-by: Dan Murphy --- drivers/leds/leds-lm3692x.c | 17 +++-- 1 file changed, 3

Re: [PATCH 1/4] leds: lm3692x: Update license header to SPDX

2018-07-03 Thread Jacek Anaszewski
Hi Dan, Thank you for the patch set, applied. Best regards, Jacek Anaszewski On 07/02/2018 08:12 PM, Dan Murphy wrote: Update the license header to the current SPDX licensing format. Signed-off-by: Dan Murphy --- drivers/leds/leds-lm3692x.c | 17 +++-- 1 file changed, 3

Re: [PATCH] leds: max8997: use mode when calling max8997_led_set_mode

2018-07-02 Thread Jacek Anaszewski
brightness = led->cdev.max_brightness; Applied. -- Best regards, Jacek Anaszewski

Re: [PATCH] leds: max8997: use mode when calling max8997_led_set_mode

2018-07-02 Thread Jacek Anaszewski
brightness = led->cdev.max_brightness; Applied. -- Best regards, Jacek Anaszewski

Re: [PATCH] leds: Modify PC Engines apu/apu2 driver to support apu3

2018-06-25 Thread Jacek Anaszewski
apu2") || - dmi_match(DMI_PRODUCT_NAME, "PC Engines apu2"))) { + dmi_match(DMI_PRODUCT_NAME, "PC Engines apu2") || + dmi_match(DMI_PRODUCT_NAME, "APU3") || + dmi_match(DMI_PRODUCT_NAME, "apu3") || + dmi_match(DMI_PRODUCT_NAME, "PC Engines apu3"))) { pr_err("Unknown PC Engines board: %s\n", dmi_get_system_info(DMI_PRODUCT_NAME)); return -ENODEV; Applied. -- Best regards, Jacek Anaszewski

Re: [PATCH] leds: Modify PC Engines apu/apu2 driver to support apu3

2018-06-25 Thread Jacek Anaszewski
apu2") || - dmi_match(DMI_PRODUCT_NAME, "PC Engines apu2"))) { + dmi_match(DMI_PRODUCT_NAME, "PC Engines apu2") || + dmi_match(DMI_PRODUCT_NAME, "APU3") || + dmi_match(DMI_PRODUCT_NAME, "apu3") || + dmi_match(DMI_PRODUCT_NAME, "PC Engines apu3"))) { pr_err("Unknown PC Engines board: %s\n", dmi_get_system_info(DMI_PRODUCT_NAME)); return -ENODEV; Applied. -- Best regards, Jacek Anaszewski

[GIT PULL] LED updates for 4.18-rc1

2018-06-04 Thread Jacek Anaszewski
brightness (2018-05-24 22:08:26 +0200) Best regards, Jacek Anaszewski LED updates for 4.18-rc1 Andy Shevchenko (1): leds: wm831x-status: Use sysfs_match_string

[GIT PULL] LED updates for 4.18-rc1

2018-06-04 Thread Jacek Anaszewski
brightness (2018-05-24 22:08:26 +0200) Best regards, Jacek Anaszewski LED updates for 4.18-rc1 Andy Shevchenko (1): leds: wm831x-status: Use sysfs_match_string

Re: [PATCH] leds: class: ensure workqueue is initialized before setting brightness

2018-05-24 Thread Jacek Anaszewski
device_node *np, led_trigger_set_default(led_cdev); #endif + mutex_unlock(_cdev->led_access); + dev_dbg(parent, "Registered led device: %s\n", led_cdev->name); Applied. -- Best regards, Jacek Anaszewski

Re: [PATCH] leds: class: ensure workqueue is initialized before setting brightness

2018-05-24 Thread Jacek Anaszewski
_trigger_set_default(led_cdev); #endif + mutex_unlock(_cdev->led_access); + dev_dbg(parent, "Registered led device: %s\n", led_cdev->name); Applied. -- Best regards, Jacek Anaszewski

Re: [PATCH v9 2/2] leds: lm3601x: Introduce the lm3601x LED driver

2018-05-23 Thread Jacek Anaszewski
{ "LM36011", CHIP_LM36011 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, lm3601x_id); + +static const struct of_device_id of_lm3601x_leds_match[] = { + { .compatible = "ti,lm36010", }, + { .compatible = "ti,lm36011", }, + { } +}; +MODULE_DEVICE_TA

Re: [PATCH v9 2/2] leds: lm3601x: Introduce the lm3601x LED driver

2018-05-23 Thread Jacek Anaszewski
{ } +}; +MODULE_DEVICE_TABLE(i2c, lm3601x_id); + +static const struct of_device_id of_lm3601x_leds_match[] = { + { .compatible = "ti,lm36010", }, + { .compatible = "ti,lm36011", }, + { } +}; +MODULE_DEVICE_TABLE(of, of_lm3601x_leds_match); + +static struct i2c_driver lm3601x_i2c_driver = { + .driver = { + .name = "lm3601x", + .of_match_table = of_lm3601x_leds_match, + }, + .probe_new = lm3601x_probe, + .remove = lm3601x_remove, + .id_table = lm3601x_id, +}; +module_i2c_driver(lm3601x_i2c_driver); + +MODULE_DESCRIPTION("Texas Instruments Flash Lighting driver for LM3601X"); +MODULE_AUTHOR("Dan Murphy "); +MODULE_LICENSE("GPL v2"); Patch set applied to the for-next branch of linux-leds.git. -- Best regards, Jacek Anaszewski

Re: [PATCH v8 2/2] leds: lm3601x: Introduce the lm3601x LED driver

2018-05-22 Thread Jacek Anaszewski
rictly stick to the 80 character limit as we all have modern computers nowadays. After addressing the rest, FWIW, Reviewed-by: Andy Shevchenko <andy.shevche...@gmail.com> -- Best regards, Jacek Anaszewski

Re: [PATCH v8 2/2] leds: lm3601x: Introduce the lm3601x LED driver

2018-05-22 Thread Jacek Anaszewski
modern computers nowadays. After addressing the rest, FWIW, Reviewed-by: Andy Shevchenko -- Best regards, Jacek Anaszewski

Re: [PATCH v8 2/2] leds: lm3601x: Introduce the lm3601x LED driver

2018-05-22 Thread Jacek Anaszewski
+}; +MODULE_DEVICE_TABLE(i2c, lm3601x_id); + +static const struct of_device_id of_lm3601x_leds_match[] = { + { .compatible = "ti,lm36010", }, + { .compatible = "ti,lm36011", }, + { } +}; +MODULE_DEVICE_TABLE(of, of_lm3601x_leds_match); + +static struct i2c_driver lm3601x_i2c_driver = { + .driver = { + .name = "lm3601x", + .of_match_table = of_lm3601x_leds_match, + }, + .probe = lm3601x_probe, + .remove = lm3601x_remove, + .id_table = lm3601x_id, +}; +module_i2c_driver(lm3601x_i2c_driver); + +MODULE_DESCRIPTION("Texas Instruments Flash Lighting driver for LM3601X"); +MODULE_AUTHOR("Dan Murphy <dmur...@ti.com>"); +MODULE_LICENSE("GPL v2"); -- Best regards, Jacek Anaszewski

Re: [PATCH v8 2/2] leds: lm3601x: Introduce the lm3601x LED driver

2018-05-22 Thread Jacek Anaszewski
E(i2c, lm3601x_id); + +static const struct of_device_id of_lm3601x_leds_match[] = { + { .compatible = "ti,lm36010", }, + { .compatible = "ti,lm36011", }, + { } +}; +MODULE_DEVICE_TABLE(of, of_lm3601x_leds_match); + +static struct i2c_driver lm3601x_i2c_driver = { + .driver = { + .name = "lm3601x", + .of_match_table = of_lm3601x_leds_match, + }, + .probe = lm3601x_probe, + .remove = lm3601x_remove, + .id_table = lm3601x_id, +}; +module_i2c_driver(lm3601x_i2c_driver); + +MODULE_DESCRIPTION("Texas Instruments Flash Lighting driver for LM3601X"); +MODULE_AUTHOR("Dan Murphy "); +MODULE_LICENSE("GPL v2"); -- Best regards, Jacek Anaszewski

Re: [PATCH v7 2/2] leds: lm3601x: Introduce the lm3601x LED driver

2018-05-21 Thread Jacek Anaszewski
+ { "LM36010", CHIP_LM36010 }, + { "LM36011", CHIP_LM36011 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, lm3601x_id); + +static const struct of_device_id of_lm3601x_leds_match[] = { + { .compatible = "ti,lm36010", }, + { .compatible = "ti,lm36011", }, + { } +}; +MODULE_DEVICE_TABLE(of, of_lm3601x_leds_match); + +static struct i2c_driver lm3601x_i2c_driver = { + .driver = { + .name = "lm3601x", + .of_match_table = of_lm3601x_leds_match, + }, + .probe = lm3601x_probe, + .remove = lm3601x_remove, + .id_table = lm3601x_id, +}; +module_i2c_driver(lm3601x_i2c_driver); + +MODULE_DESCRIPTION("Texas Instruments Flash Lighting driver for LM3601X"); +MODULE_AUTHOR("Dan Murphy <dmur...@ti.com>"); +MODULE_LICENSE("GPL v2"); -- Best regards, Jacek Anaszewski

Re: [PATCH v7 2/2] leds: lm3601x: Introduce the lm3601x LED driver

2018-05-21 Thread Jacek Anaszewski
0", CHIP_LM36010 }, + { "LM36011", CHIP_LM36011 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, lm3601x_id); + +static const struct of_device_id of_lm3601x_leds_match[] = { + { .compatible = "ti,lm36010", }, + { .compatible = "ti,lm36011", }, + { } +}; +MODULE_DEVICE_TABLE(of, of_lm3601x_leds_match); + +static struct i2c_driver lm3601x_i2c_driver = { + .driver = { + .name = "lm3601x", + .of_match_table = of_lm3601x_leds_match, + }, + .probe = lm3601x_probe, + .remove = lm3601x_remove, + .id_table = lm3601x_id, +}; +module_i2c_driver(lm3601x_i2c_driver); + +MODULE_DESCRIPTION("Texas Instruments Flash Lighting driver for LM3601X"); +MODULE_AUTHOR("Dan Murphy "); +MODULE_LICENSE("GPL v2"); -- Best regards, Jacek Anaszewski

Re: [PATCH v6 2/2] leds: lm3601x: Introduce the lm3601x LED driver

2018-05-17 Thread Jacek Anaszewski
to save few lines of code in case of drivers supporting a family of chips we can use it. We are going to get rid of a devicename section from LED class device name soon anyway, since it is redundant. -- Best regards, Jacek Anaszewski

Re: [PATCH v6 2/2] leds: lm3601x: Introduce the lm3601x LED driver

2018-05-17 Thread Jacek Anaszewski
to save few lines of code in case of drivers supporting a family of chips we can use it. We are going to get rid of a devicename section from LED class device name soon anyway, since it is redundant. -- Best regards, Jacek Anaszewski

Re: [PATCH v6 2/2] leds: lm3601x: Introduce the lm3601x LED driver

2018-05-16 Thread Jacek Anaszewski
Dan, On 05/16/2018 11:17 PM, Dan Murphy wrote: Jacek and Andy On 05/16/2018 04:13 PM, Dan Murphy wrote: Jacek and Andy On 05/16/2018 04:02 PM, Jacek Anaszewski wrote: Hi Andy and Dan, I will make all the changes then. I don't want to go through and ack each one. Let me clarify. I

<    4   5   6   7   8   9   10   11   12   13   >