From 69ed55dec4b2116a19e4cca4393cbc014fce5fb2 Mon Sep 17 00:00:00 2001
From: huangcm <1263938474@qq.com>
Date: Mon, 24 Feb 2025 03:43:18 +0000
Subject: [PATCH] fix(pmu): usb supply always usb adapter mode

---
 longan/device/config/chips/a133/configs/c3/board.dts |  573 +++++++++++++++++++++-----------------------------------
 1 files changed, 217 insertions(+), 356 deletions(-)

diff --git a/longan/device/config/chips/a133/configs/c3/board.dts b/longan/device/config/chips/a133/configs/c3/board.dts
index 993148c..2fa9efb 100755
--- a/longan/device/config/chips/a133/configs/c3/board.dts
+++ b/longan/device/config/chips/a133/configs/c3/board.dts
@@ -6,6 +6,7 @@
 
 /dts-v1/;
 #include "sun50iw10p1.dtsi"
+#include "dt-bindings/input/linux-event-codes.h"
 
 /{
 	model = "sun50iw10";
@@ -18,7 +19,7 @@
 
 	reg_usb1_vbus: usb1-vbus {
 		compatible = "regulator-fixed";
-		//gpio = <&r_pio PL 11 1 2 0 1>;
+		gpio = <&r_pio PL 8 1 2 0 1>;
 		regulator-name = "usb1-vbus";
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
@@ -26,7 +27,7 @@
 		enable-active-high;
 	};
 
-	soc@03000000 {
+	soc: soc@03000000 {
 
 		r_pio: pinctrl@07022000 {
 
@@ -100,22 +101,22 @@
 			};
 
 			twi3_pins_a: twi3@0 {
-				allwinner,pins = "PE3", "PE4";
+				allwinner,pins = "PH12", "PH13";
 				allwinner,pname = "twi3_scl", "twi3_sda";
 				allwinner,function = "twi3";
-				allwinner,muxsel = <2>;
+				allwinner,muxsel = <3>;
 				allwinner,drive = <1>;
 				allwinner,pull = <1>;
 			};
 
 			twi3_pins_b: twi3@1 {
-				allwinner,pins = "PE3", "PE4";
+				allwinner,pins = "PH12", "PH13";
 				allwinner,function = "io_disabled";
 				allwinner,muxsel = <7>;
 				allwinner,drive = <1>;
 				allwinner,pull = <0>;
 			};
-
+/*
 			pwm0_pin_a: pwm0@0 {
 				//allwinner,pins = "PD23";
 				allwinner,function = "pwm0";
@@ -151,7 +152,7 @@
 				allwinner,pull = <0>;
 				allwinner,data = <0xffffffff>;
 			};
-
+*/
 			pwm2_pin_a: pwm2@0 {
 				allwinner,pins = "PD20";
 				allwinner,function = "pwm2";
@@ -169,7 +170,7 @@
 				allwinner,pull = <0>;
 				allwinner,data = <0xffffffff>;
 			};
-
+/*
 			pwm3_pin_a: pwm3@0 {
 				allwinner,pins = "PD21";
 				allwinner,function = "pwm3";
@@ -187,11 +188,13 @@
 				allwinner,pull = <0>;
 				allwinner,data = <0xffffffff>;
 			};
-
+*/
 			spi0_pins_a: spi0@0 {
-				allwinner,pins = "PC2", "PC4", "PC12", "PC15", "PC16";
-				allwinner,pname = "spi0_mosi", "spi0_miso",
-						  "spi0_sclk", "spi0_wp", "spi0_hold";
+				// allwinner,pins = "PC2", "PC4", "PC12", "PC15", "PC16";
+				allwinner,pins = "PC2", "PC4", "PC12";
+				// allwinner,pname = "spi0_mosi", "spi0_miso",
+				// 		  "spi0_sclk", "spi0_wp", "spi0_hold";
+				allwinner,pname = "spi0_mosi", "spi0_miso", "spi0_sclk";
 				allwinner,function = "spi0";
 				allwinner,muxsel = <4>;
 				allwinner,drive = <1>;
@@ -208,12 +211,14 @@
 			};
 
 			spi0_pins_c: spi0@2 {
-				allwinner,pins = "PC2", "PC3", "PC4", "PC7", "PC12", "PC15", "PC16";
+				// allwinner,pins = "PC2", "PC3", "PC4", "PC7", "PC12", "PC15", "PC16";
+				allwinner,pins = "PC2", "PC3", "PC4", "PC7", "PC12";
 				allwinner,function = "io_disabled";
 				allwinner,muxsel = <7>;
 				allwinner,drive = <1>;
 				allwinner,pull = <0>;
 			};
+/*
 			spi1_pins_a: spi1@0 {
 				allwinner,pins = "PD11", "PD12", "PD13";
 				allwinner,pname = "spi1_sclk", "spi1_mosi",
@@ -230,7 +235,7 @@
 				allwinner,function = "spi1";
 				allwinner,muxsel = <4>;
 				allwinner,drive = <1>;
-				allwinner,pull = <1>;	/* only CS should be pulled up */
+				allwinner,pull = <1>;	// only CS should be pulled up 
 			};
 
 			spi1_pins_c: spi1@2 {
@@ -275,6 +280,7 @@
                                 allwinner,drive = <1>;
                                 allwinner,pull = <0>;
                         };
+*/
 		};
 
 		twi0: twi@0x05002000{
@@ -295,8 +301,8 @@
                                 ctp_revert_x_flag = <0x1>;
                                 ctp_revert_y_flag = <0x1>;
                                 ctp_exchange_x_y_flag = <0x0>;
-                                ctp_int_port = <&r_pio PL 7  3 0xffffffff 0xffffffff 0>;
-                                ctp_wakeup =   <&pio   PB 2  1 0xffffffff 0xffffffff 1>;
+                                ctp_int_port = <&pio PE 3 6 0xffffffff 0xffffffff 0>;
+                                ctp_wakeup =   <&pio PE 4 1 0xffffffff 0xffffffff 1>;
                                 ctp_power_ldo = <3300>;
                                 ctp_power_ldo_vol = <3300>;
                                 ctp_power = <3300>;
@@ -317,29 +323,38 @@
                         pinctrl-1 = <&spi0_pins_c>;
                         spi0_cs_number = <1>;
                         spi0_cs_bitmap = <1>;
-			spi_slave_mode = <0>;
+						spi_slave_mode = <0>;
                         //status = "okay";
                         status = "disabled";
+						/*
                         spi_uart {
                                 compatible = "wkmic,wk2124spi";
                                 reg = <0>;
                                 spi-max-frequency = <10000000>;
                                 //irq_gpio = <&pio PH 11 6 0xffffffff 0xffffffff 0>;
                         };
-                };
+						*/
 
+						dh2228@2 {
+                        	compatible = "rohm,dh2228fv";
+                        	reg = <0>;
+                        	spi-max-frequency = <100000>;
+                		};
+
+                };
+/*
                 pwm3: pwm3@0300a000 {
                         pinctrl-names = "active", "sleep";
                         pinctrl-0 = <&pwm3_pin_a>;
                         pinctrl-1 = <&pwm3_pin_b>;
-			status = "okay";
+						status = "disabled";
                 };
-
+*/
                 pwm2: pwm2@0300a000 {
                         pinctrl-names = "active", "sleep";
                         pinctrl-0 = <&pwm2_pin_a>;
                         pinctrl-1 = <&pwm2_pin_b>;
-			status = "okay";
+						status = "okay";
                 };
 
 		twi1: twi@0x05002400{
@@ -347,46 +362,7 @@
 			pinctrl-0 = <&twi1_pins_a>;
 			pinctrl-1 = <&twi1_pins_b>;
 			status = "okay";
-			gsensor {
-				compatible = "allwinner,sc7a20";
-				reg = <0x19>;
-				device_type = "gsensor";
-				status = "disabled";
-				gsensor_twi_id = <0x1>;
-				gsensor_twi_addr = <0x19>;
-				//gsensor_int1 = <&pio PH 11 6 1 0xffffffff 0xffffffff>;
-				gsensor-supply = <&reg_dcdc1>;
-				gsensor_vcc_io_val = <3300>;
-			};
-			lightsensor {
-				compatible = "allwinner,stk3x1x";
-				reg = <0x48>;
-				device_type = "lightsensor";
-				status = "disabled";
-				ls_twi_id = <0x1>;
-				ls_twi_addr = <0x48>;
-				//ls_int = <&pio PH 4 6 1 0xffffffff 0xffffffff>;
-				lightsensor-supply = <&reg_dcdc1>;
-			};
-                        pcf85063@51 {
-                                compatible = "haoyu,hym8563";
-                                reg = <0x51>;
-                                status = "okay";
-			};
-        		mpu6050@68 {
-                		compatible = "invensense,mpu6500";
-                		reg = <0x68>;
-                		mount-matrix = 	"-0.984807753012208",  /* x0 */
-                               		       	"0",                   /* y0 */
-                               		       	"-0.173648177666930",  /* z0 */
-                               			"0",                   /* x1 */
-                               			"-1",                  /* y1 */
-                               			"0",                   /* z1 */
-                               			"-0.173648177666930",  /* x2 */
-                               			"0",                   /* y2 */
-                               			"0.984807753012208";   /* z2 */
-				status = "disabled";
-        		};
+			// EXTEND GPIO
 		};
 
 		twi2: twi@0x05002800{
@@ -394,21 +370,26 @@
 			pinctrl-0 = <&twi2_pins_a>;
 			pinctrl-1 = <&twi2_pins_b>;
 			twi-supply = <&reg_dldo2>;
-			status = "ok";
+			status = "okay";
+			// CAMERA1
 
-/*			ac107@36 {
-				compatible = "Allwinnertech,ac107_0";
-				gpio-reset = "null";
-				reg = <0x36>;
-				status = "okay";
-			}; */
+			// CAMERA2
 		};
 
 		twi3: twi@0x05002c00{
 			clock-frequency = <200000>;
 			pinctrl-0 = <&twi3_pins_a>;
 			pinctrl-1 = <&twi3_pins_b>;
-			status = "ok";
+			status = "okay";
+			// RTC
+			pcf8563@51 {
+					compatible = "haoyu,hym8563";
+					reg = <0x51>;
+					interrupt-parent = <&pio>;
+					interrupts = <PB 8 IRQ_TYPE_LEVEL_LOW>;
+					status = "okay";
+					wakeup-source;
+			};
 		};
 
 		twi6: s_twi@0x07081400{
@@ -559,6 +540,7 @@
 						regulator-ramp-delay = <250>;
 						regulator-enable-ramp-delay = <1000>;
 						regulator-boot-on;
+						regulator-always-on;
 					};
 					reg_dcdc2: dcdc2 {
 						regulator-name = "axp803-dcdc2";
@@ -642,15 +624,20 @@
 					};
 					reg_dldo1: dldo1 {
 						regulator-name = "axp803-dldo1";
-						regulator-min-microvolt = <700000>;
-						regulator-max-microvolt = <3300000>;
+						regulator-min-microvolt = <1800000>;
+						regulator-max-microvolt = <1900000>;
 						regulator-enable-ramp-delay = <1000>;
+						regulator-always-on;
+						regulator-boot-on;
 					};
 					reg_dldo2: dldo2 {
 						regulator-name = "axp803-dldo2";
 						regulator-min-microvolt = <700000>;
 						regulator-max-microvolt = <4200000>;
 						regulator-enable-ramp-delay = <1000>;
+						regulator-always-on;
+						regulator-boot-on;
+						// kickpi
 					};
 					reg_dldo3: dldo3 {
 						regulator-name = "axp803-dldo3";
@@ -681,6 +668,9 @@
 						regulator-min-microvolt = <700000>;
 						regulator-max-microvolt = <1900000>;
 						regulator-enable-ramp-delay = <1000>;
+						regulator-always-on;
+						regulator-boot-on;
+						// kickpi
 					};
 					reg_fldo1: fldo1 {
 						regulator-name = "axp803-fldo1";
@@ -832,7 +822,7 @@
 
 			osc24m-on = <0x1>;
 		};
-
+/*
 		pwm0: pwm0@0300a000 {
 			pinctrl-names = "active", "sleep";
 			pinctrl-0 = <&pwm0_pin_a>;
@@ -852,7 +842,7 @@
 			spi_slave_mode = <0>;
 			status = "disabled";
 		};
-
+*/
 		gpadc:gpadc{
 			channel_num = <1>;
 			channel_select = <0x01>;
@@ -923,8 +913,7 @@
 			device_type = "usbc0";
 			usb_port_type = <0x0>;
 			usb_detect_type = <0x1>;
-			//usb_id_gpio = <&pio PH 8 0 0 0xffffffff 0xffffffff>;
-			usb_id_gpio = <&r_pio PL 10 0 0 0xffffffff 0xffffffff>;
+			usb_id_gpio = <&r_pio PL 9 0 0 0xffffffff 0xffffffff>;
 			usb_det_vbus_gpio   = "axp_ctrl";
 			usb_regulator_io = "nocare";
 			det_vbus_supply = <&usb_power_supply>;
@@ -963,23 +952,26 @@
 		};
 
 		sdc1: sdmmc@04021000 {
-			bus-width = <4>;
-			no-mmc;
-			no-sd;
-			cap-sd-highspeed;
-			/*sd-uhs-sdr12*/
-			/*sd-uhs-sdr25*/
-			/*sd-uhs-sdr50;*/
-			/*sd-uhs-ddr50;*/
-			/*sd-uhs-sdr104*/
-			/*sunxi-power-save-mode;*/
-			/*sunxi-dis-signal-vol-sw;*/
-			cap-sdio-irq;
-			keep-power-in-suspend;
-			ignore-pm-notify;
-			max-frequency = <50000000>;
-			ctl-spec-caps = <0x8>;
-			status = "okay";
+                        bus-width = <4>;
+                        no-mmc;
+                        no-sd;
+                        cap-sd-highspeed;
+                        /*sd-uhs-sdr12*/
+                        /*sd-uhs-sdr25*/
+                        sd-uhs-sdr50;
+                        sd-uhs-ddr50;
+                        sd-uhs-sdr104;
+			// kickpi
+                        //sunxi-power-save-mode;
+                        /*sunxi-dis-signal-vol-sw;*/
+                        sdio-used-1v8;
+                        cap-sdio-irq;
+                        keep-power-in-suspend;
+                        ignore-pm-notify;
+                        max-frequency = <50000000>;
+                        ctl-spec-caps = <0x8>;
+                        status = "okay";
+
 		};
 
 		/* gpio-spk will output 0x00 when playing audio */
@@ -1001,7 +993,7 @@
 			/* Pa enabled about */
 			pa_level 	= <0x00>;
 			pa_msleep_time 	= <0x78>;
-			gpio-spk = <&pio PH 17 1 1 1 1>;
+			//gpio-spk = <&pio PB 7 1 1 1 1>;
 			/* regulator about */
 			avcc-supply = <&reg_aldo1>;
 			cpvin-supply = <&reg_eldo1>;
@@ -1009,6 +1001,7 @@
 		};
 
 		sndcodec:sound@0 {
+			noheadphonemic = <1>;
 			status = "okay";
 		};
 
