Re: [PATCH v7 2/4] i2c-acpi : exclude ARA address for smbus device

2018-01-14 Thread Marc CAPDEVILLE
> On Sat, 13 Jan 2018 14:37:03 +0100 > Marc CAPDEVILLE <m.capdevi...@no-log.org> wrote: >> Somme ACPI enumerated devices are known to support smbus alert protocol. >> Theses devices may be miss-enumerated with the reserved smbus ARA address. >> This is the case on

Re: [PATCH v7 2/4] i2c-acpi : exclude ARA address for smbus device

2018-01-14 Thread Marc CAPDEVILLE
> On Sat, 13 Jan 2018 14:37:03 +0100 > Marc CAPDEVILLE wrote: >> Somme ACPI enumerated devices are known to support smbus alert protocol. >> Theses devices may be miss-enumerated with the reserved smbus ARA address. >> This is the case on Asus T100 tablet where cm3218 amb

Re: [PATCH v7 3/4] iio : Add cm3218 smbus ARA and ACPI support

2018-01-14 Thread Marc CAPDEVILLE
> On Sat, 13 Jan 2018 14:37:04 +0100 > Marc CAPDEVILLE <m.capdevi...@no-log.org> wrote: > >> On asus T100, Capella cm3218 chip is implemented as ambiant light >> sensor. This chip expose an smbus ARA protocol device on standard >> address 0x0c. The chip is

Re: [PATCH v7 3/4] iio : Add cm3218 smbus ARA and ACPI support

2018-01-14 Thread Marc CAPDEVILLE
> On Sat, 13 Jan 2018 14:37:04 +0100 > Marc CAPDEVILLE wrote: > >> On asus T100, Capella cm3218 chip is implemented as ambiant light >> sensor. This chip expose an smbus ARA protocol device on standard >> address 0x0c. The chip is not functional before all

[PATCH v7 3/4] iio : Add cm3218 smbus ARA and ACPI support

2018-01-13 Thread Marc CAPDEVILLE
adapter. If an interrupt resource is given, we register this irq with the smbus alert driver. If no irq is given, the driver call i2c_smbus_alert_event() to trigger the alert process to clear the initial alert event before initializing cm3218 registers. Signed-off-by: Marc CAPDEVILLE <m.capd

[PATCH v7 2/4] i2c-acpi : exclude ARA address for smbus device

2018-01-13 Thread Marc CAPDEVILLE
response address. This patch make a match on known ACPI ids for which devices are smbus ARA capable, then skip the connection if it has the reserved 0x0c address and mark it with I2C_CLIENT_ALERT flag. So device is enumerated with the correct address. Signed-off-by: Marc CAPDEVILLE <m.capd

[PATCH v7 3/4] iio : Add cm3218 smbus ARA and ACPI support

2018-01-13 Thread Marc CAPDEVILLE
adapter. If an interrupt resource is given, we register this irq with the smbus alert driver. If no irq is given, the driver call i2c_smbus_alert_event() to trigger the alert process to clear the initial alert event before initializing cm3218 registers. Signed-off-by: Marc CAPDEVILLE --- drivers

[PATCH v7 2/4] i2c-acpi : exclude ARA address for smbus device

2018-01-13 Thread Marc CAPDEVILLE
response address. This patch make a match on known ACPI ids for which devices are smbus ARA capable, then skip the connection if it has the reserved 0x0c address and mark it with I2C_CLIENT_ALERT flag. So device is enumerated with the correct address. Signed-off-by: Marc CAPDEVILLE --- drivers/i2c

[PATCH v7 4/4] iio : cm32181 : cosmetic cleanup

2018-01-13 Thread Marc CAPDEVILLE
ter Meerwald-Stadler <pme...@pmeerw.net> Signed-off-by: Marc CAPDEVILLE <m.capdevi...@no-log.org> Acked-by: Jonathan Cameron <ji...@kernel.org> --- drivers/iio/light/cm32181.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/iio

[PATCH v7 4/4] iio : cm32181 : cosmetic cleanup

2018-01-13 Thread Marc CAPDEVILLE
ter Meerwald-Stadler Signed-off-by: Marc CAPDEVILLE Acked-by: Jonathan Cameron --- drivers/iio/light/cm32181.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c index eae5b7cc6878..8fc01c8

[PATCH v7 1/4] i2c-smbus : Add client discovered ARA support

2018-01-13 Thread Marc CAPDEVILLE
with i2c_smbus_alert_free_irq(). Signed-off-by: Marc CAPDEVILLE <m.capdevi...@no-log.org> --- drivers/i2c/i2c-core-smbus.c | 42 +++ drivers/i2c/i2c-smbus.c | 171 +-- include/linux/i2c-smbus.h| 22 ++ include/linux/i2c.h | 2 + 4 files c

