[PATCH V3] ACPI: Add _DEP(Operation Region Dependencies) support to fix battery issue on the Asus T100TA

2014-11-23 Thread Lan Tianyu
a Westerberg Signed-off-by: Lan Tianyu --- Change since V2: Coding style change Change since V1: Remove redundant blank line and some coding style fixs. drivers/acpi/battery.c | 4 +++ drivers/acpi/scan.c | 85 + drivers/

[PATCH V2] ACPI: Add _DEP(Operation Region Dependencies) support to fix battery issue on the Asus T100TA

2014-11-20 Thread Lan Tianyu
are met and then do acpi_bus_attach() for the device in order to resolve battery _STA issue on the Asus T100TA. Reference: https://bugzilla.kernel.org/show_bug.cgi?id=69011 Tested-by: Jan-Michael Brummer Tested-by: Adam Williamson Tested-by: Michael Shigorin Acked-by: Wolfram Sang Signe

Re: [PATCH] ACPI: Add _DEP(Operation Region Dependencies) support to fix battery issue on the Asus T100TA

2014-11-19 Thread Lan Tianyu
Hi Mika: Thank you for review. Will resolve your comments in the next version. -- Best regards Tianyu Lan -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.htm

Re: [PATCH] ACPI: Add _DEP(Operation Region Dependencies) support to fix battery issue on the Asus T100TA

2014-11-19 Thread Lan Tianyu
On 2014年11月20日 00:05, Wolfram Sang wrote: > As long as the I2C related changes are that minimal: > > Acked-by: Wolfram Sang for the I2C part > Thank you! -- Best regards Tianyu Lan -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vg

[PATCH] ACPI: Add _DEP(Operation Region Dependencies) support to fix battery issue on the Asus T100TA

2014-11-19 Thread Lan Tianyu
are met and then do acpi_bus_attach() for the device in order to resolve battery _STA issue on the Asus T100TA. Reference: https://bugzilla.kernel.org/show_bug.cgi?id=69011 Tested-by: Jan-Michael Brummer Tested-by: Adam Williamson Tested-by: Michael Shigorin Signed-off-by: Lan Tianyu --- drivers/

[RFC PATCH V2] ACPI: Add _DEP(Operation Region Dependencies) support to fix battery issue on the Asus T100TA

2014-10-27 Thread Lan Tianyu
are met and then do acpi_bus_attach() for the device in order to resolve battery _STA issue on the Asus T100TA. Signed-off-by: Lan Tianyu --- Change since V1: Rework struct acpi_dep_data, record master and slave's ACPI handle. Rename dep_present with dep_unmet and make it as a count.

Re: [RFC PATCH] ACPI: Add _DEP(Operation Region Dependencies) support to fix battery issue on the Asus T100TA

2014-09-25 Thread Lan Tianyu
On 2014年09月26日 03:27, Rafael J. Wysocki wrote: > I'm not sure what you mean. "Dependent" means "depending on something", so > the > question reads "This requires the devices with _DEP to have a list of devices > that depend on them" which is probably not what you meant. > Sorry, I didn't say cl

Re: [RFC PATCH] ACPI: Add _DEP(Operation Region Dependencies) support to fix battery issue on the Asus T100TA

2014-09-25 Thread Lan Tianyu
On 2014年09月25日 06:27, Rafael J. Wysocki wrote: > On Tuesday, September 23, 2014 03:06:43 PM Lan Tianyu wrote: >> ACPI 5.0 introduces _DEP to designate device objects that OSPM should >> assign a higher priority in start ordering due to future operation region >> accesses.

Re: [PATCH v2] i2c: move acpi code back into the core

2014-09-25 Thread Lan Tianyu
Signed-off-by: Wolfram Sang > Cc: Mika Westerberg > Cc: Lan Tianyu > Cc: Jean Delvare > --- > > v2: - make all acpi functions static > - annotate #endif > - remove declarations in i2c.h > - add dummy functions to i2c-core.c > - make two seperate #

Re: [PATCH] i2c: move acpi code back into the core

2014-09-23 Thread Lan Tianyu
On 2014年09月23日 15:09, Lan Tianyu wrote: > On 2014年09月23日 13:39, Wolfram Sang wrote: >> >>> Sorry for later response due to sickness. I can't write this patch in >>> time. Sorry again. I will test it soon. >> >> Oh, get well soon! Please say so next time,

