Skip to content

Commit 8f49b62

Browse files
bebarinolag-linaro
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 7b79740 commit 8f49b62

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/mfd/cros_ec_dev.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ static const struct mfd_cell cros_ec_cec_cells[] = {
7474
{ .name = "cros-ec-cec", },
7575
};
7676

77+
static const struct mfd_cell cros_ec_gpio_cells[] = {
78+
{ .name = "cros-ec-gpio", },
79+
};
80+
7781
static const struct mfd_cell cros_ec_rtc_cells[] = {
7882
{ .name = "cros-ec-rtc", },
7983
};
@@ -101,6 +105,11 @@ static const struct cros_feature_to_cells cros_subdevices[] = {
101105
.mfd_cells = cros_ec_cec_cells,
102106
.num_cells = ARRAY_SIZE(cros_ec_cec_cells),
103107
},
108+
{
109+
.id = EC_FEATURE_GPIO,
110+
.mfd_cells = cros_ec_gpio_cells,
111+
.num_cells = ARRAY_SIZE(cros_ec_gpio_cells),
112+
},
104113
{
105114
.id = EC_FEATURE_RTC,
106115
.mfd_cells = cros_ec_rtc_cells,

0 commit comments

Comments
 (0)