[PATCH v7 1/4] i2c-smbus : Add client discovered ARA support

2018-01-13 Thread Marc CAPDEVILLE
with i2c_smbus_alert_free_irq(). Signed-off-by: Marc CAPDEVILLE --- drivers/i2c/i2c-core-smbus.c | 42 +++ drivers/i2c/i2c-smbus.c | 171 +-- include/linux/i2c-smbus.h| 22 ++ include/linux/i2c.h | 2 + 4 files changed, 232 insertions(+), 5

[PATCH v6 2/4] i2c-smbus : Add client discovered ARA support

2017-12-25 Thread Marc CAPDEVILLE
off. Suggested-by: Alan Cox <a...@linux.intel.com> Signed-off-by: Marc CAPDEVILLE <m.capdevi...@no-log.org> --- drivers/i2c/i2c-smbus.c | 83 +++ include/linux/i2c-smbus.h | 15 + 2 files changed, 98 insertions(+) diff --git a/dri

[PATCH v6 4/4] iio : cm32181 : cosmetic cleanup

2017-12-25 Thread Marc CAPDEVILLE
ter Meerwald-Stadler <pme...@pmeerw.net> Signed-off-by: Marc CAPDEVILLE <m.capdevi...@no-log.org> --- drivers/iio/light/cm32181.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32

[PATCH v6 1/4] i2c-core-acpi : Add i2c_acpi_set_connection

2017-12-25 Thread Marc CAPDEVILLE
with the wrong address (the first one). So let the driver detect the unsupported address and request i2c acpi core to choose the second one at probing time. Signed-off-by: Marc CAPDEVILLE <m.capdevi...@no-log.org> --- drivers/i2c/i2c-core-acpi.

[PATCH v6 3/4] iio : Add cm3218 smbus ara and acpi support

2017-12-25 Thread Marc CAPDEVILLE
the driver try to initialize chip registers. So if first registers access fail, we call i2c_smbus_alert_event() to acknowledge initial alert, then retry register access. Signed-off-by: Marc CAPDEVILLE <m.capdevi...@no-log.org> --- drivers/iio/light/cm32181.c

[PATCH v6 2/4] i2c-smbus : Add client discovered ARA support

2017-12-25 Thread Marc CAPDEVILLE
off. Suggested-by: Alan Cox Signed-off-by: Marc CAPDEVILLE --- drivers/i2c/i2c-smbus.c | 83 +++ include/linux/i2c-smbus.h | 15 + 2 files changed, 98 insertions(+) diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index

[PATCH v6 4/4] iio : cm32181 : cosmetic cleanup

2017-12-25 Thread Marc CAPDEVILLE
ter Meerwald-Stadler Signed-off-by: Marc CAPDEVILLE --- drivers/iio/light/cm32181.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c index 96c08755e6e3..3e6b244d5cd1 100644 --- a/drivers/iio/lig

[PATCH v6 1/4] i2c-core-acpi : Add i2c_acpi_set_connection

2017-12-25 Thread Marc CAPDEVILLE
with the wrong address (the first one). So let the driver detect the unsupported address and request i2c acpi core to choose the second one at probing time. Signed-off-by: Marc CAPDEVILLE --- drivers/i2c/i2c-core-acpi.c | 50 + include/linux/i2c.h

[PATCH v6 3/4] iio : Add cm3218 smbus ara and acpi support

2017-12-25 Thread Marc CAPDEVILLE
the driver try to initialize chip registers. So if first registers access fail, we call i2c_smbus_alert_event() to acknowledge initial alert, then retry register access. Signed-off-by: Marc CAPDEVILLE --- drivers/iio/light/cm32181.c | 120 ++-- 1 file changed

[PATCH v5 1/2] iio : Add cm3218 smbus ara and acpi support

2017-11-22 Thread Marc CAPDEVILLE
with that address. If the client address is already the real one, we create an i2c dummy device for the ara function. if an interrupt resource is given, we request a treaded interrupt to acknowledge the smbus alert for cm3218 chip. Signed-off-by: Marc CAPDEVILLE <m.capdevi...@no-log.org>

[PATCH v5 2/2] iio : cm32181 : cosmetic cleanup

2017-11-22 Thread Marc CAPDEVILLE
Somme cosmetic cleanup suggested by Peter Meerwald-Stadler. Macro name : MLUX_PER_LUX => CM32181_MLUX_PER_LUX Constante name : als_it_bits => cm32181_als_it_bits als_it_value => cm32181_als_it_value Comment : Registers Address => Register Addresses Signed-off-by: Mar

[PATCH v5 1/2] iio : Add cm3218 smbus ara and acpi support

