Skip to contentSkip to conversation

Staging: IIO: Add tsl2560-2 support to tsl2563 driver + drop tsl2561, driver.

PATCH In review Jonathan Cameron 3 participants 9 messages Nov 20, 2009 – Nov 22, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
index cf0d0d6..cf1d946 100644
@@ -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
index 30dbfb1..30f3300 100644
@@ -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
index 3e812b2..78b9432 100644
@@ -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,
#1 lore raw
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.

---
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

#6 lore raw
In reply to Jonathan Cameron
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.

---
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?

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

#7 lore raw
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.

---
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.

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

#2 lore raw

PATCH 1/2 Staging: IIO: Remove tsl2561 driver. Support merged with tsl2563.

In reply to Greg KH

---
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
index cf0d0d6..ab54191 100644
@@ -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
index 30dbfb1..30f3300 100644
@@ -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
#3 lore raw

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
index ab54191..80cb6e5 100644
@@ -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
index 3e812b2..78b9432 100644
@@ -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
#8 lore raw
In reply to Jonathan Cameron
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.

---
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.

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
------------------------------------------------------------
Acked-by on v1 1/2
#5 lore raw

Re: [PATCH 1/2] Staging: IIO: Remove tsl2561 driver. Support merged with tsl2563.

In reply to Jonathan Cameron
Quoted 11 lines · Jonathan Cameron

---
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
------------------------------------------------------------
Acked-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] Staging: IIO: Add tsl2560-2 support to tsl2563 driver.

In reply to Jonathan Cameron
Quoted 11 lines · Jonathan Cameron

---
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(-)
Signature · 3 lines
------------------------------------------------------------
Amit Kucheria, Finland
------------------------------------------------------------