devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/7] iio: light: AL3010 introduction
@ 2020-02-11 19:11 David Heidelberg
  2020-02-11 19:11 ` [PATCH v5 1/7] dt-bindings: iio: light: add support for Dyna-Image AL3320A David Heidelberg
  2020-02-11 19:11 ` [PATCH v5 2/7] dt-bindings: iio: light: add support for Dyna-Image AL3010 David Heidelberg
  0 siblings, 2 replies; 7+ messages in thread
From: David Heidelberg @ 2020-02-11 19:11 UTC (permalink / raw)
  To: Dmitry Osipenko, Daniel Baluta, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Rob Herring,
	Mark Rutland
  Cc: David Heidelberg, linux-iio, devicetree

These patches implement support for simple iio light sensor AL3010 and
also improves and align formating of AL3320a which is origin of al3010
driver.

AL3010 is used in many devices, mostly tegra2/3 based.
This effort is aimed for reducing number of out-of-tree patches for
tegra tablets and phones.

This sensor is tested on Nexus 7 (2012, grouper/tilapia).

David Heidelberg (7):
  dt-bindings: iio: light: add support for Dyna-Image AL3320A
  dt-bindings: iio: light: add support for Dyna-Image AL3010
  iio: light: al3320a slightly improve code formatting
  iio: light: add Dyna-Image AL3010 driver
  iio: light: al3320a implement suspend support
  iio: light: al3320a implement devm_add_action_or_reset
  iio: light: al3320a allow module autoload and polish

 .../devicetree/bindings/iio/light/al3010.yaml |  43 ++++
 .../bindings/iio/light/al3320a.yaml           |  43 ++++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 drivers/iio/light/Kconfig                     |  10 +
 drivers/iio/light/Makefile                    |   1 +
 drivers/iio/light/al3010.c                    | 240 ++++++++++++++++++
 drivers/iio/light/al3320a.c                   |  72 ++++--
 7 files changed, 394 insertions(+), 17 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/light/al3010.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/light/al3320a.yaml
 create mode 100644 drivers/iio/light/al3010.c

-- 
2.25.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v5 1/7] dt-bindings: iio: light: add support for Dyna-Image AL3320A
  2020-02-11 19:11 [PATCH v5 0/7] iio: light: AL3010 introduction David Heidelberg
@ 2020-02-11 19:11 ` David Heidelberg
  2020-02-15 16:59   ` Jonathan Cameron
  2020-02-18 21:01   ` Rob Herring
  2020-02-11 19:11 ` [PATCH v5 2/7] dt-bindings: iio: light: add support for Dyna-Image AL3010 David Heidelberg
  1 sibling, 2 replies; 7+ messages in thread
From: David Heidelberg @ 2020-02-11 19:11 UTC (permalink / raw)
  To: Dmitry Osipenko, Daniel Baluta, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Rob Herring,
	Mark Rutland
  Cc: David Heidelberg, linux-iio, devicetree

This commit add dt-bindings support to al3320a driver and vendor-prefix
dynaimage.
Partly based on unmerged commit:
"iio: Add Dyna-Image AP3223 ambient light and proximity driver"

Signed-off-by: David Heidelberg <david@ixit.cz>
---
v5
 - drop requirement on interrups and vdd-supply
 - s/al3320a@1c/light-sensor@1c/
 - dual license also under BSD

 .../bindings/iio/light/al3320a.yaml           | 43 +++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
 2 files changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/al3320a.yaml

diff --git a/Documentation/devicetree/bindings/iio/light/al3320a.yaml b/Documentation/devicetree/bindings/iio/light/al3320a.yaml
new file mode 100644
index 000000000000..cdc8d98d114c
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/al3320a.yaml
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/al3320a.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Dyna-Image AL3320A sensor
+
+maintainers:
+  - David Heidelberg <david@ixit.cz>
+
+properties:
+  compatible:
+    const: dynaimage,al3320a
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  vdd-supply:
+    description: Regulator that provides power to the sensor
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@1c {
+            compatible = "dynaimage,al3320a";
+            reg = <0x1c>;
+            vdd-supply = <&vdd_reg>;
+            interrupts = <0 99 4>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 9cd52d9e1f7f..8d2ebf3d0aa1 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -267,6 +267,8 @@ patternProperties:
     description: Dragino Technology Co., Limited
   "^dserve,.*":
     description: dServe Technology B.V.
+  "^dynaimage,.*":
+    description: Dyna-Image
   "^ea,.*":
     description: Embedded Artists AB
   "^ebs-systart,.*":
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v5 2/7] dt-bindings: iio: light: add support for Dyna-Image AL3010
  2020-02-11 19:11 [PATCH v5 0/7] iio: light: AL3010 introduction David Heidelberg
  2020-02-11 19:11 ` [PATCH v5 1/7] dt-bindings: iio: light: add support for Dyna-Image AL3320A David Heidelberg
@ 2020-02-11 19:11 ` David Heidelberg
  2020-02-15 17:00   ` Jonathan Cameron
  2020-02-18 21:01   ` Rob Herring
  1 sibling, 2 replies; 7+ messages in thread
