From patchwork Fri Jul 7 11:22:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 11737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp3193569vqx; Fri, 7 Jul 2023 04:26:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlFsg6xUQRkg/+sXwm32AUWFTTM0Pufr274c+iWueE0Z/983OG7VFfXhcYuy93UcHnPsPaiS X-Received: by 2002:a05:6a20:2595:b0:126:5ffd:c5b7 with SMTP id k21-20020a056a20259500b001265ffdc5b7mr7261541pzd.22.1688729218026; Fri, 07 Jul 2023 04:26:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688729218; cv=none; d=google.com; s=arc-20160816; b=fuCNA98g916Z+BPFVOjvj99ZeUW6dCRcuirxEO099c7OltMN7ERL63AHRr27oqOr7S RK46s0ftgm/1kroN8ln0PzdwSlyP7dOI3eXqTvSqkNRyXsJaZTS8y8XtYswS3hBUQgpO QBRtndx9F/+dCLiX2HZ5cqAKXhTI3zDRXPY1saGcbkmcvwNvtONI46vg9REzDfuELOpS yxmO5oomgn6q5Cmv/fHx6vq+eD8Hk8BWY4/Xv6l+/B5w09a7wIqlzN+zn+qf/C7aCD2A 01eZgvmQL5vM+2F16ClvwWOyyMQPUCtqEBR33/8a2QMjQCFgNijUTHmikKFNQ6mKiw6l v/Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=KZjA1a1Afzs6q7vAiqjeopUm2/pQmTWPahmXLjFLNwg=; fh=azYeB/2FfZBqWSwdqpF/aF2JbB9Ilw9cRC4micj5O3I=; b=qXLB2awbZ3Ri4kgJLiPItmCTE85VGW2YPBW/Q/KkQN2g/O6u9Vzdn1jy1XNESSgpIW s9XtIr7PGyPCHWSXiCBjow2Ancjsz5jqrkQBcTIQaW5RdwwAExISPJc4IZ7o/UG6Q5/i SnJCVuRA9bL7ta0hNYDzTwi5Rtn0FGbgT/YX5/nbC5gWevNDbS6VjjH9YPQkznGms8Y7 Vg5qiltbaA9m+19s2/r18E45v8WHCM2mriSeHCfuGJtMtj8g2nUaOEK6SyYlx78lEHkz VQ3crbeu17OaA32Gwwq+Hh8ZxqDPXiP67ldUbXlChnAYJwMHq1C4/HC1zv6Dw2rvpUY4 gcEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=iK3P6nul; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j6-20020a632306000000b005486a1e9440si3523695pgj.780.2023.07.07.04.26.43; Fri, 07 Jul 2023 04:26:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=iK3P6nul; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231327AbjGGLWb (ORCPT + 99 others); Fri, 7 Jul 2023 07:22:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbjGGLWa (ORCPT ); Fri, 7 Jul 2023 07:22:30 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47F771FF6; Fri, 7 Jul 2023 04:22:29 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4faaaa476a9so2824504e87.2; Fri, 07 Jul 2023 04:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688728947; x=1691320947; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=KZjA1a1Afzs6q7vAiqjeopUm2/pQmTWPahmXLjFLNwg=; b=iK3P6nulx5kICrJoyqmShehCXYzWbkXx4LA+/LJ2S+o2qpnKBYZtPf+QdioNsOdxHF xWB3rJvjxkn59k8hP0uNdizkT62OqXj5oxEht5560RA+6c+HM4jMAhsX5RcHtiu/IVz6 7rCMN6ArDyxSP3MTbYsHupPYCTekx3g6AO5kRuNaga2MeFQoXiJmt4Jg0WRmDMnEUymP VkxMf52Ljk4owmZLuU8ECd9NietR0ngAAxJdK3zEnykHaPOiS8+eZZAqNHuBVQ0LWxEk LduG2eDae+PsliDNCQh8LQ75lYBkyjf9G+0VZeZ+6FgKU8K1PUVzvG050Xy8AY1l4D6l sH/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688728947; x=1691320947; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KZjA1a1Afzs6q7vAiqjeopUm2/pQmTWPahmXLjFLNwg=; b=kK4Fd3YiCTjAKUa93+A77E/JiPXCOGf2iewX6Md1+vpCTdxlZG3wDLk+bL4MmKLl9k VJidw9d+2iXdMeLOwI7DSMcWhWeCaDZz5h5ivRiQs2dvum6trPFwB2Pn6QRT7zjUtdHc F5PomsB4+nQDJK6Tcbt1BR01nccl1dwZoD+lhdS1TFrQxdHWQHYpmJlj5VcCIrIMaZx+ j1mnc047+MCorFCIz2NsgG7DyCb5Lt3sbAbmcnDQUk964TaqZhBlpzoz0YaruRBExVnv LRw1NH0byYCVP+igF9XAhQaUmCg5h5xGlxbYgF+plwmnUfY3B69aZnIUrWZRB7rt/LOj hnvg== X-Gm-Message-State: ABy/qLa3sw3qIV2th0aJA9Hc1A7b6DvY76Mysd2v4HEZYumsF81g+MKc 531czpwsg+y/SiTETMvQHhg= X-Received: by 2002:a05:6512:464:b0:4fb:97e8:bc25 with SMTP id x4-20020a056512046400b004fb97e8bc25mr3501477lfd.34.1688728947060; Fri, 07 Jul 2023 04:22:27 -0700 (PDT) Received: from dc78bmyyyyyyyyyyyyyyt-3.rev.dnainternet.fi (dc78bmyyyyyyyyyyyyyyt-3.rev.dnainternet.fi. [2001:14ba:16f8:1500::1]) by smtp.gmail.com with ESMTPSA id q2-20020ac25a02000000b004fb7bb42de4sm644646lfn.58.2023.07.07.04.22.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 04:22:26 -0700 (PDT) Date: Fri, 7 Jul 2023 14:22:14 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matti Vaittinen , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] Support ROHM BU27010 RGBC sensor Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770760928016811415?= X-GMAIL-MSGID: =?utf-8?q?1770760928016811415?= Support ROHM BU27010 RGBC + flickering sensor. Following description copied from commit log: > The ROHM BU27010 is an RGBC sensor with a flickering detection FIFO. The > RGBC+IR sensor functionality is largely similar to what the BU27008 has. > There are some notable things though: > - gain setting is once again new and exotic. Now, there is 6bit gain > setting where 4 of the bits are common to all channels and 2 bits > can be configured separately for each channel. The BU27010 has > similar "1X on other channels vs 2X on IR when selector is 0x0" > gain design as BU27008 had. So, we use same gain setting policy for > BU27010 as we did for BU27008 - driver sets same gain selector for > all channels but shows the gains separately for all channels so users > can (at least in theory) detect this 1X vs 2X madness... > - BU27010 has suffled all the control register bitfields to new > addresses and bit positions while still keeping the register naming > same. > - Some more power/reset control is added. > - FIFO for "flickering detection" is added. > > The control register suffling made this slightly nasty. Still, it is > easier for maintenance perspective to add the BU27010 support in BU27008 > driver because - even though the bit positions/addresses were changed - > most of the driver structure can be re-used. Writing own driver for > BU27010 would mean plenty of duplicate code albeit a tad more clarity. This series is done on top of the iio-for-6.5a + this fix-up series: https://lore.kernel.org/all/cover.1686648422.git.mazziesaccount@gmail.com/ I didn't spot these fixups from iio git although I think I saw mail stating they were applied. Revision history: v1 => v2: - make vdd-supply required binding. - Some re-ordering for struct member init. - Some re-ordering for code to get rid of function declarations. - Tidy up the mess from patch 2/3. - Refactor parts from 3/3 to 2/3. - Clean-up commented out code and tidy things in general. Please note: I'll be mostly away from the computer during July. Please, take your time reviewing and forgive me if sending follow-up revisions is delayed. --- Matti Vaittinen (3): dt-bindings: iio: ROHM BU27010 RGBC + flickering sensor iio: light: bu27008: add chip info iio: light: bd27008: Support BD27010 RGB .../bindings/iio/light/rohm,bu27010.yaml | 49 ++ drivers/iio/light/rohm-bu27008.c | 622 ++++++++++++++---- 2 files changed, 556 insertions(+), 115 deletions(-) create mode 100644 Documentation/devicetree/bindings/iio/light/rohm,bu27010.yaml