Skip to contentSkip to conversation

mfd: intel_soc_pmic_crc: Add support for non ACPI instantiated i2c_client

PATCH Applied Hans de Goede 3 participants 6 messages Nov 4, 2024 – Nov 7, 2024

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

v2 cover mfd: intel_soc_pmic_crc: Add support for non ACPI instantiated i2c_client

Hi All,

Here is v2 of my series to add support for non ACPI instantiated i2c_client-s to intel_soc_pmic_crc.

Changes in v2:
- Consistently use the filename as driver name for all intel_soc_pmic_* drivers
- Use "intel_soc_pmic_crc" as i2c_device_id.name

Regards,

Hans

Hans de Goede (2):
mfd: intel_soc_pmic_*: Consistently use filename as driver name
mfd: intel_soc_pmic_crc: Add support for non ACPI instantiated
i2c_client

 drivers/mfd/intel_soc_pmic_bxtwc.c | 2 +-
 drivers/mfd/intel_soc_pmic_chtwc.c | 2 +-
 drivers/mfd/intel_soc_pmic_crc.c   | 9 ++++++++-
 3 files changed, 10 insertions(+), 3 deletions(-)
Signature · 1 line
2.47.0
#1 lore raw

PATCH v2 1/2 mfd: intel_soc_pmic_*: Consistently use filename as driver name

Currently the intel_soc_pmic_bxtwc, intel_soc_pmic_chtwc and intel_soc_pmic_crc PMIC drivers use more or less free form strings for their driver name.

Where as intel_soc_pmic_chtdc_ti and intel_soc_pmic_mrfld use the driver's filename as driver name.

Update the 3 others to also use the driver's filename to make the naming consistent.

---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 2 +-
 drivers/mfd/intel_soc_pmic_chtwc.c | 2 +-
 drivers/mfd/intel_soc_pmic_crc.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/mfd/intel_soc_pmic_bxtwc.c +1 -1
index ccd76800d8e4..db98675f7ffa 100644
@@ -571,7 +571,7 @@ static struct platform_driver bxtwc_driver = {
 	.probe = bxtwc_probe,
 	.shutdown = bxtwc_shutdown,
 	.driver	= {
-		.name	= "BXTWC PMIC",
+		.name	= "intel_soc_pmic_bxtwc",
 		.pm     = pm_sleep_ptr(&bxtwc_pm_ops),
 		.acpi_match_table = bxtwc_acpi_ids,
 		.dev_groups = bxtwc_groups,
drivers/mfd/intel_soc_pmic_chtwc.c +1 -1
index 2a83f540d4c9..aa71a7d83fcd 100644
@@ -267,7 +267,7 @@ static const struct acpi_device_id cht_wc_acpi_ids[] = {
 
 static struct i2c_driver cht_wc_driver = {
 	.driver	= {
-		.name	= "CHT Whiskey Cove PMIC",
+		.name	= "intel_soc_pmic_chtwc",
 		.pm     = pm_sleep_ptr(&cht_wc_pm_ops),
 		.acpi_match_table = cht_wc_acpi_ids,
 	},
drivers/mfd/intel_soc_pmic_crc.c +1 -1
index 876d017f74fe..663a9e93ce87 100644
@@ -261,7 +261,7 @@ MODULE_DEVICE_TABLE(acpi, crystal_cove_acpi_match);
 
 static struct i2c_driver crystal_cove_i2c_driver = {
 	.driver = {
-		.name = "crystal_cove_i2c",
+		.name = "intel_soc_pmic_crc",
 		.pm = pm_sleep_ptr(&crystal_cove_pm_ops),
 		.acpi_match_table = crystal_cove_acpi_match,
 	},
Signature · 1 line
2.47.0
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] mfd: intel_soc_pmic_*: Consistently use filename as driver name

Quoted 9 lines · Hans de Goede

Currently the intel_soc_pmic_bxtwc, intel_soc_pmic_chtwc and intel_soc_pmic_crc PMIC drivers use more or less free form strings for their driver name.

Where as intel_soc_pmic_chtdc_ti and intel_soc_pmic_mrfld use the driver's filename as driver name.

Update the 3 others to also use the driver's filename to make the naming consistent.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw

PATCH v2 2/2 mfd: intel_soc_pmic_crc: Add support for non ACPI instantiated i2c_client

In reply to Hans de Goede

On some x86 Bay Trail tablets which shipped with Android as factory OS, the DSDT is so broken that the PMIC needs to be manually instantiated by the special x86-android-tablets.ko "fixup" driver for cases like this.

Add an i2c_device_id table so that the driver can match on manually instantiated i2c_client-s (which lack an ACPI fwnode to match on).

---
Changes in v2:
- Use "intel_soc_pmic_crc" as i2c_device_id.name

---
 drivers/mfd/intel_soc_pmic_crc.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/mfd/intel_soc_pmic_crc.c +7 -0
index 663a9e93ce87..879fbf5cd162 100644
@@ -259,12 +259,19 @@ static const struct acpi_device_id crystal_cove_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, crystal_cove_acpi_match);
 
+static const struct i2c_device_id crystal_cove_i2c_match[] = {
+	{ "intel_soc_pmic_crc" },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, crystal_cove_i2c_match);
+
 static struct i2c_driver crystal_cove_i2c_driver = {
 	.driver = {
 		.name = "intel_soc_pmic_crc",
 		.pm = pm_sleep_ptr(&crystal_cove_pm_ops),
 		.acpi_match_table = crystal_cove_acpi_match,
 	},
+	.id_table = crystal_cove_i2c_match,
 	.probe = crystal_cove_i2c_probe,
 	.remove = crystal_cove_i2c_remove,
 	.shutdown = crystal_cove_shutdown,
Signature · 1 line
2.47.0
maintainer Applied
#5 lore raw
In reply to Hans de Goede
Quoted 9 lines · Hans de Goede

Here is v2 of my series to add support for non ACPI instantiated i2c_client-s to intel_soc_pmic_crc.

Changes in v2:
- Consistently use the filename as driver name for all intel_soc_pmic_* drivers
- Use "intel_soc_pmic_crc" as i2c_device_id.name

[...]

Applied, thanks!

[1/2] mfd: intel_soc_pmic_*: Consistently use filename as driver name

      commit: c3768c474830fab0fa3063e72dd005eb6cef0618
[2/2] mfd: intel_soc_pmic_crc: Add support for non ACPI instantiated i2c_client
      commit: bd302f82be1e10a1395d58d405e0e8af049d1cc3

--
Lee Jones [李琼斯]