diff mbox series

[RFC,5/5] mfd: cs40l26: Add CODEC driver component

Message ID 1685059471-9598-5-git-send-email-fred.treven@cirrus.com
State New
Headers show
Series [v2,1/5] dt-bindings: input: cirrus,cs40l26: Support for CS40L26 | expand

Commit Message

Fred Treven May 26, 2023, 12:04 a.m. UTC
Use MFD interface to load the CODEC driver along
with the Input FF driver.

Signed-off-by: Fred Treven <fred.treven@cirrus.com>
---
 drivers/input/misc/cs40l26.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/drivers/input/misc/cs40l26.c b/drivers/input/misc/cs40l26.c
index 12c29cbd4ff0..35d15a6c2230 100644
--- a/drivers/input/misc/cs40l26.c
+++ b/drivers/input/misc/cs40l26.c
@@ -13,6 +13,7 @@ 
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
+#include <linux/mfd/core.h>
 #include <linux/pm_runtime.h>
 #include <linux/string.h>
 #include <linux/firmware/cirrus/wmfw.h>
@@ -2136,6 +2137,10 @@  static inline int cs40l26_worker_init(struct cs40l26_private *cs40l26)
 	return 0;
 }
 
+static const struct mfd_cell cs40l26_devs[] = {
+	{ .name = "cs40l26-codec" },
+};
+
 static struct regulator_bulk_data cs40l26_supplies[] = {
 	{ .supply = "VP" },
 	{ .supply = "VA" },
@@ -2275,6 +2280,12 @@  int cs40l26_probe(struct cs40l26_private *cs40l26)
 	if (error)
 		goto err;
 
+	error = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, cs40l26_devs, 1, NULL, 0, NULL);
+	if (error) {
+		dev_err(dev, "Failed to MFD add device %s: %d\n", cs40l26_devs[0].name, error);
+		goto err;
+	}
+
 	return 0;
 err:
 	cs40l26_remove(cs40l26);