Re: [PATCH] i2c: move acpi code back into the core

2014-09-23 Thread Lan Tianyu
On 2014年09月23日 13:39, Wolfram Sang wrote: > >> Sorry for later response due to sickness. I can't write this patch in >> time. Sorry again. I will test it soon. > > Oh, get well soon! Please say so next time, so I know. > Thanks. OK. I have put the patch into test system and need to wait some ti

[RFC PATCH] ACPI: Add _DEP(Operation Region Dependencies) support to fix battery issue on the Asus T100TA

2014-09-23 Thread Lan Tianyu
one from list if _DEP condition is met and clear its dep_present flag and do acpi_bus_attch() for the device in order to resolve battery _STA issue on the Asus T100TA. Signed-off-by: Lan Tianyu --- drivers/acpi/battery.c | 4 +++ drivers/acpi/scan.

Re: [PATCH] i2c: move acpi code back into the core

2014-09-22 Thread Lan Tianyu
t; Reported-by: Jean Delvare > Signed-off-by: Wolfram Sang > Cc: Mika Westerberg > Cc: Lan Tianyu > Cc: Jean Delvare > --- > > Lan Tianyi, this is a patch I expected to get from you, fully tested. Since we > are approaching the final release soon, I did it now. Please do tes

Re: i2c-core.ko renamed to i2ccore.ko

2014-09-19 Thread Lan Tianyu
On 2014年09月18日 23:10, Wolfram Sang wrote: > On Thu, Sep 18, 2014 at 03:58:57PM +0300, Mika Westerberg wrote: >> On Thu, Sep 18, 2014 at 02:17:58PM +0200, Jean Delvare wrote: >>> Hi guys, >>> >>> Sorry for jumping in a bit late, but given that I did not get involved >>> in the discussions that led t

Re: [PATCH] I2C/ACPI: Fix possible ZERO_SIZE_PTR pointer dereferencing error.

2014-08-20 Thread Lan Tianyu
On 08/19/2014 11:48 PM, Mika Westerberg wrote: On Tue, Aug 19, 2014 at 10:38:08AM -0500, Wolfram Sang wrote: On Tue, Aug 19, 2014 at 06:16:49PM +0300, Mika Westerberg wrote: On Tue, Aug 19, 2014 at 10:03:55AM -0500, Wolfram Sang wrote: On Tue, Aug 12, 2014 at 10:33:38AM +0800, Xiubo Li wrote:

Re: [PATCH V2] I2C: Rework kernel config I2C_ACPI

2014-08-17 Thread Lan Tianyu
On 2014年08月15日 19:03, Wolfram Sang wrote: > On Fri, Aug 15, 2014 at 01:38:59PM +0800, Lan Tianyu wrote: >> Commit da3c6647(I2C/ACPI: Clean up I2C ACPI code and Add CONFIG_I2C_ACPI >> config) adds a new kernel config I2C_ACPI and make I2C core built in >> when the config is se

[PATCH V2] I2C: Rework kernel config I2C_ACPI

2014-08-14 Thread Lan Tianyu
I2C_ACPI to ACPI_I2C_OPREGION. New config only controls ACPI I2C operation region code and depends on I2C=y. Signed-off-by: Lan Tianyu --- drivers/i2c/Kconfig| 20 +++- drivers/i2c/Makefile | 2 +- drivers/i2c/i2c-acpi.c | 2 ++ include/linux/i2c.h| 12 4

Re: [PATCH] I2C: Make I2C core able to be module when I2C_ACPI is selected.

2014-08-13 Thread Lan Tianyu
On 2014年08月13日 15:07, Mika Westerberg wrote: > On Wed, Aug 13, 2014 at 10:50:32AM +0800, Lan Tianyu wrote: >> On 2014年08月13日 10:03, Wolfram Sang wrote: >>> On Tue, Aug 12, 2014 at 12:53:21PM +0300, Mika Westerberg wrote: >>>> On Mon, Aug 11, 2014 at 03:00:55PM +0800,

Re: [PATCH] I2C: Make I2C core able to be module when I2C_ACPI is selected.

