Re: [PATCH v2 2/2] ARM: dts: imx: add devicetree for Tolino Shine 2 HD

2020-08-31 Thread Andreas Kemnade
Hi,

On Thu, 27 Aug 2020 20:33:23 +0200
Jonathan Neuschäfer  wrote:

> On Wed, Aug 26, 2020 at 10:42:51PM +0200, Andreas Kemnade wrote:
> > This adds a devicetree for the Tolino Shine 2 HD Ebook reader. It is based
> > on boards marked with "37NB-E60QF0+4A2". It is equipped with an i.MX6SL
> > SoC.
> > 
> > Expected to work:
> > - Buttons
> > - Wifi
> > - Touchscreen
> > - LED
> > - uSD
> > - USB
> > - RTC
> > 
> > Not working due to missing drivers:
> > - Backlight (requires NTXEC driver)
> > - EPD
> > 
> > Not working due to unknown reasons:
> > - deep sleep (echo standby >/sys/power/state works),
> >   wakeup fails when imx_gpc_pre_suspend(true) was called.
> > 
> > Signed-off-by: Andreas Kemnade 
> > ---  
> [...]
> > +   fl {
> > +   label = "Frontlight";
> > +   gpios = < 26 GPIO_ACTIVE_LOW>;
> > +   linux,code = ;
> > +   };  
> 
> Another option might be KEY_BRIGHTNESS_TOGGLE/KEY_DISPLAYTOGGLE, but
> it's not a perfect match, either. (And perhaps a worse match due to the
> connotation of turning the display off.)
> 
I have also thought about these, but came to the same conclusion as you,
the connotation of turning the display off does not feel right.

> 
> Reviewed-by: Jonathan Neuschäfer 
> 
> Thanks

Regards,
Andreas


Re: [PATCH v2 2/2] ARM: dts: imx: add devicetree for Tolino Shine 2 HD

2020-08-27 Thread Jonathan Neuschäfer
On Wed, Aug 26, 2020 at 10:42:51PM +0200, Andreas Kemnade wrote:
> This adds a devicetree for the Tolino Shine 2 HD Ebook reader. It is based
> on boards marked with "37NB-E60QF0+4A2". It is equipped with an i.MX6SL
> SoC.
> 
> Expected to work:
> - Buttons
> - Wifi
> - Touchscreen
> - LED
> - uSD
> - USB
> - RTC
> 
> Not working due to missing drivers:
> - Backlight (requires NTXEC driver)
> - EPD
> 
> Not working due to unknown reasons:
> - deep sleep (echo standby >/sys/power/state works),
>   wakeup fails when imx_gpc_pre_suspend(true) was called.
> 
> Signed-off-by: Andreas Kemnade 
> ---
[...]
> + fl {
> + label = "Frontlight";
> + gpios = < 26 GPIO_ACTIVE_LOW>;
> + linux,code = ;
> + };

Another option might be KEY_BRIGHTNESS_TOGGLE/KEY_DISPLAYTOGGLE, but
it's not a perfect match, either. (And perhaps a worse match due to the
connotation of turning the display off.)


Reviewed-by: Jonathan Neuschäfer 

Thanks


signature.asc
Description: PGP signature


[PATCH v2 2/2] ARM: dts: imx: add devicetree for Tolino Shine 2 HD

2020-08-26 Thread Andreas Kemnade
This adds a devicetree for the Tolino Shine 2 HD Ebook reader. It is based
on boards marked with "37NB-E60QF0+4A2". It is equipped with an i.MX6SL
SoC.

Expected to work:
- Buttons
- Wifi
- Touchscreen
- LED
- uSD
- USB
- RTC

Not working due to missing drivers:
- Backlight (requires NTXEC driver)
- EPD

Not working due to unknown reasons:
- deep sleep (echo standby >/sys/power/state works),
  wakeup fails when imx_gpc_pre_suspend(true) was called.

