summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorStephen Boyd <swboyd@chromium.org>2024-02-19 12:23:24 -0800
committerLee Jones <lee@kernel.org>2024-02-23 17:14:13 +0000
commit8f49b623b9348e3374491df1a18ca2de285fc7da (patch)
tree96a5e57a43dff29f89746c0d9721df13bf45e341 /drivers/mfd
parent7b79740d42e7535901296f7acbab1043633422e6 (diff)
mfd: cros_ec_dev: Add GPIO device if feature present on EC
The ChromeOS embedded controller (EC) supports setting the state of GPIOs when the system is unlocked, and getting the state of GPIOs in all cases. Check for the feature support by checking for the GPIO feature and then populate a sub-device for the gpio hardware on the EC. Signed-off-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20240219202325.4095816-3-swboyd@chromium.org Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/cros_ec_dev.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
index 4996220ce64b..a52d59cc2b1e 100644
--- a/drivers/mfd/cros_ec_dev.c
+++ b/drivers/mfd/cros_ec_dev.c
@@ -74,6 +74,10 @@ static const struct mfd_cell cros_ec_cec_cells[] = {
{ .name = "cros-ec-cec", },
};
+static const struct mfd_cell cros_ec_gpio_cells[] = {
+ { .name = "cros-ec-gpio", },
+};
+
static const struct mfd_cell cros_ec_rtc_cells[] = {
{ .name = "cros-ec-rtc", },
};
@@ -102,6 +106,11 @@ static const struct cros_feature_to_cells cros_subdevices[] = {
.num_cells = ARRAY_SIZE(cros_ec_cec_cells),
},
{
+ .id = EC_FEATURE_GPIO,
+ .mfd_cells = cros_ec_gpio_cells,
+ .num_cells = ARRAY_SIZE(cros_ec_gpio_cells),
+ },
+ {
.id = EC_FEATURE_RTC,
.mfd_cells = cros_ec_rtc_cells,
.num_cells = ARRAY_SIZE(cros_ec_rtc_cells),