diff options
author | Abhishek Pandit-Subedi <abhishekpandit@chromium.org> | 2024-09-10 12:15:27 +0200 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-10-16 10:04:09 +0200 |
commit | 7613bc0d116ae9ee7fdda88d89057050b5e10b11 (patch) | |
tree | 2ecf1517c157894c9579b66e7fc36a1f31a060fd | |
parent | mfd: cros_ec: Load cros_ec_ucsi on supported ECs (diff) | |
download | linux-7613bc0d116ae9ee7fdda88d89057050b5e10b11.tar.xz linux-7613bc0d116ae9ee7fdda88d89057050b5e10b11.zip |
mfd: cros_ec: Don't load charger with UCSI
When UCSI is enabled, don't load cros_usbpd_charger and cros_usbpd_logger
drivers. Charger functionality is provided by the UCSI driver already and
logging will need to be added.
Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Ćukasz Bartosik <ukaszb@chromium.org>
Link: https://lore.kernel.org/r/20240910101527.603452-9-ukaszb@chromium.org
Signed-off-by: Lee Jones <lee@kernel.org>
-rw-r--r-- | drivers/mfd/cros_ec_dev.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index 44300352ff69..2cbd07359954 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -134,11 +134,6 @@ static const struct cros_feature_to_cells cros_subdevices[] = { .num_cells = ARRAY_SIZE(cros_ec_ucsi_cells), }, { - .id = EC_FEATURE_USB_PD, - .mfd_cells = cros_usbpd_charger_cells, - .num_cells = ARRAY_SIZE(cros_usbpd_charger_cells), - }, - { .id = EC_FEATURE_HANG_DETECT, .mfd_cells = cros_ec_wdt_cells, .num_cells = ARRAY_SIZE(cros_ec_wdt_cells), @@ -262,6 +257,21 @@ static int ec_device_probe(struct platform_device *pdev) } /* + * UCSI provides power supply information so we don't need to separately + * load the cros_usbpd_charger driver. + */ + if (cros_ec_check_features(ec, EC_FEATURE_USB_PD) && + !cros_ec_check_features(ec, EC_FEATURE_UCSI_PPM)) { + retval = mfd_add_hotplug_devices(ec->dev, + cros_usbpd_charger_cells, + ARRAY_SIZE(cros_usbpd_charger_cells)); + + if (retval) + dev_warn(ec->dev, "failed to add usbpd-charger: %d\n", + retval); + } + + /* * Lightbar is a special case. Newer devices support autodetection, * but older ones do not. */ |