From caa3f7193f88d621abc1d99f98c1135807fcecd8 Mon Sep 17 00:00:00 2001 From: JuniorJPDJ Date: Wed, 24 Mar 2021 20:56:05 +0100 Subject: [PATCH] main/linux-postmarketos-allwinner: add goclever-gcta741l device tree and LCD panel (MR 2040) also enables Freescale MMA7660 accelerometer driver --- ...nel-simple-Add-Hannstar-TQTM070CB501.patch | 57 ++++++++ ...-sun6i-Add-GoClever-Orion-70L-tablet.patch | 135 ++++++++++++++++++ main/linux-postmarketos-allwinner/APKBUILD | 9 +- .../config-postmarketos-allwinner.armv7 | 2 +- 4 files changed, 199 insertions(+), 4 deletions(-) create mode 100644 main/linux-postmarketos-allwinner/0013-drm-panel-simple-Add-Hannstar-TQTM070CB501.patch create mode 100644 main/linux-postmarketos-allwinner/0014-ARM-dts-sun6i-Add-GoClever-Orion-70L-tablet.patch diff --git a/main/linux-postmarketos-allwinner/0013-drm-panel-simple-Add-Hannstar-TQTM070CB501.patch b/main/linux-postmarketos-allwinner/0013-drm-panel-simple-Add-Hannstar-TQTM070CB501.patch new file mode 100644 index 000000000..90eaf31fb --- /dev/null +++ b/main/linux-postmarketos-allwinner/0013-drm-panel-simple-Add-Hannstar-TQTM070CB501.patch @@ -0,0 +1,57 @@ +From 2423e7790f9188be019ed8d40511c5a0f9faa36f Mon Sep 17 00:00:00 2001 +From: JuniorJPDJ +Date: Tue, 23 Mar 2021 12:27:30 +0100 +Subject: [PATCH] drm: panel: simple: Add Hannstar TQTM070CB501 + +--- + drivers/gpu/drm/panel/panel-simple.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c +index 41bbec72b2da..e1cc84359fff 100644 +--- a/drivers/gpu/drm/panel/panel-simple.c ++++ b/drivers/gpu/drm/panel/panel-simple.c +@@ -2045,6 +2045,30 @@ static const struct panel_desc hannstar_hsd100pxn1 = { + .connector_type = DRM_MODE_CONNECTOR_LVDS, + }; + ++static const struct drm_display_mode hannstar_tqtm070cb501_mode = { ++ .clock = 33000, ++ .hdisplay = 800, ++ .hsync_start = 800 + 240, ++ .hsync_end = 800 + 240 + 30, ++ .htotal = 800 + 240 + 30 + 14, // -14 ++ .vdisplay = 480, ++ .vsync_start = 480 + 35, ++ .vsync_end = 480 + 35 + 13, ++ .vtotal = 480 + 35 + 13 + 3, // -3 ++}; ++ ++static const struct panel_desc hannstar_tqtm070cb501 = { ++ .modes = &hannstar_tqtm070cb501_mode, ++ .num_modes = 1, ++ .bpc = 6, ++ .size = { ++ .width = 164, ++ .height = 104, ++ }, ++ .bus_format = MEDIA_BUS_FMT_RGB666_1X18, ++ .connector_type = DRM_MODE_CONNECTOR_DPI, ++}; ++ + static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = { + .clock = 33333, + .hdisplay = 800, +@@ -4126,6 +4150,9 @@ static const struct of_device_id platform_of_match[] = { + }, { + .compatible = "hit,tx23d38vm0caa", + .data = &hitachi_tx23d38vm0caa ++ }, { ++ .compatible = "hannstar,tqtm070cb501", ++ .data = &hannstar_tqtm070cb501, + }, { + .compatible = "innolux,at043tn24", + .data = &innolux_at043tn24, +-- +2.31.0 + diff --git a/main/linux-postmarketos-allwinner/0014-ARM-dts-sun6i-Add-GoClever-Orion-70L-tablet.patch b/main/linux-postmarketos-allwinner/0014-ARM-dts-sun6i-Add-GoClever-Orion-70L-tablet.patch new file mode 100644 index 000000000..ecd1d634f --- /dev/null +++ b/main/linux-postmarketos-allwinner/0014-ARM-dts-sun6i-Add-GoClever-Orion-70L-tablet.patch @@ -0,0 +1,135 @@ +From cbc71a472a6131530bdedda06efadb660c80dc24 Mon Sep 17 00:00:00 2001 +From: JuniorJPDJ +Date: Tue, 23 Mar 2021 12:29:37 +0100 +Subject: [PATCH] ARM: dts: sun6i: Add GoClever Orion 70L tablet + +--- + arch/arm/boot/dts/Makefile | 1 + + .../boot/dts/sun6i-a31s-goclever-gcta741l.dts | 103 ++++++++++++++++++ + 2 files changed, 104 insertions(+) + create mode 100644 arch/arm/boot/dts/sun6i-a31s-goclever-gcta741l.dts + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index eb25d2dbbfa7..c402f2f7e2a1 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -1134,6 +1134,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \ + sun6i-a31-mele-a1000g-quad.dtb \ + sun6i-a31s-colorfly-e708-q1.dtb \ + sun6i-a31s-cs908.dtb \ ++ sun6i-a31s-goclever-gcta741l.dtb \ + sun6i-a31s-inet-q972.dtb \ + sun6i-a31s-primo81.dtb \ + sun6i-a31s-sina31s.dtb \ +diff --git a/arch/arm/boot/dts/sun6i-a31s-goclever-gcta741l.dts b/arch/arm/boot/dts/sun6i-a31s-goclever-gcta741l.dts +new file mode 100644 +index 000000000000..7fb95aef4c74 +--- /dev/null ++++ b/arch/arm/boot/dts/sun6i-a31s-goclever-gcta741l.dts +@@ -0,0 +1,103 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR X11) ++// Copyright 2021 Jacek Pruciak ++ ++/dts-v1/; ++#include "sun6i-a31s.dtsi" ++#include "sun6i-reference-design-tablet.dtsi" ++//#include ++ ++/ { ++ model = "GoClever Orion 70L"; ++ compatible = "goclever,gcta741l", "allwinner,sun6i-a31s"; ++ ++ panel { ++ compatible = "hannstar,tqtm070cb501"; ++ power-supply = <®_dc1sw>; ++ //backlight = <&backlight>; ++ ++ port { ++ panel_input: endpoint { ++ remote-endpoint = <&tcon0_out_lcd>; ++ }; ++ }; ++ }; ++ ++ // PWM not supported by sun6i at the moment ++ //backlight { ++ // compatible = "pwm-backlight"; ++ // pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; ++ // brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; ++ // default-brightness-level = <8>; ++ // enable-gpios = <&pio 0 25 GPIO_ACTIVE_HIGH>; /* PA25 */ ++ //}; ++}; ++ ++&usb_otg { ++ dr_mode = "otg"; ++}; ++ ++&battery_power_supply { ++ status = "okay"; ++}; ++ ++&lradc { ++ vref-supply = <®_aldo3>; ++ status = "okay"; ++ ++ button-1000 { ++ label = "Home"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <1000000>; ++ }; ++}; ++ ++&i2c2 { ++ status = "okay"; ++ ++ accelerometer@4c { ++ compatible = "fsl,mma7660"; ++ reg = <0x4c>; ++ interrupt-parent = <&pio>; ++ interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>; /* PA9 */ ++ ++ mount-matrix = "0", "1", "0", ++ "1", "0", "0", ++ "0", "0", "1"; ++ }; ++}; ++ ++&tcon0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&lcd0_rgb888_pins>; ++ status = "okay"; ++}; ++ ++&tcon0_out { ++ tcon0_out_lcd: endpoint@0 { ++ reg = <0>; ++ remote-endpoint = <&panel_input>; ++ }; ++}; ++ ++&de { ++ status = "okay"; ++}; ++ ++&simplefb_lcd { ++ status = "okay"; ++}; ++ ++&codec { ++ // This still doesn't work ++ allwinner,audio-routing = ++ /* sink, source */ ++ "Headphone", "HP", ++ "Speaker", "LINEOUT", ++ "MIC1", "Mic", ++ "MIC2", "Headset Mic", ++ "Mic", "MBIAS", ++ "Headset Mic", "HBIAS"; ++ allwinner,pa-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ ++ status = "okay"; ++}; +-- +2.31.0 + diff --git a/main/linux-postmarketos-allwinner/APKBUILD b/main/linux-postmarketos-allwinner/APKBUILD index eace047dc..88dfa72e5 100644 --- a/main/linux-postmarketos-allwinner/APKBUILD +++ b/main/linux-postmarketos-allwinner/APKBUILD @@ -43,7 +43,8 @@ source="$pkgname-$_tag.tar.gz::https://github.com/megous/linux/archive/$_tag.tar 0010-dts-pinephone-drop-modem-power-node.patch 0011-dts-pinephone-jack-detection.patch 0012-pinephone-fix-pogopin-i2c.patch - 0013-WoWLAN-support-for-the-PinePhone.patch + 0013-drm-panel-simple-Add-Hannstar-TQTM070CB501.patch + 0014-ARM-dts-sun6i-Add-GoClever-Orion-70L-tablet.patch " subpackages="$pkgname-dev" builddir="$srcdir/linux-$_tag" @@ -92,7 +93,7 @@ dev() { sha512sums="a57b8c168403c33ead5a1c963f60dc56add6233fa79496d8b97459c3003396708477b2f7888c9845e7a140d79397c7fc1ac726da2ca2104ca717207e387a28da linux-postmarketos-allwinner-orange-pi-5.11-20210325-1125.tar.gz 2b632c867004f4f6bfa93cf7e2f0b04f63c8aabec2e6d1893e50f975f5c64d8301479080d950ada6e5e3f83ab08dfae644bdb98a20038ec672af92777d6ded96 config-postmarketos-allwinner.aarch64 -bd77f07781413a869575d4b0bed95840a89f139f513f6e91d5489156941ad34821441e5a89f7fff51b3e9750d9a1a726aafb7c83e66eccc7ceb33f11b8185574 config-postmarketos-allwinner.armv7 +82e63c732b2172f22875e4a78861bb62d2b69dda5d13a2003a922ea4274ec05a4fc4f5a6aa56b0e56abb33445f7ee09ebb9c8d077089ec1848a38be315a28d5c config-postmarketos-allwinner.armv7 b174532e356dcb2144c2629c1747dcb0026a40aa8e4deca5bde67344d271e519ff90f6fa287633b1dec857855331e4aa1d1bd5fd0d73044309f98e8d829e2be0 0001-dts-add-dontbeevil-pinephone-devkit.patch 898e5e6dbdfa5b2f2154818bf006f2ae4d162a246c58dab5c43534e7630a35faf48ba74f6d2493d7500ad956a0e71c0b85ca9d7a51044c21d7d87b6f27b055f5 0002-dts-add-pinetab-dev-old-display-panel.patch 55f8bc826d7958d8fd16c59663746529be80daacdca9425e5678ee175bf0b93e4c1e0d2b5878ee58b488dde7eb7a05e438ec16c97c4298d3f272957a5caf183d 0003-dts-pinetab-add-missing-bma223-ohci1.patch @@ -104,4 +105,6 @@ e8eca7814daf76ebe658bdf988a062c4ed433cee5fde522b8d64492267716a5e7ae91b55877253cc 95335f5755f8385c824cc8fb55af8b11ab02196ea6f49a80fe1ed964c0287fd6e41b597d50de615308e2cd53e0b0a471d452ea3ff8503caccfc17561c393c7f2 0009-dts-pinephone-Add-pine64-pinephone-to-compat-list.patch e9cfb545c216c061da243b0eeb2169ff11e80898270a87f432cec937057d585313109d4ae9487a6641eeb5de1b0be69b7615bfca99fb64ab7227d941e6f129c1 0010-dts-pinephone-drop-modem-power-node.patch 789ae2e405f00e897c357427c587cb7a4a3d3a68b77b9700fb6f6a67d92314fcf75f2ad8b65c0d046215bb7bd5fcf65e4e8e31748170ed595bef1ba3010dd0bf 0011-dts-pinephone-jack-detection.patch -611bab79b36ee3a9ff8504fa5c56964a0ff1bcd65eacc692d8d991a9bc300e2b16c6d69f4bcad3a35315e848653c2969a985446c385081f019d3e4e74521f42c 0012-pinephone-fix-pogopin-i2c.patch" +611bab79b36ee3a9ff8504fa5c56964a0ff1bcd65eacc692d8d991a9bc300e2b16c6d69f4bcad3a35315e848653c2969a985446c385081f019d3e4e74521f42c 0012-pinephone-fix-pogopin-i2c.patch +59f3da8cf071b2a26121dc4d84c3500e75a2d811067f514e7766fcacbef4ad469f7b89fe181098ae4f23eb39e0b60e1a071db58628c6b64b3e5e475504b2fd81 0013-drm-panel-simple-Add-Hannstar-TQTM070CB501.patch +cccc8e833cd2cd94a6dd79a287c81e4f5d8ad41876bc695afb44f241cdb609696466381adc135535e4db78a742c05181f2e29b6e750850f02241cac442dcdcd6 0014-ARM-dts-sun6i-Add-GoClever-Orion-70L-tablet.patch" diff --git a/main/linux-postmarketos-allwinner/config-postmarketos-allwinner.armv7 b/main/linux-postmarketos-allwinner/config-postmarketos-allwinner.armv7 index 1bd39731f..40cfee9ad 100644 --- a/main/linux-postmarketos-allwinner/config-postmarketos-allwinner.armv7 +++ b/main/linux-postmarketos-allwinner/config-postmarketos-allwinner.armv7 @@ -3880,7 +3880,7 @@ CONFIG_IIO=y # CONFIG_MC3230 is not set # CONFIG_MMA7455_I2C is not set # CONFIG_MMA7455_SPI is not set -# CONFIG_MMA7660 is not set +CONFIG_MMA7660=m # CONFIG_MMA8452 is not set # CONFIG_MMA9551 is not set # CONFIG_MMA9553 is not set