Skip to content
Snippets Groups Projects
Commit 73c81689 authored by Kurt Borja's avatar Kurt Borja Committed by Adam Honse
Browse files

Controllers: AlienwareController: Fix number of zones probing


The number of zones is reported by ALIENWARE_COMMAND_REPORT_CONFIG.
Therefore we have to get it before the `report` buffer gets overwritten
by the firmware version report.

This is very important for new devices which are not listed in the
`zone_quirks_table`.

Signed-off-by: default avatarKurt Borja <kuurtb@gmail.com>
parent a3afb8dc
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -99,6 +99,11 @@ AlienwareController::AlienwareController(hid_device* dev_handle, const hid_devic
report = Report(ALIENWARE_COMMAND_REPORT_CONFIG);
alienware_platform_id platform_id = report.data[4] << 8 | report.data[5];
/*-----------------------------------------------------*\
| Check if the device reports the wrong number of zones |
\*-----------------------------------------------------*/
unsigned number_of_zones = zone_quirks_table.count(platform_id) ? zone_quirks_table.at(platform_id) : report.data[6];
/*-----------------------------------------------------*\
| Get firmware version |
\*-----------------------------------------------------*/
......@@ -109,11 +114,6 @@ AlienwareController::AlienwareController(hid_device* dev_handle, const hid_devic
fw_string << static_cast<unsigned>(report.data[4]) << '.' << static_cast<unsigned>(report.data[5]) << '.' << static_cast<unsigned>(report.data[6]);
version = fw_string.str();
/*-----------------------------------------------------*\
| Check if the device reports the wrong number of zones |
\*-----------------------------------------------------*/
unsigned number_of_zones = zone_quirks_table.count(platform_id) ? zone_quirks_table.at(platform_id) : report.data[6];
/*-----------------------------------------------------*\
| Initialize Alienware zones |
\*-----------------------------------------------------*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment