From 37ffbbb7180e6a96f52ede5ce8780f1a645133f3 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Wed, 17 Nov 2021 21:59:36 +0800
Subject: [PATCH] update linux patch to support buzzer driver

---
 bsp/kernel/patch/linux-imx-imx6ull.patch |  101 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 93 insertions(+), 8 deletions(-)

diff --git a/bsp/kernel/patch/linux-imx-imx6ull.patch b/bsp/kernel/patch/linux-imx-imx6ull.patch
index 1b80338..b406717 100644
--- a/bsp/kernel/patch/linux-imx-imx6ull.patch
+++ b/bsp/kernel/patch/linux-imx-imx6ull.patch
@@ -1,12 +1,18 @@
 diff -Nuar -x include-prefixes -x logo_linux_clut224.ppm linux-imx/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi linux-imx-imx6ull/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
 --- linux-imx/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi	2021-09-08 18:41:11.000000000 +0800
-+++ linux-imx-imx6ull/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi	2021-11-16 23:10:04.218339568 +0800
-@@ -31,7 +31,35 @@
++++ linux-imx-imx6ull/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi	2021-11-17 21:58:06.816818504 +0800
+@@ -31,7 +31,41 @@
  		brightness-levels = <0 4 8 16 32 64 128 255>;
  		default-brightness-level = <6>;
  		status = "okay";
 -	};
 +	}; 
++
++	buzzer: pwm-buzzer {
++        compatible = "pwm-beeper";
++        pwms = <&pwm2 0 500000>;
++        status = "okay";
++	};
 +
 +    leds {
 +        compatible = "gpio-leds";
@@ -38,7 +44,30 @@
  
  	pxp_v4l2 {
  		compatible = "fsl,imx6ul-pxp-v4l2", "fsl,imx6sx-pxp-v4l2", "fsl,imx6sl-pxp-v4l2";
-@@ -301,21 +329,21 @@
+@@ -184,6 +218,12 @@
+ 	pinctrl-0 = <&pinctrl_i2c2>;
+ 	status = "okay";
+ 
++    rtc@6f {
++        compatible = "isil,isl1208";
++        reg = <0x6f>;
++        status = "okay";
++    };
++
+ 	codec: wm8960@1a {
+ 		#sound-dai-cells = <0>;
+ 		compatible = "wlf,wm8960";
+@@ -192,7 +232,8 @@
+ 		wlf,hp-cfg = <3 2 3>;
+ 		wlf,gpio-cfg = <1 3>;
+ 		clocks = <&clks IMX6UL_CLK_SAI2>;
+-		clock-names = "mclk";
++		clock-names = "mclk"; 
++        status = "disabled";
+ 	};
+ 
+ 	ov5640: ov5640@3c {
+@@ -301,21 +342,21 @@
  
  	display0: display@0 {
  		bits-per-pixel = <16>;
@@ -70,16 +99,39 @@
  				hsync-active = <0>;
  				vsync-active = <0>;
  				de-active = <1>;
-@@ -339,7 +367,7 @@
+@@ -332,6 +373,13 @@
+ 	status = "okay";
+ };
+ 
++&pwm2 {
++	#pwm-cells = <2>;
++	pinctrl-names = "default";
++	pinctrl-0 = <&pinctrl_pwm2>;
++	status = "okay";
++};
++
+ &pxp {
+ 	status = "okay";
+ };
+@@ -339,7 +387,7 @@
  &qspi {
  	pinctrl-names = "default";
  	pinctrl-0 = <&pinctrl_qspi>;
 -	status = "okay";
-+	status = "disabled";
++	status = "disabled"; /* disable it for the pins conflict with GPIO Led and Key */
  
  	flash0: n25q256a@0 {
  		#address-cells = <1>;
-@@ -463,6 +491,18 @@
+@@ -451,7 +499,7 @@
+ 	non-removable;
+ 	keep-power-in-suspend;
+ 	wakeup-source;
+-	status = "okay";
++	status = "disabled"; /* Not used */
+ };
+ 
+ &wdog1 {
+@@ -463,6 +511,18 @@
  &iomuxc {
  	pinctrl-names = "default";
  
@@ -98,9 +150,42 @@
  	pinctrl_csi1: csi1grp {
  		fsl,pins = <
  			MX6UL_PAD_CSI_MCLK__CSI_MCLK		0x1b088
+@@ -610,6 +670,12 @@
+ 		>;
+ 	};
+ 
++	pinctrl_pwm2: pwm2grp {
++		fsl,pins = <
++			MX6UL_PAD_GPIO1_IO09__PWM2_OUT   0x110b0
++		>;
++	};
++
+ 	pinctrl_sim2: sim2grp {
+ 		fsl,pins = <
+ 			MX6UL_PAD_CSI_DATA03__SIM2_PORT1_PD		0xb808
+@@ -679,8 +745,6 @@
+ 			MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 	0x17059
+ 			MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 	0x17059
+ 			MX6UL_PAD_UART1_RTS_B__GPIO1_IO19       0x17059 /* SD1 CD */
+-			MX6UL_PAD_GPIO1_IO05__USDHC1_VSELECT    0x17059 /* SD1 VSELECT */
+-			MX6UL_PAD_GPIO1_IO09__GPIO1_IO09        0x17059 /* SD1 RESET */
+ 		>;
+ 	};
+ 
+diff -Nuar -x include-prefixes -x logo_linux_clut224.ppm linux-imx/arch/arm/boot/dts/imx6ul.dtsi linux-imx-imx6ull/arch/arm/boot/dts/imx6ul.dtsi
+--- linux-imx/arch/arm/boot/dts/imx6ul.dtsi	2021-09-08 18:41:11.000000000 +0800
++++ linux-imx-imx6ull/arch/arm/boot/dts/imx6ul.dtsi	2021-11-17 20:39:10.582219267 +0800
+@@ -727,6 +727,7 @@
+ 					offset = <0x34>;
+ 					interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
+ 						     <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
++					status = "disabled"; /* disable CPU builtin RTC and will use ISL1208 */
+ 				};
+ 
+ 				snvs_poweroff: snvs-poweroff {
 diff -Nuar -x include-prefixes -x logo_linux_clut224.ppm linux-imx/.cfg-imx6ull linux-imx-imx6ull/.cfg-imx6ull
 --- linux-imx/.cfg-imx6ull	1970-01-01 08:00:00.000000000 +0800
-+++ linux-imx-imx6ull/.cfg-imx6ull	2021-11-16 23:33:46.661730470 +0800
++++ linux-imx-imx6ull/.cfg-imx6ull	2021-11-17 21:54:22.114060031 +0800
 @@ -0,0 +1,6910 @@
 +#
 +# Automatically generated file; DO NOT EDIT.
@@ -7014,7 +7099,7 @@
 +# end of Kernel hacking
 diff -Nuar -x include-prefixes -x logo_linux_clut224.ppm linux-imx/Makefile linux-imx-imx6ull/Makefile
 --- linux-imx/Makefile	2021-09-08 18:41:11.000000000 +0800
-+++ linux-imx-imx6ull/Makefile	2021-11-16 23:16:35.981472215 +0800
++++ linux-imx-imx6ull/Makefile	2021-11-17 21:49:34.243652949 +0800
 @@ -367,7 +367,8 @@
  # Alternatively CROSS_COMPILE can be set in the environment.
  # Default value for CROSS_COMPILE is not to prefix executables

--
Gitblit v1.9.1