2014-08-12 Thread Lan Tianyu
On 2014年08月13日 10:03, Wolfram Sang wrote: > On Tue, Aug 12, 2014 at 12:53:21PM +0300, Mika Westerberg wrote: >> On Mon, Aug 11, 2014 at 03:00:55PM +0800, Lan Tianyu wrote: >>> Commit da3c6647(I2C/ACPI: Clean up I2C ACPI code and Add CONFIG_I2C_ACPI >>> config) adds a new

[PATCH] I2C: Make I2C core able to be module when I2C_ACPI is selected.

2014-08-11 Thread Lan Tianyu
core able to be a module when I2C_ACPI is selected. Original issue the commit da3c6647 tried to avoid will be fixed in ACPICA and it's rarely triggered during unloading module. Signed-off-by: Lan Tianyu --- drivers/i2c/Kconfig | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-)

Re: [PULL REQUEST] i2c for 3.17

2014-08-10 Thread Lan Tianyu
On 2014年08月10日 01:34, Linus Torvalds wrote: > On Sat, Aug 9, 2014 at 6:56 AM, Wolfram Sang wrote: >> >> here is the pull request for 3.17 for the I2C subsystem. Highlights: > > Lowlight: selecting ACPI support (which used to be the default if ACPI > was enabled) now forces i2c to be built-in. >

Re: [Patch V3 5/5] I2C/ACPI: Clean up I2C ACPI code and Add CONFIG_I2C_ACPI config

2014-06-29 Thread Lan Tianyu
On 2014年06月27日 19:03, Wolfram Sang wrote: > On Tue, May 20, 2014 at 08:59:24PM +0800, Lan Tianyu wrote: >> Clean up ACPI related code in the i2c core and add CONFIG_I2C_ACPI >> to enable I2C ACPI code. >> >> Current there is a race between removing I2C ACPI operation

Re: [Patch V3 0/5] I2C ACPI operation region handler

2014-06-24 Thread Lan Tianyu
On 2014年05月30日 20:10, Wolfram Sang wrote: >>> Hi Wolfram: >>> Since this version resolved all comments, it's ok for you? > > Sorry, I misunderstood. I thought a V4 was needed, but it isn't. I'll > try to have a look this weekend. > Hi Wolfram: Sorry to bother you. Could you have a lo

Re: [Patch V3 0/5] I2C ACPI operation region handler

2014-05-30 Thread Lan Tianyu
On 05/30/2014 08:10 PM, Wolfram Sang wrote: Hi Wolfram: Since this version resolved all comments, it's ok for you? Sorry, I misunderstood. I thought a V4 was needed, but it isn't. I'll try to have a look this weekend. OK. Thanks. -- To unsubscribe from this list: send the line "unsubs

Re: [Patch V3 0/5] I2C ACPI operation region handler

2014-05-29 Thread Lan Tianyu
On 05/20/2014 08:59 PM, Lan Tianyu wrote: ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation region. It allows ACPI aml code able to access such kind of devices to implement some ACPI standard method. On the Asus T100TA, Bios use GenericSerialBus operation region to

Re: [Patch V2 0/9] I2C ACPI operation region handler support

2014-05-22 Thread Lan Tianyu
On 05/20/2014 10:17 PM, Rolf Eike Beer wrote: Rolf Eike Beer wrote: Lan Tianyu wrote: On 05/13/2014 09:09 PM, Rolf Eike Beer wrote: Am Montag, 28. April 2014, 22:27:39 schrieb Lan Tianyu: ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation region. It allows ACPI aml

Re: [Patch V3 0/5] I2C ACPI operation region handler

2014-05-20 Thread Lan Tianyu
On 2014年05月21日 05:25, Rafael J. Wysocki wrote: > On Tuesday, May 20, 2014 08:59:19 PM Lan Tianyu wrote: >> ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation >> region. It allows ACPI aml code able to access such kind of devices to >> implement some

Re: [Patch V3 1/5] ACPICA: Export acpi_buffer_to_resource symbol

2014-05-20 Thread Lan Tianyu
On 2014年05月21日 05:24, Rafael J. Wysocki wrote: > On Tuesday, May 20, 2014 08:59:20 PM Lan Tianyu wrote: >> The acpi_buffer_to_resource is needed in i2c module >> to convert aml buffer to struct acpi_resource >> >> Reviewed-by: Mika Westerberg >> Signed-of