@@ -1021,7 +1014,7 @@
 		};
 
 		dmic:dmic-controller@0x05095000{
-			status = "okay";
+			status = "disabled";
 		};
 
 		snddmic:sound@2{
@@ -1041,7 +1034,7 @@
 			daudio_master 	= <0x04>;
 			signal_inversion  = <0x01>;
 			slot_width_select = <0x20>;
-			status = "disabled";
+			status = "okay";
 		};
 
 		snddaudio0:sound@3 {
@@ -1050,7 +1043,7 @@
 
 /*			sunxi,snddaudio-codec = "ac107.1-0036";
 			sunxi,snddaudio-codec-dai = "ac107-pcm0"; */
-			status = "disabled";
+			status = "okay";
 		};
 
 		daudio1:daudio@0x05091000 {
@@ -1116,7 +1109,7 @@
 		vind0:vind@0 {
 			vind0_clk = <336000000>;
 			vind0_isp = <300000000>;
-			status = "okay";
+			status = "disabled";
 
 			actuator0:actuator@0 {
 				device_type = "actuator0";
@@ -1231,212 +1224,57 @@
 				status = "okay";
 			};
 		};
-/*----------------------------------------------------------------------------------
-disp init configuration
 
-disp_mode             (0:screen0<screen0,fb0>)
-screenx_output_type   (0:none; 1:lcd; 2:tv; 3:hdmi;5:vdpo)
-screenx_output_mode   (used for hdmi output, 0:480i 1:576i 2:480p 3:576p 4:720p50)
-                      (5:720p60 6:1080i50 7:1080i60 8:1080p24 9:1080p50 10:1080p60)
-screenx_output_format (for hdmi, 0:RGB 1:yuv444 2:yuv422 3:yuv420)
-screenx_output_bits   (for hdmi, 0:8bit 1:10bit 2:12bit 2:16bit)
-screenx_output_eotf   (for hdmi, 0:reserve 4:SDR 16:HDR10 18:HLG)
-screenx_output_cs     (for hdmi, 0:undefined  257:BT709 260:BT601  263:BT2020)
-screenx_output_dvi_hdmi (for hdmi, 0:undefined 1:dvi mode 2:hdmi mode)
-screen0_output_range   (for hdmi, 0:default 1:full 2:limited)
-screen0_output_scan    (for hdmi, 0:no data 1:overscan 2:underscan)
-screen0_output_aspect_ratio  (for hdmi, 8-same as original picture 9-4:3 10-16:9 11-14:9)
-fbx format            (4:RGB655 5:RGB565 6:RGB556 7:ARGB1555 8:RGBA5551 9:RGB888 10:ARGB8888 12:ARGB4444)
-fbx pixel sequence    (0:ARGB 1:BGRA 2:ABGR 3:RGBA)
-fb0_scaler_mode_enable(scaler mode enable, used FE)
-fbx_width,fbx_height  (framebuffer horizontal/vertical pixels, fix to output resolution while equal 0)
-lcdx_backlight        (lcd init backlight,the range:[0,256],default:197
-lcdx_yy               (lcd init screen bright/contrast/saturation/hue, value:0~100, default:50/50/57/50)
-lcd0_contrast         (LCD contrast, 0~100)
-lcd0_saturation       (LCD saturation, 0~100)
-lcd0_hue              (LCD hue, 0~100)
-framebuffer software rotation setting:
-disp_rotation_used:   (0:disable; 1:enable,you must set fbX_width to lcd_y,
-set fbX_height to lcd_x)
-degreeX:              (X:screen index; 0:0 degree; 1:90 degree; 3:270 degree)
-degreeX_Y:            (X:screen index; Y:layer index 0~15; 0:0 degree; 1:90 degree; 3:270 degree)
-devX_output_type : config output type in bootGUI framework in UBOOT-2018.
-				   (0:none; 1:lcd; 2:tv; 4:hdmi;)
-devX_output_mode : config output resolution(see include/video/sunxi_display2.h) of bootGUI framework in UBOOT-2018
-devX_screen_id   : config display index of bootGUI framework in UBOOT-2018
-devX_do_hpd      : whether do hpd detectation or not in UBOOT-2018
-chn_cfg_mode     : Hardware DE channel allocation config. 0:single display with 6
-				   channel, 1:dual display with 4 channel in main display and 2 channel in second
-                   display, 2:dual display with 3 channel in main display and 3 channel in second
-                   in display.
-----------------------------------------------------------------------------------*/
-                disp: disp@06000000 {
-                        disp_init_enable         = <1>;
-                        disp_mode                = <0>;
-
-                        screen0_output_type      = <1>;
-                        screen0_output_mode      = <4>;
-
-                        screen1_output_type      = <1>;
-                        screen1_output_mode      = <4>;
-
-                        screen1_output_format    = <0>;
-                        screen1_output_bits      = <0>;
-                        screen1_output_eotf      = <4>;
-                        screen1_output_cs        = <257>;
-                        screen1_output_dvi_hdmi  = <2>;
-                        screen1_output_range     = <2>;
-                        screen1_output_scan      = <0>;
-                        screen1_output_aspect_ratio = <8>;
-
-                        dev0_output_type         = <1>;
-                        dev0_output_mode         = <4>;
-                        dev0_screen_id           = <0>;
-                        dev0_do_hpd              = <0>;
-
-                        dev1_output_type         = <4>;
-                        dev1_output_mode         = <10>;
-                        dev1_screen_id           = <1>;
-                        dev1_do_hpd              = <1>;
-
-                        def_output_dev           = <0>;
-                        hdmi_mode_check          = <1>;
-
-                        fb0_format               = <0>;
-                        fb0_width                = <1024>;
-                        fb0_height               = <600>;
-
-                        fb1_format               = <0>;
-                        fb1_width                = <0>;
-                        fb1_height               = <0>;
-                        chn_cfg_mode             = <1>;
-
-                        disp_para_zone           = <1>;
-                        dc1sw-supply = <&reg_dc1sw>;
-                        eldo3-supply = <&reg_eldo3>;
-                        dcdc1-supply = <&reg_dcdc1>;
-                };
-/*----------------------------------------------------------------------------------
-;lcd0 configuration
-
-;lcd_if:               0:hv(sync+de); 1:8080; 2:ttl; 3:lvds; 4:dsi; 5:edp; 6:extend dsi
-;lcd_hv_if             0:Parallel RGB; 8:Serial RGB; 10:Dummy RGB; 11: RGB Dummy;12:CCIR656
-;lcd_hv_clk_phase      0:0 degree;1:90 degree;2:180 degree;3:270 degree
-;lcd_hv_sync_polarity  0:vs low,hs low; 1:vs high,hslow; 2:vs low,hs high; 3:vs high,hs high
-;lcd_hv_syuv_seq       0:YUYV; 1:YVYU; 2:UYVY; 3:VYUY
-;lcd_cpu_if            0:18bit/1 cycle parallel(RGB666); 4:16bit/1cycle parallel (RGB565)
-;                      6:18bit/3 cycle parallel(RGB666); 7:16bit/2cycle parallel (RGB565)
-;lcd_cpu_te            0:frame auto trigger; 1:frame triggered by te rising edge; 2:frame triggered by te falling edge;
-;lcd_dsi_if            0:video mode; 1: Command mode; 2:video burst mode
-;lcd_dsi_te            0:frame auto trigger; 1:frame triggered by te rising edge; 2:frame triggered by te falling edge;
-;lcd_x:                lcd horizontal resolution
-;lcd_y:                lcd vertical resolution
-;lcd_width:            width of lcd in mm
-;lcd_height:           height of lcd in mm
-;lcd_dclk_freq:        in MHZ unit
-;lcd_pwm_freq:         in HZ unit
-;lcd_pwm_pol:          lcd backlight PWM polarity
-;lcd_pwm_max_limit     lcd backlight PWM max limit(<=255)
-;lcd_hbp:              hsync back porch(pixel) + hsync plus width(pixel);
-;lcd_ht:               hsync total cycle(pixel)
-;lcd_vbp:              vsync back porch(line) + vysnc plus width(line)
-;lcd_vt:               vysnc total cycle(line)
-;lcd_hspw:             hsync plus width(pixel)
-;lcd_vspw:             vysnc plus width(pixel)
-;lcd_lvds_if:          0:single link;  1:dual link
-;lcd_lvds_colordepth:  0:8bit; 1:6bit
-;lcd_lvds_mode:        0:NS mode; 1:JEIDA mode
-;lcd_frm:              0:disable; 1:enable rgb666 dither; 2:enable rgb656 dither
-;lcd_io_phase:         0:noraml; 1:intert phase(0~3bit: vsync phase; 4~7bit:hsync phase;
-;                      8~11bit:dclk phase; 12~15bit:de phase)
-;lcd_gamma_en          lcd gamma correction enable
-;lcd_bright_curve_en   lcd bright curve correction enable
-;lcd_cmap_en           lcd color map function enable
-;deu_mode              0:smoll lcd screen; 1:large lcd screen(larger than 10inch)
-;lcdgamma4iep:         Smart Backlight parameter, lcd gamma vale * 10;
-;                      decrease it while lcd is not bright enough; increase while lcd is too bright
-;smart_color           90:normal lcd screen 65:retina lcd screen(9.7inch)
-;Pin setting for special function ie.LVDS, RGB data or vsync
-;   name(donot care) = port:PD12<pin function><pull up or pull down><drive ability><output level>
-;Pin setting for gpio:
-;   lcd_gpio_X     = port:PD12<pin function><pull up or pull down><drive ability><output level>
-;Pin setting for backlight enable pin
-;   lcd_bl_en     = port:PD12<pin function><pull up or pull down><drive ability><output level>
-;fsync setting, pulse to csi
-;lcd_fsync_en          (0:disable fsync,1:enable)
-;lcd_fsync_act_time    (active time of fsync, unit:pixel)
-;lcd_fsync_dis_time    (disactive time of fsync, unit:pixel)
-;lcd_fsync_pol         (0:positive;1:negative)
-;gpio config: <&pio for cpu or &r_pio for cpus, port, port num, pio function,
-pull up or pull down(default 0), driver level(default 1), data>
-;For dual link lvds: use lvds2link_pins_a  and lvds2link_pins_b instead
-;For rgb24: use rgb24_pins_a  and rgb24_pins_b instead
-;For lvds1: use lvds1_pins_a  and lvds1_pins_b instead
-;For lvds0: use lvds0_pins_a  and lvds0_pins_b instead
-;----------------------------------------------------------------------------------*/
-                lcd0: lcd0@01c0c000 {
-                        lcd_used            = <1>;
-
-                        lcd_driver_name     = "default_lcd";
-                        lcd_backlight       = <100>;
-                        lcd_if              = <3>;
-
-                        lcd_x               = <1024>;
-                        lcd_y               = <600>;
-                        lcd_width           = <217>;
-                        lcd_height          = <136>;
-                        lcd_dclk_freq       = <49>;
-
-                        lcd_pwm_used        = <1>;
-                        lcd_pwm_ch          = <3>;
-                        lcd_pwm_freq        = <50000>;
-                        lcd_pwm_pol         = <1>;
-                        lcd_pwm_max_limit   = <255>;
-
-                        lcd_hbp             = <124>;
-                        lcd_ht              = <1264>;
-                        lcd_hspw            = <24>;
-                        lcd_vbp             = <24>;
-                        lcd_vt              = <648>;
-                        lcd_vspw            = <4>;
-
-                        lcd_frm             = <0>;
-                        lcd_gamma_en        = <0>;
-                        lcd_bright_curve_en = <0>;
-                        lcd_cmap_en         = <0>;
-
-                        deu_mode            = <0>;
-                        lcdgamma4iep        = <22>;
-                        smart_color         = <90>;
-
-			lcd_lvds_if	    = <0>;
-			lcd_lvds_colordepth = <0>;
-			lcd_lvds_mode 	    = <0>;		
-
-                        lcd_pin_power = "dcdc1";
-                        lcd_pin_power1 = "eldo3";
-
-                        lcd_power = "dc1sw";
-                        lcd_gpio_0 = <&r_pio PL 11 1 0 3 1>;
-                        pinctrl-0 = <&dsi4lane_pins_a>;
-                        pinctrl-1 = <&dsi4lane_pins_b>;
-                };
-
+/*
 		hall_para {
 			hall_name = "MH248";
 			status = "disabled";
 			hall_int_port = <&r_pio PL 9 6 1 0xffffffff 0xffffffff>;
 		};
-
+*/
 		keyboard {
 			compatible = "allwinner,keyboard_1350mv";
-			status = "disable";
-			key_cnt = <3>;
-			key0 = <475 0x7372>;
-			key1 = <646 0x73>;
-			key2 = <900 0x72>;
+			status = "okay";
+			key_cnt = <1>;
+			key0 = <590 KEY_RESERVED>;
+			//key0 = <475 0x7372>;
+			//key1 = <646 0x73>;
+			//key2 = <897 0x72>;
 		};
 
+                wlan: wlan@0 {
+                        compatible    = "allwinner,sunxi-wlan";
+                        clocks;
+                        pinctrl-0;
+                        pinctrl-names;
+                        wlan_busnum   = <0x1>;
+                        wlan_power    = "axp803-dldo1";
+                        wlan_io_regulator;
+                        wlan_regon    = <&pio PG 10 1 0xffffffff 0xffffffff 1>;
+                        wlan_hostwake = <&pio PG 13 6 0xffffffff 0xffffffff 0>;
+                        //chip_en;
+                        //power_en      = <&pio PG 10 1 0xffffffff 0xffffffff 0>;
+                        status        = "okay";
+                };
+
+                bt: bt@0 {
+                        compatible    = "allwinner,sunxi-bt";
+			clocks        = <&clk_losc_out>, <&clk_dcxo_out>;
+                        bt_power      = "axp803-dldo1";
+                        bt_io_regulator;
+                        bt_rst_n      = <&r_pio PH 11 1 0xffffffff 0xffffffff 0>;
+                        status        = "okay";
+                };
+
+                btlpm: btlpm@0 {
+                        compatible  = "allwinner,sunxi-btlpm";
+                        uart_index  = <0x1>;
+                        bt_wake     = <&pio PG 12 1 0xffffffff 0xffffffff 1>;
+                        bt_hostwake = <&pio PG 11 6 0xffffffff 0xffffffff 1>;
+                        status      = "okay";
+                };
+
+/*
 		wlan: wlan@0 {
 			compatible    = "allwinner,sunxi-wlan";
 			clocks        = <&clk_losc_out>, <&clk_dcxo_out>;
@@ -1445,30 +1283,31 @@
 			wlan_busnum   = <0x1>;
 			wlan_power    = "axp803-dldo1";
 			wlan_io_regulator;
-			wlan_regon    = <&r_pio PL 5 1 0xffffffff 0xffffffff 0>;
-			wlan_hostwake = <&r_pio PL 6 6 0xffffffff 0xffffffff 0>;
+			wlan_regon    = <&pio PG 10 1 0xffffffff 0xffffffff 0>;
+			wlan_hostwake = <&pio PG 13 6 0xffffffff 0xffffffff 0>;
 			chip_en;
 			power_en;
 			status        = "okay";
 		};
+
 		bt: bt@0 {
 			compatible    = "allwinner,sunxi-bt";
 			clocks        = <&clk_losc_out>, <&clk_dcxo_out>;
 			bt_power      = "axp803-dldo1";
 			//bt_power      = "axp803-dldo1";
 			bt_io_regulator;
-			bt_rst_n      = <&r_pio PL 2 1 0xffffffff 0xffffffff 0>;
+			//bt_rst_n      = <&r_pio PL 2 1 0xffffffff 0xffffffff 0>;
 			status        = "okay";
 		};
 
 		btlpm: btlpm@0 {
 			compatible  = "allwinner,sunxi-btlpm";
 			uart_index  = <0x1>;
-			bt_wake     = <&r_pio PL 4 1 0xffffffff 0xffffffff 1>;
-			bt_hostwake = <&r_pio PL 3 6 0xffffffff 0xffffffff 1>;
+			bt_wake     = <&pio PG 11 1 0xffffffff 0xffffffff 1>;
+			bt_hostwake = <&pio PG 12 6 0xffffffff 0xffffffff 1>;
 			status      = "okay";
 		};
-
+*/
 		addr_mgt: addr_mgt@0 {
 			compatible     = "allwinner,sunxi-addr_mgt";
 			type_addr_wifi = <0x0>;
@@ -1512,73 +1351,95 @@
 	};
 	
 	leds {
-               	compatible = "gpio-leds";
-        	pinctrl-names = "default";
-		status = "okay";
+			compatible = "gpio-leds";
+			pinctrl-names = "default";
+			status = "okay";
 
-               	sys {
-                       	label = "sysled";
-                       	gpios = <&pio PH 19 1 0 1 0>;
-			linux,default_trigger = "heartbeat";
-               	};
-		
-		hubrst {
-                        label = "hubrst";
-                        gpios = <&pio PC 7 1 0 1 1>;
-			default_state="on";
-		};
-		
-		usb1_pwr {
-			label = "usb1_pwr";
-			gpios = <&r_pio PL 9 1 0 1 1>;
-			default_state="on";
-		};
+			sysled {
+				label = "sysled";
+				gpios = <&r_pio PL 10 1 0 1 1>;
+				linux,default_trigger = "heartbeat";
+			};
 
-		usb2_pwr {
-			label = "usb2_pwr";
-			gpios = <&pio PH 15 1 0 1 1>;
-			default_state="on";
-		};
-	
-		usb3_pwr {
-			label = "usb3_pwr";
-			gpios = <&pio PH 16 1 0 1 1>;
-			default_state="on";
-		};
+            spk_en {
+                label = "spk_en";
+                gpios = <&pio PB 7 1 0 1 0>;
+				linux,default_trigger = "default-on";
+            };
 
-		usb4_pwr {
-			label = "usb4_pwr";
-			gpios = <&r_pio PL 8 1 0 1 1>;
-			default_state="on";
-		};
+			fan_en {
+				label = "fan_en";
+				gpios = <&r_pio PL 7 1 0 1 0>;
+				linux,default_trigger = "default-on";
+			};
 
-		usb5_pwr {
-			label = "usb5_pwr";
-			gpios = <&pio PH 18 1 0 1 1>;
-			default_state="on";
-		};
+			PH8 {
+				label = "PH8";
+				gpios = <&pio PH 8 1 0 1 0>;
+				linux,default_trigger = "default-on";
+			};
 
-		usb6_pwr {
-			label = "usb6_pwr";
-			gpios = <&pio PB 6 1 0 1 1>;
-			default_state="on";
-		};
+			PC2 {
+				label = "PC2";
+				gpios = <&pio PC 2 1 0 1 0>;
+				linux,default_trigger = "default-on";
+			};
 
-		usb7_pwr {
-			label = "usb7_pwr";
-			gpios = <&pio PB 8 1 0 1 1>;
-			default_state="on";
-		};
+			PC3 {
+				label = "PC3";
+				gpios = <&pio PC 3 1 0 1 0>;
+				linux,default_trigger = "default-on";
+			};
 
-		spkmute {
-			label = "spkmute";
-			gpios = <&pio PH 13 1 0 1 0>;
-			default_state="on";
-		};
+			PC4 {
+				label = "PC4";
+				gpios = <&pio PC 4 1 0 1 0>;
+				linux,default_trigger = "default-on";
+			};
+
+			PC7 {
+				label = "PC7";
+				gpios = <&pio PC 7 1 0 1 0>;
+				linux,default_trigger = "default-on";
+			};
+
+			PC12 {
+				label = "PC12";
+				gpios = <&pio PC 12 1 0 1 0>;
+				linux,default_trigger = "default-on";
+			};
+
         };
-
 };
 
 &cpu0 {
 	cpu-supply = <&reg_dcdc2>;
 };
+
+&s_cir0 {
+	status = "okay";
+
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&s_cir0_pins_a>;
+	pinctrl-1 = <&s_cir0_pins_a>;
+
+	s_cir0_used = <1>;
+	ir_power_key_code0 = <0x4d>;
+	ir_addr_code0 = <0x4040>;
+	ir_power_key_code1 = <0x51>;
+	ir_addr_code1 = <0x7f80>;
+	ir_power_key_code2 = <0x1c>;
+	ir_addr_code2 = <0xdf00>;
+	wakeup-source;
+};
+
+
+&gmac0 {
+	/delete-property/ phy-rst;
+   	rx-delay = <7>;
+};
+
+
+//#include "lcd-lvds-21-1920-1080.dtsi"
+#include "lcd-lvds-7-1024-600.dtsi"
+//#include "lcd-mipi-10-800-1280.dtsi"

--
Gitblit v1.6.2