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@xxxxxxxxx
Attachment:
signature.asc
Description: This is a digitally signed message part.