summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSebastian Reichel <sre@kernel.org>2018-07-05 17:05:12 +0200
committerSebastian Reichel <sre@kernel.org>2018-07-05 17:12:23 +0200
commit0d08901ba8765134dd1e78b933a79a52b8561f04 (patch)
treecebb332a6556dbf1362a0a8ac769a967637d0da2 /drivers
parentpower: supply: max1721x: fix spelling mistake "RSenese" -> "RSense" (diff)
parentmfd: cros_ec_dev: Register cros_usbpd-charger driver as a subdevice. (diff)
downloadlinux-0d08901ba8765134dd1e78b933a79a52b8561f04.tar.xz
linux-0d08901ba8765134dd1e78b933a79a52b8561f04.zip
Merge tag 'ib-mfd-v4.19' into psy-next
Immutable branch between MFD and power-supply due for the v4.19 merge window Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/cros_ec_dev.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
index 306e1fd109bd..1dd00337d903 100644
--- a/drivers/mfd/cros_ec_dev.c
+++ b/drivers/mfd/cros_ec_dev.c
@@ -381,6 +381,10 @@ static const struct mfd_cell cros_ec_rtc_cells[] = {
{ .name = "cros-ec-rtc" }
};
+static const struct mfd_cell cros_usbpd_charger_cells[] = {
+ { .name = "cros-usbpd-charger" }
+};
+
static int ec_device_probe(struct platform_device *pdev)
{
int retval = -ENOMEM;
@@ -431,6 +435,18 @@ static int ec_device_probe(struct platform_device *pdev)
retval);
}
+ /* Check whether this EC instance has the PD charge manager */
+ if (cros_ec_check_features(ec, EC_FEATURE_USB_PD)) {
+ retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO,
+ cros_usbpd_charger_cells,
+ ARRAY_SIZE(cros_usbpd_charger_cells),
+ NULL, 0, NULL);
+ if (retval)
+ dev_err(ec->dev,
+ "failed to add cros-usbpd-charger device: %d\n",
+ retval);
+ }
+
/* Take control of the lightbar from the EC. */
lb_manual_suspend_ctrl(ec, 1);