From: David Heidelberg @ 2020-02-11 19:11 UTC (permalink / raw)
  To: Dmitry Osipenko, Daniel Baluta, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Rob Herring,
	Mark Rutland
  Cc: David Heidelberg, linux-iio, devicetree

The Dyna-Image AL3010 is a 16-bit digital ambient light sensor which
provides a multiple gain function with linear response over a dynamic
range 1216/4863/19452/77806.

Signed-off-by: David Heidelberg <david@ixit.cz>
---
v5
 - drop requirement on interrups and vdd-supply
 - s/al3010@1c/light-sensor@1c/
 - dual license also under BSD

 .../devicetree/bindings/iio/light/al3010.yaml | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/al3010.yaml

diff --git a/Documentation/devicetree/bindings/iio/light/al3010.yaml b/Documentation/devicetree/bindings/iio/light/al3010.yaml
new file mode 100644
index 000000000000..fdd1e5fa9c74
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/al3010.yaml
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/al3010.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Dyna-Image AL3010 sensor
+
+maintainers:
+  - David Heidelberg <david@ixit.cz>
+
+properties:
+  compatible:
+    const: dynaimage,al3010
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  vdd-supply:
+    description: Regulator that provides power to the sensor
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        light-sensor@1c {
+            compatible = "dynaimage,al3010";
+            reg = <0x1c>;
+            vdd-supply = <&vdd_reg>;
+            interrupts = <0 99 4>;
+        };
+    };
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 1/7] dt-bindings: iio: light: add support for Dyna-Image AL3320A
  2020-02-11 19:11 ` [PATCH v5 1/7] dt-bindings: iio: light: add support for Dyna-Image AL3320A David Heidelberg
@ 2020-02-15 16:59   ` Jonathan Cameron
  2020-02-18 21:01   ` Rob Herring
  1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2020-02-15 16:59 UTC (permalink / raw)
  To: David Heidelberg
  Cc: Dmitry Osipenko, Daniel Baluta, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Rob Herring,
	Mark Rutland, linux-iio, devicetree

On Tue, 11 Feb 2020 20:11:55 +0100
David Heidelberg <david@ixit.cz> wrote:

> This commit add dt-bindings support to al3320a driver and vendor-prefix
> dynaimage.
> Partly based on unmerged commit:
> "iio: Add Dyna-Image AP3223 ambient light and proximity driver"
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>
> ---
> v5
>  - drop requirement on interrups and vdd-supply
>  - s/al3320a@1c/light-sensor@1c/
>  - dual license also under BSD
> 
>  .../bindings/iio/light/al3320a.yaml           | 43 +++++++++++++++++++
>  .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
>  2 files changed, 45 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/light/al3320a.yaml
> 
> diff --git a/Documentation/devicetree/bindings/iio/light/al3320a.yaml b/Documentation/devicetree/bindings/iio/light/al3320a.yaml
> new file mode 100644
> index 000000000000..cdc8d98d114c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/light/al3320a.yaml
I missed this previously but it's preferred for the filename to include the
manufacturer bit.  I'll fix up including the reference to the filename below.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Ideally I'd like to add a DT reviewed by, but I think you've addressed
all the previous comments.

Thanks,

Jonathan


> @@ -0,0 +1,43 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/light/al3320a.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Dyna-Image AL3320A sensor
> +
> +maintainers:
> +  - David Heidelberg <david@ixit.cz>
> +
> +properties:
> +  compatible:
> +    const: dynaimage,al3320a
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  vdd-supply:
> +    description: Regulator that provides power to the sensor
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        light-sensor@1c {
> +            compatible = "dynaimage,al3320a";
> +            reg = <0x1c>;
> +            vdd-supply = <&vdd_reg>;
> +            interrupts = <0 99 4>;
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
> index 9cd52d9e1f7f..8d2ebf3d0aa1 100644
> --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
> +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
> @@ -267,6 +267,8 @@ patternProperties:
>      description: Dragino Technology Co., Limited
>    "^dserve,.*":
>      description: dServe Technology B.V.
> +  "^dynaimage,.*":
> +    description: Dyna-Image
>    "^ea,.*":
>      description: Embedded Artists AB
>    "^ebs-systart,.*":


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 2/7] dt-bindings: iio: light: add support for Dyna-Image AL3010
  2020-02-11 19:11 ` [PATCH v5 2/7] dt-bindings: iio: light: add support for Dyna-Image AL3010 David Heidelberg
