mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yauhen Kharuzhy <jekhor@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>
Subject: Re: [PATCH v2 0/2] Intel Cherry Trail Whiskey Cove LEDs support
Date: Wed, 24 Apr 2019 21:32:51 +0300	[thread overview]
Message-ID: <20190424183251.GA21254@jeknote.loshitsa1.net> (raw)
In-Reply-To: <21337ca0-bb91-9ca9-117b-89c47c6b2ade@redhat.com>

On Sun, Apr 21, 2019 at 09:28:42PM +0200, Hans de Goede wrote:
> Hi Yauhen,

> I had a discussion with Jacek Anaszewski about this in another thread and
> I believe we have come up with a solution for this which should work
> nicely and should allow us to move forward with your driver (after
> it is reworked to match the solution. So the solution we've come up with is:
> 
> 1) After thinking a bit more about the primary use-case for this, I've come
> to the conclusion that putting LED1 / the charging LED in software-controlled
> mode is also the correct thing to do on the GPD win / pocket. The reason for
> this is that ideally the LED would glow while charging and be simply solid
> on when the battery is full, the hw control does not allow this, so the GPD
> win/pocket can benefit from sw-control too.
> 
> 2) To allow the desired behavior we need to define a new
> "<supply-name>-charging-glow-full-solid" trigger in
> drivers/power/supply/power_supply_leds.c; and this must be the default
> trigger for the Intel Cherry Trail Whiskey Cove LED driver so that
> everything will just work. Also we must restore the original hw control
> setting on reboot/shut-down so that this is used on the GPD win/pocket when
> Linux is not running.
> 
> 3) To be able to actually implement this new trigger we first need 2 things
> in the kernel internal LED APIs:
> 
> 3a) An API for triggers to put the LED in glowing mode, we've come up
> with the following prototype for this:
> 
> void led_trigger_glow(struct led_trigger *trigger, unsigned long *cylce_time);
> 
> Where cycle_time is the number of milliseconds for a full glow cycle (from off
> to full-on to off again).  So if cylce_time is set to 1000 then the LED glows
> at 1 Hz, 500, 2 HZ, etc. Note as with led_trigger_blink() the time passed to
> led_trigger_glow is passed by reference as the LED driver may round it to
> match what the hardware can do and the rounded value is returned to the caller
> through the reference.
> 
> 3b) 3a) in turn will require adding a new optional glow_set callback to
> struct led_classdev which will then get called by led_trigger_glow if available.
> 
> We've not discussed yet what to do if led_trigger_glow gets called on
> a led_classdev which does not implement the new glow_set callback, I guess
> the most sensible thing to do then is to fallback to blinking with delay_on
> and delay_off set to cylce_time / 2.
> 
> If you can make some time to work on this solution that would be great. Please
> let me know if you've any questions about the solution outlined below.
> 
> Note that glowing is only exported as in kernel functionality, I see no
> use-case for exporting this to userspace and keeping this in kernel allows
> us to keep things nice and simple.
> 

Hi,
Unfortunately I am too busy now at fulltime job, so I don't know when I
will return to this. But I still plan to do  :)
 

-- 
Yauhen Kharuzhy

      reply	other threads:[~2019-04-24 18:33 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12 20:58 Yauhen Kharuzhy
2019-02-12 20:59 ` [PATCH v2 1/2] leds: Add Intel Cherry Trail Whiskey Cove PMIC LEDs Yauhen Kharuzhy
2019-02-13 22:43   ` Hans de Goede
2019-02-13 23:07     ` Pavel Machek
2019-02-13 23:25       ` Hans de Goede
2019-02-13 23:38         ` Pavel Machek
2019-02-14  9:57           ` Hans de Goede
2019-02-14 11:14             ` Pavel Machek
2019-02-14 11:31               ` Hans de Goede
2019-02-14 12:28                 ` Pavel Machek
2019-02-15 21:41                   ` Jacek Anaszewski
2019-02-15 23:26                     ` Pavel Machek
2019-02-14 21:46                 ` Jacek Anaszewski
2019-02-14 23:03                   ` Pavel Machek
2019-02-15  7:27                     ` Yauhen Kharuzhy
2019-02-15 21:43                       ` Jacek Anaszewski
2019-02-16 11:26                         ` Yauhen Kharuzhy
2019-02-15 11:27                     ` Hans de Goede
2019-02-15 13:02                       ` Pavel Machek
2019-02-15 21:42                       ` Jacek Anaszewski
2019-02-15 22:26                         ` Hans de Goede
2019-02-15 22:31                           ` Jacek Anaszewski
2019-02-15 23:14                             ` Hans de Goede
2019-02-16 17:02                               ` Jacek Anaszewski
2019-02-16 19:01                                 ` Hans de Goede
2019-02-16 19:37                                   ` Pavel Machek
2019-02-16 20:55                                     ` Hans de Goede
2019-02-17  0:08                                       ` Pavel Machek
2019-02-17 14:10                                         ` Hans de Goede
2019-02-17 17:45                                           ` Pavel Machek
2019-02-18 11:12                                             ` Hans de Goede
2019-02-18 21:59                                               ` Jacek Anaszewski
2019-02-16 21:54                                     ` Jacek Anaszewski
2019-02-16 22:03                                       ` Hans de Goede
2019-02-17 12:40                                         ` Jacek Anaszewski
2019-02-14 11:28             ` Pavel Machek
2019-02-14 21:34             ` Yauhen Kharuzhy
2019-02-14  6:55     ` Yauhen Kharuzhy
2019-02-14 10:04     ` Hans de Goede
2019-02-12 20:59 ` [PATCH v2 2/2] mfd: Add leds MFD cell for intel_soc_pmic_chtwc Yauhen Kharuzhy
2019-02-13 21:24   ` Jacek Anaszewski
2019-03-20  9:56   ` Lee Jones
2019-03-20  9:57     ` Lee Jones
2019-04-21 19:28 ` [PATCH v2 0/2] Intel Cherry Trail Whiskey Cove LEDs support Hans de Goede
2019-04-24 18:32   ` Yauhen Kharuzhy [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=20190424183251.GA21254@jeknote.loshitsa1.net \
    --to=jekhor@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.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

all inboxes | Powered by JetHome®