linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] i2c: dln2: Pass forward ACPI companion
@ 2016-03-24 18:59 Irina Tirdea
  2016-04-16 21:33 ` Wolfram Sang
  2016-04-24 20:30 ` Wolfram Sang
  0 siblings, 2 replies; 4+ messages in thread
From: Irina Tirdea @ 2016-03-24 18:59 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c
  Cc: linux-kernel, Octavian Purdila, Laurentiu Palcu, Irina Tirdea

Share the ACPI companion for the platform device with the
i2c adapter, so that the adapter has access to the properties
defined in ACPI tables.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
---
 drivers/i2c/busses/i2c-dln2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-dln2.c b/drivers/i2c/busses/i2c-dln2.c
index 1600edd..f2eb4f7 100644
--- a/drivers/i2c/busses/i2c-dln2.c
+++ b/drivers/i2c/busses/i2c-dln2.c
@@ -19,6 +19,7 @@
 #include <linux/i2c.h>
 #include <linux/platform_device.h>
 #include <linux/mfd/dln2.h>
+#include <linux/acpi.h>
 
 #define DLN2_I2C_MODULE_ID		0x03
 #define DLN2_I2C_CMD(cmd)		DLN2_CMD(cmd, DLN2_I2C_MODULE_ID)
@@ -210,6 +211,7 @@ static int dln2_i2c_probe(struct platform_device *pdev)
 	dln2->adapter.algo = &dln2_i2c_usb_algorithm;
 	dln2->adapter.quirks = &dln2_i2c_quirks;
 	dln2->adapter.dev.parent = dev;
