Message ID | 20231026143532.39660-1-subhajit.ghosh@tweaklogic.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-iio-owner@vger.kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C04E7C25B48 for <linux-iio@archiver.kernel.org>; Thu, 26 Oct 2023 14:35:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345255AbjJZOfs (ORCPT <rfc822;linux-iio@archiver.kernel.org>); Thu, 26 Oct 2023 10:35:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345236AbjJZOfr (ORCPT <rfc822;linux-iio@vger.kernel.org>); Thu, 26 Oct 2023 10:35:47 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC99591 for <linux-iio@vger.kernel.org>; Thu, 26 Oct 2023 07:35:44 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-27e0c1222d1so786257a91.0 for <linux-iio@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=A0/qd5DeqEh4UdiHYjFmqAwuxkZWJlx955AJuSnaY8YI5Ete8njxhs24nt8KF5+3Jf s4jId5H5Uq4/BZwbTNfjnNn9IyADS/jTDlYA4qU1OUK/groweZW9ayTJuwBiUR5aCEnt ocyAPnq44DTLiXMKe7nvXou4hSLFTQ0Apn3OIuUU+Hm4E29GQvkkJ0HV8VeuBHqBuMss N6eWK3pNBZdcldeTG7FYIDdeHc+KLasujU3aD4QRDnFMOFhRAlny1udvkAX1UI2WjkLj 23nX45yodoMNoQkmAUoCt0QwLciUsns2lAzJd24dhkqgKeojBDoForECLrDvsWP/M/hq MHvQ== X-Gm-Message-State: AOJu0Yyq0wSDAKAxTyQVhKUD4cu+mqjX+2JVH3gkgVeXa9eWSi4vUSpA 1GcZkUWOdkVjUtAtJqvXhh/tOQ== X-Google-Smtp-Source: AGHT+IGfpohH+wgf9zFOcXrPZIEKBo1PNL7rEYU1PHcczxpUdu42YaB/uM5R3t6XvjvBLhZRo6pQlw== 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 Precedence: bulk List-ID: <linux-iio.vger.kernel.org> X-Mailing-List: linux-iio@vger.kernel.org |
Series |
Support for Avago APDS9306 Ambient Light Sensor
|
expand
|
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