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


Groups > linux.kernel > #1383174

Re: [Letux-kernel] [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led driver

From "H. Nikolaus Schaller" <hns@goldelico.com>
Newsgroups linux.kernel
Subject Re: [Letux-kernel] [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led driver
Date 2016-04-20 11:00 +0200
Message-ID <rpW9k-51U-15@gated-at.bofh.it> (permalink)
References <rpmpd-1Hn-31@gated-at.bofh.it> <rpmpd-1Hn-29@gated-at.bofh.it> <rpzZ9-4qx-17@gated-at.bofh.it> <rpHDk-1Ya-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Jacek,

>>> +static void is31fl319x_brightness_set(struct led_classdev *led_cdev,
>>> +				   enum led_brightness brightness)
>>> +{
>>> +	struct is31fl319x_led *led = container_of(led_cdev,
>>> +						  struct is31fl319x_led,
>>> +						  led_cdev);
>>> +	struct is31fl319x_chip *is31 = led->chip;
>>> +	unsigned long flags;
>>> +
>>> +	spin_lock_irqsave(&is31->lock, flags);
>>> +
>>> +	if (brightness != is31fl319x_brightness_get(led_cdev)) {
>> 
>> Current brightness is cached in led_cdev->brightness.
> 
> Hm. I could not find the code line where it is cached.
> 
> And if I remember correctly (it is a while ago that we did develop
> this driver) experiments didn't show that it is cached there. Or the
> old value is not available inside the brightness setter but already
> the new one. Something like that was the reason why we cache
> it inside the driver.
> 

I have added a printk inside is31fl319x_brightness_set but never got
a difference between brightness and led_cdev->brightness.

This seems to confirm that it is already set to the new value. Thus we
can't detect changes in brightness by comparing to the previous value.

Can you please confirm?

Otherwise the driver works well so that I am almost ready for posting
V2.

Thanks,
Nikolaus

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


Thread

[PATCH] drivers: led: is31fl319x: 6/9-channel light effect led driver "H. Nikolaus Schaller" <hns@goldelico.com> - 2016-04-18 20:50 +0200
  Re: [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led  driver kbuild test robot <lkp@intel.com> - 2016-04-19 00:30 +0200
  Re: [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led  driver "David Rivshin (Allworx)" <drivshin.allworx@gmail.com> - 2016-04-19 03:30 +0200
    Re: [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led  driver Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-04-19 11:20 +0200
    Re: [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led driver "H. Nikolaus Schaller" <hns@goldelico.com> - 2016-04-19 19:30 +0200
      Re: [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led  driver Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2016-04-20 23:10 +0200
  Re: [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led  driver Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-04-19 11:20 +0200
    Re: [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led driver "H. Nikolaus Schaller" <hns@goldelico.com> - 2016-04-19 19:30 +0200
      Re: [Letux-kernel] [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led driver "H. Nikolaus Schaller" <hns@goldelico.com> - 2016-04-20 11:00 +0200
      Re: [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led  driver Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2016-04-20 23:10 +0200
  Re: [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led  driver Rob Herring <robh@kernel.org> - 2016-04-21 17:10 +0200
    Re: [PATCH] drivers: led: is31fl319x: 6/9-channel light effect led driver "H. Nikolaus Schaller" <hns@goldelico.com> - 2016-04-21 18:30 +0200

csiph-web