diff mbox series

[v3,7/7] ARM: dts: imx50-kobo-aura: Add Netronix embedded controller

Message ID 20200925050818.2512375-1-j.neuschaefer@gmx.net
State Not Applicable
Headers show
Series Netronix embedded controller driver for Kobo and Tolino ebook readers | expand

Commit Message

Jonathan Neuschäfer Sept. 25, 2020, 5:08 a.m. UTC
Enable the Netronix EC on the Kobo Aura ebook reader.

Several features are still missing:
 - Frontlight/backlight. The vendor kernel drives the frontlight LED
   using the PWM output of the EC and an additional boost pin that
   increases the brightness.
 - Battery monitoring
 - Interrupts for RTC alarm and low-battery events

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---

v3:
- Remove interrupt-controller property from embedded-controller node
- subnodes of embedded-controller node in to the main node

v2:
- https://lore.kernel.org/lkml/20200905144503.1067124-3-j.neuschaefer@gmx.net/
- Fix pwm-cells property (should be 2, not 1)
---
 arch/arm/boot/dts/imx50-kobo-aura.dts | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

--
2.28.0

Comments

Krzysztof Kozlowski Oct. 7, 2020, 7:46 a.m. UTC | #1
On Fri, 25 Sep 2020 at 07:10, Jonathan Neuschäfer <j.neuschaefer@gmx.net> wrote:
>
> Enable the Netronix EC on the Kobo Aura ebook reader.
>
> Several features are still missing:
>  - Frontlight/backlight. The vendor kernel drives the frontlight LED
>    using the PWM output of the EC and an additional boost pin that
>    increases the brightness.
>  - Battery monitoring
>  - Interrupts for RTC alarm and low-battery events
>
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---
>
> v3:
> - Remove interrupt-controller property from embedded-controller node
> - subnodes of embedded-controller node in to the main node
>
> v2:
> - https://lore.kernel.org/lkml/20200905144503.1067124-3-j.neuschaefer@gmx.net/
> - Fix pwm-cells property (should be 2, not 1)
> ---
>  arch/arm/boot/dts/imx50-kobo-aura.dts | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/boot/dts/imx50-kobo-aura.dts b/arch/arm/boot/dts/imx50-kobo-aura.dts
> index a0eaf869b9135..2d1a59091a37c 100644
> --- a/arch/arm/boot/dts/imx50-kobo-aura.dts
> +++ b/arch/arm/boot/dts/imx50-kobo-aura.dts
> @@ -6,6 +6,7 @@
>  /dts-v1/;
>  #include "imx50.dtsi"
>  #include <dt-bindings/input/input.h>
> +#include <dt-bindings/interrupt-controller/irq.h>
>
>  / {
>         model = "Kobo Aura (N514)";
> @@ -135,10 +136,24 @@ &i2c3 {
>         pinctrl-0 = <&pinctrl_i2c3>;
>         status = "okay";
>
> -       /* TODO: embedded controller at 0x43 */
> +       embedded-controller@43 {
> +               pinctrl-names = "default";
> +               pinctrl-0 = <&pinctrl_ec>;
> +               compatible = "netronix,ntxec";
> +               reg = <0x43>;
> +               system-power-controller;
> +               interrupts-extended = <&gpio4 11 IRQ_TYPE_EDGE_FALLING>;
> +               #pwm-cells = <2>;
> +       };
>  };
>
>  &iomuxc {
> +       pinctrl_ec: ec {

This should fail on dtschema check - pinctrl groups should end with "grp".

Best regards,
Krzysztof
Jonathan Neuschäfer Oct. 11, 2020, 7:42 p.m. UTC | #2
On Wed, Oct 07, 2020 at 09:46:30AM +0200, Krzysztof Kozlowski wrote:
> On Fri, 25 Sep 2020 at 07:10, Jonathan Neuschäfer <j.neuschaefer@gmx.net> wrote:
> >
> > Enable the Netronix EC on the Kobo Aura ebook reader.
...
> >  &iomuxc {
> > +       pinctrl_ec: ec {
> 
> This should fail on dtschema check - pinctrl groups should end with "grp".

I missed that requirement. I think it's only stated in the i.MX pinctrl
bindings that have been converted to YAML.

I'll fix the names.


Thanks,
Jonathan Neuschäfer
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/imx50-kobo-aura.dts b/arch/arm/boot/dts/imx50-kobo-aura.dts
index a0eaf869b9135..2d1a59091a37c 100644
--- a/arch/arm/boot/dts/imx50-kobo-aura.dts
+++ b/arch/arm/boot/dts/imx50-kobo-aura.dts
@@ -6,6 +6,7 @@ 
 /dts-v1/;
 #include "imx50.dtsi"
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>

 / {
 	model = "Kobo Aura (N514)";
@@ -135,10 +136,24 @@  &i2c3 {
 	pinctrl-0 = <&pinctrl_i2c3>;
 	status = "okay";

-	/* TODO: embedded controller at 0x43 */
+	embedded-controller@43 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_ec>;
+		compatible = "netronix,ntxec";
+		reg = <0x43>;
+		system-power-controller;
+		interrupts-extended = <&gpio4 11 IRQ_TYPE_EDGE_FALLING>;
+		#pwm-cells = <2>;
+	};
 };

 &iomuxc {
+	pinctrl_ec: ec {
+		fsl,pins = <
+			MX50_PAD_CSPI_SS0__GPIO4_11		0x0	/* INT */
+		>;
+	};
+
 	pinctrl_gpiokeys: gpiokeys {
 		fsl,pins = <
 			MX50_PAD_CSPI_MISO__GPIO4_10		0x0