Message ID | 20231026143532.39660-1-subhajit.ghosh@tweaklogic.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp723888vqb; Thu, 26 Oct 2023 07:37:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSx8Ni5lS010YYOC8DbEUrZXejHxA9jstv7Ta3dQnS9dOd0FeX2uVkNAbmIbUYN3CiTCIP X-Received: by 2002:a25:b9cd:0:b0:da0:a8fe:c4b6 with SMTP id y13-20020a25b9cd000000b00da0a8fec4b6mr2485127ybj.40.1698331029684; Thu, 26 Oct 2023 07:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698331029; cv=none; d=google.com; s=arc-20160816; b=dd0aBlfKF9afO5VDak/4SeELrRyP9TEC44EJhuNYkBVJwGFjIL53411LtaRBT6FlYi pa0yVEYlMQ6iERz7YNjUvYmmostBB7qTN2Q/j8+q7cwwzLQD+2u6hm3BwpiFaOardMw0 xeCBJvhSrQGPrENWUKpMvraF80fTy8OW2Fy16dWzTTyciZbRn++klerUkcdFB0u87kKl P1dRQmqXlaKSwT6/l2ah2TjY+Bv806iPZIPx93/dXvBL4WXotUYgttl8PSp9tVotlp5V GYFBXfhLh83c/wBHpUw9m7L1/DOVvoL817GpR+AeNFmYXXiZuVozEZwvDj9nBw2YAa4W /fFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=x6fcPIoP7TVmQOJVPPgogOEp5U2VXZnIM6xw7cT4MQ8=; fh=t8KtzLLNH/5vGwqpf/v4tjL155e/ioGpKA4tz0DWROk=; b=azMVkS36fiVhTbexu336J8Pj2JIh4IswSYj4QM8L8OH+rGebU7sz+YUYiau+VyopxH hhoNdq+ZuQwQQXayaJtJRLy5PYkgK48FhjlpZc4KIijtdj9nfFLZJr+SgQXaj7AnhsVF xZmt0/PuosXWoxF0FWtwmtldfT9Sh4cjlBeJJPoLV6YU+JccmIqesEsx5uIJY8c4e8pb 9iGN4achRwR4fCvCAEZbdPz9zGX3wwfx/VswUSWK82/8TMEnD2p66HpKLK5nr2/HhAL9 UfvNxzBbCT4zXbbR0XLKPmCtxBubPo++nQwePKxrq0N5u+A6KIFY6iNQ+nJC9V0POpuq oLWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tweaklogic.com header.s=google header.b=T4uK32Sv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id s71-20020a25aa4d000000b00d9a4a758d53si13202555ybi.83.2023.10.26.07.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 07:37:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@tweaklogic.com header.s=google header.b=T4uK32Sv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 7495F8125FF4; Thu, 26 Oct 2023 07:36:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345275AbjJZOft (ORCPT <rfc822;aposhian.dev@gmail.com> + 26 others); Thu, 26 Oct 2023 10:35:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345236AbjJZOfs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 26 Oct 2023 10:35:48 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA98E1A2 for <linux-kernel@vger.kernel.org>; Thu, 26 Oct 2023 07:35:44 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-565e54cb93aso798704a12.3 for <linux-kernel@vger.kernel.org>; Thu, 26 Oct 2023 07:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tweaklogic.com; s=google; t=1698330944; x=1698935744; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=x6fcPIoP7TVmQOJVPPgogOEp5U2VXZnIM6xw7cT4MQ8=; b=T4uK32Sv/SmHZgOdmKRjHJvXIG2qXJNy9VkA7TramYzk5xbgzWdJTfYiBRIQzEJFpF KOJVm1kwvmE2Y2JZwi7Vsx9pI26ABbB+f5LneFH9fV3muOHdMOYBVpp5V4p19phdLPEm Gk/Na4wEJHzZl15AsaaX1H0zyyDYxGgKyuBa32HK05sowf9pXDkGYKzO7cP4aBPWHnZq IwRNUFsOctxEBkePjCR6unsad3vONTWRCQZYlm87N4pR1tuJNWTBsQL30s4dGdNlqx3u pNmjrM2JrYHMjsvozD2si1Dh0CI6K5UbElOJjxGlaYLCVO5eHSKpiw45mE8Z2dXoVPiP ep6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698330944; x=1698935744; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=x6fcPIoP7TVmQOJVPPgogOEp5U2VXZnIM6xw7cT4MQ8=; b=IhuqGXsuC3RvWxy1e5UvFN0EYBYO0qeMXzgQY5E4kbSuj6fM7PEuRh4LUOLyB62C9r v6enm5uuzJzQPQwA8h91yhIcv5cLZ3iaXH23qnmwHFaWJJxkIkd3Sncc0btrQDrQQ6nn ZxzO3FQYha7fvNagYFZ8pWJxECWk+HxNmUIM3zHY01SODZrhT1QmYXnlFAbGu8k5oDtZ 1vrPaHQ8JDBgmln3hXURRtiITK+Xd2Cvj0sNljw1R3o3iI618dd3tfTmDV++Bo0JReJZ YoDZzIPVDhwDDMpqzg8+/xI7u7W3W0fnhGrCW9bn0VW/bsCnSnM2KB07bJQ3tClON+0O oJlw== X-Gm-Message-State: AOJu0Yw6TQ9IGSbbKra3aSd/39cnuOer6OK8/7OBViA9GIrwHHAkkNvm +mfHOwKFN+p0LQerZFFuMy825A== X-Received: by 2002:a17:90a:1917:b0:27d:b4a4:2d87 with SMTP id 23-20020a17090a191700b0027db4a42d87mr16510046pjg.1.1698330944272; Thu, 26 Oct 2023 07:35:44 -0700 (PDT) Received: from localhost.localdomain (2403-580d-82f4-0-16bf-4026-a446-e128.ip6.aussiebb.net. [2403:580d:82f4:0:16bf:4026:a446:e128]) by smtp.gmail.com with ESMTPSA id iq11-20020a17090afb4b00b00256b67208b1sm1727519pjb.56.2023.10.26.07.35.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 07:35:43 -0700 (PDT) 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>, Paul Gazzillo <paul@pgazz.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 v1 0/2] Support for Avago APDS9306 Ambient Light Sensor Date: Fri, 27 Oct 2023 01:05:30 +1030 Message-Id: <20231026143532.39660-1-subhajit.ghosh@tweaklogic.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 26 Oct 2023 07:36:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780829157664129093 X-GMAIL-MSGID: 1780829157664129093 |
Series |
Support for Avago APDS9306 Ambient Light Sensor
|
|
Message
Subhajit Ghosh
Oct. 26, 2023, 2:35 p.m. UTC
This series adds support for Avago (Broadcom) APDS9306 Ambient Light
Sensor.
Datasheet: 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
- 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
This driver also uses the IIO GTS Helpers Namespace for Scales, Gains
and Integration time implementation.
root@stm32mp1:~# tree -I 'dev|name|of_node|power|subsystem|uevent' \
> /sys/bus/iio/devices/iio:device1/
/sys/bus/iio/devices/iio:device1/
|-- 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_intensity_clear_raw
|-- integration_time
|-- integration_time_available
|-- sampling_frequency
|-- sampling_frequency_available
|-- scale
|-- scale_available
`-- waiting_for_supplier
1 directory, 18 files
v0 -> v1
- dt_bindings
- Squashed apds9300 and apds9600 dt bindings, added apds9306 bindings on
top of that
- Added detailed commit message for dt_bindings
- apds9306 driver
- Fixes as per review
- Not disabling the regmap internal lock
- Removing processed attribute for als channel which exposes raw values
- Modified the iio gts scale implementation for above change
- Not implementing a fallback and warning for compatibility and part ID
mismatch as suggested by Matti and Jonathan as Rob insisted on having
a single compatible string for the driver (if the device can power up
with a single compatible string, which it does).
Subhajit Ghosh (2):
dt-bindings: iio: light: Avago APDS9306
iio: light: Add support for APDS9306 Light Sensor
.../bindings/iio/light/avago,apds9300.yaml | 35 +-
.../bindings/iio/light/avago,apds9960.yaml | 44 -
drivers/iio/light/Kconfig | 12 +
drivers/iio/light/Makefile | 1 +
drivers/iio/light/apds9306.c | 1334 +++++++++++++++++
5 files changed, 1377 insertions(+), 49 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
create mode 100644 drivers/iio/light/apds9306.c
base-commit: 611da07b89fdd53f140d7b33013f255bf0ed8f34