[Patch V3 3/5] ACPI/Thermal: Use acpi_bus_attach_private_data() to attach private data

2014-05-20 Thread Lan Tianyu
Use acpi_bus_attach_private_data() to attach private data instead of acpi_attach_data(). Reviewed-by: Mika Westerberg Signed-off-by: Lan Tianyu --- drivers/acpi/thermal.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi

[Patch V3 2/5] ACPI: Add acpi_bus_attach_private_data() to facilitate to attach data to ACPI handle

2014-05-20 Thread Lan Tianyu
: Lan Tianyu --- drivers/acpi/bus.c | 28 include/acpi/acpi_bus.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index cf925c4..8445d57 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c

[Patch V3 4/5] I2C/ACPI: Add i2c ACPI operation region support

2014-05-20 Thread Lan Tianyu
ol access on the Asus T100TA, other protocols have not been tested. About RawBytes and RawProcessBytes protocol, they needs specific drivers to interpret reference data from AML code according ACPI 5.0 SPEC(5.5.2.4.5.3.9 and 5.5.2.4.5.3.10). So far, not found such case and will add when find real

[Patch V3 5/5] I2C/ACPI: Clean up I2C ACPI code and Add CONFIG_I2C_ACPI config

2014-05-20 Thread Lan Tianyu
Clean up ACPI related code in the i2c core and add CONFIG_I2C_ACPI to enable I2C ACPI code. Current there is a race between removing I2C ACPI operation region and ACPI AML code accessing. So make i2c core built-in if CONFIG_I2C_ACPI is set. Reviewed-by: Mika Westerberg Signed-off-by: Lan Tianyu

[Patch V3 0/5] I2C ACPI operation region handler

2014-05-20 Thread Lan Tianyu
oid some redundant error log. Change since V1: Fix some code style issues. Change prefix i2c_acpi to acpi_i2c. Move ACPI related code in the i2c core to i2c-acpi.c. Add CONFIG_I2C_ACPI and make i2c core built-in when it's set to avoid i2c ACPI operation region being removed. La

[Patch V3 1/5] ACPICA: Export acpi_buffer_to_resource symbol

2014-05-20 Thread Lan Tianyu
The acpi_buffer_to_resource is needed in i2c module to convert aml buffer to struct acpi_resource Reviewed-by: Mika Westerberg Signed-off-by: Lan Tianyu --- drivers/acpi/acpica/rscreate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica

Re: [Patch V2 9/9] I2C/ACPI: Add CONFIG_I2C_ACPI config

2014-05-19 Thread Lan Tianyu
On 05/19/2014 04:49 PM, Mika Westerberg wrote: On Sat, May 17, 2014 at 07:48:34PM +0200, Wolfram Sang wrote: On Tue, Apr 29, 2014 at 11:16:09AM +0300, Mika Westerberg wrote: On Mon, Apr 28, 2014 at 10:27:48PM +0800, Lan Tianyu wrote: This patch is to add CONFIG_I2C_ACPI. Current there is a

Re: [Patch V2 6/9] I2C: Add smbus word/block process call helper function

2014-05-19 Thread Lan Tianyu
On 05/18/2014 01:17 AM, Wolfram Sang wrote: BTW what were your test scenarios for these functions and smbus quick? From ACPI spec, Read/Write quick and Word/Block process call protocol will be used by Bios ACPI code. But so far, I don't find such machines. So these functions has not been te

Re: [Patch V2 6/9] I2C: Add smbus word/block process call helper function

2014-05-17 Thread Lan Tianyu
On 05/17/2014 06:21 PM, Wolfram Sang wrote: On Mon, Apr 28, 2014 at 10:27:45PM +0800, Lan Tianyu wrote: Add i2c_smbus_word/block_proc_call() helper function. These will be used in the implementation of i2c ACPI address space handler. Reviewed-by: Mika Westerberg Signed-off-by: Lan Tianyu

Re: [Patch V2 5/9] I2C: Add smbus quick read/write helper function

