Skip to contentSkip to conversation

iio:light: Add Dyna-Image AP3223 ambient light and proximity driver

PATCH Superseded Suresh Rajashekara 2 participants 4 messages Sep 30, 2015

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 iio:light: Add Dyna-Image AP3223 ambient light and proximity driver

Minimal implementation with support for raw light and proximity reading.

This is based on the driver provided by the vendor
(which was an input driver). Authors of the
driver from the vendor included
* John Huang <[email protected]>
* Templeton Tsai <[email protected]>
* Vic Lee <[email protected]>

v2
* Using regmap framework
* Error handling
* Code cleanups following comments

---
 drivers/iio/light/Kconfig  |  11 +
 drivers/iio/light/Makefile |   1 +
 drivers/iio/light/ap3223.c | 706 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 718 insertions(+)
 create mode 100644 drivers/iio/light/ap3223.c
drivers/iio/light/Kconfig +11 -0
index ae68c64..5c93ef0 100644
@@ -27,6 +27,17 @@ config AL3320A
 	 To compile this driver as a module, choose M here: the
 	 module will be called al3320a.
 
+config AP3223
+	tristate "AP3223 ambient light and proximity sensor"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	 Say Y here if you want to build a driver for the Dyna Image AP3223
+	 ambient light and proximity sensor.
+
+	 To compile this driver as a module, choose M here: the
+	 module will be called ap3223.
+
 config APDS9300
 	tristate "APDS9300 ambient light sensor"
 	depends on I2C
drivers/iio/light/Makefile +1 -0
index b12a516..13a74f9 100644
@@ -5,6 +5,7 @@
 # When adding new entries keep the list in alphabetical order
 obj-$(CONFIG_ADJD_S311)		+= adjd_s311.o
 obj-$(CONFIG_AL3320A)		+= al3320a.o
+obj-$(CONFIG_AP3223)		+= ap3223.o
 obj-$(CONFIG_APDS9300)		+= apds9300.o
 obj-$(CONFIG_CM32181)		+= cm32181.o
 obj-$(CONFIG_CM3232)		+= cm3232.o
drivers/iio/light/ap3223.c new file +706 -0

706 lines not on this page · raw message

Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#1 lore raw

PATCH v2 2/2 iio:light:tsl2563: Add DT support

* Add Device Tree support for the Dyna Image AP3223 ambient light sensor and
* proximity driver,
* Document the binding and
* Add a vendor prefix for Dyna Image

v2
* Seperating the device tree changes from code

---
 Documentation/devicetree/bindings/iio/light/ap3223.txt | 18 ++++++++++++++++++
 Documentation/devicetree/bindings/vendor-prefixes.txt  |  1 +
 2 files changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/ap3223.txt
Documentation/devicetree/bindings/iio/light/ap3223.txt new file +18 -0
new file mode 100644
index 0000000..b255d27
@@ -0,0 +1,18 @@
+* Dyna Image AP3223 ambient light sensor and proximity sensor
+
+http://www.dyna-image.com/english/product/optical-sensor-detail.php?cpid=2&dpid=8
+
+Required properties:
+
+  - compatible : should be "dynaimage,ap3223"
+  - reg : the I2C address of the sensor
+
+Example:
+
+ap3223@1c {
+	compatible = "dynaimage,ap3223";
+	reg = <0x1c>;
+
+	pinctrl-0 = <&ap3223_pins>;
+	pinctrl-names = "default";
+};
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index 5f20add..704da45 100644
@@ -46,6 +46,7 @@ digilent	Diglent, Inc.
 dlg	Dialog Semiconductor
 dlink	D-Link Corporation
 dmo	Data Modul AG
+dynaimage	Dyna-Image
 ebv	EBV Elektronik
 edt	Emerging Display Technologies
 elan	Elan Microelectronic Corp.
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#2 lore raw

Re: [PATCH v2 2/2] iio:light:tsl2563: Add DT support

Quoted 2 lines · Suresh Rajashekara

* Add Device Tree support for the Dyna Image AP3223 ambient light sensor

and

Quoted 8 lines

* proximity driver,
* Document the binding and
* Add a vendor prefix for Dyna Image

v2
* Seperating the device tree changes from code

​Please ignore this patch. I have a typo in subject. Will fix and resubmit

Suresh​

#3 lore raw

Re: [PATCH v2 2/2] iio:light:tsl2563: Add DT support

In reply to Suresh Rajashekara

Hello Suresh,

Quoted 4 lines

* Add Device Tree support for the Dyna Image AP3223 ambient light sensor and
* proximity driver,
* Document the binding and
* Add a vendor prefix for Dyna Image

the mail's subject line should read something like
iio: light: Add AP3223 DT support

tsl2563 is a different driver

Quoted 2 lines

v2
* Seperating the device tree changes from code

Separating

Quoted 45 lines
---
 Documentation/devicetree/bindings/iio/light/ap3223.txt | 18 ++++++++++++++++++
 Documentation/devicetree/bindings/vendor-prefixes.txt  |  1 +
 2 files changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/ap3223.txt
Documentation/devicetree/bindings/iio/light/ap3223.txt new file +18 -0
new file mode 100644
index 0000000..b255d27
@@ -0,0 +1,18 @@
+* Dyna Image AP3223 ambient light sensor and proximity sensor
+
+http://www.dyna-image.com/english/product/optical-sensor-detail.php?cpid=2&dpid=8
+
+Required properties:
+
+  - compatible : should be "dynaimage,ap3223"
+  - reg : the I2C address of the sensor
+
+Example:
+
+ap3223@1c {
+	compatible = "dynaimage,ap3223";
+	reg = <0x1c>;
+
+	pinctrl-0 = <&ap3223_pins>;
+	pinctrl-names = "default";
+};
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index 5f20add..704da45 100644
@@ -46,6 +46,7 @@ digilent	Diglent, Inc.
 dlg	Dialog Semiconductor
 dlink	D-Link Corporation
 dmo	Data Modul AG
+dynaimage	Dyna-Image
 ebv	EBV Elektronik
 edt	Emerging Display Technologies
 elan	Elan Microelectronic Corp.
Signature · 2 lines
Peter Meerwald
+43-664-2444418 (mobile)