All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Mario.Limonciello@dell.com
Cc: platform-driver-x86@vger.kernel.org
Subject: Re: dell-laptop and separate AC timeouts on some Dell systems
Date: Sat, 8 Apr 2017 09:19:46 +0200	[thread overview]
Message-ID: <201704080919.46723@pali> (raw)
In-Reply-To: <2235ad548a604c3990e9bbd7e78c4177@ausx13mpc120.AMER.DELL.COM>

[-- Attachment #1: Type: Text/Plain, Size: 2438 bytes --]

On Saturday 08 April 2017 04:09:11 Mario.Limonciello@dell.com wrote:
> > > The difference is that intensity it's obvious that it changes
> > > from 50 to 100 percent.  With different timeouts, shouldn't this
> > > be more complex?
> > 
> > Currently for keyboard backlight settings is used procedure:
> > get current status --> update --> set new status.
> > 
> > So we just need to have two timeouts in struct kbd_state and
> > get/set functions needs to handle it. I do not thing this change
> > would be complex, it should be straightforward.
> 
> Yeah I figured this part was straightforward, it was the second part
> that was more complex :)
> 
> > > Would you just keep two different nodes as accessible to
> > > userspace?
> > 
> > And this is another question... For a first step we should just fix
> > timeout sysfs node to work. And probably the best fix would be
> > that this node will manage timeout which belongs to current AC or
> > battery state.
> 
> So the easiest way to implement this would be to save/restore the
> values from the cbArg3 that are not currently saved without to
> regard to whether the platform supports a dedicated AC timeout.
> 
> If it doesn't support a dedicated AC timeout this will be a no-op,
> but if it does it will fix this problem.

We can detect at module load time if notebook is new or old and based on 
this fact we can fill or not cbArg3.

> > Like for dell_get_intensity(). When notebook is running on battery
> > we will export timeout configured for battery and when on AC we
> > will export timeout configured for AC. Changing timeout via sysfs
> > just affect only one (current) configuration (ac or battery).
> 
> So basically the value in sysfs would change when you added/removed
> the AC adapter?  That might be a little bit confusing to a user in
> my opinion.
> 
> > IIRC we do not provide a sysfs node for changing AC display panel
> > brightness level when notebook is running on battery and vice
> > versa. So do we need it for keyboard backlight timeout at all?
> 
> How is that handled then?  The node dynamically changes values based
> on if a power adapter is plugged in?

Node has read and store functions. Those function check if AC is 
connected and based on this state variant for AC or battery is called.

There is no need to active monitoring plug of power adapter.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

      reply	other threads:[~2017-04-08  7:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07 19:33 dell-laptop and separate AC timeouts on some Dell systems Mario.Limonciello
2017-04-07 21:55 ` Pali Rohár
2017-04-07 22:56   ` Mario.Limonciello
2017-04-07 23:22     ` Pali Rohár
2017-04-08  2:09       ` Mario.Limonciello
2017-04-08  7:19         ` Pali Rohár [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=201704080919.46723@pali \
    --to=pali.rohar@gmail.com \
    --cc=Mario.Limonciello@dell.com \
    --cc=platform-driver-x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.