2014-05-17 Thread Lan Tianyu
On 05/17/2014 05:41 PM, Wolfram Sang wrote: On Mon, Apr 28, 2014 at 10:27:44PM +0800, Lan Tianyu wrote: Add i2c_smbus_quick_write/read() helper function. These will be used in the implementation of i2c ACPI address space handler. Reviewed-by: Mika Westerberg Signed-off-by: Lan Tianyu We

Re: [Patch V2 0/9] I2C ACPI operation region handler support

2014-05-15 Thread Lan Tianyu
On 05/15/2014 03:50 PM, Rolf Eike Beer wrote: Lan Tianyu wrote: On 05/13/2014 09:09 PM, Rolf Eike Beer wrote: Am Montag, 28. April 2014, 22:27:39 schrieb Lan Tianyu: ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation region. It allows ACPI aml code able to access such

Re: [Patch V2 0/9] I2C ACPI operation region handler support

2014-05-13 Thread Lan Tianyu
On 05/13/2014 09:09 PM, Rolf Eike Beer wrote: Am Montag, 28. April 2014, 22:27:39 schrieb Lan Tianyu: ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation region. It allows ACPI aml code able to access such kind of devices to implement some ACPI standard method. On the

Re: [Patch V2 0/9] I2C ACPI operation region handler support

2014-04-28 Thread Lan Tianyu
On 2014年04月29日 06:51, Rafael J. Wysocki wrote: > On Monday, April 28, 2014 10:27:39 PM Lan Tianyu wrote: >> ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation >> region. It allows ACPI aml code able to access such kind of devices to >> implement some

[Patch V2 1/9] ACPICA: Executer: Fix buffer allocation issue for generic_serial_bus region field accesses.

2014-04-28 Thread Lan Tianyu
From: Lv Zheng The size of the buffer allocated for generic_serial_bus region access is not correct. This patch introduces acpi_ex_get_serial_access_length() to be invoked to obtain correct data buffer length. Reported by Lan Tianyu, Fixed by Lv Zheng. Reviewed-by: Mika Westerberg Signed-off

[Patch V2 5/9] I2C: Add smbus quick read/write helper function

2014-04-28 Thread Lan Tianyu
Add i2c_smbus_quick_write/read() helper function. These will be used in the implementation of i2c ACPI address space handler. Reviewed-by: Mika Westerberg Signed-off-by: Lan Tianyu --- drivers/i2c/i2c-core.c | 30 ++ include/linux/i2c.h| 2 ++ 2 files changed

[Patch V2 2/9] ACPICA: Export acpi_buffer_to_resource symbol

2014-04-28 Thread Lan Tianyu
The acpi_buffer_to_resource is needed in i2c module to convert aml buffer to struct acpi_resource Reviewed-by: Mika Westerberg Signed-off-by: Lan Tianyu --- drivers/acpi/acpica/rscreate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica

[Patch V2 6/9] I2C: Add smbus word/block process call helper function

2014-04-28 Thread Lan Tianyu
Add i2c_smbus_word/block_proc_call() helper function. These will be used in the implementation of i2c ACPI address space handler. Reviewed-by: Mika Westerberg Signed-off-by: Lan Tianyu --- drivers/i2c/i2c-core.c | 56 ++ include/linux/i2c.h

[Patch V2 0/9] I2C ACPI operation region handler support

2014-04-28 Thread Lan Tianyu
ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation region. It allows ACPI aml code able to access such kind of devices to implement some ACPI standard method. On the Asus T100TA, Bios use GenericSerialBus operation region to access i2c device to get battery info. So batter

[Patch V2 4/9] ACPI/Thermal: Use acpi_bus_attach_private_data() to attach private data

2014-04-28 Thread Lan Tianyu
Use acpi_bus_attach_private_data() to attach private data instead of acpi_attach_data(). Reviewed-by: Mika Westerberg Signed-off-by: Lan Tianyu --- drivers/acpi/thermal.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi

[Patch V2 3/9] ACPI: Add acpi_bus_attach_private_data() to facilitate to attach data to ACPI handle

2014-04-28 Thread Lan Tianyu
: Lan Tianyu --- drivers/acpi/bus.c | 18 +- include/acpi/acpi_bus.h | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index e7e5844..4ed8d48 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -132,6 +132,22

[Patch V2 7/9] I2C/ACPI: Add i2c ACPI operation region support

