2023-04-21 09:44:05

by Matti Vaittinen

[permalink] [raw]
Subject: [PATCH v1 1/3] dt-bindings: iio: light: ROHM BU27008

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 <[email protected]>
---
.../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..d942c2817680
--- /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/bu27008.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ROHM BU27008 color sensor
+
+maintainers:
+ - Matti Vaittinen <[email protected]>
+
+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>;
+ };
+ };
+
+...
--
2.40.0


--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =]


Attachments:
(No filename) (2.33 kB)
signature.asc (499.00 B)
Download all attachments

2023-04-24 10:14:17

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v1 1/3] dt-bindings: iio: light: ROHM BU27008

On 21/04/2023 11:38, Matti Vaittinen wrote:
> 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 <[email protected]>
> ---
> .../bindings/iio/light/rohm-bu27008.yaml | 49 +++++++++++++++++++
> 1 file changed, 49 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/light/rohm-bu27008.yaml

Filename like compatible, so 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..d942c2817680
> --- /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/bu27008.yaml#

Does not look like you tested the bindings. Please run `make
dt_binding_check` (see
Documentation/devicetree/bindings/writing-schema.rst for instructions).


> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ROHM BU27008 color sensor
> +
> +maintainers:
> + - Matti Vaittinen <[email protected]>
> +
> +description: |

Do not need '|' unless you need to preserve formatting.

> + 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.


Best regards,
Krzysztof

2023-04-24 10:33:22

by Matti Vaittinen

[permalink] [raw]
Subject: Re: [PATCH v1 1/3] dt-bindings: iio: light: ROHM BU27008

On 4/24/23 13:12, Krzysztof Kozlowski wrote:
> On 21/04/2023 11:38, Matti Vaittinen wrote:
>> 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 <[email protected]>
>> ---
>> .../bindings/iio/light/rohm-bu27008.yaml | 49 +++++++++++++++++++
>> 1 file changed, 49 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/iio/light/rohm-bu27008.yaml
>
> Filename like compatible, so rohm,bu27008.yaml

Thanks Krzysztof. I should've remembered this as you told me the same
thing during the bu27034 review. Feel free to kick me atthe ELC-E if I
do the same mistake with bu27010 as well ^^;
>
>>
>> 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..d942c2817680
>> --- /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/bu27008.yaml#
>
> Does not look like you tested the bindings. Please run `make
> dt_binding_check` (see
> Documentation/devicetree/bindings/writing-schema.rst for instructions).
>

I actually did. But I did first run the dt_binding_check without
filename - causing it to check all the in-tree bindings - which took a
while. So, I went to have a lunch. When I came back I re-ran the check
with the filename (DT_SCHEMA_FILES=...) - which gave me no errors.

I _assume_ this is because running the check for all bindings had
already done <add step here> generating the warning, while re-running
the check with the filename omitted the <add step here> and no longer
displayed the warning.

In any case, I missed warning from full-check, and checker missed the
warning when re-ran.

>
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: ROHM BU27008 color sensor
>> +
>> +maintainers:
>> + - Matti Vaittinen <[email protected]>
>> +
>> +description: |
>
> Do not need '|' unless you need to preserve formatting.

Ok, thanks.

I'll fix these for v2 :)

Yours,
-- Matti

--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~