platform/chrome fixes for v5.5-rc7.
One fix in the wilco_ec keyboard backlight driver to allow the EC driver to continue loading in the absence of a backlight module. -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQCtZK6p/AktxXfkOlzbaomhzOwwgUCXiCicQAKCRBzbaomhzOw ws7lAP9JZTQi2nqmYOfink9JAEQbNSMO1tdrvQiZpYPXZ/j4LgD/c1hg2ae9MMGX at2A9ffaLAXEKEJ16U7A3vUlDOO9bQY= =2Otp -----END PGP SIGNATURE----- Merge tag 'tag-chrome-platform-fixes-for-v5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform fix from Benson Leung: "One fix in the wilco_ec keyboard backlight driver to allow the EC driver to continue loading in the absence of a backlight module" * tag 'tag-chrome-platform-fixes-for-v5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: wilco_ec: Fix keyboard backlight probing
This commit is contained in:
commit
0c99ee44b8
|
@ -73,13 +73,6 @@ static int send_kbbl_msg(struct wilco_ec_device *ec,
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (response->status) {
|
||||
dev_err(ec->dev,
|
||||
"EC reported failure sending keyboard LEDs command: %d",
|
||||
response->status);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -87,6 +80,7 @@ static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness)
|
|||
{
|
||||
struct wilco_keyboard_leds_msg request;
|
||||
struct wilco_keyboard_leds_msg response;
|
||||
int ret;
|
||||
|
||||
memset(&request, 0, sizeof(request));
|
||||
request.command = WILCO_EC_COMMAND_KBBL;
|
||||
|
@ -94,7 +88,18 @@ static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness)
|
|||
request.mode = WILCO_KBBL_MODE_FLAG_PWM;
|
||||
request.percent = brightness;
|
||||
|
||||
return send_kbbl_msg(ec, &request, &response);
|
||||
ret = send_kbbl_msg(ec, &request, &response);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (response.status) {
|
||||
dev_err(ec->dev,
|
||||
"EC reported failure sending keyboard LEDs command: %d",
|
||||
response.status);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int kbbl_exist(struct wilco_ec_device *ec, bool *exists)
|
||||
|
@ -140,6 +145,13 @@ static int kbbl_init(struct wilco_ec_device *ec)
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (response.status) {
|
||||
dev_err(ec->dev,
|
||||
"EC reported failure sending keyboard LEDs command: %d",
|
||||
response.status);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (response.mode & WILCO_KBBL_MODE_FLAG_PWM)
|
||||
return response.percent;
|
||||
|
||||
|
|
Loading…
Reference in New Issue