2014-04-28 Thread Lan Tianyu
ol access on the Asus T100TA, other protocols have not been tested. About RawBytes and RawProcessBytes protocol, they needs specific drivers to interpret reference data from AML code according ACPI 5.0 SPEC(5.5.2.4.5.3.9 and 5.5.2.4.5.3.10). So far, not found such case and will add when find real

[Patch V2 8/9] I2C/ACPI: Move ACPI related code to i2c-acpi.c

2014-04-28 Thread Lan Tianyu
Clean up ACPI related code in the i2c core. Reviewed-by: Mika Westerberg Signed-off-by: Lan Tianyu --- drivers/i2c/i2c-acpi.c | 89 ++ drivers/i2c/i2c-core.c | 95 -- include/linux/i2c.h| 2 ++ 3

[Patch V2 9/9] I2C/ACPI: Add CONFIG_I2C_ACPI config

2014-04-28 Thread Lan Tianyu
This patch is to add CONFIG_I2C_ACPI. Current there is a race between removing I2C ACPI operation region and ACPI AML code accessing. So make i2c core built-in if CONFIG_I2C_ACPI is set. Signed-off-by: Lan Tianyu --- drivers/i2c/Kconfig | 17 - drivers/i2c/Makefile | 2

Re: [Resend Patch 7/9] I2C/ACPI: Add i2c ACPI operation region support

2014-04-23 Thread Lan Tianyu
On 2014年04月23日 15:28, Mika Westerberg wrote: > On Wed, Apr 23, 2014 at 09:53:21AM +0800, Lan Tianyu wrote: >> Hi Mika: >> Thanks a lot for your review. >> >> On 2014年04月22日 19:36, Mika Westerberg wrote: >>>>> + >>>>> + client.a

Re: [Resend Patch 9/9] I2C/ACPI: Add CONFIG_I2C_ACPI config

2014-04-22 Thread Lan Tianyu
On 2014年04月22日 19:45, Mika Westerberg wrote: > On Tue, Apr 22, 2014 at 02:24:15PM +0800, Lan Tianyu wrote: >> This patch is to add CONFIG_I2C_ACPI. Current there is a race between >> removing I2C ACPI operation region and ACPI AML code accessing. >> So make i2c core built-in

Re: [Resend Patch 7/9] I2C/ACPI: Add i2c ACPI operation region support

2014-04-22 Thread Lan Tianyu
Hi Mika: Thanks a lot for your review. On 2014年04月22日 19:36, Mika Westerberg wrote: >> > + >> > + client.adapter = adapter; >> > + client.addr = sb->slave_address; >> > + client.flags = 0; > I'm not sure if this is the correct way to use struct i2c_client > (allocating it from stack and

[Resend Patch 1/9] ACPICA: Executer: Fix buffer allocation issue for generic_serial_bus region field accesses.

2014-04-21 Thread Lan Tianyu
From: Lv Zheng The size of the buffer allocated for generic_serial_bus region access is not correct. This patch introduces acpi_ex_get_serial_access_length() to be invoked to obtain correct data buffer length. Reported by Lan Tianyu, Fixed by Lv Zheng. Signed-off-by: Lv Zheng Signed-off-by

[Resend Patch 0/9] I2C ACPI operation region handler support

2014-04-21 Thread Lan Tianyu
ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation region. It allows ACPI aml code able to access such kind of devices to implement some ACPI standard method. On the Asus T100TA, Bios use GenericSerialBus operation region to access i2c device to get battery info. So batter

[Resend Patch 2/9] ACPICA: Export acpi_buffer_to_resource symbol

2014-04-21 Thread Lan Tianyu
The acpi_buffer_to_resource is needed in i2c module to convert aml buffer to struct acpi_resource Signed-off-by: Lan Tianyu --- drivers/acpi/acpica/rscreate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c index 75d3690

[Resend Patch 8/9] I2C/ACPI: Move ACPI related code to i2c-acpi.c

2014-04-21 Thread Lan Tianyu
Clean up ACPI related code in the i2c core. Signed-off-by: Lan Tianyu --- drivers/i2c/i2c-acpi.c | 89 ++ drivers/i2c/i2c-core.c | 95 -- include/linux/i2c.h| 3 ++ 3 files changed, 92 insertions

