Skip to contentSkip to conversation

IIO driver for si114x

DISCUSSION Crestez Dan Leonard 4 participants 6 messages Apr 12, 2016 – Apr 20, 2016 IIO

lore
Share & tools
lore
#0 lore raw

Hello,

I want to add support for a si1145 light sensor. Some brief googling finds a bunch of old (2012) patches for an si114x driver in drivers/iio/light. Here's the link to the old thread:

http://comments.gmane.org/gmane.linux.kernel.iio/5478

I did not find any reference to si114x in the main kernel tree so it seems to me that it was never actually included. There are a bunch of other out-of-tree drivers I found searching the web but they don't seem to be IIO drivers so are not interesting.

I'm willing to do the work to get support for this in upstream. I guess the best way to do that would be to apply the most recent source I can find to my local tree, test it on my device and repost on the list for review, right? I can't find anything newer than 2012 though.

As far as I can tell there at are two sets of device models: Si1141/42/43 and 45/46/47 with similar datasheets:

https://www.silabs.com/Support%20Documents/TechnicalDocs/Si114x.pdf
https://www.silabs.com/Support%20Documents/TechnicalDocs/Si1145-46-47.pdf

I only have a Si1145 device so I can't test support for si1141/42/43.

--
Regards,
Leonard

#1 lore raw

Hello,

Quoted 5 lines

I want to add support for a si1145 light sensor. Some brief googling finds a bunch of old (2012) patches for an si114x driver in drivers/iio/light. Here's the link to the old thread:

http://comments.gmane.org/gmane.linux.kernel.iio/5478

I have updated sources, not yet posted
Matt Ranostay also indicated that he'd be willing to work on the device

Quoted 4 lines

I'm willing to do the work to get support for this in upstream. I guess the best way to do that would be to apply the most recent source I can find to my local tree, test it on my device and repost on the list for review, right? I can't find anything newer than 2012 though.

the si114x is a rather complicated device with many controls, for example the output current of the LEDs

I think this issue also surfaced for another proximity driver recently...

regards, p.

Signature · 2 lines
Peter Meerwald-Stadler
+43-664-2444418 (mobile)
#2 lore raw
Quoted 8 lines · Peter Meerwald-Stadler
Quoted 5 lines

I want to add support for a si1145 light sensor. Some brief googling finds a bunch of old (2012) patches for an si114x driver in drivers/iio/light. Here's the link to the old thread:

http://comments.gmane.org/gmane.linux.kernel.iio/5478

I have updated sources, not yet posted
Matt Ranostay also indicated that he'd be willing to work on the device

I found some reasonably recent sources in the chromeos kernel:

https://chromium.googlesource.com/chromiumos/third_party/kernel-next/+/chromeos-4.4/drivers/iio/light/si114x.c

This driver seems to be only for si1141/42/43 models and will explicitly fail on probe with the part_id values reported by si1145. Some hacking made the driver probe and report some sort of values.

I'm not sure how well that driver is tested, it failed for me at register time because SI114X_CURRENT_CHANNEL has the default scan_index 0 and this is detected as a duplicate despite the fact that scan_type is not otherwise filled. This check has been in the IIO core since 3.18.

If you have updated sources can you please post them?

--
Regards,
Leonard

#3 lore raw
Quoted 18 lines · Crestez Dan Leonard
Quoted 7 lines · Peter Meerwald-Stadler
Quoted 7 lines

I want to add support for a si1145 light sensor. Some brief googling finds a
bunch of old (2012) patches for an si114x driver in drivers/iio/light. Here's
the link to the old thread:

Quoted 5 lines
Quoted 1 line

http://comments.gmane.org/gmane.linux.kernel.iio/5478

I have updated sources, not yet posted
Matt Ranostay also indicated that he'd be willing to work on the device

I found some reasonably recent sources in the chromeos kernel:

https://chromium.googlesource.com/chromiumos/third_party/kernel-next/+/chromeos-4.4/drivers/iio/light/si114x.c

Quoted 8 lines

This driver seems to be only for si1141/42/43 models and will explicitly fail on probe with the part_id values reported by si1145. Some hacking made the driver probe and report some sort of values.

I'm not sure how well that driver is tested, it failed for me at register time because SI114X_CURRENT_CHANNEL has the default scan_index 0 and this is detected as a duplicate despite the fact that scan_type is not otherwise filled. This check has been in the IIO core since 3.18.

Pretty sure the tests where done without this patch:

http://www.spinics.net/lists/linux-iio/msg15851.html

#4 lore raw
In reply to Peter Meerwald-Stadler

Hi Peter, Matt,

Quoted 7 lines · Peter Meerwald-Stadler

Hello,

Quoted 5 lines

I want to add support for a si1145 light sensor. Some brief googling finds a bunch of old (2012) patches for an si114x driver in drivers/iio/light. Here's the link to the old thread:

http://comments.gmane.org/gmane.linux.kernel.iio/5478

Best option for us here is to send patches based on Peter proposal.

Quoted 3 lines

I have updated sources, not yet posted
Matt Ranostay also indicated that he'd be willing to work on the device

Matt did you already have some work on this?

Quoted 10 lines
Quoted 5 lines

I'm willing to do the work to get support for this in upstream. I guess the best way to do that would be to apply the most recent source I can find to my local tree, test it on my device and repost on the list for review, right? I can't find anything newer than 2012 though.

the si114x is a rather complicated device with many controls, for example the output current of the LEDs

I think this issue also surfaced for another proximity driver recently...

#5 lore raw
Quoted 12 lines · Daniel Baluta

Hi Peter, Matt,

Quoted 7 lines · Peter Meerwald-Stadler

Hello,

Quoted 5 lines

I want to add support for a si1145 light sensor. Some brief googling finds a bunch of old (2012) patches for an si114x driver in drivers/iio/light. Here's the link to the old thread:

http://comments.gmane.org/gmane.linux.kernel.iio/5478

Quoted 8 lines

Best option for us here is to send patches based on Peter proposal.

Quoted 3 lines

I have updated sources, not yet posted
Matt Ranostay also indicated that he'd be willing to work on the device

Matt did you already have some work on this?

Quoted 1 line

Nope. But I probably can do some Tested-By if I dig out this sensor.

Quoted 9 lines
Quoted 9 lines
Quoted 4 lines

I'm willing to do the work to get support for this in upstream. I guess the best way to do that would be to apply the most recent source I can find to my local tree, test it on my device and repost on the list for review, right? I can't find anything newer than 2012 though.

the si114x is a rather complicated device with many controls, for example the output current of the LEDs

I think this issue also surfaced for another proximity driver recently...