Skip to content

Commit 03a5755

Browse files
superna9999Lee Jones
authored andcommitted
mfd: cros_ec_dev: Add CEC sub-device registration
The EC can expose a CEC bus, thus add the cros-ec-cec MFD sub-device when the CEC feature bit is present. Signed-off-by: Neil Armstrong <[email protected]> Reviewed-by: Enric Balletbo i Serra <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent f47674e commit 03a5755

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/mfd/cros_ec_dev.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ static void cros_ec_sensors_register(struct cros_ec_dev *ec)
377377
kfree(msg);
378378
}
379379

380+
static const struct mfd_cell cros_ec_cec_cells[] = {
381+
{ .name = "cros-ec-cec" }
382+
};
383+
380384
static const struct mfd_cell cros_ec_rtc_cells[] = {
381385
{ .name = "cros-ec-rtc" }
382386
};
@@ -419,6 +423,18 @@ static int ec_device_probe(struct platform_device *pdev)
419423
if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE))
420424
cros_ec_sensors_register(ec);
421425

426+
/* Check whether this EC instance has CEC host command support */
427+
if (cros_ec_check_features(ec, EC_FEATURE_CEC)) {
428+
retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO,
429+
cros_ec_cec_cells,
430+
ARRAY_SIZE(cros_ec_cec_cells),
431+
NULL, 0, NULL);
432+
if (retval)
433+
dev_err(ec->dev,
434+
"failed to add cros-ec-cec device: %d\n",
435+
retval);
436+
}
437+
422438
/* Check whether this EC instance has RTC host command support */
423439
if (cros_ec_check_features(ec, EC_FEATURE_RTC)) {
424440
retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO,

0 commit comments

Comments
 (0)