[Resend Patch 3/9] ACPI: Add acpi_bus_attach_private_data() to facilitate to attach data to ACPI handle

2014-04-21 Thread Lan Tianyu
There is already acpi_bus_get_private_data() to get ACPI handle data which is associated with acpi_bus_private_data_handler(). This patch is to add acpi_bus_attach_private_data() to make a pair and facilitate to attach and get data to/from ACPI handle. Signed-off-by: Lan Tianyu --- drivers/acpi

[Resend Patch 5/9] I2C: Add smbus quick read/write helper function

2014-04-21 Thread Lan Tianyu
Add i2c_smbus_quick_write/read() helper function. These will be used in the implementation of i2c ACPI address space handler. Signed-off-by: Lan Tianyu --- drivers/i2c/i2c-core.c | 30 ++ include/linux/i2c.h| 2 ++ 2 files changed, 32 insertions(+) diff --git a

[Resend Patch 4/9] ACPI/Thermal: Use acpi_bus_attach_private_data() to attach private data

2014-04-21 Thread Lan Tianyu
Use acpi_bus_attach_private_data() to attach private data instead of acpi_attach_data(). Signed-off-by: Lan Tianyu --- drivers/acpi/thermal.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index c1e31a4..7ab9392

[Resend Patch 7/9] I2C/ACPI: Add i2c ACPI operation region support

2014-04-21 Thread Lan Tianyu
ol access on the Asus T100TA, other protocols have not been tested. About RawBytes and RawProcessBytes protocol, they needs specific drivers to interpret reference data from AML code according ACPI 5.0 SPEC(5.5.2.4.5.3.9 and 5.5.2.4.5.3.10). So far, not found such case and will add when find real

[Resend Patch 6/9] I2C: Add smbus word/block process call helper function

2014-04-21 Thread Lan Tianyu
Add i2c_smbus_word/block_proc_call() helper function. These will be used in the implementation of i2c ACPI address space handler. Signed-off-by: Lan Tianyu --- drivers/i2c/i2c-core.c | 56 ++ include/linux/i2c.h| 4 2 files changed, 60

[Resend Patch 9/9] I2C/ACPI: Add CONFIG_I2C_ACPI config

2014-04-21 Thread Lan Tianyu
This patch is to add CONFIG_I2C_ACPI. Current there is a race between removing I2C ACPI operation region and ACPI AML code accessing. So make i2c core built-in if CONFIG_I2C_ACPI is set. Signed-off-by: Lan Tianyu --- drivers/i2c/Kconfig | 17 - drivers/i2c/Makefile | 2

Re: [PATCH 1/9] ACPICA: Executer: Fix buffer allocation issue for generic_serial_bus region field accesses.

2014-04-21 Thread Lan Tianyu
On 2014年04月22日 05:38, Rafael J. Wysocki wrote: > Hi, > > On Wednesday, April 16, 2014 09:24:34 PM Lan Tianyu wrote: >> From: Lv Zheng >> >> The size of the buffer allocated for generic_serial_bus region access >> is not correct. This patch introduces acpi_ex_ge

Re: [PATCH 0/9] I2C ACPI operation region handler support

2014-04-16 Thread Lan Tianyu
On 04/16/2014 09:24 PM, Lan Tianyu wrote: ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation region. It allows ACPI aml code able to access such kind of devices to implement some ACPI standard method. On the Asus T100TA, Bios use GenericSerialBus operation region to

[PATCH 4/9] ACPI/Thermal: Use acpi_bus_attach_private_data() to attach private data

2014-04-16 Thread Lan Tianyu
Use acpi_bus_attach_private_data() to attach private data instead of acpi_attach_data(). Signed-off-by: Lan Tianyu --- drivers/acpi/thermal.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index c1e31a4..7ab9392

[PATCH 2/9] ACPICA: Export acpi_buffer_to_resource symbol

2014-04-16 Thread Lan Tianyu
The acpi_buffer_to_resource is needed in i2c module to convert aml buffer to struct acpi_resource Signed-off-by: Lan Tianyu --- drivers/acpi/acpica/rscreate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c index 75d3690

[PATCH 3/9] ACPI: Add acpi_bus_attach_private_data() to facilitate to attach data to ACPI handle

