From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7367D3B389E for ; Mon, 11 May 2026 08:22:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778487752; cv=none; b=sp+m6s3huvCjU1dWh7PTsU3IUa55fjKlFLckT+SRasqP5zuleaTPsgscegsohvMdNcNZIU9qUIbgBXc0ra708U2b3hHIZ9NhUG3CEnbM2BW9w5nsBn1QtJ8ccKHc8iIu4tb4LaI9XASqOh9rT2undsWXcQSd25/NjCz2EyHKigw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778487752; c=relaxed/simple; bh=xDPwfIZXTeW3yq3e+uusrA8W/Zw3xwvvavaC7B7WOb8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OLjzkhxNNLP0xrTvMF45uQS0YAfIg0GRa9+pxeWMD3ucIBZ2IkIlTyYN9iiY8yUSeJFKreY0x6aG3mA4Gg/jfPtBDOUO8j2GhESaCBhFYJfZ6UjAWYLyPr8PmOWLMZLklDXydenIOsvIf8sTs7ndAiIaM0NCfsaDtwv9ZH/bLjc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=pEOQbUu2; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pEOQbUu2" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-5a4113ab355so3705564e87.1 for ; Mon, 11 May 2026 01:22:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778487740; x=1779092540; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6S8mBYkFiwNSV2sm1TejB3CD4/6gNBSvCKYv8dIJSuw=; b=pEOQbUu2H+zOx9ZBV4oO3C4BiW3h2lBp6NjAe49h69GtJmkq+PE1F4pDxqxlDixxqE e7qMxfZwfIk7bw3xzDGvqRY8XV1muUAtAh+m7Z74eldJyg6f/0ITQ6lRfBDXNf7nFYAu GhKwXy8NeyrGDZc5PsfixtlyvMvCPVGmi5NWzxOVeckYvIf2fWd6VAnvPna0Pp5PQC9n a5TW2A+yPTkcFFTNoXS0lO89BTxTLqK6+m4/4LU4TIUUHukWqG8LHNuEJUkZv0d3WjOX YUs/rNcAwx33ZT4DFCh1od8wGXLpMxz5WwRMJDdHyPNp+erhhtDylda03AA/5K5FGevh m8NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778487740; x=1779092540; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6S8mBYkFiwNSV2sm1TejB3CD4/6gNBSvCKYv8dIJSuw=; b=rTrZHm6LZKLDe+HiUGpm3s/yv0wz+zRutZRhn75x4xrmmrqML2z9ztrpYVvwadGI3d kCg7pEoW95Cs6WC87trEaRjxLPzB8pFa+f1wRuntAo9XKfLh0QFP/VwNNaiF57/MzaKu Fr/3aIYJQc3vnentVQC31wReyIFUXcFrfTGIE9g6dNI45mFe1QLF+2a62ilp6XDy8jKX Edv17rTf5KqhDGahs9EZH+mO054JW65sf28oV4p1MIzmZC/Ibbr27jJxGAbhyERrLNLc Bob5UmitlgR5+28eHqhQBmGBUI4nvA4pPvGgjw7J5FD3j9ZJ1HLXH8AWonnujMOJUfE4 zWwA== X-Forwarded-Encrypted: i=1; AFNElJ/5bPq6eQUi/FIug2Ej2348Tx2rKsJXbJiOiAu1THk2xTEVC0I6noX3qdRm/BLWTwzfOsuXdu2vTnf37UU=@vger.kernel.org X-Gm-Message-State: AOJu0Ywfmmmv9EHRk6kbVI12szRnaPu5dJ74P19uFkg1Klnk+NTfmCR2 HXdsE/xQaR3kn6rcZNBk0RFc9xGcZQfOOv4NMsCyOUtOsBXuLKXgO0nj X-Gm-Gg: Acq92OHAfBCi2S5LdplmNX9atVESZC7DKBMYWldDNm0Se9cI797CADN6HMfKANe27sY IQAmuFh+fFWW9FZJMnn/jXUU3/zwYn+PGJPzZ63Q5Ii674Rnl4piRpSY5LR5nusJ6Zb9uDcwTwF LpHUx8sC4TePLQqS/TscM9FYPfyRSqt8RAWE6NuH6SjlD7uCaiF9d1QW7+RrBGZNrOMIaEA6np5 61tImhRse1QoSWt5xYcgsQdPuoXCcIFTI1TU1F7VzpKsSTAF6JdtmxI+5Aftd55J1bYo7jl4Xlx Px2IXIhQFZzCGrNq3TV+Gqpi6rMX0a57ajhOYJU1mmxD8brKjY/cyjLHSFmt8Oj0MOf9cuTDXP0 AhcFyQBe3koRPs0aqPpiYTGaNclXOGeNRVdgUgpT96FCtV3xYapVH/NoyITObUho96Oj4W24wdS Y/vZuVQVA85zPyFlfiFT8rgOHGF3HYKaGcwsy/FX24+6moR/cri+5wNQ414JJ7tiBnFyyGIPzF7 8gykhGr X-Received: by 2002:a05:6512:684:b0:5a8:638f:cc9c with SMTP id 2adb3069b0e04-5a8a94aa770mr4687218e87.17.1778487739469; Mon, 11 May 2026 01:22:19 -0700 (PDT) Received: from ?IPV6:2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703? ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a8cbfc4dcbsm672723e87.16.2026.05.11.01.22.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2026 01:22:17 -0700 (PDT) Message-ID: <92e2d1ab-c973-45a2-b0c4-d7c672c610e0@gmail.com> Date: Mon, 11 May 2026 11:22:16 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] dt-bindings: iio: light: Add ROHM BH1730FVC binding To: Alexandre Hamamdjian , Jonathan Cameron , David Lechner , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , CTCaer Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260511-bh1730-v1-0-e0df1f499135@gmail.com> <20260511-bh1730-v1-1-e0df1f499135@gmail.com> Content-Language: en-US, en-AU, en-GB, en-BW From: Matti Vaittinen In-Reply-To: <20260511-bh1730-v1-1-e0df1f499135@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for patches Alexandre! It's nice to see these upstreamed :) On 10/05/2026 21:09, Alexandre Hamamdjian wrote: > From: CTCaer > > Add a YAML binding for the ROHM BH1730FVC ambient light sensor. > Documents the required compatible string, the als-vdd/als-vid > regulators, and the rohm,integration-cycle, rohm,lux-multiplier, > rohm,opt-win-coeff and rohm,gain-coeff calibration properties > consumed by the driver. > > Signed-off-by: CTCaer > Signed-off-by: Alexandre Hamamdjian > --- > .../bindings/iio/light/rohm,bh1730fvc.yaml | 95 ++++++++++++++++++++++ > 1 file changed, 95 insertions(+) > > diff --git a/Documentation/devicetree/bindings/iio/light/rohm,bh1730fvc.yaml b/Documentation/devicetree/bindings/iio/light/rohm,bh1730fvc.yaml > new file mode 100644 > index 000000000000..6273b69e82ab > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/light/rohm,bh1730fvc.yaml > @@ -0,0 +1,95 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/light/rohm,bh1730fvc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: ROHM BH1730FVC ambient light sensor > + > +maintainers: > + - CTCaer > + > +description: > + Digital 16-bit ambient light sensor with an I2C interface. The device has > + two photodiodes (visible and infrared) and supports four gain settings and > + programmable integration time. > + > +properties: > + compatible: > + const: rohm,bh1730fvc > + > + reg: > + maxItems: 1 > + > + als-vdd-supply: > + description: Regulator for the analog/digital supply (VDD). > + > + als-vid-supply: > + description: Regulator for the LED indicator supply (VID). > + > + rohm,integration-cycle: > + description: > + Number of internal clock cycles used for the ADC integration time. > + Used together with rohm,lux-multiplier to calibrate the lux output. > + $ref: /schemas/types.yaml#/definitions/uint32 > + > + rohm,lux-multiplier: > + description: > + Lux scaling multiplier applied after integration. Used together with > + rohm,integration-cycle to calibrate the lux output. > + $ref: /schemas/types.yaml#/definitions/uint32 > + > + rohm,opt-win-coeff: > + description: > + Optical-window calibration coefficients. Specified as a flat list of > + triplets , one triplet per window region, where rc is the > + visible/IR ratio cutoff and cv/ci are the visible and IR weighting > + factors used in that region. > + $ref: /schemas/types.yaml#/definitions/uint32-matrix > + items: > + minItems: 3 > + maxItems: 3 I am not sure if I read the driver patch (2/2) correctly, but if I did, then these coefficients are used to compute Luxes out of the raw sensor data. I believe it would help anyone integrating (or investigating) this sensor, if you added the actual formula here as a comment. If I read this right, the formula is _somehting_ like: Lx = (cv[win] * ch0_data - ci[win] * ch1_data) / gain / int_time Here the cv[win] and ci[win] are selected from the opt-win-coeff -table, depending on the measured ch1_data/ch0_data ratio, right? > + rohm,gain-coeff: > + description: > + Per-gain sensitivity coefficients. Eight u32 values arranged as four > + pairs, one pair for each supported gain (1x, 2x, 64x, 128x). > + $ref: /schemas/types.yaml#/definitions/uint32-array > + minItems: 8 > + maxItems: 8 Is the gain-coeff only used as a saturation limit for increasing or decreasing the gain? Are they just raw channel values? > + > +required: > + - compatible > + - reg I will leave this to other reviewers, but I would guess the sensor does always require vdd? > +dependencies: > + rohm,integration-cycle: ['rohm,lux-multiplier'] > + rohm,lux-multiplier: ['rohm,integration-cycle'] > + > +additionalProperties: false > + > +examples: > + - | > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + light-sensor@29 { > + compatible = "rohm,bh1730fvc"; > + reg = <0x29>; > + als-vdd-supply = <&vdd_als>; > + als-vid-supply = <&vid_als>; > + rohm,integration-cycle = <38>; > + rohm,lux-multiplier = <1000>; > + rohm,opt-win-coeff = <260 1290 2733>, > + <550 795 859>, > + <1090 510 345>, > + <2130 276 130>; > + rohm,gain-coeff = <3000 0xffffffff > + 2000 9800 > + 15 60000 > + 0 1300>; > + }; > + }; > + > +... > -- --- Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~