Adding custom panel driver for XU10 panel. Cleaning up the device tree, and fixing battery display status info. Adding game controller for XU10 into the gamecontrollerdb
This commit is contained in:
parent
602e95f2ab
commit
89de54c46b
3 changed files with 193 additions and 106 deletions
|
@ -6,3 +6,4 @@
|
|||
1900c3ea010000000100000001010000,odroidgo3_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b12,start:b13,dpleft:b10,dpdown:b9,dpright:b11,dpup:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b15,rightstick:b16,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
19009b4d4b4800000111000000020000,retrogame_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
19009b4d4b4800000111000000010000,retrogame_joypad,platform:Linux,x:b2,a:b1,b:b0,y:b3,back:b8,start:b9,dpleft:b15,dpdown:b14,dpright:b16,dpup:b13,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b11,rightstick:b12,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
19008ae5010000000100000001010000,xu10_joypad,platform:Linux,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:b14,dpdown:b13,dpright:b15,dpup:b12,leftshoulder:b4,lefttrigger:b7,rightshoulder:b5,righttrigger:b6,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,
|
||||
|
|
|
@ -282,10 +282,9 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351v.dts li
|
|||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts linux/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts
|
||||
--- linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts 2024-01-17 04:00:24.264874140 +0000
|
||||
@@ -0,0 +1,837 @@
|
||||
--- linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ linux/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts 2024-01-17 10:47:39.797402000 -0500
|
||||
@@ -0,0 +1,830 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
+/*
|
||||
+ * Copyright (c) 2019 Hardkernel Co., Ltd
|
||||
|
@ -303,7 +302,7 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts linux/
|
|||
+/ {
|
||||
+ model = "MagicX XU10";
|
||||
+ compatible = "magicx,xu10", "rockchip,rk3326";
|
||||
+
|
||||
+
|
||||
+ chosen {
|
||||
+ bootargs = "earlycon=uart8250,mmio32,0xff160000 swiotlb=1 console=ttyFIQ0 rw root=PARTUUID=614e0000-0000 rootwait";
|
||||
+ };
|
||||
|
@ -364,114 +363,108 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts linux/
|
|||
+ joypad: xu10-joypad {
|
||||
+ compatible = "xu10-joypad";
|
||||
+ status = "okay";
|
||||
+ /*
|
||||
+ - xu10-joypad sysfs list -
|
||||
+ /*
|
||||
+ - xu10-joypad sysfs list -
|
||||
+ * for poll device interval(ms)
|
||||
+ /sys/devices/platform/odroidgo3_joypad/poll_interval [rw]
|
||||
+ ex) echo 20 > poll_interval
|
||||
+ * for button-adc-fuzz
|
||||
+ ex) echo 20 > poll_interval
|
||||
+ * for button-adc-fuzz
|
||||
+ /sys/devices/platform/odroidgo3_joypad/adc_fuzz [r]
|
||||
+ * for button-adc-flat
|
||||
+ * for button-adc-flat
|
||||
+ /sys/devices/platform/odroidgo3_joypad/adc_flat [r]
|
||||
+
|
||||
+ * for report control(1:enable, 0:disable)
|
||||
+ /sys/devices/platform/odroidgo3_joypad/enable [rw]
|
||||
+ * for adc calibration value setup(current adcs value -> cal value)
|
||||
+ /sys/devices/platform/odroidgo3_joypad/adc_cal [rw]
|
||||
+ ex) echo 0 > adc_cal
|
||||
+ ex) echo 0 > adc_cal
|
||||
+ * for amux data debug
|
||||
+ * Joypad driver is disabled when using this sysfs.
|
||||
+ /sys/devices/platform/odroidgo3_joypad/amux_debug [rw]
|
||||
+ ex) echo 0 > amux_debug --> select amux channel
|
||||
+ ex) cat amux_debug --> get adc data of seleted channel
|
||||
+ */
|
||||
+ ex) echo 0 > amux_debug --> select amux channel
|
||||
+ ex) cat amux_debug --> get adc data of seleted channel
|
||||
+ */
|
||||
+
|
||||
+ /* gpio pincontrol setup */
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&btn_pins>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&btn_pins>;
|
||||
+
|
||||
+ /* Analog mux define */
|
||||
+ io-channel-names = "joy_left", "joy_right";
|
||||
+ io-channels = <&saradc 1>, <&saradc 2>;
|
||||
+ io-channel-names = "joy_left", "joy_right";
|
||||
+ io-channels = <&saradc 1>, <&saradc 2>;
|
||||
+
|
||||
+ /* adc mux channel count */
|
||||
+ amux-count = <4>;
|
||||
+ amux-count = <4>;
|
||||
+
|
||||
+ /* adc mux select(a,b) gpio */
|
||||
+ amux-a-gpios = <&gpio2 RK_PB3 GPIO_ACTIVE_LOW>;
|
||||
+ amux-b-gpios = <&gpio2 RK_PB5 GPIO_ACTIVE_LOW>;
|
||||
+ amux-a-gpios = <&gpio2 RK_PB3 GPIO_ACTIVE_LOW>;
|
||||
+ amux-b-gpios = <&gpio2 RK_PB5 GPIO_ACTIVE_LOW>;
|
||||
+
|
||||
+ /* adc mux enable gpio */
|
||||
+ amux-en-gpios = <&gpio1 RK_PB0 GPIO_ACTIVE_LOW>;
|
||||
+ amux-en-gpios = <&gpio1 RK_PB0 GPIO_ACTIVE_LOW>;
|
||||
+
|
||||
+ /* adc calculate scale */
|
||||
+ button-adc-scale = <2>;
|
||||
+ button-adc-scale = <2>;
|
||||
+
|
||||
+ /* adc deadzone range */
|
||||
+ button-adc-deadzone = <180>;
|
||||
+ button-adc-deadzone = <180>;
|
||||
+
|
||||
+ /*
|
||||
+ specifies fuzz value that is used to filter noise from
|
||||
+ the event stream.
|
||||
+ */
|
||||
+ button-adc-fuzz = <32>;
|
||||
+ button-adc-flat = <32>;
|
||||
+ button-x-default-cal = <1822>;
|
||||
+ button-y-default-cal = <1800>;
|
||||
+ button-z-default-cal = <1822>;
|
||||
+ button-rz-default-cal = <1800>;
|
||||
+ button-adc-fuzz = <32>;
|
||||
+ button-adc-flat = <32>;
|
||||
+
|
||||
+ /*
|
||||
+ Analog Stick data tuning value(precent)
|
||||
+ p = positive direction, n = negative direction
|
||||
+ report value = (real_adc_data * tuning_value) / 100
|
||||
+ */
|
||||
+ abs_x-p-tuning = <200>;
|
||||
+ abs_x-n-tuning = <200>;
|
||||
+ abs_x-p-tuning = <200>;
|
||||
+ abs_x-n-tuning = <200>;
|
||||
+
|
||||
+ abs_y-p-tuning = <200>;
|
||||
+ abs_y-n-tuning = <200>;
|
||||
+ abs_y-p-tuning = <200>;
|
||||
+ abs_y-n-tuning = <200>;
|
||||
+
|
||||
+ abs_rx-p-tuning = <200>;
|
||||
+ abs_rx-n-tuning = <200>;
|
||||
+ abs_rx-p-tuning = <200>;
|
||||
+ abs_rx-n-tuning = <200>;
|
||||
+
|
||||
+ abs_ry-p-tuning = <200>;
|
||||
+ abs_ry-n-tuning = <200>;
|
||||
+ abs_ry-p-tuning = <200>;
|
||||
+ abs_ry-n-tuning = <200>;
|
||||
+
|
||||
+ /* poll device interval (ms), adc read interval */
|
||||
+ poll-interval = <10>;
|
||||
+ btn-lr-to-absx;
|
||||
+ btn-ud-to-absy;
|
||||
+ invert-absx;
|
||||
+ invert-absy;
|
||||
+ invert-absz;
|
||||
+ invert-absrz;
|
||||
+ poll-interval = <10>;
|
||||
+ btn-lr-to-absx;
|
||||
+ btn-ud-to-absy;
|
||||
+
|
||||
+ /* gpio button auto repeat set value : default disable */
|
||||
+ /*
|
||||
+ autorepeat;
|
||||
+ autorepeat;
|
||||
+ */
|
||||
+
|
||||
+ /*
|
||||
+ *** MagicX XU10 - layoout ***
|
||||
+ |-------------------------------|
|
||||
+ | sw14 sw17 sw16 sw15 |
|
||||
+ |-----|-------------------|-----|
|
||||
+ | | | |
|
||||
+ |vol+ | | sw13|
|
||||
+ |vol- | | |
|
||||
+ | | LCD Display | |
|
||||
+ | | | |
|
||||
+ | | | |
|
||||
+ | |-------------------| |
|
||||
+ | sw9 sw10 |
|
||||
+ | |
|
||||
+ | sw1 sw7 |
|
||||
+ | sw3 sw4 sw8 sw6 |
|
||||
+ | sw2 sw5 |
|
||||
+ | |
|
||||
+ | sw11 sw12 |
|
||||
+ | |
|
||||
+ |-------|---------------|-------|
|
||||
+ */
|
||||
+ /*
|
||||
+ *** MagicX XU10 - layoout ***
|
||||
+ |-------------------------------|
|
||||
+ | sw14 sw17 sw16 sw15 |
|
||||
+ |-----|-------------------|-----|
|
||||
+ | | | |
|
||||
+ |vol+ | | sw13|
|
||||
+ |vol- | | |
|
||||
+ | | LCD Display | |
|
||||
+ | | | |
|
||||
+ | | | |
|
||||
+ | |-------------------| |
|
||||
+ | sw9 sw10 |
|
||||
+ | |
|
||||
+ | sw1 sw7 |
|
||||
+ | sw3 sw4 sw8 sw6 |
|
||||
+ | sw2 sw5 |
|
||||
+ | |
|
||||
+ | sw11 sw12 |
|
||||
+ | |
|
||||
+ |-------|---------------|-------|
|
||||
+ */
|
||||
+
|
||||
+ /*
|
||||
+ joypad driver is poll-device driver.
|
||||
|
@ -565,6 +558,26 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts linux/
|
|||
+ };
|
||||
+ };
|
||||
+
|
||||
+ battery: battery {
|
||||
+ compatible = "simple-battery";
|
||||
+ charge-full-design-microamp-hours = <3000000>;
|
||||
+ charge-term-current-microamp = <300000>;
|
||||
+ constant-charge-current-max-microamp = <2000000>;
|
||||
+ constant-charge-voltage-max-microvolt = <4200000>;
|
||||
+ factory-internal-resistance-micro-ohms = <134000>;
|
||||
+ voltage-max-design-microvolt = <4100000>;
|
||||
+ voltage-min-design-microvolt = <3500000>;
|
||||
+
|
||||
+ ocv-capacity-celsius = <20>;
|
||||
+ ocv-capacity-table-0 =
|
||||
+ <4046950 100>, <4001920 95>, <3967900 90>, <3919950 85>,
|
||||
+ <3888450 80>, <3861850 75>, <3831540 70>, <3799130 65>,
|
||||
+ <3768190 60>, <3745650 55>, <3726610 50>, <3711630 45>,
|
||||
+ <3696720 40>, <3685660 35>, <3674950 30>, <3663050 25>,
|
||||
+ <3649470 20>, <3635260 15>, <3616920 10>, <3592440 5>,
|
||||
+ <3574170 0>;
|
||||
+ };
|
||||
+
|
||||
+ gpio-keys-vol {
|
||||
+ compatible = "gpio-keys";
|
||||
+ autorepeat;
|
||||
|
@ -697,6 +710,9 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts linux/
|
|||
+ };
|
||||
+
|
||||
+ internal_display: panel@0 {
|
||||
+ compatible = "magicx,xu10-panel", "sitronix,st7703";
|
||||
+ iovcc-supply = <&vcc_lcd>;
|
||||
+ vdd-supply = <&vcc_lcd>;
|
||||
+ reg = <0>;
|
||||
+ backlight = <&backlight>;
|
||||
+ reset-gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>;
|
||||
|
@ -914,27 +930,9 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts linux/
|
|||
+
|
||||
+ };
|
||||
+
|
||||
+ battery: battery {
|
||||
+ compatible = "simple-battery";
|
||||
+ charge-full-design-microamp-hours = <3000000>;
|
||||
+ charge-term-current-microamp = <300000>;
|
||||
+ constant-charge-current-max-microamp = <2000000>;
|
||||
+ constant-charge-voltage-max-microvolt = <4200000>;
|
||||
+ factory-internal-resistance-micro-ohms = <134000>;
|
||||
+ voltage-max-design-microvolt = <4200000>;
|
||||
+ voltage-min-design-microvolt = <3500000>;
|
||||
+
|
||||
+ ocv-capacity-celsius = <20>;
|
||||
+ ocv-capacity-table-0 = <4046950 100>, <4001920 95>, <3967900 90>, <3919950 85>,
|
||||
+ <3888450 80>, <3861850 75>, <3831540 70>, <3799130 65>,
|
||||
+ <3768190 60>, <3745650 55>, <3726610 50>, <3711630 45>,
|
||||
+ <3696720 40>, <3685660 35>, <3674950 30>, <3663050 25>,
|
||||
+ <3649470 20>, <3635260 15>, <3616920 10>, <3592440 5>,
|
||||
+ <3574170 0>;
|
||||
+ };
|
||||
+
|
||||
+ rk817_charger: charger {
|
||||
+ rockchip,resistor-sense-micro-ohms = <0>;
|
||||
+ monitored-battery = <&battery>;
|
||||
+ rockchip,resistor-sense-micro-ohms = <10000>;
|
||||
+ rockchip,sleep-enter-current-microamp = <300000>;
|
||||
+ rockchip,sleep-filter-current-microamp = <100000>;
|
||||
+ };
|
||||
|
@ -945,12 +943,6 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts linux/
|
|||
+ };
|
||||
+};
|
||||
+
|
||||
+&internal_display {
|
||||
+ compatible = "anbernic,rg351v-panel-v2", "sitronix,st7703";
|
||||
+ iovcc-supply = <&vcc_lcd>;
|
||||
+ vdd-supply = <&vcc_lcd>;
|
||||
+};
|
||||
+
|
||||
+/* I2S 1 Channel Used Header(P2):1(GPIO2.C3),2(.C2), 3(.C1), 4(.C5), 5(.C4) */
|
||||
+&i2s1_2ch {
|
||||
+ status = "okay";
|
||||
|
@ -982,7 +974,7 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3326-magicx-xu10.dts linux/
|
|||
+};
|
||||
+
|
||||
+&csi_dphy {
|
||||
+ status = "okay";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&pwm1 {
|
||||
|
|
|
@ -63,9 +63,8 @@ diff -rupN linux.orig/drivers/gpu/drm/panel/panel-newvision-nv3051d.c linux/driv
|
|||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, newvision_nv3051d_of_match);
|
||||
diff -rupN linux.orig/drivers/gpu/drm/panel/panel-sitronix-st7703.c linux/drivers/gpu/drm/panel/panel-sitronix-st7703.c
|
||||
--- linux.orig/drivers/gpu/drm/panel/panel-sitronix-st7703.c 2024-01-17 03:47:11.678388835 +0000
|
||||
+++ linux/drivers/gpu/drm/panel/panel-sitronix-st7703.c 2024-01-17 04:03:24.432977809 +0000
|
||||
--- linux.orig/drivers/gpu/drm/panel/panel-sitronix-st7703.c 2024-01-17 13:11:54.938356637 -0500
|
||||
+++ linux/drivers/gpu/drm/panel/panel-sitronix-st7703.c 2024-01-17 12:48:04.770060000 -0500
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <linux/media-bus-format.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
|
@ -405,7 +404,7 @@ diff -rupN linux.orig/drivers/gpu/drm/panel/panel-sitronix-st7703.c linux/driver
|
|||
.hdisplay = 640,
|
||||
.hsync_start = 640 + 40,
|
||||
.hsync_end = 640 + 40 + 2,
|
||||
@@ -424,15 +452,23 @@ static const struct drm_display_mode rg3
|
||||
@@ -424,15 +452,117 @@ static const struct drm_display_mode rg3
|
||||
.height_mm = 57,
|
||||
};
|
||||
|
||||
|
@ -413,12 +412,106 @@ diff -rupN linux.orig/drivers/gpu/drm/panel/panel-sitronix-st7703.c linux/driver
|
|||
- .mode = &rg353v2_mode,
|
||||
+static const struct st7703_panel_desc rg351v2_desc = {
|
||||
+ .mode = &rg351v2_mode,
|
||||
+ .lanes = 4,
|
||||
+ .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
|
||||
+ MIPI_DSI_MODE_NO_EOT_PACKET | MIPI_DSI_MODE_LPM,
|
||||
+ .format = MIPI_DSI_FMT_RGB888,
|
||||
+ .init_sequence = rg351v2_init_sequence,
|
||||
+};
|
||||
+
|
||||
+static int xu10_init_sequence(struct st7703 *ctx)
|
||||
+{
|
||||
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
+
|
||||
+ /*
|
||||
+ * Init sequence was supplied by the panel vendor.
|
||||
+ */
|
||||
+
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETEXTC, 0xf1, 0x12, 0x83);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETAPID, 0x00, 0x00, 0x00,
|
||||
+ 0xda, 0x80);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETDISP, 0x00, 0x03, 0xf0);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETRGBIF, 0x10, 0x10, 0x28,
|
||||
+ 0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x0a, 0x0a);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x8e, 0x8e);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x26, 0x22,
|
||||
+ 0xf0, 0x13);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, 0x33, 0x81, 0x05,
|
||||
+ 0xf9, 0x0e, 0x0e, 0x20, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x44, 0x25, 0x00, 0x90, 0x0a,
|
||||
+ 0x00, 0x00, 0x01, 0x4f, 0x01, 0x00, 0x00, 0x37);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETVDC, 0x47);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_BF, 0x02, 0x11, 0x00);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETSCR, 0x73, 0x73, 0x50, 0x50,
|
||||
+ 0x00, 0x00, 0x12, 0x70, 0x00);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER, 0x53, 0x00, 0x32,
|
||||
+ 0x32, 0x77, 0xd1, 0xcc, 0xcc, 0x77, 0x77, 0x33,
|
||||
+ 0x33);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETECO, 0x82, 0x00, 0xbf, 0xff,
|
||||
+ 0x00, 0xff);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETIO, 0xb8, 0x00, 0x0a, 0x00,
|
||||
+ 0x00, 0x00);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETCABC, 0x10, 0x40, 0x1e,
|
||||
+ 0x02);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETPANEL, 0x0b);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGAMMA, 0x00, 0x06, 0x0a,
|
||||
+ 0x2a, 0x3d, 0x3f, 0x3b, 0x37, 0x06, 0x0b, 0x0c,
|
||||
+ 0x10, 0x11, 0x10, 0x13, 0x12, 0x18, 0x00, 0x06,
|
||||
+ 0x0a, 0x2a, 0x3d, 0x3f, 0x3b, 0x37, 0x06, 0x0b,
|
||||
+ 0x0c, 0x10, 0x11, 0x10, 0x13, 0x12, 0x18);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETEQ, 0x07, 0x07, 0x0b, 0x0b,
|
||||
+ 0x0b, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00,
|
||||
+ 0xc0, 0x10);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP1, 0xc8, 0x10, 0x02, 0x00,
|
||||
+ 0x00, 0xb0, 0xb1, 0x11, 0x31, 0x23, 0x28, 0x80,
|
||||
+ 0xb0, 0xb1, 0x27, 0x08, 0x00, 0x04, 0x02, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00,
|
||||
+ 0x88, 0x88, 0xba, 0x60, 0x24, 0x08, 0x88, 0x88,
|
||||
+ 0x88, 0x88, 0x88, 0x88, 0x88, 0xba, 0x71, 0x35,
|
||||
+ 0x18, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00,
|
||||
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00);
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_SETGIP2, 0x97, 0x0a, 0x82, 0x02,
|
||||
+ 0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x81, 0x88, 0xba, 0x17, 0x53, 0x88, 0x88, 0x88,
|
||||
+ 0x88, 0x88, 0x88, 0x80, 0x88, 0xba, 0x06, 0x42,
|
||||
+ 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x23, 0x00,
|
||||
+ 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
+ 0x00);
|
||||
+
|
||||
+ dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_EF, 0xff, 0xff, 0x01, 0x05, 0x96, 0x01, 0x11, 0x05, 0x78, 0x01, 0x29);
|
||||
+ //dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_EF, 0xff, 0xff, 0x01);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct drm_display_mode xu10_mode = {
|
||||
+ .hdisplay = 640,
|
||||
+ .hsync_start = 640 + 120,
|
||||
+ .hsync_end = 640 + 120 + 10,
|
||||
+ .htotal = 640 + 120 + 10 + 120,
|
||||
+ .vdisplay = 480,
|
||||
+ .vsync_start = 480 + 17,
|
||||
+ .vsync_end = 480 + 17 + 4,
|
||||
+ .vtotal = 480 + 17 + 4 + 13,
|
||||
+ .clock = 27438,
|
||||
+ .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
|
||||
+ .width_mm = 70,
|
||||
+ .height_mm = 52,
|
||||
+};
|
||||
+
|
||||
+static const struct st7703_panel_desc xu10_desc = {
|
||||
+ .mode = &xu10_mode,
|
||||
.lanes = 4,
|
||||
.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
|
||||
MIPI_DSI_MODE_NO_EOT_PACKET | MIPI_DSI_MODE_LPM,
|
||||
.format = MIPI_DSI_FMT_RGB888,
|
||||
- .init_sequence = rg353v2_init_sequence,
|
||||
+ .init_sequence = rg351v2_init_sequence,
|
||||
+ .init_sequence = xu10_init_sequence,
|
||||
};
|
||||
|
||||
+#define dsi_generic_write_seq(dsi, seq...) do { \
|
||||
|
@ -432,7 +525,7 @@ diff -rupN linux.orig/drivers/gpu/drm/panel/panel-sitronix-st7703.c linux/driver
|
|||
static int rgb30panel_init_sequence(struct st7703 *ctx)
|
||||
{
|
||||
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
@@ -446,31 +482,31 @@ static int rgb30panel_init_sequence(stru
|
||||
@@ -446,31 +576,31 @@ static int rgb30panel_init_sequence(stru
|
||||
mipi_dsi_dcs_exit_sleep_mode(dsi);
|
||||
msleep(250);
|
||||
|
||||
|
@ -479,7 +572,7 @@ diff -rupN linux.orig/drivers/gpu/drm/panel/panel-sitronix-st7703.c linux/driver
|
|||
0x0f, 0xa1, 0x80, 0x12, 0x31, 0x23, 0x47, 0x86,
|
||||
0xa1, 0x80, 0x47, 0x08, 0x00, 0x00, 0x0d, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
@@ -479,7 +515,7 @@ static int rgb30panel_init_sequence(stru
|
||||
@@ -479,7 +609,7 @@ static int rgb30panel_init_sequence(stru
|
||||
0x13, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00);
|
||||
|
@ -488,7 +581,7 @@ diff -rupN linux.orig/drivers/gpu/drm/panel/panel-sitronix-st7703.c linux/driver
|
|||
0x01, 0x78, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x4f, 0x31, 0x8b, 0xa8, 0x31, 0x75, 0x88, 0x88,
|
||||
0x88, 0x88, 0x88, 0x4f, 0x20, 0x8b, 0xa8, 0x20,
|
||||
@@ -488,7 +524,7 @@ static int rgb30panel_init_sequence(stru
|
||||
@@ -488,7 +618,7 @@ static int rgb30panel_init_sequence(stru
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x40, 0xa1, 0x80, 0x00, 0x00, 0x00,
|
||||
0x00);
|
||||
|
@ -497,7 +590,7 @@ diff -rupN linux.orig/drivers/gpu/drm/panel/panel-sitronix-st7703.c linux/driver
|
|||
0x29, 0x3b, 0x3f, 0x42, 0x39, 0x06, 0x0d, 0x10,
|
||||
0x13, 0x15, 0x14, 0x15, 0x10, 0x17, 0x00, 0x0a,
|
||||
0x0f, 0x29, 0x3b, 0x3f, 0x42, 0x39, 0x06, 0x0d,
|
||||
@@ -667,7 +703,7 @@ static int allpixelson_set(void *data, u
|
||||
@@ -667,7 +797,7 @@ static int allpixelson_set(void *data, u
|
||||
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
|
||||
|
||||
dev_dbg(ctx->dev, "Setting all pixels on\n");
|
||||
|
@ -506,16 +599,17 @@ diff -rupN linux.orig/drivers/gpu/drm/panel/panel-sitronix-st7703.c linux/driver
|
|||
msleep(val * 1000);
|
||||
/* Reset the panel to get video back */
|
||||
drm_panel_disable(&ctx->panel);
|
||||
@@ -783,7 +819,7 @@ static void st7703_remove(struct mipi_ds
|
||||
@@ -783,7 +913,8 @@ static void st7703_remove(struct mipi_ds
|
||||
}
|
||||
|
||||
static const struct of_device_id st7703_of_match[] = {
|
||||
- { .compatible = "anbernic,rg353v-panel-v2", .data = &rg353v2_desc },
|
||||
+ { .compatible = "magicx,xu10-panel", .data = &xu10_desc },
|
||||
+ { .compatible = "anbernic,rg351v-panel-v2", .data = &rg351v2_desc },
|
||||
{ .compatible = "powkiddy,rgb30-panel", .data = &rgb30panel_desc },
|
||||
{ .compatible = "rocktech,jh057n00900", .data = &jh057n00900_panel_desc },
|
||||
{ .compatible = "xingbangda,xbd599", .data = &xbd599_desc },
|
||||
@@ -802,6 +838,6 @@ static struct mipi_dsi_driver st7703_dri
|
||||
@@ -802,6 +933,6 @@ static struct mipi_dsi_driver st7703_dri
|
||||
};
|
||||
module_mipi_dsi_driver(st7703_driver);
|
||||
|
||||
|
|
Loading…
Reference in a new issue