-
Notifications
You must be signed in to change notification settings - Fork 108
Add support for proximity sensors into soletta iio node #1971
Comments
Coincidence or not, we just noticed that today. Bruno submitted a stop gap user space sensor at #1970 But we will work with ostro team to support IIO asap. So you have some specific sensor? Please share the part number. |
We are looking for SX9500, and APDS9930. The kernel driver for SX9500 is already available in Linux mainline, but the IIO driver for APDS9930 has not been upstreamed yet. |
@lblim please check the apds9960 and apds9300, are they similar with apds9930 ? I tested the apds9300 and apds9960 as below, could you share your apds9930 or sx9500 information(these files list in sysfs as below)? I think you want to read data from in_proximity_raw? root@intel-quark:/sys/bus/i2c/devices/0-0039/iio:device1# ls -l cat /sys/bus/iio/devices/iio:device1/name |
Hi @yongli3 APDS9960, APDS9300 and APDS9930 are all ALS sensor but APDS9960 and 9930 are combo sensors that has more features. A separate kernel driver is needed for all three since they all have different features and export different IIO entries. And Yes, in_proximity_raw is used. Here is the IIO entries for APDS9930 root@sofia-3gr:/sys/bus/iio/devices/iio:device4# cat in_intensity_ir_raw root@sofia-3gr:/sys/bus/iio/devices/iio:device4# cat in_intensity_both_raw root@sofia-3gr:/sys/bus/iio/devices/iio:device4# cat in_proximity_raw root@sofia-3gr:/sys/bus/iio/devices/iio:device4# cat uevent root@sofia-3gr:/sys/bus/iio/devices/iio:device4# ls |
@lblim Thanks for your update. The illuminance is supported now, let me add the in_proximity_raw support |
SX9500root@s3gr10m6s:/sys/bus/iio/devices/iio:device6 # ls buffer dev events in_proximity0_raw in_proximity1_raw in_proximity2_raw in_proximity3_raw name power sampling_frequency sampling_frequency_available scan_elements subsystem trigger uevent root@s3gr10m6s:/sys/bus/iio/devices/iio:device6 # ls buffer/ enable length root@s3gr10m6s:/sys/bus/iio/devices/iio:device6 # cat dev root@s3gr10m6s:/sys/bus/iio/devices/iio:device6 # ls events/ in_proximity0_thresh_either_en in_proximity1_thresh_either_en in_proximity2_thresh_either_en in_proximity3_thresh_either_en root@s3gr10m6s:/sys/bus/iio/devices/iio:device6 # cat in_proximity0_raw *** 3GR use CS2 only. And only use iio event. root@s3gr10m6s:/sys/bus/iio/devices/iio:device6 # cat sampling_frequency root@s3gr10m6s:/sys/bus/iio/devices/iio:device6 # ls scan_elements/ in_proximity0_en in_proximity0_index in_proximity0_type in_proximity1_en in_proximity1_index in_proximity1_type in_proximity2_en in_proximity2_index in_proximity2_type in_proximity3_en in_proximity3_index in_proximity3_type in_timestamp_en in_timestamp_index in_timestamp_type root@s3gr10m6s:/sys/bus/iio/devices/iio:device6 # ls power/ async autosuspend_delay_ms control runtime_active_kids runtime_active_time runtime_enabled runtime_status runtime_suspended_time runtime_usage root@s3gr10m6s:/sys/bus/iio/devices/iio:device6 # ls subsystem/ devices drivers drivers_autoprobe drivers_probe uevent root@s3gr10m6s:/sys/bus/iio/devices/iio:device6 # ls trigger/ current_trigger root@s3gr10m6s:/sys/bus/iio/devices/iio:device6 # cat uevent |
@lblim APDS9930 is using only one: in_proximity_raw, but the SX9500 is using several different files: in_proximity1_raw, in_proximity2_raw, ..,. do you only need the in_proximity2_raw? |
Yes, we are using in_proximity2_raw and iio event (events/in_proximity2_thresh_either_en) only. sx9500 consist of 4-channel capacitive controller that can operate either as a proximity or button sensor. Customer can choose make use of all 4-channel. flow:iio: Add Proximity sensor Category support into iio node #1986 can support all channel or channel 2 only? |
Please describe use cases and how they use each of the channels. This way we can model a node type that helps those. I fear that exposing ports "out[4]" for the 4 channels will just propagate the confusion to our users. Do these ports have a relation between them? |
For my case I only use channel 2. The 4 channel is from the sx9500 datasheet. Just want to know how soletta handle for different usage, I think Android use 3 channel for menu, home and back button. |
On 09-05-2016 10:40, laykuanloon wrote:
Ah, so they are on different places? Now I've got it: one connects a
|
Yes, I only use channel 2 on phone backside to detect user is holding phone. |
if we can create multiple iio node instances, each for each channel, then using an We just need to make sure our implementation allows that, multiple node instances wouldn't step on each other toes. |
Right now, it doesn't: node types would need to change to 'share' the same iio device. Even if channels are logically distinct, as in this case, they're all exposed via same |
then we need to do it, @lblim already said to me about modules that provide multiple sensors in the same package and thus driver, like luminosity and presence. I believe providing a bundled-2-on-1 will not scale, then allowing these to use the same device may be a better approach. AFAIU this is basically changing our open/close, the other parts remain the same. The shared part would go in a static global vector and have reference count. |
On 09-05-2016 14:08, Gustavo Sverzut Barbieri wrote:
Yeah, although I haven't really though of how, I think it shouldn't be
|
Yes, allowing nodes to share the same IIO device is a better approach :) |
@lblim PR #1986 was merged, Soletta can support the proximity sensors now. Please test it using the APDS9930 or SX9500. FYI, below is a .fbp sample code for APDS9960 on Galileo boards: We will add the multiple channels implementation(#1998) later |
Task Description
Proximity sensor IIO node is not yet supported, can this be included for the upcoming Soletta release?
Dependencies
The text was updated successfully, but these errors were encountered: