All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Arcadiy Ivanov <arcadiy@ivanov.biz>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>,
	platform-driver-x86@vger.kernel.org,
	Mario Limonciello <mario.limonciello@dell.com>
Subject: Re: [PATCH] Keyboard backlight on Dell E7470 not adjustable from /sys entry
Date: Sun, 23 Apr 2017 21:41:23 +0200	[thread overview]
Message-ID: <201704232141.23690@pali> (raw)
In-Reply-To: <20170423055648.25711-1-arcadiy@ivanov.biz>

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

On Sunday 23 April 2017 07:56:48 Arcadiy Ivanov wrote:
> @@ -1115,6 +1131,7 @@ struct kbd_state {
>  	u8 als_setting;
>  	u8 als_value;
>  	u8 level;
> +	u8 timeout_ac;

It is timeout value + timeout units. It needs to be used later in
function for getting and setting timeout.

>  };
>  
>  static const int kbd_tokens[] = {
> @@ -1140,6 +1157,25 @@ static u8 kbd_previous_mode_bit;
>  
>  static bool kbd_led_present;
>  
> +#define pr_kbd_smi(x) \
> +    pr_debug("func %s\n\tinputs: %#010x %#010x %#010x %#010x, outputs: %#010x %#010x %#010x %#010x", \
> +        __func__, \
> +        x->input[0], x->input[1], x->input[2], x->input[3],\
> +        x->output[0], x->output[1], x->output[2], x->output[3])
> +
> +#define pr_kbd_state(x) \
> +    pr_debug("func %s\n\tmode_bit: %#04x, triggers: %#04x, timeout_value: %#04x, timeout_unit: %#04x, " \
> +            "als_setting: %#04x, als_value: %#04x, level: %#04x, timeout_ac: %#04x", \
> +        __func__, \
> +        x->mode_bit, x->triggers, x->timeout_value, x->timeout_unit, x->als_setting, x->als_value, x-
>level, \
> +        x->timeout_ac)
> +
> +#define pr_kbd_info(x) \
> +    pr_debug("func %s\n\tmodes: %#06x, type: %#04x, triggers: %#04x, levels: %#04x, seconds: %#04x, " \
> +            "minutes: %#04x, hours: %#04x, days: %#04x", \
> +        __func__, \
> +        x->modes, x->type, x->triggers, x->levels, x->seconds, x->minutes, x->hours, x->days)
> +

Such macros are not needed in mainline code. They are probably useful
in time of writing patch, but not later to have them present in final
driver code.

I sent a new patch (you are in recipients list too) which fixes getting
and setting timeout value when on AC. It also handles detection of
timeout AC value based on existence of 0x0451 SMBIOS token like Mario
suggested.

-- 
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-23 19:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-23  5:56 [PATCH] Keyboard backlight on Dell E7470 not adjustable from /sys entry Arcadiy Ivanov
2017-04-23 19:41 ` Pali Rohár [this message]
2017-04-23 20:54   ` Arcadiy Ivanov

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=201704232141.23690@pali \
    --to=pali.rohar@gmail.com \
    --cc=arcadiy@ivanov.biz \
    --cc=mario.limonciello@dell.com \
    --cc=mjg59@srcf.ucam.org \
    --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.