[linux-sunxi] [PATCH v2 5/5] ARM: dts: sun4i: Add support for Topwise A721 tablet

2020-03-20 Thread Pascal Roeleven
The Topwise A721/LY-F1 tablet is a tablet sold around 2012 under
different brands. The mainboard mentions A721 clearly, so this tablet
is best known under this name.

Signed-off-by: Pascal Roeleven 
---
 arch/arm/boot/dts/Makefile   |   3 +-
 arch/arm/boot/dts/sun4i-a10-topwise-a721.dts | 242 +++
 2 files changed, 244 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/sun4i-a10-topwise-a721.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 78f144e33..6e6141e00 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1040,7 +1040,8 @@ dtb-$(CONFIG_MACH_SUN4I) += \
sun4i-a10-olinuxino-lime.dtb \
sun4i-a10-pcduino.dtb \
sun4i-a10-pcduino2.dtb \
-   sun4i-a10-pov-protab2-ips9.dtb
+   sun4i-a10-pov-protab2-ips9.dtb \
+   sun4i-a10-topwise-a721.dtb
 dtb-$(CONFIG_MACH_SUN5I) += \
sun5i-a10s-auxtek-t003.dtb \
sun5i-a10s-auxtek-t004.dtb \
diff --git a/arch/arm/boot/dts/sun4i-a10-topwise-a721.dts 
b/arch/arm/boot/dts/sun4i-a10-topwise-a721.dts
new file mode 100644
index 0..936171d30
--- /dev/null
+++ b/arch/arm/boot/dts/sun4i-a10-topwise-a721.dts
@@ -0,0 +1,242 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2020 Pascal Roeleven 
+ */
+
+/dts-v1/;
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include 
+#include 
+#include 
+#include 
+
+/ {
+   model = "Topwise A721";
+   compatible = "topwise,a721", "allwinner,sun4i-a10";
+
+   aliases {
+   serial0 = 
+   };
+
+   backlight: backlight {
+   compatible = "pwm-backlight";
+   pwms = < 0 10 PWM_POLARITY_INVERTED>;
+   power-supply = <_vbat>;
+   enable-gpios = < 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
+   brightness-levels = <0 30 40 50 60 70 80 90 100>;
+   default-brightness-level = <8>;
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   panel: panel {
+   compatible = "starry,kr070pe2t";
+   backlight = <>;
+   power-supply = <_lcd_power>;
+
+   port {
+   panel_input: endpoint {
+   remote-endpoint = <_out_panel>;
+   };
+   };
+   };
+
+   reg_lcd_power: reg-lcd-power {
+   compatible = "regulator-fixed";
+   regulator-name = "reg-lcd-power";
+   gpio = < 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */
+   enable-active-high;
+   };
+
+   reg_vbat: reg-vbat {
+   compatible = "regulator-fixed";
+   regulator-name = "vbat";
+   regulator-min-microvolt = <370>;
+   regulator-max-microvolt = <370>;
+   };
+
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   cpu-supply = <_dcdc2>;
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+
+   axp209: pmic@34 {
+   reg = <0x34>;
+   interrupts = <0>;
+   };
+};
+
+#include "axp209.dtsi"
+
+_power_supply {
+   status = "okay";
+};
+
+_power_supply {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+
+   mma7660: accelerometer@4c {
+   compatible = "fsl,mma7660";
+   reg = <0x4c>;
+   };
+};
+
+ {
+   status = "okay";
+
+   ft5406ee8: touchscreen@38 {
+   compatible = "edt,edt-ft5406";
+   reg = <0x38>;
+   interrupt-parent = <>;
+   interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
+   touchscreen-size-x = <800>;
+   touchscreen-size-y = <480>;
+   vcc-supply = <_vcc3v3>;
+   };
+};
+
+ {
+   vref-supply = <_ldo2>;
+   status = "okay";
+
+   button-vol-down {
+   label = "Volume Down";
+   linux,code = ;
+   channel = <0>;
+   voltage = <761904>;
+   };
+
+   button-vol-up {
+   label = "Volume Up";
+   linux,code = ;
+   channel = <0>;
+   voltage = <571428>;
+   };
+};
+
+ {
+   vmmc-supply = <_vcc3v3>;
+   bus-width = <4>;
+   cd-gpios = < 7 1 GPIO_ACTIVE_LOW>; /* PH01 */
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+_sram {
+   status = "okay";
+};
+
+ {
+   vcc-pb-supply = <_vcc3v3>;
+   vcc-pf-supply = <_vcc3v3>;
+   vcc-ph-supply = <_vcc3v3>;
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pin>;
+   status = "okay";
+};
+
+_dcdc2 {
+   regulator-always-on;
+   regulator-min-microvolt = <100>;
+   regulator-max-microvolt = <140>;
+   regulator-name = "vdd-cpu";
+};
+
+_dcdc3 {
+   regulator-always-on;
+   regulator-min-microvolt = 

[linux-sunxi] [PATCH v2 2/5] drm: panel: Add Starry KR070PE2T

2020-03-20 Thread Pascal Roeleven
The KR070PE2T is a 7" panel with a resolution of 800x480.

KR070PE2T is the marking present on the ribbon cable. As this panel is
probably available under different brands, this marking will catch
most devices.

As I can't find a datasheet for this panel, the bus_flags are instead
from trial-and-error. The flags seem to be common for these kind of
panels as well.

Signed-off-by: Pascal Roeleven 
---
 drivers/gpu/drm/panel/panel-simple.c | 29 
 1 file changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index e14c14ac6..b3d257257 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -2842,6 +2842,32 @@ static const struct panel_desc shelly_sca07010_bfn_lnn = 
{
.bus_format = MEDIA_BUS_FMT_RGB666_1X18,
 };
 
+static const struct drm_display_mode starry_kr070pe2t_mode = {
+   .clock = 33000,
+   .hdisplay = 800,
+   .hsync_start = 800 + 209,
+   .hsync_end = 800 + 209 + 1,
+   .htotal = 800 + 209 + 1 + 45,
+   .vdisplay = 480,
+   .vsync_start = 480 + 22,
+   .vsync_end = 480 + 22 + 1,
+   .vtotal = 480 + 22 + 1 + 22,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc starry_kr070pe2t = {
+   .modes = _kr070pe2t_mode,
+   .num_modes = 1,
+   .bpc = 8,
+   .size = {
+   .width = 152,
+   .height = 86,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
+   .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
+   .connector_type = DRM_MODE_CONNECTOR_LVDS,
+};
+
 static const struct drm_display_mode starry_kr122ea0sra_mode = {
.clock = 147000,
.hdisplay = 1920,
@@ -3474,6 +3500,9 @@ static const struct of_device_id platform_of_match[] = {
}, {
.compatible = "shelly,sca07010-bfn-lnn",
.data = _sca07010_bfn_lnn,
+   }, {
+   .compatible = "starry,kr070pe2t",
+   .data = _kr070pe2t,
}, {
.compatible = "starry,kr122ea0sra",
.data = _kr122ea0sra,
-- 
2.20.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200320112205.7100-3-dev%40pascalroeleven.nl.


[linux-sunxi] [PATCH v2 3/5] dt-bindings: vendor-prefixes: Add Topwise

2020-03-20 Thread Pascal Roeleven
Topwise Communication Co,. Ltd. is a company based in Shenzhen. They
manufacture all kind of products but seem to be focusing on POS nowadays.

Signed-off-by: Pascal Roeleven 
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml 
b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 9e67944be..3c08370b7 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -982,6 +982,8 @@ patternProperties:
   "^toppoly,.*":
 description: TPO (deprecated, use tpo)
 deprecated: true
+  "^topwise,.*":
+description: Topwise Communication Co., Ltd.
   "^toradex,.*":
 description: Toradex AG
   "^toshiba,.*":
-- 
2.20.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200320112205.7100-4-dev%40pascalroeleven.nl.


[linux-sunxi] [PATCH v2 1/5] dt-bindings: panel: Add binding for Starry KR070PE2T

2020-03-20 Thread Pascal Roeleven
Add the devicetree binding for Starry KR070PE2T

Signed-off-by: Pascal Roeleven 
---
 .../devicetree/bindings/display/panel/panel-simple.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml 
b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
index 8fe60ee25..7cbace360 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
+++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml
@@ -43,6 +43,8 @@ properties:
   - satoz,sat050at40h12r2
 # Sharp LS020B1DD01D 2.0" HQVGA TFT LCD panel
   - sharp,ls020b1dd01d
+# Starry KR070PE2T 7" WVGA TFT LCD panel
+  - starry,kr070pe2t
 
   backlight: true
   enable-gpios: true
-- 
2.20.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200320112205.7100-2-dev%40pascalroeleven.nl.


[linux-sunxi] [PATCH v2 0/5] Add support for Topwise A721 tablet

2020-03-20 Thread Pascal Roeleven
This series add support for the Topwise A721 tablet and it's display.
It is an old tablet (around 2012) but it might be useful as reference
as the devicetree is pretty complete.

Changes from v1:
* Split into multiple patches
* dt-binding: use yaml instead of txt
* dt-binding: add Topwise A721 to sunxi.yaml
* dt-binding: add Topwise to vendor-prefixes
* drm: Add bus_format, bus_flags and connector_type
* dts: Use SPDX license identifier instead of boilerplate license text
* dts: Remove pinctrl leftovers

Pascal Roeleven (5):
  dt-bindings: panel: Add binding for Starry KR070PE2T
  drm: panel: Add Starry KR070PE2T
  dt-bindings: vendor-prefixes: Add Topwise
  dt-bindings: arm: Add Topwise A721
  ARM: dts: sun4i: Add support for Topwise A721 tablet

 .../devicetree/bindings/arm/sunxi.yaml|   5 +
 .../bindings/display/panel/panel-simple.yaml  |   2 +
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 arch/arm/boot/dts/Makefile|   3 +-
 arch/arm/boot/dts/sun4i-a10-topwise-a721.dts  | 242 ++
 drivers/gpu/drm/panel/panel-simple.c  |  29 +++
 6 files changed, 282 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/sun4i-a10-topwise-a721.dts

-- 
2.20.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200320112205.7100-1-dev%40pascalroeleven.nl.


[linux-sunxi] Re: [PATCH v2 2/5] dt-bindings: panel: add binding for Xingbangda XBD599 panel

2020-03-20 Thread Icenowy Zheng



于 2020年3月20日 GMT+08:00 下午5:11:22, Linus Walleij  写到:
>On Fri, Mar 20, 2020 at 9:07 AM Icenowy Zheng  wrote:
>> 于 2020年3月19日 GMT+08:00 下午10:14:27, Linus Walleij
> 写到:
>> >On Mon, Mar 16, 2020 at 2:37 PM Icenowy Zheng 
>wrote:
>
>> >As noticed in the review of the driver, this display is very close
>to
>> >himax,hx8363.
>> >
>> >I think the best is to determin what actual display controller it
>is,
>> >I think it is some kind of Ilitek controller since Ilitek ili9342 is
>> >clearly very similar.
>>
>> It's Sitronix ST7703, same as the Librem 5 panel.
>
>Heh, I wonder how it comes that it is so similar to Ilitek.
>I guess I will never understand how the silicon ecosystem works
>in asia (I did read a lot of Bunnie Huang's articles and hardware
>hacking book to try to understand...)
>
>This file should be named sitronix,st7703.yaml then.
>
>According to the code in the Librem 5:
>https://source.puri.sm/Librem5/linux-next/blob/imx8-current-librem5/drivers/gpu/drm/panel/panel-sitronix-st7701.c
>The actual name of the display is Techstar ts8550b.

Sorry, for Librem 5 panel, I mean Rocktech JH057N00900 here.

This is also the code that my patchset based on.

>And the display controller is st7701, so maybe we should
>actually name it sitronix,st770x.yaml if there are some
>sub-variants of st770x?
>
>> >properties:
>> >  compatible:
>> >items:
>> >  - const: xingbangda,xbd599
>> >  - const: ilitek,ili9342
>> >
>> >Possibly use oneOf and add support for the himax,hx8363
>> >already while you're at it.
>
>This should at least be:
>
>compatible:
>   items:
> - enum:
>   - xingbangda,xbd599
>   - himax,hx8363
>   - techstar,ts8550b
> - enum:
>   - sitronix,st7701
>   - sitronix,st7703
>
>So panel nodes using this panel become
>compatible = "xingbangda,sbd599", "sitronix,st7703"
>etc.
>
>This way it is straight-forward for drivers to identify the panel
>vendor and display controller.
>
>Yours,
>Linus Walleij
>
>___
>linux-arm-kernel mailing list
>linux-arm-ker...@lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
使用 K-9 Mail 发送自我的Android设备。

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/7BA1F742-0403-47E3-8E91-738947EB4809%40aosc.io.


[linux-sunxi] Re: [PATCH v2 3/5] drm: panel: add Xingbangda XBD599 panel

2020-03-20 Thread Linus Walleij
So following up on this:

We should state in the commit message that this driver is for all
displays using the Sitronix ST770x display controllers.
The driver should be named panel-sitronix-st770x.c.

On Thu, Mar 19, 2020 at 3:08 PM Linus Walleij  wrote:

> > +/* Manufacturer specific Commands send via DSI */
> > +#define ST7703_CMD_ALL_PIXEL_OFF 0x22
> > +#define ST7703_CMD_ALL_PIXEL_ON 0x23
> > +#define ST7703_CMD_SETDISP  0xB2
> > +#define ST7703_CMD_SETRGBIF 0xB3
> > +#define ST7703_CMD_SETCYC   0xB4
> > +#define ST7703_CMD_SETBGP   0xB5
> > +#define ST7703_CMD_SETVCOM  0xB6
> > +#define ST7703_CMD_SETOTP   0xB7
> > +#define ST7703_CMD_SETPOWER_EXT 0xB8
> > +#define ST7703_CMD_SETEXTC  0xB9
> > +#define ST7703_CMD_SETMIPI  0xBA
> > +#define ST7703_CMD_SETVDC   0xBC
> > +#define ST7703_CMD_SETSCR   0xC0
> > +#define ST7703_CMD_SETPOWER 0xC1
> > +#define ST7703_CMD_UNK_C6   0xC6
> > +#define ST7703_CMD_SETPANEL 0xCC
> > +#define ST7703_CMD_SETGAMMA 0xE0
> > +#define ST7703_CMD_SETEQ0xE3
> > +#define ST7703_CMD_SETGIP1  0xE9
> > +#define ST7703_CMD_SETGIP2  0xEA

I should have seen the ST7703 prefix shouldn't I...

> This actually looks very much like an Ilitek display controller.
> Some commands are clearly identical to Ilitek ILI9342:
> http://www.ampdisplay.com/documents/pdf/ILI9342_DS_V008_20100331.pdf

I'm still wondering about the apparent similarity between
ST770x and Ilitek ILI9342, haha :D

> 1. Try to determine what the actual display controller
>   is. I think it is some Ilitek.

OK so this is Sitronix ST770x.

> 2. Write a panel-ilitek-ili9342.c (if that is the actual controller)
>   and parameterize it for this display controller the same
>   way we do in e.g. panel-novatek-nt35510.c or
>   panel-ilitek-ili9322.c, so you use the compatible string
>   to set up the actual per-display settings for this display
>   controller.

This should be panel-sitronix-st770x.c

Yours,
Linus Walleij

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CACRpkdZnTf2jPrPV%2B%2B1HDk4tf2BK2NJnv5gkd-1Nc5KT3pu0NQ%40mail.gmail.com.


[linux-sunxi] Re: [PATCH v2 2/5] dt-bindings: panel: add binding for Xingbangda XBD599 panel

2020-03-20 Thread Linus Walleij
On Fri, Mar 20, 2020 at 9:07 AM Icenowy Zheng  wrote:
> 于 2020年3月19日 GMT+08:00 下午10:14:27, Linus Walleij  
> 写到:
> >On Mon, Mar 16, 2020 at 2:37 PM Icenowy Zheng  wrote:

> >As noticed in the review of the driver, this display is very close to
> >himax,hx8363.
> >
> >I think the best is to determin what actual display controller it is,
> >I think it is some kind of Ilitek controller since Ilitek ili9342 is
> >clearly very similar.
>
> It's Sitronix ST7703, same as the Librem 5 panel.

Heh, I wonder how it comes that it is so similar to Ilitek.
I guess I will never understand how the silicon ecosystem works
in asia (I did read a lot of Bunnie Huang's articles and hardware
hacking book to try to understand...)

This file should be named sitronix,st7703.yaml then.

According to the code in the Librem 5:
https://source.puri.sm/Librem5/linux-next/blob/imx8-current-librem5/drivers/gpu/drm/panel/panel-sitronix-st7701.c
The actual name of the display is Techstar ts8550b.
And the display controller is st7701, so maybe we should
actually name it sitronix,st770x.yaml if there are some
sub-variants of st770x?

> >properties:
> >  compatible:
> >items:
> >  - const: xingbangda,xbd599
> >  - const: ilitek,ili9342
> >
> >Possibly use oneOf and add support for the himax,hx8363
> >already while you're at it.

This should at least be:

compatible:
   items:
 - enum:
   - xingbangda,xbd599
   - himax,hx8363
   - techstar,ts8550b
 - enum:
   - sitronix,st7701
   - sitronix,st7703

So panel nodes using this panel become
compatible = "xingbangda,sbd599", "sitronix,st7703"
etc.

This way it is straight-forward for drivers to identify the panel
vendor and display controller.

Yours,
Linus Walleij

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CACRpkdbeLAyhhkx115zAV0tdC7KJ4T0UoQ2QeDwTVN%2Bbtxp%3DJw%40mail.gmail.com.


[linux-sunxi] Re: [PATCH v2 2/5] dt-bindings: panel: add binding for Xingbangda XBD599 panel

2020-03-20 Thread Icenowy Zheng



于 2020年3月19日 GMT+08:00 下午10:14:27, Linus Walleij  写到:
>Hi Icenowy,
>
>On Mon, Mar 16, 2020 at 2:37 PM Icenowy Zheng  wrote:
>
>> Xingbangda XBD599 is a 5.99" 720x1440 MIPI-DSI LCD panel.
>>
>> Add its device tree binding.
>>
>> Signed-off-by: Icenowy Zheng 
>(...)
>
>> +properties:
>> +  compatible:
>> +const: xingbangda,xbd599
>
>As noticed in the review of the driver, this display is very close to
>himax,hx8363.
>
>I think the best is to determin what actual display controller it is,
>I think it is some kind of Ilitek controller since Ilitek ili9342 is
>clearly very similar.

It's Sitronix ST7703, same as the Librem 5 panel.

>
>The best would be something like name the bindings
>ilitek-ili9342.yaml and then:
>
>properties:
>  compatible:
>items:
>  - const: xingbangda,xbd599
>  - const: ilitek,ili9342
>
>Possibly use oneOf and add support for the himax,hx8363
>already while you're at it.
>
>Yours,
>Linus Walleij
>
>___
>linux-arm-kernel mailing list
>linux-arm-ker...@lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
使用 K-9 Mail 发送自我的Android设备。

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/491ADD02-5511-404B-88A8-5725EF061EAC%40aosc.io.