Signed-off-by: Andreas Kemnade 
---
Changes in v2:
- better comments about internals
- avoid confusion about polarity of wifi enable pin
- newline cleanup

 arch/arm/boot/dts/Makefile   |   1 +
 arch/arm/boot/dts/imx6sl-tolino-shine2hd.dts | 588 +++
 2 files changed, 589 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6sl-tolino-shine2hd.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index e6a1cac0bfc7..c65fa3852246 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -581,6 +581,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6qp-zii-rdu2.dtb
 dtb-$(CONFIG_SOC_IMX6SL) += \
imx6sl-evk.dtb \
+   imx6sl-tolino-shine2hd.dtb \
imx6sl-tolino-shine3.dtb \
imx6sl-warp.dtb
 dtb-$(CONFIG_SOC_IMX6SLL) += \
diff --git a/arch/arm/boot/dts/imx6sl-tolino-shine2hd.dts 
b/arch/arm/boot/dts/imx6sl-tolino-shine2hd.dts
new file mode 100644
index ..caa279608803
--- /dev/null
+++ b/arch/arm/boot/dts/imx6sl-tolino-shine2hd.dts
@@ -0,0 +1,588 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device tree for the Tolino Shine 2 HD ebook reader
+ *
+ * Name on mainboard is: 37NB-E60QF0+4A2 or 37NB-E60QF0+4A3
+ * Serials start with: E60QF2
+ *
+ * Copyright 2020 Andreas Kemnade
+ */
+
+/dts-v1/;
+
+#include 
+#include 
+#include "imx6sl.dtsi"
+
+/ {
+   model = "Tolino Shine 2 HD";
+   compatible = "kobo,tolino-shine2hd", "fsl,imx6sl";
+
+   chosen {
+   stdout-path = 
+   };
+
+   gpio_keys: gpio-keys {
+   compatible = "gpio-keys";
+   pinctrl-names = "default";
+   pinctrl-0 = <_gpio_keys>;
+
+   cover {
+   label = "Cover";
+   gpios = < 12 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   linux,input-type = ;
+   wakeup-source;
+   };
+
+   fl {
+   label = "Frontlight";
+   gpios = < 26 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   home {
+   label = "Home";
+   gpios = < 25 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+
+   power {
+   label = "Power";
+   gpios = < 8 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   wakeup-source;
+   };
+   };
+
+   leds: leds {
+   compatible = "gpio-leds";
+   pinctrl-names = "default";
+   pinctrl-0 = <_led>;
+
+   on {
+   label = "tolinoshine2hd:white:on";
+   gpios = < 13 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "timer";
+   };
+   };
+
+   memory@8000 {
+   device_type = "memory";
+   reg = <0x8000 0x2000>;
+   };
+
+   reg_wifi: regulator-wifi {
+   compatible = "regulator-fixed";
+   pinctrl-names = "default";
+   pinctrl-0 = <_wifi_power>;
+   regulator-name = "SD3_SPWR";
+   regulator-min-microvolt = <300>;
+   regulator-max-microvolt = <300>;
+   gpio = < 29 GPIO_ACTIVE_LOW>;
+   };
+
+   wifi_pwrseq: wifi_pwrseq {
+   compatible = "mmc-pwrseq-simple";
+   pinctrl-names = "default";
+   pinctrl-0 = <_wifi_reset>;
+   post-power-on-delay-ms = <20>;
+   reset-gpios = < 0 GPIO_ACTIVE_LOW>;
+   };
+};
+
+ {
+   pinctrl-names = "default","sleep";
+   pinctrl-0 = <_i2c1>;
+   pinctrl-1 = <_i2c1_sleep>;
+   status = "okay";
+
+   /* TODO: embedded controller at 0x43 (driver missing) */
+
+};
+
+ {
+   pinctrl-names = "default","sleep";
+   pinctrl-0 = <_i2c2>;
+   pinctrl-1 = <_i2c2_sleep>;
+   clock-frequency = <10>;
+   status = "okay";
+
+   zforce: touchscreen@50 {
+   compatible = "neonode,zforce";
+   pinctrl-names = "default";
+   pinctrl-0 = <_zforce>;
+   reg = <0x50>;
+   interrupt-parent = <>;
+   interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
+   vdd-supply = <_reg>;
+   reset-gpios = < 9 GPIO_ACTIVE_LOW>;
+   x-size = <1072>;
+   y-size = <1448>;
+   };
+
+