Re: [PATCH 1/2] dt-bindings: iio: light: Add ROHM BH1730FVC binding

From: Jonathan Cameron

Date: Mon May 11 2026 - 11:20:30 EST


On Mon, 11 May 2026 01:09:49 +0700
Alexandre Hamamdjian via B4 Relay <devnull+azkali.limited.gmail.com@xxxxxxxxxx> wrote:

> From: CTCaer <ctcaer@xxxxxxxxx>
>
> 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 <ctcaer@xxxxxxxxx>
> Signed-off-by: Alexandre Hamamdjian <azkali.limited@xxxxxxxxx>
> ---
> .../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 <ctcaer@xxxxxxxxx>
> +
> +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).

What's this? I'm not seeing it on the datasheet I found:
https://fscdn.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1730fvc-e.pdf


> +
> + 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.
Why is this a DT thing?
> + $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.

Likewise - this sounds like a driver choice, why is it in firmware?

I'll guess this an integration cycles are linear (more or less) so can we just
define an calibration values (maybe the win-coeff. gain_coeff?) as being defined
a fixed ratio of these?

> + $ref: /schemas/types.yaml#/definitions/uint32
> +
> + rohm,opt-win-coeff:
> + description:
> + Optical-window calibration coefficients. Specified as a flat list of
> + triplets <rc cv ci>, 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.

This one is fine - though maybe we can generalize as Matti suggested.

> + $ref: /schemas/types.yaml#/definitions/uint32-matrix
> + items:
> + minItems: 3
> + maxItems: 3
> +
> + rohm,gain-coeff:
> + description:
> + Per-gain sensitivity coefficients. Eight u32 values arranged as four
> + <cl fl> pairs, one pair for each supported gain (1x, 2x, 64x, 128x).

I have no idea what this is and why it would be in the dt-binding as opposed
to being a driver thing. What is it about how the sensor is wired up or
physically mounted that changes this?

> + $ref: /schemas/types.yaml#/definitions/uint32-array
> + minItems: 8
> + maxItems: 8
> +
> +required:
> + - compatible
> + - reg
> +
> +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>;
> + };
> + };
> +
> +...
>