asus-wmi: handle "unknown status" bit
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
This commit is contained in:
parent
a7ce3f041e
commit
a75fe0d78e
1 changed files with 6 additions and 0 deletions
|
@ -92,6 +92,7 @@ MODULE_LICENSE("GPL");
|
||||||
|
|
||||||
/* DSTS masks */
|
/* DSTS masks */
|
||||||
#define ASUS_WMI_DSTS_STATUS_BIT 0x00000001
|
#define ASUS_WMI_DSTS_STATUS_BIT 0x00000001
|
||||||
|
#define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002
|
||||||
#define ASUS_WMI_DSTS_PRESENCE_BIT 0x00010000
|
#define ASUS_WMI_DSTS_PRESENCE_BIT 0x00010000
|
||||||
#define ASUS_WMI_DSTS_BRIGHTNESS_MASK 0x000000FF
|
#define ASUS_WMI_DSTS_BRIGHTNESS_MASK 0x000000FF
|
||||||
#define ASUS_WMI_DSTS_MAX_BRIGTH_MASK 0x0000FF00
|
#define ASUS_WMI_DSTS_MAX_BRIGTH_MASK 0x0000FF00
|
||||||
|
@ -270,6 +271,11 @@ static int asus_wmi_get_devstate_bits(u32 dev_id, u32 mask)
|
||||||
if (!(retval & ASUS_WMI_DSTS_PRESENCE_BIT))
|
if (!(retval & ASUS_WMI_DSTS_PRESENCE_BIT))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
|
if (mask == ASUS_WMI_DSTS_STATUS_BIT) {
|
||||||
|
if (retval & ASUS_WMI_DSTS_UNKNOWN_BIT)
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
return retval & mask;
|
return retval & mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue