From patchwork Wed Apr 26 08:07:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 677230 Return-Path: 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 CF54EC7618E for ; Wed, 26 Apr 2023 08:07:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239827AbjDZIHm (ORCPT ); Wed, 26 Apr 2023 04:07:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239381AbjDZIHl (ORCPT ); Wed, 26 Apr 2023 04:07:41 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E03AB1993; Wed, 26 Apr 2023 01:07:33 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2a8dd1489b0so65082921fa.3; Wed, 26 Apr 2023 01:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682496452; x=1685088452; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Yssv3P2DrAoOPk41LdEXWeC4Pr2ddQEWhBOO6bbwtPs=; b=H9KGVGDTsUVvOvmemzmLJL+6TTOPnYBNs0J8c2vD4we64VDLrlFF4Zmf9Bun6Mo32b J1/PcqdfxYyOXKhnzO2Tp//kuYiT+XA28MPs72tJEiXfg2YAtpBo6unF3jL3ikgQw9rB JwpwWtEZj85tuLKObuTDZ8m8INadztLYM7sUwkgCYEZJaXCs0ONji25LH/9bq+M9Y7h6 8AgjIJ2IlOpZ+3bel/ej4vUwpxqo8X5bbEIZcSvBhcSnQsbXPI+CiriuuVrdrdZAsNXZ WVE7k0I/Ff2dmNA5+AxRYjIY+6NJO3mBtfffnCsc8GFMg03l4o+ob+SXjvb0wyBhX4pZ b9Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682496452; x=1685088452; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Yssv3P2DrAoOPk41LdEXWeC4Pr2ddQEWhBOO6bbwtPs=; b=k6UDNon64ZS121iL3cj7Aek/3Xt3GMrVG6c2u0PY4Yc4ZpcbeC2kH76M0+s5k74LnE yMfJZn/4T8G4kDfwwA5VgmLlWvoWwaOy5GCDqCJmZ5PO2iJO4wqqJNVkQW1jgIDZWcA2 LMLL7XulSskRS3JelXpJDq+6uL+JuPEkqDvl6AQUX4phq4mZ9KiPcChyaLg0FzWlwj8d tTAq7MazCnmyZPziFRZxmHXhNmF1IyhmgR0oUkfYmzXIkGnxSdWyYdOuVaMxjLIBiVpC fqWfxbC3CJ/hFJlgUsPyESQSQyQfiCvm9yX0ToJo4fyPZLeDJYjRY3CaRgoc+QJYEsKg fq0g== X-Gm-Message-State: AAQBX9dm44/UNe+jfxuDxbnUPyqrRlljN3SFVUZQ4ot793YrdWnSF8QL 2/NX6wbaUYDfo3ntrm66rRU= X-Google-Smtp-Source: AKy350Y36NzrqqY6T008oWsFu+U7lCHlNArWcmmJKgUhDMAHf1pN8jKL3/r7E1QK7GGAsG8/38CHdQ== X-Received: by 2002:a2e:8210:0:b0:2a6:1681:81e0 with SMTP id w16-20020a2e8210000000b002a6168181e0mr4097295ljg.2.1682496451680; Wed, 26 Apr 2023 01:07:31 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id t23-20020a2e9d17000000b002aa43e06a65sm1913713lji.16.2023.04.26.01.07.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 01:07:31 -0700 (PDT) Date: Wed, 26 Apr 2023 11:07:27 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Matti Vaittinen , Andy Shevchenko , Shreeya Patel , Zhigang Shi , Paul Gazzillo , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti Subject: [PATCH v3 1/5] dt-bindings: iio: light: ROHM BU27008 Message-ID: <16be2f3bbf44506e6e6754ad900ef8c289f07bc7.1682495921.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The ROHM BU27008 is a sensor with 5 photodiodes (red, green, blue, clear and IR) with four configurable channels. Red and green being always available and two out of the rest three (blue, clear, IR) can be selected to be simultaneously measured. Typical application is adjusting LCD backlight of TVs, mobile phones and tablet PCs. Add BU27008 dt-bindings. Signed-off-by: Matti Vaittinen Reviewed-by: Krzysztof Kozlowski --- Revision history: v2 => No changes v1 => v2: - fix binding file name - fix binding id - drop unnecessary '|' from description --- .../bindings/iio/light/rohm,bu27008.yaml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/light/rohm,bu27008.yaml diff --git a/Documentation/devicetree/bindings/iio/light/rohm,bu27008.yaml b/Documentation/devicetree/bindings/iio/light/rohm,bu27008.yaml new file mode 100644 index 000000000000..4f66fd47b016 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/light/rohm,bu27008.yaml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/light/rohm,bu27008.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ROHM BU27008 color sensor + +maintainers: + - Matti Vaittinen + +description: + The ROHM BU27008 is a sensor with 5 photodiodes (red, green, blue, clear + and IR) with four configurable channels. Red and green being always + available and two out of the rest three (blue, clear, IR) can be + selected to be simultaneously measured. Typical application is adjusting + LCD backlight of TVs, mobile phones and tablet PCs. + +properties: + compatible: + const: rohm,bu27008 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vdd-supply: true + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + light-sensor@38 { + compatible = "rohm,bu27008"; + reg = <0x38>; + }; + }; + +... From patchwork Wed Apr 26 08:08:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 677229 Return-Path: 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 F1FC2C77B60 for ; Wed, 26 Apr 2023 08:08:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239993AbjDZIIS (ORCPT ); Wed, 26 Apr 2023 04:08:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239966AbjDZIIR (ORCPT ); Wed, 26 Apr 2023 04:08:17 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F6F41FE5; Wed, 26 Apr 2023 01:08:07 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2a7af0cb2e6so65408281fa.0; Wed, 26 Apr 2023 01:08:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682496484; x=1685088484; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=LWFogPesRkVpMzxNVC02NFFYCke98s78XYIUivPMFsQ=; b=OrDhF11kmo13l3Tx4eN2FjmD1eybCrYJ0Pd1hjZsrNss07E3DoTOnNIO4+ZGQvomvA hTmR8HNw+7RTcjDPOThbvyUYp5GtQJ46kJ6o6d/6Gj1vsC5ny4whzsA6K/qzt8QgCx5A ZbrTrx2X0iPrT3oCncu7OYFN3saasFqoJ/xZUyJhbOxyVGMR2swJUVq5IEmRDX361jVC wbw05qPcF25yZC00xkeN/1r/gcOGT839LUdJPUGRJFKUcsAibmYCnma3o2/0s7dieHoL QTeKaWimdX73IGD03qNBJ2EGDLfLYm0MlriQESqnyahhD/zOM3TXfLJu3/8rOvkShhBP QFng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682496484; x=1685088484; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LWFogPesRkVpMzxNVC02NFFYCke98s78XYIUivPMFsQ=; b=B3Ci1eoJWsqSqeGaUVbUpXHHD7sEdyfNtkApTjfRSQP6JhDas3IszFFRdQFdYsVERr 9HgyuD/6ezmtzrlwNZ9/aLzCEogX8EjOjN3R/X5mPrWT7avWPaufZJP+QqCMijU1KwgQ Aa8P71jrdSaezY23Czz+noyCs+cvrfM3T8cCrVFTUkJ9P4+Lnp2yKWtTdSZ/eqfhSS8I V6LbJLM/e6JSZiMeUOgv1hWUfTnA7HE9gp3/DjRlhU+Ats1+ZfQsyNisLArGtkG4IAEa lrW3+KQZp/nXFnWz6oRQBkc3j9/VdN9nzlMHXKKSbzRGv3p2vThjvPezqSah85X0Nayq 5z/A== X-Gm-Message-State: AAQBX9eF9WxNw1bAwwPEIaciC5rFoLWJdkeU4Cx9QMQX3bykf5bHx4oN NryX1t3Um4b+KUEsw/ei/pw= X-Google-Smtp-Source: AKy350aGmzbOtkw8gzRpYFQIYuuLon7uAey2DlB3ct09oD1GSuh6fOoqQzXFssTODba71G3SwH4DmA== X-Received: by 2002:a2e:8602:0:b0:2a8:c7f8:58ef with SMTP id a2-20020a2e8602000000b002a8c7f858efmr4118783lji.22.1682496484476; Wed, 26 Apr 2023 01:08:04 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id g6-20020ac25386000000b004edb2cb3500sm2333035lfh.279.2023.04.26.01.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 01:08:03 -0700 (PDT) Date: Wed, 26 Apr 2023 11:08:00 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Matti Vaittinen , Andy Shevchenko , Shreeya Patel , Zhigang Shi , Paul Gazzillo , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti Subject: [PATCH v3 3/5] iio: kx022a: Use new iio_validate_own_trigger() Message-ID: <6c1081343f8fa1fe8bb21f340ba031f61d3b6085.1682495921.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The new generic iio_validate_own_trigger() can be used as validate_trigger callback for verifying the used trigger belongs to same device as the iio_dev. Use the generic function instead of rolling own one. Signed-off-by: Matti Vaittinen --- Revision history v2: New patch --- drivers/iio/accel/kionix-kx022a.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c index f98393d74666..09814881f513 100644 --- a/drivers/iio/accel/kionix-kx022a.c +++ b/drivers/iio/accel/kionix-kx022a.c @@ -516,17 +516,6 @@ static int kx022a_read_raw(struct iio_dev *idev, return -EINVAL; }; -static int kx022a_validate_trigger(struct iio_dev *idev, - struct iio_trigger *trig) -{ - struct kx022a_data *data = iio_priv(idev); - - if (data->trig != trig) - return -EINVAL; - - return 0; -} - static int kx022a_set_watermark(struct iio_dev *idev, unsigned int val) { struct kx022a_data *data = iio_priv(idev); @@ -725,7 +714,7 @@ static const struct iio_info kx022a_info = { .write_raw = &kx022a_write_raw, .read_avail = &kx022a_read_avail, - .validate_trigger = kx022a_validate_trigger, + .validate_trigger = iio_validate_own_trigger, .hwfifo_set_watermark = kx022a_set_watermark, .hwfifo_flush_to_buffer = kx022a_fifo_flush, }; From patchwork Wed Apr 26 08:08:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 677228 Return-Path: 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 123A3C7618E for ; Wed, 26 Apr 2023 08:08:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240024AbjDZIIr (ORCPT ); Wed, 26 Apr 2023 04:08:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240046AbjDZIIp (ORCPT ); Wed, 26 Apr 2023 04:08:45 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78F3B1BCF; Wed, 26 Apr 2023 01:08:43 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4edc63c82d1so6919044e87.0; Wed, 26 Apr 2023 01:08:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682496521; x=1685088521; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=bwraoI4g6RfgKEcR1F5pGP3sB4nBBYRP3MYxGERA6l0=; b=jgQh4PiYX4shyHzn66p/SCgTaBxIge55AfT29SbEMbFESye6ukQaFwFIb2EiFCYcK+ 8U3p3Gq0cPIN+hFSuWf49UBnH+wNFLhVSs8DfH316Q/M+1LYU962XgeLZ9WKuuiS0ANJ OS3jWU3g9UXuFkVKngqUci0guKU19FJfBGwB2AqOPZ868fCx7il1KA+PXWf8KIpGmwSg iINs0EV1q0O2Dq2BYwxz+vmhW0O5mpDZUu3pJqVsL2z2TkgvlxEGSBQoeaajrNL6zrSY MtCXsSIbU/KzNJ6v++zKVcXnMSuODeS6rCVFNFPfEatUsEEh6huGGUbuIz2clUh40ac/ 1mpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682496521; x=1685088521; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bwraoI4g6RfgKEcR1F5pGP3sB4nBBYRP3MYxGERA6l0=; b=bLkq3c7TyrbBPi4CeWCG1CgAabk1MzzDqAZGX1pR8DzE7OIFBVDGOoI62trQ6j/uUB SKxMZxajAT36tfaH2HVVoF2wSUwmH8CqqnijeaAdRmp1Sb69Zzi6/OpWXV6ay5jz1feT BqbsCkM1b1IcpZnpA8AKrWXiiAX4ltSdyu9TFtrnVnDVSdn6/UFH2fQqRuJ2pnbklpOi XYN8ht45L4MQoZTty3LDYob4/ggI1NTHm0r5PmML31LxC/v++L8K1dmH/PlerUn9H9SK zMj4INSa0OmiFcqUtmorp+sbz5I76L8rVsvtPFa8gIunAM1L0ypgTxzRHArZ3zOiiCLq a/5w== X-Gm-Message-State: AAQBX9cBGr/kfZ7AxDDkklS8TAUJ5v26Vu2kzvMLnWIHmGo8Z+3gREy+ BHba7k5YkXIdbnzu+Npgf64= X-Google-Smtp-Source: AKy350Ycxl7efm7n0wR3Jl9lBQGjzKOoF6zw9kgIaAM6rWH2axubm/GiTe/jpQJ2S/BfyYZmCc2Ydw== X-Received: by 2002:ac2:4247:0:b0:4eb:341c:ecc5 with SMTP id m7-20020ac24247000000b004eb341cecc5mr5283661lfl.12.1682496521384; Wed, 26 Apr 2023 01:08:41 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id h25-20020ac250d9000000b004eb09820adbsm2378262lfm.105.2023.04.26.01.08.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 01:08:40 -0700 (PDT) Date: Wed, 26 Apr 2023 11:08:37 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Matti Vaittinen , Andy Shevchenko , Shreeya Patel , Zhigang Shi , Paul Gazzillo , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti Subject: [PATCH v3 5/5] MAINTAINERS: Add ROHM BU27008 Message-ID: <052761fb6e40a76bf0f2690fa00e221f374e980d.1682495921.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add myself as a maintainer for ROHM BU27008 color sensor driver. Signed-off-by: Matti Vaittinen --- Revision history: No changes since v1 --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index ac81383129a6..6c0775aabade 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -18099,10 +18099,11 @@ S: Maintained F: Documentation/devicetree/bindings/iio/light/bh1750.yaml F: drivers/iio/light/bh1750.c -ROHM BU27034 AMBIENT LIGHT SENSOR DRIVER +ROHM BU270xx LIGHT SENSOR DRIVERs M: Matti Vaittinen L: linux-iio@vger.kernel.org S: Supported +F: drivers/iio/light/rohm-bu27008.c F: drivers/iio/light/rohm-bu27034.c ROHM MULTIFUNCTION BD9571MWV-M PMIC DEVICE DRIVERS