Patchwork [v5,14/15] ACPI / scan: Create platform device for INT3515 ACPI nodes

login
register
mail settings
Submitter Andy Shevchenko
Date Nov. 28, 2018, 11:45 a.m.
Message ID <20181128114535.80223-15-andriy.shevchenko@linux.intel.com>
Download mbox | patch
Permalink /patch/667013/
State New
Headers show

Comments

Andy Shevchenko - Nov. 28, 2018, 11:45 a.m.
The ACPI device with INT3515 _HID is representing a complex USB PD
hardware infrastructure which includes several I2C slave ICs.

We add an ID to the I2C multi instantiate list to enumerate
all I2C slaves correctly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/acpi/scan.c                          | 1 +
 drivers/platform/x86/i2c-multi-instantiate.c | 9 +++++++++
 drivers/usb/typec/tps6598x.c                 | 8 ++++----
 3 files changed, 14 insertions(+), 4 deletions(-)
Heikki Krogerus - Nov. 28, 2018, 12:07 p.m.
On Wed, Nov 28, 2018 at 01:45:34PM +0200, Andy Shevchenko wrote:
> The ACPI device with INT3515 _HID is representing a complex USB PD
> hardware infrastructure which includes several I2C slave ICs.
> 
> We add an ID to the I2C multi instantiate list to enumerate
> all I2C slaves correctly.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/acpi/scan.c                          | 1 +
>  drivers/platform/x86/i2c-multi-instantiate.c | 9 +++++++++
>  drivers/usb/typec/tps6598x.c                 | 8 ++++----
>  3 files changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index bd1c59fb0e17..e9eda5558c1f 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -1541,6 +1541,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
>  	static const struct acpi_device_id i2c_multi_instantiate_ids[] = {
>  		{"BSG1160", },
>  		{"INT33FE", },
> +		{"INT3515", },
>  		{}
>  	};
>  
> diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
> index 2439d4c71118..3d893e0ac250 100644
> --- a/drivers/platform/x86/i2c-multi-instantiate.c
> +++ b/drivers/platform/x86/i2c-multi-instantiate.c
> @@ -159,12 +159,21 @@ static const struct i2c_inst_data bsg1160_data[]  = {
>  	{}
>  };
>  
> +static const struct i2c_inst_data int3515_data[]  = {
> +	{ "tps6598x", IRQ_RESOURCE_APIC, 0 },
> +	{ "tps6598x", IRQ_RESOURCE_APIC, 1 },
> +	{ "tps6598x", IRQ_RESOURCE_APIC, 2 },
> +	{ "tps6598x", IRQ_RESOURCE_APIC, 3 },
> +	{}
> +};
> +
>  /*
>   * Note new device-ids must also be added to i2c_multi_instantiate_ids in
>   * drivers/acpi/scan.c: acpi_device_enumeration_by_parent().
>   */
>  static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = {
>  	{ "BSG1160", (unsigned long)bsg1160_data },
> +	{ "INT3515", (unsigned long)int3515_data },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, i2c_multi_inst_acpi_ids);
> diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c
> index c84c8c189e90..1c0033ad8738 100644
> --- a/drivers/usb/typec/tps6598x.c
> +++ b/drivers/usb/typec/tps6598x.c
> @@ -501,19 +501,19 @@ static int tps6598x_remove(struct i2c_client *client)
>  	return 0;
>  }
>  
> -static const struct acpi_device_id tps6598x_acpi_match[] = {
> -	{ "INT3515", 0 },
> +static const struct i2c_device_id tps6598x_id[] = {
> +	{ "tps6598x" },
>  	{ }
>  };
> -MODULE_DEVICE_TABLE(acpi, tps6598x_acpi_match);
> +MODULE_DEVICE_TABLE(i2c, tps6598x_id);
>  
>  static struct i2c_driver tps6598x_i2c_driver = {
>  	.driver = {
>  		.name = "tps6598x",
> -		.acpi_match_table = tps6598x_acpi_match,
>  	},
>  	.probe_new = tps6598x_probe,
>  	.remove = tps6598x_remove,
> +	.id_table = tps6598x_id,
>  };
>  module_i2c_driver(tps6598x_i2c_driver);
>  
> -- 
> 2.19.2
Rafael J. Wysocki - Nov. 29, 2018, 8:58 p.m.
On Wed, Nov 28, 2018 at 12:48 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> The ACPI device with INT3515 _HID is representing a complex USB PD
> hardware infrastructure which includes several I2C slave ICs.
>
> We add an ID to the I2C multi instantiate list to enumerate
> all I2C slaves correctly.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

and I'm assuming that you will route the whole series through the
platform/x86 drivers tree.
Andy Shevchenko - Nov. 30, 2018, 9:56 a.m.
On Thu, Nov 29, 2018 at 09:58:51PM +0100, Rafael J. Wysocki wrote:
> On Wed, Nov 28, 2018 at 12:48 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > The ACPI device with INT3515 _HID is representing a complex USB PD
> > hardware infrastructure which includes several I2C slave ICs.
> >
> > We add an ID to the I2C multi instantiate list to enumerate
> > all I2C slaves correctly.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> 
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> and I'm assuming that you will route the whole series through the
> platform/x86 drivers tree.

Thanks, Rafael, will route through PDx86!

Patch

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index bd1c59fb0e17..e9eda5558c1f 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1541,6 +1541,7 @@  static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
 	static const struct acpi_device_id i2c_multi_instantiate_ids[] = {
 		{"BSG1160", },
 		{"INT33FE", },
+		{"INT3515", },
 		{}
 	};
 
diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
index 2439d4c71118..3d893e0ac250 100644
--- a/drivers/platform/x86/i2c-multi-instantiate.c
+++ b/drivers/platform/x86/i2c-multi-instantiate.c
@@ -159,12 +159,21 @@  static const struct i2c_inst_data bsg1160_data[]  = {
 	{}
 };
 
+static const struct i2c_inst_data int3515_data[]  = {
+	{ "tps6598x", IRQ_RESOURCE_APIC, 0 },
+	{ "tps6598x", IRQ_RESOURCE_APIC, 1 },
+	{ "tps6598x", IRQ_RESOURCE_APIC, 2 },
+	{ "tps6598x", IRQ_RESOURCE_APIC, 3 },
+	{}
+};
+
 /*
  * Note new device-ids must also be added to i2c_multi_instantiate_ids in
  * drivers/acpi/scan.c: acpi_device_enumeration_by_parent().
  */
 static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = {
 	{ "BSG1160", (unsigned long)bsg1160_data },
+	{ "INT3515", (unsigned long)int3515_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, i2c_multi_inst_acpi_ids);
diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c
index c84c8c189e90..1c0033ad8738 100644
--- a/drivers/usb/typec/tps6598x.c
+++ b/drivers/usb/typec/tps6598x.c
@@ -501,19 +501,19 @@  static int tps6598x_remove(struct i2c_client *client)
 	return 0;
 }
 
-static const struct acpi_device_id tps6598x_acpi_match[] = {
-	{ "INT3515", 0 },
+static const struct i2c_device_id tps6598x_id[] = {
+	{ "tps6598x" },
 	{ }
 };
-MODULE_DEVICE_TABLE(acpi, tps6598x_acpi_match);
+MODULE_DEVICE_TABLE(i2c, tps6598x_id);
 
 static struct i2c_driver tps6598x_i2c_driver = {
 	.driver = {
 		.name = "tps6598x",
-		.acpi_match_table = tps6598x_acpi_match,
 	},
 	.probe_new = tps6598x_probe,
 	.remove = tps6598x_remove,
+	.id_table = tps6598x_id,
 };
 module_i2c_driver(tps6598x_i2c_driver);