summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2019-01-07 08:47:24 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-08 11:43:55 -0800
commit21d44090e548781f44eb4fe8a6447e0506e99f9a (patch)
tree65e8c1eb4556b79bcc31e1b9621e7508fc094a24
parent24a2d84b99b241c33b975ea42e071bf30cd6d222 (diff)
downloadchrome-ec-21d44090e548781f44eb4fe8a6447e0506e99f9a.tar.gz
oz554: Keep interrupt always enabled
OZ554ALN asserts the interrupt when it's ready for writing settings and settings are cleared when it's turned off (i.e. S3/S5). Therefore, we do not need to toggle the interrupt on power state transitions. This patch makes the interrupt enabled on HOOK_INIT. It's assumed the device doesn't have a lid. For clamshell devices, different interrupt & power control scheme may be needed. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/120237453 BRANCH=Kalista TEST=Verified display backlight is turned on/off as system changes power states (s0/s3/s5) with sysjump enabled. Change-Id: Ia911993abd76c09e79025ea454e456781b5b2fc1 Reviewed-on: https://chromium-review.googlesource.com/1397868 Commit-Ready: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com> Commit-Ready: David Huang <David.Huang@quantatw.com> Tested-by: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com> Tested-by: David Huang <David.Huang@quantatw.com> Reviewed-by: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: David Huang <David.Huang@quantatw.com> Reviewed-by: Vincent Wang <vwang@chromium.org>
-rw-r--r--driver/led/oz554.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/driver/led/oz554.c b/driver/led/oz554.c
index f53b25f138..60581eb64c 100644
--- a/driver/led/oz554.c
+++ b/driver/led/oz554.c
@@ -23,6 +23,16 @@ struct oz554_value {
uint8_t data;
};
+/*
+ * OZ554ALN asserts the interrupt when it's ready for writing settings, which
+ * are cleared when it's turned off. We enable the interrupt on HOOK_INIT and
+ * keep it enabled in S0/S3/S5.
+ *
+ * It's assumed the device doesn't have a lid and OZ554ALN is powered only in
+ * S0. For clamshell devices, different interrupt & power control scheme may be
+ * needed.
+ */
+
/* This ordering is suggested by vendor. */
static const struct oz554_value order[] = {
/*
@@ -77,6 +87,7 @@ static void set_oz554_reg(void)
return;
}
}
+ CPRINTS("Wrote OZ554 settings");
}
static void backlight_enable_deferred(void)
@@ -91,14 +102,8 @@ void backlight_enable_interrupt(enum gpio_signal signal)
hook_call_deferred(&backlight_enable_deferred_data, 30 * MSEC);
}
-static void on_chipset_resume(void)
+static void init_oz554(void)
{
gpio_enable_interrupt(GPIO_PANEL_BACKLIGHT_EN);
}
-DECLARE_HOOK(HOOK_CHIPSET_RESUME, on_chipset_resume, HOOK_PRIO_DEFAULT);
-
-static void on_chipset_shutdown(void)
-{
- gpio_disable_interrupt(GPIO_PANEL_BACKLIGHT_EN);
-}
-DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, on_chipset_shutdown, HOOK_PRIO_DEFAULT);
+DECLARE_HOOK(HOOK_INIT, init_oz554, HOOK_PRIO_DEFAULT);