@ 2020-02-15 17:00   ` Jonathan Cameron
  2020-02-18 21:01   ` Rob Herring
  1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2020-02-15 17:00 UTC (permalink / raw)
  To: David Heidelberg
  Cc: Dmitry Osipenko, Daniel Baluta, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Rob Herring,
	Mark Rutland, linux-iio, devicetree

On Tue, 11 Feb 2020 20:11:56 +0100
David Heidelberg <david@ixit.cz> wrote:

> The Dyna-Image AL3010 is a 16-bit digital ambient light sensor which
> provides a multiple gain function with linear response over a dynamic
> range 1216/4863/19452/77806.
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>
Applied with name tweaked as per patch 1.

Thanks,

Jonathan

> ---
> v5
>  - drop requirement on interrups and vdd-supply
>  - s/al3010@1c/light-sensor@1c/
>  - dual license also under BSD
> 
>  .../devicetree/bindings/iio/light/al3010.yaml | 43 +++++++++++++++++++
>  1 file changed, 43 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/light/al3010.yaml
> 
> diff --git a/Documentation/devicetree/bindings/iio/light/al3010.yaml b/Documentation/devicetree/bindings/iio/light/al3010.yaml
> new file mode 100644
> index 000000000000..fdd1e5fa9c74
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/light/al3010.yaml
> @@ -0,0 +1,43 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/light/al3010.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Dyna-Image AL3010 sensor
> +
> +maintainers:
> +  - David Heidelberg <david@ixit.cz>
> +
> +properties:
> +  compatible:
> +    const: dynaimage,al3010
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  vdd-supply:
> +    description: Regulator that provides power to the sensor
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        light-sensor@1c {
> +            compatible = "dynaimage,al3010";
> +            reg = <0x1c>;
> +            vdd-supply = <&vdd_reg>;
> +            interrupts = <0 99 4>;
> +        };
> +    };


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 1/7] dt-bindings: iio: light: add support for Dyna-Image AL3320A
  2020-02-11 19:11 ` [PATCH v5 1/7] dt-bindings: iio: light: add support for Dyna-Image AL3320A David Heidelberg
  2020-02-15 16:59   ` Jonathan Cameron
@ 2020-02-18 21:01   ` Rob Herring
  1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2020-02-18 21:01 UTC (permalink / raw)
  To: David Heidelberg
  Cc: Dmitry Osipenko, Daniel Baluta, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Mark Rutland,
	David Heidelberg, linux-iio, devicetree

On Tue, 11 Feb 2020 20:11:55 +0100, David Heidelberg wrote:
> This commit add dt-bindings support to al3320a driver and vendor-prefix
> dynaimage.
> Partly based on unmerged commit:
> "iio: Add Dyna-Image AP3223 ambient light and proximity driver"
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>
> ---
> v5
>  - drop requirement on interrups and vdd-supply
>  - s/al3320a@1c/light-sensor@1c/
>  - dual license also under BSD
> 
>  .../bindings/iio/light/al3320a.yaml           | 43 +++++++++++++++++++
>  .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
>  2 files changed, 45 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/light/al3320a.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 2/7] dt-bindings: iio: light: add support for Dyna-Image AL3010
  2020-02-11 19:11 ` [PATCH v5 2/7] dt-bindings: iio: light: add support for Dyna-Image AL3010 David Heidelberg
  2020-02-15 17:00   ` Jonathan Cameron
@ 2020-02-18 21:01   ` Rob Herring
  1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2020-02-18 21:01 UTC (permalink / raw)
  To: David Heidelberg
  Cc: Dmitry Osipenko, Daniel Baluta, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Mark Rutland,
	David Heidelberg, linux-iio, devicetree

On Tue, 11 Feb 2020 20:11:56 +0100, David Heidelberg wrote:
> The Dyna-Image AL3010 is a 16-bit digital ambient light sensor which
> provides a multiple gain function with linear response over a dynamic
> range 1216/4863/19452/77806.
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>
> ---
> v5
>  - drop requirement on interrups and vdd-supply
>  - s/al3010@1c/light-sensor@1c/
>  - dual license also under BSD
> 
>  .../devicetree/bindings/iio/light/al3010.yaml | 43 +++++++++++++++++++
>  1 file changed, 43 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/light/al3010.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-02-18 21:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 19:11 [PATCH v5 0/7] iio: light: AL3010 introduction David Heidelberg
2020-02-11 19:11 ` [PATCH v5 1/7] dt-bindings: iio: light: add support for Dyna-Image AL3320A David Heidelberg
2020-02-15 16:59   ` Jonathan Cameron
2020-02-18 21:01   ` Rob Herring
2020-02-11 19:11 ` [PATCH v5 2/7] dt-bindings: iio: light: add support for Dyna-Image AL3010 David Heidelberg
2020-02-15 17:00   ` Jonathan Cameron
2020-02-18 21:01   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).