From patchwork Tue Jun 13 10:04:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 10701 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp433509vqr; Tue, 13 Jun 2023 03:17:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5EwGu38WMmAzyQIZTA1eFnRKWYE5GD/+x1Bkz/w4QquIkstQVoHgUOAlhnsc2QNuSlI6LL X-Received: by 2002:a17:907:7e9a:b0:94f:3521:394 with SMTP id qb26-20020a1709077e9a00b0094f35210394mr12159725ejc.51.1686651448676; Tue, 13 Jun 2023 03:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686651448; cv=none; d=google.com; s=arc-20160816; b=mjZIE6vPv2+7YA5XUC9lPezdtuXbjrhChJhcCJ7Yj1eOkZRxpF3Dd9YHrpyP0+rX2Z 7a3wRf21AvnGRBDhGXuFsSel/KpVq0dae9HGiN5lHm2o2J2k3UYwXQjNhRhsaJnXp56I kNbWJfJhWuink+GSqRkCrwzSy+80+Yvde+IwdfizlQo8RvaXw6z95crgOFxQn5P5jBex sNlNU+J8enxfFUNItvZ0A+MpxP5N4M8ci9GyTI276KywXgCF5eIIiWJY7AetV57tpswv miIeX/xlFVQ+wUsmA569t7V8ysnrJjicg5BmU/kSCmyLj3F9hTI8UEqVVJoRFu0SFg5x kBkw== 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=3aoW4c/0c2Y3ZUPrlBsCZCwmswvbzyn7amN1Oeqw4TU=; b=LmneWtEmTXcp4vwihK/9v/5l86JP/ouUrQvrdUaZcHNdTzl7s2p3KgYDcQcbvtcnoF p6YabtYlRY3Bv7lHMZzqXPrhUZnojYRxSM92r2q4TR+9CinZYl4X1fFcxbLJMVbFRCuX DNLdQLceoXnoiYIThKXXSWHAPULWi5cVVCwKHNCw0Bj0UwcfH1Q9xQI00uGn0DuwYgPQ Lre6vbuUL85REPr9GOR4znG8zATPvoavEiWbVEE+dfL/KteiJf7LdzjNBc4SzC69eIvX UflOULWGC93+p+PNZttgdaEq+UNql9snLODYFQjgyUgFuD6UW6iRHrVEdqZ6aaEl4/jv JHNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=UkKnxSys; 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 qh12-20020a170906ecac00b0097885374cf3si6610082ejb.392.2023.06.13.03.17.03; Tue, 13 Jun 2023 03:17:28 -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=UkKnxSys; 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 S239336AbjFMKGG (ORCPT + 99 others); Tue, 13 Jun 2023 06:06:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240669AbjFMKFE (ORCPT ); Tue, 13 Jun 2023 06:05:04 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F13568E; Tue, 13 Jun 2023 03:05:01 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f611ac39c5so6706663e87.2; Tue, 13 Jun 2023 03:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686650700; x=1689242700; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=3aoW4c/0c2Y3ZUPrlBsCZCwmswvbzyn7amN1Oeqw4TU=; b=UkKnxSys2MimNCCnHQVavNcXQH0kM0oF73GRxm7/61ytdQCvi/xCeQs213R5kuTWWx NDwOviN0NXlEA4ESfJwtPkAsgwuzwMweyZsOVb1A7kS1PhQVC0H3Me7qVwjClO/xLviT w/xzuZbfYQDaIApczjqpJlSpj5p3hsaKcAtX2NgZh7Y+cGH2veSM4ZYi2WUGm48IjBUR 53jSpRY3bn/rRfUGpT7n0jjwI8t8TvMW0cge4bkavTm78FWtpTcbsogfDGD8Viw9LcC0 vfsK7Q4gtvVBM/lBRmmZoQEIAlb+jc/vEy6f5YRTJJPOBXuTHcCTU0u/fZLqxxxz+5Xl QP2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686650700; x=1689242700; 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=3aoW4c/0c2Y3ZUPrlBsCZCwmswvbzyn7amN1Oeqw4TU=; b=OBjGkUwe8VzSFf7z/f2RG5BdyQ8cnuoTWMhLC+KOb6XwxOS0ZtVXCZplk+2FKm/69/ riVSh1ef3SXJnKjBJAMiY7azfvPTe2DjAsoErzSaf/39FmfWQhbWbYgVLAmy3EGgrYGi UX8rcAukWbIMmcZb6qjFLOEo4ZoxBJFXJVsaEBQ7UROmjtd+94Cr8QaLzd5KI1VCyN5X u4JTPNcyp86Oq28yuZWkHiV52BV+5c+mzIc3t0p05gJet0kcaYTHFpav/M9SBCfZUWS7 PTN9/a8lJvt2GzabAzfHT0Qp+DQvP2McPaKuYcZnkTarVnaQ4/SxHAWQf4IHIk6MM2xT MHgg== X-Gm-Message-State: AC+VfDypeoBuTe3XRPLWC0b7ISWx9Qe74wk0l/74DD6YRT5wTfpNvBgS 4LUy/na+NXg5Nzgs9Gt1ywQ= X-Received: by 2002:a19:6446:0:b0:4e8:5e39:6234 with SMTP id b6-20020a196446000000b004e85e396234mr4987654lfj.16.1686650700027; Tue, 13 Jun 2023 03:05:00 -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 w7-20020ac24427000000b004f3945751b2sm1713043lfl.43.2023.06.13.03.04.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 03:04:59 -0700 (PDT) Date: Tue, 13 Jun 2023 13:04:41 +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 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?1768582229429401579?= X-GMAIL-MSGID: =?utf-8?q?1768582229429401579?= 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/ --- Matti Vaittinen (3): dt-bindings: ROHM BU27010 RGBC + flickering sensor iio: light: bu27008: add chip info iio: light: bd27008: Support BD27010 RGB .../bindings/iio/light/rohm,bu27010.yaml | 50 ++ drivers/iio/light/rohm-bu27008.c | 504 ++++++++++++++++-- 2 files changed, 500 insertions(+), 54 deletions(-) create mode 100644 Documentation/devicetree/bindings/iio/light/rohm,bu27010.yaml