linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] ACPI / scan: Create platform device for BSG2150 ACPI nodes
@ 2018-12-20 14:34 Hans de Goede
  2018-12-20 14:34 ` [PATCH] " Hans de Goede
  2019-02-05 15:55 ` [PATCH 0/1] " Andy Shevchenko
  0 siblings, 2 replies; 4+ messages in thread
From: Hans de Goede @ 2018-12-20 14:34 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown, Darren Hart, Andy Shevchenko
  Cc: Hans de Goede, linux-acpi, platform-driver-x86, linux-kernel

Hi All,

This patch adds support for another ACPI HID which describes multiple
i2c-clients in a single node. As such this applies on top of the recent
patch from Andy making a similar change for INT3515 nodes:

Commit a3dd034a1707 ("ACPI / scan: Create platform device for INT3515
ACPI nodes"), which is in the platform-drivers-x86-v4.21-1 tag.

As such I believe it would be best to merge this tree through the
linux-platform-drivers-x86 tree, as was done for the INT3515 patch.

Rafael, may we have your ack for merging the single line drivers/acpi
change through the linux-platform-drivers-x86 tree?

Regards,

Hans


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ACPI / scan: Create platform device for BSG2150 ACPI nodes
  2018-12-20 14:34 [PATCH 0/1] ACPI / scan: Create platform device for BSG2150 ACPI nodes Hans de Goede
@ 2018-12-20 14:34 ` Hans de Goede
  2018-12-20 20:59   ` Rafael J. Wysocki
  2019-02-05 15:55 ` [PATCH 0/1] " Andy Shevchenko
  1 sibling, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2018-12-20 14:34 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown, Darren Hart, Andy Shevchenko
  Cc: Hans de Goede, linux-acpi, platform-driver-x86, linux-kernel

The Point of View TAB-P1006W-232-3G tablet has an ACPI firmware node with
a HID of BSG2150 describing the 2 Bosch sensors used in the device a
BMC150 compatible accelerometer and a BMC150 compatible magnetometer.

The ACPI firmware node actually contains 3 I2cSerialBusV2 resources,
but this seems to be a copy and paste job from the BSG1160 firmware node
on other devices, since there is no i2c-client listening to the 0x68
address listed in the third resource and the 0x68 address is identical
to the address of the third resource in the BSG1160 nodes, where as the
other 2 addresses are different.

Add the ID to the I2C multi instantiate list, so that the
i2c-multi-instantiate.c driver can handle it;

And add the necessary info to the i2c-multi-instantiate.c driver to
enumerate all I2C slaves correctly.

To avoid triggering the:

        if (i < multi->num_clients) {
                dev_err(dev, "Error finding driver, idx %d\n", i);

Error this commit lists the 3th device in the i2c_inst_data with a
type of "bsg2150_dummy_dev".

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/acpi/scan.c                          | 1 +
 drivers/platform/x86/i2c-multi-instantiate.c | 9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index e9eda5558c1f..d5b981cafaf8 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1540,6 +1540,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
 	 */
 	static const struct acpi_device_id i2c_multi_instantiate_ids[] = {
 		{"BSG1160", },
+		{"BSG2150", },
 		{"INT33FE", },
 		{"INT3515", },
 		{}
diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
index 3d893e0ac250..197d8a192721 100644
--- a/drivers/platform/x86/i2c-multi-instantiate.c
+++ b/drivers/platform/x86/i2c-multi-instantiate.c
@@ -159,6 +159,14 @@ static const struct i2c_inst_data bsg1160_data[]  = {
 	{}
 };
 
+static const struct i2c_inst_data bsg2150_data[]  = {
+	{ "bmc150_accel", IRQ_RESOURCE_GPIO, 0 },
+	{ "bmc150_magn" },
+	/* The resources describe a 3th client, but it is not really there. */
+	{ "bsg2150_dummy_dev" },
+	{}
+};
+
 static const struct i2c_inst_data int3515_data[]  = {
 	{ "tps6598x", IRQ_RESOURCE_APIC, 0 },
 	{ "tps6598x", IRQ_RESOURCE_APIC, 1 },
@@ -173,6 +181,7 @@ static const struct i2c_inst_data int3515_data[]  = {
  */
 static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = {
 	{ "BSG1160", (unsigned long)bsg1160_data },
+	{ "BSG2150", (unsigned long)bsg2150_data },
 	{ "INT3515", (unsigned long)int3515_data },
 	{ }
 };
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI / scan: Create platform device for BSG2150 ACPI nodes
  2018-12-20 14:34 ` [PATCH] " Hans de Goede
@ 2018-12-20 20:59   ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2018-12-20 20:59 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Len Brown, Darren Hart, Andy Shevchenko, linux-acpi,
	platform-driver-x86, linux-kernel

On Thursday, December 20, 2018 3:34:51 PM CET Hans de Goede wrote:
> The Point of View TAB-P1006W-232-3G tablet has an ACPI firmware node with
> a HID of BSG2150 describing the 2 Bosch sensors used in the device a
> BMC150 compatible accelerometer and a BMC150 compatible magnetometer.
> 
> The ACPI firmware node actually contains 3 I2cSerialBusV2 resources,
> but this seems to be a copy and paste job from the BSG1160 firmware node
> on other devices, since there is no i2c-client listening to the 0x68
> address listed in the third resource and the 0x68 address is identical
> to the address of the third resource in the BSG1160 nodes, where as the
> other 2 addresses are different.
> 
> Add the ID to the I2C multi instantiate list, so that the
> i2c-multi-instantiate.c driver can handle it;
> 
> And add the necessary info to the i2c-multi-instantiate.c driver to
> enumerate all I2C slaves correctly.
> 
> To avoid triggering the:
> 
>         if (i < multi->num_clients) {
>                 dev_err(dev, "Error finding driver, idx %d\n", i);
> 
> Error this commit lists the 3th device in the i2c_inst_data with a
> type of "bsg2150_dummy_dev".
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

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

> ---
>  drivers/acpi/scan.c                          | 1 +
>  drivers/platform/x86/i2c-multi-instantiate.c | 9 +++++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index e9eda5558c1f..d5b981cafaf8 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -1540,6 +1540,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
>  	 */
>  	static const struct acpi_device_id i2c_multi_instantiate_ids[] = {
>  		{"BSG1160", },
> +		{"BSG2150", },
>  		{"INT33FE", },
>  		{"INT3515", },
>  		{}
> diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
> index 3d893e0ac250..197d8a192721 100644
> --- a/drivers/platform/x86/i2c-multi-instantiate.c
> +++ b/drivers/platform/x86/i2c-multi-instantiate.c
> @@ -159,6 +159,14 @@ static const struct i2c_inst_data bsg1160_data[]  = {
>  	{}
>  };
>  
> +static const struct i2c_inst_data bsg2150_data[]  = {
> +	{ "bmc150_accel", IRQ_RESOURCE_GPIO, 0 },
> +	{ "bmc150_magn" },
> +	/* The resources describe a 3th client, but it is not really there. */
> +	{ "bsg2150_dummy_dev" },
> +	{}
> +};
> +
>  static const struct i2c_inst_data int3515_data[]  = {
>  	{ "tps6598x", IRQ_RESOURCE_APIC, 0 },
>  	{ "tps6598x", IRQ_RESOURCE_APIC, 1 },
> @@ -173,6 +181,7 @@ static const struct i2c_inst_data int3515_data[]  = {
>   */
>  static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = {
>  	{ "BSG1160", (unsigned long)bsg1160_data },
> +	{ "BSG2150", (unsigned long)bsg2150_data },
>  	{ "INT3515", (unsigned long)int3515_data },
>  	{ }
>  };
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/1] ACPI / scan: Create platform device for BSG2150 ACPI nodes
  2018-12-20 14:34 [PATCH 0/1] ACPI / scan: Create platform device for BSG2150 ACPI nodes Hans de Goede
  2018-12-20 14:34 ` [PATCH] " Hans de Goede
@ 2019-02-05 15:55 ` Andy Shevchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2019-02-05 15:55 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Rafael J . Wysocki, Len Brown, Darren Hart, Andy Shevchenko,
	ACPI Devel Maling List, Platform Driver,
	Linux Kernel Mailing List

On Thu, Dec 20, 2018 at 4:35 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi All,
>
> This patch adds support for another ACPI HID which describes multiple
> i2c-clients in a single node. As such this applies on top of the recent
> patch from Andy making a similar change for INT3515 nodes:
>
> Commit a3dd034a1707 ("ACPI / scan: Create platform device for INT3515
> ACPI nodes"), which is in the platform-drivers-x86-v4.21-1 tag.
>
> As such I believe it would be best to merge this tree through the
> linux-platform-drivers-x86 tree, as was done for the INT3515 patch.
>
> Rafael, may we have your ack for merging the single line drivers/acpi
> change through the linux-platform-drivers-x86 tree?
>

Pushed to my review and testing queue, thanks!

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-05 15:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-20 14:34 [PATCH 0/1] ACPI / scan: Create platform device for BSG2150 ACPI nodes Hans de Goede
2018-12-20 14:34 ` [PATCH] " Hans de Goede
2018-12-20 20:59   ` Rafael J. Wysocki
2019-02-05 15:55 ` [PATCH 0/1] " Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).