Staging: IIO: Add tsl2560-2 support to tsl2563 driver + drop tsl2561, driver.
Subsystems (3)
PATCH 1/1 Staging: IIO: Add tsl2560-2 support to tsl2563 driver + drop tsl2561, driver.
These parts (tsl2560-tsl2563) are identical in interface. The tsl2563 driver is more advanced so makes sense to drop the tsl2561 driver.
---
Greg, I've done the changes and driver removal as a single patch. Can separate into two if you would prefer?
Amit, as promised I have tested against the tsl2561 on an imote2 sensor board (for which the original driver was written). All seems to work as intended. Only changes are addition of devices to the device table and Kconfig comment changes to reflect new support. Hope you don't mind, but I dropped the N900 reference. These things are pretty common (including the new parts) and we don't really want to encourage people to start listing where they found. I haven't done any of the other changes I suggested, but can do those as a follow up patch if you don't mind?
There are a few more similar chips with slightly different conversion functions.
Thanks,
Jonathan
drivers/staging/iio/light/Kconfig | 15 +-- drivers/staging/iio/light/Makefile | 1 - drivers/staging/iio/light/tsl2561.c | 272 ----------------------------------- drivers/staging/iio/light/tsl2563.c | 11 +- 4 files changed, 9 insertions(+), 290 deletions(-)
drivers/staging/iio/light/Kconfig +3 -12
@@ -3,21 +3,12 @@ # comment "Light sensors" -config TSL2561 - tristate "TAOS TSL2561 light-to-digital convertor" - depends on I2C - help - Say yes bere to build support for the TAOS light to digital - convertor. This chip has two light sensors. One is broadband - including infrared whilst the other measures only infrared. - Provides direct access via sysfs. - config SENSORS_TSL2563 - tristate "TAOS TSL2563 ambient light sensor" + tristate "TAOS TSL256[0-3] ambient light sensors" depends on I2C help - If you say yes here you get support for the Taos TSL2563 - ambient light sensor (found in N900). + If you say yes here you get support for the Taos TSL2560, + TSL2561, TSL2562 and TSL2563 ambient light sensors. This driver can also be built as a module. If so, the module will be called tsl2563.
drivers/staging/iio/light/Makefile +0 -1
@@ -2,5 +2,4 @@ # Makefile for industrial I/O Light sensors # -obj-$(CONFIG_TSL2561) += tsl2561.o obj-$(CONFIG_SENSORS_TSL2563) += tsl2563.o
drivers/staging/iio/light/tsl2561.c deleted +0 -272
272 lines not on this page · raw message
drivers/staging/iio/light/tsl2563.c +6 -5
@@ -38,8 +38,6 @@#include "../iio.h" #include "tsl2563.h" -#define DRIVER_NAME "tsl2563" -/* Use this many bits for fraction part. */ #define ADC_FRAC_BITS (14)
@@ -738,14 +736,17 @@ out: }static const struct i2c_device_id tsl2563_id[] = { - {DRIVER_NAME ,0 }, - { }, + {"tsl2560" ,0 }, + {"tsl2561" ,1 }, + {"tsl2562" ,2 }, + {"tsl2563" ,3 }, + {} };MODULE_DEVICE_TABLE (i2c, tsl2563_id);static struct i2c_driver tsl2563_i2c_driver = { .driver = { - .name =DRIVER_NAME , + .name ="tsl2563" , }, .suspend = tsl2563_suspend, .resume = tsl2563_resume,
Quoted 8 lines · Jonathan Cameron
These parts (tsl2560-tsl2563) are identical in interface. The tsl2563 driver is more advanced so makes sense to drop the tsl2561 driver.
Signed-off-by Jonathan Cameron <[email protected]>---
Greg, I've done the changes and driver removal as a single patch. Can separate into two if you would prefer?
Yes, please split this into 2 patches, it's easier to review that way.
thanks,
greg k-h
PATCH 1/2 Staging: IIO: Remove tsl2561 driver. Support merged with tsl2563.
---
This patch simply removes the tsl2561 driver.
drivers/staging/iio/light/Kconfig | 9 -- drivers/staging/iio/light/Makefile | 1 - drivers/staging/iio/light/tsl2561.c | 272 ----------------------------------- 3 files changed, 0 insertions(+), 282 deletions(-)
drivers/staging/iio/light/Kconfig +0 -9
@@ -3,15 +3,6 @@ # comment "Light sensors" -config TSL2561 - tristate "TAOS TSL2561 light-to-digital convertor" - depends on I2C - help - Say yes bere to build support for the TAOS light to digital - convertor. This chip has two light sensors. One is broadband - including infrared whilst the other measures only infrared. - Provides direct access via sysfs. - config SENSORS_TSL2563 tristate "TAOS TSL2563 ambient light sensor" depends on I2C
drivers/staging/iio/light/Makefile +0 -1
@@ -2,5 +2,4 @@ # Makefile for industrial I/O Light sensors # -obj-$(CONFIG_TSL2561) += tsl2561.o obj-$(CONFIG_SENSORS_TSL2563) += tsl2563.o
drivers/staging/iio/light/tsl2561.c deleted +0 -272
272 lines not on this page · raw message
Signature · 1 line
1.6.4.4
PATCH 2/2 Staging: IIO: Add tsl2560-2 support to tsl2563 driver.
---
Minimal changes to driver. Just adds the device to the id table and adjusts the Kconfig elements appropriately.
Adding further similar chips from TAOS is complicated by their different conversion functions (and hence left for now).
drivers/staging/iio/light/Kconfig | 6 +++--- drivers/staging/iio/light/tsl2563.c | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-)
drivers/staging/iio/light/Kconfig +3 -3
@@ -4,11 +4,11 @@ comment "Light sensors" config SENSORS_TSL2563 - tristate "TAOS TSL2563 ambient light sensor" + tristate "TAOS TSL256[0-3] ambient light sensor" depends on I2C help - If you say yes here you get support for the Taos TSL2563 - ambient light sensor (found in N900). + If you say yes here you get support for the Taos TSL2560, + TSL2561, TSL2562 and TSL2563 ambient light sensors. This driver can also be built as a module. If so, the module will be called tsl2563.
drivers/staging/iio/light/tsl2563.c +6 -5
@@ -38,8 +38,6 @@#include "../iio.h" #include "tsl2563.h" -#define DRIVER_NAME "tsl2563" -/* Use this many bits for fraction part. */ #define ADC_FRAC_BITS (14)
@@ -738,14 +736,17 @@ out: }static const struct i2c_device_id tsl2563_id[] = { - {DRIVER_NAME ,0 }, - { }, + {"tsl2560" ,0 }, + {"tsl2561" ,1 }, + {"tsl2562" ,2 }, + {"tsl2563" ,3 }, + {} };MODULE_DEVICE_TABLE (i2c, tsl2563_id);static struct i2c_driver tsl2563_i2c_driver = { .driver = { - .name =DRIVER_NAME , + .name ="tsl2563" , }, .suspend = tsl2563_suspend, .resume = tsl2563_resume,
Signature · 1 line
1.6.4.4
Re: [PATCH 2/2] Staging: IIO: Add tsl2560-2 support to tsl2563 driver.
Quoted 11 lines · Jonathan Cameron
Signed-off-by Jonathan Cameron <[email protected]>---
Minimal changes to driver. Just adds the device to the id table and adjusts theKconfigelements appropriately.Adding further similar chips from TAOS is complicated by their different conversion functions (and hence left for now).
drivers/staging/iio/light/Kconfig | 6 +++--- drivers/staging/iio/light/tsl2563.c | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-)
Signature · 3 lines
------------------------------------------------------------ Amit Kucheria, Finland ------------------------------------------------------------
Re: [PATCH 1/2] Staging: IIO: Remove tsl2561 driver. Support merged with tsl2563.
In reply to Jonathan CameronQuoted 11 lines · Jonathan Cameron
Signed-off-by Jonathan Cameron <[email protected]>---
This patch simply removes the tsl2561 driver.drivers/staging/iio/light/Kconfig | 9 -- drivers/staging/iio/light/Makefile | 1 - drivers/staging/iio/light/tsl2561.c | 272 ----------------------------------- 3 files changed, 0 insertions(+), 282 deletions(-)
Signature · 3 lines
------------------------------------------------------------ Amit Kucheria, Finland ------------------------------------------------------------
Quoted 19 lines · Jonathan Cameron
These parts (tsl2560-tsl2563) are identical in interface. The tsl2563 driver is more advanced so makes sense to drop the tsl2561 driver.
Signed-off-by Jonathan Cameron <[email protected]>---
Greg, I've done the changes and driver removal as a single patch. Can separate into two if you would prefer?Amit, as promised I have tested against the tsl2561 on an imote2 sensor board (for which the original driver was written). All seems to work as intended. Only changes are addition of devices to the device table and
Kconfigcomment changes to reflect new support. Hope you don't mind, but I dropped the N900 reference. These things are pretty common (including the new parts) and we don't really want to encourage people to start listing where they found. I haven't done any of the other changes I suggested, but can do those as a follow up patch if you don't mind?
Quoted 6 lines
There are a few more similar chips with slightly different conversion functions.
Thanks,
Jonathan
Jonathan,
Changes looks good. I'll send my acks on the split up patches.
I'm working on moving this driver to the input subsystem as agreed. I was planning to address your review comments in that rework. I can defer that work if you want.
Regards,
Amit
Quoted 23 lines · Amit Kucheria
Quoted 22 lines · Jonathan Cameron
These parts (tsl2560-tsl2563) are identical in interface. The tsl2563 driver is more advanced so makes sense to drop the tsl2561 driver.
Signed-off-by Jonathan Cameron <[email protected]>---
Greg, I've done the changes and driver removal as a single patch. Can separate into two if you would prefer?Amit, as promised I have tested against the tsl2561 on an imote2 sensor board (for which the original driver was written). All seems to work as intended. Only changes are addition of devices to the device table and
Kconfigcomment changes to reflect new support. Hope you don't mind, but I dropped the N900 reference. These things are pretty common (including the new parts) and we don't really want to encourage people to start listing where they found. I haven't done any of the other changes I suggested, but can do those as a follow up patch if you don't mind?There are a few more similar chips with slightly different conversion functions.
Quoted 7 lines
Quoted 3 lines
Thanks,
Jonathan
Jonathan,
Changes looks good. I'll send my acks on the split up patches.
Cool, I'll do them in a few mins.
Quoted 2 lines
I'm working on moving this driver to the input subsystem as agreed.
Input? Ambient Light sensors subsystem makes sense. Input certainly does not (and will get copious NAKs). I was beginning to doubt that ALS will get sorted out in time for the next merge window (or that the various drivers would get moved across in time), hence this patch to clear up a bit of a mess and a lot of pointless code in IIO as Greg has already taken your driver into the staging tree.
Quoted 3 lines
I
was planning to address your review comments in that rework. I can defer that work if you want.
Sure, that's fine with me, though given the wonders of staging, you may well find a 3rd party submits patches for your driver in the meantime ;)
Thanks,
Jonathan
Quoted 33 lines · Jonathan Cameron
Quoted 23 lines · Amit Kucheria
Quoted 22 lines · Jonathan Cameron
These parts (tsl2560-tsl2563) are identical in interface. The tsl2563 driver is more advanced so makes sense to drop the tsl2561 driver.
Signed-off-by Jonathan Cameron <[email protected]>---
Greg, I've done the changes and driver removal as a single patch. Can separate into two if you would prefer?Amit, as promised I have tested against the tsl2561 on an imote2 sensor board (for which the original driver was written). All seems to work as intended. Only changes are addition of devices to the device table and
Kconfigcomment changes to reflect new support. Hope you don't mind, but I dropped the N900 reference. These things are pretty common (including the new parts) and we don't really want to encourage people to start listing where they found. I haven't done any of the other changes I suggested, but can do those as a follow up patch if you don't mind?There are a few more similar chips with slightly different conversion functions.
Quoted 7 lines
Quoted 3 lines
Thanks,
Jonathan
Jonathan,
Changes looks good. I'll send my acks on the split up patches.
Cool, I'll do them in a few mins.
Quoted 1 line
Quoted 7 lines
Quoted 1 line
I'm working on moving this driver to the input subsystem as agreed.
Input? Ambient Light sensors subsystem makes sense. Input certainly does not (and will get copious NAKs). I was beginning to doubt that ALS will get sorted out in time for the next merge window (or that the various drivers would get moved across in time), hence this patch to clear up a bit of a mess and a lot of pointless code in IIO as Greg has already taken your driver into the staging tree.
Err.. sorry, distracted reply. I meant the ALS subsystem that Rui is sheparding.
Quoted 6 lines
Quoted 3 lines
I
was planning to address your review comments in that rework. I can defer that work if you want.Sure, that's fine with me, though given the wonders of staging, you may well find a 3rd party submits patches for your driver in the meantime ;)
Less work for me :)
Signature · 3 lines
------------------------------------------------------------ Amit Kucheria, Finland ------------------------------------------------------------