devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/3] Support for Avago APDS9306 Ambient Light Sensor
@ 2024-01-21  5:17 Subhajit Ghosh
  2024-01-21  5:17 ` [PATCH v5 1/3] dt-bindings: iio: light: Squash APDS9300 and APDS9960 schemas Subhajit Ghosh
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Subhajit Ghosh @ 2024-01-21  5:17 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matti Vaittinen,
	Andy Shevchenko, Marek Vasut, Anshul Dalal, Javier Carrasco
  Cc: Subhajit Ghosh, Matt Ranostay, Stefan Windfeldt-Prytz, linux-iio,
	devicetree, linux-kernel

Support for Avago APDS9306 Ambient Light Sensor

Driver support for Avago (Broadcom) APDS9306 Ambient Light Sensor.
It has two channels - ALS and CLEAR. The ALS (Ambient Light Sensor)
channel approximates the response of the human-eye providing direct
read out where the output count is proportional to ambient light levels.
It is internally temperature compensated and rejects 50Hz and 60Hz flicker
caused by artificial light sources. Hardware interrupt configuration is
optional. It is a low power device with 20 bit resolution and has 
configurable adaptive interrupt mode and interrupt persistence mode.
The device also features inbuilt hardware gain, multiple integration time
selection options and sampling frequency selection options.

This driver also uses the IIO GTS (Gain Time Scale) Helpers Namespace for 
Scales, Gains and Integration time implementation.

Link: https://docs.broadcom.com/doc/AV02-4755EN

Following features are supported:
  - I2C interface
  - 2 channels - als and clear
  - Raw data for als and clear channels
  - Up to 20 bit resolution
  - 20 bit data register for each channel
  - Common Configurable items for both channels
    - Integration Time
    - Scale
  - Interrupt (event) interface
    - High and Low threshold interrupts for each channel
    - Selection of interrupt channels - als or clear
    - Selection of interrupt mode - threshold or adaptive
    - Level selection for adaptive threshold interrupts
    - Persistence (Period) level selection for interrupts

root@stm32mp1:~# tree -I 'dev|name|of_node|power|subsystem|uevent' \
/sys/bus/iio/devices/iio:device0/
|-- events
|   |-- in_illuminance_thresh_either_en
|   |-- in_intensity_clear_thresh_either_en
|   |-- thresh_adaptive_either_en
|   |-- thresh_adaptive_either_value
|   |-- thresh_adaptive_either_values_available
|   |-- thresh_either_period
|   |-- thresh_either_period_available
|   |-- thresh_falling_value
|   `-- thresh_rising_value
|-- in_illuminance_raw
|-- in_illuminance_scale
|-- in_illuminance_scale_available
|-- in_intensity_clear_raw
|-- integration_time
|-- integration_time_available
|-- sampling_frequency
|-- sampling_frequency_available
`-- waiting_for_supplier

1 directory, 18 files

v2 -> v5:
 - Bumped up the version:
   RFC->v0->v1->v2->v3 (Earlier scheme)
   v1->v2->v3->v4->v5 (Scheme after review) (Current scheme)
   Link: https://lore.kernel.org/all/20231028143631.2545f93e@jic23-huawei/

 - Added separate patch to merge schemas for APDS9300 and APDS9906. Added
   APDS9306 support on top of that.
   Link: https://lore.kernel.org/lkml/4e785d2e-d310-4592-a75a-13549938dcef@linaro.org/
   Link: https://lore.kernel.org/lkml/20231028142944.7e210eb6@jic23-huawei/

 - Removed scale attribute for Intensity channel:
   Link: https://lore.kernel.org/all/20231204095108.22f89718@jic23-huawei/

 - Dropped caching of hardware gain, repeat rate and integration time and
   updated code as per earlier reviews.
   Link: https://lore.kernel.org/lkml/20231028142944.7e210eb6@jic23-huawei/

 - Added descriptive commit messages
 - Fixed wrongly formatted commit messages
 - Added changelog in right positions

 - Link to v2: 
   https://lore.kernel.org/lkml/20231027074545.6055-3-subhajit.ghosh@tweaklogic.com/

v2 -> v5 Bindings:
 - Removed 'required' for Interrupts and 'oneOf' for compatibility strings
   as per below reviews:
   Link: https://lore.kernel.org/lkml/20231028142944.7e210eb6@jic23-huawei/
   Link: https://lore.kernel.org/lkml/22e9e5e9-d26a-46e9-8986-5062bbfd72ec@linaro.org/

 - Implemented changes as per previous reviews:
   Link: https://lore.kernel.org/lkml/20231028142944.7e210eb6@jic23-huawei/
   Link: https://lore.kernel.org/lkml/22e9e5e9-d26a-46e9-8986-5062bbfd72ec@linaro.org/

Subhajit Ghosh (3):
  dt-bindings: iio: light: Squash APDS9300 and APDS9960 schemas
  dt-bindings: iio: light: Avago APDS9306
  iio: light: Add support for APDS9306 Light Sensor

 .../bindings/iio/light/avago,apds9300.yaml    |   20 +-
 .../bindings/iio/light/avago,apds9960.yaml    |   44 -
 drivers/iio/light/Kconfig                     |   12 +
 drivers/iio/light/Makefile                    |    1 +
 drivers/iio/light/apds9306.c                  | 1315 +++++++++++++++++
 5 files changed, 1343 insertions(+), 49 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
 create mode 100644 drivers/iio/light/apds9306.c


base-commit: 9d1694dc91ce7b80bc96d6d8eaf1a1eca668d847
-- 
2.34.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-02-04 14:14 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-21  5:17 [PATCH v5 0/3] Support for Avago APDS9306 Ambient Light Sensor Subhajit Ghosh
2024-01-21  5:17 ` [PATCH v5 1/3] dt-bindings: iio: light: Squash APDS9300 and APDS9960 schemas Subhajit Ghosh
2024-01-21 15:27   ` Jonathan Cameron
2024-01-22 10:11     ` Subhajit Ghosh
2024-01-22  9:50   ` Krzysztof Kozlowski
2024-01-22 10:23     ` Subhajit Ghosh
2024-01-21  5:17 ` [PATCH v5 2/3] dt-bindings: iio: light: Avago APDS9306 Subhajit Ghosh
2024-01-21 15:36   ` Jonathan Cameron
2024-01-22 10:03     ` Subhajit Ghosh
2024-01-22  9:51   ` Krzysztof Kozlowski
2024-01-22 10:07     ` Subhajit Ghosh
2024-01-22 12:30       ` Krzysztof Kozlowski
2024-01-21  5:17 ` [PATCH v5 3/3] iio: light: Add support for APDS9306 Light Sensor Subhajit Ghosh
2024-01-21  9:22   ` Christophe JAILLET
2024-01-21 12:52     ` Andy Shevchenko
2024-01-22 11:42       ` Subhajit Ghosh
2024-01-22 11:39     ` Subhajit Ghosh
2024-01-21 15:23   ` Jonathan Cameron
2024-01-22 10:56     ` Subhajit Ghosh
2024-01-22 11:04       ` Jonathan Cameron
2024-01-22 11:48         ` Subhajit Ghosh
2024-02-04 11:23       ` Subhajit Ghosh
2024-02-04 13:40         ` Jonathan Cameron
2024-02-04 14:13           ` Subhajit Ghosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).