Skip to contentSkip to conversation

mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

PATCH New Hans de Goede 5 participants 12 messages Oct 5, 2016 – Oct 26, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

Hi all,

Dennis Gilmore (in the Cc) reports that axp20x-i2c does not auto-load on e.g. the CHIP. I believe this is caused by the i2c-ids table not being populated.

I believe the patch in the next mail should fix this.

Regards,

Hans

#1 lore raw

PATCH 1/1 mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

The i2c subsys does not load modules by compatible, only by i2c-id, with e.g. a modalias of: "i2c:axp209".

Populate the axp20x_i2c_id[] table with supported ids, so that module auto-loading will work.

---
 drivers/mfd/axp20x-i2c.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mfd/axp20x-i2c.c +4 -3
index b1b8658..d35a5fe 100644
@@ -69,10 +69,11 @@ static const struct of_device_id axp20x_i2c_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, axp20x_i2c_of_match);
 
-/*
- * This is useless for OF-enabled devices, but it is needed by I2C subsystem
- */
 static const struct i2c_device_id axp20x_i2c_id[] = {
+	{ "axp152", 0 },
+	{ "axp202", 0 },
+	{ "axp209", 0 },
+	{ "axp221", 0 },
 	{ },
 };
 MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id);
Signature · 1 line
2.9.3
#2 lore raw

PATCH 1/1 mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

Quoted 8 lines · Hans de Goede

The i2c subsys does not load modules by compatible, only by i2c-id, with e.g. a modalias of: "i2c:axp209".

Populate the axp20x_i2c_id[] table with supported ids, so that module auto-loading will work.

Even though axp20x-i2c seems to be the only "DT only" i2c client, would it make sense to add DT-based module autoloading to the i2c core?

This also made me realize we probably don't have module auto-loading for sunxi-rsb either.

Both should be doable with Stephen Boyd's "of: device: Export of_device_{get_modalias, uvent_modalias} to modules" patch.

Regards
ChenYu

#3 lore raw

PATCH 1/1 mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

Hi,

Quoted 7 lines · Chen-Yu Tsai
Quoted 6 lines · Hans de Goede

The i2c subsys does not load modules by compatible, only by i2c-id, with e.g. a modalias of: "i2c:axp209".

Populate the axp20x_i2c_id[] table with supported ids, so that module auto-loading will work.

Quoted 8 lines
Quoted 2 lines

Even though axp20x-i2c seems to be the only "DT only" i2c client, would it make sense to add DT-based module autoloading to the i2c core?

If it is not too invasive, then yes that would be a sensible addition IMHO.

Regards,

Hans

#4 lore raw

PATCH 1/1 mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

Quoted 11 lines · Hans de Goede
Quoted 10 lines · Chen-Yu Tsai
Quoted 8 lines · Hans de Goede

The i2c subsys does not load modules by compatible, only by i2c-id, with e.g. a modalias of: "i2c:axp209".

Populate the axp20x_i2c_id[] table with supported ids, so that module auto-loading will work.

Quoted 7 lines
Quoted 5 lines

Even though axp20x-i2c seems to be the only "DT only" i2c client, would it make sense to add DT-based module autoloading to the i2c core?

If it is not too invasive, then yes that would be a sensible addition IMHO.

If I understand you correctly, I already have a patch-set on the ML that does this.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#5 lore raw

PATCH 1/1 mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

Even though axp20x-i2c seems to be the only "DT only" i2c client, would it make sense to add DT-based module autoloading to the i2c core?

If it is not too invasive, then yes that would be a sensible addition IMHO.

If I understand you correctly, I already have a patch-set on the ML that does this.

Incomplete, though. But we will see if Kieran finds time somewhen...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161024/f6b74cf4/attachment.sig>

#6 lore raw

PATCH 1/1 mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

Quoted 11 lines · Wolfram Sang
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

Even though axp20x-i2c seems to be the only "DT only" i2c client, would it make sense to add DT-based module autoloading to the i2c core?

If it is not too invasive, then yes that would be a sensible addition IMHO.

If I understand you correctly, I already have a patch-set on the ML that does this.

Incomplete, though. But we will see if Kieran finds time somewhen...

I was under the impression it was all but ready.

What are you waiting on?

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#7 lore raw

PATCH 1/1 mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

Quoted 2 lines

I was under the impression it was all but ready.

Then, I would have applied it.

Quoted 1 line

What are you waiting on?

Lee, I don't want to explain it *again*. Please re-read Kieran's last attempt.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161024/241ed28c/attachment.sig>

#8 lore raw

PATCH 1/1 mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

Quoted 9 lines · Wolfram Sang
Quoted 2 lines

I was under the impression it was all but ready.

Then, I would have applied it.

Quoted 1 line

What are you waiting on?

Lee, I don't want to explain it *again*. Please re-read Kieran's last attempt.

I met with Kieran. He's submitted a new version.

Here's hoping! ;)

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#9 lore raw

PATCH 1/1 mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

In reply to Hans de Goede

Hi,

Quoted 21 lines · Hans de Goede

The i2c subsys does not load modules by compatible, only by i2c-id, with e.g. a modalias of: "i2c:axp209".

Populate the axp20x_i2c_id[] table with supported ids, so that module auto-loading will work.

---
 drivers/mfd/axp20x-i2c.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mfd/axp20x-i2c.c +0 -1
index b1b8658..d35a5fe 100644
@@ -69,10 +69,11 @@ static const struct of_device_id axp20x_i2c_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, axp20x_i2c_of_match);
 
-/*

drivers/mfd/axp20x-i2c.c static const struct of_device_id axp20x_i2c_of_match[] = { · line 79

Quoted 10 lines
drivers/mfd/axp20x-i2c.c +4 -2
- * This is useless for OF-enabled devices, but it is needed by I2C subsystem
- */
 static const struct i2c_device_id axp20x_i2c_id[] = {
+	{ "axp152", 0 },
+	{ "axp202", 0 },
+	{ "axp209", 0 },
+	{ "axp221", 0 },
 	{ },
 };
 MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id);

Thanks, queued.

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161019/fe135abd/attachment.sig>

#10 lore raw

PATCH 1/1 mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

Hi,

Quoted 8 lines · Sebastian Reichel
Quoted 8 lines
drivers/mfd/axp20x-i2c.c +0 -0
index b1b8658..d35a5fe 100644
@@ -69,10 +69,11 @@ static const struct of_device_id axp20x_i2c_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, axp20x_i2c_of_match);
 
Quoted 13 lines

drivers/mfd/axp20x-i2c.c static const struct of_device_id axp20x_i2c_of_match[] = { · line 79

Quoted 11 lines
drivers/mfd/axp20x-i2c.c +4 -3
-/*
- * This is useless for OF-enabled devices, but it is needed by I2C subsystem
- */
 static const struct i2c_device_id axp20x_i2c_id[] = {
+	{ "axp152", 0 },
+	{ "axp202", 0 },
+	{ "axp209", 0 },
+	{ "axp221", 0 },
 	{ },
 };
 MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id);

Thanks, queued.

My mistake. It should obviously go through mfd. So take this instead:

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161019/aa748c19/attachment.sig>

#11 lore raw

PATCH 1/1 mfd: axp20x-i2c: Add i2c-ids to fix module auto-loading

In reply to Hans de Goede
Quoted 11 lines · Hans de Goede

The i2c subsys does not load modules by compatible, only by i2c-id, with e.g. a modalias of: "i2c:axp209".

Populate the axp20x_i2c_id[] table with supported ids, so that module auto-loading will work.

---
 drivers/mfd/axp20x-i2c.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Applied (for now), thanks.

Quoted 19 lines
drivers/mfd/axp20x-i2c.c +4 -3
index b1b8658..d35a5fe 100644
@@ -69,10 +69,11 @@ static const struct of_device_id axp20x_i2c_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, axp20x_i2c_of_match);
 
-/*
- * This is useless for OF-enabled devices, but it is needed by I2C subsystem
- */
 static const struct i2c_device_id axp20x_i2c_id[] = {
+	{ "axp152", 0 },
+	{ "axp202", 0 },
+	{ "axp209", 0 },
+	{ "axp221", 0 },
 	{ },
 };
 MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id);
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog