linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guru Das Srinagesh <gurus@codeaurora.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	linux-leds@vger.kernel.org,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	Dan Murphy <dmurphy@ti.com>,
	linux-kernel@vger.kernel.org,
	Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Subject: Re: [PATCH 1/2] leds: Add flag to keep trigger always
Date: Wed, 9 Oct 2019 17:52:24 -0700	[thread overview]
Message-ID: <20191010005224.GA31702@codeaurora.org> (raw)
In-Reply-To: <20191008074731.GB633@amd>

On Tue, Oct 08, 2019 at 09:47:31AM +0200, Pavel Machek wrote:
> Hi!
> 
> > > > > I don't understand.  The original commit broke userspace operations.
> > > > > Shouldn't it be reverted, or fixed this way in order to have userspace
> > > > > work properly again?
> > > > 
> > > > So, what it is exactly that is not working? :-). Yes, root can
> > > > disconnect LED from v4l2 interface; he can also connect it
> > > > back. Documentation says that happens.
> > > > 
> > > > Yes, root can do stupid things.
> > > > 
> > > > Commit 0013b23d66a2768f5babbb0ea9f03ab067a990d8 is from 2008. I'd
> > > > prefer we did not apply it in 2008, but...
> > > 
> > > Ah, my fault, I thought this was a new commit.
> > > 
> > > Guru, what are you doing here that this is required all of a sudden?  No
> > > other kernel seems to need these changes, what is different in your
> > > Android userspace that requires this patch series?
> > > 
> > > thanks,
> > > 
> > > greg k-h
> > 
> > Hi Greg,
> > 
> > Our camera flash driver first requests the available current from the
> > flash LED before setting its brightness. It passes a trigger as argument
> > to the function that determines the available current. This function
> > uses trigger_to_lcdev() to look up the led_classdev associated with that
> > trigger as a first step. This lookup will fail if the trigger has been
> > dissociated from its led_classdev as a result of a user setting that
> > led_classdev's brightness to zero manually through sysfs. 
> > 
> > Why would the user set the brightness to zero? The user does this as
> > part of camera and LED testing activities which include, amongst other
> > things, visual inspection of the operation of various onboard LEDs. The
> > user uses sysfs to manually turn on and off the LEDs by setting their
> > brightness to max and then to zero in order to verify that they are
> > working as expected.
> 
> Yes, so you should really set trigger to none before changing
> brightness manually and restore it back to whatever it was when you
> are done with manual testing.

Hi Pavel,

Tried your suggestion to set the trigger to "none" before manual testing
and to restore it afterwards, and it works.

Thanks a lot.

      reply	other threads:[~2019-10-10  0:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-10  0:52 [PATCH 1/2] leds: Add flag to keep trigger always Guru Das Srinagesh
2019-08-10  0:52 ` [PATCH 2/2] leds: triggers: Don't remove trigger if LED_KEEP_TRIGGER flag is set Guru Das Srinagesh
2019-08-10  7:13 ` [PATCH 1/2] leds: Add flag to keep trigger always Pavel Machek
2019-09-30 13:39   ` Greg KH
2019-09-30 17:22     ` Pavel Machek
2019-09-30 17:27       ` Greg KH
2019-10-04 20:09         ` Guru Das Srinagesh
2019-10-08  7:47           ` Pavel Machek
2019-10-10  0:52             ` Guru Das Srinagesh [this message]

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=20191010005224.GA31702@codeaurora.org \
    --to=gurus@codeaurora.org \
    --cc=dmurphy@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=subbaram@codeaurora.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).