+	ACPI_COMPANION_SET(&dln2->adapter.dev, ACPI_COMPANION(&pdev->dev));
 	dln2->adapter.dev.of_node = dev->of_node;
 	i2c_set_adapdata(&dln2->adapter, dln2);
 	snprintf(dln2->adapter.name, sizeof(dln2->adapter.name), "%s-%s-%d",
-- 
1.9.1

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

* Re: [PATCH 1/1] i2c: dln2: Pass forward ACPI companion
  2016-03-24 18:59 [PATCH 1/1] i2c: dln2: Pass forward ACPI companion Irina Tirdea
@ 2016-04-16 21:33 ` Wolfram Sang
  2016-04-18  7:54   ` Mika Westerberg
  2016-04-24 20:30 ` Wolfram Sang
  1 sibling, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2016-04-16 21:33 UTC (permalink / raw)
  To: Irina Tirdea, Mika Westerberg
  Cc: linux-i2c, linux-kernel, Octavian Purdila, Laurentiu Palcu

[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]

On Thu, Mar 24, 2016 at 08:59:16PM +0200, Irina Tirdea wrote:
> Share the ACPI companion for the platform device with the
> i2c adapter, so that the adapter has access to the properties
> defined in ACPI tables.
> 
> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
> ---

Adding Mika for my question: A few drivers do this, does it make sense
to put this into the core?

Apart from that, looks good to me.

>  drivers/i2c/busses/i2c-dln2.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-dln2.c b/drivers/i2c/busses/i2c-dln2.c
> index 1600edd..f2eb4f7 100644
> --- a/drivers/i2c/busses/i2c-dln2.c
> +++ b/drivers/i2c/busses/i2c-dln2.c
> @@ -19,6 +19,7 @@
>  #include <linux/i2c.h>
>  #include <linux/platform_device.h>
>  #include <linux/mfd/dln2.h>
> +#include <linux/acpi.h>
>  
>  #define DLN2_I2C_MODULE_ID		0x03
>  #define DLN2_I2C_CMD(cmd)		DLN2_CMD(cmd, DLN2_I2C_MODULE_ID)
> @@ -210,6 +211,7 @@ static int dln2_i2c_probe(struct platform_device *pdev)
>  	dln2->adapter.algo = &dln2_i2c_usb_algorithm;
>  	dln2->adapter.quirks = &dln2_i2c_quirks;
>  	dln2->adapter.dev.parent = dev;
> +	ACPI_COMPANION_SET(&dln2->adapter.dev, ACPI_COMPANION(&pdev->dev));
>  	dln2->adapter.dev.of_node = dev->of_node;
>  	i2c_set_adapdata(&dln2->adapter, dln2);
>  	snprintf(dln2->adapter.name, sizeof(dln2->adapter.name), "%s-%s-%d",
> -- 
> 1.9.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 1/1] i2c: dln2: Pass forward ACPI companion
  2016-04-16 21:33 ` Wolfram Sang
@ 2016-04-18  7:54   ` Mika Westerberg
  0 siblings, 0 replies; 4+ messages in thread
From: Mika Westerberg @ 2016-04-18  7:54 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Irina Tirdea, linux-i2c, linux-kernel, Octavian Purdila,
	Laurentiu Palcu

On Sat, Apr 16, 2016 at 11:33:04PM +0200, Wolfram Sang wrote:
> On Thu, Mar 24, 2016 at 08:59:16PM +0200, Irina Tirdea wrote:
> > Share the ACPI companion for the platform device with the
> > i2c adapter, so that the adapter has access to the properties
> > defined in ACPI tables.
> > 
> > Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
> > ---
> 
> Adding Mika for my question: A few drivers do this, does it make sense
> to put this into the core?

It is pretty much dependent on the driver in question, how it wants to
deal with the ACPI companion.

DT does the same for of_node:

	ACPI_COMPANION_SET(&dln2->adapter.dev, ACPI_COMPANION(&pdev->dev));
  	dln2->adapter.dev.of_node = dev->of_node;

> Apart from that, looks good to me.

Looks good to me too.

> >  drivers/i2c/busses/i2c-dln2.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/i2c/busses/i2c-dln2.c b/drivers/i2c/busses/i2c-dln2.c
> > index 1600edd..f2eb4f7 100644
> > --- a/drivers/i2c/busses/i2c-dln2.c
> > +++ b/drivers/i2c/busses/i2c-dln2.c
> > @@ -19,6 +19,7 @@
> >  #include <linux/i2c.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/mfd/dln2.h>
> > +#include <linux/acpi.h>
> >  
> >  #define DLN2_I2C_MODULE_ID		0x03
> >  #define DLN2_I2C_CMD(cmd)		DLN2_CMD(cmd, DLN2_I2C_MODULE_ID)
> > @@ -210,6 +211,7 @@ static int dln2_i2c_probe(struct platform_device *pdev)
> >  	dln2->adapter.algo = &dln2_i2c_usb_algorithm;
> >  	dln2->adapter.quirks = &dln2_i2c_quirks;
> >  	dln2->adapter.dev.parent = dev;
> > +	ACPI_COMPANION_SET(&dln2->adapter.dev, ACPI_COMPANION(&pdev->dev));
> >  	dln2->adapter.dev.of_node = dev->of_node;
> >  	i2c_set_adapdata(&dln2->adapter, dln2);
> >  	snprintf(dln2->adapter.name, sizeof(dln2->adapter.name), "%s-%s-%d",
> > -- 
> > 1.9.1
> > 

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

* Re: [PATCH 1/1] i2c: dln2: Pass forward ACPI companion
  2016-03-24 18:59 [PATCH 1/1] i2c: dln2: Pass forward ACPI companion Irina Tirdea
  2016-04-16 21:33 ` Wolfram Sang
@ 2016-04-24 20:30 ` Wolfram Sang
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2016-04-24 20:30 UTC (permalink / raw)
  To: Irina Tirdea; +Cc: linux-i2c, linux-kernel, Octavian Purdila, Laurentiu Palcu

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

On Thu, Mar 24, 2016 at 08:59:16PM +0200, Irina Tirdea wrote:
> Share the ACPI companion for the platform device with the
> i2c adapter, so that the adapter has access to the properties
> defined in ACPI tables.
> 
> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-04-24 20:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-24 18:59 [PATCH 1/1] i2c: dln2: Pass forward ACPI companion Irina Tirdea
2016-04-16 21:33 ` Wolfram Sang
2016-04-18  7:54   ` Mika Westerberg
2016-04-24 20:30 ` Wolfram Sang

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).