diff --git a/linux-4.19/common_patch/hdf.patch b/linux-4.19/common_patch/hdf.patch index a94049873e1b391985ff621356a756c906bce550..c30b468c5489d4cf1c5ebad1b4ac54ed6983d07a 100644 --- a/linux-4.19/common_patch/hdf.patch +++ b/linux-4.19/common_patch/hdf.patch @@ -71,7 +71,7 @@ diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index bd7ac53b7..d7efd1e3d 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile -@@ -2,6 +2,15 @@ +@@ -2,6 +2,19 @@ # # Makefile for the HID driver # @@ -82,6 +82,10 @@ index bd7ac53b7..d7efd1e3d 100644 + $(HDF_ROOT_DIR)/framework/include/utils \ + $(HDF_ROOT_DIR)/framework/include/osal \ + $(HDF_ROOT_DIR)/framework/ability/sbuf/include \ ++ $(HDF_ROOT_DIR)/inner_api/utils \ ++ $(HDF_ROOT_DIR)/inner_api/osal/shared \ ++ $(HDF_ROOT_DIR)/inner_api/host/shared \ ++ $(HDF_ROOT_DIR)/inner_api/core \ + $(HDF_ROOT_DIR)/khdf/osal/include \ + -I../../../../../third_party/FreeBSD/sys/dev/evdev hid-y := hid-core.o hid-input.o hid-quirks.o diff --git a/linux-5.10/common_patch/hdf.patch b/linux-5.10/common_patch/hdf.patch index 47afa88160a7dc72f94b4d3c1f92276e4e642022..005bb6c44c3daa4ce186bf2af05b9c82bc485c93 100644 --- a/linux-5.10/common_patch/hdf.patch +++ b/linux-5.10/common_patch/hdf.patch @@ -73,7 +73,7 @@ diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 4acb583c9..ddcaf4cdc 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile -@@ -2,6 +2,15 @@ +@@ -2,6 +2,19 @@ # # Makefile for the HID driver # @@ -84,6 +84,10 @@ index 4acb583c9..ddcaf4cdc 100644 + $(HDF_ROOT_DIR)/framework/include/utils \ + $(HDF_ROOT_DIR)/framework/include/osal \ + $(HDF_ROOT_DIR)/framework/ability/sbuf/include \ ++ $(HDF_ROOT_DIR)/inner_api/utils \ ++ $(HDF_ROOT_DIR)/inner_api/osal/shared \ ++ $(HDF_ROOT_DIR)/inner_api/core \ ++ $(HDF_ROOT_DIR)/inner_api/host/shared \ + $(HDF_ROOT_DIR)/khdf/osal/include \ + $(HDF_ROOT_DIR)/evdev hid-y := hid-core.o hid-input.o hid-quirks.o diff --git a/linux-5.10/hispark_phoenix_patch/hispark_phoenix.patch b/linux-5.10/hispark_phoenix_patch/hispark_phoenix.patch index f6f82266ba0d78f093853883cdebfcfb37aebc9a..eae45a12929e0b5f050626beafbd6c3a5c070225 100644 --- a/linux-5.10/hispark_phoenix_patch/hispark_phoenix.patch +++ b/linux-5.10/hispark_phoenix_patch/hispark_phoenix.patch @@ -1,7 +1,7 @@ diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 -index 35ca90776..bce2c3d76 +index 748961c35..8ac4d1508 --- a/Makefile +++ b/Makefile @@ -212,6 +212,15 @@ ifndef KBUILD_CHECKSRC @@ -39,7 +39,7 @@ index 35ca90776..bce2c3d76 ifdef need-config include include/config/auto.conf -@@ -1570,7 +1578,7 @@ distclean: mrproper +@@ -1579,7 +1587,7 @@ distclean: mrproper \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ -o -name '*.bak' -o -name '#*#' -o -name '*%' \ -o -name 'core' \) \ @@ -69000,7 +69000,7 @@ index db7866b6f..30a26a6a9 100644 WARN(1, "called from state %s\n", phy_state_to_str(phydev->state)); diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c -index 85f3cde5f..c6914dda0 100644 +index d2f6d8107..a5495b6ed 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -2451,6 +2451,49 @@ int genphy_soft_reset(struct phy_device *phydev) @@ -392843,7 +392843,7 @@ index 000000000..c3578e2fc +#endif /* __HAL_SDIO_H_ */ diff --git a/drivers/net/wireless/rtl/usb_rtl8723du/rtl8723DU_WiFi_linux_v5.6.5.3_35502.20191025_COEX20181130-2e2e/include/ieee80211.h b/drivers/net/wireless/rtl/usb_rtl8723du/rtl8723DU_WiFi_linux_v5.6.5.3_35502.20191025_COEX20181130-2e2e/include/ieee80211.h new file mode 100644 -index 000000000..60af1d772 +index 000000000..8070e6d13 --- /dev/null +++ b/drivers/net/wireless/rtl/usb_rtl8723du/rtl8723DU_WiFi_linux_v5.6.5.3_35502.20191025_COEX20181130-2e2e/include/ieee80211.h @@ -0,0 +1,2204 @@ @@ -394465,18 +394465,18 @@ index 000000000..60af1d772 + (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ + (((Addr[5]) & 0xff) == 0xff)) +#else -+extern __inline int is_multicast_mac_addr(const u8 *addr) ++static __inline int is_multicast_mac_addr(const u8 *addr) +{ + return (addr[0] != 0xff) && (0x01 & addr[0]); +} + -+extern __inline int is_broadcast_mac_addr(const u8 *addr) ++static __inline int is_broadcast_mac_addr(const u8 *addr) +{ + return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ + (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); +} + -+extern __inline int is_zero_mac_addr(const u8 *addr) ++static __inline int is_zero_mac_addr(const u8 *addr) +{ + return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ + (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); @@ -490922,10 +490922,10 @@ index 40d7e98fc..0e3344cc7 struct mmc_cqe_ops { diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index a934282b1..384e38f0e 100644 +index c746566be..88014cc49 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -2028,6 +2028,7 @@ struct net_device { +@@ -2031,6 +2031,7 @@ struct net_device { /* * Cache lines mostly used on receive path (including eth_type_trans()) */ @@ -491131,7 +491131,7 @@ index dac65180c..8df9147d1 100644 diff --git a/scripts/Makefile.build b/scripts/Makefile.build old mode 100644 new mode 100755 -index d7cfd330a..fd4e50b46 +index 51aa32d58..f4a6959ef --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -111,7 +111,7 @@ endif @@ -491154,7 +491154,7 @@ index d7cfd330a..fd4e50b46 ifdef CONFIG_STACK_VALIDATION ifneq ($(SKIP_STACK_VALIDATION),1) -@@ -269,6 +273,7 @@ define rule_cc_o_c +@@ -275,6 +279,7 @@ define rule_cc_o_c $(call cmd_and_fixdep,cc_o_c) $(call cmd,gen_ksymdeps) $(call cmd,checksrc) diff --git a/linux-5.10/hispark_taurus_patch/hispark_taurus.patch b/linux-5.10/hispark_taurus_patch/hispark_taurus.patch index 04fdc7b0cea1474bb24e9c6903bfe6adfe49f0fb..5d33f9b093fa53d6d9f3744f68f1e68bc7d1122f 100755 --- a/linux-5.10/hispark_taurus_patch/hispark_taurus.patch +++ b/linux-5.10/hispark_taurus_patch/hispark_taurus.patch @@ -12341,13 +12341,13 @@ index c0a7f0d90..a5ca33ad8 100644 static void __init zone_sizes_init(unsigned long min, unsigned long max) diff --git a/drivers/Kconfig b/drivers/Kconfig -index 826b2b19d..96840663d 100644 +index abf8938eb..2e65f9182 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig -@@ -242,4 +242,11 @@ source "drivers/accesstokenid/Kconfig" - - source "drivers/hooks/Kconfig" - +@@ -244,4 +244,11 @@ source "drivers/hooks/Kconfig" + + source "drivers/hck/Kconfig" + +source "drivers/hidmac/Kconfig" + +source "drivers/hiedmac/Kconfig" @@ -12357,13 +12357,13 @@ index 826b2b19d..96840663d 100644 +source "drivers/hi_vdmav100/Kconfig" endmenu diff --git a/drivers/Makefile b/drivers/Makefile -index f13d70df6557..22c0f9f57eda 100644 +index d9e92b5e3..e9e62665f 100644 --- a/drivers/Makefile +++ b/drivers/Makefile -@@ -194,3 +194,7 @@ obj-$(CONFIG_COUNTER) += counter/ - obj-$(CONFIG_MOST) += most/ +@@ -195,3 +195,7 @@ obj-$(CONFIG_MOST) += most/ obj-$(CONFIG_ACCESS_TOKENID) += accesstokenid/ obj-$(CONFIG_VENDOR_HOOKS) += hooks/ + obj-$(CONFIG_HCK_VENDOR_HOOKS) += hck/ +obj-$(CONFIG_HI_DMAC) += hidmac/ +obj-$(CONFIG_HIEDMAC) += hiedmac/ +obj-$(CONFIG_ARCH_HISI_BVT) += hisilicon/ @@ -48888,7 +48888,7 @@ diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ether index 3616b77ca..883c5f5db 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c -@@ -2092,14 +2092,17 @@ static int mlx4_en_get_module_eeprom(struct net_device *dev, +@@ -2092,8 +2092,11 @@ static int mlx4_en_get_module_eeprom(struct net_device *dev, ret = mlx4_get_module_info(mdev->dev, priv->port, offset, ee->len - i, data + i); @@ -48901,13 +48901,6 @@ index 3616b77ca..883c5f5db 100644 if (ret < 0) { en_err(priv, - "mlx4_get_module_info i(%d) offset(%d) bytes_to_read(%d) - FAILED (0x%x)\n", - i, offset, ee->len - i, ret); -- return 0; -+ return ret; - } - - i += ret; diff --git a/drivers/net/mdio/Kconfig b/drivers/net/mdio/Kconfig index a10cc460d..42603264a 100644 --- a/drivers/net/mdio/Kconfig @@ -55331,7 +55324,7 @@ index b75fe5680..bec11c742 + * and each transcation length = 1024B, no any + * chain trb needed, so skip it. + */ -+ if (length == (3 * maxp)) ++ if (req->request.length == (3 * maxp)) + chain_skip = 1; } + if (speed == USB_SPEED_SUPER) diff --git a/linux-5.10/imx8mm_patch/hdf.patch b/linux-5.10/imx8mm_patch/hdf.patch index 1460c4fcb7384ceedb9e8109dbcbecef708ef8db..89945cf8f12ca8b131dc3ea02b5e49d4c2dbd479 100644 --- a/linux-5.10/imx8mm_patch/hdf.patch +++ b/linux-5.10/imx8mm_patch/hdf.patch @@ -54,7 +54,7 @@ diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 4acb583c9..ddcaf4cdc 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile -@@ -2,6 +2,15 @@ +@@ -2,6 +2,19 @@ # # Makefile for the HID driver # @@ -65,6 +65,10 @@ index 4acb583c9..ddcaf4cdc 100644 + $(HDF_ROOT_DIR)/framework/include/utils \ + $(HDF_ROOT_DIR)/framework/include/osal \ + $(HDF_ROOT_DIR)/framework/ability/sbuf/include \ ++ $(HDF_ROOT_DIR)/inner_api/utils \ ++ $(HDF_ROOT_DIR)/inner_api/osal/shared \ ++ $(HDF_ROOT_DIR)/inner_api/core \ ++ $(HDF_ROOT_DIR)/inner_api/host/shared \ + $(HDF_ROOT_DIR)/khdf/osal/include \ + $(HDF_ROOT_DIR)/evdev hid-y := hid-core.o hid-input.o hid-quirks.o diff --git a/linux-5.10/imx8mm_patch/patches/drivers/0037_linux_drivers_net.patch b/linux-5.10/imx8mm_patch/patches/drivers/0037_linux_drivers_net.patch index 1345fc9b2ff111951b1f967203d98473d23015c8..2e5ef3301cb50dd687392cc9c6ece81b972969e1 100644 --- a/linux-5.10/imx8mm_patch/patches/drivers/0037_linux_drivers_net.patch +++ b/linux-5.10/imx8mm_patch/patches/drivers/0037_linux_drivers_net.patch @@ -268,7 +268,7 @@ index de7b31842..fa7fb5f55 100644 obj-$(CONFIG_FEC_MPC52xx) += fec_mpc52xx.o ifeq ($(CONFIG_FEC_MPC52xx_MDIO),y) -@@ -19,9 +20,28 @@ gianfar_driver-objs := gianfar.o \ +@@ -19,9 +20,32 @@ gianfar_driver-objs := gianfar.o \ obj-$(CONFIG_UCC_GETH) += ucc_geth_driver.o ucc_geth_driver-objs := ucc_geth.o ucc_geth_ethtool.o @@ -293,6 +293,10 @@ index de7b31842..fa7fb5f55 100644 +ccflags-y += -I$(DRV_HDF_FRAMEWORK)/include/net/ +ccflags-y += -I$(DRV_HDF_FRAMEWORK)/include/osal/ +ccflags-y += -I$(DRV_HDF_FRAMEWORK)/include/utils/ ++ccflags-y += -I$(srctree)/drivers/hdf/inner_api/utils/ ++ccflags-y += -I$(srctree)/drivers/hdf/inner_api/osal/shared/ ++ccflags-y += -I$(srctree)/drivers/hdf/inner_api/core/ ++ccflags-y += -I$(srctree)/drivers/hdf/inner_api/host/shared/ +ccflags-y += -I$(DRV_HDF_FRAMEWORK)/model/network/common/netdevice/ +ccflags-y += -I$(DRV_HDF_FRAMEWORK)/model/network/ethernet/ +ccflags-y += -I$(srctree)/drivers/net/ethernet/freescale/ @@ -141703,7 +141707,7 @@ new file mode 100755 index 000000000..631c0c72d --- /dev/null +++ b/drivers/net/wireless/bcmdhd/Makefile -@@ -0,0 +1,217 @@ +@@ -0,0 +1,221 @@ +# bcmdhd + +MODULE_NAME := bcmdhd @@ -141726,6 +141730,10 @@ index 000000000..631c0c72d + -I $(srctree)/$(src)/../../../../drivers/hdf/framework/include/core \ + -I $(srctree)/$(src)/../../../../drivers/hdf/framework/include/wifi \ + -I $(srctree)/$(src)/../../../../drivers/hdf/framework/include/utils \ ++ -I $(srctree)/$(src)/../../../../drivers/hdf/inner_api/utils \ ++ -I $(srctree)/$(src)/../../../../drivers/hdf/inner_api/osal/shared \ ++ -I $(srctree)/$(src)/../../../../drivers/hdf/inner_api/core \ ++ -I $(srctree)/$(src)/../../../../drivers/hdf/inner_api/host/shared \ + -I $(srctree)/$(src)/../../../../drivers/hdf/framework/ability/sbuf/include \ + -I $(srctree)/$(src)/../../../../drivers/hdf/framework/core/common/include/host \ + -I $(srctree)/$(src)/../../../../drivers/hdf/framework/model/network/wifi/include \ diff --git a/linux-5.10/khdvk_3566b_patch/hdf.patch b/linux-5.10/khdvk_3566b_patch/hdf.patch index 1651f9d3b6c965904047dd9e8e2de0e4510d6ce9..a12aa6ad0937fca0710fc44513c8c8cbca5e769d 100644 --- a/linux-5.10/khdvk_3566b_patch/hdf.patch +++ b/linux-5.10/khdvk_3566b_patch/hdf.patch @@ -54,7 +54,7 @@ diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 4acb583c9..ddcaf4cdc 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile -@@ -2,6 +2,15 @@ +@@ -2,6 +2,19 @@ # # Makefile for the HID driver # @@ -65,6 +65,10 @@ index 4acb583c9..ddcaf4cdc 100644 + $(HDF_ROOT_DIR)/framework/include/utils \ + $(HDF_ROOT_DIR)/framework/include/osal \ + $(HDF_ROOT_DIR)/framework/ability/sbuf/include \ ++ $(HDF_ROOT_DIR)/inner_api/utils \ ++ $(HDF_ROOT_DIR)/inner_api/osal/shared \ ++ $(HDF_ROOT_DIR)/inner_api/host/shared \ ++ $(HDF_ROOT_DIR)/inner_api/core \ + $(HDF_ROOT_DIR)/khdf/osal/include \ + $(HDF_ROOT_DIR)/evdev hid-y := hid-core.o hid-input.o hid-quirks.o @@ -303,7 +307,7 @@ diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index a48e5f2d8..90d25f224 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile -@@ -85,3 +85,17 @@ obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND) += xen-kbdfront.o +@@ -85,3 +85,21 @@ obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND) += xen-kbdfront.o obj-$(CONFIG_INPUT_YEALINK) += yealink.o obj-$(CONFIG_INPUT_IDEAPAD_SLIDEBAR) += ideapad_slidebar.o @@ -318,6 +322,10 @@ index a48e5f2d8..90d25f224 100644 + -I$(srctree)/drivers/hdf/framework/core/host/include \ + -I$(srctree)/drivers/hdf/framework/core/shared/include \ + -I$(srctree)/drivers/hdf/framework/utils/include \ ++ -I$(srctree)/drivers/hdf/inner_api/osal/shared \ ++ -I$(srctree)/drivers/hdf/inner_api/host/shared \ ++ -I$(srctree)/drivers/hdf/inner_api/utils \ ++ -I$(srctree)/drivers/hdf/inner_api/core \ + -I$(srctree)/drivers/hdf/khdf/osal/include +ccflags-y +=-I$(srctree)/bounds_checking_function/include \ + -I$(srctree)/drivers/hdf/evdev diff --git a/linux-5.10/rk3568_patch/hdf.patch b/linux-5.10/rk3568_patch/hdf.patch index 1651f9d3b6c965904047dd9e8e2de0e4510d6ce9..a12aa6ad0937fca0710fc44513c8c8cbca5e769d 100644 --- a/linux-5.10/rk3568_patch/hdf.patch +++ b/linux-5.10/rk3568_patch/hdf.patch @@ -54,7 +54,7 @@ diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 4acb583c9..ddcaf4cdc 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile -@@ -2,6 +2,15 @@ +@@ -2,6 +2,19 @@ # # Makefile for the HID driver # @@ -65,6 +65,10 @@ index 4acb583c9..ddcaf4cdc 100644 + $(HDF_ROOT_DIR)/framework/include/utils \ + $(HDF_ROOT_DIR)/framework/include/osal \ + $(HDF_ROOT_DIR)/framework/ability/sbuf/include \ ++ $(HDF_ROOT_DIR)/inner_api/utils \ ++ $(HDF_ROOT_DIR)/inner_api/osal/shared \ ++ $(HDF_ROOT_DIR)/inner_api/host/shared \ ++ $(HDF_ROOT_DIR)/inner_api/core \ + $(HDF_ROOT_DIR)/khdf/osal/include \ + $(HDF_ROOT_DIR)/evdev hid-y := hid-core.o hid-input.o hid-quirks.o @@ -303,7 +307,7 @@ diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index a48e5f2d8..90d25f224 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile -@@ -85,3 +85,17 @@ obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND) += xen-kbdfront.o +@@ -85,3 +85,21 @@ obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND) += xen-kbdfront.o obj-$(CONFIG_INPUT_YEALINK) += yealink.o obj-$(CONFIG_INPUT_IDEAPAD_SLIDEBAR) += ideapad_slidebar.o @@ -318,6 +322,10 @@ index a48e5f2d8..90d25f224 100644 + -I$(srctree)/drivers/hdf/framework/core/host/include \ + -I$(srctree)/drivers/hdf/framework/core/shared/include \ + -I$(srctree)/drivers/hdf/framework/utils/include \ ++ -I$(srctree)/drivers/hdf/inner_api/osal/shared \ ++ -I$(srctree)/drivers/hdf/inner_api/host/shared \ ++ -I$(srctree)/drivers/hdf/inner_api/utils \ ++ -I$(srctree)/drivers/hdf/inner_api/core \ + -I$(srctree)/drivers/hdf/khdf/osal/include +ccflags-y +=-I$(srctree)/bounds_checking_function/include \ + -I$(srctree)/drivers/hdf/evdev diff --git a/linux-5.10/rk3568_patch/kernel.patch b/linux-5.10/rk3568_patch/kernel.patch index 4b13d130725ca9e9f751f261a6615e35dfdd0793..7533444bcc914181d11a61bef36ee0eb969e7023 100644 --- a/linux-5.10/rk3568_patch/kernel.patch +++ b/linux-5.10/rk3568_patch/kernel.patch @@ -90689,7 +90689,7 @@ index 000000000..9f346dc7e + +/ { + chosen: chosen { -+ bootargs = "earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 root=PARTUUID=614e0000-0000 hardware=rk3568 default_boot_device=fe310000.sdhci rw rootwait bootslots=2 ohos.required_mount.system=/dev/block/platform/fe310000.sdhci/by-name/system@/usr@ext4@ro,barrier=1@wait,required ohos.required_mount.vendor=/dev/block/platform/fe310000.sdhci/by-name/vendor@/vendor@ext4@ro,barrier=1@wait,required ohos.required_mount.misc=/dev/block/platform/fe310000.sdhci/by-name/misc@none@none@none@wait,required"; ++ bootargs = "earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 root=PARTUUID=614e0000-0000 hardware=rk3568 default_boot_device=fe310000.sdhci rw rootwait ohos.required_mount.system=/dev/block/platform/fe310000.sdhci/by-name/system@/usr@ext4@ro,barrier=1@wait,required ohos.required_mount.vendor=/dev/block/platform/fe310000.sdhci/by-name/vendor@/vendor@ext4@ro,barrier=1@wait,required ohos.required_mount.misc=/dev/block/platform/fe310000.sdhci/by-name/misc@none@none@none@wait,required ohos.required_mount.bootctrl=/dev/block/platform/fe310000.sdhci/by-name/bootctrl@none@none@none@wait,required"; + }; + + fiq-debugger { @@ -103561,25 +103561,25 @@ index 4999caff3..b47d477f4 100644 * UpdateCapsule() depends on the system being reset via * ResetSystem(). diff --git a/drivers/Kconfig b/drivers/Kconfig -index 12e0cceac..e683e9f1e 100644 +index abf8938eb..9030ee25e 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig -@@ -244,4 +244,7 @@ source "drivers/accesstokenid/Kconfig" +@@ -244,4 +244,7 @@ source "drivers/hooks/Kconfig" - source "drivers/hooks/Kconfig" + source "drivers/hck/Kconfig" +source "drivers/rkflash/Kconfig" + +source "drivers/rk_nand/Kconfig" endmenu diff --git a/drivers/Makefile b/drivers/Makefile -index 8ec75883a..5ffe117f9 100644 +index d9e92b5e3..6f650fb1c 100644 --- a/drivers/Makefile +++ b/drivers/Makefile -@@ -195,3 +195,5 @@ obj-$(CONFIG_DRIVERS_HDF) += hdf/ - obj-$(CONFIG_MOST) += most/ +@@ -195,3 +195,5 @@ obj-$(CONFIG_MOST) += most/ obj-$(CONFIG_ACCESS_TOKENID) += accesstokenid/ obj-$(CONFIG_VENDOR_HOOKS) += hooks/ + obj-$(CONFIG_HCK_VENDOR_HOOKS) += hck/ +obj-$(CONFIG_RK_FLASH) += rkflash/ +obj-$(CONFIG_RK_NAND) += rk_nand/ diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c @@ -121490,7 +121490,7 @@ deleted file mode 100644 index 2e912166a..000000000 --- a/drivers/devfreq/rk3399_dmc.c +++ /dev/null -@@ -1,516 +0,0 @@ +@@ -1,518 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2016, Fuzhou Rockchip Electronics Co., Ltd. @@ -121978,6 +121978,8 @@ index 2e912166a..000000000 -{ - struct rk3399_dmcfreq *dmcfreq = dev_get_drvdata(&pdev->dev); - +- devfreq_event_disable_edev(dmcfreq->edev); +- - /* - * Before remove the opp table we need to unregister the opp notifier. - */ @@ -464328,9 +464330,9 @@ index aa1bb8629..4a1e90bdd 100644 } } - } - -- analogix_dp_get_adjust_training_lane(dp, adjust_request); - +- analogix_dp_get_adjust_training_lane(dp, adjust_request); + - for (lane = 0; lane < lane_count; lane++) - analogix_dp_set_lane_link_training(dp, - dp->link_train.training_lane[lane], lane); @@ -464764,8 +464766,8 @@ index aa1bb8629..4a1e90bdd 100644 if (!bridge->encoder) { DRM_ERROR("Parent encoder object not found"); -@@ -1268,6 +1282,14 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge, - return 0; +@@ -1287,6 +1301,14 @@ struct drm_crtc *analogix_dp_get_old_crtc(struct analogix_dp_device *dp, + return conn_state->crtc; } +static void analogix_dp_bridge_detach(struct drm_bridge *bridge) @@ -464779,7 +464781,7 @@ index aa1bb8629..4a1e90bdd 100644 static struct drm_crtc *analogix_dp_get_new_crtc(struct analogix_dp_device *dp, struct drm_atomic_state *state) -@@ -1295,20 +1317,20 @@ analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge, +@@ -1314,20 +1336,20 @@ analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge, struct analogix_dp_device *dp = bridge->driver_private; struct drm_crtc *crtc; struct drm_crtc_state *old_crtc_state; @@ -464811,7 +464813,7 @@ index aa1bb8629..4a1e90bdd 100644 } static int analogix_dp_set_bridge(struct analogix_dp_device *dp) -@@ -1317,16 +1339,10 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) +@@ -1336,16 +1358,10 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) pm_runtime_get_sync(dp->dev); @@ -464829,7 +464831,7 @@ index aa1bb8629..4a1e90bdd 100644 ret = analogix_dp_init_dp(dp); if (ret) -@@ -1344,11 +1360,14 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) +@@ -1363,11 +1379,14 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) } ret = analogix_dp_commit(dp); @@ -464845,7 +464847,7 @@ index aa1bb8629..4a1e90bdd 100644 if (dp->plat_data->power_on_end) dp->plat_data->power_on_end(dp->plat_data); -@@ -1356,11 +1375,9 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) +@@ -1375,11 +1394,9 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) return 0; out_dp_init: @@ -464858,7 +464860,7 @@ index aa1bb8629..4a1e90bdd 100644 pm_runtime_put_sync(dp->dev); return ret; -@@ -1377,17 +1394,19 @@ analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge, +@@ -1396,17 +1413,19 @@ analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge, int timeout_loop = 0; int ret; @@ -464888,7 +464890,7 @@ index aa1bb8629..4a1e90bdd 100644 } if (dp->dpms_mode == DRM_MODE_DPMS_ON) -@@ -1409,7 +1428,6 @@ analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge, +@@ -1428,7 +1447,6 @@ analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge, static void analogix_dp_bridge_disable(struct drm_bridge *bridge) { struct analogix_dp_device *dp = bridge->driver_private; @@ -464896,7 +464898,7 @@ index aa1bb8629..4a1e90bdd 100644 if (dp->dpms_mode != DRM_MODE_DPMS_ON) return; -@@ -1426,16 +1444,14 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge) +@@ -1445,16 +1463,14 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge) if (dp->plat_data->power_off) dp->plat_data->power_off(dp->plat_data); @@ -464917,7 +464919,7 @@ index aa1bb8629..4a1e90bdd 100644 dp->fast_train_enable = false; dp->psr_supported = false; -@@ -1492,14 +1508,19 @@ analogix_dp_bridge_atomic_post_disable(struct drm_bridge *bridge, +@@ -1526,14 +1542,19 @@ analogix_dp_bridge_atomic_post_disable(struct drm_bridge *bridge, static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge, const struct drm_display_mode *orig_mode, @@ -464938,7 +464940,7 @@ index aa1bb8629..4a1e90bdd 100644 /* Input video interlaces & hsync pol & vsync pol */ video->interlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); video->v_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NVSYNC); -@@ -1567,6 +1588,27 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge, +@@ -1601,6 +1622,27 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge, video->interlaced = true; } @@ -464966,7 +464968,7 @@ index aa1bb8629..4a1e90bdd 100644 static const struct drm_bridge_funcs analogix_dp_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, -@@ -1577,29 +1619,30 @@ static const struct drm_bridge_funcs analogix_dp_bridge_funcs = { +@@ -1611,29 +1653,30 @@ static const struct drm_bridge_funcs analogix_dp_bridge_funcs = { .atomic_post_disable = analogix_dp_bridge_atomic_post_disable, .mode_set = analogix_dp_bridge_mode_set, .attach = analogix_dp_bridge_attach, @@ -465012,7 +465014,7 @@ index aa1bb8629..4a1e90bdd 100644 } return 0; -@@ -1612,7 +1655,7 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) +@@ -1646,7 +1689,7 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) switch (dp->plat_data->dev_type) { case RK3288_DP: @@ -465021,7 +465023,7 @@ index aa1bb8629..4a1e90bdd 100644 /* * Like Rk3288 DisplayPort TRM indicate that "Main link * containing 4 physical lanes of 2.7/1.62 Gbps/lane". -@@ -1620,6 +1663,11 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) +@@ -1654,6 +1697,11 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) video_info->max_link_rate = 0x0A; video_info->max_lane_count = 0x04; break; @@ -465033,7 +465035,7 @@ index aa1bb8629..4a1e90bdd 100644 case EXYNOS_DP: /* * NOTE: those property parseing code is used for -@@ -1632,6 +1680,9 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) +@@ -1666,6 +1714,9 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) break; } @@ -465043,8 +465045,8 @@ index aa1bb8629..4a1e90bdd 100644 return 0; } -@@ -1643,13 +1694,72 @@ static ssize_t analogix_dpaux_transfer(struct drm_dp_aux *aux, - return analogix_dp_transfer(dp, msg); +@@ -1688,13 +1739,72 @@ static ssize_t analogix_dpaux_transfer(struct drm_dp_aux *aux, + return ret; } +int analogix_dp_audio_hw_params(struct analogix_dp_device *dp, @@ -465117,7 +465119,7 @@ index aa1bb8629..4a1e90bdd 100644 int ret; if (!plat_data) { -@@ -1665,7 +1775,7 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) +@@ -1710,7 +1820,7 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) dp->dpms_mode = DRM_MODE_DPMS_OFF; mutex_init(&dp->panel_lock); @@ -465126,7 +465128,7 @@ index aa1bb8629..4a1e90bdd 100644 /* * platform dp driver need containor_of the plat_data to get -@@ -1694,13 +1804,13 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) +@@ -1739,13 +1849,13 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) } } @@ -465145,7 +465147,7 @@ index aa1bb8629..4a1e90bdd 100644 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -@@ -1722,34 +1832,38 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) +@@ -1770,40 +1880,44 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) } if (dp->hpd_gpiod) { @@ -465178,7 +465180,8 @@ index aa1bb8629..4a1e90bdd 100644 + dp->irq = platform_get_irq(pdev, 0); if (dp->irq == -ENXIO) { dev_err(&pdev->dev, "failed to get irq\n"); - return ERR_PTR(-ENODEV); + ret = -ENODEV; + goto err_disable_clk; } + irq_set_status_flags(dp->irq, IRQ_NOAUTOEN); @@ -465189,7 +465192,7 @@ index aa1bb8629..4a1e90bdd 100644 + 0, "analogix-dp", dp); if (ret) { dev_err(&pdev->dev, "failed to request irq\n"); - return ERR_PTR(ret); + goto err_disable_clk; } - disable_irq(dp->irq); + @@ -465197,8 +465200,14 @@ index aa1bb8629..4a1e90bdd 100644 + dp->bridge.funcs = &analogix_dp_bridge_funcs; return dp; + + err_disable_clk: +- clk_disable_unprepare(dp->clock); ++ clk_bulk_disable_unprepare(dp->nr_clks, dp->clks); + return ERR_PTR(ret); } -@@ -1772,9 +1886,9 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev) + EXPORT_SYMBOL_GPL(analogix_dp_probe); +@@ -1825,9 +1939,9 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev) pm_runtime_enable(dp->dev); @@ -465210,7 +465219,7 @@ index aa1bb8629..4a1e90bdd 100644 goto err_disable_pm_runtime; } -@@ -1789,14 +1903,7 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind); +@@ -1842,14 +1956,7 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind); void analogix_dp_unbind(struct analogix_dp_device *dp) { @@ -465225,7 +465234,7 @@ index aa1bb8629..4a1e90bdd 100644 drm_dp_aux_unregister(&dp->aux); pm_runtime_disable(dp->dev); } -@@ -1804,45 +1911,22 @@ EXPORT_SYMBOL_GPL(analogix_dp_unbind); +@@ -1857,32 +1964,21 @@ EXPORT_SYMBOL_GPL(analogix_dp_unbind); void analogix_dp_remove(struct analogix_dp_device *dp) { @@ -465238,13 +465247,7 @@ index aa1bb8629..4a1e90bdd 100644 +int analogix_dp_runtime_suspend(struct analogix_dp_device *dp) { - clk_disable_unprepare(dp->clock); -- -- if (dp->plat_data->panel) { -- if (drm_panel_unprepare(dp->plat_data->panel)) -- DRM_ERROR("failed to turnoff the panel\n"); -- } + clk_bulk_disable_unprepare(dp->nr_clks, dp->clks); - return 0; } -EXPORT_SYMBOL_GPL(analogix_dp_suspend); @@ -465261,13 +465264,6 @@ index aa1bb8629..4a1e90bdd 100644 - return ret; - } - -- if (dp->plat_data->panel) { -- if (drm_panel_prepare(dp->plat_data->panel)) { -- DRM_ERROR("failed to setup the panel\n"); -- return -EBUSY; -- } -- } -- - return 0; + return clk_bulk_prepare_enable(dp->nr_clks, dp->clks); } @@ -472159,7 +472155,7 @@ index 0c79a9ba4..52374e943 100644 config3 = hdmi_readb(hdmi, HDMI_CONFIG3_ID); -@@ -1005,6 +1307,15 @@ static bool is_csc_needed(struct dw_hdmi *hdmi) +@@ -1013,6 +1315,15 @@ static bool is_csc_needed(struct dw_hdmi *hdmi) is_color_space_interpolation(hdmi); } @@ -472175,7 +472171,7 @@ index 0c79a9ba4..52374e943 100644 static void dw_hdmi_update_csc_coeffs(struct dw_hdmi *hdmi) { const u16 (*csc_coeff)[3][4] = &csc_coeff_default; -@@ -1027,7 +1338,7 @@ static void dw_hdmi_update_csc_coeffs(struct dw_hdmi *hdmi) +@@ -1035,7 +1346,7 @@ static void dw_hdmi_update_csc_coeffs(struct dw_hdmi *hdmi) csc_coeff = &csc_coeff_rgb_in_eitu709; csc_scale = 0; } else if (is_input_rgb && is_output_rgb && @@ -472184,7 +472180,7 @@ index 0c79a9ba4..52374e943 100644 csc_coeff = &csc_coeff_rgb_full_to_rgb_limited; } -@@ -1059,7 +1370,7 @@ static void hdmi_video_csc(struct dw_hdmi *hdmi) +@@ -1067,7 +1378,7 @@ static void hdmi_video_csc(struct dw_hdmi *hdmi) if (is_color_space_interpolation(hdmi)) interpolation = HDMI_CSC_CFG_INTMODE_CHROMA_INT_FORMULA1; else if (is_color_space_decimation(hdmi)) @@ -472193,7 +472189,7 @@ index 0c79a9ba4..52374e943 100644 switch (hdmi_bus_fmt_color_depth(hdmi->hdmi_data.enc_out_bus_format)) { case 8: -@@ -1106,7 +1417,7 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) +@@ -1114,7 +1425,7 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) switch (hdmi_bus_fmt_color_depth( hdmi->hdmi_data.enc_out_bus_format)) { case 8: @@ -472202,7 +472198,7 @@ index 0c79a9ba4..52374e943 100644 output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS; break; case 10: -@@ -1144,18 +1455,15 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) +@@ -1152,18 +1463,15 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) } /* set the packetizer registers */ @@ -472224,7 +472220,7 @@ index 0c79a9ba4..52374e943 100644 vp_conf = HDMI_VP_CONF_PR_EN_ENABLE | HDMI_VP_CONF_BYPASS_SELECT_PIX_REPEATER; } else { /* data from packetizer block */ -@@ -1167,8 +1475,13 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) +@@ -1175,8 +1483,13 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) HDMI_VP_CONF_PR_EN_MASK | HDMI_VP_CONF_BYPASS_SELECT_MASK, HDMI_VP_CONF); @@ -472240,7 +472236,7 @@ index 0c79a9ba4..52374e943 100644 hdmi_writeb(hdmi, remap_size, HDMI_VP_REMAP); -@@ -1269,6 +1582,23 @@ static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi, +@@ -1277,6 +1590,23 @@ static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi, return true; } @@ -472264,7 +472260,7 @@ index 0c79a9ba4..52374e943 100644 /* * HDMI2.0 Specifies the following procedure for High TMDS Bit Rates: * - The Source shall suspend transmission of the TMDS clock and data -@@ -1446,6 +1776,13 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, +@@ -1454,6 +1784,13 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, const struct dw_hdmi_mpll_config *mpll_config = pdata->mpll_cfg; const struct dw_hdmi_curr_ctrl *curr_ctrl = pdata->cur_ctr; const struct dw_hdmi_phy_config *phy_config = pdata->phy_config; @@ -472278,7 +472274,7 @@ index 0c79a9ba4..52374e943 100644 /* TOFIX Will need 420 specific PHY configuration tables */ -@@ -1455,11 +1792,11 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, +@@ -1463,11 +1800,11 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, break; for (; curr_ctrl->mpixelclock != ~0UL; curr_ctrl++) @@ -472292,7 +472288,7 @@ index 0c79a9ba4..52374e943 100644 break; if (mpll_config->mpixelclock == ~0UL || -@@ -1467,11 +1804,18 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, +@@ -1475,11 +1812,18 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, phy_config->mpixelclock == ~0UL) return -EINVAL; @@ -472314,7 +472310,7 @@ index 0c79a9ba4..52374e943 100644 HDMI_3D_TX_PHY_CURRCTRL); dw_hdmi_phy_i2c_write(hdmi, 0, HDMI_3D_TX_PHY_PLLPHBYCTRL); -@@ -1484,10 +1828,6 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, +@@ -1492,10 +1836,6 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, dw_hdmi_phy_i2c_write(hdmi, phy_config->vlev_ctr, HDMI_3D_TX_PHY_VLEVCTRL); @@ -472325,7 +472321,7 @@ index 0c79a9ba4..52374e943 100644 return 0; } -@@ -1589,14 +1929,16 @@ void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data) +@@ -1597,14 +1937,16 @@ void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data) hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE, HDMI_IH_PHY_STAT0); @@ -472349,7 +472345,7 @@ index 0c79a9ba4..52374e943 100644 } EXPORT_SYMBOL_GPL(dw_hdmi_phy_setup_hpd); -@@ -1612,23 +1954,36 @@ static const struct dw_hdmi_phy_ops dw_hdmi_synopsys_phy_ops = { +@@ -1620,23 +1962,36 @@ static const struct dw_hdmi_phy_ops dw_hdmi_synopsys_phy_ops = { * HDMI TX Setup */ @@ -472402,7 +472398,7 @@ index 0c79a9ba4..52374e943 100644 } static void hdmi_config_AVI(struct dw_hdmi *hdmi, -@@ -1642,10 +1997,15 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, +@@ -1650,10 +2005,15 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, drm_hdmi_avi_infoframe_from_display_mode(&frame, connector, mode); if (hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format)) { @@ -472422,7 +472418,7 @@ index 0c79a9ba4..52374e943 100644 } else { frame.quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT; frame.ycc_quantization_range = -@@ -1680,6 +2040,14 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, +@@ -1688,6 +2048,14 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, frame.extended_colorimetry = HDMI_EXTENDED_COLORIMETRY_XV_YCC_709; break; @@ -472437,7 +472433,7 @@ index 0c79a9ba4..52374e943 100644 default: /* Carries no data */ frame.colorimetry = HDMI_COLORIMETRY_ITU_601; frame.extended_colorimetry = -@@ -1816,17 +2184,44 @@ static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi, +@@ -1824,17 +2192,44 @@ static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi, const struct drm_connector *connector) { const struct drm_connector_state *conn_state = connector->state; @@ -472482,7 +472478,7 @@ index 0c79a9ba4..52374e943 100644 err = drm_hdmi_infoframe_set_hdr_metadata(&frame, conn_state); if (err < 0) return; -@@ -1846,51 +2241,66 @@ static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi, +@@ -1854,51 +2249,66 @@ static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi, hdmi_writeb(hdmi, 1, HDMI_FC_DRM_UP); hdmi_modb(hdmi, HDMI_FC_PACKET_TX_EN_DRM_ENABLE, HDMI_FC_PACKET_TX_EN_DRM_MASK, HDMI_FC_PACKET_TX_EN); @@ -472576,7 +472572,7 @@ index 0c79a9ba4..52374e943 100644 inv_val |= mode->flags & DRM_MODE_FLAG_PVSYNC ? HDMI_FC_INVIDCONF_VSYNC_IN_POLARITY_ACTIVE_HIGH : -@@ -1956,7 +2366,8 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, +@@ -1964,7 +2374,8 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, /* Scrambling Control */ if (dw_hdmi_support_scdc(hdmi, display)) { if (vmode->mtmdsclock > HDMI14_MAX_TMDSCLK || @@ -472586,7 +472582,7 @@ index 0c79a9ba4..52374e943 100644 /* * HDMI2.0 Specifies the following procedure: * After the Source Device has determined that -@@ -1990,6 +2401,8 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, +@@ -1998,6 +2409,8 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, HDMI_MC_SWRSTZ); drm_scdc_set_scrambling(hdmi->ddc, 0); } @@ -472595,7 +472591,7 @@ index 0c79a9ba4..52374e943 100644 } /* Set up horizontal active pixel width */ -@@ -2047,6 +2460,12 @@ static void dw_hdmi_enable_video_path(struct dw_hdmi *hdmi) +@@ -2055,6 +2468,12 @@ static void dw_hdmi_enable_video_path(struct dw_hdmi *hdmi) hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_TMDSCLK_DISABLE; hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS); @@ -472608,7 +472604,7 @@ index 0c79a9ba4..52374e943 100644 /* Enable csc path */ if (is_csc_needed(hdmi)) { hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_CSCCLK_DISABLE; -@@ -2122,6 +2541,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, +@@ -2130,6 +2549,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, const struct drm_display_mode *mode) { int ret; @@ -472616,7 +472612,7 @@ index 0c79a9ba4..52374e943 100644 hdmi_disable_overflow_interrupts(hdmi); -@@ -2133,48 +2553,91 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, +@@ -2141,48 +2561,91 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, dev_dbg(hdmi->dev, "CEA mode used vic=%d\n", hdmi->vic); } @@ -472727,7 +472723,7 @@ index 0c79a9ba4..52374e943 100644 /* HDMI Initialization Step B.3 */ dw_hdmi_enable_video_path(hdmi); -@@ -2202,7 +2665,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, +@@ -2210,7 +2673,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, hdmi_video_packetize(hdmi); hdmi_video_csc(hdmi); hdmi_video_sample(hdmi); @@ -472736,7 +472732,7 @@ index 0c79a9ba4..52374e943 100644 dw_hdmi_clear_overflow(hdmi); -@@ -2278,6 +2741,8 @@ static void dw_hdmi_poweroff(struct dw_hdmi *hdmi) +@@ -2286,6 +2749,8 @@ static void dw_hdmi_poweroff(struct dw_hdmi *hdmi) hdmi->phy.enabled = false; } @@ -472745,7 +472741,7 @@ index 0c79a9ba4..52374e943 100644 hdmi->bridge_is_on = false; } -@@ -2295,6 +2760,10 @@ static void dw_hdmi_update_power(struct dw_hdmi *hdmi) +@@ -2303,6 +2768,10 @@ static void dw_hdmi_update_power(struct dw_hdmi *hdmi) } if (force == DRM_FORCE_OFF) { @@ -472756,7 +472752,7 @@ index 0c79a9ba4..52374e943 100644 if (hdmi->bridge_is_on) dw_hdmi_poweroff(hdmi); } else { -@@ -2327,8 +2796,15 @@ static enum drm_connector_status dw_hdmi_detect(struct dw_hdmi *hdmi) +@@ -2335,8 +2804,15 @@ static enum drm_connector_status dw_hdmi_detect(struct dw_hdmi *hdmi) { enum drm_connector_status result; @@ -472773,7 +472769,7 @@ index 0c79a9ba4..52374e943 100644 mutex_lock(&hdmi->mutex); if (result != hdmi->last_connector_result) { dev_dbg(hdmi->dev, "read_hpd result: %d", result); -@@ -2338,6 +2814,11 @@ static enum drm_connector_status dw_hdmi_detect(struct dw_hdmi *hdmi) +@@ -2346,6 +2822,11 @@ static enum drm_connector_status dw_hdmi_detect(struct dw_hdmi *hdmi) } mutex_unlock(&hdmi->mutex); @@ -472785,7 +472781,7 @@ index 0c79a9ba4..52374e943 100644 return result; } -@@ -2358,7 +2839,7 @@ static struct edid *dw_hdmi_get_edid(struct dw_hdmi *hdmi, +@@ -2366,7 +2847,7 @@ static struct edid *dw_hdmi_get_edid(struct dw_hdmi *hdmi, dev_dbg(hdmi->dev, "got edid: width[%d] x height[%d]\n", edid->width_cm, edid->height_cm); @@ -472794,7 +472790,7 @@ index 0c79a9ba4..52374e943 100644 hdmi->sink_has_audio = drm_detect_monitor_audio(edid); return edid; -@@ -2376,21 +2857,105 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force) +@@ -2384,21 +2865,105 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force) return dw_hdmi_detect(hdmi); } @@ -472907,7 +472903,7 @@ index 0c79a9ba4..52374e943 100644 return ret; } -@@ -2419,11 +2984,54 @@ static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, +@@ -2427,11 +2992,54 @@ static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, drm_atomic_get_new_connector_state(state, connector); struct drm_crtc *crtc = new_state->crtc; struct drm_crtc_state *crtc_state; @@ -472963,7 +472959,7 @@ index 0c79a9ba4..52374e943 100644 crtc_state = drm_atomic_get_crtc_state(state, crtc); if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); -@@ -2434,12 +3042,105 @@ static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, +@@ -2442,12 +3050,105 @@ static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, return 0; } @@ -473069,7 +473065,7 @@ index 0c79a9ba4..52374e943 100644 hdmi->force = connector->force; dw_hdmi_update_power(hdmi); dw_hdmi_update_phy_mask(hdmi); -@@ -2452,15 +3153,98 @@ static const struct drm_connector_funcs dw_hdmi_connector_funcs = { +@@ -2460,15 +3161,98 @@ static const struct drm_connector_funcs dw_hdmi_connector_funcs = { .destroy = drm_connector_cleanup, .force = dw_hdmi_connector_force, .reset = drm_atomic_helper_connector_reset, @@ -473168,7 +473164,7 @@ index 0c79a9ba4..52374e943 100644 static int dw_hdmi_connector_create(struct dw_hdmi *hdmi) { struct drm_connector *connector = &hdmi->connector; -@@ -2497,6 +3281,8 @@ static int dw_hdmi_connector_create(struct dw_hdmi *hdmi) +@@ -2505,6 +3289,8 @@ static int dw_hdmi_connector_create(struct dw_hdmi *hdmi) drm_connector_attach_encoder(connector, hdmi->bridge.encoder); @@ -473177,7 +473173,7 @@ index 0c79a9ba4..52374e943 100644 cec_fill_conn_info_from_drm(&conn_info, connector); notifier = cec_notifier_conn_register(hdmi->dev, NULL, &conn_info); -@@ -2771,16 +3557,36 @@ static int dw_hdmi_bridge_atomic_check(struct drm_bridge *bridge, +@@ -2780,16 +3566,36 @@ static int dw_hdmi_bridge_atomic_check(struct drm_bridge *bridge, struct drm_connector_state *conn_state) { struct dw_hdmi *hdmi = bridge->driver_private; @@ -473221,7 +473217,7 @@ index 0c79a9ba4..52374e943 100644 return 0; } -@@ -2789,10 +3595,22 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge, +@@ -2798,10 +3604,22 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flags flags) { struct dw_hdmi *hdmi = bridge->driver_private; @@ -473244,7 +473240,7 @@ index 0c79a9ba4..52374e943 100644 return dw_hdmi_connector_create(hdmi); } -@@ -2812,17 +3630,16 @@ dw_hdmi_bridge_mode_valid(struct drm_bridge *bridge, +@@ -2821,17 +3639,16 @@ dw_hdmi_bridge_mode_valid(struct drm_bridge *bridge, const struct drm_display_mode *mode) { struct dw_hdmi *hdmi = bridge->driver_private; @@ -473267,7 +473263,7 @@ index 0c79a9ba4..52374e943 100644 return mode_status; } -@@ -2903,6 +3720,12 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = { +@@ -2912,6 +3729,12 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = { .get_edid = dw_hdmi_bridge_get_edid, }; @@ -473280,7 +473276,7 @@ index 0c79a9ba4..52374e943 100644 /* ----------------------------------------------------------------------------- * IRQ Handling */ -@@ -2928,7 +3751,7 @@ static irqreturn_t dw_hdmi_i2c_irq(struct dw_hdmi *hdmi) +@@ -2937,7 +3760,7 @@ static irqreturn_t dw_hdmi_i2c_irq(struct dw_hdmi *hdmi) static irqreturn_t dw_hdmi_hardirq(int irq, void *dev_id) { struct dw_hdmi *hdmi = dev_id; @@ -473289,7 +473285,7 @@ index 0c79a9ba4..52374e943 100644 irqreturn_t ret = IRQ_NONE; if (hdmi->i2c) -@@ -2940,6 +3763,13 @@ static irqreturn_t dw_hdmi_hardirq(int irq, void *dev_id) +@@ -2949,6 +3772,13 @@ static irqreturn_t dw_hdmi_hardirq(int irq, void *dev_id) return IRQ_WAKE_THREAD; } @@ -473303,7 +473299,7 @@ index 0c79a9ba4..52374e943 100644 return ret; } -@@ -2947,7 +3777,7 @@ void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense) +@@ -2956,7 +3786,7 @@ void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense) { mutex_lock(&hdmi->mutex); @@ -473312,24 +473308,21 @@ index 0c79a9ba4..52374e943 100644 /* * If the RX sense status indicates we're disconnected, * clear the software rxsense status. -@@ -2974,7 +3804,7 @@ EXPORT_SYMBOL_GPL(dw_hdmi_setup_rx_sense); +@@ -2983,7 +3813,7 @@ EXPORT_SYMBOL_GPL(dw_hdmi_setup_rx_sense); static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) { struct dw_hdmi *hdmi = dev_id; - u8 intr_stat, phy_int_pol, phy_pol_mask, phy_stat; + u8 intr_stat, phy_int_pol, phy_pol_mask, phy_stat, hdcp_stat; + enum drm_connector_status status = connector_status_unknown; intr_stat = hdmi_readb(hdmi, HDMI_IH_PHY_STAT0); - phy_int_pol = hdmi_readb(hdmi, HDMI_PHY_POL0); -@@ -3015,25 +3845,21 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) - } +@@ -3030,22 +3860,21 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) + if (!(phy_stat & (HDMI_PHY_HPD | HDMI_PHY_RX_SENSE))) + status = connector_status_disconnected; } - -- if (intr_stat & HDMI_IH_PHY_STAT0_HPD) { -- enum drm_connector_status status = phy_int_pol & HDMI_PHY_HPD -- ? connector_status_connected -- : connector_status_disconnected; - +- if (status != connector_status_unknown) { - dev_dbg(hdmi->dev, "EVENT=%s\n", - status == connector_status_connected ? - "plugin" : "plugout"); @@ -473360,7 +473353,7 @@ index 0c79a9ba4..52374e943 100644 return IRQ_HANDLED; } -@@ -3167,12 +3993,363 @@ static void dw_hdmi_init_hw(struct dw_hdmi *hdmi) +@@ -3179,12 +4008,363 @@ static void dw_hdmi_init_hw(struct dw_hdmi *hdmi) * Even if we are using a separate i2c adapter doing this doesn't * hurt. */ @@ -473725,7 +473718,7 @@ index 0c79a9ba4..52374e943 100644 /* ----------------------------------------------------------------------------- * Probe/remove API, used from platforms based on the DRM bridge API. */ -@@ -3181,6 +4358,7 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3193,6 +4373,7 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; @@ -473733,7 +473726,7 @@ index 0c79a9ba4..52374e943 100644 struct platform_device_info pdevinfo; struct device_node *ddc_node; struct dw_hdmi_cec_data cec; -@@ -3193,11 +4371,13 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3205,11 +4386,13 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, u8 prod_id1; u8 config0; u8 config3; @@ -473747,7 +473740,7 @@ index 0c79a9ba4..52374e943 100644 hdmi->plat_data = plat_data; hdmi->dev = dev; hdmi->sample_rate = 48000; -@@ -3328,7 +4508,24 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3340,7 +4523,24 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, prod_id1 & HDMI_PRODUCT_ID1_HDCP ? "with" : "without", hdmi->phy.name); @@ -473773,7 +473766,7 @@ index 0c79a9ba4..52374e943 100644 irq = platform_get_irq(pdev, 0); if (irq < 0) { -@@ -3336,6 +4533,7 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3348,6 +4548,7 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, goto err_iahb; } @@ -473781,7 +473774,7 @@ index 0c79a9ba4..52374e943 100644 ret = devm_request_threaded_irq(dev, irq, dw_hdmi_hardirq, dw_hdmi_irq, IRQF_SHARED, dev_name(dev), hdmi); -@@ -3371,8 +4569,20 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3383,8 +4584,20 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, hdmi->ddc = dw_hdmi_i2c_adapter(hdmi); if (IS_ERR(hdmi->ddc)) hdmi->ddc = NULL; @@ -473802,7 +473795,7 @@ index 0c79a9ba4..52374e943 100644 hdmi->bridge.driver_private = hdmi; hdmi->bridge.funcs = &dw_hdmi_bridge_funcs; hdmi->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID -@@ -3381,6 +4591,30 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3393,6 +4606,30 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, hdmi->bridge.of_node = pdev->dev.of_node; #endif @@ -473833,7 +473826,7 @@ index 0c79a9ba4..52374e943 100644 memset(&pdevinfo, 0, sizeof(pdevinfo)); pdevinfo.parent = dev; pdevinfo.id = PLATFORM_DEVID_AUTO; -@@ -3434,8 +4668,40 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3446,8 +4683,40 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, hdmi->cec = platform_device_register_full(&pdevinfo); } @@ -473874,7 +473867,7 @@ index 0c79a9ba4..52374e943 100644 return hdmi; err_iahb: -@@ -3445,7 +4711,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3457,7 +4726,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, err_isfr: clk_disable_unprepare(hdmi->isfr_clk); err_res: @@ -473886,7 +473879,7 @@ index 0c79a9ba4..52374e943 100644 return ERR_PTR(ret); } -@@ -3453,16 +4722,35 @@ EXPORT_SYMBOL_GPL(dw_hdmi_probe); +@@ -3465,16 +4737,35 @@ EXPORT_SYMBOL_GPL(dw_hdmi_probe); void dw_hdmi_remove(struct dw_hdmi *hdmi) { @@ -473922,7 +473915,7 @@ index 0c79a9ba4..52374e943 100644 clk_disable_unprepare(hdmi->iahb_clk); clk_disable_unprepare(hdmi->isfr_clk); if (hdmi->cec_clk) -@@ -3480,7 +4768,7 @@ EXPORT_SYMBOL_GPL(dw_hdmi_remove); +@@ -3492,7 +4783,7 @@ EXPORT_SYMBOL_GPL(dw_hdmi_remove); */ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev, struct drm_encoder *encoder, @@ -473931,7 +473924,7 @@ index 0c79a9ba4..52374e943 100644 { struct dw_hdmi *hdmi; int ret; -@@ -3496,6 +4784,9 @@ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev, +@@ -3508,6 +4799,9 @@ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev, return ERR_PTR(ret); } @@ -473941,7 +473934,7 @@ index 0c79a9ba4..52374e943 100644 return hdmi; } EXPORT_SYMBOL_GPL(dw_hdmi_bind); -@@ -3506,9 +4797,87 @@ void dw_hdmi_unbind(struct dw_hdmi *hdmi) +@@ -3518,9 +4812,87 @@ void dw_hdmi_unbind(struct dw_hdmi *hdmi) } EXPORT_SYMBOL_GPL(dw_hdmi_unbind); @@ -477614,10 +477607,10 @@ index ade2327a1..4726b16a3 100644 + secondary->plat_data.split_mode = true; + } + - return component_add(dev, &rockchip_dp_component_ops); - } - -@@ -411,52 +618,85 @@ static int rockchip_dp_remove(struct platform_device *pdev) + ret = component_add(dev, &rockchip_dp_component_ops); + if (ret) + goto err_dp_remove; +@@ -419,52 +626,85 @@ static int rockchip_dp_remove(struct platform_device *pdev) return 0; } @@ -604882,7 +604875,7 @@ index 0f2314449..ccf39dcf6 100644 /* * can't update plane when vop is disabled. -@@ -908,488 +1868,1864 @@ static void vop_plane_atomic_update(struct drm_plane *plane, +@@ -908,206 +1868,426 @@ static void vop_plane_atomic_update(struct drm_plane *plane, return; } @@ -605448,18 +605441,12 @@ index 0f2314449..ccf39dcf6 100644 + .atomic_get_property = vop_atomic_plane_get_property, }; --static int vop_crtc_enable_vblank(struct drm_crtc *crtc) --{ -- struct vop *vop = to_vop(crtc); -- unsigned long flags; -+static int vop_crtc_enable_vblank(struct drm_crtc *crtc) -+{ -+ struct vop *vop = to_vop(crtc); -+ unsigned long flags; -+ -+ if (WARN_ON(!vop->is_enabled)) -+ return -EPERM; -+ + static int vop_crtc_enable_vblank(struct drm_crtc *crtc) +@@ -1118,278 +2298,1434 @@ static int vop_crtc_enable_vblank(struct drm_crtc *crtc) + if (WARN_ON(!vop->is_enabled)) + return -EPERM; + +- spin_lock_irqsave(&vop->irq_lock, flags); + spin_lock_irqsave(&vop->irq_lock, flags); + + if (VOP_MAJOR(vop->version) == 3 && VOP_MINOR(vop->version) >= 7) { @@ -606576,23 +606563,22 @@ index 0f2314449..ccf39dcf6 100644 + pzpos = kmalloc_array(vop_data->win_size, sizeof(*pzpos), GFP_KERNEL); + if (!pzpos) + return -ENOMEM; - -- if (WARN_ON(!vop->is_enabled)) -- return -EPERM; ++ + for (i = 0; i < vop_data->win_size; i++) { + const struct vop_win_data *win_data = &vop_data->win[i]; + struct vop_win *win; -- spin_lock_irqsave(&vop->irq_lock, flags); +- VOP_INTR_SET_TYPE(vop, clear, FS_INTR, 1); +- VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 1); + if (!win_data->phy) + continue; -- VOP_INTR_SET_TYPE(vop, clear, FS_INTR, 1); -- VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 1); +- spin_unlock_irqrestore(&vop->irq_lock, flags); + for (j = 0; j < vop->num_wins; j++) { + win = &vop->win[j]; -- spin_unlock_irqrestore(&vop->irq_lock, flags); +- return 0; +-} + if (win->win_id == i && !win->area_id) + break; + } @@ -606601,8 +606587,10 @@ index 0f2314449..ccf39dcf6 100644 + goto err_free_pzpos; + } -- return 0; --} +-static void vop_crtc_disable_vblank(struct drm_crtc *crtc) +-{ +- struct vop *vop = to_vop(crtc); +- unsigned long flags; + plane = &win->base; + pstate = state->planes[drm_plane_index(plane)].state; + /* @@ -606613,10 +606601,8 @@ index 0f2314449..ccf39dcf6 100644 + pstate = plane->state; + plane_state = to_vop_plane_state(pstate); --static void vop_crtc_disable_vblank(struct drm_crtc *crtc) --{ -- struct vop *vop = to_vop(crtc); -- unsigned long flags; +- if (WARN_ON(!vop->is_enabled)) +- return; + if (!pstate->visible) + pzpos[cnt].zpos = INT_MAX; + else @@ -606624,26 +606610,18 @@ index 0f2314449..ccf39dcf6 100644 + pzpos[cnt++].win_id = win->win_id; + } -- if (WARN_ON(!vop->is_enabled)) -- return; +- spin_lock_irqsave(&vop->irq_lock, flags); + sort(pzpos, cnt, sizeof(pzpos[0]), vop_zpos_cmp, NULL); -- spin_lock_irqsave(&vop->irq_lock, flags); +- VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 0); + for (i = 0, cnt = 0; i < vop_data->win_size; i++) { + const struct vop_win_data *win_data = &vop_data->win[i]; + int shift = i * 2; -- VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 0); -+ if (win_data->phy) { -+ struct vop_zpos *zpos = &pzpos[cnt++]; - - spin_unlock_irqrestore(&vop->irq_lock, flags); -} -+ dsp_layer_sel |= zpos->win_id << shift; -+ } else { -+ dsp_layer_sel |= i << shift; -+ } -+ } ++ if (win_data->phy) { ++ struct vop_zpos *zpos = &pzpos[cnt++]; -static bool vop_crtc_mode_fixup(struct drm_crtc *crtc, - const struct drm_display_mode *mode, @@ -606651,7 +606629,11 @@ index 0f2314449..ccf39dcf6 100644 -{ - struct vop *vop = to_vop(crtc); - unsigned long rate; -+ s->dsp_layer_sel = dsp_layer_sel; ++ dsp_layer_sel |= zpos->win_id << shift; ++ } else { ++ dsp_layer_sel |= i << shift; ++ } ++ } - /* - * Clock craziness. @@ -606686,9 +606668,11 @@ index 0f2314449..ccf39dcf6 100644 - */ - rate = clk_round_rate(vop->dclk, adjusted_mode->clock * 1000 + 999); - adjusted_mode->clock = DIV_ROUND_UP(rate, 1000); -+ vop_dclk_source_generate(crtc, crtc_state); ++ s->dsp_layer_sel = dsp_layer_sel; - return true; ++ vop_dclk_source_generate(crtc, crtc_state); ++ +err_free_pzpos: + kfree(pzpos); + return ret; @@ -607087,15 +607071,15 @@ index 0f2314449..ccf39dcf6 100644 - val |= vact_end; - VOP_REG_SET(vop, modeset, vact_st_end, val); - VOP_REG_SET(vop, modeset, vpost_st_end, val); -- -- VOP_REG_SET(vop, intr, line_flag_num[0], vact_end); + VOP_CTRL_SET(vop, afbdc_en, s->afbdc_en); -- clk_set_rate(vop->dclk, adjusted_mode->clock * 1000); +- VOP_REG_SET(vop, intr, line_flag_num[0], vact_end); + VOP_CTRL_SET(vop, dsp_layer_sel, s->dsp_layer_sel); + if (vop_data->feature & VOP_FEATURE_OVERSCAN) + vop_post_config(crtc); +- clk_set_rate(vop->dclk, adjusted_mode->clock * 1000); +- - VOP_REG_SET(vop, common, standby, 0); - mutex_unlock(&vop->vop_lock); + spin_unlock(&vop->reg_lock); @@ -607255,10 +607239,11 @@ index 0f2314449..ccf39dcf6 100644 .atomic_flush = vop_crtc_atomic_flush, .atomic_enable = vop_crtc_atomic_enable, .atomic_disable = vop_crtc_atomic_disable, -@@ -1526,11 +3853,33 @@ static void vop_crtc_destroy(struct drm_crtc *crtc) +@@ -1525,15 +3852,37 @@ static void vop_crtc_destroy(struct drm_crtc *crtc) + { drm_crtc_cleanup(crtc); } - ++ +static void vop_crtc_reset(struct drm_crtc *crtc) +{ + struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state); @@ -607279,19 +607264,22 @@ index 0f2314449..ccf39dcf6 100644 + s->top_margin = 100; + s->bottom_margin = 100; +} -+ + static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc) { - struct rockchip_crtc_state *rockchip_state; + struct rockchip_crtc_state *rockchip_state, *old_state; + if (WARN_ON(!crtc->state)) + return NULL; + - rockchip_state = kzalloc(sizeof(*rockchip_state), GFP_KERNEL); + old_state = to_rockchip_crtc_state(crtc->state); + rockchip_state = kmemdup(old_state, sizeof(*old_state), GFP_KERNEL); if (!rockchip_state) return NULL; -@@ -1547,17 +3896,6 @@ static void vop_crtc_destroy_state(struct drm_crtc *crtc, +@@ -1550,17 +3899,6 @@ static void vop_crtc_destroy_state(struct drm_crtc *crtc, kfree(s); } @@ -607309,15 +607297,23 @@ index 0f2314449..ccf39dcf6 100644 #ifdef CONFIG_DRM_ANALOGIX_DP static struct drm_connector *vop_get_edp_connector(struct vop *vop) { -@@ -1615,26 +3953,124 @@ static int vop_crtc_set_crc_source(struct drm_crtc *crtc, - return -ENODEV; +@@ -1611,33 +3949,131 @@ vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, + return 0; } --static int --vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, -- size_t *values_cnt) +-#else +-static int vop_crtc_set_crc_source(struct drm_crtc *crtc, +- const char *source_name) -{ - return -ENODEV; +-} ++#else ++static int vop_crtc_set_crc_source(struct drm_crtc *crtc, ++ const char *source_name) ++{ ++ return -ENODEV; ++} ++ +static int +vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, + size_t *values_cnt) @@ -607417,7 +607413,12 @@ index 0f2314449..ccf39dcf6 100644 + vop->line_flag = val; + return 0; + } -+ + +-static int +-vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, +- size_t *values_cnt) +-{ +- return -ENODEV; + DRM_ERROR("failed to set vop crtc property\n"); + return -EINVAL; } @@ -607441,7 +607442,7 @@ index 0f2314449..ccf39dcf6 100644 }; static void vop_fb_unref_worker(struct drm_flip_work *work, void *val) -@@ -1642,22 +4078,23 @@ static void vop_fb_unref_worker(struct drm_flip_work *work, void *val) +@@ -1645,22 +4081,23 @@ static void vop_fb_unref_worker(struct drm_flip_work *work, void *val) struct vop *vop = container_of(work, struct vop, fb_unref_work); struct drm_framebuffer *fb = val; @@ -607469,7 +607470,7 @@ index 0f2314449..ccf39dcf6 100644 if (test_and_clear_bit(VOP_PENDING_FB_UNREF, &vop->pending)) drm_flip_work_commit(&vop->fb_unref_work, system_unbound_wq); -@@ -1666,8 +4103,9 @@ static void vop_handle_vblank(struct vop *vop) +@@ -1669,8 +4106,9 @@ static void vop_handle_vblank(struct vop *vop) static irqreturn_t vop_isr(int irq, void *data) { struct vop *vop = data; @@ -607480,7 +607481,7 @@ index 0f2314449..ccf39dcf6 100644 int ret = IRQ_NONE; /* -@@ -1686,14 +4124,14 @@ static irqreturn_t vop_isr(int irq, void *data) +@@ -1689,14 +4127,14 @@ static irqreturn_t vop_isr(int irq, void *data) * interrupt register has interrupt status, enable and clear bits, we * must hold irq_lock to avoid a race with enable/disable_vblank(). */ @@ -607497,7 +607498,7 @@ index 0f2314449..ccf39dcf6 100644 /* This is expected for vop iommu irqs, since the irq is shared */ if (!active_irqs) -@@ -1711,17 +4149,41 @@ static irqreturn_t vop_isr(int irq, void *data) +@@ -1714,17 +4152,41 @@ static irqreturn_t vop_isr(int irq, void *data) ret = IRQ_HANDLED; } @@ -607543,7 +607544,7 @@ index 0f2314449..ccf39dcf6 100644 out_disable: vop_core_clks_disable(vop); -@@ -1730,27 +4192,254 @@ static irqreturn_t vop_isr(int irq, void *data) +@@ -1733,27 +4195,254 @@ static irqreturn_t vop_isr(int irq, void *data) return ret; } @@ -607805,7 +607806,7 @@ index 0f2314449..ccf39dcf6 100644 int i; /* -@@ -1758,29 +4447,19 @@ static int vop_create_crtc(struct vop *vop) +@@ -1761,29 +4450,19 @@ static int vop_create_crtc(struct vop *vop) * to pass them to drm_crtc_init_with_planes, which sets the * "possible_crtcs" to the newly initialized crtc. */ @@ -607842,7 +607843,7 @@ index 0f2314449..ccf39dcf6 100644 if (plane->type == DRM_PLANE_TYPE_PRIMARY) primary = plane; else if (plane->type == DRM_PLANE_TYPE_CURSOR) -@@ -1793,37 +4472,23 @@ static int vop_create_crtc(struct vop *vop) +@@ -1796,37 +4475,23 @@ static int vop_create_crtc(struct vop *vop) goto err_cleanup_planes; drm_crtc_helper_add(crtc, &vop_crtc_helper_funcs); @@ -607886,7 +607887,7 @@ index 0f2314449..ccf39dcf6 100644 } port = of_get_child_by_name(dev->of_node, "port"); -@@ -1840,15 +4505,60 @@ static int vop_create_crtc(struct vop *vop) +@@ -1843,15 +4508,60 @@ static int vop_create_crtc(struct vop *vop) init_completion(&vop->dsp_hold_completion); init_completion(&vop->line_flag_completion); crtc->port = port; @@ -607913,11 +607914,11 @@ index 0f2314449..ccf39dcf6 100644 +#undef VOP_ATTACH_MODE_CONFIG_PROP + vop_crtc_create_plane_mask_property(vop, crtc); + vop_crtc_create_feature_property(vop, crtc); -+ + + if (vop->lut_regs) { + u16 *r_base, *g_base, *b_base; + u32 lut_len = vop->lut_len; - ++ + vop->lut = devm_kmalloc_array(dev, lut_len, sizeof(*vop->lut), + GFP_KERNEL); + if (!vop->lut) @@ -607952,7 +607953,7 @@ index 0f2314449..ccf39dcf6 100644 err_cleanup_crtc: drm_crtc_cleanup(crtc); err_cleanup_planes: -@@ -1860,12 +4570,10 @@ static int vop_create_crtc(struct vop *vop) +@@ -1863,12 +4573,10 @@ static int vop_create_crtc(struct vop *vop) static void vop_destroy_crtc(struct vop *vop) { @@ -607966,7 +607967,7 @@ index 0f2314449..ccf39dcf6 100644 of_node_put(crtc->port); /* -@@ -1888,137 +4596,129 @@ static void vop_destroy_crtc(struct vop *vop) +@@ -1891,137 +4599,129 @@ static void vop_destroy_crtc(struct vop *vop) drm_flip_work_cleanup(&vop->fb_unref_work); } @@ -608209,7 +608210,7 @@ index 0f2314449..ccf39dcf6 100644 } /** -@@ -2077,46 +4777,97 @@ static int vop_bind(struct device *dev, struct device *master, void *data) +@@ -2080,46 +4780,97 @@ static int vop_bind(struct device *dev, struct device *master, void *data) struct drm_device *drm_dev = data; struct vop *vop; struct resource *res; @@ -608254,7 +608255,6 @@ index 0f2314449..ccf39dcf6 100644 + return ret; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- vop->len = resource_size(res); + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); + if (!res) { + dev_warn(vop->dev, "failed to get vop register byname\n"); @@ -608263,13 +608263,13 @@ index 0f2314449..ccf39dcf6 100644 vop->regs = devm_ioremap_resource(dev, res); if (IS_ERR(vop->regs)) return PTR_ERR(vop->regs); -+ vop->len = resource_size(res); -+ + vop->len = resource_size(res); + +- res = platform_get_resource(pdev, IORESOURCE_MEM, 1); + vop->regsbak = devm_kzalloc(dev, vop->len, GFP_KERNEL); + if (!vop->regsbak) + return -ENOMEM; - -- res = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gamma_lut"); if (res) { - if (!vop_data->lut_size) { @@ -608321,7 +608321,7 @@ index 0f2314449..ccf39dcf6 100644 irq = platform_get_irq(pdev, 0); if (irq < 0) { DRM_DEV_ERROR(dev, "cannot find irq for vop\n"); -@@ -2128,53 +4879,51 @@ static int vop_bind(struct device *dev, struct device *master, void *data) +@@ -2131,53 +4882,51 @@ static int vop_bind(struct device *dev, struct device *master, void *data) spin_lock_init(&vop->irq_lock); mutex_init(&vop->vop_lock); @@ -624752,7 +624752,7 @@ index a6fe03c37..f33e7d1be 100644 .act_info = VOP_REG(RK3288_WIN0_ACT_INFO, 0x1fff1fff, 0), .dsp_info = VOP_REG(RK3288_WIN0_DSP_INFO, 0x0fff0fff, 0), .dsp_st = VOP_REG(RK3288_WIN0_DSP_ST, 0x1fff1fff, 0), -@@ -597,464 +675,1196 @@ static const struct vop_win_phy rk3288_win01_data = { +@@ -597,466 +675,1196 @@ static const struct vop_win_phy rk3288_win01_data = { .uv_mst = VOP_REG(RK3288_WIN0_CBR_MST, 0xffffffff, 0), .yrgb_vir = VOP_REG(RK3288_WIN0_VIR, 0x3fff, 0), .uv_vir = VOP_REG(RK3288_WIN0_VIR, 0x3fff, 16), @@ -625587,6 +625587,7 @@ index a6fe03c37..f33e7d1be 100644 - .enable = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 0), - .format = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 1), - .rb_swap = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 12), +- .x_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 21), - .y_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 22), - .act_info = VOP_REG(RK3288_WIN0_ACT_INFO, 0x1fff1fff, 0), - .dsp_info = VOP_REG(RK3288_WIN0_DSP_INFO, 0x0fff0fff, 0), @@ -625597,6 +625598,7 @@ index a6fe03c37..f33e7d1be 100644 - .uv_vir = VOP_REG(RK3288_WIN0_VIR, 0x3fff, 16), - .src_alpha_ctl = VOP_REG(RK3288_WIN0_SRC_ALPHA_CTRL, 0xff, 0), - .dst_alpha_ctl = VOP_REG(RK3288_WIN0_DST_ALPHA_CTRL, 0xff, 0), +- .channel = VOP_REG(RK3288_WIN0_CTRL2, 0xff, 0), + .enable = VOP_REG(RK3066_SYS_CTRL1, 0x1, 0), + .format = VOP_REG(RK3066_SYS_CTRL0, 0x7, 4), + .rb_swap = VOP_REG(RK3066_SYS_CTRL0, 0x1, 19), @@ -625653,12 +625655,12 @@ index a6fe03c37..f33e7d1be 100644 +static const struct vop_win_data rk3066_vop_win_data[] = { + { .base = 0x00, .phy = &rk3066_win0_data, .type = DRM_PLANE_TYPE_PRIMARY }, -- { .base = 0x40, .phy = &rk3288_win01_data, +- { .base = 0x40, .phy = &rk3368_win01_data, - .type = DRM_PLANE_TYPE_OVERLAY }, -- { .base = 0x00, .phy = &rk3288_win23_data, +- { .base = 0x00, .phy = &rk3368_win23_data, + { .base = 0x00, .phy = &rk3066_win1_data, .type = DRM_PLANE_TYPE_OVERLAY }, -- { .base = 0x50, .phy = &rk3288_win23_data, +- { .base = 0x50, .phy = &rk3368_win23_data, + { .base = 0x00, .phy = &rk3066_win2_data, .type = DRM_PLANE_TYPE_CURSOR }, }; @@ -660850,27 +660852,6 @@ index 000000000..1e5183ccc +MODULE_AUTHOR("luowei "); +MODULE_DESCRIPTION("ms5607 temperature driver"); +MODULE_LICENSE("GPL"); -diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c -index ecdeca147..4408245b6 100644 ---- a/drivers/input/serio/ambakmi.c -+++ b/drivers/input/serio/ambakmi.c -@@ -159,7 +159,7 @@ static int amba_kmi_probe(struct amba_device *dev, - return ret; - } - --static int amba_kmi_remove(struct amba_device *dev) -+static void amba_kmi_remove(struct amba_device *dev) - { - struct amba_kmi_port *kmi = amba_get_drvdata(dev); - -@@ -168,7 +168,6 @@ static int amba_kmi_remove(struct amba_device *dev) - iounmap(kmi->base); - kfree(kmi); - amba_release_regions(dev); -- return 0; - } - - static int __maybe_unused amba_kmi_resume(struct device *dev) diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index cc18f54ea..b9db13eda 100644 --- a/drivers/input/touchscreen/Kconfig @@ -1167876,10 +1167857,10 @@ index 000000000..ff10499ff + diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/wl_cfg80211.c b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/wl_cfg80211.c new file mode 100755 -index 000000000..10e2ebb2a +index 000000000000..1534f3919a3e --- /dev/null +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/wl_cfg80211.c -@@ -0,0 +1,25020 @@ +@@ -0,0 +1,25039 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Linux cfg80211 driver @@ -1170638,11 +1170619,13 @@ index 000000000..10e2ebb2a + WL_DBG(("%s:Mac addr" MACDBG "\n", + __FUNCTION__, MAC2STRDBG(mac_addr))); + -+ if ((wl_iftype == WL_IF_TYPE_P2P_DISC) || (wl_iftype == WL_IF_TYPE_AP) || -+ (wl_iftype == WL_IF_TYPE_P2P_GO) || (wl_iftype == WL_IF_TYPE_P2P_GC)) { ++ if ((wl_iftype == WL_IF_TYPE_P2P_DISC) || (wl_iftype == WL_IF_TYPE_AP) ){//|| ++ // (wl_iftype == WL_IF_TYPE_P2P_GO) || (wl_iftype == WL_IF_TYPE_P2P_GC)) { + /* Avoid invoking release mac addr code for interfaces using + * fixed mac addr. + */ ++ WL_ERR(("%s: release Mac addr" MACDBG "\n", ++ __FUNCTION__, MAC2STRDBG(mac_addr))); + return BCME_OK; + } + @@ -1171070,6 +1171053,7 @@ index 000000000..10e2ebb2a + u16 wl_mode; + u16 wl_iftype; + struct net_info *netinfo; ++ u8 mac_addr[ETH_ALEN]; + dhd_pub_t *dhd; + BCM_REFERENCE(dhd); + @@ -1171095,8 +1171079,24 @@ index 000000000..10e2ebb2a + WL_INFORM_MEM(("del vif. wdev cfg_iftype:%d\n", wdev->iftype)); + + wiphy = wdev->wiphy; ++ ++ if ((netinfo = wl_get_netinfo_by_wdev(cfg, wdev)) == NULL) { ++ WL_ERR(("Find netinfo from wdev %p failed\n", wdev)); ++ ret = -ENODEV; ++ goto exit; ++ } ++ ++ if (!wdev->netdev) { ++ WL_ERR(("dead mac ndev null! \n")); ++ } else { ++ /* Disable tx before del */ ++ memcpy(mac_addr, wdev->netdev->dev_addr, ETH_ALEN); ++ } ++ wl_iftype = netinfo->iftype; ++ +#ifdef WL_CFG80211_P2P_DEV_IF + if (wdev->iftype == NL80211_IFTYPE_P2P_DEVICE) { ++ wl_release_vif_macaddr(cfg, mac_addr, wl_iftype); + /* p2p discovery would be de-initialized in stop p2p + * device context/from other virtual i/f creation context + * so netinfo list may not have any node corresponding to @@ -1571942,13 +1571942,18 @@ index 624273d0e..93aba7d29 100644 writel_relaxed(rockchip_spi_calc_burst_size(xfer->len / rs->n_bytes) - 1, rs->regs + ROCKCHIP_SPI_DMARDLR); writel_relaxed(dmacr, rs->regs + ROCKCHIP_SPI_DMACR); -@@ -566,7 +624,46 @@ static size_t rockchip_spi_max_transfer_size(struct spi_device *spi) +@@ -566,11 +624,50 @@ static size_t rockchip_spi_max_transfer_size(struct spi_device *spi) static int rockchip_spi_slave_abort(struct spi_controller *ctlr) { struct rockchip_spi *rs = spi_controller_get_devdata(ctlr); + u32 rx_fifo_left; + struct dma_tx_state state; + enum dma_status status; + + if (atomic_read(&rs->state) & RXDMA) + dmaengine_terminate_sync(ctlr->dma_rx); + if (atomic_read(&rs->state) & TXDMA) + dmaengine_terminate_sync(ctlr->dma_tx); + + /* Get current dma rx point */ + if (atomic_read(&rs->state) & RXDMA) { @@ -1571983,13 +1571988,12 @@ index 624273d0e..93aba7d29 100644 + + rs->xfer->len = (unsigned int)(rs->rx - rs->xfer->rx_buf); + } - ++ +out: -+ spi_enable_chip(rs, false); + atomic_set(&rs->state, 0); + spi_enable_chip(rs, false); rs->slave_abort = true; - complete(&ctlr->xfer_completion); - -@@ -582,12 +679,6 @@ static int rockchip_spi_transfer_one( +@@ -588,12 +685,6 @@ static int rockchip_spi_transfer_one( int ret; bool use_dma; @@ -1572002,7 +1572006,7 @@ index 624273d0e..93aba7d29 100644 WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) && (readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)); -@@ -602,7 +693,7 @@ static int rockchip_spi_transfer_one( +@@ -608,7 +699,7 @@ static int rockchip_spi_transfer_one( } rs->n_bytes = xfer->bits_per_word <= 8 ? 1 : 2; @@ -1572011,7 +1572015,7 @@ index 624273d0e..93aba7d29 100644 use_dma = ctlr->can_dma ? ctlr->can_dma(ctlr, spi, xfer) : false; ret = rockchip_spi_config(rs, spi, xfer, use_dma, ctlr->slave); -@@ -612,7 +703,7 @@ static int rockchip_spi_transfer_one( +@@ -618,7 +709,7 @@ static int rockchip_spi_transfer_one( if (use_dma) return rockchip_spi_prepare_dma(rs, ctlr, xfer); @@ -1572020,15 +1572024,15 @@ index 624273d0e..93aba7d29 100644 } static bool rockchip_spi_can_dma(struct spi_controller *ctlr, -@@ -638,6 +729,7 @@ static int rockchip_spi_probe(struct platform_device *pdev) +@@ -644,6 +735,7 @@ static int rockchip_spi_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; - u32 rsd_nsecs; + u32 rsd_nsecs, num_cs; bool slave_mode; + struct pinctrl *pinctrl = NULL; slave_mode = of_property_read_bool(np, "spi-slave"); -@@ -785,6 +877,28 @@ static int rockchip_spi_probe(struct platform_device *pdev) +@@ -792,6 +884,28 @@ static int rockchip_spi_probe(struct platform_device *pdev) ctlr->can_dma = rockchip_spi_can_dma; } @@ -1572057,7 +1572061,7 @@ index 624273d0e..93aba7d29 100644 ret = devm_spi_register_controller(&pdev->dev, ctlr); if (ret < 0) { dev_err(&pdev->dev, "Failed to register controller\n"); -@@ -924,6 +1038,7 @@ static const struct of_device_id rockchip_spi_dt_match[] = { +@@ -931,6 +1045,7 @@ static const struct of_device_id rockchip_spi_dt_match[] = { { .compatible = "rockchip,rk3368-spi", }, { .compatible = "rockchip,rk3399-spi", }, { .compatible = "rockchip,rv1108-spi", }, @@ -1575328,7 +1575332,7 @@ index e1fe03ceb..268c4610c 100644 #include #include #include -@@ -15,383 +18,81 @@ +@@ -15,386 +18,80 @@ #include #include #include @@ -1575340,10 +1575344,12 @@ index e1fe03ceb..268c4610c 100644 #include #include -#include -- ++#include "ion_private.h" + -#include "ion.h" -- --static struct ion_device *internal_dev; ++#define ION_CURRENT_ABI_VERSION 2 + + static struct ion_device *internal_dev; -static int heap_id; - -/* this function should only be called while dev->lock is held */ @@ -1575431,6 +1575437,9 @@ index e1fe03ceb..268c4610c 100644 - void *vaddr; - - if (buffer->kmap_cnt) { +- if (buffer->kmap_cnt == INT_MAX) +- return ERR_PTR(-EOVERFLOW); +- - buffer->kmap_cnt++; - return buffer->vaddr; - } @@ -1575558,7 +1575567,7 @@ index e1fe03ceb..268c4610c 100644 -{ - dma_unmap_sgtable(attachment->dev, table, direction, 0); -} - +- -static int ion_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma) -{ - struct ion_buffer *buffer = dmabuf->priv; @@ -1575577,17 +1575586,14 @@ index e1fe03ceb..268c4610c 100644 - /* now map it to userspace */ - ret = buffer->heap->ops->map_user(buffer->heap, buffer, vma); - mutex_unlock(&buffer->lock); -+#include "ion_private.h" - +- - if (ret) - pr_err("%s: failure mapping buffer to userspace\n", - __func__); -+#define ION_CURRENT_ABI_VERSION 2 - return ret; -} -+static struct ion_device *internal_dev; - +- -static void ion_dma_buf_release(struct dma_buf *dmabuf) +/* Entry into ION allocator for rest of the kernel */ +struct dma_buf *ion_alloc(size_t len, unsigned int heap_id_mask, @@ -1575754,7 +1575760,7 @@ index e1fe03ceb..268c4610c 100644 static int ion_query_heaps(struct ion_heap_query *query) { -@@ -441,6 +142,7 @@ static int ion_query_heaps(struct ion_heap_query *query) +@@ -444,6 +141,7 @@ static int ion_query_heaps(struct ion_heap_query *query) union ion_ioctl_arg { struct ion_allocation_data allocation; struct ion_heap_query query; @@ -1575762,7 +1575768,7 @@ index e1fe03ceb..268c4610c 100644 }; static int validate_ioctl_arg(unsigned int cmd, union ion_ioctl_arg *arg) -@@ -489,9 +191,9 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) +@@ -492,9 +190,9 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { int fd; @@ -1575775,7 +1575781,7 @@ index e1fe03ceb..268c4610c 100644 if (fd < 0) return fd; -@@ -502,6 +204,9 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) +@@ -505,6 +203,9 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) case ION_IOC_HEAP_QUERY: ret = ion_query_heaps(&data.query); break; @@ -1575785,7 +1575791,7 @@ index e1fe03ceb..268c4610c 100644 default: return -ENOTTY; } -@@ -554,31 +259,88 @@ static int debug_shrink_get(void *data, u64 *val) +@@ -557,31 +258,88 @@ static int debug_shrink_get(void *data, u64 *val) DEFINE_SIMPLE_ATTRIBUTE(debug_shrink_fops, debug_shrink_get, debug_shrink_set, "%llu\n"); @@ -1575882,7 +1575888,7 @@ index e1fe03ceb..268c4610c 100644 heap->num_of_buffers = 0; heap->num_of_alloc_bytes = 0; heap->alloc_bytes_wm = 0; -@@ -606,8 +368,16 @@ void ion_device_add_heap(struct ion_heap *heap) +@@ -609,8 +367,16 @@ void ion_device_add_heap(struct ion_heap *heap) &debug_shrink_fops); } @@ -1575900,7 +1575906,7 @@ index e1fe03ceb..268c4610c 100644 /* * use negative heap->id to reverse the priority -- when traversing * the list later attempt higher id numbers first -@@ -615,10 +385,99 @@ void ion_device_add_heap(struct ion_heap *heap) +@@ -618,10 +384,99 @@ void ion_device_add_heap(struct ion_heap *heap) plist_node_init(&heap->node, -heap->id); plist_add(&heap->node, &dev->heaps); @@ -1576002,7 +1576008,7 @@ index e1fe03ceb..268c4610c 100644 static int ion_device_create(void) { -@@ -636,8 +495,13 @@ static int ion_device_create(void) +@@ -639,8 +494,13 @@ static int ion_device_create(void) ret = misc_register(&idev->dev); if (ret) { pr_err("ion: failed to register misc device.\n"); @@ -1576018,7 +1576024,7 @@ index e1fe03ceb..268c4610c 100644 } idev->debug_root = debugfs_create_dir("ion", NULL); -@@ -645,5 +509,11 @@ static int ion_device_create(void) +@@ -648,5 +508,11 @@ static int ion_device_create(void) plist_head_init(&idev->heaps); internal_dev = idev; return 0; @@ -1580928,254 +1580934,6 @@ index 110a19c51..dd41c694c 100644 spin_unlock_irqrestore(&port->lock, flags); serial8250_rpm_put(up); -diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c -old mode 100644 -new mode 100755 -index 1433260d9..347fb3d38 ---- a/drivers/usb/common/common.c -+++ b/drivers/usb/common/common.c -@@ -25,6 +25,12 @@ static const char *const ep_type_names[] = { - [USB_ENDPOINT_XFER_INT] = "intr", - }; - -+/** -+ * usb_ep_type_string() - Returns human readable-name of the endpoint type. -+ * @ep_type: The endpoint type to return human-readable name for. If it's not -+ * any of the types: USB_ENDPOINT_XFER_{CONTROL, ISOC, BULK, INT}, -+ * usually got by usb_endpoint_type(), the string 'unknown' will be returned. -+ */ - const char *usb_ep_type_string(int ep_type) - { - if (ep_type < 0 || ep_type >= ARRAY_SIZE(ep_type_names)) -@@ -69,6 +75,19 @@ static const char *const speed_names[] = { - [USB_SPEED_SUPER_PLUS] = "super-speed-plus", - }; - -+static const char *const ssp_rate[] = { -+ [USB_SSP_GEN_UNKNOWN] = "UNKNOWN", -+ [USB_SSP_GEN_2x1] = "super-speed-plus-gen2x1", -+ [USB_SSP_GEN_1x2] = "super-speed-plus-gen1x2", -+ [USB_SSP_GEN_2x2] = "super-speed-plus-gen2x2", -+}; -+ -+/** -+ * usb_speed_string() - Returns human readable-name of the speed. -+ * @speed: The speed to return human-readable name for. If it's not -+ * any of the speeds defined in usb_device_speed enum, string for -+ * USB_SPEED_UNKNOWN will be returned. -+ */ - const char *usb_speed_string(enum usb_device_speed speed) - { - if (speed < 0 || speed >= ARRAY_SIZE(speed_names)) -@@ -77,6 +96,14 @@ const char *usb_speed_string(enum usb_device_speed speed) - } - EXPORT_SYMBOL_GPL(usb_speed_string); - -+/** -+ * usb_get_maximum_speed - Get maximum requested speed for a given USB -+ * controller. -+ * @dev: Pointer to the given USB controller device -+ * -+ * The function gets the maximum speed string from property "maximum-speed", -+ * and returns the corresponding enum usb_device_speed. -+ */ - enum usb_device_speed usb_get_maximum_speed(struct device *dev) - { - const char *maximum_speed; -@@ -86,12 +113,44 @@ enum usb_device_speed usb_get_maximum_speed(struct device *dev) - if (ret < 0) - return USB_SPEED_UNKNOWN; - -- ret = match_string(speed_names, ARRAY_SIZE(speed_names), maximum_speed); -+ ret = match_string(ssp_rate, ARRAY_SIZE(ssp_rate), maximum_speed); -+ if (ret > 0) -+ return USB_SPEED_SUPER_PLUS; - -+ ret = match_string(speed_names, ARRAY_SIZE(speed_names), maximum_speed); - return (ret < 0) ? USB_SPEED_UNKNOWN : ret; - } - EXPORT_SYMBOL_GPL(usb_get_maximum_speed); - -+/** -+ * usb_get_maximum_ssp_rate - Get the signaling rate generation and lane count -+ * of a SuperSpeed Plus capable device. -+ * @dev: Pointer to the given USB controller device -+ * -+ * If the string from "maximum-speed" property is super-speed-plus-genXxY where -+ * 'X' is the generation number and 'Y' is the number of lanes, then this -+ * function returns the corresponding enum usb_ssp_rate. -+ */ -+enum usb_ssp_rate usb_get_maximum_ssp_rate(struct device *dev) -+{ -+ const char *maximum_speed; -+ int ret; -+ -+ ret = device_property_read_string(dev, "maximum-speed", &maximum_speed); -+ if (ret < 0) -+ return USB_SSP_GEN_UNKNOWN; -+ -+ ret = match_string(ssp_rate, ARRAY_SIZE(ssp_rate), maximum_speed); -+ return (ret < 0) ? USB_SSP_GEN_UNKNOWN : ret; -+} -+EXPORT_SYMBOL_GPL(usb_get_maximum_ssp_rate); -+ -+/** -+ * usb_state_string - Returns human readable name for the state. -+ * @state: The state to return a human-readable name for. If it's not -+ * any of the states devices in usb_device_state_string enum, -+ * the string UNKNOWN will be returned. -+ */ - const char *usb_state_string(enum usb_device_state state) - { - static const char *const names[] = { -@@ -141,6 +200,47 @@ enum usb_dr_mode usb_get_dr_mode(struct device *dev) - } - EXPORT_SYMBOL_GPL(usb_get_dr_mode); - -+/** -+ * usb_decode_interval - Decode bInterval into the time expressed in 1us unit -+ * @epd: The descriptor of the endpoint -+ * @speed: The speed that the endpoint works as -+ * -+ * Function returns the interval expressed in 1us unit for servicing -+ * endpoint for data transfers. -+ */ -+unsigned int usb_decode_interval(const struct usb_endpoint_descriptor *epd, -+ enum usb_device_speed speed) -+{ -+ unsigned int interval = 0; -+ -+ switch (usb_endpoint_type(epd)) { -+ case USB_ENDPOINT_XFER_CONTROL: -+ /* uframes per NAK */ -+ if (speed == USB_SPEED_HIGH) -+ interval = epd->bInterval; -+ break; -+ case USB_ENDPOINT_XFER_ISOC: -+ interval = 1 << (epd->bInterval - 1); -+ break; -+ case USB_ENDPOINT_XFER_BULK: -+ /* uframes per NAK */ -+ if (speed == USB_SPEED_HIGH && usb_endpoint_dir_out(epd)) -+ interval = epd->bInterval; -+ break; -+ case USB_ENDPOINT_XFER_INT: -+ if (speed >= USB_SPEED_HIGH) -+ interval = 1 << (epd->bInterval - 1); -+ else -+ interval = epd->bInterval; -+ break; -+ } -+ -+ interval *= (speed >= USB_SPEED_HIGH) ? 125 : 1000; -+ -+ return interval; -+} -+EXPORT_SYMBOL_GPL(usb_decode_interval); -+ - #ifdef CONFIG_OF - /** - * of_usb_get_dr_mode_by_phy - Get dual role mode for the controller device -diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c -old mode 100644 -new mode 100755 -index 1ef2de6e3..d8b0041de ---- a/drivers/usb/core/devices.c -+++ b/drivers/usb/core/devices.c -@@ -157,38 +157,25 @@ static char *usb_dump_endpoint_descriptor(int speed, char *start, char *end, - switch (usb_endpoint_type(desc)) { - case USB_ENDPOINT_XFER_CONTROL: - type = "Ctrl"; -- if (speed == USB_SPEED_HIGH) /* uframes per NAK */ -- interval = desc->bInterval; -- else -- interval = 0; - dir = 'B'; /* ctrl is bidirectional */ - break; - case USB_ENDPOINT_XFER_ISOC: - type = "Isoc"; -- interval = 1 << (desc->bInterval - 1); - break; - case USB_ENDPOINT_XFER_BULK: - type = "Bulk"; -- if (speed == USB_SPEED_HIGH && dir == 'O') /* uframes per NAK */ -- interval = desc->bInterval; -- else -- interval = 0; - break; - case USB_ENDPOINT_XFER_INT: - type = "Int."; -- if (speed == USB_SPEED_HIGH || speed >= USB_SPEED_SUPER) -- interval = 1 << (desc->bInterval - 1); -- else -- interval = desc->bInterval; - break; - default: /* "can't happen" */ - return start; - } -- interval *= (speed == USB_SPEED_HIGH || -- speed >= USB_SPEED_SUPER) ? 125 : 1000; -- if (interval % 1000) -+ -+ interval = usb_decode_interval(desc, speed); -+ if (interval % 1000) { - unit = 'u'; -- else { -+ } else { - unit = 'm'; - interval /= 1000; - } -diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c -old mode 100644 -new mode 100755 -index 1c2c04079..fc3341f2b ---- a/drivers/usb/core/endpoint.c -+++ b/drivers/usb/core/endpoint.c -@@ -84,40 +84,13 @@ static ssize_t interval_show(struct device *dev, struct device_attribute *attr, - char *buf) - { - struct ep_device *ep = to_ep_device(dev); -+ unsigned int interval; - char unit; -- unsigned interval = 0; -- unsigned in; - -- in = (ep->desc->bEndpointAddress & USB_DIR_IN); -- -- switch (usb_endpoint_type(ep->desc)) { -- case USB_ENDPOINT_XFER_CONTROL: -- if (ep->udev->speed == USB_SPEED_HIGH) -- /* uframes per NAK */ -- interval = ep->desc->bInterval; -- break; -- -- case USB_ENDPOINT_XFER_ISOC: -- interval = 1 << (ep->desc->bInterval - 1); -- break; -- -- case USB_ENDPOINT_XFER_BULK: -- if (ep->udev->speed == USB_SPEED_HIGH && !in) -- /* uframes per NAK */ -- interval = ep->desc->bInterval; -- break; -- -- case USB_ENDPOINT_XFER_INT: -- if (ep->udev->speed == USB_SPEED_HIGH) -- interval = 1 << (ep->desc->bInterval - 1); -- else -- interval = ep->desc->bInterval; -- break; -- } -- interval *= (ep->udev->speed == USB_SPEED_HIGH) ? 125 : 1000; -- if (interval % 1000) -+ interval = usb_decode_interval(ep->desc, ep->udev->speed); -+ if (interval % 1000) { - unit = 'u'; -- else { -+ } else { - unit = 'm'; - interval /= 1000; - } diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c old mode 100644 new mode 100755 @@ -1581392,7 +1581150,7 @@ index 30919f741..76ef2f024 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - retval = -EINVAL; -- goto error1; +- goto error2; - } hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); @@ -1581598,9 +1581356,9 @@ index 5f18acac7..64e3e3a34 - } else if (hsotg->plat && hsotg->plat->phy_init) { - ret = hsotg->plat->phy_init(pdev, hsotg->plat->phy_type); - } else { -- ret = phy_power_on(hsotg->phy); +- ret = phy_init(hsotg->phy); - if (ret == 0) -- ret = phy_init(hsotg->phy); +- ret = phy_power_on(hsotg->phy); - } + if (!hsotg->ll_phy_enabled) + ret = dwc2_lowlevel_phy_enable(hsotg); @@ -1581619,9 +1581377,9 @@ index 5f18acac7..64e3e3a34 - } else if (hsotg->plat && hsotg->plat->phy_exit) { - ret = hsotg->plat->phy_exit(pdev, hsotg->plat->phy_type); - } else { -- ret = phy_exit(hsotg->phy); +- ret = phy_power_off(hsotg->phy); - if (ret == 0) -- ret = phy_power_off(hsotg->phy); +- ret = phy_exit(hsotg->phy); - } + if (hsotg->ll_phy_enabled) + ret = dwc2_lowlevel_phy_disable(hsotg); @@ -1581651,7 +1581409,7 @@ index 5f18acac7..64e3e3a34 retval = dwc2_get_dr_mode(hsotg); if (retval) goto error; -@@ -594,6 +656,11 @@ static int dwc2_driver_probe(struct platform_device *dev) +@@ -597,6 +659,11 @@ static int dwc2_driver_probe(struct platform_device *dev) if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL) dwc2_lowlevel_hw_disable(hsotg); @@ -1581663,7 +1581421,7 @@ index 5f18acac7..64e3e3a34 #if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \ IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE) /* Postponed adding a new gadget to the udc class driver list */ -@@ -622,6 +689,8 @@ static int dwc2_driver_probe(struct platform_device *dev) +@@ -625,6 +692,8 @@ static int dwc2_driver_probe(struct platform_device *dev) if (hsotg->params.activate_stm_id_vb_detection) regulator_disable(hsotg->usb33d); error: @@ -1581672,7 +1581430,7 @@ index 5f18acac7..64e3e3a34 if (hsotg->dr_mode != USB_DR_MODE_PERIPHERAL) dwc2_lowlevel_hw_disable(hsotg); return retval; -@@ -681,6 +750,7 @@ static int __maybe_unused dwc2_suspend(struct device *dev) +@@ -684,6 +753,7 @@ static int __maybe_unused dwc2_suspend(struct device *dev) static int __maybe_unused dwc2_resume(struct device *dev) { struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev); @@ -1581680,7 +1581438,7 @@ index 5f18acac7..64e3e3a34 int ret = 0; if (dwc2->phy_off_for_suspend && dwc2->ll_hw_enabled) { -@@ -720,6 +790,17 @@ static int __maybe_unused dwc2_resume(struct device *dev) +@@ -723,6 +793,17 @@ static int __maybe_unused dwc2_resume(struct device *dev) dwc2_drd_resume(dwc2); @@ -1581733,17 +1581491,10 @@ index ae86da0dc..2259f8876 diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c old mode 100644 new mode 100755 -index 1580d51ae..4f3eb0ac7 +index 4a0eec176511..71b66519ffe8 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c -@@ -114,19 +114,30 @@ void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode) - dwc->current_dr_role = mode; - } - --static int dwc3_core_soft_reset(struct dwc3 *dwc); -- - static void __dwc3_set_mode(struct work_struct *work) - { +@@ -119,12 +119,26 @@ static void __dwc3_set_mode(struct work_struct *work) struct dwc3 *dwc = work_to_dwc(work); unsigned long flags; int ret; @@ -1581765,11 +1581516,12 @@ index 1580d51ae..4f3eb0ac7 + + dwc->current_role_sw_mode = dwc->desired_role_sw_mode; +#endif ++ + if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_OTG) dwc3_otg_update(dwc, 0); -@@ -201,7 +212,26 @@ static void __dwc3_set_mode(struct work_struct *work) +@@ -204,7 +218,26 @@ static void __dwc3_set_mode(struct work_struct *work) } break; case DWC3_GCTL_PRTCAP_DEVICE: @@ -1581797,7 +1581549,7 @@ index 1580d51ae..4f3eb0ac7 dwc3_event_buffers_setup(dwc); -@@ -264,6 +294,19 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc) +@@ -267,6 +300,19 @@ int dwc3_core_soft_reset(struct dwc3 *dwc) { u32 reg; int retries = 1000; @@ -1581817,7 +1581569,7 @@ index 1580d51ae..4f3eb0ac7 /* * We're resetting only the device side because, if we're in host mode, -@@ -297,6 +340,9 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc) +@@ -301,6 +347,9 @@ int dwc3_core_soft_reset(struct dwc3 *dwc) udelay(1); } while (--retries); @@ -1581827,7 +1581579,7 @@ index 1580d51ae..4f3eb0ac7 return -ETIMEDOUT; done: -@@ -554,6 +600,9 @@ static void dwc3_cache_hwparams(struct dwc3 *dwc) +@@ -558,6 +607,9 @@ static void dwc3_cache_hwparams(struct dwc3 *dwc) parms->hwparams6 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS6); parms->hwparams7 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS7); parms->hwparams8 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS8); @@ -1581837,7 +1581589,7 @@ index 1580d51ae..4f3eb0ac7 } static int dwc3_core_ulpi_init(struct dwc3 *dwc) -@@ -963,21 +1012,9 @@ static int dwc3_core_init(struct dwc3 *dwc) +@@ -968,21 +1020,9 @@ static int dwc3_core_init(struct dwc3 *dwc) dwc->phys_ready = true; } @@ -1581860,7 +1581612,7 @@ index 1580d51ae..4f3eb0ac7 if (hw_mode == DWC3_GHWPARAMS0_MODE_DRD && !DWC3_VER_IS_WITHIN(DWC3, ANY, 194A)) { -@@ -1043,12 +1080,25 @@ static int dwc3_core_init(struct dwc3 *dwc) +@@ -1048,12 +1088,25 @@ static int dwc3_core_init(struct dwc3 *dwc) if (!DWC3_VER_IS_PRIOR(DWC3, 290A)) reg |= DWC3_GUCTL1_DEV_L1_EXIT_BY_HW; @@ -1581886,7 +1581638,7 @@ index 1580d51ae..4f3eb0ac7 dwc3_writel(dwc->regs, DWC3_GUCTL1, reg); } -@@ -1148,11 +1198,8 @@ static int dwc3_core_get_phy(struct dwc3 *dwc) +@@ -1153,11 +1206,8 @@ static int dwc3_core_get_phy(struct dwc3 *dwc) ret = PTR_ERR(dwc->usb2_phy); if (ret == -ENXIO || ret == -ENODEV) { dwc->usb2_phy = NULL; @@ -1581899,7 +1581651,7 @@ index 1580d51ae..4f3eb0ac7 } } -@@ -1160,11 +1207,8 @@ static int dwc3_core_get_phy(struct dwc3 *dwc) +@@ -1165,11 +1215,8 @@ static int dwc3_core_get_phy(struct dwc3 *dwc) ret = PTR_ERR(dwc->usb3_phy); if (ret == -ENXIO || ret == -ENODEV) { dwc->usb3_phy = NULL; @@ -1581912,7 +1581664,7 @@ index 1580d51ae..4f3eb0ac7 } } -@@ -1173,11 +1217,8 @@ static int dwc3_core_get_phy(struct dwc3 *dwc) +@@ -1178,11 +1225,8 @@ static int dwc3_core_get_phy(struct dwc3 *dwc) ret = PTR_ERR(dwc->usb2_generic_phy); if (ret == -ENOSYS || ret == -ENODEV) { dwc->usb2_generic_phy = NULL; @@ -1581925,7 +1581677,7 @@ index 1580d51ae..4f3eb0ac7 } } -@@ -1186,11 +1227,8 @@ static int dwc3_core_get_phy(struct dwc3 *dwc) +@@ -1191,11 +1235,8 @@ static int dwc3_core_get_phy(struct dwc3 *dwc) ret = PTR_ERR(dwc->usb3_generic_phy); if (ret == -ENOSYS || ret == -ENODEV) { dwc->usb3_generic_phy = NULL; @@ -1581938,7 +1581690,7 @@ index 1580d51ae..4f3eb0ac7 } } -@@ -1212,11 +1250,8 @@ static int dwc3_core_init_mode(struct dwc3 *dwc) +@@ -1217,11 +1258,8 @@ static int dwc3_core_init_mode(struct dwc3 *dwc) phy_set_mode(dwc->usb3_generic_phy, PHY_MODE_USB_DEVICE); ret = dwc3_gadget_init(dwc); @@ -1581952,7 +1581704,7 @@ index 1580d51ae..4f3eb0ac7 break; case USB_DR_MODE_HOST: dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_HOST); -@@ -1227,20 +1262,14 @@ static int dwc3_core_init_mode(struct dwc3 *dwc) +@@ -1232,20 +1270,14 @@ static int dwc3_core_init_mode(struct dwc3 *dwc) phy_set_mode(dwc->usb3_generic_phy, PHY_MODE_USB_HOST); ret = dwc3_host_init(dwc); @@ -1581977,17 +1581729,17 @@ index 1580d51ae..4f3eb0ac7 break; default: dev_err(dev, "Unsupported mode of operation %d\n", dwc->dr_mode); -@@ -1281,6 +1310,9 @@ static void dwc3_get_properties(struct dwc3 *dwc) - u8 rx_max_burst_prd; - u8 tx_thr_num_pkt_prd; - u8 tx_max_burst_prd; +@@ -1286,6 +1318,9 @@ static void dwc3_get_properties(struct dwc3 *dwc) + u8 rx_max_burst_prd = 0; + u8 tx_thr_num_pkt_prd = 0; + u8 tx_max_burst_prd = 0; + u8 tx_fifo_resize_max_num; + const char *usb_psy_name; + int ret; /* default to highest possible threshold */ lpm_nyet_threshold = 0xf; -@@ -1294,7 +1326,15 @@ static void dwc3_get_properties(struct dwc3 *dwc) +@@ -1299,7 +1334,15 @@ static void dwc3_get_properties(struct dwc3 *dwc) */ hird_threshold = 12; @@ -1582003,7 +1581755,7 @@ index 1580d51ae..4f3eb0ac7 dwc->dr_mode = usb_get_dr_mode(dev); dwc->hsphy_mode = of_usb_get_phy_mode(dev->of_node); -@@ -1305,6 +1345,13 @@ static void dwc3_get_properties(struct dwc3 *dwc) +@@ -1310,6 +1353,13 @@ static void dwc3_get_properties(struct dwc3 *dwc) else dwc->sysdev = dwc->dev; @@ -1582017,7 +1581769,7 @@ index 1580d51ae..4f3eb0ac7 dwc->has_lpm_erratum = device_property_read_bool(dev, "snps,has-lpm-erratum"); device_property_read_u8(dev, "snps,lpm-nyet-threshold", -@@ -1329,6 +1376,11 @@ static void dwc3_get_properties(struct dwc3 *dwc) +@@ -1334,6 +1384,11 @@ static void dwc3_get_properties(struct dwc3 *dwc) &tx_thr_num_pkt_prd); device_property_read_u8(dev, "snps,tx-max-burst-prd", &tx_max_burst_prd); @@ -1582029,7 +1581781,7 @@ index 1580d51ae..4f3eb0ac7 dwc->disable_scramble_quirk = device_property_read_bool(dev, "snps,disable_scramble_quirk"); -@@ -1394,6 +1446,8 @@ static void dwc3_get_properties(struct dwc3 *dwc) +@@ -1399,6 +1454,8 @@ static void dwc3_get_properties(struct dwc3 *dwc) dwc->tx_max_burst_prd = tx_max_burst_prd; dwc->imod_interval = 0; @@ -1582038,7 +1581790,7 @@ index 1580d51ae..4f3eb0ac7 } /* check whether the core supports IMOD */ -@@ -1468,21 +1522,59 @@ static void dwc3_check_params(struct dwc3 *dwc) +@@ -1473,21 +1530,59 @@ static void dwc3_check_params(struct dwc3 *dwc) } break; } @@ -1582100,7 +1581852,7 @@ index 1580d51ae..4f3eb0ac7 dwc->dev = dev; -@@ -1514,7 +1606,7 @@ static int dwc3_probe(struct platform_device *pdev) +@@ -1519,7 +1614,7 @@ static int dwc3_probe(struct platform_device *pdev) dwc3_get_properties(dwc); @@ -1582109,7 +1581861,7 @@ index 1580d51ae..4f3eb0ac7 if (IS_ERR(dwc->reset)) return PTR_ERR(dwc->reset); -@@ -1580,8 +1672,7 @@ static int dwc3_probe(struct platform_device *pdev) +@@ -1585,8 +1680,7 @@ static int dwc3_probe(struct platform_device *pdev) ret = dwc3_core_init(dwc); if (ret) { @@ -1582119,7 +1581871,7 @@ index 1580d51ae..4f3eb0ac7 goto err4; } -@@ -1592,7 +1683,17 @@ static int dwc3_probe(struct platform_device *pdev) +@@ -1597,7 +1691,17 @@ static int dwc3_probe(struct platform_device *pdev) if (ret) goto err5; @@ -1582138,7 +1581890,7 @@ index 1580d51ae..4f3eb0ac7 return 0; -@@ -1630,6 +1731,9 @@ static int dwc3_probe(struct platform_device *pdev) +@@ -1635,6 +1739,9 @@ static int dwc3_probe(struct platform_device *pdev) assert_reset: reset_control_assert(dwc->reset); @@ -1582148,7 +1581900,7 @@ index 1580d51ae..4f3eb0ac7 return ret; } -@@ -1652,6 +1756,9 @@ static int dwc3_remove(struct platform_device *pdev) +@@ -1657,6 +1764,9 @@ static int dwc3_remove(struct platform_device *pdev) dwc3_free_event_buffers(dwc); dwc3_free_scratch_buffers(dwc); @@ -1582158,7 +1581910,7 @@ index 1580d51ae..4f3eb0ac7 return 0; } -@@ -1836,7 +1943,7 @@ static int dwc3_runtime_suspend(struct device *dev) +@@ -1841,7 +1951,7 @@ static int dwc3_runtime_suspend(struct device *dev) if (ret) return ret; @@ -1582167,7 +1581919,7 @@ index 1580d51ae..4f3eb0ac7 return 0; } -@@ -1846,7 +1953,7 @@ static int dwc3_runtime_resume(struct device *dev) +@@ -1851,7 +1961,7 @@ static int dwc3_runtime_resume(struct device *dev) struct dwc3 *dwc = dev_get_drvdata(dev); int ret; @@ -1582176,7 +1581928,7 @@ index 1580d51ae..4f3eb0ac7 ret = dwc3_resume_common(dwc, PMSG_AUTO_RESUME); if (ret) -@@ -1895,6 +2002,9 @@ static int dwc3_suspend(struct device *dev) +@@ -1900,6 +2010,9 @@ static int dwc3_suspend(struct device *dev) struct dwc3 *dwc = dev_get_drvdata(dev); int ret; @@ -1582186,7 +1581938,7 @@ index 1580d51ae..4f3eb0ac7 ret = dwc3_suspend_common(dwc, PMSG_SUSPEND); if (ret) return ret; -@@ -1909,6 +2019,9 @@ static int dwc3_resume(struct device *dev) +@@ -1914,6 +2027,9 @@ static int dwc3_resume(struct device *dev) struct dwc3 *dwc = dev_get_drvdata(dev); int ret; @@ -1583231,7 +1582983,7 @@ new mode 100755 index 8b236394a..c9b5fbd55 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c -@@ -405,6 +405,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd, +@@ -416,6 +416,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd, return ret; } @@ -1583239,7 +1582991,7 @@ index 8b236394a..c9b5fbd55 static int dwc3_send_clear_stall_ep_cmd(struct dwc3_ep *dep) { -@@ -628,8 +629,192 @@ static int dwc3_gadget_set_ep_config(struct dwc3_ep *dep, unsigned int action) +@@ -639,8 +640,192 @@ static int dwc3_gadget_set_ep_config(struct dwc3_ep *dep, unsigned int action) return dwc3_send_gadget_ep_cmd(dep, DWC3_DEPCMD_SETEPCONFIG, ¶ms); } @@ -1583434,7 +1583186,7 @@ index 8b236394a..c9b5fbd55 /** * __dwc3_gadget_ep_enable - initializes a hw endpoint -@@ -648,6 +833,10 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep, unsigned int action) +@@ -659,6 +844,10 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep, unsigned int action) int ret; if (!(dep->flags & DWC3_EP_ENABLED)) { @@ -1583445,7 +1583197,7 @@ index 8b236394a..c9b5fbd55 ret = dwc3_gadget_start_config(dep); if (ret) return ret; -@@ -730,8 +919,16 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep, unsigned int action) +@@ -741,8 +930,16 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep, unsigned int action) * All stream eps will reinitiate stream on NoStream * rejection until we can determine that the host can * prime after the first transfer. @@ -1583463,7 +1583215,7 @@ index 8b236394a..c9b5fbd55 } } -@@ -802,7 +999,7 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) +@@ -813,7 +1010,7 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) dep->stream_capable = false; dep->type = 0; @@ -1583472,7 +1583224,7 @@ index 8b236394a..c9b5fbd55 return 0; } -@@ -1404,7 +1601,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep) +@@ -1416,7 +1613,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep) dwc3_stop_active_transfer(dep, true, true); list_for_each_entry_safe(req, tmp, &dep->started_list, list) @@ -1583481,7 +1583233,7 @@ index 8b236394a..c9b5fbd55 /* If ep isn't started, then there's no end transfer pending */ if (!(dep->flags & DWC3_EP_END_TRANSFER_PENDING)) -@@ -1620,7 +1817,7 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) +@@ -1632,7 +1829,7 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) struct dwc3 *dwc = dep->dwc; if (!dep->endpoint.desc || !dwc->pullups_connected || !dwc->connected) { @@ -1583490,7 +1583242,7 @@ index 8b236394a..c9b5fbd55 dep->name); return -ESHUTDOWN; } -@@ -1733,10 +1930,25 @@ static void dwc3_gadget_ep_cleanup_cancelled_requests(struct dwc3_ep *dep) +@@ -1745,10 +1942,25 @@ static void dwc3_gadget_ep_cleanup_cancelled_requests(struct dwc3_ep *dep) { struct dwc3_request *req; struct dwc3_request *tmp; @@ -1583517,7 +1583269,7 @@ index 8b236394a..c9b5fbd55 } } -@@ -1780,7 +1992,8 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, +@@ -1792,7 +2004,8 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, * cancelled. */ list_for_each_entry_safe(r, t, &dep->started_list, list) @@ -1583527,7 +1583279,7 @@ index 8b236394a..c9b5fbd55 dep->flags &= ~DWC3_EP_WAIT_TRANSFER_COMPLETE; -@@ -1801,8 +2014,6 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol) +@@ -1813,8 +2026,6 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol) { struct dwc3_gadget_ep_cmd_params params; struct dwc3 *dwc = dep->dwc; @@ -1583536,7 +1583288,7 @@ index 8b236394a..c9b5fbd55 int ret; if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) { -@@ -1851,16 +2062,14 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol) +@@ -1863,16 +2074,14 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol) dwc3_stop_active_transfer(dep, true, true); @@ -1583555,7 +1583307,7 @@ index 8b236394a..c9b5fbd55 ret = dwc3_send_clear_stall_ep_cmd(dep); if (ret) { dev_err(dwc->dev, "failed to clear STALL on %s\n", -@@ -2059,6 +2268,102 @@ static void dwc3_stop_active_transfers(struct dwc3 *dwc) +@@ -2071,6 +2280,102 @@ static void dwc3_stop_active_transfers(struct dwc3 *dwc) } } @@ -1583658,7 +1583410,7 @@ index 8b236394a..c9b5fbd55 static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) { u32 reg; -@@ -2081,6 +2386,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) +@@ -2093,6 +2398,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) if (dwc->has_hibernation) reg |= DWC3_DCTL_KEEP_CONNECT; @@ -1583666,20 +1583418,19 @@ index 8b236394a..c9b5fbd55 dwc->pullups_connected = true; } else { reg &= ~DWC3_DCTL_RUN_STOP; -@@ -2111,10 +2417,12 @@ static int __dwc3_gadget_start(struct dwc3 *dwc); +@@ -2151,9 +2457,11 @@ static int dwc3_gadget_soft_disconnect(struct dwc3 *dwc) static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) { struct dwc3 *dwc = gadget_to_dwc(g); + struct dwc3_vendor *vdwc = container_of(dwc, struct dwc3_vendor, dwc); - unsigned long flags; int ret; is_on = !!is_on; + vdwc->softconnect = is_on; + dwc->softconnect = is_on; /* - * Per databook, when we want to stop the gadget, if a control transfer -@@ -2205,8 +2513,7 @@ static void dwc3_gadget_enable_irq(struct dwc3 *dwc) +@@ -2222,8 +2530,7 @@ static void dwc3_gadget_enable_irq(struct dwc3 *dwc) u32 reg; /* Enable all but Start and End of Frame IRQs */ @@ -1583689,7 +1583440,7 @@ index 8b236394a..c9b5fbd55 DWC3_DEVTEN_CMDCMPLTEN | DWC3_DEVTEN_ERRTICERREN | DWC3_DEVTEN_WKUPEVTEN | -@@ -2219,7 +2526,7 @@ static void dwc3_gadget_enable_irq(struct dwc3 *dwc) +@@ -2236,7 +2543,7 @@ static void dwc3_gadget_enable_irq(struct dwc3 *dwc) /* On 2.30a and above this bit enables U3/L2-L1 Suspend Events */ if (!DWC3_VER_IS_PRIOR(DWC3, 230A)) @@ -1583698,7 +1583449,7 @@ index 8b236394a..c9b5fbd55 dwc3_writel(dwc->regs, DWC3_DEVTEN, reg); } -@@ -2262,9 +2569,7 @@ static void dwc3_gadget_setup_nump(struct dwc3 *dwc) +@@ -2279,9 +2586,7 @@ static void dwc3_gadget_setup_nump(struct dwc3 *dwc) u32 reg; ram2_depth = DWC3_GHWPARAMS7_RAM2_DEPTH(dwc->hwparams.hwparams7); @@ -1583709,7 +1583460,7 @@ index 8b236394a..c9b5fbd55 nump = ((ram2_depth * mdwidth / 8) - 24 - 16) / 1024; nump = min_t(u32, nump, 16); -@@ -2282,6 +2587,15 @@ static int __dwc3_gadget_start(struct dwc3 *dwc) +@@ -2299,6 +2604,15 @@ static int __dwc3_gadget_start(struct dwc3 *dwc) int ret = 0; u32 reg; @@ -1583725,7 +1583476,7 @@ index 8b236394a..c9b5fbd55 /* * Use IMOD if enabled via dwc->imod_interval. Otherwise, if * the core supports IMOD, disable it. -@@ -2310,6 +2624,17 @@ static int __dwc3_gadget_start(struct dwc3 *dwc) +@@ -2327,6 +2641,17 @@ static int __dwc3_gadget_start(struct dwc3 *dwc) dwc3_gadget_setup_nump(dwc); @@ -1583743,7 +1583494,7 @@ index 8b236394a..c9b5fbd55 /* Start with SuperSpeed Default */ dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512); -@@ -2397,6 +2722,7 @@ static int dwc3_gadget_stop(struct usb_gadget *g) +@@ -2414,6 +2739,7 @@ static int dwc3_gadget_stop(struct usb_gadget *g) spin_lock_irqsave(&dwc->lock, flags); dwc->gadget_driver = NULL; @@ -1583751,7 +1583502,7 @@ index 8b236394a..c9b5fbd55 spin_unlock_irqrestore(&dwc->lock, flags); free_irq(dwc->irq_gadget, dwc->ev_buf); -@@ -2448,59 +2774,94 @@ static void dwc3_gadget_set_speed(struct usb_gadget *g, +@@ -2465,59 +2791,94 @@ static void dwc3_gadget_set_speed(struct usb_gadget *g, { struct dwc3 *dwc = gadget_to_dwc(g); unsigned long flags; @@ -1583893,7 +1583644,7 @@ index 8b236394a..c9b5fbd55 spin_unlock_irqrestore(&dwc->lock, flags); } -@@ -2512,7 +2873,11 @@ static const struct usb_gadget_ops dwc3_gadget_ops = { +@@ -2529,7 +2890,11 @@ static const struct usb_gadget_ops dwc3_gadget_ops = { .udc_start = dwc3_gadget_start, .udc_stop = dwc3_gadget_stop, .udc_set_speed = dwc3_gadget_set_speed, @@ -1583905,7 +1583656,7 @@ index 8b236394a..c9b5fbd55 }; /* -------------------------------------------------------------------------- */ -@@ -2535,12 +2900,10 @@ static int dwc3_gadget_init_control_endpoint(struct dwc3_ep *dep) +@@ -2552,12 +2917,10 @@ static int dwc3_gadget_init_control_endpoint(struct dwc3_ep *dep) static int dwc3_gadget_init_in_endpoint(struct dwc3_ep *dep) { struct dwc3 *dwc = dep->dwc; @@ -1583920,7 +1583671,7 @@ index 8b236394a..c9b5fbd55 /* MDWIDTH is represented in bits, we need it in bytes */ mdwidth /= 8; -@@ -2582,12 +2945,10 @@ static int dwc3_gadget_init_in_endpoint(struct dwc3_ep *dep) +@@ -2599,12 +2962,10 @@ static int dwc3_gadget_init_in_endpoint(struct dwc3_ep *dep) static int dwc3_gadget_init_out_endpoint(struct dwc3_ep *dep) { struct dwc3 *dwc = dep->dwc; @@ -1583935,7 +1583686,7 @@ index 8b236394a..c9b5fbd55 /* MDWIDTH is represented in bits, convert to bytes */ mdwidth /= 8; -@@ -2880,6 +3241,11 @@ static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep, +@@ -2926,6 +3287,11 @@ static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep, static bool dwc3_gadget_ep_should_continue(struct dwc3_ep *dep) { struct dwc3_request *req; @@ -1583947,7 +1583698,7 @@ index 8b236394a..c9b5fbd55 if (!list_empty(&dep->pending_list)) return true; -@@ -2907,6 +3273,9 @@ static bool dwc3_gadget_endpoint_trbs_complete(struct dwc3_ep *dep, +@@ -2953,6 +3319,9 @@ static bool dwc3_gadget_endpoint_trbs_complete(struct dwc3_ep *dep, struct dwc3 *dwc = dep->dwc; bool no_started_trb = true; @@ -1583957,17 +1583708,17 @@ index 8b236394a..c9b5fbd55 dwc3_gadget_ep_cleanup_completed_requests(dep, event, status); if (dep->flags & DWC3_EP_END_TRANSFER_PENDING) -@@ -2954,6 +3323,9 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep, +@@ -3003,6 +3372,9 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep, { int status = 0; + if (!dep->endpoint.desc) + return; + - if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) - dwc3_gadget_endpoint_frame_from_event(dep, event); + if (!dep->endpoint.desc) + return; -@@ -3145,7 +3517,7 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, +@@ -3205,7 +3577,7 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, static void dwc3_disconnect_gadget(struct dwc3 *dwc) { @@ -1583976,7 +1583727,7 @@ index 8b236394a..c9b5fbd55 spin_unlock(&dwc->lock); dwc->gadget_driver->disconnect(dwc->gadget); spin_lock(&dwc->lock); -@@ -3154,7 +3526,7 @@ static void dwc3_disconnect_gadget(struct dwc3 *dwc) +@@ -3214,7 +3586,7 @@ static void dwc3_disconnect_gadget(struct dwc3 *dwc) static void dwc3_suspend_gadget(struct dwc3 *dwc) { @@ -1583985,7 +1583736,7 @@ index 8b236394a..c9b5fbd55 spin_unlock(&dwc->lock); dwc->gadget_driver->suspend(dwc->gadget); spin_lock(&dwc->lock); -@@ -3163,7 +3535,7 @@ static void dwc3_suspend_gadget(struct dwc3 *dwc) +@@ -3223,7 +3595,7 @@ static void dwc3_suspend_gadget(struct dwc3 *dwc) static void dwc3_resume_gadget(struct dwc3 *dwc) { @@ -1583994,7 +1583745,7 @@ index 8b236394a..c9b5fbd55 spin_unlock(&dwc->lock); dwc->gadget_driver->resume(dwc->gadget); spin_lock(&dwc->lock); -@@ -3175,14 +3547,14 @@ static void dwc3_reset_gadget(struct dwc3 *dwc) +@@ -3235,14 +3607,14 @@ static void dwc3_reset_gadget(struct dwc3 *dwc) if (!dwc->gadget_driver) return; @@ -1584011,7 +1583762,7 @@ index 8b236394a..c9b5fbd55 bool interrupt) { struct dwc3_gadget_ep_cmd_params params; -@@ -3242,6 +3614,7 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, +@@ -3294,6 +3666,7 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force, else dep->flags |= DWC3_EP_END_TRANSFER_PENDING; } @@ -1584019,7 +1583770,7 @@ index 8b236394a..c9b5fbd55 static void dwc3_clear_stall_all_ep(struct dwc3 *dwc) { -@@ -3356,12 +3729,18 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc) +@@ -3408,12 +3781,18 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc) struct dwc3_ep *dep; int ret; u32 reg; @@ -1584038,7 +1583789,7 @@ index 8b236394a..c9b5fbd55 /* * RAMClkSel is reset to 0 after USB reset, so it must be reprogrammed * each time on Connect Done. -@@ -3376,6 +3755,11 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc) +@@ -3428,6 +3807,11 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc) dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512); dwc->gadget->ep0->maxpacket = 512; dwc->gadget->speed = USB_SPEED_SUPER_PLUS; @@ -1584050,7 +1583801,7 @@ index 8b236394a..c9b5fbd55 break; case DWC3_DSTS_SUPERSPEED: /* -@@ -3397,6 +3781,11 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc) +@@ -3449,6 +3833,11 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc) dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512); dwc->gadget->ep0->maxpacket = 512; dwc->gadget->speed = USB_SPEED_SUPER; @@ -1584062,7 +1583813,7 @@ index 8b236394a..c9b5fbd55 break; case DWC3_DSTS_HIGHSPEED: dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(64); -@@ -3488,7 +3877,7 @@ static void dwc3_gadget_wakeup_interrupt(struct dwc3 *dwc) +@@ -3540,7 +3929,7 @@ static void dwc3_gadget_wakeup_interrupt(struct dwc3 *dwc) * implemented. */ @@ -1584071,7 +1583822,7 @@ index 8b236394a..c9b5fbd55 spin_unlock(&dwc->lock); dwc->gadget_driver->resume(dwc->gadget); spin_lock(&dwc->lock); -@@ -3656,7 +4045,7 @@ static void dwc3_gadget_interrupt(struct dwc3 *dwc, +@@ -3706,7 +4095,7 @@ static void dwc3_gadget_interrupt(struct dwc3 *dwc, case DWC3_DEVICE_EVENT_LINK_STATUS_CHANGE: dwc3_gadget_linksts_change_interrupt(dwc, event->event_info); break; @@ -1584080,7 +1583831,7 @@ index 8b236394a..c9b5fbd55 /* It changed to be suspend event for version 2.30a and above */ if (!DWC3_VER_IS_PRIOR(DWC3, 230A)) { /* -@@ -3900,6 +4289,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) +@@ -3954,6 +4343,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) dev->platform_data = dwc; dwc->gadget->ops = &dwc3_gadget_ops; dwc->gadget->speed = USB_SPEED_UNKNOWN; @@ -1584088,7 +1583839,7 @@ index 8b236394a..c9b5fbd55 dwc->gadget->sg_supported = true; dwc->gadget->name = "dwc3-gadget"; dwc->gadget->lpm_capable = !dwc->usb2_gadget_lpm_disable; -@@ -3926,6 +4316,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) +@@ -3980,6 +4370,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) dwc->revision); dwc->gadget->max_speed = dwc->maximum_speed; @@ -1584096,7 +1583847,7 @@ index 8b236394a..c9b5fbd55 /* * REVISIT: Here we should clear all pending IRQs to be -@@ -3942,7 +4333,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) +@@ -3996,7 +4387,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) goto err5; } @@ -1584108,14 +1583859,14 @@ index 8b236394a..c9b5fbd55 return 0; -@@ -3997,9 +4391,10 @@ int dwc3_gadget_suspend(struct dwc3 *dwc) +@@ -4051,9 +4445,10 @@ int dwc3_gadget_suspend(struct dwc3 *dwc) int dwc3_gadget_resume(struct dwc3 *dwc) { + struct dwc3_vendor *vdwc = container_of(dwc, struct dwc3_vendor, dwc); int ret; -- if (!dwc->gadget_driver) +- if (!dwc->gadget_driver || !dwc->softconnect) + if (!dwc->gadget_driver || !vdwc->softconnect) return 0; @@ -1590182,15 +1589933,15 @@ diff --git a/drivers/usb/gadget/function/uvc.h b/drivers/usb/gadget/function/uvc index 23ee25383..8fb61023d 100644 --- a/drivers/usb/gadget/function/uvc.h +++ b/drivers/usb/gadget/function/uvc.h -@@ -14,6 +14,7 @@ - #include +@@ -15,6 +15,7 @@ #include #include + #include +#include #include #include -@@ -68,6 +69,7 @@ extern unsigned int uvc_gadget_trace_param; +@@ -69,6 +70,7 @@ extern unsigned int uvc_gadget_trace_param; #define UVC_NUM_REQUESTS 4 #define UVC_MAX_REQUEST_SIZE 64 #define UVC_MAX_EVENTS 4 @@ -1590198,7 +1589949,7 @@ index 23ee25383..8fb61023d 100644 /* ------------------------------------------------------------------------ * Structures -@@ -89,8 +91,8 @@ struct uvc_video { +@@ -90,8 +92,8 @@ struct uvc_video { /* Requests */ unsigned int req_size; @@ -1590209,16 +1589960,16 @@ index 23ee25383..8fb61023d 100644 struct list_head req_free; spinlock_t req_lock; -@@ -117,6 +119,8 @@ struct uvc_device { +@@ -118,6 +120,8 @@ struct uvc_device { enum uvc_state state; struct usb_function func; struct uvc_video video; + /* for creating and issuing QoS requests */ + struct pm_qos_request pm_qos; bool func_connected; + wait_queue_head_t func_connected_queue; - /* Descriptors */ -@@ -138,6 +142,7 @@ struct uvc_device { +@@ -140,6 +144,7 @@ struct uvc_device { /* Events */ unsigned int event_length; unsigned int event_setup_out : 1; @@ -1591833,9 +1591584,9 @@ new mode 100755 index 8950d1f10..8b90da5a6 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c -@@ -25,6 +25,15 @@ - */ - #define TT_MICROFRAMES_MAX 9 +@@ -32,6 +32,15 @@ + #define ESCH_BW_OVERFLOW 1004 + #define ESCH_FIXME 1005 +#define DBG_BUF_EN 64 + @@ -1591849,9 +1591600,9 @@ index 8950d1f10..8b90da5a6 /* mtk scheduler bitmasks */ #define EP_BPKTS(p) ((p) & 0x7f) #define EP_BCSCOUNT(p) (((p) & 0x7) << 8) -@@ -32,13 +41,75 @@ - #define EP_BOFFSET(p) ((p) & 0x3fff) - #define EP_BREPEAT(p) (((p) & 0x7fff) << 16) +@@ -57,13 +66,75 @@ static char *sch_error_string(int err_num) + } + } +static char *sch_error_string(int err_num) +{ @@ -1591926,7 +1591677,7 @@ index 8950d1f10..8b90da5a6 * * the bandwidth domain array is saved to @sch_array of struct xhci_hcd_mtk, * each HS root port is treated as a single bandwidth domain, -@@ -49,9 +120,11 @@ static int is_fs_or_ls(enum usb_device_speed speed) +@@ -74,9 +145,11 @@ static int is_fs_or_ls(enum usb_device_speed speed) * so the bandwidth domain array is organized as follow for simplification: * SSport0-OUT, SSport0-IN, ..., SSportX-OUT, SSportX-IN, HSport0, ..., HSportY */ @@ -1591940,7 +1591691,7 @@ index 8950d1f10..8b90da5a6 struct xhci_virt_device *virt_dev; int bw_index; -@@ -67,7 +140,7 @@ static int get_bw_index(struct xhci_hcd *xhci, struct usb_device *udev, +@@ -92,7 +165,7 @@ static int get_bw_index(struct xhci_hcd *xhci, struct usb_device *udev, bw_index = virt_dev->real_port + xhci->usb3_rhub.num_ports - 1; } @@ -1591949,7 +1591700,7 @@ index 8950d1f10..8b90da5a6 } static u32 get_esit(struct xhci_ep_ctx *ep_ctx) -@@ -85,7 +158,6 @@ static struct mu3h_sch_tt *find_tt(struct usb_device *udev) +@@ -110,7 +183,6 @@ static struct mu3h_sch_tt *find_tt(struct usb_device *udev) { struct usb_tt *utt = udev->tt; struct mu3h_sch_tt *tt, **tt_index, **ptt; @@ -1591957,7 +1591708,7 @@ index 8950d1f10..8b90da5a6 bool allocated_index = false; if (!utt) -@@ -107,10 +179,8 @@ static struct mu3h_sch_tt *find_tt(struct usb_device *udev) +@@ -132,10 +204,8 @@ static struct mu3h_sch_tt *find_tt(struct usb_device *udev) utt->hcpriv = tt_index; allocated_index = true; } @@ -1591969,7 +1591720,7 @@ index 8950d1f10..8b90da5a6 ptt = (struct mu3h_sch_tt **) &utt->hcpriv; } -@@ -125,8 +195,6 @@ static struct mu3h_sch_tt *find_tt(struct usb_device *udev) +@@ -150,8 +220,6 @@ static struct mu3h_sch_tt *find_tt(struct usb_device *udev) return ERR_PTR(-ENOMEM); } INIT_LIST_HEAD(&tt->ep_list); @@ -1591978,7 +1591729,7 @@ index 8950d1f10..8b90da5a6 *ptt = tt; } -@@ -200,14 +268,15 @@ static struct mu3h_sch_ep_info *create_sch_ep(struct usb_device *udev, +@@ -225,14 +293,15 @@ static struct mu3h_sch_ep_info *create_sch_ep(struct usb_device *udev, sch_ep->sch_tt = tt; sch_ep->ep = ep; @@ -1591996,7 +1591747,7 @@ index 8950d1f10..8b90da5a6 { u32 ep_type; u32 maxpkt; -@@ -234,7 +303,7 @@ static void setup_sch_info(struct usb_device *udev, +@@ -259,7 +328,7 @@ static void setup_sch_info(struct usb_device *udev, sch_ep->burst_mode = 0; sch_ep->repeat = 0; @@ -1592005,7 +1591756,7 @@ index 8950d1f10..8b90da5a6 sch_ep->cs_count = 0; /* -@@ -252,7 +321,7 @@ static void setup_sch_info(struct usb_device *udev, +@@ -277,7 +346,7 @@ static void setup_sch_info(struct usb_device *udev, sch_ep->pkts = max_burst + 1; sch_ep->bw_cost_per_microframe = maxpkt * sch_ep->pkts; bwb_table[0] = sch_ep->bw_cost_per_microframe; @@ -1592014,7 +1591765,7 @@ index 8950d1f10..8b90da5a6 /* usb3_r1 spec section4.4.7 & 4.4.8 */ sch_ep->cs_count = 0; sch_ep->burst_mode = 1; -@@ -272,7 +341,6 @@ static void setup_sch_info(struct usb_device *udev, +@@ -297,7 +366,6 @@ static void setup_sch_info(struct usb_device *udev, } if (ep_type == ISOC_IN_EP || ep_type == ISOC_OUT_EP) { @@ -1592022,7 +1591773,7 @@ index 8950d1f10..8b90da5a6 if (sch_ep->esit == 1) sch_ep->pkts = esit_pkts; -@@ -288,16 +356,14 @@ static void setup_sch_info(struct usb_device *udev, +@@ -313,16 +381,14 @@ static void setup_sch_info(struct usb_device *udev, sch_ep->repeat = !!(sch_ep->num_budget_microframes > 1); sch_ep->bw_cost_per_microframe = maxpkt * sch_ep->pkts; @@ -1592042,23 +1591793,7 @@ index 8950d1f10..8b90da5a6 sch_ep->pkts = 1; /* at most one packet for each microframe */ /* -@@ -375,7 +441,6 @@ static void update_bus_bw(struct mu3h_sch_bw_info *sch_bw, - sch_ep->bw_budget_table[j]; - } - } -- sch_ep->allocated = used; - } - - static int check_fs_bus_bw(struct mu3h_sch_ep_info *sch_ep, int offset) -@@ -396,25 +461,22 @@ static int check_fs_bus_bw(struct mu3h_sch_ep_info *sch_ep, int offset) - for (j = 0; j < sch_ep->cs_count; j++) { - tmp = tt->fs_bus_bw[base + j] + sch_ep->bw_cost_per_microframe; - if (tmp > FS_PAYLOAD_MAX) -- return -ERANGE; -+ return -ESCH_BW_OVERFLOW; - } - } - +@@ -428,8 +494,7 @@ static int check_fs_bus_bw(struct mu3h_sch_ep_info *sch_ep, int offset) return 0; } @@ -1592066,67 +1591801,9 @@ index 8950d1f10..8b90da5a6 - struct mu3h_sch_ep_info *sch_ep, u32 offset) +static int check_sch_tt(struct mu3h_sch_ep_info *sch_ep, u32 offset) { - struct mu3h_sch_tt *tt = sch_ep->sch_tt; u32 extra_cs_count; -- u32 fs_budget_start; u32 start_ss, last_ss; - u32 start_cs, last_cs; - int i; - - start_ss = offset % 8; -- fs_budget_start = (start_ss + 1) % 8; - - if (sch_ep->ep_type == ISOC_OUT_EP) { - last_ss = start_ss + sch_ep->cs_count - 1; -@@ -424,11 +486,11 @@ static int check_sch_tt(struct usb_device *udev, - * must never schedule Start-Split in Y6 - */ - if (!(start_ss == 7 || last_ss < 6)) -- return -ERANGE; -+ return -ESCH_SS_Y6; - - for (i = 0; i < sch_ep->cs_count; i++) - if (test_bit(offset + i, tt->ss_bit_map)) -- return -ERANGE; -+ return -ESCH_SS_OVERLAP; - - } else { - u32 cs_count = DIV_ROUND_UP(sch_ep->maxpkt, FS_PAYLOAD_MAX); -@@ -438,28 +500,26 @@ static int check_sch_tt(struct usb_device *udev, - * must never schedule Start-Split in Y6 - */ - if (start_ss == 6) -- return -ERANGE; -+ return -ESCH_SS_Y6; - - /* one uframe for ss + one uframe for idle */ - start_cs = (start_ss + 2) % 8; - last_cs = start_cs + cs_count - 1; - - if (last_cs > 7) -- return -ERANGE; -+ return -ESCH_CS_OVERFLOW; - - if (sch_ep->ep_type == ISOC_IN_EP) - extra_cs_count = (last_cs == 7) ? 1 : 2; - else /* ep_type : INTR IN / INTR OUT */ -- extra_cs_count = (fs_budget_start == 6) ? 1 : 2; -+ extra_cs_count = 1; - - cs_count += extra_cs_count; - if (cs_count > 7) - cs_count = 7; /* HW limit */ - -- for (i = 0; i < cs_count + 2; i++) { -- if (test_bit(offset + i, tt->ss_bit_map)) -- return -ERANGE; -- } -+ if (test_bit(offset, tt->ss_bit_map)) -+ return -ESCH_SS_OVERLAP; - - sch_ep->cs_count = cs_count; - /* one for ss, the other for idle */ -@@ -476,8 +536,7 @@ static int check_sch_tt(struct usb_device *udev, +@@ -488,8 +553,7 @@ static int check_sch_tt(struct usb_device *udev, return check_fs_bus_bw(sch_ep, offset); } @@ -1592136,8 +1591813,8 @@ index 8950d1f10..8b90da5a6 { struct mu3h_sch_tt *tt = sch_ep->sch_tt; u32 base, num_esit; -@@ -513,21 +572,46 @@ static void update_sch_tt(struct usb_device *udev, - list_del(&sch_ep->tt_endpoint); +@@ -549,8 +613,36 @@ static u32 get_esit_boundary(struct mu3h_sch_ep_info *sch_ep) + return boundary; } -static int check_sch_bw(struct usb_device *udev, @@ -1592174,45 +1591851,8 @@ index 8950d1f10..8b90da5a6 + struct mu3h_sch_ep_info *sch_ep) { u32 offset; -- u32 esit; u32 min_bw; - u32 min_index; - u32 worst_bw; - u32 bw_boundary; -+ u32 esit_boundary; - u32 min_num_budget; - u32 min_cs_count; -- bool tt_offset_ok = false; -- int ret; -- -- esit = sch_ep->esit; -+ int ret = 0; - - /* - * Search through all possible schedule microframes. -@@ -537,16 +621,15 @@ static int check_sch_bw(struct usb_device *udev, - min_index = 0; - min_cs_count = sch_ep->cs_count; - min_num_budget = sch_ep->num_budget_microframes; -- for (offset = 0; offset < esit; offset++) { -- if (is_fs_or_ls(udev->speed)) { -- ret = check_sch_tt(udev, sch_ep, offset); -+ esit_boundary = get_esit_boundary(sch_ep); -+ for (offset = 0; offset < sch_ep->esit; offset++) { -+ if (sch_ep->sch_tt) { -+ ret = check_sch_tt(sch_ep, offset); - if (ret) - continue; -- else -- tt_offset_ok = true; - } - -- if ((offset + sch_ep->num_budget_microframes) > sch_ep->esit) -+ if ((offset + sch_ep->num_budget_microframes) > esit_boundary) - break; - - worst_bw = get_max_bw(sch_bw, sch_ep, offset); -@@ -560,44 +643,24 @@ static int check_sch_bw(struct usb_device *udev, +@@ -592,13 +684,7 @@ static int check_sch_bw(struct usb_device *udev, break; } @@ -1592226,43 +1591866,8 @@ index 8950d1f10..8b90da5a6 + bw_boundary = get_bw_boundary(sch_ep->speed); /* check bandwidth */ if (min_bw > bw_boundary) -- return -ERANGE; -+ return ret ? ret : -ESCH_BW_OVERFLOW; - - sch_ep->offset = min_index; - sch_ep->cs_count = min_cs_count; - sch_ep->num_budget_microframes = min_num_budget; - -- if (is_fs_or_ls(udev->speed)) { -- /* all offset for tt is not ok*/ -- if (!tt_offset_ok) -- return -ERANGE; -- -- update_sch_tt(udev, sch_ep, 1); -- } -- -- /* update bus bandwidth info */ -- update_bus_bw(sch_bw, sch_ep, 1); -- -- return 0; -+ return load_ep_bw(sch_bw, sch_ep, true); - } - - static void destroy_sch_ep(struct usb_device *udev, - struct mu3h_sch_bw_info *sch_bw, struct mu3h_sch_ep_info *sch_ep) - { - /* only release ep bw check passed by check_sch_bw() */ -- if (sch_ep->allocated) { -- update_bus_bw(sch_bw, sch_ep, 0); -- if (sch_ep->sch_tt) -- update_sch_tt(udev, sch_ep, 0); -- } -+ if (sch_ep->allocated) -+ load_ep_bw(sch_bw, sch_ep, false); - - if (sch_ep->sch_tt) - drop_tt(udev); -@@ -652,37 +715,29 @@ int xhci_mtk_sch_init(struct xhci_hcd_mtk *mtk) + return ret ? ret : -ESCH_BW_OVERFLOW; +@@ -670,37 +756,29 @@ int xhci_mtk_sch_init(struct xhci_hcd_mtk *mtk) return 0; } @@ -1592305,7 +1591910,7 @@ index 8950d1f10..8b90da5a6 /* * set @bpkts to 1 if it is LS or FS periodic endpoint, and its * device does not connected through an external HS hub -@@ -698,41 +753,30 @@ int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, +@@ -716,41 +794,30 @@ int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, if (IS_ERR_OR_NULL(sch_ep)) return -ENOMEM; @@ -1592354,7 +1591959,7 @@ index 8950d1f10..8b90da5a6 list_for_each_entry_safe(sch_ep, tmp, &sch_bw->bw_ep_list, endpoint) { if (sch_ep->ep == ep) { -@@ -741,7 +785,6 @@ void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, +@@ -759,7 +826,6 @@ void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, } } } @@ -1592362,7 +1591967,7 @@ index 8950d1f10..8b90da5a6 int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) { -@@ -750,17 +793,17 @@ int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) +@@ -768,18 +834,18 @@ int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) struct xhci_virt_device *virt_dev = xhci->devs[udev->slot_id]; struct mu3h_sch_bw_info *sch_bw; struct mu3h_sch_ep_info *sch_ep, *tmp; @@ -1592379,13 +1591984,13 @@ index 8950d1f10..8b90da5a6 - ret = check_sch_bw(udev, sch_bw, sch_ep); + ret = check_sch_bw(sch_bw, sch_ep); if (ret) { -- xhci_err(xhci, "Not enough bandwidth!\n"); -+ xhci_err(xhci, "Not enough bandwidth! (%s)\n", + xhci_err(xhci, "Not enough bandwidth! (%s)\n", + sch_error_string(-ret)); + sch_error_string(-ret)); return -ENOSPC; } } -@@ -770,9 +813,7 @@ int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) +@@ -789,9 +855,7 @@ int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) struct usb_host_endpoint *ep = sch_ep->ep; unsigned int ep_index = xhci_get_endpoint_index(&ep->desc); @@ -1592396,7 +1592001,7 @@ index 8950d1f10..8b90da5a6 list_move_tail(&sch_ep->endpoint, &sch_bw->bw_ep_list); ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); -@@ -789,7 +830,6 @@ int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) +@@ -808,7 +872,6 @@ int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) return xhci_check_bandwidth(hcd, udev); } @@ -1592404,7 +1592009,7 @@ index 8950d1f10..8b90da5a6 void xhci_mtk_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) { -@@ -797,16 +837,43 @@ void xhci_mtk_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) +@@ -816,16 +879,43 @@ void xhci_mtk_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct mu3h_sch_bw_info *sch_bw; struct mu3h_sch_ep_info *sch_ep, *tmp; @@ -1592497,15 +1592102,14 @@ new mode 100755 index 2fc0568ba..4ccd08e20 --- a/drivers/usb/host/xhci-mtk.h +++ b/drivers/usb/host/xhci-mtk.h -@@ -23,15 +23,11 @@ - * @ss_bit_map: used to avoid start split microframes overlay +@@ -22,14 +22,10 @@ + /** * @fs_bus_bw: array to keep track of bandwidth already used for FS * @ep_list: Endpoints using this TT - * @usb_tt: usb TT related - * @tt_port: TT port number */ struct mu3h_sch_tt { - DECLARE_BITMAP(ss_bit_map, XHCI_MTK_MAX_ESIT); u32 fs_bus_bw[XHCI_MTK_MAX_ESIT]; struct list_head ep_list; - struct usb_tt *usb_tt; @@ -1592513,7 +1592117,7 @@ index 2fc0568ba..4ccd08e20 }; /** -@@ -88,7 +84,8 @@ struct mu3h_sch_ep_info { +@@ -86,7 +82,8 @@ struct mu3h_sch_ep_info { struct mu3h_sch_tt *sch_tt; u32 ep_type; u32 maxpkt; @@ -1592523,7 +1592127,7 @@ index 2fc0568ba..4ccd08e20 bool allocated; /* * mtk xHCI scheduling information put into reserved DWs -@@ -165,38 +162,13 @@ static inline struct xhci_hcd_mtk *hcd_to_mtk(struct usb_hcd *hcd) +@@ -163,38 +160,13 @@ static inline struct xhci_hcd_mtk *hcd_to_mtk(struct usb_hcd *hcd) return dev_get_drvdata(hcd->self.controller); } @@ -1595290,8 +1594894,8 @@ index e62e5e3da..8769cab04 case DP_STATUS_CON_UFP_D: case DP_STATUS_CON_BOTH: /* NOTE: First acting as DP source */ conf |= DP_CONF_UFP_U_AS_UFP_D; -- pin_assign = DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo) & -- DP_CAP_UFP_D_PIN_ASSIGN(dp->port->vdo); +- pin_assign = DP_CAP_PIN_ASSIGN_UFP_D(dp->alt->vdo) & +- DP_CAP_PIN_ASSIGN_DFP_D(dp->port->vdo); break; default: break; @@ -1654252,85 +1653856,6 @@ new mode 100755 diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h old mode 100644 new mode 100755 -diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h -index 604c6c514..1cffa3474 100644 ---- a/include/linux/usb/ch9.h -+++ b/include/linux/usb/ch9.h -@@ -36,62 +36,24 @@ - #include - #include - --/** -- * usb_ep_type_string() - Returns human readable-name of the endpoint type. -- * @ep_type: The endpoint type to return human-readable name for. If it's not -- * any of the types: USB_ENDPOINT_XFER_{CONTROL, ISOC, BULK, INT}, -- * usually got by usb_endpoint_type(), the string 'unknown' will be returned. -- */ --extern const char *usb_ep_type_string(int ep_type); -+/* USB 3.2 SuperSpeed Plus phy signaling rate generation and lane count */ - --/** -- * usb_speed_string() - Returns human readable-name of the speed. -- * @speed: The speed to return human-readable name for. If it's not -- * any of the speeds defined in usb_device_speed enum, string for -- * USB_SPEED_UNKNOWN will be returned. -- */ --extern const char *usb_speed_string(enum usb_device_speed speed); -+enum usb_ssp_rate { -+ USB_SSP_GEN_UNKNOWN = 0, -+ USB_SSP_GEN_2x1, -+ USB_SSP_GEN_1x2, -+ USB_SSP_GEN_2x2, -+}; - --/** -- * usb_get_maximum_speed - Get maximum requested speed for a given USB -- * controller. -- * @dev: Pointer to the given USB controller device -- * -- * The function gets the maximum speed string from property "maximum-speed", -- * and returns the corresponding enum usb_device_speed. -- */ -+extern const char *usb_ep_type_string(int ep_type); -+extern const char *usb_speed_string(enum usb_device_speed speed); - extern enum usb_device_speed usb_get_maximum_speed(struct device *dev); -- --/** -- * usb_state_string - Returns human readable name for the state. -- * @state: The state to return a human-readable name for. If it's not -- * any of the states devices in usb_device_state_string enum, -- * the string UNKNOWN will be returned. -- */ -+extern enum usb_ssp_rate usb_get_maximum_ssp_rate(struct device *dev); - extern const char *usb_state_string(enum usb_device_state state); -+unsigned int usb_decode_interval(const struct usb_endpoint_descriptor *epd, -+ enum usb_device_speed speed); - - #ifdef CONFIG_TRACING --/** -- * usb_decode_ctrl - Returns human readable representation of control request. -- * @str: buffer to return a human-readable representation of control request. -- * This buffer should have about 200 bytes. -- * @size: size of str buffer. -- * @bRequestType: matches the USB bmRequestType field -- * @bRequest: matches the USB bRequest field -- * @wValue: matches the USB wValue field (CPU byte order) -- * @wIndex: matches the USB wIndex field (CPU byte order) -- * @wLength: matches the USB wLength field (CPU byte order) -- * -- * Function returns decoded, formatted and human-readable description of -- * control request packet. -- * -- * The usage scenario for this is for tracepoints, so function as a return -- * use the same value as in parameters. This approach allows to use this -- * function in TP_printk -- * -- * Important: wValue, wIndex, wLength parameters before invoking this function -- * should be processed by le16_to_cpu macro. -- */ - extern const char *usb_decode_ctrl(char *str, size_t size, __u8 bRequestType, - __u8 bRequest, __u16 wValue, __u16 wIndex, - __u16 wLength); diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index a2d229ab6..4d352204e 100644 --- a/include/linux/usb/composite.h @@ -1662698,33 +1662223,6 @@ index f51bc8f36..7e3fe68af 100644 #define UART_IIR 2 /* In: Interrupt ID Register */ #define UART_IIR_NO_INT 0x01 /* No interrupts pending */ -diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h -index 0f865ae4b..17ce56198 100644 ---- a/include/uapi/linux/usb/ch9.h -+++ b/include/uapi/linux/usb/ch9.h -@@ -968,9 +968,22 @@ struct usb_ssp_cap_descriptor { - __le32 bmSublinkSpeedAttr[1]; /* list of sublink speed attrib entries */ - #define USB_SSP_SUBLINK_SPEED_SSID (0xf) /* sublink speed ID */ - #define USB_SSP_SUBLINK_SPEED_LSE (0x3 << 4) /* Lanespeed exponent */ -+#define USB_SSP_SUBLINK_SPEED_LSE_BPS 0 -+#define USB_SSP_SUBLINK_SPEED_LSE_KBPS 1 -+#define USB_SSP_SUBLINK_SPEED_LSE_MBPS 2 -+#define USB_SSP_SUBLINK_SPEED_LSE_GBPS 3 -+ - #define USB_SSP_SUBLINK_SPEED_ST (0x3 << 6) /* Sublink type */ -+#define USB_SSP_SUBLINK_SPEED_ST_SYM_RX 0 -+#define USB_SSP_SUBLINK_SPEED_ST_ASYM_RX 1 -+#define USB_SSP_SUBLINK_SPEED_ST_SYM_TX 2 -+#define USB_SSP_SUBLINK_SPEED_ST_ASYM_TX 3 -+ - #define USB_SSP_SUBLINK_SPEED_RSVD (0x3f << 8) /* Reserved */ - #define USB_SSP_SUBLINK_SPEED_LP (0x3 << 14) /* Link protocol */ -+#define USB_SSP_SUBLINK_SPEED_LP_SS 0 -+#define USB_SSP_SUBLINK_SPEED_LP_SSP 1 -+ - #define USB_SSP_SUBLINK_SPEED_LSM (0xff << 16) /* Lanespeed mantissa */ - } __attribute__((packed)); - diff --git a/include/uapi/linux/usb/f_accessory.h b/include/uapi/linux/usb/f_accessory.h new file mode 100755 index 000000000..0baeb7d0d @@ -1663075,7 +1662573,7 @@ index 8ded6b8f1..6e6c8e0c9 100644 return -ENOMEM; diff --git a/ipc/sem.c b/ipc/sem.c -index d3b9b73cd..7d9c06b0a 100644 +index 2cb6515ef1dd..7d9c06b0ad6e 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -511,7 +511,7 @@ static struct sem_array *sem_alloc(size_t nsems) @@ -1663105,16 +1662603,6 @@ index d3b9b73cd..7d9c06b0a 100644 if (!new) { ipc_rcu_putref(&sma->sem_perm, sem_rcu_free); return ERR_PTR(-ENOMEM); -@@ -2001,8 +2001,7 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops, - if (nsops > ns->sc_semopm) - return -E2BIG; - if (nsops > SEMOPM_FAST) { -- sops = kvmalloc_array(nsops, sizeof(*sops), -- GFP_KERNEL_ACCOUNT); -+ sops = kvmalloc_array(nsops, sizeof(*sops), GFP_KERNEL); - if (sops == NULL) - return -ENOMEM; - } diff --git a/ipc/shm.c b/ipc/shm.c index fce0b7b12..e25c7c610 100644 --- a/ipc/shm.c @@ -1663367,7 +1662855,7 @@ diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 3173fe473..cb9a882d3 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c -@@ -334,6 +334,8 @@ static struct cpuset top_cpuset = { +@@ -335,6 +335,8 @@ static struct cpuset top_cpuset = { * guidelines for accessing subsystem state in kernel/cgroup.c */ @@ -1663376,7 +1662864,7 @@ index 3173fe473..cb9a882d3 100644 DEFINE_STATIC_PERCPU_RWSEM(cpuset_rwsem); void cpuset_read_lock(void) -@@ -351,9 +353,9 @@ static DEFINE_SPINLOCK(callback_lock); +@@ -352,9 +354,9 @@ static DEFINE_SPINLOCK(callback_lock); static struct workqueue_struct *cpuset_migrate_mm_wq; /* @@ -1663388,7 +1662876,7 @@ index 3173fe473..cb9a882d3 100644 static DECLARE_WORK(cpuset_hotplug_work, cpuset_hotplug_workfn); static DECLARE_WAIT_QUEUE_HEAD(cpuset_attach_wq); -@@ -373,18 +375,29 @@ static inline bool is_in_v2_mode(void) +@@ -374,18 +376,29 @@ static inline bool is_in_v2_mode(void) } /* @@ -1663424,7 +1662912,7 @@ index 3173fe473..cb9a882d3 100644 cs = parent_cs(cs); if (unlikely(!cs)) { /* -@@ -394,11 +407,13 @@ static void guarantee_online_cpus(struct cpuset *cs, struct cpumask *pmask) +@@ -395,11 +408,13 @@ static void guarantee_online_cpus(struct cpuset *cs, struct cpumask *pmask) * cpuset's effective_cpus is on its way to be * identical to cpu_online_mask. */ @@ -1663441,7 +1662929,7 @@ index 3173fe473..cb9a882d3 100644 } /* -@@ -489,6 +504,9 @@ static inline int alloc_cpumasks(struct cpuset *cs, struct tmpmasks *tmp) +@@ -490,6 +505,9 @@ static inline int alloc_cpumasks(struct cpuset *cs, struct tmpmasks *tmp) if (cs && !zalloc_cpumask_var(pmask4, GFP_KERNEL)) goto free_three; @@ -1663451,7 +1662939,7 @@ index 3173fe473..cb9a882d3 100644 return 0; free_three: -@@ -939,7 +957,7 @@ static void rebuild_root_domains(void) +@@ -940,7 +958,7 @@ static void rebuild_root_domains(void) struct cpuset *cs = NULL; struct cgroup_subsys_state *pos_css; @@ -1663460,7 +1662948,7 @@ index 3173fe473..cb9a882d3 100644 lockdep_assert_cpus_held(); lockdep_assert_held(&sched_domains_mutex); -@@ -999,8 +1017,7 @@ static void rebuild_sched_domains_locked(void) +@@ -1000,8 +1018,7 @@ static void rebuild_sched_domains_locked(void) struct cpuset *cs; int ndoms; @@ -1663470,7 +1662958,7 @@ index 3173fe473..cb9a882d3 100644 /* * If we have raced with CPU hotplug, return early to avoid -@@ -1051,12 +1068,18 @@ static void rebuild_sched_domains_locked(void) +@@ -1052,12 +1069,18 @@ static void rebuild_sched_domains_locked(void) void rebuild_sched_domains(void) { get_online_cpus(); @@ -1663491,16 +1662979,16 @@ index 3173fe473..cb9a882d3 100644 /** * update_tasks_cpumask - Update the cpumasks of tasks in the cpuset. * @cs: the cpuset in which each task's cpus_allowed mask needs to be changed -@@ -1072,7 +1095,7 @@ static void update_tasks_cpumask(struct cpuset *cs) - - css_task_iter_start(&cs->css, 0, &it); - while ((task = css_task_iter_next(&it))) +@@ -1080,7 +1103,7 @@ static void update_tasks_cpumask(struct cpuset *cs) + if (top_cs && (task->flags & PF_KTHREAD) && + kthread_is_per_cpu(task)) + continue; - set_cpus_allowed_ptr(task, cs->effective_cpus); + update_cpus_allowed(cs, task, cs->effective_cpus); + } css_task_iter_end(&it); } - -@@ -1096,8 +1119,7 @@ static void compute_effective_cpumask(struct cpumask *new_cpus, +@@ -1105,8 +1128,7 @@ static void compute_effective_cpumask(struct cpumask *new_cpus, cpumask_and(new_cpus, new_cpus, cs->cpus_requested); cpumask_and(new_cpus, new_cpus, cpu_active_mask); } else { @@ -1663510,7 +1662998,7 @@ index 3173fe473..cb9a882d3 100644 } } -@@ -1162,7 +1184,7 @@ static int update_parent_subparts_cpumask(struct cpuset *cpuset, int cmd, +@@ -1171,7 +1193,7 @@ static int update_parent_subparts_cpumask(struct cpuset *cpuset, int cmd, int new_prs; bool part_error = false; /* Partition error? */ @@ -1663519,7 +1663007,7 @@ index 3173fe473..cb9a882d3 100644 /* * The parent must be a partition root. -@@ -2158,7 +2180,7 @@ static int cpuset_can_attach(struct cgroup_taskset *tset) +@@ -2171,7 +2193,7 @@ static int cpuset_can_attach(struct cgroup_taskset *tset) cpuset_attach_old_cs = task_cs(cgroup_taskset_first(tset, &css)); cs = css_cs(css); @@ -1663528,7 +1663016,7 @@ index 3173fe473..cb9a882d3 100644 /* allow moving tasks into an empty cpuset if on default hierarchy */ ret = -ENOSPC; -@@ -2182,7 +2204,7 @@ static int cpuset_can_attach(struct cgroup_taskset *tset) +@@ -2195,7 +2217,7 @@ static int cpuset_can_attach(struct cgroup_taskset *tset) cs->attach_in_progress++; ret = 0; out_unlock: @@ -1663537,7 +1663025,7 @@ index 3173fe473..cb9a882d3 100644 return ret; } -@@ -2192,9 +2214,9 @@ static void cpuset_cancel_attach(struct cgroup_taskset *tset) +@@ -2205,9 +2227,9 @@ static void cpuset_cancel_attach(struct cgroup_taskset *tset) cgroup_taskset_first(tset, &css); @@ -1663549,10 +1663037,10 @@ index 3173fe473..cb9a882d3 100644 } /* -@@ -2217,22 +2239,20 @@ static void cpuset_attach(struct cgroup_taskset *tset) - cgroup_taskset_first(tset, &css); +@@ -2231,22 +2253,20 @@ static void cpuset_attach(struct cgroup_taskset *tset) cs = css_cs(css); + lockdep_assert_cpus_held(); /* see cgroup_attach_lock() */ - percpu_down_write(&cpuset_rwsem); - - /* prepare for attach */ @@ -1663578,7 +1663066,7 @@ index 3173fe473..cb9a882d3 100644 cpuset_change_task_nodemask(task, &cpuset_attach_nodemask_to); cpuset_update_task_spread_flag(cs, task); -@@ -2271,7 +2291,7 @@ static void cpuset_attach(struct cgroup_taskset *tset) +@@ -2285,7 +2305,7 @@ static void cpuset_attach(struct cgroup_taskset *tset) if (!cs->attach_in_progress) wake_up(&cpuset_attach_wq); @@ -1663587,7 +1663075,7 @@ index 3173fe473..cb9a882d3 100644 } /* The various types of files and directories in a cpuset file system */ -@@ -2303,7 +2323,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft, +@@ -2317,7 +2337,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft, int retval = 0; get_online_cpus(); @@ -1663596,7 +1663084,7 @@ index 3173fe473..cb9a882d3 100644 if (!is_cpuset_online(cs)) { retval = -ENODEV; goto out_unlock; -@@ -2339,7 +2359,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft, +@@ -2353,7 +2373,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft, break; } out_unlock: @@ -1663605,7 +1663093,7 @@ index 3173fe473..cb9a882d3 100644 put_online_cpus(); return retval; } -@@ -2352,7 +2372,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft, +@@ -2366,7 +2386,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft, int retval = -ENODEV; get_online_cpus(); @@ -1663614,7 +1663102,7 @@ index 3173fe473..cb9a882d3 100644 if (!is_cpuset_online(cs)) goto out_unlock; -@@ -2365,7 +2385,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft, +@@ -2379,7 +2399,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft, break; } out_unlock: @@ -1663623,7 +1663111,7 @@ index 3173fe473..cb9a882d3 100644 put_online_cpus(); return retval; } -@@ -2406,7 +2426,7 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of, +@@ -2420,7 +2440,7 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of, flush_work(&cpuset_hotplug_work); get_online_cpus(); @@ -1663632,7 +1663120,7 @@ index 3173fe473..cb9a882d3 100644 if (!is_cpuset_online(cs)) goto out_unlock; -@@ -2430,7 +2450,7 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of, +@@ -2444,7 +2464,7 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of, free_cpuset(trialcs); out_unlock: @@ -1663641,7 +1663129,7 @@ index 3173fe473..cb9a882d3 100644 put_online_cpus(); kernfs_unbreak_active_protection(of->kn); css_put(&cs->css); -@@ -2563,13 +2583,13 @@ static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf, +@@ -2577,13 +2597,13 @@ static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf, css_get(&cs->css); get_online_cpus(); @@ -1663657,7 +1663145,7 @@ index 3173fe473..cb9a882d3 100644 put_online_cpus(); css_put(&cs->css); return retval ?: nbytes; -@@ -2777,7 +2797,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) +@@ -2791,7 +2811,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) return 0; get_online_cpus(); @@ -1663666,7 +1663154,7 @@ index 3173fe473..cb9a882d3 100644 set_bit(CS_ONLINE, &cs->flags); if (is_spread_page(parent)) -@@ -2829,7 +2849,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) +@@ -2843,7 +2863,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) cpumask_copy(cs->effective_cpus, parent->cpus_allowed); spin_unlock_irq(&callback_lock); out_unlock: @@ -1663675,7 +1663163,7 @@ index 3173fe473..cb9a882d3 100644 put_online_cpus(); return 0; } -@@ -2850,7 +2870,7 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css) +@@ -2864,7 +2884,7 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css) struct cpuset *cs = css_cs(css); get_online_cpus(); @@ -1663684,7 +1663172,7 @@ index 3173fe473..cb9a882d3 100644 if (is_partition_root(cs)) update_prstate(cs, 0); -@@ -2869,7 +2889,7 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css) +@@ -2883,7 +2903,7 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css) cpuset_dec(); clear_bit(CS_ONLINE, &cs->flags); @@ -1663693,7 +1663181,7 @@ index 3173fe473..cb9a882d3 100644 put_online_cpus(); } -@@ -2882,7 +2902,7 @@ static void cpuset_css_free(struct cgroup_subsys_state *css) +@@ -2896,7 +2916,7 @@ static void cpuset_css_free(struct cgroup_subsys_state *css) static void cpuset_bind(struct cgroup_subsys_state *root_css) { @@ -1663702,7 +1663190,7 @@ index 3173fe473..cb9a882d3 100644 spin_lock_irq(&callback_lock); if (is_in_v2_mode()) { -@@ -2895,7 +2915,7 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css) +@@ -2909,7 +2929,7 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css) } spin_unlock_irq(&callback_lock); @@ -1663711,7 +1663199,7 @@ index 3173fe473..cb9a882d3 100644 } /* -@@ -2905,10 +2925,10 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css) +@@ -2919,10 +2939,10 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css) */ static void cpuset_fork(struct task_struct *task) { @@ -1663723,7 +1663211,7 @@ index 3173fe473..cb9a882d3 100644 task->mems_allowed = current->mems_allowed; } -@@ -2937,7 +2957,6 @@ struct cgroup_subsys cpuset_cgrp_subsys = { +@@ -2951,7 +2971,6 @@ struct cgroup_subsys cpuset_cgrp_subsys = { int __init cpuset_init(void) { @@ -1663731,7 +1663219,7 @@ index 3173fe473..cb9a882d3 100644 BUG_ON(!alloc_cpumask_var(&top_cpuset.cpus_allowed, GFP_KERNEL)); BUG_ON(!alloc_cpumask_var(&top_cpuset.cpus_requested, GFP_KERNEL)); -@@ -3012,7 +3031,7 @@ hotplug_update_tasks_legacy(struct cpuset *cs, +@@ -3026,7 +3045,7 @@ hotplug_update_tasks_legacy(struct cpuset *cs, is_empty = cpumask_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed); @@ -1663740,7 +1663228,7 @@ index 3173fe473..cb9a882d3 100644 /* * Move tasks to the nearest ancestor with execution resources, -@@ -3022,7 +3041,7 @@ hotplug_update_tasks_legacy(struct cpuset *cs, +@@ -3036,7 +3055,7 @@ hotplug_update_tasks_legacy(struct cpuset *cs, if (is_empty) remove_tasks_in_empty_cpuset(cs); @@ -1663749,7 +1663237,7 @@ index 3173fe473..cb9a882d3 100644 } static void -@@ -3072,14 +3091,14 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp) +@@ -3086,14 +3105,14 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp) retry: wait_event(cpuset_attach_wq, cs->attach_in_progress == 0); @@ -1663766,7 +1663254,7 @@ index 3173fe473..cb9a882d3 100644 goto retry; } -@@ -3151,7 +3170,7 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp) +@@ -3165,7 +3184,7 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp) hotplug_update_tasks_legacy(cs, &new_cpus, &new_mems, cpus_updated, mems_updated); @@ -1663775,7 +1663263,7 @@ index 3173fe473..cb9a882d3 100644 } /** -@@ -3170,7 +3189,7 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp) +@@ -3184,7 +3203,7 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp) * Note that CPU offlining during suspend is ignored. We don't modify * cpusets across suspend/resume cycles at all. */ @@ -1663784,7 +1663272,7 @@ index 3173fe473..cb9a882d3 100644 { static cpumask_t new_cpus; static nodemask_t new_mems; -@@ -3181,7 +3200,7 @@ static void cpuset_hotplug_workfn(struct work_struct *work) +@@ -3195,7 +3214,7 @@ static void cpuset_hotplug_workfn(struct work_struct *work) if (on_dfl && !alloc_cpumasks(NULL, &tmp)) ptmp = &tmp; @@ -1663793,7 +1663281,7 @@ index 3173fe473..cb9a882d3 100644 /* fetch the available cpus/mems and find out which changed how */ cpumask_copy(&new_cpus, cpu_active_mask); -@@ -3238,7 +3257,7 @@ static void cpuset_hotplug_workfn(struct work_struct *work) +@@ -3252,7 +3271,7 @@ static void cpuset_hotplug_workfn(struct work_struct *work) update_tasks_nodemask(&top_cpuset); } @@ -1663802,7 +1663290,7 @@ index 3173fe473..cb9a882d3 100644 /* if cpus or mems changed, we need to propagate to descendants */ if (cpus_updated || mems_updated) { -@@ -3282,6 +3301,7 @@ void cpuset_wait_for_hotplug(void) +@@ -3296,6 +3315,7 @@ void cpuset_wait_for_hotplug(void) { flush_work(&cpuset_hotplug_work); } @@ -1663810,7 +1663298,7 @@ index 3173fe473..cb9a882d3 100644 /* * Keep top_cpuset.mems_allowed tracking node_states[N_MEMORY]. -@@ -3337,11 +3357,11 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) +@@ -3354,11 +3374,11 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) spin_lock_irqsave(&callback_lock, flags); rcu_read_lock(); @@ -1663824,7 +1663312,7 @@ index 3173fe473..cb9a882d3 100644 /** * cpuset_cpus_allowed_fallback - final fallback before complete catastrophe. * @tsk: pointer to task_struct with which the scheduler is struggling -@@ -3356,9 +3376,17 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) +@@ -3373,9 +3393,17 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) void cpuset_cpus_allowed_fallback(struct task_struct *tsk) { @@ -1664082,15 +1663570,15 @@ index 32391acc8..545958377 100644 #include "power.h" -@@ -139,6 +140,7 @@ static void s2idle_loop(void) +@@ -138,6 +139,7 @@ static void s2idle_loop(void) + break; } - pm_wakeup_clear(false); + clear_wakeup_reasons(); - s2idle_enter(); } -@@ -359,6 +361,7 @@ static int suspend_prepare(suspend_state_t state) + +@@ -357,6 +359,7 @@ static int suspend_prepare(suspend_state_t state) if (!error) return 0; @@ -1664098,7 +1663586,7 @@ index 32391acc8..545958377 100644 suspend_stats.failed_freeze++; dpm_save_failed_step(SUSPEND_FREEZE); pm_notifier_call_chain(PM_POST_SUSPEND); -@@ -388,7 +391,7 @@ void __weak arch_suspend_enable_irqs(void) +@@ -386,7 +389,7 @@ void __weak arch_suspend_enable_irqs(void) */ static int suspend_enter(suspend_state_t state, bool *wakeup) { @@ -1664107,7 +1663595,7 @@ index 32391acc8..545958377 100644 error = platform_suspend_prepare(state); if (error) -@@ -396,7 +399,11 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) +@@ -394,7 +397,11 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) error = dpm_suspend_late(PMSG_SUSPEND); if (error) { @@ -1664119,7 +1663607,7 @@ index 32391acc8..545958377 100644 goto Platform_finish; } error = platform_suspend_prepare_late(state); -@@ -405,7 +412,11 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) +@@ -403,7 +410,11 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) error = dpm_suspend_noirq(PMSG_SUSPEND); if (error) { @@ -1664131,7 +1663619,7 @@ index 32391acc8..545958377 100644 goto Platform_early_resume; } error = platform_suspend_prepare_noirq(state); -@@ -421,8 +432,10 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) +@@ -419,8 +430,10 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) } error = suspend_disable_secondary_cpus(); @@ -1664143,7 +1663631,7 @@ index 32391acc8..545958377 100644 arch_suspend_disable_irqs(); BUG_ON(!irqs_disabled()); -@@ -493,6 +506,8 @@ int suspend_devices_and_enter(suspend_state_t state) +@@ -491,6 +504,8 @@ int suspend_devices_and_enter(suspend_state_t state) error = dpm_suspend_start(PMSG_SUSPEND); if (error) { pr_err("Some devices failed to suspend, or early wake event detected\n"); @@ -1665114,19 +1664602,20 @@ new file mode 100755 index 000000000..4f6b72d23 --- /dev/null +++ b/make-ohos.sh -@@ -0,0 +1,135 @@ +@@ -0,0 +1,136 @@ +#!/bin/bash + +set -e + -+export PATH=../../../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/:$PATH ++SCRIPTPATH=$(dirname $realpath "$0") ++export PATH=$(realpath $SCRIPTPATH/../../../../)/prebuilts/clang/ohos/linux-x86_64/llvm/bin/:$(realpath $SCRIPTPATH/../../../../)/prebuilts/develop_tools/pahole/bin/:$PATH +export PRODUCT_PATH=vendor/hihope/rk3568 +IMAGE_SIZE=64 # 64M +IMAGE_BLOCKS=4096 +ENABLE_LTO_O0=${3} + +CPUs=`sed -n "N;/processor/p" /proc/cpuinfo|wc -l` -+MAKE="make LLVM=1 LLVM_IAS=1 CROSS_COMPILE=../../../../prebuilts/gcc/linux-x86/aarch64/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-" ++MAKE="make LLVM=1 LLVM_IAS=1 CROSS_COMPILE=aarch64-linux-gnu-" +[ "${ENABLE_LTO_O0}" == "enable_lto_O0" ] && MAKE="${MAKE} KCFLAGS=-Wl,--lto-O0" +BUILD_PATH=boot_linux +EXTLINUX_PATH=${BUILD_PATH}/extlinux @@ -1665177,12 +1664666,13 @@ index 000000000..4f6b72d23 + conf=$2 + dtb=$3 + -+ config_base="arch/${arch}/configs/${conf}" -+ config_frag="" + if [ "$GPUDRIVER" == "mesa3d" ]; then ++ config_base="arch/${arch}/configs/${conf}" + config_frag="../../../../device/soc/rockchip/panfrost.config" ++ ARCH=${arch} ./scripts/kconfig/merge_config.sh ${config_base} ${config_frag} ++ else ++ ${MAKE} ARCH=${arch} ${conf} + fi -+ ARCH=${arch} ./scripts/kconfig/merge_config.sh ${config_base} ${config_frag} + + if [ $? -ne 0 ]; then + echo "FAIL: ${MAKE} ARCH=${arch} ${conf}" @@ -1665518,69 +1665008,7 @@ index cf165b0d1..2a14519a8 100644 sock_put(sk); } -@@ -280,8 +280,7 @@ static int sco_connect(struct hci_dev *hdev, struct sock *sk) - return err; - } - --static int sco_send_frame(struct sock *sk, void *buf, int len, -- unsigned int msg_flags) -+static int sco_send_frame(struct sock *sk, struct msghdr *msg, int len) - { - struct sco_conn *conn = sco_pi(sk)->conn; - struct sk_buff *skb; -@@ -293,11 +292,15 @@ static int sco_send_frame(struct sock *sk, void *buf, int len, - - BT_DBG("sk %p len %d", sk, len); - -- skb = bt_skb_send_alloc(sk, len, msg_flags & MSG_DONTWAIT, &err); -+ skb = bt_skb_send_alloc(sk, len, msg->msg_flags & MSG_DONTWAIT, &err); - if (!skb) - return err; - -- memcpy(skb_put(skb, len), buf, len); -+ if (memcpy_from_msg(skb_put(skb, len), msg, len)) { -+ kfree_skb(skb); -+ return -EFAULT; -+ } -+ - hci_send_sco(conn->hcon, skb); - - return len; -@@ -722,7 +725,6 @@ static int sco_sock_sendmsg(struct socket *sock, struct msghdr *msg, - size_t len) - { - struct sock *sk = sock->sk; -- void *buf; - int err; - - BT_DBG("sock %p, sk %p", sock, sk); -@@ -734,24 +736,14 @@ static int sco_sock_sendmsg(struct socket *sock, struct msghdr *msg, - if (msg->msg_flags & MSG_OOB) - return -EOPNOTSUPP; - -- buf = kmalloc(len, GFP_KERNEL); -- if (!buf) -- return -ENOMEM; -- -- if (memcpy_from_msg(buf, msg, len)) { -- kfree(buf); -- return -EFAULT; -- } -- - lock_sock(sk); - - if (sk->sk_state == BT_CONNECTED) -- err = sco_send_frame(sk, buf, len, msg->msg_flags); -+ err = sco_send_frame(sk, msg, len); - else - err = -ENOTCONN; - - release_sock(sk); -- kfree(buf); - return err; - } - -@@ -1108,10 +1100,10 @@ static void sco_conn_ready(struct sco_conn *conn) +@@ -1103,10 +1103,10 @@ static void sco_conn_ready(struct sco_conn *conn) if (sk) { sco_sock_clear_timer(sk); @@ -1665593,7 +1665021,7 @@ index cf165b0d1..2a14519a8 100644 } else { sco_conn_lock(conn); -@@ -1126,12 +1118,12 @@ static void sco_conn_ready(struct sco_conn *conn) +@@ -1121,12 +1121,12 @@ static void sco_conn_ready(struct sco_conn *conn) return; } @@ -1665608,7 +1665036,7 @@ index cf165b0d1..2a14519a8 100644 sco_conn_unlock(conn); return; } -@@ -1152,7 +1144,7 @@ static void sco_conn_ready(struct sco_conn *conn) +@@ -1147,7 +1147,7 @@ static void sco_conn_ready(struct sco_conn *conn) /* Wake up parent */ parent->sk_data_ready(parent); @@ -1669612,16 +1669040,16 @@ diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening index 269967c4f..9eb73dc1b 100644 --- a/security/Kconfig.hardening +++ b/security/Kconfig.hardening -@@ -29,7 +29,7 @@ choice - prompt "Initialize kernel stack variables at function entry" +@@ -39,7 +39,7 @@ choice default GCC_PLUGIN_STRUCTLEAK_BYREF_ALL if COMPILE_TEST && GCC_PLUGINS default INIT_STACK_ALL_PATTERN if COMPILE_TEST && CC_HAS_AUTO_VAR_INIT_PATTERN + default INIT_STACK_ALL_ZERO if CC_HAS_AUTO_VAR_INIT_ZERO - default INIT_STACK_NONE + default INIT_STACK_ALL_ZERO help This option enables initialization of stack variables at function entry time. This has the possibility to have the -@@ -190,6 +190,7 @@ config STACKLEAK_RUNTIME_DISABLE +@@ -211,6 +211,7 @@ config STACKLEAK_RUNTIME_DISABLE config INIT_ON_ALLOC_DEFAULT_ON bool "Enable heap memory zeroing on allocation by default" @@ -1669691,26 +1669119,15 @@ index 2c5f7e905..51821334f 100644 cable->pause &= ~stream; err = cable->ops->start(dpcm); spin_unlock(&cable->lock); -@@ -608,15 +627,16 @@ static unsigned int loopback_jiffies_timer_pos_update +@@ -608,6 +627,7 @@ static unsigned int loopback_jiffies_timer_pos_update cable->streams[SNDRV_PCM_STREAM_CAPTURE]; - unsigned long delta_play = 0, delta_capt = 0; + unsigned long delta_play = 0, delta_capt = 0, cur_jiffies; unsigned int running, count1, count2; + unsigned long cur_jiffies = cycles_to_jiffies(); + cur_jiffies = jiffies; running = cable->running ^ cable->pause; - if (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) { -- delta_play = jiffies - dpcm_play->last_jiffies; -+ delta_play = cur_jiffies - dpcm_play->last_jiffies; - dpcm_play->last_jiffies += delta_play; - } - - if (running & (1 << SNDRV_PCM_STREAM_CAPTURE)) { -- delta_capt = jiffies - dpcm_capt->last_jiffies; -+ delta_capt = cur_jiffies - dpcm_capt->last_jiffies; - dpcm_capt->last_jiffies += delta_capt; - } - -@@ -842,7 +862,7 @@ static void loopback_jiffies_timer_dpcm_info(struct loopback_pcm *dpcm, +@@ -843,7 +863,7 @@ static void loopback_jiffies_timer_dpcm_info(struct loopback_pcm *dpcm, snd_iprintf(buffer, " irq_pos:\t\t%u\n", dpcm->irq_pos); snd_iprintf(buffer, " period_frac:\t%u\n", dpcm->period_size_frac); snd_iprintf(buffer, " last_jiffies:\t%lu (%lu)\n", @@ -1698066,7 +1697483,7 @@ index fa84ec695..b31431327 100644 i2s->dev = &pdev->dev; i2s->grf = syscon_regmap_lookup_by_phandle(node, "rockchip,grf"); -@@ -609,26 +701,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev) +@@ -609,25 +701,6 @@ static int rockchip_i2s_probe(struct platform_device *pdev) i2s->pins = of_id->data; } @@ -1698085,17 +1697502,15 @@ index fa84ec695..b31431327 100644 - i2s->mclk = devm_clk_get(&pdev->dev, "i2s_clk"); - if (IS_ERR(i2s->mclk)) { - dev_err(&pdev->dev, "Can't retrieve i2s master clock\n"); -- return PTR_ERR(i2s->mclk); +- ret = PTR_ERR(i2s->mclk); +- goto err_clk; - } - -- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- regs = devm_ioremap_resource(&pdev->dev, res); -+ regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res); - if (IS_ERR(regs)) - return PTR_ERR(regs); - -@@ -640,16 +713,28 @@ static int rockchip_i2s_probe(struct platform_device *pdev) - return PTR_ERR(i2s->regmap); + regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res); + if (IS_ERR(regs)) { + ret = PTR_ERR(regs); +@@ -643,16 +716,28 @@ static int rockchip_i2s_probe(struct platform_device *pdev) + goto err_clk; } - i2s->playback_dma_data.addr = res->start + I2S_TXDR; @@ -1698130,7 +1697545,7 @@ index fa84ec695..b31431327 100644 pm_runtime_enable(&pdev->dev); if (!pm_runtime_enabled(&pdev->dev)) { ret = i2s_runtime_resume(&pdev->dev); -@@ -657,33 +742,20 @@ static int rockchip_i2s_probe(struct platform_device *pdev) +@@ -660,33 +745,20 @@ static int rockchip_i2s_probe(struct platform_device *pdev) goto err_pm_disable; } @@ -1698168,15 +1697583,6 @@ index fa84ec695..b31431327 100644 if (ret) { dev_err(&pdev->dev, "Could not register PCM\n"); goto err_suspend; -@@ -697,6 +769,8 @@ static int rockchip_i2s_probe(struct platform_device *pdev) - err_pm_disable: - pm_runtime_disable(&pdev->dev); - -+ clk_disable_unprepare(i2s->hclk); -+ - return ret; - } - diff --git a/sound/soc/rockchip/rockchip_i2s.h b/sound/soc/rockchip/rockchip_i2s.h index fcaae24e4..251851bf4 100644 --- a/sound/soc/rockchip/rockchip_i2s.h diff --git a/linux-5.10/unionpi_tiger_pacth/hdf.patch b/linux-5.10/unionpi_tiger_pacth/hdf.patch index a8eec8445e03382b38c5aaa1edab2ca22c920546..4e447d7f6efa7bae18d4dab53743725c5a137e2e 100755 --- a/linux-5.10/unionpi_tiger_pacth/hdf.patch +++ b/linux-5.10/unionpi_tiger_pacth/hdf.patch @@ -271,7 +271,7 @@ diff -Naur a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c diff -Naur a/drivers/hid/Makefile b/drivers/hid/Makefile --- a/drivers/hid/Makefile 2022-04-15 21:05:13.889124134 +0800 +++ b/drivers/hid/Makefile 2022-04-20 19:17:58.761084044 +0800 -@@ -2,6 +2,15 @@ +@@ -2,6 +2,19 @@ # # Makefile for the HID driver # @@ -282,6 +282,10 @@ diff -Naur a/drivers/hid/Makefile b/drivers/hid/Makefile + $(HDF_ROOT_DIR)/framework/include/utils \ + $(HDF_ROOT_DIR)/framework/include/osal \ + $(HDF_ROOT_DIR)/framework/ability/sbuf/include \ ++ $(HDF_ROOT_DIR)/inner_api/utils \ ++ $(HDF_ROOT_DIR)/inner_api/osal/shared \ ++ $(HDF_ROOT_DIR)/inner_api/host/shared \ ++ $(HDF_ROOT_DIR)/inner_api/core \ + $(HDF_ROOT_DIR)/khdf/osal/include \ + $(HDF_ROOT_DIR)/evdev hid-y := hid-core.o hid-input.o hid-quirks.o diff --git a/linux-5.10/unionpi_tiger_pacth/linux-5.10.patch b/linux-5.10/unionpi_tiger_pacth/linux-5.10.patch index 7b2df389278ab711d72a04981d28852bf3815455..bbb79a4102160842752d87a3c5f55def7bde3639 100755 --- a/linux-5.10/unionpi_tiger_pacth/linux-5.10.patch +++ b/linux-5.10/unionpi_tiger_pacth/linux-5.10.patch @@ -38663,7 +38663,7 @@ diff -Naur a/vendor/amlogic/input/keyboard/Kconfig b/vendor/amlogic/input/keyboa diff -Naur a/vendor/amlogic/input/keyboard/Makefile b/vendor/amlogic/input/keyboard/Makefile --- a/vendor/amlogic/input/keyboard/Makefile 1970-01-01 08:00:00.000000000 +0800 +++ b/vendor/amlogic/input/keyboard/Makefile 2022-06-30 16:25:40.030803814 +0800 -@@ -0,0 +1,20 @@ +@@ -0,0 +1,24 @@ +# +# Makefile for the keyboard device drivers. +# Support OpenHammony HDF Input @@ -38678,6 +38678,10 @@ diff -Naur a/vendor/amlogic/input/keyboard/Makefile b/vendor/amlogic/input/keybo + $(HDF_ROOT_DIR)/framework/core/common/include/host \ + $(HDF_ROOT_DIR)/framework/include/utils \ + $(HDF_ROOT_DIR)/framework/include/osal \ ++ $(HDF_ROOT_DIR)/inner_api/utils \ ++ $(HDF_ROOT_DIR)/inner_api/osal/shared \ ++ $(HDF_ROOT_DIR)/inner_api/core \ ++ $(HDF_ROOT_DIR)/inner_api/host/shared \ + $(HDF_ROOT_DIR)/framework/ability/sbuf/include \ + $(HDF_ROOT_DIR)/khdf/osal/include \ + $(HDF_ROOT_DIR)/evdev diff --git a/linux-5.10/yangfan_patch/drivers.patch b/linux-5.10/yangfan_patch/drivers.patch index 0c75a9d6352b550f6b0de8161707884f09b2fe1a..e2a96c844399461ae2ab9865c6f4785f3790af68 100644 --- a/linux-5.10/yangfan_patch/drivers.patch +++ b/linux-5.10/yangfan_patch/drivers.patch @@ -1,243 +1,5 @@ -From 2c04d50c10d60e3df37e91391576e9b53fa2e5bc Mon Sep 17 00:00:00 2001 -From: jiewangdp -Date: Fri, 16 Sep 2022 10:38:52 +0800 -Subject: [PATCH] drivers - -Change-Id: I9825adaa8537a316db8a1831e759a74223b9e428 ---- - drivers/Makefile | 2 + - drivers/block/nbd.c | 6 - - drivers/char/Makefile | 2 + - drivers/clk/Kconfig | 7 + - drivers/clk/clk.c | 2 +- - drivers/clk/rockchip/Kconfig | 42 +- - drivers/clk/rockchip/Makefile | 2 + - drivers/clk/rockchip/clk-cpu.c | 92 +- - drivers/clk/rockchip/clk-ddr.c | 171 +- - drivers/clk/rockchip/clk-half-divider.c | 35 +- - drivers/clk/rockchip/clk-pll.c | 779 ++- - drivers/clk/rockchip/clk-rk3399.c | 589 +- - drivers/clk/rockchip/clk.c | 200 +- - drivers/clk/rockchip/clk.h | 358 +- - drivers/clocksource/Kconfig | 4 +- - drivers/clocksource/timer-rockchip.c | 33 + - drivers/cpufreq/Kconfig.arm | 10 + - drivers/cpufreq/Makefile | 3 +- - drivers/cpufreq/cpufreq-dt-platdev.c | 37 +- - drivers/cpufreq/cpufreq-dt.c | 168 +- - drivers/cpufreq/cpufreq.c | 7 +- - drivers/cpufreq/cpufreq_userspace.c | 6 +- - drivers/cpuidle/driver.c | 1 + - drivers/cpuidle/governor.c | 2 + - drivers/devfreq/Kconfig | 13 +- - drivers/devfreq/Makefile | 5 +- - drivers/devfreq/devfreq.c | 35 + - drivers/devfreq/event/Kconfig | 7 + - drivers/devfreq/event/Makefile | 1 + - drivers/devfreq/event/rockchip-dfi.c | 563 +- - drivers/dma-buf/Kconfig | 3 +- - drivers/dma-buf/dma-buf-sysfs-stats.h | 27 + - drivers/dma-buf/dma-buf.c | 144 +- - drivers/dma-buf/dma-fence.c | 70 +- - drivers/dma-buf/dma-heap.c | 221 +- - drivers/dma-buf/heaps/Kconfig | 16 +- - drivers/dma-buf/heaps/Makefile | 3 +- - drivers/dma-buf/heaps/cma_heap.c | 336 +- - drivers/dma-buf/heaps/system_heap.c | 575 +- - drivers/dma-buf/sw_sync.c | 12 + - drivers/dma-buf/sync_debug.c | 2 + - drivers/dma-buf/sync_debug.h | 7 + - drivers/firmware/Kconfig | 9 +- - drivers/firmware/Makefile | 1 + - drivers/gpio/Kconfig | 8 + - drivers/gpio/Makefile | 1 + - drivers/gpio/gpiolib-of.c | 11 + - drivers/gpio/gpiolib-of.h | 5 + - drivers/gpu/Makefile | 2 +- - drivers/gpu/drm/Kconfig | 24 +- - drivers/gpu/drm/Makefile | 11 +- - drivers/gpu/drm/amd/display/Kconfig | 2 - - drivers/gpu/drm/bridge/Kconfig | 16 + - drivers/gpu/drm/bridge/Makefile | 2 + - .../drm/bridge/analogix/analogix_dp_core.c | 953 ++-- - .../drm/bridge/analogix/analogix_dp_core.h | 61 +- - .../gpu/drm/bridge/analogix/analogix_dp_reg.c | 1054 ++-- - .../gpu/drm/bridge/analogix/analogix_dp_reg.h | 99 +- - drivers/gpu/drm/bridge/display-connector.c | 132 +- - drivers/gpu/drm/bridge/lontium-lt9611.c | 8 +- - drivers/gpu/drm/bridge/nwl-dsi.c | 2 +- - drivers/gpu/drm/bridge/sii902x.c | 280 +- - drivers/gpu/drm/bridge/synopsys/Makefile | 7 +- - drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 3 + - drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 1747 +++++- - drivers/gpu/drm/bridge/synopsys/dw-hdmi.h | 55 + - drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 111 +- - drivers/gpu/drm/drm_atomic_helper.c | 12 +- - drivers/gpu/drm/drm_atomic_state_helper.c | 7 + - drivers/gpu/drm/drm_atomic_uapi.c | 14 + - drivers/gpu/drm/drm_auth.c | 42 +- - drivers/gpu/drm/drm_color_mgmt.c | 41 +- - drivers/gpu/drm/drm_crtc_internal.h | 22 + - drivers/gpu/drm/drm_debugfs.c | 3 +- - drivers/gpu/drm/drm_edid.c | 122 +- - drivers/gpu/drm/drm_file.c | 69 +- - drivers/gpu/drm/drm_fourcc.c | 10 + - drivers/gpu/drm/drm_ioctl.c | 8 +- - drivers/gpu/drm/drm_lease.c | 81 +- - drivers/gpu/drm/drm_mipi_dsi.c | 1 + - drivers/gpu/drm/drm_mode_config.c | 16 + - drivers/gpu/drm/drm_modes.c | 2 + - drivers/gpu/drm/drm_prime.c | 23 + - drivers/gpu/drm/drm_vblank.c | 9 +- - .../gpu/drm/hisilicon/kirin/kirin_ade_reg.h | 4 +- - drivers/gpu/drm/panel/Kconfig | 1 - - drivers/gpu/drm/panel/Makefile | 2 + - drivers/gpu/drm/panel/panel-simple.c | 511 +- - drivers/gpu/drm/panfrost/panfrost_device.h | 8 +- - drivers/gpu/drm/panfrost/panfrost_drv.c | 50 +- - drivers/gpu/drm/panfrost/panfrost_gem.c | 20 +- - drivers/gpu/drm/panfrost/panfrost_job.c | 4 +- - drivers/gpu/drm/panfrost/panfrost_mmu.c | 198 +- - drivers/gpu/drm/panfrost/panfrost_mmu.h | 5 +- - drivers/gpu/drm/panfrost/panfrost_regs.h | 2 - - drivers/gpu/drm/rockchip/Kconfig | 73 +- - drivers/gpu/drm/rockchip/Makefile | 18 +- - .../gpu/drm/rockchip/analogix_dp-rockchip.c | 422 +- - drivers/gpu/drm/rockchip/cdn-dp-core.c | 109 +- - drivers/gpu/drm/rockchip/cdn-dp-core.h | 5 +- - .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 596 ++- - drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 3202 ++++++++++- - drivers/gpu/drm/rockchip/inno_hdmi.c | 2 +- - drivers/gpu/drm/rockchip/rk3066_hdmi.c | 2 +- - drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 1454 ++++- - drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 430 +- - drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 153 +- - drivers/gpu/drm/rockchip/rockchip_drm_fb.h | 19 + - drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 18 +- - drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 637 ++- - drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 47 +- - drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4724 +++++++++++++---- - drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 1156 +++- - drivers/gpu/drm/rockchip/rockchip_lvds.c | 964 ++-- - drivers/gpu/drm/rockchip/rockchip_rgb.c | 557 +- - drivers/gpu/drm/rockchip/rockchip_rgb.h | 6 +- - drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2524 ++++++--- - drivers/gpu/drm/rockchip/rockchip_vop_reg.h | 818 ++- - drivers/i2c/busses/i2c-rk3x.c | 383 +- - drivers/i2c/i2c-core-base.c | 51 +- - drivers/iio/adc/Kconfig | 7 + - drivers/iio/adc/rockchip_saradc.c | 143 +- - drivers/input/Kconfig | 2 + - drivers/input/Makefile | 1 + - drivers/input/touchscreen/Kconfig | 9 + - drivers/input/touchscreen/Makefile | 1 + - drivers/iommu/Kconfig | 3 +- - drivers/iommu/dma-iommu.c | 50 + - drivers/iommu/iommu.c | 155 +- - drivers/iommu/rockchip-iommu.c | 690 ++- - drivers/irqchip/Kconfig | 5 +- - drivers/irqchip/irq-gic-v3-its.c | 60 +- - drivers/irqchip/irq-gic-v3.c | 26 + - drivers/irqchip/irq-gic-v4.c | 19 + - drivers/irqchip/irq-meson-gpio.c | 89 +- - drivers/mailbox/rockchip-mailbox.c | 135 +- - drivers/media/i2c/Kconfig | 34 + - drivers/media/i2c/Makefile | 3 + - drivers/media/platform/Kconfig | 3 + - drivers/media/platform/Makefile | 3 + - drivers/media/usb/uvc/uvc_driver.c | 7 +- - drivers/media/v4l2-core/v4l2-async.c | 54 + - drivers/mfd/rk808.c | 928 +++- - drivers/mmc/core/block.c | 3 + - drivers/mmc/core/block.h | 1 + - drivers/mmc/core/core.h | 2 + - drivers/mmc/core/host.c | 45 + - drivers/mmc/core/sdio.c | 424 +- - drivers/mmc/host/Makefile | 1 + - drivers/mmc/host/dw_mmc-rockchip.c | 95 +- - drivers/mmc/host/dw_mmc.h | 2 + - drivers/mmc/host/sdhci-of-dwcmshc.c | 260 +- - drivers/net/ethernet/stmicro/stmmac/Makefile | 3 +- - .../net/ethernet/stmicro/stmmac/dwmac-rk.c | 932 +++- - drivers/net/wireless/Kconfig | 1 + - drivers/net/wireless/Makefile | 1 + - drivers/nvmem/core.c | 4 + - drivers/nvmem/rockchip-efuse.c | 348 +- - drivers/nvmem/rockchip-otp.c | 22 +- - drivers/opp/debugfs.c | 44 + - drivers/opp/of.c | 2 +- - drivers/pci/controller/Makefile | 6 +- - drivers/pci/controller/dwc/Kconfig | 9 + - drivers/pci/controller/dwc/Makefile | 1 + - drivers/pci/controller/dwc/pcie-designware.h | 1 + - drivers/pci/controller/pcie-rockchip.c | 5 + - drivers/phy/rockchip/Kconfig | 100 + - drivers/phy/rockchip/Makefile | 12 +- - .../phy/rockchip/phy-rockchip-inno-dsidphy.c | 434 +- - drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 2597 +++++++-- - drivers/phy/rockchip/phy-rockchip-pcie.c | 12 +- - drivers/phy/rockchip/phy-rockchip-typec.c | 733 ++- - drivers/phy/rockchip/phy-rockchip-usb.c | 628 ++- - drivers/pinctrl/Kconfig | 7 +- - drivers/pinctrl/Makefile | 2 + - drivers/pinctrl/pinctrl-rk805.c | 350 +- - drivers/pinctrl/pinctrl-rockchip.c | 2862 +++++----- - drivers/power/reset/gpio-poweroff.c | 1 - - drivers/power/supply/Kconfig | 17 +- - drivers/power/supply/Makefile | 1 + - drivers/pwm/Kconfig | 6 + - drivers/pwm/pwm-rockchip.c | 109 +- - drivers/pwm/sysfs.c | 43 + - drivers/regulator/Kconfig | 10 +- - drivers/regulator/Makefile | 1 + - drivers/regulator/core.c | 346 +- - drivers/regulator/fan53555.c | 399 +- - drivers/regulator/of_regulator.c | 8 +- - drivers/regulator/rk808-regulator.c | 534 +- - drivers/rtc/rtc-hym8563.c | 64 +- - drivers/soc/rockchip/Kconfig | 119 +- - drivers/soc/rockchip/Makefile | 15 + - drivers/soc/rockchip/grf.c | 65 + - drivers/soc/rockchip/io-domain.c | 95 +- - drivers/soc/rockchip/pm_domains.c | 870 ++- - drivers/spi/spi-rockchip.c | 172 +- - drivers/spi/spidev.c | 1 + - drivers/staging/blackbox/Kconfig | 11 + - drivers/staging/blackbox/Makefile | 2 + - drivers/thermal/rockchip_thermal.c | 584 +- - drivers/thermal/thermal_core.c | 1 + - drivers/thermal/thermal_core.h | 2 - - drivers/tty/serial/8250/8250.h | 15 + - drivers/tty/serial/8250/8250_core.c | 10 +- - drivers/tty/serial/8250/8250_dma.c | 205 +- - drivers/tty/serial/8250/8250_dw.c | 92 +- - drivers/tty/serial/8250/8250_dwlib.c | 12 + - drivers/tty/serial/8250/8250_port.c | 103 +- - drivers/tty/vt/keyboard.c | 1 + - drivers/usb/core/hub.c | 3 +- - drivers/usb/core/quirks.c | 8 + - drivers/usb/gadget/Kconfig | 31 + - drivers/usb/gadget/composite.c | 104 +- - drivers/usb/gadget/configfs.c | 281 +- - drivers/usb/gadget/epautoconf.c | 24 + - drivers/usb/gadget/function/f_fs.c | 14 +- - drivers/usb/gadget/function/f_uvc.c | 448 +- - drivers/usb/gadget/function/u_uvc.h | 9 +- - drivers/usb/gadget/function/uvc.h | 9 +- - drivers/usb/gadget/function/uvc_queue.c | 8 + - drivers/usb/gadget/function/uvc_v4l2.c | 24 +- - drivers/usb/gadget/function/uvc_video.c | 40 +- - drivers/usb/gadget/udc/core.c | 2 +- - drivers/usb/storage/scsiglue.c | 4 + - drivers/usb/storage/unusual_devs.h | 6 + - drivers/usb/storage/unusual_uas.h | 18 + - drivers/video/Kconfig | 5 + - drivers/video/Makefile | 1 + - drivers/video/backlight/pwm_bl.c | 2 + - 229 files changed, 37333 insertions(+), 8857 deletions(-) - diff --git a/drivers/Makefile b/drivers/Makefile -index 8ec75883a..053dac091 100644 +index f13d70df6..f072f4e8f 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -6,6 +6,8 @@ @@ -250,10 +12,10 @@ index 8ec75883a..053dac091 100644 obj-y += bus/ diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c -index 07b06fc6f..cc9770936 100644 +index ff14210e8..991d73e4e 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c -@@ -2386,12 +2386,6 @@ static int nbd_genl_status(struct sk_buff *skb, struct genl_info *info) +@@ -2398,12 +2398,6 @@ static int nbd_genl_status(struct sk_buff *skb, struct genl_info *info) } dev_list = nla_nest_start_noflag(reply, NBD_ATTR_DEVICE_LIST); @@ -298,10 +60,10 @@ index c715d4681..42bb63d80 100644 tristate "Clock driver for WM831x/2x PMICs" depends on MFD_WM831X diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 515ef39c4..3878a494e 100644 +index b355d3d40..81850505a 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1296,7 +1296,7 @@ static int __init clk_disable_unused(void) +@@ -1313,7 +1313,7 @@ static int __init clk_disable_unused(void) return 0; } @@ -4558,7 +4320,7 @@ index e363ae04a..f1327e7fe 100644 list_del(&priv->node); } diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c -index 8e159fb6a..ffe4eec2d 100644 +index 30dafe8fc..a87fac5fb 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -688,8 +688,12 @@ static ssize_t show_##file_name \ @@ -5816,10 +5578,10 @@ index 7475e09b0..d64fc0392 100644 dma_fence_end_signalling(tmp); diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c -index 70e410c64..4fb22001b 100644 +index 2594408a1..26d59b48f 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma-heap.c -@@ -30,6 +30,7 @@ +@@ -31,6 +31,7 @@ * @heap_devt heap device node * @list list head connecting to list of heaps * @heap_cdev heap char device @@ -5827,7 +5589,7 @@ index 70e410c64..4fb22001b 100644 * * Represents a heap of memory from which buffers can be made. */ -@@ -40,6 +41,8 @@ struct dma_heap { +@@ -41,6 +42,8 @@ struct dma_heap { dev_t heap_devt; struct list_head list; struct cdev heap_cdev; @@ -5836,7 +5598,7 @@ index 70e410c64..4fb22001b 100644 }; static LIST_HEAD(heap_list); -@@ -48,20 +51,72 @@ static dev_t dma_heap_devt; +@@ -49,20 +52,72 @@ static dev_t dma_heap_devt; static struct class *dma_heap_class; static DEFINE_XARRAY_ALLOC(dma_heap_minors); @@ -5913,7 +5675,7 @@ index 70e410c64..4fb22001b 100644 static int dma_heap_open(struct inode *inode, struct file *file) { -@@ -89,15 +144,9 @@ static long dma_heap_ioctl_allocate(struct file *file, void *data) +@@ -90,15 +145,9 @@ static long dma_heap_ioctl_allocate(struct file *file, void *data) if (heap_allocation->fd) return -EINVAL; @@ -5932,7 +5694,7 @@ index 70e410c64..4fb22001b 100644 if (fd < 0) return fd; -@@ -189,6 +238,47 @@ void *dma_heap_get_drvdata(struct dma_heap *heap) +@@ -191,6 +240,47 @@ void *dma_heap_get_drvdata(struct dma_heap *heap) { return heap->priv; } @@ -5980,7 +5742,7 @@ index 70e410c64..4fb22001b 100644 /** * dma_heap_get_name() - get heap name -@@ -201,11 +291,11 @@ const char *dma_heap_get_name(struct dma_heap *heap) +@@ -203,11 +293,11 @@ const char *dma_heap_get_name(struct dma_heap *heap) { return heap->name; } @@ -5994,7 +5756,7 @@ index 70e410c64..4fb22001b 100644 unsigned int minor; int ret; -@@ -220,21 +310,19 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) +@@ -222,21 +312,19 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) } /* check the name is unique */ @@ -6023,7 +5785,7 @@ index 70e410c64..4fb22001b 100644 heap->name = exp_info->name; heap->ops = exp_info->ops; heap->priv = exp_info->priv; -@@ -259,16 +347,20 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) +@@ -261,16 +349,20 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) goto err1; } @@ -6051,7 +5813,7 @@ index 70e410c64..4fb22001b 100644 /* Add heap to the list */ mutex_lock(&heap_list_lock); list_add(&heap->list, &heap_list); -@@ -284,27 +376,88 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) +@@ -286,27 +378,88 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) kfree(heap); return err_ret; } @@ -7377,10 +7139,10 @@ index 09dada80a..2d00d22f1 100644 obj-$(CONFIG_GPIO_SAMA5D2_PIOBU) += gpio-sama5d2-piobu.o obj-$(CONFIG_GPIO_SCH311X) += gpio-sch311x.o diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c -index 2f895a2b8..be9002d62 100644 +index 2e63274a4..ab666917b 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c -@@ -1039,3 +1039,14 @@ void of_gpiochip_remove(struct gpio_chip *chip) +@@ -1046,3 +1046,14 @@ void of_gpiochip_remove(struct gpio_chip *chip) { of_node_put(chip->of_node); } @@ -7418,18 +7180,6 @@ index ed26664f1..8af2bc899 100644 #endif /* CONFIG_OF_GPIO */ extern struct notifier_block gpio_of_notifier; -diff --git a/drivers/gpu/Makefile b/drivers/gpu/Makefile -index 835c88318..b66e520eb 100644 ---- a/drivers/gpu/Makefile -+++ b/drivers/gpu/Makefile -@@ -3,6 +3,6 @@ - # taken to initialize them in the correct order. Link order is the only way - # to ensure this currently. - obj-$(CONFIG_TEGRA_HOST1X) += host1x/ --obj-y += drm/ vga/ -+obj-y += drm/ vga/ arm/ - obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/ - obj-$(CONFIG_TRACE_GPU_MEM) += trace/ diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index ca868271f..f7954773a 100644 --- a/drivers/gpu/drm/Kconfig @@ -7576,7 +7326,7 @@ index 2b3aff104..519e916ed 100644 obj-$(CONFIG_DRM_SII902X) += sii902x.o obj-$(CONFIG_DRM_SII9234) += sii9234.o diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c -index aa1bb8629..1965fb1bd 100644 +index e8baa0745..3489b9702 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -8,11 +8,13 @@ @@ -8424,7 +8174,7 @@ index aa1bb8629..1965fb1bd 100644 DRM_MODE_CONNECTOR_eDP); if (ret) { DRM_ERROR("Failed to initialize connector with drm\n"); -@@ -1268,11 +1344,20 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge, +@@ -1268,6 +1344,14 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge, return 0; } @@ -8437,6 +8187,9 @@ index aa1bb8629..1965fb1bd 100644 +} + static + struct drm_crtc *analogix_dp_get_old_crtc(struct analogix_dp_device *dp, + struct drm_atomic_state *state) +@@ -1291,7 +1375,8 @@ static struct drm_crtc *analogix_dp_get_new_crtc(struct analogix_dp_device *dp, struct drm_atomic_state *state) { @@ -8446,7 +8199,7 @@ index aa1bb8629..1965fb1bd 100644 struct drm_connector *connector; struct drm_connector_state *conn_state; -@@ -1295,7 +1380,6 @@ analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge, +@@ -1314,7 +1399,6 @@ analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge, struct analogix_dp_device *dp = bridge->driver_private; struct drm_crtc *crtc; struct drm_crtc_state *old_crtc_state; @@ -8454,7 +8207,7 @@ index aa1bb8629..1965fb1bd 100644 crtc = analogix_dp_get_new_crtc(dp, old_state); if (!crtc) -@@ -1306,27 +1390,20 @@ analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge, +@@ -1325,27 +1409,20 @@ analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge, if (old_crtc_state && old_crtc_state->self_refresh_active) return; @@ -8487,7 +8240,7 @@ index aa1bb8629..1965fb1bd 100644 ret = analogix_dp_init_dp(dp); if (ret) -@@ -1344,28 +1421,35 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) +@@ -1363,28 +1440,35 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) } ret = analogix_dp_commit(dp); @@ -8530,7 +8283,7 @@ index aa1bb8629..1965fb1bd 100644 static void analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge, struct drm_bridge_state *old_bridge_state) -@@ -1404,12 +1488,14 @@ analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge, +@@ -1423,12 +1507,14 @@ analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge, usleep_range(10, 11); } dev_err(dp->dev, "too many times retry set bridge, give it up\n"); @@ -8546,7 +8299,7 @@ index aa1bb8629..1965fb1bd 100644 if (dp->dpms_mode != DRM_MODE_DPMS_ON) return; -@@ -1421,21 +1507,17 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge) +@@ -1440,21 +1526,17 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge) } } @@ -8559,12 +8312,12 @@ index aa1bb8629..1965fb1bd 100644 analogix_dp_set_analog_power_down(dp, POWER_ALL, 1); - phy_power_off(dp->phy); -+ analogix_dp_phy_power_off(dp); - +- - clk_disable_unprepare(dp->clock); - - pm_runtime_put_sync(dp->dev); -- ++ analogix_dp_phy_power_off(dp); + - ret = analogix_dp_prepare_panel(dp, false, true); - if (ret) - DRM_ERROR("failed to setup the panel ret = %d\n", ret); @@ -8573,7 +8326,7 @@ index aa1bb8629..1965fb1bd 100644 dp->fast_train_enable = false; dp->psr_supported = false; -@@ -1492,14 +1574,19 @@ analogix_dp_bridge_atomic_post_disable(struct drm_bridge *bridge, +@@ -1526,14 +1608,19 @@ analogix_dp_bridge_atomic_post_disable(struct drm_bridge *bridge, static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge, const struct drm_display_mode *orig_mode, @@ -8594,7 +8347,7 @@ index aa1bb8629..1965fb1bd 100644 /* Input video interlaces & hsync pol & vsync pol */ video->interlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); video->v_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NVSYNC); -@@ -1508,16 +1595,12 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge, +@@ -1542,16 +1629,12 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge, /* Input video dynamic_range & colorimetry */ vic = drm_match_cea_mode(mode); if ((vic == 6) || (vic == 7) || (vic == 21) || (vic == 22) || @@ -8614,7 +8367,7 @@ index aa1bb8629..1965fb1bd 100644 /* Input vide bpc and color_formats */ switch (display_info->bpc) { -@@ -1537,12 +1620,16 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge, +@@ -1571,12 +1654,16 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge, video->color_depth = COLOR_8; break; } @@ -8634,7 +8387,7 @@ index aa1bb8629..1965fb1bd 100644 /* * NOTE: those property parsing code is used for providing backward -@@ -1567,6 +1654,56 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge, +@@ -1601,6 +1688,56 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge, video->interlaced = true; } @@ -8691,7 +8444,7 @@ index aa1bb8629..1965fb1bd 100644 static const struct drm_bridge_funcs analogix_dp_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, -@@ -1577,29 +1714,30 @@ static const struct drm_bridge_funcs analogix_dp_bridge_funcs = { +@@ -1611,29 +1748,30 @@ static const struct drm_bridge_funcs analogix_dp_bridge_funcs = { .atomic_post_disable = analogix_dp_bridge_atomic_post_disable, .mode_set = analogix_dp_bridge_mode_set, .attach = analogix_dp_bridge_attach, @@ -8737,7 +8490,7 @@ index aa1bb8629..1965fb1bd 100644 } return 0; -@@ -1609,10 +1747,11 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) +@@ -1643,10 +1781,11 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) { struct device_node *dp_node = dp->dev->of_node; struct video_info *video_info = &dp->video_info; @@ -8750,7 +8503,7 @@ index aa1bb8629..1965fb1bd 100644 /* * Like Rk3288 DisplayPort TRM indicate that "Main link * containing 4 physical lanes of 2.7/1.62 Gbps/lane". -@@ -1620,6 +1759,10 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) +@@ -1654,6 +1793,10 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) video_info->max_link_rate = 0x0A; video_info->max_lane_count = 0x04; break; @@ -8761,7 +8514,7 @@ index aa1bb8629..1965fb1bd 100644 case EXYNOS_DP: /* * NOTE: those property parseing code is used for -@@ -1632,6 +1775,35 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) +@@ -1666,6 +1809,35 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) break; } @@ -8797,10 +8550,14 @@ index aa1bb8629..1965fb1bd 100644 return 0; } -@@ -1643,13 +1815,99 @@ static ssize_t analogix_dpaux_transfer(struct drm_dp_aux *aux, - return analogix_dp_transfer(dp, msg); - } - +@@ -1673,20 +1845,96 @@ static ssize_t analogix_dpaux_transfer(struct drm_dp_aux *aux, + struct drm_dp_aux_msg *msg) + { + struct analogix_dp_device *dp = to_dp(aux); ++ ++ return analogix_dp_transfer(dp, msg); ++} ++ +int analogix_dp_audio_hw_params(struct analogix_dp_device *dp, + struct hdmi_codec_daifmt *daifmt, + struct hdmi_codec_params *params) @@ -8864,33 +8621,40 @@ index aa1bb8629..1965fb1bd 100644 + +int analogix_dp_loader_protect(struct analogix_dp_device *dp) +{ -+ int ret; -+ + int ret; + +- pm_runtime_get_sync(dp->dev); + ret = analogix_dp_phy_power_on(dp); + if (ret) + return ret; -+ + +- ret = analogix_dp_detect_hpd(dp); + dp->dpms_mode = DRM_MODE_DPMS_ON; + + analogix_dp_link_train_restore(dp); + + ret = analogix_dp_fast_link_train_detection(dp); -+ if (ret) + if (ret) +- goto out; + return ret; -+ + +- ret = analogix_dp_transfer(dp, msg); +-out: +- pm_runtime_put(dp->dev); + if (analogix_dp_detect_sink_psr(dp)) { + ret = analogix_dp_enable_sink_psr(dp); + if (ret) + return ret; + } -+ + +- return ret; + return 0; -+} + } +EXPORT_SYMBOL_GPL(analogix_dp_loader_protect); -+ + struct analogix_dp_device * analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) - { +@@ -1694,7 +1942,6 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) struct platform_device *pdev = to_platform_device(dev); struct analogix_dp_device *dp; struct resource *res; @@ -8898,7 +8662,7 @@ index aa1bb8629..1965fb1bd 100644 int ret; if (!plat_data) { -@@ -1663,9 +1921,10 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) +@@ -1708,9 +1955,10 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) dp->dev = &pdev->dev; dp->dpms_mode = DRM_MODE_DPMS_OFF; @@ -8910,7 +8674,7 @@ index aa1bb8629..1965fb1bd 100644 /* * platform dp driver need containor_of the plat_data to get -@@ -1694,13 +1953,13 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) +@@ -1739,21 +1987,19 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) } } @@ -8929,7 +8693,23 @@ index aa1bb8629..1965fb1bd 100644 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -@@ -1722,34 +1981,49 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) + dp->reg_base = devm_ioremap_resource(&pdev->dev, res); +- if (IS_ERR(dp->reg_base)) { +- ret = PTR_ERR(dp->reg_base); +- goto err_disable_clk; +- } ++ if (IS_ERR(dp->reg_base)) ++ return ERR_CAST(dp->reg_base); + + dp->force_hpd = of_property_read_bool(dev->of_node, "force-hpd"); + +@@ -1765,46 +2011,55 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) + if (IS_ERR(dp->hpd_gpiod)) { + dev_err(dev, "error getting HDP GPIO: %ld\n", + PTR_ERR(dp->hpd_gpiod)); +- ret = PTR_ERR(dp->hpd_gpiod); +- goto err_disable_clk; ++ return ERR_CAST(dp->hpd_gpiod); } if (dp->hpd_gpiod) { @@ -8962,7 +8742,9 @@ index aa1bb8629..1965fb1bd 100644 + dp->irq = platform_get_irq(pdev, 0); if (dp->irq == -ENXIO) { dev_err(&pdev->dev, "failed to get irq\n"); - return ERR_PTR(-ENODEV); +- ret = -ENODEV; +- goto err_disable_clk; ++ return ERR_PTR(-ENODEV); } - ret = devm_request_threaded_irq(&pdev->dev, dp->irq, @@ -8974,10 +8756,12 @@ index aa1bb8629..1965fb1bd 100644 + IRQF_ONESHOT, dev_name(dev), dp); if (ret) { dev_err(&pdev->dev, "failed to request irq\n"); - return ERR_PTR(ret); +- goto err_disable_clk; ++ return ERR_PTR(ret); } - disable_irq(dp->irq); -+ + +- return dp; + dp->extcon = devm_extcon_dev_allocate(dev, analogix_dp_cable); + if (IS_ERR(dp->extcon)) { + dev_err(dev, "failed to allocate extcon device\n"); @@ -8993,9 +8777,14 @@ index aa1bb8629..1965fb1bd 100644 + dp->bridge.driver_private = dp; + dp->bridge.funcs = &analogix_dp_bridge_funcs; - return dp; +-err_disable_clk: +- clk_disable_unprepare(dp->clock); +- return ERR_PTR(ret); ++ return dp; } -@@ -1771,16 +2045,21 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev) + EXPORT_SYMBOL_GPL(analogix_dp_probe); + +@@ -1824,16 +2079,21 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev) return ret; pm_runtime_enable(dp->dev); @@ -9019,7 +8808,7 @@ index aa1bb8629..1965fb1bd 100644 pm_runtime_disable(dp->dev); return ret; -@@ -1789,34 +2068,23 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind); +@@ -1842,47 +2102,50 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind); void analogix_dp_unbind(struct analogix_dp_device *dp) { @@ -9049,46 +8838,35 @@ index aa1bb8629..1965fb1bd 100644 int analogix_dp_suspend(struct analogix_dp_device *dp) { - clk_disable_unprepare(dp->clock); -- -- if (dp->plat_data->panel) { -- if (drm_panel_unprepare(dp->plat_data->panel)) -- DRM_ERROR("failed to turnoff the panel\n"); -- } + pm_runtime_force_suspend(dp->dev); - ++ return 0; } -@@ -1824,25 +2092,26 @@ EXPORT_SYMBOL_GPL(analogix_dp_suspend); + EXPORT_SYMBOL_GPL(analogix_dp_suspend); int analogix_dp_resume(struct analogix_dp_device *dp) { - int ret; -+ pm_runtime_force_resume(dp->dev); -+ analogix_dp_init(dp); - +- - ret = clk_prepare_enable(dp->clock); - if (ret < 0) { - DRM_ERROR("Failed to prepare_enable the clock clk [%d]\n", ret); - return ret; - } -+ return 0; -+} -+EXPORT_SYMBOL_GPL(analogix_dp_resume); - -- if (dp->plat_data->panel) { -- if (drm_panel_prepare(dp->plat_data->panel)) { -- DRM_ERROR("failed to setup the panel\n"); -- return -EBUSY; -- } -- } -+int analogix_dp_runtime_suspend(struct analogix_dp_device *dp) -+{ -+ clk_bulk_disable_unprepare(dp->nr_clks, dp->clks); ++ pm_runtime_force_resume(dp->dev); ++ analogix_dp_init(dp); return 0; } --EXPORT_SYMBOL_GPL(analogix_dp_resume); + EXPORT_SYMBOL_GPL(analogix_dp_resume); -#endif ++ ++int analogix_dp_runtime_suspend(struct analogix_dp_device *dp) ++{ ++ clk_bulk_disable_unprepare(dp->nr_clks, dp->clks); ++ ++ return 0; ++} +EXPORT_SYMBOL_GPL(analogix_dp_runtime_suspend); + +int analogix_dp_runtime_resume(struct analogix_dp_device *dp) @@ -9099,6 +8877,11 @@ index aa1bb8629..1965fb1bd 100644 int analogix_dp_start_crc(struct drm_connector *connector) { +@@ -1909,3 +2172,4 @@ EXPORT_SYMBOL_GPL(analogix_dp_stop_crc); + MODULE_AUTHOR("Jingoo Han "); + MODULE_DESCRIPTION("Analogix DP Core Driver"); + MODULE_LICENSE("GPL v2"); ++ diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h index c051502d7..ebc9b51e3 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h @@ -9248,7 +9031,7 @@ index c051502d7..ebc9b51e3 100644 #endif /* _ANALOGIX_DP_CORE_H */ diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c -index 914c569ab..be64c0cf1 100644 +index cab3f5c4e..be64c0cf1 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c @@ -11,30 +11,44 @@ @@ -9941,7 +9724,7 @@ index 914c569ab..be64c0cf1 100644 - /* Write data buffer */ - reg = (unsigned int)data; - writel(reg, dp->reg_base + ANALOGIX_DP_BUF_DATA_0); - +- - /* - * Set DisplayPort transaction and write 1 byte - * If bit 3 is 1, DisplayPort transaction. @@ -9949,7 +9732,7 @@ index 914c569ab..be64c0cf1 100644 - */ - reg = AUX_TX_COMM_DP_TRANSACTION | AUX_TX_COMM_WRITE; - writel(reg, dp->reg_base + ANALOGIX_DP_AUX_CH_CTL_1); -- + - /* Start AUX transaction */ - retval = analogix_dp_start_aux_transaction(dp); - if (retval == 0) @@ -9974,7 +9757,10 @@ index 914c569ab..be64c0cf1 100644 - u32 reg; + u32 status; + int ret; -+ + +- reg = bwtype; +- if ((bwtype == DP_LINK_BW_2_7) || (bwtype == DP_LINK_BW_1_62)) +- writel(reg, dp->reg_base + ANALOGIX_DP_LINK_BW_SET); + analogix_dp_write(dp, ANALOGIX_DP_LINK_BW_SET, bwtype); + + if (dp->phy) { @@ -9999,10 +9785,7 @@ index 914c569ab..be64c0cf1 100644 + else + analogix_dp_ssc_disable(dp); + } - -- reg = bwtype; -- if ((bwtype == DP_LINK_BW_2_7) || (bwtype == DP_LINK_BW_1_62)) -- writel(reg, dp->reg_base + ANALOGIX_DP_LINK_BW_SET); ++ + ret = readx_poll_timeout(analogix_dp_get_pll_lock_status, dp, status, + status != PLL_UNLOCKED, 120, + 120 * DP_TIMEOUT_LOOP_COUNT); @@ -10563,7 +10346,7 @@ index 914c569ab..be64c0cf1 100644 int analogix_dp_send_psr_spd(struct analogix_dp_device *dp, struct dp_sdp *vsc, bool blocking) { -@@ -1044,53 +1005,66 @@ int analogix_dp_send_psr_spd(struct analogix_dp_device *dp, +@@ -1044,44 +1005,47 @@ int analogix_dp_send_psr_spd(struct analogix_dp_device *dp, ssize_t psr_status; /* don't send info frame */ @@ -10632,28 +10415,7 @@ index 914c569ab..be64c0cf1 100644 if (!blocking) return 0; - -+ /* -+ * db[1]!=0: entering PSR, wait for fully active remote frame buffer. -+ * db[1]==0: exiting PSR, wait for either -+ * (a) ACTIVE_RESYNC - the sink "must display the -+ * incoming active frames from the Source device with no visible -+ * glitches and/or artifacts", even though timings may still be -+ * re-synchronizing; or -+ * (b) INACTIVE - the transition is fully complete. -+ */ - ret = readx_poll_timeout(analogix_dp_get_psr_status, dp, psr_status, - psr_status >= 0 && - ((vsc->db[1] && psr_status == DP_PSR_SINK_ACTIVE_RFB) || -- (!vsc->db[1] && psr_status == DP_PSR_SINK_INACTIVE)), 1500, -- DP_TIMEOUT_PSR_LOOP_MS * 1000); -+ (!vsc->db[1] && (psr_status == DP_PSR_SINK_ACTIVE_RESYNC || -+ psr_status == DP_PSR_SINK_INACTIVE))), -+ 1500, DP_TIMEOUT_PSR_LOOP_MS * 1000); - if (ret) { - dev_warn(dp->dev, "Failed to apply PSR %d\n", ret); - return ret; -@@ -1098,11 +1072,46 @@ int analogix_dp_send_psr_spd(struct analogix_dp_device *dp, +@@ -1108,11 +1072,46 @@ int analogix_dp_send_psr_spd(struct analogix_dp_device *dp, return 0; } @@ -10701,7 +10463,7 @@ index 914c569ab..be64c0cf1 100644 u8 *buffer = msg->buffer; unsigned int i; int num_transferred = 0; -@@ -1114,7 +1123,7 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, +@@ -1124,7 +1123,7 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, /* Clear AUX CH data buffer */ reg = BUF_CLR; @@ -10710,7 +10472,7 @@ index 914c569ab..be64c0cf1 100644 switch (msg->request & ~DP_AUX_I2C_MOT) { case DP_AUX_I2C_WRITE: -@@ -1142,21 +1151,21 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, +@@ -1152,21 +1151,21 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, } reg |= AUX_LENGTH(msg->size); @@ -10738,7 +10500,7 @@ index 914c569ab..be64c0cf1 100644 num_transferred++; } } -@@ -1168,7 +1177,7 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, +@@ -1178,7 +1177,7 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, if (msg->size < 1) reg |= ADDR_ONLY; @@ -10747,19 +10509,19 @@ index 914c569ab..be64c0cf1 100644 ret = readx_poll_timeout(readl, dp->reg_base + ANALOGIX_DP_AUX_CH_CTL_2, reg, !(reg & AUX_EN), 25, 500 * 1000); -@@ -1187,30 +1196,31 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, +@@ -1197,30 +1196,31 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, } /* Clear interrupt source for AUX CH command reply */ - writel(RPLY_RECEIV, dp->reg_base + ANALOGIX_DP_INT_STA); -- ++ analogix_dp_write(dp, ANALOGIX_DP_INT_STA, RPLY_RECEIV); + - /* Clear interrupt source for AUX CH access error */ - reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA); - status_reg = readl(dp->reg_base + ANALOGIX_DP_AUX_CH_STA); - if ((reg & AUX_ERR) || (status_reg & AUX_STATUS_MASK)) { - writel(AUX_ERR, dp->reg_base + ANALOGIX_DP_INT_STA); -+ analogix_dp_write(dp, ANALOGIX_DP_INT_STA, RPLY_RECEIV); - +- - dev_warn(dp->dev, "AUX CH error happened: %#x (%d)\n", - status_reg & AUX_STATUS_MASK, !!(reg & AUX_ERR)); - goto aux_error; @@ -10793,7 +10555,7 @@ index 914c569ab..be64c0cf1 100644 if (reg == AUX_RX_COMM_AUX_DEFER) msg->reply = DP_AUX_NATIVE_REPLY_DEFER; else if (reg == AUX_RX_COMM_I2C_DEFER) -@@ -1222,7 +1232,7 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, +@@ -1232,7 +1232,7 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, (msg->request & ~DP_AUX_I2C_MOT) == DP_AUX_NATIVE_READ) msg->reply = DP_AUX_NATIVE_REPLY_ACK; @@ -10802,7 +10564,7 @@ index 914c569ab..be64c0cf1 100644 aux_error: /* if aux err happen, reset aux */ -@@ -1230,3 +1240,127 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, +@@ -1240,3 +1240,127 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, return -EREMOTEIO; } @@ -11326,7 +11088,7 @@ index 29b1ce214..c1926154e 100644 static void lt9611_bridge_pre_enable(struct drm_bridge *bridge) diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c -index 6cac2e58c..c65ca8607 100644 +index b68d33598..215da60e8 100644 --- a/drivers/gpu/drm/bridge/nwl-dsi.c +++ b/drivers/gpu/drm/bridge/nwl-dsi.c @@ -196,7 +196,7 @@ static u32 ps2bc(struct nwl_dsi *dsi, unsigned long long ps) @@ -11790,7 +11552,7 @@ index 70ab4fbdc..48fc36d56 100644 cec->adap->owner = THIS_MODULE; diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c -index 0c79a9ba4..52374e943 100644 +index b10228b9e..28a3bc53f 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -9,6 +9,8 @@ @@ -12348,7 +12110,7 @@ index 0c79a9ba4..52374e943 100644 config3 = hdmi_readb(hdmi, HDMI_CONFIG3_ID); -@@ -1005,6 +1307,15 @@ static bool is_csc_needed(struct dw_hdmi *hdmi) +@@ -1013,6 +1315,15 @@ static bool is_csc_needed(struct dw_hdmi *hdmi) is_color_space_interpolation(hdmi); } @@ -12364,7 +12126,7 @@ index 0c79a9ba4..52374e943 100644 static void dw_hdmi_update_csc_coeffs(struct dw_hdmi *hdmi) { const u16 (*csc_coeff)[3][4] = &csc_coeff_default; -@@ -1027,7 +1338,7 @@ static void dw_hdmi_update_csc_coeffs(struct dw_hdmi *hdmi) +@@ -1035,7 +1346,7 @@ static void dw_hdmi_update_csc_coeffs(struct dw_hdmi *hdmi) csc_coeff = &csc_coeff_rgb_in_eitu709; csc_scale = 0; } else if (is_input_rgb && is_output_rgb && @@ -12373,7 +12135,7 @@ index 0c79a9ba4..52374e943 100644 csc_coeff = &csc_coeff_rgb_full_to_rgb_limited; } -@@ -1059,7 +1370,7 @@ static void hdmi_video_csc(struct dw_hdmi *hdmi) +@@ -1067,7 +1378,7 @@ static void hdmi_video_csc(struct dw_hdmi *hdmi) if (is_color_space_interpolation(hdmi)) interpolation = HDMI_CSC_CFG_INTMODE_CHROMA_INT_FORMULA1; else if (is_color_space_decimation(hdmi)) @@ -12382,7 +12144,7 @@ index 0c79a9ba4..52374e943 100644 switch (hdmi_bus_fmt_color_depth(hdmi->hdmi_data.enc_out_bus_format)) { case 8: -@@ -1106,7 +1417,7 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) +@@ -1114,7 +1425,7 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) switch (hdmi_bus_fmt_color_depth( hdmi->hdmi_data.enc_out_bus_format)) { case 8: @@ -12391,7 +12153,7 @@ index 0c79a9ba4..52374e943 100644 output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS; break; case 10: -@@ -1144,18 +1455,15 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) +@@ -1152,18 +1463,15 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) } /* set the packetizer registers */ @@ -12413,7 +12175,7 @@ index 0c79a9ba4..52374e943 100644 vp_conf = HDMI_VP_CONF_PR_EN_ENABLE | HDMI_VP_CONF_BYPASS_SELECT_PIX_REPEATER; } else { /* data from packetizer block */ -@@ -1167,8 +1475,13 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) +@@ -1175,8 +1483,13 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) HDMI_VP_CONF_PR_EN_MASK | HDMI_VP_CONF_BYPASS_SELECT_MASK, HDMI_VP_CONF); @@ -12429,7 +12191,7 @@ index 0c79a9ba4..52374e943 100644 hdmi_writeb(hdmi, remap_size, HDMI_VP_REMAP); -@@ -1269,6 +1582,23 @@ static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi, +@@ -1277,6 +1590,23 @@ static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi, return true; } @@ -12453,7 +12215,7 @@ index 0c79a9ba4..52374e943 100644 /* * HDMI2.0 Specifies the following procedure for High TMDS Bit Rates: * - The Source shall suspend transmission of the TMDS clock and data -@@ -1446,6 +1776,13 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, +@@ -1454,6 +1784,13 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, const struct dw_hdmi_mpll_config *mpll_config = pdata->mpll_cfg; const struct dw_hdmi_curr_ctrl *curr_ctrl = pdata->cur_ctr; const struct dw_hdmi_phy_config *phy_config = pdata->phy_config; @@ -12467,7 +12229,7 @@ index 0c79a9ba4..52374e943 100644 /* TOFIX Will need 420 specific PHY configuration tables */ -@@ -1455,11 +1792,11 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, +@@ -1463,11 +1800,11 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, break; for (; curr_ctrl->mpixelclock != ~0UL; curr_ctrl++) @@ -12481,7 +12243,7 @@ index 0c79a9ba4..52374e943 100644 break; if (mpll_config->mpixelclock == ~0UL || -@@ -1467,11 +1804,18 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, +@@ -1475,11 +1812,18 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, phy_config->mpixelclock == ~0UL) return -EINVAL; @@ -12503,7 +12265,7 @@ index 0c79a9ba4..52374e943 100644 HDMI_3D_TX_PHY_CURRCTRL); dw_hdmi_phy_i2c_write(hdmi, 0, HDMI_3D_TX_PHY_PLLPHBYCTRL); -@@ -1484,10 +1828,6 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, +@@ -1492,10 +1836,6 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi, dw_hdmi_phy_i2c_write(hdmi, phy_config->vlev_ctr, HDMI_3D_TX_PHY_VLEVCTRL); @@ -12514,7 +12276,7 @@ index 0c79a9ba4..52374e943 100644 return 0; } -@@ -1589,14 +1929,16 @@ void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data) +@@ -1597,14 +1937,16 @@ void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data) hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE, HDMI_IH_PHY_STAT0); @@ -12538,7 +12300,7 @@ index 0c79a9ba4..52374e943 100644 } EXPORT_SYMBOL_GPL(dw_hdmi_phy_setup_hpd); -@@ -1612,23 +1954,36 @@ static const struct dw_hdmi_phy_ops dw_hdmi_synopsys_phy_ops = { +@@ -1620,23 +1962,36 @@ static const struct dw_hdmi_phy_ops dw_hdmi_synopsys_phy_ops = { * HDMI TX Setup */ @@ -12591,7 +12353,7 @@ index 0c79a9ba4..52374e943 100644 } static void hdmi_config_AVI(struct dw_hdmi *hdmi, -@@ -1642,10 +1997,15 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, +@@ -1650,10 +2005,15 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, drm_hdmi_avi_infoframe_from_display_mode(&frame, connector, mode); if (hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format)) { @@ -12611,7 +12373,7 @@ index 0c79a9ba4..52374e943 100644 } else { frame.quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT; frame.ycc_quantization_range = -@@ -1680,6 +2040,14 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, +@@ -1688,6 +2048,14 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, frame.extended_colorimetry = HDMI_EXTENDED_COLORIMETRY_XV_YCC_709; break; @@ -12626,7 +12388,7 @@ index 0c79a9ba4..52374e943 100644 default: /* Carries no data */ frame.colorimetry = HDMI_COLORIMETRY_ITU_601; frame.extended_colorimetry = -@@ -1816,17 +2184,44 @@ static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi, +@@ -1824,17 +2192,44 @@ static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi, const struct drm_connector *connector) { const struct drm_connector_state *conn_state = connector->state; @@ -12671,7 +12433,7 @@ index 0c79a9ba4..52374e943 100644 err = drm_hdmi_infoframe_set_hdr_metadata(&frame, conn_state); if (err < 0) return; -@@ -1846,51 +2241,66 @@ static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi, +@@ -1854,51 +2249,66 @@ static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi, hdmi_writeb(hdmi, 1, HDMI_FC_DRM_UP); hdmi_modb(hdmi, HDMI_FC_PACKET_TX_EN_DRM_ENABLE, HDMI_FC_PACKET_TX_EN_DRM_MASK, HDMI_FC_PACKET_TX_EN); @@ -12765,7 +12527,7 @@ index 0c79a9ba4..52374e943 100644 inv_val |= mode->flags & DRM_MODE_FLAG_PVSYNC ? HDMI_FC_INVIDCONF_VSYNC_IN_POLARITY_ACTIVE_HIGH : -@@ -1956,7 +2366,8 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, +@@ -1964,7 +2374,8 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, /* Scrambling Control */ if (dw_hdmi_support_scdc(hdmi, display)) { if (vmode->mtmdsclock > HDMI14_MAX_TMDSCLK || @@ -12775,7 +12537,7 @@ index 0c79a9ba4..52374e943 100644 /* * HDMI2.0 Specifies the following procedure: * After the Source Device has determined that -@@ -1990,6 +2401,8 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, +@@ -1998,6 +2409,8 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, HDMI_MC_SWRSTZ); drm_scdc_set_scrambling(hdmi->ddc, 0); } @@ -12784,7 +12546,7 @@ index 0c79a9ba4..52374e943 100644 } /* Set up horizontal active pixel width */ -@@ -2047,6 +2460,12 @@ static void dw_hdmi_enable_video_path(struct dw_hdmi *hdmi) +@@ -2055,6 +2468,12 @@ static void dw_hdmi_enable_video_path(struct dw_hdmi *hdmi) hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_TMDSCLK_DISABLE; hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS); @@ -12797,7 +12559,7 @@ index 0c79a9ba4..52374e943 100644 /* Enable csc path */ if (is_csc_needed(hdmi)) { hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_CSCCLK_DISABLE; -@@ -2122,6 +2541,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, +@@ -2130,6 +2549,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, const struct drm_display_mode *mode) { int ret; @@ -12805,7 +12567,7 @@ index 0c79a9ba4..52374e943 100644 hdmi_disable_overflow_interrupts(hdmi); -@@ -2133,48 +2553,91 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, +@@ -2141,48 +2561,91 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, dev_dbg(hdmi->dev, "CEA mode used vic=%d\n", hdmi->vic); } @@ -12916,7 +12678,7 @@ index 0c79a9ba4..52374e943 100644 /* HDMI Initialization Step B.3 */ dw_hdmi_enable_video_path(hdmi); -@@ -2202,7 +2665,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, +@@ -2210,7 +2673,7 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, hdmi_video_packetize(hdmi); hdmi_video_csc(hdmi); hdmi_video_sample(hdmi); @@ -12925,7 +12687,7 @@ index 0c79a9ba4..52374e943 100644 dw_hdmi_clear_overflow(hdmi); -@@ -2278,6 +2741,8 @@ static void dw_hdmi_poweroff(struct dw_hdmi *hdmi) +@@ -2286,6 +2749,8 @@ static void dw_hdmi_poweroff(struct dw_hdmi *hdmi) hdmi->phy.enabled = false; } @@ -12934,7 +12696,7 @@ index 0c79a9ba4..52374e943 100644 hdmi->bridge_is_on = false; } -@@ -2295,6 +2760,10 @@ static void dw_hdmi_update_power(struct dw_hdmi *hdmi) +@@ -2303,6 +2768,10 @@ static void dw_hdmi_update_power(struct dw_hdmi *hdmi) } if (force == DRM_FORCE_OFF) { @@ -12945,7 +12707,7 @@ index 0c79a9ba4..52374e943 100644 if (hdmi->bridge_is_on) dw_hdmi_poweroff(hdmi); } else { -@@ -2327,8 +2796,15 @@ static enum drm_connector_status dw_hdmi_detect(struct dw_hdmi *hdmi) +@@ -2335,8 +2804,15 @@ static enum drm_connector_status dw_hdmi_detect(struct dw_hdmi *hdmi) { enum drm_connector_status result; @@ -12962,7 +12724,7 @@ index 0c79a9ba4..52374e943 100644 mutex_lock(&hdmi->mutex); if (result != hdmi->last_connector_result) { dev_dbg(hdmi->dev, "read_hpd result: %d", result); -@@ -2338,6 +2814,11 @@ static enum drm_connector_status dw_hdmi_detect(struct dw_hdmi *hdmi) +@@ -2346,6 +2822,11 @@ static enum drm_connector_status dw_hdmi_detect(struct dw_hdmi *hdmi) } mutex_unlock(&hdmi->mutex); @@ -12974,7 +12736,7 @@ index 0c79a9ba4..52374e943 100644 return result; } -@@ -2358,7 +2839,7 @@ static struct edid *dw_hdmi_get_edid(struct dw_hdmi *hdmi, +@@ -2366,7 +2847,7 @@ static struct edid *dw_hdmi_get_edid(struct dw_hdmi *hdmi, dev_dbg(hdmi->dev, "got edid: width[%d] x height[%d]\n", edid->width_cm, edid->height_cm); @@ -12983,7 +12745,7 @@ index 0c79a9ba4..52374e943 100644 hdmi->sink_has_audio = drm_detect_monitor_audio(edid); return edid; -@@ -2376,21 +2857,105 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force) +@@ -2384,21 +2865,105 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force) return dw_hdmi_detect(hdmi); } @@ -13096,7 +12858,7 @@ index 0c79a9ba4..52374e943 100644 return ret; } -@@ -2419,11 +2984,54 @@ static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, +@@ -2427,11 +2992,54 @@ static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, drm_atomic_get_new_connector_state(state, connector); struct drm_crtc *crtc = new_state->crtc; struct drm_crtc_state *crtc_state; @@ -13152,7 +12914,7 @@ index 0c79a9ba4..52374e943 100644 crtc_state = drm_atomic_get_crtc_state(state, crtc); if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); -@@ -2434,12 +3042,105 @@ static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, +@@ -2442,12 +3050,105 @@ static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, return 0; } @@ -13258,7 +13020,7 @@ index 0c79a9ba4..52374e943 100644 hdmi->force = connector->force; dw_hdmi_update_power(hdmi); dw_hdmi_update_phy_mask(hdmi); -@@ -2452,15 +3153,98 @@ static const struct drm_connector_funcs dw_hdmi_connector_funcs = { +@@ -2460,15 +3161,98 @@ static const struct drm_connector_funcs dw_hdmi_connector_funcs = { .destroy = drm_connector_cleanup, .force = dw_hdmi_connector_force, .reset = drm_atomic_helper_connector_reset, @@ -13357,7 +13119,7 @@ index 0c79a9ba4..52374e943 100644 static int dw_hdmi_connector_create(struct dw_hdmi *hdmi) { struct drm_connector *connector = &hdmi->connector; -@@ -2497,6 +3281,8 @@ static int dw_hdmi_connector_create(struct dw_hdmi *hdmi) +@@ -2505,6 +3289,8 @@ static int dw_hdmi_connector_create(struct dw_hdmi *hdmi) drm_connector_attach_encoder(connector, hdmi->bridge.encoder); @@ -13366,7 +13128,7 @@ index 0c79a9ba4..52374e943 100644 cec_fill_conn_info_from_drm(&conn_info, connector); notifier = cec_notifier_conn_register(hdmi->dev, NULL, &conn_info); -@@ -2771,16 +3557,36 @@ static int dw_hdmi_bridge_atomic_check(struct drm_bridge *bridge, +@@ -2780,16 +3566,36 @@ static int dw_hdmi_bridge_atomic_check(struct drm_bridge *bridge, struct drm_connector_state *conn_state) { struct dw_hdmi *hdmi = bridge->driver_private; @@ -13410,7 +13172,7 @@ index 0c79a9ba4..52374e943 100644 return 0; } -@@ -2789,10 +3595,22 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge, +@@ -2798,10 +3604,22 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flags flags) { struct dw_hdmi *hdmi = bridge->driver_private; @@ -13433,7 +13195,7 @@ index 0c79a9ba4..52374e943 100644 return dw_hdmi_connector_create(hdmi); } -@@ -2812,17 +3630,16 @@ dw_hdmi_bridge_mode_valid(struct drm_bridge *bridge, +@@ -2821,17 +3639,16 @@ dw_hdmi_bridge_mode_valid(struct drm_bridge *bridge, const struct drm_display_mode *mode) { struct dw_hdmi *hdmi = bridge->driver_private; @@ -13456,7 +13218,7 @@ index 0c79a9ba4..52374e943 100644 return mode_status; } -@@ -2903,6 +3720,12 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = { +@@ -2912,6 +3729,12 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = { .get_edid = dw_hdmi_bridge_get_edid, }; @@ -13469,7 +13231,7 @@ index 0c79a9ba4..52374e943 100644 /* ----------------------------------------------------------------------------- * IRQ Handling */ -@@ -2928,7 +3751,7 @@ static irqreturn_t dw_hdmi_i2c_irq(struct dw_hdmi *hdmi) +@@ -2937,7 +3760,7 @@ static irqreturn_t dw_hdmi_i2c_irq(struct dw_hdmi *hdmi) static irqreturn_t dw_hdmi_hardirq(int irq, void *dev_id) { struct dw_hdmi *hdmi = dev_id; @@ -13478,7 +13240,7 @@ index 0c79a9ba4..52374e943 100644 irqreturn_t ret = IRQ_NONE; if (hdmi->i2c) -@@ -2940,6 +3763,13 @@ static irqreturn_t dw_hdmi_hardirq(int irq, void *dev_id) +@@ -2949,6 +3772,13 @@ static irqreturn_t dw_hdmi_hardirq(int irq, void *dev_id) return IRQ_WAKE_THREAD; } @@ -13492,7 +13254,7 @@ index 0c79a9ba4..52374e943 100644 return ret; } -@@ -2947,7 +3777,7 @@ void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense) +@@ -2956,7 +3786,7 @@ void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense) { mutex_lock(&hdmi->mutex); @@ -13501,7 +13263,7 @@ index 0c79a9ba4..52374e943 100644 /* * If the RX sense status indicates we're disconnected, * clear the software rxsense status. -@@ -2974,7 +3804,7 @@ EXPORT_SYMBOL_GPL(dw_hdmi_setup_rx_sense); +@@ -2983,7 +3813,7 @@ EXPORT_SYMBOL_GPL(dw_hdmi_setup_rx_sense); static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) { struct dw_hdmi *hdmi = dev_id; @@ -13510,7 +13272,7 @@ index 0c79a9ba4..52374e943 100644 intr_stat = hdmi_readb(hdmi, HDMI_IH_PHY_STAT0); phy_int_pol = hdmi_readb(hdmi, HDMI_PHY_POL0); -@@ -3015,25 +3845,21 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) +@@ -3024,25 +3854,21 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) } } @@ -13549,7 +13311,7 @@ index 0c79a9ba4..52374e943 100644 return IRQ_HANDLED; } -@@ -3167,12 +3993,363 @@ static void dw_hdmi_init_hw(struct dw_hdmi *hdmi) +@@ -3176,12 +4002,363 @@ static void dw_hdmi_init_hw(struct dw_hdmi *hdmi) * Even if we are using a separate i2c adapter doing this doesn't * hurt. */ @@ -13914,7 +13676,7 @@ index 0c79a9ba4..52374e943 100644 /* ----------------------------------------------------------------------------- * Probe/remove API, used from platforms based on the DRM bridge API. */ -@@ -3181,6 +4358,7 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3190,6 +4367,7 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; @@ -13922,7 +13684,7 @@ index 0c79a9ba4..52374e943 100644 struct platform_device_info pdevinfo; struct device_node *ddc_node; struct dw_hdmi_cec_data cec; -@@ -3193,11 +4371,13 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3202,11 +4380,13 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, u8 prod_id1; u8 config0; u8 config3; @@ -13936,7 +13698,7 @@ index 0c79a9ba4..52374e943 100644 hdmi->plat_data = plat_data; hdmi->dev = dev; hdmi->sample_rate = 48000; -@@ -3328,7 +4508,24 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3337,7 +4517,24 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, prod_id1 & HDMI_PRODUCT_ID1_HDCP ? "with" : "without", hdmi->phy.name); @@ -13962,7 +13724,7 @@ index 0c79a9ba4..52374e943 100644 irq = platform_get_irq(pdev, 0); if (irq < 0) { -@@ -3336,6 +4533,7 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3345,6 +4542,7 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, goto err_iahb; } @@ -13970,7 +13732,7 @@ index 0c79a9ba4..52374e943 100644 ret = devm_request_threaded_irq(dev, irq, dw_hdmi_hardirq, dw_hdmi_irq, IRQF_SHARED, dev_name(dev), hdmi); -@@ -3371,8 +4569,20 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3380,8 +4578,20 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, hdmi->ddc = dw_hdmi_i2c_adapter(hdmi); if (IS_ERR(hdmi->ddc)) hdmi->ddc = NULL; @@ -13991,7 +13753,7 @@ index 0c79a9ba4..52374e943 100644 hdmi->bridge.driver_private = hdmi; hdmi->bridge.funcs = &dw_hdmi_bridge_funcs; hdmi->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID -@@ -3381,6 +4591,30 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3390,6 +4600,30 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, hdmi->bridge.of_node = pdev->dev.of_node; #endif @@ -14022,7 +13784,7 @@ index 0c79a9ba4..52374e943 100644 memset(&pdevinfo, 0, sizeof(pdevinfo)); pdevinfo.parent = dev; pdevinfo.id = PLATFORM_DEVID_AUTO; -@@ -3434,8 +4668,40 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3443,8 +4677,40 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, hdmi->cec = platform_device_register_full(&pdevinfo); } @@ -14063,7 +13825,7 @@ index 0c79a9ba4..52374e943 100644 return hdmi; err_iahb: -@@ -3445,7 +4711,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, +@@ -3454,7 +4720,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, err_isfr: clk_disable_unprepare(hdmi->isfr_clk); err_res: @@ -14075,7 +13837,7 @@ index 0c79a9ba4..52374e943 100644 return ERR_PTR(ret); } -@@ -3453,16 +4722,35 @@ EXPORT_SYMBOL_GPL(dw_hdmi_probe); +@@ -3462,16 +4731,35 @@ EXPORT_SYMBOL_GPL(dw_hdmi_probe); void dw_hdmi_remove(struct dw_hdmi *hdmi) { @@ -14111,7 +13873,7 @@ index 0c79a9ba4..52374e943 100644 clk_disable_unprepare(hdmi->iahb_clk); clk_disable_unprepare(hdmi->isfr_clk); if (hdmi->cec_clk) -@@ -3480,7 +4768,7 @@ EXPORT_SYMBOL_GPL(dw_hdmi_remove); +@@ -3489,7 +4777,7 @@ EXPORT_SYMBOL_GPL(dw_hdmi_remove); */ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev, struct drm_encoder *encoder, @@ -14120,7 +13882,7 @@ index 0c79a9ba4..52374e943 100644 { struct dw_hdmi *hdmi; int ret; -@@ -3496,6 +4784,9 @@ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev, +@@ -3505,6 +4793,9 @@ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev, return ERR_PTR(ret); } @@ -14130,7 +13892,7 @@ index 0c79a9ba4..52374e943 100644 return hdmi; } EXPORT_SYMBOL_GPL(dw_hdmi_bind); -@@ -3506,9 +4797,87 @@ void dw_hdmi_unbind(struct dw_hdmi *hdmi) +@@ -3515,9 +4806,87 @@ void dw_hdmi_unbind(struct dw_hdmi *hdmi) } EXPORT_SYMBOL_GPL(dw_hdmi_unbind); @@ -14307,7 +14069,7 @@ index 1999db05b..509732800 100644 /* diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c -index 6b268f944..fa00e24c1 100644 +index 376fa6eb4..163dcc03b 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -244,7 +244,7 @@ struct dw_mipi_dsi { @@ -14544,7 +14306,7 @@ index 6b268f944..fa00e24c1 100644 dw_mipi_dsi_debugfs_init(dsi); pm_runtime_enable(dev); -@@ -1246,6 +1231,12 @@ void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi) +@@ -1247,6 +1232,12 @@ void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi) } EXPORT_SYMBOL_GPL(dw_mipi_dsi_unbind); @@ -14558,7 +14320,7 @@ index 6b268f944..fa00e24c1 100644 MODULE_AUTHOR("Philippe Cornu "); MODULE_DESCRIPTION("DW MIPI DSI host controller driver"); diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c -index 8a871e5c3..9418d0847 100644 +index 7fc8e7000..4108c7265 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -296,12 +296,14 @@ update_connector_routing(struct drm_atomic_state *state, @@ -14588,7 +14350,7 @@ index 8a871e5c3..9418d0847 100644 DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d:%s]\n", connector->base.id, -@@ -3544,6 +3547,9 @@ int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc, +@@ -3554,6 +3557,9 @@ int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc, replaced = drm_property_replace_blob(&crtc_state->degamma_lut, NULL); replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL); replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, blob); @@ -14854,7 +14616,7 @@ index b0a826489..3d7182001 100644 from_kuid_munged(seq_user_ns(m), uid), priv->magic); diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c -index add317bd8..cfb96e181 100644 +index 4334e466b..ab52f7fed 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1835,20 +1835,11 @@ static void connector_bad_edid(struct drm_connector *connector, @@ -14881,7 +14643,7 @@ index add317bd8..cfb96e181 100644 if (connector->bad_edid_counter++ && !drm_debug_enabled(DRM_UT_KMS)) return; -@@ -4860,6 +4851,43 @@ static void drm_parse_vcdb(struct drm_connector *connector, const u8 *db) +@@ -4861,6 +4852,43 @@ static void drm_parse_vcdb(struct drm_connector *connector, const u8 *db) info->rgb_quant_range_selectable = true; } @@ -14925,7 +14687,7 @@ index add317bd8..cfb96e181 100644 static void drm_parse_ycbcr420_deep_color_info(struct drm_connector *connector, const u8 *db) { -@@ -4913,6 +4941,76 @@ static void drm_parse_hdmi_forum_vsdb(struct drm_connector *connector, +@@ -4914,6 +4942,76 @@ static void drm_parse_hdmi_forum_vsdb(struct drm_connector *connector, } } @@ -15465,10 +15227,10 @@ index 0f99e5453..d42c7310b 100644 /** * drm_mode_is_420_only - if a given videomode can be only supported in YCBCR420 diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c -index 9f955f201..ca6d13eb3 100644 +index 825499ea3..272e5cdd6 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c -@@ -780,6 +780,28 @@ int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma) +@@ -784,6 +784,28 @@ int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma) } EXPORT_SYMBOL(drm_gem_dmabuf_mmap); @@ -15497,7 +15259,7 @@ index 9f955f201..ca6d13eb3 100644 static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { .cache_sgt_mapping = true, .attach = drm_gem_map_attach, -@@ -790,6 +812,7 @@ static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { +@@ -794,6 +816,7 @@ static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { .mmap = drm_gem_dmabuf_mmap, .vmap = drm_gem_dmabuf_vmap, .vunmap = drm_gem_dmabuf_vunmap, @@ -15562,7 +15324,7 @@ index 2ba560bca..bb2c16d0f 100644 + +ccflags-y +=-I$(KERNEL_SOURCE_PATH)/drivers/gpu/drm/panel diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c -index 204674fcc..68553c28c 100644 +index b7b37082a..e5b035086 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -30,6 +30,7 @@ @@ -16012,7 +15774,7 @@ index 204674fcc..68553c28c 100644 } if (desc == &panel_dpi) { -@@ -566,7 +855,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) +@@ -567,7 +856,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) /* Catch common mistakes for panels. */ switch (connector_type) { case 0: @@ -16021,7 +15783,7 @@ index 204674fcc..68553c28c 100644 connector_type = DRM_MODE_CONNECTOR_DPI; break; case DRM_MODE_CONNECTOR_LVDS: -@@ -621,8 +910,10 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) +@@ -622,8 +911,10 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type); err = drm_panel_of_backlight(&panel->base); @@ -16033,7 +15795,7 @@ index 204674fcc..68553c28c 100644 drm_panel_add(&panel->base); -@@ -3902,6 +4193,9 @@ static const struct panel_desc arm_rtsm = { +@@ -3904,6 +4195,9 @@ static const struct panel_desc arm_rtsm = { static const struct of_device_id platform_of_match[] = { { @@ -16043,7 +15805,7 @@ index 204674fcc..68553c28c 100644 .compatible = "ampire,am-1280800n3tzqw-t00h", .data = &ire_am_1280800n3tzqw_t00h, }, { -@@ -4310,15 +4604,132 @@ static const struct of_device_id platform_of_match[] = { +@@ -4312,15 +4606,132 @@ static const struct of_device_id platform_of_match[] = { }; MODULE_DEVICE_TABLE(of, platform_of_match); @@ -16177,7 +15939,7 @@ index 204674fcc..68553c28c 100644 } static int panel_simple_platform_remove(struct platform_device *pdev) -@@ -4553,6 +4964,9 @@ static const struct panel_desc_dsi osd101t2045_53ts = { +@@ -4555,6 +4966,9 @@ static const struct panel_desc_dsi osd101t2045_53ts = { static const struct of_device_id dsi_of_match[] = { { @@ -16187,7 +15949,7 @@ index 204674fcc..68553c28c 100644 .compatible = "auo,b080uan01", .data = &auo_b080uan01 }, { -@@ -4579,9 +4993,33 @@ static const struct of_device_id dsi_of_match[] = { +@@ -4581,9 +4995,33 @@ static const struct of_device_id dsi_of_match[] = { }; MODULE_DEVICE_TABLE(of, dsi_of_match); @@ -16221,7 +15983,7 @@ index 204674fcc..68553c28c 100644 const struct of_device_id *id; int err; -@@ -4589,12 +5027,47 @@ static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi) +@@ -4591,12 +5029,47 @@ static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi) if (!id) return -ENODEV; @@ -16299,7 +16061,7 @@ index 4c6bdea55..597cf1459 100644 static inline struct panfrost_device *to_panfrost_device(struct drm_device *ddev) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c -index a70261809..689be734e 100644 +index 1dfc457bb..bd1f663d7 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -417,7 +417,7 @@ static int panfrost_ioctl_madvise(struct drm_device *dev, void *data, @@ -16475,7 +16237,7 @@ index 7e1a5664d..04e6f6f9b 100644 dma_fence_signal_locked(job->done_fence); diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c -index 7fc45b13a..21e552d1a 100644 +index 13596961a..b73e17de1 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -1,8 +1,5 @@ @@ -16969,7 +16731,7 @@ index 17a9e7eb2..fda134d9b 100644 +ccflags-y +=-I$(KERNEL_SOURCE_PATH)/drivers/gpu/drm/ \ No newline at end of file diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c -index ade2327a1..edad62bc7 100644 +index 512581698..ae3c74cc9 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -16,6 +16,7 @@ @@ -17517,10 +17279,10 @@ index ade2327a1..edad62bc7 100644 + secondary->plat_data.split_mode = true; + } + - return component_add(dev, &rockchip_dp_component_ops); - } - -@@ -411,8 +630,7 @@ static int rockchip_dp_remove(struct platform_device *pdev) + ret = component_add(dev, &rockchip_dp_component_ops); + if (ret) + goto err_dp_remove; +@@ -419,8 +638,7 @@ static int rockchip_dp_remove(struct platform_device *pdev) return 0; } @@ -17530,7 +17292,7 @@ index ade2327a1..edad62bc7 100644 { struct rockchip_dp_device *dp = dev_get_drvdata(dev); -@@ -422,7 +640,7 @@ static int rockchip_dp_suspend(struct device *dev) +@@ -430,7 +648,7 @@ static int rockchip_dp_suspend(struct device *dev) return analogix_dp_suspend(dp->adp); } @@ -17539,7 +17301,7 @@ index ade2327a1..edad62bc7 100644 { struct rockchip_dp_device *dp = dev_get_drvdata(dev); -@@ -431,27 +649,49 @@ static int rockchip_dp_resume(struct device *dev) +@@ -439,27 +657,49 @@ static int rockchip_dp_resume(struct device *dev) return analogix_dp_resume(dp->adp); } @@ -17605,7 +17367,7 @@ index ade2327a1..edad62bc7 100644 static const struct of_device_id rockchip_dp_dt_ids[] = { diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c -index dec54c70e..261490fcb 100644 +index 857c47c69..e8ade3ffa 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -6,7 +6,6 @@ @@ -17683,7 +17445,7 @@ index dec54c70e..261490fcb 100644 static const struct drm_connector_funcs cdn_dp_atomic_connector_funcs = { .detect = cdn_dp_connector_detect, .destroy = cdn_dp_connector_destroy, -@@ -382,7 +365,6 @@ static int cdn_dp_get_sink_capability(struct cdn_dp_device *dp) +@@ -383,7 +366,6 @@ static int cdn_dp_get_sink_capability(struct cdn_dp_device *dp) static int cdn_dp_enable_phy(struct cdn_dp_device *dp, struct cdn_dp_port *port) { @@ -17691,7 +17453,7 @@ index dec54c70e..261490fcb 100644 int ret; if (!port->phy_enabled) { -@@ -409,15 +391,8 @@ static int cdn_dp_enable_phy(struct cdn_dp_device *dp, struct cdn_dp_port *port) +@@ -410,15 +392,8 @@ static int cdn_dp_enable_phy(struct cdn_dp_device *dp, struct cdn_dp_port *port) goto err_power_on; } @@ -17708,7 +17470,7 @@ index dec54c70e..261490fcb 100644 if (ret) { DRM_DEV_ERROR(dp->dev, "set host capabilities failed: %d\n", ret); -@@ -669,7 +644,7 @@ static void cdn_dp_encoder_disable(struct drm_encoder *encoder) +@@ -670,7 +645,7 @@ static void cdn_dp_encoder_disable(struct drm_encoder *encoder) * run the event_work to re-connect it. */ if (!dp->connected && cdn_dp_connected_port(dp)) @@ -17717,7 +17479,7 @@ index dec54c70e..261490fcb 100644 } static int cdn_dp_encoder_atomic_check(struct drm_encoder *encoder, -@@ -680,6 +655,7 @@ static int cdn_dp_encoder_atomic_check(struct drm_encoder *encoder, +@@ -681,6 +656,7 @@ static int cdn_dp_encoder_atomic_check(struct drm_encoder *encoder, s->output_mode = ROCKCHIP_OUT_MODE_AAAA; s->output_type = DRM_MODE_CONNECTOR_DisplayPort; @@ -17725,7 +17487,7 @@ index dec54c70e..261490fcb 100644 return 0; } -@@ -912,7 +888,7 @@ static int cdn_dp_request_firmware(struct cdn_dp_device *dp) +@@ -913,7 +889,7 @@ static int cdn_dp_request_firmware(struct cdn_dp_device *dp) static void cdn_dp_pd_event_work(struct work_struct *work) { @@ -17734,7 +17496,7 @@ index dec54c70e..261490fcb 100644 event_work); struct drm_connector *connector = &dp->connector; enum drm_connector_status old_status; -@@ -985,31 +961,13 @@ static void cdn_dp_pd_event_work(struct work_struct *work) +@@ -986,31 +962,13 @@ static void cdn_dp_pd_event_work(struct work_struct *work) drm_kms_helper_hotplug_event(dp->drm_dev); } @@ -17767,7 +17529,7 @@ index dec54c70e..261490fcb 100644 ret = cdn_dp_parse_dt(dp); if (ret < 0) -@@ -1021,12 +979,12 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data) +@@ -1022,12 +980,12 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data) dp->active_port = -1; dp->fw_loaded = false; @@ -17783,7 +17545,7 @@ index dec54c70e..261490fcb 100644 DRM_DEBUG_KMS("possible_crtcs = 0x%x\n", encoder->possible_crtcs); ret = drm_simple_encoder_init(drm_dev, encoder, -@@ -1058,23 +1016,14 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data) +@@ -1059,23 +1017,14 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data) goto err_free_connector; } @@ -17812,7 +17574,7 @@ index dec54c70e..261490fcb 100644 return 0; -@@ -1091,7 +1040,7 @@ static void cdn_dp_unbind(struct device *dev, struct device *master, void *data) +@@ -1092,7 +1041,7 @@ static void cdn_dp_unbind(struct device *dev, struct device *master, void *data) struct drm_encoder *encoder = &dp->encoder; struct drm_connector *connector = &dp->connector; @@ -17821,7 +17583,7 @@ index dec54c70e..261490fcb 100644 cdn_dp_encoder_disable(encoder); encoder->funcs->destroy(encoder); connector->funcs->destroy(connector); -@@ -1122,14 +1071,14 @@ static int cdn_dp_suspend(struct device *dev) +@@ -1123,14 +1072,14 @@ static int cdn_dp_suspend(struct device *dev) return ret; } @@ -17838,7 +17600,7 @@ index dec54c70e..261490fcb 100644 mutex_unlock(&dp->lock); return 0; -@@ -1142,7 +1091,6 @@ static int cdn_dp_probe(struct platform_device *pdev) +@@ -1143,7 +1092,6 @@ static int cdn_dp_probe(struct platform_device *pdev) struct cdn_dp_data *dp_data; struct cdn_dp_port *port; struct cdn_dp_device *dp; @@ -17846,7 +17608,7 @@ index dec54c70e..261490fcb 100644 struct phy *phy; int i; -@@ -1155,21 +1103,18 @@ static int cdn_dp_probe(struct platform_device *pdev) +@@ -1156,21 +1104,18 @@ static int cdn_dp_probe(struct platform_device *pdev) dp_data = (struct cdn_dp_data *)match->data; for (i = 0; i < dp_data->max_phy; i++) { @@ -17870,7 +17632,7 @@ index dec54c70e..261490fcb 100644 port->phy = phy; port->dp = dp; port->id = i; -@@ -1177,7 +1122,7 @@ static int cdn_dp_probe(struct platform_device *pdev) +@@ -1178,7 +1123,7 @@ static int cdn_dp_probe(struct platform_device *pdev) } if (!dp->ports) { @@ -25717,7 +25479,7 @@ index 7ffc541be..6a1d8e55b 100644 +void rockchip_gem_get_ddr_info(void); #endif /* _ROCKCHIP_DRM_GEM_H */ diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index 0f2314449..031de4f6b 100644 +index af98bfcde..7cafe8798 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -6,21 +6,28 @@ @@ -28198,12 +27960,17 @@ index 0f2314449..031de4f6b 100644 }; static int vop_crtc_enable_vblank(struct drm_crtc *crtc) -@@ -1120,8 +2360,13 @@ static int vop_crtc_enable_vblank(struct drm_crtc *crtc) - - spin_lock_irqsave(&vop->irq_lock, flags); +@@ -1115,281 +2355,1485 @@ static int vop_crtc_enable_vblank(struct drm_crtc *crtc) + struct vop *vop = to_vop(crtc); + unsigned long flags; -- VOP_INTR_SET_TYPE(vop, clear, FS_INTR, 1); -- VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 1); +- if (WARN_ON(!vop->is_enabled)) +- return -EPERM; ++ if (WARN_ON(!vop->is_enabled)) ++ return -EPERM; ++ ++ spin_lock_irqsave(&vop->irq_lock, flags); ++ + if (VOP_MAJOR(vop->version) == 3 && VOP_MINOR(vop->version) >= 7) { + VOP_INTR_SET_TYPE(vop, clear, FS_FIELD_INTR, 1); + VOP_INTR_SET_TYPE(vop, enable, FS_FIELD_INTR, 1); @@ -28211,93 +27978,56 @@ index 0f2314449..031de4f6b 100644 + VOP_INTR_SET_TYPE(vop, clear, FS_INTR, 1); + VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 1); + } - - spin_unlock_irqrestore(&vop->irq_lock, flags); - -@@ -1138,258 +2383,1457 @@ static void vop_crtc_disable_vblank(struct drm_crtc *crtc) - - spin_lock_irqsave(&vop->irq_lock, flags); - -- VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 0); ++ ++ spin_unlock_irqrestore(&vop->irq_lock, flags); ++ ++ return 0; ++} ++ ++static void vop_crtc_disable_vblank(struct drm_crtc *crtc) ++{ ++ struct vop *vop = to_vop(crtc); ++ unsigned long flags; ++ ++ if (WARN_ON(!vop->is_enabled)) ++ return; ++ ++ spin_lock_irqsave(&vop->irq_lock, flags); ++ + if (VOP_MAJOR(vop->version) == 3 && VOP_MINOR(vop->version) >= 7) + VOP_INTR_SET_TYPE(vop, enable, FS_FIELD_INTR, 0); + else + VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 0); - - spin_unlock_irqrestore(&vop->irq_lock, flags); - } - --static bool vop_crtc_mode_fixup(struct drm_crtc *crtc, -- const struct drm_display_mode *mode, -- struct drm_display_mode *adjusted_mode) ++ ++ spin_unlock_irqrestore(&vop->irq_lock, flags); ++} ++ +static void vop_crtc_cancel_pending_vblank(struct drm_crtc *crtc, + struct drm_file *file_priv) - { ++{ + struct drm_device *drm = crtc->dev; - struct vop *vop = to_vop(crtc); -- unsigned long rate; ++ struct vop *vop = to_vop(crtc); + struct drm_pending_vblank_event *e; + unsigned long flags; - -- /* -- * Clock craziness. -- * -- * Key points: -- * -- * - DRM works in in kHz. -- * - Clock framework works in Hz. -- * - Rockchip's clock driver picks the clock rate that is the -- * same _OR LOWER_ than the one requested. -- * -- * Action plan: -- * -- * 1. When DRM gives us a mode, we should add 999 Hz to it. That way -- * if the clock we need is 60000001 Hz (~60 MHz) and DRM tells us to -- * make 60000 kHz then the clock framework will actually give us -- * the right clock. -- * -- * NOTE: if the PLL (maybe through a divider) could actually make -- * a clock rate 999 Hz higher instead of the one we want then this -- * could be a problem. Unfortunately there's not much we can do -- * since it's baked into DRM to use kHz. It shouldn't matter in -- * practice since Rockchip PLLs are controlled by tables and -- * even if there is a divider in the middle I wouldn't expect PLL -- * rates in the table that are just a few kHz different. -- * -- * 2. Get the clock framework to round the rate for us to tell us -- * what it will actually make. -- * -- * 3. Store the rounded up rate so that we don't need to worry about -- * this in the actual clk_set_rate(). -- */ -- rate = clk_round_rate(vop->dclk, adjusted_mode->clock * 1000 + 999); -- adjusted_mode->clock = DIV_ROUND_UP(rate, 1000); ++ + spin_lock_irqsave(&drm->event_lock, flags); + e = vop->event; + if (e && e->base.file_priv == file_priv) { + vop->event = NULL; - -- return true; ++ + /* e->base.destroy(&e->base);//todo */ + file_priv->event_space += sizeof(e->event); + } + spin_unlock_irqrestore(&drm->event_lock, flags); - } - --static bool vop_dsp_lut_is_enabled(struct vop *vop) ++} ++ +static int vop_crtc_loader_protect(struct drm_crtc *crtc, bool on) - { -- return vop_read_reg(vop, 0, &vop->data->common->dsp_lut_en); --} ++{ + struct rockchip_drm_private *private = crtc->dev->dev_private; + struct vop *vop = to_vop(crtc); + int sys_status = drm_crtc_index(crtc) ? + SYS_STATUS_LCDC1 : SYS_STATUS_LCDC0; - --static void vop_crtc_write_gamma_lut(struct vop *vop, struct drm_crtc *crtc) --{ -- struct drm_color_lut *lut = crtc->state->gamma_lut->data; -- unsigned int i; ++ + if (on == vop->loader_protect) + return 0; + @@ -28315,36 +28045,24 @@ index 0f2314449..031de4f6b 100644 + vop->pll->use_count++; + } + } - -- for (i = 0; i < crtc->gamma_size; i++) { -- u32 word; ++ + rockchip_set_system_status(sys_status); + vop_initial(crtc); + drm_crtc_vblank_on(crtc); + vop->loader_protect = true; + } else { + vop_crtc_atomic_disable(crtc, NULL); - -- word = (drm_color_lut_extract(lut[i].red, 10) << 20) | -- (drm_color_lut_extract(lut[i].green, 10) << 10) | -- drm_color_lut_extract(lut[i].blue, 10); -- writel(word, vop->lut_regs + i * 4); ++ + if (vop->dclk_source && vop->pll) { + vop->pll->use_count--; + vop->pll = NULL; + } + vop->loader_protect = false; - } ++ } + + return 0; - } - --static void vop_crtc_gamma_set(struct vop *vop, struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) --{ -- struct drm_crtc_state *state = crtc->state; -- unsigned int idle; -- int ret; ++} ++ +#define DEBUG_PRINT(args...) \ + do { \ + if (s) \ @@ -28352,17 +28070,7 @@ index 0f2314449..031de4f6b 100644 + else \ + pr_err(args); \ + } while (0) - -- if (!vop->lut_regs) -- return; -- /* -- * To disable gamma (gamma_lut is null) or to write -- * an update to the LUT, clear dsp_lut_en. -- */ -- spin_lock(&vop->reg_lock); -- VOP_REG_SET(vop, common, dsp_lut_en, 0); -- vop_cfg_done(vop); -- spin_unlock(&vop->reg_lock); ++ +static int vop_plane_info_dump(struct seq_file *s, struct drm_plane *plane) +{ + struct vop_win *win = to_vop_win(plane); @@ -28382,16 +28090,7 @@ index 0f2314449..031de4f6b 100644 + state->crtc ? "ACTIVE" : "DISABLED"); + if (!fb) + return 0; - -- /* -- * In order to write the LUT to the internal memory, -- * we need to first make sure the dsp_lut_en bit is cleared. -- */ -- ret = readx_poll_timeout(vop_dsp_lut_is_enabled, vop, -- idle, !idle, 5, 30 * 1000); -- if (ret) { -- DRM_DEV_ERROR(vop->dev, "display LUT RAM enable timeout!\n"); -- return; ++ + src = &pstate->src; + dest = &pstate->dest; + @@ -28418,14 +28117,8 @@ index 0f2314449..031de4f6b 100644 + + DEBUG_PRINT("\tbuf[%d]: addr: %pad pitch: %d offset: %d\n", + i, &fb_addr, fb->pitches[i], fb->offsets[i]); - } - -- if (!state->gamma_lut) -- return; -- -- spin_lock(&vop->reg_lock); -- vop_crtc_write_gamma_lut(vop, crtc); -- VOP_REG_SET(vop, common, dsp_lut_en, 1); ++ } ++ + return 0; +} + @@ -28783,17 +28476,14 @@ index 0f2314449..031de4f6b 100644 + u32 val; + + VOP_CTRL_SET(vop, out_mode, mode); - vop_cfg_done(vop); -- spin_unlock(&vop->reg_lock); ++ vop_cfg_done(vop); + ret = readx_poll_timeout(vop_mode_done, vop, val, val == mode, + 1000, 500 * 1000); + if (ret) + dev_err(vop->dev, "wait mode 0x%x timeout\n", mode); + - } - --static void vop_crtc_atomic_begin(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) ++} ++ +static void vop_crtc_send_mcu_cmd(struct drm_crtc *crtc, u32 type, u32 value) +{ + struct rockchip_crtc_state *state; @@ -28839,8 +28529,8 @@ index 0f2314449..031de4f6b 100644 +} + +static int vop_crtc_wait_vact_end(struct drm_crtc *crtc, unsigned int mstimeout) - { - struct vop *vop = to_vop(crtc); ++{ ++ struct vop *vop = to_vop(crtc); + unsigned long jiffies_left; + int ret = 0; + @@ -28986,15 +28676,10 @@ index 0f2314449..031de4f6b 100644 + + VOP_CTRL_SET(vop, overlay_mode, s->yuv_overlay); + VOP_CTRL_SET(vop, dsp_out_yuv, is_yuv_output(s->bus_format)); - - /* -- * Only update GAMMA if the 'active' flag is not changed, -- * otherwise it's updated by .atomic_enable. ++ ++ /* + * Background color is 10bit depth if vop version >= 3.5 - */ -- if (crtc->state->color_mgmt_changed && -- !crtc->state->active_changed) -- vop_crtc_gamma_set(vop, crtc, old_crtc_state); ++ */ + if (!is_yuv_output(s->bus_format)) + val = 0; + else if (VOP_MAJOR(vop->version) == 3 && VOP_MINOR(vop->version) == 8 && @@ -29057,36 +28742,24 @@ index 0f2314449..031de4f6b 100644 + VOP_CTRL_SET(vop, mcu_cs_pend, vop->mcu_timing.mcu_cs_pend); + VOP_CTRL_SET(vop, mcu_rw_pst, vop->mcu_timing.mcu_rw_pst); + VOP_CTRL_SET(vop, mcu_rw_pend, vop->mcu_timing.mcu_rw_pend); - } - - static void vop_crtc_atomic_enable(struct drm_crtc *crtc, - struct drm_crtc_state *old_state) - { - struct vop *vop = to_vop(crtc); -- const struct vop_data *vop_data = vop->data; - struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state); - struct drm_display_mode *adjusted_mode = &crtc->state->adjusted_mode; -- u16 hsync_len = adjusted_mode->hsync_end - adjusted_mode->hsync_start; -- u16 hdisplay = adjusted_mode->hdisplay; -- u16 htotal = adjusted_mode->htotal; -- u16 hact_st = adjusted_mode->htotal - adjusted_mode->hsync_start; ++} ++ ++static void vop_crtc_atomic_enable(struct drm_crtc *crtc, ++ struct drm_crtc_state *old_state) ++{ ++ struct vop *vop = to_vop(crtc); ++ struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state); ++ struct drm_display_mode *adjusted_mode = &crtc->state->adjusted_mode; + u16 hsync_len = adjusted_mode->crtc_hsync_end - adjusted_mode->crtc_hsync_start; + u16 hdisplay = adjusted_mode->crtc_hdisplay; + u16 htotal = adjusted_mode->crtc_htotal; + u16 hact_st = adjusted_mode->crtc_htotal - adjusted_mode->crtc_hsync_start; - u16 hact_end = hact_st + hdisplay; -- u16 vdisplay = adjusted_mode->vdisplay; -- u16 vtotal = adjusted_mode->vtotal; -- u16 vsync_len = adjusted_mode->vsync_end - adjusted_mode->vsync_start; -- u16 vact_st = adjusted_mode->vtotal - adjusted_mode->vsync_start; ++ u16 hact_end = hact_st + hdisplay; + u16 vdisplay = adjusted_mode->crtc_vdisplay; + u16 vtotal = adjusted_mode->crtc_vtotal; + u16 vsync_len = adjusted_mode->crtc_vsync_end - adjusted_mode->crtc_vsync_start; + u16 vact_st = adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vsync_start; - u16 vact_end = vact_st + vdisplay; -- uint32_t pin_pol, val; -- int dither_bpc = s->output_bpc ? s->output_bpc : 10; -- int ret; ++ u16 vact_end = vact_st + vdisplay; + int sys_status = drm_crtc_index(crtc) ? + SYS_STATUS_LCDC1 : SYS_STATUS_LCDC0; + uint32_t val; @@ -29094,17 +28767,16 @@ index 0f2314449..031de4f6b 100644 + bool interlaced = !!(adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE); + int for_ddr_freq = 0; + bool dclk_inv, yc_swap = false; - - if (old_state && old_state->self_refresh_active) { - drm_crtc_vblank_on(crtc); -- rockchip_drm_set_win_enabled(crtc, true); ++ ++ if (old_state && old_state->self_refresh_active) { ++ drm_crtc_vblank_on(crtc); + if (vop->aclk_rate_reset) + clk_set_rate(vop->aclk, vop->aclk_rate); + vop->aclk_rate_reset = false; + - return; - } - ++ return; ++ } ++ + rockchip_set_system_status(sys_status); + vop_lock(vop); + DRM_DEV_INFO(vop->dev, "Update mode to %dx%d%s%d, type: %d\n", @@ -29116,29 +28788,17 @@ index 0f2314449..031de4f6b 100644 + s->mode_update = vop_crtc_mode_update(crtc); + if (s->mode_update) + vop_disable_all_planes(vop); - /* -- * If we have a GAMMA LUT in the state, then let's make sure -- * it's updated. We might be coming out of suspend, -- * which means the LUT internal memory needs to be re-written. ++ /* + * restore the lut table. - */ -- if (crtc->state->gamma_lut) -- vop_crtc_gamma_set(vop, crtc, old_state); ++ */ + if (vop->lut_active) + vop_crtc_load_lut(crtc); - -- mutex_lock(&vop->vop_lock); ++ + if (vop->mcu_timing.mcu_pix_total) + vop_mcu_mode(crtc); - -- WARN_ON(vop->event); ++ + dclk_inv = (s->bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE) ? 1 : 0; - -- ret = vop_enable(crtc, old_state); -- if (ret) { -- mutex_unlock(&vop->vop_lock); -- DRM_DEV_ERROR(vop->dev, "Failed to enable vop (%d)\n", ret); -- return; ++ + VOP_CTRL_SET(vop, dclk_pol, dclk_inv); + val = (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) ? + 0 : BIT(HSYNC_POSITIVE); @@ -29150,20 +28810,11 @@ index 0f2314449..031de4f6b 100644 + if (clk_set_parent(vop->dclk_source, vop->pll->pll)) + DRM_DEV_ERROR(vop->dev, + "failed to set dclk's parents\n"); - } -- pin_pol = (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) ? -- BIT(HSYNC_POSITIVE) : 0; -- pin_pol |= (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) ? -- BIT(VSYNC_POSITIVE) : 0; -- VOP_REG_SET(vop, output, pin_pol, pin_pol); -- VOP_REG_SET(vop, output, mipi_dual_channel_en, 0); - - switch (s->output_type) { ++ } ++ ++ switch (s->output_type) { + case DRM_MODE_CONNECTOR_DPI: - case DRM_MODE_CONNECTOR_LVDS: -- VOP_REG_SET(vop, output, rgb_dclk_pol, 1); -- VOP_REG_SET(vop, output, rgb_pin_pol, pin_pol); -- VOP_REG_SET(vop, output, rgb_en, 1); ++ case DRM_MODE_CONNECTOR_LVDS: + VOP_CTRL_SET(vop, rgb_en, 1); + VOP_CTRL_SET(vop, rgb_pin_pol, val); + VOP_CTRL_SET(vop, rgb_dclk_pol, dclk_inv); @@ -29179,29 +28830,18 @@ index 0f2314449..031de4f6b 100644 + } else if (s->output_if & VOP_OUTPUT_IF_BT656) { + VOP_CTRL_SET(vop, bt656_en, 1); + } - break; - case DRM_MODE_CONNECTOR_eDP: -- VOP_REG_SET(vop, output, edp_dclk_pol, 1); -- VOP_REG_SET(vop, output, edp_pin_pol, pin_pol); -- VOP_REG_SET(vop, output, edp_en, 1); ++ break; ++ case DRM_MODE_CONNECTOR_eDP: + VOP_CTRL_SET(vop, edp_en, 1); + VOP_CTRL_SET(vop, edp_pin_pol, val); + VOP_CTRL_SET(vop, edp_dclk_pol, dclk_inv); - break; - case DRM_MODE_CONNECTOR_HDMIA: -- VOP_REG_SET(vop, output, hdmi_dclk_pol, 1); -- VOP_REG_SET(vop, output, hdmi_pin_pol, pin_pol); -- VOP_REG_SET(vop, output, hdmi_en, 1); ++ break; ++ case DRM_MODE_CONNECTOR_HDMIA: + VOP_CTRL_SET(vop, hdmi_en, 1); + VOP_CTRL_SET(vop, hdmi_pin_pol, val); + VOP_CTRL_SET(vop, hdmi_dclk_pol, 1); - break; - case DRM_MODE_CONNECTOR_DSI: -- VOP_REG_SET(vop, output, mipi_dclk_pol, 1); -- VOP_REG_SET(vop, output, mipi_pin_pol, pin_pol); -- VOP_REG_SET(vop, output, mipi_en, 1); -- VOP_REG_SET(vop, output, mipi_dual_channel_en, -- !!(s->output_flags & ROCKCHIP_OUTPUT_DSI_DUAL)); ++ break; ++ case DRM_MODE_CONNECTOR_DSI: + VOP_CTRL_SET(vop, mipi_en, 1); + VOP_CTRL_SET(vop, mipi_pin_pol, val); + VOP_CTRL_SET(vop, mipi_dclk_pol, dclk_inv); @@ -29210,11 +28850,8 @@ index 0f2314449..031de4f6b 100644 + VOP_CTRL_SET(vop, data01_swap, + !!(s->output_flags & ROCKCHIP_OUTPUT_DATA_SWAP) || + vop->dual_channel_swap); - break; - case DRM_MODE_CONNECTOR_DisplayPort: -- VOP_REG_SET(vop, output, dp_dclk_pol, 0); -- VOP_REG_SET(vop, output, dp_pin_pol, pin_pol); -- VOP_REG_SET(vop, output, dp_en, 1); ++ break; ++ case DRM_MODE_CONNECTOR_DisplayPort: + VOP_CTRL_SET(vop, dp_dclk_pol, 0); + VOP_CTRL_SET(vop, dp_pin_pol, val); + VOP_CTRL_SET(vop, dp_en, 1); @@ -29232,12 +28869,10 @@ index 0f2314449..031de4f6b 100644 + VOP_CTRL_SET(vop, sw_genlock, 1); + VOP_CTRL_SET(vop, sw_uv_offset_en, 1); + VOP_CTRL_SET(vop, dither_up_en, 1); - break; - default: -- DRM_DEV_ERROR(vop->dev, "unsupported connector_type [%d]\n", -- s->output_type); ++ break; ++ default: + DRM_ERROR("unsupported connector_type[%d]\n", s->output_type); - } ++ } + vop_update_csc(crtc); + VOP_CTRL_SET(vop, htotal_pw, (htotal << 16) | hsync_len); + val = hact_st << 16; @@ -29498,17 +29133,23 @@ index 0f2314449..031de4f6b 100644 + pzpos = kmalloc_array(vop_data->win_size, sizeof(*pzpos), GFP_KERNEL); + if (!pzpos) + return -ENOMEM; -+ + +- spin_lock_irqsave(&vop->irq_lock, flags); + for (i = 0; i < vop_data->win_size; i++) { + const struct vop_win_data *win_data = &vop_data->win[i]; + struct vop_win *win; -+ + +- VOP_INTR_SET_TYPE(vop, clear, FS_INTR, 1); +- VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 1); + if (!win_data->phy) + continue; -+ + +- spin_unlock_irqrestore(&vop->irq_lock, flags); + for (j = 0; j < vop->num_wins; j++) { + win = &vop->win[j]; -+ + +- return 0; +-} + if (win->win_id == i && !win->area_id) + break; + } @@ -29516,7 +29157,11 @@ index 0f2314449..031de4f6b 100644 + ret = -EINVAL; + goto err_free_pzpos; + } -+ + +-static void vop_crtc_disable_vblank(struct drm_crtc *crtc) +-{ +- struct vop *vop = to_vop(crtc); +- unsigned long flags; + plane = &win->base; + pstate = state->planes[drm_plane_index(plane)].state; + /* @@ -29526,40 +29171,88 @@ index 0f2314449..031de4f6b 100644 + if (!pstate) + pstate = plane->state; + plane_state = to_vop_plane_state(pstate); -+ + +- if (WARN_ON(!vop->is_enabled)) +- return; + if (!pstate->visible) + pzpos[cnt].zpos = INT_MAX; + else + pzpos[cnt].zpos = plane_state->zpos; + pzpos[cnt++].win_id = win->win_id; + } -+ + +- spin_lock_irqsave(&vop->irq_lock, flags); + sort(pzpos, cnt, sizeof(pzpos[0]), vop_zpos_cmp, NULL); -+ + +- VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 0); + for (i = 0, cnt = 0; i < vop_data->win_size; i++) { + const struct vop_win_data *win_data = &vop_data->win[i]; + int shift = i * 2; -+ + +- spin_unlock_irqrestore(&vop->irq_lock, flags); +-} + if (win_data->phy) { + struct vop_zpos *zpos = &pzpos[cnt++]; -+ + +-static bool vop_crtc_mode_fixup(struct drm_crtc *crtc, +- const struct drm_display_mode *mode, +- struct drm_display_mode *adjusted_mode) +-{ +- struct vop *vop = to_vop(crtc); +- unsigned long rate; + dsp_layer_sel |= zpos->win_id << shift; + } else { + dsp_layer_sel |= i << shift; + } + } -+ + +- /* +- * Clock craziness. +- * +- * Key points: +- * +- * - DRM works in in kHz. +- * - Clock framework works in Hz. +- * - Rockchip's clock driver picks the clock rate that is the +- * same _OR LOWER_ than the one requested. +- * +- * Action plan: +- * +- * 1. When DRM gives us a mode, we should add 999 Hz to it. That way +- * if the clock we need is 60000001 Hz (~60 MHz) and DRM tells us to +- * make 60000 kHz then the clock framework will actually give us +- * the right clock. +- * +- * NOTE: if the PLL (maybe through a divider) could actually make +- * a clock rate 999 Hz higher instead of the one we want then this +- * could be a problem. Unfortunately there's not much we can do +- * since it's baked into DRM to use kHz. It shouldn't matter in +- * practice since Rockchip PLLs are controlled by tables and +- * even if there is a divider in the middle I wouldn't expect PLL +- * rates in the table that are just a few kHz different. +- * +- * 2. Get the clock framework to round the rate for us to tell us +- * what it will actually make. +- * +- * 3. Store the rounded up rate so that we don't need to worry about +- * this in the actual clk_set_rate(). +- */ +- rate = clk_round_rate(vop->dclk, adjusted_mode->clock * 1000 + 999); +- adjusted_mode->clock = DIV_ROUND_UP(rate, 1000); + s->dsp_layer_sel = dsp_layer_sel; -+ + +- return true; + vop_dclk_source_generate(crtc, crtc_state); + +err_free_pzpos: + kfree(pzpos); + return ret; -+} -+ + } + +-static bool vop_dsp_lut_is_enabled(struct vop *vop) +static void vop_post_config(struct drm_crtc *crtc) -+{ + { +- return vop_read_reg(vop, 0, &vop->data->common->dsp_lut_en); + struct vop *vop = to_vop(crtc); + struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state); + struct drm_display_mode *mode = &crtc->state->adjusted_mode; @@ -29602,19 +29295,28 @@ index 0f2314449..031de4f6b 100644 + val = vact_st_f1 << 16 | vact_end_f1; + VOP_CTRL_SET(vop, vpost_st_end_f1, val); + } -+} -+ + } + +-static void vop_crtc_write_gamma_lut(struct vop *vop, struct drm_crtc *crtc) +static void vop_update_hdr(struct drm_crtc *crtc, + struct drm_crtc_state *old_crtc_state) -+{ + { +- struct drm_color_lut *lut = crtc->state->gamma_lut->data; +- unsigned int i; + struct rockchip_crtc_state *s = + to_rockchip_crtc_state(crtc->state); + struct vop *vop = to_vop(crtc); + struct rockchip_sdr2hdr_state *sdr2hdr_state = &s->hdr.sdr2hdr_state; -+ + +- for (i = 0; i < crtc->gamma_size; i++) { +- u32 word; + if (!vop->data->hdr_table) + return; -+ + +- word = (drm_color_lut_extract(lut[i].red, 10) << 20) | +- (drm_color_lut_extract(lut[i].green, 10) << 10) | +- drm_color_lut_extract(lut[i].blue, 10); +- writel(word, vop->lut_regs + i * 4); + if (s->hdr.hdr2sdr_en) { + vop_load_hdr2sdr_table(vop); + /* This is ic design bug, when in hdr2sdr mode, the overlay mode @@ -29622,7 +29324,7 @@ index 0f2314449..031de4f6b 100644 + * we must close win0 y2r. + */ + VOP_CTRL_SET(vop, hdr2sdr_en_win0_csc, 0); -+ } + } + VOP_CTRL_SET(vop, hdr2sdr_en, s->hdr.hdr2sdr_en); + + VOP_CTRL_SET(vop, bt1886eotf_pre_conv_en, @@ -29648,11 +29350,16 @@ index 0f2314449..031de4f6b 100644 + sdr2hdr_state->bt1886eotf_post_conv_en) + vop_load_sdr2hdr_table(vop, sdr2hdr_state->sdr2hdr_func); + VOP_CTRL_SET(vop, win_csc_mode_sel, 1); -+} -+ + } + +-static void vop_crtc_gamma_set(struct vop *vop, struct drm_crtc *crtc, +- struct drm_crtc_state *old_state) +static void vop_tv_config_update(struct drm_crtc *crtc, + struct drm_crtc_state *old_crtc_state) -+{ + { +- struct drm_crtc_state *state = crtc->state; +- unsigned int idle; +- int ret; + struct rockchip_crtc_state *s = + to_rockchip_crtc_state(crtc->state); + struct rockchip_crtc_state *old_s = @@ -29660,12 +29367,22 @@ index 0f2314449..031de4f6b 100644 + int brightness, contrast, saturation, hue, sin_hue, cos_hue; + struct vop *vop = to_vop(crtc); + const struct vop_data *vop_data = vop->data; -+ + +- if (!vop->lut_regs) + if (!s->tv_state) -+ return; + return; +- /* +- * To disable gamma (gamma_lut is null) or to write +- * an update to the LUT, clear dsp_lut_en. +- */ +- spin_lock(&vop->reg_lock); +- VOP_REG_SET(vop, common, dsp_lut_en, 0); +- vop_cfg_done(vop); +- spin_unlock(&vop->reg_lock); /* -- * if vop is not support RGB10 output, need force RGB10 to RGB888. +- * In order to write the LUT to the internal memory, +- * we need to first make sure the dsp_lut_en bit is cleared. + * The BCSH only need to config once except one of the following + * condition changed: + * 1. tv_state: include brightness,contrast,saturation and hue; @@ -29674,14 +29391,15 @@ index 0f2314449..031de4f6b 100644 + * 4. bcsh_en: control the BCSH module enable or disable state; + * 5. bus_format: it is related to BCSH y2r module; */ -- if (s->output_mode == ROCKCHIP_OUT_MODE_AAAA && -- !(vop_data->feature & VOP_FEATURE_OUTPUT_RGB10)) -- s->output_mode = ROCKCHIP_OUT_MODE_P888; +- ret = readx_poll_timeout(vop_dsp_lut_is_enabled, vop, +- idle, !idle, 5, 30 * 1000); +- if (ret) { +- DRM_DEV_ERROR(vop->dev, "display LUT RAM enable timeout!\n"); + if (!memcmp(s->tv_state, + &vop->active_tv_state, sizeof(*s->tv_state)) && + s->yuv_overlay == old_s->yuv_overlay && s->mode_update && + s->bcsh_en == old_s->bcsh_en && s->bus_format == old_s->bus_format) -+ return; + return; + + memcpy(&vop->active_tv_state, s->tv_state, sizeof(*s->tv_state)); + /* post BCSH CSC */ @@ -29705,10 +29423,9 @@ index 0f2314449..031de4f6b 100644 + s->post_r2y_en = 1; + if (s->yuv_overlay && !is_yuv_output(s->bus_format)) + s->post_y2r_en = 1; -+ } + } -- if (s->output_mode == ROCKCHIP_OUT_MODE_AAAA && dither_bpc <= 8) -- VOP_REG_SET(vop, common, pre_dither_down, 1); +- if (!state->gamma_lut) + s->post_csc_mode = to_vop_csc_mode(s->color_space); + VOP_CTRL_SET(vop, bcsh_r2y_en, s->post_r2y_en); + VOP_CTRL_SET(vop, bcsh_y2r_en, s->post_y2r_en); @@ -29716,17 +29433,26 @@ index 0f2314449..031de4f6b 100644 + VOP_CTRL_SET(vop, bcsh_y2r_csc_mode, s->post_csc_mode); + if (!s->bcsh_en) { + VOP_CTRL_SET(vop, bcsh_en, s->bcsh_en); -+ return; + return; + } -+ + +- spin_lock(&vop->reg_lock); +- vop_crtc_write_gamma_lut(vop, crtc); +- VOP_REG_SET(vop, common, dsp_lut_en, 1); +- vop_cfg_done(vop); +- spin_unlock(&vop->reg_lock); +-} + if (vop_data->feature & VOP_FEATURE_OUTPUT_10BIT) + brightness = interpolate(0, -128, 100, 127, s->tv_state->brightness); + else if (VOP_MAJOR(vop->version) == 2 && VOP_MINOR(vop->version) == 6) /* px30 vopb */ + brightness = interpolate(0, -64, 100, 63, s->tv_state->brightness); - else -- VOP_REG_SET(vop, common, pre_dither_down, 0); ++ else + brightness = interpolate(0, -32, 100, 31, s->tv_state->brightness); -+ + +-static void vop_crtc_atomic_begin(struct drm_crtc *crtc, +- struct drm_crtc_state *old_crtc_state) +-{ +- struct vop *vop = to_vop(crtc); + if ((VOP_MAJOR(vop->version) == 3) || + (VOP_MAJOR(vop->version) == 2 && VOP_MINOR(vop->version) == 6)) { /* px30 vopb */ + contrast = interpolate(0, 0, 100, 511, s->tv_state->contrast); @@ -29744,12 +29470,14 @@ index 0f2314449..031de4f6b 100644 + cos_hue = fixp_cos32(hue) >> 23; + VOP_CTRL_SET(vop, bcsh_sat_con, saturation * contrast / 0x100); -- if (dither_bpc == 6) { -- VOP_REG_SET(vop, common, dither_down_sel, DITHER_DOWN_ALLEGRO); -- VOP_REG_SET(vop, common, dither_down_mode, RGB888_TO_RGB666); -- VOP_REG_SET(vop, common, dither_down_en, 1); - } else { -- VOP_REG_SET(vop, common, dither_down_en, 0); +- /* +- * Only update GAMMA if the 'active' flag is not changed, +- * otherwise it's updated by .atomic_enable. +- */ +- if (crtc->state->color_mgmt_changed && +- !crtc->state->active_changed) +- vop_crtc_gamma_set(vop, crtc, old_crtc_state); ++ } else { + contrast = interpolate(0, 0, 100, 255, s->tv_state->contrast); + saturation = interpolate(0, 0, 100, 255, s->tv_state->saturation); + /* @@ -29764,9 +29492,8 @@ index 0f2314449..031de4f6b 100644 + sin_hue = fixp_sin32(hue) >> 24; + cos_hue = fixp_cos32(hue) >> 24; + VOP_CTRL_SET(vop, bcsh_sat_con, saturation * contrast / 0x80); - } - -- VOP_REG_SET(vop, common, out_mode, s->output_mode); ++ } ++ + VOP_CTRL_SET(vop, bcsh_brightness, brightness); + VOP_CTRL_SET(vop, bcsh_contrast, contrast); + VOP_CTRL_SET(vop, bcsh_sin_hue, sin_hue); @@ -29775,39 +29502,113 @@ index 0f2314449..031de4f6b 100644 + if (VOP_MAJOR(vop->version) == 3 && VOP_MINOR(vop->version) == 0) + VOP_CTRL_SET(vop, auto_gate_en, 0); + VOP_CTRL_SET(vop, bcsh_en, s->bcsh_en); -+} + } -- VOP_REG_SET(vop, modeset, htotal_pw, (htotal << 16) | hsync_len); -- val = hact_st << 16; -- val |= hact_end; -- VOP_REG_SET(vop, modeset, hact_st_end, val); -- VOP_REG_SET(vop, modeset, hpost_st_end, val); +-static void vop_crtc_atomic_enable(struct drm_crtc *crtc, +- struct drm_crtc_state *old_state) +static void vop_cfg_update(struct drm_crtc *crtc, + struct drm_crtc_state *old_crtc_state) -+{ + { + struct rockchip_crtc_state *s = + to_rockchip_crtc_state(crtc->state); -+ struct vop *vop = to_vop(crtc); -+ const struct vop_data *vop_data = vop->data; + struct vop *vop = to_vop(crtc); + const struct vop_data *vop_data = vop->data; +- struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state); +- struct drm_display_mode *adjusted_mode = &crtc->state->adjusted_mode; +- u16 hsync_len = adjusted_mode->hsync_end - adjusted_mode->hsync_start; +- u16 hdisplay = adjusted_mode->hdisplay; +- u16 htotal = adjusted_mode->htotal; +- u16 hact_st = adjusted_mode->htotal - adjusted_mode->hsync_start; +- u16 hact_end = hact_st + hdisplay; +- u16 vdisplay = adjusted_mode->vdisplay; +- u16 vtotal = adjusted_mode->vtotal; +- u16 vsync_len = adjusted_mode->vsync_end - adjusted_mode->vsync_start; +- u16 vact_st = adjusted_mode->vtotal - adjusted_mode->vsync_start; +- u16 vact_end = vact_st + vdisplay; +- uint32_t pin_pol, val; +- int dither_bpc = s->output_bpc ? s->output_bpc : 10; +- int ret; +- +- if (old_state && old_state->self_refresh_active) { +- drm_crtc_vblank_on(crtc); +- rockchip_drm_set_win_enabled(crtc, true); +- return; +- } +- +- /* +- * If we have a GAMMA LUT in the state, then let's make sure +- * it's updated. We might be coming out of suspend, +- * which means the LUT internal memory needs to be re-written. +- */ +- if (crtc->state->gamma_lut) +- vop_crtc_gamma_set(vop, crtc, old_state); +- +- mutex_lock(&vop->vop_lock); -- VOP_REG_SET(vop, modeset, vtotal_pw, (vtotal << 16) | vsync_len); -- val = vact_st << 16; -- val |= vact_end; -- VOP_REG_SET(vop, modeset, vact_st_end, val); -- VOP_REG_SET(vop, modeset, vpost_st_end, val); +- WARN_ON(vop->event); + spin_lock(&vop->reg_lock); -- VOP_REG_SET(vop, intr, line_flag_num[0], vact_end); +- ret = vop_enable(crtc, old_state); +- if (ret) { +- mutex_unlock(&vop->vop_lock); +- DRM_DEV_ERROR(vop->dev, "Failed to enable vop (%d)\n", ret); +- return; +- } +- pin_pol = (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) ? +- BIT(HSYNC_POSITIVE) : 0; +- pin_pol |= (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) ? +- BIT(VSYNC_POSITIVE) : 0; +- VOP_REG_SET(vop, output, pin_pol, pin_pol); +- VOP_REG_SET(vop, output, mipi_dual_channel_en, 0); + vop_update_csc(crtc); -- clk_set_rate(vop->dclk, adjusted_mode->clock * 1000); +- switch (s->output_type) { +- case DRM_MODE_CONNECTOR_LVDS: +- VOP_REG_SET(vop, output, rgb_dclk_pol, 1); +- VOP_REG_SET(vop, output, rgb_pin_pol, pin_pol); +- VOP_REG_SET(vop, output, rgb_en, 1); +- break; +- case DRM_MODE_CONNECTOR_eDP: +- VOP_REG_SET(vop, output, edp_dclk_pol, 1); +- VOP_REG_SET(vop, output, edp_pin_pol, pin_pol); +- VOP_REG_SET(vop, output, edp_en, 1); +- break; +- case DRM_MODE_CONNECTOR_HDMIA: +- VOP_REG_SET(vop, output, hdmi_dclk_pol, 1); +- VOP_REG_SET(vop, output, hdmi_pin_pol, pin_pol); +- VOP_REG_SET(vop, output, hdmi_en, 1); +- break; +- case DRM_MODE_CONNECTOR_DSI: +- VOP_REG_SET(vop, output, mipi_dclk_pol, 1); +- VOP_REG_SET(vop, output, mipi_pin_pol, pin_pol); +- VOP_REG_SET(vop, output, mipi_en, 1); +- VOP_REG_SET(vop, output, mipi_dual_channel_en, +- !!(s->output_flags & ROCKCHIP_OUTPUT_DSI_DUAL)); +- break; +- case DRM_MODE_CONNECTOR_DisplayPort: +- VOP_REG_SET(vop, output, dp_dclk_pol, 0); +- VOP_REG_SET(vop, output, dp_pin_pol, pin_pol); +- VOP_REG_SET(vop, output, dp_en, 1); +- break; +- default: +- DRM_DEV_ERROR(vop->dev, "unsupported connector_type [%d]\n", +- s->output_type); +- } + vop_tv_config_update(crtc, old_crtc_state); -- VOP_REG_SET(vop, common, standby, 0); -- mutex_unlock(&vop->vop_lock); +- /* +- * if vop is not support RGB10 output, need force RGB10 to RGB888. +- */ +- if (s->output_mode == ROCKCHIP_OUT_MODE_AAAA && +- !(vop_data->feature & VOP_FEATURE_OUTPUT_RGB10)) +- s->output_mode = ROCKCHIP_OUT_MODE_P888; + if (s->afbdc_en) { + u32 pic_size, pic_offset; -+ + +- if (s->output_mode == ROCKCHIP_OUT_MODE_AAAA && dither_bpc <= 8) +- VOP_REG_SET(vop, common, pre_dither_down, 1); +- else +- VOP_REG_SET(vop, common, pre_dither_down, 0); + VOP_CTRL_SET(vop, afbdc_format, s->afbdc_win_format | 1 << 4); + VOP_CTRL_SET(vop, afbdc_hreg_block_split, 0); + VOP_CTRL_SET(vop, afbdc_sel, s->afbdc_win_id); @@ -29815,19 +29616,43 @@ index 0f2314449..031de4f6b 100644 + pic_size = (s->afbdc_win_width & 0xffff); + pic_size |= s->afbdc_win_height << 16; + VOP_CTRL_SET(vop, afbdc_pic_size, pic_size); -+ + +- if (dither_bpc == 6) { +- VOP_REG_SET(vop, common, dither_down_sel, DITHER_DOWN_ALLEGRO); +- VOP_REG_SET(vop, common, dither_down_mode, RGB888_TO_RGB666); +- VOP_REG_SET(vop, common, dither_down_en, 1); +- } else { +- VOP_REG_SET(vop, common, dither_down_en, 0); + VOP_CTRL_SET(vop, afbdc_pic_vir_width, s->afbdc_win_vir_width); + pic_offset = (s->afbdc_win_xoffset & 0xffff); + pic_offset |= s->afbdc_win_yoffset << 16; + VOP_CTRL_SET(vop, afbdc_pic_offset, pic_offset); -+ } -+ + } + +- VOP_REG_SET(vop, common, out_mode, s->output_mode); + VOP_CTRL_SET(vop, afbdc_en, s->afbdc_en); -+ + +- VOP_REG_SET(vop, modeset, htotal_pw, (htotal << 16) | hsync_len); +- val = hact_st << 16; +- val |= hact_end; +- VOP_REG_SET(vop, modeset, hact_st_end, val); +- VOP_REG_SET(vop, modeset, hpost_st_end, val); +- +- VOP_REG_SET(vop, modeset, vtotal_pw, (vtotal << 16) | vsync_len); +- val = vact_st << 16; +- val |= vact_end; +- VOP_REG_SET(vop, modeset, vact_st_end, val); +- VOP_REG_SET(vop, modeset, vpost_st_end, val); +- +- VOP_REG_SET(vop, intr, line_flag_num[0], vact_end); + VOP_CTRL_SET(vop, dsp_layer_sel, s->dsp_layer_sel); + if (vop_data->feature & VOP_FEATURE_OVERSCAN) + vop_post_config(crtc); -+ + +- clk_set_rate(vop->dclk, adjusted_mode->clock * 1000); +- +- VOP_REG_SET(vop, common, standby, 0); +- mutex_unlock(&vop->vop_lock); + spin_unlock(&vop->reg_lock); } @@ -29987,7 +29812,7 @@ index 0f2314449..031de4f6b 100644 .atomic_flush = vop_crtc_atomic_flush, .atomic_enable = vop_crtc_atomic_enable, .atomic_disable = vop_crtc_atomic_disable, -@@ -1526,11 +3962,33 @@ static void vop_crtc_destroy(struct drm_crtc *crtc) +@@ -1526,14 +3962,36 @@ static void vop_crtc_destroy(struct drm_crtc *crtc) drm_crtc_cleanup(crtc); } @@ -30017,13 +29842,16 @@ index 0f2314449..031de4f6b 100644 - struct rockchip_crtc_state *rockchip_state; + struct rockchip_crtc_state *rockchip_state, *old_state; + if (WARN_ON(!crtc->state)) + return NULL; + - rockchip_state = kzalloc(sizeof(*rockchip_state), GFP_KERNEL); + old_state = to_rockchip_crtc_state(crtc->state); + rockchip_state = kmemdup(old_state, sizeof(*old_state), GFP_KERNEL); if (!rockchip_state) return NULL; -@@ -1547,17 +4005,6 @@ static void vop_crtc_destroy_state(struct drm_crtc *crtc, +@@ -1550,17 +4008,6 @@ static void vop_crtc_destroy_state(struct drm_crtc *crtc, kfree(s); } @@ -30041,7 +29869,7 @@ index 0f2314449..031de4f6b 100644 #ifdef CONFIG_DRM_ANALOGIX_DP static struct drm_connector *vop_get_edp_connector(struct vop *vop) { -@@ -1623,18 +4070,116 @@ vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, +@@ -1626,18 +4073,116 @@ vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, } #endif @@ -30159,7 +29987,7 @@ index 0f2314449..031de4f6b 100644 }; static void vop_fb_unref_worker(struct drm_flip_work *work, void *val) -@@ -1642,115 +4187,368 @@ static void vop_fb_unref_worker(struct drm_flip_work *work, void *val) +@@ -1645,22 +4190,23 @@ static void vop_fb_unref_worker(struct drm_flip_work *work, void *val) struct vop *vop = container_of(work, struct vop, fb_unref_work); struct drm_framebuffer *fb = val; @@ -30184,60 +30012,42 @@ index 0f2314449..031de4f6b 100644 } - spin_unlock(&drm->event_lock); + spin_unlock_irqrestore(&drm->event_lock, flags); -+ -+ if (test_and_clear_bit(VOP_PENDING_FB_UNREF, &vop->pending)) -+ drm_flip_work_commit(&vop->fb_unref_work, system_unbound_wq); -+} -+ -+static irqreturn_t vop_isr(int irq, void *data) -+{ -+ struct vop *vop = data; + + if (test_and_clear_bit(VOP_PENDING_FB_UNREF, &vop->pending)) + drm_flip_work_commit(&vop->fb_unref_work, system_unbound_wq); +@@ -1669,8 +4215,9 @@ static void vop_handle_vblank(struct vop *vop) + static irqreturn_t vop_isr(int irq, void *data) + { + struct vop *vop = data; +- struct drm_crtc *crtc = &vop->crtc; + struct drm_crtc *crtc = &vop->rockchip_crtc.crtc; -+ uint32_t active_irqs; + uint32_t active_irqs; + unsigned long flags; -+ int ret = IRQ_NONE; -+ -+ /* -+ * The irq is shared with the iommu. If the runtime-pm state of the -+ * vop-device is disabled the irq has to be targeted at the iommu. -+ */ -+ if (!pm_runtime_get_if_in_use(vop->dev)) -+ return IRQ_NONE; -+ -+ if (vop_core_clks_enable(vop)) { -+ DRM_DEV_ERROR_RATELIMITED(vop->dev, "couldn't enable clocks\n"); -+ goto out; -+ } -+ -+ /* -+ * interrupt register has interrupt status, enable and clear bits, we -+ * must hold irq_lock to avoid a race with enable/disable_vblank(). -+ */ + int ret = IRQ_NONE; + + /* +@@ -1689,14 +4236,14 @@ static irqreturn_t vop_isr(int irq, void *data) + * interrupt register has interrupt status, enable and clear bits, we + * must hold irq_lock to avoid a race with enable/disable_vblank(). + */ +- spin_lock(&vop->irq_lock); + spin_lock_irqsave(&vop->irq_lock, flags); -+ -+ active_irqs = VOP_INTR_GET_TYPE(vop, status, INTR_MASK); -+ /* Clear all active interrupt sources */ -+ if (active_irqs) -+ VOP_INTR_SET_TYPE(vop, clear, active_irqs, 1); -+ + + active_irqs = VOP_INTR_GET_TYPE(vop, status, INTR_MASK); + /* Clear all active interrupt sources */ + if (active_irqs) + VOP_INTR_SET_TYPE(vop, clear, active_irqs, 1); + +- spin_unlock(&vop->irq_lock); + spin_unlock_irqrestore(&vop->irq_lock, flags); -+ -+ /* This is expected for vop iommu irqs, since the irq is shared */ -+ if (!active_irqs) -+ goto out_disable; -+ -+ if (active_irqs & DSP_HOLD_VALID_INTR) { -+ complete(&vop->dsp_hold_completion); -+ active_irqs &= ~DSP_HOLD_VALID_INTR; -+ ret = IRQ_HANDLED; -+ } -+ -+ if (active_irqs & LINE_FLAG_INTR) { -+ complete(&vop->line_flag_completion); -+ active_irqs &= ~LINE_FLAG_INTR; -+ ret = IRQ_HANDLED; -+ } -+ + + /* This is expected for vop iommu irqs, since the irq is shared */ + if (!active_irqs) +@@ -1714,17 +4261,41 @@ static irqreturn_t vop_isr(int irq, void *data) + ret = IRQ_HANDLED; + } + +- if (active_irqs & FS_INTR) { + if ((active_irqs & FS_INTR) || (active_irqs & FS_FIELD_INTR)) { + /* This is IC design not reasonable, this two register bit need + * frame effective, but actually it's effective immediately, so @@ -30247,12 +30057,13 @@ index 0f2314449..031de4f6b 100644 + VOP_CTRL_SET(vop, level2_overlay_en, vop->pre_overlay); + VOP_CTRL_SET(vop, alpha_hard_calc, vop->pre_overlay); + spin_unlock_irqrestore(&vop->irq_lock, flags); -+ drm_crtc_handle_vblank(crtc); -+ vop_handle_vblank(vop); + drm_crtc_handle_vblank(crtc); + vop_handle_vblank(vop); +- active_irqs &= ~FS_INTR; + active_irqs &= ~(FS_INTR | FS_FIELD_INTR); -+ ret = IRQ_HANDLED; -+ } -+ + ret = IRQ_HANDLED; + } + +#define ERROR_HANDLER(x) \ + do { \ + if (active_irqs & x##_INTR) {\ @@ -30270,31 +30081,37 @@ index 0f2314449..031de4f6b 100644 + ERROR_HANDLER(HWC_EMPTY); + ERROR_HANDLER(POST_BUF_EMPTY); + -+ /* Unhandled irqs are spurious. */ -+ if (active_irqs) + /* Unhandled irqs are spurious. */ + if (active_irqs) +- DRM_DEV_ERROR(vop->dev, "Unknown VOP IRQs: %#02x\n", +- active_irqs); + DRM_ERROR("Unknown VOP IRQs: %#02x\n", active_irqs); -+ -+out_disable: -+ vop_core_clks_disable(vop); -+out: -+ pm_runtime_put(vop->dev); -+ return ret; -+} -+ + + out_disable: + vop_core_clks_disable(vop); +@@ -1733,27 +4304,254 @@ static irqreturn_t vop_isr(int irq, void *data) + return ret; + } + +-static void vop_plane_add_properties(struct drm_plane *plane, +- const struct vop_win_data *win_data) +static void vop_plane_add_properties(struct vop *vop, + struct drm_plane *plane, + const struct vop_win *win) -+{ -+ unsigned int flags = 0; -+ + { + unsigned int flags = 0; + +- flags |= VOP_WIN_HAS_REG(win_data, x_mir_en) ? DRM_MODE_REFLECT_X : 0; +- flags |= VOP_WIN_HAS_REG(win_data, y_mir_en) ? DRM_MODE_REFLECT_Y : 0; + flags |= (VOP_WIN_SUPPORT(vop, win, xmirror)) ? DRM_MODE_REFLECT_X : 0; + flags |= (VOP_WIN_SUPPORT(vop, win, ymirror)) ? DRM_MODE_REFLECT_Y : 0; + -+ if (flags) -+ drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0, -+ DRM_MODE_ROTATE_0 | flags); -+} -+ + if (flags) + drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0, + DRM_MODE_ROTATE_0 | flags); + } + +-static int vop_create_crtc(struct vop *vop) +static int vop_plane_create_name_property(struct vop *vop, struct vop_win *win) +{ + struct drm_prop_enum_list *props = vop->plane_name_list; @@ -30391,9 +30208,7 @@ index 0f2314449..031de4f6b 100644 + DRM_ERROR("failed to create property\n"); + return -ENOMEM; + } - -- if (test_and_clear_bit(VOP_PENDING_FB_UNREF, &vop->pending)) -- drm_flip_work_commit(&vop->fb_unref_work, system_unbound_wq); ++ + drm_object_attach_property(&win->base.base, win->input_width_prop, 0); + drm_object_attach_property(&win->base.base, win->input_height_prop, 0); + drm_object_attach_property(&win->base.base, win->output_width_prop, 0); @@ -30402,34 +30217,20 @@ index 0f2314449..031de4f6b 100644 + drm_object_attach_property(&win->base.base, win->color_key_prop, 0); + + return 0; - } - --static irqreturn_t vop_isr(int irq, void *data) ++} ++ +static int vop_of_init_display_lut(struct vop *vop) - { -- struct vop *vop = data; -- struct drm_crtc *crtc = &vop->crtc; -- uint32_t active_irqs; -- int ret = IRQ_NONE; ++{ + struct device_node *node = vop->dev->of_node; + struct device_node *dsp_lut; + u32 lut_len = vop->lut_len; + struct property *prop; + int length, i, j; + int ret; - -- /* -- * The irq is shared with the iommu. If the runtime-pm state of the -- * vop-device is disabled the irq has to be targeted at the iommu. -- */ -- if (!pm_runtime_get_if_in_use(vop->dev)) -- return IRQ_NONE; ++ + if (!vop->lut) + return -ENOMEM; - -- if (vop_core_clks_enable(vop)) { -- DRM_DEV_ERROR_RATELIMITED(vop->dev, "couldn't enable clocks\n"); -- goto out; ++ + dsp_lut = of_parse_phandle(node, "dsp-lut", 0); + if (!dsp_lut) + return -ENXIO; @@ -30438,24 +30239,14 @@ index 0f2314449..031de4f6b 100644 + if (!prop) { + dev_err(vop->dev, "failed to find gamma_lut\n"); + return -ENXIO; - } - -- /* -- * interrupt register has interrupt status, enable and clear bits, we -- * must hold irq_lock to avoid a race with enable/disable_vblank(). -- */ -- spin_lock(&vop->irq_lock); ++ } ++ + length >>= 2; - -- active_irqs = VOP_INTR_GET_TYPE(vop, status, INTR_MASK); -- /* Clear all active interrupt sources */ -- if (active_irqs) -- VOP_INTR_SET_TYPE(vop, clear, active_irqs, 1); ++ + if (length != lut_len) { + u32 r, g, b; + u32 *lut = kmalloc_array(length, sizeof(*lut), GFP_KERNEL); - -- spin_unlock(&vop->irq_lock); ++ + if (!lut) + return -ENOMEM; + ret = of_property_read_u32_array(dsp_lut, "gamma-lut", lut, @@ -30465,40 +30256,23 @@ index 0f2314449..031de4f6b 100644 + kfree(lut); + return -EINVAL; + } - -- /* This is expected for vop iommu irqs, since the irq is shared */ -- if (!active_irqs) -- goto out_disable; ++ + for (i = 0; i < lut_len; i++) { + j = i * length / lut_len; + r = lut[j] / length / length * lut_len / length; + g = lut[j] / length % length * lut_len / length; + b = lut[j] % length * lut_len / length; - -- if (active_irqs & DSP_HOLD_VALID_INTR) { -- complete(&vop->dsp_hold_completion); -- active_irqs &= ~DSP_HOLD_VALID_INTR; -- ret = IRQ_HANDLED; -- } ++ + vop->lut[i] = r * lut_len * lut_len + g * lut_len + b; + } - -- if (active_irqs & LINE_FLAG_INTR) { -- complete(&vop->line_flag_completion); -- active_irqs &= ~LINE_FLAG_INTR; -- ret = IRQ_HANDLED; ++ + kfree(lut); + } else { + of_property_read_u32_array(dsp_lut, "gamma-lut", + vop->lut, vop->lut_len); - } ++ } + vop->lut_active = true; - -- if (active_irqs & FS_INTR) { -- drm_crtc_handle_vblank(crtc); -- vop_handle_vblank(vop); -- active_irqs &= ~FS_INTR; -- ret = IRQ_HANDLED; ++ + return 0; +} + @@ -30520,35 +30294,18 @@ index 0f2314449..031de4f6b 100644 + if (!prop) { + DRM_DEV_ERROR(vop->dev, "create plane_mask prop for vp%d failed\n", vop->id); + return -ENOMEM; - } - -- /* Unhandled irqs are spurious. */ -- if (active_irqs) -- DRM_DEV_ERROR(vop->dev, "Unknown VOP IRQs: %#02x\n", -- active_irqs); ++ } ++ + vop->plane_mask_prop = prop; + drm_object_attach_property(&crtc->base, vop->plane_mask_prop, vop->plane_mask); - --out_disable: -- vop_core_clks_disable(vop); --out: -- pm_runtime_put(vop->dev); -- return ret; ++ + return 0; - } - --static void vop_plane_add_properties(struct drm_plane *plane, -- const struct vop_win_data *win_data) ++} ++ +static int vop_crtc_create_feature_property(struct vop *vop, struct drm_crtc *crtc) { -- unsigned int flags = 0; -+ const struct vop_data *vop_data = vop->data; - -- flags |= VOP_WIN_HAS_REG(win_data, x_mir_en) ? DRM_MODE_REFLECT_X : 0; -- flags |= VOP_WIN_HAS_REG(win_data, y_mir_en) ? DRM_MODE_REFLECT_Y : 0; -- if (flags) -- drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0, -- DRM_MODE_ROTATE_0 | flags); + const struct vop_data *vop_data = vop->data; ++ + struct drm_property *prop; + u64 feature = 0; + @@ -30578,11 +30335,10 @@ index 0f2314449..031de4f6b 100644 + drm_object_attach_property(&crtc->base, vop->feature_prop, feature); + + return 0; - } - - static int vop_create_crtc(struct vop *vop) - { -- const struct vop_data *vop_data = vop->data; ++} ++ ++static int vop_create_crtc(struct vop *vop) ++{ struct device *dev = vop->dev; struct drm_device *drm_dev = vop->drm_dev; + struct rockchip_drm_private *private = drm_dev->dev_private; @@ -30595,7 +30351,7 @@ index 0f2314449..031de4f6b 100644 int i; /* -@@ -1758,29 +4556,19 @@ static int vop_create_crtc(struct vop *vop) +@@ -1761,29 +4559,19 @@ static int vop_create_crtc(struct vop *vop) * to pass them to drm_crtc_init_with_planes, which sets the * "possible_crtcs" to the newly initialized crtc. */ @@ -30632,7 +30388,7 @@ index 0f2314449..031de4f6b 100644 if (plane->type == DRM_PLANE_TYPE_PRIMARY) primary = plane; else if (plane->type == DRM_PLANE_TYPE_CURSOR) -@@ -1793,37 +4581,23 @@ static int vop_create_crtc(struct vop *vop) +@@ -1796,37 +4584,23 @@ static int vop_create_crtc(struct vop *vop) goto err_cleanup_planes; drm_crtc_helper_add(crtc, &vop_crtc_helper_funcs); @@ -30676,7 +30432,7 @@ index 0f2314449..031de4f6b 100644 } port = of_get_child_by_name(dev->of_node, "port"); -@@ -1840,15 +4614,65 @@ static int vop_create_crtc(struct vop *vop) +@@ -1843,15 +4617,65 @@ static int vop_create_crtc(struct vop *vop) init_completion(&vop->dsp_hold_completion); init_completion(&vop->line_flag_completion); crtc->port = port; @@ -30745,7 +30501,7 @@ index 0f2314449..031de4f6b 100644 err_cleanup_crtc: drm_crtc_cleanup(crtc); err_cleanup_planes: -@@ -1860,7 +4684,7 @@ static int vop_create_crtc(struct vop *vop) +@@ -1863,7 +4687,7 @@ static int vop_create_crtc(struct vop *vop) static void vop_destroy_crtc(struct vop *vop) { @@ -30754,7 +30510,7 @@ index 0f2314449..031de4f6b 100644 struct drm_device *drm_dev = vop->drm_dev; struct drm_plane *plane, *tmp; -@@ -1888,187 +4712,130 @@ static void vop_destroy_crtc(struct vop *vop) +@@ -1891,187 +4715,130 @@ static void vop_destroy_crtc(struct vop *vop) drm_flip_work_cleanup(&vop->fb_unref_work); } @@ -31039,7 +30795,7 @@ index 0f2314449..031de4f6b 100644 static int vop_bind(struct device *dev, struct device *master, void *data) { -@@ -2077,46 +4844,97 @@ static int vop_bind(struct device *dev, struct device *master, void *data) +@@ -2080,46 +4847,97 @@ static int vop_bind(struct device *dev, struct device *master, void *data) struct drm_device *drm_dev = data; struct vop *vop; struct resource *res; @@ -31084,7 +30840,6 @@ index 0f2314449..031de4f6b 100644 + return ret; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- vop->len = resource_size(res); + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); + if (!res) { + dev_warn(vop->dev, "failed to get vop register byname\n"); @@ -31093,13 +30848,13 @@ index 0f2314449..031de4f6b 100644 vop->regs = devm_ioremap_resource(dev, res); if (IS_ERR(vop->regs)) return PTR_ERR(vop->regs); -+ vop->len = resource_size(res); -+ + vop->len = resource_size(res); + +- res = platform_get_resource(pdev, IORESOURCE_MEM, 1); + vop->regsbak = devm_kzalloc(dev, vop->len, GFP_KERNEL); + if (!vop->regsbak) + return -ENOMEM; - -- res = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gamma_lut"); if (res) { - if (!vop_data->lut_size) { @@ -31151,7 +30906,7 @@ index 0f2314449..031de4f6b 100644 irq = platform_get_irq(pdev, 0); if (irq < 0) { DRM_DEV_ERROR(dev, "cannot find irq for vop\n"); -@@ -2128,53 +4946,51 @@ static int vop_bind(struct device *dev, struct device *master, void *data) +@@ -2131,53 +4949,51 @@ static int vop_bind(struct device *dev, struct device *master, void *data) spin_lock_init(&vop->irq_lock); mutex_init(&vop->vop_lock); @@ -34366,7 +34121,7 @@ index 27b963512..8973232e0 100644 return NULL; } diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -index a6fe03c37..e9b605337 100644 +index 39e1e1ebe..e9b605337 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -5,36 +5,36 @@ @@ -35468,7 +35223,7 @@ index a6fe03c37..e9b605337 100644 .act_info = VOP_REG(RK3288_WIN0_ACT_INFO, 0x1fff1fff, 0), .dsp_info = VOP_REG(RK3288_WIN0_DSP_INFO, 0x0fff0fff, 0), .dsp_st = VOP_REG(RK3288_WIN0_DSP_ST, 0x1fff1fff, 0), -@@ -597,476 +675,1318 @@ static const struct vop_win_phy rk3288_win01_data = { +@@ -597,478 +675,1318 @@ static const struct vop_win_phy rk3288_win01_data = { .uv_mst = VOP_REG(RK3288_WIN0_CBR_MST, 0xffffffff, 0), .yrgb_vir = VOP_REG(RK3288_WIN0_VIR, 0x3fff, 0), .uv_vir = VOP_REG(RK3288_WIN0_VIR, 0x3fff, 16), @@ -36221,15 +35976,23 @@ index a6fe03c37..e9b605337 100644 + .type = DRM_PLANE_TYPE_PRIMARY }, + { .base = 0x00, .phy = &rk3036_win1_data, + .type = DRM_PLANE_TYPE_OVERLAY }, -+}; -+ + }; + +-static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win23_data = { }; +static const int rk3036_vop_intrs[] = { + DSP_HOLD_VALID_INTR, + FS_INTR, + LINE_FLAG_INTR, + BUS_ERROR_INTR, +}; -+ + +-static const struct vop_win_yuv2yuv_data rk3399_vop_big_win_yuv2yuv_data[] = { +- { .base = 0x00, .phy = &rk3399_yuv2yuv_win01_data, +- .y2r_en = VOP_REG(RK3399_YUV2YUV_WIN, 0x1, 1) }, +- { .base = 0x60, .phy = &rk3399_yuv2yuv_win01_data, +- .y2r_en = VOP_REG(RK3399_YUV2YUV_WIN, 0x1, 9) }, +- { .base = 0xC0, .phy = &rk3399_yuv2yuv_win23_data }, +- { .base = 0x120, .phy = &rk3399_yuv2yuv_win23_data }, +static const struct vop_intr rk3036_intr = { + .intrs = rk3036_vop_intrs, + .nintrs = ARRAY_SIZE(rk3036_vop_intrs), @@ -36237,9 +36000,8 @@ index a6fe03c37..e9b605337 100644 + .status = VOP_REG(RK3036_INT_STATUS, 0xf, 0), + .enable = VOP_REG(RK3036_INT_STATUS, 0xf, 4), + .clear = VOP_REG(RK3036_INT_STATUS, 0xf, 8), - }; - --static const struct vop_yuv2yuv_phy rk3399_yuv2yuv_win23_data = { }; ++}; ++ +static const struct vop_ctrl rk3036_ctrl_data = { + .standby = VOP_REG(RK3036_SYS_CTRL, 0x1, 30), + .out_mode = VOP_REG(RK3036_DSP_CTRL0, 0xf, 0), @@ -36267,13 +36029,6 @@ index a6fe03c37..e9b605337 100644 + .cfg_done = VOP_REG(RK3036_REG_CFG_DONE, 0x1, 0), +}; --static const struct vop_win_yuv2yuv_data rk3399_vop_big_win_yuv2yuv_data[] = { -- { .base = 0x00, .phy = &rk3399_yuv2yuv_win01_data, -- .y2r_en = VOP_REG(RK3399_YUV2YUV_WIN, 0x1, 1) }, -- { .base = 0x60, .phy = &rk3399_yuv2yuv_win01_data, -- .y2r_en = VOP_REG(RK3399_YUV2YUV_WIN, 0x1, 9) }, -- { .base = 0xC0, .phy = &rk3399_yuv2yuv_win23_data }, -- { .base = 0x120, .phy = &rk3399_yuv2yuv_win23_data }, +static const struct vop_data rk3036_vop = { + .soc_id = 0x3036, + .vop_id = 0, @@ -36284,17 +36039,17 @@ index a6fe03c37..e9b605337 100644 + .intr = &rk3036_intr, + .win = rk3036_vop_win_data, + .win_size = ARRAY_SIZE(rk3036_vop_win_data), -+}; + }; +-static const struct vop_win_phy rk3399_win01_data = { +- .scl = &rk3288_win_full_scl, +static const struct vop_scl_regs rk3066_win_scl = { + .scale_yrgb_x = VOP_REG(RK3066_WIN0_SCL_FACTOR_YRGB, 0xffff, 0x0), + .scale_yrgb_y = VOP_REG(RK3066_WIN0_SCL_FACTOR_YRGB, 0xffff, 16), + .scale_cbcr_x = VOP_REG(RK3066_WIN0_SCL_FACTOR_CBR, 0xffff, 0x0), + .scale_cbcr_y = VOP_REG(RK3066_WIN0_SCL_FACTOR_CBR, 0xffff, 16), - }; - --static const struct vop_win_phy rk3399_win01_data = { -- .scl = &rk3288_win_full_scl, ++}; ++ +static const struct vop_win_phy rk3066_win0_data = { + .scl = &rk3066_win_scl, .data_formats = formats_win_full, @@ -36303,6 +36058,7 @@ index a6fe03c37..e9b605337 100644 - .enable = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 0), - .format = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 1), - .rb_swap = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 12), +- .x_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 21), - .y_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 22), - .act_info = VOP_REG(RK3288_WIN0_ACT_INFO, 0x1fff1fff, 0), - .dsp_info = VOP_REG(RK3288_WIN0_DSP_INFO, 0x0fff0fff, 0), @@ -36313,6 +36069,7 @@ index a6fe03c37..e9b605337 100644 - .uv_vir = VOP_REG(RK3288_WIN0_VIR, 0x3fff, 16), - .src_alpha_ctl = VOP_REG(RK3288_WIN0_SRC_ALPHA_CTRL, 0xff, 0), - .dst_alpha_ctl = VOP_REG(RK3288_WIN0_DST_ALPHA_CTRL, 0xff, 0), +- .channel = VOP_REG(RK3288_WIN0_CTRL2, 0xff, 0), + .enable = VOP_REG(RK3066_SYS_CTRL1, 0x1, 0), + .format = VOP_REG(RK3066_SYS_CTRL0, 0x7, 4), + .rb_swap = VOP_REG(RK3066_SYS_CTRL0, 0x1, 19), @@ -36369,12 +36126,12 @@ index a6fe03c37..e9b605337 100644 +static const struct vop_win_data rk3066_vop_win_data[] = { + { .base = 0x00, .phy = &rk3066_win0_data, .type = DRM_PLANE_TYPE_PRIMARY }, -- { .base = 0x40, .phy = &rk3288_win01_data, +- { .base = 0x40, .phy = &rk3368_win01_data, - .type = DRM_PLANE_TYPE_OVERLAY }, -- { .base = 0x00, .phy = &rk3288_win23_data, +- { .base = 0x00, .phy = &rk3368_win23_data, + { .base = 0x00, .phy = &rk3066_win1_data, .type = DRM_PLANE_TYPE_OVERLAY }, -- { .base = 0x50, .phy = &rk3288_win23_data, +- { .base = 0x50, .phy = &rk3368_win23_data, + { .base = 0x00, .phy = &rk3066_win2_data, .type = DRM_PLANE_TYPE_CURSOR }, }; @@ -38710,7 +38467,7 @@ index 02ddb237f..0b3adca2e 100644 MODULE_DESCRIPTION("Rockchip RK3xxx I2C Bus driver"); MODULE_AUTHOR("Max Schwarz "); diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c -index bdce6d3e5..c0315596d 100644 +index 34fecf97a..d041b7fa5 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -61,6 +61,7 @@ @@ -39201,7 +38958,7 @@ index d1539b739..d5020a729 100644 switch (dir) { case DMA_BIDIRECTIONAL: diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c -index bcf060b5c..c8605ebc0 100644 +index 9d65557df..abf1b1e6c 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -8,6 +8,7 @@ @@ -39212,7 +38969,7 @@ index bcf060b5c..c8605ebc0 100644 #include #include #include -@@ -2198,7 +2199,8 @@ void iommu_detach_device(struct iommu_domain *domain, struct device *dev) +@@ -2203,7 +2204,8 @@ void iommu_detach_device(struct iommu_domain *domain, struct device *dev) return; mutex_lock(&group->mutex); @@ -39222,7 +38979,7 @@ index bcf060b5c..c8605ebc0 100644 WARN_ON(1); goto out_unlock; } -@@ -2332,38 +2334,85 @@ phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova) +@@ -2337,38 +2339,85 @@ phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova) } EXPORT_SYMBOL_GPL(iommu_iova_to_phys); @@ -39329,7 +39086,7 @@ index bcf060b5c..c8605ebc0 100644 static int __iommu_map(struct iommu_domain *domain, unsigned long iova, phys_addr_t paddr, size_t size, int prot, gfp_t gfp) { -@@ -2374,7 +2423,7 @@ static int __iommu_map(struct iommu_domain *domain, unsigned long iova, +@@ -2379,7 +2428,7 @@ static int __iommu_map(struct iommu_domain *domain, unsigned long iova, phys_addr_t orig_paddr = paddr; int ret = 0; @@ -39338,7 +39095,7 @@ index bcf060b5c..c8605ebc0 100644 domain->pgsize_bitmap == 0UL)) return -ENODEV; -@@ -2398,18 +2447,21 @@ static int __iommu_map(struct iommu_domain *domain, unsigned long iova, +@@ -2403,18 +2452,21 @@ static int __iommu_map(struct iommu_domain *domain, unsigned long iova, pr_debug("map: iova 0x%lx pa %pa size 0x%zx\n", iova, &paddr, size); while (size) { @@ -39367,7 +39124,7 @@ index bcf060b5c..c8605ebc0 100644 } /* unroll mapping in case something went wrong */ -@@ -2429,7 +2481,7 @@ static int _iommu_map(struct iommu_domain *domain, unsigned long iova, +@@ -2434,7 +2486,7 @@ static int _iommu_map(struct iommu_domain *domain, unsigned long iova, ret = __iommu_map(domain, iova, paddr, size, prot, gfp); if (ret == 0 && ops->iotlb_sync_map) @@ -39376,7 +39133,7 @@ index bcf060b5c..c8605ebc0 100644 return ret; } -@@ -2449,6 +2501,19 @@ int iommu_map_atomic(struct iommu_domain *domain, unsigned long iova, +@@ -2454,6 +2506,19 @@ int iommu_map_atomic(struct iommu_domain *domain, unsigned long iova, } EXPORT_SYMBOL_GPL(iommu_map_atomic); @@ -39396,7 +39153,7 @@ index bcf060b5c..c8605ebc0 100644 static size_t __iommu_unmap(struct iommu_domain *domain, unsigned long iova, size_t size, struct iommu_iotlb_gather *iotlb_gather) -@@ -2458,7 +2523,7 @@ static size_t __iommu_unmap(struct iommu_domain *domain, +@@ -2463,7 +2528,7 @@ static size_t __iommu_unmap(struct iommu_domain *domain, unsigned long orig_iova = iova; unsigned int min_pagesz; @@ -39405,7 +39162,7 @@ index bcf060b5c..c8605ebc0 100644 domain->pgsize_bitmap == 0UL)) return 0; -@@ -2486,9 +2551,9 @@ static size_t __iommu_unmap(struct iommu_domain *domain, +@@ -2491,9 +2556,9 @@ static size_t __iommu_unmap(struct iommu_domain *domain, * or we hit an area that isn't mapped. */ while (unmapped < size) { @@ -39418,7 +39175,7 @@ index bcf060b5c..c8605ebc0 100644 if (!unmapped_page) break; -@@ -2535,6 +2600,18 @@ static size_t __iommu_map_sg(struct iommu_domain *domain, unsigned long iova, +@@ -2540,6 +2605,18 @@ static size_t __iommu_map_sg(struct iommu_domain *domain, unsigned long iova, unsigned int i = 0; int ret; @@ -39437,7 +39194,7 @@ index bcf060b5c..c8605ebc0 100644 while (i <= nents) { phys_addr_t s_phys = sg_phys(sg); -@@ -2561,7 +2638,13 @@ static size_t __iommu_map_sg(struct iommu_domain *domain, unsigned long iova, +@@ -2566,7 +2643,13 @@ static size_t __iommu_map_sg(struct iommu_domain *domain, unsigned long iova, } if (ops->iotlb_sync_map) @@ -40612,10 +40369,10 @@ index e5d86b717..b359fcf2c 100644 +MODULE_ALIAS("platform:rockchip-iommu"); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig -index dc062e8c2..122f81a09 100644 +index 3c24bf452..ddcd884d1 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig -@@ -416,8 +416,9 @@ config IRQ_UNIPHIER_AIDET +@@ -417,8 +417,9 @@ config IRQ_UNIPHIER_AIDET Support for the UniPhier AIDET (ARM Interrupt Detector). config MESON_IRQ_GPIO @@ -40811,7 +40568,7 @@ index 42b295337..1f17875da 100644 if (!(tmp & GITS_CBASER_SHAREABILITY_MASK)) { /* diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c -index 1bdb7acf4..0145d142b 100644 +index 4c8f18f0c..e3c45597b 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -18,6 +18,9 @@ @@ -40832,7 +40589,7 @@ index 1bdb7acf4..0145d142b 100644 gic_deactivate_unhandled(irqnr); } } -@@ -1309,6 +1313,27 @@ static void gic_cpu_pm_init(void) +@@ -1325,6 +1329,27 @@ static void gic_cpu_pm_init(void) static inline void gic_cpu_pm_init(void) { } #endif /* CONFIG_CPU_PM */ @@ -40860,7 +40617,7 @@ index 1bdb7acf4..0145d142b 100644 static struct irq_chip gic_chip = { .name = "GICv3", .irq_mask = gic_mask_irq, -@@ -1765,6 +1790,7 @@ static int __init gic_init_bases(void __iomem *dist_base, +@@ -1787,6 +1812,7 @@ static int __init gic_init_bases(void __iomem *dist_base, gic_cpu_init(); gic_smp_init(); gic_cpu_pm_init(); @@ -42716,10 +42473,10 @@ index d109b9f14..fd755d98a 100644 MODULE_LICENSE("GPL"); MODULE_AUTHOR("Chris Zhong "); diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c -index 99b981a05..ea72d4a42 100644 +index 66a00b7c7..e3f6efb81 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c -@@ -2893,6 +2893,9 @@ static void mmc_blk_remove_debugfs(struct mmc_card *card, +@@ -2892,6 +2892,9 @@ static void mmc_blk_remove_debugfs(struct mmc_card *card, #endif /* CONFIG_DEBUG_FS */ @@ -42753,20 +42510,40 @@ index a6c814fdb..16746d211 100644 extern bool use_spi_crc; diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c -index 864c8c205..eb40156f5 100644 +index 03e2f965a..eb40156f5 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c -@@ -513,6 +513,9 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev) +@@ -513,15 +513,8 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev) EXPORT_SYMBOL(mmc_alloc_host); +-static int mmc_validate_host_caps(struct mmc_host *host) +-{ +- if (host->caps & MMC_CAP_SDIO_IRQ && !host->ops->enable_sdio_irq) { +- dev_warn(host->parent, "missing ->enable_sdio_irq() ops\n"); +- return -EINVAL; +- } +- +- return 0; +-} +struct mmc_host *primary_sdio_host; +EXPORT_SYMBOL(primary_sdio_host); -+ + /** * mmc_add_host - initialise host hardware - * @host: mmc host -@@ -580,3 +583,45 @@ void mmc_free_host(struct mmc_host *host) +@@ -535,9 +528,8 @@ int mmc_add_host(struct mmc_host *host) + { + int err; + +- err = mmc_validate_host_caps(host); +- if (err) +- return err; ++ WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) && ++ !host->ops->enable_sdio_irq); + + err = device_add(&host->class_dev); + if (err) +@@ -591,3 +583,45 @@ void mmc_free_host(struct mmc_host *host) } EXPORT_SYMBOL(mmc_free_host); @@ -42813,7 +42590,7 @@ index 864c8c205..eb40156f5 100644 +} +EXPORT_SYMBOL(mmc_host_rescan); diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c -index 1b0853a82..0482a37a0 100644 +index 99a4ce68d..af7fa7497 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -3,9 +3,15 @@ @@ -43098,7 +42875,15 @@ index 1b0853a82..0482a37a0 100644 } } -@@ -719,10 +661,10 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, +@@ -708,6 +650,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, + if (host->ops->init_card) + host->ops->init_card(host, card); + ++ + card->ocr = ocr_card; + + /* +@@ -721,10 +664,10 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, * try to init uhs card. sdio_read_cccr will take over this task * to make sure which speed mode should work. */ @@ -43111,7 +42896,7 @@ index 1b0853a82..0482a37a0 100644 retries--; goto try_again; } else if (err) { -@@ -733,10 +675,20 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, +@@ -735,10 +678,20 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, /* * For native busses: set card RCA and quit open drain mode. */ @@ -43133,7 +42918,7 @@ index 1b0853a82..0482a37a0 100644 /* * Update oldcard with the new RCA received from the SDIO -@@ -753,7 +705,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, +@@ -755,7 +708,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, if (!oldcard && card->type == MMC_TYPE_SD_COMBO) { err = mmc_sd_get_csd(host, card); if (err) @@ -43142,7 +42927,7 @@ index 1b0853a82..0482a37a0 100644 mmc_decode_cid(card); } -@@ -761,7 +713,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, +@@ -763,7 +716,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, /* * Select card, as all following commands rely on that. */ @@ -43151,7 +42936,7 @@ index 1b0853a82..0482a37a0 100644 err = mmc_select_card(card); if (err) goto remove; -@@ -780,12 +732,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, +@@ -782,12 +735,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, mmc_set_timing(card->host, MMC_TIMING_SD_HS); } @@ -43165,7 +42950,7 @@ index 1b0853a82..0482a37a0 100644 } /* -@@ -794,7 +741,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, +@@ -796,7 +744,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, */ err = sdio_read_cccr(card, ocr); if (err) { @@ -43174,7 +42959,7 @@ index 1b0853a82..0482a37a0 100644 if (ocr & R4_18V_PRESENT) { /* Retry init sequence, but without R4_18V_PRESENT. */ retries = 0; -@@ -811,14 +758,13 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, +@@ -813,14 +761,13 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, goto remove; if (oldcard) { @@ -43194,9 +42979,9 @@ index 1b0853a82..0482a37a0 100644 + + card = oldcard; } - card->ocr = ocr_card; + mmc_fixup_device(card, sdio_fixup_methods); -@@ -879,27 +825,33 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, +@@ -881,27 +828,33 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, err = -EINVAL; goto remove; } @@ -43238,7 +43023,7 @@ index 1b0853a82..0482a37a0 100644 } /* -@@ -985,37 +937,21 @@ static void mmc_sdio_detect(struct mmc_host *host) +@@ -987,37 +940,21 @@ static void mmc_sdio_detect(struct mmc_host *host) */ static int mmc_sdio_pre_suspend(struct mmc_host *host) { @@ -43282,7 +43067,7 @@ index 1b0853a82..0482a37a0 100644 } /* -@@ -1023,8 +959,6 @@ static int mmc_sdio_pre_suspend(struct mmc_host *host) +@@ -1025,8 +962,6 @@ static int mmc_sdio_pre_suspend(struct mmc_host *host) */ static int mmc_sdio_suspend(struct mmc_host *host) { @@ -43291,7 +43076,7 @@ index 1b0853a82..0482a37a0 100644 /* Prevent processing of SDIO IRQs in suspended state. */ mmc_card_set_suspended(host->card); cancel_delayed_work_sync(&host->sdio_irq_work); -@@ -1032,7 +966,7 @@ static int mmc_sdio_suspend(struct mmc_host *host) +@@ -1034,7 +969,7 @@ static int mmc_sdio_suspend(struct mmc_host *host) mmc_claim_host(host); if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) @@ -43300,7 +43085,7 @@ index 1b0853a82..0482a37a0 100644 if (!mmc_card_keep_power(host)) { mmc_power_off(host); -@@ -1053,11 +987,7 @@ static int mmc_sdio_resume(struct mmc_host *host) +@@ -1055,11 +990,7 @@ static int mmc_sdio_resume(struct mmc_host *host) /* Basic card reinitialization. */ mmc_claim_host(host); @@ -43313,7 +43098,7 @@ index 1b0853a82..0482a37a0 100644 if (!mmc_card_keep_power(host)) { mmc_power_up(host, host->card->ocr); /* -@@ -1071,8 +1001,12 @@ static int mmc_sdio_resume(struct mmc_host *host) +@@ -1073,8 +1004,12 @@ static int mmc_sdio_resume(struct mmc_host *host) pm_runtime_set_active(&host->card->dev); pm_runtime_enable(&host->card->dev); } @@ -43328,7 +43113,7 @@ index 1b0853a82..0482a37a0 100644 /* We may have switched to 1-bit mode during suspend */ err = sdio_enable_4bit_bus(host->card); } -@@ -1087,7 +1021,7 @@ static int mmc_sdio_resume(struct mmc_host *host) +@@ -1089,7 +1024,7 @@ static int mmc_sdio_resume(struct mmc_host *host) if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD)) wake_up_process(host->sdio_irq_thread); else if (host->caps & MMC_CAP_SDIO_IRQ) @@ -43337,7 +43122,7 @@ index 1b0853a82..0482a37a0 100644 } out: -@@ -1097,6 +1031,38 @@ static int mmc_sdio_resume(struct mmc_host *host) +@@ -1099,6 +1034,38 @@ static int mmc_sdio_resume(struct mmc_host *host) return err; } @@ -43376,7 +43161,7 @@ index 1b0853a82..0482a37a0 100644 static int mmc_sdio_runtime_suspend(struct mmc_host *host) { /* No references to the card, cut the power to it. */ -@@ -1114,42 +1080,16 @@ static int mmc_sdio_runtime_resume(struct mmc_host *host) +@@ -1116,42 +1083,16 @@ static int mmc_sdio_runtime_resume(struct mmc_host *host) /* Restore power and re-initialize. */ mmc_claim_host(host); mmc_power_up(host, host->card->ocr); @@ -43422,7 +43207,7 @@ index 1b0853a82..0482a37a0 100644 } static int mmc_sdio_sw_reset(struct mmc_host *host) -@@ -1161,7 +1101,7 @@ static int mmc_sdio_sw_reset(struct mmc_host *host) +@@ -1163,7 +1104,7 @@ static int mmc_sdio_sw_reset(struct mmc_host *host) mmc_set_initial_state(host); mmc_set_initial_signal_voltage(host); @@ -43431,7 +43216,7 @@ index 1b0853a82..0482a37a0 100644 } static const struct mmc_bus_ops mmc_sdio_ops = { -@@ -1189,9 +1129,21 @@ int mmc_attach_sdio(struct mmc_host *host) +@@ -1191,9 +1132,21 @@ int mmc_attach_sdio(struct mmc_host *host) WARN_ON(!host->claimed); @@ -43453,7 +43238,7 @@ index 1b0853a82..0482a37a0 100644 mmc_attach_bus(host, &mmc_sdio_ops); if (host->ocr_avail_sdio) -@@ -1211,7 +1163,7 @@ int mmc_attach_sdio(struct mmc_host *host) +@@ -1213,7 +1166,7 @@ int mmc_attach_sdio(struct mmc_host *host) /* * Detect and init the card. */ @@ -43462,7 +43247,7 @@ index 1b0853a82..0482a37a0 100644 if (err) goto err; -@@ -1262,6 +1214,11 @@ int mmc_attach_sdio(struct mmc_host *host) +@@ -1264,6 +1217,11 @@ int mmc_attach_sdio(struct mmc_host *host) pm_runtime_enable(&card->sdio_func[i]->dev); } @@ -43474,7 +43259,7 @@ index 1b0853a82..0482a37a0 100644 /* * First add the card to the driver model... */ -@@ -1306,3 +1263,48 @@ int mmc_attach_sdio(struct mmc_host *host) +@@ -1308,3 +1266,48 @@ int mmc_attach_sdio(struct mmc_host *host) return err; } @@ -45336,10 +45121,10 @@ index 80b324499..5671364ae 100644 obj-$(CONFIG_VIRT_WIFI) += virt_wifi.o +obj-$(CONFIG_WL_ROCKCHIP) += rockchip_wlan/ diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c -index 6b170083c..a8d527cda 100644 +index 21d89d80d..c8db5f945 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -1665,7 +1665,11 @@ static void __exit nvmem_exit(void) +@@ -1667,7 +1667,11 @@ static void __exit nvmem_exit(void) bus_unregister(&nvmem_bus_type); } @@ -45916,7 +45701,7 @@ index 596c185b5..0f45d8123 100644 } core_initcall(opp_debug_init); diff --git a/drivers/opp/of.c b/drivers/opp/of.c -index 5de46aa99..446862368 100644 +index 3d7adc0de..b163f5d13 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -1328,7 +1328,7 @@ int dev_pm_opp_of_register_em(struct device *dev, struct cpumask *cpus) @@ -52333,7 +52118,7 @@ index c6f4229eb..46e426cf4 100644 MODULE_DESCRIPTION("RK805 pin control and GPIO driver"); MODULE_AUTHOR("Joseph Chen "); diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c -index 53a0badc6..c03815d27 100644 +index 07b120417..9d7ae4f8f 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -16,12 +16,14 @@ @@ -52698,7 +52483,7 @@ index 53a0badc6..c03815d27 100644 static struct rockchip_mux_recalced_data rk3128_mux_recalced_data[] = { { .num = 2, -@@ -757,11 +598,47 @@ static struct rockchip_mux_recalced_data rk3308_mux_recalced_data[] = { +@@ -772,11 +613,47 @@ static struct rockchip_mux_recalced_data rk3308_mux_recalced_data[] = { static struct rockchip_mux_recalced_data rk3328_mux_recalced_data[] = { { @@ -52746,7 +52531,7 @@ index 53a0badc6..c03815d27 100644 }, { .num = 2, .pin = 15, -@@ -777,6 +654,103 @@ static struct rockchip_mux_recalced_data rk3328_mux_recalced_data[] = { +@@ -792,6 +669,103 @@ static struct rockchip_mux_recalced_data rk3328_mux_recalced_data[] = { }, }; @@ -52850,7 +52635,7 @@ index 53a0badc6..c03815d27 100644 static void rockchip_get_recalced_mux(struct rockchip_pin_bank *bank, int pin, int *reg, u8 *bit, int *mask) { -@@ -800,598 +774,218 @@ static void rockchip_get_recalced_mux(struct rockchip_pin_bank *bank, int pin, +@@ -815,598 +789,218 @@ static void rockchip_get_recalced_mux(struct rockchip_pin_bank *bank, int pin, *bit = data->bit; } @@ -53639,7 +53424,7 @@ index 53a0badc6..c03815d27 100644 }; static bool rockchip_get_mux_route(struct rockchip_pin_bank *bank, int pin, -@@ -1439,8 +1033,12 @@ static int rockchip_get_mux(struct rockchip_pin_bank *bank, int pin) +@@ -1454,8 +1048,12 @@ static int rockchip_get_mux(struct rockchip_pin_bank *bank, int pin) if (bank->iomux[iomux_num].type & IOMUX_GPIO_ONLY) return RK_FUNC_GPIO; @@ -53654,7 +53439,7 @@ index 53a0badc6..c03815d27 100644 /* get basic quadrupel of mux registers and the correct reg inside */ mux_type = bank->iomux[iomux_num].type; -@@ -1527,8 +1125,12 @@ static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) +@@ -1542,8 +1140,12 @@ static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) dev_dbg(info->dev, "setting mux of GPIO%d-%d to %d\n", bank->bank_num, pin, mux); @@ -53669,7 +53454,7 @@ index 53a0badc6..c03815d27 100644 /* get basic quadrupel of mux registers and the correct reg inside */ mux_type = bank->iomux[iomux_num].type; -@@ -1551,6 +1153,9 @@ static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) +@@ -1566,6 +1168,9 @@ static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) if (bank->recalced_mask & BIT(pin)) rockchip_get_recalced_mux(bank, pin, ®, &bit, &mask); @@ -53679,7 +53464,7 @@ index 53a0badc6..c03815d27 100644 if (bank->route_mask & BIT(pin)) { if (rockchip_get_mux_route(bank, pin, mux, &route_location, &route_reg, &route_val)) { -@@ -1572,10 +1177,20 @@ static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) +@@ -1587,10 +1192,20 @@ static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) } } @@ -53704,7 +53489,7 @@ index 53a0badc6..c03815d27 100644 return ret; } -@@ -1760,6 +1375,115 @@ static int rv1108_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank, +@@ -1775,6 +1390,115 @@ static int rv1108_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank, return 0; } @@ -53820,7 +53605,7 @@ index 53a0badc6..c03815d27 100644 #define RK3308_SCHMITT_PINS_PER_REG 8 #define RK3308_SCHMITT_BANK_STRIDE 16 #define RK3308_SCHMITT_GRF_OFFSET 0x1a0 -@@ -1780,6 +1504,111 @@ static int rk3308_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank, +@@ -1795,6 +1519,111 @@ static int rk3308_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank, return 0; } @@ -53932,7 +53717,7 @@ index 53a0badc6..c03815d27 100644 #define RK2928_PULL_OFFSET 0x118 #define RK2928_PULL_PINS_PER_REG 16 #define RK2928_PULL_BANK_STRIDE 8 -@@ -2102,6 +1931,100 @@ static void rk3399_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, +@@ -2117,6 +1946,100 @@ static void rk3399_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, *bit = (pin_num % 8) * 2; } @@ -54033,7 +53818,7 @@ index 53a0badc6..c03815d27 100644 static int rockchip_perpin_drv_list[DRV_TYPE_MAX][8] = { { 2, 4, 8, 12, -1, -1, -1, -1 }, { 3, 6, 9, 12, -1, -1, -1, -1 }, -@@ -2202,6 +2125,15 @@ static int rockchip_set_drive_perpin(struct rockchip_pin_bank *bank, +@@ -2217,6 +2140,15 @@ static int rockchip_set_drive_perpin(struct rockchip_pin_bank *bank, bank->bank_num, pin_num, strength); ctrl->drv_calc_reg(bank, pin_num, ®map, ®, &bit); @@ -54049,7 +53834,7 @@ index 53a0badc6..c03815d27 100644 ret = -EINVAL; for (i = 0; i < ARRAY_SIZE(rockchip_perpin_drv_list[drv_type]); i++) { -@@ -2271,14 +2203,42 @@ static int rockchip_set_drive_perpin(struct rockchip_pin_bank *bank, +@@ -2286,14 +2218,42 @@ static int rockchip_set_drive_perpin(struct rockchip_pin_bank *bank, return -EINVAL; } @@ -54093,7 +53878,7 @@ index 53a0badc6..c03815d27 100644 } static int rockchip_pull_list[PULL_TYPE_MAX][4] = { -@@ -2323,11 +2283,14 @@ static int rockchip_get_pull(struct rockchip_pin_bank *bank, int pin_num) +@@ -2338,11 +2298,14 @@ static int rockchip_get_pull(struct rockchip_pin_bank *bank, int pin_num) : PIN_CONFIG_BIAS_DISABLE; case PX30: case RV1108: @@ -54108,7 +53893,7 @@ index 53a0badc6..c03815d27 100644 pull_type = bank->pull_type[pin_num / 8]; data >>= bit; data &= (1 << RK3188_PULL_BITS_PER_PIN) - 1; -@@ -2368,11 +2331,14 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank, +@@ -2383,11 +2346,14 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank, break; case PX30: case RV1108: @@ -54123,7 +53908,7 @@ index 53a0badc6..c03815d27 100644 pull_type = bank->pull_type[pin_num / 8]; ret = -EINVAL; for (i = 0; i < ARRAY_SIZE(rockchip_pull_list[pull_type]); -@@ -2382,6 +2348,14 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank, +@@ -2397,6 +2363,14 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank, break; } } @@ -54138,7 +53923,7 @@ index 53a0badc6..c03815d27 100644 if (ret < 0) { dev_err(info->dev, "unsupported pull setting %d\n", -@@ -2426,6 +2400,35 @@ static int rk3328_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank, +@@ -2441,6 +2415,35 @@ static int rk3328_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank, return 0; } @@ -54174,7 +53959,7 @@ index 53a0badc6..c03815d27 100644 static int rockchip_get_schmitt(struct rockchip_pin_bank *bank, int pin_num) { struct rockchip_pinctrl *info = bank->drvdata; -@@ -2444,10 +2447,17 @@ static int rockchip_get_schmitt(struct rockchip_pin_bank *bank, int pin_num) +@@ -2459,10 +2462,17 @@ static int rockchip_get_schmitt(struct rockchip_pin_bank *bank, int pin_num) return ret; data >>= bit; @@ -54196,7 +53981,7 @@ index 53a0badc6..c03815d27 100644 int pin_num, int enable) { struct rockchip_pinctrl *info = bank->drvdata; -@@ -2465,7 +2475,91 @@ static int rockchip_set_schmitt(struct rockchip_pin_bank *bank, +@@ -2480,7 +2490,91 @@ static int rockchip_set_schmitt(struct rockchip_pin_bank *bank, return ret; /* enable the write to the equivalent lower bits */ @@ -54289,7 +54074,7 @@ index 53a0badc6..c03815d27 100644 rmask = BIT(bit + 16) | BIT(bit); return regmap_update_bits(regmap, reg, rmask, data); -@@ -2526,9 +2620,9 @@ static int rockchip_pmx_set(struct pinctrl_dev *pctldev, unsigned selector, +@@ -2541,9 +2635,9 @@ static int rockchip_pmx_set(struct pinctrl_dev *pctldev, unsigned selector, break; } @@ -54301,7 +54086,7 @@ index 53a0badc6..c03815d27 100644 rockchip_set_mux(bank, pins[cnt] - bank->pin_base, 0); return ret; -@@ -2537,86 +2631,11 @@ static int rockchip_pmx_set(struct pinctrl_dev *pctldev, unsigned selector, +@@ -2552,86 +2646,11 @@ static int rockchip_pmx_set(struct pinctrl_dev *pctldev, unsigned selector, return 0; } @@ -54388,7 +54173,7 @@ index 53a0badc6..c03815d27 100644 }; /* -@@ -2635,26 +2654,27 @@ static bool rockchip_pinconf_pull_valid(struct rockchip_pin_ctrl *ctrl, +@@ -2650,26 +2669,27 @@ static bool rockchip_pinconf_pull_valid(struct rockchip_pin_ctrl *ctrl, return pull ? false : true; case PX30: case RV1108: @@ -54419,7 +54204,7 @@ index 53a0badc6..c03815d27 100644 enum pin_config_param param; u32 arg; int i; -@@ -2687,10 +2707,13 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, +@@ -2702,10 +2722,13 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, return rc; break; case PIN_CONFIG_OUTPUT: @@ -54437,7 +54222,7 @@ index 53a0badc6..c03815d27 100644 if (rc) return rc; break; -@@ -2713,9 +2736,17 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, +@@ -2728,9 +2751,17 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, if (rc < 0) return rc; break; @@ -54456,7 +54241,7 @@ index 53a0badc6..c03815d27 100644 } } /* for each config */ -@@ -2728,6 +2759,7 @@ static int rockchip_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, +@@ -2743,6 +2774,7 @@ static int rockchip_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, { struct rockchip_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); struct rockchip_pin_bank *bank = pin_to_bank(info, pin); @@ -54464,7 +54249,7 @@ index 53a0badc6..c03815d27 100644 enum pin_config_param param = pinconf_to_config_param(*config); u16 arg; int rc; -@@ -2753,10 +2785,12 @@ static int rockchip_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, +@@ -2768,10 +2800,12 @@ static int rockchip_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, break; case PIN_CONFIG_OUTPUT: rc = rockchip_get_mux(bank, pin - bank->pin_base); @@ -54479,7 +54264,7 @@ index 53a0badc6..c03815d27 100644 if (rc < 0) return rc; -@@ -2781,11 +2815,20 @@ static int rockchip_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, +@@ -2796,11 +2830,20 @@ static int rockchip_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin, if (rc < 0) return rc; @@ -54501,7 +54286,7 @@ index 53a0badc6..c03815d27 100644 } *config = pinconf_to_config_packed(param, arg); -@@ -2848,716 +2891,173 @@ static int rockchip_pinctrl_parse_groups(struct device_node *np, +@@ -2863,716 +2906,173 @@ static int rockchip_pinctrl_parse_groups(struct device_node *np, return -EINVAL; } @@ -55223,14 +55008,14 @@ index 53a0badc6..c03815d27 100644 - } - return ret; -} - +- -static int rockchip_gpiolib_unregister(struct platform_device *pdev, - struct rockchip_pinctrl *info) -{ - struct rockchip_pin_ctrl *ctrl = info->ctrl; - struct rockchip_pin_bank *bank = ctrl->pin_banks; - int i; -- + - for (i = 0; i < ctrl->nr_banks; ++i, ++bank) { - if (!bank->valid) - continue; @@ -55337,7 +55122,7 @@ index 53a0badc6..c03815d27 100644 } static const struct of_device_id rockchip_pinctrl_dt_match[]; -@@ -3569,7 +3069,6 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( +@@ -3584,7 +3084,6 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( { const struct of_device_id *match; struct device_node *node = pdev->dev.of_node; @@ -55345,7 +55130,7 @@ index 53a0badc6..c03815d27 100644 struct rockchip_pin_ctrl *ctrl; struct rockchip_pin_bank *bank; int grf_offs, pmu_offs, drv_grf_offs, drv_pmu_offs, i, j; -@@ -3577,23 +3076,6 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( +@@ -3592,23 +3091,6 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( match = of_match_node(rockchip_pinctrl_dt_match, node); ctrl = (struct rockchip_pin_ctrl *)match->data; @@ -55369,7 +55154,7 @@ index 53a0badc6..c03815d27 100644 grf_offs = ctrl->grf_mux_offset; pmu_offs = ctrl->pmu_mux_offset; drv_pmu_offs = ctrl->pmu_drv_offset; -@@ -3618,12 +3100,13 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( +@@ -3633,12 +3115,13 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( /* preset iomux offset value, set new start value */ if (iom->offset >= 0) { @@ -55385,7 +55170,7 @@ index 53a0badc6..c03815d27 100644 pmu_offs : grf_offs; } -@@ -3648,7 +3131,7 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( +@@ -3663,7 +3146,7 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( inc = (iom->type & (IOMUX_WIDTH_4BIT | IOMUX_WIDTH_3BIT | IOMUX_WIDTH_2BIT)) ? 8 : 4; @@ -55394,7 +55179,7 @@ index 53a0badc6..c03815d27 100644 pmu_offs += inc; else grf_offs += inc; -@@ -3743,6 +3226,46 @@ static int __maybe_unused rockchip_pinctrl_resume(struct device *dev) +@@ -3758,6 +3241,46 @@ static int __maybe_unused rockchip_pinctrl_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(rockchip_pinctrl_dev_pm_ops, rockchip_pinctrl_suspend, rockchip_pinctrl_resume); @@ -55441,7 +55226,7 @@ index 53a0badc6..c03815d27 100644 static int rockchip_pinctrl_probe(struct platform_device *pdev) { struct rockchip_pinctrl *info; -@@ -3814,17 +3337,25 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev) +@@ -3831,17 +3354,25 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev) return PTR_ERR(info->regmap_pmu); } @@ -55472,7 +55257,7 @@ index 53a0badc6..c03815d27 100644 return 0; } -@@ -3864,6 +3395,7 @@ static struct rockchip_pin_ctrl px30_pin_ctrl = { +@@ -3881,6 +3412,7 @@ static struct rockchip_pin_ctrl px30_pin_ctrl = { .pull_calc_reg = px30_calc_pull_reg_and_bit, .drv_calc_reg = px30_calc_drv_reg_and_bit, .schmitt_calc_reg = px30_calc_schmitt_reg_and_bit, @@ -55480,7 +55265,7 @@ index 53a0badc6..c03815d27 100644 }; static struct rockchip_pin_bank rv1108_pin_banks[] = { -@@ -3890,6 +3422,86 @@ static struct rockchip_pin_ctrl rv1108_pin_ctrl = { +@@ -3907,6 +3439,86 @@ static struct rockchip_pin_ctrl rv1108_pin_ctrl = { .schmitt_calc_reg = rv1108_calc_schmitt_reg_and_bit, }; @@ -55567,7 +55352,7 @@ index 53a0badc6..c03815d27 100644 static struct rockchip_pin_bank rk2928_pin_banks[] = { PIN_BANK(0, 32, "gpio0"), PIN_BANK(1, 32, "gpio1"), -@@ -4012,9 +3624,9 @@ static struct rockchip_pin_ctrl rk3228_pin_ctrl = { +@@ -4029,9 +3641,9 @@ static struct rockchip_pin_ctrl rk3228_pin_ctrl = { }; static struct rockchip_pin_bank rk3288_pin_banks[] = { @@ -55580,7 +55365,7 @@ index 53a0badc6..c03815d27 100644 IOMUX_UNROUTED ), PIN_BANK_IOMUX_FLAGS(1, 32, "gpio1", IOMUX_UNROUTED, -@@ -4089,6 +3701,7 @@ static struct rockchip_pin_ctrl rk3308_pin_ctrl = { +@@ -4106,6 +3718,7 @@ static struct rockchip_pin_ctrl rk3308_pin_ctrl = { .niomux_recalced = ARRAY_SIZE(rk3308_mux_recalced_data), .iomux_routes = rk3308_mux_route_data, .niomux_routes = ARRAY_SIZE(rk3308_mux_route_data), @@ -55588,7 +55373,7 @@ index 53a0badc6..c03815d27 100644 .pull_calc_reg = rk3308_calc_pull_reg_and_bit, .drv_calc_reg = rk3308_calc_drv_reg_and_bit, .schmitt_calc_reg = rk3308_calc_schmitt_reg_and_bit, -@@ -4213,11 +3826,55 @@ static struct rockchip_pin_ctrl rk3399_pin_ctrl = { +@@ -4230,11 +3843,55 @@ static struct rockchip_pin_ctrl rk3399_pin_ctrl = { .drv_calc_reg = rk3399_calc_drv_reg_and_bit, }; @@ -55644,7 +55429,7 @@ index 53a0badc6..c03815d27 100644 { .compatible = "rockchip,rk2928-pinctrl", .data = &rk2928_pin_ctrl }, { .compatible = "rockchip,rk3036-pinctrl", -@@ -4242,6 +3899,8 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = { +@@ -4259,6 +3916,8 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = { .data = &rk3368_pin_ctrl }, { .compatible = "rockchip,rk3399-pinctrl", .data = &rk3399_pin_ctrl }, @@ -55653,7 +55438,7 @@ index 53a0badc6..c03815d27 100644 {}, }; -@@ -4259,3 +3918,14 @@ static int __init rockchip_pinctrl_drv_register(void) +@@ -4276,3 +3935,14 @@ static int __init rockchip_pinctrl_drv_register(void) return platform_driver_register(&rockchip_pinctrl_driver); } postcore_initcall(rockchip_pinctrl_drv_register); @@ -56133,7 +55918,7 @@ index 6ebae5162..81ba62a81 100644 ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c -index a6d27334a..470354ae0 100644 +index 007ce4af4..148a62ccd 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -51,6 +51,7 @@ static LIST_HEAD(regulator_map_list); @@ -56156,7 +55941,7 @@ index a6d27334a..470354ae0 100644 static int _regulator_is_enabled(struct regulator_dev *rdev); static int _regulator_disable(struct regulator *regulator); static int _regulator_get_current_limit(struct regulator_dev *rdev); -@@ -4931,11 +4937,265 @@ static void regulator_dev_release(struct device *dev) +@@ -4939,11 +4945,265 @@ static void regulator_dev_release(struct device *dev) kfree(rdev); } @@ -56422,7 +56207,7 @@ index a6d27334a..470354ae0 100644 /* Avoid duplicate debugfs directory names */ if (parent && rname == rdev->desc->name) { -@@ -4956,8 +5216,88 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) +@@ -4964,8 +5224,88 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) &rdev->open_count); debugfs_create_u32("bypass_count", 0444, rdev->debugfs, &rdev->bypass_count); @@ -56511,7 +56296,7 @@ index a6d27334a..470354ae0 100644 static int regulator_register_resolve_supply(struct device *dev, void *data) { struct regulator_dev *rdev = dev_to_rdev(dev); -@@ -5432,7 +5772,7 @@ void regulator_unregister(struct regulator_dev *rdev) +@@ -5440,7 +5780,7 @@ void regulator_unregister(struct regulator_dev *rdev) mutex_lock(®ulator_list_mutex); @@ -56520,7 +56305,7 @@ index a6d27334a..470354ae0 100644 WARN_ON(rdev->open_count); regulator_remove_coupling(rdev); unset_regulator_supplies(rdev); -@@ -5863,7 +6203,11 @@ static int __init regulator_init(void) +@@ -5871,7 +6211,11 @@ static int __init regulator_init(void) } /* init early to allow our consumers to complete system booting */ @@ -57226,10 +57011,10 @@ index aa426183b..5d83e1311 100644 }; diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c -index 06c0b15fe..564f928eb 100644 +index 5d844697c..b11a434ec 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c -@@ -413,8 +413,12 @@ device_node *regulator_of_get_init_node(struct device *dev, +@@ -417,8 +417,12 @@ device_node *regulator_of_get_init_node(struct device *dev, for_each_available_child_of_node(search, child) { name = of_get_property(child, "regulator-compatible", NULL); @@ -58433,7 +58218,7 @@ index 875032f73..7ac36a26a 100644 +ccflags-y +=-I$(KERNEL_SOURCE_PATH)/drivers/mmc/host/ \ No newline at end of file diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c -index 494cf2b5b..a252b07a6 100644 +index 343ff61cc..14f85382d 100644 --- a/drivers/soc/rockchip/grf.c +++ b/drivers/soc/rockchip/grf.c @@ -7,6 +7,7 @@ @@ -58542,7 +58327,7 @@ index 494cf2b5b..a252b07a6 100644 }, { /* sentinel */ }, }; -@@ -173,3 +235,6 @@ static int __init rockchip_grf_init(void) +@@ -175,3 +237,6 @@ static int __init rockchip_grf_init(void) return 0; } postcore_initcall(rockchip_grf_init); @@ -59948,7 +59733,7 @@ index 54eb6cfc5..3ae1676bc 100644 +MODULE_DESCRIPTION("ROCKCHIP PM Domain Driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c -index 624273d0e..b50f84809 100644 +index a9f97023d..b50f84809 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -10,6 +10,7 @@ @@ -60220,10 +60005,12 @@ index 624273d0e..b50f84809 100644 writel_relaxed(rockchip_spi_calc_burst_size(xfer->len / rs->n_bytes) - 1, rs->regs + ROCKCHIP_SPI_DMARDLR); writel_relaxed(dmacr, rs->regs + ROCKCHIP_SPI_DMACR); -@@ -566,7 +624,46 @@ static size_t rockchip_spi_max_transfer_size(struct spi_device *spi) +@@ -566,12 +624,45 @@ static size_t rockchip_spi_max_transfer_size(struct spi_device *spi) static int rockchip_spi_slave_abort(struct spi_controller *ctlr) { struct rockchip_spi *rs = spi_controller_get_devdata(ctlr); +- +- if (atomic_read(&rs->state) & RXDMA) + u32 rx_fifo_left; + struct dma_tx_state state; + enum dma_status status; @@ -60232,7 +60019,10 @@ index 624273d0e..b50f84809 100644 + if (atomic_read(&rs->state) & RXDMA) { + dmaengine_pause(ctlr->dma_rx); + status = dmaengine_tx_status(ctlr->dma_rx, ctlr->dma_rx->cookie, &state); -+ dmaengine_terminate_sync(ctlr->dma_rx); + dmaengine_terminate_sync(ctlr->dma_rx); +- if (atomic_read(&rs->state) & TXDMA) +- dmaengine_terminate_sync(ctlr->dma_tx); +- atomic_set(&rs->state, 0); + atomic_set(&rs->state, 0); + if (status == DMA_ERROR) { + rs->rx = rs->xfer->rx_buf; @@ -60261,13 +60051,12 @@ index 624273d0e..b50f84809 100644 + + rs->xfer->len = (unsigned int)(rs->rx - rs->xfer->rx_buf); + } - ++ +out: -+ spi_enable_chip(rs, false); + spi_enable_chip(rs, false); rs->slave_abort = true; complete(&ctlr->xfer_completion); - -@@ -582,12 +679,6 @@ static int rockchip_spi_transfer_one( +@@ -588,12 +679,6 @@ static int rockchip_spi_transfer_one( int ret; bool use_dma; @@ -60280,7 +60069,7 @@ index 624273d0e..b50f84809 100644 WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) && (readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)); -@@ -602,7 +693,7 @@ static int rockchip_spi_transfer_one( +@@ -608,7 +693,7 @@ static int rockchip_spi_transfer_one( } rs->n_bytes = xfer->bits_per_word <= 8 ? 1 : 2; @@ -60289,7 +60078,7 @@ index 624273d0e..b50f84809 100644 use_dma = ctlr->can_dma ? ctlr->can_dma(ctlr, spi, xfer) : false; ret = rockchip_spi_config(rs, spi, xfer, use_dma, ctlr->slave); -@@ -612,7 +703,7 @@ static int rockchip_spi_transfer_one( +@@ -618,7 +703,7 @@ static int rockchip_spi_transfer_one( if (use_dma) return rockchip_spi_prepare_dma(rs, ctlr, xfer); @@ -60298,15 +60087,30 @@ index 624273d0e..b50f84809 100644 } static bool rockchip_spi_can_dma(struct spi_controller *ctlr, -@@ -638,6 +729,7 @@ static int rockchip_spi_probe(struct platform_device *pdev) +@@ -642,8 +727,9 @@ static int rockchip_spi_probe(struct platform_device *pdev) + struct spi_controller *ctlr; + struct resource *mem; struct device_node *np = pdev->dev.of_node; - u32 rsd_nsecs; +- u32 rsd_nsecs, num_cs; ++ u32 rsd_nsecs; bool slave_mode; + struct pinctrl *pinctrl = NULL; slave_mode = of_property_read_bool(np, "spi-slave"); -@@ -785,6 +877,28 @@ static int rockchip_spi_probe(struct platform_device *pdev) +@@ -750,9 +836,8 @@ static int rockchip_spi_probe(struct platform_device *pdev) + * rk spi0 has two native cs, spi1..5 one cs only + * if num-cs is missing in the dts, default to 1 + */ +- if (of_property_read_u32(np, "num-cs", &num_cs)) +- num_cs = 1; +- ctlr->num_chipselect = num_cs; ++ if (of_property_read_u16(np, "num-cs", &ctlr->num_chipselect)) ++ ctlr->num_chipselect = 1; + ctlr->use_gpio_descriptors = true; + } + ctlr->dev.of_node = pdev->dev.of_node; +@@ -792,6 +877,28 @@ static int rockchip_spi_probe(struct platform_device *pdev) ctlr->can_dma = rockchip_spi_can_dma; } @@ -61340,7 +61144,7 @@ index aa9e0e31e..e1c667e8f 100644 module_platform_driver(rockchip_thermal_driver); diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c -index d9e34ac37..595046139 100644 +index dd449945e..560b1b83d 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -542,6 +542,7 @@ int thermal_zone_device_is_enabled(struct thermal_zone_device *tz) @@ -61363,7 +61167,7 @@ index 681209db4..5e80cb326 100644 - #endif /* __THERMAL_CORE_H__ */ diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h -index 34aa2714f..71ace116f 100644 +index b6dc9003b..f7261181d 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -48,6 +48,9 @@ struct uart_8250_dma { @@ -61376,7 +61180,7 @@ index 34aa2714f..71ace116f 100644 }; struct old_serial_port { -@@ -136,6 +139,9 @@ static inline bool serial8250_set_THRI(struct uart_8250_port *up) +@@ -158,6 +161,9 @@ static inline bool serial8250_set_THRI(struct uart_8250_port *up) if (up->ier & UART_IER_THRI) return false; up->ier |= UART_IER_THRI; @@ -61386,7 +61190,7 @@ index 34aa2714f..71ace116f 100644 serial_out(up, UART_IER, up->ier); return true; } -@@ -305,6 +311,9 @@ static inline int is_omap1510_8250(struct uart_8250_port *pt) +@@ -327,6 +333,9 @@ static inline int is_omap1510_8250(struct uart_8250_port *pt) #ifdef CONFIG_SERIAL_8250_DMA extern int serial8250_tx_dma(struct uart_8250_port *); extern int serial8250_rx_dma(struct uart_8250_port *); @@ -61396,7 +61200,7 @@ index 34aa2714f..71ace116f 100644 extern void serial8250_rx_dma_flush(struct uart_8250_port *); extern int serial8250_request_dma(struct uart_8250_port *); extern void serial8250_release_dma(struct uart_8250_port *); -@@ -317,6 +326,12 @@ static inline int serial8250_rx_dma(struct uart_8250_port *p) +@@ -339,6 +348,12 @@ static inline int serial8250_rx_dma(struct uart_8250_port *p) { return -1; } @@ -61410,10 +61214,10 @@ index 34aa2714f..71ace116f 100644 static inline int serial8250_request_dma(struct uart_8250_port *p) { diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c -index cae61d1eb..fc81bbc76 100644 +index 98ce484f1..36ee2fe24 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c -@@ -558,6 +558,7 @@ static void __init serial8250_isa_init_ports(void) +@@ -559,6 +559,7 @@ static void __init serial8250_isa_init_ports(void) static void __init serial8250_register_ports(struct uart_driver *drv, struct device *dev) { @@ -61421,7 +61225,7 @@ index cae61d1eb..fc81bbc76 100644 int i; for (i = 0; i < nr_uarts; i++) { -@@ -574,6 +575,7 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev) +@@ -578,6 +579,7 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev) serial8250_apply_quirks(up); uart_add_one_port(drv, &up->port); } @@ -61429,7 +61233,7 @@ index cae61d1eb..fc81bbc76 100644 } #ifdef CONFIG_SERIAL_8250_CONSOLE -@@ -1019,7 +1021,9 @@ int serial8250_register_8250_port(struct uart_8250_port *up) +@@ -1023,7 +1025,9 @@ int serial8250_register_8250_port(struct uart_8250_port *up) uart->rs485_start_tx = up->rs485_start_tx; uart->rs485_stop_tx = up->rs485_stop_tx; uart->dma = up->dma; @@ -61440,7 +61244,7 @@ index cae61d1eb..fc81bbc76 100644 /* Take tx_loadsz from fifosize if it wasn't set separately */ if (uart->port.fifosize && !uart->tx_loadsz) uart->tx_loadsz = uart->port.fifosize; -@@ -1243,7 +1247,11 @@ static void __exit serial8250_exit(void) +@@ -1247,7 +1251,11 @@ static void __exit serial8250_exit(void) #endif } @@ -61453,7 +61257,7 @@ index cae61d1eb..fc81bbc76 100644 MODULE_LICENSE("GPL"); diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c -index 890fa7dda..136ed708f 100644 +index b3c3f7e58..d8da0622b 100644 --- a/drivers/tty/serial/8250/8250_dma.c +++ b/drivers/tty/serial/8250/8250_dma.c @@ -11,6 +11,12 @@ @@ -61518,7 +61322,7 @@ index 890fa7dda..136ed708f 100644 int serial8250_tx_dma(struct uart_8250_port *p) { struct uart_8250_dma *dma = p->dma; -@@ -76,7 +117,12 @@ int serial8250_tx_dma(struct uart_8250_port *p) +@@ -85,7 +126,12 @@ int serial8250_tx_dma(struct uart_8250_port *p) } dma->tx_size = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE); @@ -61532,7 +61336,7 @@ index 890fa7dda..136ed708f 100644 desc = dmaengine_prep_slave_single(dma->txchan, dma->tx_addr + xmit->tail, dma->tx_size, DMA_MEM_TO_DEV, -@@ -106,6 +152,64 @@ int serial8250_tx_dma(struct uart_8250_port *p) +@@ -115,6 +161,64 @@ int serial8250_tx_dma(struct uart_8250_port *p) return ret; } @@ -61597,7 +61401,7 @@ index 890fa7dda..136ed708f 100644 int serial8250_rx_dma(struct uart_8250_port *p) { struct uart_8250_dma *dma = p->dma; -@@ -131,6 +235,8 @@ int serial8250_rx_dma(struct uart_8250_port *p) +@@ -140,6 +244,8 @@ int serial8250_rx_dma(struct uart_8250_port *p) return 0; } @@ -61606,7 +61410,7 @@ index 890fa7dda..136ed708f 100644 void serial8250_rx_dma_flush(struct uart_8250_port *p) { struct uart_8250_dma *dma = p->dma; -@@ -158,11 +264,19 @@ int serial8250_request_dma(struct uart_8250_port *p) +@@ -167,11 +273,19 @@ int serial8250_request_dma(struct uart_8250_port *p) dma->rxconf.direction = DMA_DEV_TO_MEM; dma->rxconf.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; dma->rxconf.src_addr = rx_dma_addr + UART_RX; @@ -61627,7 +61431,7 @@ index 890fa7dda..136ed708f 100644 dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); -@@ -185,54 +299,52 @@ int serial8250_request_dma(struct uart_8250_port *p) +@@ -194,54 +308,52 @@ int serial8250_request_dma(struct uart_8250_port *p) dmaengine_slave_config(dma->rxchan, &dma->rxconf); @@ -61678,6 +61482,7 @@ index 890fa7dda..136ed708f 100644 - dma->rx_buf, dma->rx_addr); - ret = -ENOMEM; - goto err; +- } + /* Get a channel for TX */ + dma->txchan = dma_request_slave_channel_compat(mask, + dma->fn, dma->tx_param, @@ -61697,14 +61502,13 @@ index 890fa7dda..136ed708f 100644 + dma_release_channel(dma->txchan); + dma->txchan = NULL; + } -+ + +- dev_dbg_ratelimited(p->port.dev, "got both dma channels\n"); + dev_info_ratelimited(p->port.dev, "got rx and tx dma channels\n"); + } else { + dev_info_ratelimited(p->port.dev, "got rx dma channels only\n"); - } ++ } -- dev_dbg_ratelimited(p->port.dev, "got both dma channels\n"); -- +#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI) + /* start dma for rx*/ + serial8250_start_rx_dma(p); @@ -61715,7 +61519,7 @@ index 890fa7dda..136ed708f 100644 release_rx: dma_release_channel(dma->rxchan); return ret; -@@ -252,15 +364,18 @@ void serial8250_release_dma(struct uart_8250_port *p) +@@ -261,15 +373,18 @@ void serial8250_release_dma(struct uart_8250_port *p) dma->rx_addr); dma_release_channel(dma->rxchan); dma->rxchan = NULL; @@ -61743,7 +61547,7 @@ index 890fa7dda..136ed708f 100644 } EXPORT_SYMBOL_GPL(serial8250_release_dma); diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c -index 49559731b..f6010822f 100644 +index ace221afe..c5bba750f 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -33,6 +33,7 @@ @@ -61766,7 +61570,7 @@ index 49559731b..f6010822f 100644 unsigned int skip_autocfg:1; unsigned int uart_16550_compatible:1; }; -@@ -235,10 +241,9 @@ static unsigned int dw8250_serial_in32be(struct uart_port *p, int offset) +@@ -238,10 +244,9 @@ static unsigned int dw8250_serial_in32be(struct uart_port *p, int offset) static int dw8250_handle_irq(struct uart_port *p) { @@ -61778,7 +61582,7 @@ index 49559731b..f6010822f 100644 unsigned long flags; /* -@@ -247,15 +252,13 @@ static int dw8250_handle_irq(struct uart_port *p) +@@ -250,15 +255,13 @@ static int dw8250_handle_irq(struct uart_port *p) * data available. If we see such a case then we'll do a bogus * read. If we don't do this then the "RX TIMEOUT" interrupt will * fire forever. @@ -61798,7 +61602,7 @@ index 49559731b..f6010822f 100644 (void) p->serial_in(p, UART_RX); spin_unlock_irqrestore(&p->lock, flags); -@@ -329,12 +332,49 @@ dw8250_do_pm(struct uart_port *port, unsigned int state, unsigned int old) +@@ -332,12 +335,49 @@ dw8250_do_pm(struct uart_port *port, unsigned int state, unsigned int old) static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios, struct ktermios *old) { @@ -61848,7 +61652,7 @@ index 49559731b..f6010822f 100644 rate = clk_round_rate(d->clk, newrate); if (rate > 0) { /* -@@ -348,6 +388,7 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios, +@@ -351,6 +391,7 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios, if (ret) swap(p->uartclk, rate); } @@ -61856,7 +61660,7 @@ index 49559731b..f6010822f 100644 clk_prepare_enable(d->clk); p->status &= ~UPSTAT_AUTOCTS; -@@ -480,6 +521,9 @@ static int dw8250_probe(struct platform_device *pdev) +@@ -483,6 +524,9 @@ static int dw8250_probe(struct platform_device *pdev) data->data.dma.fn = dw8250_fallback_dma_filter; data->usr_reg = DW_UART_USR; p->private_data = &data->data; @@ -61866,7 +61670,7 @@ index 49559731b..f6010822f 100644 data->uart_16550_compatible = device_property_read_bool(dev, "snps,uart-16550-compatible"); -@@ -519,6 +563,13 @@ static int dw8250_probe(struct platform_device *pdev) +@@ -522,6 +566,13 @@ static int dw8250_probe(struct platform_device *pdev) data->msr_mask_off |= UART_MSR_TERI; } @@ -61880,7 +61684,7 @@ index 49559731b..f6010822f 100644 /* Always ask for fixed clock rate from a property. */ device_property_read_u32(dev, "clock-frequency", &p->uartclk); -@@ -599,7 +650,10 @@ static int dw8250_probe(struct platform_device *pdev) +@@ -602,7 +653,10 @@ static int dw8250_probe(struct platform_device *pdev) else queue_work(system_unbound_wq, &data->clk_work); } @@ -61892,7 +61696,7 @@ index 49559731b..f6010822f 100644 platform_set_drvdata(pdev, data); pm_runtime_set_active(dev); -@@ -642,6 +696,10 @@ static int dw8250_remove(struct platform_device *pdev) +@@ -645,6 +699,10 @@ static int dw8250_remove(struct platform_device *pdev) pm_runtime_disable(dev); pm_runtime_put_noidle(dev); @@ -61903,7 +61707,7 @@ index 49559731b..f6010822f 100644 return 0; } -@@ -652,6 +710,13 @@ static int dw8250_suspend(struct device *dev) +@@ -655,6 +713,13 @@ static int dw8250_suspend(struct device *dev) struct dw8250_data *data = dev_get_drvdata(dev); serial8250_suspend_port(data->data.line); @@ -61917,7 +61721,7 @@ index 49559731b..f6010822f 100644 return 0; } -@@ -661,6 +726,15 @@ static int dw8250_resume(struct device *dev) +@@ -664,6 +729,15 @@ static int dw8250_resume(struct device *dev) struct dw8250_data *data = dev_get_drvdata(dev); serial8250_resume_port(data->data.line); @@ -61964,10 +61768,10 @@ index 6d6a78eea..fee4f2933 100644 } diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 7c07ebb37..1ad77505b 100644 +index 9d60418e4..44f8d9d10 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c -@@ -1567,8 +1567,13 @@ static inline void __start_tx(struct uart_port *port) +@@ -1548,8 +1548,13 @@ static inline void __start_tx(struct uart_port *port) { struct uart_8250_port *up = up_to_u8250p(port); @@ -61981,7 +61785,7 @@ index 7c07ebb37..1ad77505b 100644 if (serial8250_set_THRI(up)) { if (up->bugs & UART_BUG_TXEN) { -@@ -1888,6 +1893,12 @@ EXPORT_SYMBOL_GPL(serial8250_modem_status); +@@ -1879,6 +1884,12 @@ EXPORT_SYMBOL_GPL(serial8250_modem_status); static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir) { @@ -61994,7 +61798,7 @@ index 7c07ebb37..1ad77505b 100644 switch (iir & 0x3f) { case UART_IIR_RX_TIMEOUT: serial8250_rx_dma_flush(up); -@@ -1896,6 +1907,7 @@ static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir) +@@ -1887,6 +1898,7 @@ static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir) return true; } return up->dma->rx_dma(up); @@ -62002,7 +61806,7 @@ index 7c07ebb37..1ad77505b 100644 } /* -@@ -1906,7 +1918,9 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) +@@ -1897,7 +1909,9 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) unsigned char status; unsigned long flags; struct uart_8250_port *up = up_to_u8250p(port); @@ -62012,7 +61816,7 @@ index 7c07ebb37..1ad77505b 100644 if (iir & UART_IIR_NO_INT) return 0; -@@ -1915,6 +1929,17 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) +@@ -1906,6 +1920,17 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) status = serial_port_in(port, UART_LSR); @@ -62030,7 +61834,7 @@ index 7c07ebb37..1ad77505b 100644 /* * If port is stopped and there are no error conditions in the * FIFO, then don't drain the FIFO, as this may lead to TTY buffer -@@ -1932,11 +1957,34 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) +@@ -1923,11 +1948,34 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) if (!up->dma || handle_rx_dma(up, iir)) status = serial8250_rx_chars(up, status); } @@ -62067,7 +61871,7 @@ index 7c07ebb37..1ad77505b 100644 uart_unlock_and_check_sysrq(port, flags); return 1; } -@@ -2405,7 +2453,11 @@ int serial8250_do_startup(struct uart_port *port) +@@ -2396,7 +2444,11 @@ int serial8250_do_startup(struct uart_port *port) if (uart_console(port)) msg = "forbid DMA for kernel console"; else if (serial8250_request_dma(up)) @@ -62079,7 +61883,7 @@ index 7c07ebb37..1ad77505b 100644 if (msg) { dev_warn_ratelimited(port->dev, "%s\n", msg); up->dma = NULL; -@@ -2599,6 +2651,10 @@ void serial8250_do_set_divisor(struct uart_port *port, unsigned int baud, +@@ -2590,6 +2642,10 @@ void serial8250_do_set_divisor(struct uart_port *port, unsigned int baud, { struct uart_8250_port *up = up_to_u8250p(port); @@ -62090,7 +61894,7 @@ index 7c07ebb37..1ad77505b 100644 /* Workaround to enable 115200 baud on OMAP1510 internal ports */ if (is_omap1510_8250(up)) { if (baud == 115200) { -@@ -2618,6 +2674,17 @@ void serial8250_do_set_divisor(struct uart_port *port, unsigned int baud, +@@ -2609,6 +2665,17 @@ void serial8250_do_set_divisor(struct uart_port *port, unsigned int baud, serial_port_out(port, UART_LCR, up->lcr | UART_LCR_DLAB); serial_dl_write(up, quot); @@ -62108,7 +61912,7 @@ index 7c07ebb37..1ad77505b 100644 } EXPORT_SYMBOL_GPL(serial8250_do_set_divisor); -@@ -2797,6 +2864,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2788,6 +2855,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, if ((termios->c_cflag & CREAD) == 0) port->ignore_status_mask |= UART_LSR_DR; @@ -62116,7 +61920,7 @@ index 7c07ebb37..1ad77505b 100644 /* * CTS flow control flag and modem status interrupts */ -@@ -2810,6 +2878,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2801,6 +2869,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, up->ier |= UART_IER_RTOIE; serial_port_out(port, UART_IER, up->ier); @@ -62124,7 +61928,7 @@ index 7c07ebb37..1ad77505b 100644 if (up->capabilities & UART_CAP_EFR) { unsigned char efr = 0; -@@ -2828,16 +2897,25 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2819,16 +2888,25 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, serial_port_out(port, UART_EFR, efr); } @@ -62152,7 +61956,7 @@ index 7c07ebb37..1ad77505b 100644 if (port->type != PORT_16750) { /* emulated UARTs (Lucent Venus 167x) need two steps */ if (up->fcr & UART_FCR_ENABLE_FIFO) -@@ -2845,6 +2923,23 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2836,6 +2914,23 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, serial_port_out(port, UART_FCR, up->fcr); /* set fcr */ } serial8250_set_mctrl(port, port->mctrl); @@ -62189,10 +61993,10 @@ index aa0026a98..379fe28f0 100644 return; diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c -index af15dbe6b..33e67a24b 100644 +index f2a3c0b5b..8746d9071 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -1826,7 +1826,8 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) +@@ -1829,7 +1829,8 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) * bus_resume methods. */ if (hdev->parent) { /* normal device */ @@ -62203,7 +62007,7 @@ index af15dbe6b..33e67a24b 100644 const struct hc_driver *drv = bus_to_hcd(hdev->bus)->driver; diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c -index baf80e2ac..465de8233 100644 +index f03ee889e..a2397a197 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c @@ -322,6 +322,10 @@ static const struct usb_device_id usb_quirk_list[] = { @@ -62217,7 +62021,7 @@ index baf80e2ac..465de8233 100644 /* appletouch */ { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME }, -@@ -411,6 +415,10 @@ static const struct usb_device_id usb_quirk_list[] = { +@@ -414,6 +418,10 @@ static const struct usb_device_id usb_quirk_list[] = { /* Generic RTL8153 based ethernet adapters */ { USB_DEVICE(0x0bda, 0x8153), .driver_info = USB_QUIRK_NO_LPM }, @@ -62443,7 +62247,7 @@ index a98079990..553382ce3 100644 .suspend = composite_suspend, diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c -index 9b7fa53d6..13cd4a21a 100644 +index d51ea1c05..1478f76c5 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -10,6 +10,32 @@ @@ -62569,7 +62373,7 @@ index 9b7fa53d6..13cd4a21a 100644 static void configfs_composite_unbind(struct usb_gadget *gadget) { struct usb_composite_dev *cdev; -@@ -1447,6 +1533,51 @@ static void configfs_composite_unbind(struct usb_gadget *gadget) +@@ -1449,6 +1535,51 @@ static void configfs_composite_unbind(struct usb_gadget *gadget) spin_unlock_irqrestore(&gi->spinlock, flags); } @@ -62621,7 +62425,7 @@ index 9b7fa53d6..13cd4a21a 100644 static int configfs_composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) { -@@ -1472,6 +1603,8 @@ static int configfs_composite_setup(struct usb_gadget *gadget, +@@ -1474,6 +1605,8 @@ static int configfs_composite_setup(struct usb_gadget *gadget, return ret; } @@ -62630,7 +62434,7 @@ index 9b7fa53d6..13cd4a21a 100644 static void configfs_composite_disconnect(struct usb_gadget *gadget) { struct usb_composite_dev *cdev; -@@ -1482,6 +1615,14 @@ static void configfs_composite_disconnect(struct usb_gadget *gadget) +@@ -1484,6 +1617,14 @@ static void configfs_composite_disconnect(struct usb_gadget *gadget) if (!cdev) return; @@ -62645,7 +62449,7 @@ index 9b7fa53d6..13cd4a21a 100644 gi = container_of(cdev, struct gadget_info, cdev); spin_lock_irqsave(&gi->spinlock, flags); cdev = get_gadget_data(gadget); -@@ -1490,10 +1631,36 @@ static void configfs_composite_disconnect(struct usb_gadget *gadget) +@@ -1492,10 +1633,36 @@ static void configfs_composite_disconnect(struct usb_gadget *gadget) return; } @@ -62682,7 +62486,7 @@ index 9b7fa53d6..13cd4a21a 100644 static void configfs_composite_suspend(struct usb_gadget *gadget) { struct usb_composite_dev *cdev; -@@ -1542,10 +1709,13 @@ static const struct usb_gadget_driver configfs_driver_template = { +@@ -1544,10 +1711,13 @@ static const struct usb_gadget_driver configfs_driver_template = { .bind = configfs_composite_bind, .unbind = configfs_composite_unbind, @@ -62698,7 +62502,7 @@ index 9b7fa53d6..13cd4a21a 100644 .suspend = configfs_composite_suspend, .resume = configfs_composite_resume, -@@ -1557,6 +1727,91 @@ static const struct usb_gadget_driver configfs_driver_template = { +@@ -1559,6 +1729,91 @@ static const struct usb_gadget_driver configfs_driver_template = { .match_existing_only = 1, }; @@ -62790,7 +62594,7 @@ index 9b7fa53d6..13cd4a21a 100644 static struct config_group *gadgets_make( struct config_group *group, const char *name) -@@ -1609,7 +1864,11 @@ static struct config_group *gadgets_make( +@@ -1611,7 +1866,11 @@ static struct config_group *gadgets_make( if (!gi->composite.gadget_driver.function) goto err; @@ -62802,7 +62606,7 @@ index 9b7fa53d6..13cd4a21a 100644 err: kfree(gi); return ERR_PTR(-ENOMEM); -@@ -1617,7 +1876,11 @@ static struct config_group *gadgets_make( +@@ -1619,7 +1878,11 @@ static struct config_group *gadgets_make( static void gadgets_drop(struct config_group *group, struct config_item *item) { @@ -62814,7 +62618,7 @@ index 9b7fa53d6..13cd4a21a 100644 } static struct configfs_group_operations gadgets_ops = { -@@ -1657,6 +1920,13 @@ static int __init gadget_cfs_init(void) +@@ -1659,6 +1922,13 @@ static int __init gadget_cfs_init(void) config_group_init(&gadget_subsys.su_group); ret = configfs_register_subsystem(&gadget_subsys); @@ -62828,7 +62632,7 @@ index 9b7fa53d6..13cd4a21a 100644 return ret; } module_init(gadget_cfs_init); -@@ -1664,5 +1934,10 @@ module_init(gadget_cfs_init); +@@ -1666,5 +1936,10 @@ module_init(gadget_cfs_init); static void __exit gadget_cfs_exit(void) { configfs_unregister_subsystem(&gadget_subsys); @@ -62882,7 +62686,7 @@ index 1eb4fa2e6..177645f32 100644 } EXPORT_SYMBOL_GPL(usb_ep_autoconfig_ss); diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c -index cbb7947f3..32475df2e 100644 +index bb0d92837..daa2a13b4 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -71,7 +71,7 @@ struct ffs_function { @@ -62894,7 +62698,7 @@ index cbb7947f3..32475df2e 100644 short *interfaces_nums; struct usb_function function; -@@ -2799,7 +2799,7 @@ static int __ffs_func_bind_do_descs(enum ffs_entity_type type, u8 *valuep, +@@ -2827,7 +2827,7 @@ static int __ffs_func_bind_do_descs(enum ffs_entity_type type, u8 *valuep, struct ffs_function *func = priv; struct ffs_ep *ffs_ep; unsigned ep_desc_id; @@ -62903,7 +62707,7 @@ index cbb7947f3..32475df2e 100644 static const char *speed_names[] = { "full", "high", "super" }; if (type != FFS_DESCRIPTOR) -@@ -2872,8 +2872,9 @@ static int __ffs_func_bind_do_descs(enum ffs_entity_type type, u8 *valuep, +@@ -2900,8 +2900,9 @@ static int __ffs_func_bind_do_descs(enum ffs_entity_type type, u8 *valuep, ffs_ep->ep = ep; ffs_ep->req = req; @@ -62915,7 +62719,7 @@ index cbb7947f3..32475df2e 100644 /* * If we use virtual address mapping, we restore * original bEndpointAddress value. -@@ -3408,7 +3409,10 @@ static void ffs_func_resume(struct usb_function *f) +@@ -3436,7 +3437,10 @@ static void ffs_func_resume(struct usb_function *f) static int ffs_func_revmap_ep(struct ffs_function *func, u8 num) { @@ -62928,7 +62732,7 @@ index cbb7947f3..32475df2e 100644 } diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c -index f48a00e49..31cc58171 100644 +index fecdba85a..baf8dee72 100644 --- a/drivers/usb/gadget/function/f_uvc.c +++ b/drivers/usb/gadget/function/f_uvc.c @@ -124,6 +124,18 @@ static struct usb_interface_descriptor uvc_streaming_intf_alt0 = { @@ -63185,13 +62989,13 @@ index f48a00e49..31cc58171 100644 + if (ret) + return ret; + usb_ep_enable(uvc->video.ep); -+ + +- if (!uvc->video.ep) + memset(&v4l2_event, 0, sizeof(v4l2_event)); + v4l2_event.type = UVC_EVENT_STREAMON; + v4l2_event_queue(&uvc->vdev, &v4l2_event); + return USB_GADGET_DELAYED_STATUS; - -- if (!uvc->video.ep) ++ + default: return -EINVAL; + } @@ -63641,7 +63445,7 @@ index f48a00e49..31cc58171 100644 ret = uvcg_attach_configfs(opts); if (ret < 0) { -@@ -948,6 +1242,8 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi) +@@ -974,6 +1268,8 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi) uvc->func.disable = uvc_function_disable; uvc->func.setup = uvc_function_setup; uvc->func.free_func = uvc_free; @@ -63701,18 +63505,18 @@ index 9a01a7d4f..3e92a28d8 100644 #endif /* U_UVC_H */ diff --git a/drivers/usb/gadget/function/uvc.h b/drivers/usb/gadget/function/uvc.h -index 893aaa70f..ed28b90f6 100644 +index 6c4fc4913..0ea4405ff 100644 --- a/drivers/usb/gadget/function/uvc.h +++ b/drivers/usb/gadget/function/uvc.h -@@ -14,6 +14,7 @@ - #include +@@ -15,6 +15,7 @@ #include #include + #include +#include #include #include -@@ -68,6 +69,7 @@ extern unsigned int uvc_gadget_trace_param; +@@ -69,6 +70,7 @@ extern unsigned int uvc_gadget_trace_param; #define UVC_NUM_REQUESTS 4 #define UVC_MAX_REQUEST_SIZE 64 #define UVC_MAX_EVENTS 4 @@ -63720,7 +63524,7 @@ index 893aaa70f..ed28b90f6 100644 /* ------------------------------------------------------------------------ * Structures -@@ -89,8 +91,8 @@ struct uvc_video { +@@ -90,8 +92,8 @@ struct uvc_video { /* Requests */ unsigned int req_size; @@ -63731,16 +63535,16 @@ index 893aaa70f..ed28b90f6 100644 struct list_head req_free; spinlock_t req_lock; -@@ -118,6 +120,8 @@ struct uvc_device { - struct usb_function func; +@@ -120,6 +122,8 @@ struct uvc_device { struct uvc_video video; bool func_connected; + wait_queue_head_t func_connected_queue; + /* for creating and issuing QoS requests */ + struct pm_qos_request pm_qos; /* Descriptors */ struct { -@@ -138,6 +142,7 @@ struct uvc_device { +@@ -140,6 +144,7 @@ struct uvc_device { /* Events */ unsigned int event_length; unsigned int event_setup_out : 1; @@ -63749,7 +63553,7 @@ index 893aaa70f..ed28b90f6 100644 static inline struct uvc_device *to_uvc(struct usb_function *f) diff --git a/drivers/usb/gadget/function/uvc_queue.c b/drivers/usb/gadget/function/uvc_queue.c -index 61e2c94cc..3cc3da8ff 100644 +index cab1e3046..0f5e6fb93 100644 --- a/drivers/usb/gadget/function/uvc_queue.c +++ b/drivers/usb/gadget/function/uvc_queue.c @@ -124,6 +124,14 @@ int uvcg_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type, @@ -63768,7 +63572,7 @@ index 61e2c94cc..3cc3da8ff 100644 if (ret) return ret; diff --git a/drivers/usb/gadget/function/uvc_v4l2.c b/drivers/usb/gadget/function/uvc_v4l2.c -index 197c26f7a..10fab9220 100644 +index 65abd55ce..4216c9147 100644 --- a/drivers/usb/gadget/function/uvc_v4l2.c +++ b/drivers/usb/gadget/function/uvc_v4l2.c @@ -41,6 +41,7 @@ uvc_send_response(struct uvc_device *uvc, struct uvc_request_data *data) @@ -63814,7 +63618,7 @@ index 197c26f7a..10fab9220 100644 return 0; } -@@ -389,6 +402,9 @@ const struct v4l2_file_operations uvc_v4l2_fops = { +@@ -390,6 +403,9 @@ const struct v4l2_file_operations uvc_v4l2_fops = { .open = uvc_v4l2_open, .release = uvc_v4l2_release, .unlocked_ioctl = video_ioctl2, @@ -63825,7 +63629,7 @@ index 197c26f7a..10fab9220 100644 .poll = uvc_v4l2_poll, #ifndef CONFIG_MMU diff --git a/drivers/usb/gadget/function/uvc_video.c b/drivers/usb/gadget/function/uvc_video.c -index 633e23d58..5311b0f40 100644 +index 5ce548c23..cae5c2b62 100644 --- a/drivers/usb/gadget/function/uvc_video.c +++ b/drivers/usb/gadget/function/uvc_video.c @@ -12,12 +12,14 @@ @@ -63941,7 +63745,7 @@ index 633e23d58..5311b0f40 100644 return ret; diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c -index da691a69f..0e6dbf9da 100644 +index 3a3b5a03d..06c748702 100644 --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -755,7 +755,7 @@ int usb_gadget_deactivate(struct usb_gadget *gadget) @@ -63969,7 +63773,7 @@ index e5a971b83..a345f2982 100644 max_sectors = PAGE_SIZE >> 9; if (queue_max_hw_sectors(sdev->request_queue) > max_sectors) diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h -index 29191d33c..07150541e 100644 +index 4993227ab..c151e7864 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -927,6 +927,12 @@ UNUSUAL_DEV( 0x05e3, 0x0723, 0x9451, 0x9451, @@ -63986,10 +63790,10 @@ index 29191d33c..07150541e 100644 * Reported by Hanno Boeck * Taken from the Lycoris Kernel diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h -index 4051c8cd0..1fcb871c6 100644 +index 251778d14..5c428b0c0 100644 --- a/drivers/usb/storage/unusual_uas.h +++ b/drivers/usb/storage/unusual_uas.h -@@ -62,6 +62,12 @@ UNUSUAL_DEV(0x0984, 0x0301, 0x0128, 0x0128, +@@ -76,6 +76,12 @@ UNUSUAL_DEV(0x0b05, 0x1932, 0x0000, 0x9999, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_IGNORE_UAS), @@ -64002,7 +63806,7 @@ index 4051c8cd0..1fcb871c6 100644 /* Reported-by: David Webb */ UNUSUAL_DEV(0x0bc2, 0x331a, 0x0000, 0x9999, "Seagate", -@@ -97,6 +103,12 @@ UNUSUAL_DEV(0x152d, 0x0578, 0x0000, 0x9999, +@@ -118,6 +124,12 @@ UNUSUAL_DEV(0x152d, 0x0578, 0x0000, 0x9999, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_BROKEN_FUA), @@ -64015,9 +63819,9 @@ index 4051c8cd0..1fcb871c6 100644 /* Reported-by: Thinh Nguyen */ UNUSUAL_DEV(0x154b, 0xf00b, 0x0000, 0x9999, "PNY", -@@ -111,6 +123,12 @@ UNUSUAL_DEV(0x154b, 0xf00d, 0x0000, 0x9999, +@@ -139,6 +151,12 @@ UNUSUAL_DEV(0x17ef, 0x3899, 0x0000, 0x9999, USB_SC_DEVICE, USB_PR_DEVICE, NULL, - US_FL_NO_ATA_1X), + US_FL_IGNORE_UAS), +UNUSUAL_DEV(0x174c, 0x55aa, 0x0000, 0x9999, + "WINTOGO", @@ -64029,18 +63833,10 @@ index 4051c8cd0..1fcb871c6 100644 UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999, "VIA", diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig -index 427a993c7..e4c52ca82 100644 +index 427a993c7..c0c623a82 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig -@@ -18,6 +18,7 @@ source "drivers/gpu/host1x/Kconfig" - source "drivers/gpu/ipu-v3/Kconfig" - - source "drivers/gpu/drm/Kconfig" -+source "drivers/gpu/arm/Kconfig" - - menu "Frame buffer Devices" - source "drivers/video/fbdev/Kconfig" -@@ -25,6 +26,10 @@ endmenu +@@ -25,6 +25,10 @@ endmenu source "drivers/video/backlight/Kconfig" @@ -64076,6 +63872,3 @@ index 1cf924f3a..cd3676b96 100644 pb->lth_brightness = data->lth_brightness * (div_u64(state.period, pb->scale)); --- -2.25.1 - diff --git a/linux-5.10/yangfan_patch/hdf.patch b/linux-5.10/yangfan_patch/hdf.patch index 7373b8c8a35e7afa7391a481e6f1a8fcdd242069..fd2e20938b008c85eee7e95f624b8bdf6344c281 100644 --- a/linux-5.10/yangfan_patch/hdf.patch +++ b/linux-5.10/yangfan_patch/hdf.patch @@ -55,7 +55,7 @@ diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 4acb583c9..ddcaf4cdc 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile -@@ -2,6 +2,15 @@ +@@ -2,6 +2,19 @@ # # Makefile for the HID driver # @@ -66,6 +66,10 @@ index 4acb583c9..ddcaf4cdc 100644 + $(HDF_ROOT_DIR)/framework/include/utils \ + $(HDF_ROOT_DIR)/framework/include/osal \ + $(HDF_ROOT_DIR)/framework/ability/sbuf/include \ ++ $(HDF_ROOT_DIR)/inner_api/utils \ ++ $(HDF_ROOT_DIR)/inner_api/osal/shared \ ++ $(HDF_ROOT_DIR)/inner_api/host/shared \ ++ $(HDF_ROOT_DIR)/inner_api/core \ + $(HDF_ROOT_DIR)/khdf/osal/include \ + $(HDF_ROOT_DIR)/evdev hid-y := hid-core.o hid-input.o hid-quirks.o @@ -304,7 +308,7 @@ diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index a48e5f2d8..2a1480815 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile -@@ -85,3 +85,17 @@ obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND) += xen-kbdfront.o +@@ -85,3 +85,21 @@ obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND) += xen-kbdfront.o obj-$(CONFIG_INPUT_YEALINK) += yealink.o obj-$(CONFIG_INPUT_IDEAPAD_SLIDEBAR) += ideapad_slidebar.o @@ -319,6 +323,10 @@ index a48e5f2d8..2a1480815 100644 + -I$(srctree)/drivers/hdf/framework/core/host/include \ + -I$(srctree)/drivers/hdf/framework/core/shared/include \ + -I$(srctree)/drivers/hdf/framework/utils/include \ ++ -I$(srctree)/drivers/hdf/inner_api/osal/shared \ ++ -I$(srctree)/drivers/hdf/inner_api/host/shared \ ++ -I$(srctree)/drivers/hdf/inner_api/utils \ ++ -I$(srctree)/drivers/hdf/inner_api/core \ + -I$(srctree)/drivers/hdf/khdf/osal/include +ccflags-y +=-I$(srctree)/bounds_checking_function/include \ + -I$(srctree)/drivers/hdf/evdev diff --git a/linux-5.10/yangfan_patch/include.patch b/linux-5.10/yangfan_patch/include.patch index a2369284f48ac26b2eb281d0c975b2064fc5a7cc..7e715fe86cd97c6e2efee4c5e4181ab1f756075a 100644 --- a/linux-5.10/yangfan_patch/include.patch +++ b/linux-5.10/yangfan_patch/include.patch @@ -2473,10 +2473,10 @@ index ce8df2186..e8703b6fc 100644 #endif /* __FAN53555_H__ */ diff --git a/include/linux/sched.h b/include/linux/sched.h -index a67583bfa..c7290fa02 100644 +index 3dca22f2a..ef9d4a196 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1366,7 +1366,7 @@ struct task_struct { +@@ -1356,7 +1356,7 @@ struct task_struct { u64 timer_slack_ns; u64 default_timer_slack_ns; @@ -2485,18 +2485,6 @@ index a67583bfa..c7290fa02 100644 unsigned int kasan_depth; #endif -@@ -1702,11 +1702,9 @@ extern struct pid *cad_pid; - #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ - #define PF_RANDOMIZE 0x00400000 /* Randomize virtual address space */ - #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ -- - #ifdef CONFIG_WGCM - #define PF_WGCM_WORKER 0x01000000 /* WGCM worker*/ - #endif -- - #define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_mask */ - #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ - #define PF_MEMALLOC_NOCMA 0x10000000 /* All allocation request will have _GFP_MOVABLE cleared */ diff --git a/include/linux/sched/hotplug.h b/include/linux/sched/hotplug.h index 9a62ffdd2..89fb9b027 100644 --- a/include/linux/sched/hotplug.h @@ -3724,7 +3712,7 @@ index ad16f7731..f302ab6db 100644 /* This part must be outside protection */ diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h -index 11b133fa9..421c9848c 100644 +index dd5fff2bb..6c6a23b4b 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -203,6 +203,7 @@ TRACE_EVENT(sched_migrate_task, diff --git a/linux-5.10/yangfan_patch/kernel.patch b/linux-5.10/yangfan_patch/kernel.patch index 93fe52fff4fe2a6821cf75921a2fe50cc10ca2e8..7f78888615fc8cbafb6ddc8b008b6a65ffc518f9 100644 --- a/linux-5.10/yangfan_patch/kernel.patch +++ b/linux-5.10/yangfan_patch/kernel.patch @@ -389,10 +389,10 @@ index 3173fe473..f4d318733 100644 } /* -@@ -2217,22 +2239,20 @@ static void cpuset_attach(struct cgroup_taskset *tset) - cgroup_taskset_first(tset, &css); +@@ -2218,22 +2240,20 @@ static void cpuset_attach(struct cgroup_taskset *tset) cs = css_cs(css); + lockdep_assert_cpus_held(); /* see cgroup_attach_lock() */ - percpu_down_write(&cpuset_rwsem); - - /* prepare for attach */ @@ -418,7 +418,7 @@ index 3173fe473..f4d318733 100644 cpuset_change_task_nodemask(task, &cpuset_attach_nodemask_to); cpuset_update_task_spread_flag(cs, task); -@@ -2271,7 +2291,7 @@ static void cpuset_attach(struct cgroup_taskset *tset) +@@ -2272,7 +2292,7 @@ static void cpuset_attach(struct cgroup_taskset *tset) if (!cs->attach_in_progress) wake_up(&cpuset_attach_wq); @@ -427,7 +427,7 @@ index 3173fe473..f4d318733 100644 } /* The various types of files and directories in a cpuset file system */ -@@ -2303,7 +2323,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft, +@@ -2304,7 +2324,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft, int retval = 0; get_online_cpus(); @@ -436,7 +436,7 @@ index 3173fe473..f4d318733 100644 if (!is_cpuset_online(cs)) { retval = -ENODEV; goto out_unlock; -@@ -2339,7 +2359,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft, +@@ -2340,7 +2360,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft, break; } out_unlock: @@ -445,7 +445,7 @@ index 3173fe473..f4d318733 100644 put_online_cpus(); return retval; } -@@ -2352,7 +2372,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft, +@@ -2353,7 +2373,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft, int retval = -ENODEV; get_online_cpus(); @@ -454,7 +454,7 @@ index 3173fe473..f4d318733 100644 if (!is_cpuset_online(cs)) goto out_unlock; -@@ -2365,7 +2385,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft, +@@ -2366,7 +2386,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft, break; } out_unlock: @@ -463,7 +463,7 @@ index 3173fe473..f4d318733 100644 put_online_cpus(); return retval; } -@@ -2406,7 +2426,7 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of, +@@ -2407,7 +2427,7 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of, flush_work(&cpuset_hotplug_work); get_online_cpus(); @@ -472,7 +472,7 @@ index 3173fe473..f4d318733 100644 if (!is_cpuset_online(cs)) goto out_unlock; -@@ -2430,7 +2450,7 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of, +@@ -2431,7 +2451,7 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of, free_cpuset(trialcs); out_unlock: @@ -481,7 +481,7 @@ index 3173fe473..f4d318733 100644 put_online_cpus(); kernfs_unbreak_active_protection(of->kn); css_put(&cs->css); -@@ -2563,13 +2583,13 @@ static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf, +@@ -2564,13 +2584,13 @@ static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf, css_get(&cs->css); get_online_cpus(); @@ -497,7 +497,7 @@ index 3173fe473..f4d318733 100644 put_online_cpus(); css_put(&cs->css); return retval ?: nbytes; -@@ -2777,7 +2797,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) +@@ -2778,7 +2798,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) return 0; get_online_cpus(); @@ -506,7 +506,7 @@ index 3173fe473..f4d318733 100644 set_bit(CS_ONLINE, &cs->flags); if (is_spread_page(parent)) -@@ -2829,7 +2849,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) +@@ -2830,7 +2850,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) cpumask_copy(cs->effective_cpus, parent->cpus_allowed); spin_unlock_irq(&callback_lock); out_unlock: @@ -515,7 +515,7 @@ index 3173fe473..f4d318733 100644 put_online_cpus(); return 0; } -@@ -2850,7 +2870,7 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css) +@@ -2851,7 +2871,7 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css) struct cpuset *cs = css_cs(css); get_online_cpus(); @@ -524,7 +524,7 @@ index 3173fe473..f4d318733 100644 if (is_partition_root(cs)) update_prstate(cs, 0); -@@ -2869,7 +2889,7 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css) +@@ -2870,7 +2890,7 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css) cpuset_dec(); clear_bit(CS_ONLINE, &cs->flags); @@ -533,7 +533,7 @@ index 3173fe473..f4d318733 100644 put_online_cpus(); } -@@ -2882,7 +2902,7 @@ static void cpuset_css_free(struct cgroup_subsys_state *css) +@@ -2883,7 +2903,7 @@ static void cpuset_css_free(struct cgroup_subsys_state *css) static void cpuset_bind(struct cgroup_subsys_state *root_css) { @@ -542,7 +542,7 @@ index 3173fe473..f4d318733 100644 spin_lock_irq(&callback_lock); if (is_in_v2_mode()) { -@@ -2895,7 +2915,7 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css) +@@ -2896,7 +2916,7 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css) } spin_unlock_irq(&callback_lock); @@ -551,7 +551,7 @@ index 3173fe473..f4d318733 100644 } /* -@@ -2908,7 +2928,6 @@ static void cpuset_fork(struct task_struct *task) +@@ -2909,7 +2929,6 @@ static void cpuset_fork(struct task_struct *task) if (task_css_is_root(task, cpuset_cgrp_id)) return; @@ -559,7 +559,7 @@ index 3173fe473..f4d318733 100644 task->mems_allowed = current->mems_allowed; } -@@ -2937,7 +2956,6 @@ struct cgroup_subsys cpuset_cgrp_subsys = { +@@ -2938,7 +2957,6 @@ struct cgroup_subsys cpuset_cgrp_subsys = { int __init cpuset_init(void) { @@ -567,7 +567,7 @@ index 3173fe473..f4d318733 100644 BUG_ON(!alloc_cpumask_var(&top_cpuset.cpus_allowed, GFP_KERNEL)); BUG_ON(!alloc_cpumask_var(&top_cpuset.cpus_requested, GFP_KERNEL)); -@@ -3012,7 +3030,7 @@ hotplug_update_tasks_legacy(struct cpuset *cs, +@@ -3013,7 +3031,7 @@ hotplug_update_tasks_legacy(struct cpuset *cs, is_empty = cpumask_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed); @@ -576,7 +576,7 @@ index 3173fe473..f4d318733 100644 /* * Move tasks to the nearest ancestor with execution resources, -@@ -3022,7 +3040,7 @@ hotplug_update_tasks_legacy(struct cpuset *cs, +@@ -3023,7 +3041,7 @@ hotplug_update_tasks_legacy(struct cpuset *cs, if (is_empty) remove_tasks_in_empty_cpuset(cs); @@ -585,7 +585,7 @@ index 3173fe473..f4d318733 100644 } static void -@@ -3072,14 +3090,14 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp) +@@ -3073,14 +3091,14 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp) retry: wait_event(cpuset_attach_wq, cs->attach_in_progress == 0); @@ -602,7 +602,7 @@ index 3173fe473..f4d318733 100644 goto retry; } -@@ -3151,7 +3169,7 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp) +@@ -3152,7 +3170,7 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp) hotplug_update_tasks_legacy(cs, &new_cpus, &new_mems, cpus_updated, mems_updated); @@ -611,7 +611,7 @@ index 3173fe473..f4d318733 100644 } /** -@@ -3170,7 +3188,7 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp) +@@ -3171,7 +3189,7 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp) * Note that CPU offlining during suspend is ignored. We don't modify * cpusets across suspend/resume cycles at all. */ @@ -620,7 +620,7 @@ index 3173fe473..f4d318733 100644 { static cpumask_t new_cpus; static nodemask_t new_mems; -@@ -3181,7 +3199,7 @@ static void cpuset_hotplug_workfn(struct work_struct *work) +@@ -3182,7 +3200,7 @@ static void cpuset_hotplug_workfn(struct work_struct *work) if (on_dfl && !alloc_cpumasks(NULL, &tmp)) ptmp = &tmp; @@ -629,7 +629,7 @@ index 3173fe473..f4d318733 100644 /* fetch the available cpus/mems and find out which changed how */ cpumask_copy(&new_cpus, cpu_active_mask); -@@ -3238,7 +3256,7 @@ static void cpuset_hotplug_workfn(struct work_struct *work) +@@ -3239,7 +3257,7 @@ static void cpuset_hotplug_workfn(struct work_struct *work) update_tasks_nodemask(&top_cpuset); } @@ -638,7 +638,7 @@ index 3173fe473..f4d318733 100644 /* if cpus or mems changed, we need to propagate to descendants */ if (cpus_updated || mems_updated) { -@@ -3282,6 +3300,7 @@ void cpuset_wait_for_hotplug(void) +@@ -3283,6 +3301,7 @@ void cpuset_wait_for_hotplug(void) { flush_work(&cpuset_hotplug_work); } @@ -646,7 +646,7 @@ index 3173fe473..f4d318733 100644 /* * Keep top_cpuset.mems_allowed tracking node_states[N_MEMORY]. -@@ -3337,11 +3356,11 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) +@@ -3338,11 +3357,11 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) spin_lock_irqsave(&callback_lock, flags); rcu_read_lock(); @@ -660,7 +660,7 @@ index 3173fe473..f4d318733 100644 /** * cpuset_cpus_allowed_fallback - final fallback before complete catastrophe. * @tsk: pointer to task_struct with which the scheduler is struggling -@@ -3356,9 +3375,17 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) +@@ -3357,9 +3376,17 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) void cpuset_cpus_allowed_fallback(struct task_struct *tsk) { @@ -936,15 +936,15 @@ index 32391acc8..545958377 100644 #include "power.h" -@@ -139,6 +140,7 @@ static void s2idle_loop(void) +@@ -138,6 +139,7 @@ static void s2idle_loop(void) + break; } - pm_wakeup_clear(false); + clear_wakeup_reasons(); - s2idle_enter(); } -@@ -359,6 +361,7 @@ static int suspend_prepare(suspend_state_t state) + +@@ -357,6 +359,7 @@ static int suspend_prepare(suspend_state_t state) if (!error) return 0; @@ -952,7 +952,7 @@ index 32391acc8..545958377 100644 suspend_stats.failed_freeze++; dpm_save_failed_step(SUSPEND_FREEZE); pm_notifier_call_chain(PM_POST_SUSPEND); -@@ -388,7 +391,7 @@ void __weak arch_suspend_enable_irqs(void) +@@ -386,7 +389,7 @@ void __weak arch_suspend_enable_irqs(void) */ static int suspend_enter(suspend_state_t state, bool *wakeup) { @@ -961,7 +961,7 @@ index 32391acc8..545958377 100644 error = platform_suspend_prepare(state); if (error) -@@ -396,7 +399,11 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) +@@ -394,7 +397,11 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) error = dpm_suspend_late(PMSG_SUSPEND); if (error) { @@ -973,7 +973,7 @@ index 32391acc8..545958377 100644 goto Platform_finish; } error = platform_suspend_prepare_late(state); -@@ -405,7 +412,11 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) +@@ -403,7 +410,11 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) error = dpm_suspend_noirq(PMSG_SUSPEND); if (error) { @@ -985,7 +985,7 @@ index 32391acc8..545958377 100644 goto Platform_early_resume; } error = platform_suspend_prepare_noirq(state); -@@ -421,8 +432,10 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) +@@ -419,8 +430,10 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) } error = suspend_disable_secondary_cpus(); @@ -997,7 +997,7 @@ index 32391acc8..545958377 100644 arch_suspend_disable_irqs(); BUG_ON(!irqs_disabled()); -@@ -493,6 +506,8 @@ int suspend_devices_and_enter(suspend_state_t state) +@@ -491,6 +504,8 @@ int suspend_devices_and_enter(suspend_state_t state) error = dpm_suspend_start(PMSG_SUSPEND); if (error) { pr_err("Some devices failed to suspend, or early wake event detected\n"); @@ -1328,7 +1328,7 @@ diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index d5c00fa02..689cc1a63 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c -@@ -1390,6 +1390,27 @@ static void dequeue_rt_entity(struct sched_rt_entity *rt_se, unsigned int flags) +@@ -1393,6 +1393,27 @@ static void dequeue_rt_entity(struct sched_rt_entity *rt_se, unsigned int flags) enqueue_top_rt_rq(&rq->rt); } @@ -1356,7 +1356,7 @@ index d5c00fa02..689cc1a63 100644 /* * Adding/removing a task to/from a priority array: */ -@@ -1397,6 +1418,7 @@ static void +@@ -1400,6 +1421,7 @@ static void enqueue_task_rt(struct rq *rq, struct task_struct *p, int flags) { struct sched_rt_entity *rt_se = &p->rt; @@ -1364,7 +1364,7 @@ index d5c00fa02..689cc1a63 100644 if (flags & ENQUEUE_WAKEUP) rt_se->timeout = 0; -@@ -1404,7 +1426,8 @@ enqueue_task_rt(struct rq *rq, struct task_struct *p, int flags) +@@ -1407,7 +1429,8 @@ enqueue_task_rt(struct rq *rq, struct task_struct *p, int flags) enqueue_rt_entity(rt_se, flags); walt_inc_cumulative_runnable_avg(rq, p); @@ -1374,7 +1374,7 @@ index d5c00fa02..689cc1a63 100644 enqueue_pushable_task(rq, p); } -@@ -1461,7 +1484,10 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags) +@@ -1464,7 +1487,10 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags) { struct task_struct *curr; struct rq *rq; @@ -1385,7 +1385,7 @@ index d5c00fa02..689cc1a63 100644 /* For anything but wake ups, just return the task_cpu */ if (sd_flag != SD_BALANCE_WAKE && sd_flag != SD_BALANCE_FORK) -@@ -1471,6 +1497,8 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags) +@@ -1474,6 +1500,8 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags) rcu_read_lock(); curr = READ_ONCE(rq->curr); /* unlocked access */ @@ -1394,9 +1394,9 @@ index d5c00fa02..689cc1a63 100644 /* * If the current task on @p's runqueue is an RT task, then -@@ -1502,6 +1530,15 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags) - unlikely(rt_task(curr)) && - (curr->nr_cpus_allowed < 2 || curr->prio <= p->prio); +@@ -1508,6 +1536,15 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags) + test |= sysctl_sched_enable_rt_cas; + #endif + /* + * Respect the sync flag as long as the task can run on this CPU. diff --git a/linux-5.10/yangfan_patch/net.patch b/linux-5.10/yangfan_patch/net.patch index f98289c8ff3ea74f454f7a158f68402472bff98c..db93141136b8124add950961dd50ebdaa4f6a65c 100644 --- a/linux-5.10/yangfan_patch/net.patch +++ b/linux-5.10/yangfan_patch/net.patch @@ -64,69 +64,7 @@ index cf165b0d1..2a14519a8 100644 sock_put(sk); } -@@ -280,8 +280,7 @@ static int sco_connect(struct hci_dev *hdev, struct sock *sk) - return err; - } - --static int sco_send_frame(struct sock *sk, void *buf, int len, -- unsigned int msg_flags) -+static int sco_send_frame(struct sock *sk, struct msghdr *msg, int len) - { - struct sco_conn *conn = sco_pi(sk)->conn; - struct sk_buff *skb; -@@ -293,11 +292,15 @@ static int sco_send_frame(struct sock *sk, void *buf, int len, - - BT_DBG("sk %p len %d", sk, len); - -- skb = bt_skb_send_alloc(sk, len, msg_flags & MSG_DONTWAIT, &err); -+ skb = bt_skb_send_alloc(sk, len, msg->msg_flags & MSG_DONTWAIT, &err); - if (!skb) - return err; - -- memcpy(skb_put(skb, len), buf, len); -+ if (memcpy_from_msg(skb_put(skb, len), msg, len)) { -+ kfree_skb(skb); -+ return -EFAULT; -+ } -+ - hci_send_sco(conn->hcon, skb); - - return len; -@@ -722,7 +725,6 @@ static int sco_sock_sendmsg(struct socket *sock, struct msghdr *msg, - size_t len) - { - struct sock *sk = sock->sk; -- void *buf; - int err; - - BT_DBG("sock %p, sk %p", sock, sk); -@@ -734,24 +736,14 @@ static int sco_sock_sendmsg(struct socket *sock, struct msghdr *msg, - if (msg->msg_flags & MSG_OOB) - return -EOPNOTSUPP; - -- buf = kmalloc(len, GFP_KERNEL); -- if (!buf) -- return -ENOMEM; -- -- if (memcpy_from_msg(buf, msg, len)) { -- kfree(buf); -- return -EFAULT; -- } -- - lock_sock(sk); - - if (sk->sk_state == BT_CONNECTED) -- err = sco_send_frame(sk, buf, len, msg->msg_flags); -+ err = sco_send_frame(sk, msg, len); - else - err = -ENOTCONN; - - release_sock(sk); -- kfree(buf); - return err; - } - -@@ -1108,10 +1100,10 @@ static void sco_conn_ready(struct sco_conn *conn) +@@ -1103,10 +1103,10 @@ static void sco_conn_ready(struct sco_conn *conn) if (sk) { sco_sock_clear_timer(sk); @@ -139,7 +77,7 @@ index cf165b0d1..2a14519a8 100644 } else { sco_conn_lock(conn); -@@ -1126,12 +1118,12 @@ static void sco_conn_ready(struct sco_conn *conn) +@@ -1121,12 +1121,12 @@ static void sco_conn_ready(struct sco_conn *conn) return; } @@ -154,7 +92,7 @@ index cf165b0d1..2a14519a8 100644 sco_conn_unlock(conn); return; } -@@ -1152,7 +1144,7 @@ static void sco_conn_ready(struct sco_conn *conn) +@@ -1147,7 +1147,7 @@ static void sco_conn_ready(struct sco_conn *conn) /* Wake up parent */ parent->sk_data_ready(parent); diff --git a/linux-5.10/yangfan_patch/sound.patch b/linux-5.10/yangfan_patch/sound.patch index 77f6059d2b6b4637ceec2264d5c9e40073355516..02209b23eba7b9788d1a5ad37e1404480bebdc46 100644 --- a/linux-5.10/yangfan_patch/sound.patch +++ b/linux-5.10/yangfan_patch/sound.patch @@ -74,26 +74,15 @@ index 2c5f7e905..51821334f 100644 cable->pause &= ~stream; err = cable->ops->start(dpcm); spin_unlock(&cable->lock); -@@ -608,15 +627,16 @@ static unsigned int loopback_jiffies_timer_pos_update +@@ -608,6 +627,7 @@ static unsigned int loopback_jiffies_timer_pos_update cable->streams[SNDRV_PCM_STREAM_CAPTURE]; - unsigned long delta_play = 0, delta_capt = 0; + unsigned long delta_play = 0, delta_capt = 0, cur_jiffies; unsigned int running, count1, count2; + unsigned long cur_jiffies = cycles_to_jiffies(); + cur_jiffies = jiffies; running = cable->running ^ cable->pause; - if (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) { -- delta_play = jiffies - dpcm_play->last_jiffies; -+ delta_play = cur_jiffies - dpcm_play->last_jiffies; - dpcm_play->last_jiffies += delta_play; - } - - if (running & (1 << SNDRV_PCM_STREAM_CAPTURE)) { -- delta_capt = jiffies - dpcm_capt->last_jiffies; -+ delta_capt = cur_jiffies - dpcm_capt->last_jiffies; - dpcm_capt->last_jiffies += delta_capt; - } - -@@ -842,7 +862,7 @@ static void loopback_jiffies_timer_dpcm_info(struct loopback_pcm *dpcm, +@@ -843,7 +863,7 @@ static void loopback_jiffies_timer_dpcm_info(struct loopback_pcm *dpcm, snd_iprintf(buffer, " irq_pos:\t\t%u\n", dpcm->irq_pos); snd_iprintf(buffer, " period_frac:\t%u\n", dpcm->period_size_frac); snd_iprintf(buffer, " last_jiffies:\t%lu (%lu)\n", @@ -103,7 +92,7 @@ index 2c5f7e905..51821334f 100644 } diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig -index 34c6dd04b..78e46839a 100644 +index 52c89a6f5..9aa44103e 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -89,6 +89,7 @@ config SND_SOC_ALL_CODECS @@ -114,7 +103,7 @@ index 34c6dd04b..78e46839a 100644 imply SND_SOC_ES8316 imply SND_SOC_ES8328_SPI imply SND_SOC_ES8328_I2C -@@ -761,6 +762,9 @@ config SND_SOC_DMIC +@@ -766,6 +767,9 @@ config SND_SOC_DMIC Enable support for the Generic Digital Microphone CODEC. Select this if your sound card has DMICs. @@ -124,7 +113,7 @@ index 34c6dd04b..78e46839a 100644 config SND_SOC_HDMI_CODEC tristate select SND_PCM_ELD -@@ -1024,6 +1028,9 @@ config SND_SOC_RK3328 +@@ -1029,6 +1033,9 @@ config SND_SOC_RK3328 tristate "Rockchip RK3328 audio CODEC" select REGMAP_MMIO @@ -281,7 +270,7 @@ index 65e814d46..83be7d21e 100644 obj-$(CONFIG_SND_SOC_ROCKCHIP_SPDIF) += snd-soc-rockchip-spdif.o diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c -index fa84ec695..165d027b4 100644 +index 785baf98f..165d027b4 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -15,11 +15,11 @@ @@ -561,7 +550,7 @@ index fa84ec695..165d027b4 100644 i2s->dev = &pdev->dev; i2s->grf = syscon_regmap_lookup_by_phandle(node, "rockchip,grf"); -@@ -609,26 +691,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev) +@@ -609,50 +691,40 @@ static int rockchip_i2s_probe(struct platform_device *pdev) i2s->pins = of_id->data; } @@ -580,17 +569,26 @@ index fa84ec695..165d027b4 100644 - i2s->mclk = devm_clk_get(&pdev->dev, "i2s_clk"); - if (IS_ERR(i2s->mclk)) { - dev_err(&pdev->dev, "Can't retrieve i2s master clock\n"); -- return PTR_ERR(i2s->mclk); +- ret = PTR_ERR(i2s->mclk); +- goto err_clk; - } - -- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- regs = devm_ioremap_resource(&pdev->dev, res); -+ regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res); - if (IS_ERR(regs)) - return PTR_ERR(regs); - -@@ -640,16 +703,28 @@ static int rockchip_i2s_probe(struct platform_device *pdev) - return PTR_ERR(i2s->regmap); + regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res); +- if (IS_ERR(regs)) { +- ret = PTR_ERR(regs); +- goto err_clk; +- } ++ if (IS_ERR(regs)) ++ return PTR_ERR(regs); + + i2s->regmap = devm_regmap_init_mmio(&pdev->dev, regs, + &rockchip_i2s_regmap_config); + if (IS_ERR(i2s->regmap)) { + dev_err(&pdev->dev, + "Failed to initialise managed register map\n"); +- ret = PTR_ERR(i2s->regmap); +- goto err_clk; ++ return PTR_ERR(i2s->regmap); } - i2s->playback_dma_data.addr = res->start + I2S_TXDR; @@ -625,7 +623,7 @@ index fa84ec695..165d027b4 100644 pm_runtime_enable(&pdev->dev); if (!pm_runtime_enabled(&pdev->dev)) { ret = i2s_runtime_resume(&pdev->dev); -@@ -657,33 +732,20 @@ static int rockchip_i2s_probe(struct platform_device *pdev) +@@ -660,33 +732,20 @@ static int rockchip_i2s_probe(struct platform_device *pdev) goto err_pm_disable; } @@ -663,11 +661,13 @@ index fa84ec695..165d027b4 100644 if (ret) { dev_err(&pdev->dev, "Could not register PCM\n"); goto err_suspend; -@@ -697,6 +759,8 @@ static int rockchip_i2s_probe(struct platform_device *pdev) +@@ -699,8 +758,9 @@ static int rockchip_i2s_probe(struct platform_device *pdev) + i2s_runtime_suspend(&pdev->dev); err_pm_disable: pm_runtime_disable(&pdev->dev); - -+ clk_disable_unprepare(i2s->hclk); +-err_clk: ++ + clk_disable_unprepare(i2s->hclk); + return ret; } @@ -928,7 +928,7 @@ index 674810851..7f00470ac 100644 return PTR_ERR(regs); diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c -index 75d4d317b..e60bf1f40 100644 +index 6333a2ecb..03b1f7e35 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1523,6 +1523,9 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) diff --git a/linux-5.10/zhiyuan_patch/hdf.patch b/linux-5.10/zhiyuan_patch/hdf.patch index 6f4972eb51c568d7aa875ad2a4583f9dc47af8f1..cb5dee5fc16b6f9fb786c6d0e6d6e8605523f7a6 100644 --- a/linux-5.10/zhiyuan_patch/hdf.patch +++ b/linux-5.10/zhiyuan_patch/hdf.patch @@ -109,7 +109,7 @@ diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 4acb583c92a6..ddcaf4cdcb9c 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile -@@ -2,6 +2,15 @@ +@@ -2,6 +2,19 @@ # # Makefile for the HID driver # @@ -120,6 +120,10 @@ index 4acb583c92a6..ddcaf4cdcb9c 100644 + $(HDF_ROOT_DIR)/framework/include/utils \ + $(HDF_ROOT_DIR)/framework/include/osal \ + $(HDF_ROOT_DIR)/framework/ability/sbuf/include \ ++ $(HDF_ROOT_DIR)/inner_api/utils \ ++ $(HDF_ROOT_DIR)/inner_api/osal/shared \ ++ $(HDF_ROOT_DIR)/inner_api/host/shared \ ++ $(HDF_ROOT_DIR)/inner_api/core \ + $(HDF_ROOT_DIR)/khdf/osal/include \ + $(HDF_ROOT_DIR)/evdev hid-y := hid-core.o hid-input.o hid-quirks.o