2017-11-22 Thread Marc CAPDEVILLE
with that address. If the client address is already the real one, we create an i2c dummy device for the ara function. if an interrupt resource is given, we request a treaded interrupt to acknowledge the smbus alert for cm3218 chip. Signed-off-by: Marc CAPDEVILLE --- v5 : - dont use smbus_alert driver

[PATCH v5 2/2] iio : cm32181 : cosmetic cleanup

2017-11-22 Thread Marc CAPDEVILLE
Somme cosmetic cleanup suggested by Peter Meerwald-Stadler. Macro name : MLUX_PER_LUX => CM32181_MLUX_PER_LUX Constante name : als_it_bits => cm32181_als_it_bits als_it_value => cm32181_als_it_value Comment : Registers Address => Register Addresses Signed-off-by: Mar

[PATCH v4] iio : Add cm3218 smbus ara and acpi support

2017-10-27 Thread Marc CAPDEVILLE
. if an interrupt resource is given, and only for cm3218 chip, we declare an smbus_alert device. Signed-off-by: Marc CAPDEVILLE <m.capdevi...@no-log.org> --- v4 : - rework acpi i2c adress lookup due to bad commit being sent. v3 : - rework acpi i2c adress lookup - comment style c

[PATCH v4] iio : Add cm3218 smbus ara and acpi support

2017-10-27 Thread Marc CAPDEVILLE
. if an interrupt resource is given, and only for cm3218 chip, we declare an smbus_alert device. Signed-off-by: Marc CAPDEVILLE --- v4 : - rework acpi i2c adress lookup due to bad commit being sent. v3 : - rework acpi i2c adress lookup - comment style cleanup - add prefix cm32181_to

[PATCH v3] iio : Add cm3218 smbus ara and acpi support

2017-10-27 Thread Marc CAPDEVILLE
I'm sorry, this patch is not functionnal. I'll resubmit in v4 soon. I apologize for the inconvenience.

[PATCH v3] iio : Add cm3218 smbus ara and acpi support

2017-10-27 Thread Marc CAPDEVILLE
I'm sorry, this patch is not functionnal. I'll resubmit in v4 soon. I apologize for the inconvenience.

[PATCH v3] iio : Add cm3218 smbus ara and acpi support

2017-10-27 Thread Marc CAPDEVILLE
. if an interrupt resource is given, and only for cm3218 chip, we declare an smbus_alert device. Signed-off-by: Marc CAPDEVILLE <m.capdevi...@no-log.org> --- Thanks to all for your review. It seems that capellamicro.com mailhost timeout when sending to Kevin. v3 : - rework acpi i2c

[PATCH v3] iio : Add cm3218 smbus ara and acpi support

2017-10-27 Thread Marc CAPDEVILLE
. if an interrupt resource is given, and only for cm3218 chip, we declare an smbus_alert device. Signed-off-by: Marc CAPDEVILLE --- Thanks to all for your review. It seems that capellamicro.com mailhost timeout when sending to Kevin. v3 : - rework acpi i2c adress lookup - comment style

[PATCH v2] iio : Add cm3218 smbus ara and acpi support

2017-10-25 Thread Marc CAPDEVILLE
. if an interrupt resource is given, and only for cm3218 chip, we declare an smbus_alert device. Signed-off-by: Marc CAPDEVILLE <m.capdevi...@no-log.org> --- v2 : - cm3218 support always build - Cleanup of unneeded #if statement - Beter identifying chip in platform device

[PATCH v2] iio : Add cm3218 smbus ara and acpi support

2017-10-25 Thread Marc CAPDEVILLE
. if an interrupt resource is given, and only for cm3218 chip, we declare an smbus_alert device. Signed-off-by: Marc CAPDEVILLE --- v2 : - cm3218 support always build - Cleanup of unneeded #if statement - Beter identifying chip in platform device, acpi and of_device drivers/iio/light

[PATCH] iio : Add cm3218 smbus ara and acpi support

2017-10-19 Thread Marc CAPDEVILLE
and change it in the client structur. Signed-off-by: Marc CAPDEVILLE <m.capdevi...@no-log.org> --- drivers/iio/light/Kconfig | 19 +++ drivers/iio/light/cm32181.c | 119 2 files changed, 138 insertions(+) diff --git a/drivers/iio/light/Kconfig b/d

[PATCH] iio : Add cm3218 smbus ara and acpi support

2017-10-19 Thread Marc CAPDEVILLE
and change it in the client structur. Signed-off-by: Marc CAPDEVILLE --- drivers/iio/light/Kconfig | 19 +++ drivers/iio/light/cm32181.c | 119 2 files changed, 138 insertions(+) diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig index