Skip to contentSkip to conversation

Add support for LTR-301 and LTR-559 sensors

PATCH Superseded Daniel Baluta 2 participants 6 messages Apr 14, 2015 – Apr 19, 2015 IIO

v7 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v7 cover Add support for LTR-301 and LTR-559 sensors

This patchset adds support for LiteOn LTR301 ambient light sensor and LTR559 ambient light and proximity sensor.

v7:
1. Rebase LTR-301 on top of LTR-559 and merged the patches into a single patchset
2. Moved ltr501_chip_info_tbl below ltr501_info in patch 1 in order to make patch 2 changes look natural. :)
3. Moved "else" branch of id check from patch 2 to patch 1. Now it is no longer possible to have a NULL name after this check. If id is not NULL than id->name is one of ltr501_id already defined strings.

v6:
1. Changed the title in commit log

v5:
1. Rebased this patch on top of Daniel's LTR559 patchset
(http://marc.info/?l=linux-kernel&m=142779827617036&w=2)
2. Added info and channel members to chip_info struture.

v4:
1. Addressed minor comments from Peter Meerwald
2. Changed invalid chip id errno from ENOSYS to ENODEV
3. Fixed channel id index number
4. Removed unused variable.

v3:
1. Sent v2 before by mistake. So sending the final version of v2 as v3.

v2:
1. Handled device id NULL case in probe
2. Changed pr_warn to dev_warn

v1:
Extended LTR501 driver to support both LTR301 and LTR501 device.

Daniel Baluta (1):
iio: ltr501: Add support for ltr559 chip

Kuppuswamy Sathyanarayanan (1):
iio: ltr501: Add support for ltr301

 drivers/iio/light/Kconfig  |   3 +-
 drivers/iio/light/ltr501.c | 240 ++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 209 insertions(+), 34 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v7 1/2 iio: ltr501: Add support for ltr559 chip

This device is register compatible with LTR501, with a minor difference for ALS control register as showed below:

ALS Control register for LTR501:

7 6 5 4 3 2 1 0

+------+------+------+------+------+------+------+------+
|                           |      |      |             |
|        Reserved           | Gain |  SW  |    ALS Mode |
|                           |      | Reset|             |
+------+------+------+------+------+------+------+------+

ALS Control register for LTR559:

7 6 5 4 3 2 1 0

+------+------+------+------+------+------+------+------+
|                    |                    |      |      |
|     Reserved       |        Gain        |  SW  | ALS  |
|                    |                    | Reset| Mode |
+------+------+------+------+------+------+------+------+

We handle this difference by introducing ltr501_chip_info.

Datasheet for LTR559 is at:
http://optoelectronics.liteon.com/upload/download/DS86-2013-0003/S_110_LTR-559ALS-01_DS_V1.pdf

---
 drivers/iio/light/Kconfig  |   3 +-
 drivers/iio/light/ltr501.c | 199 +++++++++++++++++++++++++++++++++++++--------
 2 files changed, 168 insertions(+), 34 deletions(-)
drivers/iio/light/Kconfig +2 -1
index 01a1a16..16a0ba1 100644
@@ -169,7 +169,8 @@ config LTR501
 	select IIO_TRIGGERED_BUFFER
 	help
 	 If you say yes here you get support for the Lite-On LTR-501ALS-01
-	 ambient light and proximity sensor.
+	 ambient light and proximity sensor. This driver also supports LTR-559
+	 ALS/PS sensor.
 
 	 This driver can also be built as a module.  If so, the module
          will be called ltr501.
drivers/iio/light/ltr501.c +166 -33

302 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH v7 2/2 iio: ltr501: Add support for ltr301

In reply to Daniel Baluta

From: Kuppuswamy Sathyanarayanan <[email protected]>

Added support for Liteon 301 Ambient light sensor. Since LTR-301 and LTR-501 are register compatible(and even have same part id), LTR-501 driver has been extended to support both devices. LTR-501 is similar to LTR-301 in ALS sensing, But the only difference is, LTR-501 also supports proximity sensing.

LTR-501 - ALS + Proximity combo
LTR-301 - ALS sensor.

---
 drivers/iio/light/Kconfig  |  2 +-
 drivers/iio/light/ltr501.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 44 insertions(+), 3 deletions(-)
drivers/iio/light/Kconfig +1 -1
index 16a0ba1..a437bad 100644
@@ -170,7 +170,7 @@ config LTR501
 	help
 	 If you say yes here you get support for the Lite-On LTR-501ALS-01
 	 ambient light and proximity sensor. This driver also supports LTR-559
-	 ALS/PS sensor.
+	 ALS/PS or LTR-301 ALS sensors.
 
 	 This driver can also be built as a module.  If so, the module
          will be called ltr501.
drivers/iio/light/ltr501.c +43 -2

103 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer
#3 lore raw
In reply to Daniel Baluta
Quoted 38 lines · Daniel Baluta

This patchset adds support for LiteOn LTR301 ambient light sensor and LTR559 ambient light and proximity sensor.

v7:
1. Rebase LTR-301 on top of LTR-559 and merged the patches into a single patchset
2. Moved ltr501_chip_info_tbl below ltr501_info in patch 1 in order to make patch 2 changes look natural. :)
3. Moved "else" branch of id check from patch 2 to patch 1. Now it is no longer possible to have a NULL name after this check. If id is not NULL than id->name is one of ltr501_id already defined strings.

v6:
1. Changed the title in commit log

