Commit 3b0bfd33 authored by Benson Leung's avatar Benson Leung

Merge branch 'chrome-platform-5.5-fixes' into for-kernelci

Merge dfb9a885 platform/chrome: wilco_ec: Fix keyboard backlight probing
from chrome-platform-5.5-fixes into chrome-platform-5.6 destined branch.
Signed-off-by: default avatarBenson Leung <bleung@chromium.org>
parents ffd7263e dfb9a885
...@@ -73,13 +73,6 @@ static int send_kbbl_msg(struct wilco_ec_device *ec, ...@@ -73,13 +73,6 @@ static int send_kbbl_msg(struct wilco_ec_device *ec,
return ret; return ret;
} }
if (response->status) {
dev_err(ec->dev,
"EC reported failure sending keyboard LEDs command: %d",
response->status);
return -EIO;
}
return 0; return 0;
} }
...@@ -87,6 +80,7 @@ static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness) ...@@ -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 request;
struct wilco_keyboard_leds_msg response; struct wilco_keyboard_leds_msg response;
int ret;
memset(&request, 0, sizeof(request)); memset(&request, 0, sizeof(request));
request.command = WILCO_EC_COMMAND_KBBL; request.command = WILCO_EC_COMMAND_KBBL;
...@@ -94,7 +88,18 @@ static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness) ...@@ -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.mode = WILCO_KBBL_MODE_FLAG_PWM;
request.percent = brightness; 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) static int kbbl_exist(struct wilco_ec_device *ec, bool *exists)
...@@ -140,6 +145,13 @@ static int kbbl_init(struct wilco_ec_device *ec) ...@@ -140,6 +145,13 @@ static int kbbl_init(struct wilco_ec_device *ec)
if (ret < 0) if (ret < 0)
return ret; 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) if (response.mode & WILCO_KBBL_MODE_FLAG_PWM)
return response.percent; return response.percent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment