diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 5e12ddd78d..7cd7906dc9 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -81,6 +81,11 @@ config KERNEL_PROFILING Enable the extended profiling support mechanisms used by profilers such as OProfile. +config KERNEL_RPI_AXIPERF + bool "Compile the kernel with RaspberryPi AXI Performance monitors" + default y + depends on KERNEL_PERF_EVENTS && TARGET_bcm27xx + config KERNEL_UBSAN bool "Compile the kernel with undefined behaviour sanity checker" help @@ -368,6 +373,34 @@ config KERNEL_DEBUG_INFO help This will compile your kernel and modules with debug information. +config KERNEL_DEBUG_INFO_BTF + + bool "Enable additional BTF type information" + default n + depends on !HOST_OS_MACOS + depends on KERNEL_DEBUG_INFO && !KERNEL_DEBUG_INFO_REDUCED + select DWARVES + help + Generate BPF Type Format (BTF) information from DWARF debug info. + Turning this on expects presence of pahole tool, which will convert + DWARF type info into equivalent deduplicated BTF type info. + + Required to run BPF CO-RE applications. + +config KERNEL_DEBUG_INFO_REDUCED + bool "Reduce debugging information" + default y + depends on KERNEL_DEBUG_INFO + help + If you say Y here gcc is instructed to generate less debugging + information for structure types. This means that tools that + need full debugging information (like kgdb or systemtap) won't + be happy. But if you merely need debugging information to + resolve line numbers there is no loss. Advantage is that + build directory object sizes shrink dramatically over a full + DEBUG_INFO build and compile times are reduced too. + Only works with newer gcc versions. + config KERNEL_DEBUG_LL_UART_NONE bool default n @@ -422,10 +455,20 @@ config KERNEL_KPROBE_EVENTS bool default y if KERNEL_KPROBES +config KERNEL_BPF_EVENTS + bool "Compile the kernel with BPF event support" + default n + select KERNEL_KPROBES + help + Allows to attach BPF programs to kprobe, uprobe and tracepoint events. + This is required to use BPF maps of type BPF_MAP_TYPE_PERF_EVENT_ARRAY + for sending data from BPF programs to user-space for post-processing + or logging. + config KERNEL_BPF_KPROBE_OVERRIDE bool - depends on KERNEL_KPROBES default n + depends on KERNEL_KPROBES config KERNEL_AIO bool "Compile the kernel with asynchronous IO support" diff --git a/include/kernel-build.mk b/include/kernel-build.mk index 80da4455bc..cc651f29b1 100644 --- a/include/kernel-build.mk +++ b/include/kernel-build.mk @@ -162,7 +162,6 @@ define BuildKernel $(LINUX_RECONF_CMD) > $(LINUX_DIR)/.config $(_SINGLE)$(KERNEL_MAKE) \ $(if $(findstring Darwin,$(HOST_OS)), \ - HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib -lncurses" \ HOSTLDLIBS_mconf="-L$(STAGING_DIR_HOST)/lib -lncurses" \ filechk_conf_cfg=" :" \ ) \ diff --git a/include/kernel.mk b/include/kernel.mk index e4074a48f4..01b737f132 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -110,8 +110,7 @@ KERNEL_MAKE_FLAGS = \ KBUILD_BUILD_HOST="$(call qstrip,$(CONFIG_KERNEL_BUILD_DOMAIN))" \ KBUILD_BUILD_TIMESTAMP="$(KBUILD_BUILD_TIMESTAMP)" \ KBUILD_BUILD_VERSION="0" \ - HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib" \ - KBUILD_HOSTLDLIBS="-L$(STAGING_DIR_HOST)/lib" \ + KBUILD_HOSTLDFLAGS="-L$(STAGING_DIR_HOST)/lib" \ CONFIG_SHELL="$(BASH)" \ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \ $(if $(PKG_BUILD_ID),LDFLAGS_MODULE=--build-id=0x$(PKG_BUILD_ID)) \ diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 732fc5ee47..cd155473bb 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -32,10 +32,6 @@ ALLWIFIBOARDS:= \ glinet_gl-b2200 \ glinet_gl-s1300 \ linksys_ea8300 \ - mikrotik_cap-ac \ - mikrotik_hap-ac2 \ - mikrotik_hap-ac3 \ - mikrotik_sxtsq-5-ac \ p2w_r619ac \ qxwlan_e2600ac-c1 \ qxwlan_e2600ac-c2 \ @@ -107,10 +103,6 @@ $(eval $(call generate-ipq-wifi-package,glinet_gl-ap1300,GL.iNet GL-AP1300)) $(eval $(call generate-ipq-wifi-package,glinet_gl-b2200,GL.iNet GL-B2200)) $(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300)) $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300)) -$(eval $(call generate-ipq-wifi-package,mikrotik_cap-ac,Mikrotik cAP ac)) -$(eval $(call generate-ipq-wifi-package,mikrotik_hap-ac2,Mikrotik hAP ac2)) -$(eval $(call generate-ipq-wifi-package,mikrotik_hap-ac3,Mikrotik hAP ac3)) -$(eval $(call generate-ipq-wifi-package,mikrotik_sxtsq-5-ac,MikroTik SXTsq 5 ac)) $(eval $(call generate-ipq-wifi-package,p2w_r619ac,P&W R619AC)) $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac-c1,Qxwlan E2600AC C1)) $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac-c2,Qxwlan E2600AC C2)) diff --git a/package/firmware/ipq-wifi/board-mikrotik_cap-ac.qca4019 b/package/firmware/ipq-wifi/board-mikrotik_cap-ac.qca4019 deleted file mode 100644 index 81da65d225..0000000000 Binary files a/package/firmware/ipq-wifi/board-mikrotik_cap-ac.qca4019 and /dev/null differ diff --git a/package/firmware/ipq-wifi/board-mikrotik_hap-ac2.qca4019 b/package/firmware/ipq-wifi/board-mikrotik_hap-ac2.qca4019 deleted file mode 100644 index 73372c183e..0000000000 Binary files a/package/firmware/ipq-wifi/board-mikrotik_hap-ac2.qca4019 and /dev/null differ diff --git a/package/firmware/ipq-wifi/board-mikrotik_hap-ac3.qca4019 b/package/firmware/ipq-wifi/board-mikrotik_hap-ac3.qca4019 deleted file mode 100644 index a97a20217c..0000000000 Binary files a/package/firmware/ipq-wifi/board-mikrotik_hap-ac3.qca4019 and /dev/null differ diff --git a/package/firmware/ipq-wifi/board-mikrotik_sxtsq-5-ac.qca4019 b/package/firmware/ipq-wifi/board-mikrotik_sxtsq-5-ac.qca4019 deleted file mode 100644 index 97f982637a..0000000000 Binary files a/package/firmware/ipq-wifi/board-mikrotik_sxtsq-5-ac.qca4019 and /dev/null differ diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index 278f6d737e..acdaa5a6fc 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2021-11-28 -PKG_SOURCE_VERSION:=dc350bbf41d987c5b2db54405bcc9ef3cd66d5db -PKG_MIRROR_HASH:=92422485c7b92be840a40bf8d157bb6731d14d3811907b6cb4e4cfab0777b60d +PKG_SOURCE_DATE:=2022-05-13 +PKG_SOURCE_VERSION:=f808496fcc6b1f68942914117aebf8b3f8d52bb3 +PKG_MIRROR_HASH:=39527b3408696594eda5579521a9fb798417be4dda73fa08e8b3a8c7b0d3f3d9 # Build the 5.15 ath10k-ct driver version. # Probably this should match as closely as diff --git a/package/kernel/ath10k-ct/patches/120-ath10k-fetch-calibration-data-via-nvmem-subsystem.patch b/package/kernel/ath10k-ct/patches/120-ath10k-fetch-calibration-data-via-nvmem-subsystem.patch index 2a4b09ac27..c935d8575e 100644 --- a/package/kernel/ath10k-ct/patches/120-ath10k-fetch-calibration-data-via-nvmem-subsystem.patch +++ b/package/kernel/ath10k-ct/patches/120-ath10k-fetch-calibration-data-via-nvmem-subsystem.patch @@ -34,7 +34,7 @@ Signed-off-by: Christian Lamparter #include #include -@@ -988,7 +989,8 @@ static int ath10k_core_get_board_id_from +@@ -1005,7 +1006,8 @@ static int ath10k_core_get_board_id_from } if (ar->cal_mode == ATH10K_PRE_CAL_MODE_DT || @@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter bmi_board_id_param = BMI_PARAM_GET_FLASH_BOARD_ID; else bmi_board_id_param = BMI_PARAM_GET_EEPROM_BOARD_ID; -@@ -2087,7 +2089,8 @@ static int ath10k_download_and_run_otp(s +@@ -2115,7 +2117,8 @@ static int ath10k_download_and_run_otp(s /* As of now pre-cal is valid for 10_4 variants */ if (ar->cal_mode == ATH10K_PRE_CAL_MODE_DT || @@ -54,7 +54,7 @@ Signed-off-by: Christian Lamparter bmi_otp_exe_param = BMI_PARAM_FLASH_SECTION_ALL; ret = ath10k_bmi_execute(ar, address, bmi_otp_exe_param, &result); -@@ -2221,6 +2224,39 @@ struct ath10k_bss_rom_ie { +@@ -2249,6 +2252,39 @@ struct ath10k_bss_rom_ie { __le32 rom_len; } __packed; @@ -94,7 +94,7 @@ Signed-off-by: Christian Lamparter int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name, struct ath10k_fw_file *fw_file) { -@@ -2597,6 +2633,18 @@ static int ath10k_core_pre_cal_download( +@@ -2625,6 +2661,18 @@ static int ath10k_core_pre_cal_download( { int ret; @@ -113,7 +113,7 @@ Signed-off-by: Christian Lamparter ret = ath10k_download_cal_file(ar, ar->pre_cal_file); if (ret == 0) { ar->cal_mode = ATH10K_PRE_CAL_MODE_FILE; -@@ -2663,6 +2711,18 @@ static int ath10k_download_cal_data(stru +@@ -2691,6 +2739,18 @@ static int ath10k_download_cal_data(stru "pre cal download procedure failed, try cal file: %d\n", ret); diff --git a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index 0f75c496e7..2cc7c1e678 100644 --- a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -129,7 +129,7 @@ v13: .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, -@@ -141,6 +143,7 @@ static const struct ath10k_hw_params ath +@@ -143,6 +145,7 @@ static const struct ath10k_hw_params ath .dev_id = QCA9887_1_0_DEVICE_ID, .bus = ATH10K_BUS_PCI, .name = "qca9887 hw1.0", @@ -137,7 +137,7 @@ v13: .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, -@@ -352,6 +355,7 @@ static const struct ath10k_hw_params ath +@@ -360,6 +363,7 @@ static const struct ath10k_hw_params ath .dev_id = QCA99X0_2_0_DEVICE_ID, .bus = ATH10K_BUS_PCI, .name = "qca99x0 hw2.0", @@ -145,7 +145,7 @@ v13: .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .otp_exe_param = 0x00000700, -@@ -393,6 +397,7 @@ static const struct ath10k_hw_params ath +@@ -402,6 +406,7 @@ static const struct ath10k_hw_params ath .dev_id = QCA9984_1_0_DEVICE_ID, .bus = ATH10K_BUS_PCI, .name = "qca9984/qca9994 hw1.0", @@ -153,7 +153,7 @@ v13: .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -441,6 +446,7 @@ static const struct ath10k_hw_params ath +@@ -451,6 +456,7 @@ static const struct ath10k_hw_params ath .dev_id = QCA9888_2_0_DEVICE_ID, .bus = ATH10K_BUS_PCI, .name = "qca9888 hw2.0", @@ -161,7 +161,7 @@ v13: .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -3942,6 +3948,10 @@ int ath10k_core_start(struct ath10k *ar, +@@ -3977,6 +3983,10 @@ int ath10k_core_start(struct ath10k *ar, ath10k_wmi_check_apply_board_power_ctl_table(ar); } @@ -172,7 +172,7 @@ v13: return 0; err_hif_stop: -@@ -4203,9 +4213,18 @@ static void ath10k_core_register_work(st +@@ -4238,9 +4248,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -191,7 +191,7 @@ v13: err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -4265,6 +4284,8 @@ void ath10k_core_unregister(struct ath10 +@@ -4300,6 +4319,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; @@ -456,7 +456,7 @@ v13: static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { --- a/ath10k-5.15/wmi.c +++ b/ath10k-5.15/wmi.c -@@ -8409,6 +8409,49 @@ ath10k_wmi_op_gen_peer_set_param(struct +@@ -8413,6 +8413,49 @@ ath10k_wmi_op_gen_peer_set_param(struct return skb; } @@ -506,7 +506,7 @@ v13: static struct sk_buff * ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id, enum wmi_sta_ps_mode psmode) -@@ -10240,6 +10283,9 @@ static const struct wmi_ops wmi_ops = { +@@ -10244,6 +10287,9 @@ static const struct wmi_ops wmi_ops = { .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, .gen_echo = ath10k_wmi_op_gen_echo, @@ -516,7 +516,7 @@ v13: /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -10310,6 +10356,8 @@ static const struct wmi_ops wmi_10_1_ops +@@ -10314,6 +10360,8 @@ static const struct wmi_ops wmi_10_1_ops .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, .gen_echo = ath10k_wmi_op_gen_echo, @@ -525,7 +525,7 @@ v13: /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -10389,6 +10437,8 @@ static const struct wmi_ops wmi_10_2_ops +@@ -10393,6 +10441,8 @@ static const struct wmi_ops wmi_10_2_ops .gen_delba_send = ath10k_wmi_op_gen_delba_send, .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, @@ -534,7 +534,7 @@ v13: /* .gen_pdev_enable_adaptive_cca not implemented */ }; -@@ -10460,6 +10510,8 @@ static const struct wmi_ops wmi_10_2_4_o +@@ -10464,6 +10514,8 @@ static const struct wmi_ops wmi_10_2_4_o ath10k_wmi_op_gen_pdev_enable_adaptive_cca, .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing, @@ -543,7 +543,7 @@ v13: /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -10542,6 +10594,8 @@ static const struct wmi_ops wmi_10_4_ops +@@ -10546,6 +10598,8 @@ static const struct wmi_ops wmi_10_4_ops .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info, .gen_echo = ath10k_wmi_op_gen_echo, .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, diff --git a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch index 4c4a0edd57..fb8468b9c0 100644 --- a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch @@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/ath10k-5.15/mac.c +++ b/ath10k-5.15/mac.c -@@ -11521,7 +11521,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -11544,7 +11544,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/bcm27xx-gpu-fw/Makefile b/package/kernel/bcm27xx-gpu-fw/Makefile index b99912542b..b3323c8b28 100644 --- a/package/kernel/bcm27xx-gpu-fw/Makefile +++ b/package/kernel/bcm27xx-gpu-fw/Makefile @@ -2,8 +2,8 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=bcm27xx-gpu-fw -PKG_VERSION:=2021-08-19 -PKG_RELEASE:=25e2b597ebfb2495eab4816a276758dcc6ea21f1 +PKG_VERSION:=2022-05-16 +PKG_RELEASE:=3673be308132de102fdff491d1333d9d0f823557 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_RELEASE) @@ -26,7 +26,7 @@ define Download/bootcode_bin FILE:=$(RPI_FIRMWARE_FILE)-bootcode.bin URL:=$(RPI_FIRMWARE_URL) URL_FILE:=bootcode.bin - HASH:=36fba28838867f26670a0cd1de340da62e13171cfdec0e7822737e849b3c0681 + HASH:=69309823da13dc96b89e3d82b44f820e4f84efa79d207adad2c8784559794f03 endef $(eval $(call Download,bootcode_bin)) @@ -34,7 +34,7 @@ define Download/fixup_dat FILE:=$(RPI_FIRMWARE_FILE)-fixup.dat URL:=$(RPI_FIRMWARE_URL) URL_FILE:=fixup.dat - HASH:=b06aa43aa668d6982de66044299d1b0dd6b449ec321dd83742aa1eb68774e15b + HASH:=921f56c62ad1995addb984b156c869202dc5d46bbe9ebcbd02c20f0def9058e3 endef $(eval $(call Download,fixup_dat)) @@ -42,7 +42,7 @@ define Download/fixup_cd_dat FILE:=$(RPI_FIRMWARE_FILE)-fixup_cd.dat URL:=$(RPI_FIRMWARE_URL) URL_FILE:=fixup_cd.dat - HASH:=fff4fd9fbb691100be46269f554acd866eac8cfef39082e03ac12f70fbfe9d95 + HASH:=83a985aa0d73844786f3b3bf674826c520212f6f72fc6a890f2ebb5f87de5d8c endef $(eval $(call Download,fixup_cd_dat)) @@ -50,7 +50,7 @@ define Download/fixup_x_dat FILE:=$(RPI_FIRMWARE_FILE)-fixup_x.dat URL:=$(RPI_FIRMWARE_URL) URL_FILE:=fixup_x.dat - HASH:=d74f97ae37cd476e6d4c8e466c3013be49e891e63b9aabc0c9b7637d85068cd0 + HASH:=8b00b00678adafe01e087240d156dbc87822e745b269be4f282596b69265cd1e endef $(eval $(call Download,fixup_x_dat)) @@ -58,7 +58,7 @@ define Download/fixup4_dat FILE:=$(RPI_FIRMWARE_FILE)-fixup4.dat URL:=$(RPI_FIRMWARE_URL) URL_FILE:=fixup4.dat - HASH:=a607f4dc3000c188f8daaa3417c70a9e5ecc039fae36ba46807c00294f89cd24 + HASH:=ef2b5d2a0a95ca48e00a1ce78b7650ee9e947cc1c588704c8ae30c1623122e2f endef $(eval $(call Download,fixup4_dat)) @@ -66,7 +66,7 @@ define Download/fixup4cd_dat FILE:=$(RPI_FIRMWARE_FILE)-fixup4cd.dat URL:=$(RPI_FIRMWARE_URL) URL_FILE:=fixup4cd.dat - HASH:=fff4fd9fbb691100be46269f554acd866eac8cfef39082e03ac12f70fbfe9d95 + HASH:=83a985aa0d73844786f3b3bf674826c520212f6f72fc6a890f2ebb5f87de5d8c endef $(eval $(call Download,fixup4cd_dat)) @@ -74,7 +74,7 @@ define Download/fixup4x_dat FILE:=$(RPI_FIRMWARE_FILE)-fixup4x.dat URL:=$(RPI_FIRMWARE_URL) URL_FILE:=fixup4x.dat - HASH:=14ba09cba83d82a158481a7267fad06ada73c26c3a27dfd34694955f11ba6e27 + HASH:=a6c4e30ada5a00fe7de83c460638ca824647651bb4a3644b8c65d7ba1d9f2d2b endef $(eval $(call Download,fixup4x_dat)) @@ -82,7 +82,7 @@ define Download/start_elf FILE:=$(RPI_FIRMWARE_FILE)-start.elf URL:=$(RPI_FIRMWARE_URL) URL_FILE:=start.elf - HASH:=8bee170c56529bf1666ad4afdd18ae18c7123e7a2fd30e2992cd0d9a01fa63ee + HASH:=5455c148f4b8b04c553809bd22b995ee49ba5279ca3848df8bde6f80a388f7e0 endef $(eval $(call Download,start_elf)) @@ -90,7 +90,7 @@ define Download/start_cd_elf FILE:=$(RPI_FIRMWARE_FILE)-start_cd.elf URL:=$(RPI_FIRMWARE_URL) URL_FILE:=start_cd.elf - HASH:=27d9354ff1af79a521527a288fe736f7337f91bca12bbc177c80e29dbbef0ffd + HASH:=168c0a9178d5a3b4bd89ef770826a85b4ea3132560ba3600c212c0cec4c575c6 endef $(eval $(call Download,start_cd_elf)) @@ -98,7 +98,7 @@ define Download/start_x_elf FILE:=$(RPI_FIRMWARE_FILE)-start_x.elf URL:=$(RPI_FIRMWARE_URL) URL_FILE:=start_x.elf - HASH:=499bfdf3deba7bb0a033d2a4487b7f05bce45de2692c7c6dabc4a456237fd438 + HASH:=30c6a7f32a25185053ca3ca9e4bcfe932246ed42a1b7c37f8803209f93d86404 endef $(eval $(call Download,start_x_elf)) @@ -106,7 +106,7 @@ define Download/start4_elf FILE:=$(RPI_FIRMWARE_FILE)-start4.elf URL:=$(RPI_FIRMWARE_URL) URL_FILE:=start4.elf - HASH:=158bf783090223626cf45794bf679a3fadbf64bba55b76e3349b94e01be34202 + HASH:=be8bbff41dba2749b7b0e812f0a9d87a9122d18508f7b5ff3cd20f303d15bc07 endef $(eval $(call Download,start4_elf)) @@ -114,7 +114,7 @@ define Download/start4cd_elf FILE:=$(RPI_FIRMWARE_FILE)-start4cd.elf URL:=$(RPI_FIRMWARE_URL) URL_FILE:=start4cd.elf - HASH:=c4912701f620cdd9e44bbacbfc4adb4be1b6fb7ccf81f6029ce2115511970cc0 + HASH:=000372e9cf6815ade595948dbd6328665f2a535eeee44e74b0ec8e56b6fbbf90 endef $(eval $(call Download,start4cd_elf)) @@ -122,7 +122,7 @@ define Download/start4x_elf FILE:=$(RPI_FIRMWARE_FILE)-start4x.elf URL:=$(RPI_FIRMWARE_URL) URL_FILE:=start4x.elf - HASH:=3eb1adb5dfef21da0a16679ef65314a64196a67c6fca3422df8bc721d6b6fa94 + HASH:=48895858f7936570dfab44c67bdcb0357ac8fcd630162c36ac9ed8f2de85c038 endef $(eval $(call Download,start4x_elf)) diff --git a/package/kernel/bpf-headers/Makefile b/package/kernel/bpf-headers/Makefile index 4ffe5a7cc0..6d25a7386f 100644 --- a/package/kernel/bpf-headers/Makefile +++ b/package/kernel/bpf-headers/Makefile @@ -56,7 +56,6 @@ KERNEL_MAKE := \ LLVM=1 CC="$(CLANG)" LD="$(TARGET_CROSS)ld" \ HOSTCC="$(HOSTCC)" \ HOSTCXX="$(HOSTCXX)" \ - HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib" \ KBUILD_HOSTLDLIBS="-L$(STAGING_DIR_HOST)/lib" \ CONFIG_SHELL="$(BASH)" \ INSTALL_HDR_PATH="$(PKG_BUILD_DIR)/user_headers" diff --git a/package/kernel/mac80211/patches/ath10k/100-ath10k-support-bus-and-device-specific-API-1-BDF-sel.patch b/package/kernel/mac80211/patches/ath10k/100-ath10k-support-bus-and-device-specific-API-1-BDF-sel.patch new file mode 100644 index 0000000000..74d5b374fb --- /dev/null +++ b/package/kernel/mac80211/patches/ath10k/100-ath10k-support-bus-and-device-specific-API-1-BDF-sel.patch @@ -0,0 +1,65 @@ +From f2a7064a78b22f2b68b9fcbc8a6f4c5e61c5ba64 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Sun, 10 Oct 2021 00:17:11 +0200 +Subject: [PATCH] ath10k: support bus and device specific API 1 BDF selection + +Some ath10k IPQ40xx devices like the MikroTik hAP ac2 and ac3 require the +BDF-s to be extracted from the device storage instead of shipping packaged +API 2 BDF-s. + +This is required as MikroTik has started shipping boards that require BDF-s +to be updated, as otherwise their WLAN performance really suffers. +This is however impossible as the devices that require this are release +under the same revision and its not possible to differentiate them from +devices using the older BDF-s. + +In OpenWrt we are extracting the calibration data during runtime and we are +able to extract the BDF-s in the same manner, however we cannot package the +BDF-s to API 2 format on the fly and can only use API 1 to provide BDF-s on +the fly. +This is an issue as the ath10k driver explicitly looks only for the +board.bin file and not for something like board-bus-device.bin like it does +for pre-cal data. +Due to this we have no way of providing correct BDF-s on the fly, so lets +extend the ath10k driver to first look for BDF-s in the +board-bus-device.bin format, for example: board-ahb-a800000.wifi.bin +If that fails, look for the default board file name as defined previously. + +Signed-off-by: Robert Marko +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20211009221711.2315352-1-robimarko@gmail.com +--- + drivers/net/wireless/ath/ath10k/core.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath10k/core.c ++++ b/drivers/net/wireless/ath/ath10k/core.c +@@ -1199,6 +1199,7 @@ success: + static int ath10k_core_fetch_board_data_api_1(struct ath10k *ar, int bd_ie_type) + { + const struct firmware *fw; ++ char boardname[100]; + + if (bd_ie_type == ATH10K_BD_IE_BOARD) { + if (!ar->hw_params.fw.board) { +@@ -1206,9 +1207,19 @@ static int ath10k_core_fetch_board_data_ + return -EINVAL; + } + ++ scnprintf(boardname, sizeof(boardname), "board-%s-%s.bin", ++ ath10k_bus_str(ar->hif.bus), dev_name(ar->dev)); ++ + ar->normal_mode_fw.board = ath10k_fetch_fw_file(ar, + ar->hw_params.fw.dir, +- ar->hw_params.fw.board); ++ boardname); ++ if (IS_ERR(ar->normal_mode_fw.board)) { ++ fw = ath10k_fetch_fw_file(ar, ++ ar->hw_params.fw.dir, ++ ar->hw_params.fw.board); ++ ar->normal_mode_fw.board = fw; ++ } ++ + if (IS_ERR(ar->normal_mode_fw.board)) + return PTR_ERR(ar->normal_mode_fw.board); + diff --git a/package/kernel/mac80211/patches/ath10k/120-ath10k-fetch-calibration-data-via-nvmem-subsystem.patch b/package/kernel/mac80211/patches/ath10k/120-ath10k-fetch-calibration-data-via-nvmem-subsystem.patch index bebd5fe6c2..ab42c6e1e0 100644 --- a/package/kernel/mac80211/patches/ath10k/120-ath10k-fetch-calibration-data-via-nvmem-subsystem.patch +++ b/package/kernel/mac80211/patches/ath10k/120-ath10k-fetch-calibration-data-via-nvmem-subsystem.patch @@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter bmi_board_id_param = BMI_PARAM_GET_FLASH_BOARD_ID; else bmi_board_id_param = BMI_PARAM_GET_EEPROM_BOARD_ID; -@@ -1743,7 +1745,8 @@ static int ath10k_download_and_run_otp(s +@@ -1754,7 +1756,8 @@ static int ath10k_download_and_run_otp(s /* As of now pre-cal is valid for 10_4 variants */ if (ar->cal_mode == ATH10K_PRE_CAL_MODE_DT || @@ -54,7 +54,7 @@ Signed-off-by: Christian Lamparter bmi_otp_exe_param = BMI_PARAM_FLASH_SECTION_ALL; ret = ath10k_bmi_execute(ar, address, bmi_otp_exe_param, &result); -@@ -1870,6 +1873,39 @@ out_free: +@@ -1881,6 +1884,39 @@ out_free: return ret; } @@ -94,7 +94,7 @@ Signed-off-by: Christian Lamparter int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name, struct ath10k_fw_file *fw_file) { -@@ -2104,6 +2140,18 @@ static int ath10k_core_pre_cal_download( +@@ -2115,6 +2151,18 @@ static int ath10k_core_pre_cal_download( { int ret; @@ -113,7 +113,7 @@ Signed-off-by: Christian Lamparter ret = ath10k_download_cal_file(ar, ar->pre_cal_file); if (ret == 0) { ar->cal_mode = ATH10K_PRE_CAL_MODE_FILE; -@@ -2170,6 +2218,18 @@ static int ath10k_download_cal_data(stru +@@ -2181,6 +2229,18 @@ static int ath10k_download_cal_data(stru "pre cal download procedure failed, try cal file: %d\n", ret); diff --git a/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch index b6ae2c7c83..5362c2436d 100644 --- a/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch @@ -14,7 +14,7 @@ Signed-off-by: Sven Eckelmann --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -3429,6 +3429,16 @@ int ath10k_core_register(struct ath10k * +@@ -3440,6 +3440,16 @@ int ath10k_core_register(struct ath10k * queue_work(ar->workqueue, &ar->register_work); diff --git a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index 6db2430749..f63f45d108 100644 --- a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -172,7 +172,7 @@ v13: .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -3144,6 +3150,10 @@ int ath10k_core_start(struct ath10k *ar, +@@ -3155,6 +3161,10 @@ int ath10k_core_start(struct ath10k *ar, goto err_hif_stop; } @@ -183,7 +183,7 @@ v13: return 0; err_hif_stop: -@@ -3402,9 +3412,18 @@ static void ath10k_core_register_work(st +@@ -3413,9 +3423,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -202,7 +202,7 @@ v13: err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -3450,6 +3469,8 @@ void ath10k_core_unregister(struct ath10 +@@ -3461,6 +3480,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; diff --git a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch index 4077b2f393..d94a8a8596 100644 --- a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch +++ b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch @@ -26,7 +26,7 @@ Signed-off-by: Ansuel Smith #include #include #include -@@ -3320,6 +3321,8 @@ static int ath10k_core_probe_fw(struct a +@@ -3331,6 +3332,8 @@ static int ath10k_core_probe_fw(struct a device_get_mac_address(ar->dev, ar->mac_addr, sizeof(ar->mac_addr)); diff --git a/package/kernel/mac80211/patches/ath9k/580-ath9k_ar9561_fix_bias_level.patch b/package/kernel/mac80211/patches/ath9k/580-ath9k_ar9561_fix_bias_level.patch index e4c2e1cd02..b883177b9f 100644 --- a/package/kernel/mac80211/patches/ath9k/580-ath9k_ar9561_fix_bias_level.patch +++ b/package/kernel/mac80211/patches/ath9k/580-ath9k_ar9561_fix_bias_level.patch @@ -29,8 +29,6 @@ v2: Adjust #define per Felix's suggestion drivers/net/wireless/ath/ath9k/ar9003_phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h -index a171dbb29..ad949eb02 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h @@ -720,7 +720,7 @@ @@ -42,6 +40,3 @@ index a171dbb29..ad949eb02 100644 #define AR_CH0_XTAL (AR_SREV_9300(ah) ? 0x16294 : \ ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16298 : \ --- -2.30.2 - diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index 07b3ea66c6..2a7b5c50e2 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -24,11 +24,8 @@ PKG_INSTALL:=1 PKG_USE_MIPS16:=1 PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone -HOST_BUILD_DEPENDS:=argp-standalone/host musl-fts/host - include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk -include $(INCLUDE_DIR)/host-build.mk define Package/elfutils/Default SECTION:=libs @@ -114,7 +111,6 @@ define Package/libelf/install endef # these lines need to be ordered by dependency because of ABI versioning -$(eval $(call HostBuild)) $(eval $(call BuildPackage,libelf)) $(eval $(call BuildPackage,libdw)) $(eval $(call BuildPackage,libasm)) diff --git a/package/utils/bcm27xx-userland/Makefile b/package/utils/bcm27xx-userland/Makefile index 8114fd6289..857db7969f 100644 --- a/package/utils/bcm27xx-userland/Makefile +++ b/package/utils/bcm27xx-userland/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bcm27xx-userland -PKG_VERSION:=97bc8180ad682b004ea224d1db7b8e108eda4397 -PKG_RELEASE:=1 +PKG_VERSION:=c4fd1b8986c6d6d4ae5cd51e65a8bbeb495dfa4e +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/raspberrypi/userland/tar.gz/$(PKG_VERSION)? -PKG_HASH:=d67def03931215f41b741aed5a3a1bc2bd62fa33f5cc14692e9a4d65f2e0ea27 +PKG_HASH:=ab8a5b27c34cf1b97de87b895448a6355229f73b679866b47c51a723273cc8ae PKG_FLAGS:=nonshared diff --git a/target/linux/at91/sam9x/config-default b/target/linux/at91/sam9x/config-default index 9f97e7542e..07dfee21b8 100644 --- a/target/linux/at91/sam9x/config-default +++ b/target/linux/at91/sam9x/config-default @@ -81,7 +81,6 @@ CONFIG_CRYPTO_HASH_INFO=y CONFIG_CRYPTO_LZO=y CONFIG_CRYPTO_RNG2=y CONFIG_CRYPTO_ZSTD=y -CONFIG_DEBUG_INFO=y CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y diff --git a/target/linux/at91/sama7/config-default b/target/linux/at91/sama7/config-default index 6b69c43d7a..30965850ca 100644 --- a/target/linux/at91/sama7/config-default +++ b/target/linux/at91/sama7/config-default @@ -118,7 +118,6 @@ CONFIG_CRYPTO_SHA256=y CONFIG_DCACHE_WORD_ACCESS=y CONFIG_DEBUG_AT91_SAMA7G5_FLEXCOM3=y CONFIG_DEBUG_AT91_UART=y -CONFIG_DEBUG_INFO=y CONFIG_DEBUG_LL=y CONFIG_DEBUG_LL_INCLUDE="debug/at91.S" CONFIG_DEBUG_UART_PHYS=0xe1824200 diff --git a/target/linux/bcm27xx/Makefile b/target/linux/bcm27xx/Makefile index a62d72ffc4..e408c9040c 100644 --- a/target/linux/bcm27xx/Makefile +++ b/target/linux/bcm27xx/Makefile @@ -11,7 +11,7 @@ BOARDNAME:=Broadcom BCM27xx FEATURES:=audio boot-part display ext4 fpu gpio rootfs-part rtc squashfs usb usbgadget SUBTARGETS:=bcm2708 bcm2709 bcm2710 bcm2711 -KERNEL_PATCHVER=5.10 +KERNEL_PATCHVER:=5.15 define Target/Description Build firmware image for Broadcom BCM27xx SoC devices. diff --git a/target/linux/bcm27xx/base-files/etc/board.d/02_network b/target/linux/bcm27xx/base-files/etc/board.d/02_network index f279941e1e..b4394f6922 100644 --- a/target/linux/bcm27xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm27xx/base-files/etc/board.d/02_network @@ -10,16 +10,16 @@ board_config_update board=$(board_name) case "$board" in -raspberrypi,model-b |\ -raspberrypi,model-b-plus |\ -raspberrypi,model-b-rev2 |\ raspberrypi,2-model-b |\ raspberrypi,2-model-b-rev2 |\ raspberrypi,3-model-b |\ raspberrypi,3-model-b-plus |\ raspberrypi,400 |\ raspberrypi,4-compute-module |\ -raspberrypi,4-model-b) +raspberrypi,4-model-b |\ +raspberrypi,model-b |\ +raspberrypi,model-b-plus |\ +raspberrypi,model-b-rev2) ucidef_set_interface_lan "eth0" ;; diff --git a/target/linux/bcm27xx/base-files/etc/diag.sh b/target/linux/bcm27xx/base-files/etc/diag.sh index f5e9ee0111..a22ffd3f2a 100644 --- a/target/linux/bcm27xx/base-files/etc/diag.sh +++ b/target/linux/bcm27xx/base-files/etc/diag.sh @@ -9,7 +9,7 @@ set_state() { case "$(board_name)" in raspberrypi,2-model-b |\ raspberrypi,2-model-b-rev2 |\ - raspberrypi,3-model-b |\ + raspberrypi,3-model-b |\ raspberrypi,3-model-b-plus |\ raspberrypi,400 |\ raspberrypi,4-compute-module |\ diff --git a/target/linux/bcm27xx/base-files/lib/preinit/05_set_preinit_iface_brcm2708 b/target/linux/bcm27xx/base-files/lib/preinit/05_set_preinit_iface_brcm2708 index 269465e301..c52995bd17 100644 --- a/target/linux/bcm27xx/base-files/lib/preinit/05_set_preinit_iface_brcm2708 +++ b/target/linux/bcm27xx/base-files/lib/preinit/05_set_preinit_iface_brcm2708 @@ -9,6 +9,8 @@ set_preinit_iface() { raspberrypi,2-model-b-rev2 |\ raspberrypi,3-model-b |\ raspberrypi,3-model-b-plus |\ + raspberrypi,400 |\ + raspberrypi,4-compute-module |\ raspberrypi,4-model-b |\ raspberrypi,model-b |\ raspberrypi,model-b-plus |\ diff --git a/target/linux/bcm27xx/bcm2708/config-5.10 b/target/linux/bcm27xx/bcm2708/config-5.15 similarity index 96% rename from target/linux/bcm27xx/bcm2708/config-5.10 rename to target/linux/bcm27xx/bcm2708/config-5.15 index 56e076ba95..84b16b4a7a 100644 --- a/target/linux/bcm27xx/bcm2708/config-5.10 +++ b/target/linux/bcm27xx/bcm2708/config-5.15 @@ -20,6 +20,7 @@ CONFIG_ARM_CPU_SUSPEND=y CONFIG_ARM_ERRATA_411920=y CONFIG_ARM_HAS_SG_CHAIN=y CONFIG_ARM_L1_CACHE_SHIFT=5 +# CONFIG_ARM_MHU_V2 is not set CONFIG_ARM_PATCH_PHYS_VIRT=y CONFIG_ARM_RASPBERRYPI_CPUFREQ=y CONFIG_ARM_THUMB=y @@ -49,11 +50,9 @@ CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_SD=y CONFIG_BLK_PM=y -CONFIG_BLK_SCSI_REQUEST=y CONFIG_BRCMSTB_L2_IRQ=y CONFIG_BRCM_CHAR_DRIVERS=y # CONFIG_CACHE_L2X0 is not set -CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -69,6 +68,7 @@ CONFIG_CMA_SIZE_MBYTES=5 CONFIG_CMA_SIZE_SEL_MBYTES=y # CONFIG_CMA_SIZE_SEL_MIN is not set # CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +# CONFIG_CMA_SYSFS is not set CONFIG_COMMON_CLK=y CONFIG_COMPAT_32BIT_TIME=y CONFIG_CONFIGFS_FS=y @@ -110,7 +110,6 @@ CONFIG_CRYPTO_CRC32C=y CONFIG_CRYPTO_RNG2=y CONFIG_DCACHE_WORD_ACCESS=y CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEBUG_INFO=y CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" CONFIG_DMABUF_HEAPS=y CONFIG_DMABUF_HEAPS_CMA=y @@ -130,7 +129,6 @@ CONFIG_DTC=y CONFIG_DUMMY_CONSOLE=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y -CONFIG_ENABLE_MUST_CHECK=y CONFIG_EXT4_FS=y CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_SECURITY=y @@ -158,6 +156,7 @@ CONFIG_FREEZER=y CONFIG_FS_IOMAP=y CONFIG_FS_MBCACHE=y CONFIG_FS_POSIX_ACL=y +CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_GENERIC_ALLOCATOR=y @@ -170,6 +169,7 @@ CONFIG_GENERIC_IRQ_CHIP=y CONFIG_GENERIC_IRQ_MULTI_HANDLER=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y CONFIG_GENERIC_PCI_IOMAP=y CONFIG_GENERIC_PINCONF=y CONFIG_GENERIC_PINCTRL_GROUPS=y @@ -181,6 +181,7 @@ CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y # CONFIG_GPIO_BCM_VIRT is not set +CONFIG_GPIO_CDEV=y # CONFIG_GPIO_FSM is not set CONFIG_GPIO_RASPBERRYPI_EXP=y CONFIG_HANDLE_DOMAIN_IRQ=y @@ -223,13 +224,13 @@ CONFIG_MAC_PARTITION=y CONFIG_MAGIC_SYSRQ=y CONFIG_MAILBOX=y # CONFIG_MAILBOX_TEST is not set -CONFIG_MAX_RAW_DEVS=256 CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y CONFIG_MDIO_DEVRES=y CONFIG_MEMFD_CREATE=y CONFIG_MEMORY_ISOLATION=y CONFIG_MFD_CORE=y +# CONFIG_MFD_RASPBERRYPI_POE_HAT is not set # CONFIG_MFD_RPISENSE_CORE is not set CONFIG_MFD_SYSCON=y CONFIG_MIGHT_HAVE_CACHE_L2X0=y @@ -248,13 +249,14 @@ CONFIG_MODULES_USE_ELF_REL=y # CONFIG_MTD is not set CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_SELFTESTS=y CONFIG_NLS=y CONFIG_NLS_ASCII=y +CONFIG_NOP_USB_XCEIV=y CONFIG_NO_HZ=y CONFIG_NO_HZ_COMMON=y CONFIG_NO_HZ_IDLE=y CONFIG_NVMEM=y -# CONFIG_NVMEM_RMEM is not set CONFIG_OABI_COMPAT=y CONFIG_OF=y CONFIG_OF_ADDRESS=y @@ -266,7 +268,6 @@ CONFIG_OF_GPIO=y CONFIG_OF_IRQ=y CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y -CONFIG_OF_NET=y CONFIG_OF_OVERLAY=y CONFIG_OF_RESOLVE=y CONFIG_OLD_SIGACTION=y @@ -286,11 +287,11 @@ CONFIG_PM_OPP=y CONFIG_PM_SLEEP=y CONFIG_POWER_SUPPLY=y CONFIG_PRINTK_TIME=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_RASPBERRYPI_FIRMWARE=y CONFIG_RASPBERRYPI_POWER=y CONFIG_RATIONAL=y # CONFIG_RAVE_SP_CORE is not set -CONFIG_RAW_DRIVER=y CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y CONFIG_REGULATOR=y @@ -299,9 +300,9 @@ CONFIG_RESET_CONTROLLER=y # CONFIG_RESET_RASPBERRYPI is not set CONFIG_RESET_SIMPLE=y # CONFIG_RPIVID_MEM is not set -# CONFIG_RPI_AXIPERF is not set # CONFIG_RPI_POE_POWER is not set CONFIG_SCSI=y +CONFIG_SCSI_COMMON=y # CONFIG_SCSI_LOWLEVEL is not set # CONFIG_SCSI_PROC_FS is not set CONFIG_SERIAL_8250_BCM2835AUX=y @@ -319,8 +320,6 @@ CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SG_POOL=y CONFIG_SMSC_PHY=y -# CONFIG_SND_SOC_AD193X_I2C is not set -# CONFIG_SND_SOC_AD193X_SPI is not set CONFIG_SPARSE_IRQ=y CONFIG_SRCU=y # CONFIG_STRIP_ASM_SYMS is not set @@ -354,6 +353,7 @@ CONFIG_USB_SUPPORT=y CONFIG_USB_UAS=y CONFIG_USB_USBNET=y CONFIG_USE_OF=y +CONFIG_VCHIQ_CDEV=y CONFIG_VFP=y CONFIG_VT=y CONFIG_VT_CONSOLE=y diff --git a/target/linux/bcm27xx/bcm2709/config-5.10 b/target/linux/bcm27xx/bcm2709/config-5.15 similarity index 95% rename from target/linux/bcm27xx/bcm2709/config-5.10 rename to target/linux/bcm27xx/bcm2709/config-5.15 index f15f6e3562..35452dd33d 100644 --- a/target/linux/bcm27xx/bcm2709/config-5.10 +++ b/target/linux/bcm27xx/bcm2709/config-5.15 @@ -27,6 +27,7 @@ CONFIG_ARM_HAS_SG_CHAIN=y CONFIG_ARM_L1_CACHE_SHIFT=6 CONFIG_ARM_L1_CACHE_SHIFT_6=y CONFIG_ARM_LPAE=y +# CONFIG_ARM_MHU_V2 is not set CONFIG_ARM_PATCH_IDIV=y CONFIG_ARM_PATCH_PHYS_VIRT=y CONFIG_ARM_RASPBERRYPI_CPUFREQ=y @@ -62,13 +63,11 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y -CONFIG_BLK_SCSI_REQUEST=y CONFIG_BOUNCE=y CONFIG_BRCMSTB_L2_IRQ=y CONFIG_BRCM_CHAR_DRIVERS=y CONFIG_BROADCOM_PHY=y # CONFIG_CACHE_L2X0 is not set -CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -84,6 +83,7 @@ CONFIG_CMA_SIZE_MBYTES=5 CONFIG_CMA_SIZE_SEL_MBYTES=y # CONFIG_CMA_SIZE_SEL_MIN is not set # CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +# CONFIG_CMA_SYSFS is not set CONFIG_COMMON_CLK=y CONFIG_COMPAT_32BIT_TIME=y CONFIG_CONFIGFS_FS=y @@ -108,6 +108,7 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y CONFIG_CPU_FREQ_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y CONFIG_CPU_FREQ_GOV_USERSPACE=y CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_HAS_ASID=y @@ -142,7 +143,6 @@ CONFIG_CRYPTO_SHA512=y CONFIG_CRYPTO_XTS=y CONFIG_DCACHE_WORD_ACCESS=y CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEBUG_INFO=y CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" CONFIG_DIMLIB=y CONFIG_DMABUF_HEAPS=y @@ -163,7 +163,6 @@ CONFIG_DTC=y CONFIG_DUMMY_CONSOLE=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y -CONFIG_ENABLE_MUST_CHECK=y CONFIG_EXT4_FS=y CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_SECURITY=y @@ -194,6 +193,7 @@ CONFIG_FS_ENCRYPTION_ALGS=y CONFIG_FS_IOMAP=y CONFIG_FS_MBCACHE=y CONFIG_FS_POSIX_ACL=y +CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_GENERIC_ALLOCATOR=y @@ -202,6 +202,7 @@ CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y CONFIG_GENERIC_EARLY_IOREMAP=y CONFIG_GENERIC_GETTIMEOFDAY=y CONFIG_GENERIC_IDLE_POLL_SETUP=y @@ -211,6 +212,7 @@ CONFIG_GENERIC_IRQ_MIGRATION=y CONFIG_GENERIC_IRQ_MULTI_HANDLER=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y CONFIG_GENERIC_PCI_IOMAP=y @@ -227,6 +229,7 @@ CONFIG_GENERIC_VDSO_32=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_BCM_VIRT=y +CONFIG_GPIO_CDEV=y # CONFIG_GPIO_FSM is not set CONFIG_GPIO_RASPBERRYPI_EXP=y CONFIG_HANDLE_DOMAIN_IRQ=y @@ -262,6 +265,8 @@ CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_WORK=y CONFIG_JBD2=y CONFIG_KEYS=y +CONFIG_KMAP_LOCAL=y +CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY=y CONFIG_LEDS_GPIO=y CONFIG_LEDS_TRIGGER_ACTPWR=y CONFIG_LEDS_TRIGGER_INPUT=y @@ -276,7 +281,6 @@ CONFIG_MAC_PARTITION=y CONFIG_MAGIC_SYSRQ=y CONFIG_MAILBOX=y # CONFIG_MAILBOX_TEST is not set -CONFIG_MAX_RAW_DEVS=256 CONFIG_MDIO_BCM_UNIMAC=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y @@ -284,6 +288,7 @@ CONFIG_MDIO_DEVRES=y CONFIG_MEMFD_CREATE=y CONFIG_MEMORY_ISOLATION=y CONFIG_MFD_CORE=y +# CONFIG_MFD_RASPBERRYPI_POE_HAT is not set # CONFIG_MFD_RPISENSE_CORE is not set CONFIG_MFD_SYSCON=y CONFIG_MICROCHIP_PHY=y @@ -308,6 +313,7 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEON=y CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_SELFTESTS=y CONFIG_NLS=y CONFIG_NLS_ASCII=y CONFIG_NOP_USB_XCEIV=y @@ -316,7 +322,6 @@ CONFIG_NO_HZ_COMMON=y CONFIG_NO_HZ_IDLE=y CONFIG_NR_CPUS=4 CONFIG_NVMEM=y -# CONFIG_NVMEM_RMEM is not set CONFIG_OABI_COMPAT=y CONFIG_OF=y CONFIG_OF_ADDRESS=y @@ -328,7 +333,6 @@ CONFIG_OF_GPIO=y CONFIG_OF_IRQ=y CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y -CONFIG_OF_NET=y CONFIG_OF_OVERLAY=y CONFIG_OF_RESOLVE=y CONFIG_OLD_SIGACTION=y @@ -360,12 +364,12 @@ CONFIG_PM_SLEEP=y CONFIG_PM_SLEEP_SMP=y CONFIG_POWER_SUPPLY=y CONFIG_PRINTK_TIME=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_RAS=y CONFIG_RASPBERRYPI_FIRMWARE=y CONFIG_RASPBERRYPI_POWER=y CONFIG_RATIONAL=y # CONFIG_RAVE_SP_CORE is not set -CONFIG_RAW_DRIVER=y CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y CONFIG_REGULATOR=y @@ -376,11 +380,11 @@ CONFIG_RESET_RASPBERRYPI=y CONFIG_RESET_SIMPLE=y CONFIG_RFS_ACCEL=y # CONFIG_RPIVID_MEM is not set -# CONFIG_RPI_AXIPERF is not set # CONFIG_RPI_POE_POWER is not set CONFIG_RPS=y CONFIG_RWSEM_SPIN_ON_OWNER=y CONFIG_SCSI=y +CONFIG_SCSI_COMMON=y # CONFIG_SCSI_LOWLEVEL is not set # CONFIG_SCSI_PROC_FS is not set CONFIG_SERIAL_8250_BCM2835AUX=y @@ -400,8 +404,7 @@ CONFIG_SG_POOL=y CONFIG_SMP=y CONFIG_SMP_ON_UP=y CONFIG_SMSC_PHY=y -# CONFIG_SND_SOC_AD193X_I2C is not set -# CONFIG_SND_SOC_AD193X_SPI is not set +CONFIG_SOCK_RX_QUEUE_MAPPING=y CONFIG_SPARSE_IRQ=y CONFIG_SRCU=y # CONFIG_STRIP_ASM_SYMS is not set @@ -411,7 +414,6 @@ CONFIG_SWIOTLB=y CONFIG_SWPHY=y CONFIG_SWP_EMULATE=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_SYS_SUPPORTS_HUGETLBFS=y # CONFIG_TEXTSEARCH is not set CONFIG_THERMAL=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y @@ -424,6 +426,7 @@ CONFIG_TIMER_PROBE=y CONFIG_TMPFS_POSIX_ACL=y CONFIG_TREE_RCU=y CONFIG_TREE_SRCU=y +# CONFIG_UCLAMP_TASK is not set CONFIG_UEVENT_HELPER_PATH="" # CONFIG_UID16 is not set CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" @@ -447,6 +450,7 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_PCI=y CONFIG_USB_XHCI_PLATFORM=y CONFIG_USE_OF=y +CONFIG_VCHIQ_CDEV=y CONFIG_VFP=y CONFIG_VFPv3=y CONFIG_VT=y diff --git a/target/linux/bcm27xx/bcm2710/config-5.10 b/target/linux/bcm27xx/bcm2710/config-5.15 similarity index 94% rename from target/linux/bcm27xx/bcm2710/config-5.10 rename to target/linux/bcm27xx/bcm2710/config-5.15 index 6e26891070..bd7cbea350 100644 --- a/target/linux/bcm27xx/bcm2710/config-5.10 +++ b/target/linux/bcm27xx/bcm2710/config-5.15 @@ -4,19 +4,20 @@ CONFIG_ARCH_BCM2835=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y CONFIG_ARCH_MMAP_RND_BITS=18 CONFIG_ARCH_MMAP_RND_BITS_MAX=24 CONFIG_ARCH_MMAP_RND_BITS_MIN=18 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 CONFIG_ARCH_PROC_KCORE_TEXT=y -CONFIG_ARCH_SELECT_MEMORY_MODEL=y -CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_STACKWALK=y CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_WANTS_NO_INSTR=y CONFIG_ARM64=y CONFIG_ARM64_4K_PAGES=y CONFIG_ARM64_CNP=y +CONFIG_ARM64_EPAN=y CONFIG_ARM64_ERRATUM_819472=y CONFIG_ARM64_ERRATUM_824069=y CONFIG_ARM64_ERRATUM_826319=y @@ -24,18 +25,18 @@ CONFIG_ARM64_ERRATUM_827319=y CONFIG_ARM64_ERRATUM_832075=y CONFIG_ARM64_ERRATUM_843419=y CONFIG_ARM64_HW_AFDBM=y +CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y CONFIG_ARM64_MODULE_PLTS=y CONFIG_ARM64_PAGE_SHIFT=12 CONFIG_ARM64_PAN=y CONFIG_ARM64_PA_BITS=48 CONFIG_ARM64_PA_BITS_48=y CONFIG_ARM64_PTR_AUTH=y +CONFIG_ARM64_PTR_AUTH_KERNEL=y CONFIG_ARM64_SVE=y CONFIG_ARM64_TAGGED_ADDR_ABI=y -CONFIG_ARM64_UAO=y CONFIG_ARM64_VA_BITS=39 CONFIG_ARM64_VA_BITS_39=y -CONFIG_ARM64_VHE=y CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y CONFIG_ARM_AMBA=y CONFIG_ARM_ARCH_TIMER=y @@ -46,6 +47,7 @@ CONFIG_ARM_GIC_V2M=y CONFIG_ARM_GIC_V3=y CONFIG_ARM_GIC_V3_ITS=y CONFIG_ARM_GIC_V3_ITS_PCI=y +# CONFIG_ARM_MHU_V2 is not set CONFIG_ARM_PSCI_FW=y CONFIG_ARM_RASPBERRYPI_CPUFREQ=y CONFIG_ARM_TIMER_SP804=y @@ -72,15 +74,12 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y -CONFIG_BLK_SCSI_REQUEST=y -CONFIG_BOUNCE=y CONFIG_BRCMSTB_L2_IRQ=y CONFIG_BRCM_CHAR_DRIVERS=y CONFIG_CAVIUM_ERRATUM_22375=y CONFIG_CAVIUM_ERRATUM_23154=y CONFIG_CAVIUM_ERRATUM_27456=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -96,6 +95,7 @@ CONFIG_CMA_SIZE_MBYTES=5 CONFIG_CMA_SIZE_SEL_MBYTES=y # CONFIG_CMA_SIZE_SEL_MIN is not set # CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +# CONFIG_CMA_SYSFS is not set CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_XGENE=y # CONFIG_COMPAT_32BIT_TIME is not set @@ -113,6 +113,7 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y CONFIG_CPU_FREQ_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y CONFIG_CPU_FREQ_GOV_USERSPACE=y CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_IDLE=y @@ -141,7 +142,6 @@ CONFIG_CRYPTO_SHA512=y CONFIG_CRYPTO_XTS=y CONFIG_DCACHE_WORD_ACCESS=y CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEBUG_INFO=y CONFIG_DMABUF_HEAPS=y CONFIG_DMABUF_HEAPS_CMA=y CONFIG_DMABUF_HEAPS_SYSTEM=y @@ -159,7 +159,6 @@ CONFIG_DNOTIFY=y CONFIG_DTC=y CONFIG_DUMMY_CONSOLE=y CONFIG_EDAC_SUPPORT=y -CONFIG_ENABLE_MUST_CHECK=y CONFIG_EXT4_FS=y CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_SECURITY=y @@ -175,7 +174,6 @@ CONFIG_FB_CMDLINE=y CONFIG_FB_SIMPLE=y CONFIG_FIXED_PHY=y CONFIG_FIX_EARLYCON_MEM=y -# CONFIG_FLATMEM_MANUAL is not set CONFIG_FONT_8x16=y CONFIG_FONT_8x8=y CONFIG_FONT_SUPPORT=y @@ -190,6 +188,7 @@ CONFIG_FS_ENCRYPTION_ALGS=y CONFIG_FS_IOMAP=y CONFIG_FS_MBCACHE=y CONFIG_FS_POSIX_ACL=y +CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_GENERIC_ALLOCATOR=y @@ -202,14 +201,15 @@ CONFIG_GENERIC_CPU_AUTOPROBE=y CONFIG_GENERIC_CPU_VULNERABILITIES=y CONFIG_GENERIC_CSUM=y CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_FIND_FIRST_BIT=y CONFIG_GENERIC_GETTIMEOFDAY=y CONFIG_GENERIC_IDLE_POLL_SETUP=y CONFIG_GENERIC_IRQ_CHIP=y CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y CONFIG_GENERIC_IRQ_MIGRATION=y -CONFIG_GENERIC_IRQ_MULTI_HANDLER=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y CONFIG_GENERIC_PCI_IOMAP=y @@ -224,6 +224,7 @@ CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_BCM_VIRT=y +CONFIG_GPIO_CDEV=y # CONFIG_GPIO_FSM is not set CONFIG_GPIO_RASPBERRYPI_EXP=y CONFIG_HANDLE_DOMAIN_IRQ=y @@ -231,7 +232,6 @@ CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y -CONFIG_HOLES_IN_ZONE=y CONFIG_HOTPLUG_CPU=y CONFIG_HW_CONSOLE=y CONFIG_HW_RANDOM=y @@ -269,13 +269,13 @@ CONFIG_MAC_PARTITION=y CONFIG_MAGIC_SYSRQ=y CONFIG_MAILBOX=y # CONFIG_MAILBOX_TEST is not set -CONFIG_MAX_RAW_DEVS=256 CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y CONFIG_MDIO_DEVRES=y CONFIG_MEMFD_CREATE=y CONFIG_MEMORY_ISOLATION=y CONFIG_MFD_CORE=y +# CONFIG_MFD_RASPBERRYPI_POE_HAT is not set # CONFIG_MFD_RPISENSE_CORE is not set CONFIG_MFD_SYSCON=y CONFIG_MICROCHIP_PHY=y @@ -299,14 +299,15 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_SELFTESTS=y CONFIG_NLS=y CONFIG_NLS_ASCII=y +CONFIG_NOP_USB_XCEIV=y CONFIG_NO_HZ=y CONFIG_NO_HZ_COMMON=y CONFIG_NO_HZ_IDLE=y CONFIG_NR_CPUS=4 CONFIG_NVMEM=y -# CONFIG_NVMEM_RMEM is not set CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_CONFIGFS=y @@ -317,7 +318,6 @@ CONFIG_OF_GPIO=y CONFIG_OF_IRQ=y CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y -CONFIG_OF_NET=y CONFIG_OF_OVERLAY=y CONFIG_OF_RESOLVE=y CONFIG_PADATA=y @@ -344,13 +344,13 @@ CONFIG_PM_SLEEP_SMP=y CONFIG_POWER_RESET=y CONFIG_POWER_SUPPLY=y CONFIG_PRINTK_TIME=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y CONFIG_RASPBERRYPI_FIRMWARE=y CONFIG_RASPBERRYPI_POWER=y CONFIG_RATIONAL=y # CONFIG_RAVE_SP_CORE is not set -CONFIG_RAW_DRIVER=y CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y CONFIG_REGULATOR=y @@ -362,11 +362,11 @@ CONFIG_RESET_SIMPLE=y CONFIG_RFS_ACCEL=y CONFIG_RODATA_FULL_DEFAULT_ENABLED=y # CONFIG_RPIVID_MEM is not set -# CONFIG_RPI_AXIPERF is not set # CONFIG_RPI_POE_POWER is not set CONFIG_RPS=y CONFIG_RWSEM_SPIN_ON_OWNER=y CONFIG_SCSI=y +CONFIG_SCSI_COMMON=y # CONFIG_SCSI_LOWLEVEL is not set # CONFIG_SCSI_PROC_FS is not set CONFIG_SERIAL_8250_BCM2835AUX=y @@ -385,11 +385,9 @@ CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SG_POOL=y CONFIG_SMP=y CONFIG_SMSC_PHY=y -# CONFIG_SND_SOC_AD193X_I2C is not set -# CONFIG_SND_SOC_AD193X_SPI is not set +CONFIG_SOCK_RX_QUEUE_MAPPING=y CONFIG_SPARSEMEM=y CONFIG_SPARSEMEM_EXTREME=y -CONFIG_SPARSEMEM_MANUAL=y CONFIG_SPARSEMEM_VMEMMAP=y CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y CONFIG_SPARSE_IRQ=y @@ -400,7 +398,6 @@ CONFIG_SUSPEND_FREEZER=y CONFIG_SWIOTLB=y CONFIG_SWPHY=y CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_SYS_SUPPORTS_HUGETLBFS=y # CONFIG_TEXTSEARCH is not set CONFIG_THERMAL=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y @@ -415,6 +412,7 @@ CONFIG_TIMER_PROBE=y CONFIG_TMPFS_POSIX_ACL=y CONFIG_TREE_RCU=y CONFIG_TREE_SRCU=y +# CONFIG_UCLAMP_TASK is not set CONFIG_UEVENT_HELPER_PATH="" CONFIG_UNMAP_KERNEL_AT_EL0=y CONFIG_USB=y @@ -424,10 +422,12 @@ CONFIG_USB_DWCOTG=y CONFIG_USB_LAN78XX=y CONFIG_USB_NET_DRIVERS=y CONFIG_USB_NET_SMSC95XX=y +CONFIG_USB_PHY=y CONFIG_USB_STORAGE=y CONFIG_USB_SUPPORT=y CONFIG_USB_UAS=y CONFIG_USB_USBNET=y +CONFIG_VCHIQ_CDEV=y CONFIG_VMAP_STACK=y CONFIG_VT=y CONFIG_VT_CONSOLE=y diff --git a/target/linux/bcm27xx/bcm2711/config-5.10 b/target/linux/bcm27xx/bcm2711/config-5.15 similarity index 94% rename from target/linux/bcm27xx/bcm2711/config-5.10 rename to target/linux/bcm27xx/bcm2711/config-5.15 index 03d84378b3..834b1b33ed 100644 --- a/target/linux/bcm27xx/bcm2711/config-5.10 +++ b/target/linux/bcm27xx/bcm2711/config-5.15 @@ -4,19 +4,20 @@ CONFIG_ARCH_BCM2835=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y CONFIG_ARCH_MMAP_RND_BITS=18 CONFIG_ARCH_MMAP_RND_BITS_MAX=24 CONFIG_ARCH_MMAP_RND_BITS_MIN=18 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 CONFIG_ARCH_PROC_KCORE_TEXT=y -CONFIG_ARCH_SELECT_MEMORY_MODEL=y -CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_STACKWALK=y CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_WANTS_NO_INSTR=y CONFIG_ARM64=y CONFIG_ARM64_4K_PAGES=y CONFIG_ARM64_CNP=y +CONFIG_ARM64_EPAN=y CONFIG_ARM64_ERRATUM_819472=y CONFIG_ARM64_ERRATUM_824069=y CONFIG_ARM64_ERRATUM_826319=y @@ -24,18 +25,18 @@ CONFIG_ARM64_ERRATUM_827319=y CONFIG_ARM64_ERRATUM_832075=y CONFIG_ARM64_ERRATUM_843419=y CONFIG_ARM64_HW_AFDBM=y +CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y CONFIG_ARM64_MODULE_PLTS=y CONFIG_ARM64_PAGE_SHIFT=12 CONFIG_ARM64_PAN=y CONFIG_ARM64_PA_BITS=48 CONFIG_ARM64_PA_BITS_48=y CONFIG_ARM64_PTR_AUTH=y +CONFIG_ARM64_PTR_AUTH_KERNEL=y CONFIG_ARM64_SVE=y CONFIG_ARM64_TAGGED_ADDR_ABI=y -CONFIG_ARM64_UAO=y CONFIG_ARM64_VA_BITS=39 CONFIG_ARM64_VA_BITS_39=y -CONFIG_ARM64_VHE=y CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y CONFIG_ARM_AMBA=y CONFIG_ARM_ARCH_TIMER=y @@ -46,6 +47,7 @@ CONFIG_ARM_GIC_V2M=y CONFIG_ARM_GIC_V3=y CONFIG_ARM_GIC_V3_ITS=y CONFIG_ARM_GIC_V3_ITS_PCI=y +# CONFIG_ARM_MHU_V2 is not set CONFIG_ARM_PSCI_FW=y CONFIG_ARM_RASPBERRYPI_CPUFREQ=y CONFIG_ARM_TIMER_SP804=y @@ -75,8 +77,6 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y -CONFIG_BLK_SCSI_REQUEST=y -CONFIG_BOUNCE=y CONFIG_BRCMSTB_L2_IRQ=y CONFIG_BRCM_CHAR_DRIVERS=y CONFIG_BROADCOM_PHY=y @@ -84,7 +84,6 @@ CONFIG_CAVIUM_ERRATUM_22375=y CONFIG_CAVIUM_ERRATUM_23154=y CONFIG_CAVIUM_ERRATUM_27456=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_MMIO=y CONFIG_CLK_BCM2711_DVP=y CONFIG_CLK_BCM2835=y @@ -100,6 +99,7 @@ CONFIG_CMA_SIZE_MBYTES=5 CONFIG_CMA_SIZE_SEL_MBYTES=y # CONFIG_CMA_SIZE_SEL_MIN is not set # CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +# CONFIG_CMA_SYSFS is not set CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_XGENE=y # CONFIG_COMPAT_32BIT_TIME is not set @@ -117,6 +117,7 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y CONFIG_CPU_FREQ_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y CONFIG_CPU_FREQ_GOV_USERSPACE=y CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_IDLE=y @@ -145,7 +146,6 @@ CONFIG_CRYPTO_SHA512=y CONFIG_CRYPTO_XTS=y CONFIG_DCACHE_WORD_ACCESS=y CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEBUG_INFO=y CONFIG_DIMLIB=y CONFIG_DMABUF_HEAPS=y CONFIG_DMABUF_HEAPS_CMA=y @@ -164,7 +164,6 @@ CONFIG_DNOTIFY=y CONFIG_DTC=y CONFIG_DUMMY_CONSOLE=y CONFIG_EDAC_SUPPORT=y -CONFIG_ENABLE_MUST_CHECK=y CONFIG_EXT4_FS=y CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_SECURITY=y @@ -180,7 +179,6 @@ CONFIG_FB_CMDLINE=y CONFIG_FB_SIMPLE=y CONFIG_FIXED_PHY=y CONFIG_FIX_EARLYCON_MEM=y -# CONFIG_FLATMEM_MANUAL is not set CONFIG_FONT_8x16=y CONFIG_FONT_8x8=y CONFIG_FONT_SUPPORT=y @@ -195,6 +193,7 @@ CONFIG_FS_ENCRYPTION_ALGS=y CONFIG_FS_IOMAP=y CONFIG_FS_MBCACHE=y CONFIG_FS_POSIX_ACL=y +CONFIG_FWNODE_MDIO=y CONFIG_FW_CACHE=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_GENERIC_ALLOCATOR=y @@ -207,14 +206,15 @@ CONFIG_GENERIC_CPU_AUTOPROBE=y CONFIG_GENERIC_CPU_VULNERABILITIES=y CONFIG_GENERIC_CSUM=y CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_FIND_FIRST_BIT=y CONFIG_GENERIC_GETTIMEOFDAY=y CONFIG_GENERIC_IDLE_POLL_SETUP=y CONFIG_GENERIC_IRQ_CHIP=y CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y CONFIG_GENERIC_IRQ_MIGRATION=y -CONFIG_GENERIC_IRQ_MULTI_HANDLER=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y CONFIG_GENERIC_PCI_IOMAP=y @@ -230,6 +230,7 @@ CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_BCM_VIRT=y +CONFIG_GPIO_CDEV=y # CONFIG_GPIO_FSM is not set CONFIG_GPIO_RASPBERRYPI_EXP=y CONFIG_HANDLE_DOMAIN_IRQ=y @@ -237,7 +238,6 @@ CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y -CONFIG_HOLES_IN_ZONE=y CONFIG_HOTPLUG_CPU=y CONFIG_HW_CONSOLE=y CONFIG_HW_RANDOM=y @@ -276,7 +276,6 @@ CONFIG_MAC_PARTITION=y CONFIG_MAGIC_SYSRQ=y CONFIG_MAILBOX=y # CONFIG_MAILBOX_TEST is not set -CONFIG_MAX_RAW_DEVS=256 CONFIG_MDIO_BCM_UNIMAC=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y @@ -284,6 +283,7 @@ CONFIG_MDIO_DEVRES=y CONFIG_MEMFD_CREATE=y CONFIG_MEMORY_ISOLATION=y CONFIG_MFD_CORE=y +# CONFIG_MFD_RASPBERRYPI_POE_HAT is not set # CONFIG_MFD_RPISENSE_CORE is not set CONFIG_MFD_SYSCON=y CONFIG_MIGRATION=y @@ -306,6 +306,7 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_SELFTESTS=y CONFIG_NLS=y CONFIG_NLS_ASCII=y CONFIG_NOP_USB_XCEIV=y @@ -314,7 +315,6 @@ CONFIG_NO_HZ_COMMON=y CONFIG_NO_HZ_IDLE=y CONFIG_NR_CPUS=4 CONFIG_NVMEM=y -# CONFIG_NVMEM_RMEM is not set CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_CONFIGFS=y @@ -325,7 +325,6 @@ CONFIG_OF_GPIO=y CONFIG_OF_IRQ=y CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y -CONFIG_OF_NET=y CONFIG_OF_OVERLAY=y CONFIG_OF_RESOLVE=y CONFIG_PADATA=y @@ -355,6 +354,7 @@ CONFIG_PM_SLEEP_SMP=y CONFIG_POWER_RESET=y CONFIG_POWER_SUPPLY=y CONFIG_PRINTK_TIME=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y CONFIG_RAS=y @@ -362,7 +362,6 @@ CONFIG_RASPBERRYPI_FIRMWARE=y CONFIG_RASPBERRYPI_POWER=y CONFIG_RATIONAL=y # CONFIG_RAVE_SP_CORE is not set -CONFIG_RAW_DRIVER=y CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y CONFIG_REGULATOR=y @@ -374,11 +373,11 @@ CONFIG_RESET_SIMPLE=y CONFIG_RFS_ACCEL=y CONFIG_RODATA_FULL_DEFAULT_ENABLED=y # CONFIG_RPIVID_MEM is not set -# CONFIG_RPI_AXIPERF is not set # CONFIG_RPI_POE_POWER is not set CONFIG_RPS=y CONFIG_RWSEM_SPIN_ON_OWNER=y CONFIG_SCSI=y +CONFIG_SCSI_COMMON=y # CONFIG_SCSI_LOWLEVEL is not set # CONFIG_SCSI_PROC_FS is not set CONFIG_SERIAL_8250_BCM2835AUX=y @@ -396,11 +395,9 @@ CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SG_POOL=y CONFIG_SMP=y -# CONFIG_SND_SOC_AD193X_I2C is not set -# CONFIG_SND_SOC_AD193X_SPI is not set +CONFIG_SOCK_RX_QUEUE_MAPPING=y CONFIG_SPARSEMEM=y CONFIG_SPARSEMEM_EXTREME=y -CONFIG_SPARSEMEM_MANUAL=y CONFIG_SPARSEMEM_VMEMMAP=y CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y CONFIG_SPARSE_IRQ=y @@ -411,7 +408,6 @@ CONFIG_SUSPEND_FREEZER=y CONFIG_SWIOTLB=y CONFIG_SWPHY=y CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_SYS_SUPPORTS_HUGETLBFS=y # CONFIG_TEXTSEARCH is not set CONFIG_THERMAL=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y @@ -426,6 +422,7 @@ CONFIG_TIMER_PROBE=y CONFIG_TMPFS_POSIX_ACL=y CONFIG_TREE_RCU=y CONFIG_TREE_SRCU=y +# CONFIG_UCLAMP_TASK is not set CONFIG_UEVENT_HELPER_PATH="" CONFIG_UNMAP_KERNEL_AT_EL0=y CONFIG_USB=y @@ -442,6 +439,7 @@ CONFIG_USB_UAS=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_PCI=y CONFIG_USB_XHCI_PLATFORM=y +CONFIG_VCHIQ_CDEV=y CONFIG_VMAP_STACK=y CONFIG_VT=y CONFIG_VT_CONSOLE=y diff --git a/target/linux/bcm27xx/modules/hwmon.mk b/target/linux/bcm27xx/modules/hwmon.mk index 316f0b8419..0f1547cd4f 100644 --- a/target/linux/bcm27xx/modules/hwmon.mk +++ b/target/linux/bcm27xx/modules/hwmon.mk @@ -15,19 +15,3 @@ define KernelPackage/hwmon-raspberrypi/description endef $(eval $(call KernelPackage,hwmon-raspberrypi)) - - -define KernelPackage/hwmon-rpi-poe-fan - SUBMENU:=$(HWMON_MENU) - TITLE:=Raspberry Pi PoE HAT fan - DEPENDS:=@TARGET_bcm27xx +kmod-hwmon-core - KCONFIG:=CONFIG_SENSORS_RPI_POE_FAN - FILES:=$(LINUX_DIR)/drivers/hwmon/rpi-poe-fan.ko - AUTOLOAD:=$(call AutoProbe,rpi-poe-fan) -endef - -define KernelPackage/hwmon-rpi-poe-fan/description - Raspberry Pi PoE HAT fan driver -endef - -$(eval $(call KernelPackage,hwmon-rpi-poe-fan)) diff --git a/target/linux/bcm27xx/modules/other.mk b/target/linux/bcm27xx/modules/other.mk index 2d4aa3c079..5f37e498d0 100644 --- a/target/linux/bcm27xx/modules/other.mk +++ b/target/linux/bcm27xx/modules/other.mk @@ -20,6 +20,24 @@ endef $(eval $(call KernelPackage,pwm-bcm2835)) +define KernelPackage/pwm-raspberrypi-poe + SUBMENU:=$(OTHER_MENU) + TITLE:=Raspberry Pi Firwmware PoE Hat PWM support + KCONFIG:= \ + CONFIG_PWM=y \ + CONFIG_PWM_RASPBERRYPI_POE + FILES:=$(LINUX_DIR)/drivers/pwm/pwm-raspberrypi-poe.ko + AUTOLOAD:=$(call AutoLoad,20,pwm-raspberrypi-poe) + DEPENDS:=@TARGET_bcm27xx @LINUX_5_15 +endef + +define KernelPackage/pwm-raspberrypi-poe/description + This package provides Raspberry Pi Firwmware PoE Hat PWM support +endef + +$(eval $(call KernelPackage,pwm-raspberrypi-poe)) + + define KernelPackage/smi-bcm2835 SUBMENU:=$(OTHER_MENU) TITLE:=BCM2835 SMI driver diff --git a/target/linux/bcm27xx/modules/sound.mk b/target/linux/bcm27xx/modules/sound.mk index 0823786d5c..3d5ba33626 100644 --- a/target/linux/bcm27xx/modules/sound.mk +++ b/target/linux/bcm27xx/modules/sound.mk @@ -932,6 +932,7 @@ define KernelPackage/sound-soc-rpi-cirrus CONFIG_SND_SOC_WM8804 \ CONFIG_SND_SOC_WM_ADSP FILES:= \ + $(LINUX_DIR)/drivers/mfd/arizona.ko \ $(LINUX_DIR)/sound/soc/bcm/snd-soc-rpi-cirrus.ko \ $(LINUX_DIR)/sound/soc/codecs/snd-soc-arizona.ko \ $(LINUX_DIR)/sound/soc/codecs/snd-soc-wm-adsp.ko \ diff --git a/target/linux/bcm27xx/modules/video.mk b/target/linux/bcm27xx/modules/video.mk index f480831caf..f9d32e263a 100644 --- a/target/linux/bcm27xx/modules/video.mk +++ b/target/linux/bcm27xx/modules/video.mk @@ -40,7 +40,7 @@ define KernelPackage/drm-vc4 $(LINUX_DIR)/drivers/gpu/drm/vc4/vc4.ko \ $(LINUX_DIR)/drivers/gpu/drm/drm_kms_helper.ko \ $(LINUX_DIR)/drivers/media/cec/cec.ko@lt5.10 \ - $(LINUX_DIR)/drivers/media/cec/core/cec.ko@ge5.10 + $(LINUX_DIR)/drivers/media/cec/core/cec.ko AUTOLOAD:=$(call AutoProbe,vc4) endef diff --git a/target/linux/bcm27xx/patches-5.10/950-0015-firmware-Updated-mailbox-header.patch b/target/linux/bcm27xx/patches-5.10/950-0015-firmware-Updated-mailbox-header.patch deleted file mode 100644 index d909c9d150..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0015-firmware-Updated-mailbox-header.patch +++ /dev/null @@ -1,27 +0,0 @@ -From b7ad81911a06fd8047ca36c07bd49d8317833502 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 25 Jan 2016 17:25:12 +0000 -Subject: [PATCH] firmware: Updated mailbox header - ---- - include/soc/bcm2835/raspberrypi-firmware.h | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/include/soc/bcm2835/raspberrypi-firmware.h -+++ b/include/soc/bcm2835/raspberrypi-firmware.h -@@ -9,6 +9,8 @@ - #include - #include - -+#define RPI_FIRMWARE_CHAN_FB 1 -+ - struct rpi_firmware; - - enum rpi_firmware_property_status { -@@ -161,5 +163,6 @@ static inline struct rpi_firmware *rpi_f - return NULL; - } - #endif -+int rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data); - - #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ diff --git a/target/linux/bcm27xx/patches-5.10/950-0028-mm-Remove-the-PFN-busy-warning.patch b/target/linux/bcm27xx/patches-5.10/950-0028-mm-Remove-the-PFN-busy-warning.patch deleted file mode 100644 index 3f320fd002..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0028-mm-Remove-the-PFN-busy-warning.patch +++ /dev/null @@ -1,25 +0,0 @@ -From a432a3f7142e7e76fd1708debe509ffbea3a3658 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH] mm: Remove the PFN busy warning - -See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is -expected sometimes when using CMA. However, that commit still spams -my kernel log with these warnings. - -Signed-off-by: Eric Anholt ---- - mm/page_alloc.c | 2 -- - 1 file changed, 2 deletions(-) - ---- a/mm/page_alloc.c -+++ b/mm/page_alloc.c -@@ -8603,8 +8603,6 @@ int alloc_contig_range(unsigned long sta - - /* Make sure the range is really isolated. */ - if (test_pages_isolated(outer_start, end, 0)) { -- pr_info_ratelimited("%s: [%lx, %lx) PFNs busy\n", -- __func__, outer_start, end); - ret = -EBUSY; - goto done; - } diff --git a/target/linux/bcm27xx/patches-5.10/950-0035-tty-amba-pl011-Make-TX-optimisation-conditional.patch b/target/linux/bcm27xx/patches-5.10/950-0035-tty-amba-pl011-Make-TX-optimisation-conditional.patch deleted file mode 100644 index f7316fb3e6..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0035-tty-amba-pl011-Make-TX-optimisation-conditional.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 28c2408f991d97de5e3d1da9711cf5486f411d02 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 11 Jul 2019 13:13:39 +0100 -Subject: [PATCH] tty: amba-pl011: Make TX optimisation conditional - -pl011_tx_chars takes a "from_irq" parameter to reduce the number of -register accesses. When from_irq is true the function assumes that the -FIFO is half empty and writes up to half a FIFO's worth of bytes -without polling the FIFO status register, the reasoning being that -the function is being called as a result of the TX interrupt being -raised. This logic would work were it not for the fact that -pl011_rx_chars, called from pl011_int before pl011_tx_chars, releases -the spinlock before calling tty_flip_buffer_push. - -A user thread writing to the UART claims the spinlock and ultimately -calls pl011_tx_chars with from_irq set to false. This reverts to the -older logic that polls the FIFO status register before sending every -byte. If this happen on an SMP system during the section of the IRQ -handler where the spinlock has been released, then by the time the TX -interrupt handler is called, the FIFO may already be full, and any -further writes are likely to be lost. - -The fix involves adding a per-port flag that is true iff running from -within the interrupt handler and the spinlock has not yet been released. -This flag is then used as the value for the from_irq parameter of -pl011_tx_chars, causing polling to be used in the unsafe case. - -Fixes: 1e84d22322ce ("serial/amba-pl011: Refactor and simplify TX FIFO handling") - -Signed-off-by: Phil Elwell ---- - drivers/tty/serial/amba-pl011.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - ---- a/drivers/tty/serial/amba-pl011.c -+++ b/drivers/tty/serial/amba-pl011.c -@@ -265,6 +265,7 @@ struct uart_amba_port { - unsigned int old_cr; /* state during shutdown */ - unsigned int fixed_baud; /* vendor-set fixed baud rate */ - char type[12]; -+ bool irq_locked; /* in irq, unreleased lock */ - #ifdef CONFIG_DMA_ENGINE - /* DMA stuff */ - bool using_tx_dma; -@@ -811,6 +812,7 @@ __acquires(&uap->port.lock) - if (!uap->using_tx_dma) - return; - -+ uap->irq_locked = 0; - dmaengine_terminate_async(uap->dmatx.chan); - - if (uap->dmatx.queued) { -@@ -937,6 +939,7 @@ static void pl011_dma_rx_chars(struct ua - fifotaken = pl011_fifo_to_tty(uap); - } - -+ uap->irq_locked = 0; - spin_unlock(&uap->port.lock); - dev_vdbg(uap->port.dev, - "Took %d chars from DMA buffer and %d chars from the FIFO\n", -@@ -1341,6 +1344,7 @@ __acquires(&uap->port.lock) - { - pl011_fifo_to_tty(uap); - -+ uap->irq_locked = 0; - spin_unlock(&uap->port.lock); - tty_flip_buffer_push(&uap->port.state->port); - /* -@@ -1474,6 +1478,7 @@ static irqreturn_t pl011_int(int irq, vo - int handled = 0; - - spin_lock_irqsave(&uap->port.lock, flags); -+ uap->irq_locked = 1; - status = pl011_read(uap, REG_RIS) & uap->im; - if (status) { - do { -@@ -1493,7 +1498,7 @@ static irqreturn_t pl011_int(int irq, vo - UART011_CTSMIS|UART011_RIMIS)) - pl011_modem_status(uap); - if (status & UART011_TXIS) -- pl011_tx_chars(uap, true); -+ pl011_tx_chars(uap, uap->irq_locked); - - if (pass_counter-- == 0) - break; diff --git a/target/linux/bcm27xx/patches-5.10/950-0038-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch b/target/linux/bcm27xx/patches-5.10/950-0038-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch deleted file mode 100644 index d8bb4c1f73..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0038-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 68ef623a719071e05f5d62270c7bee35a2984452 Mon Sep 17 00:00:00 2001 -From: notro -Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH] pinctrl-bcm2835: Set base to 0 give expected gpio - numbering - -Signed-off-by: Noralf Tronnes ---- - drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c -+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c -@@ -362,7 +362,7 @@ static const struct gpio_chip bcm2835_gp - .get = bcm2835_gpio_get, - .set = bcm2835_gpio_set, - .set_config = gpiochip_generic_config, -- .base = -1, -+ .base = 0, - .ngpio = BCM2835_NUM_GPIOS, - .can_sleep = false, - }; diff --git a/target/linux/bcm27xx/patches-5.10/950-0061-Fixes-a-problem-when-module-probes-before-i2c-module.patch b/target/linux/bcm27xx/patches-5.10/950-0061-Fixes-a-problem-when-module-probes-before-i2c-module.patch deleted file mode 100644 index f4dc7b6289..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0061-Fixes-a-problem-when-module-probes-before-i2c-module.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 4be98b29d123fc7615ea8404fbda450ec8acb084 Mon Sep 17 00:00:00 2001 -From: Joerg Schambacher -Date: Fri, 16 Oct 2020 15:17:07 +0200 -Subject: [PATCH] Fixes a problem when module probes before i2c module - is available - -The driver crashed while a NULL pointer returned by i2c_get_adapter() -has been used to access the i2c bus functions. -The headphone probing function hb_hp_probe() now returns -EPROBE_DEFER -in case the i2c module has not been loaded yet. - -Signed-off-by: Joerg Schambacher ---- - sound/soc/bcm/hifiberry_dacplus.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - ---- a/sound/soc/bcm/hifiberry_dacplus.c -+++ b/sound/soc/bcm/hifiberry_dacplus.c -@@ -315,12 +315,14 @@ static int hb_hp_detect(void) - { - struct i2c_adapter *adap = i2c_get_adapter(1); - int ret; -- - struct i2c_client tpa_i2c_client = { - .addr = 0x60, - .adapter = adap, - }; - -+ if (!adap) -+ return -EPROBE_DEFER; /* I2C module not yet available */ -+ - ret = i2c_smbus_read_byte(&tpa_i2c_client) >= 0; - i2c_put_adapter(adap); - return ret; -@@ -342,7 +344,10 @@ static int snd_rpi_hifiberry_dacplus_pro - struct of_changeset ocs; - - /* probe for head phone amp */ -- if (hb_hp_detect()) { -+ ret = hb_hp_detect(); -+ if (ret < 0) -+ return ret; -+ if (ret) { - card->aux_dev = hifiberry_dacplus_aux_devs; - card->num_aux_devs = - ARRAY_SIZE(hifiberry_dacplus_aux_devs); diff --git a/target/linux/bcm27xx/patches-5.10/950-0073-raspberrypi-firmware-Export-the-general-transaction-.patch b/target/linux/bcm27xx/patches-5.10/950-0073-raspberrypi-firmware-Export-the-general-transaction-.patch deleted file mode 100644 index 17f36af72d..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0073-raspberrypi-firmware-Export-the-general-transaction-.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 9cf689eda644ccba0c80982cbd821c9163f5de39 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Wed, 14 Sep 2016 09:16:19 +0100 -Subject: [PATCH] raspberrypi-firmware: Export the general transaction - function. - -The vc4-firmware-kms module is going to be doing the MBOX FB call. - -Signed-off-by: Eric Anholt ---- - drivers/firmware/raspberrypi.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/firmware/raspberrypi.c -+++ b/drivers/firmware/raspberrypi.c -@@ -46,7 +46,7 @@ static void response_callback(struct mbo - * Sends a request to the firmware through the BCM2835 mailbox driver, - * and synchronously waits for the reply. - */ --static int -+int - rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) - { - u32 message = MBOX_MSG(chan, data); -@@ -71,6 +71,7 @@ rpi_firmware_transaction(struct rpi_firm - - return ret; - } -+EXPORT_SYMBOL_GPL(rpi_firmware_transaction); - - /** - * rpi_firmware_property_list - Submit firmware property list diff --git a/target/linux/bcm27xx/patches-5.10/950-0075-added-capture_clear-option-to-pps-gpio-via-dtoverlay.patch b/target/linux/bcm27xx/patches-5.10/950-0075-added-capture_clear-option-to-pps-gpio-via-dtoverlay.patch deleted file mode 100644 index 80f68e9085..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0075-added-capture_clear-option-to-pps-gpio-via-dtoverlay.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 781bfd769e192aa39ef93fa37c812af444a9cf93 Mon Sep 17 00:00:00 2001 -From: hdoverobinson -Date: Tue, 13 Mar 2018 06:58:39 -0400 -Subject: [PATCH] added capture_clear option to pps-gpio via dtoverlay - (#2433) - ---- - drivers/pps/clients/pps-gpio.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/drivers/pps/clients/pps-gpio.c -+++ b/drivers/pps/clients/pps-gpio.c -@@ -145,6 +145,8 @@ static int pps_gpio_setup(struct platfor - - if (of_property_read_bool(np, "assert-falling-edge")) - data->assert_falling_edge = true; -+ if (of_property_read_bool(np, "capture-clear")) -+ data->capture_clear = true; - return 0; - } - diff --git a/target/linux/bcm27xx/patches-5.10/950-0084-Add-rpi-poe-fan-driver.patch b/target/linux/bcm27xx/patches-5.10/950-0084-Add-rpi-poe-fan-driver.patch deleted file mode 100644 index a93529e4ba..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0084-Add-rpi-poe-fan-driver.patch +++ /dev/null @@ -1,581 +0,0 @@ -From 079bce6210d997fda44d6143b4b394173360bef1 Mon Sep 17 00:00:00 2001 -From: Serge Schneider -Date: Mon, 9 Jul 2018 12:54:25 +0100 -Subject: [PATCH] Add rpi-poe-fan driver - -Signed-off-by: Serge Schneider - -PoE HAT driver cleanup - -* Fix undeclared variable in rpi_poe_fan_suspend -* Add SPDX-License-Identifier -* Expand PoE acronym in Kconfig help -* Give clearer error message on of_property_count_u32_elems fail -* Add documentation -* Add vendor to of_device_id compatible string. -* Rename m_data_s struct to fw_data_s -* Fix typos - -Fixes: #2665 - -Signed-off-by: Serge Schneider - -rpi-poe-fan: fix def_pwm1 writes - -Signed-off-by: Serge Schneider ---- - .../devicetree/bindings/hwmon/rpi-poe-fan.txt | 55 +++ - Documentation/hwmon/rpi-poe-fan | 15 + - drivers/hwmon/Kconfig | 11 + - drivers/hwmon/Makefile | 1 + - drivers/hwmon/rpi-poe-fan.c | 436 ++++++++++++++++++ - 5 files changed, 518 insertions(+) - create mode 100644 Documentation/devicetree/bindings/hwmon/rpi-poe-fan.txt - create mode 100644 Documentation/hwmon/rpi-poe-fan - create mode 100644 drivers/hwmon/rpi-poe-fan.c - ---- /dev/null -+++ b/Documentation/devicetree/bindings/hwmon/rpi-poe-fan.txt -@@ -0,0 +1,55 @@ -+Bindings for the Raspberry Pi PoE HAT fan -+ -+Required properties: -+- compatible : "raspberrypi,rpi-poe-fan" -+- firmware : Reference to the RPi firmware device node -+- pwms : the PWM that is used to control the PWM fan -+- cooling-levels : PWM duty cycle values in a range from 0 to 255 -+ which correspond to thermal cooling states -+ -+Example: -+ fan0: rpi-poe-fan@0 { -+ compatible = "raspberrypi,rpi-poe-fan"; -+ firmware = <&firmware>; -+ cooling-min-state = <0>; -+ cooling-max-state = <3>; -+ #cooling-cells = <2>; -+ cooling-levels = <0 50 150 255>; -+ status = "okay"; -+ }; -+ -+ thermal-zones { -+ cpu_thermal: cpu-thermal { -+ trips { -+ threshold: trip-point@0 { -+ temperature = <45000>; -+ hysteresis = <5000>; -+ type = "active"; -+ }; -+ target: trip-point@1 { -+ temperature = <50000>; -+ hysteresis = <2000>; -+ type = "active"; -+ }; -+ cpu_hot: cpu_hot@0 { -+ temperature = <55000>; -+ hysteresis = <2000>; -+ type = "active"; -+ }; -+ }; -+ cooling-maps { -+ map0 { -+ trip = <&threshold>; -+ cooling-device = <&fan0 0 1>; -+ }; -+ map1 { -+ trip = <&target>; -+ cooling-device = <&fan0 1 2>; -+ }; -+ map2 { -+ trip = <&cpu_hot>; -+ cooling-device = <&fan0 2 3>; -+ }; -+ }; -+ }; -+ }; ---- /dev/null -+++ b/Documentation/hwmon/rpi-poe-fan -@@ -0,0 +1,15 @@ -+Kernel driver rpi-poe-fan -+===================== -+ -+This driver enables the use of the Raspberry Pi PoE HAT fan. -+ -+Author: Serge Schneider -+ -+Description -+----------- -+ -+The driver implements a simple interface for driving the Raspberry Pi PoE -+(Power over Ethernet) HAT fan. The driver passes commands to the Raspberry Pi -+firmware through the mailbox property interface. The firmware then forwards -+the commands to the board over I2C on the ID_EEPROM pins. The driver exposes -+the fan to the user space through the hwmon sysfs interface. ---- a/drivers/hwmon/Kconfig -+++ b/drivers/hwmon/Kconfig -@@ -1489,6 +1489,17 @@ config SENSORS_RASPBERRYPI_HWMON - This driver can also be built as a module. If so, the module - will be called raspberrypi-hwmon. - -+config SENSORS_RPI_POE_FAN -+ tristate "Raspberry Pi PoE HAT fan" -+ depends on RASPBERRYPI_FIRMWARE -+ depends on THERMAL || THERMAL=n -+ help -+ If you say yes here you get support for Raspberry Pi PoE (Power over -+ Ethernet) HAT fan. -+ -+ This driver can also be built as a module. If so, the module -+ will be called rpi-poe-fan. -+ - config SENSORS_SL28CPLD - tristate "Kontron sl28cpld hardware monitoring driver" - depends on MFD_SL28CPLD || COMPILE_TEST ---- a/drivers/hwmon/Makefile -+++ b/drivers/hwmon/Makefile -@@ -157,6 +157,7 @@ obj-$(CONFIG_SENSORS_PCF8591) += pcf8591 - obj-$(CONFIG_SENSORS_POWR1220) += powr1220.o - obj-$(CONFIG_SENSORS_PWM_FAN) += pwm-fan.o - obj-$(CONFIG_SENSORS_RASPBERRYPI_HWMON) += raspberrypi-hwmon.o -+obj-$(CONFIG_SENSORS_RPI_POE_FAN) += rpi-poe-fan.o - obj-$(CONFIG_SENSORS_S3C) += s3c-hwmon.o - obj-$(CONFIG_SENSORS_SCH56XX_COMMON)+= sch56xx-common.o - obj-$(CONFIG_SENSORS_SCH5627) += sch5627.o ---- /dev/null -+++ b/drivers/hwmon/rpi-poe-fan.c -@@ -0,0 +1,436 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * rpi-poe-fan.c - Hwmon driver for Raspberry Pi PoE HAT fan. -+ * -+ * Copyright (C) 2018 Raspberry Pi (Trading) Ltd. -+ * Based on pwm-fan.c by Kamil Debski -+ * -+ * Author: Serge Schneider -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define MAX_PWM 255 -+ -+#define POE_CUR_PWM 0x0 -+#define POE_DEF_PWM 0x1 -+ -+struct rpi_poe_fan_ctx { -+ struct mutex lock; -+ struct rpi_firmware *fw; -+ unsigned int pwm_value; -+ unsigned int def_pwm_value; -+ unsigned int rpi_poe_fan_state; -+ unsigned int rpi_poe_fan_max_state; -+ unsigned int *rpi_poe_fan_cooling_levels; -+ struct thermal_cooling_device *cdev; -+ struct notifier_block nb; -+}; -+ -+struct fw_tag_data_s{ -+ u32 reg; -+ u32 val; -+ u32 ret; -+}; -+ -+static int write_reg(struct rpi_firmware *fw, u32 reg, u32 *val){ -+ struct fw_tag_data_s fw_tag_data = { -+ .reg = reg, -+ .val = *val -+ }; -+ int ret; -+ ret = rpi_firmware_property(fw, RPI_FIRMWARE_SET_POE_HAT_VAL, -+ &fw_tag_data, sizeof(fw_tag_data)); -+ if (ret) { -+ return ret; -+ } else if (fw_tag_data.ret) { -+ return -EIO; -+ } -+ return 0; -+} -+ -+static int read_reg(struct rpi_firmware *fw, u32 reg, u32 *val){ -+ struct fw_tag_data_s fw_tag_data = { -+ .reg = reg, -+ }; -+ int ret; -+ ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_POE_HAT_VAL, -+ &fw_tag_data, sizeof(fw_tag_data)); -+ if (ret) { -+ return ret; -+ } else if (fw_tag_data.ret) { -+ return -EIO; -+ } -+ *val = fw_tag_data.val; -+ return 0; -+} -+ -+static int rpi_poe_reboot(struct notifier_block *nb, unsigned long code, -+ void *unused) -+{ -+ struct rpi_poe_fan_ctx *ctx = container_of(nb, struct rpi_poe_fan_ctx, -+ nb); -+ -+ if (ctx->pwm_value != ctx->def_pwm_value) -+ write_reg(ctx->fw, POE_CUR_PWM, &ctx->def_pwm_value); -+ -+ return NOTIFY_DONE; -+} -+ -+static int __set_pwm(struct rpi_poe_fan_ctx *ctx, u32 pwm) -+{ -+ int ret = 0; -+ -+ mutex_lock(&ctx->lock); -+ if (ctx->pwm_value == pwm) -+ goto exit_set_pwm_err; -+ -+ ret = write_reg(ctx->fw, POE_CUR_PWM, &pwm); -+ if (!ret) -+ ctx->pwm_value = pwm; -+exit_set_pwm_err: -+ mutex_unlock(&ctx->lock); -+ return ret; -+} -+ -+static int __set_def_pwm(struct rpi_poe_fan_ctx *ctx, u32 def_pwm) -+{ -+ int ret = 0; -+ mutex_lock(&ctx->lock); -+ if (ctx->def_pwm_value == def_pwm) -+ goto exit_set_def_pwm_err; -+ -+ ret = write_reg(ctx->fw, POE_DEF_PWM, &def_pwm); -+ if (!ret) -+ ctx->def_pwm_value = def_pwm; -+exit_set_def_pwm_err: -+ mutex_unlock(&ctx->lock); -+ return ret; -+} -+ -+static void rpi_poe_fan_update_state(struct rpi_poe_fan_ctx *ctx, -+ unsigned long pwm) -+{ -+ int i; -+ -+ for (i = 0; i < ctx->rpi_poe_fan_max_state; ++i) -+ if (pwm < ctx->rpi_poe_fan_cooling_levels[i + 1]) -+ break; -+ -+ ctx->rpi_poe_fan_state = i; -+} -+ -+static ssize_t set_pwm(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ struct rpi_poe_fan_ctx *ctx = dev_get_drvdata(dev); -+ unsigned long pwm; -+ int ret; -+ -+ if (kstrtoul(buf, 10, &pwm) || pwm > MAX_PWM) -+ return -EINVAL; -+ -+ ret = __set_pwm(ctx, pwm); -+ if (ret) -+ return ret; -+ -+ rpi_poe_fan_update_state(ctx, pwm); -+ return count; -+} -+ -+static ssize_t set_def_pwm(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ struct rpi_poe_fan_ctx *ctx = dev_get_drvdata(dev); -+ unsigned long def_pwm; -+ int ret; -+ -+ if (kstrtoul(buf, 10, &def_pwm) || def_pwm > MAX_PWM) -+ return -EINVAL; -+ -+ ret = __set_def_pwm(ctx, def_pwm); -+ if (ret) -+ return ret; -+ return count; -+} -+ -+static ssize_t show_pwm(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct rpi_poe_fan_ctx *ctx = dev_get_drvdata(dev); -+ -+ return sprintf(buf, "%u\n", ctx->pwm_value); -+} -+ -+static ssize_t show_def_pwm(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ struct rpi_poe_fan_ctx *ctx = dev_get_drvdata(dev); -+ -+ return sprintf(buf, "%u\n", ctx->def_pwm_value); -+} -+ -+ -+static SENSOR_DEVICE_ATTR(pwm1, 0644, show_pwm, set_pwm, 0); -+static SENSOR_DEVICE_ATTR(def_pwm1, 0644, show_def_pwm, set_def_pwm, 1); -+ -+static struct attribute *rpi_poe_fan_attrs[] = { -+ &sensor_dev_attr_pwm1.dev_attr.attr, -+ &sensor_dev_attr_def_pwm1.dev_attr.attr, -+ NULL, -+}; -+ -+ATTRIBUTE_GROUPS(rpi_poe_fan); -+ -+/* thermal cooling device callbacks */ -+static int rpi_poe_fan_get_max_state(struct thermal_cooling_device *cdev, -+ unsigned long *state) -+{ -+ struct rpi_poe_fan_ctx *ctx = cdev->devdata; -+ -+ if (!ctx) -+ return -EINVAL; -+ -+ *state = ctx->rpi_poe_fan_max_state; -+ -+ return 0; -+} -+ -+static int rpi_poe_fan_get_cur_state(struct thermal_cooling_device *cdev, -+ unsigned long *state) -+{ -+ struct rpi_poe_fan_ctx *ctx = cdev->devdata; -+ -+ if (!ctx) -+ return -EINVAL; -+ -+ *state = ctx->rpi_poe_fan_state; -+ -+ return 0; -+} -+ -+static int rpi_poe_fan_set_cur_state(struct thermal_cooling_device *cdev, -+ unsigned long state) -+{ -+ struct rpi_poe_fan_ctx *ctx = cdev->devdata; -+ int ret; -+ -+ if (!ctx || (state > ctx->rpi_poe_fan_max_state)) -+ return -EINVAL; -+ -+ if (state == ctx->rpi_poe_fan_state) -+ return 0; -+ -+ ret = __set_pwm(ctx, ctx->rpi_poe_fan_cooling_levels[state]); -+ if (ret) { -+ dev_err(&cdev->device, "Cannot set pwm!\n"); -+ return ret; -+ } -+ -+ ctx->rpi_poe_fan_state = state; -+ -+ return ret; -+} -+ -+static const struct thermal_cooling_device_ops rpi_poe_fan_cooling_ops = { -+ .get_max_state = rpi_poe_fan_get_max_state, -+ .get_cur_state = rpi_poe_fan_get_cur_state, -+ .set_cur_state = rpi_poe_fan_set_cur_state, -+}; -+ -+static int rpi_poe_fan_of_get_cooling_data(struct device *dev, -+ struct rpi_poe_fan_ctx *ctx) -+{ -+ struct device_node *np = dev->of_node; -+ int num, i, ret; -+ -+ if (!of_find_property(np, "cooling-levels", NULL)) -+ return 0; -+ -+ ret = of_property_count_u32_elems(np, "cooling-levels"); -+ if (ret <= 0) { -+ dev_err(dev, "cooling-levels property missing or invalid: %d\n", -+ ret); -+ return ret ? : -EINVAL; -+ } -+ -+ num = ret; -+ ctx->rpi_poe_fan_cooling_levels = devm_kzalloc(dev, num * sizeof(u32), -+ GFP_KERNEL); -+ if (!ctx->rpi_poe_fan_cooling_levels) -+ return -ENOMEM; -+ -+ ret = of_property_read_u32_array(np, "cooling-levels", -+ ctx->rpi_poe_fan_cooling_levels, num); -+ if (ret) { -+ dev_err(dev, "Property 'cooling-levels' cannot be read!\n"); -+ return ret; -+ } -+ -+ for (i = 0; i < num; i++) { -+ if (ctx->rpi_poe_fan_cooling_levels[i] > MAX_PWM) { -+ dev_err(dev, "PWM fan state[%d]:%d > %d\n", i, -+ ctx->rpi_poe_fan_cooling_levels[i], MAX_PWM); -+ return -EINVAL; -+ } -+ } -+ -+ ctx->rpi_poe_fan_max_state = num - 1; -+ -+ return 0; -+} -+ -+static int rpi_poe_fan_probe(struct platform_device *pdev) -+{ -+ struct thermal_cooling_device *cdev; -+ struct rpi_poe_fan_ctx *ctx; -+ struct device *hwmon; -+ struct device_node *np = pdev->dev.of_node; -+ struct device_node *fw_node; -+ int ret; -+ -+ fw_node = of_parse_phandle(np, "firmware", 0); -+ if (!fw_node) { -+ dev_err(&pdev->dev, "Missing firmware node\n"); -+ return -ENOENT; -+ } -+ -+ ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); -+ if (!ctx) -+ return -ENOMEM; -+ -+ mutex_init(&ctx->lock); -+ -+ ctx->fw = rpi_firmware_get(fw_node); -+ if (!ctx->fw) -+ return -EPROBE_DEFER; -+ -+ platform_set_drvdata(pdev, ctx); -+ -+ ctx->nb.notifier_call = rpi_poe_reboot; -+ ret = register_reboot_notifier(&ctx->nb); -+ if (ret) { -+ dev_err(&pdev->dev, "Failed to register reboot notifier: %i\n", -+ ret); -+ return ret; -+ } -+ ret = read_reg(ctx->fw, POE_DEF_PWM, &ctx->def_pwm_value); -+ if (ret) { -+ dev_err(&pdev->dev, "Failed to get default PWM value: %i\n", -+ ret); -+ goto err; -+ } -+ ret = read_reg(ctx->fw, POE_CUR_PWM, &ctx->pwm_value); -+ if (ret) { -+ dev_err(&pdev->dev, "Failed to get current PWM value: %i\n", -+ ret); -+ goto err; -+ } -+ -+ hwmon = devm_hwmon_device_register_with_groups(&pdev->dev, "rpipoefan", -+ ctx, rpi_poe_fan_groups); -+ if (IS_ERR(hwmon)) { -+ dev_err(&pdev->dev, "Failed to register hwmon device\n"); -+ ret = PTR_ERR(hwmon); -+ goto err; -+ } -+ -+ ret = rpi_poe_fan_of_get_cooling_data(&pdev->dev, ctx); -+ if (ret) -+ return ret; -+ -+ rpi_poe_fan_update_state(ctx, ctx->pwm_value); -+ if (!IS_ENABLED(CONFIG_THERMAL)) -+ return 0; -+ -+ cdev = thermal_of_cooling_device_register(np, -+ "rpi-poe-fan", ctx, -+ &rpi_poe_fan_cooling_ops); -+ if (IS_ERR(cdev)) { -+ dev_err(&pdev->dev, -+ "Failed to register rpi-poe-fan as cooling device"); -+ ret = PTR_ERR(cdev); -+ goto err; -+ } -+ ctx->cdev = cdev; -+ thermal_cdev_update(cdev); -+ -+ return 0; -+err: -+ unregister_reboot_notifier(&ctx->nb); -+ return ret; -+} -+ -+static int rpi_poe_fan_remove(struct platform_device *pdev) -+{ -+ struct rpi_poe_fan_ctx *ctx = platform_get_drvdata(pdev); -+ u32 value = ctx->def_pwm_value; -+ -+ unregister_reboot_notifier(&ctx->nb); -+ thermal_cooling_device_unregister(ctx->cdev); -+ if (ctx->pwm_value != value) { -+ write_reg(ctx->fw, POE_CUR_PWM, &value); -+ } -+ return 0; -+} -+ -+#ifdef CONFIG_PM_SLEEP -+static int rpi_poe_fan_suspend(struct device *dev) -+{ -+ struct rpi_poe_fan_ctx *ctx = dev_get_drvdata(dev); -+ u32 value = 0; -+ int ret = 0; -+ -+ if (ctx->pwm_value != value) -+ ret = write_reg(ctx->fw, POE_CUR_PWM, &value); -+ return ret; -+} -+ -+static int rpi_poe_fan_resume(struct device *dev) -+{ -+ struct rpi_poe_fan_ctx *ctx = dev_get_drvdata(dev); -+ u32 value = ctx->pwm_value; -+ int ret = 0; -+ -+ if (value != 0) -+ ret = write_reg(ctx->fw, POE_CUR_PWM, &value); -+ -+ return ret; -+} -+#endif -+ -+static SIMPLE_DEV_PM_OPS(rpi_poe_fan_pm, rpi_poe_fan_suspend, -+ rpi_poe_fan_resume); -+ -+static const struct of_device_id of_rpi_poe_fan_match[] = { -+ { .compatible = "raspberrypi,rpi-poe-fan", }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(of, of_rpi_poe_fan_match); -+ -+static struct platform_driver rpi_poe_fan_driver = { -+ .probe = rpi_poe_fan_probe, -+ .remove = rpi_poe_fan_remove, -+ .driver = { -+ .name = "rpi-poe-fan", -+ .pm = &rpi_poe_fan_pm, -+ .of_match_table = of_rpi_poe_fan_match, -+ }, -+}; -+ -+module_platform_driver(rpi_poe_fan_driver); -+ -+MODULE_AUTHOR("Serge Schneider "); -+MODULE_ALIAS("platform:rpi-poe-fan"); -+MODULE_DESCRIPTION("Raspberry Pi PoE HAT fan driver"); -+MODULE_LICENSE("GPL"); diff --git a/target/linux/bcm27xx/patches-5.10/950-0086-hwmon-raspberrypi-Prevent-voltage-low-warnings-from-.patch b/target/linux/bcm27xx/patches-5.10/950-0086-hwmon-raspberrypi-Prevent-voltage-low-warnings-from-.patch deleted file mode 100644 index c6fe514618..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0086-hwmon-raspberrypi-Prevent-voltage-low-warnings-from-.patch +++ /dev/null @@ -1,75 +0,0 @@ -From f6e40957774cd71b4a8ce2190d94ef8e9b289938 Mon Sep 17 00:00:00 2001 -From: Stefan Wahren -Date: Sat, 6 Oct 2018 16:46:18 +0200 -Subject: [PATCH] hwmon: raspberrypi: Prevent voltage low warnings from - filling log - -Although the correct fix for low voltage warnings is to -improve the power supply, the current implementation -of the detection can fill the log if the warning -happens freqently. This replaces the logging with -slightly custom ratelimited logging. - -Signed-off-by: James Hughes -Signed-off-by: Stefan Wahren ---- - drivers/hwmon/raspberrypi-hwmon.c | 41 ++++++++++++++++++++++++++++--- - 1 file changed, 37 insertions(+), 4 deletions(-) - ---- a/drivers/hwmon/raspberrypi-hwmon.c -+++ b/drivers/hwmon/raspberrypi-hwmon.c -@@ -15,6 +15,36 @@ - #include - #include - -+/* -+ * This section defines some rate limited logging that prevent -+ * repeated messages at much lower Hz than the default kernel settings. -+ * It's usually 5s, this is 5 minutes. -+ * Burst 3 means you may get three messages 'quickly', before -+ * the ratelimiting kicks in. -+ */ -+#define LOCAL_RATELIMIT_INTERVAL (5 * 60 * HZ) -+#define LOCAL_RATELIMIT_BURST 3 -+ -+#ifdef CONFIG_PRINTK -+#define printk_ratelimited_local(fmt, ...) \ -+({ \ -+ static DEFINE_RATELIMIT_STATE(_rs, \ -+ LOCAL_RATELIMIT_INTERVAL, \ -+ LOCAL_RATELIMIT_BURST); \ -+ \ -+ if (__ratelimit(&_rs)) \ -+ printk(fmt, ##__VA_ARGS__); \ -+}) -+#else -+#define printk_ratelimited_local(fmt, ...) \ -+ no_printk(fmt, ##__VA_ARGS__) -+#endif -+ -+#define pr_crit_ratelimited_local(fmt, ...) \ -+ printk_ratelimited_local(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) -+#define pr_info_ratelimited_local(fmt, ...) \ -+printk_ratelimited_local(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) -+ - #define UNDERVOLTAGE_STICKY_BIT BIT(16) - - struct rpi_hwmon_data { -@@ -47,10 +77,13 @@ static void rpi_firmware_get_throttled(s - if (new_uv == old_uv) - return; - -- if (new_uv) -- dev_crit(data->hwmon_dev, "Undervoltage detected!\n"); -- else -- dev_info(data->hwmon_dev, "Voltage normalised\n"); -+ if (new_uv) { -+ pr_crit_ratelimited_local("Under-voltage detected! (0x%08x)\n", -+ value); -+ } else { -+ pr_info_ratelimited_local("Voltage normalised (0x%08x)\n", -+ value); -+ } - - sysfs_notify(&data->hwmon_dev->kobj, NULL, "in0_lcrit_alarm"); - } diff --git a/target/linux/bcm27xx/patches-5.10/950-0099-media-ov5647-Add-set_fmt-and-get_fmt-calls.patch b/target/linux/bcm27xx/patches-5.10/950-0099-media-ov5647-Add-set_fmt-and-get_fmt-calls.patch deleted file mode 100644 index df4b83ad0a..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0099-media-ov5647-Add-set_fmt-and-get_fmt-calls.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 3774310df4996e7ce45854ddb47a6cf969295f9d Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 31 Oct 2018 14:55:37 +0000 -Subject: [PATCH] media: ov5647: Add set_fmt and get_fmt calls. - -There's no way to query the subdevice for the supported -resolutions. -Add set_fmt and get_fmt implementations. - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/ov5647.c | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -463,8 +463,30 @@ static int ov5647_enum_mbus_code(struct - return 0; - } - -+static int ov5647_set_get_fmt(struct v4l2_subdev *sd, -+ struct v4l2_subdev_pad_config *cfg, -+ struct v4l2_subdev_format *format) -+{ -+ struct v4l2_mbus_framefmt *fmt = &format->format; -+ -+ if (format->pad != 0) -+ return -EINVAL; -+ -+ /* Only one format is supported, so return that */ -+ memset(fmt, 0, sizeof(*fmt)); -+ fmt->code = MEDIA_BUS_FMT_SBGGR8_1X8; -+ fmt->colorspace = V4L2_COLORSPACE_SRGB; -+ fmt->field = V4L2_FIELD_NONE; -+ fmt->width = 640; -+ fmt->height = 480; -+ -+ return 0; -+} -+ - static const struct v4l2_subdev_pad_ops ov5647_subdev_pad_ops = { - .enum_mbus_code = ov5647_enum_mbus_code, -+ .set_fmt = ov5647_set_get_fmt, -+ .get_fmt = ov5647_set_get_fmt, - }; - - static const struct v4l2_subdev_ops ov5647_subdev_ops = { diff --git a/target/linux/bcm27xx/patches-5.10/950-0100-media-ov5647-Add-support-for-PWDN-GPIO.patch b/target/linux/bcm27xx/patches-5.10/950-0100-media-ov5647-Add-support-for-PWDN-GPIO.patch deleted file mode 100644 index 13bcb78aac..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0100-media-ov5647-Add-support-for-PWDN-GPIO.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 4b8d9d9c7f6d8f863669ce97ac299ca542ad6ecc Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 31 Oct 2018 14:56:33 +0000 -Subject: [PATCH] media: ov5647: Add support for PWDN GPIO. - -Add support for an optional GPIO connected to PWDN on the sensor. - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/ov5647.c | 28 ++++++++++++++++++++++++++++ - 1 file changed, 28 insertions(+) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -21,6 +21,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -35,6 +36,13 @@ - - #define SENSOR_NAME "ov5647" - -+/* -+ * From the datasheet, "20ms after PWDN goes low or 20ms after RESETB goes -+ * high if reset is inserted after PWDN goes high, host can access sensor's -+ * SCCB to initialize sensor." -+ */ -+#define PWDN_ACTIVE_DELAY_MS 20 -+ - #define MIPI_CTRL00_CLOCK_LANE_GATE BIT(5) - #define MIPI_CTRL00_BUS_IDLE BIT(2) - #define MIPI_CTRL00_CLOCK_LANE_DISABLE BIT(0) -@@ -86,6 +94,7 @@ struct ov5647 { - unsigned int height; - int power_count; - struct clk *xclk; -+ struct gpio_desc *pwdn; - }; - - static inline struct ov5647 *to_state(struct v4l2_subdev *sd) -@@ -355,6 +364,11 @@ static int ov5647_sensor_power(struct v4 - if (on && !ov5647->power_count) { - dev_dbg(&client->dev, "OV5647 power on\n"); - -+ if (ov5647->pwdn) { -+ gpiod_set_value(ov5647->pwdn, 0); -+ msleep(PWDN_ACTIVE_DELAY_MS); -+ } -+ - ret = clk_prepare_enable(ov5647->xclk); - if (ret < 0) { - dev_err(&client->dev, "clk prepare enable failed\n"); -@@ -392,6 +406,8 @@ static int ov5647_sensor_power(struct v4 - dev_dbg(&client->dev, "soft stby failed\n"); - - clk_disable_unprepare(ov5647->xclk); -+ -+ gpiod_set_value(ov5647->pwdn, 1); - } - - /* Update the power count. */ -@@ -603,6 +619,10 @@ static int ov5647_probe(struct i2c_clien - return -EINVAL; - } - -+ /* Request the power down GPIO asserted */ -+ sensor->pwdn = devm_gpiod_get_optional(&client->dev, "pwdn", -+ GPIOD_OUT_HIGH); -+ - mutex_init(&sensor->lock); - - sd = &sensor->sd; -@@ -616,7 +636,15 @@ static int ov5647_probe(struct i2c_clien - if (ret < 0) - goto mutex_remove; - -+ if (sensor->pwdn) { -+ gpiod_set_value(sensor->pwdn, 0); -+ msleep(PWDN_ACTIVE_DELAY_MS); -+ } -+ - ret = ov5647_detect(sd); -+ -+ gpiod_set_value(sensor->pwdn, 1); -+ - if (ret < 0) - goto error; - diff --git a/target/linux/bcm27xx/patches-5.10/950-0101-media-ov5647-Add-support-for-non-continuous-clock-mo.patch b/target/linux/bcm27xx/patches-5.10/950-0101-media-ov5647-Add-support-for-non-continuous-clock-mo.patch deleted file mode 100644 index 364d3c53ea..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0101-media-ov5647-Add-support-for-non-continuous-clock-mo.patch +++ /dev/null @@ -1,79 +0,0 @@ -From f8ae99474d8555a30615db821c180a7d56b2e73c Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 31 Oct 2018 14:56:47 +0000 -Subject: [PATCH] media: ov5647: Add support for non-continuous clock - mode - -The driver was only supporting continuous clock mode -although this was not stated anywhere. -Non-continuous clock saves a small amount of power and -on some SoCs is easier to interface with. - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/ov5647.c | 17 ++++++++++++++--- - 1 file changed, 14 insertions(+), 3 deletions(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -44,6 +44,7 @@ - #define PWDN_ACTIVE_DELAY_MS 20 - - #define MIPI_CTRL00_CLOCK_LANE_GATE BIT(5) -+#define MIPI_CTRL00_LINE_SYNC_ENABLE BIT(4) - #define MIPI_CTRL00_BUS_IDLE BIT(2) - #define MIPI_CTRL00_CLOCK_LANE_DISABLE BIT(0) - -@@ -95,6 +96,7 @@ struct ov5647 { - int power_count; - struct clk *xclk; - struct gpio_desc *pwdn; -+ unsigned int flags; - }; - - static inline struct ov5647 *to_state(struct v4l2_subdev *sd) -@@ -269,9 +271,15 @@ static int ov5647_set_virtual_channel(st - - static int ov5647_stream_on(struct v4l2_subdev *sd) - { -+ struct ov5647 *ov5647 = to_state(sd); -+ u8 val = MIPI_CTRL00_BUS_IDLE; - int ret; - -- ret = ov5647_write(sd, OV5647_REG_MIPI_CTRL00, MIPI_CTRL00_BUS_IDLE); -+ if (ov5647->flags & V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK) -+ val |= MIPI_CTRL00_CLOCK_LANE_GATE | -+ MIPI_CTRL00_LINE_SYNC_ENABLE; -+ -+ ret = ov5647_write(sd, OV5647_REG_MIPI_CTRL00, val); - if (ret < 0) - return ret; - -@@ -568,7 +576,7 @@ static const struct v4l2_subdev_internal - .open = ov5647_open, - }; - --static int ov5647_parse_dt(struct device_node *np) -+static int ov5647_parse_dt(struct device_node *np, struct ov5647 *sensor) - { - struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 }; - struct device_node *ep; -@@ -581,6 +589,9 @@ static int ov5647_parse_dt(struct device - - ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &bus_cfg); - -+ if (!ret) -+ sensor->flags = bus_cfg.bus.mipi_csi2.flags; -+ - of_node_put(ep); - return ret; - } -@@ -599,7 +610,7 @@ static int ov5647_probe(struct i2c_clien - return -ENOMEM; - - if (IS_ENABLED(CONFIG_OF) && np) { -- ret = ov5647_parse_dt(np); -+ ret = ov5647_parse_dt(np, sensor); - if (ret) { - dev_err(dev, "DT parsing error: %d\n", ret); - return ret; diff --git a/target/linux/bcm27xx/patches-5.10/950-0118-media-ov5647-Use-gpiod_set_value_cansleep.patch b/target/linux/bcm27xx/patches-5.10/950-0118-media-ov5647-Use-gpiod_set_value_cansleep.patch deleted file mode 100644 index 1c0a24f805..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0118-media-ov5647-Use-gpiod_set_value_cansleep.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 58f1758adcdbfd1cf556eb3cbb85b88ddcef0840 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Tue, 18 Sep 2018 11:08:51 +0100 -Subject: [PATCH] media: ov5647: Use gpiod_set_value_cansleep - -All calls to the gpio library are in contexts that can sleep, -therefore there is no issue with having those GPIOs controlled -by controllers which require sleeping (eg I2C GPIO expanders). - -Switch to using gpiod_set_value_cansleep instead of gpiod_set_value -to avoid triggering the warning in gpiolib should the GPIO -controller need to sleep. - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/ov5647.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -373,7 +373,7 @@ static int ov5647_sensor_power(struct v4 - dev_dbg(&client->dev, "OV5647 power on\n"); - - if (ov5647->pwdn) { -- gpiod_set_value(ov5647->pwdn, 0); -+ gpiod_set_value_cansleep(ov5647->pwdn, 0); - msleep(PWDN_ACTIVE_DELAY_MS); - } - -@@ -415,7 +415,7 @@ static int ov5647_sensor_power(struct v4 - - clk_disable_unprepare(ov5647->xclk); - -- gpiod_set_value(ov5647->pwdn, 1); -+ gpiod_set_value_cansleep(ov5647->pwdn, 1); - } - - /* Update the power count. */ -@@ -648,13 +648,13 @@ static int ov5647_probe(struct i2c_clien - goto mutex_remove; - - if (sensor->pwdn) { -- gpiod_set_value(sensor->pwdn, 0); -+ gpiod_set_value_cansleep(sensor->pwdn, 0); - msleep(PWDN_ACTIVE_DELAY_MS); - } - - ret = ov5647_detect(sd); - -- gpiod_set_value(sensor->pwdn, 1); -+ gpiod_set_value_cansleep(sensor->pwdn, 1); - - if (ret < 0) - goto error; diff --git a/target/linux/bcm27xx/patches-5.10/950-0127-mmc-sdhci-iproc-Fix-vmmc-regulators-on-iProc.patch b/target/linux/bcm27xx/patches-5.10/950-0127-mmc-sdhci-iproc-Fix-vmmc-regulators-on-iProc.patch deleted file mode 100644 index b6d71b3611..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0127-mmc-sdhci-iproc-Fix-vmmc-regulators-on-iProc.patch +++ /dev/null @@ -1,46 +0,0 @@ -From efc6e571660a0d0ca53fb603cc4f132481e8977f Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 2 Aug 2019 15:20:11 +0100 -Subject: [PATCH] mmc: sdhci-iproc: Fix vmmc regulators on iProc - -The Linux support for controlling card power via regulators appears to -be contentious. I would argue that the default behaviour is contrary to -the SDHCI spec - turning off the power writes a reserved value to the -SD Bus Voltage Select field of the Power Control Register, which -seems to kill the Arasan/iProc controller - but fortunately there is a -hook in sdhci_ops to override the behaviour. Borrow the implementation -from sdhci_arasan_set_power. - -Signed-off-by: Phil Elwell ---- - drivers/mmc/host/sdhci-iproc.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/drivers/mmc/host/sdhci-iproc.c -+++ b/drivers/mmc/host/sdhci-iproc.c -@@ -190,6 +190,17 @@ static unsigned int sdhci_iproc_bcm2711_ - return 200000; - } - -+static void sdhci_iproc_set_power(struct sdhci_host *host, unsigned char mode, -+ unsigned short vdd) -+{ -+ if (!IS_ERR(host->mmc->supply.vmmc)) { -+ struct mmc_host *mmc = host->mmc; -+ -+ mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); -+ } -+ sdhci_set_power_noreg(host, mode, vdd); -+} -+ - static const struct sdhci_ops sdhci_iproc_ops = { - .set_clock = sdhci_set_clock, - .get_max_clock = sdhci_iproc_get_max_clock, -@@ -207,6 +218,7 @@ static const struct sdhci_ops sdhci_ipro - .write_b = sdhci_iproc_writeb, - .set_clock = sdhci_set_clock, - .get_max_clock = sdhci_iproc_get_max_clock, -+ .set_power = sdhci_iproc_set_power, - .set_bus_width = sdhci_set_bus_width, - .reset = sdhci_reset, - .set_uhs_signaling = sdhci_set_uhs_signaling, diff --git a/target/linux/bcm27xx/patches-5.10/950-0144-drm-v3d-Hook-up-the-runtime-PM-ops.patch b/target/linux/bcm27xx/patches-5.10/950-0144-drm-v3d-Hook-up-the-runtime-PM-ops.patch deleted file mode 100644 index 9fcffec0b0..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0144-drm-v3d-Hook-up-the-runtime-PM-ops.patch +++ /dev/null @@ -1,34 +0,0 @@ -From e7398ddc64a8540bb016d653ff0bddfc0660f606 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Mon, 14 Jan 2019 14:47:57 -0800 -Subject: [PATCH] drm/v3d: Hook up the runtime PM ops. - -In translating the runtime PM code from vc4, I missed the ".pm" -assignment to actually connect them up. Fixes missing MMU setup if -runtime PM resets V3D. - -Signed-off-by: Eric Anholt -(cherry picked from commit ca197699af29baa8236c74c53d4904ca8957ee06) ---- - drivers/gpu/drm/v3d/v3d_drv.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/v3d/v3d_drv.c -+++ b/drivers/gpu/drm/v3d/v3d_drv.c -@@ -70,7 +70,7 @@ static int v3d_runtime_resume(struct dev - } - #endif - --static const struct dev_pm_ops v3d_v3d_pm_ops = { -+static const struct dev_pm_ops v3d_pm_ops = { - SET_RUNTIME_PM_OPS(v3d_runtime_suspend, v3d_runtime_resume, NULL) - }; - -@@ -356,6 +356,7 @@ static struct platform_driver v3d_platfo - .driver = { - .name = "v3d", - .of_match_table = v3d_of_match, -+ .pm = &v3d_pm_ops, - }, - }; - diff --git a/target/linux/bcm27xx/patches-5.10/950-0159-v4l2-Add-a-Greyworld-AWB-mode.patch b/target/linux/bcm27xx/patches-5.10/950-0159-v4l2-Add-a-Greyworld-AWB-mode.patch deleted file mode 100644 index 5755cde42c..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0159-v4l2-Add-a-Greyworld-AWB-mode.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 1c6c1ab42e61cdca555c85bdde5677b13b5cd5f3 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Fri, 6 Sep 2019 15:04:51 +0100 -Subject: [PATCH] v4l2: Add a Greyworld AWB mode. - -Adds a simple greyworld white balance preset, mainly for use -with cameras without an IR filter (eg Raspberry Pi NoIR) - -Signed-off-by: Dave Stevenson ---- - drivers/media/v4l2-core/v4l2-ctrls.c | 1 + - include/uapi/linux/v4l2-controls.h | 1 + - 2 files changed, 2 insertions(+) - ---- a/drivers/media/v4l2-core/v4l2-ctrls.c -+++ b/drivers/media/v4l2-core/v4l2-ctrls.c -@@ -275,6 +275,7 @@ const char * const *v4l2_ctrl_get_menu(u - "Flash", - "Cloudy", - "Shade", -+ "Greyworld", - NULL, - }; - static const char * const camera_iso_sensitivity_auto[] = { ---- a/include/uapi/linux/v4l2-controls.h -+++ b/include/uapi/linux/v4l2-controls.h -@@ -886,6 +886,7 @@ enum v4l2_auto_n_preset_white_balance { - V4L2_WHITE_BALANCE_FLASH = 7, - V4L2_WHITE_BALANCE_CLOUDY = 8, - V4L2_WHITE_BALANCE_SHADE = 9, -+ V4L2_WHITE_BALANCE_GREYWORLD = 10, - }; - - #define V4L2_CID_WIDE_DYNAMIC_RANGE (V4L2_CID_CAMERA_CLASS_BASE+21) diff --git a/target/linux/bcm27xx/patches-5.10/950-0162-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch b/target/linux/bcm27xx/patches-5.10/950-0162-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch deleted file mode 100644 index c3be3d58e6..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0162-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 39e3ab3e857a617b982dbeee2037f13edc46f799 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 23 Sep 2019 09:26:41 +0100 -Subject: [PATCH] kbuild: Allow .dtbo overlays to be built piecemeal - -Before 4.20, it was possible to build an arbitrary overlay by copying -it to arm/boot/dts/overlays/mytest-overlay.dts and running: - - make ARCH=arm overlays/mytest.dtbo - -In 4.20 the .dtb build rules were centralised, requiring the dowstream -.dtbo build rules to be changed. They were, enough to support "make ... -dtbs", but not sufficiently to allow this ad-hoc, one-off building of -individual files. - -Add the missing makefile rule to support this way of building. - -See: https://github.com/raspberrypi/linux/issues/3250 - -Signed-off-by: Phil Elwell ---- - Makefile | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/Makefile -+++ b/Makefile -@@ -1354,6 +1354,9 @@ ifneq ($(dtstree),) - %.dtb: include/config/kernel.release scripts_dtc - $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ - -+%.dtbo: prepare3 scripts_dtc -+ $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ -+ - PHONY += dtbs dtbs_install dtbs_check - dtbs: include/config/kernel.release scripts_dtc - $(Q)$(MAKE) $(build)=$(dtstree) diff --git a/target/linux/bcm27xx/patches-5.10/950-0167-drm-v3d-Don-t-clear-MMU-control-bits-on-exception.patch b/target/linux/bcm27xx/patches-5.10/950-0167-drm-v3d-Don-t-clear-MMU-control-bits-on-exception.patch deleted file mode 100644 index 19bb22080f..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0167-drm-v3d-Don-t-clear-MMU-control-bits-on-exception.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 7372f1f8c151f752aa533eaf2b85ad9b21ec9639 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 11 Nov 2019 14:01:41 +0000 -Subject: [PATCH] drm/v3d: Don't clear MMU control bits on exception - -MMU exception conditions are reported in the V3D_MMU_CTRL register as -write-1-to-clear (W1C) bits. The MMU interrupt handling code clears any -exceptions, but does so by masking out any other bits and writing the -result back. There are some important control bits in that register, -including MMU_ENABLE, so a safer approach is to simply write back the -value just read unaltered. - -This patch doesn't remove the cause of the apparent PTE errors, but it -does reduce the impact to just an error in the kernel log. - -Signed-off-by: Phil Elwell ---- - drivers/gpu/drm/v3d/v3d_irq.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - ---- a/drivers/gpu/drm/v3d/v3d_irq.c -+++ b/drivers/gpu/drm/v3d/v3d_irq.c -@@ -178,10 +178,7 @@ v3d_hub_irq(int irq, void *arg) - }; - const char *client = "?"; - -- V3D_WRITE(V3D_MMU_CTL, -- V3D_READ(V3D_MMU_CTL) & (V3D_MMU_CTL_CAP_EXCEEDED | -- V3D_MMU_CTL_PT_INVALID | -- V3D_MMU_CTL_WRITE_VIOLATION)); -+ V3D_WRITE(V3D_MMU_CTL, V3D_READ(V3D_MMU_CTL)); - - if (v3d->ver >= 41) { - axi_id = axi_id >> 5; diff --git a/target/linux/bcm27xx/patches-5.10/950-0172-net-bcmgenet-The-second-IRQ-is-optional.patch b/target/linux/bcm27xx/patches-5.10/950-0172-net-bcmgenet-The-second-IRQ-is-optional.patch deleted file mode 100644 index 34b3238ed6..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0172-net-bcmgenet-The-second-IRQ-is-optional.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 7f729e862d5d0f6605874393af075a6aa8e98bd5 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 14 Nov 2019 11:59:01 +0000 -Subject: [PATCH] net: bcmgenet: The second IRQ is optional - -As of 5.4, the kernel logs errors for absent IRQs unless requested -with platform_get_irq_optional. - -Signed-off-by: Phil Elwell ---- - drivers/gpu/drm/v3d/v3d_irq.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/gpu/drm/v3d/v3d_irq.c -+++ b/drivers/gpu/drm/v3d/v3d_irq.c -@@ -217,7 +217,7 @@ v3d_irq_init(struct v3d_dev *v3d) - V3D_CORE_WRITE(core, V3D_CTL_INT_CLR, V3D_CORE_IRQS); - V3D_WRITE(V3D_HUB_INT_CLR, V3D_HUB_IRQS); - -- irq1 = platform_get_irq(v3d_to_pdev(v3d), 1); -+ irq1 = platform_get_irq_optional(v3d_to_pdev(v3d), 1); - if (irq1 == -EPROBE_DEFER) - return irq1; - if (irq1 > 0) { diff --git a/target/linux/bcm27xx/patches-5.10/950-0173-net-phy-2711-Allow-ethernet-LED-mode-to-be-set-via-d.patch b/target/linux/bcm27xx/patches-5.10/950-0173-net-phy-2711-Allow-ethernet-LED-mode-to-be-set-via-d.patch deleted file mode 100644 index d755615f52..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0173-net-phy-2711-Allow-ethernet-LED-mode-to-be-set-via-d.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 3ab0c4b6aa76a4dedb51c4e800b5b4ba29187c46 Mon Sep 17 00:00:00 2001 -From: James Hughes -Date: Thu, 31 Oct 2019 14:39:44 +0000 -Subject: [PATCH] net:phy:2711 Allow ethernet LED mode to be set via - device tree - -Add device tree entries and code to allow the specification of -the lighting modes for the LED's on the ethernet connector. - -Signed-off-by: James Hughes ---- - drivers/net/phy/broadcom.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - ---- a/drivers/net/phy/broadcom.c -+++ b/drivers/net/phy/broadcom.c -@@ -314,6 +314,9 @@ static void bcm54xx_adjust_rxrefclk(stru - static int bcm54xx_config_init(struct phy_device *phydev) - { - int reg, err, val; -+ u32 led_modes[] = {BCM_LED_MULTICOLOR_LINK_ACT, -+ BCM_LED_MULTICOLOR_LINK_ACT}; -+ struct device_node *np = phydev->mdio.dev.of_node; - - reg = phy_read(phydev, MII_BCM54XX_ECR); - if (reg < 0) -@@ -369,6 +372,8 @@ static int bcm54xx_config_init(struct ph - - bcm54xx_phydsp_config(phydev); - -+ of_property_read_u32_array(np, "led-modes", led_modes, 2); -+ - /* Encode link speed into LED1 and LED3 pair (green/amber). - * Also flash these two LEDs on activity. This means configuring - * them for MULTICOLOR and encoding link/activity into them. -@@ -378,8 +383,8 @@ static int bcm54xx_config_init(struct ph - bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1, val); - - val = BCM_LED_MULTICOLOR_IN_PHASE | -- BCM5482_SHD_LEDS1_LED1(BCM_LED_MULTICOLOR_LINK_ACT) | -- BCM5482_SHD_LEDS1_LED3(BCM_LED_MULTICOLOR_LINK_ACT); -+ BCM5482_SHD_LEDS1_LED1(led_modes[0]) | -+ BCM5482_SHD_LEDS1_LED3(led_modes[1]); - bcm_phy_write_exp(phydev, BCM_EXP_MULTICOLOR, val); - - return 0; diff --git a/target/linux/bcm27xx/patches-5.10/950-0174-net-phy-2711-Change-the-default-ethernet-LED-actions.patch b/target/linux/bcm27xx/patches-5.10/950-0174-net-phy-2711-Change-the-default-ethernet-LED-actions.patch deleted file mode 100644 index 854e2cf765..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0174-net-phy-2711-Change-the-default-ethernet-LED-actions.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0534ec9429d41d9a00851444498f11b222d350b8 Mon Sep 17 00:00:00 2001 -From: James Hughes -Date: Thu, 7 Nov 2019 14:59:59 +0000 -Subject: [PATCH] net:phy:2711 Change the default ethernet LED actions - -This should return default behaviour back to that of previous -releases. ---- - drivers/net/phy/broadcom.c | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - ---- a/drivers/net/phy/broadcom.c -+++ b/drivers/net/phy/broadcom.c -@@ -315,7 +315,7 @@ static int bcm54xx_config_init(struct ph - { - int reg, err, val; - u32 led_modes[] = {BCM_LED_MULTICOLOR_LINK_ACT, -- BCM_LED_MULTICOLOR_LINK_ACT}; -+ BCM_LED_MULTICOLOR_LINK}; - struct device_node *np = phydev->mdio.dev.of_node; - - reg = phy_read(phydev, MII_BCM54XX_ECR); -@@ -374,10 +374,6 @@ static int bcm54xx_config_init(struct ph - - of_property_read_u32_array(np, "led-modes", led_modes, 2); - -- /* Encode link speed into LED1 and LED3 pair (green/amber). -- * Also flash these two LEDs on activity. This means configuring -- * them for MULTICOLOR and encoding link/activity into them. -- */ - val = BCM5482_SHD_LEDS1_LED1(BCM_LED_SRC_MULTICOLOR1) | - BCM5482_SHD_LEDS1_LED3(BCM_LED_SRC_MULTICOLOR1); - bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1, val); diff --git a/target/linux/bcm27xx/patches-5.10/950-0179-drm-v3d-Set-dma_mask-as-well-as-coherent_dma_mask.patch b/target/linux/bcm27xx/patches-5.10/950-0179-drm-v3d-Set-dma_mask-as-well-as-coherent_dma_mask.patch deleted file mode 100644 index 1289309a59..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0179-drm-v3d-Set-dma_mask-as-well-as-coherent_dma_mask.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0a34bafa5816dd1425550968ff7d3de2dc955e6f Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 22 Nov 2019 16:23:32 +0000 -Subject: [PATCH] drm/v3d: Set dma_mask as well as coherent_dma_mask - -Both coherent_dma_mask and dma_mask act as constraints on allocations -and bounce buffer usage, so be sure to set dma_mask to the appropriate -value otherwise the effective mask could be incorrect. - -Signed-off-by: Phil Elwell ---- - drivers/gpu/drm/v3d/v3d_drv.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/gpu/drm/v3d/v3d_drv.c -+++ b/drivers/gpu/drm/v3d/v3d_drv.c -@@ -263,8 +263,8 @@ static int v3d_platform_drm_probe(struct - return ret; - - mmu_debug = V3D_READ(V3D_MMU_DEBUG_INFO); -- dev->coherent_dma_mask = -- DMA_BIT_MASK(30 + V3D_GET_FIELD(mmu_debug, V3D_MMU_PA_WIDTH)); -+ dma_set_mask_and_coherent(dev, -+ DMA_BIT_MASK(30 + V3D_GET_FIELD(mmu_debug, V3D_MMU_PA_WIDTH))); - v3d->va_width = 30 + V3D_GET_FIELD(mmu_debug, V3D_MMU_VA_WIDTH); - - ident1 = V3D_READ(V3D_HUB_IDENT1); diff --git a/target/linux/bcm27xx/patches-5.10/950-0187-pinctrl-bcm2835-Accept-fewer-than-expected-IRQs.patch b/target/linux/bcm27xx/patches-5.10/950-0187-pinctrl-bcm2835-Accept-fewer-than-expected-IRQs.patch deleted file mode 100644 index 45c7b4252a..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0187-pinctrl-bcm2835-Accept-fewer-than-expected-IRQs.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 9ab71458b5475c7d8d42896721e593f6ef1a5c7a Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Tue, 25 Feb 2020 17:38:20 +0000 -Subject: [PATCH] pinctrl: bcm2835: Accept fewer than expected IRQs - -The downstream .dts files only request two GPIO IRQs. Truncate the -array of parent IRQs when irq_of_parse_and_map returns 0. - -Signed-off-by: Phil Elwell ---- - drivers/pinctrl/bcm/pinctrl-bcm2835.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - ---- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c -+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c -@@ -1290,9 +1290,13 @@ static int bcm2835_pinctrl_probe(struct - char *name; - - girq->parents[i] = irq_of_parse_and_map(np, i); -- if (!is_7211) -+ if (!is_7211) { -+ if (!girq->parents[i]) { -+ girq->num_parents = i; -+ break; -+ } - continue; -- -+ } - /* Skip over the all banks interrupts */ - pc->wake_irq[i] = irq_of_parse_and_map(np, i + - BCM2835_NUM_IRQS + 1); diff --git a/target/linux/bcm27xx/patches-5.10/950-0192-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch b/target/linux/bcm27xx/patches-5.10/950-0192-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch deleted file mode 100644 index bf59fc6c8f..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0192-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 45ae2035e05d4519d86f1073a257dea3a920f484 Mon Sep 17 00:00:00 2001 -From: Nataliya Korovkina -Date: Thu, 12 Mar 2020 17:22:53 -0400 -Subject: [PATCH] Kbuild: Allow .dtbo overlays to be built, adjust. - -This is adjustment to commit -d368ceaacdccd7732dc97d1d7987bdf7149d62e3 "kbuild: Allow .dtbo overlays to be built piecemeal" - -prepare3 target has gone from mainline tree in branch 5.4.y - -Signed-off-by: Nataliya Korovkina ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/Makefile -+++ b/Makefile -@@ -1354,7 +1354,7 @@ ifneq ($(dtstree),) - %.dtb: include/config/kernel.release scripts_dtc - $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ - --%.dtbo: prepare3 scripts_dtc -+%.dtbo: include/config/kernel.release scripts_dtc - $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ - - PHONY += dtbs dtbs_install dtbs_check diff --git a/target/linux/bcm27xx/patches-5.10/950-0197-media-uapi-Add-hevc-ctrls-for-WPP-decoding.patch b/target/linux/bcm27xx/patches-5.10/950-0197-media-uapi-Add-hevc-ctrls-for-WPP-decoding.patch deleted file mode 100644 index a018a1ba47..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0197-media-uapi-Add-hevc-ctrls-for-WPP-decoding.patch +++ /dev/null @@ -1,40 +0,0 @@ -From cfbd02c5469513b6d28d9012b14d70baa44869c5 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Mon, 23 Mar 2020 19:00:17 +0000 -Subject: [PATCH] media: uapi: Add hevc ctrls for WPP decoding - -WPP can allow greater parallelism within the decode, but needs -offset information to be passed in. - -Adds num_entry_point_offsets and entry_point_offset_minus1 to -v4l2_ctrl_hevc_slice_params. - -This is based on Jernej Skrabec's patches for cedrus which -implement the same feature. - -Signed-off-by: Dave Stevenson ---- - include/media/hevc-ctrls.h | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/include/media/hevc-ctrls.h -+++ b/include/media/hevc-ctrls.h -@@ -170,6 +170,7 @@ struct v4l2_ctrl_hevc_slice_params { - - /* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */ - __u32 slice_segment_addr; -+ __u32 num_entry_point_offsets; - - /* ISO/IEC 23008-2, ITU-T Rec. H.265: NAL unit header */ - __u8 nal_unit_type; -@@ -204,7 +205,9 @@ struct v4l2_ctrl_hevc_slice_params { - __u8 num_rps_poc_st_curr_after; - __u8 num_rps_poc_lt_curr; - -- __u8 padding[5]; -+ __u8 padding; -+ -+ __u32 entry_point_offset_minus1[256]; - - /* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */ - struct v4l2_hevc_dpb_entry dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]; diff --git a/target/linux/bcm27xx/patches-5.10/950-0201-mmc-sdhci-Silence-MMC-warnings.patch b/target/linux/bcm27xx/patches-5.10/950-0201-mmc-sdhci-Silence-MMC-warnings.patch deleted file mode 100644 index fabb3b0e6d..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0201-mmc-sdhci-Silence-MMC-warnings.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 966a8df34ba0d98908dd381f27f6cfd615b3cb74 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Fri, 6 Dec 2019 13:05:27 +0100 -Subject: [PATCH] mmc: sdhci: Silence MMC warnings - -When the MMC isn't plugged in, the driver will spam the console which is -pretty annoying when using NFS. - -Signed-off-by: Maxime Ripard ---- - drivers/mmc/host/sdhci.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/mmc/host/sdhci.c -+++ b/drivers/mmc/host/sdhci.c -@@ -41,7 +41,7 @@ - pr_debug("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x) - - #define SDHCI_DUMP(f, x...) \ -- pr_err("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x) -+ pr_debug("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x) - - #define MAX_TUNING_LOOP 40 - -@@ -3145,7 +3145,7 @@ static void sdhci_timeout_timer(struct t - spin_lock_irqsave(&host->lock, flags); - - if (host->cmd && !sdhci_data_line_cmd(host->cmd)) { -- pr_err("%s: Timeout waiting for hardware cmd interrupt.\n", -+ pr_debug("%s: Timeout waiting for hardware cmd interrupt.\n", - mmc_hostname(host->mmc)); - sdhci_dumpregs(host); - -@@ -3167,7 +3167,7 @@ static void sdhci_timeout_data_timer(str - - if (host->data || host->data_cmd || - (host->cmd && sdhci_data_line_cmd(host->cmd))) { -- pr_err("%s: Timeout waiting for hardware interrupt.\n", -+ pr_debug("%s: Timeout waiting for hardware interrupt.\n", - mmc_hostname(host->mmc)); - sdhci_dumpregs(host); - diff --git a/target/linux/bcm27xx/patches-5.10/950-0205-overlays-Fix-dtc-warnings-in-i2c-gpio.patch b/target/linux/bcm27xx/patches-5.10/950-0205-overlays-Fix-dtc-warnings-in-i2c-gpio.patch deleted file mode 100644 index 43db2828bb..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0205-overlays-Fix-dtc-warnings-in-i2c-gpio.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 987af76904b945d39b90e6a5294f8f2f691fb8fb Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 8 Apr 2020 11:59:39 +0100 -Subject: [PATCH] overlays: Fix dtc warnings in i2c-gpio - -Better late than never. - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts -@@ -11,6 +11,9 @@ - target-path = "/"; - - __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ - i2c_gpio: i2c@0 { - reg = <0xffffffff>; - compatible = "i2c-gpio"; diff --git a/target/linux/bcm27xx/patches-5.10/950-0223-overlays-Make-the-i2c-gpio-overlay-safe-again.patch b/target/linux/bcm27xx/patches-5.10/950-0223-overlays-Make-the-i2c-gpio-overlay-safe-again.patch deleted file mode 100644 index 589b583158..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0223-overlays-Make-the-i2c-gpio-overlay-safe-again.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 4721459bb386bf32b2295b947f38b91cdd97929b Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 1 May 2020 17:56:13 +0100 -Subject: [PATCH] overlays: Make the i2c-gpio overlay safe again - -Like many overlays, the i2c-gpio overlay goes to efforts to avoid -generating warnings about #address-cells and #size-cells not -being defined, which it does by defining them. Unfortunately this -is fatal if they don't match what the system requires, and the -recent switch to #size-cells = 2 on 2711 made i2c-gpio very -dangerous. - -In the absence of the knowledge of a clean way to fix this, just delete -the declarations and suffer the warnings. - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts | 3 --- - 1 file changed, 3 deletions(-) - ---- a/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts -@@ -11,9 +11,6 @@ - target-path = "/"; - - __overlay__ { -- #address-cells = <1>; -- #size-cells = <0>; -- - i2c_gpio: i2c@0 { - reg = <0xffffffff>; - compatible = "i2c-gpio"; diff --git a/target/linux/bcm27xx/patches-5.10/950-0224-media-i2c-imx219-Declare-that-the-driver-can-create-.patch b/target/linux/bcm27xx/patches-5.10/950-0224-media-i2c-imx219-Declare-that-the-driver-can-create-.patch deleted file mode 100644 index 87e1000617..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0224-media-i2c-imx219-Declare-that-the-driver-can-create-.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 8a251d243fa3931f3b03677f4f58ceb728f42e99 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Mon, 20 Apr 2020 11:01:21 +0100 -Subject: [PATCH] media: i2c: imx219: Declare that the driver can - create events - -The flag V4L2_SUBDEV_FL_HAS_EVENTS is required if the subdev can -generate events. It can create events from the ctrl handler, therefore -this is required. - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/imx219.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/media/i2c/imx219.c -+++ b/drivers/media/i2c/imx219.c -@@ -1591,7 +1591,8 @@ static int imx219_probe(struct i2c_clien - - /* Initialize subdev */ - imx219->sd.internal_ops = &imx219_internal_ops; -- imx219->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; -+ imx219->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | -+ V4L2_SUBDEV_FL_HAS_EVENTS; - imx219->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; - - /* Initialize source pads */ diff --git a/target/linux/bcm27xx/patches-5.10/950-0226-media-ov5647-Add-basic-support-for-multiple-sensor-m.patch b/target/linux/bcm27xx/patches-5.10/950-0226-media-ov5647-Add-basic-support-for-multiple-sensor-m.patch deleted file mode 100644 index be41bb4a26..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0226-media-ov5647-Add-basic-support-for-multiple-sensor-m.patch +++ /dev/null @@ -1,407 +0,0 @@ -From c3535af52b9f641565db400aab050298b786fcf3 Mon Sep 17 00:00:00 2001 -From: David Plowman -Date: Wed, 29 Jan 2020 15:30:53 +0000 -Subject: [PATCH] media: ov5647: Add basic support for multiple sensor - modes. - -Specifically: - -Added a structure ov5647_mode and a list of supported_modes (though no -actual new modes as yet). The state object points to the "current mode". - -ov5647_enum_mbus_code, ov5647_enum_frame_size, ov5647_set_fmt and -ov5647_get_fmt all needed upgrading to cope with multiple modes. - -__sensor_init (which writes all the registers) is now called by -ov5647_stream_on (once the mode is known) rather than by -ov5647_sensor_power. - -Signed-off-by: David Plowman -Signed-off-by: Naushir Patuck ---- - drivers/media/i2c/ov5647.c | 268 ++++++++++++++++++++++++++++--------- - 1 file changed, 202 insertions(+), 66 deletions(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -86,13 +86,17 @@ struct regval_list { - u8 data; - }; - -+struct ov5647_mode { -+ struct v4l2_mbus_framefmt format; -+ struct regval_list *reg_list; -+ unsigned int num_regs; -+}; -+ - struct ov5647 { - struct v4l2_subdev sd; - struct media_pad pad; - struct mutex lock; -- struct v4l2_mbus_framefmt format; -- unsigned int width; -- unsigned int height; -+ const struct ov5647_mode *mode; - int power_count; - struct clk *xclk; - struct gpio_desc *pwdn; -@@ -207,6 +211,32 @@ static struct regval_list ov5647_640x480 - {0x0100, 0x01}, - }; - -+static struct ov5647_mode supported_modes_8bit[] = { -+ /* -+ * Original 8-bit VGA mode -+ * Uncentred crop (top left quarter) from 2x2 binned 1296x972 image. -+ */ -+ { -+ { -+ .code = MEDIA_BUS_FMT_SBGGR8_1X8, -+ .colorspace = V4L2_COLORSPACE_SRGB, -+ .field = V4L2_FIELD_NONE, -+ .width = 640, -+ .height = 480 -+ }, -+ ov5647_640x480, -+ ARRAY_SIZE(ov5647_640x480) -+ }, -+ /* more modes below here... */ -+}; -+ -+static struct ov5647_mode supported_modes_10bit[] = { -+ /* no 10-bit modes yet */ -+}; -+ -+/* Use original 8-bit VGA mode as default. */ -+#define OV5647_DEFAULT_MODE (&supported_modes_8bit[0]) -+ - static int ov5647_write(struct v4l2_subdev *sd, u16 reg, u8 val) - { - int ret; -@@ -293,12 +323,55 @@ static int ov5647_set_virtual_channel(st - return ov5647_write(sd, OV5647_REG_MIPI_CTRL14, channel_id | (channel << 6)); - } - -+static int __sensor_init(struct v4l2_subdev *sd) -+{ -+ int ret; -+ u8 resetval, rdval; -+ struct i2c_client *client = v4l2_get_subdevdata(sd); -+ struct ov5647 *state = to_state(sd); -+ -+ ret = ov5647_read(sd, OV5647_SW_STANDBY, &rdval); -+ if (ret < 0) -+ return ret; -+ -+ ret = ov5647_write_array(sd, state->mode->reg_list, -+ state->mode->num_regs); -+ if (ret < 0) { -+ dev_err(&client->dev, "write sensor default regs error\n"); -+ return ret; -+ } -+ -+ ret = ov5647_set_virtual_channel(sd, 0); -+ if (ret < 0) -+ return ret; -+ -+ ret = ov5647_read(sd, OV5647_SW_STANDBY, &resetval); -+ if (ret < 0) -+ return ret; -+ -+ if (!(resetval & 0x01)) { -+ dev_err(&client->dev, "Device was in SW standby"); -+ ret = ov5647_write(sd, OV5647_SW_STANDBY, 0x01); -+ if (ret < 0) -+ return ret; -+ } -+ -+ return 0; -+} -+ - static int ov5647_stream_on(struct v4l2_subdev *sd) - { -+ struct i2c_client *client = v4l2_get_subdevdata(sd); - struct ov5647 *ov5647 = to_state(sd); - u8 val = MIPI_CTRL00_BUS_IDLE; - int ret; - -+ ret = __sensor_init(sd); -+ if (ret < 0) { -+ dev_err(&client->dev, "sensor_init failed\n"); -+ return ret; -+ } -+ - if (ov5647->flags & V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK) - val |= MIPI_CTRL00_CLOCK_LANE_GATE | - MIPI_CTRL00_LINE_SYNC_ENABLE; -@@ -347,44 +420,6 @@ static int set_sw_standby(struct v4l2_su - return ov5647_write(sd, OV5647_SW_STANDBY, rdval); - } - --static int __sensor_init(struct v4l2_subdev *sd) --{ -- int ret; -- u8 resetval, rdval; -- struct i2c_client *client = v4l2_get_subdevdata(sd); -- -- ret = ov5647_read(sd, OV5647_SW_STANDBY, &rdval); -- if (ret < 0) -- return ret; -- -- ret = ov5647_write_array(sd, ov5647_640x480, -- ARRAY_SIZE(ov5647_640x480)); -- if (ret < 0) { -- dev_err(&client->dev, "write sensor default regs error\n"); -- return ret; -- } -- -- ret = ov5647_set_virtual_channel(sd, 0); -- if (ret < 0) -- return ret; -- -- ret = ov5647_read(sd, OV5647_SW_STANDBY, &resetval); -- if (ret < 0) -- return ret; -- -- if (!(resetval & 0x01)) { -- dev_err(&client->dev, "Device was in SW standby"); -- ret = ov5647_write(sd, OV5647_SW_STANDBY, 0x01); -- if (ret < 0) -- return ret; -- } -- -- /* -- * stream off to make the clock lane into LP-11 state. -- */ -- return ov5647_stream_off(sd); --} -- - static int ov5647_sensor_power(struct v4l2_subdev *sd, int on) - { - int ret = 0; -@@ -408,7 +443,7 @@ static int ov5647_sensor_power(struct v4 - } - - ret = ov5647_write_array(sd, sensor_oe_enable_regs, -- ARRAY_SIZE(sensor_oe_enable_regs)); -+ ARRAY_SIZE(sensor_oe_enable_regs)); - if (ret < 0) { - clk_disable_unprepare(ov5647->xclk); - dev_err(&client->dev, -@@ -416,7 +451,10 @@ static int ov5647_sensor_power(struct v4 - goto out; - } - -- ret = __sensor_init(sd); -+ /* -+ * Ensure streaming off to make clock lane go into LP-11 state. -+ */ -+ ret = ov5647_stream_off(sd); - if (ret < 0) { - clk_disable_unprepare(ov5647->xclk); - dev_err(&client->dev, -@@ -427,7 +465,7 @@ static int ov5647_sensor_power(struct v4 - dev_dbg(&client->dev, "OV5647 power off\n"); - - ret = ov5647_write_array(sd, sensor_oe_disable_regs, -- ARRAY_SIZE(sensor_oe_disable_regs)); -+ ARRAY_SIZE(sensor_oe_disable_regs)); - - if (ret < 0) - dev_dbg(&client->dev, "disable oe failed\n"); -@@ -489,10 +527,19 @@ static const struct v4l2_subdev_core_ops - - static int ov5647_s_stream(struct v4l2_subdev *sd, int enable) - { -+ struct ov5647 *state = to_state(sd); -+ int ret = 0; -+ -+ mutex_lock(&state->lock); -+ - if (enable) -- return ov5647_stream_on(sd); -+ ret = ov5647_stream_on(sd); - else -- return ov5647_stream_off(sd); -+ ret = ov5647_stream_off(sd); -+ -+ mutex_unlock(&state->lock); -+ -+ return ret; - } - - static const struct v4l2_subdev_video_ops ov5647_subdev_video_ops = { -@@ -503,38 +550,127 @@ static int ov5647_enum_mbus_code(struct - struct v4l2_subdev_pad_config *cfg, - struct v4l2_subdev_mbus_code_enum *code) - { -- if (code->index > 0) -+ if (code->index == 0 && ARRAY_SIZE(supported_modes_8bit)) -+ code->code = MEDIA_BUS_FMT_SBGGR8_1X8; -+ else if (code->index == 0 && ARRAY_SIZE(supported_modes_8bit) == 0 && -+ ARRAY_SIZE(supported_modes_10bit)) -+ code->code = MEDIA_BUS_FMT_SBGGR10_1X10; -+ else if (code->index == 1 && ARRAY_SIZE(supported_modes_8bit) && -+ ARRAY_SIZE(supported_modes_10bit)) -+ code->code = MEDIA_BUS_FMT_SBGGR10_1X10; -+ else - return -EINVAL; - -- code->code = MEDIA_BUS_FMT_SBGGR8_1X8; -+ return 0; -+} -+ -+static int ov5647_enum_frame_size(struct v4l2_subdev *sd, -+ struct v4l2_subdev_pad_config *cfg, -+ struct v4l2_subdev_frame_size_enum *fse) -+{ -+ struct ov5647_mode *mode = NULL; -+ -+ if (fse->code == MEDIA_BUS_FMT_SBGGR8_1X8) { -+ if (fse->index >= ARRAY_SIZE(supported_modes_8bit)) -+ return -EINVAL; -+ mode = &supported_modes_8bit[fse->index]; -+ } else if (fse->code == MEDIA_BUS_FMT_SBGGR10_1X10) { -+ if (fse->index >= ARRAY_SIZE(supported_modes_10bit)) -+ return -EINVAL; -+ mode = &supported_modes_10bit[fse->index]; -+ } else { -+ return -EINVAL; -+ } -+ -+ fse->min_width = mode->format.width; -+ fse->max_width = fse->min_width; -+ fse->min_height = mode->format.height; -+ fse->max_height = fse->min_height; -+ -+ return 0; -+} -+ -+static int ov5647_set_fmt(struct v4l2_subdev *sd, -+ struct v4l2_subdev_pad_config *cfg, -+ struct v4l2_subdev_format *format) -+{ -+ struct v4l2_mbus_framefmt *fmt = &format->format; -+ struct ov5647 *state = to_state(sd); -+ struct v4l2_mbus_framefmt *framefmt; -+ const struct ov5647_mode *mode_8bit, *mode_10bit, *mode = NULL; -+ -+ if (format->pad != 0) -+ return -EINVAL; -+ -+ mutex_lock(&state->lock); -+ -+ /* -+ * Try to respect any given pixel format, otherwise try for a 10-bit -+ * mode. -+ */ -+ mode_8bit = v4l2_find_nearest_size(supported_modes_8bit, -+ ARRAY_SIZE(supported_modes_8bit), -+ format.width, format.height, -+ format->format.width, -+ format->format.height); -+ mode_10bit = v4l2_find_nearest_size(supported_modes_10bit, -+ ARRAY_SIZE(supported_modes_10bit), -+ format.width, format.height, -+ format->format.width, -+ format->format.height); -+ if (format->format.code == MEDIA_BUS_FMT_SBGGR8_1X8 && mode_8bit) -+ mode = mode_8bit; -+ else if (format->format.code == MEDIA_BUS_FMT_SBGGR10_1X10 && -+ mode_10bit) -+ mode = mode_10bit; -+ else if (mode_10bit) -+ mode = mode_10bit; -+ else -+ mode = mode_8bit; -+ -+ if (!mode) -+ return -EINVAL; -+ -+ *fmt = mode->format; -+ if (format->which == V4L2_SUBDEV_FORMAT_TRY) { -+ framefmt = v4l2_subdev_get_try_format(sd, cfg, format->pad); -+ *framefmt = format->format; -+ } else { -+ state->mode = mode; -+ } -+ -+ mutex_unlock(&state->lock); - - return 0; - } - --static int ov5647_set_get_fmt(struct v4l2_subdev *sd, -- struct v4l2_subdev_pad_config *cfg, -- struct v4l2_subdev_format *format) -+static int ov5647_get_fmt(struct v4l2_subdev *sd, -+ struct v4l2_subdev_pad_config *cfg, -+ struct v4l2_subdev_format *format) - { - struct v4l2_mbus_framefmt *fmt = &format->format; -+ struct ov5647 *state = to_state(sd); - - if (format->pad != 0) - return -EINVAL; - -- /* Only one format is supported, so return that */ -- memset(fmt, 0, sizeof(*fmt)); -- fmt->code = MEDIA_BUS_FMT_SBGGR8_1X8; -- fmt->colorspace = V4L2_COLORSPACE_SRGB; -- fmt->field = V4L2_FIELD_NONE; -- fmt->width = 640; -- fmt->height = 480; -+ mutex_lock(&state->lock); -+ -+ if (format->which == V4L2_SUBDEV_FORMAT_TRY) -+ *fmt = *v4l2_subdev_get_try_format(sd, cfg, format->pad); -+ else -+ *fmt = state->mode->format; -+ -+ mutex_unlock(&state->lock); - - return 0; - } - - static const struct v4l2_subdev_pad_ops ov5647_subdev_pad_ops = { - .enum_mbus_code = ov5647_enum_mbus_code, -- .set_fmt = ov5647_set_get_fmt, -- .get_fmt = ov5647_set_get_fmt, -+ .set_fmt = ov5647_set_fmt, -+ .get_fmt = ov5647_get_fmt, -+ .enum_frame_size = ov5647_enum_frame_size, - }; - - static const struct v4l2_subdev_ops ov5647_subdev_ops = { -@@ -580,18 +716,15 @@ static int ov5647_open(struct v4l2_subde - v4l2_subdev_get_try_format(sd, fh->pad, 0); - struct v4l2_rect *crop = - v4l2_subdev_get_try_crop(sd, fh->pad, 0); -+ struct ov5647 *state = to_state(sd); - - crop->left = OV5647_COLUMN_START_DEF; - crop->top = OV5647_ROW_START_DEF; - crop->width = OV5647_WINDOW_WIDTH_DEF; - crop->height = OV5647_WINDOW_HEIGHT_DEF; - -- format->code = MEDIA_BUS_FMT_SBGGR8_1X8; -- -- format->width = OV5647_WINDOW_WIDTH_DEF; -- format->height = OV5647_WINDOW_HEIGHT_DEF; -- format->field = V4L2_FIELD_NONE; -- format->colorspace = V4L2_COLORSPACE_SRGB; -+ /* Set the default format to the same as the sensor. */ -+ *format = state->mode->format; - - return 0; - } -@@ -660,6 +793,9 @@ static int ov5647_probe(struct i2c_clien - - mutex_init(&sensor->lock); - -+ /* Set the default mode before we init the subdev */ -+ sensor->mode = OV5647_DEFAULT_MODE; -+ - sd = &sensor->sd; - v4l2_i2c_subdev_init(sd, client, &ov5647_subdev_ops); - sensor->sd.internal_ops = &ov5647_subdev_internal_ops; diff --git a/target/linux/bcm27xx/patches-5.10/950-0227-media-ov5647-Add-V4L2-controls-for-analogue-gain-exp.patch b/target/linux/bcm27xx/patches-5.10/950-0227-media-ov5647-Add-V4L2-controls-for-analogue-gain-exp.patch deleted file mode 100644 index 583edace3a..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0227-media-ov5647-Add-V4L2-controls-for-analogue-gain-exp.patch +++ /dev/null @@ -1,277 +0,0 @@ -From 0c212ccaa2e790de8eb43b2766767f2713f93915 Mon Sep 17 00:00:00 2001 -From: David Plowman -Date: Wed, 29 Jan 2020 15:31:23 +0000 -Subject: [PATCH] media: ov5647: Add V4L2 controls for analogue gain, - exposure and AWB - -Added basic v4l2_ctrl_handler infrastructure (there was none -previously). - -Added controls to let AWB/AEC/AGC run in the sensor's auto mode or -manually. Also controls to set exposure (in lines) and analogue gain -(as a register code) from user code. - -Also delete registers (just the one) from the VGA mode register set -that are now controlled by the new V4L2 controls. - -Signed-off-by: David Plowman -Signed-off-by: Naushir Patuck ---- - drivers/media/i2c/ov5647.c | 175 ++++++++++++++++++++++++++++++++++++- - 1 file changed, 174 insertions(+), 1 deletion(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -29,11 +29,13 @@ - #include - #include - #include -+#include - #include - #include - #include - #include - -+ - #define SENSOR_NAME "ov5647" - - /* -@@ -53,9 +55,16 @@ - #define OV5647_REG_CHIPID_H 0x300A - #define OV5647_REG_CHIPID_L 0x300B - #define OV5640_REG_PAD_OUT 0x300D -+#define OV5647_REG_EXP_HI 0x3500 -+#define OV5647_REG_EXP_MID 0x3501 -+#define OV5647_REG_EXP_LO 0x3502 -+#define OV5647_REG_AEC_AGC 0x3503 -+#define OV5647_REG_GAIN_HI 0x350A -+#define OV5647_REG_GAIN_LO 0x350B - #define OV5647_REG_FRAME_OFF_NUMBER 0x4202 - #define OV5647_REG_MIPI_CTRL00 0x4800 - #define OV5647_REG_MIPI_CTRL14 0x4814 -+#define OV5647_REG_AWB 0x5001 - - #define REG_TERM 0xfffe - #define VAL_TERM 0xfe -@@ -101,6 +110,7 @@ struct ov5647 { - struct clk *xclk; - struct gpio_desc *pwdn; - unsigned int flags; -+ struct v4l2_ctrl_handler ctrls; - }; - - static inline struct ov5647 *to_state(struct v4l2_subdev *sd) -@@ -135,7 +145,6 @@ static struct regval_list ov5647_640x480 - {0x3612, 0x59}, - {0x3618, 0x00}, - {0x5000, 0x06}, -- {0x5001, 0x01}, - {0x5002, 0x41}, - {0x5003, 0x08}, - {0x5a00, 0x08}, -@@ -372,6 +381,11 @@ static int ov5647_stream_on(struct v4l2_ - return ret; - } - -+ /* Apply customized values from user when stream starts */ -+ ret = __v4l2_ctrl_handler_setup(sd->ctrl_handler); -+ if (ret) -+ return ret; -+ - if (ov5647->flags & V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK) - val |= MIPI_CTRL00_CLOCK_LANE_GATE | - MIPI_CTRL00_LINE_SYNC_ENABLE; -@@ -753,6 +767,120 @@ static int ov5647_parse_dt(struct device - return ret; - } - -+static int ov5647_s_auto_white_balance(struct v4l2_subdev *sd, u32 val) -+{ -+ /* non-zero turns on AWB */ -+ return ov5647_write(sd, OV5647_REG_AWB, val ? 1 : 0); -+} -+ -+static int ov5647_s_autogain(struct v4l2_subdev *sd, u32 val) -+{ -+ int ret; -+ u8 reg; -+ -+ /* non-zero turns on AGC by clearing bit 1 */ -+ ret = ov5647_read(sd, OV5647_REG_AEC_AGC, ®); -+ if (ret == 0) -+ ret = ov5647_write(sd, OV5647_REG_AEC_AGC, -+ val ? reg & ~2 : reg | 2); -+ -+ return ret; -+} -+ -+static int ov5647_s_exposure_auto(struct v4l2_subdev *sd, u32 val) -+{ -+ int ret; -+ u8 reg; -+ -+ /* Everything except V4L2_EXPOSURE_MANUAL turns on AEC by -+ * clearing bit 0 -+ */ -+ ret = ov5647_read(sd, OV5647_REG_AEC_AGC, ®); -+ if (ret == 0) -+ ret = ov5647_write(sd, OV5647_REG_AEC_AGC, -+ val == V4L2_EXPOSURE_MANUAL ? -+ reg | 1 : reg & ~1); -+ -+ return ret; -+} -+ -+static int ov5647_s_analogue_gain(struct v4l2_subdev *sd, u32 val) -+{ -+ int ret; -+ -+ /* 10 bits of gain, 2 in the high register */ -+ ret = ov5647_write(sd, OV5647_REG_GAIN_HI, (val >> 8) & 3); -+ if (ret == 0) -+ ret = ov5647_write(sd, OV5647_REG_GAIN_LO, val & 0xff); -+ -+ return ret; -+} -+ -+static int ov5647_s_exposure(struct v4l2_subdev *sd, u32 val) -+{ -+ int ret; -+ -+ /* Sensor has 20 bits, but the bottom 4 bits are fractions of a line -+ * which we leave as zero (and don't receive in "val"). -+ */ -+ ret = ov5647_write(sd, OV5647_REG_EXP_HI, (val >> 12) & 0xf); -+ if (ret == 0) -+ ov5647_write(sd, OV5647_REG_EXP_MID, (val >> 4) & 0xff); -+ if (ret == 0) -+ ov5647_write(sd, OV5647_REG_EXP_LO, (val & 0xf) << 4); -+ -+ return ret; -+} -+ -+static int ov5647_s_ctrl(struct v4l2_ctrl *ctrl) -+{ -+ struct ov5647 *state = container_of(ctrl->handler, -+ struct ov5647, ctrls); -+ struct v4l2_subdev *sd = &state->sd; -+ struct i2c_client *client = v4l2_get_subdevdata(sd); -+ int ret = 0; -+ -+ /* v4l2_ctrl_lock() locks our own mutex */ -+ -+ /* -+ * If the device is not powered up by the host driver do -+ * not apply any controls to H/W at this time. Instead -+ * the controls will be restored right after power-up. -+ */ -+ if (state->power_count == 0) -+ return 0; -+ -+ switch (ctrl->id) { -+ case V4L2_CID_AUTO_WHITE_BALANCE: -+ ret = ov5647_s_auto_white_balance(sd, ctrl->val); -+ break; -+ case V4L2_CID_AUTOGAIN: -+ ret = ov5647_s_autogain(sd, ctrl->val); -+ break; -+ case V4L2_CID_EXPOSURE_AUTO: -+ ret = ov5647_s_exposure_auto(sd, ctrl->val); -+ break; -+ case V4L2_CID_ANALOGUE_GAIN: -+ ret = ov5647_s_analogue_gain(sd, ctrl->val); -+ break; -+ case V4L2_CID_EXPOSURE: -+ ret = ov5647_s_exposure(sd, ctrl->val); -+ break; -+ default: -+ dev_info(&client->dev, -+ "ctrl(id:0x%x,val:0x%x) is not handled\n", -+ ctrl->id, ctrl->val); -+ ret = -EINVAL; -+ break; -+ } -+ -+ return ret; -+} -+ -+static const struct v4l2_ctrl_ops ov5647_ctrl_ops = { -+ .s_ctrl = ov5647_s_ctrl, -+}; -+ - static int ov5647_probe(struct i2c_client *client) - { - struct device *dev = &client->dev; -@@ -761,6 +889,7 @@ static int ov5647_probe(struct i2c_clien - struct v4l2_subdev *sd; - struct device_node *np = client->dev.of_node; - u32 xclk_freq; -+ struct v4l2_ctrl *ctrl; - - sensor = devm_kzalloc(dev, sizeof(*sensor), GFP_KERNEL); - if (!sensor) -@@ -793,6 +922,48 @@ static int ov5647_probe(struct i2c_clien - - mutex_init(&sensor->lock); - -+ /* Initialise controls. */ -+ v4l2_ctrl_handler_init(&sensor->ctrls, 3); -+ v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -+ V4L2_CID_AUTOGAIN, -+ 0, /* min */ -+ 1, /* max */ -+ 1, /* step */ -+ 1); /* default */ -+ v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -+ V4L2_CID_AUTO_WHITE_BALANCE, -+ 0, /* min */ -+ 1, /* max */ -+ 1, /* step */ -+ 1); /* default */ -+ v4l2_ctrl_new_std_menu(&sensor->ctrls, &ov5647_ctrl_ops, -+ V4L2_CID_EXPOSURE_AUTO, -+ V4L2_EXPOSURE_MANUAL, /* max */ -+ 0, /* skip_mask */ -+ V4L2_EXPOSURE_AUTO); /* default */ -+ ctrl = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -+ V4L2_CID_EXPOSURE, -+ 4, /* min lines */ -+ 65535, /* max lines (4+8+4 bits)*/ -+ 1, /* step */ -+ 1000); /* default number of lines */ -+ ctrl->flags |= V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; -+ ctrl = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -+ V4L2_CID_ANALOGUE_GAIN, -+ 16, /* min, 16 = 1.0x */ -+ 1023, /* max (10 bits) */ -+ 1, /* step */ -+ 32); /* default, 32 = 2.0x */ -+ ctrl->flags |= V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; -+ -+ if (sensor->ctrls.error) { -+ ret = sensor->ctrls.error; -+ dev_err(&client->dev, "%s control init failed (%d)\n", -+ __func__, ret); -+ goto error; -+ } -+ sensor->sd.ctrl_handler = &sensor->ctrls; -+ - /* Set the default mode before we init the subdev */ - sensor->mode = OV5647_DEFAULT_MODE; - -@@ -828,6 +999,7 @@ static int ov5647_probe(struct i2c_clien - error: - media_entity_cleanup(&sd->entity); - mutex_remove: -+ v4l2_ctrl_handler_free(&sensor->ctrls); - mutex_destroy(&sensor->lock); - return ret; - } -@@ -839,6 +1011,7 @@ static int ov5647_remove(struct i2c_clie - - v4l2_async_unregister_subdev(&ov5647->sd); - media_entity_cleanup(&ov5647->sd.entity); -+ v4l2_ctrl_handler_free(&ov5647->ctrls); - v4l2_device_unregister_subdev(sd); - mutex_destroy(&ov5647->lock); - diff --git a/target/linux/bcm27xx/patches-5.10/950-0228-media-ov5647-Add-extra-10-bit-sensor-modes.patch b/target/linux/bcm27xx/patches-5.10/950-0228-media-ov5647-Add-extra-10-bit-sensor-modes.patch deleted file mode 100644 index 32b2375a48..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0228-media-ov5647-Add-extra-10-bit-sensor-modes.patch +++ /dev/null @@ -1,549 +0,0 @@ -From 004f4065edbb817a54121937514eb94159ecce69 Mon Sep 17 00:00:00 2001 -From: David Plowman -Date: Wed, 29 Jan 2020 15:31:28 +0000 -Subject: [PATCH] media: ov5647: Add extra 10-bit sensor modes. - -The 8-bit VGA mode remains, we add the following 10-bit modes: - -Mode 0: 2592x1944 full resolution. - -Mode 1: 1920x1080 full resolution, but centre-cropped. -(This mode achieves 30fps, mode 0 does not.) - -Mode 2: 1296x972 full field-of-view 2x2 binned mode. - -Mode 3: VGA full field of view mode. - -Signed-off-by: David Plowman -Signed-off-by: Naushir Patuck ---- - drivers/media/i2c/ov5647.c | 463 ++++++++++++++++++++++++++++++++++++- - 1 file changed, 452 insertions(+), 11 deletions(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -111,6 +111,7 @@ struct ov5647 { - struct gpio_desc *pwdn; - unsigned int flags; - struct v4l2_ctrl_handler ctrls; -+ bool write_mode_regs; - }; - - static inline struct ov5647 *to_state(struct v4l2_subdev *sd) -@@ -130,7 +131,7 @@ static struct regval_list sensor_oe_enab - {0x3002, 0xe4}, - }; - --static struct regval_list ov5647_640x480[] = { -+static struct regval_list ov5647_640x480_8bit[] = { - {0x0100, 0x00}, - {0x0103, 0x01}, - {0x3034, 0x08}, -@@ -220,9 +221,378 @@ static struct regval_list ov5647_640x480 - {0x0100, 0x01}, - }; - -+static struct regval_list ov5647_2592x1944_10bit[] = { -+ {0x0100, 0x00}, -+ {0x0103, 0x01}, -+ {0x3034, 0x1a}, -+ {0x3035, 0x21}, -+ {0x3036, 0x69}, -+ {0x303c, 0x11}, -+ {0x3106, 0xf5}, -+ {0x3821, 0x06}, -+ {0x3820, 0x00}, -+ {0x3827, 0xec}, -+ {0x370c, 0x03}, -+ {0x3612, 0x5b}, -+ {0x3618, 0x04}, -+ {0x5000, 0x06}, -+ {0x5002, 0x41}, -+ {0x5003, 0x08}, -+ {0x5a00, 0x08}, -+ {0x3000, 0x00}, -+ {0x3001, 0x00}, -+ {0x3002, 0x00}, -+ {0x3016, 0x08}, -+ {0x3017, 0xe0}, -+ {0x3018, 0x44}, -+ {0x301c, 0xf8}, -+ {0x301d, 0xf0}, -+ {0x3a18, 0x00}, -+ {0x3a19, 0xf8}, -+ {0x3c01, 0x80}, -+ {0x3b07, 0x0c}, -+ {0x380c, 0x0b}, -+ {0x380d, 0x1c}, -+ {0x380e, 0x07}, -+ {0x380f, 0xb0}, -+ {0x3814, 0x11}, -+ {0x3815, 0x11}, -+ {0x3708, 0x64}, -+ {0x3709, 0x12}, -+ {0x3808, 0x0a}, -+ {0x3809, 0x20}, -+ {0x380a, 0x07}, -+ {0x380b, 0x98}, -+ {0x3800, 0x00}, -+ {0x3801, 0x00}, -+ {0x3802, 0x00}, -+ {0x3803, 0x00}, -+ {0x3804, 0x0a}, -+ {0x3805, 0x3f}, -+ {0x3806, 0x07}, -+ {0x3807, 0xa3}, -+ {0x3811, 0x10}, -+ {0x3813, 0x06}, -+ {0x3630, 0x2e}, -+ {0x3632, 0xe2}, -+ {0x3633, 0x23}, -+ {0x3634, 0x44}, -+ {0x3636, 0x06}, -+ {0x3620, 0x64}, -+ {0x3621, 0xe0}, -+ {0x3600, 0x37}, -+ {0x3704, 0xa0}, -+ {0x3703, 0x5a}, -+ {0x3715, 0x78}, -+ {0x3717, 0x01}, -+ {0x3731, 0x02}, -+ {0x370b, 0x60}, -+ {0x3705, 0x1a}, -+ {0x3f05, 0x02}, -+ {0x3f06, 0x10}, -+ {0x3f01, 0x0a}, -+ {0x3a08, 0x01}, -+ {0x3a09, 0x28}, -+ {0x3a0a, 0x00}, -+ {0x3a0b, 0xf6}, -+ {0x3a0d, 0x08}, -+ {0x3a0e, 0x06}, -+ {0x3a0f, 0x58}, -+ {0x3a10, 0x50}, -+ {0x3a1b, 0x58}, -+ {0x3a1e, 0x50}, -+ {0x3a11, 0x60}, -+ {0x3a1f, 0x28}, -+ {0x4001, 0x02}, -+ {0x4004, 0x04}, -+ {0x4000, 0x09}, -+ {0x4837, 0x19}, -+ {0x4800, 0x24}, -+ {0x3503, 0x03}, -+ {0x0100, 0x01}, -+}; -+ -+static struct regval_list ov5647_1080p30_10bit[] = { -+ {0x0100, 0x00}, -+ {0x0103, 0x01}, -+ {0x3034, 0x1a}, -+ {0x3035, 0x21}, -+ {0x3036, 0x62}, -+ {0x303c, 0x11}, -+ {0x3106, 0xf5}, -+ {0x3821, 0x06}, -+ {0x3820, 0x00}, -+ {0x3827, 0xec}, -+ {0x370c, 0x03}, -+ {0x3612, 0x5b}, -+ {0x3618, 0x04}, -+ {0x5000, 0x06}, -+ {0x5002, 0x41}, -+ {0x5003, 0x08}, -+ {0x5a00, 0x08}, -+ {0x3000, 0x00}, -+ {0x3001, 0x00}, -+ {0x3002, 0x00}, -+ {0x3016, 0x08}, -+ {0x3017, 0xe0}, -+ {0x3018, 0x44}, -+ {0x301c, 0xf8}, -+ {0x301d, 0xf0}, -+ {0x3a18, 0x00}, -+ {0x3a19, 0xf8}, -+ {0x3c01, 0x80}, -+ {0x3b07, 0x0c}, -+ {0x380c, 0x09}, -+ {0x380d, 0x70}, -+ {0x380e, 0x04}, -+ {0x380f, 0x50}, -+ {0x3814, 0x11}, -+ {0x3815, 0x11}, -+ {0x3708, 0x64}, -+ {0x3709, 0x12}, -+ {0x3808, 0x07}, -+ {0x3809, 0x80}, -+ {0x380a, 0x04}, -+ {0x380b, 0x38}, -+ {0x3800, 0x01}, -+ {0x3801, 0x5c}, -+ {0x3802, 0x01}, -+ {0x3803, 0xb2}, -+ {0x3804, 0x08}, -+ {0x3805, 0xe3}, -+ {0x3806, 0x05}, -+ {0x3807, 0xf1}, -+ {0x3811, 0x04}, -+ {0x3813, 0x02}, -+ {0x3630, 0x2e}, -+ {0x3632, 0xe2}, -+ {0x3633, 0x23}, -+ {0x3634, 0x44}, -+ {0x3636, 0x06}, -+ {0x3620, 0x64}, -+ {0x3621, 0xe0}, -+ {0x3600, 0x37}, -+ {0x3704, 0xa0}, -+ {0x3703, 0x5a}, -+ {0x3715, 0x78}, -+ {0x3717, 0x01}, -+ {0x3731, 0x02}, -+ {0x370b, 0x60}, -+ {0x3705, 0x1a}, -+ {0x3f05, 0x02}, -+ {0x3f06, 0x10}, -+ {0x3f01, 0x0a}, -+ {0x3a08, 0x01}, -+ {0x3a09, 0x4b}, -+ {0x3a0a, 0x01}, -+ {0x3a0b, 0x13}, -+ {0x3a0d, 0x04}, -+ {0x3a0e, 0x03}, -+ {0x3a0f, 0x58}, -+ {0x3a10, 0x50}, -+ {0x3a1b, 0x58}, -+ {0x3a1e, 0x50}, -+ {0x3a11, 0x60}, -+ {0x3a1f, 0x28}, -+ {0x4001, 0x02}, -+ {0x4004, 0x04}, -+ {0x4000, 0x09}, -+ {0x4837, 0x19}, -+ {0x4800, 0x34}, -+ {0x3503, 0x03}, -+ {0x0100, 0x01}, -+}; -+ -+static struct regval_list ov5647_2x2binned_10bit[] = { -+ {0x0100, 0x00}, -+ {0x0103, 0x01}, -+ {0x3034, 0x1A}, -+ {0x3035, 0x21}, -+ {0x3036, 0x62}, -+ {0x303C, 0x11}, -+ {0x3106, 0xF5}, -+ {0x3827, 0xEC}, -+ {0x370C, 0x03}, -+ {0x3612, 0x59}, -+ {0x3618, 0x00}, -+ {0x5000, 0x06}, -+ {0x5002, 0x41}, -+ {0x5003, 0x08}, -+ {0x5A00, 0x08}, -+ {0x3000, 0x00}, -+ {0x3001, 0x00}, -+ {0x3002, 0x00}, -+ {0x3016, 0x08}, -+ {0x3017, 0xE0}, -+ {0x3018, 0x44}, -+ {0x301C, 0xF8}, -+ {0x301D, 0xF0}, -+ {0x3A18, 0x00}, -+ {0x3A19, 0xF8}, -+ {0x3C01, 0x80}, -+ {0x3B07, 0x0C}, -+ {0x3800, 0x00}, -+ {0x3801, 0x00}, -+ {0x3802, 0x00}, -+ {0x3803, 0x00}, -+ {0x3804, 0x0A}, -+ {0x3805, 0x3F}, -+ {0x3806, 0x07}, -+ {0x3807, 0xA3}, -+ {0x3808, 0x05}, -+ {0x3809, 0x10}, -+ {0x380A, 0x03}, -+ {0x380B, 0xCC}, -+ {0x380C, 0x07}, -+ {0x380D, 0x68}, -+ {0x3811, 0x0c}, -+ {0x3813, 0x06}, -+ {0x3814, 0x31}, -+ {0x3815, 0x31}, -+ {0x3630, 0x2E}, -+ {0x3632, 0xE2}, -+ {0x3633, 0x23}, -+ {0x3634, 0x44}, -+ {0x3636, 0x06}, -+ {0x3620, 0x64}, -+ {0x3621, 0xE0}, -+ {0x3600, 0x37}, -+ {0x3704, 0xA0}, -+ {0x3703, 0x5A}, -+ {0x3715, 0x78}, -+ {0x3717, 0x01}, -+ {0x3731, 0x02}, -+ {0x370B, 0x60}, -+ {0x3705, 0x1A}, -+ {0x3F05, 0x02}, -+ {0x3F06, 0x10}, -+ {0x3F01, 0x0A}, -+ {0x3A08, 0x01}, -+ {0x3A09, 0x28}, -+ {0x3A0A, 0x00}, -+ {0x3A0B, 0xF6}, -+ {0x3A0D, 0x08}, -+ {0x3A0E, 0x06}, -+ {0x3A0F, 0x58}, -+ {0x3A10, 0x50}, -+ {0x3A1B, 0x58}, -+ {0x3A1E, 0x50}, -+ {0x3A11, 0x60}, -+ {0x3A1F, 0x28}, -+ {0x4001, 0x02}, -+ {0x4004, 0x04}, -+ {0x4000, 0x09}, -+ {0x4837, 0x16}, -+ {0x4800, 0x24}, -+ {0x3503, 0x03}, -+ {0x3820, 0x41}, -+ {0x3821, 0x07}, -+ {0x380E, 0x05}, -+ {0x380F, 0x9B}, -+ {0x350A, 0x00}, -+ {0x350B, 0x10}, -+ {0x3500, 0x00}, -+ {0x3501, 0x1A}, -+ {0x3502, 0xF0}, -+ {0x3212, 0xA0}, -+ {0x0100, 0x01}, -+}; -+ -+static struct regval_list ov5647_640x480_10bit[] = { -+ {0x0100, 0x00}, -+ {0x0103, 0x01}, -+ {0x3035, 0x11}, -+ {0x3036, 0x46}, -+ {0x303c, 0x11}, -+ {0x3821, 0x07}, -+ {0x3820, 0x41}, -+ {0x370c, 0x03}, -+ {0x3612, 0x59}, -+ {0x3618, 0x00}, -+ {0x5000, 0x06}, -+ {0x5003, 0x08}, -+ {0x5a00, 0x08}, -+ {0x3000, 0xff}, -+ {0x3001, 0xff}, -+ {0x3002, 0xff}, -+ {0x301d, 0xf0}, -+ {0x3a18, 0x00}, -+ {0x3a19, 0xf8}, -+ {0x3c01, 0x80}, -+ {0x3b07, 0x0c}, -+ {0x380c, 0x07}, -+ {0x380d, 0x3c}, -+ {0x380e, 0x01}, -+ {0x380f, 0xf8}, -+ {0x3814, 0x35}, -+ {0x3815, 0x35}, -+ {0x3708, 0x64}, -+ {0x3709, 0x52}, -+ {0x3808, 0x02}, -+ {0x3809, 0x80}, -+ {0x380a, 0x01}, -+ {0x380b, 0xe0}, -+ {0x3800, 0x00}, -+ {0x3801, 0x10}, -+ {0x3802, 0x00}, -+ {0x3803, 0x00}, -+ {0x3804, 0x0a}, -+ {0x3805, 0x2f}, -+ {0x3806, 0x07}, -+ {0x3807, 0x9f}, -+ {0x3630, 0x2e}, -+ {0x3632, 0xe2}, -+ {0x3633, 0x23}, -+ {0x3634, 0x44}, -+ {0x3620, 0x64}, -+ {0x3621, 0xe0}, -+ {0x3600, 0x37}, -+ {0x3704, 0xa0}, -+ {0x3703, 0x5a}, -+ {0x3715, 0x78}, -+ {0x3717, 0x01}, -+ {0x3731, 0x02}, -+ {0x370b, 0x60}, -+ {0x3705, 0x1a}, -+ {0x3f05, 0x02}, -+ {0x3f06, 0x10}, -+ {0x3f01, 0x0a}, -+ {0x3a08, 0x01}, -+ {0x3a09, 0x2e}, -+ {0x3a0a, 0x00}, -+ {0x3a0b, 0xfb}, -+ {0x3a0d, 0x02}, -+ {0x3a0e, 0x01}, -+ {0x3a0f, 0x58}, -+ {0x3a10, 0x50}, -+ {0x3a1b, 0x58}, -+ {0x3a1e, 0x50}, -+ {0x3a11, 0x60}, -+ {0x3a1f, 0x28}, -+ {0x4001, 0x02}, -+ {0x4004, 0x02}, -+ {0x4000, 0x09}, -+ {0x3000, 0x00}, -+ {0x3001, 0x00}, -+ {0x3002, 0x00}, -+ {0x3017, 0xe0}, -+ {0x301c, 0xfc}, -+ {0x3636, 0x06}, -+ {0x3016, 0x08}, -+ {0x3827, 0xec}, -+ {0x3018, 0x44}, -+ {0x3035, 0x21}, -+ {0x3106, 0xf5}, -+ {0x3034, 0x1a}, -+ {0x301c, 0xf8}, -+ {0x4800, 0x34}, -+ {0x3503, 0x03}, -+ {0x0100, 0x01}, -+}; -+ - static struct ov5647_mode supported_modes_8bit[] = { - /* -- * Original 8-bit VGA mode -+ * MODE 0: Original 8-bit VGA mode. - * Uncentred crop (top left quarter) from 2x2 binned 1296x972 image. - */ - { -@@ -233,14 +603,70 @@ static struct ov5647_mode supported_mode - .width = 640, - .height = 480 - }, -- ov5647_640x480, -- ARRAY_SIZE(ov5647_640x480) -+ ov5647_640x480_8bit, -+ ARRAY_SIZE(ov5647_640x480_8bit) - }, -- /* more modes below here... */ - }; - - static struct ov5647_mode supported_modes_10bit[] = { -- /* no 10-bit modes yet */ -+ /* -+ * MODE 0: 2592x1944 full resolution full FOV 10-bit mode. -+ */ -+ { -+ { -+ .code = MEDIA_BUS_FMT_SBGGR10_1X10, -+ .colorspace = V4L2_COLORSPACE_SRGB, -+ .field = V4L2_FIELD_NONE, -+ .width = 2592, -+ .height = 1944 -+ }, -+ ov5647_2592x1944_10bit, -+ ARRAY_SIZE(ov5647_2592x1944_10bit) -+ }, -+ /* -+ * MODE 1: 1080p30 10-bit mode. -+ * Full resolution centre-cropped down to 1080p. -+ */ -+ { -+ { -+ .code = MEDIA_BUS_FMT_SBGGR10_1X10, -+ .colorspace = V4L2_COLORSPACE_SRGB, -+ .field = V4L2_FIELD_NONE, -+ .width = 1920, -+ .height = 1080 -+ }, -+ ov5647_1080p30_10bit, -+ ARRAY_SIZE(ov5647_1080p30_10bit) -+ }, -+ /* -+ * MODE 2: 2x2 binned full FOV 10-bit mode. -+ */ -+ { -+ { -+ .code = MEDIA_BUS_FMT_SBGGR10_1X10, -+ .colorspace = V4L2_COLORSPACE_SRGB, -+ .field = V4L2_FIELD_NONE, -+ .width = 1296, -+ .height = 972 -+ }, -+ ov5647_2x2binned_10bit, -+ ARRAY_SIZE(ov5647_2x2binned_10bit) -+ }, -+ /* -+ * MODE 3: 10-bit VGA full FOV mode 60fps. -+ * 2x2 binned and subsampled down to VGA. -+ */ -+ { -+ { -+ .code = MEDIA_BUS_FMT_SBGGR10_1X10, -+ .colorspace = V4L2_COLORSPACE_SRGB, -+ .field = V4L2_FIELD_NONE, -+ .width = 640, -+ .height = 480 -+ }, -+ ov5647_640x480_10bit, -+ ARRAY_SIZE(ov5647_640x480_10bit) -+ }, - }; - - /* Use original 8-bit VGA mode as default. */ -@@ -343,11 +769,14 @@ static int __sensor_init(struct v4l2_sub - if (ret < 0) - return ret; - -- ret = ov5647_write_array(sd, state->mode->reg_list, -- state->mode->num_regs); -- if (ret < 0) { -- dev_err(&client->dev, "write sensor default regs error\n"); -- return ret; -+ if (state->write_mode_regs) { -+ ret = ov5647_write_array(sd, state->mode->reg_list, -+ state->mode->num_regs); -+ if (ret < 0) { -+ dev_err(&client->dev, "write sensor default regs error\n"); -+ return ret; -+ } -+ state->write_mode_regs = false; - } - - ret = ov5647_set_virtual_channel(sd, 0); -@@ -475,6 +904,9 @@ static int ov5647_sensor_power(struct v4 - "Camera not available, check Power\n"); - goto out; - } -+ -+ /* Write out the register set over I2C on stream-on. */ -+ ov5647->write_mode_regs = true; - } else if (!on && ov5647->power_count == 1) { - dev_dbg(&client->dev, "OV5647 power off\n"); - -@@ -650,6 +1082,12 @@ static int ov5647_set_fmt(struct v4l2_su - framefmt = v4l2_subdev_get_try_format(sd, cfg, format->pad); - *framefmt = format->format; - } else { -+ /* -+ * If we have changed modes, write the I2C register list on -+ * a stream_on(). -+ */ -+ if (state->mode != mode) -+ state->write_mode_regs = true; - state->mode = mode; - } - -@@ -967,6 +1405,9 @@ static int ov5647_probe(struct i2c_clien - /* Set the default mode before we init the subdev */ - sensor->mode = OV5647_DEFAULT_MODE; - -+ /* Write out the register set over I2C on stream-on. */ -+ sensor->write_mode_regs = true; -+ - sd = &sensor->sd; - v4l2_i2c_subdev_init(sd, client, &ov5647_subdev_ops); - sensor->sd.internal_ops = &ov5647_subdev_internal_ops; diff --git a/target/linux/bcm27xx/patches-5.10/950-0229-media-ov5647-change-defaults-to-better-match-raw-cam.patch b/target/linux/bcm27xx/patches-5.10/950-0229-media-ov5647-change-defaults-to-better-match-raw-cam.patch deleted file mode 100644 index 43053890d3..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0229-media-ov5647-change-defaults-to-better-match-raw-cam.patch +++ /dev/null @@ -1,59 +0,0 @@ -From aab5d5842d718544ef906dc8cc5c221e6121160f Mon Sep 17 00:00:00 2001 -From: David Plowman -Date: Wed, 29 Jan 2020 15:31:32 +0000 -Subject: [PATCH] media: ov5647: change defaults to better match raw - camera applications. - -Specifically: - -* AWB is now off by default. - -* AEC/AGC is also off by default. - -* The default mode is changed to the 10-bit 2x2 binned mode. - -AWB and AEC/AGC can be re-enabled using the usual V4L2 controls. The -original 8-bit mode will be respected if an application requests the -8-bit format. - -Signed-off-by: David Plowman -Signed-off-by: Naushir Patuck ---- - drivers/media/i2c/ov5647.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -669,8 +669,8 @@ static struct ov5647_mode supported_mode - }, - }; - --/* Use original 8-bit VGA mode as default. */ --#define OV5647_DEFAULT_MODE (&supported_modes_8bit[0]) -+/* Use 2x2 binned 10-bit mode as default. */ -+#define OV5647_DEFAULT_MODE (&supported_modes_10bit[2]) - - static int ov5647_write(struct v4l2_subdev *sd, u16 reg, u8 val) - { -@@ -1367,18 +1367,18 @@ static int ov5647_probe(struct i2c_clien - 0, /* min */ - 1, /* max */ - 1, /* step */ -- 1); /* default */ -+ 0); /* default */ - v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, - V4L2_CID_AUTO_WHITE_BALANCE, - 0, /* min */ - 1, /* max */ - 1, /* step */ -- 1); /* default */ -+ 0); /* default */ - v4l2_ctrl_new_std_menu(&sensor->ctrls, &ov5647_ctrl_ops, - V4L2_CID_EXPOSURE_AUTO, - V4L2_EXPOSURE_MANUAL, /* max */ - 0, /* skip_mask */ -- V4L2_EXPOSURE_AUTO); /* default */ -+ V4L2_EXPOSURE_MANUAL); /* default */ - ctrl = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, - V4L2_CID_EXPOSURE, - 4, /* min lines */ diff --git a/target/linux/bcm27xx/patches-5.10/950-0230-media-i2c-ov5647-Add-support-for-g_selection-to-refl.patch b/target/linux/bcm27xx/patches-5.10/950-0230-media-i2c-ov5647-Add-support-for-g_selection-to-refl.patch deleted file mode 100644 index 3b3bba282c..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0230-media-i2c-ov5647-Add-support-for-g_selection-to-refl.patch +++ /dev/null @@ -1,206 +0,0 @@ -From 450dc10dd858314fcb5e18942b6e5260e3478f10 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 29 Apr 2020 11:46:07 +0100 -Subject: [PATCH] media: i2c: ov5647: Add support for g_selection to - reflect cropping/binning - -In order to apply lens shading correctly the client needs to know how -each mode crops or scales the image compared to the full sensor array. -Implement this (based on the imx219 equivalent). - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/ov5647.c | 119 ++++++++++++++++++++++++++++++------- - 1 file changed, 96 insertions(+), 23 deletions(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -70,25 +70,14 @@ - #define VAL_TERM 0xfe - #define REG_DLY 0xffff - --#define OV5647_ROW_START 0x01 --#define OV5647_ROW_START_MIN 0 --#define OV5647_ROW_START_MAX 2004 --#define OV5647_ROW_START_DEF 54 -- --#define OV5647_COLUMN_START 0x02 --#define OV5647_COLUMN_START_MIN 0 --#define OV5647_COLUMN_START_MAX 2750 --#define OV5647_COLUMN_START_DEF 16 -- --#define OV5647_WINDOW_HEIGHT 0x03 --#define OV5647_WINDOW_HEIGHT_MIN 2 --#define OV5647_WINDOW_HEIGHT_MAX 2006 --#define OV5647_WINDOW_HEIGHT_DEF 1944 -- --#define OV5647_WINDOW_WIDTH 0x04 --#define OV5647_WINDOW_WIDTH_MIN 2 --#define OV5647_WINDOW_WIDTH_MAX 2752 --#define OV5647_WINDOW_WIDTH_DEF 2592 -+/* OV5647 native and active pixel array size */ -+#define OV5647_NATIVE_WIDTH 2624U -+#define OV5647_NATIVE_HEIGHT 1956U -+ -+#define OV5647_PIXEL_ARRAY_LEFT 16U -+#define OV5647_PIXEL_ARRAY_TOP 16U -+#define OV5647_PIXEL_ARRAY_WIDTH 2592U -+#define OV5647_PIXEL_ARRAY_HEIGHT 1944U - - struct regval_list { - u16 addr; -@@ -97,6 +86,9 @@ struct regval_list { - - struct ov5647_mode { - struct v4l2_mbus_framefmt format; -+ /* Analog crop rectangle. */ -+ struct v4l2_rect crop; -+ - struct regval_list *reg_list; - unsigned int num_regs; - }; -@@ -603,6 +595,12 @@ static struct ov5647_mode supported_mode - .width = 640, - .height = 480 - }, -+ .crop = { -+ .left = 0, -+ .top = 0, -+ .width = 1280, -+ .height = 960, -+ }, - ov5647_640x480_8bit, - ARRAY_SIZE(ov5647_640x480_8bit) - }, -@@ -620,6 +618,12 @@ static struct ov5647_mode supported_mode - .width = 2592, - .height = 1944 - }, -+ .crop = { -+ .left = 0, -+ .top = 0, -+ .width = 2592, -+ .height = 1944 -+ }, - ov5647_2592x1944_10bit, - ARRAY_SIZE(ov5647_2592x1944_10bit) - }, -@@ -635,6 +639,12 @@ static struct ov5647_mode supported_mode - .width = 1920, - .height = 1080 - }, -+ .crop = { -+ .left = 348, -+ .top = 434, -+ .width = 1928, -+ .height = 1080, -+ }, - ov5647_1080p30_10bit, - ARRAY_SIZE(ov5647_1080p30_10bit) - }, -@@ -649,6 +659,12 @@ static struct ov5647_mode supported_mode - .width = 1296, - .height = 972 - }, -+ .crop = { -+ .left = 0, -+ .top = 0, -+ .width = 2592, -+ .height = 1944, -+ }, - ov5647_2x2binned_10bit, - ARRAY_SIZE(ov5647_2x2binned_10bit) - }, -@@ -664,6 +680,12 @@ static struct ov5647_mode supported_mode - .width = 640, - .height = 480 - }, -+ .crop = { -+ .left = 16, -+ .top = 0, -+ .width = 2560, -+ .height = 1920, -+ }, - ov5647_640x480_10bit, - ARRAY_SIZE(ov5647_640x480_10bit) - }, -@@ -971,6 +993,56 @@ static const struct v4l2_subdev_core_ops - #endif - }; - -+static const struct v4l2_rect * -+__ov5647_get_pad_crop(struct ov5647 *ov5647, struct v4l2_subdev_pad_config *cfg, -+ unsigned int pad, enum v4l2_subdev_format_whence which) -+{ -+ switch (which) { -+ case V4L2_SUBDEV_FORMAT_TRY: -+ return v4l2_subdev_get_try_crop(&ov5647->sd, cfg, pad); -+ case V4L2_SUBDEV_FORMAT_ACTIVE: -+ return &ov5647->mode->crop; -+ } -+ -+ return NULL; -+} -+ -+static int ov5647_get_selection(struct v4l2_subdev *sd, -+ struct v4l2_subdev_pad_config *cfg, -+ struct v4l2_subdev_selection *sel) -+{ -+ switch (sel->target) { -+ case V4L2_SEL_TGT_CROP: { -+ struct ov5647 *state = to_state(sd); -+ -+ mutex_lock(&state->lock); -+ sel->r = *__ov5647_get_pad_crop(state, cfg, sel->pad, -+ sel->which); -+ mutex_unlock(&state->lock); -+ -+ return 0; -+ } -+ -+ case V4L2_SEL_TGT_NATIVE_SIZE: -+ sel->r.top = 0; -+ sel->r.left = 0; -+ sel->r.width = OV5647_NATIVE_WIDTH; -+ sel->r.height = OV5647_NATIVE_HEIGHT; -+ -+ return 0; -+ -+ case V4L2_SEL_TGT_CROP_DEFAULT: -+ sel->r.top = OV5647_PIXEL_ARRAY_TOP; -+ sel->r.left = OV5647_PIXEL_ARRAY_LEFT; -+ sel->r.width = OV5647_PIXEL_ARRAY_WIDTH; -+ sel->r.height = OV5647_PIXEL_ARRAY_HEIGHT; -+ -+ return 0; -+ } -+ -+ return -EINVAL; -+} -+ - static int ov5647_s_stream(struct v4l2_subdev *sd, int enable) - { - struct ov5647 *state = to_state(sd); -@@ -1122,6 +1194,7 @@ static const struct v4l2_subdev_pad_ops - .enum_mbus_code = ov5647_enum_mbus_code, - .set_fmt = ov5647_set_fmt, - .get_fmt = ov5647_get_fmt, -+ .get_selection = ov5647_get_selection, - .enum_frame_size = ov5647_enum_frame_size, - }; - -@@ -1170,10 +1243,10 @@ static int ov5647_open(struct v4l2_subde - v4l2_subdev_get_try_crop(sd, fh->pad, 0); - struct ov5647 *state = to_state(sd); - -- crop->left = OV5647_COLUMN_START_DEF; -- crop->top = OV5647_ROW_START_DEF; -- crop->width = OV5647_WINDOW_WIDTH_DEF; -- crop->height = OV5647_WINDOW_HEIGHT_DEF; -+ crop->left = OV5647_PIXEL_ARRAY_LEFT; -+ crop->top = OV5647_PIXEL_ARRAY_TOP; -+ crop->width = OV5647_PIXEL_ARRAY_WIDTH; -+ crop->height = OV5647_PIXEL_ARRAY_HEIGHT; - - /* Set the default format to the same as the sensor. */ - *format = state->mode->format; diff --git a/target/linux/bcm27xx/patches-5.10/950-0231-media-i2c-ov5467-Fixup-error-path-to-release-mutex.patch b/target/linux/bcm27xx/patches-5.10/950-0231-media-i2c-ov5467-Fixup-error-path-to-release-mutex.patch deleted file mode 100644 index 2547aac869..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0231-media-i2c-ov5467-Fixup-error-path-to-release-mutex.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 5c462e56efdb4de0e3b785082d8adae675ccaefd Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 29 Apr 2020 11:50:52 +0100 -Subject: [PATCH] media: i2c: ov5467: Fixup error path to release mutex - -"87f3ab9 media: ov5647: Add basic support for multiple sensor modes." -added a return path ov5647_set_fmt that didn't release the device -mutex that it had claimed. -Release the mutex. - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/ov5647.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -1146,8 +1146,10 @@ static int ov5647_set_fmt(struct v4l2_su - else - mode = mode_8bit; - -- if (!mode) -+ if (!mode) { -+ mutex_unlock(&state->lock); - return -EINVAL; -+ } - - *fmt = mode->format; - if (format->which == V4L2_SUBDEV_FORMAT_TRY) { diff --git a/target/linux/bcm27xx/patches-5.10/950-0232-media-i2c-ov5647-Support-V4L2_CID_PIXEL_RATE.patch b/target/linux/bcm27xx/patches-5.10/950-0232-media-i2c-ov5647-Support-V4L2_CID_PIXEL_RATE.patch deleted file mode 100644 index 78054d937f..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0232-media-i2c-ov5647-Support-V4L2_CID_PIXEL_RATE.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 5cb8892104a869adaf76d40629b5a0230d32edd0 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 29 Apr 2020 12:25:13 +0100 -Subject: [PATCH] media: i2c: ov5647: Support V4L2_CID_PIXEL_RATE - -Clients need to know the pixel rate in order to compute exposure -and frame rate values. -Advertise it. - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/ov5647.c | 31 +++++++++++++++++++++++++++---- - 1 file changed, 27 insertions(+), 4 deletions(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -89,6 +89,8 @@ struct ov5647_mode { - /* Analog crop rectangle. */ - struct v4l2_rect crop; - -+ u64 pixel_rate; -+ - struct regval_list *reg_list; - unsigned int num_regs; - }; -@@ -103,6 +105,7 @@ struct ov5647 { - struct gpio_desc *pwdn; - unsigned int flags; - struct v4l2_ctrl_handler ctrls; -+ struct v4l2_ctrl *pixel_rate; - bool write_mode_regs; - }; - -@@ -601,6 +604,7 @@ static struct ov5647_mode supported_mode - .width = 1280, - .height = 960, - }, -+ .pixel_rate = 77291670, - ov5647_640x480_8bit, - ARRAY_SIZE(ov5647_640x480_8bit) - }, -@@ -624,6 +628,7 @@ static struct ov5647_mode supported_mode - .width = 2592, - .height = 1944 - }, -+ .pixel_rate = 87500000, - ov5647_2592x1944_10bit, - ARRAY_SIZE(ov5647_2592x1944_10bit) - }, -@@ -645,6 +650,7 @@ static struct ov5647_mode supported_mode - .width = 1928, - .height = 1080, - }, -+ .pixel_rate = 81666700, - ov5647_1080p30_10bit, - ARRAY_SIZE(ov5647_1080p30_10bit) - }, -@@ -665,6 +671,7 @@ static struct ov5647_mode supported_mode - .width = 2592, - .height = 1944, - }, -+ .pixel_rate = 81666700, - ov5647_2x2binned_10bit, - ARRAY_SIZE(ov5647_2x2binned_10bit) - }, -@@ -686,6 +693,7 @@ static struct ov5647_mode supported_mode - .width = 2560, - .height = 1920, - }, -+ .pixel_rate = 55000000, - ov5647_640x480_10bit, - ARRAY_SIZE(ov5647_640x480_10bit) - }, -@@ -1163,6 +1171,11 @@ static int ov5647_set_fmt(struct v4l2_su - if (state->mode != mode) - state->write_mode_regs = true; - state->mode = mode; -+ -+ __v4l2_ctrl_modify_range(state->pixel_rate, -+ mode->pixel_rate, -+ mode->pixel_rate, 1, -+ mode->pixel_rate); - } - - mutex_unlock(&state->lock); -@@ -1379,6 +1392,9 @@ static int ov5647_s_ctrl(struct v4l2_ctr - case V4L2_CID_EXPOSURE: - ret = ov5647_s_exposure(sd, ctrl->val); - break; -+ case V4L2_CID_PIXEL_RATE: -+ /* Read-only, but we adjust it based on mode. */ -+ break; - default: - dev_info(&client->dev, - "ctrl(id:0x%x,val:0x%x) is not handled\n", -@@ -1436,7 +1452,7 @@ static int ov5647_probe(struct i2c_clien - mutex_init(&sensor->lock); - - /* Initialise controls. */ -- v4l2_ctrl_handler_init(&sensor->ctrls, 3); -+ v4l2_ctrl_handler_init(&sensor->ctrls, 6); - v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, - V4L2_CID_AUTOGAIN, - 0, /* min */ -@@ -1469,6 +1485,16 @@ static int ov5647_probe(struct i2c_clien - 32); /* default, 32 = 2.0x */ - ctrl->flags |= V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; - -+ /* Set the default mode before we init the subdev */ -+ sensor->mode = OV5647_DEFAULT_MODE; -+ -+ /* By default, PIXEL_RATE is read only, but it does change per mode */ -+ sensor->pixel_rate = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -+ V4L2_CID_PIXEL_RATE, -+ sensor->mode->pixel_rate, -+ sensor->mode->pixel_rate, 1, -+ sensor->mode->pixel_rate); -+ - if (sensor->ctrls.error) { - ret = sensor->ctrls.error; - dev_err(&client->dev, "%s control init failed (%d)\n", -@@ -1477,9 +1503,6 @@ static int ov5647_probe(struct i2c_clien - } - sensor->sd.ctrl_handler = &sensor->ctrls; - -- /* Set the default mode before we init the subdev */ -- sensor->mode = OV5647_DEFAULT_MODE; -- - /* Write out the register set over I2C on stream-on. */ - sensor->write_mode_regs = true; - diff --git a/target/linux/bcm27xx/patches-5.10/950-0233-media-i2c-ov5647-Set-V4L2_SUBDEV_FL_HAS_EVENTS-flag.patch b/target/linux/bcm27xx/patches-5.10/950-0233-media-i2c-ov5647-Set-V4L2_SUBDEV_FL_HAS_EVENTS-flag.patch deleted file mode 100644 index 1f7710e382..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0233-media-i2c-ov5647-Set-V4L2_SUBDEV_FL_HAS_EVENTS-flag.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 29e3826878f43cd88414824be055cf5fcd57ab23 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 29 Apr 2020 17:25:56 +0100 -Subject: [PATCH] media: i2c: ov5647: Set V4L2_SUBDEV_FL_HAS_EVENTS - flag - -The ov5647 subdev can generate control events, therefore set -the V4L2_SUBDEV_FL_HAS_EVENTS flag. - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/ov5647.c | 29 +++++++++++++++++++++++++++-- - 1 file changed, 27 insertions(+), 2 deletions(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -90,6 +90,8 @@ struct ov5647_mode { - struct v4l2_rect crop; - - u64 pixel_rate; -+ /* HTS as defined in the register set (0x380C/0x380D) */ -+ int hts; - - struct regval_list *reg_list; - unsigned int num_regs; -@@ -106,6 +108,7 @@ struct ov5647 { - unsigned int flags; - struct v4l2_ctrl_handler ctrls; - struct v4l2_ctrl *pixel_rate; -+ struct v4l2_ctrl *hblank; - bool write_mode_regs; - }; - -@@ -605,6 +608,7 @@ static struct ov5647_mode supported_mode - .height = 960, - }, - .pixel_rate = 77291670, -+ .hts = 1896, - ov5647_640x480_8bit, - ARRAY_SIZE(ov5647_640x480_8bit) - }, -@@ -629,6 +633,7 @@ static struct ov5647_mode supported_mode - .height = 1944 - }, - .pixel_rate = 87500000, -+ .hts = 2844, - ov5647_2592x1944_10bit, - ARRAY_SIZE(ov5647_2592x1944_10bit) - }, -@@ -651,6 +656,7 @@ static struct ov5647_mode supported_mode - .height = 1080, - }, - .pixel_rate = 81666700, -+ .hts = 2416, - ov5647_1080p30_10bit, - ARRAY_SIZE(ov5647_1080p30_10bit) - }, -@@ -672,6 +678,7 @@ static struct ov5647_mode supported_mode - .height = 1944, - }, - .pixel_rate = 81666700, -+ .hts = 1896, - ov5647_2x2binned_10bit, - ARRAY_SIZE(ov5647_2x2binned_10bit) - }, -@@ -694,6 +701,7 @@ static struct ov5647_mode supported_mode - .height = 1920, - }, - .pixel_rate = 55000000, -+ .hts = 1852, - ov5647_640x480_10bit, - ARRAY_SIZE(ov5647_640x480_10bit) - }, -@@ -1168,6 +1176,8 @@ static int ov5647_set_fmt(struct v4l2_su - * If we have changed modes, write the I2C register list on - * a stream_on(). - */ -+ int hblank; -+ - if (state->mode != mode) - state->write_mode_regs = true; - state->mode = mode; -@@ -1176,6 +1186,9 @@ static int ov5647_set_fmt(struct v4l2_su - mode->pixel_rate, - mode->pixel_rate, 1, - mode->pixel_rate); -+ hblank = mode->hts - mode->format.width; -+ __v4l2_ctrl_modify_range(state->hblank, hblank, hblank, 1, -+ hblank); - } - - mutex_unlock(&state->lock); -@@ -1395,6 +1408,9 @@ static int ov5647_s_ctrl(struct v4l2_ctr - case V4L2_CID_PIXEL_RATE: - /* Read-only, but we adjust it based on mode. */ - break; -+ case V4L2_CID_HBLANK: -+ /* Read-only, but we adjust it based on mode. */ -+ break; - default: - dev_info(&client->dev, - "ctrl(id:0x%x,val:0x%x) is not handled\n", -@@ -1419,6 +1435,7 @@ static int ov5647_probe(struct i2c_clien - struct device_node *np = client->dev.of_node; - u32 xclk_freq; - struct v4l2_ctrl *ctrl; -+ int hblank; - - sensor = devm_kzalloc(dev, sizeof(*sensor), GFP_KERNEL); - if (!sensor) -@@ -1452,7 +1469,7 @@ static int ov5647_probe(struct i2c_clien - mutex_init(&sensor->lock); - - /* Initialise controls. */ -- v4l2_ctrl_handler_init(&sensor->ctrls, 6); -+ v4l2_ctrl_handler_init(&sensor->ctrls, 7); - v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, - V4L2_CID_AUTOGAIN, - 0, /* min */ -@@ -1495,6 +1512,13 @@ static int ov5647_probe(struct i2c_clien - sensor->mode->pixel_rate, 1, - sensor->mode->pixel_rate); - -+ /* By default, HBLANK is read only, but it does change per mode */ -+ hblank = sensor->mode->hts - sensor->mode->format.width; -+ sensor->hblank = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -+ V4L2_CID_HBLANK, hblank, hblank, 1, -+ hblank); -+ sensor->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; -+ - if (sensor->ctrls.error) { - ret = sensor->ctrls.error; - dev_err(&client->dev, "%s control init failed (%d)\n", -@@ -1509,7 +1533,8 @@ static int ov5647_probe(struct i2c_clien - sd = &sensor->sd; - v4l2_i2c_subdev_init(sd, client, &ov5647_subdev_ops); - sensor->sd.internal_ops = &ov5647_subdev_internal_ops; -- sensor->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; -+ sensor->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | -+ V4L2_SUBDEV_FL_HAS_EVENTS; - - sensor->pad.flags = MEDIA_PAD_FL_SOURCE; - sd->entity.function = MEDIA_ENT_F_CAM_SENSOR; diff --git a/target/linux/bcm27xx/patches-5.10/950-0234-media-i2c-ov5647-Add-support-for-V4L2_CID_VBLANK.patch b/target/linux/bcm27xx/patches-5.10/950-0234-media-i2c-ov5647-Add-support-for-V4L2_CID_VBLANK.patch deleted file mode 100644 index 53a6dad006..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0234-media-i2c-ov5647-Add-support-for-V4L2_CID_VBLANK.patch +++ /dev/null @@ -1,205 +0,0 @@ -From 95a10a4709eea202f3ce833fdeb9b30c17d80148 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 29 Apr 2020 21:39:58 +0100 -Subject: [PATCH] media: i2c: ov5647: Add support for V4L2_CID_VBLANK - -Adds vblank control to allow for frame rate control. - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/ov5647.c | 65 ++++++++++++++++++++++++++++++++------ - 1 file changed, 55 insertions(+), 10 deletions(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -61,6 +61,8 @@ - #define OV5647_REG_AEC_AGC 0x3503 - #define OV5647_REG_GAIN_HI 0x350A - #define OV5647_REG_GAIN_LO 0x350B -+#define OV5647_REG_VTS_HI 0x380e -+#define OV5647_REG_VTS_LO 0x380f - #define OV5647_REG_FRAME_OFF_NUMBER 0x4202 - #define OV5647_REG_MIPI_CTRL00 0x4800 - #define OV5647_REG_MIPI_CTRL14 0x4814 -@@ -79,6 +81,9 @@ - #define OV5647_PIXEL_ARRAY_WIDTH 2592U - #define OV5647_PIXEL_ARRAY_HEIGHT 1944U - -+#define OV5647_VBLANK_MIN 4 -+#define OV5647_VTS_MAX 32767 -+ - struct regval_list { - u16 addr; - u8 data; -@@ -92,6 +97,8 @@ struct ov5647_mode { - u64 pixel_rate; - /* HTS as defined in the register set (0x380C/0x380D) */ - int hts; -+ /* Default VTS value for this mode */ -+ int vts_def; - - struct regval_list *reg_list; - unsigned int num_regs; -@@ -109,6 +116,7 @@ struct ov5647 { - struct v4l2_ctrl_handler ctrls; - struct v4l2_ctrl *pixel_rate; - struct v4l2_ctrl *hblank; -+ struct v4l2_ctrl *vblank; - bool write_mode_regs; - }; - -@@ -161,8 +169,6 @@ static struct regval_list ov5647_640x480 - {0x3b07, 0x0c}, - {0x380c, 0x07}, - {0x380d, 0x68}, -- {0x380e, 0x03}, -- {0x380f, 0xd8}, - {0x3814, 0x31}, - {0x3815, 0x31}, - {0x3708, 0x64}, -@@ -251,8 +257,6 @@ static struct regval_list ov5647_2592x19 - {0x3b07, 0x0c}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, -- {0x380e, 0x07}, -- {0x380f, 0xb0}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3708, 0x64}, -@@ -342,8 +346,6 @@ static struct regval_list ov5647_1080p30 - {0x3b07, 0x0c}, - {0x380c, 0x09}, - {0x380d, 0x70}, -- {0x380e, 0x04}, -- {0x380f, 0x50}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3708, 0x64}, -@@ -485,8 +487,6 @@ static struct regval_list ov5647_2x2binn - {0x3503, 0x03}, - {0x3820, 0x41}, - {0x3821, 0x07}, -- {0x380E, 0x05}, -- {0x380F, 0x9B}, - {0x350A, 0x00}, - {0x350B, 0x10}, - {0x3500, 0x00}, -@@ -520,8 +520,6 @@ static struct regval_list ov5647_640x480 - {0x3b07, 0x0c}, - {0x380c, 0x07}, - {0x380d, 0x3c}, -- {0x380e, 0x01}, -- {0x380f, 0xf8}, - {0x3814, 0x35}, - {0x3815, 0x35}, - {0x3708, 0x64}, -@@ -609,6 +607,7 @@ static struct ov5647_mode supported_mode - }, - .pixel_rate = 77291670, - .hts = 1896, -+ .vts_def = 0x3d8, - ov5647_640x480_8bit, - ARRAY_SIZE(ov5647_640x480_8bit) - }, -@@ -634,6 +633,7 @@ static struct ov5647_mode supported_mode - }, - .pixel_rate = 87500000, - .hts = 2844, -+ .vts_def = 0x7b0, - ov5647_2592x1944_10bit, - ARRAY_SIZE(ov5647_2592x1944_10bit) - }, -@@ -657,6 +657,7 @@ static struct ov5647_mode supported_mode - }, - .pixel_rate = 81666700, - .hts = 2416, -+ .vts_def = 0x450, - ov5647_1080p30_10bit, - ARRAY_SIZE(ov5647_1080p30_10bit) - }, -@@ -679,6 +680,7 @@ static struct ov5647_mode supported_mode - }, - .pixel_rate = 81666700, - .hts = 1896, -+ .vts_def = 0x59b, - ov5647_2x2binned_10bit, - ARRAY_SIZE(ov5647_2x2binned_10bit) - }, -@@ -702,6 +704,7 @@ static struct ov5647_mode supported_mode - }, - .pixel_rate = 55000000, - .hts = 1852, -+ .vts_def = 0x1f8, - ov5647_640x480_10bit, - ARRAY_SIZE(ov5647_640x480_10bit) - }, -@@ -710,6 +713,29 @@ static struct ov5647_mode supported_mode - /* Use 2x2 binned 10-bit mode as default. */ - #define OV5647_DEFAULT_MODE (&supported_modes_10bit[2]) - -+static int ov5647_write16(struct v4l2_subdev *sd, u16 reg, u16 val) -+{ -+ int ret; -+ unsigned char data[4] = { reg >> 8, reg & 0xff, val >> 8, val & 0xff}; -+ struct i2c_client *client = v4l2_get_subdevdata(sd); -+ -+ ret = i2c_master_send(client, data, 4); -+ /* -+ * Writing the wrong number of bytes also needs to be flagged as an -+ * error. Success needs to produce a 0 return code. -+ */ -+ if (ret == 4) { -+ ret = 0; -+ } else { -+ dev_dbg(&client->dev, "%s: i2c write error, reg: %x\n", -+ __func__, reg); -+ if (ret >= 0) -+ ret = -EINVAL; -+ } -+ -+ return ret; -+} -+ - static int ov5647_write(struct v4l2_subdev *sd, u16 reg, u8 val) - { - int ret; -@@ -1189,6 +1215,14 @@ static int ov5647_set_fmt(struct v4l2_su - hblank = mode->hts - mode->format.width; - __v4l2_ctrl_modify_range(state->hblank, hblank, hblank, 1, - hblank); -+ -+ __v4l2_ctrl_modify_range(state->vblank, -+ OV5647_VBLANK_MIN, -+ OV5647_VTS_MAX - mode->format.height, -+ 1, -+ mode->vts_def - mode->format.height); -+ __v4l2_ctrl_s_ctrl(state->vblank, -+ mode->vts_def - mode->format.height); - } - - mutex_unlock(&state->lock); -@@ -1411,6 +1445,10 @@ static int ov5647_s_ctrl(struct v4l2_ctr - case V4L2_CID_HBLANK: - /* Read-only, but we adjust it based on mode. */ - break; -+ case V4L2_CID_VBLANK: -+ ret = ov5647_write16(sd, OV5647_REG_VTS_HI, -+ state->mode->format.height + ctrl->val); -+ break; - default: - dev_info(&client->dev, - "ctrl(id:0x%x,val:0x%x) is not handled\n", -@@ -1519,6 +1557,13 @@ static int ov5647_probe(struct i2c_clien - hblank); - sensor->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; - -+ sensor->vblank = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -+ V4L2_CID_VBLANK, OV5647_VBLANK_MIN, -+ OV5647_VTS_MAX - -+ sensor->mode->format.height, 1, -+ sensor->mode->vts_def - -+ sensor->mode->format.height); -+ - if (sensor->ctrls.error) { - ret = sensor->ctrls.error; - dev_err(&client->dev, "%s control init failed (%d)\n", diff --git a/target/linux/bcm27xx/patches-5.10/950-0235-media-i2c-ov5647-Neither-analogue-gain-nor-exposure-.patch b/target/linux/bcm27xx/patches-5.10/950-0235-media-i2c-ov5647-Neither-analogue-gain-nor-exposure-.patch deleted file mode 100644 index b1505e7d06..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0235-media-i2c-ov5647-Neither-analogue-gain-nor-exposure-.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 05a1c88d9b8dd344edfce3eaa00a3cac866cf3ad Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 29 Apr 2020 21:47:25 +0100 -Subject: [PATCH] media: i2c: ov5647: Neither analogue gain nor - exposure need EXECUTE_ON_WRITE - -The controls for analogue gain and exposure were defined with -V4L2_CTRL_FLAG_EXECUTE_ON_WRITE. This is not required as we only need -to send changes to the sensor. - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/ov5647.c | 27 ++++++++++++--------------- - 1 file changed, 12 insertions(+), 15 deletions(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -1472,7 +1472,6 @@ static int ov5647_probe(struct i2c_clien - struct v4l2_subdev *sd; - struct device_node *np = client->dev.of_node; - u32 xclk_freq; -- struct v4l2_ctrl *ctrl; - int hblank; - - sensor = devm_kzalloc(dev, sizeof(*sensor), GFP_KERNEL); -@@ -1525,20 +1524,18 @@ static int ov5647_probe(struct i2c_clien - V4L2_EXPOSURE_MANUAL, /* max */ - 0, /* skip_mask */ - V4L2_EXPOSURE_MANUAL); /* default */ -- ctrl = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -- V4L2_CID_EXPOSURE, -- 4, /* min lines */ -- 65535, /* max lines (4+8+4 bits)*/ -- 1, /* step */ -- 1000); /* default number of lines */ -- ctrl->flags |= V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; -- ctrl = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -- V4L2_CID_ANALOGUE_GAIN, -- 16, /* min, 16 = 1.0x */ -- 1023, /* max (10 bits) */ -- 1, /* step */ -- 32); /* default, 32 = 2.0x */ -- ctrl->flags |= V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; -+ v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -+ V4L2_CID_EXPOSURE, -+ 4, /* min lines */ -+ 65535, /* max lines (4+8+4 bits)*/ -+ 1, /* step */ -+ 1000); /* default number of lines */ -+ v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -+ V4L2_CID_ANALOGUE_GAIN, -+ 16, /* min, 16 = 1.0x */ -+ 1023, /* max (10 bits) */ -+ 1, /* step */ -+ 32); /* default, 32 = 2.0x */ - - /* Set the default mode before we init the subdev */ - sensor->mode = OV5647_DEFAULT_MODE; diff --git a/target/linux/bcm27xx/patches-5.10/950-0236-media-i2c-ov5647-Use-member-names-in-mode-tables.patch b/target/linux/bcm27xx/patches-5.10/950-0236-media-i2c-ov5647-Use-member-names-in-mode-tables.patch deleted file mode 100644 index e96e6a40b1..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0236-media-i2c-ov5647-Use-member-names-in-mode-tables.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 1073eef3ada930c9c35b2b0da30828cfe1ea4024 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 29 Apr 2020 22:11:01 +0100 -Subject: [PATCH] media: i2c: ov5647: Use member names in mode tables - -To make adding new members to the mode structures easier, use -the member names in the initialisers. - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/ov5647.c | 30 +++++++++++++++--------------- - 1 file changed, 15 insertions(+), 15 deletions(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -592,7 +592,7 @@ static struct ov5647_mode supported_mode - * Uncentred crop (top left quarter) from 2x2 binned 1296x972 image. - */ - { -- { -+ .format = { - .code = MEDIA_BUS_FMT_SBGGR8_1X8, - .colorspace = V4L2_COLORSPACE_SRGB, - .field = V4L2_FIELD_NONE, -@@ -608,8 +608,8 @@ static struct ov5647_mode supported_mode - .pixel_rate = 77291670, - .hts = 1896, - .vts_def = 0x3d8, -- ov5647_640x480_8bit, -- ARRAY_SIZE(ov5647_640x480_8bit) -+ .reg_list = ov5647_640x480_8bit, -+ .num_regs = ARRAY_SIZE(ov5647_640x480_8bit) - }, - }; - -@@ -618,7 +618,7 @@ static struct ov5647_mode supported_mode - * MODE 0: 2592x1944 full resolution full FOV 10-bit mode. - */ - { -- { -+ .format = { - .code = MEDIA_BUS_FMT_SBGGR10_1X10, - .colorspace = V4L2_COLORSPACE_SRGB, - .field = V4L2_FIELD_NONE, -@@ -634,15 +634,15 @@ static struct ov5647_mode supported_mode - .pixel_rate = 87500000, - .hts = 2844, - .vts_def = 0x7b0, -- ov5647_2592x1944_10bit, -- ARRAY_SIZE(ov5647_2592x1944_10bit) -+ .reg_list = ov5647_2592x1944_10bit, -+ .num_regs = ARRAY_SIZE(ov5647_2592x1944_10bit) - }, - /* - * MODE 1: 1080p30 10-bit mode. - * Full resolution centre-cropped down to 1080p. - */ - { -- { -+ .format = { - .code = MEDIA_BUS_FMT_SBGGR10_1X10, - .colorspace = V4L2_COLORSPACE_SRGB, - .field = V4L2_FIELD_NONE, -@@ -658,14 +658,14 @@ static struct ov5647_mode supported_mode - .pixel_rate = 81666700, - .hts = 2416, - .vts_def = 0x450, -- ov5647_1080p30_10bit, -- ARRAY_SIZE(ov5647_1080p30_10bit) -+ .reg_list = ov5647_1080p30_10bit, -+ .num_regs = ARRAY_SIZE(ov5647_1080p30_10bit) - }, - /* - * MODE 2: 2x2 binned full FOV 10-bit mode. - */ - { -- { -+ .format = { - .code = MEDIA_BUS_FMT_SBGGR10_1X10, - .colorspace = V4L2_COLORSPACE_SRGB, - .field = V4L2_FIELD_NONE, -@@ -681,15 +681,15 @@ static struct ov5647_mode supported_mode - .pixel_rate = 81666700, - .hts = 1896, - .vts_def = 0x59b, -- ov5647_2x2binned_10bit, -- ARRAY_SIZE(ov5647_2x2binned_10bit) -+ .reg_list = ov5647_2x2binned_10bit, -+ .num_regs = ARRAY_SIZE(ov5647_2x2binned_10bit) - }, - /* - * MODE 3: 10-bit VGA full FOV mode 60fps. - * 2x2 binned and subsampled down to VGA. - */ - { -- { -+ .format = { - .code = MEDIA_BUS_FMT_SBGGR10_1X10, - .colorspace = V4L2_COLORSPACE_SRGB, - .field = V4L2_FIELD_NONE, -@@ -705,8 +705,8 @@ static struct ov5647_mode supported_mode - .pixel_rate = 55000000, - .hts = 1852, - .vts_def = 0x1f8, -- ov5647_640x480_10bit, -- ARRAY_SIZE(ov5647_640x480_10bit) -+ .reg_list = ov5647_640x480_10bit, -+ .num_regs = ARRAY_SIZE(ov5647_640x480_10bit) - }, - }; - diff --git a/target/linux/bcm27xx/patches-5.10/950-0237-media-i2c-ov5647-Advertise-the-correct-exposure-rang.patch b/target/linux/bcm27xx/patches-5.10/950-0237-media-i2c-ov5647-Advertise-the-correct-exposure-rang.patch deleted file mode 100644 index 6bdde3a7ab..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0237-media-i2c-ov5647-Advertise-the-correct-exposure-rang.patch +++ /dev/null @@ -1,119 +0,0 @@ -From 7048b8678ac96eb512adfb18990eff0c9b8109f5 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Thu, 30 Apr 2020 11:03:00 +0100 -Subject: [PATCH] media: i2c: ov5647: Advertise the correct exposure - range - -Exposure is clipped by the VTS of the mode, so needs to be updated as -and when this is changed. - -Signed-off-by: Dave Stevenson ---- - drivers/media/i2c/ov5647.c | 47 +++++++++++++++++++++++++++++++------- - 1 file changed, 39 insertions(+), 8 deletions(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -84,6 +84,11 @@ - #define OV5647_VBLANK_MIN 4 - #define OV5647_VTS_MAX 32767 - -+#define OV5647_EXPOSURE_MIN 4 -+#define OV5647_EXPOSURE_STEP 1 -+#define OV5647_EXPOSURE_DEFAULT 1000 -+#define OV5647_EXPOSURE_MAX 65535 -+ - struct regval_list { - u16 addr; - u8 data; -@@ -117,6 +122,7 @@ struct ov5647 { - struct v4l2_ctrl *pixel_rate; - struct v4l2_ctrl *hblank; - struct v4l2_ctrl *vblank; -+ struct v4l2_ctrl *exposure; - bool write_mode_regs; - }; - -@@ -1202,7 +1208,7 @@ static int ov5647_set_fmt(struct v4l2_su - * If we have changed modes, write the I2C register list on - * a stream_on(). - */ -- int hblank; -+ int exposure_max, exposure_def, hblank; - - if (state->mode != mode) - state->write_mode_regs = true; -@@ -1223,6 +1229,15 @@ static int ov5647_set_fmt(struct v4l2_su - mode->vts_def - mode->format.height); - __v4l2_ctrl_s_ctrl(state->vblank, - mode->vts_def - mode->format.height); -+ -+ exposure_max = mode->vts_def - 4; -+ exposure_def = (exposure_max < OV5647_EXPOSURE_DEFAULT) ? -+ exposure_max : OV5647_EXPOSURE_DEFAULT; -+ __v4l2_ctrl_modify_range(state->exposure, -+ state->exposure->minimum, -+ exposure_max, -+ state->exposure->step, -+ exposure_def); - } - - mutex_unlock(&state->lock); -@@ -1415,6 +1430,19 @@ static int ov5647_s_ctrl(struct v4l2_ctr - - /* v4l2_ctrl_lock() locks our own mutex */ - -+ if (ctrl->id == V4L2_CID_VBLANK) { -+ int exposure_max, exposure_def; -+ -+ /* Update max exposure while meeting expected vblanking */ -+ exposure_max = state->mode->format.height + ctrl->val - 4; -+ exposure_def = (exposure_max < OV5647_EXPOSURE_DEFAULT) ? -+ exposure_max : OV5647_EXPOSURE_DEFAULT; -+ __v4l2_ctrl_modify_range(state->exposure, -+ state->exposure->minimum, -+ exposure_max, state->exposure->step, -+ exposure_def); -+ } -+ - /* - * If the device is not powered up by the host driver do - * not apply any controls to H/W at this time. Instead -@@ -1472,7 +1500,7 @@ static int ov5647_probe(struct i2c_clien - struct v4l2_subdev *sd; - struct device_node *np = client->dev.of_node; - u32 xclk_freq; -- int hblank; -+ int hblank, exposure_max, exposure_def; - - sensor = devm_kzalloc(dev, sizeof(*sensor), GFP_KERNEL); - if (!sensor) -@@ -1525,12 +1553,6 @@ static int ov5647_probe(struct i2c_clien - 0, /* skip_mask */ - V4L2_EXPOSURE_MANUAL); /* default */ - v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -- V4L2_CID_EXPOSURE, -- 4, /* min lines */ -- 65535, /* max lines (4+8+4 bits)*/ -- 1, /* step */ -- 1000); /* default number of lines */ -- v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, - V4L2_CID_ANALOGUE_GAIN, - 16, /* min, 16 = 1.0x */ - 1023, /* max (10 bits) */ -@@ -1540,6 +1562,15 @@ static int ov5647_probe(struct i2c_clien - /* Set the default mode before we init the subdev */ - sensor->mode = OV5647_DEFAULT_MODE; - -+ exposure_max = sensor->mode->vts_def - 4; -+ exposure_def = (exposure_max < OV5647_EXPOSURE_DEFAULT) ? -+ exposure_max : OV5647_EXPOSURE_DEFAULT; -+ sensor->exposure = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, -+ V4L2_CID_EXPOSURE, -+ OV5647_EXPOSURE_MIN, exposure_max, -+ OV5647_EXPOSURE_STEP, -+ exposure_def); -+ - /* By default, PIXEL_RATE is read only, but it does change per mode */ - sensor->pixel_rate = v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, - V4L2_CID_PIXEL_RATE, diff --git a/target/linux/bcm27xx/patches-5.10/950-0252-SQUASH-pinctrl-bcm2835-Set-base-for-bcm2711-GPIO-to-.patch b/target/linux/bcm27xx/patches-5.10/950-0252-SQUASH-pinctrl-bcm2835-Set-base-for-bcm2711-GPIO-to-.patch deleted file mode 100644 index 95ced63872..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0252-SQUASH-pinctrl-bcm2835-Set-base-for-bcm2711-GPIO-to-.patch +++ /dev/null @@ -1,27 +0,0 @@ -From abc82e964df6c13999cff7b148b12efb255f19aa Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 22 May 2020 11:35:33 +0100 -Subject: [PATCH] SQUASH: pinctrl: bcm2835: Set base for bcm2711 GPIO - to 0 - -Without this patch GPIOs don't seem to work properly, primarily -noticeable as broken LEDs. - -Squash with "pinctrl-bcm2835: Set base to 0 give expected gpio numbering" - -Signed-off-by: Phil Elwell ---- - drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c -+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c -@@ -378,7 +378,7 @@ static const struct gpio_chip bcm2711_gp - .get = bcm2835_gpio_get, - .set = bcm2835_gpio_set, - .set_config = gpiochip_generic_config, -- .base = -1, -+ .base = 0, - .ngpio = BCM2711_NUM_GPIOS, - .can_sleep = false, - }; diff --git a/target/linux/bcm27xx/patches-5.10/950-0253-staging-vchiq_arm-Clean-up-40-bit-DMA-support.patch b/target/linux/bcm27xx/patches-5.10/950-0253-staging-vchiq_arm-Clean-up-40-bit-DMA-support.patch deleted file mode 100644 index b9d4c1701b..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0253-staging-vchiq_arm-Clean-up-40-bit-DMA-support.patch +++ /dev/null @@ -1,174 +0,0 @@ -From 461092c036303037c0efe37002079ce6e9ed8ba5 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 20 May 2020 16:36:33 +0100 -Subject: [PATCH] staging: vchiq_arm: Clean up 40-bit DMA support - -Manage the split between addresses for the VPU and addresses for the -40-bit DMA controller with a dedicated DMA device pointer that on non- -BCM2711 platforms is the same as the main VCHIQ device. This allows -the VCHIQ node to stay in the usual place in the DT, and removes the -ugly VC_SAFE macros. - -Signed-off-by: Phil Elwell - -staging: vchiq_arm: Use g_dma_dev for dma_unmap_sg - -Commit "staging: vchiq_arm: Clean up 40-bit DMA support" failed to -change one of the calls to dma_unmap_sg to pass in g_dma_dev (rather -than g_dev). Correct that oversight. - -See: https://github.com/raspberrypi/linux/issues/3647 - -Signed-off-by: Phil Elwell ---- - .../interface/vchiq_arm/vchiq_2835_arm.c | 42 ++++++++++++------- - .../interface/vchiq_arm/vchiq_arm.c | 14 ------- - 2 files changed, 27 insertions(+), 29 deletions(-) - ---- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c -+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c -@@ -16,8 +16,6 @@ - #include - - #define TOTAL_SLOTS (VCHIQ_SLOT_ZERO_SLOTS + 2 * 32) --#define VC_SAFE(x) (g_use_36bit_addrs ? ((u32)(x) | 0xc0000000) : (u32)(x)) --#define IS_VC_SAFE(x) (g_use_36bit_addrs ? !((x) & ~0x3fffffffull) : 1) - - #include "vchiq_arm.h" - #include "vchiq_connected.h" -@@ -66,6 +64,7 @@ static char *g_fragments_base; - static char *g_free_fragments; - static struct semaphore g_free_fragments_sema; - static struct device *g_dev; -+static struct device *g_dma_dev; - - static DEFINE_SEMAPHORE(g_free_fragments_mutex); - -@@ -82,6 +81,7 @@ free_pagelist(struct vchiq_pagelist_info - int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) - { - struct device *dev = &pdev->dev; -+ struct device *dma_dev = NULL; - struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev); - struct rpi_firmware *fw = drvdata->fw; - struct vchiq_slot_zero *vchiq_slot_zero; -@@ -103,7 +103,23 @@ int vchiq_platform_init(struct platform_ - g_cache_line_size = drvdata->cache_line_size; - g_fragments_size = 2 * g_cache_line_size; - -- g_use_36bit_addrs = (dev->dma_pfn_offset == 0); -+ if (drvdata->use_36bit_addrs) { -+ struct device_node *dma_node = -+ of_find_compatible_node(NULL, NULL, "brcm,bcm2711-dma"); -+ -+ if (dma_node) { -+ struct platform_device *pdev; -+ -+ pdev = of_find_device_by_node(dma_node); -+ if (pdev) -+ dma_dev = &pdev->dev; -+ of_node_put(dma_node); -+ g_use_36bit_addrs = true; -+ } else { -+ dev_err(dev, "40-bit DMA controller not found\n"); -+ return -EINVAL; -+ } -+ } - - /* Allocate space for the channels in coherent memory */ - slot_mem_size = PAGE_ALIGN(TOTAL_SLOTS * VCHIQ_SLOT_SIZE); -@@ -116,14 +132,8 @@ int vchiq_platform_init(struct platform_ - return -ENOMEM; - } - -- if (!IS_VC_SAFE(slot_phys)) { -- dev_err(dev, "allocated DMA memory %pad is not VC-safe\n", -- &slot_phys); -- return -ENOMEM; -- } -- - WARN_ON(((unsigned long)slot_mem & (PAGE_SIZE - 1)) != 0); -- channelbase = VC_SAFE(slot_phys); -+ channelbase = slot_phys; - - vchiq_slot_zero = vchiq_init_slots(slot_mem, slot_mem_size); - if (!vchiq_slot_zero) -@@ -171,6 +181,8 @@ int vchiq_platform_init(struct platform_ - } - - g_dev = dev; -+ g_dma_dev = dma_dev ?: dev; -+ - vchiq_log_info(vchiq_arm_log_level, - "vchiq_init - done (slots %pK, phys %pad)", - vchiq_slot_zero, &slot_phys); -@@ -240,7 +252,7 @@ vchiq_prepare_bulk_data(struct vchiq_bul - if (!pagelistinfo) - return VCHIQ_ERROR; - -- bulk->data = (void *)VC_SAFE(pagelistinfo->dma_addr); -+ bulk->data = pagelistinfo->dma_addr; - - /* - * Store the pagelistinfo address in remote_data, -@@ -295,7 +307,7 @@ static void - cleanup_pagelistinfo(struct vchiq_pagelist_info *pagelistinfo) - { - if (pagelistinfo->scatterlist_mapped) { -- dma_unmap_sg(g_dev, pagelistinfo->scatterlist, -+ dma_unmap_sg(g_dma_dev, pagelistinfo->scatterlist, - pagelistinfo->num_pages, pagelistinfo->dma_dir); - } - -@@ -444,7 +456,7 @@ create_pagelist(char *buf, char __user * - count -= len; - } - -- dma_buffers = dma_map_sg(g_dev, -+ dma_buffers = dma_map_sg(g_dma_dev, - scatterlist, - num_pages, - pagelistinfo->dma_dir); -@@ -494,7 +506,7 @@ create_pagelist(char *buf, char __user * - } else { - for_each_sg(scatterlist, sg, dma_buffers, i) { - u32 len = sg_dma_len(sg); -- u32 addr = VC_SAFE(sg_dma_address(sg)); -+ u32 addr = sg_dma_address(sg); - u32 new_pages = (len + PAGE_SIZE - 1) >> PAGE_SHIFT; - - /* Note: addrs is the address + page_count - 1 -@@ -555,7 +567,7 @@ free_pagelist(struct vchiq_pagelist_info - * NOTE: dma_unmap_sg must be called before the - * cpu can touch any of the data/pages. - */ -- dma_unmap_sg(g_dev, pagelistinfo->scatterlist, -+ dma_unmap_sg(g_dma_dev, pagelistinfo->scatterlist, - pagelistinfo->num_pages, pagelistinfo->dma_dir); - pagelistinfo->scatterlist_mapped = 0; - ---- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c -+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c -@@ -2720,22 +2720,8 @@ vchiq_register_child(struct platform_dev - - child->dev.of_node = np; - -- /* -- * We want the dma-ranges etc to be copied from a device with the -- * correct dma-ranges for the VPU. -- * VCHIQ on Pi4 is now under scb which doesn't get those dma-ranges. -- * Take the "dma" node as going to be suitable as it sees the world -- * through the same eyes as the VPU. -- */ -- np = of_find_node_by_path("dma"); -- if (!np) -- np = pdev->dev.of_node; -- - of_dma_configure(&child->dev, np, true); - -- if (np != pdev->dev.of_node) -- of_node_put(np); -- - return child; - } - diff --git a/target/linux/bcm27xx/patches-5.10/950-0296-media-i2c-ov5647-Parse-and-register-properties.patch b/target/linux/bcm27xx/patches-5.10/950-0296-media-i2c-ov5647-Parse-and-register-properties.patch deleted file mode 100644 index 10f5512b6a..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0296-media-i2c-ov5647-Parse-and-register-properties.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 0f0998ed9620f676ee78eb6f606b0b2fa118bf68 Mon Sep 17 00:00:00 2001 -From: Laurent Pinchart -Date: Sat, 4 Jul 2020 01:45:08 +0300 -Subject: [PATCH] media: i2c: ov5647: Parse and register properties - -Parse device properties and register controls for them using the V4L2 -fwnode properties helpers. - -Signed-off-by: Laurent Pinchart ---- - drivers/media/i2c/ov5647.c | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - ---- a/drivers/media/i2c/ov5647.c -+++ b/drivers/media/i2c/ov5647.c -@@ -1501,6 +1501,7 @@ static int ov5647_probe(struct i2c_clien - struct device_node *np = client->dev.of_node; - u32 xclk_freq; - int hblank, exposure_max, exposure_def; -+ struct v4l2_fwnode_device_properties props; - - sensor = devm_kzalloc(dev, sizeof(*sensor), GFP_KERNEL); - if (!sensor) -@@ -1534,7 +1535,7 @@ static int ov5647_probe(struct i2c_clien - mutex_init(&sensor->lock); - - /* Initialise controls. */ -- v4l2_ctrl_handler_init(&sensor->ctrls, 7); -+ v4l2_ctrl_handler_init(&sensor->ctrls, 9); - v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops, - V4L2_CID_AUTOGAIN, - 0, /* min */ -@@ -1598,6 +1599,16 @@ static int ov5647_probe(struct i2c_clien - __func__, ret); - goto error; - } -+ -+ ret = v4l2_fwnode_device_parse(&client->dev, &props); -+ if (ret) -+ goto error; -+ -+ ret = v4l2_ctrl_new_fwnode_properties(&sensor->ctrls, &ov5647_ctrl_ops, -+ &props); -+ if (ret) -+ goto error; -+ - sensor->sd.ctrl_handler = &sensor->ctrls; - - /* Write out the register set over I2C on stream-on. */ diff --git a/target/linux/bcm27xx/patches-5.10/950-0300-ARM-proc-v7-Force-misalignment-of-early-stmia.patch b/target/linux/bcm27xx/patches-5.10/950-0300-ARM-proc-v7-Force-misalignment-of-early-stmia.patch deleted file mode 100644 index 3910f77230..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0300-ARM-proc-v7-Force-misalignment-of-early-stmia.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 9e5b2debe12d4e840a7d3ec0cf22b215396ed46e Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 29 Jul 2020 13:47:55 +0100 -Subject: [PATCH] ARM: proc-v7: Force misalignment of early stmia - -In an attempt to prevent the problem of CPUn not starting, explicitly -misalign the scratch space used to save registers acros the cache -invalidation. - -Notes: -At this stage in the boot process the core is running with its cache -disabled. Before enabling the cache its contents must be explicitly -invalidated, a process that requires quite a few registers that the -caller must preserve. Evidence suggests that something is writing a -block of zeroes over that space at a time when all other cores should -be idle, possibly some kind of write-combiner, and the misalignment is -designed to disrupt any write-coalescing. - -In truth, I don't understand why this patch works, and when the failure -is so random it is hard to be certain that this isn't just rolling the -dice again. One interesting test would be to change the "addeq r12, #4"s -to "addeq r12, #0"s determine see if the offset itself is significant or -just the additional code. - -See: https://github.com/Hexxeh/rpi-firmware/issues/232 - -Signed-off-by: Phil Elwell ---- - arch/arm/mm/proc-v7.S | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - ---- a/arch/arm/mm/proc-v7.S -+++ b/arch/arm/mm/proc-v7.S -@@ -287,6 +287,8 @@ __v7_ca17mp_setup: - mov r10, #0 - 1: adr r0, __v7_setup_stack_ptr - ldr r12, [r0] -+ tst r12, #0x1f -+ addeq r12, r12, #4 - add r12, r12, r0 @ the local stack - stmia r12, {r1-r6, lr} @ v7_invalidate_l1 touches r0-r6 - bl v7_invalidate_l1 -@@ -474,6 +476,8 @@ __v7_setup: - adr r0, __v7_setup_stack_ptr - ldr r12, [r0] - add r12, r12, r0 @ the local stack -+ tst r12, #0x1f -+ addeq r12, r12, #4 - stmia r12, {r1-r6, lr} @ v7_invalidate_l1 touches r0-r6 - bl v7_invalidate_l1 - ldmia r12, {r1-r6, lr} -@@ -557,7 +561,7 @@ ENDPROC(__v7_setup) - .bss - .align 2 - __v7_setup_stack: -- .space 4 * 7 @ 7 registers -+ .space 4 * 8 @ 7 registers + 1 spare - - __INITDATA - diff --git a/target/linux/bcm27xx/patches-5.10/950-0306-bcm2835-mmc-uninitialized_var-is-no-more.patch b/target/linux/bcm27xx/patches-5.10/950-0306-bcm2835-mmc-uninitialized_var-is-no-more.patch deleted file mode 100644 index a89e4ab112..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0306-bcm2835-mmc-uninitialized_var-is-no-more.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 99c87c4c80fb0dd24f6849d0846c0c4a418903a9 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 3 Sep 2020 14:02:21 +0100 -Subject: [PATCH] bcm2835-mmc: uninitialized_var is no more - ---- - drivers/mmc/host/bcm2835-mmc.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/mmc/host/bcm2835-mmc.c -+++ b/drivers/mmc/host/bcm2835-mmc.c -@@ -367,7 +367,7 @@ static void bcm2835_bcm2835_mmc_read_blo - unsigned long flags; - size_t blksize, len, chunk; - -- u32 uninitialized_var(scratch); -+ u32 scratch = 0; - u8 *buf; - - blksize = host->data->blksz; diff --git a/target/linux/bcm27xx/patches-5.10/950-0310-vc4_hdmi-Remove-cec_available-flag-as-always-support.patch b/target/linux/bcm27xx/patches-5.10/950-0310-vc4_hdmi-Remove-cec_available-flag-as-always-support.patch deleted file mode 100644 index 4c9e0d71f4..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0310-vc4_hdmi-Remove-cec_available-flag-as-always-support.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 8dda85398458dc330758ef5e1408d66995ffa068 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Thu, 7 May 2020 18:16:09 +0100 -Subject: [PATCH] vc4_hdmi: Remove cec_available flag as always - supported - -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ---- - drivers/gpu/drm/vc4/vc4_hdmi.h | 3 --- - 2 files changed, 7 deletions(-) - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1493,9 +1493,6 @@ static int vc4_hdmi_cec_init(struct vc4_ - u32 value; - int ret; - -- if (!vc4_hdmi->variant->cec_available) -- return 0; -- - vc4_hdmi->cec_adap = cec_allocate_adapter(&vc4_hdmi_cec_adap_ops, - vc4_hdmi, "vc4", - CEC_CAP_DEFAULTS | -@@ -1928,7 +1925,6 @@ static const struct vc4_hdmi_variant bcm - .debugfs_name = "hdmi_regs", - .card_name = "vc4-hdmi", - .max_pixel_clock = 162000000, -- .cec_available = true, - .registers = vc4_hdmi_fields, - .num_registers = ARRAY_SIZE(vc4_hdmi_fields), - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.h -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -43,9 +43,6 @@ struct vc4_hdmi_variant { - /* Filename to expose the registers in debugfs */ - const char *debugfs_name; - -- /* Set to true when the CEC support is available */ -- bool cec_available; -- - /* Maximum pixel clock supported by the controller (in Hz) */ - unsigned long long max_pixel_clock; - diff --git a/target/linux/bcm27xx/patches-5.10/950-0313-vc4_hdmi-Set-HDMI_MAI_FMT.patch b/target/linux/bcm27xx/patches-5.10/950-0313-vc4_hdmi-Set-HDMI_MAI_FMT.patch deleted file mode 100644 index e4f6f8795c..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0313-vc4_hdmi-Set-HDMI_MAI_FMT.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 80ba4d12d096a8f7855835ee54dc17d1e3a0d31a Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 10 Mar 2020 22:21:15 +0000 -Subject: [PATCH] vc4_hdmi: Set HDMI_MAI_FMT - -The hardware uses this for generating the right audio -data island packets when using formats other than PCM - -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 48 ++++++++++++++++++++++++++++++++++ - drivers/gpu/drm/vc4/vc4_regs.h | 30 +++++++++++++++++++++ - 2 files changed, 78 insertions(+) - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -991,6 +991,44 @@ static void vc4_hdmi_audio_shutdown(stru - vc4_hdmi->audio.substream = NULL; - } - -+static int sample_rate_to_mai_fmt(int samplerate) -+{ -+ switch (samplerate) { -+ case 8000: -+ return VC4_HDMI_MAI_SAMPLE_RATE_8000; -+ case 11025: -+ return VC4_HDMI_MAI_SAMPLE_RATE_11025; -+ case 12000: -+ return VC4_HDMI_MAI_SAMPLE_RATE_12000; -+ case 16000: -+ return VC4_HDMI_MAI_SAMPLE_RATE_16000; -+ case 22050: -+ return VC4_HDMI_MAI_SAMPLE_RATE_22050; -+ case 24000: -+ return VC4_HDMI_MAI_SAMPLE_RATE_24000; -+ case 32000: -+ return VC4_HDMI_MAI_SAMPLE_RATE_32000; -+ case 44100: -+ return VC4_HDMI_MAI_SAMPLE_RATE_44100; -+ case 48000: -+ return VC4_HDMI_MAI_SAMPLE_RATE_48000; -+ case 64000: -+ return VC4_HDMI_MAI_SAMPLE_RATE_64000; -+ case 88200: -+ return VC4_HDMI_MAI_SAMPLE_RATE_88200; -+ case 96000: -+ return VC4_HDMI_MAI_SAMPLE_RATE_96000; -+ case 128000: -+ return VC4_HDMI_MAI_SAMPLE_RATE_128000; -+ case 176400: -+ return VC4_HDMI_MAI_SAMPLE_RATE_176400; -+ case 192000: -+ return VC4_HDMI_MAI_SAMPLE_RATE_192000; -+ default: -+ return VC4_HDMI_MAI_SAMPLE_RATE_NOT_INDICATED; -+ } -+} -+ - /* HDMI audio codec callbacks */ - static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params, -@@ -1001,6 +1039,8 @@ static int vc4_hdmi_audio_hw_params(stru - struct device *dev = &vc4_hdmi->pdev->dev; - u32 audio_packet_config, channel_mask; - u32 channel_map; -+ u32 mai_audio_format; -+ u32 mai_sample_rate; - - if (substream != vc4_hdmi->audio.substream) - return -EINVAL; -@@ -1021,6 +1061,14 @@ static int vc4_hdmi_audio_hw_params(stru - - vc4_hdmi_audio_set_mai_clock(vc4_hdmi); - -+ mai_sample_rate = sample_rate_to_mai_fmt(vc4_hdmi->audio.samplerate); -+ mai_audio_format = VC4_HDMI_MAI_FORMAT_PCM; -+ HDMI_WRITE(HDMI_MAI_FMT, -+ VC4_SET_FIELD(mai_sample_rate, -+ VC4_HDMI_MAI_FORMAT_SAMPLE_RATE) | -+ VC4_SET_FIELD(mai_audio_format, -+ VC4_HDMI_MAI_FORMAT_AUDIO_FORMAT)); -+ - /* The B frame identifier should match the value used by alsa-lib (8) */ - audio_packet_config = - VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_SAMPLE_FLAT | ---- a/drivers/gpu/drm/vc4/vc4_regs.h -+++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -516,6 +516,36 @@ - # define VC4_HDMI_AUDIO_PACKET_CEA_MASK_MASK VC4_MASK(7, 0) - # define VC4_HDMI_AUDIO_PACKET_CEA_MASK_SHIFT 0 - -+# define VC4_HDMI_MAI_FORMAT_AUDIO_FORMAT_MASK VC4_MASK(23, 16) -+# define VC4_HDMI_MAI_FORMAT_AUDIO_FORMAT_SHIFT 16 -+ -+enum { -+ VC4_HDMI_MAI_FORMAT_PCM = 2, -+ VC4_HDMI_MAI_FORMAT_HBR = 200, -+}; -+ -+# define VC4_HDMI_MAI_FORMAT_SAMPLE_RATE_MASK VC4_MASK(15, 8) -+# define VC4_HDMI_MAI_FORMAT_SAMPLE_RATE_SHIFT 8 -+ -+enum { -+ VC4_HDMI_MAI_SAMPLE_RATE_NOT_INDICATED = 0, -+ VC4_HDMI_MAI_SAMPLE_RATE_8000 = 1, -+ VC4_HDMI_MAI_SAMPLE_RATE_11025 = 2, -+ VC4_HDMI_MAI_SAMPLE_RATE_12000 = 3, -+ VC4_HDMI_MAI_SAMPLE_RATE_16000 = 4, -+ VC4_HDMI_MAI_SAMPLE_RATE_22050 = 5, -+ VC4_HDMI_MAI_SAMPLE_RATE_24000 = 6, -+ VC4_HDMI_MAI_SAMPLE_RATE_32000 = 7, -+ VC4_HDMI_MAI_SAMPLE_RATE_44100 = 8, -+ VC4_HDMI_MAI_SAMPLE_RATE_48000 = 9, -+ VC4_HDMI_MAI_SAMPLE_RATE_64000 = 10, -+ VC4_HDMI_MAI_SAMPLE_RATE_88200 = 11, -+ VC4_HDMI_MAI_SAMPLE_RATE_96000 = 12, -+ VC4_HDMI_MAI_SAMPLE_RATE_128000 = 13, -+ VC4_HDMI_MAI_SAMPLE_RATE_176400 = 14, -+ VC4_HDMI_MAI_SAMPLE_RATE_192000 = 15, -+}; -+ - # define VC4_HDMI_RAM_PACKET_ENABLE BIT(16) - - /* When set, the CTS_PERIOD counts based on MAI bus sync pulse instead diff --git a/target/linux/bcm27xx/patches-5.10/950-0314-drm-vc4-add-iec958-controls-to-vc4_hdmi.patch b/target/linux/bcm27xx/patches-5.10/950-0314-drm-vc4-add-iec958-controls-to-vc4_hdmi.patch deleted file mode 100644 index 9582c86871..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0314-drm-vc4-add-iec958-controls-to-vc4_hdmi.patch +++ /dev/null @@ -1,119 +0,0 @@ -From 29e5bf9305e98a57a895d6806fafa6e67f257fd8 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Tue, 17 Mar 2020 12:12:22 +0100 -Subject: [PATCH] drm/vc4: add iec958 controls to vc4_hdmi - -Although vc4 get an IEC958 formatted stream passed in from userspace -the driver needs the info from the channel status bits to properly -set up the hardware, eg for HBR passthrough. - -Add iec958 controls so the channel status bits can be passed in -from userspace. - -Signed-off-by: Matthias Reichl ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 60 ++++++++++++++++++++++++++++++++++ - drivers/gpu/drm/vc4/vc4_hdmi.h | 2 ++ - 2 files changed, 62 insertions(+) - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -44,6 +44,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -1182,6 +1183,47 @@ static int vc4_hdmi_audio_eld_ctl_get(st - return 0; - } - -+static int vc4_spdif_info(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_info *uinfo) -+{ -+ uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; -+ uinfo->count = 1; -+ return 0; -+} -+ -+static int vc4_spdif_playback_get(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); -+ struct vc4_hdmi *vc4_hdmi = snd_component_to_hdmi(component); -+ -+ memcpy(ucontrol->value.iec958.status, vc4_hdmi->audio.iec_status, -+ sizeof(vc4_hdmi->audio.iec_status)); -+ -+ return 0; -+} -+ -+static int vc4_spdif_playback_put(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); -+ struct vc4_hdmi *vc4_hdmi = snd_component_to_hdmi(component); -+ -+ memcpy(vc4_hdmi->audio.iec_status, ucontrol->value.iec958.status, -+ sizeof(vc4_hdmi->audio.iec_status)); -+ -+ return 0; -+} -+ -+static int vc4_spdif_mask_get(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ memset(ucontrol->value.iec958.status, 0xff, -+ sizeof_field(struct vc4_hdmi_audio, iec_status)); -+ -+ return 0; -+} -+ - static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = { - { - .access = SNDRV_CTL_ELEM_ACCESS_READ | -@@ -1191,6 +1233,19 @@ static const struct snd_kcontrol_new vc4 - .info = vc4_hdmi_audio_eld_ctl_info, - .get = vc4_hdmi_audio_eld_ctl_get, - }, -+ { -+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, -+ .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT), -+ .info = vc4_spdif_info, -+ .get = vc4_spdif_playback_get, -+ .put = vc4_spdif_playback_put, -+ }, -+ { -+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, -+ .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, MASK), -+ .info = vc4_spdif_info, -+ .get = vc4_spdif_mask_get, -+ }, - }; - - static const struct snd_soc_dapm_widget vc4_hdmi_audio_widgets[] = { -@@ -1311,6 +1366,11 @@ static int vc4_hdmi_audio_init(struct vc - vc4_hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; - vc4_hdmi->audio.dma_data.maxburst = 2; - -+ vc4_hdmi->audio.iec_status[0] = IEC958_AES0_CON_NOT_COPYRIGHT; -+ vc4_hdmi->audio.iec_status[1] = -+ IEC958_AES1_CON_ORIGINAL | IEC958_AES1_CON_PCM_CODER; -+ vc4_hdmi->audio.iec_status[3] = IEC958_AES3_CON_FS_48000; -+ - ret = devm_snd_dmaengine_pcm_register(dev, &pcm_conf, 0); - if (ret) { - dev_err(dev, "Could not register PCM component: %d\n", ret); ---- a/drivers/gpu/drm/vc4/vc4_hdmi.h -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -107,6 +107,8 @@ struct vc4_hdmi_audio { - struct snd_pcm_substream *substream; - - bool streaming; -+ -+ unsigned char iec_status[4]; - }; - - /* General HDMI hardware state. */ diff --git a/target/linux/bcm27xx/patches-5.10/950-0315-drm-vc4-move-setup-from-hw_params-to-prepare.patch b/target/linux/bcm27xx/patches-5.10/950-0315-drm-vc4-move-setup-from-hw_params-to-prepare.patch deleted file mode 100644 index 9b90426393..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0315-drm-vc4-move-setup-from-hw_params-to-prepare.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 7b6cfdfc74c7e9c00060a0c4146a6358b261f7db Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Thu, 19 Mar 2020 20:00:35 +0100 -Subject: [PATCH] drm/vc4: move setup from hw_params to prepare - -Configuring HDMI audio registers in prepare allows us to take -IEC958 bits into account which are set by the alsa hook after -the hw_params call. - -Signed-off-by: Matthias Reichl ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 20 +++++++++++--------- - 1 file changed, 11 insertions(+), 9 deletions(-) - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1031,9 +1031,8 @@ static int sample_rate_to_mai_fmt(int sa - } - - /* HDMI audio codec callbacks */ --static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, -- struct snd_pcm_hw_params *params, -- struct snd_soc_dai *dai) -+static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream, -+ struct snd_soc_dai *dai) - { - struct vc4_hdmi *vc4_hdmi = dai_to_hdmi(dai); - struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; -@@ -1046,12 +1045,15 @@ static int vc4_hdmi_audio_hw_params(stru - if (substream != vc4_hdmi->audio.substream) - return -EINVAL; - -- dev_dbg(dev, "%s: %u Hz, %d bit, %d channels\n", __func__, -- params_rate(params), params_width(params), -- params_channels(params)); -+ dev_dbg(dev, "%s: %u Hz, %d bit, %d channels AES0=%02x\n", -+ __func__, -+ substream->runtime->rate, -+ snd_pcm_format_width(substream->runtime->format), -+ substream->runtime->channels, -+ vc4_hdmi->audio.iec_status[0]); - -- vc4_hdmi->audio.channels = params_channels(params); -- vc4_hdmi->audio.samplerate = params_rate(params); -+ vc4_hdmi->audio.channels = substream->runtime->channels; -+ vc4_hdmi->audio.samplerate = substream->runtime->rate; - - HDMI_WRITE(HDMI_MAI_CTL, - VC4_HD_MAI_CTL_RESET | -@@ -1273,7 +1275,7 @@ static const struct snd_soc_component_dr - static const struct snd_soc_dai_ops vc4_hdmi_audio_dai_ops = { - .startup = vc4_hdmi_audio_startup, - .shutdown = vc4_hdmi_audio_shutdown, -- .hw_params = vc4_hdmi_audio_hw_params, -+ .prepare = vc4_hdmi_audio_prepare, - .set_fmt = vc4_hdmi_audio_set_fmt, - .trigger = vc4_hdmi_audio_trigger, - }; diff --git a/target/linux/bcm27xx/patches-5.10/950-0316-drm-vc4-enable-HBR-MAI-format-on-HBR-streams.patch b/target/linux/bcm27xx/patches-5.10/950-0316-drm-vc4-enable-HBR-MAI-format-on-HBR-streams.patch deleted file mode 100644 index 1fbda20137..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0316-drm-vc4-enable-HBR-MAI-format-on-HBR-streams.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 465b5e6889b1af1c9c061751a0ee234a27644030 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Fri, 10 Jul 2020 11:51:16 +0100 -Subject: [PATCH] drm/vc4: enable HBR MAI format on HBR streams - -Signed-off-by: Matthias Reichl ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1065,7 +1065,11 @@ static int vc4_hdmi_audio_prepare(struct - vc4_hdmi_audio_set_mai_clock(vc4_hdmi); - - mai_sample_rate = sample_rate_to_mai_fmt(vc4_hdmi->audio.samplerate); -- mai_audio_format = VC4_HDMI_MAI_FORMAT_PCM; -+ if (vc4_hdmi->audio.iec_status[0] & IEC958_AES0_NONAUDIO && -+ vc4_hdmi->audio.channels == 8) -+ mai_audio_format = VC4_HDMI_MAI_FORMAT_HBR; -+ else -+ mai_audio_format = VC4_HDMI_MAI_FORMAT_PCM; - HDMI_WRITE(HDMI_MAI_FMT, - VC4_SET_FIELD(mai_sample_rate, - VC4_HDMI_MAI_FORMAT_SAMPLE_RATE) | diff --git a/target/linux/bcm27xx/patches-5.10/950-0317-vc4_hdmi-Remove-firmware-logic-for-MAI-threshold-set.patch b/target/linux/bcm27xx/patches-5.10/950-0317-vc4_hdmi-Remove-firmware-logic-for-MAI-threshold-set.patch deleted file mode 100644 index ef776face1..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0317-vc4_hdmi-Remove-firmware-logic-for-MAI-threshold-set.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 3c398513990aa0edc5b9ebfbdd2395623562c6e4 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Thu, 25 Jun 2020 18:48:40 +0100 -Subject: [PATCH] vc4_hdmi: Remove firmware logic for MAI threshold - setting - -This was a workaround for bugs in hardware on earlier Pi models -and wasn't totally successful. - -It makes audio quality worse on a Pi4 at the higher sample rates - -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 22 ++++++---------------- - 1 file changed, 6 insertions(+), 16 deletions(-) - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1086,22 +1086,12 @@ static int vc4_hdmi_audio_prepare(struct - audio_packet_config |= VC4_SET_FIELD(channel_mask, - VC4_HDMI_AUDIO_PACKET_CEA_MASK); - -- /* Set the MAI threshold. This logic mimics the firmware's. */ -- if (vc4_hdmi->audio.samplerate > 96000) { -- HDMI_WRITE(HDMI_MAI_THR, -- VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQHIGH) | -- VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQLOW)); -- } else if (vc4_hdmi->audio.samplerate > 48000) { -- HDMI_WRITE(HDMI_MAI_THR, -- VC4_SET_FIELD(0x14, VC4_HD_MAI_THR_DREQHIGH) | -- VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQLOW)); -- } else { -- HDMI_WRITE(HDMI_MAI_THR, -- VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICHIGH) | -- VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) | -- VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQHIGH) | -- VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQLOW)); -- } -+ /* Set the MAI threshold */ -+ HDMI_WRITE(HDMI_MAI_THR, -+ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICHIGH) | -+ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) | -+ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQHIGH) | -+ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQLOW)); - - HDMI_WRITE(HDMI_MAI_CONFIG, - VC4_HDMI_MAI_CONFIG_BIT_REVERSE | diff --git a/target/linux/bcm27xx/patches-5.10/950-0318-vc_hdmi-Set-VC4_HDMI_MAI_CONFIG_FORMAT_REVERSE.patch b/target/linux/bcm27xx/patches-5.10/950-0318-vc_hdmi-Set-VC4_HDMI_MAI_CONFIG_FORMAT_REVERSE.patch deleted file mode 100644 index 1767ccf4a5..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0318-vc_hdmi-Set-VC4_HDMI_MAI_CONFIG_FORMAT_REVERSE.patch +++ /dev/null @@ -1,24 +0,0 @@ -From f4a590c59a65381a0b9aa045e5fc493b3dbb5945 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Tue, 30 Jun 2020 11:23:49 +0100 -Subject: [PATCH] vc_hdmi: Set VC4_HDMI_MAI_CONFIG_FORMAT_REVERSE - -Without this bit set, HDMI_MAI_FORMAT doesn't pick up -the format and samplerate from DVP_CFG_MAI0_FMT and you -can't get HDMI_HDMI_13_AUDIO_STATUS_1 to indicate HBR mode - -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1095,6 +1095,7 @@ static int vc4_hdmi_audio_prepare(struct - - HDMI_WRITE(HDMI_MAI_CONFIG, - VC4_HDMI_MAI_CONFIG_BIT_REVERSE | -+ VC4_HDMI_MAI_CONFIG_FORMAT_REVERSE | - VC4_SET_FIELD(channel_mask, VC4_HDMI_MAI_CHANNEL_MASK)); - - channel_map = vc4_hdmi->variant->channel_map(vc4_hdmi, channel_mask); diff --git a/target/linux/bcm27xx/patches-5.10/950-0350-ARM-dts-bcm271x-Use-a53-pmu-drop-RPI364.patch b/target/linux/bcm27xx/patches-5.10/950-0350-ARM-dts-bcm271x-Use-a53-pmu-drop-RPI364.patch deleted file mode 100644 index 0dce47a417..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0350-ARM-dts-bcm271x-Use-a53-pmu-drop-RPI364.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 97a2cff029c6c8f7f2550935e6110b81c69bc34a Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 19 Mar 2020 10:04:46 +0000 -Subject: [PATCH] ARM: dts: bcm271x: Use a53 pmu, drop RPI364 - -The upstream bcm2837.dtsi uses cortex-a53-pmu, so we can do the same -but with a fallback to the cortex-a7-pmu which is supported by the -32-bit kernel. - -Now that we're using the natural fallback mechanism of compatible -strings, the RPI364 macro no longer serves any purpose - remove it. - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/bcm2710.dtsi | 6 +----- - arch/arm64/boot/dts/broadcom/bcm2710-rpi-2-b.dts | 2 -- - arch/arm64/boot/dts/broadcom/bcm2710-rpi-3-b-plus.dts | 2 -- - arch/arm64/boot/dts/broadcom/bcm2710-rpi-3-b.dts | 2 -- - arch/arm64/boot/dts/broadcom/bcm2710-rpi-cm3.dts | 2 -- - arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dts | 2 -- - 6 files changed, 1 insertion(+), 15 deletions(-) - ---- a/arch/arm/boot/dts/bcm2710.dtsi -+++ b/arch/arm/boot/dts/bcm2710.dtsi -@@ -5,11 +5,7 @@ - compatible = "brcm,bcm2837", "brcm,bcm2836"; - - arm-pmu { --#ifdef RPI364 -- compatible = "arm,armv8-pmuv3", "arm,cortex-a7-pmu"; --#else -- compatible = "arm,cortex-a7-pmu"; --#endif -+ compatible = "arm,cortex-a53-pmu", "arm,cortex-a7-pmu"; - }; - - soc { ---- a/arch/arm64/boot/dts/broadcom/bcm2710-rpi-2-b.dts -+++ b/arch/arm64/boot/dts/broadcom/bcm2710-rpi-2-b.dts -@@ -1,3 +1 @@ --#define RPI364 -- - #include "../../../../arm/boot/dts/bcm2710-rpi-2-b.dts" ---- a/arch/arm64/boot/dts/broadcom/bcm2710-rpi-3-b-plus.dts -+++ b/arch/arm64/boot/dts/broadcom/bcm2710-rpi-3-b-plus.dts -@@ -1,3 +1 @@ --#define RPI364 -- - #include "../../../../arm/boot/dts/bcm2710-rpi-3-b-plus.dts" ---- a/arch/arm64/boot/dts/broadcom/bcm2710-rpi-3-b.dts -+++ b/arch/arm64/boot/dts/broadcom/bcm2710-rpi-3-b.dts -@@ -1,3 +1 @@ --#define RPI364 -- - #include "../../../../arm/boot/dts/bcm2710-rpi-3-b.dts" ---- a/arch/arm64/boot/dts/broadcom/bcm2710-rpi-cm3.dts -+++ b/arch/arm64/boot/dts/broadcom/bcm2710-rpi-cm3.dts -@@ -1,3 +1 @@ --#define RPI364 -- - #include "../../../../arm/boot/dts/bcm2710-rpi-cm3.dts" ---- a/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dts -+++ b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dts -@@ -1,3 +1 @@ --#define RPI364 -- - #include "../../../../arm/boot/dts/bcm2711-rpi-4-b.dts" diff --git a/target/linux/bcm27xx/patches-5.10/950-0351-overlays-Add-option-to-disable-composite-to-vc4-kms-.patch b/target/linux/bcm27xx/patches-5.10/950-0351-overlays-Add-option-to-disable-composite-to-vc4-kms-.patch deleted file mode 100644 index dae08fe9e3..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0351-overlays-Add-option-to-disable-composite-to-vc4-kms-.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 8c4205446ace4f14ec8725d11f46b570e9bc1fd3 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Fri, 23 Oct 2020 14:15:41 +0100 -Subject: [PATCH] overlays: Add option to disable composite to - vc4-kms-v3d - -Composite gets enabled automatically if HDMI isn't detected, -which can cause some grief in X should it be not connected -and touchscreens are in use. - -Signed-off-by: Dave Stevenson ---- - arch/arm/boot/dts/overlays/README | 2 ++ - arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts | 1 + - 2 files changed, 3 insertions(+) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -2949,6 +2949,8 @@ Params: cma-512 CMA is 5 - cma-default Use upstream's default value - audio Enable or disable audio over HDMI (default "on") - noaudio Disable all HDMI audio (default "off") -+ nocomposite Disable the composite video output (default -+ "off") - - - Name: vc4-kms-v3d-pi4 ---- a/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts -+++ b/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts -@@ -118,5 +118,6 @@ - __overrides__ { - audio = <0>,"!13", <0>,"=14"; - noaudio = <0>,"=13", <0>,"!14"; -+ nocomposite = <0>, "!11"; - }; - }; diff --git a/target/linux/bcm27xx/patches-5.10/950-0352-overlays-imx219-Correct-link-frequency-to-match-the-.patch b/target/linux/bcm27xx/patches-5.10/950-0352-overlays-imx219-Correct-link-frequency-to-match-the-.patch deleted file mode 100644 index de77b9dfb0..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0352-overlays-imx219-Correct-link-frequency-to-match-the-.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7ba47043d428bce18161417f134ca6492d097744 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 11 Mar 2020 12:07:57 +0000 -Subject: [PATCH] overlays: imx219: Correct link frequency to match the - upstream driver - -The upstream driver is checking the link frequency parameter, and -the overlay had the wrong value. - -Signed-off-by: Dave Stevenson ---- - arch/arm/boot/dts/overlays/imx219-overlay.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm/boot/dts/overlays/imx219-overlay.dts -+++ b/arch/arm/boot/dts/overlays/imx219-overlay.dts -@@ -36,7 +36,7 @@ - data-lanes = <1 2>; - clock-noncontinuous; - link-frequencies = -- /bits/ 64 <297000000>; -+ /bits/ 64 <456000000>; - }; - }; - }; diff --git a/target/linux/bcm27xx/patches-5.10/950-0353-dts-Add-CM4-to-arm64-dt-files.patch b/target/linux/bcm27xx/patches-5.10/950-0353-dts-Add-CM4-to-arm64-dt-files.patch deleted file mode 100644 index 706154b55a..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0353-dts-Add-CM4-to-arm64-dt-files.patch +++ /dev/null @@ -1,28 +0,0 @@ -From aa9f4bd2a82bc227bc5d11939ad3cacb7a2663e6 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Fri, 23 Oct 2020 15:45:11 +0100 -Subject: [PATCH] dts: Add CM4 to arm64 dt files - -Signed-off-by: Dave Stevenson ---- - arch/arm64/boot/dts/broadcom/Makefile | 3 ++- - arch/arm64/boot/dts/broadcom/bcm2711-rpi-cm4.dts | 1 + - 2 files changed, 3 insertions(+), 1 deletion(-) - create mode 100644 arch/arm64/boot/dts/broadcom/bcm2711-rpi-cm4.dts - ---- a/arch/arm64/boot/dts/broadcom/Makefile -+++ b/arch/arm64/boot/dts/broadcom/Makefile -@@ -7,7 +7,8 @@ dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rp - dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-3-b.dtb - dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-2-b.dtb - dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-3-b.dtb --dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-4-b.dtb -+dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-4-b.dtb \ -+ bcm2711-rpi-cm4.dtb - dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-3-b-plus.dtb - dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-cm3.dtb - dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-cm3.dtb ---- /dev/null -+++ b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-cm4.dts -@@ -0,0 +1 @@ -+#include "../../../../arm/boot/dts/bcm2711-rpi-cm4.dts" diff --git a/target/linux/bcm27xx/patches-5.10/950-0356-dts-Tidy-the-Raspberry-Pi-Makefile-entries.patch b/target/linux/bcm27xx/patches-5.10/950-0356-dts-Tidy-the-Raspberry-Pi-Makefile-entries.patch deleted file mode 100644 index c8e659d42c..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0356-dts-Tidy-the-Raspberry-Pi-Makefile-entries.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 8364d0445bde9900c7ef8e6f6d4ba2642dca0807 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 26 Oct 2020 15:01:21 +0000 -Subject: [PATCH] dts: Tidy the Raspberry Pi Makefile entries - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/Makefile | 2 +- - arch/arm64/boot/dts/broadcom/Makefile | 7 ++----- - 2 files changed, 3 insertions(+), 6 deletions(-) - ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -10,8 +10,8 @@ dtb-$(CONFIG_ARCH_BCM2835) += \ - bcm2709-rpi-2-b.dtb \ - bcm2710-rpi-2-b.dtb \ - bcm2710-rpi-3-b.dtb \ -- bcm2711-rpi-4-b.dtb \ - bcm2710-rpi-3-b-plus.dtb \ -+ bcm2711-rpi-4-b.dtb \ - bcm2710-rpi-cm3.dtb \ - bcm2711-rpi-cm4.dtb - ---- a/arch/arm64/boot/dts/broadcom/Makefile -+++ b/arch/arm64/boot/dts/broadcom/Makefile -@@ -3,15 +3,12 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rp - bcm2837-rpi-3-b.dtb \ - bcm2837-rpi-3-b-plus.dtb \ - bcm2837-rpi-cm3-io3.dtb --dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-2-b.dtb --dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-3-b.dtb - dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-2-b.dtb - dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-3-b.dtb --dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-4-b.dtb \ -- bcm2711-rpi-cm4.dtb - dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-3-b-plus.dtb --dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-cm3.dtb -+dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-4-b.dtb - dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-cm3.dtb -+dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-cm4.dtb - - subdir-y += northstar2 - subdir-y += stingray diff --git a/target/linux/bcm27xx/patches-5.10/950-0358-ARM-dts-Disable-headphone-audio-on-Zeroes-CM4.patch b/target/linux/bcm27xx/patches-5.10/950-0358-ARM-dts-Disable-headphone-audio-on-Zeroes-CM4.patch deleted file mode 100644 index e7801c1bed..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0358-ARM-dts-Disable-headphone-audio-on-Zeroes-CM4.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 895b2a5d3578ff5b91be41eb099280e2c63cb25c Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 26 Oct 2020 10:18:50 +0000 -Subject: [PATCH] ARM: dts: Disable headphone audio on Zeroes, CM4 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/bcm2708-rpi-zero-w.dts | 1 + - arch/arm/boot/dts/bcm2708-rpi-zero.dts | 1 + - arch/arm/boot/dts/bcm2711-rpi-cm4.dts | 1 + - 3 files changed, 3 insertions(+) - ---- a/arch/arm/boot/dts/bcm2708-rpi-zero-w.dts -+++ b/arch/arm/boot/dts/bcm2708-rpi-zero-w.dts -@@ -152,6 +152,7 @@ - &audio { - pinctrl-names = "default"; - pinctrl-0 = <&audio_pins>; -+ brcm,disable-headphones = <1>; - }; - - / { ---- a/arch/arm/boot/dts/bcm2708-rpi-zero.dts -+++ b/arch/arm/boot/dts/bcm2708-rpi-zero.dts -@@ -106,6 +106,7 @@ - &audio { - pinctrl-names = "default"; - pinctrl-0 = <&audio_pins>; -+ brcm,disable-headphones = <1>; - }; - - / { ---- a/arch/arm/boot/dts/bcm2711-rpi-cm4.dts -+++ b/arch/arm/boot/dts/bcm2711-rpi-cm4.dts -@@ -574,6 +574,7 @@ - &audio { - pinctrl-names = "default"; - pinctrl-0 = <&audio_pins>; -+ brcm,disable-headphones = <1>; - }; - - / { diff --git a/target/linux/bcm27xx/patches-5.10/950-0359-overlays-Enable-headphone-audio-in-audremap.patch b/target/linux/bcm27xx/patches-5.10/950-0359-overlays-Enable-headphone-audio-in-audremap.patch deleted file mode 100644 index d0bd203852..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0359-overlays-Enable-headphone-audio-in-audremap.patch +++ /dev/null @@ -1,26 +0,0 @@ -From b16e7c1d42fafe29a34e8e0449c2d94debb38dc4 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 26 Oct 2020 10:21:23 +0000 -Subject: [PATCH] overlays: Enable headphone audio in audremap - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/audremap-overlay.dts | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/arm/boot/dts/overlays/audremap-overlay.dts -+++ b/arch/arm/boot/dts/overlays/audremap-overlay.dts -@@ -26,6 +26,13 @@ - }; - }; - -+ fragment@3 { -+ target = <&audio>; -+ __overlay__ { -+ brcm,disable-headphones = <0>; -+ }; -+ }; -+ - __overrides__ { - swap_lr = <&frag0>, "swap_lr?"; - enable_jack = <&frag0>, "enable_jack?"; diff --git a/target/linux/bcm27xx/patches-5.10/950-0361-ARM-dts-Expand-PCIe-space-on-BCM2711.patch b/target/linux/bcm27xx/patches-5.10/950-0361-ARM-dts-Expand-PCIe-space-on-BCM2711.patch deleted file mode 100644 index 34b63f58ed..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0361-ARM-dts-Expand-PCIe-space-on-BCM2711.patch +++ /dev/null @@ -1,30 +0,0 @@ -From f78a15dcaf63a5ad478670fd1d52d85261e88f37 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 26 Oct 2020 10:35:43 +0000 -Subject: [PATCH] ARM: dts: Expand PCIe space on BCM2711 - -Attempts to connect external GPUs to Compute Module 4's PCIe bus have -highlighted that the existing "outbound window" - the fraction of the -PCI address base that is appears in the host's memory map - is -restrictively small. Expand the window to a full 1GB. - -See: https://www.raspberrypi.org/forums/viewtopic.php?f=98&t=288902 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/bcm2711.dtsi | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/arm/boot/dts/bcm2711.dtsi -+++ b/arch/arm/boot/dts/bcm2711.dtsi -@@ -560,8 +560,8 @@ - msi-controller; - msi-parent = <&pcie0>; - -- ranges = <0x02000000 0x0 0xf8000000 0x6 0x00000000 -- 0x0 0x04000000>; -+ ranges = <0x02000000 0x0 0xc0000000 0x6 0x00000000 -+ 0x0 0x40000000>; - /* - * The wrapper around the PCIe block has a bug - * preventing it from accessing beyond the first 3GB of diff --git a/target/linux/bcm27xx/patches-5.10/950-0363-gpio-fsm-Fix-a-build-warning.patch b/target/linux/bcm27xx/patches-5.10/950-0363-gpio-fsm-Fix-a-build-warning.patch deleted file mode 100644 index 742d23bbc9..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0363-gpio-fsm-Fix-a-build-warning.patch +++ /dev/null @@ -1,22 +0,0 @@ -From f6df23eb130f2407565db92e60b66a56b9b6fdea Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Tue, 27 Oct 2020 12:10:04 +0000 -Subject: [PATCH] gpio-fsm: Fix a build warning - -Signed-off-by: Phil Elwell ---- - drivers/gpio/gpio-fsm.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/gpio/gpio-fsm.c -+++ b/drivers/gpio/gpio-fsm.c -@@ -956,7 +956,8 @@ static int gpio_fsm_probe(struct platfor - // add reserved words to the symbol table - for (i = 0; i < ARRAY_SIZE(reserved_symbols); i++) { - if (reserved_symbols[i]) -- add_symbol(&gf->symtab, reserved_symbols[i], (void *)i); -+ add_symbol(&gf->symtab, reserved_symbols[i], -+ (void *)(uintptr_t)i); - } - - // parse the state diff --git a/target/linux/bcm27xx/patches-5.10/950-0366-PiFi-40-Devicetree-files.patch b/target/linux/bcm27xx/patches-5.10/950-0366-PiFi-40-Devicetree-files.patch deleted file mode 100644 index 2f8db38b81..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0366-PiFi-40-Devicetree-files.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 5dd5b4625a4435f64ee6a1c9f47e3609e771f14b Mon Sep 17 00:00:00 2001 -From: David Knell -Date: Wed, 28 Oct 2020 14:20:56 +0000 -Subject: [PATCH] PiFi-40 Devicetree files - -Signed-off-by: David Knell ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 +++ - .../arm/boot/dts/overlays/pifi-40-overlay.dts | 50 +++++++++++++++++++ - 3 files changed, 57 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/pifi-40-overlay.dts - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -125,6 +125,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - pca953x.dtbo \ - pibell.dtbo \ - pifacedigital.dtbo \ -+ pifi-40.dtbo \ - piglow.dtbo \ - piscreen.dtbo \ - piscreen2r.dtbo \ ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -2000,6 +2000,12 @@ Params: spi-present-mask 8-bit in - 0-3, which can be configured with JP1 and JP2. - - -+Name: pifi-40 -+Info: Configures the PiFi 40W stereo amplifier -+Load: dtoverlay=pifi-40 -+Params: -+ -+ - Name: piglow - Info: Configures the PiGlow by pimoroni.com - Load: dtoverlay=piglow ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/pifi-40-overlay.dts -@@ -0,0 +1,50 @@ -+// Definitions for PiFi-40 Amp -+/dts-v1/; -+/plugin/; -+#include -+/ { -+ compatible = "brcm,bcm2835"; -+ -+ fragment@0 { -+ target = <&i2s>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ tas5711l: audio-codec@1a { -+ compatible = "ti,tas5711"; -+ reg = <0x1a>; -+ #sound-dai-cells = <0>; -+ sound-name-prefix = "Left"; -+ status = "okay"; -+ }; -+ -+ tas5711r: audio-codec@1b { -+ compatible = "ti,tas5711"; -+ reg = <0x1b>; -+ #sound-dai-cells = <0>; -+ sound-name-prefix = "Right"; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&sound>; -+ pifi_40: __overlay__ { -+ compatible = "pifi,pifi-40"; -+ audio-codec = <&tas5711l &tas5711r>; -+ i2s-controller = <&i2s>; -+ pdn-gpios = <&gpio 23 1>; -+ status = "okay"; -+ }; -+ }; -+}; diff --git a/target/linux/bcm27xx/patches-5.10/950-0367-PiFi-40-driver-Makefile-and-Kconfig.patch b/target/linux/bcm27xx/patches-5.10/950-0367-PiFi-40-driver-Makefile-and-Kconfig.patch deleted file mode 100644 index 82e781b08c..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0367-PiFi-40-driver-Makefile-and-Kconfig.patch +++ /dev/null @@ -1,332 +0,0 @@ -From 0fa0f5932fff8c960862176fd61a7bccd2f28b90 Mon Sep 17 00:00:00 2001 -From: David Knell -Date: Wed, 28 Oct 2020 14:21:37 +0000 -Subject: [PATCH] PiFi-40 driver, Makefile and Kconfig - -Signed-off-by: David Knell ---- - sound/soc/bcm/Kconfig | 8 ++ - sound/soc/bcm/Makefile | 3 + - sound/soc/bcm/pifi-40.c | 283 ++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 294 insertions(+) - create mode 100644 sound/soc/bcm/pifi-40.c - ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -100,6 +100,14 @@ config SND_BCM2708_SOC_HIFIBERRY_AMP - help - Say Y or M if you want to add support for the HifiBerry Amp amplifier board. - -+ config SND_BCM2708_SOC_PIFI_40 -+ tristate "Support for the PiFi-40 amp" -+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -+ select SND_SOC_TAS571X -+ select SND_PIFI_40 -+ help -+ Say Y or M if you want to add support for the PiFi40 amp board -+ - config SND_BCM2708_SOC_RPI_CIRRUS - tristate "Support for Cirrus Logic Audio Card" - depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -45,6 +45,7 @@ snd-soc-pisound-objs := pisound.o - snd-soc-fe-pi-audio-objs := fe-pi-audio.o - snd-soc-rpi-simple-soundcard-objs := rpi-simple-soundcard.o - snd-soc-rpi-wm8804-soundcard-objs := rpi-wm8804-soundcard.o -+snd-soc-pifi-40-objs := pifi-40.o - - obj-$(CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD) += snd-soc-googlevoicehat-codec.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o -@@ -74,3 +75,5 @@ obj-$(CONFIG_SND_PISOUND) += snd-soc-pis - obj-$(CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO) += snd-soc-fe-pi-audio.o - obj-$(CONFIG_SND_RPI_SIMPLE_SOUNDCARD) += snd-soc-rpi-simple-soundcard.o - obj-$(CONFIG_SND_RPI_WM8804_SOUNDCARD) += snd-soc-rpi-wm8804-soundcard.o -+obj-$(CONFIG_SND_BCM2708_SOC_PIFI_40) += snd-soc-pifi-40.o -+ ---- /dev/null -+++ b/sound/soc/bcm/pifi-40.c -@@ -0,0 +1,283 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* -+ * ALSA ASoC Machine Driver for PiFi-40 -+ * -+ * Author: David Knell -+ * based on code by Florian Meier -+ * Copyright (C) 2020 -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static struct gpio_desc *pdn_gpio; -+static int vol = 0x30; -+ -+// Volume control -+static int pifi_40_vol_get(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ ucontrol->value.integer.value[0] = vol; -+ ucontrol->value.integer.value[1] = vol; -+ return 0; -+} -+ -+static int pifi_40_vol_set(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); -+ struct snd_soc_pcm_runtime *rtd; -+ unsigned int v = ucontrol->value.integer.value[0]; -+ struct snd_soc_component *dac[2]; -+ -+ rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); -+ dac[0] = asoc_rtd_to_codec(rtd, 0)->component; -+ dac[1] = asoc_rtd_to_codec(rtd, 1)->component; -+ -+ snd_soc_component_write(dac[0], 0x07, 255 - v); -+ snd_soc_component_write(dac[1], 0x07, 255 - v); -+ -+ vol = v; -+ return 1; -+} -+ -+static const DECLARE_TLV_DB_SCALE(digital_tlv_master, -10350, 50, 1); -+static const struct snd_kcontrol_new pifi_40_controls[] = { -+ SOC_DOUBLE_R_EXT_TLV("Master Volume", 0x00, 0x01, -+ 0x00, // Min -+ 0xff, // Max -+ 0x01, // Invert -+ pifi_40_vol_get, pifi_40_vol_set, -+ digital_tlv_master) -+}; -+ -+static const char * const codec_ctl_pfx[] = { "Left", "Right" }; -+ -+static const char * const codec_ctl_name[] = { "Master Volume", -+ "Speaker Volume", -+ "Speaker Switch" }; -+ -+static int snd_pifi_40_init(struct snd_soc_pcm_runtime *rtd) -+{ -+ struct snd_soc_card *card = rtd->card; -+ struct snd_soc_component *dac[2]; -+ struct snd_kcontrol *kctl; -+ int i, j; -+ -+ dac[0] = asoc_rtd_to_codec(rtd, 0)->component; -+ dac[1] = asoc_rtd_to_codec(rtd, 1)->component; -+ -+ -+ // Set up cards - pulse power down first -+ gpiod_set_value_cansleep(pdn_gpio, 1); -+ usleep_range(1000, 10000); -+ gpiod_set_value_cansleep(pdn_gpio, 0); -+ usleep_range(20000, 30000); -+ -+ // Oscillator trim -+ snd_soc_component_write(dac[0], 0x1b, 0); -+ snd_soc_component_write(dac[1], 0x1b, 0); -+ usleep_range(60000, 80000); -+ -+ // Common setup -+ for (i = 0; i < 2; i++) { -+ // MCLK at 64fs, sample rate 44.1 or 48kHz -+ snd_soc_component_write(dac[i], 0x00, 0x60); -+ -+ // Set up for PBTL -+ snd_soc_component_write(dac[i], 0x19, 0x3A); -+ snd_soc_component_write(dac[i], 0x25, 0x01103245); -+ -+ // Master vol to -10db -+ snd_soc_component_write(dac[i], 0x07, 0x44); -+ } -+ // Inputs set to L and R respectively -+ snd_soc_component_write(dac[0], 0x20, 0x00017772); -+ snd_soc_component_write(dac[1], 0x20, 0x00107772); -+ -+ // Remove codec controls -+ for (i = 0; i < 2; i++) { -+ for (j = 0; j < 3; j++) { -+ char cname[256]; -+ -+ sprintf(cname, "%s %s", codec_ctl_pfx[i], -+ codec_ctl_name[j]); -+ kctl = snd_soc_card_get_kcontrol(card, cname); -+ if (!kctl) { -+ pr_info("Control %s not found\n", -+ cname); -+ } else { -+ kctl->vd[0].access = -+ SNDRV_CTL_ELEM_ACCESS_READWRITE; -+ snd_ctl_remove(card->snd_card, kctl); -+ } -+ } -+ } -+ -+ return 0; -+} -+ -+static int snd_pifi_40_hw_params(struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); -+ unsigned int sample_bits; -+ -+ sample_bits = snd_pcm_format_physical_width(params_format(params)); -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, 64); -+} -+ -+static struct snd_soc_ops snd_pifi_40_ops = { .hw_params = -+ snd_pifi_40_hw_params }; -+ -+static struct snd_soc_dai_link_component pifi_40_codecs[] = { -+ { -+ .dai_name = "tas571x-hifi", -+ }, -+ { -+ .dai_name = "tas571x-hifi", -+ }, -+}; -+ -+SND_SOC_DAILINK_DEFS( -+ pifi_40_dai, DAILINK_COMP_ARRAY(COMP_EMPTY()), -+ DAILINK_COMP_ARRAY(COMP_CODEC("tas571x.1-001a", "tas571x-hifi"), -+ COMP_CODEC("tas571x.1-001b", "tas571x-hifi")), -+ DAILINK_COMP_ARRAY(COMP_EMPTY())); -+ -+static struct snd_soc_dai_link snd_pifi_40_dai[] = { -+ { -+ .name = "PiFi40", -+ .stream_name = "PiFi40", -+ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | -+ SND_SOC_DAIFMT_CBS_CFS, -+ .ops = &snd_pifi_40_ops, -+ .init = snd_pifi_40_init, -+ SND_SOC_DAILINK_REG(pifi_40_dai), -+ }, -+}; -+ -+// Machine driver -+static struct snd_soc_card snd_pifi_40 = { -+ .name = "PiFi40", -+ .owner = THIS_MODULE, -+ .dai_link = snd_pifi_40_dai, -+ .num_links = ARRAY_SIZE(snd_pifi_40_dai), -+ .controls = pifi_40_controls, -+ .num_controls = ARRAY_SIZE(pifi_40_controls) -+}; -+ -+static void snd_pifi_40_pdn(struct snd_soc_card *card, int on) -+{ -+ if (pdn_gpio) -+ gpiod_set_value_cansleep(pdn_gpio, on ? 0 : 1); -+} -+ -+static int snd_pifi_40_probe(struct platform_device *pdev) -+{ -+ struct snd_soc_card *card = &snd_pifi_40; -+ int ret = 0, i = 0; -+ -+ card->dev = &pdev->dev; -+ platform_set_drvdata(pdev, &snd_pifi_40); -+ -+ if (pdev->dev.of_node) { -+ struct device_node *i2s_node; -+ struct snd_soc_dai_link *dai; -+ -+ dai = &snd_pifi_40_dai[0]; -+ i2s_node = of_parse_phandle(pdev->dev.of_node, "i2s-controller", -+ 0); -+ if (i2s_node) { -+ for (i = 0; i < card->num_links; i++) { -+ dai->cpus->dai_name = NULL; -+ dai->cpus->of_node = i2s_node; -+ dai->platforms->name = NULL; -+ dai->platforms->of_node = i2s_node; -+ } -+ } -+ -+ pifi_40_codecs[0].of_node = -+ of_parse_phandle(pdev->dev.of_node, "audio-codec", 0); -+ pifi_40_codecs[1].of_node = -+ of_parse_phandle(pdev->dev.of_node, "audio-codec", 1); -+ if (!pifi_40_codecs[0].of_node || !pifi_40_codecs[1].of_node) { -+ dev_err(&pdev->dev, -+ "Property 'audio-codec' missing or invalid\n"); -+ return -EINVAL; -+ } -+ -+ pdn_gpio = devm_gpiod_get_optional(&pdev->dev, "pdn", -+ GPIOD_OUT_LOW); -+ if (IS_ERR(pdn_gpio)) { -+ ret = PTR_ERR(pdn_gpio); -+ dev_err(&pdev->dev, "failed to get pdn gpio: %d\n", -+ ret); -+ return ret; -+ } -+ -+ ret = snd_soc_register_card(&snd_pifi_40); -+ if (ret < 0) { -+ dev_err(&pdev->dev, -+ "snd_soc_register_card() failed: %d\n", ret); -+ return ret; -+ } -+ -+ return 0; -+ } -+ -+ return -EINVAL; -+} -+ -+static int snd_pifi_40_remove(struct platform_device *pdev) -+{ -+ struct snd_soc_card *card = platform_get_drvdata(pdev); -+ -+ kfree(&card->drvdata); -+ snd_pifi_40_pdn(&snd_pifi_40, 0); -+ return snd_soc_unregister_card(&snd_pifi_40); -+} -+ -+static const struct of_device_id snd_pifi_40_of_match[] = { -+ { -+ .compatible = "pifi,pifi-40", -+ }, -+ { /* sentinel */ }, -+}; -+ -+MODULE_DEVICE_TABLE(of, snd_pifi_40_of_match); -+ -+static struct platform_driver snd_pifi_40_driver = { -+ .driver = { -+ .name = "snd-pifi-40", -+ .owner = THIS_MODULE, -+ .of_match_table = snd_pifi_40_of_match, -+ }, -+ .probe = snd_pifi_40_probe, -+ .remove = snd_pifi_40_remove, -+}; -+ -+module_platform_driver(snd_pifi_40_driver); -+ -+MODULE_AUTHOR("David Knell "); -+MODULE_DESCRIPTION("ALSA ASoC Machine Driver for PiFi-40"); -+MODULE_LICENSE("GPL v2"); diff --git a/target/linux/bcm27xx/patches-5.10/950-0373-overlays-Add-MAX31856-support-to-maxtherm-overlay.patch b/target/linux/bcm27xx/patches-5.10/950-0373-overlays-Add-MAX31856-support-to-maxtherm-overlay.patch deleted file mode 100644 index e7e6ee0bd8..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0373-overlays-Add-MAX31856-support-to-maxtherm-overlay.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 9444edfa8b5b18f8727b82853dd50345a400a316 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 22 Oct 2020 17:11:12 +0100 -Subject: [PATCH] overlays: Add MAX31856 support to maxtherm overlay - -Extend the maxtherm overlay with support for the MAX31856. -The driver reads the thermocouple type from a property, which is much -more civilised. - -See: https://github.com/raspberrypi/linux/issues/3915 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/README | 18 ++++++++++++----- - .../boot/dts/overlays/maxtherm-overlay.dts | 20 +++++++++++++++++++ - 2 files changed, 33 insertions(+), 5 deletions(-) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -1666,20 +1666,19 @@ Params: no-sdmode Driver d - - - Name: maxtherm --Info: Configure a MAX6675 or MAX31855 thermocouple as an IIO device. -+Info: Configure a MAX6675, MAX31855 or MAX31856 thermocouple as an IIO device. - - For devices on spi1 or spi2, the interfaces should be enabled - with one of the spi1-1/2/3cs and/or spi2-1/2/3cs overlays. - The overlay expects to disable the relevant spidev node, so also using - e.g. cs0_spidev=off is unnecessary. - -- Note: with the 5.7 kernel (and later) there will also be -- overlays for MAX31855E, MAX31855J, MAX31855K, -- MAX31885N, MAX31855R, MAX31855S and MAX31855T. -- - Example: - MAX31855 on /dev/spidev0.0 - dtoverlay=maxtherm,spi0-0,max31855 -+ MAX31856 using a type J thermocouple on /dev/spidev2.1 -+ dtoverlay=spi2-2cs -+ dtoverlay=maxtherm,spi2-1,max31856,type_j - - Load: dtoverlay=maxtherm,= - Params: spi- Configure device at spi, cs -@@ -1693,6 +1692,15 @@ Params: spi- Configur - max31855r Enable support for the MAX31855R - max31855s Enable support for the MAX31855S - max31855t Enable support for the MAX31855T -+ max31856 Enable support for the MAX31856 (with type K) -+ type_b Select a type B sensor for max31856 -+ type_e Select a type E sensor for max31856 -+ type_j Select a type J sensor for max31856 -+ type_k Select a type K sensor for max31856 -+ type_n Select a type N sensor for max31856 -+ type_r Select a type R sensor for max31856 -+ type_s Select a type S sensor for max31856 -+ type_t Select a type T sensor for max31856 - - - Name: mbed-dac ---- a/arch/arm/boot/dts/overlays/maxtherm-overlay.dts -+++ b/arch/arm/boot/dts/overlays/maxtherm-overlay.dts -@@ -5,6 +5,8 @@ - /dts-v1/; - /plugin/; - -+#include -+ - / { - compatible = "brcm,bcm2835"; - -@@ -128,6 +130,15 @@ - }; - }; - -+ fragment@16 { -+ target = <&max>; -+ __dormant__ { -+ compatible = "maxim,max31856"; -+ spi-cpha; -+ thermocouple-type = ; -+ }; -+ }; -+ - __overrides__ { - spi0-0 = <0>, "+0", - <&maxfrag>,"target:0=",<&spi0>, -@@ -162,5 +173,14 @@ - max31855r = <0>,"+13"; - max31855s = <0>,"+14"; - max31855t = <0>,"+15"; -+ max31856 = <0>,"+16"; -+ type_b = <&max>,"thermocouple-type:0=",; -+ type_e = <&max>,"thermocouple-type:0=",; -+ type_j = <&max>,"thermocouple-type:0=",; -+ type_k = <&max>,"thermocouple-type:0=",; -+ type_n = <&max>,"thermocouple-type:0=",; -+ type_r = <&max>,"thermocouple-type:0=",; -+ type_s = <&max>,"thermocouple-type:0=",; -+ type_t = <&max>,"thermocouple-type:0=",; - }; - }; diff --git a/target/linux/bcm27xx/patches-5.10/950-0374-ARM-dts-Add-bcm2711-rpi-400.dts.patch b/target/linux/bcm27xx/patches-5.10/950-0374-ARM-dts-Add-bcm2711-rpi-400.dts.patch deleted file mode 100644 index 4b9a7e55a1..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0374-ARM-dts-Add-bcm2711-rpi-400.dts.patch +++ /dev/null @@ -1,657 +0,0 @@ -From 57e4984d7b342860d635155c13bf747d2c225e26 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Tue, 14 Jul 2020 14:21:33 +0100 -Subject: [PATCH] ARM: dts: Add bcm2711-rpi-400.dts - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/Makefile | 1 + - arch/arm/boot/dts/bcm2711-rpi-400.dts | 615 ++++++++++++++++++ - arch/arm64/boot/dts/broadcom/Makefile | 1 + - .../boot/dts/broadcom/bcm2711-rpi-400.dts | 1 + - 4 files changed, 618 insertions(+) - create mode 100644 arch/arm/boot/dts/bcm2711-rpi-400.dts - create mode 100644 arch/arm64/boot/dts/broadcom/bcm2711-rpi-400.dts - ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -12,6 +12,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \ - bcm2710-rpi-3-b.dtb \ - bcm2710-rpi-3-b-plus.dtb \ - bcm2711-rpi-4-b.dtb \ -+ bcm2711-rpi-400.dtb \ - bcm2710-rpi-cm3.dtb \ - bcm2711-rpi-cm4.dtb - ---- /dev/null -+++ b/arch/arm/boot/dts/bcm2711-rpi-400.dts -@@ -0,0 +1,615 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/dts-v1/; -+#include "bcm2711.dtsi" -+#include "bcm2835-rpi.dtsi" -+ -+#include -+ -+/ { -+ compatible = "raspberrypi,400", "brcm,bcm2711"; -+ model = "Raspberry Pi 400"; -+ -+ chosen { -+ /* 8250 auxiliary UART instead of pl011 */ -+ stdout-path = "serial1:115200n8"; -+ }; -+ -+ /* Will be filled by the bootloader */ -+ memory@0 { -+ device_type = "memory"; -+ reg = <0 0 0>; -+ }; -+ -+ aliases { -+ emmc2bus = &emmc2bus; -+ ethernet0 = &genet; -+ pcie0 = &pcie0; -+ }; -+ -+ leds { -+ act { -+ gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; -+ }; -+ -+ pwr { -+ label = "PWR"; -+ gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; -+ default-state = "keep"; -+ linux,default-trigger = "default-on"; -+ }; -+ }; -+ -+ wifi_pwrseq: wifi-pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; -+ }; -+ -+ sd_io_1v8_reg: sd_io_1v8_reg { -+ compatible = "regulator-gpio"; -+ regulator-name = "vdd-sd-io"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-boot-on; -+ regulator-always-on; -+ regulator-settling-time-us = <5000>; -+ gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>; -+ states = <1800000 0x1 -+ 3300000 0x0>; -+ status = "okay"; -+ }; -+ -+ sd_vcc_reg: sd_vcc_reg { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc-sd"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-boot-on; -+ enable-active-high; -+ gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; -+ }; -+}; -+ -+&ddc0 { -+ status = "okay"; -+}; -+ -+&ddc1 { -+ status = "okay"; -+}; -+ -+&firmware { -+ firmware_clocks: clocks { -+ compatible = "raspberrypi,firmware-clocks"; -+ #clock-cells = <1>; -+ }; -+ -+ expgpio: gpio { -+ compatible = "raspberrypi,firmware-gpio"; -+ gpio-controller; -+ #gpio-cells = <2>; -+ gpio-line-names = "BT_ON", -+ "WL_ON", -+ "PWR_LED_OFF", -+ "GLOBAL_RESET", -+ "VDD_SD_IO_SEL", -+ "CAM_GPIO", -+ "SD_PWR_ON", -+ "SD_OC_N"; -+ status = "okay"; -+ }; -+ -+ reset: reset { -+ compatible = "raspberrypi,firmware-reset"; -+ #reset-cells = <1>; -+ }; -+}; -+ -+&gpio { -+ /* -+ * Parts taken from rpi_SCH_4b_4p0_reduced.pdf and -+ * the official GPU firmware DT blob. -+ * -+ * Legend: -+ * "FOO" = GPIO line named "FOO" on the schematic -+ * "FOO_N" = GPIO line named "FOO" on schematic, active low -+ */ -+ gpio-line-names = "ID_SDA", -+ "ID_SCL", -+ "SDA1", -+ "SCL1", -+ "GPIO_GCLK", -+ "GPIO5", -+ "GPIO6", -+ "SPI_CE1_N", -+ "SPI_CE0_N", -+ "SPI_MISO", -+ "SPI_MOSI", -+ "SPI_SCLK", -+ "GPIO12", -+ "GPIO13", -+ /* Serial port */ -+ "TXD1", -+ "RXD1", -+ "GPIO16", -+ "GPIO17", -+ "GPIO18", -+ "GPIO19", -+ "GPIO20", -+ "GPIO21", -+ "GPIO22", -+ "GPIO23", -+ "GPIO24", -+ "GPIO25", -+ "GPIO26", -+ "GPIO27", -+ "RGMII_MDIO", -+ "RGMIO_MDC", -+ /* Used by BT module */ -+ "CTS0", -+ "RTS0", -+ "TXD0", -+ "RXD0", -+ /* Used by Wifi */ -+ "SD1_CLK", -+ "SD1_CMD", -+ "SD1_DATA0", -+ "SD1_DATA1", -+ "SD1_DATA2", -+ "SD1_DATA3", -+ /* Shared with SPI flash */ -+ "PWM0_MISO", -+ "PWM1_MOSI", -+ "STATUS_LED_G_CLK", -+ "SPIFLASH_CE_N", -+ "SDA0", -+ "SCL0", -+ "RGMII_RXCLK", -+ "RGMII_RXCTL", -+ "RGMII_RXD0", -+ "RGMII_RXD1", -+ "RGMII_RXD2", -+ "RGMII_RXD3", -+ "RGMII_TXCLK", -+ "RGMII_TXCTL", -+ "RGMII_TXD0", -+ "RGMII_TXD1", -+ "RGMII_TXD2", -+ "RGMII_TXD3"; -+}; -+ -+&hdmi0 { -+ clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>; -+ clock-names = "hdmi", "bvb", "audio", "cec"; -+ status = "okay"; -+}; -+ -+&hdmi1 { -+ clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>; -+ clock-names = "hdmi", "bvb", "audio", "cec"; -+ status = "okay"; -+}; -+ -+&hvs { -+ clocks = <&firmware_clocks 4>; -+}; -+ -+&pixelvalve0 { -+ status = "okay"; -+}; -+ -+&pixelvalve1 { -+ status = "okay"; -+}; -+ -+&pixelvalve2 { -+ status = "okay"; -+}; -+ -+&pixelvalve4 { -+ status = "okay"; -+}; -+ -+&pwm1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>; -+ status = "okay"; -+}; -+ -+/* SDHCI is used to control the SDIO for wireless */ -+&sdhci { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&emmc_gpio34>; -+ bus-width = <4>; -+ non-removable; -+ mmc-pwrseq = <&wifi_pwrseq>; -+ status = "okay"; -+ -+ brcmf: wifi@1 { -+ reg = <1>; -+ compatible = "brcm,bcm4329-fmac"; -+ }; -+}; -+ -+/* EMMC2 is used to drive the SD card */ -+&emmc2 { -+ vqmmc-supply = <&sd_io_1v8_reg>; -+ vmmc-supply = <&sd_vcc_reg>; -+ broken-cd; -+ status = "okay"; -+}; -+ -+&genet { -+ phy-handle = <&phy1>; -+ phy-mode = "rgmii-rxid"; -+ status = "okay"; -+}; -+ -+&genet_mdio { -+ phy1: ethernet-phy@1 { -+ /* No PHY interrupt */ -+ reg = <0x1>; -+ }; -+}; -+ -+&pcie0 { -+ pci@1,0 { -+ #address-cells = <3>; -+ #size-cells = <2>; -+ ranges; -+ -+ reg = <0 0 0 0 0>; -+ -+ usb@1,0 { -+ reg = <0x10000 0 0 0 0>; -+ resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>; -+ }; -+ }; -+}; -+ -+/* uart0 communicates with the BT module */ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>; -+ uart-has-rtscts; -+ status = "okay"; -+ -+ bluetooth { -+ compatible = "brcm,bcm43438-bt"; -+ max-speed = <2000000>; -+ shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>; -+ }; -+}; -+ -+/* uart1 is mapped to the pin header */ -+&uart1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart1_gpio14>; -+ status = "okay"; -+}; -+ -+&vchiq { -+ interrupts = ; -+}; -+ -+&vc4 { -+ status = "okay"; -+}; -+ -+&vec { -+ status = "disabled"; -+}; -+ -+// ============================================= -+// Downstream rpi- changes -+ -+#define BCM2711 -+ -+#include "bcm270x.dtsi" -+#include "bcm271x-rpi-bt.dtsi" -+ -+/ { -+ soc { -+ /delete-node/ pixelvalve@7e807000; -+ /delete-node/ hdmi@7e902000; -+ }; -+}; -+ -+#include "bcm2711-rpi.dtsi" -+#include "bcm283x-rpi-csi1-2lane.dtsi" -+#include "bcm283x-rpi-i2c0mux_0_44.dtsi" -+ -+/ { -+ chosen { -+ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1"; -+ }; -+ -+ aliases { -+ serial0 = &uart1; -+ serial1 = &uart0; -+ mmc0 = &emmc2; -+ mmc1 = &mmcnr; -+ mmc2 = &sdhost; -+ /delete-property/ i2c2; -+ i2c3 = &i2c3; -+ i2c4 = &i2c4; -+ i2c5 = &i2c5; -+ i2c6 = &i2c6; -+ /delete-property/ intc; -+ }; -+ -+ /delete-node/ wifi-pwrseq; -+}; -+ -+&mmcnr { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdio_pins>; -+ bus-width = <4>; -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-0 = <&uart0_pins &bt_pins>; -+ status = "okay"; -+}; -+ -+&uart1 { -+ pinctrl-0 = <&uart1_pins>; -+}; -+ -+&spi0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&spi0_pins &spi0_cs_pins>; -+ cs-gpios = <&gpio 8 1>, <&gpio 7 1>; -+ -+ spidev0: spidev@0{ -+ compatible = "spidev"; -+ reg = <0>; /* CE0 */ -+ #address-cells = <1>; -+ #size-cells = <0>; -+ spi-max-frequency = <125000000>; -+ }; -+ -+ spidev1: spidev@1{ -+ compatible = "spidev"; -+ reg = <1>; /* CE1 */ -+ #address-cells = <1>; -+ #size-cells = <0>; -+ spi-max-frequency = <125000000>; -+ }; -+}; -+ -+&gpio { -+ spi0_pins: spi0_pins { -+ brcm,pins = <9 10 11>; -+ brcm,function = ; -+ }; -+ -+ spi0_cs_pins: spi0_cs_pins { -+ brcm,pins = <8 7>; -+ brcm,function = ; -+ }; -+ -+ spi3_pins: spi3_pins { -+ brcm,pins = <1 2 3>; -+ brcm,function = ; -+ }; -+ -+ spi3_cs_pins: spi3_cs_pins { -+ brcm,pins = <0 24>; -+ brcm,function = ; -+ }; -+ -+ spi4_pins: spi4_pins { -+ brcm,pins = <5 6 7>; -+ brcm,function = ; -+ }; -+ -+ spi4_cs_pins: spi4_cs_pins { -+ brcm,pins = <4 25>; -+ brcm,function = ; -+ }; -+ -+ spi5_pins: spi5_pins { -+ brcm,pins = <13 14 15>; -+ brcm,function = ; -+ }; -+ -+ spi5_cs_pins: spi5_cs_pins { -+ brcm,pins = <12 26>; -+ brcm,function = ; -+ }; -+ -+ spi6_pins: spi6_pins { -+ brcm,pins = <19 20 21>; -+ brcm,function = ; -+ }; -+ -+ spi6_cs_pins: spi6_cs_pins { -+ brcm,pins = <18 27>; -+ brcm,function = ; -+ }; -+ -+ i2c0_pins: i2c0 { -+ brcm,pins = <0 1>; -+ brcm,function = ; -+ brcm,pull = ; -+ }; -+ -+ i2c1_pins: i2c1 { -+ brcm,pins = <2 3>; -+ brcm,function = ; -+ brcm,pull = ; -+ }; -+ -+ i2c3_pins: i2c3 { -+ brcm,pins = <4 5>; -+ brcm,function = ; -+ brcm,pull = ; -+ }; -+ -+ i2c4_pins: i2c4 { -+ brcm,pins = <8 9>; -+ brcm,function = ; -+ brcm,pull = ; -+ }; -+ -+ i2c5_pins: i2c5 { -+ brcm,pins = <12 13>; -+ brcm,function = ; -+ brcm,pull = ; -+ }; -+ -+ i2c6_pins: i2c6 { -+ brcm,pins = <22 23>; -+ brcm,function = ; -+ brcm,pull = ; -+ }; -+ -+ i2s_pins: i2s { -+ brcm,pins = <18 19 20 21>; -+ brcm,function = ; -+ }; -+ -+ sdio_pins: sdio_pins { -+ brcm,pins = <34 35 36 37 38 39>; -+ brcm,function = ; // alt3 = SD1 -+ brcm,pull = <0 2 2 2 2 2>; -+ }; -+ -+ bt_pins: bt_pins { -+ brcm,pins = "-"; // non-empty to keep btuart happy, //4 = 0 -+ // to fool pinctrl -+ brcm,function = <0>; -+ brcm,pull = <2>; -+ }; -+ -+ uart0_pins: uart0_pins { -+ brcm,pins = <32 33>; -+ brcm,function = ; -+ brcm,pull = <0 2>; -+ }; -+ -+ uart1_pins: uart1_pins { -+ brcm,pins; -+ brcm,function; -+ brcm,pull; -+ }; -+ -+ uart2_pins: uart2_pins { -+ brcm,pins = <0 1>; -+ brcm,function = ; -+ brcm,pull = <0 2>; -+ }; -+ -+ uart3_pins: uart3_pins { -+ brcm,pins = <4 5>; -+ brcm,function = ; -+ brcm,pull = <0 2>; -+ }; -+ -+ uart4_pins: uart4_pins { -+ brcm,pins = <8 9>; -+ brcm,function = ; -+ brcm,pull = <0 2>; -+ }; -+ -+ uart5_pins: uart5_pins { -+ brcm,pins = <12 13>; -+ brcm,function = ; -+ brcm,pull = <0 2>; -+ }; -+}; -+ -+&i2c0if { -+ clock-frequency = <100000>; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins>; -+ clock-frequency = <100000>; -+}; -+ -+&i2s { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2s_pins>; -+}; -+ -+/ { -+ __overrides__ { -+ /delete-property/ i2c2_baudrate; -+ /delete-property/ i2c2_iknowwhatimdoing; -+ }; -+}; -+ -+// ============================================= -+// Board specific stuff here -+ -+/ { -+ power_ctrl: power_ctrl { -+ compatible = "gpio-poweroff"; -+ gpios = <&expgpio 5 0>; -+ force; -+ }; -+}; -+ -+&sdhost { -+ status = "disabled"; -+}; -+ -+&phy1 { -+ led-modes = <0x00 0x08>; /* link/activity link */ -+}; -+ -+&gpio { -+ audio_pins: audio_pins { -+ brcm,pins = <40 41>; -+ brcm,function = <4>; -+ }; -+}; -+ -+&leds { -+ act_led: act { -+ label = "led0"; -+ linux,default-trigger = "default-on"; -+ default-state = "on"; -+ gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; -+ }; -+ -+ pwr_led: pwr { -+ label = "led1"; -+ linux,default-trigger = "default-on"; -+ gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; -+ }; -+}; -+ -+&pwm1 { -+ status = "disabled"; -+}; -+ -+&audio { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&audio_pins>; -+ brcm,disable-headphones = <1>; -+}; -+ -+/ { -+ __overrides__ { -+ act_led_gpio = <&act_led>,"gpios:4"; -+ act_led_activelow = <&act_led>,"gpios:8"; -+ act_led_trigger = <&act_led>,"linux,default-trigger"; -+ -+ pwr_led_gpio = <&pwr_led>,"gpios:4"; -+ pwr_led_activelow = <&pwr_led>,"gpios:8"; -+ pwr_led_trigger = <&pwr_led>,"linux,default-trigger"; -+ -+ eth_led0 = <&phy1>,"led-modes:0"; -+ eth_led1 = <&phy1>,"led-modes:4"; -+ -+ sd_poll_once = <&emmc2>, "non-removable?"; -+ spi_dma4 = <&spi0>, "dmas:0=", <&dma40>, -+ <&spi0>, "dmas:8=", <&dma40>; -+ }; -+}; ---- a/arch/arm64/boot/dts/broadcom/Makefile -+++ b/arch/arm64/boot/dts/broadcom/Makefile -@@ -7,6 +7,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rp - dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-3-b.dtb - dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-3-b-plus.dtb - dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-4-b.dtb -+dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-400.dtb - dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-cm3.dtb - dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-cm4.dtb - ---- /dev/null -+++ b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-400.dts -@@ -0,0 +1 @@ -+#include "../../../../arm/boot/dts/bcm2711-rpi-400.dts" diff --git a/target/linux/bcm27xx/patches-5.10/950-0375-overlays-Deprecate-and-delete-the-sdtweak-overlay.patch b/target/linux/bcm27xx/patches-5.10/950-0375-overlays-Deprecate-and-delete-the-sdtweak-overlay.patch deleted file mode 100644 index 72dc8877ce..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0375-overlays-Deprecate-and-delete-the-sdtweak-overlay.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 068c8b508a0501de9bda9d6d9a8c4ddc06cf7ff8 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 4 Nov 2020 11:25:02 +0000 -Subject: [PATCH] overlays: Deprecate and delete the sdtweak overlay - -The sdtweak overlay has been superseded by the board-specific -sd_* parameters such as sd_poll_once, sd_overclock etc. - -For example, replace: - - dtoverlay=sdtweak,poll_once - -with: - - dtparam=sd_poll_once - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/Makefile | 1 - - arch/arm/boot/dts/overlays/README | 27 +++---------------- - arch/arm/boot/dts/overlays/overlay_map.dts | 4 +++ - .../arm/boot/dts/overlays/sdtweak-overlay.dts | 25 ----------------- - 4 files changed, 8 insertions(+), 49 deletions(-) - delete mode 100644 arch/arm/boot/dts/overlays/sdtweak-overlay.dts - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -158,7 +158,6 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - sc16is752-spi1.dtbo \ - sdhost.dtbo \ - sdio.dtbo \ -- sdtweak.dtbo \ - sh1106-spi.dtbo \ - smi.dtbo \ - smi-dev.dtbo \ ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -2409,29 +2409,10 @@ Load: - - - Name: sdtweak --Info: Tunes the bcm2835-sdhost SD/MMC driver -- N.B. This functionality is now available via the sd_* dtparams in the -- base DTB. --Load: dtoverlay=sdtweak,= --Params: overclock_50 Clock (in MHz) to use when the MMC framework -- requests 50MHz -- -- force_pio Disable DMA support (default off) -- -- pio_limit Number of blocks above which to use DMA -- (default 1) -- -- debug Enable debug output (default off) -- -- poll_once Looks for a card once after booting. Useful -- for network booting scenarios to avoid the -- overhead of continuous polling. N.B. Using -- this option restricts the system to using a -- single card per boot (or none at all). -- (default off) -- -- enable Set to off to completely disable the interface -- (default on) -+Info: This overlay is now deprecated. Use the sd_* dtparams in the -+ base DTB, e.g. "dtoverlay=sdtweak,poll_once" becomes -+ "dtparam=sd_poll_once". -+Load: - - - Name: sh1106-spi ---- a/arch/arm/boot/dts/overlays/overlay_map.dts -+++ b/arch/arm/boot/dts/overlays/overlay_map.dts -@@ -61,6 +61,10 @@ - deprecated = "use sdio,bus_width=1,gpios_22_25"; - }; - -+ sdtweak { -+ deprecated = "use 'dtparam=sd_poll_once' etc."; -+ }; -+ - spi0-cs { - renamed = "spi0-2cs"; - }; ---- a/arch/arm/boot/dts/overlays/sdtweak-overlay.dts -+++ /dev/null -@@ -1,25 +0,0 @@ --/dts-v1/; --/plugin/; -- --/* Provide backwards compatible aliases for the old sdhost dtparams. */ -- --/{ -- compatible = "brcm,bcm2835"; -- -- fragment@0 { -- target = <&sdhost>; -- frag0: __overlay__ { -- brcm,overclock-50 = <0>; -- brcm,pio-limit = <1>; -- }; -- }; -- -- __overrides__ { -- overclock_50 = <&frag0>,"brcm,overclock-50:0"; -- force_pio = <&frag0>,"brcm,force-pio?"; -- pio_limit = <&frag0>,"brcm,pio-limit:0"; -- debug = <&frag0>,"brcm,debug?"; -- enable = <&frag0>,"status"; -- poll_once = <&frag0>,"non-removable?"; -- }; --}; diff --git a/target/linux/bcm27xx/patches-5.10/950-0376-ARM-dts-bcm27xx-Remove-enable_headphones-setting.patch b/target/linux/bcm27xx/patches-5.10/950-0376-ARM-dts-bcm27xx-Remove-enable_headphones-setting.patch deleted file mode 100644 index 0098c3227d..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0376-ARM-dts-bcm27xx-Remove-enable_headphones-setting.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 5ec30e3d930de9ca7bddbb8ef6b367c0bc89306f Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 5 Nov 2020 11:39:35 +0000 -Subject: [PATCH] ARM: dts: bcm27xx: Remove enable_headphones setting - -The enable_headphones parameter of the snd_bcm2835 module is forced -to 1 if enable_compat_alsa is 0, so setting them both on the kernel -command line is pointless (and, in the case of Pi 400 and Pi Zeroes, -confusing). - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/bcm2708-rpi-zero-w.dts | 2 +- - arch/arm/boot/dts/bcm2708-rpi-zero.dts | 2 +- - arch/arm/boot/dts/bcm270x.dtsi | 2 +- - arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts | 2 +- - arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 2 +- - arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 2 +- - arch/arm/boot/dts/bcm2711-rpi-400.dts | 2 +- - arch/arm/boot/dts/bcm2711-rpi-cm4.dts | 2 +- - 8 files changed, 8 insertions(+), 8 deletions(-) - ---- a/arch/arm/boot/dts/bcm2708-rpi-zero-w.dts -+++ b/arch/arm/boot/dts/bcm2708-rpi-zero-w.dts -@@ -11,7 +11,7 @@ - model = "Raspberry Pi Zero W"; - - chosen { -- bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1"; -+ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; - }; - - aliases { ---- a/arch/arm/boot/dts/bcm2708-rpi-zero.dts -+++ b/arch/arm/boot/dts/bcm2708-rpi-zero.dts -@@ -10,7 +10,7 @@ - model = "Raspberry Pi Zero"; - - chosen { -- bootargs = "coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1"; -+ bootargs = "coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; - }; - }; - ---- a/arch/arm/boot/dts/bcm270x.dtsi -+++ b/arch/arm/boot/dts/bcm270x.dtsi -@@ -3,7 +3,7 @@ - - / { - chosen { -- bootargs = "coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1"; -+ bootargs = "coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; - /delete-property/ stdout-path; - }; - ---- a/arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts -+++ b/arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts -@@ -12,7 +12,7 @@ - model = "Raspberry Pi 3 Model B+"; - - chosen { -- bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1"; -+ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; - }; - - aliases { ---- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts -+++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts -@@ -12,7 +12,7 @@ - model = "Raspberry Pi 3 Model B"; - - chosen { -- bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1"; -+ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; - }; - - aliases { ---- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts -+++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts -@@ -323,7 +323,7 @@ - - / { - chosen { -- bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1"; -+ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; - }; - - aliases { ---- a/arch/arm/boot/dts/bcm2711-rpi-400.dts -+++ b/arch/arm/boot/dts/bcm2711-rpi-400.dts -@@ -322,7 +322,7 @@ - - / { - chosen { -- bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1"; -+ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; - }; - - aliases { ---- a/arch/arm/boot/dts/bcm2711-rpi-cm4.dts -+++ b/arch/arm/boot/dts/bcm2711-rpi-cm4.dts -@@ -309,7 +309,7 @@ - - / { - chosen { -- bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1"; -+ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; - }; - - aliases { diff --git a/target/linux/bcm27xx/patches-5.10/950-0381-dtoverlays-Add-an-overlay-for-the-EDT-FT5406-touchsc.patch b/target/linux/bcm27xx/patches-5.10/950-0381-dtoverlays-Add-an-overlay-for-the-EDT-FT5406-touchsc.patch deleted file mode 100644 index 238b9ae2f6..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0381-dtoverlays-Add-an-overlay-for-the-EDT-FT5406-touchsc.patch +++ /dev/null @@ -1,96 +0,0 @@ -From e7972981794db2cfa349aa5d34171f83d4ffe830 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Fri, 6 Nov 2020 18:52:25 +0000 -Subject: [PATCH] dtoverlays: Add an overlay for the EDT FT5406 - touchscreen - -This touchscreen controller is used by the 7" DSI panel, and -this overlay configures it for when it is NOT being polled by -the firmware. - -Signed-off-by: Dave Stevenson ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 14 +++++++ - .../boot/dts/overlays/edt-ft5406-overlay.dts | 42 +++++++++++++++++++ - 3 files changed, 57 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/edt-ft5406-overlay.dts - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -40,6 +40,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - draws.dtbo \ - dwc-otg.dtbo \ - dwc2.dtbo \ -+ edt-ft5406.dtbo \ - enc28j60.dtbo \ - enc28j60-spi2.dtbo \ - exc3000.dtbo \ ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -733,6 +733,20 @@ Params: dr_mode Dual rol - [ The ds1307-rtc overlay has been deleted. See i2c-rtc. ] - - -+Name: edt-ft5406 -+Info: Overlay for the EDT FT5406 touchscreen on the CSI/DSI I2C interface. -+ This works with the Raspberry Pi 7" touchscreen when not being polled -+ by the firmware. -+ You MUST use either "disable_touchscreen=1" or "ignore_lcd=1" in -+ config.txt to stop the firmware polling the touchscreen. -+Load: dtoverlay=edt-ft5406,= -+Params: sizex Touchscreen size x (default 800) -+ sizey Touchscreen size y (default 480) -+ invx Touchscreen inverted x axis -+ invy Touchscreen inverted y axis -+ swapxy Touchscreen swapped x y axis -+ -+ - Name: enc28j60 - Info: Overlay for the Microchip ENC28J60 Ethernet Controller on SPI0 - Load: dtoverlay=enc28j60,= ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/edt-ft5406-overlay.dts -@@ -0,0 +1,42 @@ -+/* -+ * Device Tree overlay for RaspberryPi 7" Touchscreen panel -+ * -+ */ -+ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2835"; -+ -+ fragment@0 { -+ target = <&i2c_csi_dsi>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ ft5406: ts@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ -+ touchscreen-size-x = < 800 >; -+ touchscreen-size-y = < 480 >; -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c0if>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ __overrides__ { -+ sizex = <&ft5406>,"touchscreen-size-x:0"; -+ sizey = <&ft5406>,"touchscreen-size-y:0"; -+ invx = <&ft5406>,"touchscreen-inverted-x?"; -+ invy = <&ft5406>,"touchscreen-inverted-y?"; -+ swapxy = <&ft5406>,"touchscreen-swapped-x-y?"; -+ }; -+}; diff --git a/target/linux/bcm27xx/patches-5.10/950-0384-Add-devicetree-support-for-RaspberryPi-7-panel-over-.patch b/target/linux/bcm27xx/patches-5.10/950-0384-Add-devicetree-support-for-RaspberryPi-7-panel-over-.patch deleted file mode 100644 index cc4e2039da..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0384-Add-devicetree-support-for-RaspberryPi-7-panel-over-.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 818fff9eed1c36f404f0556a0b239b43799a094b Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Tue, 10 Nov 2020 17:49:35 +0000 -Subject: [PATCH] Add devicetree support for RaspberryPi 7" panel over - DSI I2C - -Signed-off-by: Dave Stevenson ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 8 +++ - .../overlays/vc4-kms-dsi-7inch-overlay.dts | 56 +++++++++++++++++++ - 3 files changed, 65 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dsi-7inch-overlay.dts - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -201,6 +201,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - upstream.dtbo \ - upstream-pi4.dtbo \ - vc4-fkms-v3d.dtbo \ -+ vc4-kms-dsi-7inch.dtbo \ - vc4-kms-kippah-7inch.dtbo \ - vc4-kms-v3d.dtbo \ - vc4-kms-v3d-pi4.dtbo \ ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -2935,6 +2935,14 @@ Params: cma-512 CMA is 5 - cma-default Use upstream's default value - - -+Name: vc4-kms-dsi-7inch -+Info: Enable the Raspberry Pi DSI 7" screen. -+ Use edt-ft5406 for the touchscreen element. -+ Requires vc4-kms-v3d to be loaded. -+Load: dtoverlay=vc4-kms-dsi-7inch -+Params: -+ -+ - Name: vc4-kms-kippah-7inch - Info: Enable the Adafruit DPI Kippah with the 7" Ontat panel attached. - Requires vc4-kms-v3d to be loaded. ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/vc4-kms-dsi-7inch-overlay.dts -@@ -0,0 +1,56 @@ -+/* -+ * Device Tree overlay for RaspberryPi 7" Touchscreen panel -+ * -+ */ -+ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2835"; -+ -+ fragment@0 { -+ target = <&dsi1>; -+ __overlay__ { -+ #address-cells = <1>; size-cells = <0>; -+ status = "okay"; -+ port { -+ dsi_out_port: endpoint { -+ remote-endpoint = <&panel_dsi_port>; -+ }; -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c_csi_dsi>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ lcd@45 { -+ compatible = "raspberrypi,7inch-touchscreen-panel"; -+ reg = <0x45>; -+ port { -+ panel_dsi_port: endpoint { -+ remote-endpoint = <&dsi_out_port>; -+ }; -+ }; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&i2c0if>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@3 { -+ target = <&i2c0mux>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+}; diff --git a/target/linux/bcm27xx/patches-5.10/950-0385-mcp251xfd-add-overlay.patch b/target/linux/bcm27xx/patches-5.10/950-0385-mcp251xfd-add-overlay.patch deleted file mode 100644 index 8d5d1927fc..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0385-mcp251xfd-add-overlay.patch +++ /dev/null @@ -1,283 +0,0 @@ -From 6a028ad5aed9e68280c9ccf6d4ca5370fcfdb4a2 Mon Sep 17 00:00:00 2001 -From: Marc Kleine-Budde -Date: Fri, 15 Nov 2019 00:54:07 +0100 -Subject: [PATCH] mcp251xfd: add overlay - -Signed-off-by: Marc Kleine-Budde ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 22 ++ - .../boot/dts/overlays/mcp251xfd-overlay.dts | 226 ++++++++++++++++++ - 3 files changed, 249 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/mcp251xfd-overlay.dts - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -108,6 +108,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - mcp23s17.dtbo \ - mcp2515-can0.dtbo \ - mcp2515-can1.dtbo \ -+ mcp251xfd.dtbo \ - mcp3008.dtbo \ - mcp3202.dtbo \ - mcp342x.dtbo \ ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -1779,6 +1779,28 @@ Params: oscillator Clock fr - interrupt GPIO for interrupt signal - - -+Name: mcp251xfd -+Info: Configures the MCP251XFD CAN controller family -+ For devices on spi1 or spi2, the interfaces should be enabled -+ with one of the spi1-1/2/3cs and/or spi2-1/2/3cs overlays. -+Load: dtoverlay=mcp251xfd,= -+Params: spi- Configure device at spi, cs -+ (boolean, required) -+ -+ oscillator Clock frequency for the CAN controller (Hz) -+ -+ speed Maximum SPI frequence (Hz) -+ -+ interrupt GPIO for interrupt signal -+ -+ rx_interrupt GPIO for RX interrupt signal (nINT1) (optional) -+ -+ xceiver_enable GPIO for CAN transceiver enable (optional) -+ -+ xceiver_active_high specifiy if CAN transceiver enable pin is -+ active high (optional, default: active low) -+ -+ - Name: mcp3008 - Info: Configures MCP3008 A/D converters - For devices on spi1 or spi2, the interfaces should be enabled ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/mcp251xfd-overlay.dts -@@ -0,0 +1,226 @@ -+// SPDX-License-Identifier: (GPL-2.0 OR MIT) -+ -+/dts-v1/; -+/plugin/; -+ -+#include -+#include -+#include -+ -+/ { -+ compatible = "brcm,bcm2835"; -+ -+ fragment@0 { -+ target = <&spidev0>; -+ __dormant__ { -+ status = "disabled"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&spidev1>; -+ __dormant__ { -+ status = "disabled"; -+ }; -+ }; -+ -+ fragment@2 { -+ target-path = "spi1/spidev@0"; -+ __dormant__ { -+ status = "disabled"; -+ }; -+ }; -+ -+ fragment@3 { -+ target-path = "spi1/spidev@1"; -+ __dormant__ { -+ status = "disabled"; -+ }; -+ }; -+ -+ fragment@4 { -+ target-path = "spi1/spidev@2"; -+ __dormant__ { -+ status = "disabled"; -+ }; -+ }; -+ -+ fragment@5 { -+ target-path = "spi2/spidev@0"; -+ __dormant__ { -+ status = "disabled"; -+ }; -+ }; -+ -+ fragment@6 { -+ target-path = "spi2/spidev@1"; -+ __dormant__ { -+ status = "disabled"; -+ }; -+ }; -+ -+ fragment@7 { -+ target-path = "spi2/spidev@2"; -+ __dormant__ { -+ status = "disabled"; -+ }; -+ }; -+ -+ fragment@8 { -+ target = <&gpio>; -+ __overlay__ { -+ mcp251xfd_pins: mcp251xfd_pins { -+ brcm,pins = <25>; -+ brcm,function = ; -+ }; -+ }; -+ }; -+ -+ fragment@9 { -+ target-path = "/clocks"; -+ __overlay__ { -+ clk_mcp251xfd_osc: mcp251xfd-osc { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <40000000>; -+ }; -+ }; -+ }; -+ -+ mcp251xfd_frag: fragment@10 { -+ target = <&spi0>; -+ __overlay__ { -+ status = "okay"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ mcp251xfd: mcp251xfd@0 { -+ compatible = "microchip,mcp251xfd"; -+ reg = <0>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mcp251xfd_pins>; -+ spi-max-frequency = <20000000>; -+ interrupt-parent = <&gpio>; -+ interrupts = <25 IRQ_TYPE_LEVEL_LOW>; -+ clocks = <&clk_mcp251xfd_osc>; -+ }; -+ }; -+ }; -+ -+ fragment@11 { -+ target = <&mcp251xfd>; -+ mcp251xfd_rx_int_gpios: __dormant__ { -+ microchip,rx-int-gpios = <&gpio 255 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ fragment@12 { -+ target = <&gpio>; -+ __dormant__ { -+ mcp251xfd_xceiver_pins: mcp251xfd_xceiver_pins { -+ brcm,pins = <255>; -+ brcm,function = ; -+ }; -+ }; -+ }; -+ -+ fragment@13 { -+ target-path = "/"; -+ __dormant__ { -+ reg_mcp251xfd_xceiver: reg_mcp251xfd_xceiver { -+ compatible = "regulator-fixed"; -+ regulator-name = "mcp251xfd_xceiver"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ gpio = <&gpio 4 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mcp251xfd_xceiver_pins>; -+ }; -+ }; -+ }; -+ -+ fragment@14 { -+ target = <&mcp251xfd>; -+ __dormant__ { -+ xceiver-supply = <®_mcp251xfd_xceiver>; -+ }; -+ }; -+ -+ __overrides__ { -+ spi0-0 = <0>, "+0", -+ <&mcp251xfd_frag>, "target:0=", <&spi0>, -+ <&mcp251xfd>, "reg:0=0", -+ <&mcp251xfd_pins>, "name=mcp251xfd_spi0_0_pins", -+ <&clk_mcp251xfd_osc>, "name=mcp251xfd-spi0-0-osc", -+ <&mcp251xfd_xceiver_pins>, "name=mcp251xfd_spi0_0_xceiver_pins", -+ <®_mcp251xfd_xceiver>, "name=reg-mcp251xfd-spi0-0-xceiver", -+ <®_mcp251xfd_xceiver>, "regulator-name=mcp251xfd-spi0-0-xceiver"; -+ spi0-1 = <0>, "+1", -+ <&mcp251xfd_frag>, "target:0=", <&spi0>, -+ <&mcp251xfd>, "reg:0=1", -+ <&mcp251xfd_pins>, "name=mcp251xfd_spi0_1_pins", -+ <&clk_mcp251xfd_osc>, "name=mcp251xfd-spi0-1-osc", -+ <&mcp251xfd_xceiver_pins>, "name=mcp251xfd_spi0_1_xceiver_pins", -+ <®_mcp251xfd_xceiver>, "name=reg-mcp251xfd-spi0-1-xceiver", -+ <®_mcp251xfd_xceiver>, "regulator-name=mcp251xfd-spi0-1-xceiver"; -+ spi1-0 = <0>, "+2", -+ <&mcp251xfd_frag>, "target:0=", <&spi1>, -+ <&mcp251xfd>, "reg:0=0", -+ <&mcp251xfd_pins>, "name=mcp251xfd_spi1_0_pins", -+ <&clk_mcp251xfd_osc>, "name=mcp251xfd-spi1-0-osc", -+ <&mcp251xfd_xceiver_pins>, "name=mcp251xfd_spi1_0_xceiver_pins", -+ <®_mcp251xfd_xceiver>, "name=reg-mcp251xfd-spi1-0-xceiver", -+ <®_mcp251xfd_xceiver>, "regulator-name=mcp251xfd-spi1-0-xceiver"; -+ spi1-1 = <0>, "+3", -+ <&mcp251xfd_frag>, "target:0=", <&spi1>, -+ <&mcp251xfd>, "reg:0=1", -+ <&mcp251xfd_pins>, "name=mcp251xfd_spi1_1_pins", -+ <&clk_mcp251xfd_osc>, "name=mcp251xfd-spi1-1-osc", -+ <&mcp251xfd_xceiver_pins>, "name=mcp251xfd_spi1_1_xceiver_pins", -+ <®_mcp251xfd_xceiver>, "name=reg-mcp251xfd-spi1-1-xceiver", -+ <®_mcp251xfd_xceiver>, "regulator-name=mcp251xfd-spi1-1-xceiver"; -+ spi1-2 = <0>, "+4", -+ <&mcp251xfd_frag>, "target:0=", <&spi1>, -+ <&mcp251xfd>, "reg:0=2", -+ <&mcp251xfd_pins>, "name=mcp251xfd_spi1_2_pins", -+ <&clk_mcp251xfd_osc>, "name=mcp251xfd-spi1-2-osc", -+ <&mcp251xfd_xceiver_pins>, "name=mcp251xfd_spi1_2_xceiver_pins", -+ <®_mcp251xfd_xceiver>, "name=reg-mcp251xfd-spi1-2-xceiver", -+ <®_mcp251xfd_xceiver>, "regulator-name=mcp251xfd-spi1-2-xceiver"; -+ spi2-0 = <0>, "+5", -+ <&mcp251xfd_frag>, "target:0=", <&spi2>, -+ <&mcp251xfd>, "reg:0=0", -+ <&mcp251xfd_pins>, "name=mcp251xfd_spi2_0_pins", -+ <&clk_mcp251xfd_osc>, "name=mcp251xfd-spi2-0-osc", -+ <&mcp251xfd_xceiver_pins>, "name=mcp251xfd_spi2_0_xceiver_pins", -+ <®_mcp251xfd_xceiver>, "name=reg-mcp251xfd-spi2-0-xceiver", -+ <®_mcp251xfd_xceiver>, "regulator-name=mcp251xfd-spi2-0-xceiver"; -+ spi2-1 = <0>, "+6", -+ <&mcp251xfd_frag>, "target:0=", <&spi2>, -+ <&mcp251xfd>, "reg:0=1", -+ <&mcp251xfd_pins>, "name=mcp251xfd_spi2_1_pins", -+ <&clk_mcp251xfd_osc>, "name=mcp251xfd-spi2-1-osc", -+ <&mcp251xfd_xceiver_pins>, "name=mcp251xfd_spi2_1_xceiver_pins", -+ <®_mcp251xfd_xceiver>, "name=reg-mcp251xfd-spi2-1-xceiver", -+ <®_mcp251xfd_xceiver>, "regulator-name=mcp251xfd-spi2-1-xceiver"; -+ spi2-2 = <0>, "+7", -+ <&mcp251xfd_frag>, "target:0=", <&spi2>, -+ <&mcp251xfd>, "reg:0=2", -+ <&mcp251xfd_pins>, "name=mcp251xfd_spi2_2_pins", -+ <&clk_mcp251xfd_osc>, "name=mcp251xfd-spi2-2-osc", -+ <&mcp251xfd_xceiver_pins>, "name=mcp251xfd_spi2_2_xceiver_pins", -+ <®_mcp251xfd_xceiver>, "name=reg-mcp251xfd-spi2-2-xceiver", -+ <®_mcp251xfd_xceiver>, "regulator-name=mcp251xfd-spi2-2-xceiver"; -+ oscillator = <&clk_mcp251xfd_osc>, "clock-frequency:0"; -+ speed = <&mcp251xfd>, "spi-max-frequency:0"; -+ interrupt = <&mcp251xfd_pins>, "brcm,pins:0", -+ <&mcp251xfd>, "interrupts:0"; -+ rx_interrupt = <0>, "+11", -+ <&mcp251xfd_pins>, "brcm,pins:4", -+ <&mcp251xfd_rx_int_gpios>, "microchip,rx-int-gpios:4"; -+ xceiver_enable = <0>, "+12+13+14", -+ <&mcp251xfd_xceiver_pins>, "brcm,pins:0", -+ <®_mcp251xfd_xceiver>, "gpio:4"; -+ xceiver_active_high = <®_mcp251xfd_xceiver>, "enable-active-high?"; -+ }; -+}; diff --git a/target/linux/bcm27xx/patches-5.10/950-0388-dt-Use-compatible-string-for-BCM2711-DSI1.patch b/target/linux/bcm27xx/patches-5.10/950-0388-dt-Use-compatible-string-for-BCM2711-DSI1.patch deleted file mode 100644 index 77ee192889..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0388-dt-Use-compatible-string-for-BCM2711-DSI1.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 3fa54d7688eaea066f1478ed6bc6051ee3b11f2b Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Thu, 12 Nov 2020 18:42:30 +0000 -Subject: [PATCH] dt: Use compatible string for BCM2711 DSI1 - -Updates the compatible string for DSI1 on BCM2711 to -differentiate it from BCM2835. - -Signed-off-by: Dave Stevenson ---- - arch/arm/boot/dts/bcm2711.dtsi | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm/boot/dts/bcm2711.dtsi -+++ b/arch/arm/boot/dts/bcm2711.dtsi -@@ -611,6 +611,7 @@ - - &dsi1 { - interrupts = ; -+ compatible = "brcm,bcm2711-dsi1"; - }; - - &gpio { diff --git a/target/linux/bcm27xx/patches-5.10/950-0389-drm-vc4-Correct-DSI-register-definition.patch b/target/linux/bcm27xx/patches-5.10/950-0389-drm-vc4-Correct-DSI-register-definition.patch deleted file mode 100644 index f8a2a69354..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0389-drm-vc4-Correct-DSI-register-definition.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 264515dcb2a318072530a2171c084dc207006399 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Mon, 30 Nov 2020 16:16:03 +0000 -Subject: [PATCH] drm/vc4: Correct DSI register definition - -The DSI1_PHY_AFEC0_PD_DLANE1 and DSI1_PHY_AFEC0_PD_DLANE3 register -definitions were swapped, so trying to use more than a single data -lane failed as lane 1 would get powered down. -(In theory a 4 lane device would work as all lanes would remain -powered). - -Correct the definitions. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_dsi.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/gpu/drm/vc4/vc4_dsi.c -+++ b/drivers/gpu/drm/vc4/vc4_dsi.c -@@ -306,11 +306,11 @@ - # define DSI0_PHY_AFEC0_RESET BIT(11) - # define DSI1_PHY_AFEC0_PD_BG BIT(11) - # define DSI0_PHY_AFEC0_PD BIT(10) --# define DSI1_PHY_AFEC0_PD_DLANE3 BIT(10) -+# define DSI1_PHY_AFEC0_PD_DLANE1 BIT(10) - # define DSI0_PHY_AFEC0_PD_BG BIT(9) - # define DSI1_PHY_AFEC0_PD_DLANE2 BIT(9) - # define DSI0_PHY_AFEC0_PD_DLANE1 BIT(8) --# define DSI1_PHY_AFEC0_PD_DLANE1 BIT(8) -+# define DSI1_PHY_AFEC0_PD_DLANE3 BIT(8) - # define DSI_PHY_AFEC0_PTATADJ_MASK VC4_MASK(7, 4) - # define DSI_PHY_AFEC0_PTATADJ_SHIFT 4 - # define DSI_PHY_AFEC0_CTATADJ_MASK VC4_MASK(3, 0) diff --git a/target/linux/bcm27xx/patches-5.10/950-0390-Allo-boss2-driver.patch b/target/linux/bcm27xx/patches-5.10/950-0390-Allo-boss2-driver.patch deleted file mode 100644 index b07f7c9f2d..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0390-Allo-boss2-driver.patch +++ /dev/null @@ -1,1185 +0,0 @@ -From 5eba3bb8b48060a5ddf143c1aa69840a90dd9162 Mon Sep 17 00:00:00 2001 -From: Sudeep -Date: Fri, 23 Oct 2020 15:47:17 +0530 -Subject: [PATCH] Allo boss2 driver - -Signed-off-by: Sudeep ---- - sound/soc/bcm/Kconfig | 9 + - sound/soc/bcm/Makefile | 2 + - sound/soc/bcm/allo-boss2-dac.c | 1133 ++++++++++++++++++++++++++++++++ - 3 files changed, 1144 insertions(+) - create mode 100644 sound/soc/bcm/allo-boss2-dac.c - ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -267,6 +267,15 @@ config SND_BCM2708_SOC_ALLO_BOSS_DAC - help - Say Y or M if you want to add support for Allo Boss DAC. - -+config SND_BCM2708_SOC_ALLO_BOSS2_DAC -+ tristate "Support for Allo Boss2 DAC" -+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -+ depends on I2C -+ select REGMAP_I2C -+ select SND_AUDIO_GRAPH_CARD -+ help -+ Say Y or M if you want to add support for Allo Boss2 DAC. -+ - config SND_BCM2708_SOC_ALLO_DIGIONE - tristate "Support for Allo DigiOne" - depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -38,6 +38,7 @@ snd-soc-digidac1-soundcard-objs := digid - snd-soc-dionaudio-loco-objs := dionaudio_loco.o - snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o - snd-soc-allo-boss-dac-objs := allo-boss-dac.o -+snd-soc-allo-boss2-dac-objs := allo-boss2-dac.o - snd-soc-allo-piano-dac-objs := allo-piano-dac.o - snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o - snd-soc-allo-katana-codec-objs := allo-katana-codec.o -@@ -68,6 +69,7 @@ obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += - obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o - obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o - obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o -+obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS2_DAC) += snd-soc-allo-boss2-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o - obj-$(CONFIG_SND_BCM2708_SOC_ALLO_KATANA_DAC) += snd-soc-allo-katana-codec.o ---- /dev/null -+++ b/sound/soc/bcm/allo-boss2-dac.c -@@ -0,0 +1,1133 @@ -+/* -+ * Driver for the ALLO KATANA CODEC -+ * -+ * Author: Jaikumar -+ * Copyright 2018 -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "../codecs/cs43130.h" -+ -+#include -+#include -+#define DEBUG -+ -+#define CS43130_DSD_EN_MASK 0x10 -+#define CS43130_PDN_DONE_INT_MASK 0x00 -+ -+static struct gpio_desc *snd_allo_clk44gpio; -+static struct gpio_desc *snd_allo_clk48gpio; -+ -+struct cs43130_priv { -+ struct snd_soc_component *component; -+ struct regmap *regmap; -+ struct regulator_bulk_data supplies[CS43130_NUM_SUPPLIES]; -+ struct gpio_desc *reset_gpio; -+ unsigned int dev_id; /* codec device ID */ -+ int xtal_ibias; -+ /* shared by both DAIs */ -+ struct mutex clk_mutex; -+ int clk_req; -+ bool pll_bypass; -+ struct completion xtal_rdy; -+ struct completion pll_rdy; -+ unsigned int mclk; -+ unsigned int mclk_int; -+ int mclk_int_src; -+ -+ /* DAI specific */ -+ struct cs43130_dai dais[CS43130_DAI_ID_MAX]; -+ -+ /* HP load specific */ -+ bool dc_meas; -+ bool ac_meas; -+ bool hpload_done; -+ struct completion hpload_evt; -+ unsigned int hpload_stat; -+ u16 hpload_dc[2]; -+ u16 dc_threshold[CS43130_DC_THRESHOLD]; -+ u16 ac_freq[CS43130_AC_FREQ]; -+ u16 hpload_ac[CS43130_AC_FREQ][2]; -+ struct workqueue_struct *wq; -+ struct work_struct work; -+ struct snd_soc_jack jack; -+}; -+ -+static const struct reg_default cs43130_reg_defaults[] = { -+ {CS43130_SYS_CLK_CTL_1, 0x06}, -+ {CS43130_SP_SRATE, 0x01}, -+ {CS43130_SP_BITSIZE, 0x05}, -+ {CS43130_PAD_INT_CFG, 0x03}, -+ {CS43130_PWDN_CTL, 0xFE}, -+ {CS43130_CRYSTAL_SET, 0x04}, -+ {CS43130_PLL_SET_1, 0x00}, -+ {CS43130_PLL_SET_2, 0x00}, -+ {CS43130_PLL_SET_3, 0x00}, -+ {CS43130_PLL_SET_4, 0x00}, -+ {CS43130_PLL_SET_5, 0x40}, -+ {CS43130_PLL_SET_6, 0x10}, -+ {CS43130_PLL_SET_7, 0x80}, -+ {CS43130_PLL_SET_8, 0x03}, -+ {CS43130_PLL_SET_9, 0x02}, -+ {CS43130_PLL_SET_10, 0x02}, -+ {CS43130_CLKOUT_CTL, 0x00}, -+ {CS43130_ASP_NUM_1, 0x01}, -+ {CS43130_ASP_NUM_2, 0x00}, -+ {CS43130_ASP_DEN_1, 0x08}, -+ {CS43130_ASP_DEN_2, 0x00}, -+ {CS43130_ASP_LRCK_HI_TIME_1, 0x1F}, -+ {CS43130_ASP_LRCK_HI_TIME_2, 0x00}, -+ {CS43130_ASP_LRCK_PERIOD_1, 0x3F}, -+ {CS43130_ASP_LRCK_PERIOD_2, 0x00}, -+ {CS43130_ASP_CLOCK_CONF, 0x0C}, -+ {CS43130_ASP_FRAME_CONF, 0x0A}, -+ {CS43130_XSP_NUM_1, 0x01}, -+ {CS43130_XSP_NUM_2, 0x00}, -+ {CS43130_XSP_DEN_1, 0x02}, -+ {CS43130_XSP_DEN_2, 0x00}, -+ {CS43130_XSP_LRCK_HI_TIME_1, 0x1F}, -+ {CS43130_XSP_LRCK_HI_TIME_2, 0x00}, -+ {CS43130_XSP_LRCK_PERIOD_1, 0x3F}, -+ {CS43130_XSP_LRCK_PERIOD_2, 0x00}, -+ {CS43130_XSP_CLOCK_CONF, 0x0C}, -+ {CS43130_XSP_FRAME_CONF, 0x0A}, -+ {CS43130_ASP_CH_1_LOC, 0x00}, -+ {CS43130_ASP_CH_2_LOC, 0x00}, -+ {CS43130_ASP_CH_1_SZ_EN, 0x06}, -+ {CS43130_ASP_CH_2_SZ_EN, 0x0E}, -+ {CS43130_XSP_CH_1_LOC, 0x00}, -+ {CS43130_XSP_CH_2_LOC, 0x00}, -+ {CS43130_XSP_CH_1_SZ_EN, 0x06}, -+ {CS43130_XSP_CH_2_SZ_EN, 0x0E}, -+ {CS43130_DSD_VOL_B, 0x78}, -+ {CS43130_DSD_VOL_A, 0x78}, -+ {CS43130_DSD_PATH_CTL_1, 0xA8}, -+ {CS43130_DSD_INT_CFG, 0x00}, -+ {CS43130_DSD_PATH_CTL_2, 0x02}, -+ {CS43130_DSD_PCM_MIX_CTL, 0x00}, -+ {CS43130_DSD_PATH_CTL_3, 0x40}, -+ {CS43130_HP_OUT_CTL_1, 0x30}, -+ {CS43130_PCM_FILT_OPT, 0x02}, -+ {CS43130_PCM_VOL_B, 0x78}, -+ {CS43130_PCM_VOL_A, 0x78}, -+ {CS43130_PCM_PATH_CTL_1, 0xA8}, -+ {CS43130_PCM_PATH_CTL_2, 0x00}, -+ {CS43130_CLASS_H_CTL, 0x1E}, -+ {CS43130_HP_DETECT, 0x04}, -+ {CS43130_HP_LOAD_1, 0x00}, -+ {CS43130_HP_MEAS_LOAD_1, 0x00}, -+ {CS43130_HP_MEAS_LOAD_2, 0x00}, -+ {CS43130_INT_MASK_1, 0xFF}, -+ {CS43130_INT_MASK_2, 0xFF}, -+ {CS43130_INT_MASK_3, 0xFF}, -+ {CS43130_INT_MASK_4, 0xFF}, -+ {CS43130_INT_MASK_5, 0xFF}, -+}; -+static bool cs43130_volatile_register(struct device *dev, unsigned int reg) -+{ -+ switch (reg) { -+ case CS43130_INT_STATUS_1 ... CS43130_INT_STATUS_5: -+ case CS43130_HP_DC_STAT_1 ... CS43130_HP_DC_STAT_2: -+ case CS43130_HP_AC_STAT_1 ... CS43130_HP_AC_STAT_2: -+ return true; -+ default: -+ return false; -+ } -+} -+ -+static const char * const pcm_spd_texts[] = { -+ "Fast", -+ "Slow", -+}; -+ -+static SOC_ENUM_SINGLE_DECL(pcm_spd_enum, CS43130_PCM_FILT_OPT, 7, -+ pcm_spd_texts); -+ -+static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(master_tlv, -12750, 0); -+ -+static const struct snd_kcontrol_new cs43130_controls[] = { -+ SOC_DOUBLE_R_TLV("Master Playback Volume", CS43130_PCM_VOL_B, -+ CS43130_PCM_VOL_A, 0, 255, 1, master_tlv), -+ SOC_DOUBLE("Master Playback Switch", CS43130_PCM_PATH_CTL_1, -+ 0, 1, 1, 1), -+ SOC_DOUBLE_R_TLV("Digital Playback Volume", CS43130_DSD_VOL_B, -+ CS43130_DSD_VOL_A, 0, 255, 1, master_tlv), -+ SOC_DOUBLE("Digital Playback Switch", CS43130_DSD_PATH_CTL_1, -+ 0, 1, 1, 1), -+ SOC_SINGLE("HV_Enable", CS43130_HP_OUT_CTL_1, 0, 1, 0), -+ SOC_ENUM("PCM Filter Speed", pcm_spd_enum), -+ SOC_SINGLE("PCM Phase Compensation", CS43130_PCM_FILT_OPT, 6, 1, 0), -+ SOC_SINGLE("PCM Nonoversample Emulate", CS43130_PCM_FILT_OPT, 5, 1, 0), -+ SOC_SINGLE("PCM High-pass Filter", CS43130_PCM_FILT_OPT, 1, 1, 0), -+ SOC_SINGLE("PCM De-emphasis Filter", CS43130_PCM_FILT_OPT, 0, 1, 0), -+}; -+ -+static bool cs43130_readable_register(struct device *dev, unsigned int reg) -+{ -+ switch (reg) { -+ case CS43130_DEVID_AB ... CS43130_SYS_CLK_CTL_1: -+ case CS43130_SP_SRATE ... CS43130_PAD_INT_CFG: -+ case CS43130_PWDN_CTL: -+ case CS43130_CRYSTAL_SET: -+ case CS43130_PLL_SET_1 ... CS43130_PLL_SET_5: -+ case CS43130_PLL_SET_6: -+ case CS43130_PLL_SET_7: -+ case CS43130_PLL_SET_8: -+ case CS43130_PLL_SET_9: -+ case CS43130_PLL_SET_10: -+ case CS43130_CLKOUT_CTL: -+ case CS43130_ASP_NUM_1 ... CS43130_ASP_FRAME_CONF: -+ case CS43130_XSP_NUM_1 ... CS43130_XSP_FRAME_CONF: -+ case CS43130_ASP_CH_1_LOC: -+ case CS43130_ASP_CH_2_LOC: -+ case CS43130_ASP_CH_1_SZ_EN: -+ case CS43130_ASP_CH_2_SZ_EN: -+ case CS43130_XSP_CH_1_LOC: -+ case CS43130_XSP_CH_2_LOC: -+ case CS43130_XSP_CH_1_SZ_EN: -+ case CS43130_XSP_CH_2_SZ_EN: -+ case CS43130_DSD_VOL_B ... CS43130_DSD_PATH_CTL_3: -+ case CS43130_HP_OUT_CTL_1: -+ case CS43130_PCM_FILT_OPT ... CS43130_PCM_PATH_CTL_2: -+ case CS43130_CLASS_H_CTL: -+ case CS43130_HP_DETECT: -+ case CS43130_HP_STATUS: -+ case CS43130_HP_LOAD_1: -+ case CS43130_HP_MEAS_LOAD_1: -+ case CS43130_HP_MEAS_LOAD_2: -+ case CS43130_HP_DC_STAT_1: -+ case CS43130_HP_DC_STAT_2: -+ case CS43130_HP_AC_STAT_1: -+ case CS43130_HP_AC_STAT_2: -+ case CS43130_HP_LOAD_STAT: -+ case CS43130_INT_STATUS_1 ... CS43130_INT_STATUS_5: -+ case CS43130_INT_MASK_1 ... CS43130_INT_MASK_5: -+ return true; -+ default: -+ return false; -+ } -+} -+static bool cs43130_precious_register(struct device *dev, unsigned int reg) -+{ -+ switch (reg) { -+ case CS43130_INT_STATUS_1 ... CS43130_INT_STATUS_5: -+ return true; -+ default: -+ return false; -+ } -+} -+static int cs43130_pcm_pdn(struct snd_soc_component *component) -+{ -+ struct cs43130_priv *cs43130 = -+ snd_soc_component_get_drvdata(component); -+ int ret; -+ unsigned int reg, pdn_int; -+ -+ regmap_write(cs43130->regmap, CS43130_DSD_PATH_CTL_2, 0x02); -+ regmap_update_bits(cs43130->regmap, CS43130_INT_MASK_1, -+ CS43130_PDN_DONE_INT_MASK, 0); -+ regmap_update_bits(cs43130->regmap, CS43130_PWDN_CTL, -+ CS43130_PDN_HP_MASK, 1 << CS43130_PDN_HP_SHIFT); -+ usleep_range(10, 50); -+ ret = regmap_read(cs43130->regmap, CS43130_INT_STATUS_1, ®); -+ pdn_int = reg & 0xFE; -+ regmap_update_bits(cs43130->regmap, CS43130_PWDN_CTL, -+ CS43130_PDN_ASP_MASK, 1 << CS43130_PDN_ASP_SHIFT); -+ return 0; -+ -+} -+static int cs43130_pwr_up_asp_dac(struct snd_soc_component *component) -+{ -+ struct cs43130_priv *cs43130 = -+ snd_soc_component_get_drvdata(component); -+ -+ regmap_update_bits(cs43130->regmap, CS43130_PAD_INT_CFG, -+ CS43130_ASP_3ST_MASK, 0); -+ regmap_write(cs43130->regmap, CS43130_DXD1, 0x99); -+ regmap_write(cs43130->regmap, CS43130_DXD13, 0x20); -+ regmap_update_bits(cs43130->regmap, CS43130_PWDN_CTL, -+ CS43130_PDN_ASP_MASK, 0); -+ regmap_update_bits(cs43130->regmap, CS43130_PWDN_CTL, -+ CS43130_PDN_HP_MASK, 0); -+ usleep_range(10000, 12000); -+ regmap_write(cs43130->regmap, CS43130_DXD1, 0x00); -+ regmap_write(cs43130->regmap, CS43130_DXD13, 0x00); -+ return 0; -+} -+static int cs43130_change_clksrc(struct snd_soc_component *component, -+ enum cs43130_mclk_src_sel src) -+{ -+ int ret; -+ struct cs43130_priv *cs43130 = -+ snd_soc_component_get_drvdata(component); -+ int mclk_int_decoded; -+ -+ if (src == cs43130->mclk_int_src) { -+ /* clk source has not changed */ -+ return 0; -+ } -+ switch (cs43130->mclk_int) { -+ case CS43130_MCLK_22M: -+ mclk_int_decoded = CS43130_MCLK_22P5; -+ break; -+ case CS43130_MCLK_24M: -+ mclk_int_decoded = CS43130_MCLK_24P5; -+ break; -+ default: -+ dev_err(component->dev, "Invalid MCLK INT freq: %u\n", -+ cs43130->mclk_int); -+ return -EINVAL; -+ } -+ -+ switch (src) { -+ case CS43130_MCLK_SRC_EXT: -+ cs43130->pll_bypass = true; -+ cs43130->mclk_int_src = CS43130_MCLK_SRC_EXT; -+ if (cs43130->xtal_ibias == CS43130_XTAL_UNUSED) { -+ regmap_update_bits(cs43130->regmap, CS43130_PWDN_CTL, -+ CS43130_PDN_XTAL_MASK, -+ 1 << CS43130_PDN_XTAL_SHIFT); -+ } else { -+ reinit_completion(&cs43130->xtal_rdy); -+ regmap_update_bits(cs43130->regmap, CS43130_INT_MASK_1, -+ CS43130_XTAL_RDY_INT_MASK, 0); -+ regmap_update_bits(cs43130->regmap, CS43130_PWDN_CTL, -+ CS43130_PDN_XTAL_MASK, 0); -+ ret = wait_for_completion_timeout(&cs43130->xtal_rdy, -+ msecs_to_jiffies(100)); -+ regmap_update_bits(cs43130->regmap, CS43130_INT_MASK_1, -+ CS43130_XTAL_RDY_INT_MASK, -+ 1 << CS43130_XTAL_RDY_INT_SHIFT); -+ if (ret == 0) { -+ dev_err(component->dev, "Timeout waiting for XTAL_READY interrupt\n"); -+ return -ETIMEDOUT; -+ } -+ } -+ regmap_update_bits(cs43130->regmap, CS43130_SYS_CLK_CTL_1, -+ CS43130_MCLK_SRC_SEL_MASK, -+ src << CS43130_MCLK_SRC_SEL_SHIFT); -+ regmap_update_bits(cs43130->regmap, CS43130_SYS_CLK_CTL_1, -+ CS43130_MCLK_INT_MASK, -+ mclk_int_decoded << CS43130_MCLK_INT_SHIFT); -+ usleep_range(150, 200); -+ regmap_update_bits(cs43130->regmap, CS43130_PWDN_CTL, -+ CS43130_PDN_PLL_MASK, -+ 1 << CS43130_PDN_PLL_SHIFT); -+ break; -+ case CS43130_MCLK_SRC_RCO: -+ cs43130->mclk_int_src = CS43130_MCLK_SRC_RCO; -+ -+ regmap_update_bits(cs43130->regmap, CS43130_SYS_CLK_CTL_1, -+ CS43130_MCLK_SRC_SEL_MASK, -+ src << CS43130_MCLK_SRC_SEL_SHIFT); -+ regmap_update_bits(cs43130->regmap, CS43130_SYS_CLK_CTL_1, -+ CS43130_MCLK_INT_MASK, -+ CS43130_MCLK_22P5 << CS43130_MCLK_INT_SHIFT); -+ usleep_range(150, 200); -+ regmap_update_bits(cs43130->regmap, CS43130_PWDN_CTL, -+ CS43130_PDN_XTAL_MASK, -+ 1 << CS43130_PDN_XTAL_SHIFT); -+ regmap_update_bits(cs43130->regmap, CS43130_PWDN_CTL, -+ CS43130_PDN_PLL_MASK, -+ 1 << CS43130_PDN_PLL_SHIFT); -+ break; -+ default: -+ dev_err(component->dev, "Invalid MCLK source value\n"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+static const struct cs43130_bitwidth_map cs43130_bitwidth_table[] = { -+ {8, CS43130_SP_BIT_SIZE_8, CS43130_CH_BIT_SIZE_8}, -+ {16, CS43130_SP_BIT_SIZE_16, CS43130_CH_BIT_SIZE_16}, -+ {24, CS43130_SP_BIT_SIZE_24, CS43130_CH_BIT_SIZE_24}, -+ {32, CS43130_SP_BIT_SIZE_32, CS43130_CH_BIT_SIZE_32}, -+}; -+ -+static const struct cs43130_bitwidth_map *cs43130_get_bitwidth_table( -+ unsigned int bitwidth) -+{ -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(cs43130_bitwidth_table); i++) { -+ if (cs43130_bitwidth_table[i].bitwidth == bitwidth) -+ return &cs43130_bitwidth_table[i]; -+ } -+ -+ return NULL; -+} -+static int cs43130_set_bitwidth(int dai_id, unsigned int bitwidth_dai, -+ struct regmap *regmap) -+{ -+ const struct cs43130_bitwidth_map *bw_map; -+ -+ bw_map = cs43130_get_bitwidth_table(bitwidth_dai); -+ if (!bw_map) -+ return -EINVAL; -+ -+ switch (dai_id) { -+ case CS43130_ASP_PCM_DAI: -+ case CS43130_ASP_DOP_DAI: -+ regmap_update_bits(regmap, CS43130_ASP_CH_1_SZ_EN, -+ CS43130_CH_BITSIZE_MASK, bw_map->ch_bit); -+ regmap_update_bits(regmap, CS43130_ASP_CH_2_SZ_EN, -+ CS43130_CH_BITSIZE_MASK, bw_map->ch_bit); -+ regmap_update_bits(regmap, CS43130_SP_BITSIZE, -+ CS43130_ASP_BITSIZE_MASK, bw_map->sp_bit); -+ break; -+ case CS43130_XSP_DOP_DAI: -+ regmap_update_bits(regmap, CS43130_XSP_CH_1_SZ_EN, -+ CS43130_CH_BITSIZE_MASK, bw_map->ch_bit); -+ regmap_update_bits(regmap, CS43130_XSP_CH_2_SZ_EN, -+ CS43130_CH_BITSIZE_MASK, bw_map->ch_bit); -+ regmap_update_bits(regmap, CS43130_SP_BITSIZE, -+ CS43130_XSP_BITSIZE_MASK, bw_map->sp_bit << -+ CS43130_XSP_BITSIZE_SHIFT); -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+static const struct cs43130_rate_map cs43130_rate_table[] = { -+ {32000, CS43130_ASP_SPRATE_32K}, -+ {44100, CS43130_ASP_SPRATE_44_1K}, -+ {48000, CS43130_ASP_SPRATE_48K}, -+ {88200, CS43130_ASP_SPRATE_88_2K}, -+ {96000, CS43130_ASP_SPRATE_96K}, -+ {176400, CS43130_ASP_SPRATE_176_4K}, -+ {192000, CS43130_ASP_SPRATE_192K}, -+ {352800, CS43130_ASP_SPRATE_352_8K}, -+ {384000, CS43130_ASP_SPRATE_384K}, -+}; -+ -+static const struct cs43130_rate_map *cs43130_get_rate_table(int fs) -+{ -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(cs43130_rate_table); i++) { -+ if (cs43130_rate_table[i].fs == fs) -+ return &cs43130_rate_table[i]; -+ } -+ -+ return NULL; -+} -+ -+static const struct cs43130_clk_gen *cs43130_get_clk_gen(int mclk_int, int fs, -+ const struct cs43130_clk_gen *clk_gen_table, int len_clk_gen_table) -+{ -+ int i; -+ -+ for (i = 0; i < len_clk_gen_table; i++) { -+ if (clk_gen_table[i].mclk_int == mclk_int && -+ clk_gen_table[i].fs == fs) -+ return &clk_gen_table[i]; -+ } -+ return NULL; -+} -+ -+static int cs43130_set_sp_fmt(int dai_id, unsigned int bitwidth_sclk, -+ struct snd_pcm_hw_params *params, -+ struct cs43130_priv *cs43130) -+{ -+ u16 frm_size; -+ u16 hi_size; -+ u8 frm_delay; -+ u8 frm_phase; -+ u8 frm_data; -+ u8 sclk_edge; -+ u8 lrck_edge; -+ u8 clk_data; -+ u8 loc_ch1; -+ u8 loc_ch2; -+ u8 dai_mode_val; -+ const struct cs43130_clk_gen *clk_gen; -+ -+ switch (cs43130->dais[dai_id].dai_format) { -+ case SND_SOC_DAIFMT_I2S: -+ hi_size = bitwidth_sclk; -+ frm_delay = 2; -+ frm_phase = 0; -+ break; -+ case SND_SOC_DAIFMT_LEFT_J: -+ hi_size = bitwidth_sclk; -+ frm_delay = 2; -+ frm_phase = 1; -+ break; -+ case SND_SOC_DAIFMT_DSP_A: -+ hi_size = 1; -+ frm_delay = 2; -+ frm_phase = 1; -+ break; -+ case SND_SOC_DAIFMT_DSP_B: -+ hi_size = 1; -+ frm_delay = 0; -+ frm_phase = 1; -+ break; -+ default: -+ return -EINVAL; -+ } -+ switch (cs43130->dais[dai_id].dai_mode) { -+ case SND_SOC_DAIFMT_CBS_CFS: -+ dai_mode_val = 0; -+ break; -+ case SND_SOC_DAIFMT_CBM_CFM: -+ dai_mode_val = 1; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ frm_size = bitwidth_sclk * params_channels(params); -+ sclk_edge = 1; -+ lrck_edge = 0; -+ loc_ch1 = 0; -+ loc_ch2 = bitwidth_sclk * (params_channels(params) - 1); -+ -+ frm_data = frm_delay & CS43130_SP_FSD_MASK; -+ frm_data |= (frm_phase << CS43130_SP_STP_SHIFT) & CS43130_SP_STP_MASK; -+ -+ clk_data = lrck_edge & CS43130_SP_LCPOL_IN_MASK; -+ clk_data |= (lrck_edge << CS43130_SP_LCPOL_OUT_SHIFT) & -+ CS43130_SP_LCPOL_OUT_MASK; -+ clk_data |= (sclk_edge << CS43130_SP_SCPOL_IN_SHIFT) & -+ CS43130_SP_SCPOL_IN_MASK; -+ clk_data |= (sclk_edge << CS43130_SP_SCPOL_OUT_SHIFT) & -+ CS43130_SP_SCPOL_OUT_MASK; -+ clk_data |= (dai_mode_val << CS43130_SP_MODE_SHIFT) & -+ CS43130_SP_MODE_MASK; -+ switch (dai_id) { -+ case CS43130_ASP_PCM_DAI: -+ case CS43130_ASP_DOP_DAI: -+ regmap_update_bits(cs43130->regmap, CS43130_ASP_LRCK_PERIOD_1, -+ CS43130_SP_LCPR_DATA_MASK, (frm_size - 1) >> -+ CS43130_SP_LCPR_LSB_DATA_SHIFT); -+ regmap_update_bits(cs43130->regmap, CS43130_ASP_LRCK_PERIOD_2, -+ CS43130_SP_LCPR_DATA_MASK, (frm_size - 1) >> -+ CS43130_SP_LCPR_MSB_DATA_SHIFT); -+ regmap_update_bits(cs43130->regmap, CS43130_ASP_LRCK_HI_TIME_1, -+ CS43130_SP_LCHI_DATA_MASK, (hi_size - 1) >> -+ CS43130_SP_LCHI_LSB_DATA_SHIFT); -+ regmap_update_bits(cs43130->regmap, CS43130_ASP_LRCK_HI_TIME_2, -+ CS43130_SP_LCHI_DATA_MASK, (hi_size - 1) >> -+ CS43130_SP_LCHI_MSB_DATA_SHIFT); -+ regmap_write(cs43130->regmap, CS43130_ASP_FRAME_CONF, frm_data); -+ regmap_write(cs43130->regmap, CS43130_ASP_CH_1_LOC, loc_ch1); -+ regmap_write(cs43130->regmap, CS43130_ASP_CH_2_LOC, loc_ch2); -+ regmap_update_bits(cs43130->regmap, CS43130_ASP_CH_1_SZ_EN, -+ CS43130_CH_EN_MASK, 1 << CS43130_CH_EN_SHIFT); -+ regmap_update_bits(cs43130->regmap, CS43130_ASP_CH_2_SZ_EN, -+ CS43130_CH_EN_MASK, 1 << CS43130_CH_EN_SHIFT); -+ regmap_write(cs43130->regmap, CS43130_ASP_CLOCK_CONF, clk_data); -+ break; -+ case CS43130_XSP_DOP_DAI: -+ regmap_update_bits(cs43130->regmap, CS43130_XSP_LRCK_PERIOD_1, -+ CS43130_SP_LCPR_DATA_MASK, (frm_size - 1) >> -+ CS43130_SP_LCPR_LSB_DATA_SHIFT); -+ regmap_update_bits(cs43130->regmap, CS43130_XSP_LRCK_PERIOD_2, -+ CS43130_SP_LCPR_DATA_MASK, (frm_size - 1) >> -+ CS43130_SP_LCPR_MSB_DATA_SHIFT); -+ regmap_update_bits(cs43130->regmap, CS43130_XSP_LRCK_HI_TIME_1, -+ CS43130_SP_LCHI_DATA_MASK, (hi_size - 1) >> -+ CS43130_SP_LCHI_LSB_DATA_SHIFT); -+ regmap_update_bits(cs43130->regmap, CS43130_XSP_LRCK_HI_TIME_2, -+ CS43130_SP_LCHI_DATA_MASK, (hi_size - 1) >> -+ CS43130_SP_LCHI_MSB_DATA_SHIFT); -+ regmap_write(cs43130->regmap, CS43130_XSP_FRAME_CONF, frm_data); -+ regmap_write(cs43130->regmap, CS43130_XSP_CH_1_LOC, loc_ch1); -+ regmap_write(cs43130->regmap, CS43130_XSP_CH_2_LOC, loc_ch2); -+ regmap_update_bits(cs43130->regmap, CS43130_XSP_CH_1_SZ_EN, -+ CS43130_CH_EN_MASK, 1 << CS43130_CH_EN_SHIFT); -+ regmap_update_bits(cs43130->regmap, CS43130_XSP_CH_2_SZ_EN, -+ CS43130_CH_EN_MASK, 1 << CS43130_CH_EN_SHIFT); -+ regmap_write(cs43130->regmap, CS43130_XSP_CLOCK_CONF, clk_data); -+ break; -+ default: -+ return -EINVAL; -+ } -+ switch (frm_size) { -+ case 16: -+ clk_gen = cs43130_get_clk_gen(cs43130->mclk_int, -+ params_rate(params), -+ cs43130_16_clk_gen, -+ ARRAY_SIZE(cs43130_16_clk_gen)); -+ break; -+ case 32: -+ clk_gen = cs43130_get_clk_gen(cs43130->mclk_int, -+ params_rate(params), -+ cs43130_32_clk_gen, -+ ARRAY_SIZE(cs43130_32_clk_gen)); -+ break; -+ case 48: -+ clk_gen = cs43130_get_clk_gen(cs43130->mclk_int, -+ params_rate(params), -+ cs43130_48_clk_gen, -+ ARRAY_SIZE(cs43130_48_clk_gen)); -+ break; -+ case 64: -+ clk_gen = cs43130_get_clk_gen(cs43130->mclk_int, -+ params_rate(params), -+ cs43130_64_clk_gen, -+ ARRAY_SIZE(cs43130_64_clk_gen)); -+ break; -+ default: -+ return -EINVAL; -+ } -+ if (!clk_gen) -+ return -EINVAL; -+ switch (dai_id) { -+ case CS43130_ASP_PCM_DAI: -+ case CS43130_ASP_DOP_DAI: -+ regmap_write(cs43130->regmap, CS43130_ASP_DEN_1, -+ (clk_gen->den & CS43130_SP_M_LSB_DATA_MASK) >> -+ CS43130_SP_M_LSB_DATA_SHIFT); -+ regmap_write(cs43130->regmap, CS43130_ASP_DEN_2, -+ (clk_gen->den & CS43130_SP_M_MSB_DATA_MASK) >> -+ CS43130_SP_M_MSB_DATA_SHIFT); -+ regmap_write(cs43130->regmap, CS43130_ASP_NUM_1, -+ (clk_gen->num & CS43130_SP_N_LSB_DATA_MASK) >> -+ CS43130_SP_N_LSB_DATA_SHIFT); -+ regmap_write(cs43130->regmap, CS43130_ASP_NUM_2, -+ (clk_gen->num & CS43130_SP_N_MSB_DATA_MASK) >> -+ CS43130_SP_N_MSB_DATA_SHIFT); -+ break; -+ case CS43130_XSP_DOP_DAI: -+ regmap_write(cs43130->regmap, CS43130_XSP_DEN_1, -+ (clk_gen->den & CS43130_SP_M_LSB_DATA_MASK) >> -+ CS43130_SP_M_LSB_DATA_SHIFT); -+ regmap_write(cs43130->regmap, CS43130_XSP_DEN_2, -+ (clk_gen->den & CS43130_SP_M_MSB_DATA_MASK) >> -+ CS43130_SP_M_MSB_DATA_SHIFT); -+ regmap_write(cs43130->regmap, CS43130_XSP_NUM_1, -+ (clk_gen->num & CS43130_SP_N_LSB_DATA_MASK) >> -+ CS43130_SP_N_LSB_DATA_SHIFT); -+ regmap_write(cs43130->regmap, CS43130_XSP_NUM_2, -+ (clk_gen->num & CS43130_SP_N_MSB_DATA_MASK) >> -+ CS43130_SP_N_MSB_DATA_SHIFT); -+ break; -+ default: -+ return -EINVAL; -+ } -+ return 0; -+} -+ -+static int cs43130_hw_params(struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params, -+ struct snd_soc_dai *dai) -+{ -+ struct snd_soc_component *component = dai->component; -+ struct cs43130_priv *cs43130 = -+ snd_soc_component_get_drvdata(component); -+ const struct cs43130_rate_map *rate_map; -+ unsigned int sclk = cs43130->dais[dai->id].sclk; -+ unsigned int bitwidth_sclk; -+ unsigned int bitwidth_dai = (unsigned int)(params_width(params)); -+ unsigned int dop_rate = (unsigned int)(params_rate(params)); -+ unsigned int required_clk, ret; -+ u8 dsd_speed; -+ -+ cs43130->pll_bypass = true; -+ cs43130_pcm_pdn(component); -+ mutex_lock(&cs43130->clk_mutex); -+ if (!cs43130->clk_req) { -+ /* no DAI is currently using clk */ -+ if (!(CS43130_MCLK_22M % params_rate(params))) { -+ required_clk = CS43130_MCLK_22M; -+ cs43130->mclk_int = CS43130_MCLK_22M; -+ gpiod_set_value_cansleep(snd_allo_clk44gpio, 1); -+ gpiod_set_value_cansleep(snd_allo_clk48gpio, 0); -+ usleep_range(13500, 14000); -+ } else { -+ required_clk = CS43130_MCLK_24M; -+ cs43130->mclk_int = CS43130_MCLK_24M; -+ gpiod_set_value_cansleep(snd_allo_clk48gpio, 1); -+ gpiod_set_value_cansleep(snd_allo_clk44gpio, 0); -+ usleep_range(13500, 14000); -+ } -+ if (cs43130->pll_bypass) -+ cs43130_change_clksrc(component, CS43130_MCLK_SRC_EXT); -+ else -+ cs43130_change_clksrc(component, CS43130_MCLK_SRC_PLL); -+ } -+ -+ cs43130->clk_req++; -+ mutex_unlock(&cs43130->clk_mutex); -+ -+ switch (dai->id) { -+ case CS43130_ASP_DOP_DAI: -+ case CS43130_XSP_DOP_DAI: -+ /* DoP bitwidth is always 24-bit */ -+ bitwidth_dai = 24; -+ sclk = params_rate(params) * bitwidth_dai * -+ params_channels(params); -+ -+ switch (params_rate(params)) { -+ case 176400: -+ dsd_speed = 0; -+ break; -+ case 352800: -+ dsd_speed = 1; -+ break; -+ default: -+ dev_err(component->dev, "Rate(%u) not supported\n", -+ params_rate(params)); -+ return -EINVAL; -+ } -+ -+ regmap_update_bits(cs43130->regmap, CS43130_DSD_PATH_CTL_2, -+ CS43130_DSD_SPEED_MASK, -+ dsd_speed << CS43130_DSD_SPEED_SHIFT); -+ break; -+ case CS43130_ASP_PCM_DAI: -+ rate_map = cs43130_get_rate_table(params_rate(params)); -+ if (!rate_map) -+ return -EINVAL; -+ -+ regmap_write(cs43130->regmap, CS43130_SP_SRATE, rate_map->val); -+ if ((dop_rate == 176400) && (bitwidth_dai == 24)) { -+ dsd_speed = 0; -+ regmap_update_bits(cs43130->regmap, -+ CS43130_DSD_PATH_CTL_2, -+ CS43130_DSD_SPEED_MASK, -+ dsd_speed << CS43130_DSD_SPEED_SHIFT); -+ regmap_update_bits(cs43130->regmap, -+ CS43130_DSD_PATH_CTL_2, -+ CS43130_DSD_SRC_MASK, -+ CS43130_DSD_SRC_ASP << -+ CS43130_DSD_SRC_SHIFT); -+ regmap_update_bits(cs43130->regmap, -+ CS43130_DSD_PATH_CTL_2, -+ CS43130_DSD_EN_MASK, 0x01 << -+ CS43130_DSD_EN_SHIFT); -+ } -+ break; -+ default: -+ dev_err(component->dev, "Invalid DAI (%d)\n", dai->id); -+ return -EINVAL; -+ } -+ -+ switch (dai->id) { -+ case CS43130_ASP_DOP_DAI: -+ regmap_update_bits(cs43130->regmap, CS43130_DSD_PATH_CTL_2, -+ CS43130_DSD_SRC_MASK, CS43130_DSD_SRC_ASP << -+ CS43130_DSD_SRC_SHIFT); -+ regmap_update_bits(cs43130->regmap, CS43130_DSD_PATH_CTL_2, -+ CS43130_DSD_EN_MASK, 0x01 << -+ CS43130_DSD_EN_SHIFT); -+ break; -+ case CS43130_XSP_DOP_DAI: -+ regmap_update_bits(cs43130->regmap, CS43130_DSD_PATH_CTL_2, -+ CS43130_DSD_SRC_MASK, CS43130_DSD_SRC_XSP << -+ CS43130_DSD_SRC_SHIFT); -+ break; -+ } -+ if (!sclk && cs43130->dais[dai->id].dai_mode == -+ SND_SOC_DAIFMT_CBM_CFM) { -+ /* Calculate SCLK in master mode if unassigned */ -+ sclk = params_rate(params) * bitwidth_dai * -+ params_channels(params); -+ } -+ if (!sclk) { -+ /* at this point, SCLK must be set */ -+ dev_err(component->dev, "SCLK freq is not set\n"); -+ return -EINVAL; -+ } -+ -+ bitwidth_sclk = (sclk / params_rate(params)) / params_channels(params); -+ if (bitwidth_sclk < bitwidth_dai) { -+ dev_err(component->dev, "Format not supported: SCLK freq is too low\n"); -+ return -EINVAL; -+ } -+ -+ dev_dbg(component->dev, -+ "sclk = %u, fs = %d, bitwidth_dai = %u\n", -+ sclk, params_rate(params), bitwidth_dai); -+ -+ dev_dbg(component->dev, -+ "bitwidth_sclk = %u, num_ch = %u\n", -+ bitwidth_sclk, params_channels(params)); -+ -+ cs43130_set_bitwidth(dai->id, bitwidth_dai, cs43130->regmap); -+ cs43130_set_sp_fmt(dai->id, bitwidth_sclk, params, cs43130); -+ ret = cs43130_pwr_up_asp_dac(component); -+ return 0; -+} -+ -+static int cs43130_hw_free(struct snd_pcm_substream *substream, -+ struct snd_soc_dai *dai) -+{ -+ struct snd_soc_component *component = dai->component; -+ struct cs43130_priv *cs43130 = -+ snd_soc_component_get_drvdata(component); -+ -+ mutex_lock(&cs43130->clk_mutex); -+ cs43130->clk_req--; -+ if (!cs43130->clk_req) { -+ /* no DAI is currently using clk */ -+ cs43130_change_clksrc(component, CS43130_MCLK_SRC_RCO); -+ cs43130_pcm_pdn(component); -+ } -+ mutex_unlock(&cs43130->clk_mutex); -+ -+ return 0; -+} -+ -+static const unsigned int cs43130_asp_src_rates[] = { -+ 32000, 44100, 48000, 88200, 96000, 176400, 192000 -+}; -+ -+static const struct snd_pcm_hw_constraint_list cs43130_asp_constraints = { -+ .count = ARRAY_SIZE(cs43130_asp_src_rates), -+ .list = cs43130_asp_src_rates, -+}; -+ -+static int cs43130_pcm_startup(struct snd_pcm_substream *substream, -+ struct snd_soc_dai *dai) -+{ -+ return snd_pcm_hw_constraint_list(substream->runtime, 0, -+ SNDRV_PCM_HW_PARAM_RATE, -+ &cs43130_asp_constraints); -+} -+ -+static int cs43130_pcm_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) -+{ -+ struct snd_soc_component *component = codec_dai->component; -+ struct cs43130_priv *cs43130 = -+ snd_soc_component_get_drvdata(component); -+ -+ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { -+ case SND_SOC_DAIFMT_CBS_CFS: -+ cs43130->dais[codec_dai->id].dai_mode = SND_SOC_DAIFMT_CBS_CFS; -+ break; -+ case SND_SOC_DAIFMT_CBM_CFM: -+ cs43130->dais[codec_dai->id].dai_mode = SND_SOC_DAIFMT_CBM_CFM; -+ break; -+ default: -+ dev_err(component->dev, "unsupported mode\n"); -+ return -EINVAL; -+ } -+ -+ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { -+ case SND_SOC_DAIFMT_I2S: -+ cs43130->dais[codec_dai->id].dai_format = SND_SOC_DAIFMT_I2S; -+ break; -+ case SND_SOC_DAIFMT_LEFT_J: -+ cs43130->dais[codec_dai->id].dai_format = SND_SOC_DAIFMT_LEFT_J; -+ break; -+ default: -+ dev_err(component->dev, -+ "unsupported audio format\n"); -+ return -EINVAL; -+ } -+ -+ dev_dbg(component->dev, "dai_id = %d, dai_mode = %u, dai_format = %u\n", -+ codec_dai->id, -+ cs43130->dais[codec_dai->id].dai_mode, -+ cs43130->dais[codec_dai->id].dai_format); -+ -+ return 0; -+} -+ -+static int cs43130_set_sysclk(struct snd_soc_dai *codec_dai, -+ int clk_id, unsigned int freq, int dir) -+{ -+ struct snd_soc_component *component = codec_dai->component; -+ struct cs43130_priv *cs43130 = -+ snd_soc_component_get_drvdata(component); -+ -+ cs43130->dais[codec_dai->id].sclk = freq; -+ dev_dbg(component->dev, "dai_id = %d, sclk = %u\n", codec_dai->id, -+ cs43130->dais[codec_dai->id].sclk); -+ -+ return 0; -+} -+ -+static int cs43130_component_set_sysclk(struct snd_soc_component *component, -+ int clk_id, int source, -+ unsigned int freq, int dir) -+{ -+ struct cs43130_priv *cs43130 = -+ snd_soc_component_get_drvdata(component); -+ -+ dev_dbg(component->dev, "clk_id = %d, source = %d, freq = %d, dir = %d\n", -+ clk_id, source, freq, dir); -+ -+ switch (freq) { -+ case CS43130_MCLK_22M: -+ case CS43130_MCLK_24M: -+ cs43130->mclk = freq; -+ break; -+ default: -+ dev_err(component->dev, "Invalid MCLK INT freq: %u\n", freq); -+ return -EINVAL; -+ } -+ -+ if (source == CS43130_MCLK_SRC_EXT) { -+ cs43130->pll_bypass = true; -+ } else { -+ dev_err(component->dev, "Invalid MCLK source\n"); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+static u16 const cs43130_ac_freq[CS43130_AC_FREQ] = { -+ 24, -+ 43, -+ 93, -+ 200, -+ 431, -+ 928, -+ 2000, -+ 4309, -+ 9283, -+ 20000, -+}; -+static const struct snd_soc_dai_ops cs43130_dai_ops = { -+ .startup = cs43130_pcm_startup, -+ .hw_params = cs43130_hw_params, -+ .hw_free = cs43130_hw_free, -+ .set_sysclk = cs43130_set_sysclk, -+ .set_fmt = cs43130_pcm_set_fmt, -+}; -+ -+static struct snd_soc_dai_driver cs43130_codec_dai = { -+ .name = "allo-cs43130", -+ .playback = { -+ .stream_name = "Playback", -+ .channels_min = 2, -+ .channels_max = 2, -+ .rates = SNDRV_PCM_RATE_CONTINUOUS, -+ .rate_min = 44100, -+ .rate_max = 192000, -+ .formats = SNDRV_PCM_FMTBIT_S16_LE | -+ SNDRV_PCM_FMTBIT_S24_LE | -+ SNDRV_PCM_FMTBIT_S32_LE -+ -+ }, -+ .ops = &cs43130_dai_ops, -+}; -+ -+static struct snd_soc_component_driver cs43130_component_driver = { -+ .idle_bias_on = true, -+ .controls = cs43130_controls, -+ .num_controls = ARRAY_SIZE(cs43130_controls), -+ .set_sysclk = cs43130_component_set_sysclk, -+ .idle_bias_on = 1, -+ .use_pmdown_time = 1, -+ .endianness = 1, -+ .non_legacy_dai_naming = 1, -+}; -+ -+static const struct regmap_config cs43130_regmap = { -+ .reg_bits = 24, -+ .pad_bits = 8, -+ .val_bits = 8, -+ -+ .max_register = CS43130_LASTREG, -+ .reg_defaults = cs43130_reg_defaults, -+ .num_reg_defaults = ARRAY_SIZE(cs43130_reg_defaults), -+ .readable_reg = cs43130_readable_register, -+ .precious_reg = cs43130_precious_register, -+ .volatile_reg = cs43130_volatile_register, -+ .cache_type = REGCACHE_RBTREE, -+ /* needed for regcache_sync */ -+ .use_single_read = true, -+ .use_single_write = true, -+}; -+ -+static u16 const cs43130_dc_threshold[CS43130_DC_THRESHOLD] = { -+ 50, -+ 120, -+}; -+ -+static int cs43130_handle_device_data(struct i2c_client *i2c_client, -+ struct cs43130_priv *cs43130) -+{ -+ struct device_node *np = i2c_client->dev.of_node; -+ unsigned int val; -+ int i; -+ -+ if (of_property_read_u32(np, "cirrus,xtal-ibias", &val) < 0) { -+ /* Crystal is unused. System clock is used for external MCLK */ -+ cs43130->xtal_ibias = CS43130_XTAL_UNUSED; -+ return 0; -+ } -+ -+ switch (val) { -+ case 1: -+ cs43130->xtal_ibias = CS43130_XTAL_IBIAS_7_5UA; -+ break; -+ case 2: -+ cs43130->xtal_ibias = CS43130_XTAL_IBIAS_12_5UA; -+ break; -+ case 3: -+ cs43130->xtal_ibias = CS43130_XTAL_IBIAS_15UA; -+ break; -+ default: -+ dev_err(&i2c_client->dev, -+ "Invalid cirrus,xtal-ibias value: %d\n", val); -+ return -EINVAL; -+ } -+ -+ cs43130->dc_meas = of_property_read_bool(np, "cirrus,dc-measure"); -+ cs43130->ac_meas = of_property_read_bool(np, "cirrus,ac-measure"); -+ -+ if (of_property_read_u16_array(np, "cirrus,ac-freq", cs43130->ac_freq, -+ CS43130_AC_FREQ) < 0) { -+ for (i = 0; i < CS43130_AC_FREQ; i++) -+ cs43130->ac_freq[i] = cs43130_ac_freq[i]; -+ } -+ -+ if (of_property_read_u16_array(np, "cirrus,dc-threshold", -+ cs43130->dc_threshold, -+ CS43130_DC_THRESHOLD) < 0) { -+ for (i = 0; i < CS43130_DC_THRESHOLD; i++) -+ cs43130->dc_threshold[i] = cs43130_dc_threshold[i]; -+ } -+ -+ return 0; -+} -+ -+ -+static int allo_cs43130_component_probe(struct i2c_client *i2c, -+ const struct i2c_device_id *id) -+{ -+ struct regmap *regmap; -+ struct regmap_config config = cs43130_regmap; -+ struct device *dev = &i2c->dev; -+ struct cs43130_priv *cs43130; -+ unsigned int devid = 0; -+ unsigned int reg; -+ int ret; -+ -+ regmap = devm_regmap_init_i2c(i2c, &config); -+ if (IS_ERR(regmap)) -+ return PTR_ERR(regmap); -+ -+ cs43130 = devm_kzalloc(dev, sizeof(struct cs43130_priv), -+ GFP_KERNEL); -+ if (!cs43130) -+ return -ENOMEM; -+ -+ dev_set_drvdata(dev, cs43130); -+ cs43130->regmap = regmap; -+ -+ if (i2c->dev.of_node) { -+ ret = cs43130_handle_device_data(i2c, cs43130); -+ if (ret != 0) -+ return ret; -+ } -+ usleep_range(2000, 2050); -+ -+ ret = regmap_read(cs43130->regmap, CS43130_DEVID_AB, ®); -+ devid = (reg & 0xFF) << 12; -+ ret = regmap_read(cs43130->regmap, CS43130_DEVID_CD, ®); -+ devid |= (reg & 0xFF) << 4; -+ ret = regmap_read(cs43130->regmap, CS43130_DEVID_E, ®); -+ devid |= (reg & 0xF0) >> 4; -+ if (devid != CS43198_CHIP_ID) { -+ dev_err(dev, "Failed to read Chip or wrong Chip id: %d\n", ret); -+ return ret; -+ } -+ -+ cs43130->mclk_int_src = CS43130_MCLK_SRC_RCO; -+ msleep(20); -+ -+ ret = snd_soc_register_component(dev, &cs43130_component_driver, -+ &cs43130_codec_dai, 1); -+ if (ret != 0) { -+ dev_err(dev, "failed to register codec: %d\n", ret); -+ return ret; -+ } -+ regmap_update_bits(cs43130->regmap, CS43130_PAD_INT_CFG, -+ CS43130_ASP_3ST_MASK, 0); -+ regmap_update_bits(cs43130->regmap, CS43130_PAD_INT_CFG, -+ CS43130_XSP_3ST_MASK, 1); -+ regmap_update_bits(cs43130->regmap, CS43130_PWDN_CTL, -+ CS43130_PDN_HP_MASK, 1 << CS43130_PDN_HP_SHIFT); -+ msleep(20); -+ regmap_write(cs43130->regmap, CS43130_CLASS_H_CTL, 0x06); -+ snd_allo_clk44gpio = devm_gpiod_get(dev, "clock44", GPIOD_OUT_HIGH); -+ if (IS_ERR(snd_allo_clk44gpio)) -+ dev_err(dev, "devm_gpiod_get() failed\n"); -+ -+ snd_allo_clk48gpio = devm_gpiod_get(dev, "clock48", GPIOD_OUT_LOW); -+ if (IS_ERR(snd_allo_clk48gpio)) -+ dev_err(dev, "devm_gpiod_get() failed\n"); -+ -+ return 0; -+} -+ -+static int allo_cs43130_component_remove(struct i2c_client *i2c) -+{ -+ snd_soc_unregister_component(&i2c->dev); -+ return 0; -+} -+ -+static const struct i2c_device_id allo_cs43130_component_id[] = { -+ { "allo-cs43198", }, -+ { } -+}; -+MODULE_DEVICE_TABLE(i2c, allo_cs43130_component_id); -+ -+static const struct of_device_id allo_cs43130_codec_of_match[] = { -+ { .compatible = "allo,allo-cs43198", }, -+ { } -+}; -+MODULE_DEVICE_TABLE(of, allo_cs43130_codec_of_match); -+ -+static struct i2c_driver allo_cs43130_component_driver = { -+ .probe = allo_cs43130_component_probe, -+ .remove = allo_cs43130_component_remove, -+ .id_table = allo_cs43130_component_id, -+ .driver = { -+ .name = "allo-cs43198", -+ .of_match_table = allo_cs43130_codec_of_match, -+ }, -+}; -+ -+module_i2c_driver(allo_cs43130_component_driver); -+ -+MODULE_DESCRIPTION("ASoC Allo Boss2 Codec Driver"); -+MODULE_AUTHOR("Sudeepkumar "); -+MODULE_LICENSE("GPL v2"); diff --git a/target/linux/bcm27xx/patches-5.10/950-0391-Add-allo-boss2-overlay.patch b/target/linux/bcm27xx/patches-5.10/950-0391-Add-allo-boss2-overlay.patch deleted file mode 100644 index 841e942b63..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0391-Add-allo-boss2-overlay.patch +++ /dev/null @@ -1,98 +0,0 @@ -From d05c88f5281ef8d50c984bfca8faf8420c656057 Mon Sep 17 00:00:00 2001 -From: Sudeep -Date: Fri, 23 Oct 2020 15:51:15 +0530 -Subject: [PATCH] Add allo boss2 overlay - -Signed-off-by: Sudeep ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 ++ - .../overlays/allo-boss2-dac-audio-overlay.dts | 57 +++++++++++++++++++ - 3 files changed, 64 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/allo-boss2-dac-audio-overlay.dts - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -14,6 +14,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - adv728x-m.dtbo \ - akkordion-iqdacplus.dtbo \ - allo-boss-dac-pcm512x-audio.dtbo \ -+ allo-boss2-dac-audio.dtbo \ - allo-digione.dtbo \ - allo-katana-dac-audio.dtbo \ - allo-piano-dac-pcm512x-audio.dtbo \ ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -420,6 +420,12 @@ Params: 24db_digital_gain Allow ga - slave" - - -+Name: allo-boss2-dac-audio -+Info: Configures the Allo Boss2 DAC audio card -+Load: dtoverlay=allo-boss2-dac-audio -+Params: -+ -+ - Name: allo-digione - Info: Configures the Allo Digione audio card - Load: dtoverlay=allo-digione ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/allo-boss2-dac-audio-overlay.dts -@@ -0,0 +1,57 @@ -+/* * Definitions for Allo Boss2 DAC boards -+ */ -+ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2835"; -+ -+ fragment@0 { -+ target = <&i2s>; -+ __overlay__ { -+ #sound-dai-cells = <0>; -+ status = "okay"; -+ cpu_port: port { -+ cpu_endpoint: endpoint { -+ remote-endpoint = <&codec_endpoint>; -+ bitclock-master = <&codec_endpoint>; -+ frame-master = <&codec_endpoint>; -+ dai-format = "i2s"; -+ }; -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ allo-cs43130@30 { -+ #sound-dai-cells = <0>; -+ compatible = "allo,allo-cs43198"; -+ clock44-gpio = <&gpio 5 0>; -+ clock48-gpio = <&gpio 6 0>; -+ reg = <0x30>; -+ port { -+ codec_endpoint: endpoint { -+ remote-endpoint = <&cpu_endpoint>; -+ }; -+ }; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&sound>; -+ boss2_dac: __overlay__ { -+ compatible = "audio-graph-card"; -+ label = "Allo Boss2"; -+ dais = <&cpu_port>; -+ status = "okay"; -+ }; -+ }; -+}; -+ diff --git a/target/linux/bcm27xx/patches-5.10/950-0392-Overlay-Update-Allo-Piano-Plus-dac-driver-for-5.4.y-.patch b/target/linux/bcm27xx/patches-5.10/950-0392-Overlay-Update-Allo-Piano-Plus-dac-driver-for-5.4.y-.patch deleted file mode 100644 index 41aca2bc1d..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0392-Overlay-Update-Allo-Piano-Plus-dac-driver-for-5.4.y-.patch +++ /dev/null @@ -1,30 +0,0 @@ -From b26fca3f72b9d79141a0355909602f5194dbd1b3 Mon Sep 17 00:00:00 2001 -From: paul-1 <6473457+paul-1@users.noreply.github.com> -Date: Wed, 4 Nov 2020 19:17:48 -0500 -Subject: [PATCH] Overlay: Update Allo Piano Plus dac driver for 5.4.y - kernels. - -Create unique names for the two instances of the codec driver. - -Signed-off-by: Paul Hermann ---- - .../dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts -+++ b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts -@@ -23,12 +23,14 @@ - #sound-dai-cells = <0>; - compatible = "ti,pcm5122"; - reg = <0x4c>; -+ sound-name-prefix = "Main"; - status = "okay"; - }; - allo_pcm5122_4d: pcm5122@4d { - #sound-dai-cells = <0>; - compatible = "ti,pcm5122"; - reg = <0x4d>; -+ sound-name-prefix = "Sub"; - status = "okay"; - }; - }; diff --git a/target/linux/bcm27xx/patches-5.10/950-0397-ARM-dts-CM4-audio-pins-are-not-connected.patch b/target/linux/bcm27xx/patches-5.10/950-0397-ARM-dts-CM4-audio-pins-are-not-connected.patch deleted file mode 100644 index 65b1a03af6..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0397-ARM-dts-CM4-audio-pins-are-not-connected.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 3b2a09e95b28f9fd30bc569135d4e939d3d5eb7f Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 7 Dec 2020 09:35:57 +0000 -Subject: [PATCH] ARM: dts: CM4 audio pins are not connected - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/bcm2711-rpi-cm4.dts | 2 -- - 1 file changed, 2 deletions(-) - ---- a/arch/arm/boot/dts/bcm2711-rpi-cm4.dts -+++ b/arch/arm/boot/dts/bcm2711-rpi-cm4.dts -@@ -548,8 +548,6 @@ - - &gpio { - audio_pins: audio_pins { -- brcm,pins = <40 41>; -- brcm,function = <4>; - }; - }; - diff --git a/target/linux/bcm27xx/patches-5.10/950-0398-overlays-Add-PCF85063-and-PCF85063A-to-i2c-rtc.patch b/target/linux/bcm27xx/patches-5.10/950-0398-overlays-Add-PCF85063-and-PCF85063A-to-i2c-rtc.patch deleted file mode 100644 index 8c9f55aa13..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0398-overlays-Add-PCF85063-and-PCF85063A-to-i2c-rtc.patch +++ /dev/null @@ -1,339 +0,0 @@ -From ba93a3eeaf4101166feec31b4a2799b6d4aee640 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 7 Dec 2020 08:49:53 +0000 -Subject: [PATCH] overlays: Add PCF85063 and PCF85063A to i2c-rtc - -Add support for the PCF85063 and PCF85063A RTC devices to the -i2c-rtc overlay. - -Also enable the device to be used on i2c0 (i2c_vc) on GPIOs 0&1 (use -parameter "i2c0") and GPIOs 44 & 45 (use parameter "i2c_csi_dsi"). - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/README | 8 ++ - .../arm/boot/dts/overlays/i2c-rtc-overlay.dts | 98 ++++++++++--------- - 2 files changed, 61 insertions(+), 45 deletions(-) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -1257,6 +1257,10 @@ Params: abx80x Select o - - pcf2129 Select the PCF2129 device - -+ pcf85063 Select the PCF85363 device -+ -+ pcf85063a Select the PCF85363A device -+ - pcf8523 Select the PCF8523 device - - pcf85363 Select the PCF85363 device -@@ -1269,6 +1273,10 @@ Params: abx80x Select o - - sd3078 Select the ZXW Shenzhen whwave SD3078 device - -+ i2c0 Choose the I2C0 bus on GPIOs 0&1 -+ -+ i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45 -+ - addr Sets the address for the RTC. Note that the - device must be configured to use the specified - address. ---- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts -@@ -6,235 +6,238 @@ - compatible = "brcm,bcm2835"; - - fragment@0 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - abx80x: abx80x@69 { - compatible = "abracon,abx80x"; - reg = <0x69>; - abracon,tc-diode = "standard"; - abracon,tc-resistor = <0>; -- status = "okay"; - }; - }; - }; - - fragment@1 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - ds1307: ds1307@68 { - compatible = "dallas,ds1307"; - reg = <0x68>; -- status = "okay"; - }; - }; - }; - - fragment@2 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - ds1339: ds1339@68 { - compatible = "dallas,ds1339"; - trickle-resistor-ohms = <0>; - reg = <0x68>; -- status = "okay"; - }; - }; - }; - - fragment@3 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - ds3231: ds3231@68 { - compatible = "maxim,ds3231"; - reg = <0x68>; -- status = "okay"; - }; - }; - }; - - fragment@4 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - mcp7940x: mcp7940x@6f { - compatible = "microchip,mcp7940x"; - reg = <0x6f>; -- status = "okay"; - }; - }; - }; - - fragment@5 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - mcp7941x: mcp7941x@6f { - compatible = "microchip,mcp7941x"; - reg = <0x6f>; -- status = "okay"; - }; - }; - }; - - fragment@6 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - pcf2127@51 { - compatible = "nxp,pcf2127"; - reg = <0x51>; -- status = "okay"; - }; - }; - }; - - fragment@7 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - pcf8523: pcf8523@68 { - compatible = "nxp,pcf8523"; - reg = <0x68>; -- status = "okay"; - }; - }; - }; - - fragment@8 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - pcf8563: pcf8563@51 { - compatible = "nxp,pcf8563"; - reg = <0x51>; -- status = "okay"; - }; - }; - }; - - fragment@9 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - m41t62: m41t62@68 { - compatible = "st,m41t62"; - reg = <0x68>; -- status = "okay"; - }; - }; - }; - - fragment@10 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - rv3028: rv3028@52 { - compatible = "microcrystal,rv3028"; - reg = <0x52>; -- status = "okay"; - }; - }; - }; - - fragment@11 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - pcf2129@51 { - compatible = "nxp,pcf2129"; - reg = <0x51>; -- status = "okay"; - }; - }; - }; - - fragment@12 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - pcf85363@51 { - compatible = "nxp,pcf85363"; - reg = <0x51>; -- status = "okay"; - }; - }; - }; - - fragment@13 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - rv1805: rv1805@69 { - compatible = "microcrystal,rv1805"; - reg = <0x69>; - abracon,tc-diode = "standard"; - abracon,tc-resistor = <0>; -- status = "okay"; - }; - }; - }; - - fragment@14 { -- target = <&i2c_arm>; -+ target = <&i2cbus>; - __dormant__ { - #address-cells = <1>; - #size-cells = <0>; -- status = "okay"; - - sd3078: sd3078@32 { - compatible = "whwave,sd3078"; - reg = <0x32>; -- status = "okay"; - }; - }; - }; - -+ fragment@15 { -+ target = <&i2cbus>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ pcf85063@51 { -+ compatible = "nxp,pcf85063"; -+ reg = <0x51>; -+ }; -+ }; -+ }; -+ -+ fragment@16 { -+ target = <&i2cbus>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ pcf85063a@51 { -+ compatible = "nxp,pcf85063a"; -+ reg = <0x51>; -+ }; -+ }; -+ }; -+ -+ frag100: fragment@100 { -+ target = <&i2c_arm>; -+ i2cbus: __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ - __overrides__ { - abx80x = <0>,"+0"; - ds1307 = <0>,"+1"; -@@ -251,6 +254,11 @@ - pcf85363 = <0>,"+12"; - rv1805 = <0>,"+13"; - sd3078 = <0>,"+14"; -+ pcf85063 = <0>,"+15"; -+ pcf85063a = <0>,"+16"; -+ -+ i2c0 = <&frag100>, "target:0=",<&i2c0>; -+ i2c_csi_dsi = <&frag100>, "target:0=",<&i2c_csi_dsi>; - - addr = <&abx80x>, "reg:0", - <&ds1307>, "reg:0", diff --git a/target/linux/bcm27xx/patches-5.10/950-0399-overlays-Fix-cut-and-paste-error-in-README.patch b/target/linux/bcm27xx/patches-5.10/950-0399-overlays-Fix-cut-and-paste-error-in-README.patch deleted file mode 100644 index ba4453c1cc..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0399-overlays-Fix-cut-and-paste-error-in-README.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 4e88fb586d6b2e062c1bb9613fa9aaf4ee52fe79 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 7 Dec 2020 17:18:39 +0000 -Subject: [PATCH] overlays: Fix cut-and-paste error in README - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/README | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -1257,9 +1257,9 @@ Params: abx80x Select o - - pcf2129 Select the PCF2129 device - -- pcf85063 Select the PCF85363 device -+ pcf85063 Select the PCF85063 device - -- pcf85063a Select the PCF85363A device -+ pcf85063a Select the PCF85063A device - - pcf8523 Select the PCF8523 device - diff --git a/target/linux/bcm27xx/patches-5.10/950-0400-staging-bcm2835-codec-Ensure-OUTPUT-timestamps-are-a.patch b/target/linux/bcm27xx/patches-5.10/950-0400-staging-bcm2835-codec-Ensure-OUTPUT-timestamps-are-a.patch deleted file mode 100644 index e4a5eb832c..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0400-staging-bcm2835-codec-Ensure-OUTPUT-timestamps-are-a.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 35e371f270fb14320de11b93cbc0f1e1024ff58c Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 4 Nov 2020 18:31:02 +0000 -Subject: [PATCH] staging/bcm2835-codec: Ensure OUTPUT timestamps are - always forwarded - -The firmware by default tries to ensure that decoded frame -timestamps always increment. This is counter to the V4L2 API -which wants exactly the OUTPUT queue timestamps passed to the -CAPTURE queue buffers. - -Disable the firmware option. - -Signed-off-by: Dave Stevenson ---- - .../bcm2835-codec/bcm2835-v4l2-codec.c | 13 +++++++++++++ - .../vc04_services/vchiq-mmal/mmal-parameters.h | 3 +++ - 2 files changed, 16 insertions(+) - ---- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c -+++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c -@@ -2001,6 +2001,19 @@ static int bcm2835_codec_create_componen - MMAL_PARAMETER_ZERO_COPY, &enable, - sizeof(enable)); - -+ if (dev->role == DECODE) { -+ /* -+ * Disable firmware option that ensures decoded timestamps -+ * always increase. -+ */ -+ enable = 0; -+ vchiq_mmal_port_parameter_set(dev->instance, -+ &ctx->component->output[0], -+ MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS, -+ &enable, -+ sizeof(enable)); -+ } -+ - setup_mmal_port_format(ctx, &ctx->q_data[V4L2_M2M_SRC], - &ctx->component->input[0]); - ---- a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h -+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h -@@ -674,6 +674,9 @@ enum mmal_parameter_video_type { - - /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */ - MMAL_PARAMETER_VIDEO_ENCODE_HEADERS_WITH_FRAME, -+ -+ /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */ -+ MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS, - }; - - /** Valid mirror modes */ diff --git a/target/linux/bcm27xx/patches-5.10/950-0402-overlays-mpu6050-Add-addr-parameter.patch b/target/linux/bcm27xx/patches-5.10/950-0402-overlays-mpu6050-Add-addr-parameter.patch deleted file mode 100644 index 3806b8fa9f..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0402-overlays-mpu6050-Add-addr-parameter.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 3e0ea72cab201faea51f8cdb490562151a3f01fd Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Tue, 15 Dec 2020 17:02:17 +0000 -Subject: [PATCH] overlays: mpu6050: Add 'addr' parameter - -The mpu6050 starts up at address 0x68 by default, but can be set to -0x69 if the ADO pin is pulled high. Give the overlay an addr parameter -to allow devices at the alternate address to be used. - -See: https://github.com/Hexxeh/rpi-firmware/issues/252 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/README | 1 + - arch/arm/boot/dts/overlays/mpu6050-overlay.dts | 1 + - 2 files changed, 2 insertions(+) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -1920,6 +1920,7 @@ Name: mpu6050 - Info: Overlay for i2c connected mpu6050 imu - Load: dtoverlay=mpu6050,= - Params: interrupt GPIO pin for interrupt (default 4) -+ addr I2C address of the device (default 0x68) - - - Name: mz61581 ---- a/arch/arm/boot/dts/overlays/mpu6050-overlay.dts -+++ b/arch/arm/boot/dts/overlays/mpu6050-overlay.dts -@@ -24,5 +24,6 @@ - - __overrides__ { - interrupt = <&mpu6050>,"interrupts:0"; -+ addr = <&mpu6050>,"reg:0"; - }; - }; diff --git a/target/linux/bcm27xx/patches-5.10/950-0403-drm-vc4-Make-normalize_zpos-conditional-on-using-fkm.patch b/target/linux/bcm27xx/patches-5.10/950-0403-drm-vc4-Make-normalize_zpos-conditional-on-using-fkm.patch deleted file mode 100644 index b93da878c1..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0403-drm-vc4-Make-normalize_zpos-conditional-on-using-fkm.patch +++ /dev/null @@ -1,29 +0,0 @@ -From a384e2c5d6e72e08e3d183b58ca8697f6665a793 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Tue, 15 Dec 2020 16:26:51 +0000 -Subject: [PATCH] drm/vc4: Make normalize_zpos conditional on using - fkms - -Eric's view was that there was no point in having zpos -support on vc4 as all the planes had the same functionality. - -Can be later squashed into (and fixes): -drm/vc4: Add firmware-kms mode - -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_kms.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -923,7 +923,8 @@ int vc4_kms_load(struct drm_device *dev) - dev->mode_config.preferred_depth = 24; - dev->mode_config.async_page_flip = true; - dev->mode_config.allow_fb_modifiers = true; -- dev->mode_config.normalize_zpos = true; -+ if (vc4->firmware_kms) -+ dev->mode_config.normalize_zpos = true; - - ret = vc4_ctm_obj_init(vc4); - if (ret) diff --git a/target/linux/bcm27xx/patches-5.10/950-0404-overlays-Add-missing-addresses-to-ads1015-ads1115.patch b/target/linux/bcm27xx/patches-5.10/950-0404-overlays-Add-missing-addresses-to-ads1015-ads1115.patch deleted file mode 100644 index 346c1017e0..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0404-overlays-Add-missing-addresses-to-ads1015-ads1115.patch +++ /dev/null @@ -1,41 +0,0 @@ -From f3f0143ace6866e7370e1cec6ff04f0e6ede11dd Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 16 Dec 2020 09:28:17 +0000 -Subject: [PATCH] overlays: Add missing addresses to ads1015/ads1115 - -The overlays for the ads1015 and ads1115 I2C ADCs omitted the addresses -in the main device node names. As well as breaking the conventions for -I2C devices, this prevents the firmware from renaming them when the -"reg" property is modified, which in turn stops the overlays from being -instantiated multiple times. - -See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=294465 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/ads1015-overlay.dts | 2 +- - arch/arm/boot/dts/overlays/ads1115-overlay.dts | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/arm/boot/dts/overlays/ads1015-overlay.dts -+++ b/arch/arm/boot/dts/overlays/ads1015-overlay.dts -@@ -13,7 +13,7 @@ - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; -- ads1015: ads1015 { -+ ads1015: ads1015@48 { - compatible = "ti,ads1015"; - status = "okay"; - #address-cells = <1>; ---- a/arch/arm/boot/dts/overlays/ads1115-overlay.dts -+++ b/arch/arm/boot/dts/overlays/ads1115-overlay.dts -@@ -15,7 +15,7 @@ - #size-cells = <0>; - status = "okay"; - -- ads1115: ads1115 { -+ ads1115: ads1115@48 { - compatible = "ti,ads1115"; - status = "okay"; - #address-cells = <1>; diff --git a/target/linux/bcm27xx/patches-5.10/950-0406-staging-vc04_services-codec-Add-support-for-CID-MPEG.patch b/target/linux/bcm27xx/patches-5.10/950-0406-staging-vc04_services-codec-Add-support-for-CID-MPEG.patch deleted file mode 100644 index ca3d454f4b..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0406-staging-vc04_services-codec-Add-support-for-CID-MPEG.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 8c2356e38c9a51356a9f0eacf08f4de6521ad0bd Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Sun, 13 Dec 2020 16:45:58 +0000 -Subject: [PATCH] staging/vc04_services/codec: Add support for CID - MPEG_HEADER_MODE - -Control V4L2_CID_MPEG_VIDEO_HEADER_MODE controls whether the encoder -is meant to emit the header bytes as a separate packet or with the -first encoded frame. -Add support for it. - -Signed-off-by: Dave Stevenson ---- - .../bcm2835-codec/bcm2835-v4l2-codec.c | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - ---- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c -+++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c -@@ -1692,6 +1692,17 @@ static int bcm2835_codec_s_ctrl(struct v - sizeof(ctrl->val)); - break; - -+ case V4L2_CID_MPEG_VIDEO_HEADER_MODE: -+ if (!ctx->component) -+ break; -+ -+ ret = vchiq_mmal_port_parameter_set(ctx->dev->instance, -+ &ctx->component->output[0], -+ MMAL_PARAMETER_VIDEO_ENCODE_HEADERS_WITH_FRAME, -+ &ctrl->val, -+ sizeof(ctrl->val)); -+ break; -+ - case V4L2_CID_MPEG_VIDEO_H264_I_PERIOD: - if (!ctx->component) - break; -@@ -1963,6 +1974,7 @@ static int bcm2835_codec_set_ctrls(struc - const u32 control_ids[] = { - V4L2_CID_MPEG_VIDEO_BITRATE_MODE, - V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER, -+ V4L2_CID_MPEG_VIDEO_HEADER_MODE, - V4L2_CID_MPEG_VIDEO_H264_I_PERIOD, - V4L2_CID_MPEG_VIDEO_H264_LEVEL, - V4L2_CID_MPEG_VIDEO_H264_PROFILE, -@@ -2515,7 +2527,7 @@ static int bcm2835_codec_open(struct fil - hdl = &ctx->hdl; - if (dev->role == ENCODE) { - /* Encode controls */ -- v4l2_ctrl_handler_init(hdl, 7); -+ v4l2_ctrl_handler_init(hdl, 9); - - v4l2_ctrl_new_std_menu(hdl, &bcm2835_codec_ctrl_ops, - V4L2_CID_MPEG_VIDEO_BITRATE_MODE, -@@ -2525,6 +2537,10 @@ static int bcm2835_codec_open(struct fil - V4L2_CID_MPEG_VIDEO_BITRATE, - 25 * 1000, 25 * 1000 * 1000, - 25 * 1000, 10 * 1000 * 1000); -+ v4l2_ctrl_new_std_menu(hdl, &bcm2835_codec_ctrl_ops, -+ V4L2_CID_MPEG_VIDEO_HEADER_MODE, -+ V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME, -+ 0, V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME); - v4l2_ctrl_new_std(hdl, &bcm2835_codec_ctrl_ops, - V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER, - 0, 1, diff --git a/target/linux/bcm27xx/patches-5.10/950-0407-staging-vc04_services-codec-Clear-last-buf-dequeued-.patch b/target/linux/bcm27xx/patches-5.10/950-0407-staging-vc04_services-codec-Clear-last-buf-dequeued-.patch deleted file mode 100644 index a64930c1cb..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0407-staging-vc04_services-codec-Clear-last-buf-dequeued-.patch +++ /dev/null @@ -1,37 +0,0 @@ -From b35ad716845db394d9850d123d3617653f26a921 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Sun, 13 Dec 2020 16:54:43 +0000 -Subject: [PATCH] staging/vc04_services/codec: Clear last buf dequeued - flag on START - -It appears that the V4L2 M2M framework requires the driver to manually -call vb2_clear_last_buffer_dequeued on the CAPTURE queue during a -V4L2_DEC_CMD_START. -Add such a call. - -Signed-off-by: Dave Stevenson ---- - .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c -+++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c -@@ -1780,6 +1780,7 @@ static int vidioc_decoder_cmd(struct fil - { - struct bcm2835_codec_ctx *ctx = file2ctx(file); - struct bcm2835_codec_q_data *q_data = &ctx->q_data[V4L2_M2M_SRC]; -+ struct vb2_queue *dst_vq; - int ret; - - v4l2_dbg(2, debug, &ctx->dev->v4l2_dev, "%s, cmd %u", __func__, -@@ -1815,7 +1816,9 @@ static int vidioc_decoder_cmd(struct fil - break; - - case V4L2_DEC_CMD_START: -- /* Do we need to do anything here? */ -+ dst_vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, -+ V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); -+ vb2_clear_last_buffer_dequeued(dst_vq); - break; - - default: diff --git a/target/linux/bcm27xx/patches-5.10/950-0408-drm-atomic-Pass-the-full-state-to-CRTC-atomic-enable.patch b/target/linux/bcm27xx/patches-5.10/950-0408-drm-atomic-Pass-the-full-state-to-CRTC-atomic-enable.patch deleted file mode 100644 index 28bd9095d0..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0408-drm-atomic-Pass-the-full-state-to-CRTC-atomic-enable.patch +++ /dev/null @@ -1,1183 +0,0 @@ -From 41661de0a014d606f6f55dd030a14bc341e677fc Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Thu, 8 Oct 2020 14:44:08 +0200 -Subject: [PATCH] drm/atomic: Pass the full state to CRTC atomic - enable/disable - -Commit 351f950db4ab28c321a1bd4b92e4bb03e34c4703 upstream. - -If the CRTC driver ever needs to access the full DRM state, it can't do so -at atomic_enable / atomic_disable time since drm_atomic_helper_swap_state -will have cleared the pointer from the struct drm_crtc_state to the struct -drm_atomic_state before calling those hooks. - -In order to allow that, let's pass the full DRM state to atomic_enable and -atomic_disable. The conversion was done using the coccinelle script below, -built tested on all the drivers and actually tested on vc4. - -virtual report - -@@ -struct drm_crtc_helper_funcs *FUNCS; -identifier dev, state; -identifier crtc, crtc_state; -@@ - - disable_outputs(struct drm_device *dev, struct drm_atomic_state *state) - { - <... -- FUNCS->atomic_disable(crtc, crtc_state); -+ FUNCS->atomic_disable(crtc, state); - ...> - } - -@@ -struct drm_crtc_helper_funcs *FUNCS; -identifier dev, state; -identifier crtc, crtc_state; -@@ - - drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, struct drm_atomic_state *state) - { - <... -- FUNCS->atomic_enable(crtc, crtc_state); -+ FUNCS->atomic_enable(crtc, state); - ...> - } - -@@ -identifier crtc, old_state; -@@ - - struct drm_crtc_helper_funcs { - ... -- void (*atomic_enable)(struct drm_crtc *crtc, struct drm_crtc_state *old_state); -+ void (*atomic_enable)(struct drm_crtc *crtc, struct drm_atomic_state *state); - ... -- void (*atomic_disable)(struct drm_crtc *crtc, struct drm_crtc_state *old_state); -+ void (*atomic_disable)(struct drm_crtc *crtc, struct drm_atomic_state *state); - ... -} - -@ crtc_atomic_func @ -identifier helpers; -identifier func; -@@ - -( -static struct drm_crtc_helper_funcs helpers = { - ..., - .atomic_enable = func, - ..., -}; -| -static struct drm_crtc_helper_funcs helpers = { - ..., - .atomic_disable = func, - ..., -}; -) - -@ ignores_old_state @ -identifier crtc_atomic_func.func; -identifier crtc, old_state; -@@ - -void func(struct drm_crtc *crtc, - struct drm_crtc_state *old_state) -{ - ... when != old_state -} - -@ adds_old_state depends on crtc_atomic_func && !ignores_old_state @ -identifier crtc_atomic_func.func; -identifier crtc, old_state; -@@ - -void func(struct drm_crtc *crtc, struct drm_crtc_state *old_state) -{ -+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc); - ... -} - -@ depends on crtc_atomic_func @ -identifier crtc_atomic_func.func; -expression E; -type T; -@@ - -void func(...) -{ - ... -- T state = E; -+ T crtc_state = E; - <+... -- state -+ crtc_state - ...+> - -} - -@ depends on crtc_atomic_func @ -identifier crtc_atomic_func.func; -type T; -@@ - -void func(...) -{ - ... -- T state; -+ T crtc_state; - <+... -- state -+ crtc_state - ...+> - -} - -@ depends on crtc_atomic_func @ -identifier crtc_atomic_func.func; -identifier old_state; -identifier crtc; -@@ - -void func(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state -+ struct drm_atomic_state *state - ) - { ... } - -@ include depends on adds_old_state @ -@@ - - #include - -@ no_include depends on !include && adds_old_state @ -@@ - -+ #include - #include - -Signed-off-by: Maxime Ripard -Acked-by: Daniel Vetter -Link: https://patchwork.freedesktop.org/patch/msgid/845aa10ef171fc0ea060495efef142a0c13f7870.1602161031.git-series.maxime@cerno.tech ---- - drivers/gpu/drm/arc/arcpgu_crtc.c | 4 ++-- - drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 8 ++++++-- - drivers/gpu/drm/arm/hdlcd_crtc.c | 4 ++-- - drivers/gpu/drm/arm/malidp_crtc.c | 6 ++++-- - drivers/gpu/drm/armada/armada_crtc.c | 8 ++++++-- - drivers/gpu/drm/ast/ast_mode.c | 6 ++++-- - drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 4 ++-- - drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- - drivers/gpu/drm/drm_simple_kms_helper.c | 4 ++-- - drivers/gpu/drm/exynos/exynos_drm_crtc.c | 4 ++-- - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 6 ++++-- - drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 4 ++-- - drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 4 ++-- - drivers/gpu/drm/imx/dcss/dcss-crtc.c | 9 +++++++-- - drivers/gpu/drm/imx/ipuv3-crtc.c | 6 ++++-- - drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 ++-- - drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 ++-- - drivers/gpu/drm/meson/meson_crtc.c | 8 ++++---- - drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 7 +++++-- - drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c | 4 ++-- - drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 4 ++-- - drivers/gpu/drm/mxsfb/mxsfb_kms.c | 4 ++-- - drivers/gpu/drm/omapdrm/omap_crtc.c | 4 ++-- - drivers/gpu/drm/qxl/qxl_display.c | 4 ++-- - drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 6 ++++-- - drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 ++++-- - drivers/gpu/drm/sti/sti_crtc.c | 4 ++-- - drivers/gpu/drm/stm/ltdc.c | 4 ++-- - drivers/gpu/drm/sun4i/sun4i_crtc.c | 4 ++-- - drivers/gpu/drm/tegra/dc.c | 8 ++++---- - drivers/gpu/drm/tidss/tidss_crtc.c | 6 ++++-- - drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 4 ++-- - drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 ++-- - drivers/gpu/drm/vc4/vc4_crtc.c | 8 ++++++-- - drivers/gpu/drm/vc4/vc4_txp.c | 9 +++++++-- - drivers/gpu/drm/virtio/virtgpu_display.c | 4 ++-- - drivers/gpu/drm/vkms/vkms_crtc.c | 4 ++-- - drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 4 ++-- - drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 4 ++-- - drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 4 ++-- - drivers/gpu/drm/xlnx/zynqmp_disp.c | 6 ++++-- - drivers/gpu/drm/zte/zx_vou.c | 4 ++-- - include/drm/drm_modeset_helper_vtables.h | 13 ++----------- - 43 files changed, 131 insertions(+), 99 deletions(-) - ---- a/drivers/gpu/drm/arc/arcpgu_crtc.c -+++ b/drivers/gpu/drm/arc/arcpgu_crtc.c -@@ -116,7 +116,7 @@ static void arc_pgu_crtc_mode_set_nofb(s - } - - static void arc_pgu_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc); - -@@ -127,7 +127,7 @@ static void arc_pgu_crtc_atomic_enable(s - } - - static void arc_pgu_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc); - ---- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c -+++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c -@@ -273,8 +273,10 @@ komeda_crtc_do_flush(struct drm_crtc *cr - - static void - komeda_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old = drm_atomic_get_old_crtc_state(state, -+ crtc); - pm_runtime_get_sync(crtc->dev->dev); - komeda_crtc_prepare(to_kcrtc(crtc)); - drm_crtc_vblank_on(crtc); -@@ -319,8 +321,10 @@ komeda_crtc_flush_and_wait_for_flip_done - - static void - komeda_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct komeda_crtc *kcrtc = to_kcrtc(crtc); - struct komeda_crtc_state *old_st = to_kcrtc_st(old); - struct komeda_pipeline *master = kcrtc->master; ---- a/drivers/gpu/drm/arm/hdlcd_crtc.c -+++ b/drivers/gpu/drm/arm/hdlcd_crtc.c -@@ -168,7 +168,7 @@ static void hdlcd_crtc_mode_set_nofb(str - } - - static void hdlcd_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); - -@@ -179,7 +179,7 @@ static void hdlcd_crtc_atomic_enable(str - } - - static void hdlcd_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); - ---- a/drivers/gpu/drm/arm/malidp_crtc.c -+++ b/drivers/gpu/drm/arm/malidp_crtc.c -@@ -46,7 +46,7 @@ static enum drm_mode_status malidp_crtc_ - } - - static void malidp_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct malidp_drm *malidp = crtc_to_malidp_device(crtc); - struct malidp_hw_device *hwdev = malidp->dev; -@@ -70,8 +70,10 @@ static void malidp_crtc_atomic_enable(st - } - - static void malidp_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct malidp_drm *malidp = crtc_to_malidp_device(crtc); - struct malidp_hw_device *hwdev = malidp->dev; - int err; ---- a/drivers/gpu/drm/armada/armada_crtc.c -+++ b/drivers/gpu/drm/armada/armada_crtc.c -@@ -467,8 +467,10 @@ static void armada_drm_crtc_atomic_flush - } - - static void armada_drm_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc); - struct drm_pending_vblank_event *event; - -@@ -503,8 +505,10 @@ static void armada_drm_crtc_atomic_disab - } - - static void armada_drm_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc); - - DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name); ---- a/drivers/gpu/drm/ast/ast_mode.c -+++ b/drivers/gpu/drm/ast/ast_mode.c -@@ -793,7 +793,7 @@ ast_crtc_helper_atomic_flush(struct drm_ - - static void - ast_crtc_helper_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) -+ struct drm_atomic_state *state) - { - struct drm_device *dev = crtc->dev; - struct ast_private *ast = to_ast_private(dev); -@@ -816,8 +816,10 @@ ast_crtc_helper_atomic_enable(struct drm - - static void - ast_crtc_helper_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct drm_device *dev = crtc->dev; - struct ast_private *ast = to_ast_private(dev); - ---- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c -+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c -@@ -165,7 +165,7 @@ atmel_hlcdc_crtc_mode_valid(struct drm_c - } - - static void atmel_hlcdc_crtc_atomic_disable(struct drm_crtc *c, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct drm_device *dev = c->dev; - struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); -@@ -200,7 +200,7 @@ static void atmel_hlcdc_crtc_atomic_disa - } - - static void atmel_hlcdc_crtc_atomic_enable(struct drm_crtc *c, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct drm_device *dev = c->dev; - struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); ---- a/drivers/gpu/drm/drm_atomic_helper.c -+++ b/drivers/gpu/drm/drm_atomic_helper.c -@@ -1093,7 +1093,7 @@ disable_outputs(struct drm_device *dev, - if (new_crtc_state->enable && funcs->prepare) - funcs->prepare(crtc); - else if (funcs->atomic_disable) -- funcs->atomic_disable(crtc, old_crtc_state); -+ funcs->atomic_disable(crtc, old_state); - else if (funcs->disable) - funcs->disable(crtc); - else if (funcs->dpms) -@@ -1358,7 +1358,7 @@ void drm_atomic_helper_commit_modeset_en - DRM_DEBUG_ATOMIC("enabling [CRTC:%d:%s]\n", - crtc->base.id, crtc->name); - if (funcs->atomic_enable) -- funcs->atomic_enable(crtc, old_crtc_state); -+ funcs->atomic_enable(crtc, old_state); - else if (funcs->commit) - funcs->commit(crtc); - } ---- a/drivers/gpu/drm/drm_simple_kms_helper.c -+++ b/drivers/gpu/drm/drm_simple_kms_helper.c -@@ -99,7 +99,7 @@ static int drm_simple_kms_crtc_check(str - } - - static void drm_simple_kms_crtc_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct drm_plane *plane; - struct drm_simple_display_pipe *pipe; -@@ -113,7 +113,7 @@ static void drm_simple_kms_crtc_enable(s - } - - static void drm_simple_kms_crtc_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct drm_simple_display_pipe *pipe; - ---- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c -+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c -@@ -19,7 +19,7 @@ - #include "exynos_drm_plane.h" - - static void exynos_drm_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); - -@@ -30,7 +30,7 @@ static void exynos_drm_crtc_atomic_enabl - } - - static void exynos_drm_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); - ---- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c -+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c -@@ -43,8 +43,10 @@ static void fsl_dcu_drm_crtc_atomic_flus - } - - static void fsl_dcu_drm_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct drm_device *dev = crtc->dev; - struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; - -@@ -62,7 +64,7 @@ static void fsl_dcu_drm_crtc_atomic_disa - } - - static void fsl_dcu_drm_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct drm_device *dev = crtc->dev; - struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; ---- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c -+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c -@@ -172,7 +172,7 @@ static void hibmc_crtc_dpms(struct drm_c - } - - static void hibmc_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - unsigned int reg; - struct hibmc_drm_private *priv = crtc->dev->dev_private; -@@ -191,7 +191,7 @@ static void hibmc_crtc_atomic_enable(str - } - - static void hibmc_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - unsigned int reg; - struct hibmc_drm_private *priv = crtc->dev->dev_private; ---- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c -+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c -@@ -436,7 +436,7 @@ static void ade_dump_regs(void __iomem * - #endif - - static void ade_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct kirin_crtc *kcrtc = to_kirin_crtc(crtc); - struct ade_hw_ctx *ctx = kcrtc->hw_ctx; -@@ -459,7 +459,7 @@ static void ade_crtc_atomic_enable(struc - } - - static void ade_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct kirin_crtc *kcrtc = to_kirin_crtc(crtc); - struct ade_hw_ctx *ctx = kcrtc->hw_ctx; ---- a/drivers/gpu/drm/imx/dcss/dcss-crtc.c -+++ b/drivers/gpu/drm/imx/dcss/dcss-crtc.c -@@ -3,6 +3,7 @@ - * Copyright 2019 NXP. - */ - -+#include - #include - #include - #include -@@ -77,8 +78,10 @@ static void dcss_crtc_atomic_flush(struc - } - - static void dcss_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct dcss_crtc *dcss_crtc = container_of(crtc, struct dcss_crtc, - base); - struct dcss_dev *dcss = dcss_crtc->base.dev->dev_private; -@@ -111,8 +114,10 @@ static void dcss_crtc_atomic_enable(stru - } - - static void dcss_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct dcss_crtc *dcss_crtc = container_of(crtc, struct dcss_crtc, - base); - struct dcss_dev *dcss = dcss_crtc->base.dev->dev_private; ---- a/drivers/gpu/drm/imx/ipuv3-crtc.c -+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c -@@ -47,7 +47,7 @@ static inline struct ipu_crtc *to_ipu_cr - } - - static void ipu_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); - struct ipu_soc *ipu = dev_get_drvdata(ipu_crtc->dev->parent); -@@ -79,8 +79,10 @@ static void ipu_crtc_disable_planes(stru - } - - static void ipu_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); - struct ipu_soc *ipu = dev_get_drvdata(ipu_crtc->dev->parent); - ---- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c -+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c -@@ -112,7 +112,7 @@ static inline struct ingenic_drm *drm_cr - } - - static void ingenic_drm_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { - struct ingenic_drm *priv = drm_crtc_get_priv(crtc); - -@@ -126,7 +126,7 @@ static void ingenic_drm_crtc_atomic_enab - } - - static void ingenic_drm_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { - struct ingenic_drm *priv = drm_crtc_get_priv(crtc); - unsigned int var; ---- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c -+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c -@@ -517,7 +517,7 @@ void mtk_drm_crtc_async_update(struct dr - } - - static void mtk_drm_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc); - struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0]; -@@ -542,7 +542,7 @@ static void mtk_drm_crtc_atomic_enable(s - } - - static void mtk_drm_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc); - struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0]; ---- a/drivers/gpu/drm/meson/meson_crtc.c -+++ b/drivers/gpu/drm/meson/meson_crtc.c -@@ -82,7 +82,7 @@ static const struct drm_crtc_funcs meson - }; - - static void meson_g12a_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct meson_crtc *meson_crtc = to_meson_crtc(crtc); - struct drm_crtc_state *crtc_state = crtc->state; -@@ -118,7 +118,7 @@ static void meson_g12a_crtc_atomic_enabl - } - - static void meson_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct meson_crtc *meson_crtc = to_meson_crtc(crtc); - struct drm_crtc_state *crtc_state = crtc->state; -@@ -146,7 +146,7 @@ static void meson_crtc_atomic_enable(str - } - - static void meson_g12a_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct meson_crtc *meson_crtc = to_meson_crtc(crtc); - struct meson_drm *priv = meson_crtc->priv; -@@ -171,7 +171,7 @@ static void meson_g12a_crtc_atomic_disab - } - - static void meson_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct meson_crtc *meson_crtc = to_meson_crtc(crtc); - struct meson_drm *priv = meson_crtc->priv; ---- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c -+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c -@@ -11,6 +11,7 @@ - #include - #include - -+#include - #include - #include - #include -@@ -706,10 +707,12 @@ static struct drm_crtc_state *dpu_crtc_d - } - - static void dpu_crtc_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) -+ struct drm_atomic_state *state) - { - struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); - struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state); -+ struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct drm_encoder *encoder; - unsigned long flags; - bool release_bandwidth = false; -@@ -770,7 +773,7 @@ static void dpu_crtc_disable(struct drm_ - } - - static void dpu_crtc_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) -+ struct drm_atomic_state *state) - { - struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); - struct drm_encoder *encoder; ---- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c -+++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c -@@ -264,7 +264,7 @@ static void mdp4_crtc_mode_set_nofb(stru - } - - static void mdp4_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); - struct mdp4_kms *mdp4_kms = get_kms(crtc); -@@ -284,7 +284,7 @@ static void mdp4_crtc_atomic_disable(str - } - - static void mdp4_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); - struct mdp4_kms *mdp4_kms = get_kms(crtc); ---- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c -+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c -@@ -483,7 +483,7 @@ static u32 mdp5_crtc_get_vblank_counter( - } - - static void mdp5_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); - struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state); -@@ -529,7 +529,7 @@ static void mdp5_crtc_vblank_on(struct d - } - - static void mdp5_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); - struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state); ---- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c -+++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c -@@ -343,7 +343,7 @@ static void mxsfb_crtc_atomic_flush(stru - } - - static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev); - struct drm_device *drm = mxsfb->drm; -@@ -367,7 +367,7 @@ static void mxsfb_crtc_atomic_enable(str - } - - static void mxsfb_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev); - struct drm_device *drm = mxsfb->drm; ---- a/drivers/gpu/drm/omapdrm/omap_crtc.c -+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c -@@ -436,7 +436,7 @@ static void omap_crtc_arm_event(struct d - } - - static void omap_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct omap_drm_private *priv = crtc->dev->dev_private; - struct omap_crtc *omap_crtc = to_omap_crtc(crtc); -@@ -462,7 +462,7 @@ static void omap_crtc_atomic_enable(stru - } - - static void omap_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct omap_drm_private *priv = crtc->dev->dev_private; - struct omap_crtc *omap_crtc = to_omap_crtc(crtc); ---- a/drivers/gpu/drm/qxl/qxl_display.c -+++ b/drivers/gpu/drm/qxl/qxl_display.c -@@ -445,13 +445,13 @@ static const struct drm_framebuffer_func - }; - - static void qxl_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - qxl_crtc_update_monitors_config(crtc, "enable"); - } - - static void qxl_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - qxl_crtc_update_monitors_config(crtc, "disable"); - } ---- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c -+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c -@@ -716,7 +716,7 @@ static int rcar_du_crtc_atomic_check(str - } - - static void rcar_du_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc); - struct rcar_du_crtc_state *rstate = to_rcar_crtc_state(crtc->state); -@@ -751,8 +751,10 @@ static void rcar_du_crtc_atomic_enable(s - } - - static void rcar_du_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc); - struct rcar_du_crtc_state *rstate = to_rcar_crtc_state(old_state); - struct rcar_du_device *rcdu = rcrtc->dev; ---- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -@@ -693,7 +693,7 @@ static void rockchip_drm_set_win_enabled - } - - static void vop_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct vop *vop = to_vop(crtc); - -@@ -1261,8 +1261,10 @@ static void vop_crtc_atomic_begin(struct - } - - static void vop_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - 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); ---- a/drivers/gpu/drm/sti/sti_crtc.c -+++ b/drivers/gpu/drm/sti/sti_crtc.c -@@ -23,7 +23,7 @@ - #include "sti_vtg.h" - - static void sti_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct sti_mixer *mixer = to_sti_mixer(crtc); - -@@ -35,7 +35,7 @@ static void sti_crtc_atomic_enable(struc - } - - static void sti_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct sti_mixer *mixer = to_sti_mixer(crtc); - ---- a/drivers/gpu/drm/stm/ltdc.c -+++ b/drivers/gpu/drm/stm/ltdc.c -@@ -420,7 +420,7 @@ static void ltdc_crtc_update_clut(struct - } - - static void ltdc_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct ltdc_device *ldev = crtc_to_ltdc(crtc); - struct drm_device *ddev = crtc->dev; -@@ -442,7 +442,7 @@ static void ltdc_crtc_atomic_enable(stru - } - - static void ltdc_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct ltdc_device *ldev = crtc_to_ltdc(crtc); - struct drm_device *ddev = crtc->dev; ---- a/drivers/gpu/drm/sun4i/sun4i_crtc.c -+++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c -@@ -101,7 +101,7 @@ static void sun4i_crtc_atomic_flush(stru - } - - static void sun4i_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct drm_encoder *encoder = sun4i_crtc_get_encoder(crtc); - struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); -@@ -122,7 +122,7 @@ static void sun4i_crtc_atomic_disable(st - } - - static void sun4i_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct drm_encoder *encoder = sun4i_crtc_get_encoder(crtc); - struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); ---- a/drivers/gpu/drm/tegra/dc.c -+++ b/drivers/gpu/drm/tegra/dc.c -@@ -1748,7 +1748,7 @@ static int tegra_dc_wait_idle(struct teg - } - - static void tegra_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct tegra_dc *dc = to_tegra_dc(crtc); - u32 value; -@@ -1805,10 +1805,10 @@ static void tegra_crtc_atomic_disable(st - } - - static void tegra_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct drm_display_mode *mode = &crtc->state->adjusted_mode; -- struct tegra_dc_state *state = to_dc_state(crtc->state); -+ struct tegra_dc_state *crtc_state = to_dc_state(crtc->state); - struct tegra_dc *dc = to_tegra_dc(crtc); - u32 value; - int err; -@@ -1888,7 +1888,7 @@ static void tegra_crtc_atomic_enable(str - tegra_dc_writel(dc, 0, DC_DISP_BORDER_COLOR); - - /* apply PLL and pixel clock changes */ -- tegra_dc_commit_state(dc, state); -+ tegra_dc_commit_state(dc, crtc_state); - - /* program display mode */ - tegra_dc_set_timings(dc, mode); ---- a/drivers/gpu/drm/tidss/tidss_crtc.c -+++ b/drivers/gpu/drm/tidss/tidss_crtc.c -@@ -212,8 +212,10 @@ static void tidss_crtc_atomic_flush(stru - } - - static void tidss_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct tidss_crtc *tcrtc = to_tidss_crtc(crtc); - struct drm_device *ddev = crtc->dev; - struct tidss_device *tidss = to_tidss(ddev); -@@ -255,7 +257,7 @@ static void tidss_crtc_atomic_enable(str - } - - static void tidss_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct tidss_crtc *tcrtc = to_tidss_crtc(crtc); - struct drm_device *ddev = crtc->dev; ---- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c -+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c -@@ -484,7 +484,7 @@ static void tilcdc_crtc_enable(struct dr - } - - static void tilcdc_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - tilcdc_crtc_enable(crtc); - } -@@ -541,7 +541,7 @@ static void tilcdc_crtc_disable(struct d - } - - static void tilcdc_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - tilcdc_crtc_disable(crtc); - } ---- a/drivers/gpu/drm/vboxvideo/vbox_mode.c -+++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c -@@ -213,12 +213,12 @@ static void vbox_crtc_set_base_and_mode( - } - - static void vbox_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) -+ struct drm_atomic_state *state) - { - } - - static void vbox_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) -+ struct drm_atomic_state *state) - { - } - ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -489,8 +489,10 @@ int vc4_crtc_disable_at_boot(struct drm_ - } - - static void vc4_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct vc4_crtc_state *old_vc4_state = to_vc4_crtc_state(old_state); - struct drm_device *dev = crtc->dev; - -@@ -516,8 +518,10 @@ static void vc4_crtc_atomic_disable(stru - } - - static void vc4_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct drm_device *dev = crtc->dev; - struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); - struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc); ---- a/drivers/gpu/drm/vc4/vc4_txp.c -+++ b/drivers/gpu/drm/vc4/vc4_txp.c -@@ -13,6 +13,7 @@ - #include - #include - -+#include - #include - #include - #include -@@ -401,15 +402,19 @@ static int vc4_txp_atomic_check(struct d - } - - static void vc4_txp_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - drm_crtc_vblank_on(crtc); - vc4_hvs_atomic_enable(crtc, old_state); - } - - static void vc4_txp_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct drm_device *dev = crtc->dev; - - /* Disable vblank irq handling before crtc is disabled. */ ---- a/drivers/gpu/drm/virtio/virtgpu_display.c -+++ b/drivers/gpu/drm/virtio/virtgpu_display.c -@@ -95,12 +95,12 @@ static void virtio_gpu_crtc_mode_set_nof - } - - static void virtio_gpu_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - } - - static void virtio_gpu_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct drm_device *dev = crtc->dev; - struct virtio_gpu_device *vgdev = dev->dev_private; ---- a/drivers/gpu/drm/vkms/vkms_crtc.c -+++ b/drivers/gpu/drm/vkms/vkms_crtc.c -@@ -215,13 +215,13 @@ static int vkms_crtc_atomic_check(struct - } - - static void vkms_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - drm_crtc_vblank_on(crtc); - } - - static void vkms_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - drm_crtc_vblank_off(crtc); - } ---- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c -+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c -@@ -214,7 +214,7 @@ static void vmw_ldu_crtc_mode_set_nofb(s - * CRTC, it makes more sense to do those at plane update time. - */ - static void vmw_ldu_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - } - -@@ -224,7 +224,7 @@ static void vmw_ldu_crtc_atomic_enable(s - * @crtc: CRTC to be turned off - */ - static void vmw_ldu_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - } - ---- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c -+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c -@@ -279,7 +279,7 @@ static void vmw_sou_crtc_helper_prepare( - * This is called after a mode set has been completed. - */ - static void vmw_sou_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - } - -@@ -289,7 +289,7 @@ static void vmw_sou_crtc_atomic_enable(s - * @crtc: CRTC to be turned off - */ - static void vmw_sou_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct vmw_private *dev_priv; - struct vmw_screen_object_unit *sou; ---- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c -+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c -@@ -408,12 +408,12 @@ static void vmw_stdu_crtc_helper_prepare - } - - static void vmw_stdu_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - } - - static void vmw_stdu_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct vmw_private *dev_priv; - struct vmw_screen_target_display_unit *stdu; ---- a/drivers/gpu/drm/xlnx/zynqmp_disp.c -+++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c -@@ -1441,7 +1441,7 @@ static int zynqmp_disp_crtc_setup_clock( - - static void - zynqmp_disp_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) -+ struct drm_atomic_state *state) - { - struct zynqmp_disp *disp = crtc_to_disp(crtc); - struct drm_display_mode *adjusted_mode = &crtc->state->adjusted_mode; -@@ -1473,8 +1473,10 @@ zynqmp_disp_crtc_atomic_enable(struct dr - - static void - zynqmp_disp_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, -+ crtc); - struct zynqmp_disp *disp = crtc_to_disp(crtc); - struct drm_plane_state *old_plane_state; - ---- a/drivers/gpu/drm/zte/zx_vou.c -+++ b/drivers/gpu/drm/zte/zx_vou.c -@@ -350,7 +350,7 @@ static inline void vou_chn_set_update(st - } - - static void zx_crtc_atomic_enable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct drm_display_mode *mode = &crtc->state->adjusted_mode; - bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; -@@ -455,7 +455,7 @@ static void zx_crtc_atomic_enable(struct - } - - static void zx_crtc_atomic_disable(struct drm_crtc *crtc, -- struct drm_crtc_state *old_state) -+ struct drm_atomic_state *state) - { - struct zx_crtc *zcrtc = to_zx_crtc(crtc); - const struct zx_crtc_bits *bits = zcrtc->bits; ---- a/include/drm/drm_modeset_helper_vtables.h -+++ b/include/drm/drm_modeset_helper_vtables.h -@@ -417,14 +417,10 @@ struct drm_crtc_helper_funcs { - * @atomic_enable must be the inverse of @atomic_disable for atomic - * drivers. - * -- * Drivers can use the @old_crtc_state input parameter if the operations -- * needed to enable the CRTC don't depend solely on the new state but -- * also on the transition between the old state and the new state. -- * - * This function is optional. - */ - void (*atomic_enable)(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state); -+ struct drm_atomic_state *state); - - /** - * @atomic_disable: -@@ -441,15 +437,10 @@ struct drm_crtc_helper_funcs { - * need to implement it if there's no need to disable anything at the - * CRTC level. - * -- * Comparing to @disable, this one provides the additional input -- * parameter @old_crtc_state which could be used to access the old -- * state. Atomic drivers should consider to use this one instead -- * of @disable. -- * - * This function is optional. - */ - void (*atomic_disable)(struct drm_crtc *crtc, -- struct drm_crtc_state *old_crtc_state); -+ struct drm_atomic_state *state); - - /** - * @get_scanout_position: diff --git a/target/linux/bcm27xx/patches-5.10/950-0409-drm-atomic-Pass-the-full-state-to-CRTC-atomic_check.patch b/target/linux/bcm27xx/patches-5.10/950-0409-drm-atomic-Pass-the-full-state-to-CRTC-atomic_check.patch deleted file mode 100644 index a110b7a605..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0409-drm-atomic-Pass-the-full-state-to-CRTC-atomic_check.patch +++ /dev/null @@ -1,1027 +0,0 @@ -From 27a4cd3c9986626cc731282e2e4887121f72f5f7 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Wed, 28 Oct 2020 13:32:21 +0100 -Subject: [PATCH] drm/atomic: Pass the full state to CRTC atomic_check -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Commit 29b77ad7b9ca8c87152a1a9e8188970fb2a93df4 upstream. - -The current atomic helpers have either their object state being passed as -an argument or the full atomic state. - -The former is the pattern that was done at first, before switching to the -latter for new hooks or when it was needed. - -Let's start convert all the remaining helpers to provide a consistent -interface, starting with the CRTC's atomic_check. - -The conversion was done using the coccinelle script below, -built tested on all the drivers and actually tested on vc4. - -virtual report - -@@ -struct drm_crtc_helper_funcs *FUNCS; -struct drm_crtc *crtc; -struct drm_crtc_state *crtc_state; -identifier dev, state; -identifier ret, f; -@@ - - f(struct drm_device *dev, struct drm_atomic_state *state) - { - <... -- ret = FUNCS->atomic_check(crtc, crtc_state); -+ ret = FUNCS->atomic_check(crtc, state); - ...> - } - -@@ -identifier crtc, new_state; -@@ - - struct drm_crtc_helper_funcs { - ... -- int (*atomic_check)(struct drm_crtc *crtc, struct drm_crtc_state *new_state); -+ int (*atomic_check)(struct drm_crtc *crtc, struct drm_atomic_state *state); - ... -} - -@ crtc_atomic_func @ -identifier helpers; -identifier func; -@@ - -static struct drm_crtc_helper_funcs helpers = { - ..., - .atomic_check = func, - ..., -}; - -@ ignores_new_state @ -identifier crtc_atomic_func.func; -identifier crtc, new_state; -@@ - - int func(struct drm_crtc *crtc, - struct drm_crtc_state *new_state) - { - ... when != new_state - } - -@ adds_new_state depends on crtc_atomic_func && !ignores_new_state @ -identifier crtc_atomic_func.func; -identifier crtc, new_state; -@@ - - int func(struct drm_crtc *crtc, struct drm_crtc_state *new_state) - { -+ struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc); - ... - } - -@ depends on crtc_atomic_func @ -identifier crtc_atomic_func.func; -expression E; -type T; -@@ - - int func(...) - { - ... -- T state = E; -+ T crtc_state = E; - <+... -- state -+ crtc_state - ...+> - } - -@ depends on crtc_atomic_func @ -identifier crtc_atomic_func.func; -type T; -@@ - - int func(...) - { - ... -- T state; -+ T crtc_state; - <+... -- state -+ crtc_state - ...+> - } - -@ depends on crtc_atomic_func @ -identifier crtc_atomic_func.func; -identifier new_state; -identifier crtc; -@@ - - int func(struct drm_crtc *crtc, -- struct drm_crtc_state *new_state -+ struct drm_atomic_state *state - ) - { ... } - -@@ -identifier new_state; -identifier crtc; -@@ - - int vmw_du_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *new_state -+ struct drm_atomic_state *state - ) - { -+ struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc); - ... - } - -@@ -identifier new_state; -identifier crtc; -@@ - - int vmw_du_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *new_state -+ struct drm_atomic_state *state - ); - -@ include depends on adds_new_state @ -@@ - - #include - -@ no_include depends on !include && adds_new_state @ -@@ - -+ #include - #include - -Signed-off-by: Maxime Ripard -Reviewed-by: Ville Syrjälä -Acked-by: Thomas Zimmermann -Link: https://patchwork.freedesktop.org/patch/msgid/20201028123222.1732139-1-maxime@cerno.tech ---- - .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++----- - .../gpu/drm/arm/display/komeda/komeda_crtc.c | 10 ++++---- - drivers/gpu/drm/arm/malidp_crtc.c | 20 ++++++++-------- - drivers/gpu/drm/armada/armada_crtc.c | 10 ++++---- - drivers/gpu/drm/ast/ast_mode.c | 12 ++++++---- - .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 3 ++- - drivers/gpu/drm/drm_atomic_helper.c | 2 +- - drivers/gpu/drm/drm_simple_kms_helper.c | 10 ++++---- - drivers/gpu/drm/exynos/exynos_drm_crtc.c | 8 ++++--- - drivers/gpu/drm/imx/ipuv3-crtc.c | 6 +++-- - drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 15 ++++++++---- - drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 23 +++++++++++-------- - drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c | 2 +- - drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 13 +++++++---- - drivers/gpu/drm/mxsfb/mxsfb_kms.c | 10 ++++---- - drivers/gpu/drm/nouveau/dispnv50/head.c | 7 ++++-- - drivers/gpu/drm/omapdrm/omap_crtc.c | 13 +++++++---- - drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 11 +++++---- - drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 +++- - drivers/gpu/drm/sun4i/sun4i_crtc.c | 7 ++++-- - drivers/gpu/drm/tidss/tidss_crtc.c | 10 ++++---- - drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 12 ++++++---- - drivers/gpu/drm/vc4/vc4_crtc.c | 11 +++++---- - drivers/gpu/drm/vc4/vc4_txp.c | 10 ++++---- - drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- - drivers/gpu/drm/vkms/vkms_crtc.c | 16 +++++++------ - drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4 +++- - drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 2 +- - drivers/gpu/drm/xlnx/zynqmp_disp.c | 6 +++-- - include/drm/drm_modeset_helper_vtables.h | 5 ++-- - 30 files changed, 168 insertions(+), 110 deletions(-) - ---- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -@@ -5606,17 +5606,19 @@ static void dm_update_crtc_active_planes - } - - static int dm_crtc_helper_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - struct amdgpu_device *adev = drm_to_adev(crtc->dev); - struct dc *dc = adev->dm.dc; -- struct dm_crtc_state *dm_crtc_state = to_dm_crtc_state(state); -+ struct dm_crtc_state *dm_crtc_state = to_dm_crtc_state(crtc_state); - int ret = -EINVAL; - -- dm_update_crtc_active_planes(crtc, state); -+ dm_update_crtc_active_planes(crtc, crtc_state); - - if (unlikely(!dm_crtc_state->stream && -- modeset_required(state, NULL, dm_crtc_state->stream))) { -+ modeset_required(crtc_state, NULL, dm_crtc_state->stream))) { - WARN_ON(1); - return ret; - } -@@ -5627,8 +5629,8 @@ static int dm_crtc_helper_atomic_check(s - * planes are disabled, which is not supported by the hardware. And there is legacy - * userspace which stops using the HW cursor altogether in response to the resulting EINVAL. - */ -- if (state->enable && -- !(state->plane_mask & drm_plane_mask(crtc->primary))) -+ if (crtc_state->enable && -+ !(crtc_state->plane_mask & drm_plane_mask(crtc->primary))) - return -EINVAL; - - /* In some use cases, like reset, no stream is attached */ ---- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c -+++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c -@@ -74,16 +74,18 @@ static void komeda_crtc_update_clock_rat - */ - static int - komeda_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - struct komeda_crtc *kcrtc = to_kcrtc(crtc); -- struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(state); -+ struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(crtc_state); - int err; - -- if (drm_atomic_crtc_needs_modeset(state)) -+ if (drm_atomic_crtc_needs_modeset(crtc_state)) - komeda_crtc_update_clock_ratio(kcrtc_st); - -- if (state->active) { -+ if (crtc_state->active) { - err = komeda_build_display_data_flow(kcrtc, kcrtc_st); - if (err) - return err; ---- a/drivers/gpu/drm/arm/malidp_crtc.c -+++ b/drivers/gpu/drm/arm/malidp_crtc.c -@@ -337,8 +337,10 @@ mclk_calc: - } - - static int malidp_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - struct malidp_drm *malidp = crtc_to_malidp_device(crtc); - struct malidp_hw_device *hwdev = malidp->dev; - struct drm_plane *plane; -@@ -373,7 +375,7 @@ static int malidp_crtc_atomic_check(stru - */ - - /* first count the number of rotated planes */ -- drm_atomic_crtc_state_for_each_plane_state(plane, pstate, state) { -+ drm_atomic_crtc_state_for_each_plane_state(plane, pstate, crtc_state) { - struct drm_framebuffer *fb = pstate->fb; - - if ((pstate->rotation & MALIDP_ROTATED_MASK) || fb->modifier) -@@ -389,7 +391,7 @@ static int malidp_crtc_atomic_check(stru - rot_mem_free += hwdev->rotation_memory[1]; - - /* now validate the rotation memory requirements */ -- drm_atomic_crtc_state_for_each_plane_state(plane, pstate, state) { -+ drm_atomic_crtc_state_for_each_plane_state(plane, pstate, crtc_state) { - struct malidp_plane *mp = to_malidp_plane(plane); - struct malidp_plane_state *ms = to_malidp_plane_state(pstate); - struct drm_framebuffer *fb = pstate->fb; -@@ -417,18 +419,18 @@ static int malidp_crtc_atomic_check(stru - } - - /* If only the writeback routing has changed, we don't need a modeset */ -- if (state->connectors_changed) { -+ if (crtc_state->connectors_changed) { - u32 old_mask = crtc->state->connector_mask; -- u32 new_mask = state->connector_mask; -+ u32 new_mask = crtc_state->connector_mask; - - if ((old_mask ^ new_mask) == - (1 << drm_connector_index(&malidp->mw_connector.base))) -- state->connectors_changed = false; -+ crtc_state->connectors_changed = false; - } - -- ret = malidp_crtc_atomic_check_gamma(crtc, state); -- ret = ret ? ret : malidp_crtc_atomic_check_ctm(crtc, state); -- ret = ret ? ret : malidp_crtc_atomic_check_scaling(crtc, state); -+ ret = malidp_crtc_atomic_check_gamma(crtc, crtc_state); -+ ret = ret ? ret : malidp_crtc_atomic_check_ctm(crtc, crtc_state); -+ ret = ret ? ret : malidp_crtc_atomic_check_scaling(crtc, crtc_state); - - return ret; - } ---- a/drivers/gpu/drm/armada/armada_crtc.c -+++ b/drivers/gpu/drm/armada/armada_crtc.c -@@ -413,15 +413,17 @@ static void armada_drm_crtc_mode_set_nof - } - - static int armada_drm_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name); - -- if (state->gamma_lut && drm_color_lut_size(state->gamma_lut) != 256) -+ if (crtc_state->gamma_lut && drm_color_lut_size(crtc_state->gamma_lut) != 256) - return -EINVAL; - -- if (state->color_mgmt_changed) -- state->planes_changed = true; -+ if (crtc_state->color_mgmt_changed) -+ crtc_state->planes_changed = true; - - return 0; - } ---- a/drivers/gpu/drm/ast/ast_mode.c -+++ b/drivers/gpu/drm/ast/ast_mode.c -@@ -751,24 +751,26 @@ static void ast_crtc_dpms(struct drm_crt - } - - static int ast_crtc_helper_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - struct drm_device *dev = crtc->dev; - struct ast_crtc_state *ast_state; - const struct drm_format_info *format; - bool succ; - -- if (!state->enable) -+ if (!crtc_state->enable) - return 0; /* no mode checks if CRTC is being disabled */ - -- ast_state = to_ast_crtc_state(state); -+ ast_state = to_ast_crtc_state(crtc_state); - - format = ast_state->format; - if (drm_WARN_ON_ONCE(dev, !format)) - return -EINVAL; /* BUG: We didn't set format in primary check(). */ - -- succ = ast_get_vbios_mode_info(format, &state->mode, -- &state->adjusted_mode, -+ succ = ast_get_vbios_mode_info(format, &crtc_state->mode, -+ &crtc_state->adjusted_mode, - &ast_state->vbios_mode_info); - if (!succ) - return -EINVAL; ---- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c -+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c -@@ -325,8 +325,9 @@ static int atmel_hlcdc_crtc_select_outpu - } - - static int atmel_hlcdc_crtc_atomic_check(struct drm_crtc *c, -- struct drm_crtc_state *s) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *s = drm_atomic_get_new_crtc_state(state, c); - int ret; - - ret = atmel_hlcdc_crtc_select_output_mode(s); ---- a/drivers/gpu/drm/drm_atomic_helper.c -+++ b/drivers/gpu/drm/drm_atomic_helper.c -@@ -918,7 +918,7 @@ drm_atomic_helper_check_planes(struct dr - if (!funcs || !funcs->atomic_check) - continue; - -- ret = funcs->atomic_check(crtc, new_crtc_state); -+ ret = funcs->atomic_check(crtc, state); - if (ret) { - DRM_DEBUG_ATOMIC("[CRTC:%d:%s] atomic driver check failed\n", - crtc->base.id, crtc->name); ---- a/drivers/gpu/drm/drm_simple_kms_helper.c -+++ b/drivers/gpu/drm/drm_simple_kms_helper.c -@@ -86,16 +86,18 @@ drm_simple_kms_crtc_mode_valid(struct dr - } - - static int drm_simple_kms_crtc_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -- bool has_primary = state->plane_mask & -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); -+ bool has_primary = crtc_state->plane_mask & - drm_plane_mask(crtc->primary); - - /* We always want to have an active plane with an active CRTC */ -- if (has_primary != state->enable) -+ if (has_primary != crtc_state->enable) - return -EINVAL; - -- return drm_atomic_add_affected_planes(state->state, crtc); -+ return drm_atomic_add_affected_planes(crtc_state->state, crtc); - } - - static void drm_simple_kms_crtc_enable(struct drm_crtc *crtc, ---- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c -+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c -@@ -49,15 +49,17 @@ static void exynos_drm_crtc_atomic_disab - } - - static int exynos_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); - -- if (!state->enable) -+ if (!crtc_state->enable) - return 0; - - if (exynos_crtc->ops->atomic_check) -- return exynos_crtc->ops->atomic_check(exynos_crtc, state); -+ return exynos_crtc->ops->atomic_check(exynos_crtc, crtc_state); - - return 0; - } ---- a/drivers/gpu/drm/imx/ipuv3-crtc.c -+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c -@@ -227,11 +227,13 @@ static bool ipu_crtc_mode_fixup(struct d - } - - static int ipu_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - u32 primary_plane_mask = drm_plane_mask(crtc->primary); - -- if (state->active && (primary_plane_mask & state->plane_mask) == 0) -+ if (crtc_state->active && (primary_plane_mask & crtc_state->plane_mask) == 0) - return -EINVAL; - - return 0; ---- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c -+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c -@@ -195,22 +195,27 @@ static void ingenic_drm_crtc_update_timi - } - - static int ingenic_drm_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - struct ingenic_drm *priv = drm_crtc_get_priv(crtc); - struct drm_plane_state *f1_state, *f0_state, *ipu_state = NULL; - -- if (drm_atomic_crtc_needs_modeset(state) && priv->soc_info->has_osd) { -- f1_state = drm_atomic_get_plane_state(state->state, &priv->f1); -+ if (drm_atomic_crtc_needs_modeset(crtc_state) && priv->soc_info->has_osd) { -+ f1_state = drm_atomic_get_plane_state(crtc_state->state, -+ &priv->f1); - if (IS_ERR(f1_state)) - return PTR_ERR(f1_state); - -- f0_state = drm_atomic_get_plane_state(state->state, &priv->f0); -+ f0_state = drm_atomic_get_plane_state(crtc_state->state, -+ &priv->f0); - if (IS_ERR(f0_state)) - return PTR_ERR(f0_state); - - if (IS_ENABLED(CONFIG_DRM_INGENIC_IPU) && priv->ipu_plane) { -- ipu_state = drm_atomic_get_plane_state(state->state, priv->ipu_plane); -+ ipu_state = drm_atomic_get_plane_state(crtc_state->state, -+ priv->ipu_plane); - if (IS_ERR(ipu_state)) - return PTR_ERR(ipu_state); - ---- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c -+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c -@@ -815,10 +815,12 @@ struct plane_state { - }; - - static int dpu_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); -- struct dpu_crtc_state *cstate = to_dpu_crtc_state(state); -+ struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc_state); - struct plane_state *pstates; - - const struct drm_plane_state *pstate; -@@ -835,32 +837,33 @@ static int dpu_crtc_atomic_check(struct - - pstates = kzalloc(sizeof(*pstates) * DPU_STAGE_MAX * 4, GFP_KERNEL); - -- if (!state->enable || !state->active) { -+ if (!crtc_state->enable || !crtc_state->active) { - DPU_DEBUG("crtc%d -> enable %d, active %d, skip atomic_check\n", -- crtc->base.id, state->enable, state->active); -+ crtc->base.id, crtc_state->enable, -+ crtc_state->active); - goto end; - } - -- mode = &state->adjusted_mode; -+ mode = &crtc_state->adjusted_mode; - DPU_DEBUG("%s: check", dpu_crtc->name); - - /* force a full mode set if active state changed */ -- if (state->active_changed) -- state->mode_changed = true; -+ if (crtc_state->active_changed) -+ crtc_state->mode_changed = true; - - memset(pipe_staged, 0, sizeof(pipe_staged)); - - if (cstate->num_mixers) { - mixer_width = mode->hdisplay / cstate->num_mixers; - -- _dpu_crtc_setup_lm_bounds(crtc, state); -+ _dpu_crtc_setup_lm_bounds(crtc, crtc_state); - } - - crtc_rect.x2 = mode->hdisplay; - crtc_rect.y2 = mode->vdisplay; - - /* get plane state for all drm planes associated with crtc state */ -- drm_atomic_crtc_state_for_each_plane_state(plane, pstate, state) { -+ drm_atomic_crtc_state_for_each_plane_state(plane, pstate, crtc_state) { - struct drm_rect dst, clip = crtc_rect; - - if (IS_ERR_OR_NULL(pstate)) { -@@ -966,7 +969,7 @@ static int dpu_crtc_atomic_check(struct - - atomic_inc(&_dpu_crtc_get_kms(crtc)->bandwidth_ref); - -- rc = dpu_core_perf_crtc_check(crtc, state); -+ rc = dpu_core_perf_crtc_check(crtc, crtc_state); - if (rc) { - DPU_ERROR("crtc%d failed performance check %d\n", - crtc->base.id, rc); ---- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c -+++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c -@@ -307,7 +307,7 @@ static void mdp4_crtc_atomic_enable(stru - } - - static int mdp4_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { - struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); - DBG("%s: check", mdp4_crtc->name); ---- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c -+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c -@@ -7,6 +7,7 @@ - - #include - -+#include - #include - #include - #include -@@ -682,15 +683,17 @@ static enum mdp_mixer_stage_id get_start - } - - static int mdp5_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - struct mdp5_kms *mdp5_kms = get_kms(crtc); - struct drm_plane *plane; - struct drm_device *dev = crtc->dev; - struct plane_state pstates[STAGE_MAX + 1]; - const struct mdp5_cfg_hw *hw_cfg; - const struct drm_plane_state *pstate; -- const struct drm_display_mode *mode = &state->adjusted_mode; -+ const struct drm_display_mode *mode = &crtc_state->adjusted_mode; - bool cursor_plane = false; - bool need_right_mixer = false; - int cnt = 0, i; -@@ -699,7 +702,7 @@ static int mdp5_crtc_atomic_check(struct - - DBG("%s: check", crtc->name); - -- drm_atomic_crtc_state_for_each_plane_state(plane, pstate, state) { -+ drm_atomic_crtc_state_for_each_plane_state(plane, pstate, crtc_state) { - if (!pstate->visible) - continue; - -@@ -731,7 +734,7 @@ static int mdp5_crtc_atomic_check(struct - if (mode->hdisplay > hw_cfg->lm.max_width) - need_right_mixer = true; - -- ret = mdp5_crtc_setup_pipeline(crtc, state, need_right_mixer); -+ ret = mdp5_crtc_setup_pipeline(crtc, crtc_state, need_right_mixer); - if (ret) { - DRM_DEV_ERROR(dev->dev, "couldn't assign mixers %d\n", ret); - return ret; -@@ -744,7 +747,7 @@ static int mdp5_crtc_atomic_check(struct - WARN_ON(cursor_plane && - (pstates[cnt - 1].plane->type != DRM_PLANE_TYPE_CURSOR)); - -- start = get_start_stage(crtc, state, &pstates[0].state->base); -+ start = get_start_stage(crtc, crtc_state, &pstates[0].state->base); - - /* verify that there are not too many planes attached to crtc - * and that we don't have conflicting mixer stages: ---- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c -+++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c -@@ -310,17 +310,19 @@ static void mxsfb_crtc_mode_set_nofb(str - } - - static int mxsfb_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -- bool has_primary = state->plane_mask & -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); -+ bool has_primary = crtc_state->plane_mask & - drm_plane_mask(crtc->primary); - - /* The primary plane has to be enabled when the CRTC is active. */ -- if (state->active && !has_primary) -+ if (crtc_state->active && !has_primary) - return -EINVAL; - - /* TODO: Is this needed ? */ -- return drm_atomic_add_affected_planes(state->state, crtc); -+ return drm_atomic_add_affected_planes(crtc_state->state, crtc); - } - - static void mxsfb_crtc_atomic_flush(struct drm_crtc *crtc, ---- a/drivers/gpu/drm/nouveau/dispnv50/head.c -+++ b/drivers/gpu/drm/nouveau/dispnv50/head.c -@@ -30,6 +30,7 @@ - #include - #include - -+#include - #include - #include - #include -@@ -315,12 +316,14 @@ nv50_head_atomic_check_mode(struct nv50_ - } - - static int --nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) -+nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - struct nouveau_drm *drm = nouveau_drm(crtc->dev); - struct nv50_head *head = nv50_head(crtc); - struct nv50_head_atom *armh = nv50_head_atom(crtc->state); -- struct nv50_head_atom *asyh = nv50_head_atom(state); -+ struct nv50_head_atom *asyh = nv50_head_atom(crtc_state); - struct nouveau_conn_atom *asyc = NULL; - struct drm_connector_state *conns; - struct drm_connector *conn; ---- a/drivers/gpu/drm/omapdrm/omap_crtc.c -+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c -@@ -569,22 +569,25 @@ static bool omap_crtc_is_manually_update - } - - static int omap_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - struct drm_plane_state *pri_state; - -- if (state->color_mgmt_changed && state->gamma_lut) { -- unsigned int length = state->gamma_lut->length / -+ if (crtc_state->color_mgmt_changed && crtc_state->gamma_lut) { -+ unsigned int length = crtc_state->gamma_lut->length / - sizeof(struct drm_color_lut); - - if (length < 2) - return -EINVAL; - } - -- pri_state = drm_atomic_get_new_plane_state(state->state, crtc->primary); -+ pri_state = drm_atomic_get_new_plane_state(crtc_state->state, -+ crtc->primary); - if (pri_state) { - struct omap_crtc_state *omap_crtc_state = -- to_omap_crtc_state(state); -+ to_omap_crtc_state(crtc_state); - - /* Mirror new values for zpos and rotation in omap_crtc_state */ - omap_crtc_state->zpos = pri_state->zpos; ---- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c -+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c -@@ -688,20 +688,23 @@ static void rcar_du_crtc_stop(struct rca - */ - - static int rcar_du_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *state) -+ struct drm_atomic_state *state) - { -- struct rcar_du_crtc_state *rstate = to_rcar_crtc_state(state); -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); -+ struct rcar_du_crtc_state *rstate = to_rcar_crtc_state(crtc_state); - struct drm_encoder *encoder; - int ret; - -- ret = rcar_du_cmm_check(crtc, state); -+ ret = rcar_du_cmm_check(crtc, crtc_state); - if (ret) - return ret; - - /* Store the routes from the CRTC output to the DU outputs. */ - rstate->outputs = 0; - -- drm_for_each_encoder_mask(encoder, crtc->dev, state->encoder_mask) { -+ drm_for_each_encoder_mask(encoder, crtc->dev, -+ crtc_state->encoder_mask) { - struct rcar_du_encoder *renc; - - /* Skip the writeback encoder. */ ---- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -@@ -1416,8 +1416,10 @@ static void vop_wait_for_irq_handler(str - } - - static int vop_crtc_atomic_check(struct drm_crtc *crtc, -- struct drm_crtc_state *crtc_state) -+ struct drm_atomic_state *state) - { -+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, -+ crtc); - struct vop *vop = to_vop(crtc); - struct drm_plane *plane; - struct drm_plane_state *plane_state; ---- a/drivers/gpu/drm/sun4i/sun4i_crtc.c -+++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c -@@ -15,6 +15,7 @@ - - #include