Add support for Topwise A721 tablet
Subsystems (6)
cover Add support for Topwise A721 tablet
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.
Pascal Roeleven (2):
drm/panel: Add Starry KR070PE2T
ARM: dts: sun4i: Add support for Topwise A721 tablet
.../display/panel/starry,kr070pe2t.txt | 7 + arch/arm/boot/dts/Makefile | 3 +- arch/arm/boot/dts/sun4i-a10-topwise-a721.dts | 302 ++++++++++++++++++ drivers/gpu/drm/panel/panel-simple.c | 26 ++ 4 files changed, 337 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/display/panel/starry,kr070pe2t.txt create mode 100644 arch/arm/boot/dts/sun4i-a10-topwise-a721.dts
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 1/2 drm/panel: Add Starry KR070PE2T
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.
--- .../display/panel/starry,kr070pe2t.txt | 7 +++++ drivers/gpu/drm/panel/panel-simple.c | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/starry,kr070pe2t.txt
Documentation/devicetree/bindings/display/panel/starry,kr070pe2t.txt new file +7 -0
@@ -0,0 +1,7 @@ +Starry 7" (800x480 pixels) LCD panel + +Required properties: +- compatible: should be "starry,kr070pe2t" + +This binding is compatible with the simple-panel binding, which is specified +in simple-panel.txt in this directory.
drivers/gpu/drm/panel/panel-simple.c +26 -0
@@ -2842,6 +2842,29 @@ 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 = &starry_kr070pe2t_mode, + .num_modes =1 , + .bpc =8 , + .size = { + .width =152 , + .height =86 , + }, +}; +static const struct drm_display_mode starry_kr122ea0sra_mode = { .clock =147000 , .hdisplay =1920 ,
@@ -3474,6 +3497,9 @@ static const struct of_device_id platform_of_match[] = { }, { .compatible = "shelly,sca07010-bfn-lnn", .data = &shelly_sca07010_bfn_lnn, + }, { + .compatible = "starry,kr070pe2t", + .data = &starry_kr070pe2t, }, { .compatible = "starry,kr122ea0sra", .data = &starry_kr122ea0sra,
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 2/2 ARM: dts: sun4i: Add support for Topwise A721 tablet
In reply to Pascal RoelevenThe 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.
--- arch/arm/boot/dts/Makefile | 3 +- arch/arm/boot/dts/sun4i-a10-topwise-a721.dts | 302 +++++++++++++++++++ 2 files changed, 304 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/sun4i-a10-topwise-a721.dts
arch/arm/boot/dts/Makefile +2 -1
@@ -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 \
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +302 -0
302 lines not on this page · raw message
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [linux-sunxi] [PATCH 2/2] ARM: dts: sun4i: Add support for Topwise A721 tablet
Hello Pascal,
Quoted 62 lines · 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 <[email protected]>--- arch/arm/boot/dts/Makefile | 3 +- arch/arm/boot/dts/sun4i-a10-topwise-a721.dts | 302 +++++++++++++++++++ 2 files changed, 304 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/sun4i-a10-topwise-a721.dtsarch/arm/boot/dts/Makefile +2
-1@@ -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 \arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +31
-0@@ -0,0 +1,302 @@ +/* + * Copyright 2020 Pascal Roeleven <[email protected]> + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software.
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts line 41
Quoted 10 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +10
-0+ * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */
You should use SPDX license identifier instead of boilerplate license text.
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts line 54
Quoted 12 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +12
-0+/dts-v1/; +#include "sun4i-a10.dtsi" +#include "sunxi-common-regulators.dtsi" + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/pwm/pwm.h> + +/ { + model = "Topwise A721"; + compatible = "topwise,a721", "allwinner,sun4i-a10";
topwise is not in vendor-prefixes.yaml
Quoted 159 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +159
-0+ aliases { + serial0 = &uart0; + }; + + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 100000 PWM_POLARITY_INVERTED>; + power-supply = <®_vbat>; + enable-gpios = <&pio 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 = <&backlight>; + power-supply = <®_lcd_power>; + + port { + panel_input: endpoint { + remote-endpoint = <&tcon0_out_panel>; + }; + }; + }; + + reg_lcd_power: reg-lcd-power { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&lcd_power_pin>; + regulator-name = "reg-lcd-power"; + gpio = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */ + enable-active-high; + }; + + reg_vbat: reg-vbat { + compatible = "regulator-fixed"; + regulator-name = "vbat"; + regulator-min-microvolt = <3700000>; + regulator-max-microvolt = <3700000>; + }; + +}; + +&codec { + status = "okay"; +}; + +&cpu0 { + cpu-supply = <®_dcdc2>; +}; + +&de { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + + axp209: pmic@34 { + reg = <0x34>; + interrupts = <0>; + }; +}; + +#include "axp209.dtsi" + +&ac_power_supply { + status = "okay"; +}; + +&battery_power_supply { + status = "okay"; +}; + +&i2c1 { + status = "okay"; + + mma7660: accelerometer@4c { + compatible = "fsl,mma7660"; + reg = <0x4c>; + }; +}; + +&i2c2 { + status = "okay"; + + ft5406ee8: touchscreen@38 { + compatible = "edt,edt-ft5406"; + reg = <0x38>; + interrupt-parent = <&pio>; + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; + touchscreen-size-x = <800>; + touchscreen-size-y = <480>; + vcc-supply = <®_vcc3v3>; + }; +}; + +&lradc { + vref-supply = <®_ldo2>; + status = "okay"; + + button-vol-down { + label = "Volume Down"; + linux,code = <KEY_VOLUMEDOWN>; + channel = <0>; + voltage = <761904>; + }; + + button-vol-up { + label = "Volume Up"; + linux,code = <KEY_VOLUMEUP>; + channel = <0>; + voltage = <571428>; + }; +}; + +&mmc0 { + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH01 */ + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&otg_sram { + status = "okay"; +}; + +&pio { + vcc-pb-supply = <®_vcc3v3>; + vcc-pf-supply = <®_vcc3v3>; + vcc-ph-supply = <®_vcc3v3>; + + lcd_power_pin: lcd-power-pin { + pins = "PH8"; + function = "gpio_out"; + bias-pull-up; + }; + + usb0_id_detect_pin: usb0-id-detect-pin {
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts line 224
Quoted 10 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +10
-0+ pins = "PH4"; + function = "gpio_in"; + bias-pull-up; + }; + + usb0_vbus_detect_pin: usb0-vbus-detect-pin { + pins = "PH5"; + function = "gpio_in"; + bias-pull-down; + };
All 3 nodes above can be replaced with appropriate GPIO_PULL_UP / GPIO_PULL_DOWN macros inside the *-gpios property.
Quoted 13 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +13
-0+}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pin>; + status = "okay"; +}; + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1400000>; + regulator-name = "vdd-cpu";
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts line 247
Quoted 10 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +10
-0+}; + +®_dcdc3 { + regulator-always-on; + regulator-min-microvolt = <1250000>; + regulator-max-microvolt = <1250000>; + regulator-name = "vdd-int-dll"; +}; + +
You have extra space here ^
Quoted 38 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +38
-0+®_ldo1 { + regulator-name = "vdd-rtc"; +}; + +®_ldo2 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "avcc"; +}; + +®_usb0_vbus { + status = "okay"; +}; + +®_usb1_vbus { + status = "okay"; +}; + +®_usb2_vbus { + status = "okay"; +}; + +&tcon0_out { + tcon0_out_panel: endpoint@0 { + reg = <0>; + remote-endpoint = <&panel_input>; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pb_pins>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "otg";
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts line 295
Quoted 10 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +10
-0+ status = "okay"; +}; + +&usb_power_supply { + status = "okay"; +}; + +&usbphy { + pinctrl-names = "default"; + pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
No need to use pinctrl to configure regular GPIO functions anymore.
regards,
Ondrej
Quoted 14 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +7
-0+ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ + usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ + usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +};Signature · 6 lines
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 [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/20200310102725.14591-3-dev%40pascalroeleven.nl.
Re: [linux-sunxi] [PATCH 2/2] ARM: dts: sun4i: Add support for Topwise A721 tablet
In reply to Pascal RoelevenQuoted 13 lines · 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 <[email protected]>--- arch/arm/boot/dts/Makefile | 3 +- arch/arm/boot/dts/sun4i-a10-topwise-a721.dts | 302 +++++++++++++++++++ 2 files changed, 304 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/sun4i-a10-topwise-a721.dtsarch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +2
-0+/dts-v1/; +#include "sun4i-a10.dtsi"
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts line 54
Quoted 10 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +10
-0+#include "sunxi-common-regulators.dtsi" + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/pwm/pwm.h> + +/ { + model = "Topwise A721"; + compatible = "topwise,a721", "allwinner,sun4i-a10";
And you also need to add the compatible to:
Documentation/devicetree/bindings/arm/sunxi.yaml
regards,
o.
Re: [PATCH 1/2] drm/panel: Add Starry KR070PE2T
In reply to Pascal RoelevenHi Pascal.
Thanks for submitting.
Quoted 7 lines · 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.
Signed-off-by Pascal Roeleven <[email protected]>
A few things to improve.
The binding should be a separate patch.
subject - shall start with dt-bindings:
Shall be sent to deveicetree mailing list.
For panel we no longer accept .txt bindings. But the good news is that since the panel is simple, you only need to list your compatible in the file bindings/display/panel/panel-simple.yaml
- must be en alphabetical order
- vendor prefix must be present in vendor-prefixes
Quoted 29 lines
--- .../display/panel/starry,kr070pe2t.txt | 7 +++++ drivers/gpu/drm/panel/panel-simple.c | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/starry,kr070pe2t.txtDocumentation/devicetree/bindings/display/panel/starry,kr070pe2t.txt new file +7
-0@@ -0,0 +1,7 @@ +Starry 7" (800x480 pixels) LCD panel + +Required properties: +- compatible: should be "starry,kr070pe2t" + +This binding is compatible with the simple-panel binding, which is specified +in simple-panel.txt in this directory.drivers/gpu/drm/panel/panel-simple.c +2
-0@@ -2842,6 +2842,29 @@ 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 ,
drivers/gpu/drm/panel/panel-simple.c static const struct panel_desc shelly_sca07010_bfn_lnn = { · line 2856
Quoted 10 lines
drivers/gpu/drm/panel/panel-simple.c +10
-0+ .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, +};
Please adjust so:
vrefresh * htotal * vtotal == clock.
I cannot say what needs to be adjusted.
But we are moving away from specifying vrefresh and want the data to be OK.
drivers/gpu/drm/panel/panel-simple.c static const struct panel_desc shelly_sca07010_bfn_lnn = { · line 2866
Quoted 10 lines
drivers/gpu/drm/panel/panel-simple.c +10
-0+ +static const struct panel_desc starry_kr070pe2t = { + .modes = &starry_kr070pe2t_mode, + .num_modes =1 , + .bpc =8 , + .size = { + .width =152 , + .height =86 , + }, +};
For this part specifying the connector type is today mandatory. And please investigate if you can be more precise concerning bus_format, flags, etc.
See also what other panels do in the same file.
Sam
Quoted 16 lines
drivers/gpu/drm/panel/panel-simple.c +4
-0+static const struct drm_display_mode starry_kr122ea0sra_mode = { .clock =147000 , .hdisplay =1920 ,@@ -3474,6 +3497,9 @@ static const struct of_device_id platform_of_match[] = { }, { .compatible = "shelly,sca07010-bfn-lnn", .data = &shelly_sca07010_bfn_lnn, + }, { + .compatible = "starry,kr070pe2t", + .data = &starry_kr070pe2t, }, { .compatible = "starry,kr122ea0sra", .data = &starry_kr122ea0sra,Signature · 1 line
2.20.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/2] drm/panel: Add Starry KR070PE2T
Quoted 65 lines · Sam Ravnborg
Hi Pascal.
Thanks for submitting.
Quoted 7 lines · 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.
Signed-off-by Pascal Roeleven <[email protected]>A few things to improve.
The binding should be a separate patch.
subject - shall start with dt-bindings:
Shall be sent to deveicetree mailing list.For panel we no longer accept .txt bindings. But the good news is that since the panel is simple, you only need to list your compatible in the file
bindings/display/panel/panel-simple.yaml
- must be en alphabetical order
- vendor prefix must be present in vendor-prefixesQuoted 37 lines
--- .../display/panel/starry,kr070pe2t.txt | 7 +++++ drivers/gpu/drm/panel/panel-simple.c | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/starry,kr070pe2t.txtDocumentation/devicetree/bindings/display/panel/starry,kr070pe2t.txt new file +7
-0@@ -0,0 +1,7 @@ +Starry 7" (800x480 pixels) LCD panel + +Required properties: +- compatible: should be "starry,kr070pe2t" + +This binding is compatible with the simple-panel binding, which is specified +in simple-panel.txt in this directory.drivers/gpu/drm/panel/panel-simple.c +10
-0@@ -2842,6 +2842,29 @@ 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 ,
Quoted 8 lines
drivers/gpu/drm/panel/panel-simple.c static const struct panel_desc shelly_sca07010_bfn_lnn = { · line 2856
Quoted 2 lines
drivers/gpu/drm/panel/panel-simple.c +2
-0+ .vrefresh = 60, +};Please adjust so:
vrefresh * htotal * vtotal == clock.
I cannot say what needs to be adjusted.
But we are moving away from specifying vrefresh and want the data to be OK.
This one actually looks OK to me. Unless I typoed the numbers the timings give us a vrefresh of 59.58 which gets rounded to 60. So no change once .vrefresh disappears AFAICS.
Signature · 2 lines
Ville Syrjälä Intel
Re: [linux-sunxi] [PATCH 2/2] ARM: dts: sun4i: Add support for Topwise A721 tablet
In reply to Ondřej JirmanQuoted 362 lines · Ondřej Jirman
Hello Pascal,
Quoted 70 lines · 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 <[email protected]>--- arch/arm/boot/dts/Makefile | 3 +- arch/arm/boot/dts/sun4i-a10-topwise-a721.dts | 302 +++++++++++++++++++ 2 files changed, 304 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/sun4i-a10-topwise-a721.dtsarch/arm/boot/dts/Makefile +2
-1@@ -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 \arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +11
-0@@ -0,0 +1,302 @@ +/* + * Copyright 2020 Pascal Roeleven <[email protected]> + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 ofthe
+ * License, or (at your option) any later version.
+ *+ * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details.+ *
+ * Or, alternatively,
+ *
+ * b) Permission is hereby granted, free of charge, to any person+ * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions:+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the
Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIESQuoted 7 lines
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE.+ */
You should use SPDX license identifier instead of boilerplate license text.
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts line 54
Quoted 12 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +12
-0+/dts-v1/; +#include "sun4i-a10.dtsi" +#include "sunxi-common-regulators.dtsi" + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/pwm/pwm.h> + +/ { + model = "Topwise A721"; + compatible = "topwise,a721", "allwinner,sun4i-a10";topwise is not in
vendor-prefixes.yamlQuoted 159 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +159
-0+ aliases { + serial0 = &uart0; + }; + + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 100000 PWM_POLARITY_INVERTED>; + power-supply = <®_vbat>; + enable-gpios = <&pio 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 = <&backlight>; + power-supply = <®_lcd_power>; + + port { + panel_input: endpoint { + remote-endpoint = <&tcon0_out_panel>; + }; + }; + }; + + reg_lcd_power: reg-lcd-power { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&lcd_power_pin>; + regulator-name = "reg-lcd-power"; + gpio = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */ + enable-active-high; + }; + + reg_vbat: reg-vbat { + compatible = "regulator-fixed"; + regulator-name = "vbat"; + regulator-min-microvolt = <3700000>; + regulator-max-microvolt = <3700000>; + }; + +}; + +&codec { + status = "okay"; +}; + +&cpu0 { + cpu-supply = <®_dcdc2>; +}; + +&de { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + + axp209: pmic@34 { + reg = <0x34>; + interrupts = <0>; + }; +}; + +#include "axp209.dtsi" + +&ac_power_supply { + status = "okay"; +}; + +&battery_power_supply { + status = "okay"; +}; + +&i2c1 { + status = "okay"; + + mma7660: accelerometer@4c { + compatible = "fsl,mma7660"; + reg = <0x4c>; + }; +}; + +&i2c2 { + status = "okay"; + + ft5406ee8: touchscreen@38 { + compatible = "edt,edt-ft5406"; + reg = <0x38>; + interrupt-parent = <&pio>; + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; + touchscreen-size-x = <800>; + touchscreen-size-y = <480>; + vcc-supply = <®_vcc3v3>; + }; +}; + +&lradc { + vref-supply = <®_ldo2>; + status = "okay"; + + button-vol-down { + label = "Volume Down"; + linux,code = <KEY_VOLUMEDOWN>; + channel = <0>; + voltage = <761904>; + }; + + button-vol-up { + label = "Volume Up"; + linux,code = <KEY_VOLUMEUP>; + channel = <0>; + voltage = <571428>; + }; +}; + +&mmc0 { + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH01 */ + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&otg_sram { + status = "okay"; +}; + +&pio { + vcc-pb-supply = <®_vcc3v3>; + vcc-pf-supply = <®_vcc3v3>; + vcc-ph-supply = <®_vcc3v3>; + + lcd_power_pin: lcd-power-pin { + pins = "PH8"; + function = "gpio_out"; + bias-pull-up; + }; + + usb0_id_detect_pin: usb0-id-detect-pin {arch/arm/boot/dts/sun4i-a10-topwise-a721.dts line 224
Quoted 10 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +10
-0+ pins = "PH4"; + function = "gpio_in"; + bias-pull-up; + }; + + usb0_vbus_detect_pin: usb0-vbus-detect-pin { + pins = "PH5"; + function = "gpio_in"; + bias-pull-down; + };All 3 nodes above can be replaced with appropriate
GPIO_PULL_UP/GPIO_PULL_DOWNmacros inside the *-gpios property.Quoted 13 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +13
-0+}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pin>; + status = "okay"; +}; + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1400000>; + regulator-name = "vdd-cpu";arch/arm/boot/dts/sun4i-a10-topwise-a721.dts line 247
Quoted 10 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +10
-0+}; + +®_dcdc3 { + regulator-always-on; + regulator-min-microvolt = <1250000>; + regulator-max-microvolt = <1250000>; + regulator-name = "vdd-int-dll"; +}; + +You have extra space here ^
Quoted 38 lines
+®_ldo1 {
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +37
-0+ regulator-name = "vdd-rtc"; +}; + +®_ldo2 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "avcc"; +}; + +®_usb0_vbus { + status = "okay"; +}; + +®_usb1_vbus { + status = "okay"; +}; + +®_usb2_vbus { + status = "okay"; +}; + +&tcon0_out { + tcon0_out_panel: endpoint@0 { + reg = <0>; + remote-endpoint = <&panel_input>; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pb_pins>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "otg";arch/arm/boot/dts/sun4i-a10-topwise-a721.dts line 295
Quoted 10 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +10
-0+ status = "okay"; +}; + +&usb_power_supply { + status = "okay"; +}; + +&usbphy { + pinctrl-names = "default"; + pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;No need to use pinctrl to configure regular GPIO functions anymore.
regards,
OndrejQuoted 10 lines
arch/arm/boot/dts/sun4i-a10-topwise-a721.dts new file +7
-1+ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ + usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ + usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +}; --2.20.1
Quoted 4 lines
Quoted 4 lines
--
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 [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/20200310102725.14591-3-dev%40pascalroeleven.nl.
Hi Ondrej,
Thank you for your review. I will be fixing these in v2.
Re: [PATCH 1/2] drm/panel: Add Starry KR070PE2T
In reply to Sam RavnborgQuoted 5 lines · Sam Ravnborg
A few things to improve.
The binding should be a separate patch.
subject - shall start with dt-bindings:
Shall be sent to deveicetree mailing list.
Hi Sam,
Thank you very much for your review.
I did consider this. The reason I combined the patches, is that the binding depends on the display so I thought they were related in some way. Didn't know the correct procedure to handle this. I will split them apart in v2.
Quoted 42 lines
Quoted 42 lines
--- .../display/panel/starry,kr070pe2t.txt | 7 +++++ drivers/gpu/drm/panel/panel-simple.c | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644
Documentation/devicetree/bindings/display/panel/starry,kr070pe2t.txt(quoted diff) +0
-0
b/Documentation/devicetree/bindings/display/panel/starry,kr070pe2t.txtDocumentation/devicetree/bindings/display/panel/starry,kr070pe2t.txt new file +6
-0@@ -0,0 +1,7 @@ +Starry 7" (800x480 pixels) LCD panel + +Required properties: +- compatible: should be "starry,kr070pe2t" + +This binding is compatible with the simple-panel binding, which isspecified
Documentation/devicetree/bindings/display/panel/starry,kr070pe2t.txt new file +1
-0+in simple-panel.txt in this directory.drivers/gpu/drm/panel/panel-simple.c +10
-0@@ -2842,6 +2842,29 @@ 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 ,
Quoted 8 lines
drivers/gpu/drm/panel/panel-simple.c static const struct panel_desc · line 2857
Quoted 2 lines
drivers/gpu/drm/panel/panel-simple.c +2
-0+ .vrefresh = 60, +};Please adjust so:
vrefresh * htotal * vtotal == clock.
I cannot say what needs to be adjusted.
But we are moving away from specifying vrefresh and want the data to be OK.
Just like Ville Syrjälä, I ran the numbers and vrefresh indeed calculates to 59.58.
Rob Herring
maintainerRe: [PATCH 1/2] drm/panel: Add Starry KR070PE2T
Quoted 7 lines · Pascal Roeleven
Quoted 5 lines · Sam Ravnborg
A few things to improve.
The binding should be a separate patch.
subject - shall start with dt-bindings:
Shall be sent to deveicetree mailing list.
Quoted 6 lines
Hi Sam,
Thank you very much for your review.
I did consider this. The reason I combined the patches, is that the binding depends on the display so I thought they were related in some way. Didn't know the correct procedure to handle this. I will split them apart in v2.
FYI, checkpatch.pl will tell you both bindings should be a separate patch and that they should be in DT schema format.
Rob
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel