diff mbox series

[v5,1/3] mfd: twl-core: Add a clock subdevice for the TWL6030

Message ID 20241014161109.2222-2-andreas@kemnade.info (mailing list archive)
State Not Applicable, archived
Headers show
Series mfd: twl: Add clock for TWL6030 | expand

Commit Message

Andreas Kemnade Oct. 14, 2024, 4:11 p.m. UTC
Also the TWL6030 has some clocks, so add a subdevice for that.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
---
 drivers/mfd/twl-core.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

Comments

Lee Jones Oct. 15, 2024, 8:33 a.m. UTC | #1
On Mon, 14 Oct 2024 18:11:07 +0200, Andreas Kemnade wrote:
> Also the TWL6030 has some clocks, so add a subdevice for that.
> 
> 

Applied, thanks!

[1/3] mfd: twl-core: Add a clock subdevice for the TWL6030
      commit: 5ebc60259a0fdd13aef077726b1773f1ae091efc

--
Lee Jones [李琼斯]
Andreas Kemnade Oct. 23, 2024, 10:04 a.m. UTC | #2
Am Tue, 15 Oct 2024 09:33:10 +0100
schrieb Lee Jones <lee@kernel.org>:

> On Mon, 14 Oct 2024 18:11:07 +0200, Andreas Kemnade wrote:
> > Also the TWL6030 has some clocks, so add a subdevice for that.
> > 
> >   
> 
> Applied, thanks!
> 
> [1/3] mfd: twl-core: Add a clock subdevice for the TWL6030
>       commit: 5ebc60259a0fdd13aef077726b1773f1ae091efc
> 
hmm, this does not appear in linux-next. Did anything went wrong?

Regards,
Andreas
Lee Jones Oct. 25, 2024, 8:50 a.m. UTC | #3
On Wed, 23 Oct 2024, Andreas Kemnade wrote:

> Am Tue, 15 Oct 2024 09:33:10 +0100
> schrieb Lee Jones <lee@kernel.org>:
> 
> > On Mon, 14 Oct 2024 18:11:07 +0200, Andreas Kemnade wrote:
> > > Also the TWL6030 has some clocks, so add a subdevice for that.
> > > 
> > >   
> > 
> > Applied, thanks!
> > 
> > [1/3] mfd: twl-core: Add a clock subdevice for the TWL6030
> >       commit: 5ebc60259a0fdd13aef077726b1773f1ae091efc
> > 
> hmm, this does not appear in linux-next. Did anything went wrong?

Looks like a clerical error on my part.

Thanks for noticing.  Re-applied and pushed.
diff mbox series

Patch

diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index c130ffef182f..f89eda4a17fe 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -711,6 +711,10 @@  static struct of_dev_auxdata twl_auxdata_lookup[] = {
 	{ /* sentinel */ },
 };
 
+static const struct mfd_cell twl6030_cells[] = {
+	{ .name = "twl6030-clk" },
+};
+
 static const struct mfd_cell twl6032_cells[] = {
 	{ .name = "twl6032-clk" },
 };
@@ -861,17 +865,23 @@  twl_probe(struct i2c_client *client)
 				 TWL4030_DCDC_GLOBAL_CFG);
 	}
 
-	if (id->driver_data == (TWL6030_CLASS | TWL6032_SUBCLASS)) {
-		status = devm_mfd_add_devices(&client->dev,
-					      PLATFORM_DEVID_NONE,
-					      twl6032_cells,
-					      ARRAY_SIZE(twl6032_cells),
-					      NULL, 0, NULL);
+	if (twl_class_is_6030()) {
+		const struct mfd_cell *cells;
+		int num_cells;
+
+		if (id->driver_data & TWL6032_SUBCLASS) {
+			cells = twl6032_cells;
+			num_cells = ARRAY_SIZE(twl6032_cells);
+		} else {
+			cells = twl6030_cells;
+			num_cells = ARRAY_SIZE(twl6030_cells);
+		}
+
+		status = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE,
+					      cells, num_cells, NULL, 0, NULL);
 		if (status < 0)
 			goto free;
-	}
 
-	if (twl_class_is_6030()) {
 		if (of_device_is_system_power_controller(node)) {
 			if (!pm_power_off)
 				pm_power_off = twl6030_power_off;