2014-04-16 Thread Lan Tianyu
There is already acpi_bus_get_private_data() to get ACPI handle data which is associated with acpi_bus_private_data_handler(). This patch is to add acpi_bus_attach_private_data() to make a pair and facilitate to attach and get data to/from ACPI handle. Signed-off-by: Lan Tianyu --- drivers/acpi

[PATCH 5/9] I2C: Add smbus quick read/write helper function

2014-04-16 Thread Lan Tianyu
Add i2c_smbus_quick_write/read() helper function. These will be used in the implementation of i2c ACPI address space handler. Signed-off-by: Lan Tianyu --- drivers/i2c/i2c-core.c | 30 ++ include/linux/i2c.h| 2 ++ 2 files changed, 32 insertions(+) diff --git a

[PATCH 6/9] I2C: Add smbus word/block process call helper function

2014-04-16 Thread Lan Tianyu
Add i2c_smbus_word/block_proc_call() helper function. These will be used in the implementation of i2c ACPI address space handler. Signed-off-by: Lan Tianyu --- drivers/i2c/i2c-core.c | 56 ++ include/linux/i2c.h| 4 2 files changed, 60

[PATCH 7/9] I2C/ACPI: Add i2c ACPI operation region support

2014-04-16 Thread Lan Tianyu
ol access on the Asus T100TA, other protocols have not been tested. About RawBytes and RawProcessBytes protocol, they needs specific drivers to interpret reference data from AML code according ACPI 5.0 SPEC(5.5.2.4.5.3.9 and 5.5.2.4.5.3.10). So far, not found such case and will add when find r

[PATCH 9/9] I2C/ACPI: Add CONFIG_I2C_ACPI config

2014-04-16 Thread Lan Tianyu
This patch is to add CONFIG_I2C_ACPI. Current there is a race between removing I2C ACPI operation region and ACPI AML code accessing. So make i2c core built-in if CONFIG_I2C_ACPI is set. The race will be fixed later in the ACPICA. Signed-off-by: Lan Tianyu --- drivers/i2c/Kconfig | 16

[PATCH 8/9] I2C/ACPI: Move ACPI related code to i2c-acpi.c

2014-04-16 Thread Lan Tianyu
Clean up ACPI related code in the i2c core. Signed-off-by: Lan Tianyu --- drivers/i2c/i2c-acpi.c | 89 ++ drivers/i2c/i2c-core.c | 95 -- include/linux/i2c.h| 3 ++ 3 files changed, 92 insertions

[PATCH 1/9] ACPICA: Executer: Fix buffer allocation issue for generic_serial_bus region field accesses.

2014-04-16 Thread Lan Tianyu
From: Lv Zheng The size of the buffer allocated for generic_serial_bus region access is not correct. This patch introduces acpi_ex_get_serial_access_length() to be invoked to obtain correct data buffer length. Reported by Lan Tianyu, Fixed by Lv Zheng. Signed-off-by: Lv Zheng Signed-off-by

[PATCH 0/9] I2C ACPI operation region handler support

2014-04-16 Thread Lan Tianyu
ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation region. It allows ACPI aml code able to access such kind of devices to implement some ACPI standard method. On the Asus T100TA, Bios use GenericSerialBus operation region to access i2c device to get battery info. So batter

Re: Fwd: Hid over I2C and ACPI interaction

2012-07-09 Thread Lan Tianyu
---Original Message- >> From: linux-acpi-ow...@vger.kernel.org [mailto:linux-acpi- >> ow...@vger.kernel.org] On Behalf Of Lan Tianyu >> Sent: Sunday, July 08, 2012 8:25 PM >> To: Mika Westerberg >> Cc: Zhang, Rui; kh...@linux-fr.org; ben-li...@fluff.org; >&

Re: Fwd: Hid over I2C and ACPI interaction

2012-07-08 Thread Lan Tianyu
On 2012年07月06日 13:52, Mika Westerberg wrote: On Thu, Jul 05, 2012 at 03:01:57PM +0800, Zhang Rui wrote: +Note that although these are ACPI devices, we prefer to use PnP drivers for them, +this is because: +1. all the non-ACPI-predefined Devices are exported as PnP devices as well +2. PnP bus is