Re: [PATCH 3/4] fix module autoloading for ACPI enumerated devices

2014-01-16 Thread Zhang Rui
On Wed, 2014-01-15 at 17:08 +0200, Mika Westerberg wrote: On Tue, Jan 14, 2014 at 04:46:37PM +0800, Zhang Rui wrote: diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 3a94b79..2f4aea2 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -677,7 +677,13

Re: [PATCH 3/4] fix module autoloading for ACPI enumerated devices

2014-01-16 Thread Zhang Rui
On Thu, 2014-01-16 at 12:28 +, Mark Brown wrote: On Tue, Jan 14, 2014 at 04:46:37PM +0800, Zhang Rui wrote: ACPI enumerated devices has ACPI style _HID and _CID strings, all of these strings can be used for both driver loading and matching. Currently, in Platform, I2C and SPI bus

Re: [PATCH 3/4] fix module autoloading for ACPI enumerated devices

2014-01-16 Thread Zhang Rui
On Thu, 2014-01-16 at 13:27 +0100, Wolfram Sang wrote: diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index d74c0b3..c4c5588 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -104,6 +104,11 @@ static int i2c_device_match(struct device *dev, struct

Re: [PATCH 3/4] fix module autoloading for ACPI enumerated devices

2014-01-16 Thread Zhang Rui
On Fri, 2014-01-17 at 02:28 +0100, Rafael J. Wysocki wrote: On Thursday, January 16, 2014 04:04:35 PM Zhang Rui wrote: On Wed, 2014-01-15 at 17:08 +0200, Mika Westerberg wrote: On Tue, Jan 14, 2014 at 04:46:37PM +0800, Zhang Rui wrote: diff --git a/drivers/base/platform.c b/drivers/base

RE: [PATCH 4/4] OF: introduce OF style 'modalias' support for platform bus.

2014-01-15 Thread Zhang, Rui
-Original Message- From: Rob Herring [mailto:robherri...@gmail.com] Sent: Wednesday, January 15, 2014 9:45 PM To: Zhang, Rui Cc: linux-ker...@vger.kernel.org; linux-a...@vger.kernel.org; linux- i...@vger.kernel.org; linux-...@vger.kernel.org; w...@the-dreams.de; Mark Brown; Greg

Re: [PATCH 3/4] fix module autoloading for ACPI enumerated devices

2014-01-14 Thread Zhang Rui
On Mon, 2014-01-13 at 17:35 +, Mark Brown wrote: On Mon, Jan 13, 2014 at 09:48:31PM +0800, Zhang Rui wrote: ACPI enumerated devices has ACPI style _HID and _CID strings, all of these strings can be used for both driver loading and matching. But currently, in Platform, I2C and SPI bus

[PATCH 0/4] module autoloading fixes

2014-01-14 Thread Zhang Rui
their modalias as acpi:PNP0C0B. thanks, rui Zhang Rui (4): ACPI: fix create_modalias() return value handling ACPI: add module autoloading support for ACPI enumerated devices fix module autoloading for ACPI enumerated devices

[PATCH 3/4] fix module autoloading for ACPI enumerated devices

2014-01-14 Thread Zhang Rui
when the device node is created, because their modalias do not match. This also applies to I2C and SPI bus. With this patch, the device' modalias will be shown as acpi:INTABCD as well. Signed-off-by: Zhang Rui rui.zh...@intel.com --- drivers/base/platform.c | 12 +++- drivers/i2c/i2c

[PATCH 1/4] ACPI: fix create_modalias() return value handling

2014-01-14 Thread Zhang Rui
if there is an output error, return -ENOMEM if the output is truncated, and also fixes both acpi_device_uevent() and acpi_device_modalias_show() to do proper return value check. Signed-off-by: Zhang Rui rui.zh...@intel.com --- drivers/acpi/scan.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions

[PATCH 4/4] OF: introduce OF style 'modalias' support for platform bus.

2014-01-14 Thread Zhang Rui
Fix a problem that, the platform bus supports the OF style modalias in .uevent() call, but not in its device 'modalias' sysfs attribute. cc: devicet...@vger.kernel.org Signed-off-by: Zhang Rui rui.zh...@intel.com --- drivers/base/platform.c |4 drivers/of/device.c |3

[PATCH 2/4] ACPI: add module autoloading support for ACPI enumerated devices

2014-01-14 Thread Zhang Rui
, and another for exporting ACPI ids in device' modalias sysfs attribute. For any bus that supports ACPI enumerated devices, it needs to invoke these two functions for their uevent and modalias attribute. Signed-off-by: Zhang Rui rui.zh...@intel.com Reviewed-by: Mika Westerberg mika.westerb

[PATCH 0/4] module autoloading fixes

2014-01-13 Thread Zhang Rui
their modalias as acpi:PNP0C0B. thanks, rui Zhang Rui (4): ACPI: fix create_modalias() return value handling ACPI: add module autoloading support for ACPI enumerated devices fix module autoloading for ACPI enumerated devices

[PATCH 2/4] ACPI: add module autoloading support for ACPI enumerated devices

2014-01-13 Thread Zhang Rui
, and another for exporting ACPI ids in device' modalias sysfs attribute. For any bus that supports ACPI enumerated devices, it needs to invoke these two functions for their uevent and modalias attribute. Signed-off-by: Zhang Rui rui.zh...@intel.com Reviewed-by: Mika Westerberg mika.westerb

[PATCH 1/4] ACPI: fix create_modalias() return value handling

2014-01-13 Thread Zhang Rui
if there is an output error, return -ENOMEM if the output is truncated, and also fixes both acpi_device_uevent() and acpi_device_modalias_show() to do proper return value check. Signed-off-by: Zhang Rui rui.zh...@intel.com --- drivers/acpi/scan.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions

[PATCH 3/4] fix module autoloading for ACPI enumerated devices

2014-01-13 Thread Zhang Rui
. This patch fixes module autoloading on those buses for ACPI enumerated devices. Signed-off-by: Zhang Rui rui.zh...@intel.com --- drivers/base/platform.c | 12 +++- drivers/i2c/i2c-core.c | 11 +++ drivers/spi/spi.c | 10 ++ 3 files changed, 32 insertions(+), 1

[PATCH 4/4] OF: introduce OF style 'modalias' support for platform bus.

2014-01-13 Thread Zhang Rui
Fix a problem that, the platform bus supports the OF style modalias in .uevent() call, but not in its device' modalias sysfs attribute. Signed-off-by: Zhang Rui rui.zh...@intel.com --- drivers/base/platform.c |4 drivers/of/device.c |3 +++ include/linux/of_device.h |6

Re: [PATCH] i2c: Fix modalias for ACPI enumerated I2C devices

2013-10-15 Thread Zhang Rui
On Mon, 2013-10-14 at 20:47 +0800, Zhang Rui wrote: On Mon, 2013-10-14 at 14:18 +0300, Jarkko Nikula wrote: On 10/14/2013 12:23 PM, Zhang Rui wrote: Hi, On Thu, 2013-10-10 at 17:17 +0300, Jarkko Nikula wrote: There is a minor fault about ACPI enumerated I2C devices

[PATCH 2/3] Platform: fix module autoloading for ACPI enumerated devices

2013-10-14 Thread Zhang Rui
Signed-off-by: Zhang Rui rui.zh...@intel.com --- drivers/base/platform.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 4f8bef3..80d2250 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -690,6 +690,10

[PATCH 1/3] ACPI: add module autoloading support for ACPI enumerated devices

2013-10-14 Thread Zhang Rui
introduces a new function to exporting ACPI ids as the module_alias, for the ACPI enumerate devices. For any drivers using MODULE_DEVICE_TALBE(acpi, blabla), the uevent file of its associated device must be fixed by invoking this function. Signed-off-by: Zhang Rui rui.zh...@intel.com --- drivers/acpi

[PATCH 3/3] I2C: fix module autoloading for ACPI enumerated devices

2013-10-14 Thread Zhang Rui
Signed-off-by: Zhang Rui rui.zh...@intel.com --- drivers/i2c/i2c-core.c |5 + 1 file changed, 5 insertions(+) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 3be58f8..d75b679 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -104,6 +104,11 @@ static

Re: [PATCH] i2c: Fix modalias for ACPI enumerated I2C devices

2013-10-14 Thread Zhang Rui
Hi, On Thu, 2013-10-10 at 17:17 +0300, Jarkko Nikula wrote: There is a minor fault about ACPI enumerated I2C devices with their modalias attribute. Now modalias is set by device instance not by hardware ID. For example i2c:INTABCD:00, i2c:INTABCD:01 etc. This means each device instance gets

Re: [PATCH 1/3] ACPI: add module autoloading support for ACPI enumerated devices

2013-10-14 Thread Zhang Rui
On Mon, 2013-10-14 at 13:14 +0300, Mika Westerberg wrote: On Mon, Oct 14, 2013 at 05:10:32PM +0800, Zhang Rui wrote: An ACPI enumerated device may have its compatible id strings. To support the compatible ACPI ids (acpi_device-pnp.ids), we introduced acpi_driver_match_device() to match

Re: [PATCH] i2c: Fix modalias for ACPI enumerated I2C devices

2013-10-14 Thread Zhang Rui
On Mon, 2013-10-14 at 14:18 +0300, Jarkko Nikula wrote: On 10/14/2013 12:23 PM, Zhang Rui wrote: Hi, On Thu, 2013-10-10 at 17:17 +0300, Jarkko Nikula wrote: There is a minor fault about ACPI enumerated I2C devices with their modalias attribute. Now modalias is set by device instance

RE: [RFC PATCH 1/6] Introduce acpi_match_device_id().

2012-10-01 Thread Zhang, Rui
-Original Message- From: Mika Westerberg [mailto:mika.westerb...@linux.intel.com] Sent: Monday, October 01, 2012 2:38 PM To: Zhang, Rui Cc: LKML; linux-pm; linux-i2c; linux-a...@vger.kernel.org; Len, Brown; Rafael J. Wysocki; Grant Likely; Dirk Brandewie Subject: Re: [RFC PATCH 1

RE: [RFC PATCH 2/6] Introduce ACPI style match in platform_match

2012-10-01 Thread Zhang, Rui
-Original Message- From: linux-acpi-ow...@vger.kernel.org [mailto:linux-acpi- ow...@vger.kernel.org] On Behalf Of Mika Westerberg Sent: Monday, October 01, 2012 2:47 PM To: Zhang, Rui Cc: LKML; linux-pm; linux-i2c; linux-a...@vger.kernel.org; Len, Brown; Rafael J. Wysocki; Grant

RE: [RFC PATCH 5/6] ACPI: Introduce ACPI I2C controller enumeration driver

2012-10-01 Thread Zhang, Rui
-Original Message- From: linux-i2c-ow...@vger.kernel.org [mailto:linux-i2c- ow...@vger.kernel.org] On Behalf Of Mika Westerberg Sent: Monday, October 01, 2012 2:55 PM To: Zhang, Rui Cc: LKML; linux-pm; linux-i2c; linux-a...@vger.kernel.org; Len, Brown; Rafael J. Wysocki; Grant

RE: [RFC PATCH 0/6] ACPI: ACPI 5.0 device enumeration proposal

2012-10-01 Thread Zhang, Rui
-Original Message- From: Mika Westerberg [mailto:mika.westerb...@linux.intel.com] Sent: Monday, October 01, 2012 2:45 PM To: Zhang, Rui Cc: LKML; linux-pm; linux-i2c; linux-a...@vger.kernel.org; Len, Brown; Rafael J. Wysocki; Grant Likely; Dirk Brandewie Subject: Re: [RFC PATCH 0

RE: [RFC PATCH 1/6] Introduce acpi_match_device_id().

2012-09-29 Thread Zhang, Rui
-Original Message- From: Mika Westerberg [mailto:mika.westerb...@linux.intel.com] Sent: Friday, September 28, 2012 10:14 PM To: Zhang, Rui Cc: LKML; linux-pm; linux-i2c; linux-a...@vger.kernel.org; Len, Brown; Rafael J. Wysocki; Grant Likely; Dirk Brandewie Subject: Re: [RFC PATCH

RE: [RFC PATCH 5/6] ACPI: Introduce ACPI I2C controller enumeration driver

2012-09-29 Thread Zhang, Rui
-Original Message- From: Alan Cox [mailto:a...@lxorguk.ukuu.org.uk] Sent: Friday, September 28, 2012 8:54 PM To: Zhang, Rui Cc: LKML; linux-pm; linux-i2c; linux-a...@vger.kernel.org; Len, Brown; Rafael J. Wysocki; Grant Likely; Dirk Brandewie Subject: Re: [RFC PATCH 5/6] ACPI

[RFC PATCH 1/6] Introduce acpi_match_device_id().

2012-09-28 Thread Zhang Rui
From 72df5d1f51fb27a4ba7f70a3b07df759d32b8288 Mon Sep 17 00:00:00 2001 From: Zhang Rui rui.zh...@intel.com Date: Thu, 27 Sep 2012 15:11:55 +0800 Subject: [RFC PATCH 1/6] Introduce acpi_match_device_id(). This API is used to check if a device id string is compatible with an ACPI device, either PNP

[RFC PATCH 3/6] ACPI: introduce acpi_get_generic_resources

2012-09-28 Thread Zhang Rui
From 9a851d177794129a89f720c7122cb39fd163126b Mon Sep 17 00:00:00 2001 From: Zhang Rui rui.zh...@intel.com Date: Fri, 28 Sep 2012 08:34:05 +0800 Subject: [RFC PATCH 3/6] ACPI: introduce acpi_get_generic_resources Introduce acpi_get_generic_resources() to convert ACPI style resources to struct

[RFC PATCH 4/6] Change i2c_register_board_info from __init to __devinit

2012-09-28 Thread Zhang Rui
From 34aa38e12c04544d89af2eae46de284dc8a03b8d Mon Sep 17 00:00:00 2001 From: Zhang Rui rui.zh...@intel.com Date: Thu, 27 Sep 2012 15:42:23 +0800 Subject: [RFC PATCH 4/6] Change i2c_register_board_info from __init to __devinit. ACPI 5 supports enumerating I2C adapter and its slaves via ACPI

[RFC PATCH 5/6] ACPI: Introduce ACPI I2C controller enumeration driver

2012-09-28 Thread Zhang Rui
From 6077a62f2865201ab6727ca7d628ee5e43aa57e1 Mon Sep 17 00:00:00 2001 From: Zhang Rui rui.zh...@intel.com Date: Fri, 24 Aug 2012 15:18:25 +0800 Subject: [RFC PATCH 5/6] ACPI: Introduce ACPI I2C controller enumeration driver This driver is able to 1) enumerate I2C controller via ACPI namespace

[RFC PATCH 6/6] Introduce INT33B1 I2C controller driver

2012-09-28 Thread Zhang Rui
From 817d814ecae91862f42a0447f455dae7f74cba27 Mon Sep 17 00:00:00 2001 From: Zhang Rui rui.zh...@intel.com Date: Fri, 24 Aug 2012 15:20:38 +0800 Subject: [RFC PATCH 6/6] Introduce INT33B1 I2C controller driver This is a dummy platform device driver to illustrate my idea about how a really I2C

Re: Fwd: Hid over I2C and ACPI interaction

2012-07-08 Thread Zhang Rui
on some example ASL code. :) thanks, rui Cheers, Benjamin On Thu, Jul 5, 2012 at 9:20 AM, Zhang Rui rui.zh...@intel.com wrote: Hah, seems I forgot to reply to Benjamin. On 四, 2012-07-05 at 15:01 +0800, Zhang Rui wrote: Original Message Subject: Hid over I2C

Re: Fwd: Hid over I2C and ACPI interaction

2012-07-05 Thread Zhang Rui
the I2C slave device in I2C bus. here is a BKM I wrote, hope it helps. And also any comments are welcome. :) From 0a0fa4ff7b4b06c6560de94a78b15c6adfd86e34 Mon Sep 17 00:00:00 2001 From: Zhang Rui rui.zh...@intel.com Date: Mon, 26 Dec 2011 10:42:04 +0800 As many SoC IP blocks are not hardware

Re: Fwd: Hid over I2C and ACPI interaction

2012-07-05 Thread Zhang Rui
Hah, seems I forgot to reply to Benjamin. On 四, 2012-07-05 at 15:01 +0800, Zhang Rui wrote: Original Message Subject: Hid over I2C and ACPI interaction Date: Wed, 4 Jul 2012 15:46:35 +0200 From: Benjamin Tissoires benjamin.tissoi...@gmail.com To: Jean Delvare kh

Re: [PATCH] ALS: TSL2550 driver move from i2c/chips

2009-10-15 Thread Zhang Rui
On Tue, 2009-10-13 at 01:02 +0800, Jonathan Cameron wrote: Jean Delvare wrote: Hi Jonathan, On Mon, 12 Oct 2009 15:19:07 +0100, Jonathan Cameron wrote: @@ -60,9 +65,41 @@ static const u8 TSL2550_MODE_RANGE[2] = { }; /* + * IDR to assign each registered device a unique id +

Re: [PATCH] ALS: TSL2550 driver move from i2c/chips

2009-10-15 Thread Zhang Rui
update Pavel's email address. On Fri, 2009-10-16 at 09:37 +0800, Zhang Rui wrote: On Tue, 2009-10-13 at 01:02 +0800, Jonathan Cameron wrote: Jean Delvare wrote: Hi Jonathan, On Mon, 12 Oct 2009 15:19:07 +0100, Jonathan Cameron wrote: @@ -60,9 +65,41 @@ static const u8