Skip to contentSkip to conversation

dt-bindings: iio: light: ROHM BH1745

PATCH Superseded Mudit Sharma 2 participants 4 messages Jun 3, 2024

Subsystems (3)

v1 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Mudit Sharma

author maintainer
#0 lore raw

PATCH 1/3 dt-bindings: iio: light: ROHM BH1745

Add ROHM BH1745 - 4 channel I2C colour sensor's dt-bindings.

---
 .../bindings/iio/light/rohm,bh1745.yaml       | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/rohm,bh1745.yaml
Documentation/devicetree/bindings/iio/light/rohm,bh1745.yaml new file +49 -0
new file mode 100644
index 000000000000..b6abfbf609cb
@@ -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,bh1745.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ROHM BH1745 colour sensor
+
+maintainers:
+  Mudit Sharma <[email protected]>
+
+description: |
+  BH1745 is an I2C colour sensor with red, green, blue and clear
+  channels. It has a programmable active low interrupt pin.
+  Interrupt occurs when the signal from the selected interrupt
+  source channel crosses set interrupt threshold high/low level.
+
+properties:
+  compatible:
+    const: rohm,bh1745
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        colour-sensor@38 {
+            compatible = "rohm,bh1745";
+            reg = <0x38>;
+            interrupt-parent = <&gpio>;
+            interrupts = <19 IRQ_TYPE_LEVEL_LOW>;
+        };
+    };
+
+...
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH 2/3 iio: light: ROHM BH1745 colour sensor

Add support for BH1745, which is an I2C colour sensor with red, green, blue and clear channels. It has a programmable active low interrupt pin. Interrupt occurs when the signal from the selected interrupt source channel crosses set interrupt threshold high or low level.

This driver includes device attributes to configure the following:
- Interrupt pin latch: The interrupt pin can be configured to be latched (until interrupt register (0x60) is read or initialized) or update after each measurement.
- Interrupt source: The colour channel that will cause the interrupt when channel will cross the set threshold high or low level.

This driver also includes device attributes to present valid configuration options/values for:
- Integration time
- Interrupt colour source
- Hardware gain

---
 drivers/iio/light/Kconfig  |  12 +
 drivers/iio/light/Makefile |   1 +
 drivers/iio/light/bh1745.c | 879 +++++++++++++++++++++++++++++++++++++
 3 files changed, 892 insertions(+)
 create mode 100644 drivers/iio/light/bh1745.c
drivers/iio/light/Kconfig +12 -0
index 9a587d403118..6e0bd2addf9e 100644
@@ -114,6 +114,18 @@ config AS73211
 	 This driver can also be built as a module.  If so, the module
 	 will be called as73211.
 
+config BH1745
+	tristate "ROHM BH1745 colour sensor"
+	depends on I2C
+	select REGMAP_I2C
+	select IIO_BUFFER
+	select IIO_TRIGGERED_BUFFER
+	help
+	  Say Y here to build support for the ROHM bh1745 colour sensor.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called bh1745.
+
 config BH1750
 	tristate "ROHM BH1750 ambient light sensor"
 	depends on I2C
drivers/iio/light/Makefile +1 -0
index a30f906e91ba..939a701a06ac 100644
@@ -13,6 +13,7 @@ obj-$(CONFIG_APDS9300)		+= apds9300.o
 obj-$(CONFIG_APDS9306)		+= apds9306.o
 obj-$(CONFIG_APDS9960)		+= apds9960.o
 obj-$(CONFIG_AS73211)		+= as73211.o
+obj-$(CONFIG_BH1745)		+= bh1745.o
 obj-$(CONFIG_BH1750)		+= bh1750.o
 obj-$(CONFIG_BH1780)		+= bh1780.o
 obj-$(CONFIG_CM32181)		+= cm32181.o
drivers/iio/light/bh1745.c new file +879 -0

879 lines not on this page · raw message

Signature · 1 line
2.43.0
author maintainer
#2 lore raw

PATCH 3/3 MAINTAINERS: Add maintainer for ROHM BH1745

In reply to Mudit Sharma

Add myself as maintainer for ROHM BH1745 colour sensor driver.

---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
index d6c90161c7bf..945873321fef 100644
@@ -19407,6 +19407,13 @@ S:	Supported
 F:	drivers/power/supply/bd99954-charger.c
 F:	drivers/power/supply/bd99954-charger.h
 
+ROHM BH1745 COLOUR SENSOR
+M:	Mudit Sharma <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/iio/light/rohm,bh1745.yaml
+F:	drivers/iio/light/bh1745.c
+
 ROHM BH1750 AMBIENT LIGHT SENSOR DRIVER
 M:	Tomasz Duszynski <[email protected]>
 S:	Maintained
Signature · 1 line
2.43.0
#3 lore raw
In reply to Mudit Sharma
Quoted 8 lines · Mudit Sharma

Add ROHM BH1745 - 4 channel I2C colour sensor's dt-bindings.

---
 .../bindings/iio/light/rohm,bh1745.yaml       | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/rohm,bh1745.yaml

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/light/rohm,bh1745.yaml: maintainers: 'Mudit Sharma <[email protected]>' is not of type 'array'
from schema $id: http://devicetree.org/meta-schemas/base.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.