From: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
To: Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Matti Vaittinen <mazziesaccount@gmail.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Marek Vasut <marex@denx.de>, Anshul Dalal <anshulusr@gmail.com>,
Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>,
Matt Ranostay <matt@ranostay.sg>,
Stefan Windfeldt-Prytz <stefan.windfeldt-prytz@axis.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v9 0/5] Support for Avago APDS9306 Ambient Light Sensor
Date: Sat, 9 Mar 2024 21:20:26 +1030 [thread overview]
Message-ID: <20240309105031.10313-1-subhajit.ghosh@tweaklogic.com> (raw)
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
v8 -> v9:
- Added const at several places as per review
- Removed 'ret' from iio_gts_find_new_gain_by_old_gain_time()
as it is not used. The current implementaion of the above
function passes all my tests of changing integration times,
scales and gains from userspace.
- Using the same apds9306_event_spec for both als and clear channels
struct iio_chan_spec definitions.
- Used IIO_MOD_EVENT_CODE() macro for Intensity channel events
- Changes as per review:
https://lore.kernel.org/all/20240303151422.5fc3c2f2@jic23-huawei/
v7 -> v8:
- Renamed APDS9306_INT_CH_CLEAR to APDS9306_INT_SRC_CLEAR macro for higher
readability
- Removed APDS9306_CHANNEL macro for higher readability
- Updated iio_push_event() functions with correct type of events (Light or Intensity)
- Updated variable name "event_ch_is_light" to "int_src" and change as per
review to fix compiler warning
- Used scope for guard() functions
- Other fixes as per reviews
https://lore.kernel.org/all/20240224151340.3f2f51e8@jic23-huawei/
https://lore.kernel.org/all/ZdycR6nr3rtrnuth@smile.fi.intel.com/
v7 -> v8 Bindings:
- Updated commit message as mentioned by Jonathan
https://lore.kernel.org/all/20240224143803.27efa14f@jic23-huawei/
v6 -> v7:
- Made comments to struct part_id_gts_multiplier as kernel doc
- Removed static_asserts for array sizes
- Moved regmap_field from driver private data structure and removed
regfield_ prefix to reduce names
- Used "struct apds9306_regfields *rf = &data->rf" in the respective
functions to reduce names
- Removed apds9306_runtime_power_on() and apds9306_runtime_power_off()
functions in favour of using the runtime_pm calls directly from
calling functions.
- Fixed indentations
https://lore.kernel.org/all/ZcOZX8mWTozC2EAc@smile.fi.intel.com/#r
v6 -> v7 Bindings:
- Updated commit message
- Removed wrong patch dependency statement from commit messages
- Updates tags
https://lore.kernel.org/all/20240206-gambling-tricycle-510794e20ca8@spud/
v5 -> v6:
- Changes as per review
- Update kernel doc for private data
- Change IIO Event Spec definitions
- Update guard mutex lock implementation
- Add pm_runtime_get()
- Update styling
Link: https://lore.kernel.org/all/20240204134056.5dc64e8b@jic23-huawei/
v5 -> v6 Bindings:
- Write proper commit messages
- Add vdd-supply in a separate commit
- Add Interrupt macro in a separate commit
Link: https://lore.kernel.org/all/1d0a80a6-dba5-4db8-a7a8-73d4ffe7a37e@linaro.org/
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 (5):
dt-bindings: iio: light: Merge APDS9300 and APDS9960 schemas
dt-bindings: iio: light: adps9300: Add missing vdd-supply
dt-bindings: iio: light: adps9300: Update interrupt definitions
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 | 1355 +++++++++++++++++
5 files changed, 1383 insertions(+), 49 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
create mode 100644 drivers/iio/light/apds9306.c
base-commit: 45ec2f5f6ed3ec3a79ba1329ad585497cdcbe663
--
2.34.1
next reply other threads:[~2024-03-09 10:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-09 10:50 Subhajit Ghosh [this message]
2024-03-09 10:50 ` [PATCH v9 1/5] dt-bindings: iio: light: Merge APDS9300 and APDS9960 schemas Subhajit Ghosh
2024-03-09 10:50 ` [PATCH v9 2/5] dt-bindings: iio: light: adps9300: Add missing vdd-supply Subhajit Ghosh
2024-03-09 10:50 ` [PATCH v9 3/5] dt-bindings: iio: light: adps9300: Update interrupt definitions Subhajit Ghosh
2024-03-09 10:50 ` [PATCH v9 4/5] dt-bindings: iio: light: Avago APDS9306 Subhajit Ghosh
2024-03-09 10:50 ` [PATCH v9 5/5] iio: light: Add support for APDS9306 Light Sensor Subhajit Ghosh
2024-03-10 12:42 ` Jonathan Cameron
2024-03-10 20:52 ` Subhajit Ghosh
2024-03-11 9:52 ` [PATCH v9 0/5] Support for Avago APDS9306 Ambient " Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240309105031.10313-1-subhajit.ghosh@tweaklogic.com \
--to=subhajit.ghosh@tweaklogic.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=anshulusr@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marex@denx.de \
--cc=matt@ranostay.sg \
--cc=mazziesaccount@gmail.com \
--cc=robh+dt@kernel.org \
--cc=stefan.windfeldt-prytz@axis.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).