v5:
1. Rebased this patch on top of Daniel's LTR559 patchset
(http://marc.info/?l=linux-kernel&m=142779827617036&w=2)
2. Added info and channel members to chip_info struture.

v4:
1. Addressed minor comments from Peter Meerwald
2. Changed invalid chip id errno from ENOSYS to ENODEV
3. Fixed channel id index number
4. Removed unused variable.

v3:
1. Sent v2 before by mistake. So sending the final version of v2 as v3.

v2:
1. Handled device id NULL case in probe
2. Changed pr_warn to dev_warn

v1:
Extended LTR501 driver to support both LTR301 and LTR501 device.

Daniel Baluta (1):
iio: ltr501: Add support for ltr559 chip

Quoted 7 lines

Kuppuswamy Sathyanarayanan (1):
iio: ltr501: Add support for ltr301

 drivers/iio/light/Kconfig  |   3 +-
 drivers/iio/light/ltr501.c | 240 ++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 209 insertions(+), 34 deletions(-)

Sorry Daniel, I've confused this further by first taking the set that added interrupt support to this driver. Hence this series doesn't apply at all.

Don't suppose you could rebase on my testing branch to deal with that.

Sorry again, I was obviously half asleep and hadn't registered just how much pain these two sets were going to cause.

Jonathan

maintainer
#4 lore raw
Quoted 47 lines · Jonathan Cameron
Quoted 38 lines · Daniel Baluta

This patchset adds support for LiteOn LTR301 ambient light sensor and LTR559 ambient light and proximity sensor.

v7:
1. Rebase LTR-301 on top of LTR-559 and merged the patches into a single patchset
2. Moved ltr501_chip_info_tbl below ltr501_info in patch 1 in order to make patch 2 changes look natural. :)
3. Moved "else" branch of id check from patch 2 to patch 1. Now it is no longer possible to have a NULL name after this check. If id is not NULL than id->name is one of ltr501_id already defined strings.

v6:
1. Changed the title in commit log

v5:
1. Rebased this patch on top of Daniel's LTR559 patchset
(http://marc.info/?l=linux-kernel&m=142779827617036&w=2)
2. Added info and channel members to chip_info struture.

v4:
1. Addressed minor comments from Peter Meerwald
2. Changed invalid chip id errno from ENOSYS to ENODEV
3. Fixed channel id index number
4. Removed unused variable.

v3:
1. Sent v2 before by mistake. So sending the final version of v2 as v3.

v2:
1. Handled device id NULL case in probe
2. Changed pr_warn to dev_warn

v1:
Extended LTR501 driver to support both LTR301 and LTR501 device.

Daniel Baluta (1):
iio: ltr501: Add support for ltr559 chip

Quoted 7 lines

Kuppuswamy Sathyanarayanan (1):
iio: ltr501: Add support for ltr301

 drivers/iio/light/Kconfig  |   3 +-
 drivers/iio/light/ltr501.c | 240 ++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 209 insertions(+), 34 deletions(-)
Quoted 7 lines

Sorry Daniel, I've confused this further by first taking the set that added interrupt support to this driver. Hence this series doesn't apply at all.

Don't suppose you could rebase on my testing branch to deal with that.

Sorry again, I was obviously half asleep and hadn't registered just how much pain these two sets were going to cause.

I think this is all just fuzz, but I'm more likely to mess it up that you!

Quoted 7 lines

Jonathan
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 48 lines · Jonathan Cameron
Quoted 47 lines · Jonathan Cameron
Quoted 45 lines · Daniel Baluta

This patchset adds support for LiteOn LTR301 ambient light sensor and LTR559 ambient light and proximity sensor.

v7:
1. Rebase LTR-301 on top of LTR-559 and merged the patches into a single patchset
2. Moved ltr501_chip_info_tbl below ltr501_info in patch 1 in order to make patch 2 changes look natural. :)
3. Moved "else" branch of id check from patch 2 to patch 1. Now it is no longer possible to have a NULL name after this check. If id is not NULL than id->name is one of ltr501_id already defined strings.

v6:
1. Changed the title in commit log

v5:
1. Rebased this patch on top of Daniel's LTR559 patchset
(http://marc.info/?l=linux-kernel&m=142779827617036&w=2)
2. Added info and channel members to chip_info struture.

v4:
1. Addressed minor comments from Peter Meerwald
2. Changed invalid chip id errno from ENOSYS to ENODEV
3. Fixed channel id index number
4. Removed unused variable.

v3:
1. Sent v2 before by mistake. So sending the final version of v2 as v3.

v2:
1. Handled device id NULL case in probe
2. Changed pr_warn to dev_warn

v1:
Extended LTR501 driver to support both LTR301 and LTR501 device.

Daniel Baluta (1):
iio: ltr501: Add support for ltr559 chip

Kuppuswamy Sathyanarayanan (1):
iio: ltr501: Add support for ltr301

 drivers/iio/light/Kconfig  |   3 +-
 drivers/iio/light/ltr501.c | 240 ++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 209 insertions(+), 34 deletions(-)
Quoted 8 lines
Quoted 7 lines

Sorry Daniel, I've confused this further by first taking the set that added interrupt support to this driver. Hence this series doesn't apply at all.

Don't suppose you could rebase on my testing branch to deal with that.

Sorry again, I was obviously half asleep and hadn't registered just how much pain these two sets were going to cause.

I think this is all just fuzz, but I'm more likely to mess it up that you!

No problem Jonathan. I will rebase and resend :).

thanks,
Daniel.