> +static void eeepc_wmi_key_filter(struct asus_wmi_driver *asus_wmi, int *code, > +                Âint *value, int *autorelease) > +{ > +    struct eeepc_wmi_driver *eeepc = to_eeepc_wmi_driver(asus_wmi); > +    int is_press; > + > +    /* > +    Â* The following behavior is used for T101MT "Home" key: > +    Â* > +    Â*  On press:  No event set > +    Â*  On hold:  ÂKEY_PROG2 press sent once w/o autorelease > +    Â*  On release: If key was held, KEY_PROG2 release sent. > +    Â*        Otherwise KEY_HOME press sent w/ autorelease. > +    Â* > +    Â* The simple state machine below implements this behavior. > +    Â*/ > +    switch (*code) { > +    case HOME_PRESS: > +        eeepc->home_key_state = HOME_PRESS; > +        *code = ASUS_WMI_KEY_IGNORE; > +        break; > +    case HOME_HOLD: > +        if (eeepc->home_key_state == HOME_HOLD) { > +            *code = ASUS_WMI_KEY_IGNORE; > +        } else { > +            eeepc->home_key_state = HOME_HOLD; > +            *value = 1; > +            *autorelease = 0; > +        } > +        break; > +    case HOME_RELEASE: > +        if (eeepc->home_key_state == HOME_RELEASE) { > +            dev_warn(&asus_wmi->platform_device->dev, > +                Â"Unexpected home key release event\n"); > +            *code = ASUS_WMI_KEY_IGNORE; > +        } else { > +            *code = eeepc->home_key_state; > +            eeepc->home_key_state = HOME_RELEASE; > +            is_press = (*code == HOME_PRESS); > +            *value = is_press; > +            *autorelease = is_press; > +        } > +        break; > +    } > +} > + Why not something simpler like this ? static void eeepc_wmi_key_filter(struct asus_wmi_driver *asus_wmi, int code,                Âint *value, int *autorelease) { if (code == 0xe4) { *value = 1; *autorelease = 0; } else if (code == 0xe5) { *value = 0; *autorelease = 0; } } with this keymap : { KE_KEY, 0xe4, { KEY_HOME } }, /* Home Key Down */ { KE_KEY, 0xe5, { KEY_HOME } }, /* Home Key Up */ { KE_KEY, 0xea, { KEY_PROG2 } }, /* Home Key hold more than one second */ This sounds simpler and we don't loose information (key down and key up both event reported at the right time). 0xe5 is *always* sent after 0xe4 right ? Also, for the callback, "value" should be an unsigned int, and "autorelease" a bool. Thanks, -- Corentin Chary http://xf.iksaif.net ÿô.nÇ·®+%˱é¥wÿº{.nÇ·©«_¢¹ÿv¸¯z¿ñØnr¡öë¨è&£ûz¹Þúzf£¢·h§~Ûÿÿïÿê_èæ+v¨þ)ßø