Commit 8f49b623 authored by Stephen Boyd's avatar Stephen Boyd Committed by Lee Jones

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: default avatarStephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20240219202325.4095816-3-swboyd@chromium.orgSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 7b79740d
...@@ -74,6 +74,10 @@ static const struct mfd_cell cros_ec_cec_cells[] = { ...@@ -74,6 +74,10 @@ static const struct mfd_cell cros_ec_cec_cells[] = {
{ .name = "cros-ec-cec", }, { .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[] = { static const struct mfd_cell cros_ec_rtc_cells[] = {
{ .name = "cros-ec-rtc", }, { .name = "cros-ec-rtc", },
}; };
...@@ -101,6 +105,11 @@ static const struct cros_feature_to_cells cros_subdevices[] = { ...@@ -101,6 +105,11 @@ static const struct cros_feature_to_cells cros_subdevices[] = {
.mfd_cells = cros_ec_cec_cells, .mfd_cells = cros_ec_cec_cells,
.num_cells = ARRAY_SIZE(cros_ec_cec_cells), .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, .id = EC_FEATURE_RTC,
.mfd_cells = cros_ec_rtc_cells, .mfd_cells = cros_ec_rtc_cells,
......
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