> 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
> 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 alerts are
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
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
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..8fc01c8d4522
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
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
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
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
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
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
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
.
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
I'm sorry, this patch is not functionnal.
I'll resubmit in v4 soon.
I apologize for the inconvenience.
.
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
.
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
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
17 matches
Mail list logo