From 41307a1bdbf5129b8435aa35a455a68dc4724c62 Mon Sep 17 00:00:00 2001 From: Pablo Greco Date: Oct 27 2021 10:06:05 +0000 Subject: Update to 5.10.74 --- diff --git a/.raspberrypi2.metadata b/.raspberrypi2.metadata index 3a4045f..5f080f0 100644 --- a/.raspberrypi2.metadata +++ b/.raspberrypi2.metadata @@ -1,3 +1,3 @@ be0b909f1fbb760cc2d5cf146e1da3b2af0cf899 SOURCES/linux-5.10.tar.xz -2d313607b18877bee80b3f218f736f37e9a80273 SOURCES/25e2b597ebfb2495eab4816a276758dcc6ea21f1.tar.gz -02e8d19fafa7e6ea39d27fdb8c51f99153ab9d87 SOURCES/patch-5.10.60.xz +d115792ed906ca8b0374edca2418a1663b86837c SOURCES/d2ab264b688a223e23029ffbba86820c8c6cb329.tar.gz +c8b8f8fcde64cbce35d68926460f70ecf8f0f933 SOURCES/patch-5.10.74.xz diff --git a/SOURCES/rpi-5.10.x.patch b/SOURCES/rpi-5.10.x.patch index cf65cb0..e09299b 100644 --- a/SOURCES/rpi-5.10.x.patch +++ b/SOURCES/rpi-5.10.x.patch @@ -1,7 +1,7 @@ -From 729fdd8dc8e265f7ef993ead0232704a343efe56 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dan Pasanen Date: Thu, 21 Sep 2017 09:55:42 -0500 -Subject: [PATCH 001/834] arm: partially revert +Subject: [PATCH 001/889] arm: partially revert 702b94bff3c50542a6e4ab9a4f4cef093262fe65 * Re-expose some dmi APIs for use in VCSM @@ -109,10 +109,10 @@ index e21249548e9f..33e4a9b8f1ba 100644 2.18.4 -From 8cb80f2eea1662f8378bc3bedcb86e93485ebdbd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 29 Oct 2018 14:45:45 +0000 -Subject: [PATCH 002/834] Revert "rtc: pcf8523: properly handle oscillator stop +Subject: [PATCH 002/889] Revert "rtc: pcf8523: properly handle oscillator stop bit" This reverts commit ede44c908d44b166a5b6bd7caacd105c2ff5a70f. @@ -171,10 +171,10 @@ index 57d351dfe272..0aa1e8f9ee75 100644 2.18.4 -From 5da3efe6952cc580d335429f3c624ffb6f8f8546 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 15 Mar 2019 21:11:10 +0000 -Subject: [PATCH 003/834] Revert "staging: bcm2835-audio: Drop DT dependency" +Subject: [PATCH 003/889] Revert "staging: bcm2835-audio: Drop DT dependency" This reverts commit b7491a9fca2dc2535b9dc922550a37c5baae9d3d. --- @@ -273,10 +273,10 @@ index c250fbef2fa3..b42917c25050 100644 2.18.4 -From 94844b8b421c739c0474faed86ba41c9efb41d80 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Apr 2020 13:41:10 +0100 -Subject: [PATCH 004/834] Revert "spi: spidev: Fix CS polarity if GPIO +Subject: [PATCH 004/889] Revert "spi: spidev: Fix CS polarity if GPIO descriptors are used" This reverts commit 83b2a8fe43bda0c11981ad6afa5dd0104d78be28. @@ -311,10 +311,10 @@ index 859910ec8d9f..225577709c03 100644 2.18.4 -From 18dc9af2208a75568f48f5ba5a8ab35e365921af Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 Nov 2020 11:49:53 +0000 -Subject: [PATCH 005/834] Revert "mailbox: avoid timer start from callback" +Subject: [PATCH 005/889] Revert "mailbox: avoid timer start from callback" This reverts commit c7dacf5b0f32957b24ef29df1207dc2cd8307743. @@ -375,10 +375,110 @@ index 3e7d4b20ab34..0b821a5b2db8 100644 2.18.4 -From 44dbc5552af8d87f58a0ccf662d50d6b8f1f8135 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 1 Mar 2021 09:12:44 +0000 +Subject: [PATCH 006/889] Revert "Bluetooth: Always request for user + confirmation for Just Works (LE SC)" + +This reverts commit ffee202a78c2980688bc5d2f7d56480e69a5e0c9. + +The commit "Bluetooth: Always request for user confirmation for Just +Works" prevents BLE devices pairing in (at least) the Raspberry Pi OS +GUI. After reverting it, pairing works again. Although this companion +commit ("... (LE SC)") has not been demonstrated to be problematic, +it follows the same logic and therefore could affect some use cases. + +If another solution to the problem is found then this reversion will +be removed. + +See: https://github.com/raspberrypi/linux/issues/4139 + +Signed-off-by: Phil Elwell +--- + net/bluetooth/smp.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c +index 2b7879afc333..36ac2db5340c 100644 +--- a/net/bluetooth/smp.c ++++ b/net/bluetooth/smp.c +@@ -2201,7 +2201,7 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb) + if (err) + return SMP_UNSPECIFIED; + +- if (smp->method == REQ_OOB) { ++ if (smp->method == JUST_WORKS || smp->method == REQ_OOB) { + if (hcon->out) { + sc_dhkey_check(smp); + SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK); +@@ -2216,9 +2216,6 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb) + confirm_hint = 0; + + confirm: +- if (smp->method == JUST_WORKS) +- confirm_hint = 1; +- + err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, hcon->type, + hcon->dst_type, passkey, confirm_hint); + if (err) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 1 Mar 2021 09:14:35 +0000 +Subject: [PATCH 007/889] Revert "Bluetooth: Always request for user + confirmation for Just Works" + +This reverts commit 92516cd97fd4d8ad5b1421a0d51771044f453a5f. + +Thi commit "Bluetooth: Always request for user confirmation for Just +Works" prevents BLE devices pairing in (at least) the Raspberry Pi OS +GUI. After reverting it, pairing works again. + +If another solution to the problem is found then this reversion will +be removed. + +See: https://github.com/raspberrypi/linux/issues/4139 + +Signed-off-by: Phil Elwell +--- + net/bluetooth/smp.c | 11 ++--------- + 1 file changed, 2 insertions(+), 9 deletions(-) + +diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c +index 36ac2db5340c..7c3be6b3d454 100644 +--- a/net/bluetooth/smp.c ++++ b/net/bluetooth/smp.c +@@ -883,16 +883,9 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth, + hcon->io_capability == HCI_IO_NO_INPUT_OUTPUT) + smp->method = JUST_WORKS; + +- /* If Just Works, Continue with Zero TK and ask user-space for +- * confirmation */ ++ /* If Just Works, Continue with Zero TK */ + if (smp->method == JUST_WORKS) { +- ret = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, +- hcon->type, +- hcon->dst_type, +- passkey, 1); +- if (ret) +- return ret; +- set_bit(SMP_FLAG_WAIT_USER, &smp->flags); ++ set_bit(SMP_FLAG_TK_VALID, &smp->flags); + return 0; + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 006/834] smsx95xx: fix crimes against truesize +Subject: [PATCH 008/889] smsx95xx: fix crimes against truesize smsc95xx is adjusting truesize when it shouldn't, and following a recent patch from Eric this is now triggering warnings. @@ -390,7 +490,7 @@ Signed-off-by: Steve Glendinning 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c -index ea0d5f04dc3a..a7591ceca30f 100644 +index 465e11dcdf12..1501859a3d15 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -67,6 +67,10 @@ static bool turbo_mode = true; @@ -404,7 +504,7 @@ index ea0d5f04dc3a..a7591ceca30f 100644 static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data, int in_pm) { -@@ -1827,7 +1831,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) +@@ -1830,7 +1834,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(skb); skb_trim(skb, skb->len - 4); /* remove fcs */ @@ -414,7 +514,7 @@ index ea0d5f04dc3a..a7591ceca30f 100644 return 1; } -@@ -1845,7 +1850,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) +@@ -1848,7 +1853,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(ax_skb); skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */ @@ -428,10 +528,10 @@ index ea0d5f04dc3a..a7591ceca30f 100644 2.18.4 -From e304b7d2b5064e331dfdfa5e59aa8c5c96b86834 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Sam Nazarko Date: Fri, 1 Apr 2016 17:27:21 +0100 -Subject: [PATCH 007/834] smsc95xx: Experimental: Enable turbo_mode and +Subject: [PATCH 009/889] smsc95xx: Experimental: Enable turbo_mode and packetsize=2560 by default See: http://forum.kodi.tv/showthread.php?tid=285288 @@ -440,7 +540,7 @@ See: http://forum.kodi.tv/showthread.php?tid=285288 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c -index a7591ceca30f..d16620941d76 100644 +index 1501859a3d15..b51571e38832 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -71,6 +71,10 @@ static bool truesize_mode = false; @@ -477,10 +577,10 @@ index a7591ceca30f..d16620941d76 100644 2.18.4 -From 8482a3a641eafdfcc80ba057060d833a86dc2fcb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 008/834] Allow mac address to be set in smsc95xx +Subject: [PATCH 010/889] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -488,7 +588,7 @@ Signed-off-by: popcornmix 1 file changed, 56 insertions(+) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c -index d16620941d76..09d4c1963b2c 100644 +index b51571e38832..2c7c91b4d418 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -50,6 +50,7 @@ @@ -579,10 +679,10 @@ index d16620941d76..09d4c1963b2c 100644 2.18.4 -From ba67a498468a8ea0e5bb472094675ded6097fa61 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 12:43:36 +0000 -Subject: [PATCH 009/834] Protect __release_resource against resources without +Subject: [PATCH 011/889] Protect __release_resource against resources without parents Without this patch, removing a device tree overlay can crash here. @@ -613,10 +713,10 @@ index 817545ff80b9..375a43d99b28 100644 2.18.4 -From 17a7c057cb38867d1cf72eb8fda42c6af82c9734 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:33:30 +0000 -Subject: [PATCH 010/834] irq-bcm2836: Avoid "Invalid trigger warning" +Subject: [PATCH 012/889] irq-bcm2836: Avoid "Invalid trigger warning" Initialise the level for each IRQ to avoid a warning from the arm arch timer code. @@ -643,10 +743,10 @@ index cbc7c740e4dc..f4247c257581 100644 2.18.4 -From e2e78e6cd275580bb7b5a8bf76fffa730b2da2c0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 12 Jun 2015 19:01:05 +0200 -Subject: [PATCH 011/834] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 013/889] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -778,10 +878,10 @@ index a1e004af23e7..50a03f8c9c57 100644 2.18.4 -From 8ba263651eeef7634f44f8f16a0cc0a6f75e1855 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Oct 2015 16:26:55 +0200 -Subject: [PATCH 012/834] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH 014/889] irqchip: irq-bcm2835: Add 2836 FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -883,10 +983,10 @@ index 50a03f8c9c57..b3219aa763a6 100644 2.18.4 -From d019ffd130023fd479fa906a315d94b7868fbedd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 013/834] spi: spidev: Completely disable the spidev warning +Subject: [PATCH 015/889] spi: spidev: Completely disable the spidev warning An alternative strategy would be to use "rpi,spidev" instead, but that would require many Raspberry Pi Device Tree changes. @@ -913,10 +1013,10 @@ index 225577709c03..a262479f0a92 100644 2.18.4 -From 82542f3c4e83755ae13600889277b99222787634 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 3 Oct 2015 22:22:55 +0200 -Subject: [PATCH 014/834] dmaengine: bcm2835: Load driver early and support +Subject: [PATCH 016/889] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -934,7 +1034,7 @@ Signed-off-by: Noralf Trønnes 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig -index f28bb2334e74..5a8decee7f3b 100644 +index 08013345d1f2..5fbc1e9e3970 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -134,7 +134,7 @@ config COH901318 @@ -1022,17 +1122,17 @@ index 630dfbb01a40..bf7ba96a39f9 100644 2.18.4 -From b447ddd1c5cb61310f55a01222f63897f9a286cf Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jan 2016 17:25:12 +0000 -Subject: [PATCH 015/834] firmware: Updated mailbox header +Subject: [PATCH 017/889] firmware: Updated mailbox header --- include/soc/bcm2835/raspberrypi-firmware.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h -index cc9cdbc66403..212cceffcc5c 100644 +index fdfef7fe40df..900268868196 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -9,6 +9,8 @@ @@ -1044,7 +1144,7 @@ index cc9cdbc66403..212cceffcc5c 100644 struct rpi_firmware; enum rpi_firmware_property_status { -@@ -159,5 +161,6 @@ static inline struct rpi_firmware *rpi_firmware_get(struct device_node *firmware +@@ -161,5 +163,6 @@ static inline struct rpi_firmware *rpi_firmware_get(struct device_node *firmware return NULL; } #endif @@ -1055,10 +1155,10 @@ index cc9cdbc66403..212cceffcc5c 100644 2.18.4 -From 46fb86d451d581737aeb2802fbea4a0013742189 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jun 2016 16:48:41 +0100 -Subject: [PATCH 016/834] rtc: Add SPI alias for pcf2123 driver +Subject: [PATCH 018/889] rtc: Add SPI alias for pcf2123 driver Without this alias, Device Tree won't cause the driver to be loaded. @@ -1081,10 +1181,10 @@ index c3691fa4210e..ead1fd376d2d 100644 2.18.4 -From ad0eb2f6b707e7208f52ae0eb3307227b28b9d26 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 7 Oct 2016 16:50:59 +0200 -Subject: [PATCH 017/834] watchdog: bcm2835: Support setting reboot partition +Subject: [PATCH 019/889] watchdog: bcm2835: Support setting reboot partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1189,10 +1289,10 @@ index dec6ca019bea..62937e6f83ca 100644 2.18.4 -From c242878e023aa73cf1976c8c989cb0ed8aa4d29d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 Apr 2016 19:40:12 +0100 -Subject: [PATCH 018/834] reboot: Use power off rather than busy spinning when +Subject: [PATCH 020/889] reboot: Use power off rather than busy spinning when halt is requested --- @@ -1218,10 +1318,10 @@ index 0ce388f15422..63373adab475 100644 2.18.4 -From afd0aa587fe1b4421de114418b0c5b409100753f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Nov 2016 13:02:52 +0000 -Subject: [PATCH 019/834] bcm: Make RASPBERRYPI_POWER depend on PM +Subject: [PATCH 021/889] bcm: Make RASPBERRYPI_POWER depend on PM --- drivers/soc/bcm/Kconfig | 1 + @@ -1243,10 +1343,10 @@ index 24f92a6e882a..a6a705ec30c7 100644 2.18.4 -From 9709f912ee533c8c0a3751f3030e7663bac908b4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Fri, 2 Sep 2016 16:45:27 +0100 -Subject: [PATCH 020/834] Register the clocks early during the boot process, so +Subject: [PATCH 022/889] Register the clocks early during the boot process, so that special/critical clocks can get enabled early on in the boot process avoiding the risk of disabling a clock, pll_divider or pll when a claiming driver fails to install propperly - maybe it needs to defer. @@ -1294,10 +1394,10 @@ index 1ac803e14fa3..2482458795c2 100644 2.18.4 -From 86a59d15be7ef5c5fa5994eeea98c3e3dad12780 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 6 Dec 2016 17:05:39 +0000 -Subject: [PATCH 021/834] bcm2835-rng: Avoid initialising if already enabled +Subject: [PATCH 023/889] bcm2835-rng: Avoid initialising if already enabled Avoids the 0x40000 cycles of warmup again if firmware has already used it --- @@ -1325,10 +1425,10 @@ index 1a7c43b43c6b..ee47667d0710 100644 2.18.4 -From 29db436565db54bdebaaa92d754c6e7ff844bbff Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 022/834] clk-bcm2835: Mark used PLLs and dividers CRITICAL +Subject: [PATCH 024/889] clk-bcm2835: Mark used PLLs and dividers CRITICAL The VPU configures and relies on several PLLs and dividers. Mark all enabled dividers and their PLLs as CRITICAL to prevent the kernel from @@ -1359,10 +1459,10 @@ index 2482458795c2..0f716cb070a7 100644 2.18.4 -From 91255a4a05316c8a2f974aa38b56aea2f46a6523 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 023/834] clk-bcm2835: Add claim-clocks property +Subject: [PATCH 025/889] clk-bcm2835: Add claim-clocks property The claim-clocks property can be used to prevent PLLs and dividers from being marked as critical. It contains a vector of clock IDs, @@ -1485,10 +1585,10 @@ index 0f716cb070a7..50f018fbb562 100644 2.18.4 -From 450af3a54db52e5addbc9047637d62cc05a8ad62 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 6 Mar 2017 09:06:18 +0000 -Subject: [PATCH 024/834] clk-bcm2835: Read max core clock from firmware +Subject: [PATCH 026/889] clk-bcm2835: Read max core clock from firmware The VPU is responsible for managing the core clock, usually under direction from the bcm2835-cpufreq driver but not via the clk-bcm2835 @@ -1606,10 +1706,10 @@ index 50f018fbb562..f1ef788c1194 100644 2.18.4 -From c5ed6379429066599fdfe341e0209eb6deb47d36 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:36:44 +0000 -Subject: [PATCH 025/834] sound: Demote deferral errors to INFO level +Subject: [PATCH 027/889] sound: Demote deferral errors to INFO level At present there is no mechanism to specify driver load order, which can lead to deferrals and repeated retries until successful. @@ -1647,10 +1747,10 @@ index e677422c1058..880ae162eaa5 100644 2.18.4 -From 80d37772ba4d1f39e737456e063769fc0c63223a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Claggy3 Date: Sat, 11 Feb 2017 14:00:30 +0000 -Subject: [PATCH 026/834] Update vfpmodule.c +Subject: [PATCH 028/889] Update vfpmodule.c Christopher Alexander Tobias Schulze - May 2, 2015, 11:57 a.m. This patch fixes a problem with VFP state save and restore related @@ -1790,10 +1890,10 @@ index 2cb355c1b5b7..1e2dcf81aefa 100644 2.18.4 -From b741e17b1dce6ec748c0e41a4f6dab193ebf006c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 1 Nov 2016 15:15:41 +0100 -Subject: [PATCH 027/834] i2c: bcm2835: Add debug support +Subject: [PATCH 029/889] i2c: bcm2835: Add debug support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1985,10 +2085,10 @@ index 37443edbf754..18b2e9e3d752 100644 2.18.4 -From 35ec5f8404f86b79ee401191b0aba6ea21df753b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH 028/834] mm: Remove the PFN busy warning +Subject: [PATCH 030/889] mm: Remove the PFN busy warning See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is expected sometimes when using CMA. However, that commit still spams @@ -2000,7 +2100,7 @@ Signed-off-by: Eric Anholt 1 file changed, 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 0166558d3d64..e312b5aeba2c 100644 +index e8e0f1cec8b0..299688722120 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8594,8 +8594,6 @@ int alloc_contig_range(unsigned long start, unsigned long end, @@ -2016,10 +2116,10 @@ index 0166558d3d64..e312b5aeba2c 100644 2.18.4 -From 712520915068e349a9870264926073c366756ec0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Jan 2018 16:52:45 +0000 -Subject: [PATCH 029/834] irqchip: irq-bcm2836: Remove regmap and syscon use +Subject: [PATCH 031/889] irqchip: irq-bcm2836: Remove regmap and syscon use The syscon node defines a register range that duplicates that used by the local_intc node on bcm2836/7. Since irq-bcm2835 and irq-bcm2836 are @@ -2136,10 +2236,10 @@ index f4247c257581..2187672e5be3 100644 2.18.4 -From c10c9fd87ed5f3c6bf2edfd9f547a42935538e95 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Oct 2017 15:04:29 +0100 -Subject: [PATCH 030/834] lan78xx: Enable LEDs and auto-negotiation +Subject: [PATCH 032/889] lan78xx: Enable LEDs and auto-negotiation For applications of the LAN78xx that don't have valid programmed EEPROMs or OTPs, enabling both LEDs and auto-negotiation by default @@ -2151,10 +2251,10 @@ Signed-off-by: Phil Elwell 1 file changed, 11 insertions(+) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c -index 65b315bc60ab..306bf917d4ed 100644 +index a5cd42bae962..ba8db84b5d43 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2453,6 +2453,11 @@ static int lan78xx_reset(struct lan78xx_net *dev) +@@ -2461,6 +2461,11 @@ static int lan78xx_reset(struct lan78xx_net *dev) int ret = 0; unsigned long timeout; u8 sig; @@ -2166,7 +2266,7 @@ index 65b315bc60ab..306bf917d4ed 100644 ret = lan78xx_read_reg(dev, HW_CFG, &buf); buf |= HW_CFG_LRST_; -@@ -2506,6 +2511,9 @@ static int lan78xx_reset(struct lan78xx_net *dev) +@@ -2514,6 +2519,9 @@ static int lan78xx_reset(struct lan78xx_net *dev) ret = lan78xx_read_reg(dev, HW_CFG, &buf); buf |= HW_CFG_MEF_; @@ -2176,7 +2276,7 @@ index 65b315bc60ab..306bf917d4ed 100644 ret = lan78xx_write_reg(dev, HW_CFG, buf); ret = lan78xx_read_reg(dev, USB_CFG0, &buf); -@@ -2561,6 +2569,9 @@ static int lan78xx_reset(struct lan78xx_net *dev) +@@ -2569,6 +2577,9 @@ static int lan78xx_reset(struct lan78xx_net *dev) buf |= MAC_CR_AUTO_DUPLEX_ | MAC_CR_AUTO_SPEED_; } } @@ -2190,10 +2290,10 @@ index 65b315bc60ab..306bf917d4ed 100644 2.18.4 -From 505fd7bf92681735064a429f1a79efb8b73eea08 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Feb 2016 17:26:48 +0000 -Subject: [PATCH 031/834] amba_pl011: Don't use DT aliases for numbering +Subject: [PATCH 033/889] amba_pl011: Don't use DT aliases for numbering The pl011 driver looks for DT aliases of the form "serial", and if found uses as the device ID. This can cause @@ -2225,10 +2325,10 @@ index 87dc3fc15694..fe48193de094 100644 2.18.4 -From a5501c9b99321414e9dac605e2d059069627f301 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:07:39 +0000 -Subject: [PATCH 032/834] amba_pl011: Round input clock up +Subject: [PATCH 034/889] amba_pl011: Round input clock up The UART clock is initialised to be as close to the requested frequency as possible without exceeding it. Now that there is a @@ -2317,10 +2417,10 @@ index fe48193de094..339ecce1ad0d 100644 2.18.4 -From fa0d64291fb5fa39739dc90ac81d5acd101ec04b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 29 Sep 2017 10:32:19 +0100 -Subject: [PATCH 033/834] amba_pl011: Insert mb() for correct FIFO handling +Subject: [PATCH 035/889] amba_pl011: Insert mb() for correct FIFO handling The pl011 register accessor functions use the _relaxed versions of the standard readl() and writel() functions, meaning that there are no @@ -2350,10 +2450,10 @@ index 339ecce1ad0d..afb0175bf592 100644 2.18.4 -From 67efb831896c2f1c6a0e7b23efda74f68efcdcaa Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 29 Sep 2017 10:32:19 +0100 -Subject: [PATCH 034/834] amba_pl011: Add cts-event-workaround DT property +Subject: [PATCH 036/889] amba_pl011: Add cts-event-workaround DT property The BCM2835 PL011 implementation seems to have a bug that can lead to a transmission lockup if CTS changes frequently. A workaround was added to @@ -2408,10 +2508,10 @@ index afb0175bf592..17ef9c2a4d72 100644 2.18.4 -From 3a565abae5596c5e1ef67eba24b361dda24596bb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 11 Jul 2019 13:13:39 +0100 -Subject: [PATCH 035/834] tty: amba-pl011: Make TX optimisation conditional +Subject: [PATCH 037/889] 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 @@ -2499,10 +2599,10 @@ index 17ef9c2a4d72..8b1f8167c85d 100644 2.18.4 -From e2bcc02b49a1ae60151de022d50bd638bfeff795 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 24 Jan 2020 11:38:28 +0000 -Subject: [PATCH 036/834] tty: amba-pl011: Add un/throttle support +Subject: [PATCH 038/889] tty: amba-pl011: Add un/throttle support The PL011 driver lacks throttle and unthrottle methods. As a result, sending more data to the Pi than it can immediately sink while CRTSCTS @@ -2566,10 +2666,10 @@ index 8b1f8167c85d..9df9bc8f9dfd 100644 2.18.4 -From 50bc81bac4b079f9d2361340a156bf35e157b867 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 29 Jan 2020 09:35:19 +0000 -Subject: [PATCH 037/834] tty: amba-pl011: Avoid rare write-when-full error +Subject: [PATCH 039/889] tty: amba-pl011: Avoid rare write-when-full error Under some circumstances on BCM283x processors data loss can be observed - a single byte missing from the TX output stream. These bytes @@ -2614,10 +2714,10 @@ index 9df9bc8f9dfd..760301512509 100644 2.18.4 -From 0642e7243e00aebeea55e14447a23b40b4a2ce09 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 038/834] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 040/889] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -2642,10 +2742,10 @@ index 1d21129f7751..bbf761c41dc5 100644 2.18.4 -From 979066baf5b765d1b34b405fe32359a9c3044edb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 039/834] Main bcm2708/bcm2709 linux port +Subject: [PATCH 041/889] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -2804,10 +2904,10 @@ index 39761d190545..9766d8b50778 100644 2.18.4 -From 5c2668c24ce7e08d4eff43280f02ecd5540b3a64 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 040/834] Add dwc_otg driver +Subject: [PATCH 042/889] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -3949,10 +4049,10 @@ index 95a9bae72f13..54a53e225625 100644 usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_OVER_CURRENT); diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c -index 19ebb542befc..6138a21cf0f1 100644 +index dba2baca486e..ccbbda19b04c 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c -@@ -2129,6 +2129,85 @@ int usb_set_configuration(struct usb_device *dev, int configuration) +@@ -2135,6 +2135,85 @@ int usb_set_configuration(struct usb_device *dev, int configuration) if (cp->string == NULL && !(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) cp->string = usb_cache_string(dev, cp->desc.iConfiguration); @@ -64627,10 +64727,10 @@ index 000000000000..cdc9963176e5 2.18.4 -From b7a47ae86ae63ca60509f99d91c15130cdd4fd26 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 041/834] bcm2708 framebuffer driver +Subject: [PATCH 043/889] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -68186,7 +68286,7 @@ index 3c14e43b82fe..7626beb6a5bb 100644 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h -index 212cceffcc5c..2f5509d53fc3 100644 +index 900268868196..df2ba29b4ae0 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -123,6 +123,7 @@ enum rpi_firmware_property_tag { @@ -68201,10 +68301,10 @@ index 212cceffcc5c..2f5509d53fc3 100644 2.18.4 -From a908ef574e0c6e98c8ed997cf0a327806fd8eaed Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Thu, 14 Mar 2019 13:27:54 +0000 -Subject: [PATCH 042/834] Pulled in the multi frame buffer support from the Pi3 +Subject: [PATCH 044/889] Pulled in the multi frame buffer support from the Pi3 repo --- @@ -68982,7 +69082,7 @@ index 831e9a7b6818..f66957d48dc3 100644 static int __init bcm2708_fb_init(void) diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h -index 2f5509d53fc3..16253b6875c9 100644 +index df2ba29b4ae0..bc3829dfcc33 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -106,9 +106,15 @@ enum rpi_firmware_property_tag { @@ -69036,10 +69136,10 @@ index 2f5509d53fc3..16253b6875c9 100644 2.18.4 -From b2a8ec195e51c8bbcb708ae81c8616ad96c112a5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 043/834] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 045/889] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -69283,10 +69383,10 @@ index f66957d48dc3..0e9ec3f593b8 100644 static int bcm2708_fb_register(struct bcm2708_fb *fb) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c -index 98030d75833b..a654bcbeb74c 100644 +index 00939ca2065a..098cd5dfc06f 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c -@@ -1079,6 +1079,30 @@ fb_blank(struct fb_info *info, int blank) +@@ -1085,6 +1085,30 @@ fb_blank(struct fb_info *info, int blank) } EXPORT_SYMBOL(fb_blank); @@ -69317,7 +69417,7 @@ index 98030d75833b..a654bcbeb74c 100644 static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { -@@ -1087,6 +1111,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, +@@ -1093,6 +1117,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, struct fb_fix_screeninfo fix; struct fb_cmap cmap_from; struct fb_cmap_user cmap; @@ -69325,7 +69425,7 @@ index 98030d75833b..a654bcbeb74c 100644 void __user *argp = (void __user *)arg; long ret = 0; -@@ -1162,6 +1187,15 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, +@@ -1168,6 +1193,15 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, unlock_fb_info(info); console_unlock(); break; @@ -69341,7 +69441,7 @@ index 98030d75833b..a654bcbeb74c 100644 default: lock_fb_info(info); fb = info->fbops; -@@ -1307,6 +1341,7 @@ static long fb_compat_ioctl(struct file *file, unsigned int cmd, +@@ -1313,6 +1347,7 @@ static long fb_compat_ioctl(struct file *file, unsigned int cmd, case FBIOPAN_DISPLAY: case FBIOGET_CON2FBMAP: case FBIOPUT_CON2FBMAP: @@ -69383,10 +69483,10 @@ index 4c14e8be7267..3c6f12b76214 100644 2.18.4 -From 3f89b569f9f2389ad2097dbffce6da1a1e033783 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 044/834] Speed up console framebuffer imageblit function +Subject: [PATCH 046/889] Speed up console framebuffer imageblit function Especially on platforms with a slower CPU but a relatively high framebuffer fill bandwidth, like current ARM devices, the existing @@ -69598,10 +69698,10 @@ index a2bb276a8b24..436494fba15a 100644 2.18.4 -From 81b4029d1e1cad87a71314391dfa165b4b3fd6dc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 045/834] dmaengine: Add support for BCM2708 +Subject: [PATCH 047/889] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -69777,7 +69877,7 @@ Signed-off-by: Andrei Gherzan create mode 100644 include/linux/platform_data/dma-bcm2708.h diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig -index 5a8decee7f3b..8fbac86be34c 100644 +index 5fbc1e9e3970..cdfb63c723f6 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -134,7 +134,7 @@ config COH901318 @@ -70252,10 +70352,10 @@ index 000000000000..6ca874d332a8 2.18.4 -From 509c04ac190c82ab4a52eea55cbd419803055559 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 046/834] MMC: added alternative MMC driver +Subject: [PATCH 048/889] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -70460,7 +70560,7 @@ Signed-off-by: Yaroslav Rosomakho create mode 100644 drivers/mmc/host/bcm2835-mmc.c diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c -index 87bac9920702..b1c3f3c56756 100644 +index 94caee49da99..da599f075bc2 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -165,6 +165,13 @@ static DEFINE_MUTEX(open_lock); @@ -70477,7 +70577,7 @@ index 87bac9920702..b1c3f3c56756 100644 static inline int mmc_blk_part_switch(struct mmc_card *card, unsigned int part_type); static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, -@@ -2898,6 +2905,7 @@ static int mmc_blk_probe(struct mmc_card *card) +@@ -2897,6 +2904,7 @@ static int mmc_blk_probe(struct mmc_card *card) { struct mmc_blk_data *md, *part_md; char cap_str[10]; @@ -70485,7 +70585,7 @@ index 87bac9920702..b1c3f3c56756 100644 /* * Check that the card supports the command class(es) we need. -@@ -2905,7 +2913,16 @@ static int mmc_blk_probe(struct mmc_card *card) +@@ -2904,7 +2912,16 @@ static int mmc_blk_probe(struct mmc_card *card) if (!(card->csd.cmdclass & CCC_BLOCK_READ)) return -ENODEV; @@ -70503,7 +70603,7 @@ index 87bac9920702..b1c3f3c56756 100644 card->complete_wq = alloc_workqueue("mmc_complete", WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); -@@ -2920,9 +2937,14 @@ static int mmc_blk_probe(struct mmc_card *card) +@@ -2919,9 +2936,14 @@ static int mmc_blk_probe(struct mmc_card *card) string_get_size((u64)get_capacity(md->disk), 512, STRING_UNITS_2, cap_str, sizeof(cap_str)); @@ -72204,10 +72304,10 @@ index 42df06c6b19c..e7f45a2b0c72 100644 2.18.4 -From 3d9c57f6dd8e8be8ea3ace726ee3d160072c40d5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 047/834] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 049/889] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -74696,10 +74796,10 @@ index 000000000000..7caba5e12f79 2.18.4 -From 0994c84b1108c507aa57ce8045b494b161503392 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 28 Oct 2016 15:36:43 +0100 -Subject: [PATCH 048/834] vc_mem: Add vc_mem driver for querying firmware +Subject: [PATCH 050/889] vc_mem: Add vc_mem driver for querying firmware memory addresses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -75200,10 +75300,10 @@ index 000000000000..3c7079237496 2.18.4 -From 8b6e342978da9b119424dd66ab122e0d571b52a7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 049/834] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 051/889] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren @@ -75510,10 +75610,10 @@ index 000000000000..f5e7f1ba8fb6 2.18.4 -From a74b079227427c2a5c2eb0afd0b08e13eacbf127 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 050/834] Add SMI driver +Subject: [PATCH 052/889] Add SMI driver Signed-off-by: Luke Wren @@ -77447,10 +77547,10 @@ index 000000000000..ee3a75edfc03 2.18.4 -From 8ea713dd879aa2910ed00c8bea96a308f6e19a7f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 051/834] Add Chris Boot's i2c driver +Subject: [PATCH 053/889] Add Chris Boot's i2c driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -78118,10 +78218,10 @@ index 000000000000..962f2e5c7455 2.18.4 -From 293e461d632d2e871be4abbf3e015104ed5fce53 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:27:06 +0200 -Subject: [PATCH 052/834] char: broadcom: Add vcio module +Subject: [PATCH 054/889] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -78383,10 +78483,10 @@ index 000000000000..d2598663a2b5 2.18.4 -From b1d39c59909f362c5776b982b1f7c1a35dc68cac Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:25:01 +0200 -Subject: [PATCH 053/834] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 055/889] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -78407,15 +78507,15 @@ firmware: bcm2835: Support ARCH_BCM270x Signed-off-by: Noralf Trønnes --- - drivers/firmware/raspberrypi.c | 19 +++++++++++++++++-- - 1 file changed, 17 insertions(+), 2 deletions(-) + drivers/firmware/raspberrypi.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c -index 2371d08bdd17..5fec4accb24f 100644 +index 1d965c1252ca..f039319020be 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -29,6 +29,8 @@ struct rpi_firmware { - u32 enabled; +@@ -32,6 +32,8 @@ struct rpi_firmware { + struct kref consumers; }; +static struct platform_device *g_pdev; @@ -78423,32 +78523,23 @@ index 2371d08bdd17..5fec4accb24f 100644 static DEFINE_MUTEX(transaction_lock); static void response_callback(struct mbox_client *cl, void *msg) -@@ -249,6 +251,7 @@ static int rpi_firmware_probe(struct platform_device *pdev) - init_completion(&fw->c); +@@ -272,6 +274,7 @@ static int rpi_firmware_probe(struct platform_device *pdev) + kref_init(&fw->consumers); platform_set_drvdata(pdev, fw); + g_pdev = pdev; rpi_firmware_print_firmware_revision(fw); rpi_register_hwmon_driver(dev, fw); -@@ -276,6 +279,7 @@ static int rpi_firmware_remove(struct platform_device *pdev) +@@ -298,6 +301,7 @@ static int rpi_firmware_remove(struct platform_device *pdev) + rpi_hwmon = NULL; platform_device_unregister(rpi_clk); rpi_clk = NULL; - mbox_free_channel(fw->chan); + g_pdev = NULL; - return 0; - } -@@ -288,7 +292,7 @@ static int rpi_firmware_remove(struct platform_device *pdev) - */ - struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node) - { -- struct platform_device *pdev = of_find_device_by_node(firmware_node); -+ struct platform_device *pdev = g_pdev; + rpi_firmware_put(fw); - if (!pdev) - return NULL; -@@ -312,7 +316,18 @@ static struct platform_driver rpi_firmware_driver = { +@@ -352,7 +356,18 @@ static struct platform_driver rpi_firmware_driver = { .shutdown = rpi_firmware_shutdown, .remove = rpi_firmware_remove, }; @@ -78472,10 +78563,10 @@ index 2371d08bdd17..5fec4accb24f 100644 2.18.4 -From 90c72c76bd9bca19429535dedf93fb574e1b4b07 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 054/834] BCM2708: Add core Device Tree support +Subject: [PATCH 056/889] BCM2708: Add core Device Tree support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -104958,10 +105049,10 @@ index 94133708889d..9c0df5bde46c 100644 2.18.4 -From bb3f92fe27be05b89fdc7ad47b41ce98bd517f2b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 055/834] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 057/889] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -105142,10 +105233,10 @@ index 6a8d6409c993..aefab0783075 100644 2.18.4 -From 9198b33813a38062ce057519f5ab5ee099245b60 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:54:08 +0100 -Subject: [PATCH 056/834] Added Device IDs for August DVB-T 205 +Subject: [PATCH 058/889] Added Device IDs for August DVB-T 205 --- drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 4 ++++ @@ -105170,10 +105261,10 @@ index c278b9b0f102..05f2297cf583 100644 2.18.4 -From 2954a983c4291cf1c5d942c5a162d8fdfb1a3be5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Nov 2016 16:50:04 +0000 -Subject: [PATCH 057/834] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 059/889] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -106793,10 +106884,10 @@ index 084734d3da5c..6af65533dbea 100644 2.18.4 -From 0dfd33ea6100eaf40c7ee50e4e60e6cc529e4b7f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 058/834] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 060/889] gpio-poweroff: Allow it to work on Raspberry Pi The Raspberry Pi firmware manages the power-down and reboot process. To do this it installs a pm_power_off handler, causing @@ -106834,10 +106925,10 @@ index 1c5af2fef142..3e670131f2a8 100644 2.18.4 -From c71865a5484d49a00a12f66fb10f1fe5151f7d6e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 059/834] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH 061/889] mfd: Add Raspberry Pi Sense HAT core driver mfd: Add rpi_sense_core of compatible string --- @@ -107720,10 +107811,10 @@ index 000000000000..56196dc2af10 2.18.4 -From 3e0bbb8e1402d79652fb108f9366ec0d3f41592c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 25 Jan 2016 15:48:59 +0000 -Subject: [PATCH 060/834] Add support for all the downstream rpi sound card +Subject: [PATCH 062/889] Add support for all the downstream rpi sound card drivers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -122966,10 +123057,10 @@ index 880ae162eaa5..54cbdb75f109 100644 2.18.4 -From 2085fe8530134f58851bd4992160aacdbc73b632 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joerg Schambacher Date: Fri, 16 Oct 2020 15:17:07 +0200 -Subject: [PATCH 061/834] Fixes a problem when module probes before i2c module +Subject: [PATCH 063/889] Fixes a problem when module probes before i2c module is available The driver crashed while a NULL pointer returned by i2c_get_adapter() @@ -123018,10 +123109,10 @@ index a6d078bc4a9a..157ab4c2cc85 100644 2.18.4 -From ea435c07584017ca2a01d8bfc3deba3b9ba22d39 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 062/834] rpi_display: add backlight driver and overlay +Subject: [PATCH 064/889] rpi_display: add backlight driver and overlay Add a mailbox-driven backlight controller for the Raspberry Pi DSI touchscreen display. Requires updated GPU firmware to recognise the @@ -123201,10 +123292,10 @@ index 000000000000..14a0d9b03739 2.18.4 -From bf4aa5233d69015c3839e59c4bfa6c222683219a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Feb 2016 19:56:04 +0000 -Subject: [PATCH 063/834] bcm2835-virtgpio: Virtual GPIO driver +Subject: [PATCH 065/889] bcm2835-virtgpio: Virtual GPIO driver Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. @@ -123468,10 +123559,10 @@ index 000000000000..49e28ad9760e 2.18.4 -From d1ecd9dab31029a3b0d8c06be0f524d5a94ae411 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH 064/834] OF: DT-Overlay configfs interface +Subject: [PATCH 066/889] OF: DT-Overlay configfs interface This is a port of Pantelis Antoniou's v3 port that makes use of the new upstreamed configfs support for binary attributes. @@ -123909,10 +124000,10 @@ index 000000000000..178f0629b0f0 2.18.4 -From f32e073aa75fa74ce5b7e28f4ef467728fd03d4e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Cheong2K Date: Fri, 26 Feb 2016 18:20:10 +0800 -Subject: [PATCH 065/834] brcm: adds support for BCM43341 wifi +Subject: [PATCH 067/889] brcm: adds support for BCM43341 wifi brcmfmac: Disable power management @@ -124060,10 +124151,10 @@ index 6d5d5c39c635..bfe4b8e5a716 100644 2.18.4 -From 730a462f41ef4cc94057438b32d2160ae17f8066 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Dec 2015 13:37:07 +0000 -Subject: [PATCH 066/834] hci_h5: Don't send conf_req when ACTIVE +Subject: [PATCH 068/889] hci_h5: Don't send conf_req when ACTIVE Without this patch, a modem and kernel can continuously bombard each other with conf_req and conf_rsp messages, in a demented game of tag. @@ -124089,10 +124180,10 @@ index 996729e78105..6d179e455721 100644 2.18.4 -From cbbeae84a0779e5e1f735e1aef1474bf12b0c2cf Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 067/834] config: Add default configs +Subject: [PATCH 069/889] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1473 +++++++++++++++++++++++++ @@ -131467,10 +131558,10 @@ index 000000000000..d542d2522076 2.18.4 -From 4505a1afcd4b1a4a8a009f8e4c7e18e4cacb7bd7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:43:57 -0800 -Subject: [PATCH 068/834] ARM64: Round-Robin dispatch IRQs between CPUs. +Subject: [PATCH 070/889] ARM64: Round-Robin dispatch IRQs between CPUs. IRQ-CPU mapping is round robined on ARM64 to increase concurrency and allow multiple interrupts to be serviced @@ -131547,10 +131638,10 @@ index 2187672e5be3..0b2af88b69a0 100644 2.18.4 -From d95bf5c9e55b48675d35c4458114342f62953a00 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 11 Feb 2017 01:18:31 -0800 -Subject: [PATCH 069/834] ARM64: Force hardware emulation of deprecated +Subject: [PATCH 071/889] ARM64: Force hardware emulation of deprecated instructions. --- @@ -131581,10 +131672,10 @@ index 7364de008bab..a11467132346 100644 2.18.4 -From 8417061f1a171aef74c6b825be35a27bfcc5ad90 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 25 Aug 2017 19:18:13 +0100 -Subject: [PATCH 070/834] cache: export clean and invalidate +Subject: [PATCH 072/889] cache: export clean and invalidate hack: cache: Fix linker error --- @@ -131642,10 +131733,10 @@ index dc8f152f3556..536df5db66e4 100644 2.18.4 -From cb47ec323105852c77efdfb648ac1ed1f46df274 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Tue, 14 Nov 2017 15:13:15 +0000 -Subject: [PATCH 071/834] AXI performance monitor driver (#2222) +Subject: [PATCH 073/889] AXI performance monitor driver (#2222) Uses the debugfs I/F to provide access to the AXI bus performance monitors. @@ -132344,10 +132435,10 @@ index 000000000000..5ae2bdaa88b4 2.18.4 -From 2a0017890ca223eda82d3f8006bf9adc1730e1c7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 3 Jun 2015 12:26:13 +0200 -Subject: [PATCH 072/834] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 074/889] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -132413,10 +132504,10 @@ index bfc556f76720..73ec2427fbcf 100644 2.18.4 -From 7263b1ecafa485c5890f408e3c27336b8fbbcbea Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 16 Jul 2018 14:40:13 +0100 -Subject: [PATCH 073/834] dwc-otg: FIQ: Fix "bad mode in data abort handler" +Subject: [PATCH 075/889] dwc-otg: FIQ: Fix "bad mode in data abort handler" Create a semi-static mapping for the USB registers early in the boot process, before additional kernel threads are started, so all threads @@ -132535,10 +132626,10 @@ index 73ec2427fbcf..9b6c921106b5 100644 2.18.4 -From c69433fae5998dee3f870cddc99e3e97661e668f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 Dec 2017 09:18:32 +0000 -Subject: [PATCH 074/834] ARM: Activate FIQs to avoid __irq_startup warnings +Subject: [PATCH 076/889] ARM: Activate FIQs to avoid __irq_startup warnings There is a new test in __irq_startup that the IRQ is activated, which hasn't been the case for FIQs since they bypass some of the usual setup. @@ -132577,10 +132668,10 @@ index 98ca3e3fa847..c3fe7d3cf482 100644 2.18.4 -From 409b87a71f3a2250627d6e2849f07607a906de39 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:16:19 +0100 -Subject: [PATCH 075/834] raspberrypi-firmware: Export the general transaction +Subject: [PATCH 077/889] raspberrypi-firmware: Export the general transaction function. The vc4-firmware-kms module is going to be doing the MBOX FB call. @@ -132591,10 +132682,10 @@ Signed-off-by: Eric Anholt 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c -index 5fec4accb24f..abb16e80a36c 100644 +index f039319020be..2929fb4cea80 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -43,7 +43,7 @@ static void response_callback(struct mbox_client *cl, void *msg) +@@ -46,7 +46,7 @@ static void response_callback(struct mbox_client *cl, void *msg) * Sends a request to the firmware through the BCM2835 mailbox driver, * and synchronously waits for the reply. */ @@ -132603,7 +132694,7 @@ index 5fec4accb24f..abb16e80a36c 100644 rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) { u32 message = MBOX_MSG(chan, data); -@@ -68,6 +68,7 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) +@@ -71,6 +71,7 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) return ret; } @@ -132615,10 +132706,10 @@ index 5fec4accb24f..abb16e80a36c 100644 2.18.4 -From ca44d28bc8a821761ae7aa2ae04b7efd21a600bb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 20 Feb 2018 10:07:27 +0000 -Subject: [PATCH 076/834] i2c-gpio: Also set bus numbers from reg property +Subject: [PATCH 078/889] i2c-gpio: Also set bus numbers from reg property I2C busses can be assigned specific bus numbers using aliases in Device Tree - string properties where the name is the alias and the @@ -132656,10 +132747,10 @@ index a4a6825c8758..cfbcf3952ddc 100644 2.18.4 -From 8cca09f210747840a94bd9b0665f4e52ca4bf6b5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: hdoverobinson Date: Tue, 13 Mar 2018 06:58:39 -0400 -Subject: [PATCH 077/834] added capture_clear option to pps-gpio via dtoverlay +Subject: [PATCH 079/889] added capture_clear option to pps-gpio via dtoverlay (#2433) --- @@ -132683,10 +132774,10 @@ index e0de1df2ede0..ee7d8f4e7f2e 100644 2.18.4 -From d627f455be8afbace0937eae66f7d2760c055c4a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 9 Mar 2018 12:01:00 +0000 -Subject: [PATCH 078/834] lan78xx: Read initial EEE status from DT +Subject: [PATCH 080/889] lan78xx: Read initial EEE status from DT Add two new DT properties: * microchip,eee-enabled - a boolean to enable EEE @@ -132699,10 +132790,10 @@ Signed-off-by: Phil Elwell 1 file changed, 16 insertions(+) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c -index 306bf917d4ed..8e234a7c84ef 100644 +index ba8db84b5d43..cf4500e4b460 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2635,6 +2635,22 @@ static int lan78xx_open(struct net_device *net) +@@ -2643,6 +2643,22 @@ static int lan78xx_open(struct net_device *net) netif_dbg(dev, ifup, dev->net, "phy initialised successfully"); @@ -132729,10 +132820,10 @@ index 306bf917d4ed..8e234a7c84ef 100644 2.18.4 -From fbf4d229ab5ab02ed7c4a537ab317d9d1a01c10f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 079/834] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 081/889] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -132740,7 +132831,7 @@ Reduces overhead when using X 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c -index 8d4ac4b9fb9d..996604acc730 100644 +index 009a0469d54f..2d18616f45e2 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -45,7 +45,7 @@ @@ -132767,10 +132858,10 @@ index 8d4ac4b9fb9d..996604acc730 100644 2.18.4 -From bc777620c432affa764483a620b903b1453cd91c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nick Bulleid Date: Thu, 10 May 2018 21:57:02 +0100 -Subject: [PATCH 080/834] Add ability to export gpio used by gpio-poweroff +Subject: [PATCH 082/889] Add ability to export gpio used by gpio-poweroff Signed-off-by: Nick Bulleid @@ -132832,10 +132923,10 @@ index 3e670131f2a8..e5dca66360a7 100644 2.18.4 -From cf8d9fa9e0c69c9f71c921bb944725baaedb3d33 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 12 May 2018 21:35:43 +0100 -Subject: [PATCH 081/834] firmware/raspberrypi: Notify firmware of a reboot +Subject: [PATCH 083/889] firmware/raspberrypi: Notify firmware of a reboot Register for reboot notifications, sending RPI_FIRMWARE_NOTIFY_REBOOT over the mailbox interface on reception. @@ -132846,10 +132937,10 @@ Signed-off-by: Phil Elwell 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c -index abb16e80a36c..05a0ae2a8eb7 100644 +index 2929fb4cea80..a7fde9de6f70 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -11,6 +11,7 @@ +@@ -12,6 +12,7 @@ #include #include #include @@ -132857,7 +132948,7 @@ index abb16e80a36c..05a0ae2a8eb7 100644 #include #include -@@ -177,6 +178,26 @@ int rpi_firmware_property(struct rpi_firmware *fw, +@@ -180,6 +181,26 @@ int rpi_firmware_property(struct rpi_firmware *fw, } EXPORT_SYMBOL_GPL(rpi_firmware_property); @@ -132884,7 +132975,7 @@ index abb16e80a36c..05a0ae2a8eb7 100644 static void rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) { -@@ -318,15 +339,32 @@ static struct platform_driver rpi_firmware_driver = { +@@ -358,15 +379,32 @@ static struct platform_driver rpi_firmware_driver = { .remove = rpi_firmware_remove, }; @@ -132922,10 +133013,10 @@ index abb16e80a36c..05a0ae2a8eb7 100644 2.18.4 -From fac491fa4736ec0051abb90eb9228e47b92e61c4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 14 Jun 2018 11:21:04 +0100 -Subject: [PATCH 082/834] irqchip: irq-bcm2835: Calc. FIQ_START at boot-time +Subject: [PATCH 084/889] irqchip: irq-bcm2835: Calc. FIQ_START at boot-time ad83c7cb2f37 ("irqchip/irq-bcm2836: Add support for DT interrupt polarity") changed the way that the BCM2836/7 local interrupts are mapped; instead @@ -132994,10 +133085,10 @@ index 18b7483588c2..0e6c0811dc1e 100644 2.18.4 -From f4103825830b7e2f120c61ee2975283b70bf4b0f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 14 Jun 2018 15:07:26 +0100 -Subject: [PATCH 083/834] of: configfs: Use of_overlay_fdt_apply API call +Subject: [PATCH 085/889] of: configfs: Use of_overlay_fdt_apply API call The published API to the dynamic overlay application mechanism now takes a Flattened Device Tree blob as input so that it can manage the @@ -133114,10 +133205,10 @@ index 178f0629b0f0..ac04301dabe1 100644 2.18.4 -From 9b4e74a7424c446b74a4d9b1cb31ffc02dc32583 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 13 Jun 2018 15:21:10 +0100 -Subject: [PATCH 084/834] net: lan78xx: Disable TCP Segmentation Offload (TSO) +Subject: [PATCH 086/889] net: lan78xx: Disable TCP Segmentation Offload (TSO) TSO seems to be having issues when packets are dropped and the remote end uses Selective Acknowledge (SACK) to denote that @@ -133136,7 +133227,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c -index 8e234a7c84ef..681a6b949140 100644 +index cf4500e4b460..aa6ec5e4f492 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -425,6 +425,15 @@ static int msg_level = -1; @@ -133155,7 +133246,7 @@ index 8e234a7c84ef..681a6b949140 100644 static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data) { u32 *buf = kmalloc(sizeof(u32), GFP_KERNEL); -@@ -2917,8 +2926,14 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) +@@ -2925,8 +2934,14 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) if (DEFAULT_RX_CSUM_ENABLE) dev->net->features |= NETIF_F_RXCSUM; @@ -133176,10 +133267,10 @@ index 8e234a7c84ef..681a6b949140 100644 2.18.4 -From 96fa89f299af1d1d31fdf4eab79c9c840071248d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 20 Jun 2018 12:20:01 +0100 -Subject: [PATCH 085/834] brcmfmac: Re-enable firmware roaming support +Subject: [PATCH 087/889] brcmfmac: Re-enable firmware roaming support As of 4.18, a firmware that implements the update_connect_params method but doesn't claim to support roaming causes an error. We @@ -133211,10 +133302,10 @@ index 591dcd04b4b4..e3758bd86acf 100644 2.18.4 -From f44330de330184462fd2617de9af04bc17b5e928 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 5 Apr 2018 14:46:11 +0100 -Subject: [PATCH 086/834] lan78xx: Move enabling of EEE into PHY init code +Subject: [PATCH 088/889] lan78xx: Move enabling of EEE into PHY init code Enable EEE mode as soon as possible after connecting to the PHY, and before phy_start. This avoids a second link negotiation, which speeds @@ -133228,10 +133319,10 @@ Signed-off-by: Phil Elwell 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c -index 681a6b949140..68d0aec53f3a 100644 +index aa6ec5e4f492..b027f223fb4b 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2167,6 +2167,22 @@ static int lan78xx_phy_init(struct lan78xx_net *dev) +@@ -2175,6 +2175,22 @@ static int lan78xx_phy_init(struct lan78xx_net *dev) mii_adv_to_linkmode_adv_t(fc, mii_adv); linkmode_or(phydev->advertising, fc, phydev->advertising); @@ -133254,7 +133345,7 @@ index 681a6b949140..68d0aec53f3a 100644 if (phydev->mdio.dev.of_node) { u32 reg; int len; -@@ -2644,22 +2660,6 @@ static int lan78xx_open(struct net_device *net) +@@ -2652,22 +2668,6 @@ static int lan78xx_open(struct net_device *net) netif_dbg(dev, ifup, dev->net, "phy initialised successfully"); @@ -133281,10 +133372,10 @@ index 681a6b949140..68d0aec53f3a 100644 2.18.4 -From 4b2cb340fadf0eca9ed1c2cc0a2b3aa9347daa0f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 9 Jul 2018 12:54:25 +0100 -Subject: [PATCH 087/834] Add rpi-poe-fan driver +Subject: [PATCH 089/889] Add rpi-poe-fan driver Signed-off-by: Serge Schneider @@ -133879,10 +133970,10 @@ index 000000000000..c9654e9e9f2d 2.18.4 -From 516d2e5b4176e9a2729a745e206f2fa9fc9a83b3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 17 Sep 2018 17:31:18 +0100 -Subject: [PATCH 088/834] cxd2880: CXD2880_SPI_DRV should select DVB_CXD2880 +Subject: [PATCH 090/889] cxd2880: CXD2880_SPI_DRV should select DVB_CXD2880 with MEDIA_SUBDRV_AUTOSELECT --- @@ -133905,10 +133996,10 @@ index 857ef4ace6e9..deae75ea3c44 100644 2.18.4 -From cf40d8706102b186a203286226e4c78335aca1ab Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sat, 6 Oct 2018 16:46:18 +0200 -Subject: [PATCH 089/834] hwmon: raspberrypi: Prevent voltage low warnings from +Subject: [PATCH 091/889] hwmon: raspberrypi: Prevent voltage low warnings from filling log Although the correct fix for low voltage warnings is to @@ -133986,10 +134077,10 @@ index d3a64a35f7a9..db3b03438dd0 100644 2.18.4 -From 5b67d13c34a445d83029b225583e13b1c69423c5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sat, 13 Oct 2018 13:31:21 +0200 -Subject: [PATCH 090/834] firmware: raspberrypi: Add backward compatible +Subject: [PATCH 092/889] firmware: raspberrypi: Add backward compatible get_throttled Avoid a hard userspace ABI change by adding a compatible get_throttled @@ -134003,18 +134094,18 @@ Signed-off-by: Stefan Wahren 1 file changed, 33 insertions(+) diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c -index 05a0ae2a8eb7..f7d605a62801 100644 +index a7fde9de6f70..bfbbf00d795c 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -28,6 +28,7 @@ struct rpi_firmware { +@@ -29,6 +29,7 @@ struct rpi_firmware { struct mbox_chan *chan; /* The property channel. */ struct completion c; u32 enabled; + u32 get_throttled; - }; - static struct platform_device *g_pdev; -@@ -174,6 +175,12 @@ int rpi_firmware_property(struct rpi_firmware *fw, + struct kref consumers; + }; +@@ -177,6 +178,12 @@ int rpi_firmware_property(struct rpi_firmware *fw, kfree(data); @@ -134027,7 +134118,7 @@ index 05a0ae2a8eb7..f7d605a62801 100644 return ret; } EXPORT_SYMBOL_GPL(rpi_firmware_property); -@@ -198,6 +205,27 @@ static int rpi_firmware_notify_reboot(struct notifier_block *nb, +@@ -201,6 +208,27 @@ static int rpi_firmware_notify_reboot(struct notifier_block *nb, return 0; } @@ -134055,7 +134146,7 @@ index 05a0ae2a8eb7..f7d605a62801 100644 static void rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) { -@@ -227,6 +255,11 @@ rpi_register_hwmon_driver(struct device *dev, struct rpi_firmware *fw) +@@ -230,6 +258,11 @@ rpi_register_hwmon_driver(struct device *dev, struct rpi_firmware *fw) rpi_hwmon = platform_device_register_data(dev, "raspberrypi-hwmon", -1, NULL, 0); @@ -134071,10 +134162,10 @@ index 05a0ae2a8eb7..f7d605a62801 100644 2.18.4 -From e7cacc8fec1ed27bb7f52a2d00f9b14705c3a64a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 6 Nov 2018 12:57:48 +0000 -Subject: [PATCH 091/834] sc16is7xx: Don't spin if no data received +Subject: [PATCH 093/889] sc16is7xx: Don't spin if no data received See: https://github.com/raspberrypi/linux/issues/2676 @@ -134100,10 +134191,10 @@ index 9adb8362578c..f64e051c0030 100644 2.18.4 -From 82ed5c2ffb8a00e4c145b46e938bc98b15826dfc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Ram Chandrasekar Date: Mon, 7 May 2018 11:54:08 -0600 -Subject: [PATCH 092/834] drivers: thermal: step_wise: add support for +Subject: [PATCH 094/889] drivers: thermal: step_wise: add support for hysteresis Step wise governor increases the mitigation level when the temperature @@ -134200,10 +134291,10 @@ index 2ae7198d3067..abe34cfe21fe 100644 2.18.4 -From 1554f0ab8d5d04242d452f7bcc909bee8a9932d6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 2 Oct 2018 11:14:15 +0100 -Subject: [PATCH 093/834] drivers: thermal: step_wise: avoid throttling at +Subject: [PATCH 095/889] drivers: thermal: step_wise: avoid throttling at hysteresis temperature after dropping below it Signed-off-by: Serge Schneider @@ -134228,10 +134319,10 @@ index abe34cfe21fe..5c8602933201 100644 2.18.4 -From b8cc6c23480fb577103e3ce1623e097068d68f3e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Fri, 2 Nov 2018 11:55:49 +0000 -Subject: [PATCH 094/834] Update issue templates (#2736) +Subject: [PATCH 096/889] Update issue templates (#2736) --- .github/ISSUE_TEMPLATE/bug_report.md | 34 ++++++++++++++++++++++++++++ @@ -134282,10 +134373,10 @@ index 000000000000..09bdc4a96838 2.18.4 -From 3b2c876ec0b87b7ab7ea8adbdbdbf656f886108e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Nov 2018 19:46:58 +0000 -Subject: [PATCH 095/834] net: lan78xx: Support auto-downshift to 100Mb/s +Subject: [PATCH 097/889] net: lan78xx: Support auto-downshift to 100Mb/s Ethernet cables with faulty or missing pairs (specifically pairs C and D) allow auto-negotiation to 1000Mbs, but do not support the successful @@ -134383,10 +134474,10 @@ index 517288da19fd..626c450d71f4 100644 2.18.4 -From 83e53701aa49285c68d6fa160359afe547252e8a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 10 Jan 2019 17:58:06 +0000 -Subject: [PATCH 096/834] firmware: raspberrypi: Report the fw variant during +Subject: [PATCH 098/889] firmware: raspberrypi: Report the fw variant during probe The driver already reported the firmware build date during probe. @@ -134411,10 +134502,10 @@ Signed-off-by: Dave Stevenson 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c -index f7d605a62801..e7df000f8b2c 100644 +index bfbbf00d795c..a3f9d0cbcebb 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -231,6 +231,15 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) +@@ -234,6 +234,15 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) { time64_t date_and_time; u32 packet; @@ -134430,7 +134521,7 @@ index f7d605a62801..e7df000f8b2c 100644 int ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_FIRMWARE_REVISION, &packet, sizeof(packet)); -@@ -240,7 +249,35 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) +@@ -243,7 +252,35 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) /* This is not compatible with y2038 */ date_and_time = packet; @@ -134467,7 +134558,7 @@ index f7d605a62801..e7df000f8b2c 100644 } static void -@@ -309,6 +346,7 @@ static int rpi_firmware_probe(struct platform_device *pdev) +@@ -332,6 +369,7 @@ static int rpi_firmware_probe(struct platform_device *pdev) g_pdev = pdev; rpi_firmware_print_firmware_revision(fw); @@ -134476,7 +134567,7 @@ index f7d605a62801..e7df000f8b2c 100644 rpi_register_clk_driver(dev); diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h -index 16253b6875c9..d0c827064999 100644 +index bc3829dfcc33..4728741132b1 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -38,6 +38,8 @@ struct rpi_firmware_property_tag_header { @@ -134492,10 +134583,10 @@ index 16253b6875c9..d0c827064999 100644 2.18.4 -From d3c18577da03f89e876f40d9305c21791453a647 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joshua Emele Date: Wed, 7 Nov 2018 16:07:40 -0800 -Subject: [PATCH 097/834] lan78xx: Debounce link events to minimize poll storm +Subject: [PATCH 099/889] lan78xx: Debounce link events to minimize poll storm The bInterval is set to 4 (i.e. 8 microframes => 1ms) and the only bit that the driver pays attention to is "link was reset". If there's a @@ -134509,7 +134600,7 @@ See: https://github.com/raspberrypi/linux/issues/2447 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c -index 68d0aec53f3a..e5bd18aa1cfa 100644 +index b027f223fb4b..ac07246e97f4 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -434,6 +434,11 @@ static bool enable_tso; @@ -134524,7 +134615,7 @@ index 68d0aec53f3a..e5bd18aa1cfa 100644 static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data) { u32 *buf = kmalloc(sizeof(u32), GFP_KERNEL); -@@ -3760,7 +3765,13 @@ static int lan78xx_probe(struct usb_interface *intf, +@@ -3768,7 +3773,13 @@ static int lan78xx_probe(struct usb_interface *intf, netdev->max_mtu = MAX_SINGLE_PACKET_SIZE; netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER); @@ -134543,10 +134634,10 @@ index 68d0aec53f3a..e5bd18aa1cfa 100644 2.18.4 -From 681fa7ca634d439db5c5fe55ac60b0af0298d435 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 5 Mar 2019 09:51:22 +0000 -Subject: [PATCH 098/834] lan78xx: EEE support is now a PHY property +Subject: [PATCH 100/889] lan78xx: EEE support is now a PHY property Now that EEE support is a property of the PHY, use the PHY's DT node when querying the EEE-related properties. @@ -134559,10 +134650,10 @@ Signed-off-by: Phil Elwell 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c -index e5bd18aa1cfa..a03bcbdd04f3 100644 +index ac07246e97f4..b64c9c8020e6 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2172,7 +2172,7 @@ static int lan78xx_phy_init(struct lan78xx_net *dev) +@@ -2180,7 +2180,7 @@ static int lan78xx_phy_init(struct lan78xx_net *dev) mii_adv_to_linkmode_adv_t(fc, mii_adv); linkmode_or(phydev->advertising, fc, phydev->advertising); @@ -134575,10 +134666,10 @@ index e5bd18aa1cfa..a03bcbdd04f3 100644 2.18.4 -From 65f780249490a566c180eeadb77ead7c4cf5926e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 20 Jul 2018 22:03:41 +0100 -Subject: [PATCH 099/834] bcm2835-dma: Add support for per-channel flags +Subject: [PATCH 101/889] bcm2835-dma: Add support for per-channel flags Add the ability to interpret the high bits of the dreq specifier as flags to be included in the DMA_CS register. The motivation for this @@ -134629,10 +134720,10 @@ index bf7ba96a39f9..87b5d0bef355 100644 2.18.4 -From a5d71f005f3abf7e9e19151efe161395b558b7a1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Fri, 29 Mar 2019 10:53:14 +0000 -Subject: [PATCH 100/834] rtc: rv3028: Add backup switchover mode support +Subject: [PATCH 102/889] rtc: rv3028: Add backup switchover mode support Signed-off-by: Phil Howard --- @@ -134685,10 +134776,10 @@ index fa226f0fe67d..20baf2257631 100644 2.18.4 -From 6472b839636dd0158ee08a80d8b161aadc61f7a9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: P33M Date: Thu, 2 May 2019 11:53:45 +0100 -Subject: [PATCH 101/834] lan78xx: use default alignment for rx buffers +Subject: [PATCH 103/889] lan78xx: use default alignment for rx buffers The lan78xx uses a 12-byte hardware rx header, so there is no need to allocate SKBs with NET_IP_ALIGN set. Removes alignment faults @@ -134698,10 +134789,10 @@ in both dwc_otg and in ipv6 processing. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c -index a03bcbdd04f3..58f5b90f11d4 100644 +index b64c9c8020e6..acfbda466d2f 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -3161,7 +3161,7 @@ static int rx_submit(struct lan78xx_net *dev, struct urb *urb, gfp_t flags) +@@ -3169,7 +3169,7 @@ static int rx_submit(struct lan78xx_net *dev, struct urb *urb, gfp_t flags) size_t size = dev->rx_urb_size; int ret = 0; @@ -134714,10 +134805,10 @@ index a03bcbdd04f3..58f5b90f11d4 100644 2.18.4 -From abe90b0bf9f38526f45104bc4e0bf68a6c13316c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:55:37 +0000 -Subject: [PATCH 102/834] media: ov5647: Add set_fmt and get_fmt calls. +Subject: [PATCH 104/889] media: ov5647: Add set_fmt and get_fmt calls. There's no way to query the subdevice for the supported resolutions. @@ -134767,10 +134858,10 @@ index e7d2e5b4ad4b..3e587eb0a30e 100644 2.18.4 -From 032be155d7fe41ba96efb8a4423a55a4f23dbc01 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:56:33 +0000 -Subject: [PATCH 103/834] media: ov5647: Add support for PWDN GPIO. +Subject: [PATCH 105/889] media: ov5647: Add support for PWDN GPIO. Add support for an optional GPIO connected to PWDN on the sensor. @@ -134865,10 +134956,10 @@ index 3e587eb0a30e..c39e3d20e3ef 100644 2.18.4 -From 3277ab906fa9063d7d27693e5ff9221433c36e6c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:56:47 +0000 -Subject: [PATCH 104/834] media: ov5647: Add support for non-continuous clock +Subject: [PATCH 106/889] media: ov5647: Add support for non-continuous clock mode The driver was only supporting continuous clock mode @@ -134950,10 +135041,10 @@ index c39e3d20e3ef..8a1a515388e0 100644 2.18.4 -From b710af86aa9ff41fdb5be761fbe53f321a3dd82e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:56:59 +0000 -Subject: [PATCH 105/834] media: tc358743: Increase FIFO level to 374. +Subject: [PATCH 107/889] media: tc358743: Increase FIFO level to 374. The existing fixed value of 16 worked for UYVY 720P60 over 2 lanes at 594MHz, or UYVY 1080P60 over 4 lanes. (RGB888 @@ -134987,10 +135078,10 @@ index f21da11caf22..471a56cf96b8 100644 2.18.4 -From 6e7f9129535502475f31b5904816c47f9e5d82bc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Thu, 21 Sep 2017 17:30:24 +0200 -Subject: [PATCH 106/834] media: tc358743: fix connected/active CSI-2 lane +Subject: [PATCH 108/889] media: tc358743: fix connected/active CSI-2 lane reporting g_mbus_config was supposed to indicate all supported lane numbers, not @@ -135069,10 +135160,10 @@ index c20e2dc6d432..396fb88266be 100644 2.18.4 -From 00e98eb0c13e9745785b95f9857c3e17019c647d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:57:21 +0000 -Subject: [PATCH 107/834] media: tc358743: Add support for 972Mbit/s link freq. +Subject: [PATCH 109/889] media: tc358743: Add support for 972Mbit/s link freq. Adds register setups for running the CSI lanes at 972Mbit/s, which allows 1080P50 UYVY down 2 lanes. @@ -135154,10 +135245,10 @@ index 44ae2f33334a..24f176ee8a7b 100644 2.18.4 -From 354cace5313c8b8afaa0718162160a857b00e9f6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:57:34 +0000 -Subject: [PATCH 108/834] media: tc358743: Check I2C succeeded during probe. +Subject: [PATCH 110/889] media: tc358743: Check I2C succeeded during probe. The probe for the TC358743 reads the CHIPID register from the device and compares it to the expected value of 0. @@ -135258,10 +135349,10 @@ index 24f176ee8a7b..ba8f63dbbd37 100644 2.18.4 -From 09535140f979a1f6f76cf51ce73da92e489d740f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:57:46 +0000 -Subject: [PATCH 109/834] media: adv7180: Default to the first valid input +Subject: [PATCH 111/889] media: adv7180: Default to the first valid input The hardware default is differential CVBS on AIN1 & 2, which isn't very useful. @@ -135309,10 +135400,10 @@ index 4498d14d3429..e98dd2bee1e5 100644 2.18.4 -From 26418e7d6f31b0456281b24484cc9d3e7d3fc06c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:57:56 +0000 -Subject: [PATCH 110/834] media: adv7180: Add YPrPb support for ADV7282M +Subject: [PATCH 112/889] media: adv7180: Add YPrPb support for ADV7282M The ADV7282M can support YPbPr on AIN1-3, but this was not selectable from the driver. Add it to the list of @@ -135339,10 +135430,10 @@ index e98dd2bee1e5..4103690a71df 100644 2.18.4 -From cde6f0f7728ebeecd0f70facb4fd2469328616b0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:58:08 +0000 -Subject: [PATCH 111/834] media: videodev2: Add helper defines for printing +Subject: [PATCH 113/889] media: videodev2: Add helper defines for printing FOURCCs New helper defines that allow printing of a FOURCC using @@ -135373,10 +135464,10 @@ index 534eaa4d39bc..56c443cc2c3d 100644 2.18.4 -From b5cd369dac60ad3d2bc6829ba3ec7fb8e844ebc7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:59:06 +0000 -Subject: [PATCH 112/834] dt-bindings: Document BCM283x CSI2/CCP2 receiver +Subject: [PATCH 114/889] dt-bindings: Document BCM283x CSI2/CCP2 receiver Document the DT bindings for the CSI2/CCP2 receiver peripheral (known as Unicam) on BCM283x SoCs. @@ -135483,10 +135574,10 @@ index 000000000000..7714fb374b34 2.18.4 -From fc2b042681990f8e2b51eaf5411167db1c1f34db Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:59:40 +0000 -Subject: [PATCH 113/834] MAINTAINERS: Add entry for BCM2835 Unicam driver +Subject: [PATCH 115/889] MAINTAINERS: Add entry for BCM2835 Unicam driver Adds entry for the new BCM2835 Unicam (CSI-2 receiver) driver @@ -135517,10 +135608,10 @@ index 4fef10dd2975..cbfee297e9f9 100644 2.18.4 -From 36b83ad70884817788208575d1d351225b60c343 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 22 Nov 2018 17:31:06 +0000 -Subject: [PATCH 114/834] media: tc358743: Return an appropriate colorspace +Subject: [PATCH 116/889] media: tc358743: Return an appropriate colorspace from tc358743_set_fmt When calling tc358743_set_fmt, the code was calling tc358743_get_fmt @@ -135621,10 +135712,10 @@ index ba8f63dbbd37..b77b900bf6ad 100644 2.18.4 -From 493c57e065a5e1972bc957f1eabbea2e60d46553 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 29 Oct 2018 16:20:46 +0000 -Subject: [PATCH 115/834] staging: mmal-vchiq: Avoid use of bool in structures +Subject: [PATCH 117/889] staging: mmal-vchiq: Avoid use of bool in structures Fixes up a checkpatch error "Avoid using bool structure members because of possible alignment issues". @@ -135651,10 +135742,10 @@ index d697ea55a0da..4a2fc257fb9f 100644 2.18.4 -From 65b5167f63d312e243da7b8b9881760ab59c695f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 24 Sep 2018 18:15:38 +0100 -Subject: [PATCH 116/834] staging: mmal-vchiq: Add support for event callbacks. +Subject: [PATCH 118/889] staging: mmal-vchiq: Add support for event callbacks. (Preparation for the codec driver). The codec uses the event mechanism to report things such as @@ -136019,10 +136110,10 @@ index 1dc81ecf9268..e87f88f99338 100644 2.18.4 -From 1f87bb1e0110abea87b45f5bf232fd846867eb18 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 24 Sep 2018 18:26:02 +0100 -Subject: [PATCH 117/834] staging: vc04_services: Support sending data to MMAL +Subject: [PATCH 119/889] staging: vc04_services: Support sending data to MMAL ports Add the ability to send data to ports. This only supports @@ -136067,10 +136158,10 @@ index 4d2ba6851d87..2f25b96673e5 100644 2.18.4 -From d3a9f5c3e91b6bcc3b5d9a0db0d39b17990d7f93 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 29 Oct 2018 17:57:45 +0000 -Subject: [PATCH 118/834] media: videobuf2: Allow exporting of a struct dmabuf +Subject: [PATCH 120/889] media: videobuf2: Allow exporting of a struct dmabuf videobuf2 only allowed exporting a dmabuf as a file descriptor, but there are instances where having the struct dma_buf is @@ -136158,10 +136249,10 @@ index bbb3f26fbde9..7a4aa9cb28c9 100644 2.18.4 -From 7174eeed3cd1db7e88443dda8a065b999408ad8b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 22 Jan 2019 12:04:09 +0000 -Subject: [PATCH 119/834] staging: mmal-vchiq: Fix client_component for 64 bit +Subject: [PATCH 121/889] staging: mmal-vchiq: Fix client_component for 64 bit kernel The MMAL client_component field is used with the event @@ -136199,10 +136290,10 @@ index 2f25b96673e5..43b80a32c922 100644 2.18.4 -From fa60bdfa387f71cb53b380116abffa389ecc5785 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 24 Jan 2019 15:09:28 +0000 -Subject: [PATCH 120/834] clk: clk-bcm2835: Use %zd when printing size_t +Subject: [PATCH 122/889] clk: clk-bcm2835: Use %zd when printing size_t The debug text for how many clocks have been registered uses "%d" with a size_t. Correct it to "%zd". @@ -136229,10 +136320,10 @@ index f1ef788c1194..2674b979a072 100644 2.18.4 -From 121f56217f028639cdcf71421d6f6f97f914039e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 18 Sep 2018 11:08:51 +0100 -Subject: [PATCH 121/834] media: ov5647: Use gpiod_set_value_cansleep +Subject: [PATCH 123/889] 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 @@ -136289,10 +136380,10 @@ index 8a1a515388e0..07550377be2e 100644 2.18.4 -From 068119943a67df5866571904bb4d261154a8eb35 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 13 Feb 2019 12:33:29 +0000 -Subject: [PATCH 122/834] staging: mmal_vchiq: Add in the Bayer encoding +Subject: [PATCH 124/889] staging: mmal_vchiq: Add in the Bayer encoding formats The list of formats was copied before Bayer support was added. @@ -136346,10 +136437,10 @@ index 2be9941a1f30..44ba91aa6d47 100644 2.18.4 -From 4db949e0d1c2a7b8fed30bfad28ab27b5f089ece Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 18 Feb 2019 15:52:29 +0000 -Subject: [PATCH 123/834] staging: mmal-vchiq: Update mmal_parameters.h with +Subject: [PATCH 125/889] staging: mmal-vchiq: Update mmal_parameters.h with recently defined params mmal_parameters.h hasn't been updated to reflect additions made @@ -136408,10 +136499,10 @@ index a1e39b1b1701..1793103b18fd 100644 2.18.4 -From a3636832cb71d9eaf5ed58f2afa67e2b7a507056 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 1 May 2019 13:27:23 +0100 -Subject: [PATCH 124/834] staging: mmal-vchiq: Free the event context for +Subject: [PATCH 126/889] staging: mmal-vchiq: Free the event context for control ports vchiq_mmal_component_init calls init_event_context for the @@ -136442,10 +136533,10 @@ index 43b80a32c922..312cd6b74c30 100644 2.18.4 -From 604bb14c13806d406b943247c157e119080a40b4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 2 May 2019 15:50:01 +0100 -Subject: [PATCH 125/834] staging: mmal-vchiq: Fix memory leak in error path +Subject: [PATCH 127/889] staging: mmal-vchiq: Fix memory leak in error path On error, vchiq_mmal_component_init could leave the event context allocated for ports. @@ -136524,10 +136615,10 @@ index 312cd6b74c30..f5222a4b26b3 100644 2.18.4 -From 7fddcd57f0695d3f17cfb865cf9cb172afe24d52 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 12 Jun 2019 17:15:05 +0100 -Subject: [PATCH 126/834] w1: w1-gpio: Make GPIO an output for strong pullup +Subject: [PATCH 128/889] w1: w1-gpio: Make GPIO an output for strong pullup The logic to drive the data line high to implement a strong pullup assumed that the pin was already an output - setting a value does @@ -136557,10 +136648,10 @@ index d4632aace402..4832cd8c2596 100644 2.18.4 -From be32b5148e38e92f8c8dabe8b53c3b3b6af57289 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 20 Feb 2019 08:49:39 +0000 -Subject: [PATCH 127/834] arm: bcm2835: Fix FIQ early ioremap +Subject: [PATCH 129/889] arm: bcm2835: Fix FIQ early ioremap The ioremapping creates mappings within the vmalloc area. The equivalent early function, create_mapping, now checks that the @@ -136636,10 +136727,10 @@ index 9b6c921106b5..9bd9842da59f 100644 2.18.4 -From 8a059ec9afea871098ff1b5d6180e25e846120c0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 29 May 2019 15:47:42 +0100 -Subject: [PATCH 128/834] arm: bcm2835: DMA can only address 1GB +Subject: [PATCH 130/889] arm: bcm2835: DMA can only address 1GB The legacy peripherals can only address the first gigabyte of RAM, so ensure that DMA allocations are restricted to that region. @@ -136667,10 +136758,10 @@ index 9bd9842da59f..7d59a9364175 100644 2.18.4 -From 376df630900604a5ad43a0eb10fe5a0879e5e946 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sat, 4 May 2019 17:06:15 +0200 -Subject: [PATCH 129/834] hwrng: iproc-rng200: Add BCM2838 support +Subject: [PATCH 131/889] hwrng: iproc-rng200: Add BCM2838 support The HWRNG on the BCM2838 is compatible to iproc-rng200, so add the support to this driver instead of bcm2835-rng. @@ -136828,10 +136919,10 @@ index 01583faf9893..2a92ea658096 100644 2.18.4 -From 6fc10d2ea13f0330395e5e27f666ddfe22fedb73 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 2 Aug 2019 15:20:11 +0100 -Subject: [PATCH 130/834] mmc: sdhci-iproc: Fix vmmc regulators on iProc +Subject: [PATCH 132/889] 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 @@ -136847,7 +136938,7 @@ Signed-off-by: Phil Elwell 1 file changed, 12 insertions(+) diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c -index ddeaf8e1f72f..57257a014022 100644 +index b9eb2ec61a83..7658898cf39b 100644 --- a/drivers/mmc/host/sdhci-iproc.c +++ b/drivers/mmc/host/sdhci-iproc.c @@ -173,6 +173,17 @@ static unsigned int sdhci_iproc_get_max_clock(struct sdhci_host *host) @@ -136865,10 +136956,10 @@ index ddeaf8e1f72f..57257a014022 100644 + 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, -@@ -190,6 +201,7 @@ static const struct sdhci_ops sdhci_iproc_32only_ops = { + /* + * There is a known bug on BCM2711's SDHCI core integration where the + * controller will hang when the difference between the core clock and the bus +@@ -207,6 +218,7 @@ static const struct sdhci_ops sdhci_iproc_32only_ops = { .write_b = sdhci_iproc_writeb, .set_clock = sdhci_set_clock, .get_max_clock = sdhci_iproc_get_max_clock, @@ -136880,10 +136971,10 @@ index ddeaf8e1f72f..57257a014022 100644 2.18.4 -From b24d294540bbc2f43dc9de1498f7dd7f6d026d87 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 1 Nov 2018 17:31:37 +0000 -Subject: [PATCH 131/834] vchiq: Add 36-bit address support +Subject: [PATCH 133/889] vchiq: Add 36-bit address support Conditional on a new compatible string, change the pagelist encoding such that the top 24 bits are the pfn, leaving 8 bits for run length @@ -137092,10 +137183,10 @@ index 0784c5002417..f8b1c005af62 100644 2.18.4 -From 9bb1ca45b4b956f47a652adfd525060970415193 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 30 Apr 2019 19:15:30 +0100 -Subject: [PATCH 132/834] bcm2835-pcm.c: Support multichannel audio +Subject: [PATCH 134/889] bcm2835-pcm.c: Support multichannel audio --- .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 17 +++++++++-------- @@ -137144,10 +137235,10 @@ index 096f2c54258a..3c0033101e6e 100644 2.18.4 -From 9b4df259062e7cfb6a58cfbc6b4d26b0081b0665 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Wed, 12 Sep 2018 14:44:53 +0100 -Subject: [PATCH 133/834] bcmgenet: constrain max DMA burst length +Subject: [PATCH 135/889] bcmgenet: constrain max DMA burst length --- drivers/net/ethernet/broadcom/genet/bcmgenet.h | 2 +- @@ -137170,10 +137261,10 @@ index f6ca01da141d..45ea07829b8c 100644 2.18.4 -From 71ed17478e0e204c7532d5621dc60cb392cdbf4a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 27 Mar 2019 13:45:46 +0000 -Subject: [PATCH 134/834] bcmgenet: Better coalescing parameter defaults +Subject: [PATCH 136/889] bcmgenet: Better coalescing parameter defaults Set defaults for TX and RX packet coalescing to be equivalent to: @@ -137219,10 +137310,10 @@ index db74241935ab..05d138849867 100644 2.18.4 -From fc9ce7fbab61bf55d8c950648e9a34aaf18033fc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 14 May 2019 17:17:59 +0100 -Subject: [PATCH 135/834] net: genet: enable link energy detect powerdown for +Subject: [PATCH 137/889] net: genet: enable link energy detect powerdown for external PHYs There are several warts surrounding bcmgenet_mii_probe() as this @@ -137256,45 +137347,10 @@ index f9e91304d232..7abd5ddebd8e 100644 2.18.4 -From 8a673e631ede8ebe22aa28231d2f303cc6c1b7ea Mon Sep 17 00:00:00 2001 -From: Tim Gover -Date: Fri, 22 Mar 2019 09:47:14 +0000 -Subject: [PATCH 136/834] usb: xhci: Disable the XHCI 5 second timeout - -If the VL805 EEPROM has not been programmed then boot will hang for five -seconds. The timeout seems to be arbitrary and is an unecessary -delay on the first boot. Remove the timeout. - -This is common code and probably can't be upstreamed unless the timeout -can be configurable somehow or perhaps the XHCI driver can be skipped -on the first boot. ---- - drivers/usb/host/xhci.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index a8d97e23f601..d61b0ef94a2f 100644 ---- a/drivers/usb/host/xhci.c -+++ b/drivers/usb/host/xhci.c -@@ -196,8 +196,9 @@ int xhci_reset(struct xhci_hcd *xhci) - if (xhci->quirks & XHCI_INTEL_HOST) - udelay(1000); - -+ // Hack: reduce handshake timeout from 10s 0.5s due to unprogrammed vl805 - ret = xhci_handshake(&xhci->op_regs->command, -- CMD_RESET, 0, 10 * 1000 * 1000); -+ CMD_RESET, 0, 500 * 1000); - if (ret) - return ret; - --- -2.18.4 - - -From 0d99e40d1e21a6793da51856c59128602d4aa43a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Mon, 13 May 2019 11:05:27 +0000 -Subject: [PATCH 137/834] spi: bcm2835: enable shared interrupt support +Subject: [PATCH 138/889] spi: bcm2835: enable shared interrupt support Add shared interrupt support for this driver. @@ -137332,10 +137388,10 @@ index 33c32e931767..1240422970df 100644 2.18.4 -From b6989f906dcbb47465dce9255128ba183d20cbd2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Jan 2019 16:11:50 +0000 -Subject: [PATCH 138/834] clk-bcm2835: Don't wait for pllh lock +Subject: [PATCH 139/889] clk-bcm2835: Don't wait for pllh lock Signed-off-by: Phil Elwell --- @@ -137376,10 +137432,10 @@ index 2674b979a072..38f97f1707d2 100644 2.18.4 -From 2c85fcbdb9b1744ac5985a193e35a361fa7c9eb7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 11 Jan 2019 17:31:07 -0800 -Subject: [PATCH 139/834] soc: bcm: bcm2835-pm: Add support for 2711. +Subject: [PATCH 140/889] soc: bcm: bcm2835-pm: Add support for 2711. Without the actual power management part any more, there's a lot less to set up for V3D. We just need to clear the RSTN field for the power @@ -137488,10 +137544,10 @@ index ed37dc40e82a..b2d157091e12 100644 2.18.4 -From 73d7cd38064d31dd59f9480a7c1c248be0159a41 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 May 2019 15:11:05 -0700 -Subject: [PATCH 140/834] clk: bcm2835: Add support for setting leaf clock +Subject: [PATCH 141/889] clk: bcm2835: Add support for setting leaf clock rates while running. As long as you wait for !BUSY, you can do glitch-free updates of clock @@ -137547,10 +137603,10 @@ index 38f97f1707d2..4cf4f5e12fe2 100644 2.18.4 -From 0ed245ada74df10dc80b1ac83467d0f302c0d4a4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 May 2019 15:24:04 -0700 -Subject: [PATCH 141/834] clk: bcm2835: Allow reparenting leaf clocks while +Subject: [PATCH 142/889] clk: bcm2835: Allow reparenting leaf clocks while they're running. This falls under the same "we can reprogram glitch-free as long as we @@ -137624,10 +137680,10 @@ index 4cf4f5e12fe2..3c55594684cd 100644 2.18.4 -From d88326c1fb41440548a131d58f6aa96d03522cf9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 11 Jun 2019 10:55:00 +0100 -Subject: [PATCH 142/834] usb: add plumbing for updating interrupt endpoint +Subject: [PATCH 143/889] usb: add plumbing for updating interrupt endpoint interval state xHCI caches device and endpoint data after the interface is configured, @@ -137652,7 +137708,7 @@ Signed-off-by: Jonathan Bell 4 files changed, 34 insertions(+) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c -index 99908d8d2dd3..07f5a39a6e31 100644 +index 4bbf3316a9a5..23ea20b9be27 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1945,6 +1945,16 @@ int usb_hcd_alloc_bandwidth(struct usb_device *udev, @@ -137673,10 +137729,10 @@ index 99908d8d2dd3..07f5a39a6e31 100644 * endpoint state is gone from hardware. usb_hcd_flush_endpoint() must * have been called previously. Use for set_configuration, set_interface, diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c -index 6138a21cf0f1..6f0c19d76515 100644 +index ccbbda19b04c..62611141f014 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c -@@ -1259,6 +1259,21 @@ static void remove_intf_ep_devs(struct usb_interface *intf) +@@ -1265,6 +1265,21 @@ static void remove_intf_ep_devs(struct usb_interface *intf) intf->ep_devs_created = 0; } @@ -137712,10 +137768,10 @@ index d6a41841b93e..32be892f53cf 100644 /* this request isn't really synchronous, but it belongs with the others */ extern int usb_driver_set_configuration(struct usb_device *udev, int config); diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h -index 3dbb42c637c1..a60b7fc02fce 100644 +index 9f05016d823f..710e24d74759 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h -@@ -382,6 +382,11 @@ struct hc_driver { +@@ -384,6 +384,11 @@ struct hc_driver { * or bandwidth constraints. */ void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); @@ -137727,7 +137783,7 @@ index 3dbb42c637c1..a60b7fc02fce 100644 /* Returns the hardware-chosen device address */ int (*address_device)(struct usb_hcd *, struct usb_device *udev); /* prepares the hardware to send commands to the device */ -@@ -443,6 +448,8 @@ extern void usb_hcd_unmap_urb_setup_for_dma(struct usb_hcd *, struct urb *); +@@ -445,6 +450,8 @@ extern void usb_hcd_unmap_urb_setup_for_dma(struct usb_hcd *, struct urb *); extern void usb_hcd_unmap_urb_for_dma(struct usb_hcd *, struct urb *); extern void usb_hcd_flush_endpoint(struct usb_device *udev, struct usb_host_endpoint *ep); @@ -137740,10 +137796,10 @@ index 3dbb42c637c1..a60b7fc02fce 100644 2.18.4 -From de333aab40c1a39a0afb7322ef8c910d97ac579a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 11 Jun 2019 11:33:39 +0100 -Subject: [PATCH 143/834] xhci: implement xhci_fixup_endpoint for interval +Subject: [PATCH 144/889] xhci: implement xhci_fixup_endpoint for interval adjustments Must be called in a non-atomic context, after the endpoint @@ -137756,7 +137812,7 @@ Signed-off-by: Jonathan Bell 1 file changed, 98 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index d61b0ef94a2f..494a059f2f5b 100644 +index 6389dc99bc9a..425a066ed977 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1467,6 +1467,103 @@ static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id, @@ -137875,10 +137931,10 @@ index d61b0ef94a2f..494a059f2f5b 100644 2.18.4 -From fe6711832cd5bb2e6c756860808e25f584a1e9dd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 11 Jun 2019 11:42:03 +0100 -Subject: [PATCH 144/834] usbhid: call usb_fixup_endpoint after mangling +Subject: [PATCH 145/889] usbhid: call usb_fixup_endpoint after mangling intervals Lets the mousepoll override mechanism work with xhci. @@ -137889,7 +137945,7 @@ Signed-off-by: Jonathan Bell 1 file changed, 1 insertion(+) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c -index 996604acc730..5ab69fc58d1b 100644 +index 2d18616f45e2..1f0e61d1312d 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -1128,6 +1128,7 @@ static int usbhid_start(struct hid_device *hid) @@ -137904,10 +137960,10 @@ index 996604acc730..5ab69fc58d1b 100644 2.18.4 -From 7a6a299940d45c911963040b9d41834527d706d9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 11 Jun 2019 17:38:28 +0100 -Subject: [PATCH 145/834] arm: bcm2835: Add bcm2838 compatible string. +Subject: [PATCH 146/889] arm: bcm2835: Add bcm2838 compatible string. Signed-off-by: Phil Elwell --- @@ -137930,10 +137986,10 @@ index 7d59a9364175..282a023027fc 100644 2.18.4 -From 991bbf4fa53f40d24013212c4254d1fd95fc8b62 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Oct 2018 17:22:43 -0700 -Subject: [PATCH 146/834] drm/v3d: Add support for 2711. +Subject: [PATCH 147/889] drm/v3d: Add support for 2711. Signed-off-by: Eric Anholt --- @@ -137956,10 +138012,10 @@ index 9f7c26193831..a463f8c0ad4c 100644 2.18.4 -From 215c887ecef91b002357893efb823a452efbef8e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 14 Jan 2019 12:35:43 -0800 -Subject: [PATCH 147/834] drm/v3d: Skip MMU flush if the device is currently +Subject: [PATCH 148/889] drm/v3d: Skip MMU flush if the device is currently off. If it's off, we know it will be reset on poweron, so the MMU won't @@ -138014,10 +138070,10 @@ index 5a453532901f..8986e7b96461 100644 2.18.4 -From a83b0d2fca6334bc8bc65334d67140c6fe6522bc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 14 Jan 2019 14:47:57 -0800 -Subject: [PATCH 148/834] drm/v3d: Hook up the runtime PM ops. +Subject: [PATCH 149/889] 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 @@ -138054,10 +138110,10 @@ index a463f8c0ad4c..5f581fe8c918 100644 2.18.4 -From a170c2dde748739f98d93822e9679815826b3b20 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Thu, 11 Jul 2019 17:55:43 +0100 -Subject: [PATCH 149/834] xhci: add quirk for host controllers that don't +Subject: [PATCH 150/889] xhci: add quirk for host controllers that don't update endpoint DCS Seen on a VLI VL805 PCIe to USB controller. For non-stream endpoints @@ -138094,7 +138150,7 @@ index 119d1a8fbb19..618a131bdd53 100644 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index 53059ee957ad..9106f0a1909a 100644 +index dc2068e3bedb..c8d733ff3eb5 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -556,7 +556,10 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, @@ -138139,10 +138195,10 @@ index 53059ee957ad..9106f0a1909a 100644 /* diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index c1865a121100..8f11760e1f7b 100644 +index 1c97c8d81154..5441604e8967 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1881,6 +1881,7 @@ struct xhci_hcd { +@@ -1884,6 +1884,7 @@ struct xhci_hcd { #define XHCI_DISABLE_SPARSE BIT_ULL(38) #define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39) #define XHCI_NO_SOFT_RETRY BIT_ULL(40) @@ -138154,10 +138210,10 @@ index c1865a121100..8f11760e1f7b 100644 2.18.4 -From d605d6ab28a3e296d19b8030251518aa12488cd4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 12 Jul 2019 15:38:35 +0100 -Subject: [PATCH 150/834] i2c: bcm2835: Set clock-stretch timeout to 35ms +Subject: [PATCH 151/889] i2c: bcm2835: Set clock-stretch timeout to 35ms The BCM2835 I2C blocks have a register to set the clock-stretch timeout - how long the device is allowed to hold SCL low - in bus @@ -138207,10 +138263,10 @@ index 18b2e9e3d752..5b2589b6b9cc 100644 2.18.4 -From 5dce849d0e802097877bf6d6a194e5cb7f86b598 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 6 Aug 2019 15:23:14 +0100 -Subject: [PATCH 151/834] clk-bcm2835: Avoid null pointer exception +Subject: [PATCH 152/889] clk-bcm2835: Avoid null pointer exception clk_desc_array[BCM2835_PLLB] doesn't exist so we dereference null when iterating @@ -138242,10 +138298,10 @@ index 3c55594684cd..d686c51a68a9 100644 2.18.4 -From bef4ecedc3feaa8a66f6e2d917313f0d2b5eca6b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 14 Jan 2019 15:13:17 -0800 -Subject: [PATCH 152/834] drm/v3d: HACK: gut runtime pm for now. +Subject: [PATCH 153/889] drm/v3d: HACK: gut runtime pm for now. Something is still unstable -- on starting a new glxgears from an idle X11, I get an MMU violation in high addresses. The CTS also failed @@ -138359,10 +138415,10 @@ index 5f581fe8c918..e6dffb116eb3 100644 2.18.4 -From 09288d2eaa605db0bf611c7fa67f2039740a0aee Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 May 2019 13:22:53 -0700 -Subject: [PATCH 153/834] drm/v3d: Clock V3D down when not in use. +Subject: [PATCH 154/889] drm/v3d: Clock V3D down when not in use. My various attempts at re-enabling runtime PM have failed, so just crank the clock down when V3D is idle to reduce power consumption. @@ -138530,10 +138586,10 @@ index 182c586525eb..b7b439de8660 100644 2.18.4 -From 6c952568a0d6ef79a481eb7c8349951e12e2c31a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Thu, 9 May 2019 14:30:37 +0100 -Subject: [PATCH 154/834] drivers: char: add chardev for mmap'ing the RPiVid +Subject: [PATCH 155/889] drivers: char: add chardev for mmap'ing the RPiVid control registers Based on the gpiomem driver, allow mapping of the decoder register @@ -138988,10 +139044,10 @@ index b2d157091e12..f70a810c55f7 100644 2.18.4 -From 848a05d0ff4ad9884fb3402232ffe8effbc0f4c4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Thu, 1 Aug 2019 16:41:20 +0100 -Subject: [PATCH 155/834] hid: usb: Add device quirks for Freeway Airmouse T3 +Subject: [PATCH 156/889] hid: usb: Add device quirks for Freeway Airmouse T3 and MX3 These wireless mouse/keyboard combo remote control devices specify @@ -139059,10 +139115,10 @@ index be53c723c729..9f9d5778114e 100644 2.18.4 -From 3fcace7ce7d950358c3a1550abb8730e20adaff1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Tue, 16 Jul 2019 12:18:21 +0100 -Subject: [PATCH 156/834] Add HDMI1 facility to the driver. +Subject: [PATCH 157/889] Add HDMI1 facility to the driver. For generic ALSA, all you need is the bcm2835.h change, but have also added structures for IEC958 HDMI. Not sure how to @@ -139152,10 +139208,10 @@ index 1b36475872d6..02f50768af96 100644 2.18.4 -From b44e4e9e35b78c23c6d89bc7249f00f0be8ec54b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 9 Aug 2019 08:51:43 +0100 -Subject: [PATCH 157/834] net: bcmgenet: Workaround #2 for Pi4 Ethernet fail +Subject: [PATCH 158/889] net: bcmgenet: Workaround #2 for Pi4 Ethernet fail Some combinations of Pi 4Bs and Ethernet switches don't reliably get a DCHP-assigned IP address, leaving the unit with a self=assigned 169.254 @@ -139209,10 +139265,10 @@ index 05d138849867..82cd64876d66 100644 2.18.4 -From 2c9b6208501ad6993fa7c2b3b6badddb5e43a491 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 13 Aug 2019 15:53:29 +0100 -Subject: [PATCH 158/834] xhci: Use more event ring segment table entries +Subject: [PATCH 159/889] xhci: Use more event ring segment table entries Users have reported log spam created by "Event Ring Full" xHC event TRBs. These are caused by interrupt latency in conjunction with a very @@ -139259,10 +139315,10 @@ index ed380ee58ab5..0d336f7451c7 100644 "// Write ERST size = %i to ir_set 0 (some bits preserved)", val); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index 8f11760e1f7b..3bf1cf0aabb1 100644 +index 5441604e8967..f852e3f2cbd0 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1650,8 +1650,8 @@ struct urb_priv { +@@ -1653,8 +1653,8 @@ struct urb_priv { * Each segment table entry is 4*32bits long. 1K seems like an ok size: * (1K bytes * 8bytes/bit) / (4*32 bits) = 64 segment entries in the table, * meaning 64 ring segments. @@ -139277,10 +139333,10 @@ index 8f11760e1f7b..3bf1cf0aabb1 100644 2.18.4 -From 8787fe867ccc5042e9184dcad849fd2226f68406 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 15 Aug 2019 12:02:34 +0100 -Subject: [PATCH 159/834] configs: arm64/bcm2711: Enable V3D +Subject: [PATCH 160/889] configs: arm64/bcm2711: Enable V3D Enable the V3D driver, which depends on BCM2835_POWER. @@ -139311,10 +139367,10 @@ index 9a5c44606337..b0e048697964 100644 2.18.4 -From bd98f32c67ad9ca1d8b945e7658cc85ffb0b103b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 Sep 2019 18:16:56 +0100 -Subject: [PATCH 160/834] arch/arm: Add model string to cpuinfo +Subject: [PATCH 161/889] arch/arm: Add model string to cpuinfo Signed-off-by: Phil Elwell --- @@ -139353,10 +139409,10 @@ index b06602cea99c..647caa3f6c7f 100644 2.18.4 -From 9b8170754dd81bd8cb0e95df8fe327d407d88704 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 Sep 2019 18:17:25 +0100 -Subject: [PATCH 161/834] arch/arm64: Add Revision, Serial, Model to cpuinfo +Subject: [PATCH 162/889] arch/arm64: Add Revision, Serial, Model to cpuinfo Signed-off-by: Phil Elwell --- @@ -139417,10 +139473,10 @@ index 77605aec25fe..721350d21074 100644 2.18.4 -From 56f69657804ab9bf53fbc5193c99331e058fc27c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 28 Aug 2019 13:34:30 +0100 -Subject: [PATCH 162/834] media: dt-bindings: Add binding for the Sony IMX219 +Subject: [PATCH 163/889] media: dt-bindings: Add binding for the Sony IMX219 sensor The IMX219 is an 8MPix CSI2 sensor, supporting 2 or 4 data lanes. @@ -139501,10 +139557,10 @@ index 000000000000..a02f1ce1e120 2.18.4 -From 253542be507727481e530cc0e6a36b166fb37cc4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 6 Sep 2019 15:04:51 +0100 -Subject: [PATCH 163/834] v4l2: Add a Greyworld AWB mode. +Subject: [PATCH 164/889] 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) @@ -139543,10 +139599,10 @@ index a184c4939438..fbe96b80a748 100644 2.18.4 -From 71a7c3440e1fe2a23f6443eecfbf57e803f98c0a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 6 Sep 2019 15:13:06 +0100 -Subject: [PATCH 164/834] staging: bcm2835-camera: Add greyworld AWB mode +Subject: [PATCH 165/889] staging: bcm2835-camera: Add greyworld AWB mode This is mainly used for the NoIR camera which has no IR filter and can completely confuse normal AWB presets. @@ -139588,10 +139644,10 @@ index 1793103b18fd..27bafc5f01d2 100644 2.18.4 -From 7f08785f21cd1496b8703f56714bd05e5b575ee9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 18 Sep 2019 17:22:36 +0100 -Subject: [PATCH 165/834] drm/v3d: Delete pm_runtime support +Subject: [PATCH 166/889] drm/v3d: Delete pm_runtime support The pm_runtime was blocking changelist submission, so delete it as a temporary workaround. @@ -139658,10 +139714,10 @@ index 8986e7b96461..618503f2f2f1 100644 2.18.4 -From c78d37278d6cfc48ad5d57729434a02d96980422 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 23 Sep 2019 09:26:41 +0100 -Subject: [PATCH 166/834] kbuild: Allow .dtbo overlays to be built piecemeal +Subject: [PATCH 167/889] 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: @@ -139683,7 +139739,7 @@ Signed-off-by: Phil Elwell 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile -index 7f25cfee84ec..bd8e14bcb2ff 100644 +index 84d540aed24c..099b4e54d6f2 100644 --- a/Makefile +++ b/Makefile @@ -1354,6 +1354,9 @@ ifneq ($(dtstree),) @@ -139700,10 +139756,10 @@ index 7f25cfee84ec..bd8e14bcb2ff 100644 2.18.4 -From a1b5df243b001a1732144d5c10ed7d66e5c95470 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Thu, 19 Sep 2019 20:45:30 +0200 -Subject: [PATCH 167/834] ARM: bcm: Switch board, clk and pinctrl to bcm2711 +Subject: [PATCH 168/889] ARM: bcm: Switch board, clk and pinctrl to bcm2711 compatible After the decision to use bcm2711 compatible for upstream, we should @@ -139732,10 +139788,10 @@ index 282a023027fc..e538e0f899a5 100644 2.18.4 -From 828625b99c1076dea64c8e8b85ad6d204fef76c0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Tue, 24 Sep 2019 18:26:55 +0100 -Subject: [PATCH 168/834] Rename HDMI ALSA device names, check for enable state +Subject: [PATCH 169/889] Rename HDMI ALSA device names, check for enable state HDMI Alsa devices renamed to match names used by DRM, to HDMI 1 and HDMI 2 @@ -139877,10 +139933,10 @@ index eb8a8a5b7ec8..f926784c622d 100644 2.18.4 -From 58c0595448fb30f9c5c457fcc14ba625e384b4b4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Proeller Date: Thu, 10 Oct 2019 19:12:08 +0200 -Subject: [PATCH 169/834] dt-bindings: Add binding for the Infineon IRS1125 +Subject: [PATCH 170/889] dt-bindings: Add binding for the Infineon IRS1125 sensor Adds a binding for the Infineon IRS1125 time-of-flight depth @@ -139950,10 +140006,10 @@ index 000000000000..25a48028c957 2.18.4 -From b2fddb55c0fd95293677b69f5ef6c11f4d46141a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Proeller Date: Thu, 10 Oct 2019 19:12:36 +0200 -Subject: [PATCH 170/834] media: i2c: Add a driver for the Infineon IRS1125 +Subject: [PATCH 171/889] media: i2c: Add a driver for the Infineon IRS1125 depth sensor The Infineon IRS1125 is a time of flight depth sensor that @@ -141195,10 +141251,10 @@ index 000000000000..dccaca23aa76 2.18.4 -From 32c00dbbaed5ce9af10c6a3cb34dba0377b014b7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 Nov 2019 14:01:41 +0000 -Subject: [PATCH 171/834] drm/v3d: Don't clear MMU control bits on exception +Subject: [PATCH 172/889] 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 @@ -141235,10 +141291,10 @@ index c88686489b88..b804783e2795 100644 2.18.4 -From 7b3e0f51b20c7f8f75412e481ee8f6c9ba355151 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 Nov 2019 20:18:08 +0000 -Subject: [PATCH 172/834] drm/v3d: Suppress all but the first MMU error +Subject: [PATCH 173/889] drm/v3d: Suppress all but the first MMU error The v3d driver currently encounters a lot of MMU PTE exceptions, so only log the first to avoid swamping the kernel log. @@ -141280,10 +141336,10 @@ index b804783e2795..063418907a19 100644 2.18.4 -From 7f5a587a7ac2a3008dead2ac7540c0884d82220d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 12 Nov 2019 16:41:21 +0000 -Subject: [PATCH 173/834] drm/v3d: Plug dma_fence leak +Subject: [PATCH 174/889] drm/v3d: Plug dma_fence leak The irq_fence and done_fence are given a reference that is never released. The necessary dma_fence_put()s seem to have been @@ -141314,10 +141370,10 @@ index 49c7920608e2..bfbe33a9492d 100644 2.18.4 -From 32b0c26f1c5e81d82aed3c9fff4a95021b3f26f2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 6 Nov 2019 13:57:48 +0000 -Subject: [PATCH 174/834] staging: vchiq_arm: Register vcsm-cma as a platform +Subject: [PATCH 175/889] staging: vchiq_arm: Register vcsm-cma as a platform driver Following the same pattern as bcm2835-camera and bcm2835-audio, @@ -141360,10 +141416,10 @@ index b8579af3948c..5d4b976820fa 100644 2.18.4 -From a0c7eecc696ffc63816dcfa1dca9376e40054f80 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 6 Nov 2019 13:57:58 +0000 -Subject: [PATCH 175/834] staging: vchiq_arm: Register bcm2835-codec as a +Subject: [PATCH 176/889] staging: vchiq_arm: Register bcm2835-codec as a platform driver Following the same pattern as bcm2835-camera and bcm2835-audio, @@ -141406,10 +141462,10 @@ index 5d4b976820fa..3bbe533007e5 100644 2.18.4 -From a91dcfb50dd74296ee734a629517bf69b973127f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 14 Nov 2019 11:59:01 +0000 -Subject: [PATCH 176/834] net: bcmgenet: The second IRQ is optional +Subject: [PATCH 177/889] 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. @@ -141436,10 +141492,10 @@ index 063418907a19..0f7a23f051df 100644 2.18.4 -From bc18bdd9a61cd4dcd1409f704b19f231a40d2474 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Thu, 31 Oct 2019 14:39:44 +0000 -Subject: [PATCH 177/834] net:phy:2711 Allow ethernet LED mode to be set via +Subject: [PATCH 178/889] net:phy:2711 Allow ethernet LED mode to be set via device tree Add device tree entries and code to allow the specification of @@ -141488,10 +141544,10 @@ index dbed15dc0fe7..10d70bde381c 100644 2.18.4 -From 548a29cb25c1989c491d9992a3b27c769ac90e58 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Thu, 7 Nov 2019 14:59:59 +0000 -Subject: [PATCH 178/834] net:phy:2711 Change the default ethernet LED actions +Subject: [PATCH 179/889] net:phy:2711 Change the default ethernet LED actions This should return default behaviour back to that of previous releases. @@ -141527,10 +141583,10 @@ index 10d70bde381c..6de9b072b6b9 100644 2.18.4 -From f45058a9ac88926e501c263bbb8c788f71f7f18f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 23 Aug 2019 16:34:38 +0100 -Subject: [PATCH 179/834] v3d_drv: Handle missing clock more gracefully +Subject: [PATCH 180/889] v3d_drv: Handle missing clock more gracefully Signed-off-by: popcornmix --- @@ -141560,10 +141616,10 @@ index 065fb20cc4a8..bfbea29c6c1f 100644 2.18.4 -From 9ba4f966baf2a48fe52739134865d2177df9fe25 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 5 Sep 2019 17:59:14 +0100 -Subject: [PATCH 180/834] v3d_gem: Kick the clock so firmware knows we are +Subject: [PATCH 181/889] v3d_gem: Kick the clock so firmware knows we are using firmware clock interface Setting the v3d clock to low value allows firmware to handle dvfs in case @@ -141593,10 +141649,10 @@ index bfbe33a9492d..b4fb899a9409 100644 2.18.4 -From 85ba776f9233f962d1c48a1a08cd71d332e41121 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 9 Sep 2019 15:49:56 +0100 -Subject: [PATCH 181/834] clk-raspberrypi: Allow cpufreq driver to also adjust +Subject: [PATCH 182/889] clk-raspberrypi: Allow cpufreq driver to also adjust gpu clocks For performance/power it is beneficial to adjust gpu clocks with arm clock. @@ -141624,10 +141680,10 @@ index f89b9cfc4309..f4884a5b598a 100644 2.18.4 -From 421b6d8286ef833e531ddc2e547fdda325f34a66 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 3 Sep 2019 20:28:00 +0100 -Subject: [PATCH 182/834] clk-bcm2835: Disable v3d clock +Subject: [PATCH 183/889] clk-bcm2835: Disable v3d clock This is controlled by firmware, see clk-raspberrypi.c @@ -141688,10 +141744,10 @@ index d686c51a68a9..84f24244d1b5 100644 2.18.4 -From 30e914bfef0e148180ec6e20f0ca0103345d0f75 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 22 Nov 2019 16:23:32 +0000 -Subject: [PATCH 183/834] drm/v3d: Set dma_mask as well as coherent_dma_mask +Subject: [PATCH 184/889] 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 @@ -141721,10 +141777,10 @@ index bfbea29c6c1f..3237f47a4792 100644 2.18.4 -From 85efd3386ea55025fc81fea457b71eccd6ff90a8 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 29 Jan 2019 16:13:25 +0000 -Subject: [PATCH 184/834] staging: vchiq_arm: Set up dma ranges on child +Subject: [PATCH 185/889] staging: vchiq_arm: Set up dma ranges on child devices The VCHIQ driver now loads the audio, camera, codec, and vc-sm @@ -141760,10 +141816,10 @@ index 3bbe533007e5..ed6c1747be64 100644 2.18.4 -From 3954d3ac6ce0ec31c7112ad33292eb5889a6d88e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 18 Jun 2019 12:15:50 +0100 -Subject: [PATCH 185/834] staging: vchiq: Use the old dma controller for OF +Subject: [PATCH 186/889] staging: vchiq: Use the old dma controller for OF config on platform devices vchiq on Pi4 is no longer under the soc node, therefore it @@ -141817,10 +141873,10 @@ index ed6c1747be64..5e704b366676 100644 2.18.4 -From 62cb65c45f9fd24035b4c27d57a8ca20b231ac41 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Fri, 27 Dec 2019 11:40:56 +0100 -Subject: [PATCH 186/834] ARM: bcm: Backport BCM2711 support from upstream +Subject: [PATCH 187/889] ARM: bcm: Backport BCM2711 support from upstream Make the BCM2711 a different machine, but keep it in board_bcm2835. @@ -141870,10 +141926,10 @@ index e538e0f899a5..91a758c61f48 100644 2.18.4 -From 1cdef7e74b3b493b5863f8b45b82bad531fc9326 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Luke Hinds <7058938+lukehinds@users.noreply.github.com> Date: Wed, 22 Jan 2020 16:03:00 +0000 -Subject: [PATCH 187/834] Initialise rpi-firmware before clk-bcm2835 +Subject: [PATCH 188/889] Initialise rpi-firmware before clk-bcm2835 The IMA (Integrity Measurement Architecture) looks for a TPM (Trusted Platform Module) having been registered when it initialises; otherwise @@ -141909,10 +141965,10 @@ index 84f24244d1b5..20155bb28e3c 100644 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("BCM2835 clock driver"); diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c -index e7df000f8b2c..8da5be17b906 100644 +index a3f9d0cbcebb..a47609ec7e63 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -430,7 +430,7 @@ static int __init rpi_firmware_init(void) +@@ -470,7 +470,7 @@ static int __init rpi_firmware_init(void) out1: return ret; } @@ -141925,10 +141981,10 @@ index e7df000f8b2c..8da5be17b906 100644 2.18.4 -From 876195b3de18252f5a799af7e65067ae1f95573f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 3 Feb 2020 17:30:46 +0000 -Subject: [PATCH 188/834] staging: vchiq_arm: Give vchiq children DT nodes +Subject: [PATCH 189/889] staging: vchiq_arm: Give vchiq children DT nodes vchiq kernel clients are now instantiated as platform drivers rather than using DT, but the children of the vchiq interface may still @@ -141970,10 +142026,10 @@ index 5e704b366676..8d518bd9a6cd 100644 2.18.4 -From d5d4ccc07c6236fbdf8493e644f2b17e49dc221a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 6 Jan 2020 16:04:30 +0000 -Subject: [PATCH 189/834] pinctrl: bcm2835: Remove gpiochip on error +Subject: [PATCH 190/889] pinctrl: bcm2835: Remove gpiochip on error A failure in gpiochip_irqchip_add leads to a leak of a gpiochip. Fix the leak with the use of devm_gpiochip_add_data. @@ -142001,10 +142057,10 @@ index bbf761c41dc5..2696029e1689 100644 2.18.4 -From 8c4698e70c80d46109e4d5e132616c0b53903fff Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 6 Jan 2020 14:05:42 +0000 -Subject: [PATCH 190/834] pinctrl: bcm2835: Change init order for gpio hogs +Subject: [PATCH 191/889] pinctrl: bcm2835: Change init order for gpio hogs pinctrl-bcm2835 is a combined pinctrl/gpio driver. Currently the gpio side is registered first, but this breaks gpio hogs (which are @@ -142085,10 +142141,10 @@ index 2696029e1689..edb3a863871d 100644 2.18.4 -From 1f9f126a5f61248cda99ecb7aaafa906fa065d65 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 25 Feb 2020 17:38:20 +0000 -Subject: [PATCH 191/834] pinctrl: bcm2835: Accept fewer than expected IRQs +Subject: [PATCH 192/889] 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. @@ -142122,10 +142178,10 @@ index edb3a863871d..bda29f421e78 100644 2.18.4 -From 631a1a404fc7ec1f35ef944e5b7c1aa9c21632ee Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 2 Mar 2020 14:40:19 +0000 -Subject: [PATCH 192/834] drivers: char: vcio: Use common compat header +Subject: [PATCH 193/889] drivers: char: vcio: Use common compat header The definition of compat_ptr is now common for most platforms, but requires the inclusion of . @@ -142151,10 +142207,10 @@ index d2598663a2b5..a39155a94fb7 100644 2.18.4 -From 936ad5b17203a8150f69245f5dfd2bcb1661c804 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 2 Mar 2020 14:42:23 +0000 -Subject: [PATCH 193/834] video: fbdev: bcm2708_fb: Use common compat header +Subject: [PATCH 194/889] video: fbdev: bcm2708_fb: Use common compat header The definition of compat_ptr is now common for most platforms, but requires the inclusion of . @@ -142180,10 +142236,10 @@ index 0e9ec3f593b8..17e9260655e4 100644 2.18.4 -From e6e32ebd6ecb4bde7121b792dc2a7d95588ed157 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 6 Feb 2020 12:23:15 +0000 -Subject: [PATCH 194/834] of: overlay: Correct symbol path fixups +Subject: [PATCH 195/889] of: overlay: Correct symbol path fixups When symbols from overlays are added to the live tree their paths must be rebased. The translated symbol is normally the result of joining @@ -142223,10 +142279,10 @@ index 43a77d720008..bccef312f4c3 100644 2.18.4 -From 2596cce2563f5c90a339b557db51c2badf91ac3d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jim Quinlan Date: Mon, 15 Jan 2018 18:28:39 -0500 -Subject: [PATCH 195/834] dt-bindings: pci: Add DT docs for Brcmstb PCIe device +Subject: [PATCH 196/889] dt-bindings: pci: Add DT docs for Brcmstb PCIe device The DT bindings description of the Brcmstb PCIe device is described. This node can be used by almost all Broadcom settop box chips, using @@ -142307,10 +142363,10 @@ index 000000000000..a1a9ad5e70ca 2.18.4 -From f75e83cf8e9a4b863de2392deaffe741469edb0a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nataliya Korovkina Date: Thu, 12 Mar 2020 17:22:53 -0400 -Subject: [PATCH 196/834] Kbuild: Allow .dtbo overlays to be built, adjust. +Subject: [PATCH 197/889] Kbuild: Allow .dtbo overlays to be built, adjust. This is adjustment to commit d368ceaacdccd7732dc97d1d7987bdf7149d62e3 "kbuild: Allow .dtbo overlays to be built piecemeal" @@ -142323,7 +142379,7 @@ Signed-off-by: Nataliya Korovkina 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile -index bd8e14bcb2ff..31cbbd02c5f5 100644 +index 099b4e54d6f2..11026140a242 100644 --- a/Makefile +++ b/Makefile @@ -1354,7 +1354,7 @@ ifneq ($(dtstree),) @@ -142339,10 +142395,10 @@ index bd8e14bcb2ff..31cbbd02c5f5 100644 2.18.4 -From b7e1a4b41920225adef0e7dbe816c6f360bc2f04 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 Apr 2020 11:22:44 +0100 -Subject: [PATCH 197/834] bcmgenet: Disable skip_umac_reset by default +Subject: [PATCH 198/889] bcmgenet: Disable skip_umac_reset by default Possible fixed upstream by 'net: bcmgenet: keep MAC in reset until PHY is up' @@ -142368,10 +142424,10 @@ index 82cd64876d66..06e0e3d0f2b5 100644 2.18.4 -From 9c9c926aa27edb2e621454c4030071b462698e22 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 24 Jan 2020 14:22:06 +0000 -Subject: [PATCH 198/834] drm/fourcc: Add packed 10bit YUV 4:2:0 format +Subject: [PATCH 199/889] drm/fourcc: Add packed 10bit YUV 4:2:0 format Adds a format that is 3 10bit YUV 4:2:0 samples packed into a 32bit work (with 2 spare bits). @@ -142431,10 +142487,10 @@ index 5498d7a6556a..3aeab2680295 100644 2.18.4 -From e76e20e7170db4c987a2aceb6e087999895cbd8d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Fri, 13 Dec 2019 17:04:25 +0100 -Subject: [PATCH 199/834] media: uapi: hevc: Add scaling matrix control +Subject: [PATCH 200/889] media: uapi: hevc: Add scaling matrix control Taken from https://patchwork.linuxtv.org/patch/60728/ Changes (mainly documentation) have been requested. @@ -142593,10 +142649,10 @@ index a3b650ab00f6..3cf7da003cd9 100644 2.18.4 -From e3f4c7c3cec86c95cc0fd987f05fbd665b8e4421 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Fri, 13 Dec 2019 17:04:27 +0100 -Subject: [PATCH 200/834] media: uapi: hevc: Add segment address field +Subject: [PATCH 201/889] media: uapi: hevc: Add segment address field From https://patchwork.linuxtv.org/patch/60725/ Changes requested, but mainly docs. @@ -142662,10 +142718,10 @@ index 3cf7da003cd9..ffc701e268eb 100644 2.18.4 -From 5c73dd2a18b3e7ee4a6c2732b09ba0b8f35a90f1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 23 Mar 2020 19:00:17 +0000 -Subject: [PATCH 201/834] media: uapi: Add hevc ctrls for WPP decoding +Subject: [PATCH 202/889] media: uapi: Add hevc ctrls for WPP decoding WPP can allow greater parallelism within the decode, but needs offset information to be passed in. @@ -142708,10 +142764,10 @@ index ffc701e268eb..6a4901d7caf3 100644 2.18.4 -From f562dd7da81518a57ec921e43715001bf8ed1a0a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 24 Jan 2020 14:28:21 +0000 -Subject: [PATCH 202/834] media: videodev2.h: Add a format for column YUV4:2:0 +Subject: [PATCH 203/889] media: videodev2.h: Add a format for column YUV4:2:0 modes Some of the Broadcom codec blocks use a column based YUV4:2:0 image @@ -143025,292 +143081,10 @@ index 56c443cc2c3d..568801746d2d 100644 2.18.4 -From efff4f25b4b8eb0c98f1653c3de8d8800eb43aec Mon Sep 17 00:00:00 2001 -From: John Cox -Date: Thu, 5 Mar 2020 14:46:54 +0000 -Subject: [PATCH 203/834] media: v4l2-mem2mem: allow request job buffer - processing after job finish - -Allow the capture buffer to be detached from a v4l2 request job such -that another job can start before the capture buffer is returned. This -allows h/w codecs that can process multiple requests at the same time -to operate more efficiently. - -Signed-off-by: John Cox ---- - drivers/media/v4l2-core/v4l2-mem2mem.c | 104 +++++++++++++++++++++++-- - include/media/v4l2-mem2mem.h | 47 +++++++++++ - include/media/videobuf2-v4l2.h | 3 + - 3 files changed, 148 insertions(+), 6 deletions(-) - -diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c -index b221b4e438a1..34dd8ba5469f 100644 ---- a/drivers/media/v4l2-core/v4l2-mem2mem.c -+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c -@@ -416,15 +416,18 @@ static void v4l2_m2m_cancel_job(struct v4l2_m2m_ctx *m2m_ctx) - { - struct v4l2_m2m_dev *m2m_dev; - unsigned long flags; -+ bool det_abort_req; - - m2m_dev = m2m_ctx->m2m_dev; - spin_lock_irqsave(&m2m_dev->job_spinlock, flags); - -+ det_abort_req = !list_empty(&m2m_ctx->det_list); - m2m_ctx->job_flags |= TRANS_ABORT; - if (m2m_ctx->job_flags & TRANS_RUNNING) { - spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags); - if (m2m_dev->m2m_ops->job_abort) - m2m_dev->m2m_ops->job_abort(m2m_ctx->priv); -+ det_abort_req = false; - dprintk("m2m_ctx %p running, will wait to complete\n", m2m_ctx); - wait_event(m2m_ctx->finished, - !(m2m_ctx->job_flags & TRANS_RUNNING)); -@@ -438,6 +441,11 @@ static void v4l2_m2m_cancel_job(struct v4l2_m2m_ctx *m2m_ctx) - /* Do nothing, was not on queue/running */ - spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags); - } -+ -+ /* Wait for detached buffers to come back too */ -+ if (det_abort_req && m2m_dev->m2m_ops->job_abort) -+ m2m_dev->m2m_ops->job_abort(m2m_ctx->priv); -+ wait_event(m2m_ctx->det_empty, list_empty(&m2m_ctx->det_list)); - } - - /* -@@ -475,6 +483,7 @@ static bool _v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev, - - list_del(&m2m_dev->curr_ctx->queue); - m2m_dev->curr_ctx->job_flags &= ~(TRANS_QUEUED | TRANS_RUNNING); -+ m2m_ctx->cap_detached = false; - wake_up(&m2m_dev->curr_ctx->finished); - m2m_dev->curr_ctx = NULL; - return true; -@@ -502,6 +511,80 @@ void v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev, - } - EXPORT_SYMBOL(v4l2_m2m_job_finish); - -+struct vb2_v4l2_buffer *_v4l2_m2m_cap_buf_detach(struct v4l2_m2m_ctx *m2m_ctx) -+{ -+ struct vb2_v4l2_buffer *buf; -+ -+ buf = v4l2_m2m_dst_buf_remove(m2m_ctx); -+ list_add_tail(&container_of(buf, struct v4l2_m2m_buffer, vb)->list, -+ &m2m_ctx->det_list); -+ m2m_ctx->cap_detached = true; -+ buf->is_held = true; -+ buf->det_state = VB2_BUF_STATE_ACTIVE; -+ -+ return buf; -+} -+ -+struct vb2_v4l2_buffer *v4l2_m2m_cap_buf_detach(struct v4l2_m2m_dev *m2m_dev, -+ struct v4l2_m2m_ctx *m2m_ctx) -+{ -+ unsigned long flags; -+ struct vb2_v4l2_buffer *src_buf, *dst_buf; -+ -+ spin_lock_irqsave(&m2m_dev->job_spinlock, flags); -+ -+ dst_buf = NULL; -+ src_buf = v4l2_m2m_next_src_buf(m2m_ctx); -+ -+ if (!(src_buf->flags & V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF) && -+ !m2m_ctx->cap_detached) -+ dst_buf = _v4l2_m2m_cap_buf_detach(m2m_ctx); -+ -+ spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags); -+ return dst_buf; -+} -+EXPORT_SYMBOL(v4l2_m2m_cap_buf_detach); -+ -+static void _v4l2_m2m_cap_buf_return(struct v4l2_m2m_ctx *m2m_ctx, -+ struct vb2_v4l2_buffer *buf, -+ enum vb2_buffer_state state) -+{ -+ buf->det_state = state; -+ -+ /* -+ * Always signal done in the order we got stuff -+ * Stop if we find a buf that is still in use -+ */ -+ while (!list_empty(&m2m_ctx->det_list)) { -+ buf = &list_first_entry(&m2m_ctx->det_list, -+ struct v4l2_m2m_buffer, list)->vb; -+ state = buf->det_state; -+ if (state != VB2_BUF_STATE_DONE && -+ state != VB2_BUF_STATE_ERROR) -+ return; -+ list_del(&container_of(buf, struct v4l2_m2m_buffer, vb)->list); -+ buf->det_state = VB2_BUF_STATE_DEQUEUED; -+ v4l2_m2m_buf_done(buf, state); -+ } -+ wake_up(&m2m_ctx->det_empty); -+} -+ -+void v4l2_m2m_cap_buf_return(struct v4l2_m2m_dev *m2m_dev, -+ struct v4l2_m2m_ctx *m2m_ctx, -+ struct vb2_v4l2_buffer *buf, -+ enum vb2_buffer_state state) -+{ -+ unsigned long flags; -+ -+ if (!buf) -+ return; -+ -+ spin_lock_irqsave(&m2m_dev->job_spinlock, flags); -+ _v4l2_m2m_cap_buf_return(m2m_ctx, buf, state); -+ spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags); -+} -+EXPORT_SYMBOL(v4l2_m2m_cap_buf_return); -+ - void v4l2_m2m_buf_done_and_job_finish(struct v4l2_m2m_dev *m2m_dev, - struct v4l2_m2m_ctx *m2m_ctx, - enum vb2_buffer_state state) -@@ -512,14 +595,21 @@ void v4l2_m2m_buf_done_and_job_finish(struct v4l2_m2m_dev *m2m_dev, - - spin_lock_irqsave(&m2m_dev->job_spinlock, flags); - src_buf = v4l2_m2m_src_buf_remove(m2m_ctx); -- dst_buf = v4l2_m2m_next_dst_buf(m2m_ctx); - -- if (WARN_ON(!src_buf || !dst_buf)) -+ if (WARN_ON(!src_buf)) - goto unlock; -- dst_buf->is_held = src_buf->flags & V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF; -- if (!dst_buf->is_held) { -- v4l2_m2m_dst_buf_remove(m2m_ctx); -- v4l2_m2m_buf_done(dst_buf, state); -+ if (!m2m_ctx->cap_detached) { -+ dst_buf = v4l2_m2m_next_dst_buf(m2m_ctx); -+ if (WARN_ON(!dst_buf)) -+ goto unlock; -+ -+ dst_buf->is_held = src_buf->flags -+ & V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF; -+ -+ if (!dst_buf->is_held) { -+ dst_buf = _v4l2_m2m_cap_buf_detach(m2m_ctx); -+ _v4l2_m2m_cap_buf_return(m2m_ctx, dst_buf, state); -+ } - } - /* - * If the request API is being used, returning the OUTPUT -@@ -1167,12 +1257,14 @@ struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(struct v4l2_m2m_dev *m2m_dev, - m2m_ctx->priv = drv_priv; - m2m_ctx->m2m_dev = m2m_dev; - init_waitqueue_head(&m2m_ctx->finished); -+ init_waitqueue_head(&m2m_ctx->det_empty); - - out_q_ctx = &m2m_ctx->out_q_ctx; - cap_q_ctx = &m2m_ctx->cap_q_ctx; - - INIT_LIST_HEAD(&out_q_ctx->rdy_queue); - INIT_LIST_HEAD(&cap_q_ctx->rdy_queue); -+ INIT_LIST_HEAD(&m2m_ctx->det_list); - spin_lock_init(&out_q_ctx->rdy_spinlock); - spin_lock_init(&cap_q_ctx->rdy_spinlock); - -diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h -index 5a91b548ecc0..8ccb17d881ad 100644 ---- a/include/media/v4l2-mem2mem.h -+++ b/include/media/v4l2-mem2mem.h -@@ -92,6 +92,9 @@ struct v4l2_m2m_queue_ctx { - * %TRANS_QUEUED, %TRANS_RUNNING and %TRANS_ABORT. - * @finished: Wait queue used to signalize when a job queue finished. - * @priv: Instance private data -+ * @cap_detached: Current job's capture buffer has been detached -+ * @det_list: List of detached (post-job but still in flight) capture buffers -+ * @det_empty: Wait queue signalled when det_list goes empty - * - * The memory to memory context is specific to a file handle, NOT to e.g. - * a device. -@@ -120,6 +123,11 @@ struct v4l2_m2m_ctx { - wait_queue_head_t finished; - - void *priv; -+ -+ /* Detached buffer handling */ -+ bool cap_detached; -+ struct list_head det_list; -+ wait_queue_head_t det_empty; - }; - - /** -@@ -326,6 +334,45 @@ void v4l2_m2m_suspend(struct v4l2_m2m_dev *m2m_dev); - */ - void v4l2_m2m_resume(struct v4l2_m2m_dev *m2m_dev); - -+/** -+ * v4l2_m2m_cap_buf_detach() - detach the capture buffer from the job and -+ * return it. -+ * -+ * @m2m_dev: opaque pointer to the internal data to handle M2M context -+ * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx -+ * -+ * This function is designed to be used in conjunction with -+ * v4l2_m2m_buf_done_and_job_finish(). It allows the next job to start -+ * execution before the capture buffer is returned to the user which can be -+ * important if the underlying processing has multiple phases that are more -+ * efficiently executed in parallel. -+ * -+ * If used then it must be called before v4l2_m2m_buf_done_and_job_finish() -+ * as otherwise the buffer will have already gone. -+ * -+ * It is the callers reponsibilty to ensure that all detached buffers are -+ * returned. -+ */ -+struct vb2_v4l2_buffer *v4l2_m2m_cap_buf_detach(struct v4l2_m2m_dev *m2m_dev, -+ struct v4l2_m2m_ctx *m2m_ctx); -+ -+/** -+ * v4l2_m2m_cap_buf_return() - return a capture buffer, previously detached -+ * with v4l2_m2m_cap_buf_detach() to the user. -+ * -+ * @m2m_dev: opaque pointer to the internal data to handle M2M context -+ * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx -+ * @buf: the buffer to return -+ * @state: vb2 buffer state passed to v4l2_m2m_buf_done(). -+ * -+ * Buffers returned by this function will be returned to the user in the order -+ * of the original jobs rather than the order in which this function is called. -+ */ -+void v4l2_m2m_cap_buf_return(struct v4l2_m2m_dev *m2m_dev, -+ struct v4l2_m2m_ctx *m2m_ctx, -+ struct vb2_v4l2_buffer *buf, -+ enum vb2_buffer_state state); -+ - /** - * v4l2_m2m_reqbufs() - multi-queue-aware REQBUFS multiplexer - * -diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h -index c203047eb834..260593fffbc8 100644 ---- a/include/media/videobuf2-v4l2.h -+++ b/include/media/videobuf2-v4l2.h -@@ -37,6 +37,8 @@ struct video_device; - * @request_fd: the request_fd associated with this buffer - * @is_held: if true, then this capture buffer was held - * @planes: plane information (userptr/fd, length, bytesused, data_offset). -+ * @det_state: if a detached request capture buffer then this contains its -+ * current state - * - * Should contain enough information to be able to cover all the fields - * of &struct v4l2_buffer at ``videodev2.h``. -@@ -51,6 +53,7 @@ struct vb2_v4l2_buffer { - __s32 request_fd; - bool is_held; - struct vb2_plane planes[VB2_MAX_PLANES]; -+ enum vb2_buffer_state det_state; - }; - - /* VB2 V4L2 flags as set in vb2_queue.subsystem_flags */ --- -2.18.4 - - -From 0bd74f6d2651e4b2075890a2243d7f84526e8770 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 17 Mar 2020 10:53:16 +0000 -Subject: [PATCH 204/834] media: dt-bindings: media: Add binding for the +Subject: [PATCH 204/889] media: dt-bindings: media: Add binding for the Raspberry PI HEVC decoder Adds a binding for the HEVC decoder found on the BCM2711 / Raspberry Pi 4. @@ -143422,10 +143196,10 @@ index cbfee297e9f9..b5113e381d78 100644 2.18.4 -From 026eb6b73c8ffb3083a595c1472394c548f5beb5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 5 Mar 2020 18:30:41 +0000 -Subject: [PATCH 205/834] staging: media: Add Raspberry Pi V4L2 H265 decoder +Subject: [PATCH 205/889] staging: media: Add Raspberry Pi V4L2 H265 decoder This driver is for the HEVC/H265 decoder block on the Raspberry Pi 4, and conforms to the V4L2 stateless decoder API. @@ -147804,10 +147578,10 @@ index 000000000000..9c4f3fb2f9f6 2.18.4 -From 0aeb69d867f84dcd2fc84de84f7f1d138bc77059 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 6 Dec 2019 13:05:27 +0100 -Subject: [PATCH 206/834] mmc: sdhci: Silence MMC warnings +Subject: [PATCH 206/889] 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. @@ -147818,7 +147592,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c -index 6cdadbb3accd..79fe26a04bfe 100644 +index b1e1d327cb8e..30d5f2debfd9 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -41,7 +41,7 @@ @@ -147830,7 +147604,7 @@ index 6cdadbb3accd..79fe26a04bfe 100644 #define MAX_TUNING_LOOP 40 -@@ -3126,7 +3126,7 @@ static void sdhci_timeout_timer(struct timer_list *t) +@@ -3127,7 +3127,7 @@ static void sdhci_timeout_timer(struct timer_list *t) spin_lock_irqsave(&host->lock, flags); if (host->cmd && !sdhci_data_line_cmd(host->cmd)) { @@ -147839,7 +147613,7 @@ index 6cdadbb3accd..79fe26a04bfe 100644 mmc_hostname(host->mmc)); sdhci_dumpregs(host); -@@ -3148,7 +3148,7 @@ static void sdhci_timeout_data_timer(struct timer_list *t) +@@ -3149,7 +3149,7 @@ static void sdhci_timeout_data_timer(struct timer_list *t) if (host->data || host->data_cmd || (host->cmd && sdhci_data_line_cmd(host->cmd))) { @@ -147852,10 +147626,10 @@ index 6cdadbb3accd..79fe26a04bfe 100644 2.18.4 -From cc310779f9a9fa1e69373f49b55364f5088640b9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 13 Feb 2020 17:51:09 +0100 -Subject: [PATCH 207/834] dt-bindings: clock: Add a binding for the RPi +Subject: [PATCH 207/889] dt-bindings: clock: Add a binding for the RPi Firmware clocks The firmare running on the RPi VideoCore can be used to discover and @@ -147922,10 +147696,10 @@ index 000000000000..d37bc311321d 2.18.4 -From a93fef13dd83aacb4c905674d9cdebd8e70f6b8a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 13 Feb 2020 16:45:24 +0100 -Subject: [PATCH 208/834] dt-bindings: display: vc4: hdmi: Add BCM2711 HDMI +Subject: [PATCH 208/889] dt-bindings: display: vc4: hdmi: Add BCM2711 HDMI controllers bindings The HDMI controllers found in the BCM2711 SoC need some adjustments to the @@ -148102,10 +147876,10 @@ index f54b4e4808f0..899d8cfa1731 100644 2.18.4 -From 3b4bc04a8330f3fe241463a9976fed356b5afe13 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 27 Jan 2020 10:22:44 +0000 -Subject: [PATCH 209/834] drm: Checking of the pitch is only valid for linear +Subject: [PATCH 209/889] drm: Checking of the pitch is only valid for linear formats framebuffer_check was computing a minimum pitch value and ensuring @@ -148148,40 +147922,10 @@ index 2f5b0c2bb0fe..89ced6af9c5c 100644 2.18.4 -From 6c4c3e9a3e7be19a43a03cc8f13ab7a460c8ebfa Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 8 Apr 2020 11:59:39 +0100 -Subject: [PATCH 210/834] 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(+) - -diff --git a/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts b/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts -index 63231b5d7c0c..2323a61edf07 100644 ---- 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"; --- -2.18.4 - - -From f34c1568de323c1f4a9ce685c1dc1b49c456f876 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Apr 2020 22:18:52 +0100 -Subject: [PATCH 211/834] driver: char: rpivid: Remove legacy name support +Subject: [PATCH 210/889] driver: char: rpivid: Remove legacy name support Signed-off-by: Phil Elwell --- @@ -148237,10 +147981,10 @@ index fbf3d4f3fe0c..5f4c91924ec1 100644 2.18.4 -From 51ad8fc29e6f3fc03e4dff71649c4c940f63d6ec Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Apr 2020 10:46:19 +0100 -Subject: [PATCH 212/834] spi: Force CS_HIGH if GPIO descriptors are used +Subject: [PATCH 211/889] spi: Force CS_HIGH if GPIO descriptors are used Commit f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs") amended of_spi_parse_dt() to always set SPI_CS_HIGH for SPI slaves whose @@ -148300,10 +148044,10 @@ index 8c261eac2cee..4436fd319df3 100644 2.18.4 -From 24992e956cd09a7b712ad42453d237859823d189 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 21 Apr 2020 11:30:23 +0100 -Subject: [PATCH 213/834] driver: char: rpivid: Don't map more than wanted +Subject: [PATCH 212/889] driver: char: rpivid: Don't map more than wanted Limit mappings to the permitted range, but don't map more than asked for otherwise we walk off the end of the allocated VMA. @@ -148357,10 +148101,10 @@ index 5f4c91924ec1..9f38083f4cb6 100644 2.18.4 -From ea4f95d1df45911572355840a765a7026ef97165 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 1 Apr 2020 08:39:49 +0100 -Subject: [PATCH 214/834] media: bcm2835-unicam: Driver for CCP2/CSI2 camera +Subject: [PATCH 213/889] media: bcm2835-unicam: Driver for CCP2/CSI2 camera interface Add driver for the Unicam camera receiver block on @@ -151088,10 +150832,10 @@ index 000000000000..ae059a171d0f 2.18.4 -From f3e412214d36783d50db6f393ca02bb5f7bfe818 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 1 Apr 2020 08:46:29 +0100 -Subject: [PATCH 215/834] media: uapi: v4l2-core: Add sensor ancillary data +Subject: [PATCH 214/889] media: uapi: v4l2-core: Add sensor ancillary data V4L2 foucc type. Add V4L2_META_FMT_SENSOR_DATA format 4CC. @@ -151186,10 +150930,10 @@ index 568801746d2d..d93d5bb7059b 100644 2.18.4 -From b6782dfed39f72ab2b7e3e0c19cc2b9345ab6c0f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 21 Jan 2020 14:06:47 +0000 -Subject: [PATCH 216/834] media: uapi: Add MEDIA_BUS_FMT_SENSOR_DATA media bus +Subject: [PATCH 215/889] media: uapi: Add MEDIA_BUS_FMT_SENSOR_DATA media bus format This patch adds MEDIA_BUS_FMT_SENSOR_DATA used by the bcm2835-unicam @@ -151258,10 +151002,10 @@ index 84fa53ffb13f..3c2848e91c1b 100644 2.18.4 -From 812e9d193ca7916f0f48ab795426837061db7ca3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 7 Apr 2020 10:42:14 +0100 -Subject: [PATCH 217/834] media: bcm2835-unicam: Add support for mulitple +Subject: [PATCH 216/889] media: bcm2835-unicam: Add support for mulitple device nodes. Move device node specific state out of the device state structure and @@ -152347,10 +152091,10 @@ index 9da9f22c3db5..b34551a3f44b 100644 2.18.4 -From 151ccc747d74dd814c387aa690c5277150348ad1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 16 Apr 2020 11:35:41 +0100 -Subject: [PATCH 218/834] media: bcm2835-unicam: Add embedded data node. +Subject: [PATCH 217/889] media: bcm2835-unicam: Add embedded data node. This patch adds a new node in the bcm2835-unicam driver to support CSI-2 embedded data streams. The subdevice is queried to see if @@ -153521,10 +153265,10 @@ index b34551a3f44b..d5e0f70b600c 100644 2.18.4 -From 5c12e94755c13c81778cc712354c84604afadad7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 2 Apr 2020 16:08:51 +0100 -Subject: [PATCH 219/834] media: bcm2835-unicam: Use dummy buffer if none have +Subject: [PATCH 218/889] media: bcm2835-unicam: Use dummy buffer if none have been queued If no buffer has been queued by a userland application, we use an @@ -153835,10 +153579,10 @@ index d5e0f70b600c..933f1ba49e3d 100644 2.18.4 -From 42769244d4c515b0ea0217c17c3ae38553369a0d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 24 Mar 2020 23:13:02 +0200 -Subject: [PATCH 220/834] media: bcm2835-unicam: Disable event-related ioctls +Subject: [PATCH 219/889] media: bcm2835-unicam: Disable event-related ioctls on metadata node The unicam driver supports both the SOURCE_CHANGE and CTRL events. Both @@ -153872,10 +153616,10 @@ index 933f1ba49e3d..2d4c7a247fc5 100644 2.18.4 -From c0b6101f7e560426cb827ccf49c58dc59ee379a3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 24 Mar 2020 23:13:02 +0200 -Subject: [PATCH 221/834] media: bcm2835-unicam: Add support for the FRAME_SYNC +Subject: [PATCH 220/889] media: bcm2835-unicam: Add support for the FRAME_SYNC event The FRAME_SYNC event is useful for userspace image processing algorithms @@ -153933,10 +153677,10 @@ index 2d4c7a247fc5..21d3a8585118 100644 2.18.4 -From c9a5257475a61669eb83a2ba2e0c327811cd4e88 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 12 Mar 2020 14:09:38 +0000 -Subject: [PATCH 222/834] media: imx219: Advertise embedded data node on media +Subject: [PATCH 221/889] media: imx219: Advertise embedded data node on media pad 1 This commit updates the imx219 driver to adverise support for embedded @@ -154275,10 +154019,10 @@ index 4771d0ef2c46..5af610f7fc08 100644 2.18.4 -From d7fb471bf3df03bc043c9c4b4db095255b12cfef Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 21 Apr 2020 16:26:03 +0100 -Subject: [PATCH 223/834] media: bcm2835-unicam: Re-fetch mbus code from subdev +Subject: [PATCH 222/889] media: bcm2835-unicam: Re-fetch mbus code from subdev on a g_fmt call The sensor subdevice may change the Bayer order if a H/V flip is @@ -154330,10 +154074,10 @@ index 21d3a8585118..d4684fb2797f 100644 2.18.4 -From baeaaa3a4ad6a58521283861ed5958d1e6e66992 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 23 Apr 2020 10:20:26 +0100 -Subject: [PATCH 224/834] media: uapi: v4l2-core: Add ISP statistics output +Subject: [PATCH 223/889] media: uapi: v4l2-core: Add ISP statistics output V4L2 fourcc type Add V4L2_META_FMT_BCM2835_ISP_STATS V4L2 format type. @@ -154437,10 +154181,10 @@ index d93d5bb7059b..e9fbb04a3519 100644 2.18.4 -From 900a8760221663fee91ca2a395878941568e2cc4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 21 Apr 2020 15:06:19 +0100 -Subject: [PATCH 225/834] media: uapi: v4l-ctrls: Add CID base for the +Subject: [PATCH 224/889] media: uapi: v4l-ctrls: Add CID base for the bcm2835-isp driver We are reserving controls for the new bcm2835-isp driver. @@ -154617,10 +154361,10 @@ index fbe96b80a748..0b8ae128b961 100644 2.18.4 -From 1139335e6c9cdcbbfe4c444c74228bb7f43c7079 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 22 Apr 2020 08:32:32 +0100 -Subject: [PATCH 226/834] staging: vchiq: Load bcm2835_isp driver from vchiq +Subject: [PATCH 225/889] staging: vchiq: Load bcm2835_isp driver from vchiq bcmn2835_isp is a platform driver dependent on vchiq, therefore add the load/unload functions for it to vchiq. @@ -154662,10 +154406,10 @@ index 8d518bd9a6cd..08083aa61808 100644 2.18.4 -From d13df4f58bb450663599ba0091affe27c551fe51 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 4 Apr 2019 13:33:47 +0100 -Subject: [PATCH 227/834] bcm2835-dma: Add proper 40-bit DMA support +Subject: [PATCH 226/889] bcm2835-dma: Add proper 40-bit DMA support BCM2711 has 4 DMA channels with a 40-bit address range, allowing them to access the full 4GB of memory on a Pi 4. @@ -155468,48 +155212,10 @@ index 87b5d0bef355..ac0458a8027f 100644 2.18.4 -From 439d079c314e940b2bca9ae029ae18aead9a46a6 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 1 May 2020 17:56:13 +0100 -Subject: [PATCH 228/834] 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(-) - -diff --git a/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts b/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts -index 2323a61edf07..63231b5d7c0c 100644 ---- 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"; --- -2.18.4 - - -From f1f7b2ff345e42400e40d304f8ad5b4f75cf4250 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 20 Apr 2020 11:01:21 +0100 -Subject: [PATCH 229/834] media: i2c: imx219: Declare that the driver can +Subject: [PATCH 227/889] media: i2c: imx219: Declare that the driver can create events The flag V4L2_SUBDEV_FL_HAS_EVENTS is required if the subdev can @@ -155539,10 +155245,10 @@ index 5af610f7fc08..79faa8cce94e 100644 2.18.4 -From eb663bd20c53425cf721ab2e1c2abaf8a59eeb3b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 15 Jan 2020 13:40:38 +0000 -Subject: [PATCH 230/834] media: ov5647: Fix return codes from +Subject: [PATCH 228/889] media: ov5647: Fix return codes from ov5647_write/ov5647_read functions. Previously they were returning positive non-zero codes for success, @@ -155619,10 +155325,10 @@ index 07550377be2e..6ecc018ac431 100644 2.18.4 -From 0e80951f436bc241e1df6e3cec4276d62d525712 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 29 Jan 2020 15:30:53 +0000 -Subject: [PATCH 231/834] media: ov5647: Add basic support for multiple sensor +Subject: [PATCH 229/889] media: ov5647: Add basic support for multiple sensor modes. Specifically: @@ -156032,10 +155738,10 @@ index 6ecc018ac431..0d84b7640cf3 100644 2.18.4 -From 6aef36538f8f70444ca119306d781eb4a9fdc992 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 29 Jan 2020 15:31:23 +0000 -Subject: [PATCH 232/834] media: ov5647: Add V4L2 controls for analogue gain, +Subject: [PATCH 230/889] media: ov5647: Add V4L2 controls for analogue gain, exposure and AWB Added basic v4l2_ctrl_handler infrastructure (there was none @@ -156315,10 +156021,10 @@ index 0d84b7640cf3..16cfafc9cf9c 100644 2.18.4 -From e0e750144eea5aead8ce4230563ca6d74baeff0e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 29 Jan 2020 15:31:28 +0000 -Subject: [PATCH 233/834] media: ov5647: Add extra 10-bit sensor modes. +Subject: [PATCH 231/889] media: ov5647: Add extra 10-bit sensor modes. The 8-bit VGA mode remains, we add the following 10-bit modes: @@ -156870,10 +156576,10 @@ index 16cfafc9cf9c..fc6c5d9c4532 100644 2.18.4 -From 42fc41d94248efff8e580e9b0815ff6492898cbc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 29 Jan 2020 15:31:32 +0000 -Subject: [PATCH 234/834] media: ov5647: change defaults to better match raw +Subject: [PATCH 232/889] media: ov5647: change defaults to better match raw camera applications. Specifically: @@ -156935,10 +156641,10 @@ index fc6c5d9c4532..66b3ee5cc190 100644 2.18.4 -From 6ca2ffffe31386dd5f5b5f511b935a501f237117 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Apr 2020 11:46:07 +0100 -Subject: [PATCH 235/834] media: i2c: ov5647: Add support for g_selection to +Subject: [PATCH 233/889] 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 @@ -157147,10 +156853,10 @@ index 66b3ee5cc190..e7c7e3ab4b38 100644 2.18.4 -From c5afc3cdb502aeb9638f69a165e0bcdf76c5f038 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Apr 2020 11:50:52 +0100 -Subject: [PATCH 236/834] media: i2c: ov5467: Fixup error path to release mutex +Subject: [PATCH 234/889] 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 @@ -157182,10 +156888,10 @@ index e7c7e3ab4b38..09d68b0b4a13 100644 2.18.4 -From bd45f7c4460f66070cde0e9c0bb310221e46d3a9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Apr 2020 12:25:13 +0100 -Subject: [PATCH 237/834] media: i2c: ov5647: Support V4L2_CID_PIXEL_RATE +Subject: [PATCH 235/889] media: i2c: ov5647: Support V4L2_CID_PIXEL_RATE Clients need to know the pixel rate in order to compute exposure and frame rate values. @@ -157319,10 +157025,10 @@ index 09d68b0b4a13..02d72feb837e 100644 2.18.4 -From 665df16aed4bf10975c9b5f53ed97af316b615e2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Apr 2020 17:25:56 +0100 -Subject: [PATCH 238/834] media: i2c: ov5647: Set V4L2_SUBDEV_FL_HAS_EVENTS +Subject: [PATCH 236/889] media: i2c: ov5647: Set V4L2_SUBDEV_FL_HAS_EVENTS flag The ov5647 subdev can generate control events, therefore set @@ -157468,10 +157174,10 @@ index 02d72feb837e..c012e0b3d68b 100644 2.18.4 -From a51d5580b219abb0cfa5fa149799f56ddab058ab Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Apr 2020 21:39:58 +0100 -Subject: [PATCH 239/834] media: i2c: ov5647: Add support for V4L2_CID_VBLANK +Subject: [PATCH 237/889] media: i2c: ov5647: Add support for V4L2_CID_VBLANK Adds vblank control to allow for frame rate control. @@ -157679,10 +157385,10 @@ index c012e0b3d68b..445a0ce186ec 100644 2.18.4 -From d20ca7affc6424e0b2bc8b9f7ea6b5ae3fd70d00 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Apr 2020 21:47:25 +0100 -Subject: [PATCH 240/834] media: i2c: ov5647: Neither analogue gain nor +Subject: [PATCH 238/889] media: i2c: ov5647: Neither analogue gain nor exposure need EXECUTE_ON_WRITE The controls for analogue gain and exposure were defined with @@ -157743,10 +157449,10 @@ index 445a0ce186ec..49247711221c 100644 2.18.4 -From 6c26e166db20814a5317a321d5ff2f0defe68712 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Apr 2020 22:11:01 +0100 -Subject: [PATCH 241/834] media: i2c: ov5647: Use member names in mode tables +Subject: [PATCH 239/889] 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. @@ -157860,10 +157566,10 @@ index 49247711221c..da4ef30d8f32 100644 2.18.4 -From 3401db6a6746567487b2c68bc71aa0a5ba59c459 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 30 Apr 2020 11:03:00 +0100 -Subject: [PATCH 242/834] media: i2c: ov5647: Advertise the correct exposure +Subject: [PATCH 240/889] media: i2c: ov5647: Advertise the correct exposure range Exposure is clipped by the VTS of the mode, so needs to be updated as @@ -157985,10 +157691,10 @@ index da4ef30d8f32..6d84d2785f74 100644 2.18.4 -From 751e5f6e994806952e38b409792c447e422ff2a9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Apr 2020 16:45:02 +0100 -Subject: [PATCH 243/834] media: bcm2835-unicam: Add support for +Subject: [PATCH 241/889] media: bcm2835-unicam: Add support for VIDIOC_[S|G]_SELECTION Sensors are now reflecting cropping and scaling parameters through @@ -158073,10 +157779,10 @@ index d4684fb2797f..0e1d525a0b35 100644 2.18.4 -From a62face418eebc77442025a46528c62ef35e95ed Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Apr 2020 22:05:09 +0100 -Subject: [PATCH 244/834] media: bcm2835-unicam: Do not stop streaming in +Subject: [PATCH 242/889] media: bcm2835-unicam: Do not stop streaming in unicam_release unicam_release calls _vb2_fop_release, which will call stop_streaming @@ -158107,10 +157813,10 @@ index 0e1d525a0b35..c7e211d04ed3 100644 2.18.4 -From 4a6ce618ce601861d8fec64a6fff720c3ecfdff6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 30 Apr 2020 09:52:50 +0100 -Subject: [PATCH 245/834] media: bcm2835-unicam: Fix reference counting in +Subject: [PATCH 243/889] media: bcm2835-unicam: Fix reference counting in unicam_open The reference counting of node->open was only incremented after @@ -158151,10 +157857,10 @@ index c7e211d04ed3..a79fc4d99d36 100644 2.18.4 -From 590b976020dc820e5e47c9e3d7d0e202609d5819 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jacko Dirks Date: Tue, 5 May 2020 14:28:14 +0200 -Subject: [PATCH 246/834] media: i2c: tc358743: Fix fallthrough warning +Subject: [PATCH 244/889] media: i2c: tc358743: Fix fallthrough warning Signed-off-by: Jacko Dirks --- @@ -158177,10 +157883,10 @@ index b77b900bf6ad..ee6779a81d43 100644 2.18.4 -From fd60d4de54242308cd0fa6dcaadf6a625bc94c26 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jacko Dirks Date: Tue, 5 May 2020 14:33:31 +0200 -Subject: [PATCH 247/834] media: bcm2835: unicam: Fix uninitialized warning +Subject: [PATCH 245/889] media: bcm2835: unicam: Fix uninitialized warning Signed-off-by: Jacko Dirks --- @@ -158204,10 +157910,10 @@ index a79fc4d99d36..92e5deb4c6fd 100644 2.18.4 -From 9a8e9844ce2a1b54980127bfbe33565d13257e1f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 5 May 2020 19:45:41 +0100 -Subject: [PATCH 248/834] video: bcm2708_fb: Disable FB if no displays found +Subject: [PATCH 246/889] video: bcm2708_fb: Disable FB if no displays found If the firmware hasn't detected a display, the driver would assume one display was available, but because it had failed to retrieve the @@ -158244,10 +157950,10 @@ index 17e9260655e4..dac5c021ce52 100644 2.18.4 -From 97b7115db69be89be7bb9255161ac6d227c925ad Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 7 May 2020 15:50:54 +0100 -Subject: [PATCH 249/834] dt-bindings: media: i2c: Add IMX477 CMOS sensor +Subject: [PATCH 247/889] dt-bindings: media: i2c: Add IMX477 CMOS sensor binding Add YAML device tree binding for IMX477 CMOS image sensor. @@ -158381,10 +158087,10 @@ index 000000000000..0994e13e67f6 2.18.4 -From 873af85d0a0f03f805bce217ce3f968d089aa8b5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 13 May 2020 18:28:27 +0100 -Subject: [PATCH 250/834] media: bcm2835-unicam: Always service interrupts +Subject: [PATCH 248/889] media: bcm2835-unicam: Always service interrupts From when bringing up the driver, there was a check in the isr to ignore interrupts (claiming them handled) should the driver @@ -158438,10 +158144,10 @@ index 92e5deb4c6fd..52a534d932bf 100644 2.18.4 -From 11d7b1bbd63d2f1402bb562c7f4deb5ad5dcbf1f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 13 May 2020 20:10:15 +0100 -Subject: [PATCH 251/834] sc16is7xx: Fix for hardware flow control +Subject: [PATCH 249/889] sc16is7xx: Fix for hardware flow control The SC16IS7XX hardware flow control is mishandled by the driver in a number of ways: @@ -158514,10 +158220,10 @@ index f64e051c0030..8e3b83fac33c 100644 2.18.4 -From ed346efadcbd8fcde9903a9065a164d21f99efa7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 15 May 2020 13:42:10 +0100 -Subject: [PATCH 252/834] staging: vc04_services: mmal-vchiq: Update parameters +Subject: [PATCH 250/889] staging: vc04_services: mmal-vchiq: Update parameters list Adds in a couple of new MMAL parameter defines. @@ -158548,10 +158254,10 @@ index 27bafc5f01d2..89059bca0b77 100644 2.18.4 -From fd8bc06352e89a3e67c091a66e20d01b1be812b2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 15 May 2020 13:48:59 +0100 -Subject: [PATCH 253/834] staging:vc04_services: bcm2835-camera: Request +Subject: [PATCH 251/889] staging:vc04_services: bcm2835-camera: Request headers with I-frame V4L2 wishes to have the codec header bytes in the same buffer as the @@ -158584,10 +158290,10 @@ index df90c1f9d148..bea37cb163fc 100644 2.18.4 -From a1a11cacba1c0f3198bfedf3163dbf75579f9c03 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 8 Apr 2020 15:23:56 +0100 -Subject: [PATCH 254/834] kbuild: Disable gcc plugins +Subject: [PATCH 252/889] kbuild: Disable gcc plugins The GCC plugin feature leads to different kernel configurations on what ought to be equivalent build systems because they depend on the build @@ -158618,10 +158324,10 @@ index b79fd0bea838..c3d0c8fedbdd 100755 2.18.4 -From 7f6022762c435e2d72179a0131e640ad6161e695 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 19 May 2020 11:46:47 +0100 -Subject: [PATCH 255/834] media: bcm2835-unicam: Retain packing information on +Subject: [PATCH 253/889] media: bcm2835-unicam: Retain packing information on G_FMT The change to retrieve the pixel format always on g_fmt didn't @@ -158672,10 +158378,10 @@ index 52a534d932bf..b32b2d33a4e2 100644 2.18.4 -From fdfc6b3a34626cf69f8c2f42196708e00059b4ff Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 5 May 2020 15:23:32 +0100 -Subject: [PATCH 256/834] zswap: Defer zswap initialisation +Subject: [PATCH 254/889] zswap: Defer zswap initialisation Enabling zswap support in the kernel configuration costs about 1.5MB of RAM, even when zswap is not enabled at runtime. This cost can be @@ -158803,10 +158509,10 @@ index fbb782924ccc..0ca7f6a68d20 100644 2.18.4 -From e379d09083f08d6e0201c18f464378b0546e68fc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 22 May 2020 11:35:33 +0100 -Subject: [PATCH 257/834] SQUASH: pinctrl: bcm2835: Set base for bcm2711 GPIO +Subject: [PATCH 255/889] SQUASH: pinctrl: bcm2835: Set base for bcm2711 GPIO to 0 Without this patch GPIOs don't seem to work properly, primarily @@ -158836,10 +158542,10 @@ index bda29f421e78..c5d88157f4b2 100644 2.18.4 -From e2a0020474d7469e87a8bd77500a52bc6027b6e4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 20 May 2020 16:36:33 +0100 -Subject: [PATCH 258/834] staging: vchiq_arm: Clean up 40-bit DMA support +Subject: [PATCH 256/889] 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- @@ -159018,10 +158724,10 @@ index 08083aa61808..c3ca18e4e85c 100644 2.18.4 -From bb6169f610fb6a56d4c31053e2ce72941124c556 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 28 May 2020 11:09:48 +0100 -Subject: [PATCH 259/834] media: bcm2835-unicam: change minimum number of +Subject: [PATCH 257/889] media: bcm2835-unicam: change minimum number of vb2_queue buffers to 1 Since the unicam driver was modified to write to a dummy buffer when no @@ -159052,10 +158758,10 @@ index b32b2d33a4e2..e76323af0952 100644 2.18.4 -From dc8a9922e651f4fabe4aae787ef8234048db0bdc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 19 May 2020 09:46:12 +0100 -Subject: [PATCH 260/834] brcmfmac: BCM43436 needs dedicated firmware +Subject: [PATCH 258/889] brcmfmac: BCM43436 needs dedicated firmware Signed-off-by: Phil Elwell --- @@ -159088,10 +158794,10 @@ index bfe4b8e5a716..d6a4d6b8ea29 100644 2.18.4 -From a8b9e13586c88cb872648a64f8899bbcf4e05ba5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Fri, 5 Jun 2020 09:22:49 +0000 -Subject: [PATCH 261/834] snd_bcm2835: disable HDMI audio when vc4 is used +Subject: [PATCH 259/889] snd_bcm2835: disable HDMI audio when vc4 is used (#3640) Things don't work too well when both the vc4 driver and the firmware @@ -159127,10 +158833,10 @@ index f926784c622d..31968fec297f 100644 2.18.4 -From 0b750bb1a8601922243b0aa5242ff4965f2e7e33 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Apr 2018 14:42:27 +0100 -Subject: [PATCH 262/834] gpiolib: Don't prevent IRQ usage of output GPIOs +Subject: [PATCH 260/889] gpiolib: Don't prevent IRQ usage of output GPIOs Upstream Linux deems using output GPIOs to generate IRQs as a bogus use case, even though the BCM2835 GPIO controller is capable of doing @@ -159183,10 +158889,10 @@ index af5bb8fedfea..2bd26c985246 100644 2.18.4 -From e023b0b64df19e4d805b40f30ae0a7ac45fbbc0d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 11 Jun 2020 09:57:03 +0100 -Subject: [PATCH 263/834] PCI: brcmstb: Add DT property to control L1SS +Subject: [PATCH 261/889] PCI: brcmstb: Add DT property to control L1SS The BRCM PCIe block has controls to enable control of the CLKREQ# signal by the L1SS, and to gate the refclk with the CLKREQ# input. @@ -159268,10 +158974,10 @@ index 9c3d2982248d..fea54f6fb7b1 100644 2.18.4 -From bbed804441fa0b286d85939f7ba0b787317a5fc7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Proeller Date: Tue, 16 Jun 2020 13:24:31 +0200 -Subject: [PATCH 264/834] media: irs1125: Using i2c_transfer for ic2 reads +Subject: [PATCH 262/889] media: irs1125: Using i2c_transfer for ic2 reads Reading data over i2c is done by using i2c_transfer to ensure that this operation can't be interrupted. @@ -159339,10 +159045,10 @@ index 25e1dd5a08ef..6680afea5894 100644 2.18.4 -From b60ed1625add41fbcd31e2c66c05c625ac9fb505 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Proeller Date: Tue, 16 Jun 2020 13:27:42 +0200 -Subject: [PATCH 265/834] media: irs1125: Refactoring and debug messages +Subject: [PATCH 263/889] media: irs1125: Refactoring and debug messages Changed some variable names to comply with checkpatch --strict mode. Debug messages added. @@ -159468,10 +159174,10 @@ index 6680afea5894..289f0c25b141 100644 2.18.4 -From 325e85dbc9bd1e007d60dbfb3baf2f15c5938e0c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Proeller Date: Tue, 16 Jun 2020 13:31:36 +0200 -Subject: [PATCH 266/834] media: irs1125: Atomic access to imager +Subject: [PATCH 264/889] media: irs1125: Atomic access to imager reconfiguration Instead of changing the exposure and framerate settings for all sequences, @@ -159857,10 +159563,10 @@ index dccaca23aa76..96d676123d5e 100644 2.18.4 -From e7cc0d93403e7c568adf3a9d4862a68c9abd1d8d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Proeller Date: Tue, 16 Jun 2020 13:33:56 +0200 -Subject: [PATCH 267/834] media: irs1125: Keep HW in sync after imager reset +Subject: [PATCH 265/889] media: irs1125: Keep HW in sync after imager reset When closing the video device, the irs1125 is put in power down state. To keep V4L2 ctrls and the HW in sync, v4l2_ctrl_handler_setup is @@ -160044,10 +159750,10 @@ index d59e05004a03..30c3d2640386 100644 2.18.4 -From 580cc0e136dc85a8d762cee2c55fe1d9f68c3fa8 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxim Mikityanskiy Date: Sat, 20 Jun 2020 15:40:00 +0300 -Subject: [PATCH 268/834] staging: bcm2835-audio: Add missing MODULE_ALIAS +Subject: [PATCH 266/889] staging: bcm2835-audio: Add missing MODULE_ALIAS Commit 8353fe6f1e0f ("Revert "staging: bcm2835-audio: Drop DT dependency"") reverts the upstream change and makes bcm2835-audio use @@ -160080,10 +159786,10 @@ index 31968fec297f..a0cba3823e5e 100644 2.18.4 -From 4774c6a84c987827891d3733b464e2d2f8f64566 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Jun 2020 11:51:05 +0100 -Subject: [PATCH 269/834] brcmfmac: Prefer a ccode from OTP over nvram file +Subject: [PATCH 267/889] brcmfmac: Prefer a ccode from OTP over nvram file Allow the nvram file to set a default ccode (regulatory domain) without overriding one set in OTP. @@ -160217,10 +159923,10 @@ index d821a4758f8c..adfea97c9a43 100644 2.18.4 -From 73ac182c55624462842e2c9027d86659560c76e3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 23 Jun 2020 10:05:57 +0100 -Subject: [PATCH 270/834] drivers: media: Remove the downstream version of +Subject: [PATCH 268/889] drivers: media: Remove the downstream version of bcm2835-unicam About to be replaced by the upstream version. @@ -163408,10 +163114,10 @@ index ae059a171d0f..000000000000 2.18.4 -From cced95e317aa18a19a679de7d062d931e3ddc74a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 4 May 2020 12:25:41 +0300 -Subject: [PATCH 271/834] media: bcm2835-unicam: Driver for CCP2/CSI2 camera +Subject: [PATCH 269/889] media: bcm2835-unicam: Driver for CCP2/CSI2 camera interface Add a driver for the Unicam camera receiver block on BCM283x processors. @@ -166576,10 +166282,10 @@ index 000000000000..ae059a171d0f 2.18.4 -From c6a70ed48e789a9680f9e782eff93f4c6bf99e09 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 23 Jun 2020 14:32:51 +0100 -Subject: [PATCH 272/834] media: bcm2835-unicam: Add support for +Subject: [PATCH 270/889] media: bcm2835-unicam: Add support for get_mbus_config to set num lanes Use the get_mbus_config pad subdev call to allow a source to use @@ -166638,10 +166344,10 @@ index 2e9387cbc1e0..9adfb2d217af 100644 2.18.4 -From 522b7a0db0480c5bb104f0bb6594f55b24ae4fb5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 26 Jun 2020 15:53:44 +0100 -Subject: [PATCH 273/834] media: bcm2835-unicam: Avoid gcc warning over {0} on +Subject: [PATCH 271/889] media: bcm2835-unicam: Avoid gcc warning over {0} on endpoint Older gcc versions object to = { 0 } initialisation if the first @@ -166671,10 +166377,10 @@ index 9adfb2d217af..a65e1da55142 100644 2.18.4 -From ecc494a77e036dee3c496aa0aa34e787a083486f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Fri, 12 Jun 2020 15:53:46 +0200 -Subject: [PATCH 274/834] media: i2c: imx290: set the format before +Subject: [PATCH 272/889] media: i2c: imx290: set the format before VIDIOC_SUBDEV_G_FMT is called Commit d46cfdc86c30d5ec768924f0b1e2683c8d20b671 upstream. @@ -166717,10 +166423,10 @@ index adcddf3204f7..ad2318390678 100644 2.18.4 -From b5432daa5968d057654003ab078e758237e02df1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Jun 2020 08:28:51 +0100 -Subject: [PATCH 275/834] media: i2c: imx290: Add support for 74.25MHz clock +Subject: [PATCH 273/889] media: i2c: imx290: Add support for 74.25MHz clock The existing driver only supported a clock of 37.125MHz, but the sensor also supports 74.25MHz. @@ -166987,10 +166693,10 @@ index ad2318390678..fe1078f7721e 100644 2.18.4 -From d781a991d3153f70385b44e2c58342b2cd69c760 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 11 Jun 2020 13:41:43 +0100 -Subject: [PATCH 276/834] media: i2c: imx290: Correct range for V4L2_CID_GAIN +Subject: [PATCH 274/889] media: i2c: imx290: Correct range for V4L2_CID_GAIN to 0-238 The datasheet lists the gain as being 0.0 to 72.0dB in 0.3dB steps, which @@ -167019,10 +166725,10 @@ index fe1078f7721e..c193b7b8d8e5 100644 2.18.4 -From 3cdf20cbe069f92330f7bfd915095548be4fcab3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 11 Jun 2020 14:36:40 +0100 -Subject: [PATCH 277/834] media: i2c: imx290: Convert HMAX setting into +Subject: [PATCH 275/889] media: i2c: imx290: Convert HMAX setting into V4L2_CID_HBLANK Userspace needs to know HBLANK if it is to work out exposure times @@ -167184,10 +166890,10 @@ index c193b7b8d8e5..b12213f6355b 100644 2.18.4 -From a05d4310a398167384b6c815aa144c68bce08c7c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 11 Jun 2020 18:09:12 +0100 -Subject: [PATCH 278/834] media: i2c: imx290: Add support for V4L2_CID_VBLANK +Subject: [PATCH 276/889] media: i2c: imx290: Add support for V4L2_CID_VBLANK In order to calculate framerate and durations userspace needs the vertical blanking information. This can be configurable, @@ -167331,10 +167037,10 @@ index b12213f6355b..357614af64f7 100644 2.18.4 -From 4e70d5796cf741ff776ce3545a8d032ecf8e741c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 11 Jun 2020 18:19:13 +0100 -Subject: [PATCH 279/834] media: i2c: imx290: Add exposure control to the +Subject: [PATCH 277/889] media: i2c: imx290: Add exposure control to the driver. Adds support for V4L2_CID_EXPOSURE so that userspace can control @@ -167430,10 +167136,10 @@ index 357614af64f7..2eae36b0ad5c 100644 2.18.4 -From 0a4019dd88224715e2ee34dd7e619f0f2d7a9dec Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 11 Jun 2020 18:34:16 +0100 -Subject: [PATCH 280/834] media: i2c: imx290: Add H and V flip controls +Subject: [PATCH 278/889] media: i2c: imx290: Add H and V flip controls The sensor supports horizontal and vertical flips, so support them through V4L2_CID_HFLIP and V4L2_CID_VFLIP. @@ -167519,10 +167225,10 @@ index 2eae36b0ad5c..3d6734da7d64 100644 2.18.4 -From 8b52714cb834d0926bfb54289e0a070bd143a878 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Jun 2020 16:52:14 +0100 -Subject: [PATCH 281/834] media: dt-bindings: media: i2c: Add mono version to +Subject: [PATCH 279/889] media: dt-bindings: media: i2c: Add mono version to IMX290 bindings The IMX290 module is available as either monochrome or colour and @@ -167561,10 +167267,10 @@ index a3cc21410f7c..294e63650d9e 100644 2.18.4 -From 20ea2520e8d9b55cab20c23c487185da0ade380a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Jun 2020 17:03:11 +0100 -Subject: [PATCH 282/834] media : i2c: imx290: Add support for the mono sensor +Subject: [PATCH 280/889] media : i2c: imx290: Add support for the mono sensor variant. The IMX290 module is available as either mono or colour (Bayer). @@ -167752,10 +167458,10 @@ index 3d6734da7d64..09df70849928 100644 2.18.4 -From 539063dc09200406a56cc7eedaa6f83f6d5dac25 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 26 Jun 2020 18:11:49 +0100 -Subject: [PATCH 283/834] media: i2c: imx290: Switch set_hmax to use +Subject: [PATCH 281/889] media: i2c: imx290: Switch set_hmax to use imx290_write_buffered_reg imx290_set_hmax was using two independent writes to set up hmax, @@ -167801,10 +167507,10 @@ index 09df70849928..b824dfe29bbd 100644 2.18.4 -From cd56dc1dd7cc3f50ffd73c6f9df4a051fddb9d80 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 2 Jul 2020 13:53:20 +0100 -Subject: [PATCH 284/834] serial: 8250: bcm2835aux - defer if clock is zero +Subject: [PATCH 282/889] serial: 8250: bcm2835aux - defer if clock is zero See: https://github.com/raspberrypi/linux/issues/3700 @@ -167835,10 +167541,10 @@ index fd95860cd661..fc36e5963e30 100644 2.18.4 -From 19389019def679cdc9cb06fa124dd792b9f33c49 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 May 2020 16:59:03 +0100 -Subject: [PATCH 285/834] media: Add a pixel format for MIPI packed 12bit luma +Subject: [PATCH 283/889] media: Add a pixel format for MIPI packed 12bit luma only. This is the format used by monochrome 12bit image sensors. @@ -167943,10 +167649,10 @@ index e9fbb04a3519..e72c28ea0235 100644 2.18.4 -From b1d1ad01ba201135dbd1704a87a4e723f924daee Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Jun 2020 17:51:03 +0100 -Subject: [PATCH 286/834] media: Add a pixel format for MIPI packed 14bit luma +Subject: [PATCH 284/889] media: Add a pixel format for MIPI packed 14bit luma only. This is the format used by monochrome 14bit image sensors. @@ -168060,10 +167766,10 @@ index e72c28ea0235..53d526dbe004 100644 2.18.4 -From 87ad9543873ea142edbcadec0536e496a4395ee2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Jun 2020 17:53:32 +0100 -Subject: [PATCH 287/834] media: bcm2835-unicam: Add support for 12bit mono +Subject: [PATCH 285/889] media: bcm2835-unicam: Add support for 12bit mono packed format Now that V4L2_PIX_FMT_Y12P is defined, allow passing raw 12bit @@ -168091,10 +167797,10 @@ index a65e1da55142..5edb58cc9f03 100644 2.18.4 -From 2c750eb7a63846bded5be2ed757164811f3d508a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Jun 2020 18:03:47 +0100 -Subject: [PATCH 288/834] media: bcm2835-unicam: Add support for 14bit mono +Subject: [PATCH 286/889] media: bcm2835-unicam: Add support for 14bit mono sources Now that V4L2_PIX_FMT_Y14 and V4L2_PIX_FMT_Y14P are defined, @@ -168126,10 +167832,10 @@ index 5edb58cc9f03..778153943160 100644 2.18.4 -From bf65370898e502ac6526ac4c415f617eb3f245a0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 1 Jul 2020 10:57:57 +0100 -Subject: [PATCH 289/834] media: bcm2835-unicam: Add support for unpacked 14bit +Subject: [PATCH 287/889] media: bcm2835-unicam: Add support for unpacked 14bit Bayer formats Now that the 14bit non-packed Bayer formats are defined, add them @@ -168174,10 +167880,10 @@ index 778153943160..c97ecfc0e55b 100644 2.18.4 -From 134688ead514df8526c0430d5717013137790bc9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Jul 2020 20:28:27 +0100 -Subject: [PATCH 290/834] bcm2835-dma: Add NO_WAIT_RESP flag +Subject: [PATCH 288/889] bcm2835-dma: Add NO_WAIT_RESP flag Use bit 27 of the dreq value (the second cell of the DT DMA descriptor) to request that the WAIT_RESP bit is not set. @@ -168234,10 +167940,10 @@ index ac0458a8027f..84b1009da23b 100644 2.18.4 -From 7c813e43e93791f010c67835bc8f2fe5ef28dd57 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Zefa Chen Date: Fri, 17 May 2019 18:23:03 +0800 -Subject: [PATCH 291/834] media: i2c: add ov9281 driver. +Subject: [PATCH 289/889] media: i2c: add ov9281 driver. Change-Id: I7b77250bbc56d2f861450cf77271ad15f9b88ab1 Signed-off-by: Zefa Chen @@ -169463,10 +169169,10 @@ index 000000000000..4a6324a3e5da 2.18.4 -From 6a1133f726c62fa99b43b26259d1bd7b3819aead Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 14 Apr 2020 15:47:09 +0100 -Subject: [PATCH 292/834] media: i2c: ov9281: fix mclk issue when probe +Subject: [PATCH 290/889] media: i2c: ov9281: fix mclk issue when probe multiple camera. Takes the ov9281 part only from the Rockchip's patch. @@ -169529,10 +169235,10 @@ index 4a6324a3e5da..0d6759942f79 100644 2.18.4 -From 6d6e06d295aa939c1d825aaa12692a286a7931b7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 14 Apr 2020 15:51:50 +0100 -Subject: [PATCH 293/834] media: i2c: ov9281: add enum_frame_interval function +Subject: [PATCH 291/889] media: i2c: ov9281: add enum_frame_interval function for iq tool 2.2 and hal3 Adds the ov9281 parts of the Rockchip patch adding enum_frame_interval to @@ -169632,10 +169338,10 @@ index 0d6759942f79..273aa904683c 100644 2.18.4 -From b25564409b79211d35676399ab622f62f8f90c5d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 14 Apr 2020 16:12:33 +0100 -Subject: [PATCH 294/834] media: i2c: ov9281: Fixup for recent kernel releases, +Subject: [PATCH 292/889] media: i2c: ov9281: Fixup for recent kernel releases, and remove custom code The Rockchip driver was based on a 4.4 kernel, and had several custom @@ -170315,10 +170021,10 @@ index 273aa904683c..7b9bea476cfb 100644 2.18.4 -From 11ad5a9697e48a6076ac1afb0e199bebe13b7c9f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 6 Jul 2020 17:51:32 +0100 -Subject: [PATCH 295/834] media: i2c: ov9281: Read chip ID via 2 reads +Subject: [PATCH 293/889] media: i2c: ov9281: Read chip ID via 2 reads Vision Components have made an OV9281 module which blocks reading back the majority of registers to comply with NDAs, and in doing @@ -170363,10 +170069,10 @@ index 7b9bea476cfb..bb8efc3d3cba 100644 2.18.4 -From 4a5a91342bd11b5311f7cda63215b861cb2ef407 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Jul 2020 10:31:53 +0100 -Subject: [PATCH 296/834] media: i2c: imx290: Explicitly set v&h blank on mode +Subject: [PATCH 294/889] media: i2c: imx290: Explicitly set v&h blank on mode change __v4l2_ctrl_modify_range only updates the current value should @@ -170415,10 +170121,10 @@ index b824dfe29bbd..b28834823f86 100644 2.18.4 -From f207668ccbffba65015443ca5c7e01df4f869e2e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Jul 2020 11:23:48 +0100 -Subject: [PATCH 297/834] media: i2c: imx290: Add support for g_selection to +Subject: [PATCH 295/889] media: i2c: imx290: Add support for g_selection to report cropping Userspace needs to know the cropping arrangements for each mode, @@ -170577,10 +170283,10 @@ index b28834823f86..24bf40d729b7 100644 2.18.4 -From 59ab560d55cfdcbc596c4753f4e16b61a2b9eb39 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Jul 2020 11:51:26 +0100 -Subject: [PATCH 298/834] media: i2c: imx290: Set the colorspace fields in the +Subject: [PATCH 296/889] media: i2c: imx290: Set the colorspace fields in the format The colorspace fields were left untouched in imx290_set_fmt @@ -170614,10 +170320,10 @@ index 24bf40d729b7..2e646fb01856 100644 2.18.4 -From e9b1620886c6172f958e42a45d334137132dfa61 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Jul 2020 14:23:40 +0100 -Subject: [PATCH 299/834] media: bcm2835-unicam: Reinstate V4L2_CAP_READWRITE +Subject: [PATCH 297/889] media: bcm2835-unicam: Reinstate V4L2_CAP_READWRITE in the caps v4l2-compliance throws a failure if the device doesn't advertise @@ -170648,10 +170354,10 @@ index c97ecfc0e55b..20b46a9e04c3 100644 2.18.4 -From b2bc04bac9e7f6c9f98bd56470d00faf0a35e580 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Jul 2020 14:52:43 +0100 -Subject: [PATCH 300/834] media: bcm2835-unicam: Ensure type is VIDEO_CAPTURE +Subject: [PATCH 298/889] media: bcm2835-unicam: Ensure type is VIDEO_CAPTURE in [g|s]_selection [g|s]_selection pass in a buffer type that needs to be validated @@ -170690,10 +170396,10 @@ index 20b46a9e04c3..de288f87ff2f 100644 2.18.4 -From 2e130ed554197aca3e38f5dab8715393ff03da96 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 11 May 2020 13:02:22 +0100 -Subject: [PATCH 301/834] media: bcm2835: unicam: Set VPU min clock freq to +Subject: [PATCH 299/889] media: bcm2835: unicam: Set VPU min clock freq to 250Mhz. When streaming with Unicam, the VPU must have a clock frequency of at @@ -170823,10 +170529,10 @@ index de288f87ff2f..295db7564614 100644 2.18.4 -From b263d5c47cb49e3042c031d49fdb889813323e41 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 11 May 2020 13:06:27 +0100 -Subject: [PATCH 302/834] dt-bindings: bcm2835-unicam: Update documentation +Subject: [PATCH 300/889] dt-bindings: bcm2835-unicam: Update documentation with new clock params Update the documentation to reflect the new "VPU" clock needed @@ -170867,10 +170573,10 @@ index 7714fb374b34..164d0377dcd2 100644 2.18.4 -From efd34904ad25a554e994c8db1cbba1ad9a919d5b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 4 Jul 2020 01:45:08 +0300 -Subject: [PATCH 303/834] media: i2c: ov5647: Parse and register properties +Subject: [PATCH 301/889] media: i2c: ov5647: Parse and register properties Parse device properties and register controls for them using the V4L2 fwnode properties helpers. @@ -170922,10 +170628,10 @@ index 6d84d2785f74..86a821a172b3 100644 2.18.4 -From b3442b4c3dbded3959f06d8853091d1fc53c9163 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Jul 2020 10:33:19 +0100 -Subject: [PATCH 304/834] leds: Add the actpwr trigger +Subject: [PATCH 302/889] leds: Add the actpwr trigger The actpwr trigger is a meta trigger that cycles between an inverted mmc0 and default-on. It is written in a way that could fairly easily @@ -171168,10 +170874,10 @@ index 000000000000..1a52107ceb03 2.18.4 -From 3975bb7dd7a3e82cf94229f6caf9376d56dbc9c3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 21 Jul 2020 17:34:09 +0100 -Subject: [PATCH 305/834] staging: vchiq_arm: children inherit DMA config +Subject: [PATCH 303/889] staging: vchiq_arm: children inherit DMA config Although it is no longer necessary for vchiq's children to have a different DMA configuration to the parent, they do still need to @@ -171210,10 +170916,10 @@ index c3ca18e4e85c..a936102dbc34 100644 2.18.4 -From e5cad0bc759b69c96e88d48cbeb2da92e66a0cd0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 22 Jul 2020 17:59:31 +0100 -Subject: [PATCH 306/834] bcm2835-dma: Advertise the full DMA range +Subject: [PATCH 304/889] bcm2835-dma: Advertise the full DMA range Unless the DMA mask is set wider than 32 bits, DMA mapping will use a bounce buffer. @@ -171293,10 +170999,10 @@ index 84b1009da23b..d1127b9058a4 100644 2.18.4 -From ba1ca3b191e6e9e532e080f1c74e5e57d0d62c7d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 29 Jul 2020 13:47:55 +0100 -Subject: [PATCH 307/834] ARM: proc-v7: Force misalignment of early stmia +Subject: [PATCH 305/889] 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 @@ -171359,10 +171065,10 @@ index 28c9d32fa99a..3e77e8982df3 100644 2.18.4 -From cb35d0a3d14c6a9f1f68148d807acd1f628f7004 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Wed, 19 Aug 2020 17:02:22 +0300 -Subject: [PATCH 308/834] media: bcm2835: unicam: Select MEDIA_CONTROLLER and +Subject: [PATCH 306/889] media: bcm2835: unicam: Select MEDIA_CONTROLLER and VIDEO_V4L2_SUBDEV_API That is what almost all other drivers appear to be doing. @@ -171392,10 +171098,10 @@ index ec46e3ef053c..7d5a0e6ba762 100644 2.18.4 -From 94637c5b9195f3f7f8573be6d7c998efbcb15591 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Wed, 19 Aug 2020 17:05:53 +0300 -Subject: [PATCH 309/834] staging: media: rpivid: Select MEDIA_CONTROLLER and +Subject: [PATCH 307/889] staging: media: rpivid: Select MEDIA_CONTROLLER and MEDIA_CONTROLLER_REQUEST_API MEDIA_CONTROLLER_REQUEST_API is a hidden option. If rpivid depends on it, @@ -171430,10 +171136,10 @@ index 58b470c80db1..304c3edf0e71 100644 2.18.4 -From 06d5694dfdd736857e32fb610fd93b16d94b0d2f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 27 Aug 2020 16:30:26 +0100 -Subject: [PATCH 310/834] media: bcm2835-unicam: Drop WARN on uing direct cache +Subject: [PATCH 308/889] media: bcm2835-unicam: Drop WARN on uing direct cache alias Pi 0&1 pass all ARM accesses through the VPU L2 cache, therefore @@ -171470,10 +171176,10 @@ index 295db7564614..35ddb97f7f75 100644 2.18.4 -From 569354fb3fc66bd25f59d367ce18e01b6e75457f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 10 Jul 2020 12:40:50 +0100 -Subject: [PATCH 311/834] media: i2c: tc358743: Only allow supported pixel fmts +Subject: [PATCH 309/889] media: i2c: tc358743: Only allow supported pixel fmts in set_fmt Fix commit "media: tc358743: Return an appropriate colorspace from @@ -171506,10 +171212,10 @@ index ee6779a81d43..ce64c25c1511 100644 2.18.4 -From d91871b102c3f9772661b71d7fa42d90b5336e67 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Jul 2020 18:29:10 +0100 -Subject: [PATCH 312/834] media: i2c: ov9281: Add support for 8 bit readout +Subject: [PATCH 310/889] media: i2c: ov9281: Add support for 8 bit readout The sensor supports 8 bit mode as well as 10bit, so add the relevant code to allow selection of this. @@ -171700,10 +171406,10 @@ index bb8efc3d3cba..9610c24ceff1 100644 2.18.4 -From ccac6534a6582b630596a209f4e68324324b7c97 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 3 Sep 2020 14:02:21 +0100 -Subject: [PATCH 313/834] bcm2835-mmc: uninitialized_var is no more +Subject: [PATCH 311/889] bcm2835-mmc: uninitialized_var is no more --- drivers/mmc/host/bcm2835-mmc.c | 2 +- @@ -171726,10 +171432,10 @@ index caf46be8eb0d..cdc1318e5936 100644 2.18.4 -From 9937d5be4bb6fd966a86450a0ff91b1498e7b1dd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 3 Sep 2020 14:02:41 +0100 -Subject: [PATCH 314/834] dwc_otg: whitelist_table is now productlist_table +Subject: [PATCH 312/889] dwc_otg: whitelist_table is now productlist_table --- drivers/usb/core/otg_productlist.h | 2 +- @@ -171752,10 +171458,10 @@ index 1839e169469b..b16e528859a8 100644 2.18.4 -From 049912d6d8af3a089d010f5edc97dd353ce89163 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: detule Date: Tue, 2 Oct 2018 04:10:08 -0400 -Subject: [PATCH 315/834] vchiq_2835_arm: Implement a DMA pool for small bulk +Subject: [PATCH 313/889] vchiq_2835_arm: Implement a DMA pool for small bulk transfers (#2699) During a bulk transfer we request a DMA allocation to hold the @@ -171880,10 +171586,10 @@ index 76179739de12..2a1d8d6541b2 100644 2.18.4 -From aaa40e0be1193785b5f6c99b024fc66b74bf45f6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 3 Sep 2020 17:09:07 +0100 -Subject: [PATCH 316/834] include/firmware: Add enum for +Subject: [PATCH 314/889] include/firmware: Add enum for RPI_FIRMWARE_FRAMEBUFFER_GET_DISPLAY_ID Used by audio and FKMS. @@ -171894,7 +171600,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 1 insertion(+) diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h -index d0c827064999..d0ee609a9043 100644 +index 4728741132b1..21bfcafae74e 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -114,6 +114,7 @@ enum rpi_firmware_property_tag { @@ -171909,376 +171615,10 @@ index d0c827064999..d0ee609a9043 100644 2.18.4 -From c7888ad70297e7e784c4e39c7f761912ec480fb5 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 27 Apr 2020 19:07:50 +0100 -Subject: [PATCH 317/834] vc4_hdmi: BCM2835 requires a fixed hsm clock for CEC - to work - -Signed-off-by: popcornmix ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 54 +++++++++++++++++++++++----------- - drivers/gpu/drm/vc4/vc4_hdmi.h | 3 ++ - 2 files changed, 40 insertions(+), 17 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index c58b8840090a..d6cf75be3f29 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -646,23 +646,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder) - return; - } - -- /* -- * As stated in RPi's vc4 firmware "HDMI state machine (HSM) clock must -- * be faster than pixel clock, infinitesimally faster, tested in -- * simulation. Otherwise, exact value is unimportant for HDMI -- * operation." This conflicts with bcm2835's vc4 documentation, which -- * states HSM's clock has to be at least 108% of the pixel clock. -- * -- * Real life tests reveal that vc4's firmware statement holds up, and -- * users are able to use pixel clocks closer to HSM's, namely for -- * 1920x1200@60Hz. So it was decided to have leave a 1% margin between -- * both clocks. Which, for RPi0-3 implies a maximum pixel clock of -- * 162MHz. -- * -- * Additionally, the AXI clock needs to be at least 25% of -- * pixel clock, but HSM ends up being the limiting factor. -- */ -- hsm_rate = max_t(unsigned long, 120000000, (pixel_rate / 100) * 101); -+ hsm_rate = vc4_hdmi->variant->calc_hsm_clock(vc4_hdmi, pixel_rate); - ret = clk_set_min_rate(vc4_hdmi->hsm_clock, hsm_rate); - if (ret) { - DRM_ERROR("Failed to set HSM clock rate: %d\n", ret); -@@ -850,6 +834,39 @@ static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { - .enable = vc4_hdmi_encoder_enable, - }; - -+static u32 vc4_hdmi_calc_hsm_clock(struct vc4_hdmi *vc4_hdmi, unsigned long pixel_rate) -+{ -+ /* -+ * Whilst this can vary, all the CEC timings are derived from this -+ * clock, so make it constant to avoid having to reconfigure CEC on -+ * every mode change. -+ */ -+ -+ return 163682864; -+} -+ -+static u32 vc5_hdmi_calc_hsm_clock(struct vc4_hdmi *vc4_hdmi, unsigned long pixel_rate) -+{ -+ /* -+ * As stated in RPi's vc4 firmware "HDMI state machine (HSM) clock must -+ * be faster than pixel clock, infinitesimally faster, tested in -+ * simulation. Otherwise, exact value is unimportant for HDMI -+ * operation." This conflicts with bcm2835's vc4 documentation, which -+ * states HSM's clock has to be at least 108% of the pixel clock. -+ * -+ * Real life tests reveal that vc4's firmware statement holds up, and -+ * users are able to use pixel clocks closer to HSM's, namely for -+ * 1920x1200@60Hz. So it was decided to have leave a 1% margin between -+ * both clocks. Which, for RPi0-3 implies a maximum pixel clock of -+ * 162MHz. -+ * -+ * Additionally, the AXI clock needs to be at least 25% of -+ * pixel clock, but HSM ends up being the limiting factor. -+ */ -+ -+ return max_t(unsigned long, 108000000, (pixel_rate / 100) * 101); -+} -+ - static u32 vc4_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask) - { - int i; -@@ -1922,6 +1939,7 @@ static const struct vc4_hdmi_variant bcm2835_variant = { - .phy_disable = vc4_hdmi_phy_disable, - .phy_rng_enable = vc4_hdmi_phy_rng_enable, - .phy_rng_disable = vc4_hdmi_phy_rng_disable, -+ .calc_hsm_clock = vc4_hdmi_calc_hsm_clock, - .channel_map = vc4_hdmi_channel_map, - }; - -@@ -1948,6 +1966,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { - .phy_disable = vc5_hdmi_phy_disable, - .phy_rng_enable = vc5_hdmi_phy_rng_enable, - .phy_rng_disable = vc5_hdmi_phy_rng_disable, -+ .calc_hsm_clock = vc5_hdmi_calc_hsm_clock, - .channel_map = vc5_hdmi_channel_map, - }; - -@@ -1974,6 +1993,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { - .phy_disable = vc5_hdmi_phy_disable, - .phy_rng_enable = vc5_hdmi_phy_rng_enable, - .phy_rng_disable = vc5_hdmi_phy_rng_disable, -+ .calc_hsm_clock = vc5_hdmi_calc_hsm_clock, - .channel_map = vc5_hdmi_channel_map, - }; - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index 0526a9cf608a..32d09132fb44 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.h -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -93,6 +93,9 @@ struct vc4_hdmi_variant { - /* Callback to disable the RNG in the PHY */ - void (*phy_rng_disable)(struct vc4_hdmi *vc4_hdmi); - -+ /* Callback to calculate hsm clock */ -+ u32 (*calc_hsm_clock)(struct vc4_hdmi *vc4_hdmi, unsigned long pixel_rate); -+ - /* Callback to get channel map */ - u32 (*channel_map)(struct vc4_hdmi *vc4_hdmi, u32 channel_mask); - }; --- -2.18.4 - - -From 5bc46aa433e8181eba539c31cdcc5eac4efe977b Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Thu, 7 May 2020 18:16:07 +0100 -Subject: [PATCH 318/834] vc4_hdmi_regs: Add Intr2 register block - -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++++++ - drivers/gpu/drm/vc4/vc4_hdmi.h | 2 ++ - drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 17 +++++++++++++++++ - 3 files changed, 27 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index d6cf75be3f29..334bf0d75e26 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1684,6 +1684,14 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) - if (!vc4_hdmi->dvp_regs) - return -ENOMEM; - -+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "intr2"); -+ if (!res) -+ return -ENODEV; -+ -+ vc4_hdmi->intr2_regs = devm_ioremap(dev, res->start, resource_size(res)); -+ if (IS_ERR(vc4_hdmi->intr2_regs)) -+ return PTR_ERR(vc4_hdmi->intr2_regs); -+ - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy"); - if (!res) - return -ENODEV; -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index 32d09132fb44..1142f332b300 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.h -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -141,6 +141,8 @@ struct vc4_hdmi { - void __iomem *ram_regs; - /* VC5 Only */ - void __iomem *rm_regs; -+ /* VC5 Only */ -+ void __iomem *intr2_regs; - - int hpd_gpio; - bool hpd_active_low; -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h -index 6c0dfbbe1a7e..10dd6097f2b5 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h -+++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h -@@ -15,6 +15,7 @@ enum vc4_hdmi_regs { - VC5_PHY, - VC5_RAM, - VC5_RM, -+ VC5_INTR2, - }; - - enum vc4_hdmi_field { -@@ -139,6 +140,7 @@ struct vc4_hdmi_register { - #define VC5_CEC_REG(reg, offset) _VC4_REG(VC5_CEC, reg, offset) - #define VC5_CSC_REG(reg, offset) _VC4_REG(VC5_CSC, reg, offset) - #define VC5_DVP_REG(reg, offset) _VC4_REG(VC5_DVP, reg, offset) -+#define VC5_INTR2_REG(reg, offset) _VC4_REG(VC5_INTR2, reg, offset) - #define VC5_PHY_REG(reg, offset) _VC4_REG(VC5_PHY, reg, offset) - #define VC5_RAM_REG(reg, offset) _VC4_REG(VC5_RAM, reg, offset) - #define VC5_RM_REG(reg, offset) _VC4_REG(VC5_RM, reg, offset) -@@ -271,6 +273,12 @@ static const struct vc4_hdmi_register vc5_hdmi_hdmi0_fields[] = { - VC5_CEC_REG(HDMI_CEC_RX_DATA_2, 0x03c), - VC5_CEC_REG(HDMI_CEC_RX_DATA_3, 0x040), - VC5_CEC_REG(HDMI_CEC_RX_DATA_4, 0x044), -+ VC5_INTR2_REG(HDMI_CEC_CPU_STATUS, 0x0000), -+ VC5_INTR2_REG(HDMI_CEC_CPU_SET, 0x0004), -+ VC5_INTR2_REG(HDMI_CEC_CPU_CLEAR, 0x0008), -+ VC5_INTR2_REG(HDMI_CEC_CPU_MASK_STATUS, 0x000c), -+ VC5_INTR2_REG(HDMI_CEC_CPU_MASK_SET, 0x0010), -+ VC5_INTR2_REG(HDMI_CEC_CPU_MASK_CLEAR, 0x0014), - - VC5_CSC_REG(HDMI_CSC_CTL, 0x000), - VC5_CSC_REG(HDMI_CSC_12_11, 0x004), -@@ -347,6 +355,12 @@ static const struct vc4_hdmi_register vc5_hdmi_hdmi1_fields[] = { - VC5_CEC_REG(HDMI_CEC_RX_DATA_2, 0x03c), - VC5_CEC_REG(HDMI_CEC_RX_DATA_3, 0x040), - VC5_CEC_REG(HDMI_CEC_RX_DATA_4, 0x044), -+ VC5_INTR2_REG(HDMI_CEC_CPU_STATUS, 0x0000), -+ VC5_INTR2_REG(HDMI_CEC_CPU_SET, 0x0004), -+ VC5_INTR2_REG(HDMI_CEC_CPU_CLEAR, 0x0008), -+ VC5_INTR2_REG(HDMI_CEC_CPU_MASK_STATUS, 0x000c), -+ VC5_INTR2_REG(HDMI_CEC_CPU_MASK_SET, 0x0010), -+ VC5_INTR2_REG(HDMI_CEC_CPU_MASK_CLEAR, 0x0014), - - VC5_CSC_REG(HDMI_CSC_CTL, 0x000), - VC5_CSC_REG(HDMI_CSC_12_11, 0x004), -@@ -377,6 +391,9 @@ void __iomem *__vc4_hdmi_get_field_base(struct vc4_hdmi *hdmi, - case VC5_DVP: - return hdmi->dvp_regs; - -+ case VC5_INTR2: -+ return hdmi->intr2_regs; -+ - case VC5_PHY: - return hdmi->phy_regs; - --- -2.18.4 - - -From d68750fa8e9adf3d7f78ff75573518fbb7428ca6 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Thu, 7 May 2020 18:16:08 +0100 -Subject: [PATCH 319/834] vc4_hdmi_regs: Make interrupt mask variant specific - -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 14 ++++++++++---- - drivers/gpu/drm/vc4/vc4_hdmi.h | 3 +++ - drivers/gpu/drm/vc4/vc4_regs.h | 9 +++++++++ - 3 files changed, 22 insertions(+), 4 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 334bf0d75e26..2206db78025a 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1387,7 +1387,7 @@ static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) - u32 stat = HDMI_READ(HDMI_CEC_CPU_STATUS); - u32 cntrl1, cntrl5; - -- if (!(stat & VC4_HDMI_CPU_CEC)) -+ if (!(stat & vc4_hdmi->variant->cec_mask)) - return IRQ_NONE; - vc4_hdmi->cec_rx_msg.len = 0; - cntrl1 = HDMI_READ(HDMI_CEC_CNTRL_1); -@@ -1403,7 +1403,7 @@ static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) - cntrl1 &= ~VC4_HDMI_CEC_START_XMIT_BEGIN; - } - HDMI_WRITE(HDMI_CEC_CNTRL_1, cntrl1); -- HDMI_WRITE(HDMI_CEC_CPU_CLEAR, VC4_HDMI_CPU_CEC); -+ HDMI_WRITE(HDMI_CEC_CPU_CLEAR, vc4_hdmi->variant->cec_mask); - - return IRQ_WAKE_THREAD; - } -@@ -1442,9 +1442,9 @@ static int vc4_hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable) - ((3600 / usecs) << VC4_HDMI_CEC_CNT_TO_3600_US_SHIFT) | - ((3500 / usecs) << VC4_HDMI_CEC_CNT_TO_3500_US_SHIFT)); - -- HDMI_WRITE(HDMI_CEC_CPU_MASK_CLEAR, VC4_HDMI_CPU_CEC); -+ HDMI_WRITE(HDMI_CEC_CPU_MASK_CLEAR, vc4_hdmi->variant->cec_mask); - } else { -- HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, VC4_HDMI_CPU_CEC); -+ HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, vc4_hdmi->variant->cec_mask); - HDMI_WRITE(HDMI_CEC_CNTRL_5, val | - VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET); - } -@@ -1949,6 +1949,8 @@ static const struct vc4_hdmi_variant bcm2835_variant = { - .phy_rng_disable = vc4_hdmi_phy_rng_disable, - .calc_hsm_clock = vc4_hdmi_calc_hsm_clock, - .channel_map = vc4_hdmi_channel_map, -+ -+ .cec_mask = VC4_HDMI_CPU_CEC, - }; - - static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { -@@ -1976,6 +1978,8 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { - .phy_rng_disable = vc5_hdmi_phy_rng_disable, - .calc_hsm_clock = vc5_hdmi_calc_hsm_clock, - .channel_map = vc5_hdmi_channel_map, -+ -+ .cec_mask = VC5_HDMI0_CPU_CEC_RX | VC5_HDMI0_CPU_CEC_TX, - }; - - static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { -@@ -2003,6 +2007,8 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { - .phy_rng_disable = vc5_hdmi_phy_rng_disable, - .calc_hsm_clock = vc5_hdmi_calc_hsm_clock, - .channel_map = vc5_hdmi_channel_map, -+ -+ .cec_mask = VC5_HDMI1_CPU_CEC_RX | VC5_HDMI1_CPU_CEC_TX, - }; - - static const struct of_device_id vc4_hdmi_dt_match[] = { -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index 1142f332b300..16cc0e9abc36 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.h -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -98,6 +98,9 @@ struct vc4_hdmi_variant { - - /* Callback to get channel map */ - u32 (*channel_map)(struct vc4_hdmi *vc4_hdmi, u32 channel_mask); -+ -+ /* Bitmask for CEC events */ -+ u32 cec_mask; - }; - - /* HDMI audio information */ -diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h -index be2c32a519b3..39630e9de1b0 100644 ---- a/drivers/gpu/drm/vc4/vc4_regs.h -+++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -668,6 +668,15 @@ - # define VC4_HDMI_CPU_CEC BIT(6) - # define VC4_HDMI_CPU_HOTPLUG BIT(0) - -+# define VC5_HDMI0_CPU_CEC_RX BIT(1) -+# define VC5_HDMI0_CPU_CEC_TX BIT(0) -+# define VC5_HDMI0_CPU_HOTPLUG_CONN BIT(4) -+# define VC5_HDMI0_CPU_HOTPLUG_REM BIT(5) -+# define VC5_HDMI1_CPU_CEC_RX BIT(7) -+# define VC5_HDMI1_CPU_CEC_TX BIT(6) -+# define VC5_HDMI1_CPU_HOTPLUG_CONN BIT(10) -+# define VC5_HDMI1_CPU_HOTPLUG_REM BIT(11) -+ - /* Debug: Current receive value on the CEC pad. */ - # define VC4_HD_CECRXD BIT(9) - /* Debug: Override CEC output to 0. */ --- -2.18.4 - - -From be33544b178e6cb925fe2f2d339e018aef2e9caf Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Thu, 7 May 2020 18:16:08 +0100 -Subject: [PATCH 320/834] vc4_hdmi: Make irq shared - -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 2206db78025a..412625246d5b 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1530,7 +1530,8 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) - - ret = devm_request_threaded_irq(&pdev->dev, platform_get_irq(pdev, 0), - vc4_cec_irq_handler, -- vc4_cec_irq_handler_thread, 0, -+ vc4_cec_irq_handler_thread, -+ IRQF_SHARED, - "vc4 hdmi cec", vc4_hdmi); - if (ret) - goto err_delete_cec_adap; --- -2.18.4 - - -From b5225ab062e777f615be208558210fc9f0e93b17 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 19 May 2020 14:54:28 +0100 -Subject: [PATCH 321/834] drm/vc4: Adopt the dma configuration from the HVS or +Subject: [PATCH 315/889] drm/vc4: Adopt the dma configuration from the HVS or V3D component vc4_drv isn't necessarily under the /soc node in DT as it is a @@ -172335,58 +171675,10 @@ index 839610f8092a..de02c57ed276 100644 2.18.4 -From 8e0351159e0dd1b6b623ad027a8b8f405c3a631e Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Tue, 23 Jun 2020 18:37:01 +0100 -Subject: [PATCH 322/834] vc4_hdmi: Set HD_CTL_WHOLSMP and HD_CTL_CHALIGN_SET - -Symptom is random switching of speakers when using multichannel. - -Repeatedly running speakertest -c8 occasionally starts with -channels jumbled. This is fixed with HD_CTL_WHOLSMP. - -The other bit looks beneficial and apears harmless in testing so -I'd suggest adding it too. - -Documentation says: HD_CTL_WHILSMP_SET -Wait for whole sample. When this bit is set MAI transmit will start -only when there is at least one whole sample available in the fifo. - -Documentation says: HD_CTL_CHALIGN_SET -Channel Align When Overflow. This bit is used to realign the audio -channels in case of an overflow. -If this bit is set, after the detection of an overflow, equal -amount of dummy words to the missing words will be written to fifo, -filling up the broken sample and maintaining alignment. - -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 412625246d5b..ba631560354c 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1091,7 +1091,9 @@ static int vc4_hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd, - HDMI_WRITE(HDMI_MAI_CTL, - VC4_SET_FIELD(vc4_hdmi->audio.channels, - VC4_HD_MAI_CTL_CHNUM) | -- VC4_HD_MAI_CTL_ENABLE); -+ VC4_HD_MAI_CTL_WHOLSMP | -+ VC4_HD_MAI_CTL_CHALIGN | -+ VC4_HD_MAI_CTL_ENABLE); - break; - case SNDRV_PCM_TRIGGER_STOP: - HDMI_WRITE(HDMI_MAI_CTL, --- -2.18.4 - - -From b2929be43654793af79d788034d396309b4d3a67 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 10 Mar 2020 22:21:15 +0000 -Subject: [PATCH 323/834] vc4_hdmi: Set HDMI_MAI_FMT +Subject: [PATCH 316/889] vc4_hdmi: Set HDMI_MAI_FMT The hardware uses this for generating the right audio data island packets when using formats other than PCM @@ -172398,10 +171690,10 @@ Signed-off-by: Dom Cobley 2 files changed, 78 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index ba631560354c..087d39f4fc16 100644 +index ee293f061f0a..8c02dcc213b9 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1005,6 +1005,44 @@ static void vc4_hdmi_audio_shutdown(struct snd_pcm_substream *substream, +@@ -988,6 +988,44 @@ static void vc4_hdmi_audio_shutdown(struct snd_pcm_substream *substream, vc4_hdmi->audio.substream = NULL; } @@ -172446,7 +171738,7 @@ index ba631560354c..087d39f4fc16 100644 /* HDMI audio codec callbacks */ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, -@@ -1015,6 +1053,8 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, +@@ -998,6 +1036,8 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, struct device *dev = &vc4_hdmi->pdev->dev; u32 audio_packet_config, channel_mask; u32 channel_map; @@ -172455,7 +171747,7 @@ index ba631560354c..087d39f4fc16 100644 if (substream != vc4_hdmi->audio.substream) return -EINVAL; -@@ -1035,6 +1075,14 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, +@@ -1018,6 +1058,14 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, vc4_hdmi_audio_set_mai_clock(vc4_hdmi); @@ -172471,7 +171763,7 @@ index ba631560354c..087d39f4fc16 100644 audio_packet_config = VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_SAMPLE_FLAT | diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h -index 39630e9de1b0..c10402e103d6 100644 +index be2c32a519b3..489f921ef44d 100644 --- a/drivers/gpu/drm/vc4/vc4_regs.h +++ b/drivers/gpu/drm/vc4/vc4_regs.h @@ -516,6 +516,36 @@ @@ -172515,10 +171807,10 @@ index 39630e9de1b0..c10402e103d6 100644 2.18.4 -From 5e55786b09373ba5ae12c40779b5a4e5b73d83ff Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Tue, 17 Mar 2020 12:12:22 +0100 -Subject: [PATCH 324/834] drm/vc4: add iec958 controls to vc4_hdmi +Subject: [PATCH 317/889] 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 @@ -172534,7 +171826,7 @@ Signed-off-by: Matthias Reichl 2 files changed, 62 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 087d39f4fc16..b2595ec65166 100644 +index 8c02dcc213b9..a7758efaa078 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -44,6 +44,7 @@ @@ -172545,7 +171837,7 @@ index 087d39f4fc16..b2595ec65166 100644 #include #include #include -@@ -1196,6 +1197,47 @@ static int vc4_hdmi_audio_eld_ctl_get(struct snd_kcontrol *kcontrol, +@@ -1179,6 +1180,47 @@ static int vc4_hdmi_audio_eld_ctl_get(struct snd_kcontrol *kcontrol, return 0; } @@ -172593,7 +171885,7 @@ index 087d39f4fc16..b2595ec65166 100644 static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = { { .access = SNDRV_CTL_ELEM_ACCESS_READ | -@@ -1205,6 +1247,19 @@ static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = { +@@ -1188,6 +1230,19 @@ static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = { .info = vc4_hdmi_audio_eld_ctl_info, .get = vc4_hdmi_audio_eld_ctl_get, }, @@ -172613,7 +171905,7 @@ index 087d39f4fc16..b2595ec65166 100644 }; static const struct snd_soc_dapm_widget vc4_hdmi_audio_widgets[] = { -@@ -1325,6 +1380,11 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) +@@ -1308,6 +1363,11 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) vc4_hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; vc4_hdmi->audio.dma_data.maxburst = 2; @@ -172626,10 +171918,10 @@ index 087d39f4fc16..b2595ec65166 100644 if (ret) { dev_err(dev, "Could not register PCM component: %d\n", ret); diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index 16cc0e9abc36..c75d4c9e1515 100644 +index 0526a9cf608a..dec3e0a9ab07 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -116,6 +116,8 @@ struct vc4_hdmi_audio { +@@ -110,6 +110,8 @@ struct vc4_hdmi_audio { struct snd_pcm_substream *substream; bool streaming; @@ -172642,10 +171934,10 @@ index 16cc0e9abc36..c75d4c9e1515 100644 2.18.4 -From ba45ffd4d2e02f69a0ae111da58d1f879a101a3e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Thu, 19 Mar 2020 20:00:35 +0100 -Subject: [PATCH 325/834] drm/vc4: move setup from hw_params to prepare +Subject: [PATCH 318/889] 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 @@ -172657,10 +171949,10 @@ Signed-off-by: Matthias Reichl 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index b2595ec65166..04b1807cb793 100644 +index a7758efaa078..846b027126d0 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1045,9 +1045,8 @@ static int sample_rate_to_mai_fmt(int samplerate) +@@ -1028,9 +1028,8 @@ static int sample_rate_to_mai_fmt(int samplerate) } /* HDMI audio codec callbacks */ @@ -172672,7 +171964,7 @@ index b2595ec65166..04b1807cb793 100644 { struct vc4_hdmi *vc4_hdmi = dai_to_hdmi(dai); struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; -@@ -1060,12 +1059,15 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, +@@ -1043,12 +1042,15 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, if (substream != vc4_hdmi->audio.substream) return -EINVAL; @@ -172693,7 +171985,7 @@ index b2595ec65166..04b1807cb793 100644 HDMI_WRITE(HDMI_MAI_CTL, VC4_HD_MAI_CTL_RESET | -@@ -1287,7 +1289,7 @@ static const struct snd_soc_component_driver vc4_hdmi_audio_component_drv = { +@@ -1270,7 +1272,7 @@ static const struct snd_soc_component_driver vc4_hdmi_audio_component_drv = { static const struct snd_soc_dai_ops vc4_hdmi_audio_dai_ops = { .startup = vc4_hdmi_audio_startup, .shutdown = vc4_hdmi_audio_shutdown, @@ -172706,10 +171998,10 @@ index b2595ec65166..04b1807cb793 100644 2.18.4 -From fcd8a24568e3d9efe1feaee7643d2d48445e247f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Fri, 10 Jul 2020 11:51:16 +0100 -Subject: [PATCH 326/834] drm/vc4: enable HBR MAI format on HBR streams +Subject: [PATCH 319/889] drm/vc4: enable HBR MAI format on HBR streams Signed-off-by: Matthias Reichl --- @@ -172717,10 +172009,10 @@ Signed-off-by: Matthias Reichl 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 04b1807cb793..c419a5d0c75d 100644 +index 846b027126d0..7f740fde0b4d 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1079,7 +1079,11 @@ static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream, +@@ -1062,7 +1062,11 @@ static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream, vc4_hdmi_audio_set_mai_clock(vc4_hdmi); mai_sample_rate = sample_rate_to_mai_fmt(vc4_hdmi->audio.samplerate); @@ -172737,10 +172029,10 @@ index 04b1807cb793..c419a5d0c75d 100644 2.18.4 -From b34991f5d51693656ab70a0bc303dfc563029bdc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Thu, 25 Jun 2020 18:48:40 +0100 -Subject: [PATCH 327/834] vc4_hdmi: Remove firmware logic for MAI threshold +Subject: [PATCH 320/889] vc4_hdmi: Remove firmware logic for MAI threshold setting This was a workaround for bugs in hardware on earlier Pi models @@ -172754,10 +172046,10 @@ Signed-off-by: Dom Cobley 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index c419a5d0c75d..ecaa1979b3a7 100644 +index 7f740fde0b4d..5a8f4adc3840 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1100,22 +1100,12 @@ static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream, +@@ -1083,22 +1083,12 @@ static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream, audio_packet_config |= VC4_SET_FIELD(channel_mask, VC4_HDMI_AUDIO_PACKET_CEA_MASK); @@ -172790,10 +172082,10 @@ index c419a5d0c75d..ecaa1979b3a7 100644 2.18.4 -From 31adaef921906df3a77eab14a271a8fab04f361a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 30 Jun 2020 11:23:49 +0100 -Subject: [PATCH 328/834] vc_hdmi: Set VC4_HDMI_MAI_CONFIG_FORMAT_REVERSE +Subject: [PATCH 321/889] 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 @@ -172805,10 +172097,10 @@ Signed-off-by: Dom Cobley 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index ecaa1979b3a7..6c8891105f16 100644 +index 5a8f4adc3840..a016f30a662d 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1109,6 +1109,7 @@ static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream, +@@ -1092,6 +1092,7 @@ static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream, HDMI_WRITE(HDMI_MAI_CONFIG, VC4_HDMI_MAI_CONFIG_BIT_REVERSE | @@ -172820,10 +172112,10 @@ index ecaa1979b3a7..6c8891105f16 100644 2.18.4 -From 45edcf09d4483267201a14f7aafe1e19e1e8b5d6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 20 Apr 2020 18:00:38 +0100 -Subject: [PATCH 329/834] vc4: Report channel mapping back to userspace +Subject: [PATCH 322/889] vc4: Report channel mapping back to userspace This follows logic in hdmi-codec.c to use speaker layout from ELD to choose a suitable speaker mapping based on @@ -172840,7 +172132,7 @@ Signed-off-by: Dom Cobley 2 files changed, 418 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 6c8891105f16..37ce071354dc 100644 +index a016f30a662d..30de86b63a58 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -49,6 +49,7 @@ @@ -173173,7 +172465,7 @@ index 6c8891105f16..37ce071354dc 100644 vc4_hdmi_write_infoframe(encoder, &frame); } -@@ -969,6 +1278,10 @@ static int vc4_hdmi_audio_startup(struct snd_pcm_substream *substream, +@@ -952,6 +1261,10 @@ static int vc4_hdmi_audio_startup(struct snd_pcm_substream *substream, if (ret) return ret; @@ -173184,7 +172476,7 @@ index 6c8891105f16..37ce071354dc 100644 return 0; } -@@ -1055,6 +1368,7 @@ static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream, +@@ -1038,6 +1351,7 @@ static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream, u32 channel_map; u32 mai_audio_format; u32 mai_sample_rate; @@ -173192,7 +172484,7 @@ index 6c8891105f16..37ce071354dc 100644 if (substream != vc4_hdmi->audio.substream) return -EINVAL; -@@ -1117,6 +1431,14 @@ static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream, +@@ -1100,6 +1414,14 @@ static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream, HDMI_WRITE(HDMI_AUDIO_PACKET_CONFIG, audio_packet_config); vc4_hdmi_set_n_cts(vc4_hdmi); @@ -173207,7 +172499,7 @@ index 6c8891105f16..37ce071354dc 100644 vc4_hdmi_set_audio_infoframe(encoder); return 0; -@@ -1235,6 +1557,89 @@ static int vc4_spdif_mask_get(struct snd_kcontrol *kcontrol, +@@ -1218,6 +1540,89 @@ static int vc4_spdif_mask_get(struct snd_kcontrol *kcontrol, return 0; } @@ -173297,7 +172589,7 @@ index 6c8891105f16..37ce071354dc 100644 static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = { { .access = SNDRV_CTL_ELEM_ACCESS_READ | -@@ -1257,6 +1662,16 @@ static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = { +@@ -1240,6 +1645,16 @@ static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = { .info = vc4_spdif_info, .get = vc4_spdif_mask_get, }, @@ -173315,10 +172607,10 @@ index 6c8891105f16..37ce071354dc 100644 static const struct snd_soc_dapm_widget vc4_hdmi_audio_widgets[] = { diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index c75d4c9e1515..1680e1a56149 100644 +index dec3e0a9ab07..e9dbdc80eb2d 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -118,6 +118,9 @@ struct vc4_hdmi_audio { +@@ -112,6 +112,9 @@ struct vc4_hdmi_audio { bool streaming; unsigned char iec_status[4]; @@ -173332,10 +172624,10 @@ index c75d4c9e1515..1680e1a56149 100644 2.18.4 -From 1fad17a971b37c75bde94fc94e1cbf7fa8340862 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 24 Jan 2020 14:25:41 +0000 -Subject: [PATCH 330/834] drm/vc4: Add support for DRM_FORMAT_P030 to vc4 +Subject: [PATCH 323/889] drm/vc4: Add support for DRM_FORMAT_P030 to vc4 planes This currently doesn't handle non-zero source rectangles correctly, @@ -173501,10 +172793,10 @@ index af4b8944a603..ec591839810a 100644 2.18.4 -From ac0d78649f7aa50f15e15f2f0faf018242110b50 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 17 Sep 2019 18:28:17 +0100 -Subject: [PATCH 331/834] drm/vc4: Add support for YUV color encodings and +Subject: [PATCH 324/889] drm/vc4: Add support for YUV color encodings and ranges The BT601/BT709 color encoding and limited vs full @@ -173617,10 +172909,10 @@ index ec591839810a..3d33fe3dacea 100644 } diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h -index c10402e103d6..1f1ed7efaff7 100644 +index 489f921ef44d..78fd28599aeb 100644 --- a/drivers/gpu/drm/vc4/vc4_regs.h +++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -985,6 +985,7 @@ enum hvs_pixel_format { +@@ -976,6 +976,7 @@ enum hvs_pixel_format { #define SCALER_CSC0_ITR_R_601_5 0x00f00000 #define SCALER_CSC0_ITR_R_709_3 0x00f00000 #define SCALER_CSC0_JPEG_JFIF 0x00000000 @@ -173628,7 +172920,7 @@ index c10402e103d6..1f1ed7efaff7 100644 /* S2.8 contribution of Cb to Green */ #define SCALER_CSC1_COEF_CB_GRN_MASK VC4_MASK(31, 22) -@@ -1001,6 +1002,7 @@ enum hvs_pixel_format { +@@ -992,6 +993,7 @@ enum hvs_pixel_format { #define SCALER_CSC1_ITR_R_601_5 0xe73304a8 #define SCALER_CSC1_ITR_R_709_3 0xf2b784a8 #define SCALER_CSC1_JPEG_JFIF 0xea34a400 @@ -173636,7 +172928,7 @@ index c10402e103d6..1f1ed7efaff7 100644 /* S2.8 contribution of Cb to Red */ #define SCALER_CSC2_COEF_CB_RED_MASK VC4_MASK(29, 20) -@@ -1014,6 +1016,7 @@ enum hvs_pixel_format { +@@ -1005,6 +1007,7 @@ enum hvs_pixel_format { #define SCALER_CSC2_ITR_R_601_5 0x00066204 #define SCALER_CSC2_ITR_R_709_3 0x00072a1c #define SCALER_CSC2_JPEG_JFIF 0x000599c5 @@ -173648,10 +172940,10 @@ index c10402e103d6..1f1ed7efaff7 100644 2.18.4 -From fa3dae8a61cb528e1b9ed2afa8f809f1fac0a358 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 7 Sep 2020 17:32:27 +0100 -Subject: [PATCH 332/834] drm/vc4: Add firmware-kms mode +Subject: [PATCH 325/889] drm/vc4: Add firmware-kms mode This is a squash of all firmware-kms related patches from previous branches, up to and including @@ -176005,7 +175297,7 @@ index 000000000000..e8d2b4b162f7 + VC_IMAGE_YUVINFO_CSC_REC_2020 = 9, +}; diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h -index d0ee609a9043..05c6989ec4c6 100644 +index 21bfcafae74e..b3ab1c091f41 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -75,6 +75,7 @@ enum rpi_firmware_property_tag { @@ -176032,10 +175324,10 @@ index d0ee609a9043..05c6989ec4c6 100644 2.18.4 -From 6d2b7da9a7a2f1535d4ecd4c4b332cb3bfc89556 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 19 May 2020 16:20:30 +0100 -Subject: [PATCH 333/834] drm/vc4: Add FKMS as an acceptable node for dma +Subject: [PATCH 326/889] drm/vc4: Add FKMS as an acceptable node for dma ranges. Under FKMS, the firmware (via FKMS) also requires the VideoCore cache @@ -176065,10 +175357,10 @@ index c8f9031fa946..d6576841d0fe 100644 2.18.4 -From a53b5ea229cb381569b018fb0536ca3c07f6fe5b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 8 May 2020 10:00:12 +0100 -Subject: [PATCH 334/834] media: i2c: Add driver for Sony IMX477 sensor +Subject: [PATCH 327/889] media: i2c: Add driver for Sony IMX477 sensor Adds a driver for the 12MPix Sony IMX477 CSI2 sensor. Whilst the sensor supports 2 or 4 CSI2 data lanes, this driver @@ -178344,10 +177636,10 @@ index 000000000000..ec56b0cfd57b 2.18.4 -From 29a41228661795dce840c605b5d650191df918a1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 8 May 2020 09:41:17 +0100 -Subject: [PATCH 335/834] media: i2c: imx477: Add support for adaptive frame +Subject: [PATCH 328/889] media: i2c: imx477: Add support for adaptive frame control Use V4L2_CID_EXPOSURE_AUTO_PRIORITY to control if the driver should @@ -178532,10 +177824,10 @@ index ec56b0cfd57b..bd0e2c291a32 100644 2.18.4 -From f0948355c2d333daa7b5a95355d7865076b6c4dc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 19 May 2020 16:56:33 +0100 -Subject: [PATCH 336/834] media: i2c: imx477: Return correct result on sensor +Subject: [PATCH 329/889] media: i2c: imx477: Return correct result on sensor id verification The test should return -EIO if the register read id does not match @@ -178563,10 +177855,10 @@ index bd0e2c291a32..e42a8633087d 100644 2.18.4 -From b577fef69f1daddec4c14ac4b2220eb4b3dad241 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 4 Jul 2020 01:45:08 +0300 -Subject: [PATCH 337/834] media: i2c: imx477: Parse and register properties +Subject: [PATCH 330/889] media: i2c: imx477: Parse and register properties Parse device properties and register controls for them using the V4L2 fwnode properties helpers. @@ -178614,10 +177906,10 @@ index e42a8633087d..3fbb173fa079 100644 2.18.4 -From f70d45a34a1ca67a1b56a8311907b3cb3017f7f5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 13 May 2020 18:28:27 +0100 -Subject: [PATCH 338/834] media: bcm2835-unicam: Always service interrupts +Subject: [PATCH 331/889] media: bcm2835-unicam: Always service interrupts From when bringing up the driver, there was a check in the isr to ignore interrupts (claiming them handled) should the driver @@ -178671,10 +177963,10 @@ index 35ddb97f7f75..d4ba911fe7e7 100644 2.18.4 -From f5da03b64eb9fb2315d157d58a208066fbe474ce Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jacko Dirks Date: Tue, 5 May 2020 14:33:31 +0200 -Subject: [PATCH 339/834] media: bcm2835: unicam: Fix uninitialized warning +Subject: [PATCH 332/889] media: bcm2835: unicam: Fix uninitialized warning Signed-off-by: Jacko Dirks --- @@ -178698,10 +177990,10 @@ index d4ba911fe7e7..8b091d3a0d15 100644 2.18.4 -From 56dcf59b4741f8bb63f07d0f31bdb8989e0ed14e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 23 Jun 2020 15:14:05 +0100 -Subject: [PATCH 340/834] media: bcm2835-unicam: Fixup review comments from +Subject: [PATCH 333/889] media: bcm2835-unicam: Fixup review comments from Hans. Updates the driver based on the upstream review comments from @@ -178950,10 +178242,10 @@ index 8b091d3a0d15..7dc96c3e8e83 100644 2.18.4 -From b9b07a398794b2455e28f77de20013bfa2e3826e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 19 May 2020 11:46:47 +0100 -Subject: [PATCH 341/834] media: bcm2835-unicam: Retain packing information on +Subject: [PATCH 334/889] media: bcm2835-unicam: Retain packing information on G_FMT The change to retrieve the pixel format always on g_fmt didn't @@ -179004,10 +178296,10 @@ index 7dc96c3e8e83..98ae97c367ea 100644 2.18.4 -From 5583c674ae3a038bc065dc5495bb36b9a912f916 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 28 May 2020 11:09:48 +0100 -Subject: [PATCH 342/834] media: bcm2835-unicam: change minimum number of +Subject: [PATCH 335/889] media: bcm2835-unicam: change minimum number of vb2_queue buffers to 1 Since the unicam driver was modified to write to a dummy buffer when no @@ -179038,10 +178330,10 @@ index 98ae97c367ea..6501fb205e20 100644 2.18.4 -From 27eb82c6a105a78603b9a2bf6e18e9f8e7e341f8 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 1 Sep 2020 18:15:27 +0100 -Subject: [PATCH 343/834] staging/fbtft: Add support for display variants +Subject: [PATCH 336/889] staging/fbtft: Add support for display variants Display variants are intended as a replacement for the now-deleted fbtft_device drivers. Drivers can register additional compatible @@ -179253,10 +178545,10 @@ index 76f8c090a837..f4f5ff0dc0c0 100644 2.18.4 -From c7fd8cb4a55abbce0c4280ee8173ea0c75394235 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 3 Feb 2020 09:32:22 +0000 -Subject: [PATCH 344/834] brcmfmac: Increase power saving delay to 2s +Subject: [PATCH 337/889] brcmfmac: Increase power saving delay to 2s Increase the delay before entering the lower power state to 2 seconds (the maximum allowed) in order to reduce the packet latencies, @@ -179292,10 +178584,10 @@ index 496f6125a3f6..e51b42b547be 100644 2.18.4 -From 3989f6c1e8bb2ebfb11b801aa1c374d1e52b1788 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 21 Sep 2020 14:02:44 +0100 -Subject: [PATCH 345/834] rpivid_h265: Fix width/height typo +Subject: [PATCH 338/889] rpivid_h265: Fix width/height typo Signed-off-by: popcornmix --- @@ -179319,10 +178611,10 @@ index 47d4de42c584..b677910e237c 100644 2.18.4 -From a9fe7ffb3380333e101c147374ade733af756207 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 25 Sep 2020 15:07:23 +0100 -Subject: [PATCH 346/834] net: bcmgenet: Reset RBUF on first open +Subject: [PATCH 339/889] net: bcmgenet: Reset RBUF on first open If the RBUF logic is not reset when the kernel starts then there may be some data left over from any network boot loader. If the @@ -179395,10 +178687,10 @@ index 06e0e3d0f2b5..8da6f867b6d2 100644 2.18.4 -From 429fadc888bd0650ac9b6487ce4910640fe0175c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Sep 2020 20:23:30 +0100 -Subject: [PATCH 347/834] char: Add broadcom char drivers back to build files +Subject: [PATCH 340/889] char: Add broadcom char drivers back to build files See: https://github.com/raspberrypi/linux/issues/3875 Signed-off-by: popcornmix @@ -179433,10 +178725,10 @@ index ffce287ef415..463ff9f136e4 100644 2.18.4 -From 7398a7e25650710d72c4f1e6274547f66457c172 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Wed, 7 Oct 2020 15:09:29 +0100 -Subject: [PATCH 348/834] dwc_otg: initialise sched_frame for periodic QHs that +Subject: [PATCH 341/889] dwc_otg: initialise sched_frame for periodic QHs that were parked If a periodic QH has no remaining QTDs, then it is removed from all @@ -179472,10 +178764,10 @@ index 2823dc9af63f..4503af692aef 100644 2.18.4 -From 3f4bf7bf7a83f792063d79fc4387eb63c0e75a5c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 8 Oct 2020 15:35:14 +0100 -Subject: [PATCH 349/834] staging: bcm2835-camera: Replace deprecated +Subject: [PATCH 342/889] staging: bcm2835-camera: Replace deprecated V4L2_PIX_FMT_BGR32 V4L2_PIX_FMT_BGR32 is deprecated as it is ambiguous over where @@ -179508,10 +178800,10 @@ index bea37cb163fc..e0a96dbb843d 100644 2.18.4 -From 1a3b465da1e1fc288237fb3ddedf4ebffc0b63cd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 8 Oct 2020 18:49:52 +0100 -Subject: [PATCH 350/834] staging: vc04_services: Add new vc-sm-cma driver +Subject: [PATCH 343/889] staging: vc04_services: Add new vc-sm-cma driver Add Broadcom VideoCore Shared Memory support. @@ -182472,10 +181764,10 @@ index 000000000000..988fdd967922 2.18.4 -From 0abc3d9a3946886091d8209c2c19eccfda46da63 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 6 May 2020 18:09:04 +0100 -Subject: [PATCH 351/834] staging: vchiq-mmal: Add support for 14bit Bayer +Subject: [PATCH 344/889] staging: vchiq-mmal: Add support for 14bit Bayer Add in the missing defines. @@ -182505,10 +181797,10 @@ index 44ba91aa6d47..be8af09a6c80 100644 2.18.4 -From cc2fc08dceaee401a5a9edc77b2567ccdbf31b3b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 6 May 2020 18:11:14 +0100 -Subject: [PATCH 352/834] staging: mmal-vchiq: Add monochrome image formats +Subject: [PATCH 345/889] staging: mmal-vchiq: Add monochrome image formats Adds support for monochrome image formats in the various MIPI packings. @@ -182540,10 +181832,10 @@ index be8af09a6c80..897e6cdf8dd9 100644 2.18.4 -From 1528cc8d1e027ce3125bbbd6993ee20106a68927 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 25 Sep 2018 16:07:55 +0100 -Subject: [PATCH 353/834] staging: mmal-vchiq: Use vc-sm-cma to support zero +Subject: [PATCH 346/889] staging: mmal-vchiq: Use vc-sm-cma to support zero copy With the vc-sm-cma driver we can support zero copy of buffers between @@ -182714,10 +182006,10 @@ index e87f88f99338..247521fbcc1d 100644 2.18.4 -From a941eec37121ef429259112ff14fae9157793d05 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 8 Oct 2020 20:24:12 +0100 -Subject: [PATCH 354/834] staging: vc04_services: Add a V4L2 M2M codec driver +Subject: [PATCH 347/889] staging: vc04_services: Add a V4L2 M2M codec driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -185804,10 +185096,10 @@ index 000000000000..d490ff67f747 2.18.4 -From a4cdd985a54892b7407cd74ce49a523d4c823303 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2020 00:48:55 +0200 -Subject: [PATCH 355/834] bcm2835-dma: only reserve channel 0 if legacy dma +Subject: [PATCH 348/889] bcm2835-dma: only reserve channel 0 if legacy dma driver is enabled If CONFIG_DMA_BCM2708 isn't enabled there's no need to mask out @@ -185842,10 +185134,10 @@ index d1127b9058a4..0cbfa9d559a2 100644 2.18.4 -From 7130cff582e9d49e1c327feede07cba6970e9681 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 12 Oct 2020 17:03:14 +0100 -Subject: [PATCH 356/834] uapi: bcm2835-isp: Add bcm2835-isp uapi header file +Subject: [PATCH 349/889] uapi: bcm2835-isp: Add bcm2835-isp uapi header file This file defines the userland interface to the bcm2835-isp driver that will follow in a separate commit. @@ -186187,10 +185479,10 @@ index 000000000000..cf8c0437f159 2.18.4 -From cb41e9be655549ead6e9e541a82fce416709ac1e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 23 Apr 2020 10:17:37 +0100 -Subject: [PATCH 357/834] staging: vc04_services: ISP: Add a more complex ISP +Subject: [PATCH 350/889] staging: vc04_services: ISP: Add a more complex ISP processing component Driver for the BCM2835 ISP hardware block. This driver uses the MMAL @@ -188622,10 +187914,10 @@ index 89059bca0b77..5b596b5c057f 100644 2.18.4 -From b3617bfede3fa83f5508c9610a270e61482b7cbd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 31 Jul 2019 17:36:34 +0100 -Subject: [PATCH 358/834] drm/vc4: A present but empty dmas disables audio +Subject: [PATCH 351/889] drm/vc4: A present but empty dmas disables audio Overlays are unable to remove properties in the base DTB, but they can overwrite them. Allow a present but empty 'dmas' property @@ -188639,10 +187931,10 @@ Signed-off-by: Phil Elwell 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 37ce071354dc..94debdfbfbee 100644 +index 30de86b63a58..3ee0b82a5718 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1762,10 +1762,12 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) +@@ -1745,10 +1745,12 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) const __be32 *addr; int index; int ret; @@ -188661,10 +187953,10 @@ index 37ce071354dc..94debdfbfbee 100644 2.18.4 -From 1162005e5d9821a59c07ac9946d6c1e2bbf6cffb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 6 Oct 2020 18:44:42 +0100 -Subject: [PATCH 359/834] drm/vc4: Add debugfs node that dumps the current +Subject: [PATCH 352/889] drm/vc4: Add debugfs node that dumps the current display lists This allows easy analysis of display lists when debugging. @@ -188737,10 +188029,10 @@ index ad691571d759..b5015d036d46 100644 2.18.4 -From 141e1e69cf1975dc64d7354fdc5ac4e37673438b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 30 Sep 2020 12:00:54 +0100 -Subject: [PATCH 360/834] gpio: Add gpio-fsm driver +Subject: [PATCH 353/889] gpio: Add gpio-fsm driver The gpio-fsm driver implements simple state machines that allow GPIOs to be controlled in response to inputs from other GPIOs - real and @@ -189933,10 +189225,10 @@ index 000000000000..eb40cfdc71df 2.18.4 -From 7d03d9bbe68582503c572d373907d40b1dfc1d4e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 21 Oct 2020 18:34:56 +0100 -Subject: [PATCH 361/834] drm/vc4: Add all the HDMI registers into the debugfs +Subject: [PATCH 354/889] drm/vc4: Add all the HDMI registers into the debugfs dumps The vc5 HDMI registers hadn't been added into the debugfs @@ -189945,29 +189237,28 @@ Add them in. Signed-off-by: Dave Stevenson --- - drivers/gpu/drm/vc4/vc4_hdmi.c | 44 ++++++++++++++++++++++++++++++++++ - drivers/gpu/drm/vc4/vc4_hdmi.h | 9 +++++++ - 2 files changed, 53 insertions(+) + drivers/gpu/drm/vc4/vc4_hdmi.c | 39 ++++++++++++++++++++++++++++++++++ + drivers/gpu/drm/vc4/vc4_hdmi.h | 8 +++++++ + 2 files changed, 47 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 94debdfbfbee..9e0aa45fafa2 100644 +index 3ee0b82a5718..be9dc99f0ff5 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -397,6 +397,13 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) +@@ -397,6 +397,12 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) drm_print_regset32(&p, &vc4_hdmi->hdmi_regset); drm_print_regset32(&p, &vc4_hdmi->hd_regset); + drm_print_regset32(&p, &vc4_hdmi->cec_regset); + drm_print_regset32(&p, &vc4_hdmi->csc_regset); + drm_print_regset32(&p, &vc4_hdmi->dvp_regset); -+ drm_print_regset32(&p, &vc4_hdmi->intr2_regset); + drm_print_regset32(&p, &vc4_hdmi->phy_regset); + drm_print_regset32(&p, &vc4_hdmi->ram_regset); + drm_print_regset32(&p, &vc4_hdmi->rm_regset); return 0; } -@@ -2167,6 +2174,7 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) +@@ -2149,6 +2155,7 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) struct platform_device *pdev = vc4_hdmi->pdev; struct device *dev = &pdev->dev; struct resource *res; @@ -189975,7 +189266,7 @@ index 94debdfbfbee..9e0aa45fafa2 100644 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi"); if (!res) -@@ -2265,6 +2273,42 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) +@@ -2239,6 +2246,38 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) return PTR_ERR(vc4_hdmi->reset); } @@ -190011,18 +189302,14 @@ index 94debdfbfbee..9e0aa45fafa2 100644 + if (ret) + return ret; + -+ ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->intr2_regset, VC5_INTR2); -+ if (ret) -+ return ret; -+ return 0; } diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index 1680e1a56149..1eb1fc0d95a3 100644 +index e9dbdc80eb2d..165d80928143 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -175,8 +175,17 @@ struct vc4_hdmi { +@@ -167,8 +167,16 @@ struct vc4_hdmi { struct reset_control *reset; @@ -190033,7 +189320,6 @@ index 1680e1a56149..1eb1fc0d95a3 100644 + struct debugfs_regset32 cec_regset; + struct debugfs_regset32 csc_regset; + struct debugfs_regset32 dvp_regset; -+ struct debugfs_regset32 intr2_regset; + struct debugfs_regset32 phy_regset; + struct debugfs_regset32 ram_regset; + struct debugfs_regset32 rm_regset; @@ -190044,10 +189330,10 @@ index 1680e1a56149..1eb1fc0d95a3 100644 2.18.4 -From 616f8e3c652b1f3fa51ad017f9504c7d320ef72e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 19 Mar 2020 10:04:46 +0000 -Subject: [PATCH 362/834] ARM: dts: bcm271x: Use a53 pmu, drop RPI364 +Subject: [PATCH 355/889] 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 @@ -190127,10 +189413,10 @@ index 1fd86f81f542..bf69a4b0b172 100644 2.18.4 -From d7470c25d341360c367dc6d7029a5dd37451e143 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 23 Oct 2020 14:15:41 +0100 -Subject: [PATCH 363/834] overlays: Add option to disable composite to +Subject: [PATCH 356/889] overlays: Add option to disable composite to vc4-kms-v3d Composite gets enabled automatically if HDMI isn't detected, @@ -190171,10 +189457,10 @@ index 6d34a2bff49b..5a4efdeed663 100644 2.18.4 -From 53ac9173aaed79a1ddd81f77f2bce8685e8b42d4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 11 Mar 2020 12:07:57 +0000 -Subject: [PATCH 364/834] overlays: imx219: Correct link frequency to match the +Subject: [PATCH 357/889] overlays: imx219: Correct link frequency to match the upstream driver The upstream driver is checking the link frequency parameter, and @@ -190202,10 +189488,10 @@ index 3484bde5a9e8..dce07b335c4e 100644 2.18.4 -From 833e878d86d4f92e8fd894f5e356e050aec2d807 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 23 Oct 2020 15:45:11 +0100 -Subject: [PATCH 365/834] dts: Add CM4 to arm64 dt files +Subject: [PATCH 358/889] dts: Add CM4 to arm64 dt files Signed-off-by: Dave Stevenson --- @@ -190239,10 +189525,10 @@ index 000000000000..8064a58155f1 2.18.4 -From 79ab46f9d2e66c5374f9fc5e3a3250ecd06f37da Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 26 Oct 2020 12:38:27 +0000 -Subject: [PATCH 366/834] drm/vc4: Add the 2711 HVS as a suitable DMA node +Subject: [PATCH 359/889] drm/vc4: Add the 2711 HVS as a suitable DMA node With vc4-drv node not being under /soc on Pi4, we need to adopt the correct DMA parameters from a suitable sub-component. @@ -190269,10 +189555,10 @@ index d6576841d0fe..617c113b033f 100644 2.18.4 -From 46960c9a16b676c3293eb1cf7dcf026826c036df Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Mon, 26 Oct 2020 14:03:35 +0000 -Subject: [PATCH 367/834] xhci: quirks: add link TRB quirk for VL805 +Subject: [PATCH 360/889] xhci: quirks: add link TRB quirk for VL805 The VL805 controller can't cope with the TR Dequeue Pointer for an endpoint being set to a Link TRB. The hardware-maintained endpoint context ends up @@ -190304,7 +189590,7 @@ index 618a131bdd53..153165fb8d88 100644 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index 9106f0a1909a..0797964e8f36 100644 +index c8d733ff3eb5..7649cb9e277f 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -653,6 +653,16 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, @@ -190325,10 +189611,10 @@ index 9106f0a1909a..0797964e8f36 100644 state->new_deq_ptr = new_deq; diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index 3bf1cf0aabb1..bea47cb6b9c5 100644 +index f852e3f2cbd0..38650e4a99d2 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1882,6 +1882,7 @@ struct xhci_hcd { +@@ -1885,6 +1885,7 @@ struct xhci_hcd { #define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39) #define XHCI_NO_SOFT_RETRY BIT_ULL(40) #define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(41) @@ -190340,10 +189626,10 @@ index 3bf1cf0aabb1..bea47cb6b9c5 100644 2.18.4 -From d7c20d773dc387400730fb85149791e60863bef2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Oct 2020 15:01:21 +0000 -Subject: [PATCH 368/834] dts: Tidy the Raspberry Pi Makefile entries +Subject: [PATCH 361/889] dts: Tidy the Raspberry Pi Makefile entries Signed-off-by: Phil Elwell --- @@ -190391,10 +189677,10 @@ index 1e861e2bf2e0..996e670a6018 100644 2.18.4 -From ca37c3cf95e04d7fe93bac1929e766ce720a5354 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Oct 2020 10:23:22 +0000 -Subject: [PATCH 369/834] staging: bcm2835-audio: Add disable-headphones flag +Subject: [PATCH 362/889] staging: bcm2835-audio: Add disable-headphones flag Add a property to allow the headphone output to be disabled. Use an integer property rather than a boolean so that an overlay can clear it. @@ -190431,10 +189717,10 @@ index a0cba3823e5e..ccda115ab9e0 100644 2.18.4 -From 7a2983338f53f0ee0fca7ddf678a98783f25a527 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Oct 2020 10:18:50 +0000 -Subject: [PATCH 370/834] ARM: dts: Disable headphone audio on Zeroes, CM4 +Subject: [PATCH 363/889] ARM: dts: Disable headphone audio on Zeroes, CM4 Signed-off-by: Phil Elwell --- @@ -190483,10 +189769,10 @@ index 0ca3a0126220..fa7b16040f36 100644 2.18.4 -From 1558023c3082a74c235e8173d861a5a678ab7c83 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Oct 2020 10:21:23 +0000 -Subject: [PATCH 371/834] overlays: Enable headphone audio in audremap +Subject: [PATCH 364/889] overlays: Enable headphone audio in audremap Signed-off-by: Phil Elwell --- @@ -190515,10 +189801,10 @@ index d624bb3a3fea..7324890ead86 100644 2.18.4 -From 2ecfbcb09cb1b01ca364414ad901df05523208a0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 26 Oct 2020 16:38:21 +0000 -Subject: [PATCH 372/834] rpisense-fb: Set pseudo_pallete to prevent crash on +Subject: [PATCH 365/889] rpisense-fb: Set pseudo_pallete to prevent crash on fbcon takeover Signed-off-by: Serge Schneider @@ -190551,10 +189837,10 @@ index 26432a5a0b4b..325977def531 100644 2.18.4 -From 1a7f5e058783ae337cc47c88cbcbe9cbaac76028 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Oct 2020 10:35:43 +0000 -Subject: [PATCH 373/834] ARM: dts: Expand PCIe space on BCM2711 +Subject: [PATCH 366/889] 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 @@ -190587,10 +189873,10 @@ index 6e0339266027..27c622ebee0d 100644 2.18.4 -From 3e81e61ce7fa49044453beb9d4f932944a43e0e6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Oct 2020 21:51:29 +0000 -Subject: [PATCH 374/834] configs: Set RASPBERRYPI_FIRMWARE for arm64 bcm2711 +Subject: [PATCH 367/889] configs: Set RASPBERRYPI_FIRMWARE for arm64 bcm2711 RASPBERRYPI_FIRMWARE was missing from the arm64 bcm2711_defconfig. bcmrpi3_defconfig was also missing a few options. Add the misssing @@ -190741,10 +190027,10 @@ index d542d2522076..6247c74639f7 100644 2.18.4 -From 43e5f8e0f3d2c1a2e7099cfb0664ccfd2fb00cef Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 27 Oct 2020 09:59:49 +0000 -Subject: [PATCH 375/834] dwc_otg: Minimise header and fix build warnings +Subject: [PATCH 368/889] dwc_otg: Minimise header and fix build warnings Delete a large amount of unused declaration from "usb.h", some of which were causing build warnings, and get the module building cleanly. @@ -191646,10 +190932,10 @@ index e55ea9c74be4..76e94b4ebb43 100644 2.18.4 -From 48f6bdbc5c0d8686d1c543ad356846812ebc4f7f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 27 Oct 2020 12:10:04 +0000 -Subject: [PATCH 376/834] gpio-fsm: Fix a build warning +Subject: [PATCH 369/889] gpio-fsm: Fix a build warning Signed-off-by: Phil Elwell --- @@ -191674,10 +190960,10 @@ index eb8b4d58d2d0..2cab50e51315 100644 2.18.4 -From 58fb5e4be7f24c7c0e99ea2388fe0590d165b295 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 27 Oct 2020 12:10:40 +0000 -Subject: [PATCH 377/834] rpivid_h625: Fix build warnings +Subject: [PATCH 370/889] rpivid_h625: Fix build warnings Signed-off-by: Phil Elwell --- @@ -191748,10 +191034,10 @@ index b677910e237c..fc3caed58187 100644 2.18.4 -From 3a349a34075bcc7657cb9086c087f5af9ecb181f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 27 Oct 2020 12:12:22 +0000 -Subject: [PATCH 378/834] bcm2708_fb: Fix a build warning +Subject: [PATCH 371/889] bcm2708_fb: Fix a build warning Signed-off-by: Phil Elwell --- @@ -191776,10 +191062,10 @@ index dac5c021ce52..365c5b96b8a0 100644 2.18.4 -From eda4c1320627f6e1ea7d177dcc3e847800da423a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Knell Date: Wed, 28 Oct 2020 14:18:42 +0000 -Subject: [PATCH 379/834] PiFi-40 defconfigs +Subject: [PATCH 372/889] PiFi-40 defconfigs Signed-off-by: David Knell --- @@ -191854,10 +191140,10 @@ index 6247c74639f7..bc02ce537715 100644 2.18.4 -From 0bfc9ba676f7daf304a484e907e5d33bbdd1bef8 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Knell Date: Wed, 28 Oct 2020 14:20:56 +0000 -Subject: [PATCH 380/834] PiFi-40 Devicetree files +Subject: [PATCH 373/889] PiFi-40 Devicetree files Signed-off-by: David Knell --- @@ -191956,10 +191242,10 @@ index 000000000000..51a20e54977f 2.18.4 -From 49a8dabcc4e03cd42551004e6670e626c0a2113b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Knell Date: Wed, 28 Oct 2020 14:21:37 +0000 -Subject: [PATCH 381/834] PiFi-40 driver, Makefile and Kconfig +Subject: [PATCH 374/889] PiFi-40 driver, Makefile and Kconfig Signed-off-by: David Knell --- @@ -192299,10 +191585,10 @@ index 000000000000..ae699fb0485c 2.18.4 -From 77de4ab00bfd2aa8bb2a8542ecfc1abf707b56eb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 27 Oct 2020 12:24:14 +0000 -Subject: [PATCH 382/834] bcm2835-pcm: Fix up multichannel pcm audio +Subject: [PATCH 375/889] bcm2835-pcm: Fix up multichannel pcm audio Fixes: a9c1660ff5f02d048c5f31abf1fd1108ccf9ef87 Signed-off-by: Dom Cobley @@ -192360,10 +191646,10 @@ index 3c0033101e6e..fa5cf5b9550f 100644 2.18.4 -From c9ebb73cb3bf7cb567931007fd1ce6085f706d85 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Thu, 22 Oct 2020 15:30:55 +0100 -Subject: [PATCH 383/834] watchdog: bcm2835: Ignore params after the partition +Subject: [PATCH 376/889] watchdog: bcm2835: Ignore params after the partition number Use sscanf to extract the partition number and ignore extra parameters @@ -192395,10 +191681,10 @@ index 62937e6f83ca..de25e3682f03 100644 2.18.4 -From dc921b887feec4dda2b12eed443d08bc02873dab Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 20 Oct 2020 11:55:37 +0100 -Subject: [PATCH 384/834] firmware: raspberrypi: Add support for tryonce reboot +Subject: [PATCH 377/889] firmware: raspberrypi: Add support for tryonce reboot flag Define a new mailbox (SET_REBOOT_FLAGS) which may be used to @@ -192416,10 +191702,10 @@ mechanism to be implemented for OS upgrades. 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c -index 8da5be17b906..f53f52fa1711 100644 +index a47609ec7e63..45511deddf6c 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -191,6 +191,7 @@ static int rpi_firmware_notify_reboot(struct notifier_block *nb, +@@ -194,6 +194,7 @@ static int rpi_firmware_notify_reboot(struct notifier_block *nb, { struct rpi_firmware *fw; struct platform_device *pdev = g_pdev; @@ -192427,7 +191713,7 @@ index 8da5be17b906..f53f52fa1711 100644 if (!pdev) return 0; -@@ -199,8 +200,28 @@ static int rpi_firmware_notify_reboot(struct notifier_block *nb, +@@ -202,8 +203,28 @@ static int rpi_firmware_notify_reboot(struct notifier_block *nb, if (!fw) return 0; @@ -192459,7 +191745,7 @@ index 8da5be17b906..f53f52fa1711 100644 return 0; } diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h -index 05c6989ec4c6..6b393bbe7f52 100644 +index b3ab1c091f41..e3daf5ee4a9c 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -96,6 +96,8 @@ enum rpi_firmware_property_tag { @@ -192475,10 +191761,10 @@ index 05c6989ec4c6..6b393bbe7f52 100644 2.18.4 -From f6aad75af10d7845e4c41b15f6c6f42c4406e10d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 14 May 2019 17:00:41 +0100 -Subject: [PATCH 385/834] phy: broadcom: split out the BCM54213PE from the +Subject: [PATCH 378/889] phy: broadcom: split out the BCM54213PE from the BCM54210E IDs The last nibble is a revision ID, and the 54213pe is a later rev @@ -192553,10 +191839,10 @@ index 54665952d6ad..92948c26da2a 100644 2.18.4 -From e03e89a80b476671c09d0be7559740b53922a1f0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 29 Oct 2020 14:10:56 +0000 -Subject: [PATCH 386/834] phy: broadcom: Add bcm54213pe configuration +Subject: [PATCH 379/889] phy: broadcom: Add bcm54213pe configuration Signed-off-by: Phil Elwell --- @@ -192593,10 +191879,10 @@ index 671517aae345..8b0ac38742d0 100644 2.18.4 -From 08ec7dc0e1185ac4cbd74d0add982aed92fb8831 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 2 Nov 2020 14:56:18 +0000 -Subject: [PATCH 387/834] configs: Add CONFIG_MAX31856=m +Subject: [PATCH 380/889] configs: Add CONFIG_MAX31856=m Enable support for MAX31856 temperature sensors. @@ -192675,10 +191961,10 @@ index bc02ce537715..680b51ab0642 100644 2.18.4 -From a8057334bf56217f1e82701663d73c1958510c6b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 22 Oct 2020 17:11:12 +0100 -Subject: [PATCH 388/834] overlays: Add MAX31856 support to maxtherm overlay +Subject: [PATCH 381/889] 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 @@ -192785,10 +192071,10 @@ index 34d5727069ec..9964e246c14f 100644 2.18.4 -From 473c2169a504c7e9111a54d277efda17b71e1c25 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2020 14:21:33 +0100 -Subject: [PATCH 389/834] ARM: dts: Add bcm2711-rpi-400.dts +Subject: [PATCH 382/889] ARM: dts: Add bcm2711-rpi-400.dts Signed-off-by: Phil Elwell --- @@ -193456,10 +192742,10 @@ index 000000000000..90c2b5a195d4 2.18.4 -From 9008542bb3521ba35f405251838aefb3b29431e1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 4 Nov 2020 11:25:02 +0000 -Subject: [PATCH 390/834] overlays: Deprecate and delete the sdtweak overlay +Subject: [PATCH 383/889] 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. @@ -193581,10 +192867,10 @@ index 38157d2f9bf3..000000000000 2.18.4 -From c2ae0df0f34a6d2e8d03969da4f9fc56e09265fb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 5 Nov 2020 11:39:35 +0000 -Subject: [PATCH 391/834] ARM: dts: bcm27xx: Remove enable_headphones setting +Subject: [PATCH 384/889] 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 @@ -193711,10 +192997,10 @@ index fa7b16040f36..49c69fdaef49 100644 2.18.4 -From 587fa539fcb6a7026c6f2592974786276c9fb281 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: menschel Date: Fri, 6 Nov 2020 23:32:22 +0100 -Subject: [PATCH 392/834] configs: Add CAN_MCP251XFD=m and CAN_ISOTP=m +Subject: [PATCH 385/889] configs: Add CAN_MCP251XFD=m and CAN_ISOTP=m * Add mcp251xfd driver module to the RPi kernel builds. * Add isotp can protocol module to the RPi kernel builds. @@ -193806,10 +193092,10 @@ index 680b51ab0642..ff74c23ef24e 100644 2.18.4 -From 2640d5b18990e3ebbbe03d7cbbf5af912728bad5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 9 Nov 2020 19:49:32 +0000 -Subject: [PATCH 393/834] vc4_hdmi: Report that 3d/stereo is allowed +Subject: [PATCH 386/889] vc4_hdmi: Report that 3d/stereo is allowed Signed-off-by: Dom Cobley --- @@ -193817,10 +193103,10 @@ Signed-off-by: Dom Cobley 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 9e0aa45fafa2..c421cca29ff4 100644 +index be9dc99f0ff5..9bff19e468a0 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -563,6 +563,7 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, +@@ -562,6 +562,7 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, connector->interlace_allowed = 1; connector->doublescan_allowed = 0; @@ -193832,10 +193118,10 @@ index 9e0aa45fafa2..c421cca29ff4 100644 2.18.4 -From 91b5f8db639f169563e26135e38555eecaa624cb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 Nov 2020 17:08:33 +0000 -Subject: [PATCH 394/834] PCI: brcmstb: Restore initial fundamental reset +Subject: [PATCH 387/889] PCI: brcmstb: Restore initial fundamental reset [1] replaced a single reset function with a pointer to one of two implementations, but also removed the call asserting the reset @@ -193873,10 +193159,10 @@ index fea54f6fb7b1..bd0263d739c9 100644 2.18.4 -From 36570bdfe580504fde265ce0f5013f5f1158a588 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 10 Nov 2020 20:04:08 +0000 -Subject: [PATCH 395/834] vc4: Clear unused infoframe packet RAM registers +Subject: [PATCH 388/889] vc4: Clear unused infoframe packet RAM registers Using a hdmi analyser the bytes in packet ram registers beyond the length were visible in the @@ -193890,10 +193176,10 @@ Signed-off-by: Dom Cobley 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index c421cca29ff4..bbfd3e0358ed 100644 +index 9bff19e468a0..5e7f22ef3dc2 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -591,9 +591,11 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, +@@ -590,9 +590,11 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, const struct vc4_hdmi_register *ram_packet_start = &vc4_hdmi->variant->registers[HDMI_RAM_PACKET_START]; u32 packet_reg = ram_packet_start->offset + VC4_HDMI_PACKET_STRIDE * packet_id; @@ -193906,7 +193192,7 @@ index c421cca29ff4..bbfd3e0358ed 100644 ssize_t len, i; int ret; -@@ -626,6 +628,13 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, +@@ -625,6 +627,13 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, packet_reg += 4; } @@ -193924,10 +193210,10 @@ index c421cca29ff4..bbfd3e0358ed 100644 2.18.4 -From c50b5e9a8eeed28696a3c3da9410524df1271c63 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 6 Nov 2020 18:45:10 +0000 -Subject: [PATCH 396/834] Input: edt-ft5x06: Poll the device if no interrupt is +Subject: [PATCH 389/889] Input: edt-ft5x06: Poll the device if no interrupt is configured. Not all systems have the interrupt line wired up, so switch to @@ -194027,10 +193313,10 @@ index 6ff81d48da86..7e8acc0c19be 100644 2.18.4 -From 6f2bf7d71bdd079de2dbe57b54da51041e13bd31 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 6 Nov 2020 18:52:25 +0000 -Subject: [PATCH 397/834] dtoverlays: Add an overlay for the EDT FT5406 +Subject: [PATCH 390/889] dtoverlays: Add an overlay for the EDT FT5406 touchscreen This touchscreen controller is used by the 7" DSI panel, and @@ -194134,10 +193420,10 @@ index 000000000000..407af59bf468 2.18.4 -From c65a82c816b4bd3377fd92575d136efc4345b71b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 23 Apr 2020 10:17:18 +0100 -Subject: [PATCH 398/834] drm/panel/raspberrypi-touchscreen: Use independent +Subject: [PATCH 391/889] drm/panel/raspberrypi-touchscreen: Use independent I2C actions with delay. We now have the hardware I2C controller pinmuxed to the drive the @@ -194198,10 +193484,10 @@ index bbdd086be7f5..057263c89998 100644 2.18.4 -From 176b974d95f35350426d53cfb614be5de866c2f2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 10 Nov 2020 11:21:56 +0000 -Subject: [PATCH 399/834] drm/panel/raspberrypi-ts: Insert delay before polling +Subject: [PATCH 392/889] drm/panel/raspberrypi-ts: Insert delay before polling for startup state In switching to the hardware I2C controller there is an issue @@ -194230,10 +193516,10 @@ index 057263c89998..804bdcc978dd 100644 2.18.4 -From 3f8ce4c24c0394035aade2de6914b4141c7ae4b3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 10 Nov 2020 17:49:35 +0000 -Subject: [PATCH 400/834] Add devicetree support for RaspberryPi 7" panel over +Subject: [PATCH 393/889] Add devicetree support for RaspberryPi 7" panel over DSI I2C Signed-off-by: Dave Stevenson @@ -194341,10 +193627,10 @@ index 000000000000..086f4ffd633a 2.18.4 -From fba3cb5b99b4116784f35a581d3bb277e406e9e6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Fri, 15 Nov 2019 00:54:07 +0100 -Subject: [PATCH 401/834] mcp251xfd: add overlay +Subject: [PATCH 394/889] mcp251xfd: add overlay Signed-off-by: Marc Kleine-Budde --- @@ -194635,10 +193921,10 @@ index 000000000000..65c861bbd340 2.18.4 -From 037cd644c52806c8c3cca05511cda1f4297005ab Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 23 Nov 2020 14:53:14 +0000 -Subject: [PATCH 402/834] configs: Regenerate the defconfigs +Subject: [PATCH 395/889] configs: Regenerate the defconfigs The CAN_ISOTP setting was in the wrong position, and it's better for bisecting and reverting if this doesn't get rolled into the next @@ -194750,10 +194036,10 @@ index ff74c23ef24e..6939accc59bf 100644 2.18.4 -From 0127f7f5ed5c6fb8a40300dc35972facba64d3bf Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 23 Nov 2020 14:56:18 +0000 -Subject: [PATCH 403/834] configs: Restore BRIDGE_NETFILTER=m +Subject: [PATCH 396/889] configs: Restore BRIDGE_NETFILTER=m CONFIG_BRIDGE_NETFILTER=m used to be the default when CONFIG_NETFILTER was enabled, but that was removed in 5.9. The way that defconfigs work @@ -194835,10 +194121,10 @@ index 6939accc59bf..88ae301afcb4 100644 2.18.4 -From 945a0316600bd2fddced8879b84d1e873b6bf2fb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 23 Nov 2020 16:17:31 +0100 -Subject: [PATCH 404/834] configs: Enable WireGuard kernel module on armhf +Subject: [PATCH 397/889] configs: Enable WireGuard kernel module on armhf configs CONFIG_WIREGUARD=m implies CONFIG_ARM_CRYPTO=y, hence the latter is removed. @@ -194914,10 +194200,10 @@ index d8484c28caed..77c400a1ecd9 100644 2.18.4 -From a81b425000643c31cac92aa0f4b697e5ceee56ae Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sun, 22 Nov 2020 11:01:08 +0000 -Subject: [PATCH 405/834] media: ov9281: Add 1280x720 and 640x480 modes +Subject: [PATCH 398/889] media: ov9281: Add 1280x720 and 640x480 modes Breaks out common register set and adds the different registers for 1280x720 (cropped) and 640x480 (skipped) modes @@ -195129,91 +194415,10 @@ index 9610c24ceff1..12621c2dccd5 100644 2.18.4 -From 512b757b76520bdc230e491709069851c0e0643b Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 11 Nov 2020 17:18:01 +0000 -Subject: [PATCH 406/834] drm/vc4: Add support for DSI0 - -DSI0 was partially supported, but didn't register with the main -driver, and the code was inconsistent as to whether it checked -port == 0 or port == 1. - -Add compatible string and other support to make it consistent. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_drv.h | 1 + - drivers/gpu/drm/vc4/vc4_dsi.c | 15 ++++++++++----- - 2 files changed, 11 insertions(+), 5 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index e2d26905d4b7..8448db4f85bf 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -81,6 +81,7 @@ struct vc4_dev { - struct vc4_hvs *hvs; - struct vc4_v3d *v3d; - struct vc4_dpi *dpi; -+ struct vc4_dsi *dsi0; - struct vc4_dsi *dsi1; - struct vc4_vec *vec; - struct vc4_txp *txp; -diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index eaf276978ee7..1680adf9fe31 100644 ---- a/drivers/gpu/drm/vc4/vc4_dsi.c -+++ b/drivers/gpu/drm/vc4/vc4_dsi.c -@@ -1306,6 +1306,7 @@ static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = { - }; - - static const struct of_device_id vc4_dsi_dt_match[] = { -+ { .compatible = "brcm,bcm2835-dsi0", (void *)(uintptr_t)0 }, - { .compatible = "brcm,bcm2835-dsi1", (void *)(uintptr_t)1 }, - {} - }; -@@ -1429,10 +1430,10 @@ vc4_dsi_init_phy_clocks(struct vc4_dsi *dsi) - memset(&init, 0, sizeof(init)); - init.parent_names = &parent_name; - init.num_parents = 1; -- if (dsi->port == 1) -- init.name = phy_clocks[i].dsi1_name; -- else -+ if (dsi->port == 0) - init.name = phy_clocks[i].dsi0_name; -+ else -+ init.name = phy_clocks[i].dsi1_name; - init.ops = &clk_fixed_factor_ops; - - ret = devm_clk_hw_register(dev, &fix->hw); -@@ -1604,7 +1605,9 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) - if (ret) - return ret; - -- if (dsi->port == 1) -+ if (dsi->port == 0) -+ vc4->dsi0 = dsi; -+ else - vc4->dsi1 = dsi; - - drm_simple_encoder_init(drm, dsi->encoder, DRM_MODE_ENCODER_DSI); -@@ -1649,7 +1652,9 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master, - list_splice_init(&dsi->bridge_chain, &dsi->encoder->bridge_chain); - drm_encoder_cleanup(dsi->encoder); - -- if (dsi->port == 1) -+ if (dsi->port == 0) -+ vc4->dsi0 = NULL; -+ else - vc4->dsi1 = NULL; - } - --- -2.18.4 - - -From 606e0c99caddba58a05200e71f0d14a43f8a2e88 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 12 Nov 2020 17:01:52 +0000 -Subject: [PATCH 407/834] dt-bindings: Add compatible for BCM2711 DSI1 +Subject: [PATCH 399/889] dt-bindings: Add compatible for BCM2711 DSI1 DSI1 on BCM2711 doesn't require the DMA workaround that is used on BCM2835/6/7, therefore it needs a new compatible string. @@ -195239,55 +194444,10 @@ index eb44e072b6e5..90ee069ada8d 100644 2.18.4 -From 34c2a35f0fcf0f0c3de182cc0c5e05f8883941fa Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Thu, 12 Nov 2020 17:18:13 +0000 -Subject: [PATCH 408/834] drm/vc4: Add configuration for BCM2711 DSI1. - -BCM2711 DSI1 doesn't have the issue with the ARM not being -able to write to the registers, therefore remove the DMA -workaround for that compatible string. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_dsi.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index 1680adf9fe31..0cd40d31e82d 100644 ---- a/drivers/gpu/drm/vc4/vc4_dsi.c -+++ b/drivers/gpu/drm/vc4/vc4_dsi.c -@@ -1308,6 +1308,11 @@ static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = { - static const struct of_device_id vc4_dsi_dt_match[] = { - { .compatible = "brcm,bcm2835-dsi0", (void *)(uintptr_t)0 }, - { .compatible = "brcm,bcm2835-dsi1", (void *)(uintptr_t)1 }, -+ /* -+ * Use 2 so that it uses the DSI1 register layout, but not DMA -+ * workaround -+ */ -+ { .compatible = "brcm,bcm2711-dsi1", (void *)(uintptr_t)2 }, - {} - }; - -@@ -1495,8 +1500,8 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) - return -ENODEV; - } - -- /* DSI1 has a broken AXI slave that doesn't respond to writes -- * from the ARM. It does handle writes from the DMA engine, -+ /* DSI1 on BCM2835/6/7 has a broken AXI slave that doesn't respond to -+ * writes from the ARM. It does handle writes from the DMA engine, - * so set up a channel for talking to it. - */ - if (dsi->port == 1) { --- -2.18.4 - - -From 63bb961b057f845e61b59f0d52f6657e34195800 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 12 Nov 2020 18:42:30 +0000 -Subject: [PATCH 409/834] dt: Use compatible string for BCM2711 DSI1 +Subject: [PATCH 400/889] dt: Use compatible string for BCM2711 DSI1 Updates the compatible string for DSI1 on BCM2711 to differentiate it from BCM2835. @@ -195313,10 +194473,10 @@ index 27c622ebee0d..9c615dd3715e 100644 2.18.4 -From c99c31fc8a8d3f9b5408aebcef2c27efa7dd1fc6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 30 Nov 2020 16:16:03 +0000 -Subject: [PATCH 410/834] drm/vc4: Correct DSI register definition +Subject: [PATCH 401/889] 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 @@ -195332,7 +194492,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index 0cd40d31e82d..bac5e07c05de 100644 +index eaf276978ee7..2646a6dbf584 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -306,11 +306,11 @@ @@ -195353,10 +194513,10 @@ index 0cd40d31e82d..bac5e07c05de 100644 2.18.4 -From efc904f8221167b38b78c2ac3015e009fae207cf Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Sudeep Date: Fri, 23 Oct 2020 15:47:17 +0530 -Subject: [PATCH 411/834] Allo boss2 driver +Subject: [PATCH 402/889] Allo boss2 driver Signed-off-by: Sudeep --- @@ -196549,10 +195709,10 @@ index 000000000000..5ad7f16964aa 2.18.4 -From e5f22813a152ec3eead82fa347fefe3d202e7efa Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Sudeep Date: Fri, 23 Oct 2020 15:51:15 +0530 -Subject: [PATCH 412/834] Add allo boss2 overlay +Subject: [PATCH 403/889] Add allo boss2 overlay Signed-off-by: Sudeep --- @@ -196658,10 +195818,10 @@ index 000000000000..a6adfb495eb9 2.18.4 -From 7ad181956150e839280e54809685d703df5da708 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Sudeep Date: Fri, 23 Oct 2020 15:52:38 +0530 -Subject: [PATCH 413/834] Add allo boss2 config +Subject: [PATCH 404/889] Add allo boss2 config Signed-off-by: Sudeep --- @@ -196736,10 +195896,10 @@ index 88ae301afcb4..2359f9c08650 100644 2.18.4 -From 8da6382ef982ea0ca051664645e747a8f4fd7ee5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 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 414/834] Overlay: Update Allo Piano Plus dac driver for 5.4.y +Subject: [PATCH 405/889] Overlay: Update Allo Piano Plus dac driver for 5.4.y kernels. Create unique names for the two instances of the codec driver. @@ -196772,10 +195932,10 @@ index 374c553db062..d47a35def4f7 100644 2.18.4 -From dd04d5f6dd13fffb81f721b091b4e2e57a180cda Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 2 Dec 2020 15:22:23 +0000 -Subject: [PATCH 415/834] media: bcm2835-unicam: Correctly handle error +Subject: [PATCH 406/889] media: bcm2835-unicam: Correctly handle error propagation for stream on On a failure in start_streaming(), the error code would not propagate to @@ -196805,10 +195965,10 @@ index 6501fb205e20..c13a0a20fd12 100644 2.18.4 -From 86ece89ab045205d7e2651a1c01137c0f332cf2d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 2 Dec 2020 15:26:09 +0000 -Subject: [PATCH 416/834] media: bcm2835-unicam: Return early from +Subject: [PATCH 407/889] media: bcm2835-unicam: Return early from stop_streaming() if stopped clk_disable_unprepare() is called unconditionally in stop_streaming(). @@ -196875,10 +196035,10 @@ index c13a0a20fd12..60309de02369 100644 2.18.4 -From 7321065c173b611b7451601f77ef7177492ba536 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 2 Dec 2020 16:48:41 +0000 -Subject: [PATCH 417/834] media: bcm2835-unicam: Clear clock state when +Subject: [PATCH 408/889] media: bcm2835-unicam: Clear clock state when stopping streaming Commit 65e08c465020d4c5b51afb452efc2246d80fd66f failed to clear the @@ -196906,10 +196066,10 @@ index 60309de02369..a8b3f5433f04 100644 2.18.4 -From 86dadbe88e5032c43e977535ddfdedcf184dc872 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 3 Dec 2020 13:44:42 +0000 -Subject: [PATCH 418/834] PCI: brcmstb: Advertise MSI-X support +Subject: [PATCH 409/889] PCI: brcmstb: Advertise MSI-X support Although the BRCMSTB PCIe interface doesn't technically support the MSI-X spec, in practise it seems to work provided no more than 32 @@ -196939,10 +196099,10 @@ index bd0263d739c9..840f264f7a9b 100644 2.18.4 -From 8953df0508a3545bf05a8077f63a5984fe0b2728 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Dec 2020 09:35:57 +0000 -Subject: [PATCH 419/834] ARM: dts: CM4 audio pins are not connected +Subject: [PATCH 410/889] ARM: dts: CM4 audio pins are not connected Signed-off-by: Phil Elwell --- @@ -196966,10 +196126,10 @@ index 49c69fdaef49..dbe8afe9ac5f 100644 2.18.4 -From cff742a9ec5b561e2be8f5b8dd68e64e6b90409b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Dec 2020 08:33:19 +0000 -Subject: [PATCH 420/834] configs: Add RTC_DRV_PCF85063=m +Subject: [PATCH 411/889] configs: Add RTC_DRV_PCF85063=m Include the driver module for the PCF85063 and PCF85063A RTC devices. @@ -197046,10 +196206,10 @@ index 2359f9c08650..5d6f27ec87f6 100644 2.18.4 -From 18c4551ba5202e7cc8bc7f6e83b3121ae1089b27 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Dec 2020 08:49:53 +0000 -Subject: [PATCH 421/834] overlays: Add PCF85063 and PCF85063A to i2c-rtc +Subject: [PATCH 412/889] overlays: Add PCF85063 and PCF85063A to i2c-rtc Add support for the PCF85063 and PCF85063A RTC devices to the i2c-rtc overlay. @@ -197393,10 +196553,10 @@ index 735ca303e4fa..759f532d5be1 100644 2.18.4 -From 246ff7e6a2718e9676226a14fe138a3032378d36 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Dec 2020 17:18:39 +0000 -Subject: [PATCH 422/834] overlays: Fix cut-and-paste error in README +Subject: [PATCH 413/889] overlays: Fix cut-and-paste error in README Signed-off-by: Phil Elwell --- @@ -197423,10 +196583,10 @@ index d4cf4176a54b..2fa2bbb943cd 100644 2.18.4 -From 738ed6b290ca5c6e4e90545bb9857cbfec888a42 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 4 Nov 2020 18:31:02 +0000 -Subject: [PATCH 423/834] staging/bcm2835-codec: Ensure OUTPUT timestamps are +Subject: [PATCH 414/889] staging/bcm2835-codec: Ensure OUTPUT timestamps are always forwarded The firmware by default tries to ensure that decoded frame @@ -197484,10 +196644,10 @@ index 5b596b5c057f..efda4dc039c3 100644 2.18.4 -From 81b0f408f101cdf689eeed9033f3b8b3df75d01b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 15 Dec 2020 16:38:37 +0000 -Subject: [PATCH 424/834] net: lan78xx: Ack pending PHY ints when resetting +Subject: [PATCH 415/889] net: lan78xx: Ack pending PHY ints when resetting lan78xx_link_reset explicitly clears the MAC's view of the PHY's IRQ status. In doing so it potentially leaves the PHY with a pending @@ -197505,7 +196665,7 @@ Signed-off-by: Phil Elwell 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c -index 58f5b90f11d4..3cf5ad0bf0c1 100644 +index acfbda466d2f..2c54e4eadde6 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -1181,6 +1181,9 @@ static int lan78xx_link_reset(struct lan78xx_net *dev) @@ -197515,17 +196675,17 @@ index 58f5b90f11d4..3cf5ad0bf0c1 100644 + /* Acknowledge any pending PHY interrupt, lest it be the last */ + phy_read(phydev, LAN88XX_INT_STS); + + mutex_lock(&phydev->lock); phy_read_status(phydev); - - if (!phydev->link && dev->link_on) { + link = phydev->link; -- 2.18.4 -From 1d282c1d9c1d010d00226eb1aba86c2b648a599c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 15 Dec 2020 17:02:17 +0000 -Subject: [PATCH 425/834] overlays: mpu6050: Add 'addr' parameter +Subject: [PATCH 416/889] 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 @@ -197566,10 +196726,10 @@ index 3109d90562ae..1b4c06535687 100644 2.18.4 -From 233c2280c1ae30163aa0f5c8cd2d775d3b208362 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 15 Dec 2020 16:26:51 +0000 -Subject: [PATCH 426/834] drm/vc4: Make normalize_zpos conditional on using +Subject: [PATCH 417/889] drm/vc4: Make normalize_zpos conditional on using fkms Eric's view was that there was no point in having zpos @@ -197601,10 +196761,10 @@ index 65513a90d606..5d0974cdeaaa 100644 2.18.4 -From 4d2ee7561f9e18be170cde75ad9079e6759d6b17 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 16 Dec 2020 09:28:17 +0000 -Subject: [PATCH 427/834] overlays: Add missing addresses to ads1015/ads1115 +Subject: [PATCH 418/889] 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 @@ -197650,10 +196810,10 @@ index 4fc571c2db33..e44ced704ee2 100644 2.18.4 -From 010505b4867fa1b316f676982935df4123e4d213 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 9 Dec 2020 11:30:12 +0000 -Subject: [PATCH 428/834] media: i2c: imx477: Selection compliance fixes +Subject: [PATCH 419/889] media: i2c: imx477: Selection compliance fixes To comply with the intended usage of the V4L2 selection target when used to retrieve a sensor image properties, adjust the rectangles @@ -197736,10 +196896,10 @@ index 3fbb173fa079..f68e7718b09c 100644 2.18.4 -From ec19d6c4cd4a573fbc581539ca34247f17c030de Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sun, 13 Dec 2020 16:45:58 +0000 -Subject: [PATCH 429/834] staging/vc04_services/codec: Add support for CID +Subject: [PATCH 420/889] staging/vc04_services/codec: Add support for CID MPEG_HEADER_MODE Control V4L2_CID_MPEG_VIDEO_HEADER_MODE controls whether the encoder @@ -197806,10 +196966,10 @@ index 3791ab4b4244..c368246cbb6a 100644 2.18.4 -From d6fc0c22328c151ac7d219e21eb55db3c6df9445 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sun, 13 Dec 2020 16:54:43 +0000 -Subject: [PATCH 430/834] staging/vc04_services/codec: Clear last buf dequeued +Subject: [PATCH 421/889] staging/vc04_services/codec: Clear last buf dequeued flag on START It appears that the V4L2 M2M framework requires the driver to manually @@ -197849,10 +197009,10 @@ index c368246cbb6a..9673d807ca67 100644 2.18.4 -From 7ebf24ee4b0456fce47c6c79a61e67aa1df1dffe Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 8 Oct 2020 14:44:08 +0200 -Subject: [PATCH 431/834] drm/atomic: Pass the full state to CRTC atomic +Subject: [PATCH 422/889] drm/atomic: Pass the full state to CRTC atomic enable/disable Commit 351f950db4ab28c321a1bd4b92e4bb03e34c4703 upstream. @@ -198590,10 +197750,10 @@ index 7d7668998501..6082b0db700f 100644 struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state); diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c -index 9e1224d54729..80374f7fc118 100644 +index b535621f4f78..f844e36e0850 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c -@@ -303,7 +303,7 @@ static void mxsfb_crtc_atomic_flush(struct drm_crtc *crtc, +@@ -343,7 +343,7 @@ static void mxsfb_crtc_atomic_flush(struct drm_crtc *crtc, } static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc, @@ -198602,7 +197762,7 @@ index 9e1224d54729..80374f7fc118 100644 { struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev); struct drm_device *drm = mxsfb->drm; -@@ -327,7 +327,7 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc, +@@ -367,7 +367,7 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc, } static void mxsfb_crtc_atomic_disable(struct drm_crtc *crtc, @@ -199035,7 +198195,7 @@ index cf3aafd00837..5b04ec047ef3 100644 struct vmw_private *dev_priv; struct vmw_screen_target_display_unit *stdu; diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c -index 8cd8af35cfaa..db4c8b03dda7 100644 +index 205c72a249b7..2bd68e9c2f3f 100644 --- 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(struct drm_crtc *crtc, @@ -199047,7 +198207,7 @@ index 8cd8af35cfaa..db4c8b03dda7 100644 { struct zynqmp_disp *disp = crtc_to_disp(crtc); struct drm_display_mode *adjusted_mode = &crtc->state->adjusted_mode; -@@ -1472,8 +1472,10 @@ zynqmp_disp_crtc_atomic_enable(struct drm_crtc *crtc, +@@ -1473,8 +1473,10 @@ zynqmp_disp_crtc_atomic_enable(struct drm_crtc *crtc, static void zynqmp_disp_crtc_atomic_disable(struct drm_crtc *crtc, @@ -199122,10 +198282,10 @@ index 4efec30f8bad..bde42988c4b5 100644 2.18.4 -From e5d7f6cc9884c03541286d44da560e4942576288 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 28 Oct 2020 13:32:21 +0100 -Subject: [PATCH 432/834] drm/atomic: Pass the full state to CRTC atomic_check +Subject: [PATCH 423/889] 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 @@ -199324,10 +198484,10 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20201028123222.1732139-1-max 30 files changed, 168 insertions(+), 110 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -index bc9df3f216f5..0076470cdf64 100644 +index d9525fbedad2..105394080336 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -@@ -5601,17 +5601,19 @@ static void dm_update_crtc_active_planes(struct drm_crtc *crtc, +@@ -5602,17 +5602,19 @@ static void dm_update_crtc_active_planes(struct drm_crtc *crtc, } static int dm_crtc_helper_atomic_check(struct drm_crtc *crtc, @@ -199351,7 +198511,7 @@ index bc9df3f216f5..0076470cdf64 100644 WARN_ON(1); return ret; } -@@ -5622,8 +5624,8 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc *crtc, +@@ -5623,8 +5625,8 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc *crtc, * 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. */ @@ -199789,10 +198949,10 @@ index 6082b0db700f..3d6aeb8916f2 100644 /* verify that there are not too many planes attached to crtc * and that we don't have conflicting mixer stages: diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c -index 80374f7fc118..4a7436914b0a 100644 +index f844e36e0850..19fa86b05ff6 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c -@@ -270,17 +270,19 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb) +@@ -310,17 +310,19 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb) } static int mxsfb_crtc_atomic_check(struct drm_crtc *crtc, @@ -199817,7 +198977,7 @@ index 80374f7fc118..4a7436914b0a 100644 static void mxsfb_crtc_atomic_flush(struct drm_crtc *crtc, diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.c b/drivers/gpu/drm/nouveau/dispnv50/head.c -index 841edfaf5b9d..0542ca22b33a 100644 +index be649d14f879..3e5c1f1e5d5e 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head.c @@ -30,6 +30,7 @@ @@ -199828,7 +198988,7 @@ index 841edfaf5b9d..0542ca22b33a 100644 #include #include #include -@@ -310,12 +311,14 @@ nv50_head_atomic_check_mode(struct nv50_head *head, struct nv50_head_atom *asyh) +@@ -315,12 +316,14 @@ nv50_head_atomic_check_mode(struct nv50_head *head, struct nv50_head_atom *asyh) } static int @@ -200169,10 +199329,10 @@ index 3ee03227607c..b3d4e7b4c8c5 100644 struct drm_crtc_state *old_crtc_state); void vmw_du_crtc_atomic_flush(struct drm_crtc *crtc, diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c -index db4c8b03dda7..178b310c0979 100644 +index 2bd68e9c2f3f..f81744bfeb30 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c -@@ -1505,9 +1505,11 @@ zynqmp_disp_crtc_atomic_disable(struct drm_crtc *crtc, +@@ -1506,9 +1506,11 @@ zynqmp_disp_crtc_atomic_disable(struct drm_crtc *crtc, } static int zynqmp_disp_crtc_atomic_check(struct drm_crtc *crtc, @@ -200213,10 +199373,10 @@ index bde42988c4b5..b97441deaf93 100644 2.18.4 -From 0a5d5bfbb6f6fbf7a687852304440717743d99cf Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 28 Oct 2020 13:32:22 +0100 -Subject: [PATCH 433/834] drm/atomic: Pass the full state to CRTC atomic begin +Subject: [PATCH 424/889] drm/atomic: Pass the full state to CRTC atomic begin and flush MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -200928,10 +200088,10 @@ index 3d6aeb8916f2..baf9f1d550c6 100644 struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc); struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state); diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c -index 4a7436914b0a..7309a66ea6e4 100644 +index 19fa86b05ff6..e06df6cf180b 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c -@@ -286,7 +286,7 @@ static int mxsfb_crtc_atomic_check(struct drm_crtc *crtc, +@@ -326,7 +326,7 @@ static int mxsfb_crtc_atomic_check(struct drm_crtc *crtc, } static void mxsfb_crtc_atomic_flush(struct drm_crtc *crtc, @@ -201151,10 +200311,10 @@ index 931c55126148..322bf7133ba1 100644 } diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 8448db4f85bf..4880b2a785cc 100644 +index e2d26905d4b7..c2950d0f97b5 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -929,7 +929,8 @@ int vc4_hvs_get_fifo_from_output(struct drm_device *dev, unsigned int output); +@@ -928,7 +928,8 @@ int vc4_hvs_get_fifo_from_output(struct drm_device *dev, unsigned int output); int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state); void vc4_hvs_atomic_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state); void vc4_hvs_atomic_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state); @@ -201252,10 +200412,10 @@ index b3d4e7b4c8c5..03f3694015ce 100644 struct drm_crtc_state *vmw_du_crtc_duplicate_state(struct drm_crtc *crtc); void vmw_du_crtc_destroy_state(struct drm_crtc *crtc, diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c -index 178b310c0979..8d9cd623d995 100644 +index f81744bfeb30..7d962874b8fe 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c -@@ -1514,14 +1514,14 @@ static int zynqmp_disp_crtc_atomic_check(struct drm_crtc *crtc, +@@ -1515,14 +1515,14 @@ static int zynqmp_disp_crtc_atomic_check(struct drm_crtc *crtc, static void zynqmp_disp_crtc_atomic_begin(struct drm_crtc *crtc, @@ -201311,10 +200471,10 @@ index b97441deaf93..f2de050085be 100644 2.18.4 -From cc0d425ddf82ce5588dc9bc28539ba33b1d7c312 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 7 Dec 2020 16:57:11 +0100 -Subject: [PATCH 434/834] drm/vc4: hvs: Align the HVS atomic hooks to the new +Subject: [PATCH 425/889] drm/vc4: hvs: Align the HVS atomic hooks to the new API Since the CRTC setup in vc4 is split between the PixelValves/TXP and the @@ -201353,10 +200513,10 @@ index 2db33bae0d0b..15d349a3d291 100644 if (vc4_encoder->pre_crtc_configure) vc4_encoder->pre_crtc_configure(encoder); diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 4880b2a785cc..cea766a7e96e 100644 +index c2950d0f97b5..b5ec12649e04 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -927,8 +927,8 @@ extern struct platform_driver vc4_hvs_driver; +@@ -926,8 +926,8 @@ extern struct platform_driver vc4_hvs_driver; void vc4_hvs_stop_channel(struct drm_device *dev, unsigned int output); int vc4_hvs_get_fifo_from_output(struct drm_device *dev, unsigned int output); int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state); @@ -201432,10 +200592,10 @@ index 9970f90e1fe3..22430640786f 100644 2.18.4 -From a054151048e9f97ab29604f976646962859e2db5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 15 Dec 2020 16:42:36 +0100 -Subject: [PATCH 435/834] drm/vc4: Pass the atomic state to encoder hooks +Subject: [PATCH 426/889] drm/vc4: Pass the atomic state to encoder hooks We'll need to access the connector state in our encoder setup, so let's just pass the whole DRM state to our private encoder hooks. @@ -201524,10 +200684,10 @@ index 15d349a3d291..e02c8aabc8c7 100644 static enum drm_mode_status vc4_crtc_mode_valid(struct drm_crtc *crtc, diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index cea766a7e96e..08fe0bce44c3 100644 +index b5ec12649e04..98f781d52a35 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -450,12 +450,12 @@ struct vc4_encoder { +@@ -449,12 +449,12 @@ struct vc4_encoder { enum vc4_encoder_type type; u32 clock_select; @@ -201546,10 +200706,10 @@ index cea766a7e96e..08fe0bce44c3 100644 static inline struct vc4_encoder * diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index bbfd3e0358ed..325d6baf65ce 100644 +index 5e7f22ef3dc2..fca379ef7369 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -721,7 +721,8 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) +@@ -720,7 +720,8 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) vc4_hdmi_set_audio_infoframe(encoder); } @@ -201559,7 +200719,7 @@ index bbfd3e0358ed..325d6baf65ce 100644 { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); -@@ -734,7 +735,8 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder) +@@ -733,7 +734,8 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder) HDMI_READ(HDMI_VID_CTL) | VC4_HD_VID_CTL_BLANKPIX); } @@ -201569,7 +200729,7 @@ index bbfd3e0358ed..325d6baf65ce 100644 { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); int ret; -@@ -947,7 +949,8 @@ static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) +@@ -946,7 +948,8 @@ static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) "VC4_HDMI_FIFO_CTL_RECENTER_DONE"); } @@ -201579,7 +200739,7 @@ index bbfd3e0358ed..325d6baf65ce 100644 { struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode; struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); -@@ -1013,7 +1016,8 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder) +@@ -1028,7 +1031,8 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder) vc4_hdmi->variant->set_timings(vc4_hdmi, mode); } @@ -201589,7 +200749,7 @@ index bbfd3e0358ed..325d6baf65ce 100644 { struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode; struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); -@@ -1035,7 +1039,8 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder) +@@ -1050,7 +1054,8 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder) HDMI_WRITE(HDMI_FIFO_CTL, VC4_HDMI_FIFO_CTL_MASTER_SLAVE_N); } @@ -201603,10 +200763,10 @@ index bbfd3e0358ed..325d6baf65ce 100644 2.18.4 -From 3a2b1267d999c2c4a1c88db7cc9aa6b9fb67aef4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 15 Dec 2020 16:42:38 +0100 -Subject: [PATCH 436/834] drm/vc4: hdmi: Don't access the connector state in +Subject: [PATCH 427/889] drm/vc4: hdmi: Don't access the connector state in reset if kmalloc fails drm_atomic_helper_connector_reset uses kmalloc which, from an API @@ -201626,10 +200786,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 325d6baf65ce..004acd57389e 100644 +index fca379ef7369..929c6a39bc49 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -522,7 +522,9 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) +@@ -521,7 +521,9 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) static void vc4_hdmi_connector_reset(struct drm_connector *connector) { drm_atomic_helper_connector_reset(connector); @@ -201644,10 +200804,10 @@ index 325d6baf65ce..004acd57389e 100644 2.18.4 -From 9be1c71dde8c5249ca9b39c6cd285e1540b1e700 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 15 Dec 2020 16:42:39 +0100 -Subject: [PATCH 437/834] drm/vc4: hdmi: Create a custom connector state +Subject: [PATCH 428/889] drm/vc4: hdmi: Create a custom connector state When run with a higher bpc than 8, the clock of the HDMI controller needs to be adjusted. Let's create a connector state that will be used at @@ -201663,10 +200823,10 @@ Reviewed-by: Dave Stevenson 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 004acd57389e..c9ae5fe76bb6 100644 +index 929c6a39bc49..e81d7d95bdbd 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -521,10 +521,37 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) +@@ -520,10 +520,37 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) static void vc4_hdmi_connector_reset(struct drm_connector *connector) { @@ -201706,7 +200866,7 @@ index 004acd57389e..c9ae5fe76bb6 100644 } static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { -@@ -532,7 +559,7 @@ static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { +@@ -531,7 +558,7 @@ static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = vc4_hdmi_connector_destroy, .reset = vc4_hdmi_connector_reset, @@ -201716,10 +200876,10 @@ index 004acd57389e..c9ae5fe76bb6 100644 }; diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index 1eb1fc0d95a3..c4f24e1f1b20 100644 +index 165d80928143..040408d870a4 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -202,6 +202,16 @@ encoder_to_vc4_hdmi(struct drm_encoder *encoder) +@@ -193,6 +193,16 @@ encoder_to_vc4_hdmi(struct drm_encoder *encoder) return container_of(_encoder, struct vc4_hdmi, encoder); } @@ -201740,10 +200900,10 @@ index 1eb1fc0d95a3..c4f24e1f1b20 100644 2.18.4 -From 8da153d322f9ab24fe5e5ec7c66c60c4c3756568 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 15 Dec 2020 16:42:40 +0100 -Subject: [PATCH 438/834] drm/vc4: hdmi: Store pixel frequency in the connector +Subject: [PATCH 429/889] drm/vc4: hdmi: Store pixel frequency in the connector state The pixel rate is for now quite simple to compute, but with more features @@ -201762,10 +200922,10 @@ Signed-off-by: Maxime Ripard 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index c9ae5fe76bb6..3153bd94351d 100644 +index e81d7d95bdbd..9ae88d02544d 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -549,6 +549,7 @@ vc4_hdmi_connector_duplicate_state(struct drm_connector *connector) +@@ -548,6 +548,7 @@ vc4_hdmi_connector_duplicate_state(struct drm_connector *connector) if (!new_state) return NULL; @@ -201773,7 +200933,7 @@ index c9ae5fe76bb6..3153bd94351d 100644 __drm_atomic_helper_connector_duplicate_state(connector, &new_state->base); return &new_state->base; -@@ -978,9 +979,29 @@ static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) +@@ -977,9 +978,29 @@ static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) "VC4_HDMI_FIFO_CTL_RECENTER_DONE"); } @@ -201803,7 +200963,7 @@ index c9ae5fe76bb6..3153bd94351d 100644 struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode; struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); unsigned long pixel_rate, hsm_rate; -@@ -992,7 +1013,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, +@@ -991,7 +1012,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, return; } @@ -201812,7 +200972,7 @@ index c9ae5fe76bb6..3153bd94351d 100644 ret = clk_set_rate(vc4_hdmi->pixel_clock, pixel_rate); if (ret) { DRM_ERROR("Failed to set pixel clock rate: %d\n", ret); -@@ -1138,6 +1159,7 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, +@@ -1153,6 +1174,7 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state) { @@ -201820,7 +200980,7 @@ index c9ae5fe76bb6..3153bd94351d 100644 struct drm_display_mode *mode = &crtc_state->adjusted_mode; struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); unsigned long long pixel_rate = mode->clock * 1000; -@@ -1168,6 +1190,8 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, +@@ -1183,6 +1205,8 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, if (pixel_rate > vc4_hdmi->variant->max_pixel_clock) return -EINVAL; @@ -201830,10 +200990,10 @@ index c9ae5fe76bb6..3153bd94351d 100644 } diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index c4f24e1f1b20..71816aba852b 100644 +index 040408d870a4..c319172b6e99 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -204,6 +204,7 @@ encoder_to_vc4_hdmi(struct drm_encoder *encoder) +@@ -195,6 +195,7 @@ encoder_to_vc4_hdmi(struct drm_encoder *encoder) struct vc4_hdmi_connector_state { struct drm_connector_state base; @@ -201845,10 +201005,10 @@ index c4f24e1f1b20..71816aba852b 100644 2.18.4 -From 8aee7c9febd2a5bc2d6d9fb15ce4706b7c3127fd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 15 Dec 2020 16:42:41 +0100 -Subject: [PATCH 439/834] drm/vc4: hdmi: Use the connector state pixel rate for +Subject: [PATCH 430/889] drm/vc4: hdmi: Use the connector state pixel rate for the PHY The PHY initialisation parameters are not based on the pixel clock but @@ -201868,10 +201028,10 @@ Signed-off-by: Maxime Ripard 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 3153bd94351d..dd7b4821719c 100644 +index 9ae88d02544d..c038a0289d72 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1055,7 +1055,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, +@@ -1070,7 +1070,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, } if (vc4_hdmi->variant->phy_init) @@ -201881,7 +201041,7 @@ index 3153bd94351d..dd7b4821719c 100644 HDMI_WRITE(HDMI_SCHEDULER_CONTROL, HDMI_READ(HDMI_SCHEDULER_CONTROL) | diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index 71816aba852b..0bcdd84b6d87 100644 +index c319172b6e99..c788f4aaa43a 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -21,10 +21,9 @@ to_vc4_hdmi_encoder(struct drm_encoder *encoder) @@ -201908,7 +201068,7 @@ index 71816aba852b..0bcdd84b6d87 100644 /* Callback to disable the PHY */ void (*phy_disable)(struct vc4_hdmi *vc4_hdmi); -@@ -214,13 +213,13 @@ conn_state_to_vc4_hdmi_conn_state(struct drm_connector_state *conn_state) +@@ -205,13 +204,13 @@ conn_state_to_vc4_hdmi_conn_state(struct drm_connector_state *conn_state) } void vc4_hdmi_phy_init(struct vc4_hdmi *vc4_hdmi, @@ -201957,10 +201117,10 @@ index 057796b54c51..36535480f8e2 100644 2.18.4 -From d29998eb5c79f1057cfcddb7ecf26905f0f8332e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 15 Dec 2020 16:42:43 +0100 -Subject: [PATCH 440/834] drm/vc4: hdmi: Enable 10/12 bpc output +Subject: [PATCH 431/889] drm/vc4: hdmi: Enable 10/12 bpc output The BCM2711 supports higher bpc count than just 8, so let's support it in our driver. @@ -201974,7 +201134,7 @@ Reviewed-by: Dave Stevenson 3 files changed, 79 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index dd7b4821719c..ef08ecb11f1a 100644 +index c038a0289d72..13cf20a7b220 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -78,6 +78,17 @@ @@ -201995,7 +201155,7 @@ index dd7b4821719c..ef08ecb11f1a 100644 # define VC4_HD_M_SW_RST BIT(2) # define VC4_HD_M_ENABLE BIT(0) -@@ -535,6 +546,8 @@ static void vc4_hdmi_connector_reset(struct drm_connector *connector) +@@ -534,6 +545,8 @@ static void vc4_hdmi_connector_reset(struct drm_connector *connector) if (!new_state) return; @@ -202004,7 +201164,7 @@ index dd7b4821719c..ef08ecb11f1a 100644 drm_atomic_helper_connector_tv_reset(connector); } -@@ -581,12 +594,20 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, +@@ -580,12 +593,20 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, vc4_hdmi->ddc); drm_connector_helper_add(connector, &vc4_hdmi_connector_helper_funcs); @@ -202025,7 +201185,7 @@ index dd7b4821719c..ef08ecb11f1a 100644 connector->polled = (DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT); -@@ -864,6 +885,7 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable) +@@ -863,6 +884,7 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable) } static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, @@ -202033,7 +201193,7 @@ index dd7b4821719c..ef08ecb11f1a 100644 struct drm_display_mode *mode) { bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; -@@ -907,7 +929,9 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, +@@ -906,7 +928,9 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, HDMI_WRITE(HDMI_VERTB0, vertb_even); HDMI_WRITE(HDMI_VERTB1, vertb); } @@ -202043,7 +201203,7 @@ index dd7b4821719c..ef08ecb11f1a 100644 struct drm_display_mode *mode) { bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; -@@ -927,6 +951,9 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, +@@ -926,6 +950,9 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, mode->crtc_vsync_end - interlaced, VC4_HDMI_VERTB_VBP)); @@ -202053,7 +201213,7 @@ index dd7b4821719c..ef08ecb11f1a 100644 HDMI_WRITE(HDMI_VEC_INTERFACE_XBAR, 0x354021); HDMI_WRITE(HDMI_HORZA, -@@ -952,6 +979,39 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, +@@ -951,6 +978,39 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, HDMI_WRITE(HDMI_VERTB0, vertb_even); HDMI_WRITE(HDMI_VERTB1, vertb); @@ -202093,7 +201253,7 @@ index dd7b4821719c..ef08ecb11f1a 100644 HDMI_WRITE(HDMI_CLOCK_STOP, 0); } -@@ -1063,7 +1123,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, +@@ -1078,7 +1138,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, VC4_HDMI_SCHEDULER_CONTROL_IGNORE_VSYNC_PREDICTS); if (vc4_hdmi->variant->set_timings) @@ -202102,7 +201262,7 @@ index dd7b4821719c..ef08ecb11f1a 100644 } static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, -@@ -1184,6 +1244,14 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, +@@ -1199,6 +1259,14 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, pixel_rate = mode->clock * 1000; } @@ -202118,7 +201278,7 @@ index dd7b4821719c..ef08ecb11f1a 100644 pixel_rate = pixel_rate * 2; diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index 0bcdd84b6d87..b0baed2e1a78 100644 +index c788f4aaa43a..f18f1d775241 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -77,6 +77,7 @@ struct vc4_hdmi_variant { @@ -202130,10 +201290,10 @@ index 0bcdd84b6d87..b0baed2e1a78 100644 /* Callback to initialize the PHY according to the connector state */ diff --git a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h -index 10dd6097f2b5..9e85266e53f5 100644 +index 6c0dfbbe1a7e..20a1438a72cb 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h -@@ -61,9 +61,12 @@ enum vc4_hdmi_field { +@@ -60,9 +60,12 @@ enum vc4_hdmi_field { */ HDMI_CTS_0, HDMI_CTS_1, @@ -202146,7 +201306,7 @@ index 10dd6097f2b5..9e85266e53f5 100644 HDMI_HORZA, HDMI_HORZB, HDMI_HOTPLUG, -@@ -233,6 +236,9 @@ static const struct vc4_hdmi_register vc5_hdmi_hdmi0_fields[] = { +@@ -231,6 +234,9 @@ static const struct vc4_hdmi_register vc5_hdmi_hdmi0_fields[] = { VC4_HDMI_REG(HDMI_VERTB1, 0x0f8), VC4_HDMI_REG(HDMI_MAI_CHANNEL_MAP, 0x09c), VC4_HDMI_REG(HDMI_MAI_CONFIG, 0x0a0), @@ -202156,7 +201316,7 @@ index 10dd6097f2b5..9e85266e53f5 100644 VC4_HDMI_REG(HDMI_HOTPLUG, 0x1a8), VC5_DVP_REG(HDMI_CLOCK_STOP, 0x0bc), -@@ -315,6 +321,9 @@ static const struct vc4_hdmi_register vc5_hdmi_hdmi1_fields[] = { +@@ -307,6 +313,9 @@ static const struct vc4_hdmi_register vc5_hdmi_hdmi1_fields[] = { VC4_HDMI_REG(HDMI_VERTB1, 0x0f8), VC4_HDMI_REG(HDMI_MAI_CHANNEL_MAP, 0x09c), VC4_HDMI_REG(HDMI_MAI_CONFIG, 0x0a0), @@ -202170,10 +201330,10 @@ index 10dd6097f2b5..9e85266e53f5 100644 2.18.4 -From 29ce375faabc654503165ccfdb503322417a2c17 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 1 Dec 2020 14:57:41 +0000 -Subject: [PATCH 441/834] drm/vc4: Fixup fkms for API change +Subject: [PATCH 432/889] drm/vc4: Fixup fkms for API change Atomic flush and check changed API, so fix up the downstream-only FKMS driver. @@ -202226,10 +201386,10 @@ index f83efe013a5b..44b1addeb22e 100644 2.18.4 -From afee087ce1e62b22249f5f07750f24f4d24554ae Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 30 Dec 2020 20:00:38 +0000 -Subject: [PATCH 442/834] overlays: Rebuild "upstream" with latest ovmerge +Subject: [PATCH 433/889] overlays: Rebuild "upstream" with latest ovmerge The latest ovmerge drops disabled fragments, causing the "upstream" overlay to change. @@ -202525,10 +201685,10 @@ index 6195e02bf9ff..e0f7cc8ba9ea 100644 2.18.4 -From 1b0412ac9608801c7778f65c5ab587d57365b06c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: menschel Date: Wed, 30 Dec 2020 21:55:34 +0100 -Subject: [PATCH 443/834] Add overlay for Seeed Studio CAN BUS FD HAT (#4034) +Subject: [PATCH 434/889] Add overlay for Seeed Studio CAN BUS FD HAT (#4034) This patch adds the overlay for the Seeed Studio CAN BUS FD HAT with two CAN FD Channels and an RTC. @@ -202753,10 +201913,10 @@ index 000000000000..e843d0b19745 2.18.4 -From 44c84e57f7dadeda21d58d9dbf0fb587afbaadec Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: gesangtome Date: Fri, 1 Jan 2021 18:03:17 +0800 -Subject: [PATCH 444/834] vc-sm-cma: fixed kbuild problem +Subject: [PATCH 435/889] vc-sm-cma: fixed kbuild problem error logs: drivers/staging/vc04_services/vc-sm-cma/Kconfig:1:error: recursive dependency detected! @@ -202789,10 +201949,10 @@ index a7c1a7bf516e..5df9198cdab1 100644 2.18.4 -From 23868ba19dfa95c03c66813f1689be3966f3e920 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sat, 2 Jan 2021 10:51:58 +0000 -Subject: [PATCH 445/834] staging/vc04-services/codec: Fix logical precedence +Subject: [PATCH 436/889] staging/vc04-services/codec: Fix logical precedence issue Two issues identified with operator precedence in logical @@ -202831,10 +201991,10 @@ index 9673d807ca67..8a8f1e8db7d0 100644 2.18.4 -From 1a3b1f0fda2f902568b699f7f9e40704dbe23278 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 Jan 2021 10:43:20 +0000 -Subject: [PATCH 446/834] staging/vc04_services: Add additional unpacked raw +Subject: [PATCH 437/889] staging/vc04_services: Add additional unpacked raw formats Support has been added for the unpacked (16bpp) versions of @@ -202888,10 +202048,10 @@ index 8eb6334ee055..59f7ad3a5b3b 100644 2.18.4 -From 27c789e13224f6dda75a8c9375fccb0ed63c9c2c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 Jan 2021 10:45:16 +0000 -Subject: [PATCH 447/834] staging/bcm2835-codec: Add the unpacked (16bpp) raw +Subject: [PATCH 438/889] staging/bcm2835-codec: Add the unpacked (16bpp) raw formats Now that the firmware supports the unpacked (16bpp) variants @@ -203061,10 +202221,10 @@ index 8a8f1e8db7d0..c883db63808f 100644 2.18.4 -From 68efb72efb8e475456c8646e79318da0969bf78f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 Jan 2021 11:41:26 +0000 -Subject: [PATCH 448/834] staging/bcm2835-codec: Log the number of excess +Subject: [PATCH 439/889] staging/bcm2835-codec: Log the number of excess supported formats When logging that the firmware has provided more supported formats @@ -203110,10 +202270,10 @@ index c883db63808f..94691ab7175a 100644 2.18.4 -From f70eec2a50aac6fc0d419fa9343b4ae0b7f69fb6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 Jan 2021 11:37:10 +0000 -Subject: [PATCH 449/834] staging/bcm2835-isp: Add the unpacked (16bpp) raw +Subject: [PATCH 440/889] staging/bcm2835-isp: Add the unpacked (16bpp) raw formats Now that the firmware supports the unpacked (16bpp) variants @@ -203292,10 +202452,10 @@ index 8bb3d115b27a..9a313ffcabf5 100644 2.18.4 -From b981e926616ba51cf727961c53e28850d34681dd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 Jan 2021 11:43:22 +0000 -Subject: [PATCH 450/834] staging/bcm2835-isp: Log the number of excess +Subject: [PATCH 441/889] staging/bcm2835-isp: Log the number of excess supported formats When logging that the firmware has provided more supported formats @@ -203327,10 +202487,10 @@ index 9a313ffcabf5..afac2ad65790 100644 2.18.4 -From 825237df5b1bc3b21a37d252551de8e5cc134ea3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 30 Dec 2020 14:51:29 +0000 -Subject: [PATCH 451/834] bcm2835-dma: Add bcm2835-dma: Add DMA_WIDE_SOURCE and +Subject: [PATCH 442/889] bcm2835-dma: Add bcm2835-dma: Add DMA_WIDE_SOURCE and DMA_WIDE_DEST flags Use (reserved) bits 24 and 25 of the dreq value @@ -203397,10 +202557,10 @@ index 0cbfa9d559a2..5517d2135168 100644 2.18.4 -From b53e9bca1145e3dbed57ee3c1e36fc53e69e8a2b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 11 Jan 2021 14:49:33 +0000 -Subject: [PATCH 452/834] bcm2835-dma: Move WAIT_RESP from extra to info +Subject: [PATCH 443/889] bcm2835-dma: Move WAIT_RESP from extra to info Questionable: Might want to drop Signed-off-by: popcornmix @@ -203428,10 +202588,10 @@ index 5517d2135168..8b97b9f10a1a 100644 2.18.4 -From 9b95c619ea627ce090ec1c9dccba307406bec524 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 6 Jan 2021 18:16:10 +0000 -Subject: [PATCH 453/834] bcm2835-dma: Avoid losing CS flags after interrupt +Subject: [PATCH 444/889] bcm2835-dma: Avoid losing CS flags after interrupt Signed-off-by: Dom Cobley --- @@ -203455,10 +202615,10 @@ index 8b97b9f10a1a..94a1b40b1645 100644 2.18.4 -From 37cd45b1c0b634091d14a653f0c397d0c86caca8 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 11 Jan 2021 13:06:23 +0000 -Subject: [PATCH 454/834] dt: Enable DMA_WIDE_SOURCE and DMA_WIDE_DEST for hdmi +Subject: [PATCH 445/889] dt: Enable DMA_WIDE_SOURCE and DMA_WIDE_DEST for hdmi audio Signed-off-by: popcornmix @@ -203506,10 +202666,10 @@ index bd77ba3a3562..47b958428d0c 100644 2.18.4 -From 9c1c2761feb581d27f0245f0f008d4c6f66347ec Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 6 Jan 2021 18:16:29 +0000 -Subject: [PATCH 455/834] bcm2711-rpi.dtsi: Bump hdmi audio dma panic priority +Subject: [PATCH 446/889] bcm2711-rpi.dtsi: Bump hdmi audio dma panic priority to max Set panic priority to 15 and leave normal priority at 0 @@ -203545,10 +202705,10 @@ index 3dbfd601ca39..8053ef54acc8 100644 2.18.4 -From 1fb7782ddca9cde3a490b9813509dbcfb6a3921c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Tue, 22 Dec 2020 14:27:46 +0900 -Subject: [PATCH 456/834] media: i2c: ov5647: Selection compliance fixes +Subject: [PATCH 447/889] media: i2c: ov5647: Selection compliance fixes To comply with the intended usage of the V4L2 selection target when used to retrieve a sensor image properties, adjust the rectangles @@ -203639,10 +202799,10 @@ index 86a821a172b3..40d0d45a2481 100644 2.18.4 -From 843a78cb1047238146f6ec667c4990d599ff5d1d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Sat, 2 Jan 2021 21:08:59 +0100 -Subject: [PATCH 457/834] overlays: give Seeed Studio CAN BUS FD HAT a -v2 +Subject: [PATCH 448/889] overlays: give Seeed Studio CAN BUS FD HAT a -v2 postfix There are several versions of the Seeed Studio CAN BUS FD HAT. This is the @@ -203697,10 +202857,10 @@ rename to arch/arm/boot/dts/overlays/seeed-can-fd-hat-v2-overlay.dts 2.18.4 -From f938b5e38831c5cd4e84dd3c138cb4e43d8a1580 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Sat, 2 Jan 2021 21:38:58 +0100 -Subject: [PATCH 458/834] overlays: Add overlay for Seeed Studio CAN BUS FD HAT +Subject: [PATCH 449/889] overlays: Add overlay for Seeed Studio CAN BUS FD HAT v1 (based on mcp2517fd) This patch adds the overlay for the Seeed Studio CAN BUS FD HAT v1 with two CAN @@ -203900,10 +203060,10 @@ index 000000000000..210d027a073e 2.18.4 -From dc8d544f7fc3aa02a03c1006fd2a7745b23254c9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Sat, 2 Jan 2021 02:34:03 +0000 -Subject: [PATCH 459/834] overlays: add wm8960-soundcard overlay +Subject: [PATCH 450/889] overlays: add wm8960-soundcard overlay add overlay for waveshare wm8960 simple-audio-card @@ -204040,10 +203200,10 @@ index 000000000000..289fa4dacdf1 2.18.4 -From bb1c5cb18511301e58313d2c2dc6227993a06094 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Sat, 26 Dec 2020 03:13:14 +0000 -Subject: [PATCH 460/834] overlays: add spi override to merus-amp overlay +Subject: [PATCH 451/889] overlays: add spi override to merus-amp overlay adds an override to the merus-amp overlay to turn the spi bus off @@ -204092,10 +203252,10 @@ index 4501fbdc253d..bbffd7d26324 100644 2.18.4 -From 87790206339f7551f39b017b4344d9e16c3cf356 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 6 Jan 2021 17:28:57 +0000 -Subject: [PATCH 461/834] dt: Add a camera regulator node to all downstream Pi +Subject: [PATCH 452/889] dt: Add a camera regulator node to all downstream Pi platforms The current firmware fixup of camera sensor overlays is not @@ -204453,10 +203613,10 @@ index 000000000000..55237d03ed94 2.18.4 -From 4e4940571444ced0cd62522a1d7a7aa0ceaf53a7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 6 Jan 2021 17:42:31 +0000 -Subject: [PATCH 462/834] dtoverlays: Update sensor overlays to use cam1_reg +Subject: [PATCH 453/889] dtoverlays: Update sensor overlays to use cam1_reg where possible Update those overlays that use the regulator framework to use the @@ -204710,10 +203870,10 @@ index 40b298d3dd86..b7a9c8c539da 100644 2.18.4 -From ea77ad440eac14206882b0246194a169bc21d959 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Sat, 9 Jan 2021 17:03:32 +0100 -Subject: [PATCH 463/834] overlays: seeed-can-fd-hat: clarify how to identify +Subject: [PATCH 454/889] overlays: seeed-can-fd-hat: clarify how to identify HAT version It turns out the used CAN SPI chip is not a good way to identify the version of @@ -204761,76 +203921,10 @@ index 5076ca440742..bc889782a30b 100644 2.18.4 -From e4020a9a98fc192cc4b2d128d132198ef3c45bfb Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 13 Jan 2021 21:25:38 +0000 -Subject: [PATCH 464/834] SQUASH: Revert: "overlays: Make the i2c-gpio overlay - safe again" - -This revert and its neighbour are opposites. When squashing, delete -the original commits as well. - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts b/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts -index 63231b5d7c0c..2323a61edf07 100644 ---- 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"; --- -2.18.4 - - -From a3f62605e088f2c77931370d102010c9a0accbb6 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 13 Jan 2021 21:27:56 +0000 -Subject: [PATCH 465/834] SQUASH: Revert "overlays: Fix dtc warnings in - i2c-gpio" - -This reverts commit 1c15edc0dca002c8536e9f1f5e1ec43017815018. - -This revert and its neighbour are opposites. When squashing, delete -the original commits as well. - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts b/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts -index 2323a61edf07..63231b5d7c0c 100644 ---- 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"; --- -2.18.4 - - -From 64f95abf17036fa5cb7060f25508d3d289afe586 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 19 Jan 2021 08:57:21 +0000 -Subject: [PATCH 466/834] configs: Enable BCM2835 thermal driver in kernel8 +Subject: [PATCH 455/889] configs: Enable BCM2835 thermal driver in kernel8 The arm64 version of bcm2711_defconfig is intended for Pi 4, but the Raspberry Pi OS kernel8.img built from it is also used for Pi 3. It is @@ -204861,10 +203955,10 @@ index 325ff25a243d..eeb52d96e26b 100644 2.18.4 -From a8d5f97e7b99be680d7ab42c644b31d3acc7ab1b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 14 Jan 2021 09:18:42 +0000 -Subject: [PATCH 467/834] uapi: bcm2835-isp: Add colour denoise configuration +Subject: [PATCH 456/889] uapi: bcm2835-isp: Add colour denoise configuration Add a configuration structure for colour denoise to the bcm2835_isp driver. @@ -204923,10 +204017,10 @@ index cf8c0437f159..c50e3ca81565 100644 2.18.4 -From e421341ebd045b43cf38542b3a32f3130b2d7f52 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 14 Jan 2021 09:20:52 +0000 -Subject: [PATCH 468/834] staging: vc04_services: ISP: Add colour denoise +Subject: [PATCH 457/889] staging: vc04_services: ISP: Add colour denoise control Add colour denoise control to the bcm2835 driver through a new v4l2 @@ -205008,10 +204102,10 @@ index efda4dc039c3..79438d23912f 100644 2.18.4 -From 0ec9b5471a180eb87d575e7b592fda012b5438c3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 21 Jan 2021 18:27:08 +0000 -Subject: [PATCH 469/834] configs: Add CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +Subject: [PATCH 458/889] configs: Add CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m Signed-off-by: popcornmix --- @@ -205086,10 +204180,10 @@ index 5d6f27ec87f6..5b6a5d59b394 100644 2.18.4 -From 887cd4d88febf00069caad583118a4cd07516441 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 22 Jan 2021 09:28:06 +0000 -Subject: [PATCH 470/834] configs: Add CONFIG_USB_NET_AQC111=m +Subject: [PATCH 459/889] configs: Add CONFIG_USB_NET_AQC111=m See: https://github.com/raspberrypi/linux/pull/4086 @@ -205166,10 +204260,10 @@ index 5b6a5d59b394..655b1d87720b 100644 2.18.4 -From a43703bbd4db33f806cc4ad6093fcb1a987136e3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nicolas Saenz Julienne Date: Thu, 10 Dec 2020 19:22:45 +0100 -Subject: [PATCH 471/834] dt-bindings: nvmem: Add bindings for rmem driver +Subject: [PATCH 460/889] dt-bindings: nvmem: Add bindings for rmem driver Firmware/co-processors might use reserved memory areas in order to pass data stemming from an nvmem device otherwise non accessible to Linux. @@ -205248,10 +204342,10 @@ index 000000000000..29b53871aa02 2.18.4 -From d40ed4f4df89639b628132efc965f652cf098256 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nicolas Saenz Julienne Date: Thu, 10 Dec 2020 12:13:49 +0100 -Subject: [PATCH 472/834] nvmem: Add driver to expose reserved memory as nvmem +Subject: [PATCH 461/889] nvmem: Add driver to expose reserved memory as nvmem Firmware/co-processors might use reserved memory areas in order to pass data stemming from an nvmem device otherwise non accessible to Linux. @@ -205424,10 +204518,10 @@ index b557a0fcd4ba..281856ac1988 100644 2.18.4 -From 234f7e273da2d5e717c1777b367f7e9fc699640a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nicolas Saenz Julienne Date: Fri, 11 Dec 2020 12:22:01 +0100 -Subject: [PATCH 473/834] ARM: dts: bcm2711: Add reserved memory template to +Subject: [PATCH 462/889] ARM: dts: bcm2711: Add reserved memory template to hold firmware configuration RPi4's co-processor will copy the board's bootloader[1] configuration @@ -205490,10 +204584,10 @@ index 32e7af96aa83..b8339a629fb9 100644 2.18.4 -From 4f0c827f772d36ba60d351ee2e383bfd8049304b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nicolas Saenz Julienne Date: Fri, 11 Dec 2020 13:04:37 +0100 -Subject: [PATCH 474/834] arm64: defconfig: Enable nvmem's rmem driver +Subject: [PATCH 463/889] arm64: defconfig: Enable nvmem's rmem driver It'll be used by the RPi4 family of boards to access its bootloader configuration. @@ -205519,10 +204613,10 @@ index 5cfe3cf6f2ac..a9f496d74639 100644 2.18.4 -From e4b7e810796fe2bcd569113c8728e19c4fbf4f1b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nicolas Saenz Julienne Date: Fri, 11 Dec 2020 13:15:41 +0100 -Subject: [PATCH 475/834] ARM: multi_v7_defconfig: Enable nvmem's rmem driver +Subject: [PATCH 464/889] ARM: multi_v7_defconfig: Enable nvmem's rmem driver It'll be used by the RPi4 family of boards to access its bootloader configuration. @@ -205548,10 +204642,10 @@ index a611b0c1e540..ea2715c9f923 100644 2.18.4 -From e1ebc9da8e42e59fc0e13163e069e1e87e386629 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 22 Jan 2021 12:08:19 +0000 -Subject: [PATCH 476/834] configs: Add NVMEM_RMEM=m for 2711 +Subject: [PATCH 465/889] configs: Add NVMEM_RMEM=m for 2711 Signed-off-by: Phil Elwell --- @@ -205587,10 +204681,10 @@ index 590a235f9e25..4c4068953a97 100644 2.18.4 -From 0ddfb0cc5e38093ab4f6944cb31a6bb3038ac077 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 22 Jan 2021 16:15:06 +0000 -Subject: [PATCH 477/834] configs: Add CRYPTO_ADIANTUM=m +Subject: [PATCH 466/889] configs: Add CRYPTO_ADIANTUM=m See: https://github.com/raspberrypi/linux/issues/3648 @@ -205667,10 +204761,10 @@ index 655b1d87720b..1ca2f13a2af5 100644 2.18.4 -From b4da1aed4d109f96b05b7d2c77af24aa083724b2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 28 Jan 2021 11:30:04 +0000 -Subject: [PATCH 478/834] spi: bcm2835: Workaround/fix for zero-length +Subject: [PATCH 467/889] spi: bcm2835: Workaround/fix for zero-length transfers A relatively recent commit ([1]) contained optimisation for the PIO @@ -205723,10 +204817,10 @@ index 1240422970df..4f40d2b9d468 100644 2.18.4 -From d7f70abee6a51d6e82eb90c2da1287a57b71516e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 29 Jan 2021 10:34:11 +0000 -Subject: [PATCH 479/834] kbuild: Silence unavoidable dtc overlay warnings +Subject: [PATCH 468/889] kbuild: Silence unavoidable dtc overlay warnings Much effort has been put into finding ways to avoid warnings from dtc about overlays, usually to do with the presence of #address-cells and @@ -205760,10 +204854,10 @@ index 9c0df5bde46c..43758c8d4b68 100644 2.18.4 -From ceca79d8a06503f94bcc4aa680318839215b65d6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 1 Feb 2021 12:45:29 +0000 -Subject: [PATCH 480/834] configs: Enable CONFIG_MEDIA_CEC_RC +Subject: [PATCH 469/889] configs: Enable CONFIG_MEDIA_CEC_RC See: https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=301072 --- @@ -205846,10 +204940,10 @@ index 1ca2f13a2af5..aa89eb5704cb 100644 2.18.4 -From 873e042c6a137a6d127b0a73d83c494cecd2d2bb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joerg Schambacher Date: Fri, 29 Jan 2021 08:26:44 +0100 -Subject: [PATCH 481/834] Adds the DT-overlays to support Hifiberry AMP100 +Subject: [PATCH 470/889] Adds the DT-overlays to support Hifiberry AMP100 Adds new DT-overlay to control AMP100. @@ -205989,10 +205083,10 @@ index 000000000000..ebdef55d6110 2.18.4 -From 73dd8c18fd5fe4433dfe3a09038b1a63d93b39c2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joerg Schambacher Date: Fri, 29 Jan 2021 16:16:39 +0100 -Subject: [PATCH 482/834] Enhances the Hifiberry DAC+ driver for Hifiberry +Subject: [PATCH 471/889] Enhances the Hifiberry DAC+ driver for Hifiberry AMP100 support Adds the necessary GPIO handling and ALSA mixer extensions. @@ -206233,10 +205327,10 @@ index 157ab4c2cc85..bdcac1b6992c 100644 2.18.4 -From 995fad2a0649f90a0f4fd3664f64b36a40d8c694 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 3 Feb 2021 16:23:43 +0000 -Subject: [PATCH 483/834] ARM: dts: Declare Pi400 and CM4 have no audio pins +Subject: [PATCH 472/889] ARM: dts: Declare Pi400 and CM4 have no audio pins The audio_pins node is left as a placeholder for the audremap overlay, and it must have (empty) brcm,function and brcm,pins properties @@ -206282,10 +205376,10 @@ index 7ab0aba5f1a3..9ab2feb4424f 100644 2.18.4 -From 10dd8edb76e329907063c2bff7e41b31cf0432be Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 4 Feb 2021 17:29:32 +0000 -Subject: [PATCH 484/834] media: i2c: imx290: Replace V4L2_CID_GAIN with +Subject: [PATCH 473/889] media: i2c: imx290: Replace V4L2_CID_GAIN with V4L2_CID_ANALOGUE_GAIN Most software (including libcamera) requires V4L2_CID_ANALOGUE_GAIN, @@ -206326,10 +205420,10 @@ index 2e646fb01856..a2df46e4aabc 100644 2.18.4 -From 057e24700fe53daf4ebd1615e464bbae068bf559 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 4 Feb 2021 21:21:44 +0000 -Subject: [PATCH 485/834] media: i2c: imx290: Fix number of controls in +Subject: [PATCH 474/889] media: i2c: imx290: Fix number of controls in v4l2_ctrl_handler_init The number is only a hint, but may as well be correct. @@ -206360,79 +205454,10 @@ index a2df46e4aabc..33ce80686163 100644 2.18.4 -From da2844424f8ee1266120cb351333ab30f1a4a2a9 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 5 Feb 2021 09:20:31 +0000 -Subject: [PATCH 486/834] i2c: bcm2835: Handle untimely DONE signal - -Under certain circumstance the DONE flag can appear to be set early. -Fortunately the TA flag is often still set at that time, and it can be -used as an indication that DONE is invalid. - -Handle the other cases - when TA is not set but not all data is -available - by silently accepting it and hoping for a second DONE. - -See: https://github.com/raspberrypi/linux/issues/3064 - -Signed-off-by: Phil Elwell ---- - drivers/i2c/busses/i2c-bcm2835.c | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - -diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c -index 5b2589b6b9cc..90ca593d8ae3 100644 ---- a/drivers/i2c/busses/i2c-bcm2835.c -+++ b/drivers/i2c/busses/i2c-bcm2835.c -@@ -373,6 +373,10 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) - u32 val, err; - - val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S); -+ bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_S, -+ BCM2835_I2C_S_CLKT | -+ BCM2835_I2C_S_ERR | -+ BCM2835_I2C_S_DONE); - bcm2835_debug_add(i2c_dev, val); - - err = val & (BCM2835_I2C_S_CLKT | BCM2835_I2C_S_ERR); -@@ -382,6 +386,9 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) - } - - if (val & BCM2835_I2C_S_DONE) { -+ if (val & BCM2835_I2C_S_TA) -+ return IRQ_HANDLED; -+ - if (!i2c_dev->curr_msg) { - dev_err(i2c_dev->dev, "Got unexpected interrupt (from firmware?)\n"); - } else if (i2c_dev->curr_msg->flags & I2C_M_RD) { -@@ -389,7 +396,10 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) - val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S); - } - -- if ((val & BCM2835_I2C_S_RXD) || i2c_dev->msg_buf_remaining) -+ if (i2c_dev->msg_buf_remaining) -+ return IRQ_HANDLED; -+ -+ if (val & BCM2835_I2C_S_RXD) - i2c_dev->msg_err = BCM2835_I2C_S_LEN; - else - i2c_dev->msg_err = 0; -@@ -426,8 +436,6 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) - - complete: - bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR); -- bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_S, BCM2835_I2C_S_CLKT | -- BCM2835_I2C_S_ERR | BCM2835_I2C_S_DONE); - complete(&i2c_dev->completion); - - return IRQ_HANDLED; --- -2.18.4 - - -From 41cf99f004a8d1a4e7e14c0df43d393c73d7fd27 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 5 Feb 2021 12:04:06 +0000 -Subject: [PATCH 487/834] configs: Add MICREL_PHY=y +Subject: [PATCH 475/889] configs: Add MICREL_PHY=y Signed-off-by: Phil Elwell --- @@ -206468,404 +205493,10 @@ index 6acc0dbe9187..a2531896a8b6 100644 2.18.4 -From 1ef4ba4442ae0f1ba89e1a2069bc759927c9b478 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Tue, 8 Dec 2020 17:13:32 +0100 -Subject: [PATCH 488/834] Revert "vc4_hdmi: Make irq shared" - -This reverts commit cd59e087d8bba4ba834565b4d48ba983143b5f27. ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index ef08ecb11f1a..d2665ceae0fc 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2197,8 +2197,7 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) - - ret = devm_request_threaded_irq(&pdev->dev, platform_get_irq(pdev, 0), - vc4_cec_irq_handler, -- vc4_cec_irq_handler_thread, -- IRQF_SHARED, -+ vc4_cec_irq_handler_thread, 0, - "vc4 hdmi cec", vc4_hdmi); - if (ret) - goto err_delete_cec_adap; --- -2.18.4 - - -From 6ec57818316f164caf4ce1733cdd741ffc9a1659 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Tue, 8 Dec 2020 17:13:33 +0100 -Subject: [PATCH 489/834] Revert "vc4_hdmi_regs: Make interrupt mask variant - specific" - -This reverts commit 37c74a07cf22a7385c93170a723d22b95ff20a51. ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 14 ++++---------- - drivers/gpu/drm/vc4/vc4_hdmi.h | 3 --- - drivers/gpu/drm/vc4/vc4_regs.h | 9 --------- - 3 files changed, 4 insertions(+), 22 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index d2665ceae0fc..a2d6410c7744 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2054,7 +2054,7 @@ static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) - u32 stat = HDMI_READ(HDMI_CEC_CPU_STATUS); - u32 cntrl1, cntrl5; - -- if (!(stat & vc4_hdmi->variant->cec_mask)) -+ if (!(stat & VC4_HDMI_CPU_CEC)) - return IRQ_NONE; - vc4_hdmi->cec_rx_msg.len = 0; - cntrl1 = HDMI_READ(HDMI_CEC_CNTRL_1); -@@ -2070,7 +2070,7 @@ static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) - cntrl1 &= ~VC4_HDMI_CEC_START_XMIT_BEGIN; - } - HDMI_WRITE(HDMI_CEC_CNTRL_1, cntrl1); -- HDMI_WRITE(HDMI_CEC_CPU_CLEAR, vc4_hdmi->variant->cec_mask); -+ HDMI_WRITE(HDMI_CEC_CPU_CLEAR, VC4_HDMI_CPU_CEC); - - return IRQ_WAKE_THREAD; - } -@@ -2109,9 +2109,9 @@ static int vc4_hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable) - ((3600 / usecs) << VC4_HDMI_CEC_CNT_TO_3600_US_SHIFT) | - ((3500 / usecs) << VC4_HDMI_CEC_CNT_TO_3500_US_SHIFT)); - -- HDMI_WRITE(HDMI_CEC_CPU_MASK_CLEAR, vc4_hdmi->variant->cec_mask); -+ HDMI_WRITE(HDMI_CEC_CPU_MASK_CLEAR, VC4_HDMI_CPU_CEC); - } else { -- HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, vc4_hdmi->variant->cec_mask); -+ HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, VC4_HDMI_CPU_CEC); - HDMI_WRITE(HDMI_CEC_CNTRL_5, val | - VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET); - } -@@ -2653,8 +2653,6 @@ static const struct vc4_hdmi_variant bcm2835_variant = { - .phy_rng_disable = vc4_hdmi_phy_rng_disable, - .calc_hsm_clock = vc4_hdmi_calc_hsm_clock, - .channel_map = vc4_hdmi_channel_map, -- -- .cec_mask = VC4_HDMI_CPU_CEC, - }; - - static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { -@@ -2682,8 +2680,6 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { - .phy_rng_disable = vc5_hdmi_phy_rng_disable, - .calc_hsm_clock = vc5_hdmi_calc_hsm_clock, - .channel_map = vc5_hdmi_channel_map, -- -- .cec_mask = VC5_HDMI0_CPU_CEC_RX | VC5_HDMI0_CPU_CEC_TX, - }; - - static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { -@@ -2711,8 +2707,6 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { - .phy_rng_disable = vc5_hdmi_phy_rng_disable, - .calc_hsm_clock = vc5_hdmi_calc_hsm_clock, - .channel_map = vc5_hdmi_channel_map, -- -- .cec_mask = VC5_HDMI1_CPU_CEC_RX | VC5_HDMI1_CPU_CEC_TX, - }; - - static const struct of_device_id vc4_hdmi_dt_match[] = { -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index b0baed2e1a78..64d05f8af5f3 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.h -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -98,9 +98,6 @@ struct vc4_hdmi_variant { - - /* Callback to get channel map */ - u32 (*channel_map)(struct vc4_hdmi *vc4_hdmi, u32 channel_mask); -- -- /* Bitmask for CEC events */ -- u32 cec_mask; - }; - - /* HDMI audio information */ -diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h -index 1f1ed7efaff7..78fd28599aeb 100644 ---- a/drivers/gpu/drm/vc4/vc4_regs.h -+++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -698,15 +698,6 @@ enum { - # define VC4_HDMI_CPU_CEC BIT(6) - # define VC4_HDMI_CPU_HOTPLUG BIT(0) - --# define VC5_HDMI0_CPU_CEC_RX BIT(1) --# define VC5_HDMI0_CPU_CEC_TX BIT(0) --# define VC5_HDMI0_CPU_HOTPLUG_CONN BIT(4) --# define VC5_HDMI0_CPU_HOTPLUG_REM BIT(5) --# define VC5_HDMI1_CPU_CEC_RX BIT(7) --# define VC5_HDMI1_CPU_CEC_TX BIT(6) --# define VC5_HDMI1_CPU_HOTPLUG_CONN BIT(10) --# define VC5_HDMI1_CPU_HOTPLUG_REM BIT(11) -- - /* Debug: Current receive value on the CEC pad. */ - # define VC4_HD_CECRXD BIT(9) - /* Debug: Override CEC output to 0. */ --- -2.18.4 - - -From 74b02aee281eb7dcd5ccf777b6e56bf6fcd96f4a Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Tue, 8 Dec 2020 17:13:35 +0100 -Subject: [PATCH 490/834] Revert "vc4_hdmi_regs: Add Intr2 register block" - -This reverts commit c865bb1bb6b481acfa4157e4331db278a176f887. ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 13 ------------- - drivers/gpu/drm/vc4/vc4_hdmi.h | 3 --- - drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 17 ----------------- - 3 files changed, 33 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index a2d6410c7744..62ead34dbb90 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -411,7 +411,6 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) - drm_print_regset32(&p, &vc4_hdmi->cec_regset); - drm_print_regset32(&p, &vc4_hdmi->csc_regset); - drm_print_regset32(&p, &vc4_hdmi->dvp_regset); -- drm_print_regset32(&p, &vc4_hdmi->intr2_regset); - drm_print_regset32(&p, &vc4_hdmi->phy_regset); - drm_print_regset32(&p, &vc4_hdmi->ram_regset); - drm_print_regset32(&p, &vc4_hdmi->rm_regset); -@@ -2352,14 +2351,6 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) - if (!vc4_hdmi->dvp_regs) - return -ENOMEM; - -- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "intr2"); -- if (!res) -- return -ENODEV; -- -- vc4_hdmi->intr2_regs = devm_ioremap(dev, res->start, resource_size(res)); -- if (IS_ERR(vc4_hdmi->intr2_regs)) -- return PTR_ERR(vc4_hdmi->intr2_regs); -- - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy"); - if (!res) - return -ENODEV; -@@ -2440,10 +2431,6 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) - if (ret) - return ret; - -- ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->intr2_regset, VC5_INTR2); -- if (ret) -- return ret; -- - return 0; - } - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index 64d05f8af5f3..b0ba2421cc04 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.h -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -146,8 +146,6 @@ struct vc4_hdmi { - void __iomem *ram_regs; - /* VC5 Only */ - void __iomem *rm_regs; -- /* VC5 Only */ -- void __iomem *intr2_regs; - - int hpd_gpio; - bool hpd_active_low; -@@ -179,7 +177,6 @@ struct vc4_hdmi { - struct debugfs_regset32 cec_regset; - struct debugfs_regset32 csc_regset; - struct debugfs_regset32 dvp_regset; -- struct debugfs_regset32 intr2_regset; - struct debugfs_regset32 phy_regset; - struct debugfs_regset32 ram_regset; - struct debugfs_regset32 rm_regset; -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h -index 9e85266e53f5..20a1438a72cb 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h -+++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h -@@ -15,7 +15,6 @@ enum vc4_hdmi_regs { - VC5_PHY, - VC5_RAM, - VC5_RM, -- VC5_INTR2, - }; - - enum vc4_hdmi_field { -@@ -143,7 +142,6 @@ struct vc4_hdmi_register { - #define VC5_CEC_REG(reg, offset) _VC4_REG(VC5_CEC, reg, offset) - #define VC5_CSC_REG(reg, offset) _VC4_REG(VC5_CSC, reg, offset) - #define VC5_DVP_REG(reg, offset) _VC4_REG(VC5_DVP, reg, offset) --#define VC5_INTR2_REG(reg, offset) _VC4_REG(VC5_INTR2, reg, offset) - #define VC5_PHY_REG(reg, offset) _VC4_REG(VC5_PHY, reg, offset) - #define VC5_RAM_REG(reg, offset) _VC4_REG(VC5_RAM, reg, offset) - #define VC5_RM_REG(reg, offset) _VC4_REG(VC5_RM, reg, offset) -@@ -279,12 +277,6 @@ static const struct vc4_hdmi_register vc5_hdmi_hdmi0_fields[] = { - VC5_CEC_REG(HDMI_CEC_RX_DATA_2, 0x03c), - VC5_CEC_REG(HDMI_CEC_RX_DATA_3, 0x040), - VC5_CEC_REG(HDMI_CEC_RX_DATA_4, 0x044), -- VC5_INTR2_REG(HDMI_CEC_CPU_STATUS, 0x0000), -- VC5_INTR2_REG(HDMI_CEC_CPU_SET, 0x0004), -- VC5_INTR2_REG(HDMI_CEC_CPU_CLEAR, 0x0008), -- VC5_INTR2_REG(HDMI_CEC_CPU_MASK_STATUS, 0x000c), -- VC5_INTR2_REG(HDMI_CEC_CPU_MASK_SET, 0x0010), -- VC5_INTR2_REG(HDMI_CEC_CPU_MASK_CLEAR, 0x0014), - - VC5_CSC_REG(HDMI_CSC_CTL, 0x000), - VC5_CSC_REG(HDMI_CSC_12_11, 0x004), -@@ -364,12 +356,6 @@ static const struct vc4_hdmi_register vc5_hdmi_hdmi1_fields[] = { - VC5_CEC_REG(HDMI_CEC_RX_DATA_2, 0x03c), - VC5_CEC_REG(HDMI_CEC_RX_DATA_3, 0x040), - VC5_CEC_REG(HDMI_CEC_RX_DATA_4, 0x044), -- VC5_INTR2_REG(HDMI_CEC_CPU_STATUS, 0x0000), -- VC5_INTR2_REG(HDMI_CEC_CPU_SET, 0x0004), -- VC5_INTR2_REG(HDMI_CEC_CPU_CLEAR, 0x0008), -- VC5_INTR2_REG(HDMI_CEC_CPU_MASK_STATUS, 0x000c), -- VC5_INTR2_REG(HDMI_CEC_CPU_MASK_SET, 0x0010), -- VC5_INTR2_REG(HDMI_CEC_CPU_MASK_CLEAR, 0x0014), - - VC5_CSC_REG(HDMI_CSC_CTL, 0x000), - VC5_CSC_REG(HDMI_CSC_12_11, 0x004), -@@ -400,9 +386,6 @@ void __iomem *__vc4_hdmi_get_field_base(struct vc4_hdmi *hdmi, - case VC5_DVP: - return hdmi->dvp_regs; - -- case VC5_INTR2: -- return hdmi->intr2_regs; -- - case VC5_PHY: - return hdmi->phy_regs; - --- -2.18.4 - - -From d414fd32efadf59063d09d2e960e497fa37457ec Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Tue, 8 Dec 2020 17:13:38 +0100 -Subject: [PATCH 491/834] Revert "vc4_hdmi: BCM2835 requires a fixed hsm clock - for CEC to work" - -This reverts commit 1cad24365e9f4325d68d4a16025f77abe3eda2f7. ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 54 +++++++++++----------------------- - drivers/gpu/drm/vc4/vc4_hdmi.h | 3 -- - 2 files changed, 17 insertions(+), 40 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 62ead34dbb90..13cf20a7b220 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1085,7 +1085,23 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, - return; - } - -- hsm_rate = vc4_hdmi->variant->calc_hsm_clock(vc4_hdmi, pixel_rate); -+ /* -+ * As stated in RPi's vc4 firmware "HDMI state machine (HSM) clock must -+ * be faster than pixel clock, infinitesimally faster, tested in -+ * simulation. Otherwise, exact value is unimportant for HDMI -+ * operation." This conflicts with bcm2835's vc4 documentation, which -+ * states HSM's clock has to be at least 108% of the pixel clock. -+ * -+ * Real life tests reveal that vc4's firmware statement holds up, and -+ * users are able to use pixel clocks closer to HSM's, namely for -+ * 1920x1200@60Hz. So it was decided to have leave a 1% margin between -+ * both clocks. Which, for RPi0-3 implies a maximum pixel clock of -+ * 162MHz. -+ * -+ * Additionally, the AXI clock needs to be at least 25% of -+ * pixel clock, but HSM ends up being the limiting factor. -+ */ -+ hsm_rate = max_t(unsigned long, 120000000, (pixel_rate / 100) * 101); - ret = clk_set_min_rate(vc4_hdmi->hsm_clock, hsm_rate); - if (ret) { - DRM_ERROR("Failed to set HSM clock rate: %d\n", ret); -@@ -1286,39 +1302,6 @@ static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { - .enable = vc4_hdmi_encoder_enable, - }; - --static u32 vc4_hdmi_calc_hsm_clock(struct vc4_hdmi *vc4_hdmi, unsigned long pixel_rate) --{ -- /* -- * Whilst this can vary, all the CEC timings are derived from this -- * clock, so make it constant to avoid having to reconfigure CEC on -- * every mode change. -- */ -- -- return 163682864; --} -- --static u32 vc5_hdmi_calc_hsm_clock(struct vc4_hdmi *vc4_hdmi, unsigned long pixel_rate) --{ -- /* -- * As stated in RPi's vc4 firmware "HDMI state machine (HSM) clock must -- * be faster than pixel clock, infinitesimally faster, tested in -- * simulation. Otherwise, exact value is unimportant for HDMI -- * operation." This conflicts with bcm2835's vc4 documentation, which -- * states HSM's clock has to be at least 108% of the pixel clock. -- * -- * Real life tests reveal that vc4's firmware statement holds up, and -- * users are able to use pixel clocks closer to HSM's, namely for -- * 1920x1200@60Hz. So it was decided to have leave a 1% margin between -- * both clocks. Which, for RPi0-3 implies a maximum pixel clock of -- * 162MHz. -- * -- * Additionally, the AXI clock needs to be at least 25% of -- * pixel clock, but HSM ends up being the limiting factor. -- */ -- -- return max_t(unsigned long, 108000000, (pixel_rate / 100) * 101); --} -- - static u32 vc4_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask) - { - int i; -@@ -2638,7 +2621,6 @@ static const struct vc4_hdmi_variant bcm2835_variant = { - .phy_disable = vc4_hdmi_phy_disable, - .phy_rng_enable = vc4_hdmi_phy_rng_enable, - .phy_rng_disable = vc4_hdmi_phy_rng_disable, -- .calc_hsm_clock = vc4_hdmi_calc_hsm_clock, - .channel_map = vc4_hdmi_channel_map, - }; - -@@ -2665,7 +2647,6 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { - .phy_disable = vc5_hdmi_phy_disable, - .phy_rng_enable = vc5_hdmi_phy_rng_enable, - .phy_rng_disable = vc5_hdmi_phy_rng_disable, -- .calc_hsm_clock = vc5_hdmi_calc_hsm_clock, - .channel_map = vc5_hdmi_channel_map, - }; - -@@ -2692,7 +2673,6 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { - .phy_disable = vc5_hdmi_phy_disable, - .phy_rng_enable = vc5_hdmi_phy_rng_enable, - .phy_rng_disable = vc5_hdmi_phy_rng_disable, -- .calc_hsm_clock = vc5_hdmi_calc_hsm_clock, - .channel_map = vc5_hdmi_channel_map, - }; - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h -index b0ba2421cc04..f18f1d775241 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.h -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h -@@ -93,9 +93,6 @@ struct vc4_hdmi_variant { - /* Callback to disable the RNG in the PHY */ - void (*phy_rng_disable)(struct vc4_hdmi *vc4_hdmi); - -- /* Callback to calculate hsm clock */ -- u32 (*calc_hsm_clock)(struct vc4_hdmi *vc4_hdmi, unsigned long pixel_rate); -- - /* Callback to get channel map */ - u32 (*channel_map)(struct vc4_hdmi *vc4_hdmi, u32 channel_mask); - }; --- -2.18.4 - - -From 56264c76d7ceac36f9b78ec6d57e69ef49ee8766 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 11 Jan 2021 15:22:55 +0100 -Subject: [PATCH 492/834] ARM: bcm: Select BRCMSTB_L2_IRQ for bcm2835 +Subject: [PATCH 476/889] ARM: bcm: Select BRCMSTB_L2_IRQ for bcm2835 The BCM2711 has a number of instances of interrupt controllers handled by the driver behind the BRCMSTB_L2_IRQ Kconfig option (irq-brcmstb-l2). @@ -206907,10 +205538,10 @@ index 5c4ac1c9f4e0..2c5620822895 100644 2.18.4 -From cc07675d9aad9d4f183c0ca117d5830bd6b16733 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 11 Jan 2021 15:23:02 +0100 -Subject: [PATCH 493/834] drm/vc4: hdmi: Introduce a CEC clock +Subject: [PATCH 477/889] drm/vc4: hdmi: Introduce a CEC clock While the BCM2835 had the CEC clock derived from the HSM clock, the BCM2711 has a dedicated parent clock for it. @@ -206975,10 +205606,10 @@ index f18f1d775241..c9b4b7678df4 100644 2.18.4 -From f7ea939df063c576ed3e67960911759a0e69afc4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 11 Jan 2021 15:23:03 +0100 -Subject: [PATCH 494/834] drm/vc4: hdmi: Split the interrupt handlers +Subject: [PATCH 478/889] drm/vc4: hdmi: Split the interrupt handlers The BCM2711 has two different interrupt sources to transmit and receive CEC messages, provided through an external interrupt chip shared between @@ -207122,10 +205753,10 @@ index 574bbed72383..335a9574007d 100644 2.18.4 -From 5eead4fdf658de8d90b256db7ce536399b6f1bd1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 11 Jan 2021 15:23:04 +0100 -Subject: [PATCH 495/834] drm/vc4: hdmi: Support BCM2711 CEC interrupt setup +Subject: [PATCH 479/889] drm/vc4: hdmi: Support BCM2711 CEC interrupt setup The HDMI controller found in the BCM2711 has an external interrupt controller for the CEC and hotplug interrupt shared between the two @@ -207246,10 +205877,10 @@ index c9b4b7678df4..ae1be14812b8 100644 2.18.4 -From 5503e4ee78422d7411b43914515fe5cf7003b5dc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 11 Jan 2021 15:23:05 +0100 -Subject: [PATCH 496/834] drm/vc4: hdmi: Remove cec_available flag +Subject: [PATCH 480/889] drm/vc4: hdmi: Remove cec_available flag Now that our HDMI controller supports CEC for the BCM2711, let's remove that flag. @@ -207302,10 +205933,10 @@ index ae1be14812b8..cb2af9f144df 100644 2.18.4 -From b749b160a14db8b92c7180538e33065547b84d98 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 11 Jan 2021 15:23:06 +0100 -Subject: [PATCH 497/834] drm/vc4: hdmi: Don't register the CEC adapter if +Subject: [PATCH 481/889] drm/vc4: hdmi: Don't register the CEC adapter if there's no interrupts We introduced the BCM2711 support to the vc4 HDMI controller with 5.10, @@ -207345,10 +205976,10 @@ index 21b547c158b1..b39cc371abdf 100644 2.18.4 -From 46a52546bba97b2825ce48e32f5ba49fb760aafc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 11 Jan 2021 15:23:07 +0100 -Subject: [PATCH 498/834] dt-binding: display: bcm2711-hdmi: Add CEC and +Subject: [PATCH 482/889] dt-binding: display: bcm2711-hdmi: Add CEC and hotplug interrupts The CEC and hotplug interrupts were missing when that binding was @@ -207402,10 +206033,10 @@ index 7ce06f9f9f8e..6e8ac910bdd8 100644 2.18.4 -From 2aaa9552af8dcaed049f4de21968e771880e77ec Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 11 Jan 2021 15:23:08 +0100 -Subject: [PATCH 499/834] ARM: dts: bcm2711: Add the BSC interrupt controller +Subject: [PATCH 483/889] ARM: dts: bcm2711: Add the BSC interrupt controller The BSC controllers used for the HDMI DDC have an interrupt controller shared between both instances. Let's add it to avoid polling. @@ -207457,10 +206088,10 @@ index 9c615dd3715e..1646231f0076 100644 2.18.4 -From e18fc7705b24d5f8843adde8673a487215070f07 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 11 Jan 2021 15:23:09 +0100 -Subject: [PATCH 500/834] ARM: dts: bcm2711: Add the CEC interrupt controller +Subject: [PATCH 484/889] ARM: dts: bcm2711: Add the CEC interrupt controller The CEC and hotplug interrupts go through an interrupt controller shared between the two HDMI controllers. @@ -207521,10 +206152,10 @@ index 1646231f0076..733d9ccf0514 100644 2.18.4 -From d387a5a5eee7139e4ab3f6dd419e1f80239bdd76 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 9 Dec 2020 16:37:01 +0000 -Subject: [PATCH 501/834] bcm2711: Disable bsc_intr and aon_intr by default and +Subject: [PATCH 485/889] bcm2711: Disable bsc_intr and aon_intr by default and enable in overlay Signed-off-by: Dom Cobley @@ -207582,10 +206213,10 @@ index f721f12d729d..8e9220f303f0 100644 2.18.4 -From 47e6e52a3b2e646e6f77f12685b956e123f5f8ae Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 15 Dec 2020 16:42:42 +0100 -Subject: [PATCH 502/834] drm/vc4: hdmi: Limit the BCM2711 to the max without +Subject: [PATCH 486/889] drm/vc4: hdmi: Limit the BCM2711 to the max without scrambling Unlike the previous generations, the HSM clock limitation is way above @@ -207633,10 +206264,10 @@ index b39cc371abdf..08f337a156ad 100644 2.18.4 -From fcae6f6d0cc1301fd3b60c393bf401a7fe1bf109 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 11 Jan 2021 17:08:20 +0000 -Subject: [PATCH 503/834] bcm2711: Remove old GIC interrupt +Subject: [PATCH 487/889] bcm2711: Remove old GIC interrupt Now handled through aon_intr @@ -207669,10 +206300,10 @@ index 271e6ff814df..a4cd27fced4e 100644 2.18.4 -From b3951fe53c0aa243a80166f4dc19e65fbd198bda Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 8 Feb 2021 11:48:35 +0000 -Subject: [PATCH 504/834] staging:bcm2835-camera: Fix the cherry-pick of AWB +Subject: [PATCH 488/889] staging:bcm2835-camera: Fix the cherry-pick of AWB Greyworld The cherry-pick of the patch that added the greyworld AWB mode @@ -207703,10 +206334,10 @@ index a7af25f90449..f73daa38fa66 100644 2.18.4 -From 22d54d745024bd159d1bb7ee06305256c087a0e4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Knell Date: Mon, 8 Feb 2021 03:33:30 +0000 -Subject: [PATCH 505/834] Overlays for PiFi-Mini amp +Subject: [PATCH 489/889] Overlays for PiFi-Mini amp Signed-off-by: David Knell --- @@ -207797,10 +206428,10 @@ index 000000000000..963597d611b5 2.18.4 -From 126bd05432ee9627d1cf6f6a12ddf527be44d5e2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Knell Date: Mon, 8 Feb 2021 03:35:15 +0000 -Subject: [PATCH 506/834] Added PiFi-Mini to rpi-simple-soundcard.c +Subject: [PATCH 490/889] Added PiFi-Mini to rpi-simple-soundcard.c Signed-off-by: David Knell --- @@ -207947,10 +206578,10 @@ index bf61a4239073..c25351e6ee90 100644 2.18.4 -From 84a74a75da3b6d20772bbb6b3c0bd0f00c441aaa Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 12 Jan 2021 13:55:39 +0000 -Subject: [PATCH 507/834] bcm2835-isp: Allow formats with different colour +Subject: [PATCH 491/889] bcm2835-isp: Allow formats with different colour spaces. Each supported format now includes a mask showing the allowed colour @@ -208667,10 +207298,10 @@ index 4d24aec7203d..5cca8bdd1d65 100644 2.18.4 -From 4088e0c909b8c892a715a25b2c655b9e8dbf5994 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joerg Schambacher Date: Mon, 1 Feb 2021 16:53:46 +0100 -Subject: [PATCH 508/834] Hifiberry DAC+ADC Pro fix for the PLL when changing +Subject: [PATCH 492/889] Hifiberry DAC+ADC Pro fix for the PLL when changing sample rates Adds 2 msecs delay when switching between oscillators to allow @@ -208729,10 +207360,10 @@ index 4c03927107e3..8b04d30bcbee 100644 2.18.4 -From 5664a7119ea91881f1bcff1b4bc79d43d5435661 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mathias Anhalt Date: Sun, 24 Jan 2021 15:15:01 +0100 -Subject: [PATCH 509/834] Fixed picture line bug in all ov9281 modes +Subject: [PATCH 493/889] Fixed picture line bug in all ov9281 modes Signed-off-by: Mathias Anhalt --- @@ -208773,10 +207404,10 @@ index 12621c2dccd5..c646f11ef1d5 100644 2.18.4 -From 11aaadb7637460e61a13905c83e0f19a113d7f52 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mathias Anhalt Date: Wed, 3 Feb 2021 20:34:09 +0100 -Subject: [PATCH 510/834] Added hflip and vflip controls to ov9281 +Subject: [PATCH 494/889] Added hflip and vflip controls to ov9281 Signed-off-by: Mathias Anhalt --- @@ -208891,10 +207522,10 @@ index c646f11ef1d5..16777b6f8e14 100644 2.18.4 -From c38e62bf70edcbaed8287b35c9843a2353894555 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 12 Feb 2021 17:45:57 +0000 -Subject: [PATCH 511/834] Partial revert "bcm2711: Disable bsc_intr and +Subject: [PATCH 495/889] Partial revert "bcm2711: Disable bsc_intr and aon_intr by default and enable in overlay" This reverts commit c765fd45856a34b9e46daa9263faeafe006c3985. @@ -208941,10 +207572,10 @@ index 8e9220f303f0..6a11260a4f1a 100644 2.18.4 -From 12a744b64c8a6746498a55ac04012cb0266b7955 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 12 Feb 2021 17:49:25 +0000 -Subject: [PATCH 512/834] Revert "ARM: dts: bcm2711: Add the BSC interrupt +Subject: [PATCH 496/889] Revert "ARM: dts: bcm2711: Add the BSC interrupt controller" This reverts commit 93a3b097c467bd5efc1ae3a271c336fdad3b2108. @@ -209003,10 +207634,10 @@ index 7661afa8ef52..ffd5fed3c4ed 100644 2.18.4 -From 36a34a9337845aa3de7952f3193a568df95caef1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 15 Feb 2021 10:25:35 +0000 -Subject: [PATCH 513/834] gpio-fsm: Rename 'num-soft-gpios' to avoid warning +Subject: [PATCH 497/889] gpio-fsm: Rename 'num-soft-gpios' to avoid warning As of 5.10, the Device Tree parser warns about properties that look like references to "suppliers" of various services. "num-soft-gpios" @@ -209041,10 +207672,10 @@ index 2cab50e51315..708f258fda35 100644 2.18.4 -From c0e8cb751a9e4cfd33c2132bfdaa0bbd20e8e9c2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 15 Feb 2021 10:32:18 +0000 -Subject: [PATCH 514/834] overlays: Rename gpio-fsm property num-soft-gpios +Subject: [PATCH 498/889] overlays: Rename gpio-fsm property num-soft-gpios The gpio-fsm property "num-soft-gpios" triggers a kernel DT checker that warns about the lack of #gpio-cells on a random node with the @@ -209087,10 +207718,10 @@ index afc9f034b5fc..3c997266a67d 100644 2.18.4 -From e4bf9e38ab4e6d10a0291fa3edb416f73c0e0a11 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Laurentiu Palcu Date: Wed, 27 Nov 2019 14:42:35 +0000 -Subject: [PATCH 515/834] drm: fix HDR static metadata type field numbering +Subject: [PATCH 499/889] drm: fix HDR static metadata type field numbering According to CTA-861 specification, HDR static metadata data block allows a sink to indicate which HDR metadata types it supports by setting the SM_0 to @@ -209124,10 +207755,10 @@ index 9850d59d6f1c..c8ec982ff498 100644 2.18.4 -From 266358cb481db6db7aa82dac4dcf65e8db11d9a4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 2 Dec 2020 18:36:24 +0000 -Subject: [PATCH 516/834] drm/vc4: Add HDR metadata property to the VC5 HDMI +Subject: [PATCH 500/889] drm/vc4: Add HDR metadata property to the VC5 HDMI connectors Now that we can export deeper colour depths, add in the signalling @@ -209231,10 +207862,10 @@ index cb2af9f144df..33b5f120bbeb 100644 2.18.4 -From d4593df33434f153e7ecd9c0a7a98ae9ba016140 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Fri, 5 Feb 2021 14:07:12 +0000 -Subject: [PATCH 517/834] drm/vc4: Add connector check to trigger mode_change +Subject: [PATCH 501/889] drm/vc4: Add connector check to trigger mode_change when hdr metadata changes Signed-off-by: Dom Cobley @@ -209304,10 +207935,10 @@ index afe9308311af..f288a052c40c 100644 2.18.4 -From dffdedff44e88107930f37ca18f0d820abd9cc38 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 8 Feb 2021 16:01:37 +0000 -Subject: [PATCH 518/834] staging: rpivid: Fix crash when CMA alloc fails +Subject: [PATCH 502/889] staging: rpivid: Fix crash when CMA alloc fails If realloc to increase coeff size fails then attempt to re-allocate the original size. If that also fails then flag a fatal error to abort @@ -209430,10 +208061,10 @@ index fc3caed58187..e6b07920aa8c 100644 2.18.4 -From bc2e0e2137273a1a776850256dfdd57f502d2f4d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 4 Feb 2021 14:23:58 +0000 -Subject: [PATCH 519/834] dt: Add option for dpi without DE and PCLK (for +Subject: [PATCH 503/889] dt: Add option for dpi without DE and PCLK (for VGA666) VGA666 doesn't use the DE or PCLK signals, therefore there is @@ -209466,10 +208097,10 @@ index e657affae46f..12c7b0b2bb5f 100644 2.18.4 -From 1ef654168851f0ed597704290adb79312a2df51e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 4 Feb 2021 14:50:59 +0000 -Subject: [PATCH 520/834] defconfigs: Add DRM_DISPLAY_CONNECTOR and +Subject: [PATCH 504/889] defconfigs: Add DRM_DISPLAY_CONNECTOR and DRM_SIMPLE_BRIDGE for VGA666 VGA666 uses "vga-connector" from DRM_DISPLAY_CONNECTOR, and @@ -209554,10 +208185,10 @@ index aa89eb5704cb..f0a791a03abd 100644 2.18.4 -From 65b8e2c15a4ae32bb7bf94eea5f0ae5b6c69d3a4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 4 Feb 2021 14:41:10 +0000 -Subject: [PATCH 521/834] dtoverlays: Add an overlay for the VGA666 when used +Subject: [PATCH 505/889] dtoverlays: Add an overlay for the VGA666 when used with vc4-kms-v3d Includes optional use of GPIOs 0&1 / BSC0 for DDC to read the EDID @@ -209718,10 +208349,10 @@ index 000000000000..6e787099e861 2.18.4 -From 6e3bb54543eaf8d00096c3b4cd2131957f85a3c8 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 12 Feb 2021 17:31:37 +0000 -Subject: [PATCH 522/834] drm/vc4: Change the default DPI format to being +Subject: [PATCH 506/889] drm/vc4: Change the default DPI format to being 18bpp, not 24. DPI hasn't really been used up until now, so the default has @@ -209758,10 +208389,10 @@ index a90f2545baee..db63f4e11b17 100644 2.18.4 -From 550f899bcf4b849d4d057173d7b944ab0040efb7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 17 Oct 2020 15:42:54 +0100 -Subject: [PATCH 523/834] gpio-fsm: Show state info in /sys/class/gpio-fsm +Subject: [PATCH 507/889] gpio-fsm: Show state info in /sys/class/gpio-fsm Add gpio-fsm sysfs entries under /sys/class/gpio-fsm. For each state machine show the current state, which state (if any) will be entered @@ -209948,10 +208579,10 @@ index 708f258fda35..d71a81d9b669 100644 2.18.4 -From b73e686dfeca70f9f47781a288f69047e5e157fd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Feb 2021 09:21:30 +0000 -Subject: [PATCH 524/834] gpio-fsm: Fix shutdown timeout handling +Subject: [PATCH 508/889] gpio-fsm: Fix shutdown timeout handling The driver is intended to jump directly to a shutdown state in the event of a timeout during shutdown, but the sense of the test was @@ -209980,10 +208611,10 @@ index d71a81d9b669..306f5123546c 100644 2.18.4 -From 7528961609b478696c615fc5be61774bfd90dbee Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Feb 2021 09:29:26 +0000 -Subject: [PATCH 525/834] overlays: fsm-demo: Ensure all LEDs are turned off +Subject: [PATCH 509/889] overlays: fsm-demo: Ensure all LEDs are turned off If the shutdown process is delayed enough to trigger the shutdown timeout then one or more states in the shutdown sequence might be @@ -210012,10 +208643,10 @@ index 9b5da179914f..e9944f5cd258 100644 2.18.4 -From 7307d9b684ad3098c51b5c99852758c2a7f94921 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Feb 2021 09:52:27 +0000 -Subject: [PATCH 526/834] configs: Add various missing IPV6 modules +Subject: [PATCH 510/889] configs: Add various missing IPV6 modules See: https://github.com/raspberrypi/linux/issues/4144 @@ -210247,10 +208878,10 @@ index f0a791a03abd..60bda75b6965 100644 2.18.4 -From ed80058d3f9e920c199fb872a1f5eeb2d7152993 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 10 Feb 2021 10:18:53 +0000 -Subject: [PATCH 527/834] media: i2c: imx477: Remove auto frame length +Subject: [PATCH 511/889] media: i2c: imx477: Remove auto frame length adjusting The V4L2_CID_EXPOSURE_AUTO_PRIORITY was used to let the sensor control @@ -210395,10 +209026,10 @@ index f68e7718b09c..30055244166b 100644 2.18.4 -From aa4a9215be7202a69ef2f7c0b57956ef21bff4e7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 10 Feb 2021 10:50:32 +0000 -Subject: [PATCH 528/834] media: i2c: imx477: Add very long exposure control to +Subject: [PATCH 512/889] media: i2c: imx477: Add very long exposure control to the driver Add support for very long exposures by using the exposure multiplier @@ -210527,10 +209158,10 @@ index 30055244166b..0143e3129258 100644 2.18.4 -From e757a38eb08bdc78a9a059270502d94c8c2b524a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 17 Feb 2021 18:08:12 +0000 -Subject: [PATCH 529/834] media: i2c: imx290: Fix up exposure calcuations and +Subject: [PATCH 513/889] media: i2c: imx290: Fix up exposure calcuations and ranges Should now correspond exactly to the datasheet. @@ -210592,10 +209223,10 @@ index 33ce80686163..43e2f294a53b 100644 2.18.4 -From 6221b58fa91b2c7da300b959a0b177f9e550b434 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 18 Feb 2021 11:58:29 +0000 -Subject: [PATCH 530/834] media: i2c: imx290: Handle exposure correctly when +Subject: [PATCH 514/889] media: i2c: imx290: Handle exposure correctly when vblank changes When vblank changes we must modify the exposure range. Also, with this @@ -210640,10 +209271,10 @@ index 43e2f294a53b..255f66985306 100644 2.18.4 -From e93ccf6f8171afc82699a813ecd284ad59883a09 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: pifi-bz <73530753+pifi-bz@users.noreply.github.com> Date: Fri, 19 Feb 2021 13:14:32 +0200 -Subject: [PATCH 531/834] DAC overlays (#4154) +Subject: [PATCH 515/889] DAC overlays (#4154) Adding overlays for PiFi DAC Zero and PiFi DAC HD. @@ -210807,10 +209438,10 @@ index 000000000000..645ea74cb435 2.18.4 -From 900e86a024de62b78820c59f7ac8bae7a472edcb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Harper Date: Mon, 22 Feb 2021 12:34:20 +0000 -Subject: [PATCH 532/834] configs: Change CONFIG_BLK_DEV_NVME=y for 2711 +Subject: [PATCH 516/889] configs: Change CONFIG_BLK_DEV_NVME=y for 2711 See https://github.com/raspberrypi/linux/issues/4163 --- @@ -210848,10 +209479,10 @@ index b5dce7480cff..8a643571a458 100644 2.18.4 -From ff33990bb69cfeb440f942afbc739fedaa1ec264 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 18 Feb 2021 15:05:57 +0000 -Subject: [PATCH 533/834] media: i2c: imx477: Fix crop height for 2028x1080 +Subject: [PATCH 517/889] media: i2c: imx477: Fix crop height for 2028x1080 mode The crop height for this mode was set at 2600 lines, it should be 2160 @@ -210879,10 +209510,10 @@ index 0143e3129258..e3d164555b09 100644 2.18.4 -From 9d5b0a0a23c59225f6a4b967333ffcd1adc02d23 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 18 Feb 2021 15:23:11 +0000 -Subject: [PATCH 534/834] media: i2c: imx477: Replace existing 1012x760 mode +Subject: [PATCH 518/889] media: i2c: imx477: Replace existing 1012x760 mode The existing 1012x760 120 fps mode has significant IQ problem using the internal sensor scaler. Replace this mode with a 1332x990 120 fps @@ -211082,10 +209713,10 @@ index e3d164555b09..0c552b9d54c5 100644 2.18.4 -From 85dfcb30108a879354cfa450afce24430e9a1b0a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 19 Feb 2021 10:30:49 +0000 -Subject: [PATCH 535/834] media: i2c: imx477: Remove internal +Subject: [PATCH 519/889] media: i2c: imx477: Remove internal v4l2_mbus_framefmt from the state The only field in this struct that is used is the format code, so @@ -211158,10 +209789,10 @@ index 0c552b9d54c5..f43c86407d97 100644 2.18.4 -From d715d913ca17915845b8f7efc41e2d42745ec667 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 19 Feb 2021 11:06:40 +0000 -Subject: [PATCH 536/834] media: i2c: imx477: Remove unused function parameter +Subject: [PATCH 520/889] media: i2c: imx477: Remove unused function parameter The struct imx477 *ctrl parameter is not used in the function imx477_adjust_exposure_range(), so remove it. @@ -211198,10 +209829,10 @@ index f43c86407d97..34bfd22cadc6 100644 2.18.4 -From 1e0b02ce50640ea31ef7eec0beb8fa8fad2613eb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Feb 2021 14:19:00 +0000 -Subject: [PATCH 537/834] overlays: i2c-rtc: Add the Dallas DS1340 +Subject: [PATCH 521/889] overlays: i2c-rtc: Add the Dallas DS1340 See: https://github.com/raspberrypi/linux/issues/4180 @@ -211269,10 +209900,10 @@ index 759f532d5be1..408b71ec97b5 100644 2.18.4 -From 1168d875fc65ca8d1753af72899368d0e1a9c468 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Feb 2021 14:20:05 +0000 -Subject: [PATCH 538/834] overlays: Update the upstream overlay +Subject: [PATCH 522/889] overlays: Update the upstream overlay Signed-off-by: Phil Elwell --- @@ -211300,110 +209931,10 @@ index e0f7cc8ba9ea..f73a1879e690 100644 2.18.4 -From 1021a72cb8795169fd7e874124c4a76beeda0a2b Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 1 Mar 2021 09:12:44 +0000 -Subject: [PATCH 539/834] Revert "Bluetooth: Always request for user - confirmation for Just Works (LE SC)" - -This reverts commit ffee202a78c2980688bc5d2f7d56480e69a5e0c9. - -The commit "Bluetooth: Always request for user confirmation for Just -Works" prevents BLE devices pairing in (at least) the Raspberry Pi OS -GUI. After reverting it, pairing works again. Although this companion -commit ("... (LE SC)") has not been demonstrated to be problematic, -it follows the same logic and therefore could affect some use cases. - -If another solution to the problem is found then this reversion will -be removed. - -See: https://github.com/raspberrypi/linux/issues/4139 - -Signed-off-by: Phil Elwell ---- - net/bluetooth/smp.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c -index 2b7879afc333..36ac2db5340c 100644 ---- a/net/bluetooth/smp.c -+++ b/net/bluetooth/smp.c -@@ -2201,7 +2201,7 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb) - if (err) - return SMP_UNSPECIFIED; - -- if (smp->method == REQ_OOB) { -+ if (smp->method == JUST_WORKS || smp->method == REQ_OOB) { - if (hcon->out) { - sc_dhkey_check(smp); - SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK); -@@ -2216,9 +2216,6 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb) - confirm_hint = 0; - - confirm: -- if (smp->method == JUST_WORKS) -- confirm_hint = 1; -- - err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, hcon->type, - hcon->dst_type, passkey, confirm_hint); - if (err) --- -2.18.4 - - -From c6e643f252ecb4cb91148982525a83d245b4ed9c Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 1 Mar 2021 09:14:35 +0000 -Subject: [PATCH 540/834] Revert "Bluetooth: Always request for user - confirmation for Just Works" - -This reverts commit 92516cd97fd4d8ad5b1421a0d51771044f453a5f. - -Thi commit "Bluetooth: Always request for user confirmation for Just -Works" prevents BLE devices pairing in (at least) the Raspberry Pi OS -GUI. After reverting it, pairing works again. - -If another solution to the problem is found then this reversion will -be removed. - -See: https://github.com/raspberrypi/linux/issues/4139 - -Signed-off-by: Phil Elwell ---- - net/bluetooth/smp.c | 11 ++--------- - 1 file changed, 2 insertions(+), 9 deletions(-) - -diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c -index 36ac2db5340c..7c3be6b3d454 100644 ---- a/net/bluetooth/smp.c -+++ b/net/bluetooth/smp.c -@@ -883,16 +883,9 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth, - hcon->io_capability == HCI_IO_NO_INPUT_OUTPUT) - smp->method = JUST_WORKS; - -- /* If Just Works, Continue with Zero TK and ask user-space for -- * confirmation */ -+ /* If Just Works, Continue with Zero TK */ - if (smp->method == JUST_WORKS) { -- ret = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, -- hcon->type, -- hcon->dst_type, -- passkey, 1); -- if (ret) -- return ret; -- set_bit(SMP_FLAG_WAIT_USER, &smp->flags); -+ set_bit(SMP_FLAG_TK_VALID, &smp->flags); - return 0; - } - --- -2.18.4 - - -From 3fa4769bc63e910a9091269e06e2b80bc270624c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 5 Mar 2021 15:40:45 +0000 -Subject: [PATCH 541/834] media: bcm2835-unicam: Fix bug in buffer swapping +Subject: [PATCH 523/889] media: bcm2835-unicam: Fix bug in buffer swapping logic If multiple sets of interrupts occur simultaneously, it may be unsafe @@ -211482,10 +210013,10 @@ index a8b3f5433f04..234f0eaf9c8c 100644 2.18.4 -From 7979084b985787adfa23f8d40022dc7ae12a367d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 8 Mar 2021 15:32:25 +0000 -Subject: [PATCH 542/834] Assign crypto aliases to different AES implementation +Subject: [PATCH 524/889] Assign crypto aliases to different AES implementation modules The kernel modules aes-neon-blk and aes-neon-bs perform poorly, at least on @@ -211597,10 +210128,10 @@ index fb507d569922..cc52829d426a 100644 2.18.4 -From 28bfd4b5561d9beabb18899d435af999a149476e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 11 Mar 2021 16:11:46 +0000 -Subject: [PATCH 543/834] overlays: Improve the i2c-rtc,i2c_csi_dsi option +Subject: [PATCH 525/889] overlays: Improve the i2c-rtc,i2c_csi_dsi option The i2c_csi_dsi parameter of the i2c-rtc overlay (added for the CM4IO board) causes the RTC devices to be probed on the I2C0 bus appearing @@ -211653,10 +210184,10 @@ index 408b71ec97b5..b9842e11b5e0 100644 2.18.4 -From f0953fbd6056f4a499e56dd095bb6c32bb47ee3a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 11 Mar 2021 16:59:05 +0000 -Subject: [PATCH 544/834] configs: Add CONFIG_RTS_HCTOSYS=y +Subject: [PATCH 526/889] configs: Add CONFIG_RTS_HCTOSYS=y The recently improved RTC_HCTOSYS option now works with RTC drivers in modules, making it much more useful in that it removes the need to run @@ -211737,10 +210268,10 @@ index 60bda75b6965..584e82f7de99 100644 2.18.4 -From 757864a31941cf69864277d6c1fbe19d9d5b3858 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 1 Feb 2021 18:48:47 +0000 -Subject: [PATCH 545/834] media/v4l2_m2m: In buffered mode run jobs if either +Subject: [PATCH 527/889] media/v4l2_m2m: In buffered mode run jobs if either port is streaming In order to get the intended behaviour of the stateful video @@ -211755,7 +210286,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c -index 34dd8ba5469f..329dc316934e 100644 +index b221b4e438a1..87729a56dda0 100644 --- a/drivers/media/v4l2-core/v4l2-mem2mem.c +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c @@ -301,9 +301,10 @@ static void __v4l2_m2m_try_queue(struct v4l2_m2m_dev *m2m_dev, @@ -211776,10 +210307,10 @@ index 34dd8ba5469f..329dc316934e 100644 2.18.4 -From d6e77c08fc08f2a913e1c14ccfd5e26a157fc65b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 1 Feb 2021 18:55:37 +0000 -Subject: [PATCH 546/834] staging/bcm2835-codec: Correct logging of size_t to +Subject: [PATCH 528/889] staging/bcm2835-codec: Correct logging of size_t to %zu Fixes: "staging/bcm2835-codec: Log the number of excess supported formats" @@ -211816,10 +210347,10 @@ index 94691ab7175a..0c4d8bf77b91 100644 2.18.4 -From 7a361d367fa73cd22065f0d3e2d56b308db80f3f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 2 Feb 2021 15:50:18 +0000 -Subject: [PATCH 547/834] staging/bcm2835-codec: Add support for pixel aspect +Subject: [PATCH 529/889] staging/bcm2835-codec: Add support for pixel aspect ratio If the format is detected by the driver and a V4L2_EVENT_SOURCE_CHANGE @@ -211904,10 +210435,10 @@ index 0c4d8bf77b91..46f659e55f18 100644 2.18.4 -From c384cb6964fff191b6e6525a00aa0d5f3b326fdb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 2 Feb 2021 16:46:39 +0000 -Subject: [PATCH 548/834] staging/bcm2835-codec: Implement additional +Subject: [PATCH 530/889] staging/bcm2835-codec: Implement additional g_selection calls for decode v4l_cropcap calls our vidioc_g_pixelaspect function to get the pixel @@ -211945,10 +210476,10 @@ index 46f659e55f18..7aa6c53e279e 100644 2.18.4 -From 9de0c2464a1fa6662a2bc73bbcb09c84becef101 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 10 Mar 2021 19:07:48 +0000 -Subject: [PATCH 549/834] staging/bcm2835-codec: Add VC-1 support. +Subject: [PATCH 531/889] staging/bcm2835-codec: Add VC-1 support. Providing the relevant licence has been purchased, then Pi0-3 can decode VC-1. @@ -211980,10 +210511,10 @@ index 7aa6c53e279e..5729a8a7d94e 100644 2.18.4 -From ed6ca54149303a7ba668998e8bdb40104787c671 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Sun, 24 Jan 2021 15:44:10 +0000 -Subject: [PATCH 550/834] vc4/drm: Avoid full hdmi audio fifo writes +Subject: [PATCH 532/889] vc4/drm: Avoid full hdmi audio fifo writes We are getting occasional VC4_HD_MAI_CTL_ERRORF in HDMI_MAI_CTL which seem to correspond with audio dropouts. @@ -212018,10 +210549,10 @@ index f288a052c40c..e10bad628681 100644 2.18.4 -From 81fc7654ba56aab680db8bd53ea1c6ec3e698a3f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Fri, 12 Mar 2021 11:26:29 +0000 -Subject: [PATCH 551/834] vc4/drm: Increase hdmi audio axi priority to avoid +Subject: [PATCH 533/889] vc4/drm: Increase hdmi audio axi priority to avoid lost samples With HBR audio (8 channel 192kHz) we get occasional VC4_HD_MAI_CTL_DLATE error flags in @@ -212060,10 +210591,10 @@ index 8053ef54acc8..20581ee97827 100644 2.18.4 -From c16c4fa50118af3584d572f502f0e25ed0558249 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Assaf Gordon Date: Fri, 12 Mar 2021 00:13:07 -0700 -Subject: [PATCH 552/834] overlays: gpio-led: new overlay +Subject: [PATCH 534/889] overlays: gpio-led: new overlay Add generic connection between the kernel's LED framework and RPI's GPIO pins. @@ -212262,10 +210793,10 @@ index 000000000000..d8e9d53f1b61 2.18.4 -From f2b9668239052c65b9e6dd41742615833f1a0bd3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nicolas Saenz Julienne Date: Mon, 15 Mar 2021 17:25:02 +0100 -Subject: [PATCH 553/834] overlays: Add pcie-32bit-dma overlay +Subject: [PATCH 535/889] overlays: Add pcie-32bit-dma overlay In order to accommodate full PCI DMA access to memory on newer BCM2711 revisions, we're forced to map PCIe's view of physical memory with an @@ -212361,77 +210892,10 @@ index 000000000000..cca3e83721b7 2.18.4 -From 83c91e22f489898846bb3fec007c024e16cf7fd1 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 17 Mar 2021 09:13:28 +0000 -Subject: [PATCH 554/834] Revert "i2c: bcm2835: Handle untimely DONE signal" - -This reverts commit 431ac1d21b5e842c5a564bc0bab31d7dc11611f5. - -Reverting this patch because it appears to have caused a regression -when used with an MPU-9250 IMU. - -See: https://github.com/Hexxeh/rpi-firmware/issues/261 - -Signed-off-by: Phil Elwell ---- - drivers/i2c/busses/i2c-bcm2835.c | 14 +++----------- - 1 file changed, 3 insertions(+), 11 deletions(-) - -diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c -index 90ca593d8ae3..5b2589b6b9cc 100644 ---- a/drivers/i2c/busses/i2c-bcm2835.c -+++ b/drivers/i2c/busses/i2c-bcm2835.c -@@ -373,10 +373,6 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) - u32 val, err; - - val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S); -- bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_S, -- BCM2835_I2C_S_CLKT | -- BCM2835_I2C_S_ERR | -- BCM2835_I2C_S_DONE); - bcm2835_debug_add(i2c_dev, val); - - err = val & (BCM2835_I2C_S_CLKT | BCM2835_I2C_S_ERR); -@@ -386,9 +382,6 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) - } - - if (val & BCM2835_I2C_S_DONE) { -- if (val & BCM2835_I2C_S_TA) -- return IRQ_HANDLED; -- - if (!i2c_dev->curr_msg) { - dev_err(i2c_dev->dev, "Got unexpected interrupt (from firmware?)\n"); - } else if (i2c_dev->curr_msg->flags & I2C_M_RD) { -@@ -396,10 +389,7 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) - val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S); - } - -- if (i2c_dev->msg_buf_remaining) -- return IRQ_HANDLED; -- -- if (val & BCM2835_I2C_S_RXD) -+ if ((val & BCM2835_I2C_S_RXD) || i2c_dev->msg_buf_remaining) - i2c_dev->msg_err = BCM2835_I2C_S_LEN; - else - i2c_dev->msg_err = 0; -@@ -436,6 +426,8 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) - - complete: - bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR); -+ bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_S, BCM2835_I2C_S_CLKT | -+ BCM2835_I2C_S_ERR | BCM2835_I2C_S_DONE); - complete(&i2c_dev->completion); - - return IRQ_HANDLED; --- -2.18.4 - - -From 0cd1cae93b457c5e0928975113c359c54e9b4561 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 22 Mar 2021 09:27:16 +0000 -Subject: [PATCH 555/834] ARM: dts: bcm2711: Add aliases for additional SPIs +Subject: [PATCH 536/889] ARM: dts: bcm2711: Add aliases for additional SPIs Without aliases for the new SPI interfaces in BCM2711, spidev instances will be allocated sequential numbers that may not match the number of @@ -212493,10 +210957,10 @@ index 9ab2feb4424f..9a999405ab85 100644 2.18.4 -From f5e7f13d9c35ae814438ce8d5bd5ac3d3463f1e2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: ProBackup-nl <515451+ProBackup-nl@users.noreply.github.com> Date: Thu, 18 Mar 2021 18:21:43 +0100 -Subject: [PATCH 556/834] Make rpi poe fan less noisy in cool environments +Subject: [PATCH 537/889] Make rpi poe fan less noisy in cool environments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -212523,10 +210987,10 @@ index 544038b614e1..af812132a8f7 100644 2.18.4 -From 35890c146b3e45a4bd6138dc96c8e17867d37aff Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 22 Mar 2021 19:43:48 +0000 -Subject: [PATCH 557/834] vc4/drm: Fix source offsets with DRM_FORMAT_P030 +Subject: [PATCH 538/889] vc4/drm: Fix source offsets with DRM_FORMAT_P030 Spec says: bits [31:4] of the given address should point to the 128-bit word containing the desired starting pixel, @@ -212600,10 +211064,10 @@ index 3d33fe3dacea..4198eb81e62d 100644 2.18.4 -From d3eff0045af7b152403b37833c70dd0c8e0bdc8d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 15 Mar 2021 13:28:06 +0000 -Subject: [PATCH 558/834] vc4/drm: vc4_plane: Remove subpixel positioning check +Subject: [PATCH 539/889] vc4/drm: vc4_plane: Remove subpixel positioning check There is little harm in ignoring fractional coordinates (they just get truncated). @@ -212668,10 +211132,10 @@ index 4198eb81e62d..5a268ac6d6fc 100644 2.18.4 -From 2645e92d68d90f3340f3b7af04b9db298b81f8e7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 22 Feb 2021 18:47:19 +0000 -Subject: [PATCH 559/834] clk-raspberrypi: Also support HEVC clock +Subject: [PATCH 540/889] clk-raspberrypi: Also support HEVC clock Signed-off-by: Dom Cobley --- @@ -212694,10 +211158,10 @@ index f4884a5b598a..94ce38a2d5aa 100644 2.18.4 -From 69f7775f9aabe9a9132fd59b8f5d1f325fc18ad2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 22 Feb 2021 18:47:43 +0000 -Subject: [PATCH 560/834] dt: Switch hevc clock from fixed to firmware driver +Subject: [PATCH 541/889] dt: Switch hevc clock from fixed to firmware driver Signed-off-by: Dom Cobley --- @@ -212737,10 +211201,10 @@ index 0a611b31b9d4..bdd1c0e5a915 100644 2.18.4 -From a29d56b63ebfadd9aec2b098914f4cd87354bb28 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 22 Feb 2021 18:50:50 +0000 -Subject: [PATCH 561/834] rpivid: Request maximum hevc clock +Subject: [PATCH 542/889] rpivid: Request maximum hevc clock Query maximum and minimum clock from driver and use those @@ -212794,10 +211258,10 @@ index 3b9e51ca05b3..b377c17dfb21 100644 2.18.4 -From 16f7e581c30ec16b9749a1efa4189f5d682afadd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 17 Mar 2021 12:34:57 +0000 -Subject: [PATCH 562/834] staging/bcm2835-camera: Add support for DMABUFs +Subject: [PATCH 543/889] staging/bcm2835-camera: Add support for DMABUFs DMABUFs are all handled by videobuf2, so there is no reason not to enable support for them. @@ -212837,10 +211301,10 @@ index e0a96dbb843d..7bee6e1bc69a 100644 2.18.4 -From 3d42a3247e8787a65ee388e4feaedb544b50ff6e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 19 Feb 2021 10:25:01 +0000 -Subject: [PATCH 563/834] staging: fbtft: Add minipitft13 variant +Subject: [PATCH 544/889] staging: fbtft: Add minipitft13 variant The Adafruit Mini-PiTFT13 display needs offsets applying when rotated, so use the "variant" mechanism to select a custom set_addr_win method @@ -212948,10 +211412,10 @@ index 3a280cc1892c..af4e975e7b30 100644 2.18.4 -From df88c24d27e7286b678fda80270325a9b801c4fe Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 18 Feb 2021 21:05:44 +0000 -Subject: [PATCH 564/834] overlays: Add minipitft13 overlay +Subject: [PATCH 545/889] overlays: Add minipitft13 overlay minipitft13 is an overlay for the Adafruit 1.3" 240x240 display (code 4484). @@ -213057,10 +211521,10 @@ index 000000000000..b1a0a2a41f72 2.18.4 -From 1e71895dab7b842b676b81dda12da0167bfb273e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 3 Mar 2021 10:31:13 +0000 -Subject: [PATCH 565/834] overlays: ghost-amp: Minor tweaks +Subject: [PATCH 546/889] overlays: ghost-amp: Minor tweaks 1. Reduce the delay between RELAY1 and RELAY2 to 1000ms. 2. Rename the states to simplify LED control by an external script. @@ -213135,10 +211599,10 @@ index 3c997266a67d..f051dfb0879f 100644 2.18.4 -From 83de5a18e0432f89199dce6b260423da235ab001 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 29 Mar 2021 12:05:06 +0100 -Subject: [PATCH 566/834] overlays: Add README entry for minipitft13 +Subject: [PATCH 547/889] overlays: Add README entry for minipitft13 Signed-off-by: Phil Elwell --- @@ -213171,10 +211635,10 @@ index d8a9ba5e9955..a5f1913d0367 100644 2.18.4 -From b0f48fed857836e6dc3d5489d1e592d5c2d3b552 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 31 Mar 2021 10:22:30 +0100 -Subject: [PATCH 567/834] ARM: dts: update bcm2711-rpi-cm4.dts and -400 +Subject: [PATCH 548/889] ARM: dts: update bcm2711-rpi-cm4.dts and -400 Neither CM4 nor Pi 400 have appeared upstream yet, and as a result they have missed out on improvements to the Pi 4B platform. @@ -213384,39 +211848,10 @@ index 9a999405ab85..a39e5c216e63 100644 2.18.4 -From d69683b75521837c5a26c37181cb0beaa47e5b04 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 31 Mar 2021 10:33:35 +0100 -Subject: [PATCH 568/834] Revert "usb: xhci: Disable the XHCI 5 second timeout" - -This reverts commit 0b387d58aacc006b3cb24415c7c62baa99edf743. ---- - drivers/usb/host/xhci.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index 494a059f2f5b..a04c4756eb74 100644 ---- a/drivers/usb/host/xhci.c -+++ b/drivers/usb/host/xhci.c -@@ -196,9 +196,8 @@ int xhci_reset(struct xhci_hcd *xhci) - if (xhci->quirks & XHCI_INTEL_HOST) - udelay(1000); - -- // Hack: reduce handshake timeout from 10s 0.5s due to unprogrammed vl805 - ret = xhci_handshake(&xhci->op_regs->command, -- CMD_RESET, 0, 500 * 1000); -+ CMD_RESET, 0, 10 * 1000 * 1000); - if (ret) - return ret; - --- -2.18.4 - - -From 523dbc9acc93dca89148acb1e548c8a894c12f0b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 31 Mar 2021 18:12:55 +0100 -Subject: [PATCH 569/834] vc4/drm: SQUASH: Fix source offsets with +Subject: [PATCH 549/889] vc4/drm: SQUASH: Fix source offsets with DRM_FORMAT_P030 x_off should only be within current stripe @@ -213449,10 +211884,10 @@ index 5a268ac6d6fc..dc3581470261 100644 2.18.4 -From dd92f742cf6f577ef5abbd956b3b783d1b7932cb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jo Henke <37883863+jo-he@users.noreply.github.com> Date: Tue, 6 Apr 2021 11:21:35 +0000 -Subject: [PATCH 570/834] dwc-otg: fix clang -Wignored-attributes warning +Subject: [PATCH 550/889] dwc-otg: fix clang -Wignored-attributes warning warning: attribute declaration must precede definition --- @@ -213491,10 +211926,10 @@ index 537cc237b4bc..86b4aaf977fb 100644 2.18.4 -From 3a207a4ab23ff83b3c4917c367db99279e90298e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jo Henke <37883863+jo-he@users.noreply.github.com> Date: Tue, 6 Apr 2021 11:38:28 +0000 -Subject: [PATCH 571/834] dwc-otg: fix clang -Wsometimes-uninitialized warning +Subject: [PATCH 551/889] dwc-otg: fix clang -Wsometimes-uninitialized warning warning: variable 'retval' is used uninitialized whenever 'if' condition is false --- @@ -213518,10 +211953,10 @@ index 799ab14b9eda..e1c1e3804095 100644 2.18.4 -From 14fe8db605a62181e6acba53ea5476b344a10a16 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jo Henke <37883863+jo-he@users.noreply.github.com> Date: Tue, 6 Apr 2021 11:45:14 +0000 -Subject: [PATCH 572/834] dwc-otg: fix clang -Wpointer-bool-conversion warning +Subject: [PATCH 552/889] dwc-otg: fix clang -Wpointer-bool-conversion warning warning: address of array 'desc->wMaxPacketSize' will always evaluate to 'true' @@ -213548,10 +211983,10 @@ index 9dabbe5c9791..2ffd4f11d0bf 100644 2.18.4 -From 7d95cae35b223c4ca6f111c1f353fc5288a7c4f7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: paul-1 <6473457+paul-1@users.noreply.github.com> Date: Fri, 2 Apr 2021 10:56:19 -0400 -Subject: [PATCH 573/834] Update Allo Piano Dac Driver +Subject: [PATCH 553/889] Update Allo Piano Dac Driver Add unique names to the individual dac coded drivers Remove some of the codec controls that are not used. @@ -213831,10 +212266,10 @@ index 0e04c4739858..fd0fe58421b0 100644 2.18.4 -From 71474298d4b851dbb9071588349ce04b18d06fad Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 19 Mar 2021 11:21:41 +0100 -Subject: [PATCH 574/834] drm/connector: Create a helper to attach the +Subject: [PATCH 554/889] drm/connector: Create a helper to attach the hdr_output_metadata property All the drivers that implement HDR output call pretty much the same @@ -213854,10 +212289,10 @@ Signed-off-by: Maxime Ripard 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -index 0076470cdf64..2e5863405ef6 100644 +index 105394080336..57afbd22ceba 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -@@ -6524,9 +6524,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, +@@ -6525,9 +6525,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, if (connector_type == DRM_MODE_CONNECTOR_HDMIA || connector_type == DRM_MODE_CONNECTOR_DisplayPort || connector_type == DRM_MODE_CONNECTOR_eDP) { @@ -213944,10 +212379,10 @@ index 928136556174..7954234b7fdc 100644 2.18.4 -From 53904a06779c5d26dc8f9199d90f5d199f560ede Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 19 Mar 2021 13:05:53 +0100 -Subject: [PATCH 575/834] drm/connector: Add helper to compare HDR metadata +Subject: [PATCH 555/889] drm/connector: Add helper to compare HDR metadata All the drivers that support the HDR metadata property have a similar function to compare the metadata from one connector state to the next, @@ -213966,10 +212401,10 @@ Signed-off-by: Maxime Ripard 5 files changed, 33 insertions(+), 48 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -index 2e5863405ef6..c699f77027be 100644 +index 57afbd22ceba..3869f8b571ee 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -@@ -5472,25 +5472,6 @@ static int fill_hdr_info_packet(const struct drm_connector_state *state, +@@ -5473,25 +5473,6 @@ static int fill_hdr_info_packet(const struct drm_connector_state *state, return 0; } @@ -213995,7 +212430,7 @@ index 2e5863405ef6..c699f77027be 100644 static int amdgpu_dm_connector_atomic_check(struct drm_connector *conn, struct drm_atomic_state *state) -@@ -5506,7 +5487,7 @@ amdgpu_dm_connector_atomic_check(struct drm_connector *conn, +@@ -5507,7 +5488,7 @@ amdgpu_dm_connector_atomic_check(struct drm_connector *conn, if (!crtc) return 0; @@ -214126,10 +212561,10 @@ index 7954234b7fdc..ca94c7ae20eb 100644 2.18.4 -From 318f3406c362bd6d2922e71af7a10525fbd9cbc5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 9 Apr 2021 17:31:55 +0200 -Subject: [PATCH 576/834] drm/vc4: Use the new helpers +Subject: [PATCH 556/889] drm/vc4: Use the new helpers We just introduced new helpers, so let's use them. @@ -214194,10 +212629,10 @@ index e10bad628681..505e1466b3d4 100644 2.18.4 -From 0381a31c5b71f48dfe98cf4ca8dcbfca85ce8547 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 9 Apr 2021 17:07:32 +0200 -Subject: [PATCH 577/834] drm/connector: Add a helper to attach the colorspace +Subject: [PATCH 557/889] drm/connector: Add a helper to attach the colorspace property The intel driver uses the same logic to attach the Colorspace property @@ -214270,10 +212705,10 @@ index ca94c7ae20eb..42cbacd1acb5 100644 2.18.4 -From 67e37ec4664cc1149c9225c40649ad2797130ee4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 9 Apr 2021 17:16:42 +0200 -Subject: [PATCH 578/834] drm/vc4: hdmi: Signal the proper colorimetry info in +Subject: [PATCH 558/889] drm/vc4: hdmi: Signal the proper colorimetry info in the infoframe Our driver while supporting HDR didn't send the proper colorimetry info @@ -214326,10 +212761,10 @@ index 505e1466b3d4..21bb87217653 100644 2.18.4 -From 6d11eb332e355fa4875a7a227af28c6961990f89 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 4 Nov 2020 18:54:20 +0000 -Subject: [PATCH 579/834] staging: vcsm-cma: Fix memory leak from not detaching +Subject: [PATCH 559/889] staging: vcsm-cma: Fix memory leak from not detaching dmabuf When importing there was a missing call to detach the buffer, @@ -214409,10 +212844,10 @@ index 40ce67f06fac..88c4df822922 100644 2.18.4 -From f84f0513a5db2bd9119ced9b845d61f6fedabd3c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 12 Apr 2021 17:27:43 +0100 -Subject: [PATCH 580/834] vc4/kms: vc4_plane: Support 2020 colourspace for yuv +Subject: [PATCH 560/889] vc4/kms: vc4_plane: Support 2020 colourspace for yuv planes https://gist.github.com/popcornmix/6b3e23103c60170b02b148e0ba5d6ed7 @@ -214522,10 +212957,10 @@ index 78fd28599aeb..7538b84a6dca 100644 2.18.4 -From e215f4a961559d31cad4c54b6856ecbee8910e5d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Thu, 15 Apr 2021 13:15:14 +0100 -Subject: [PATCH 581/834] sound/usb: add device quirks for A4Tech FHD 1080p +Subject: [PATCH 561/889] sound/usb: add device quirks for A4Tech FHD 1080p webcams These devices use a type of Sonix chipset that produces broken microphone @@ -214560,7 +212995,7 @@ index 5728bf722c88..18e5cec82bc2 100644 /* Creative BT-D1 */ USB_DEVICE(0x041e, 0x0005), diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c -index 33d185b62a76..06da60f08f7e 100644 +index a45b27a2ed4e..0a36f70d6912 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1530,6 +1530,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) @@ -214575,10 +213010,10 @@ index 33d185b62a76..06da60f08f7e 100644 2.18.4 -From 6fd755de0f79a567ab8db523627752788c6fe092 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Fri, 16 Apr 2021 11:40:23 +0100 -Subject: [PATCH 582/834] sound/usb: call usb_autopm_get_interface() for +Subject: [PATCH 562/889] sound/usb: call usb_autopm_get_interface() for devices that should not be suspended Webcams with microphones are composite devices, and autosuspend is set @@ -214595,7 +213030,7 @@ Signed-off-by: Jonathan Bell 1 file changed, 5 insertions(+) diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c -index 06da60f08f7e..ef92c567720f 100644 +index 0a36f70d6912..12fb94a7b753 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -531,6 +531,11 @@ static int setup_disable_autosuspend(struct snd_usb_audio *chip, @@ -214614,10 +213049,10 @@ index 06da60f08f7e..ef92c567720f 100644 2.18.4 -From a1ca65bf728d54a85c9796ea9ce06ae90258cc76 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 16 Apr 2021 09:31:17 +0100 -Subject: [PATCH 583/834] overlays: ghost-amp: Add DAC mute control +Subject: [PATCH 563/889] overlays: ghost-amp: Add DAC mute control Signed-off-by: Phil Elwell --- @@ -214706,10 +213141,10 @@ index f051dfb0879f..dbedb4b76c74 100644 2.18.4 -From a7684518102580c982aac2fe6523df14ec774eed Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 13 Apr 2021 11:00:01 +0200 -Subject: [PATCH 584/834] clk: Introduce a clock request API +Subject: [PATCH 564/889] clk: Introduce a clock request API It's not unusual to find clocks being shared across multiple devices that need to change the rate depending on what the device is doing at a @@ -214998,10 +213433,10 @@ index 7fd6a1febcf4..ab53a0873c8d 100644 2.18.4 -From e4a10fd3d9a4e22752450ecb54af2152b83ae135 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 13 Apr 2021 11:55:55 +0200 -Subject: [PATCH 585/834] drm/vc4: hdmi: Convert to the new clock request API +Subject: [PATCH 565/889] drm/vc4: hdmi: Convert to the new clock request API The new clock request API allows us to increase the rate of the HSM clock to match our pixel rate requirements while decreasing it when @@ -215082,10 +213517,10 @@ index 33b5f120bbeb..11a4b737d0ab 100644 2.18.4 -From 1feff5f0ceb1890e5ac7171ac206defe4f8219e0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 13 Apr 2021 14:10:03 +0100 -Subject: [PATCH 586/834] drm/vc4: hdmi: Convert to the new clock request API +Subject: [PATCH 566/889] drm/vc4: hdmi: Convert to the new clock request API The new clock request API allows us to increase the rate of the core clock as required during mode set while decreasing it when @@ -215130,10 +213565,10 @@ index 5d0974cdeaaa..48e3dc11c493 100644 2.18.4 -From e29d466520ec225f5b340bb790a69ae2a530536a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 13 Apr 2021 16:48:35 +0100 -Subject: [PATCH 587/834] bcm2835-unicam: Switch to new clock api +Subject: [PATCH 567/889] bcm2835-unicam: Switch to new clock api Signed-off-by: Dom Cobley --- @@ -215189,10 +213624,10 @@ index 234f0eaf9c8c..0d737e0c7f52 100644 2.18.4 -From 04fc8886fddec8ec70df1d621ab6c55600345610 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 19 Apr 2021 19:30:26 +0100 -Subject: [PATCH 588/834] rpivid: Switch to new clock api +Subject: [PATCH 568/889] rpivid: Switch to new clock api Signed-off-by: Dom Cobley --- @@ -215251,10 +213686,10 @@ index b377c17dfb21..def891a86e55 100644 2.18.4 -From 3fcda6d0e03907e0664df37d075297997643ca45 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 2 Nov 2020 11:45:04 +0000 -Subject: [PATCH 589/834] net: usb: r8152: Provide missing documentation for +Subject: [PATCH 569/889] net: usb: r8152: Provide missing documentation for some struct members commit 34e653efb602e0651867fb5ab14369b555a61dcd upstream. @@ -215279,7 +213714,7 @@ Signed-off-by: Jakub Kicinski 1 file changed, 6 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index 105622e1defa..92e67f6f6f01 100644 +index 0bb5b1c78654..c941ac428218 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -898,6 +898,7 @@ struct fw_header { @@ -215329,10 +213764,10 @@ index 105622e1defa..92e67f6f6f01 100644 2.18.4 -From 86e9f69b461215c52ad4e4b8a653382cdf69ce9b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 2 Nov 2020 11:45:09 +0000 -Subject: [PATCH 590/834] net: usb: r8152: Fix a couple of spelling errors in +Subject: [PATCH 570/889] net: usb: r8152: Fix a couple of spelling errors in fw_phy_nc's docs commit 9f07814d01ad085b2d9f1d55b4ce532fb2c27110 upstream. @@ -215351,7 +213786,7 @@ Signed-off-by: Jakub Kicinski 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index 92e67f6f6f01..4887256b6704 100644 +index c941ac428218..717b176f4c0b 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -963,8 +963,8 @@ struct fw_phy_patch_key { @@ -215369,10 +213804,10 @@ index 92e67f6f6f01..4887256b6704 100644 2.18.4 -From a0763c8ac111799b551cdadb6c2e211da889df0b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Wed, 4 Nov 2020 10:19:22 +0800 -Subject: [PATCH 591/834] net/usb/r8153_ecm: support ECM mode for RTL8153 +Subject: [PATCH 571/889] net/usb/r8153_ecm: support ECM mode for RTL8153 commit c1aedf015ebdd0232757a66e2daccf1246bd609c upstream. @@ -215412,7 +213847,7 @@ index 99fd12be2111..99381e6bea78 100644 obj-$(CONFIG_USB_NET_DM9601) += dm9601.o obj-$(CONFIG_USB_NET_SR9700) += sr9700.o diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index 4887256b6704..fba0b1430741 100644 +index 717b176f4c0b..cf3d2041104d 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -26,6 +26,7 @@ @@ -215703,10 +214138,10 @@ index 000000000000..20d88b1defc3 2.18.4 -From c546ba66a75beab8af35ebd95fa897d0949d3cdc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Sun, 31 Jan 2021 00:47:29 +0100 -Subject: [PATCH 592/834] net: usb: r8152: use new tasklet API +Subject: [PATCH 572/889] net: usb: r8152: use new tasklet API commit f3163f1cb87141c7a41a15a5d4c98b353f807b04 upstream. @@ -215720,7 +214155,7 @@ Signed-off-by: Jakub Kicinski 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index fba0b1430741..1db5ce3da19e 100644 +index cf3d2041104d..cec110d9eb98 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -2393,11 +2393,9 @@ static void tx_bottom(struct r8152 *tp) @@ -215750,10 +214185,10 @@ index fba0b1430741..1db5ce3da19e 100644 2.18.4 -From 5474cdc82894f25275303575621c44608c1fd4a3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Wed, 3 Feb 2021 17:14:28 +0800 -Subject: [PATCH 593/834] r8152: replace several functions about phy patch +Subject: [PATCH 573/889] r8152: replace several functions about phy patch request commit a08c0d309d8c078d22717d815cf9853f6f2c07bd upstream. @@ -215776,7 +214211,7 @@ Signed-off-by: Jakub Kicinski 1 file changed, 50 insertions(+), 34 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index 1db5ce3da19e..629dd2a2a815 100644 +index cec110d9eb98..1ce4c6bc4cb5 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -3443,59 +3443,76 @@ static void rtl_clear_bp(struct r8152 *tp, u16 type) @@ -215954,10 +214389,10 @@ index 1db5ce3da19e..629dd2a2a815 100644 2.18.4 -From b226d6d9a64f086046357a30459717818e9c6731 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Wed, 3 Feb 2021 17:14:29 +0800 -Subject: [PATCH 594/834] r8152: adjust the flow of power cut for RTL8153B +Subject: [PATCH 574/889] r8152: adjust the flow of power cut for RTL8153B commit 80fd850b31f09263ad175b2f640d5c5c6f76ed41 upstream. @@ -215975,7 +214410,7 @@ Signed-off-by: Jakub Kicinski 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index 629dd2a2a815..72ac6225b6f2 100644 +index 1ce4c6bc4cb5..0dc972dfe8ad 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -1371,6 +1371,10 @@ void write_mii_word(struct net_device *netdev, int phy_id, int reg, int val) @@ -216094,10 +214529,10 @@ index 629dd2a2a815..72ac6225b6f2 100644 2.18.4 -From 591a86f91c1aae4e5cf6ecdcd057640b5feaa1f3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Fri, 19 Feb 2021 17:04:40 +0800 -Subject: [PATCH 595/834] r8152: enable U1/U2 for USB_SPEED_SUPER +Subject: [PATCH 575/889] r8152: enable U1/U2 for USB_SPEED_SUPER commit 7a0ae61acde2cebd69665837170405eced86a6c7 upstream. @@ -216111,7 +214546,7 @@ Signed-off-by: Jakub Kicinski 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index 72ac6225b6f2..9d0ec9249916 100644 +index 0dc972dfe8ad..2a4fb3b1b0af 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -3335,7 +3335,7 @@ static void rtl8153b_runtime_enable(struct r8152 *tp, bool enable) @@ -216147,10 +214582,10 @@ index 72ac6225b6f2..9d0ec9249916 100644 2.18.4 -From 4530d0937f9d1882a2e55b43d9b821ccc2ae0616 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Fri, 19 Feb 2021 17:04:41 +0800 -Subject: [PATCH 596/834] r8152: check if the pointer of the function exists +Subject: [PATCH 576/889] r8152: check if the pointer of the function exists commit c79515e47935c747282c6ed2ee5b2ef039756eeb upstream. @@ -216163,7 +214598,7 @@ Signed-off-by: Jakub Kicinski 1 file changed, 13 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index 9d0ec9249916..f8499c1ac04a 100644 +index 2a4fb3b1b0af..93082c7d4c31 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -5735,6 +5735,9 @@ static int rtl8152_runtime_suspend(struct r8152 *tp) @@ -216204,10 +214639,10 @@ index 9d0ec9249916..f8499c1ac04a 100644 2.18.4 -From e010da7ecd040874c3f8346727d96e51f088764a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Fri, 19 Feb 2021 17:04:42 +0800 -Subject: [PATCH 597/834] r8152: replace netif_err with dev_err +Subject: [PATCH 577/889] r8152: replace netif_err with dev_err commit 156c3207611262266f0eea589ac3f00c5657320e upstream. @@ -216221,7 +214656,7 @@ Signed-off-by: Jakub Kicinski 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index f8499c1ac04a..817454713356 100644 +index 93082c7d4c31..df40fe6e01e2 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -6571,7 +6571,7 @@ static int rtl_ops_init(struct r8152 *tp) @@ -216246,10 +214681,10 @@ index f8499c1ac04a..817454713356 100644 2.18.4 -From 181916cb6ce0fb3d9b20f4821590f707bc4cba82 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Fri, 19 Feb 2021 17:04:43 +0800 -Subject: [PATCH 598/834] r8152: spilt rtl_set_eee_plus and r8153b_green_en +Subject: [PATCH 578/889] r8152: spilt rtl_set_eee_plus and r8153b_green_en commit 40fa7568ac230446d888b7ad402cff9e20fe3ad5 upstream. @@ -216262,7 +214697,7 @@ Signed-off-by: Jakub Kicinski 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index 817454713356..52a612aec78b 100644 +index df40fe6e01e2..2fb707985596 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -2632,21 +2632,24 @@ static inline u8 rtl8152_get_speed(struct r8152 *tp) @@ -216341,10 +214776,10 @@ index 817454713356..52a612aec78b 100644 2.18.4 -From d4bb0866ba13923e24a4b3ef751cd0c745f6e087 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Fri, 16 Apr 2021 16:04:32 +0800 -Subject: [PATCH 599/834] r8152: set inter fram gap time depending on speed +Subject: [PATCH 579/889] r8152: set inter fram gap time depending on speed commit 5133bcc7481528e36fff0a3b056601efb704fb32 upstream. @@ -216366,7 +214801,7 @@ Signed-off-by: David S. Miller 1 file changed, 28 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index 52a612aec78b..d2add077e6ee 100644 +index 2fb707985596..cb6357adbfcb 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -249,6 +249,9 @@ @@ -216422,10 +214857,10 @@ index 52a612aec78b..d2add077e6ee 100644 2.18.4 -From a87e0f4876dba5e9912857595725e2213d1624c5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Fri, 16 Apr 2021 16:04:33 +0800 -Subject: [PATCH 600/834] r8152: adjust rtl8152_check_firmware function +Subject: [PATCH 580/889] r8152: adjust rtl8152_check_firmware function commit a8a7be178e81a3d4b6972cbeb0ccd091ca2f9f89 upstream. @@ -216438,7 +214873,7 @@ Signed-off-by: David S. Miller 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index d2add077e6ee..0ed030e47db1 100644 +index cb6357adbfcb..6ebe6588100c 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -874,6 +874,14 @@ struct fw_header { @@ -216580,10 +215015,10 @@ index d2add077e6ee..0ed030e47db1 100644 2.18.4 -From 7aaaa3b48f0fbe090923ef6e038268ea0971e3f2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Fri, 16 Apr 2021 16:04:34 +0800 -Subject: [PATCH 601/834] r8152: add help function to change mtu +Subject: [PATCH 581/889] r8152: add help function to change mtu commit 67ce1a806f164e59a074fea8809725d3411eaa20 upstream. @@ -216601,7 +215036,7 @@ Signed-off-by: David S. Miller 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index 0ed030e47db1..adde6af84c26 100644 +index 6ebe6588100c..c55afbce0f04 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -657,15 +657,13 @@ enum rtl_register_content { @@ -216743,10 +215178,10 @@ index 0ed030e47db1..adde6af84c26 100644 2.18.4 -From 5b91d869e08c35a482b065f3e2008e1e2e8f31cf Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Fri, 16 Apr 2021 16:04:35 +0800 -Subject: [PATCH 602/834] r8152: support new chips +Subject: [PATCH 582/889] r8152: support new chips commit 195aae321c829dd1945900d75561e6aa79cce208 upstream. @@ -216760,7 +215195,7 @@ Signed-off-by: David S. Miller 1 file changed, 2359 insertions(+), 275 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index adde6af84c26..73685b8904d1 100644 +index c55afbce0f04..48acc96caa40 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -43,10 +43,14 @@ @@ -217695,7 +216130,7 @@ index adde6af84c26..73685b8904d1 100644 + case RTL_VER_15: default: if (type == MCU_TYPE_USB) { - ocp_write_byte(tp, MCU_TYPE_USB, USB_BP2_EN, 0); + ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0); @@ -3653,6 +4100,11 @@ static bool rtl8152_is_fw_mac_ok(struct r8152 *tp, struct fw_mac *mac) case RTL_VER_06: case RTL_VER_08: @@ -220132,10 +218567,10 @@ index adde6af84c26..73685b8904d1 100644 2.18.4 -From 2655f67e5da563c8037d07959861c20960ec57a0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Fri, 16 Apr 2021 16:04:36 +0800 -Subject: [PATCH 603/834] r8152: support PHY firmware for RTL8156 series +Subject: [PATCH 583/889] r8152: support PHY firmware for RTL8156 series commit 4a51b0e8a0143b0e83d51d9c58c6416c3818a9f2 upstream. @@ -220148,7 +218583,7 @@ Signed-off-by: David S. Miller 1 file changed, 561 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index 73685b8904d1..6fb3a235bf91 100644 +index 48acc96caa40..86ce16bc8791 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -974,8 +974,60 @@ enum rtl8152_fw_flags { @@ -220829,10 +219264,10 @@ index 73685b8904d1..6fb3a235bf91 100644 2.18.4 -From e9bc56757963a93f74012816e7db80519b28dc87 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hayes Wang Date: Fri, 16 Apr 2021 16:04:37 +0800 -Subject: [PATCH 604/834] r8152: search the configuration of vendor mode +Subject: [PATCH 584/889] r8152: search the configuration of vendor mode commit c2198943e33b100ed21dfb636c8fa6baef841e9d upstream. @@ -220846,7 +219281,7 @@ Signed-off-by: David S. Miller 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c -index 6fb3a235bf91..3560ee355e71 100644 +index 86ce16bc8791..45e251e907d9 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -29,7 +29,7 @@ @@ -220914,10 +219349,10 @@ index 6fb3a235bf91..3560ee355e71 100644 2.18.4 -From 557fe7cc13ff5f80bfde84f712531a149bd45a5e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 20 Apr 2021 13:34:18 +0100 -Subject: [PATCH 605/834] rpivid: Only clk_request_done once +Subject: [PATCH 585/889] rpivid: Only clk_request_done once Fixes: 25486f49bfe2e3ae13b90478d1eebd91413136ad Signed-off-by: Dom Cobley @@ -220946,10 +219381,10 @@ index def891a86e55..37c8f62649d6 100644 2.18.4 -From 2688f83f0ee3ffcef06b8cc3067b7d6a2a5e7884 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: wangzx <593074943@qq.com> Date: Tue, 20 Apr 2021 22:33:26 +0800 -Subject: [PATCH 606/834] dwc_otg: fix an undeclared variable Replace an +Subject: [PATCH 586/889] dwc_otg: fix an undeclared variable Replace an undeclared variable used by DWC_DEBUGPL with the real endpoint address. DWC_DEBUGPL does nothing with DEBUG undefined so it did not go wrong before. Signed-off-by: Zixuan Wang @@ -220976,134 +219411,10 @@ index 50c8705185ad..2ee27450c6f6 100644 2.18.4 -From e79330d4081af17ef8c672b81d873c827d38d2db Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Thu, 25 Mar 2021 18:40:51 +0000 -Subject: [PATCH 607/834] Revert "drm/vc4: Add configuration for BCM2711 DSI1." - -This reverts commit 10faa28e1474e6cf33cb0809d2a6d5b7a8351a28. - -Revert in order to take the cleaner upstream version. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_dsi.c | 9 ++------- - 1 file changed, 2 insertions(+), 7 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index bac5e07c05de..ce4db68827c8 100644 ---- a/drivers/gpu/drm/vc4/vc4_dsi.c -+++ b/drivers/gpu/drm/vc4/vc4_dsi.c -@@ -1308,11 +1308,6 @@ static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = { - static const struct of_device_id vc4_dsi_dt_match[] = { - { .compatible = "brcm,bcm2835-dsi0", (void *)(uintptr_t)0 }, - { .compatible = "brcm,bcm2835-dsi1", (void *)(uintptr_t)1 }, -- /* -- * Use 2 so that it uses the DSI1 register layout, but not DMA -- * workaround -- */ -- { .compatible = "brcm,bcm2711-dsi1", (void *)(uintptr_t)2 }, - {} - }; - -@@ -1500,8 +1495,8 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) - return -ENODEV; - } - -- /* DSI1 on BCM2835/6/7 has a broken AXI slave that doesn't respond to -- * writes from the ARM. It does handle writes from the DMA engine, -+ /* DSI1 has a broken AXI slave that doesn't respond to writes -+ * from the ARM. It does handle writes from the DMA engine, - * so set up a channel for talking to it. - */ - if (dsi->port == 1) { --- -2.18.4 - - -From 5781a77b3ad0dd41e7af162b2375af6c6bcebff0 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Thu, 25 Mar 2021 18:46:23 +0000 -Subject: [PATCH 608/834] Revert "drm/vc4: Add support for DSI0" - -This reverts commit d704a3c965783ed51476031206b2120676418672. - -Revert in order to apply upstream version - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_drv.h | 1 - - drivers/gpu/drm/vc4/vc4_dsi.c | 15 +++++---------- - 2 files changed, 5 insertions(+), 11 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 08fe0bce44c3..98f781d52a35 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -81,7 +81,6 @@ struct vc4_dev { - struct vc4_hvs *hvs; - struct vc4_v3d *v3d; - struct vc4_dpi *dpi; -- struct vc4_dsi *dsi0; - struct vc4_dsi *dsi1; - struct vc4_vec *vec; - struct vc4_txp *txp; -diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index ce4db68827c8..2646a6dbf584 100644 ---- a/drivers/gpu/drm/vc4/vc4_dsi.c -+++ b/drivers/gpu/drm/vc4/vc4_dsi.c -@@ -1306,7 +1306,6 @@ static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = { - }; - - static const struct of_device_id vc4_dsi_dt_match[] = { -- { .compatible = "brcm,bcm2835-dsi0", (void *)(uintptr_t)0 }, - { .compatible = "brcm,bcm2835-dsi1", (void *)(uintptr_t)1 }, - {} - }; -@@ -1430,10 +1429,10 @@ vc4_dsi_init_phy_clocks(struct vc4_dsi *dsi) - memset(&init, 0, sizeof(init)); - init.parent_names = &parent_name; - init.num_parents = 1; -- if (dsi->port == 0) -- init.name = phy_clocks[i].dsi0_name; -- else -+ if (dsi->port == 1) - init.name = phy_clocks[i].dsi1_name; -+ else -+ init.name = phy_clocks[i].dsi0_name; - init.ops = &clk_fixed_factor_ops; - - ret = devm_clk_hw_register(dev, &fix->hw); -@@ -1605,9 +1604,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) - if (ret) - return ret; - -- if (dsi->port == 0) -- vc4->dsi0 = dsi; -- else -+ if (dsi->port == 1) - vc4->dsi1 = dsi; - - drm_simple_encoder_init(drm, dsi->encoder, DRM_MODE_ENCODER_DSI); -@@ -1652,9 +1649,7 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master, - list_splice_init(&dsi->bridge_chain, &dsi->encoder->bridge_chain); - drm_encoder_cleanup(dsi->encoder); - -- if (dsi->port == 0) -- vc4->dsi0 = NULL; -- else -+ if (dsi->port == 1) - vc4->dsi1 = NULL; - } - --- -2.18.4 - - -From 161a522d4041be40ce9b014a8917ab7a17e47d97 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 3 Dec 2020 14:25:36 +0100 -Subject: [PATCH 609/834] drm/vc4: drv: Remove the DSI pointer in vc4_drv +Subject: [PATCH 587/889] drm/vc4: drv: Remove the DSI pointer in vc4_drv Commit 51f4fcd9c4ea867c3b4fe58111f342ad0e80642a upstream. @@ -221174,10 +219485,10 @@ index 2646a6dbf584..8c413d21f752 100644 2.18.4 -From 8c7f5c1d0cc341fb13e7fadef7c2ef156e82fc03 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 3 Dec 2020 14:25:38 +0100 -Subject: [PATCH 610/834] drm/vc4: dsi: Use snprintf for the PHY clocks instead +Subject: [PATCH 588/889] drm/vc4: dsi: Use snprintf for the PHY clocks instead of an array Commit dc0bf36401e891c853e0a25baeb4e0b4e6f3626d upstream. @@ -221246,10 +219557,10 @@ index 8c413d21f752..2727ad61989f 100644 2.18.4 -From db9a965e3063828795b102cd3690924540f4d1e4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 3 Dec 2020 14:25:39 +0100 -Subject: [PATCH 611/834] drm/vc4: dsi: Introduce a variant structure +Subject: [PATCH 589/889] drm/vc4: dsi: Introduce a variant structure Commit d1d195ce26a14ec0a87816c09ae514e1c40e97f7 upstream. @@ -221443,10 +219754,10 @@ index 2727ad61989f..ea4cd8284454 100644 2.18.4 -From c8a9e9b6706f522ae749ad05cad5e15da3759fcd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 3 Dec 2020 14:25:40 +0100 -Subject: [PATCH 612/834] drm/vc4: dsi: Add support for DSI0 +Subject: [PATCH 590/889] drm/vc4: dsi: Add support for DSI0 Commit 4b265fe11fad4234b12d92dd8091f9aa0c878eea upstream. @@ -221493,10 +219804,10 @@ index ea4cd8284454..c2ed98013f9d 100644 2.18.4 -From 28a9223aa119c2ea31bac7c8a1bfff3151e5e24d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 3 Dec 2020 14:25:42 +0100 -Subject: [PATCH 613/834] drm/vc4: dsi: Add configuration for BCM2711 DSI1 +Subject: [PATCH 591/889] drm/vc4: dsi: Add configuration for BCM2711 DSI1 Commit d0666be8ef9e8e65d4b7fabc1606ec51f61384c0 upstream. @@ -221552,10 +219863,10 @@ index c2ed98013f9d..6dfcbd9e234e 100644 2.18.4 -From fb4983c4f72bee27c9ca44596ad7e7ab84478d8b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 11 Feb 2021 18:37:04 +0000 -Subject: [PATCH 614/834] drm/vc4: Correct pixel order for DSI0 +Subject: [PATCH 592/889] drm/vc4: Correct pixel order for DSI0 For slightly unknown reasons, dsi0 takes a different pixel format to dsi1, and that has to be set in the pixel valve. @@ -221585,10 +219896,10 @@ index e02c8aabc8c7..1d1ae0d9e48f 100644 2.18.4 -From dcbb72d6f68d5f554dba42984fa05cf35619f3e1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 8 Feb 2021 11:22:01 +0000 -Subject: [PATCH 615/834] drm/vc4: Register dsi0 as the correct vc4 encoder +Subject: [PATCH 593/889] drm/vc4: Register dsi0 as the correct vc4 encoder type vc4_dsi was registering both dsi0 and dsi1 as VC4_ENCODER_TYPE_DSI1 @@ -221620,10 +219931,10 @@ index 6dfcbd9e234e..053930eaa48f 100644 2.18.4 -From 09e118a8c634a376f1c1c46445d19d55a9fa62c0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 10 Feb 2021 18:46:22 +0000 -Subject: [PATCH 616/834] drm/vc4: Fix dsi0 interrupt support. +Subject: [PATCH 594/889] drm/vc4: Fix dsi0 interrupt support. DSI0 seemingly had very little or no testing as a load of the register mappings were incorrect/missing, so host @@ -221814,10 +220125,10 @@ index 053930eaa48f..fb0efc67d31d 100644 2.18.4 -From 49c875e3f897e4dbe92cba8c2eb9caea4bb2de2c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 15 Apr 2021 16:18:16 +0100 -Subject: [PATCH 617/834] drm/vc4: Add correct stop condition to +Subject: [PATCH 595/889] drm/vc4: Add correct stop condition to vc4_dsi_encoder_disable iteration vc4_dsi_encoder_disable is partially an open coded version of @@ -221850,10 +220161,10 @@ index fb0efc67d31d..9861e2d2c05d 100644 2.18.4 -From dce31071927941990fab29229a01956bb5c22e98 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 Jan 2021 16:30:55 +0000 -Subject: [PATCH 618/834] drm/atomic: Don't fixup modes that haven't been reset +Subject: [PATCH 596/889] drm/atomic: Don't fixup modes that haven't been reset Signed-off-by: Dave Stevenson --- @@ -221880,10 +220191,10 @@ index 134d3000fb18..172144627c59 100644 2.18.4 -From 1ad56b460e806419b2c6dae274f82a9882e4cd68 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 15 Apr 2021 17:30:35 +0100 -Subject: [PATCH 619/834] drm/panel: jdi-lt070me05000: Use +Subject: [PATCH 597/889] drm/panel: jdi-lt070me05000: Use gpiod_set_value_cansleep There is no reason why the control GPIOs for the panel can not @@ -221953,10 +220264,10 @@ index 733010b5e4f5..7fb4d98e166d 100644 2.18.4 -From 7c2143f51f80fbecaec8dfa1ba6192f84778fa87 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 15 Apr 2021 18:09:56 +0100 -Subject: [PATCH 620/834] defconfigs: Add PANEL_JDI_LT070ME05000 DSI panel +Subject: [PATCH 598/889] defconfigs: Add PANEL_JDI_LT070ME05000 DSI panel Used by the 2013 Nexus 7" tablet, and working via an adapter board on Compute Modules. @@ -222034,10 +220345,10 @@ index 584e82f7de99..ff857505902b 100644 2.18.4 -From 2b3f4dba7b8069bf3be0a9be7b0be53977aedee0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 15 Apr 2021 16:46:34 +0100 -Subject: [PATCH 621/834] dtoverlays: Add overlays for JDI LT070ME05000 +Subject: [PATCH 599/889] dtoverlays: Add overlays for JDI LT070ME05000 1200x1920 DSI panel Credit to forum member gizmomouse on @@ -222264,10 +220575,10 @@ index 000000000000..5dcd0f2243e2 2.18.4 -From 84c333f6bd6a922334afa96fc66491cfa6c44f71 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 21 Apr 2021 12:14:44 +0200 -Subject: [PATCH 622/834] clk: requests: Ignore if the pointer is null +Subject: [PATCH 600/889] clk: requests: Ignore if the pointer is null Signed-off-by: Maxime Ripard --- @@ -222292,167 +220603,10 @@ index 031627757b11..af0f638d1769 100644 2.18.4 -From 89d37b77b5e32278937d141c02350367f40383cb Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Tue, 16 Mar 2021 13:51:52 +0100 -Subject: [PATCH 623/834] drm/vc4: Rework the encoder retrieval code - -Due to a FIFO that cannot be flushed between the pixelvalve and the HDMI -controllers on BCM2711, we need to carefully disable both at boot time -if they were left enabled by the firmware. - -However, at the time we're running that code, the struct drm_connector -encoder pointer isn't set yet, and thus we cannot retrieve the encoder -associated to our CRTC. - -We can however make use of the fact that we have a less flexible setup -than what DRM allows where we have a 1:1 relationship between our CRTCs -and encoders (and connectors), and thus store the crtc associated to our -encoder at boot time. - -We cannot do that at the time the encoders are probed though, since the -CRTCs won't be probed yet and thus we don't know at that time which CRTC -index we're going to get, so let's do this in two passes: we can first -bind all the components and then once they all are bound, we can iterate -over all the encoders to find their associated CRTC and set the pointer. - -This is similar to what we're doing to set the possible_crtcs field. - -Fixes: 875a4d536842 ("drm/vc4: drv: Disable the CRTC at boot time") -Signed-off-by: Maxime Ripard ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 25 +++++++++++++++++++++-- - drivers/gpu/drm/vc4/vc4_drv.c | 36 ++++++++++++++++++++++++++++++++++ - drivers/gpu/drm/vc4/vc4_drv.h | 10 ++++++++++ - 3 files changed, 69 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 1d1ae0d9e48f..d6a932246240 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -272,6 +272,19 @@ static u32 vc4_crtc_get_fifo_full_level_bits(struct vc4_crtc *vc4_crtc, - PV_CONTROL_FIFO_LEVEL); - } - -+static struct drm_encoder *vc4_get_connector_encoder(struct drm_connector *connector) -+{ -+ struct drm_encoder *encoder; -+ -+ if (drm_WARN_ON(connector->dev, hweight32(connector->possible_encoders) != 1)) -+ return NULL; -+ -+ drm_connector_for_each_possible_encoder(connector, encoder) -+ return encoder; -+ -+ return NULL; -+} -+ - /* - * Returns the encoder attached to the CRTC. - * -@@ -286,9 +299,17 @@ static struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc) - - drm_connector_list_iter_begin(crtc->dev, &conn_iter); - drm_for_each_connector_iter(connector, &conn_iter) { -- if (connector->state->crtc == crtc) { -+ struct drm_encoder *encoder; -+ struct vc4_encoder *vc4_encoder; -+ -+ encoder = vc4_get_connector_encoder(connector); -+ if (!encoder) -+ continue; -+ -+ vc4_encoder = to_vc4_encoder(encoder); -+ if (vc4_encoder->crtc == crtc) { - drm_connector_list_iter_end(&conn_iter); -- return connector->encoder; -+ return encoder; - } - } - drm_connector_list_iter_end(&conn_iter); -diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 617c113b033f..8baa90837e9e 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.c -+++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -226,6 +226,41 @@ static int compare_dev(struct device *dev, void *data) - return dev == data; - } - -+static struct drm_crtc *vc4_drv_find_crtc(struct drm_device *drm, -+ struct drm_encoder *encoder) -+{ -+ struct drm_crtc *crtc; -+ -+ if (WARN_ON(hweight32(encoder->possible_crtcs) != 1)) -+ return NULL; -+ -+ drm_for_each_crtc(crtc, drm) { -+ if (!drm_encoder_crtc_ok(encoder, crtc)) -+ continue; -+ -+ return crtc; -+ } -+ -+ return NULL; -+} -+ -+static void vc4_drv_set_encoder_data(struct drm_device *drm) -+{ -+ struct drm_encoder *encoder; -+ -+ drm_for_each_encoder(encoder, drm) { -+ struct vc4_encoder *vc4_encoder; -+ struct drm_crtc *crtc; -+ -+ crtc = vc4_drv_find_crtc(drm, encoder); -+ if (WARN_ON(!crtc)) -+ return; -+ -+ vc4_encoder = to_vc4_encoder(encoder); -+ vc4_encoder->crtc = crtc; -+ } -+} -+ - static void vc4_match_add_drivers(struct device *dev, - struct component_match **match, - struct platform_driver *const *drivers, -@@ -308,6 +343,7 @@ static int vc4_drm_bind(struct device *dev) - ret = component_bind_all(dev, drm); - if (ret) - return ret; -+ vc4_drv_set_encoder_data(drm); - - if (!vc4->firmware_kms) { - ret = vc4_plane_create_additional_planes(drm); -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index ca435d24b7dc..24e8e291e0ad 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -445,6 +445,16 @@ enum vc4_encoder_type { - - struct vc4_encoder { - struct drm_encoder base; -+ -+ /* -+ * At boot time, we need to be able to retrieve the CRTC for a given -+ * connector in order to run the disable hooks below to avoid the stuck -+ * pixel issue. Unfortunately the drm_connector->encoder pointer is -+ * NULL at that time so we can't move up the chain, so we'll store it -+ * ourselves here. -+ */ -+ struct drm_crtc *crtc; -+ - enum vc4_encoder_type type; - u32 clock_select; - --- -2.18.4 - - -From 3102a1969defe96ff367d3081551690ecb813776 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 25 Feb 2021 14:42:03 +0100 -Subject: [PATCH 624/834] drm/vc4: hvs: Make the HVS bind first +Subject: [PATCH 601/889] drm/vc4: hvs: Make the HVS bind first We'll need to have the HVS binding before the HDMI controllers so that we can check whether the firmware allows to run in 4kp60. Reorder a bit @@ -222466,10 +220620,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 8baa90837e9e..c404ef49f420 100644 +index 617c113b033f..3683780b9de8 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -390,12 +390,21 @@ static const struct component_master_ops vc4_drm_ops = { +@@ -354,12 +354,21 @@ static const struct component_master_ops vc4_drm_ops = { .unbind = vc4_drm_unbind, }; @@ -222496,10 +220650,10 @@ index 8baa90837e9e..c404ef49f420 100644 2.18.4 -From ffbe720438657276b5c52d155e5e8e8b8d943af3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 8 Oct 2020 16:06:08 +0200 -Subject: [PATCH 625/834] drm/vc4: hdmi: Properly compute the BVB clock rate +Subject: [PATCH 602/889] drm/vc4: hdmi: Properly compute the BVB clock rate The BVB clock rate computation doesn't take into account a mode clock of 594MHz that we're going to need to support 4k60. @@ -222557,10 +220711,10 @@ index 44913ca1a5e0..a83ee8427905 100644 2.18.4 -From 48920cef66fbccfa5bf8c0741a9163dc68c579bb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 25 Feb 2021 15:35:02 +0100 -Subject: [PATCH 626/834] drm/vc4: hdmi: Check and warn if we can't reach 4kp60 +Subject: [PATCH 603/889] drm/vc4: hdmi: Check and warn if we can't reach 4kp60 frequencies In order to reach the frequencies needed to output at 594MHz, the @@ -222671,10 +220825,10 @@ index 11a4b737d0ab..23e8cfc22c4d 100644 2.18.4 -From dc36d20ecff418f8155d5a2ea71eaa16e02567ae Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 8 Oct 2020 16:06:58 +0200 -Subject: [PATCH 627/834] drm/vc4: hdmi: Enable the scrambler +Subject: [PATCH 604/889] drm/vc4: hdmi: Enable the scrambler The HDMI controller on the BCM2711 includes a scrambler in order to reach the HDMI 2.0 modes that require it. Let's add the support for it. @@ -222821,10 +220975,10 @@ index 20a1438a72cb..a81fdf90f66b 100644 2.18.4 -From bfb3da6e764f21151f473a9979f1971219cef7d3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 8 Oct 2020 16:08:06 +0200 -Subject: [PATCH 628/834] drm/vc4: hdmi: Raise the maximum clock rate +Subject: [PATCH 605/889] drm/vc4: hdmi: Raise the maximum clock rate Now that we have the infrastructure in place, we can raise the maximum pixel rate we can reach for HDMI0 on the BCM2711. @@ -222857,10 +221011,10 @@ index c561b537e5b6..24d3ad18ea6e 100644 2.18.4 -From 9a1c4bd691ed01173a766e09a77620d69c29127c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 21 Apr 2021 15:15:42 +0100 -Subject: [PATCH 629/834] vc4/drm: hdmi: Handle case when bvb clock is null +Subject: [PATCH 606/889] vc4/drm: hdmi: Handle case when bvb clock is null Pi2/3 have no bvb clock but want the other clocks to remain enabled here @@ -222907,10 +221061,10 @@ index 24d3ad18ea6e..f55e522f0236 100644 2.18.4 -From d412ec39438705f89290e35071023c0c4847f248 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 19 Apr 2021 10:33:24 +0100 -Subject: [PATCH 630/834] overlays: spi-rtc: Add ds3232 and ds3234 +Subject: [PATCH 607/889] overlays: spi-rtc: Add ds3232 and ds3234 Extend the spi-rtc overlay to support the ds3232 and ds3234 RTCs, as well as adding parameters to select difference SPI controllers and @@ -223040,10 +221194,10 @@ index 9664afc9845c..51b7fec281c0 100644 2.18.4 -From 2529c6d063e5bebd929b25746e393b3f58b27f9d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: kFYatek <4499762+kFYatek@users.noreply.github.com> Date: Sat, 27 Mar 2021 21:43:33 +0100 -Subject: [PATCH 631/834] drm/vc4: Fix VEC address for BCM2711 in the +Subject: [PATCH 608/889] drm/vc4: Fix VEC address for BCM2711 in the devicetrees The VEC has a different address (0x7ec13000) on the BCM2711 (used in @@ -223122,10 +221276,10 @@ index 6d305b8b5ebe..06d04cde52b9 100644 2.18.4 -From add3c8c1bcbdee44f29750a4364544b8ba621be1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: kFYatek <4499762+kFYatek@users.noreply.github.com> Date: Sat, 27 Mar 2021 21:43:40 +0100 -Subject: [PATCH 632/834] drm/vc4: Separate VEC compatible variants +Subject: [PATCH 609/889] drm/vc4: Separate VEC compatible variants The VEC's DAC on BCM2711 is slightly different compared to the one on BCM283x and needs different configuration. In particular, bit 3 @@ -223238,10 +221392,10 @@ index bd5b8eb58b18..a467ceba75e4 100644 2.18.4 -From 50b9dba5b7949b5a907f2ebe8f89c2227bd0edc8 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 1 Apr 2021 10:34:27 -0500 -Subject: [PATCH 633/834] configs: Enable ATA and AHCI for SATA drive support. +Subject: [PATCH 610/889] configs: Enable ATA and AHCI for SATA drive support. --- arch/arm/configs/bcm2711_defconfig | 3 +++ @@ -223280,10 +221434,10 @@ index 93159a7a2d9b..b90bcc5b6ef8 100644 2.18.4 -From 7f1782bcf74ee5e0c1535fb6a34bb96a8132566a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 22 Apr 2021 10:45:37 +0200 -Subject: [PATCH 634/834] clk: requests: Dereference the request pointer after +Subject: [PATCH 611/889] clk: requests: Dereference the request pointer after the check The current code will first dereference the req pointer and then test if @@ -223316,10 +221470,10 @@ index af0f638d1769..1b9a76c7dafa 100644 2.18.4 -From 4e09257b9ef7a298c73fb2bcb33a16110d9331c1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Mar 2021 18:28:40 +0000 -Subject: [PATCH 635/834] staging/bcm2835-codec: Fix support for levels 4.1 and +Subject: [PATCH 612/889] staging/bcm2835-codec: Fix support for levels 4.1 and 4.2 The driver said it supported H264 levels 4.1 and 4.2, but @@ -223358,10 +221512,10 @@ index 5729a8a7d94e..4622057e71cb 100644 2.18.4 -From 87177a0c3ca5ed682fee43bef3263fd806c70812 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 4 Feb 2021 19:08:23 +0000 -Subject: [PATCH 636/834] staging/bcm2835-codec: Set the colourspace +Subject: [PATCH 613/889] staging/bcm2835-codec: Set the colourspace appropriately for RGB formats Video decode supports YUV and RGB formats. YUV needs to report SMPTE170M @@ -223448,10 +221602,10 @@ index 4622057e71cb..08429a42c847 100644 2.18.4 -From 0d4dcb1f6479e6e48575a79aff261e6e9c328a0c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 9 Dec 2020 18:53:56 +0000 -Subject: [PATCH 637/834] staging/bcm2835-codec: Pass corrupt frame flag. +Subject: [PATCH 614/889] staging/bcm2835-codec: Pass corrupt frame flag. MMAL has the flag MMAL_BUFFER_HEADER_FLAG_CORRUPTED but that wasn't being passed through, so add it. @@ -223496,10 +221650,10 @@ index 08429a42c847..3ed9f47a37fe 100644 2.18.4 -From 2d0a9dfb04e8fca486d3a6daa3a6a70665bcee81 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Mar 2021 18:34:50 +0000 -Subject: [PATCH 638/834] staging/bcm2835-camera: Add support for H264 levels +Subject: [PATCH 615/889] staging/bcm2835-camera: Add support for H264 levels 4.1 and 4.2 Whilst the hardware can't achieve the limits of level 4.2 under @@ -223560,10 +221714,10 @@ index f73daa38fa66..f3480a5c5170 100644 2.18.4 -From 970ef88ea8a13b0893890b50f2dad0b485241742 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 15 Apr 2021 11:07:55 +0100 -Subject: [PATCH 639/834] staging/bcm2835-codec: Do not update crop from S_FMT +Subject: [PATCH 616/889] staging/bcm2835-codec: Do not update crop from S_FMT after res change During decode, setting the CAPTURE queue format was setting the crop @@ -223602,10 +221756,10 @@ index 3ed9f47a37fe..a97666a1a4be 100644 2.18.4 -From 9c323e2c203cd9f5d3a9e3c28c8ed50d59917eeb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 23 Apr 2021 16:16:49 +0100 -Subject: [PATCH 640/834] staging/bcm2835-isp: Fix compiler warning +Subject: [PATCH 617/889] staging/bcm2835-isp: Fix compiler warning The result of dividing a u32 by a size_t is an unsigned int on arm32 and a long unsigned int on arm64. Use "%zu" (the size_t format) to @@ -223633,10 +221787,10 @@ index 5cca8bdd1d65..08dce8bba9bb 100644 2.18.4 -From bebd18f15fe475af2275ee8fa0ba497aa420da5f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 25 Apr 2021 21:07:03 +0100 -Subject: [PATCH 641/834] overlays: Allow multiple gpio-shutdown instances +Subject: [PATCH 618/889] overlays: Allow multiple gpio-shutdown instances There is no reason not to support multiple gpio-shutdown signals, so add the necessary __override__ magic. @@ -223681,10 +221835,10 @@ index 0a27595143ec..da148064aedd 100644 2.18.4 -From c7079794e8ca934396fd2e90d95b49e0e8683d15 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Apr 2021 09:58:14 +0100 -Subject: [PATCH 642/834] overlays: README - improve the gpio-poweroff guide +Subject: [PATCH 619/889] overlays: README - improve the gpio-poweroff guide Signed-off-by: Phil Elwell --- @@ -223717,10 +221871,10 @@ index 17521568cee5..b9be3bece19b 100644 2.18.4 -From 95d1d17f3242ffe76f3710c33d947f871dbe1bf4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Apr 2021 10:08:21 +0100 -Subject: [PATCH 643/834] SQUASH: overlays: Fix typo in README +Subject: [PATCH 620/889] SQUASH: overlays: Fix typo in README Signed-off-by: Phil Elwell --- @@ -223744,10 +221898,10 @@ index b9be3bece19b..79878f4f30e6 100644 2.18.4 -From 45146512c40bcb89709a482eaf938f67dd21c1df Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 27 Apr 2021 08:59:01 +0100 -Subject: [PATCH 644/834] gpio-poweroff: Remember the old poweroff handler +Subject: [PATCH 621/889] gpio-poweroff: Remember the old poweroff handler Keeping a copy of the old poweroff handler allows it to be restored should this module be unloaded, but also provides a fallback if the @@ -223803,10 +221957,10 @@ index e5dca66360a7..81e7acb8acb5 100644 2.18.4 -From 23f3d53042cdfcb7d48237b39569ac8724877aa4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 28 Apr 2021 16:14:21 +0100 -Subject: [PATCH 645/834] drm/vc4: Allow DBLCLK modes even if horz timing is +Subject: [PATCH 622/889] drm/vc4: Allow DBLCLK modes even if horz timing is odd. The 2711 pixel valve can't produce odd horizontal timings, and @@ -223851,10 +222005,10 @@ index f55e522f0236..417d3e9954c2 100644 2.18.4 -From c83143d26ef6c8f3df5c4443d850566af4487e44 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 28 Apr 2021 20:30:44 +0200 -Subject: [PATCH 646/834] overlays: Add ugreen-dabboard overlay +Subject: [PATCH 623/889] overlays: Add ugreen-dabboard overlay This is a simple overlay based on the simple-audio-card and the dmic codec. It has the speciality that it is configured to use the codec @@ -223963,10 +222117,10 @@ index 000000000000..fc8d9b118068 2.18.4 -From 2c74aba297502c7406a14af374fc880ad1174921 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 23 Apr 2021 15:02:58 +0100 -Subject: [PATCH 647/834] ARM: dts: bcm2711-rpi-400: Limit MDIO clock speed +Subject: [PATCH 624/889] ARM: dts: bcm2711-rpi-400: Limit MDIO clock speed Signed-off-by: Phil Elwell --- @@ -223992,10 +222146,10 @@ index 1bb8854e69d6..4ffd5e04ccf1 100644 2.18.4 -From bfd80357901a3c38996e870eb4b28c4ba71a30c7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 30 Apr 2021 08:34:36 +0100 -Subject: [PATCH 648/834] spi: bcm2835: Increase the CS limit to 24 +Subject: [PATCH 625/889] spi: bcm2835: Increase the CS limit to 24 Increase the maximum number of CS lines to 24, and ensure this limit is not exceeded. @@ -224036,10 +222190,10 @@ index 4f40d2b9d468..0f6a2f7c8b53 100644 2.18.4 -From bfd8a05c756bc08001fc7b216741f511f0f79537 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 4 May 2021 13:57:21 +0100 -Subject: [PATCH 649/834] configs: Regenerate defconfigs +Subject: [PATCH 626/889] configs: Regenerate defconfigs GENERIC_PHY=m is now implied by other settings on bcm2711. @@ -224077,10 +222231,10 @@ index b90bcc5b6ef8..5fb890f90233 100644 2.18.4 -From 4bc16f0bb959511dd8ac203c40dad928b6b70333 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Michael Heimpold Date: Tue, 4 May 2021 15:14:16 +0200 -Subject: [PATCH 650/834] configs: add CONFIG_QCA7000_UART=m (#4322) +Subject: [PATCH 627/889] configs: add CONFIG_QCA7000_UART=m (#4322) This allows to use the UART interface instead of SPI of QCA7000 Ethernet over powerline chips. @@ -224158,10 +222312,10 @@ index ff857505902b..c38726720f27 100644 2.18.4 -From a705293b668ee61185ce2490cb903ae32aa07481 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 5 May 2021 15:35:34 +0200 -Subject: [PATCH 651/834] clk: Always clamp the rounded rate +Subject: [PATCH 628/889] clk: Always clamp the rounded rate The current core while setting the min and max rate properly in the clk_request structure will not make sure that the requested rate is @@ -224192,154 +222346,10 @@ index 1b9a76c7dafa..f4695bac4cec 100644 2.18.4 -From 1513a616ef9c5f7ca40c0a8ef5870940cd2c8bfe Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Wed, 5 May 2021 14:06:21 +0200 -Subject: [PATCH 652/834] Revert "drm/vc4: Rework the encoder retrieval code" - -This reverts commit 3cf3d39b754a78c67134da7b8109eb968129ef8d. - -This commit was making the assumption that we had a 1:1 mapping between -the encoders and their CRTC. While this is true for the HDMI controllers -on the BCM2711, this isn't true for the other encoders (DSI0 and DPI -share the PixelValve 0, and DSI1 and SMI share the PixelValve1), and -this isn't true at all on the older SoCs, effectively breaking the -encoder retrieval logic. - -Signed-off-by: Maxime Ripard ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 25 ++--------------------- - drivers/gpu/drm/vc4/vc4_drv.c | 36 ---------------------------------- - drivers/gpu/drm/vc4/vc4_drv.h | 10 ---------- - 3 files changed, 2 insertions(+), 69 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index d6a932246240..1d1ae0d9e48f 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -272,19 +272,6 @@ static u32 vc4_crtc_get_fifo_full_level_bits(struct vc4_crtc *vc4_crtc, - PV_CONTROL_FIFO_LEVEL); - } - --static struct drm_encoder *vc4_get_connector_encoder(struct drm_connector *connector) --{ -- struct drm_encoder *encoder; -- -- if (drm_WARN_ON(connector->dev, hweight32(connector->possible_encoders) != 1)) -- return NULL; -- -- drm_connector_for_each_possible_encoder(connector, encoder) -- return encoder; -- -- return NULL; --} -- - /* - * Returns the encoder attached to the CRTC. - * -@@ -299,17 +286,9 @@ static struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc) - - drm_connector_list_iter_begin(crtc->dev, &conn_iter); - drm_for_each_connector_iter(connector, &conn_iter) { -- struct drm_encoder *encoder; -- struct vc4_encoder *vc4_encoder; -- -- encoder = vc4_get_connector_encoder(connector); -- if (!encoder) -- continue; -- -- vc4_encoder = to_vc4_encoder(encoder); -- if (vc4_encoder->crtc == crtc) { -+ if (connector->state->crtc == crtc) { - drm_connector_list_iter_end(&conn_iter); -- return encoder; -+ return connector->encoder; - } - } - drm_connector_list_iter_end(&conn_iter); -diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index c404ef49f420..3683780b9de8 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.c -+++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -226,41 +226,6 @@ static int compare_dev(struct device *dev, void *data) - return dev == data; - } - --static struct drm_crtc *vc4_drv_find_crtc(struct drm_device *drm, -- struct drm_encoder *encoder) --{ -- struct drm_crtc *crtc; -- -- if (WARN_ON(hweight32(encoder->possible_crtcs) != 1)) -- return NULL; -- -- drm_for_each_crtc(crtc, drm) { -- if (!drm_encoder_crtc_ok(encoder, crtc)) -- continue; -- -- return crtc; -- } -- -- return NULL; --} -- --static void vc4_drv_set_encoder_data(struct drm_device *drm) --{ -- struct drm_encoder *encoder; -- -- drm_for_each_encoder(encoder, drm) { -- struct vc4_encoder *vc4_encoder; -- struct drm_crtc *crtc; -- -- crtc = vc4_drv_find_crtc(drm, encoder); -- if (WARN_ON(!crtc)) -- return; -- -- vc4_encoder = to_vc4_encoder(encoder); -- vc4_encoder->crtc = crtc; -- } --} -- - static void vc4_match_add_drivers(struct device *dev, - struct component_match **match, - struct platform_driver *const *drivers, -@@ -343,7 +308,6 @@ static int vc4_drm_bind(struct device *dev) - ret = component_bind_all(dev, drm); - if (ret) - return ret; -- vc4_drv_set_encoder_data(drm); - - if (!vc4->firmware_kms) { - ret = vc4_plane_create_additional_planes(drm); -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 24e8e291e0ad..ca435d24b7dc 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -445,16 +445,6 @@ enum vc4_encoder_type { - - struct vc4_encoder { - struct drm_encoder base; -- -- /* -- * At boot time, we need to be able to retrieve the CRTC for a given -- * connector in order to run the disable hooks below to avoid the stuck -- * pixel issue. Unfortunately the drm_connector->encoder pointer is -- * NULL at that time so we can't move up the chain, so we'll store it -- * ourselves here. -- */ -- struct drm_crtc *crtc; -- - enum vc4_encoder_type type; - u32 clock_select; - --- -2.18.4 - - -From 99cf80b8b86145759bbb0574fb6c60909115ec81 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 6 May 2021 17:01:46 +0200 -Subject: [PATCH 653/834] drm/vc4: crtc: Pass the drm_atomic_state to config_pv +Subject: [PATCH 629/889] drm/vc4: crtc: Pass the drm_atomic_state to config_pv The vc4_crtc_config_pv will need to access the drm_atomic_state structure and its only parent function, vc4_crtc_atomic_enable already @@ -224388,10 +222398,10 @@ index 1d1ae0d9e48f..513c75288131 100644 2.18.4 -From 7ce38b11cd55ec2a58593645687875887dc7a385 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 6 May 2021 17:07:07 +0200 -Subject: [PATCH 654/834] drm/vc4: crtc: Fix vc4_get_crtc_encoder logic +Subject: [PATCH 630/889] drm/vc4: crtc: Fix vc4_get_crtc_encoder logic The vc4_get_crtc_encoder function currently only works when the connector->state->crtc pointer is set, which is only true when the @@ -224477,10 +222487,10 @@ index 513c75288131..a813b7de60ef 100644 2.18.4 -From a4d48e65a5ac6d2b922f41c5ec99fb321e820e67 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 6 May 2021 17:15:57 +0200 -Subject: [PATCH 655/834] drm/vc4: crtc: Lookup the encoder from the register +Subject: [PATCH 631/889] drm/vc4: crtc: Lookup the encoder from the register at boot At boot, we can't rely on the vc4_get_crtc_encoder since we don't have a @@ -224587,10 +222597,10 @@ index a813b7de60ef..a0b5503928df 100644 2.18.4 -From 89f43d82793763c2068efc395746cc1057912dd8 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 29 Apr 2021 21:58:27 +0200 -Subject: [PATCH 656/834] drm/vc4: hdmi: Simplify the connector state retrieval +Subject: [PATCH 632/889] drm/vc4: hdmi: Simplify the connector state retrieval When we have the entire DRM state, retrieving the connector state only requires the drm_connector pointer. Fortunately for us, we have @@ -224645,10 +222655,10 @@ index 417d3e9954c2..e4bf7f34ddab 100644 2.18.4 -From cc0abcfa13b63fc55896be1344a3401a13923989 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 29 Apr 2021 11:08:52 +0200 -Subject: [PATCH 657/834] drm/vc4: hdmi: Rely on interrupts to handle hotplug +Subject: [PATCH 633/889] drm/vc4: hdmi: Rely on interrupts to handle hotplug DRM currently polls for the HDMI connector status every 10s, which can be an issue when we connect/disconnect a display quickly or the device @@ -224729,10 +222739,10 @@ index e4bf7f34ddab..8bd32a639622 100644 2.18.4 -From 42824de8c1dfbaf6dc23b2e8d6f501be4cd64881 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 7 May 2021 15:28:21 +0200 -Subject: [PATCH 658/834] drm/vc4: hdmi: Add a workqueue to set scrambling +Subject: [PATCH 634/889] drm/vc4: hdmi: Add a workqueue to set scrambling It looks like some displays (like the LG 27UL850-W) don't enable the scrambling when the HDMI driver enables it. However, if we set later the @@ -224828,10 +222838,10 @@ index 23e8cfc22c4d..67c372d743cb 100644 2.18.4 -From 50a5263c197999c838e3f2436e0d5ec8bd083c7f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Fri, 7 May 2021 17:22:53 +0100 -Subject: [PATCH 659/834] vc4/drm: hdmi: Fix missing declaration +Subject: [PATCH 635/889] vc4/drm: hdmi: Fix missing declaration Fixes: 671a8068ee5feae1d92e6d48027fa8de062e2af2 Signed-off-by: Dom Cobley @@ -224855,10 +222865,10 @@ index b636cbcdd241..93a22bb4f6ea 100644 2.18.4 -From 0a9372d2d85bab701cc2d354830aaa8639ae5a7a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: AMuszkat Date: Sun, 28 Mar 2021 21:46:09 +0200 -Subject: [PATCH 660/834] overlays: merus-amp: remove spi override +Subject: [PATCH 636/889] overlays: merus-amp: remove spi override Signed-off-by: AMuszkat --- @@ -224888,10 +222898,10 @@ index bbffd7d26324..4501fbdc253d 100644 2.18.4 -From dce5cca04c65dd43144f05207d889804c73a2e50 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 10 May 2021 22:04:44 +0100 -Subject: [PATCH 661/834] configs: Add NF_LOG_ARP=m and NF_LOG_NETDEV=m +Subject: [PATCH 637/889] configs: Add NF_LOG_ARP=m and NF_LOG_NETDEV=m See: https://github.com/raspberrypi/linux/issues/3615 @@ -225008,10 +223018,10 @@ index c38726720f27..e10614d666dd 100644 2.18.4 -From 45d5517786700fe632f5d5f050a51a21f6586fab Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 11 May 2021 12:52:26 +0100 -Subject: [PATCH 662/834] media: i2c: ov5647: Correct pixel array offset +Subject: [PATCH 638/889] media: i2c: ov5647: Correct pixel array offset The top offset in the pixel array is actually 6 (see page 3-1 of the OV5647 data sheet). @@ -225039,10 +223049,10 @@ index 40d0d45a2481..90486b528908 100644 2.18.4 -From 17b3b961e4c88320128140b5e2c759edb6154d47 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 11 May 2021 12:57:22 +0100 -Subject: [PATCH 663/834] media: i2c: ov5647: Correct minimum VBLANK value +Subject: [PATCH 639/889] media: i2c: ov5647: Correct minimum VBLANK value Trial and error reveals that the minimum vblank value appears to be 24 (the OV5647 data sheet does not give any clues). This fixes streaming @@ -225071,10 +223081,10 @@ index 90486b528908..0437ae2d8dbe 100644 2.18.4 -From 307d4f23e3902205003b8869edb8e04a03947da4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 12 May 2021 07:39:21 +0100 -Subject: [PATCH 664/834] media: i2c: ov5647: Fix v4l2-compliance failure +Subject: [PATCH 640/889] media: i2c: ov5647: Fix v4l2-compliance failure subscribing to events Fixes the following v4l2-compliance failure: @@ -225111,10 +223121,10 @@ index 0437ae2d8dbe..98a5329d68fb 100644 2.18.4 -From e5512b17c57d2574e100e46caafde3cbf2d2e09f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 12 May 2021 16:44:11 +0100 -Subject: [PATCH 665/834] dtoverlays: Add pinctrl-names to i2c0 overlay. +Subject: [PATCH 641/889] dtoverlays: Add pinctrl-names to i2c0 overlay. Using dtoverlay=i2c0 failed to set up the pinctrl nodes as pinctrl-name = "default"; was missing from the i2c0if node. @@ -225142,10 +223152,10 @@ index 7c6771f84d8e..058f1cb76c69 100644 2.18.4 -From 94fba43996347b4dc935ac057fd61f5e2539b96f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 12 May 2021 16:47:05 +0100 -Subject: [PATCH 666/834] dtoverlays: Update /__symbols__/i2c0 from i2c0 +Subject: [PATCH 642/889] dtoverlays: Update /__symbols__/i2c0 from i2c0 overlay Update the symbol as well as the alias so that other overlays will @@ -225179,10 +223189,10 @@ index 058f1cb76c69..46bf1bf2dc5c 100644 2.18.4 -From 4a74891ac5fe12768e02a95c1ffd047b22e7eeb5 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 21 May 2020 11:49:37 +0100 -Subject: [PATCH 667/834] media: rpivid: Remove the need to have +Subject: [PATCH 643/889] media: rpivid: Remove the need to have num_entry_points set VAAPI H265 has num entry points but never sets it. Allow a VAAPI @@ -226162,10 +224172,10 @@ index e6b07920aa8c..434a366ecfc2 100644 2.18.4 -From 1b5b4eb65d32ab31235e501f87c484b4711822f6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 11 Mar 2021 12:51:00 +0000 -Subject: [PATCH 668/834] media: rpivid: Convert to MPLANE +Subject: [PATCH 644/889] media: rpivid: Convert to MPLANE Use multi-planar interface rather than single plane interface. This allows dmabufs holding compressed data to be resized. @@ -226505,10 +224515,10 @@ index 9c4f3fb2f9f6..5c0fd9c8a6d7 100644 2.18.4 -From 996f80aac3424fe795a73c06bdbb68bb385c0143 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 11 Mar 2021 18:43:15 +0000 -Subject: [PATCH 669/834] media: rpivid: Add an enable count to irq claim Qs +Subject: [PATCH 645/889] media: rpivid: Add an enable count to irq claim Qs Add an enable count to the irq Q structures to allow the irq logic to block further callbacks if resources associated with the irq are not @@ -226749,10 +224759,10 @@ index cf4cc8be8a55..ec73a2332b73 100644 2.18.4 -From 11b72af352018311b34c1c0293615dbd3d789cfc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Sun, 21 Mar 2021 16:38:54 -0300 -Subject: [PATCH 670/834] RFC: media: Add media_request_{pin,unpin} API +Subject: [PATCH 646/889] RFC: media: Add media_request_{pin,unpin} API This is probably not the API we will want to add, but it should show what semantics are needed by drivers. @@ -226851,10 +224861,10 @@ index 3cd25a2717ce..0de5c2c94188 100644 2.18.4 -From c7fe61875d9c2cec362517acf252c36dfc84c459 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 11 Mar 2021 19:08:00 +0000 -Subject: [PATCH 671/834] media: rpivid: Add a Pass0 to accumulate slices and +Subject: [PATCH 647/889] media: rpivid: Add a Pass0 to accumulate slices and rework job finish Due to overheads in assembling controls and requests it is worth having @@ -226881,10 +224891,10 @@ Signed-off-by: John Cox 6 files changed, 374 insertions(+), 131 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c -index 329dc316934e..1d41c4ea28d5 100644 +index 87729a56dda0..fb8708ddc1dc 100644 --- a/drivers/media/v4l2-core/v4l2-mem2mem.c +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c -@@ -501,8 +501,6 @@ void v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev, +@@ -492,8 +492,6 @@ void v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev, * holding capture buffers. Those should use * v4l2_m2m_buf_done_and_job_finish() instead. */ @@ -227917,289 +225927,10 @@ index ada6107ab675..396263bb352e 100644 2.18.4 -From fd77a5bf6b7aa59276e965e96c39cf1a0ff18754 Mon Sep 17 00:00:00 2001 -From: John Cox -Date: Fri, 19 Mar 2021 17:26:09 +0000 -Subject: [PATCH 672/834] Revert "media: v4l2-mem2mem: allow request job buffer - processing after job finish" - -This reverts commit 40ce8267cb747b3a4f526ac2cf2f633a273c92ae. - -Signed-off-by: John Cox ---- - drivers/media/v4l2-core/v4l2-mem2mem.c | 104 ++----------------------- - include/media/v4l2-mem2mem.h | 47 ----------- - include/media/videobuf2-v4l2.h | 3 - - 3 files changed, 6 insertions(+), 148 deletions(-) - -diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c -index 1d41c4ea28d5..fb8708ddc1dc 100644 ---- a/drivers/media/v4l2-core/v4l2-mem2mem.c -+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c -@@ -417,18 +417,15 @@ static void v4l2_m2m_cancel_job(struct v4l2_m2m_ctx *m2m_ctx) - { - struct v4l2_m2m_dev *m2m_dev; - unsigned long flags; -- bool det_abort_req; - - m2m_dev = m2m_ctx->m2m_dev; - spin_lock_irqsave(&m2m_dev->job_spinlock, flags); - -- det_abort_req = !list_empty(&m2m_ctx->det_list); - m2m_ctx->job_flags |= TRANS_ABORT; - if (m2m_ctx->job_flags & TRANS_RUNNING) { - spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags); - if (m2m_dev->m2m_ops->job_abort) - m2m_dev->m2m_ops->job_abort(m2m_ctx->priv); -- det_abort_req = false; - dprintk("m2m_ctx %p running, will wait to complete\n", m2m_ctx); - wait_event(m2m_ctx->finished, - !(m2m_ctx->job_flags & TRANS_RUNNING)); -@@ -442,11 +439,6 @@ static void v4l2_m2m_cancel_job(struct v4l2_m2m_ctx *m2m_ctx) - /* Do nothing, was not on queue/running */ - spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags); - } -- -- /* Wait for detached buffers to come back too */ -- if (det_abort_req && m2m_dev->m2m_ops->job_abort) -- m2m_dev->m2m_ops->job_abort(m2m_ctx->priv); -- wait_event(m2m_ctx->det_empty, list_empty(&m2m_ctx->det_list)); - } - - /* -@@ -484,7 +476,6 @@ static bool _v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev, - - list_del(&m2m_dev->curr_ctx->queue); - m2m_dev->curr_ctx->job_flags &= ~(TRANS_QUEUED | TRANS_RUNNING); -- m2m_ctx->cap_detached = false; - wake_up(&m2m_dev->curr_ctx->finished); - m2m_dev->curr_ctx = NULL; - return true; -@@ -510,80 +501,6 @@ void v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev, - } - EXPORT_SYMBOL(v4l2_m2m_job_finish); - --struct vb2_v4l2_buffer *_v4l2_m2m_cap_buf_detach(struct v4l2_m2m_ctx *m2m_ctx) --{ -- struct vb2_v4l2_buffer *buf; -- -- buf = v4l2_m2m_dst_buf_remove(m2m_ctx); -- list_add_tail(&container_of(buf, struct v4l2_m2m_buffer, vb)->list, -- &m2m_ctx->det_list); -- m2m_ctx->cap_detached = true; -- buf->is_held = true; -- buf->det_state = VB2_BUF_STATE_ACTIVE; -- -- return buf; --} -- --struct vb2_v4l2_buffer *v4l2_m2m_cap_buf_detach(struct v4l2_m2m_dev *m2m_dev, -- struct v4l2_m2m_ctx *m2m_ctx) --{ -- unsigned long flags; -- struct vb2_v4l2_buffer *src_buf, *dst_buf; -- -- spin_lock_irqsave(&m2m_dev->job_spinlock, flags); -- -- dst_buf = NULL; -- src_buf = v4l2_m2m_next_src_buf(m2m_ctx); -- -- if (!(src_buf->flags & V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF) && -- !m2m_ctx->cap_detached) -- dst_buf = _v4l2_m2m_cap_buf_detach(m2m_ctx); -- -- spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags); -- return dst_buf; --} --EXPORT_SYMBOL(v4l2_m2m_cap_buf_detach); -- --static void _v4l2_m2m_cap_buf_return(struct v4l2_m2m_ctx *m2m_ctx, -- struct vb2_v4l2_buffer *buf, -- enum vb2_buffer_state state) --{ -- buf->det_state = state; -- -- /* -- * Always signal done in the order we got stuff -- * Stop if we find a buf that is still in use -- */ -- while (!list_empty(&m2m_ctx->det_list)) { -- buf = &list_first_entry(&m2m_ctx->det_list, -- struct v4l2_m2m_buffer, list)->vb; -- state = buf->det_state; -- if (state != VB2_BUF_STATE_DONE && -- state != VB2_BUF_STATE_ERROR) -- return; -- list_del(&container_of(buf, struct v4l2_m2m_buffer, vb)->list); -- buf->det_state = VB2_BUF_STATE_DEQUEUED; -- v4l2_m2m_buf_done(buf, state); -- } -- wake_up(&m2m_ctx->det_empty); --} -- --void v4l2_m2m_cap_buf_return(struct v4l2_m2m_dev *m2m_dev, -- struct v4l2_m2m_ctx *m2m_ctx, -- struct vb2_v4l2_buffer *buf, -- enum vb2_buffer_state state) --{ -- unsigned long flags; -- -- if (!buf) -- return; -- -- spin_lock_irqsave(&m2m_dev->job_spinlock, flags); -- _v4l2_m2m_cap_buf_return(m2m_ctx, buf, state); -- spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags); --} --EXPORT_SYMBOL(v4l2_m2m_cap_buf_return); -- - void v4l2_m2m_buf_done_and_job_finish(struct v4l2_m2m_dev *m2m_dev, - struct v4l2_m2m_ctx *m2m_ctx, - enum vb2_buffer_state state) -@@ -594,21 +511,14 @@ void v4l2_m2m_buf_done_and_job_finish(struct v4l2_m2m_dev *m2m_dev, - - spin_lock_irqsave(&m2m_dev->job_spinlock, flags); - src_buf = v4l2_m2m_src_buf_remove(m2m_ctx); -+ dst_buf = v4l2_m2m_next_dst_buf(m2m_ctx); - -- if (WARN_ON(!src_buf)) -+ if (WARN_ON(!src_buf || !dst_buf)) - goto unlock; -- if (!m2m_ctx->cap_detached) { -- dst_buf = v4l2_m2m_next_dst_buf(m2m_ctx); -- if (WARN_ON(!dst_buf)) -- goto unlock; -- -- dst_buf->is_held = src_buf->flags -- & V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF; -- -- if (!dst_buf->is_held) { -- dst_buf = _v4l2_m2m_cap_buf_detach(m2m_ctx); -- _v4l2_m2m_cap_buf_return(m2m_ctx, dst_buf, state); -- } -+ dst_buf->is_held = src_buf->flags & V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF; -+ if (!dst_buf->is_held) { -+ v4l2_m2m_dst_buf_remove(m2m_ctx); -+ v4l2_m2m_buf_done(dst_buf, state); - } - /* - * If the request API is being used, returning the OUTPUT -@@ -1256,14 +1166,12 @@ struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(struct v4l2_m2m_dev *m2m_dev, - m2m_ctx->priv = drv_priv; - m2m_ctx->m2m_dev = m2m_dev; - init_waitqueue_head(&m2m_ctx->finished); -- init_waitqueue_head(&m2m_ctx->det_empty); - - out_q_ctx = &m2m_ctx->out_q_ctx; - cap_q_ctx = &m2m_ctx->cap_q_ctx; - - INIT_LIST_HEAD(&out_q_ctx->rdy_queue); - INIT_LIST_HEAD(&cap_q_ctx->rdy_queue); -- INIT_LIST_HEAD(&m2m_ctx->det_list); - spin_lock_init(&out_q_ctx->rdy_spinlock); - spin_lock_init(&cap_q_ctx->rdy_spinlock); - -diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h -index 8ccb17d881ad..5a91b548ecc0 100644 ---- a/include/media/v4l2-mem2mem.h -+++ b/include/media/v4l2-mem2mem.h -@@ -92,9 +92,6 @@ struct v4l2_m2m_queue_ctx { - * %TRANS_QUEUED, %TRANS_RUNNING and %TRANS_ABORT. - * @finished: Wait queue used to signalize when a job queue finished. - * @priv: Instance private data -- * @cap_detached: Current job's capture buffer has been detached -- * @det_list: List of detached (post-job but still in flight) capture buffers -- * @det_empty: Wait queue signalled when det_list goes empty - * - * The memory to memory context is specific to a file handle, NOT to e.g. - * a device. -@@ -123,11 +120,6 @@ struct v4l2_m2m_ctx { - wait_queue_head_t finished; - - void *priv; -- -- /* Detached buffer handling */ -- bool cap_detached; -- struct list_head det_list; -- wait_queue_head_t det_empty; - }; - - /** -@@ -334,45 +326,6 @@ void v4l2_m2m_suspend(struct v4l2_m2m_dev *m2m_dev); - */ - void v4l2_m2m_resume(struct v4l2_m2m_dev *m2m_dev); - --/** -- * v4l2_m2m_cap_buf_detach() - detach the capture buffer from the job and -- * return it. -- * -- * @m2m_dev: opaque pointer to the internal data to handle M2M context -- * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx -- * -- * This function is designed to be used in conjunction with -- * v4l2_m2m_buf_done_and_job_finish(). It allows the next job to start -- * execution before the capture buffer is returned to the user which can be -- * important if the underlying processing has multiple phases that are more -- * efficiently executed in parallel. -- * -- * If used then it must be called before v4l2_m2m_buf_done_and_job_finish() -- * as otherwise the buffer will have already gone. -- * -- * It is the callers reponsibilty to ensure that all detached buffers are -- * returned. -- */ --struct vb2_v4l2_buffer *v4l2_m2m_cap_buf_detach(struct v4l2_m2m_dev *m2m_dev, -- struct v4l2_m2m_ctx *m2m_ctx); -- --/** -- * v4l2_m2m_cap_buf_return() - return a capture buffer, previously detached -- * with v4l2_m2m_cap_buf_detach() to the user. -- * -- * @m2m_dev: opaque pointer to the internal data to handle M2M context -- * @m2m_ctx: m2m context assigned to the instance given by struct &v4l2_m2m_ctx -- * @buf: the buffer to return -- * @state: vb2 buffer state passed to v4l2_m2m_buf_done(). -- * -- * Buffers returned by this function will be returned to the user in the order -- * of the original jobs rather than the order in which this function is called. -- */ --void v4l2_m2m_cap_buf_return(struct v4l2_m2m_dev *m2m_dev, -- struct v4l2_m2m_ctx *m2m_ctx, -- struct vb2_v4l2_buffer *buf, -- enum vb2_buffer_state state); -- - /** - * v4l2_m2m_reqbufs() - multi-queue-aware REQBUFS multiplexer - * -diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h -index 260593fffbc8..c203047eb834 100644 ---- a/include/media/videobuf2-v4l2.h -+++ b/include/media/videobuf2-v4l2.h -@@ -37,8 +37,6 @@ struct video_device; - * @request_fd: the request_fd associated with this buffer - * @is_held: if true, then this capture buffer was held - * @planes: plane information (userptr/fd, length, bytesused, data_offset). -- * @det_state: if a detached request capture buffer then this contains its -- * current state - * - * Should contain enough information to be able to cover all the fields - * of &struct v4l2_buffer at ``videodev2.h``. -@@ -53,7 +51,6 @@ struct vb2_v4l2_buffer { - __s32 request_fd; - bool is_held; - struct vb2_plane planes[VB2_MAX_PLANES]; -- enum vb2_buffer_state det_state; - }; - - /* VB2 V4L2 flags as set in vb2_queue.subsystem_flags */ --- -2.18.4 - - -From 0854f7fbea93fc260a286e097fe6379f2564bf1b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 29 Mar 2021 17:42:16 +0100 -Subject: [PATCH 673/834] media: rpivid: Map cmd buffer directly +Subject: [PATCH 648/889] media: rpivid: Map cmd buffer directly It is unnecessary to have a separate dmabuf to hold the cmd buffer. Map it directly from the kmalloc. @@ -228366,10 +226097,10 @@ index 396263bb352e..2bb86d564b33 100644 2.18.4 -From 2f00b2ffa15bfac364e23997b9b8fb0b38d3fb25 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 1 Apr 2021 16:20:58 +0100 -Subject: [PATCH 674/834] media: rpivid: Improve values returned when setting +Subject: [PATCH 649/889] media: rpivid: Improve values returned when setting output format Guess a better value for the compressed bitstream buffer size @@ -228592,10 +226323,10 @@ index 5c0fd9c8a6d7..a3b228556497 100644 2.18.4 -From 76482fd2a4fa7d26c87268de587fa215dd41b9d0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Sat, 3 Apr 2021 16:27:03 +0100 -Subject: [PATCH 675/834] media: rpivid: Improve stream_on/off conformance & +Subject: [PATCH 650/889] media: rpivid: Improve stream_on/off conformance & clock setup Fix stream on & off such that failures leave the driver in the correct @@ -228864,10 +226595,10 @@ index 3d882a6853a5..705015890e71 100644 2.18.4 -From 1c071864a2764f8e42e731ab525da5c3ca0044e1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 8 Apr 2021 18:34:09 +0100 -Subject: [PATCH 676/834] media: rpivid: Improve SPS/PPS error +Subject: [PATCH 651/889] media: rpivid: Improve SPS/PPS error handling/validation Move size and width checking from bitstream processing to control @@ -229130,10 +226861,10 @@ index ee5a48f26912..bb280b215a2e 100644 2.18.4 -From 3cf22d803d1fb84107a1811406032409331a5dfb Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: menschel Date: Fri, 14 May 2021 14:49:29 +0200 -Subject: [PATCH 677/834] Add CAN_J1939 as module to default build configs +Subject: [PATCH 652/889] Add CAN_J1939 as module to default build configs (#4346) There is a CAN protocol named J1939 which is supported by Linux Kernel @@ -229216,10 +226947,10 @@ index e10614d666dd..f8e5eac69f34 100644 2.18.4 -From 6460743ce5679034645abe30d22b89ffd0c2bee0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mehmet Ahsen <2084476+mehmetahsen@users.noreply.github.com> Date: Fri, 21 May 2021 00:14:29 +0200 -Subject: [PATCH 678/834] overlays: add sensirion sgp30 to i2c-sensor overlay +Subject: [PATCH 653/889] overlays: add sensirion sgp30 to i2c-sensor overlay --- arch/arm/boot/dts/overlays/README | 3 +++ @@ -229280,10 +227011,10 @@ index ce97837b0db5..73c691c6a32f 2.18.4 -From e08bc61174e02bca424ee6c9c2203cbdc350ea15 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 21 May 2021 10:05:15 +0100 -Subject: [PATCH 679/834] configs: Add CONFIG_SENSIRION_SGP30=m +Subject: [PATCH 654/889] configs: Add CONFIG_SENSIRION_SGP30=m See: https://github.com/raspberrypi/linux/pull/4355 @@ -229360,10 +227091,10 @@ index f8e5eac69f34..cb052fed296b 100644 2.18.4 -From 1711c66c8f09020ea2cf5a31db154a7d57f7e417 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 21 May 2021 11:29:52 +0100 -Subject: [PATCH 680/834] overlays: Remove deleted merus-amp parameter +Subject: [PATCH 655/889] overlays: Remove deleted merus-amp parameter Signed-off-by: Phil Elwell --- @@ -229389,10 +227120,10 @@ index 2a7944054d4f..2c7f4791324f 100644 2.18.4 -From 502b77915fa0054a99e68407d65d1dccb6e176d2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 22 May 2021 08:55:29 +0100 -Subject: [PATCH 681/834] configs: Add GPIO_PCA953X_IRQ=y +Subject: [PATCH 656/889] configs: Add GPIO_PCA953X_IRQ=y Enable interrupt support for PCA953X GPIO expander. @@ -229471,10 +227202,10 @@ index cb052fed296b..869cb55cbf75 100644 2.18.4 -From 040d371344c9f639b88dacb003bdd6f101466bc1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Tue, 11 May 2021 11:51:35 +0200 -Subject: [PATCH 682/834] overlays: add bh1750 and ccs811 to i2c-sensor (#4334) +Subject: [PATCH 657/889] overlays: add bh1750 and ccs811 to i2c-sensor (#4334) See: https://github.com/raspberrypi/linux/pull/4334 --- @@ -229575,10 +227306,10 @@ index 73c691c6a32f..b05b0fa91942 100755 2.18.4 -From 2fd6f875ed40cd2f0fb462b4c876b3c9c9245c5c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Tue, 11 May 2021 11:51:59 +0200 -Subject: [PATCH 683/834] configs: add bh1750 and ccs811 to configs (#4334) +Subject: [PATCH 658/889] configs: add bh1750 and ccs811 to configs (#4334) See: https://github.com/raspberrypi/linux/pull/4334 --- @@ -229691,10 +227422,10 @@ index 869cb55cbf75..3200cc4c7225 100644 2.18.4 -From c5faa5c6774b239210833e9b6ee54384a3dd3fb0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 2 Dec 2019 14:48:05 +0000 -Subject: [PATCH 684/834] Add Raspberry Pi PoE+ HAT support +Subject: [PATCH 659/889] Add Raspberry Pi PoE+ HAT support Signed-off-by: Serge Schneider --- @@ -230083,7 +227814,7 @@ index 000000000000..0c96b2c1e8ab +MODULE_DESCRIPTION("Raspberry Pi PoE+ HAT power supply driver"); +MODULE_LICENSE("GPL"); diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h -index 6b393bbe7f52..97ff2a59aa03 100644 +index e3daf5ee4a9c..86b36c9327e9 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -94,7 +94,8 @@ enum rpi_firmware_property_tag { @@ -230100,10 +227831,10 @@ index 6b393bbe7f52..97ff2a59aa03 100644 2.18.4 -From 8f8fb8697126839cbd3d11f14be73a769ab580d4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 2 Dec 2019 14:48:05 +0000 -Subject: [PATCH 685/834] configs: Enable Raspberry Pi PoE+ HAT support +Subject: [PATCH 660/889] configs: Enable Raspberry Pi PoE+ HAT support Signed-off-by: Serge Schneider --- @@ -230178,10 +227909,10 @@ index 3200cc4c7225..10243e0e0658 100644 2.18.4 -From bb6d97c01aea942b6c37e182bfde2bdbaeffd763 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 2 Dec 2019 14:48:05 +0000 -Subject: [PATCH 686/834] overlays: Add rpi-poe-plus overlay +Subject: [PATCH 661/889] overlays: Add rpi-poe-plus overlay Signed-off-by: Serge Schneider --- @@ -230264,10 +227995,10 @@ index 000000000000..e0138847093b 2.18.4 -From 8f22e51217f65abe348ca28cd2284b351db66437 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 21 May 2021 11:15:04 +0100 -Subject: [PATCH 687/834] drm/vc4: FKMS: Change of Broadcast RGB mode needs a +Subject: [PATCH 662/889] drm/vc4: FKMS: Change of Broadcast RGB mode needs a mode change The Broadcast RGB (aka HDMI limited/full range) property is only @@ -230332,10 +228063,10 @@ index 44b1addeb22e..e643bbe96941 100644 2.18.4 -From dcdaee9ee2d993e8b61940bc94dfb933c86b3714 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Alex Kurichenko Date: Tue, 1 Jun 2021 01:53:47 +0300 -Subject: [PATCH 688/834] overlays: Add ssd1331-spi support for OLED screen +Subject: [PATCH 663/889] overlays: Add ssd1331-spi support for OLED screen Signed-off-by: Alex Kurichenko --- @@ -230472,10 +228203,10 @@ index 000000000000..9fd5ebf2feda 2.18.4 -From 3a4675a5ef3392fc382647bcf8cb32f28a782521 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joerg Schambacher Date: Thu, 10 Jun 2021 13:14:05 +0200 -Subject: [PATCH 689/834] Fixes an onboard clock detection problem of the PRO +Subject: [PATCH 664/889] Fixes an onboard clock detection problem of the PRO versions Increasing the sleep time after clock selection to 3-4ms @@ -230518,10 +228249,10 @@ index 8b04d30bcbee..79eccdb4dc8c 100644 2.18.4 -From c86a7c88a7c440dae5d64e4c431b57a091c7a02a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: jc-kynesim Date: Fri, 11 Jun 2021 15:14:31 +0100 -Subject: [PATCH 690/834] bcm2835: Allow compressed frames to set sizeimage +Subject: [PATCH 665/889] bcm2835: Allow compressed frames to set sizeimage (#4386) Allow the user to set sizeimage in TRY_FMT and S_FMT if the format @@ -230571,10 +228302,10 @@ index a97666a1a4be..c3ba5c25a2ab 100644 2.18.4 -From a62fb88751ef5f190368b42a066f143360642d0d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 11 Jun 2021 12:47:07 +0100 -Subject: [PATCH 691/834] media: i2c: imx477: Fix for long exposure limit +Subject: [PATCH 666/889] media: i2c: imx477: Fix for long exposure limit calculations Do not scale IMX477_EXPOSURE_OFFSET with the long exposure factor during @@ -230603,10 +228334,10 @@ index 34bfd22cadc6..b06add219cb4 100644 2.18.4 -From f0c36e8a27417f86f93d0ffc749ea2203c5af01c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 14 Jun 2021 15:07:38 +0100 -Subject: [PATCH 692/834] overlays: ghost-amp: Change early-disable sequence +Subject: [PATCH 667/889] overlays: ghost-amp: Change early-disable sequence In the event that the ENABLE signal from the codec goes low before RELAY2 has been enabled, wait until the full 1000ms has elapsed then @@ -230652,178 +228383,10 @@ index dbedb4b76c74..7509e00679c8 100644 2.18.4 -From bdc4a48f70b3db3f9cf35738e7863780858407c2 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Mon, 31 May 2021 17:52:24 +0200 -Subject: [PATCH 693/834] drm: Introduce new state accessors in place of - drm_atomic_get_crtc_state - -drm_atomic_get_crtc_state relies on drm_atomic_get_existing_crtc_state -that is deprecated and isn't really clear on which state it provides. - -Even worse, after the states have been swapped, if the CRTC is present -in the state drm_atomic_get_existing_crtc_state will return the old -state, whereas if the CRTC is not present, we'll use a copy of -crtc->state. crtc->state for the CRTC that is there at that point is the new -state though, which leads to confusion. - -Let's provide two new helpers that make it clear what our expectations -are. - -Signed-off-by: Maxime Ripard ---- - drivers/gpu/drm/drm_atomic.c | 104 +++++++++++++++++++++++++++++++++++ - include/drm/drm_atomic.h | 7 +++ - 2 files changed, 111 insertions(+) - -diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c -index 58527f151984..22a97d786d58 100644 ---- a/drivers/gpu/drm/drm_atomic.c -+++ b/drivers/gpu/drm/drm_atomic.c -@@ -281,6 +281,10 @@ EXPORT_SYMBOL(__drm_atomic_state_free); - * needed. It will also grab the relevant CRTC lock to make sure that the state - * is consistent. - * -+ * This function is deprecated, -+ * @drm_atomic_get_old_or_current_crtc_state or -+ * @drm_atomic_get_new_or_current_crtc_state should be used instead. -+ * - * Returns: - * - * Either the allocated state or the error code encoded into the pointer. When -@@ -321,6 +325,106 @@ drm_atomic_get_crtc_state(struct drm_atomic_state *state, - } - EXPORT_SYMBOL(drm_atomic_get_crtc_state); - -+/** -+ * drm_atomic_get_old_or_current_crtc_state - get CRTC state -+ * @state: global atomic state object -+ * @crtc: CRTC to get state object for -+ * -+ * This function returns the old CRTC state for the given CRTC if it's -+ * part of the state, or allocating a copy of the current state -+ * otherwise. It will also grab the relevant CRTC lock to make sure that -+ * the state is consistent. -+ * -+ * Returns: -+ * -+ * Either the allocated state or the error code encoded into the pointer. When -+ * the error is EDEADLK then the w/w mutex code has detected a deadlock and the -+ * entire atomic sequence must be restarted. All other errors are fatal. -+ */ -+struct drm_crtc_state * -+drm_atomic_get_old_or_current_crtc_state(struct drm_atomic_state *state, -+ struct drm_crtc *crtc) -+{ -+ int ret, index = drm_crtc_index(crtc); -+ struct drm_crtc_state *crtc_state; -+ -+ WARN_ON(!state->acquire_ctx); -+ -+ crtc_state = drm_atomic_get_old_crtc_state(state, crtc); -+ if (crtc_state) -+ return crtc_state; -+ -+ ret = drm_modeset_lock(&crtc->mutex, state->acquire_ctx); -+ if (ret) -+ return ERR_PTR(ret); -+ -+ crtc_state = crtc->funcs->atomic_duplicate_state(crtc); -+ if (!crtc_state) -+ return ERR_PTR(-ENOMEM); -+ -+ state->crtcs[index].state = crtc_state; -+ state->crtcs[index].old_state = crtc->state; -+ state->crtcs[index].new_state = crtc_state; -+ state->crtcs[index].ptr = crtc; -+ crtc_state->state = state; -+ -+ DRM_DEBUG_ATOMIC("Added [CRTC:%d:%s] %p state to %p\n", -+ crtc->base.id, crtc->name, crtc_state, state); -+ -+ return crtc_state; -+} -+EXPORT_SYMBOL(drm_atomic_get_old_or_current_crtc_state); -+ -+/** -+ * drm_atomic_get_new_or_current_crtc_state - get CRTC state -+ * @state: global atomic state object -+ * @crtc: CRTC to get state object for -+ * -+ * This function returns the new CRTC state for the given CRTC if it's -+ * part of the state, or allocating a copy of the current state -+ * otherwise. It will also grab the relevant CRTC lock to make sure that -+ * the state is consistent. -+ * -+ * Returns: -+ * -+ * Either the allocated state or the error code encoded into the pointer. When -+ * the error is EDEADLK then the w/w mutex code has detected a deadlock and the -+ * entire atomic sequence must be restarted. All other errors are fatal. -+ */ -+struct drm_crtc_state * -+drm_atomic_get_new_or_current_crtc_state(struct drm_atomic_state *state, -+ struct drm_crtc *crtc) -+{ -+ int ret, index = drm_crtc_index(crtc); -+ struct drm_crtc_state *crtc_state; -+ -+ WARN_ON(!state->acquire_ctx); -+ -+ crtc_state = drm_atomic_get_new_crtc_state(state, crtc); -+ if (crtc_state) -+ return crtc_state; -+ -+ ret = drm_modeset_lock(&crtc->mutex, state->acquire_ctx); -+ if (ret) -+ return ERR_PTR(ret); -+ -+ crtc_state = crtc->funcs->atomic_duplicate_state(crtc); -+ if (!crtc_state) -+ return ERR_PTR(-ENOMEM); -+ -+ state->crtcs[index].state = crtc_state; -+ state->crtcs[index].old_state = crtc->state; -+ state->crtcs[index].new_state = crtc_state; -+ state->crtcs[index].ptr = crtc; -+ crtc_state->state = state; -+ -+ DRM_DEBUG_ATOMIC("Added [CRTC:%d:%s] %p state to %p\n", -+ crtc->base.id, crtc->name, crtc_state, state); -+ -+ return crtc_state; -+} -+EXPORT_SYMBOL(drm_atomic_get_new_or_current_crtc_state); -+ - static int drm_atomic_crtc_check(const struct drm_crtc_state *old_crtc_state, - const struct drm_crtc_state *new_crtc_state) - { -diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h -index d07c851d255b..feec1676fc03 100644 ---- a/include/drm/drm_atomic.h -+++ b/include/drm/drm_atomic.h -@@ -445,6 +445,13 @@ void drm_atomic_state_default_release(struct drm_atomic_state *state); - struct drm_crtc_state * __must_check - drm_atomic_get_crtc_state(struct drm_atomic_state *state, - struct drm_crtc *crtc); -+struct drm_crtc_state * __must_check -+drm_atomic_get_new_or_current_crtc_state(struct drm_atomic_state *state, -+ struct drm_crtc *crtc); -+struct drm_crtc_state * __must_check -+drm_atomic_get_old_or_current_crtc_state(struct drm_atomic_state *state, -+ struct drm_crtc *crtc); -+ - struct drm_plane_state * __must_check - drm_atomic_get_plane_state(struct drm_atomic_state *state, - struct drm_plane *plane); --- -2.18.4 - - -From a2c7be6a856d32592c3da09282d134689eb16681 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 26 May 2021 16:07:01 +0200 -Subject: [PATCH 694/834] drm/vc4: Make vc4_crtc_get_encoder public +Subject: [PATCH 668/889] drm/vc4: Make vc4_crtc_get_encoder public We'll need that function in vc4_kms to compute the core clock rate requirements. @@ -230873,199 +228436,10 @@ index ca435d24b7dc..96cc262cb174 100644 2.18.4 -From 93074386f064a9a28f9d5ea0cea4720f1c8158bc Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Wed, 26 May 2021 16:13:02 +0200 -Subject: [PATCH 695/834] drm/vc4: Increase the core clock based on HVS load - -Depending on a given HVS output (HVS to PixelValves) and input (planes -attached to a channel) load, the HVS needs for the core clock to be -raised above its boot time default. - -Failing to do so will result in a vblank timeout and a stalled display -pipeline. - -Signed-off-by: Maxime Ripard ---- - drivers/gpu/drm/vc4/vc4_drv.h | 1 + - drivers/gpu/drm/vc4/vc4_kms.c | 127 +++++++++++++++++++++++++++++++++- - 2 files changed, 126 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 96cc262cb174..4a652ecd2920 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -329,6 +329,7 @@ struct vc4_hvs { - u32 __iomem *dlist; - - struct clk *core_clk; -+ struct clk_request *core_req; - - /* Memory manager for CRTCs to allocate space in the display - * list. Units are dwords. -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 48e3dc11c493..962d3f4397ae 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -305,6 +305,106 @@ static void vc5_hvs_pv_muxing_commit(struct vc4_dev *vc4, - } - } - -+#define HVS_BUS_WIDTH 4 -+ -+/* -+ * On the BCM2711, the core clock needs to be raised depending on the -+ * rate of pixels being fetched from memory by the HVS and then the -+ * pixels being output to the PixelValves. -+ * -+ * Thus, we need to consider the mode on each CRTC to compute the output -+ * pixel rate, and all the planes attached to those CRTCs to compute the -+ * input rate, and take the highest of the two. -+ */ -+static unsigned long vc5_hvs_compute_core_rate(struct vc4_dev *vc4, -+ struct drm_atomic_state *state) -+{ -+ struct drm_crtc *crtc; -+ unsigned long cob_rate = 0; -+ unsigned long pixel_rate = 0; -+ unsigned num_outputs = 0; -+ -+ drm_for_each_crtc(crtc, state->dev) { -+ const struct drm_display_mode *mode; -+ struct drm_crtc_state *crtc_state; -+ struct vc4_encoder *vc4_encoder; -+ struct drm_encoder *encoder; -+ struct drm_plane *plane; -+ unsigned long min_rate; -+ unsigned refresh; -+ -+ crtc_state = drm_atomic_get_new_or_current_crtc_state(state, crtc); -+ if (!crtc_state) -+ continue; -+ -+ if (!crtc_state->active) -+ continue; -+ -+ mode = &crtc_state->adjusted_mode; -+ encoder = vc4_get_crtc_encoder(crtc, state, -+ drm_atomic_get_connector_state); -+ if (!encoder) -+ continue; -+ -+ num_outputs++; -+ vc4_encoder = to_vc4_encoder(encoder); -+ -+ /* -+ * The HVS only generates the active pixels and stores -+ * completed lines in the COB. However, pixel-valve -+ * consumes at the HDMI pixel clock rate which can be a -+ * lot higher than the number of active pixels e.g. 4K -+ * p60 is 594 MHz but active pixels would be 498 MHz. -+ * The COB output is one pixel per clock and runs of the -+ * the core clock and needs to run fast enough to send -+ * the active pixels minus the buffering in pixel-valve. -+ * -+ * For PV2 (HDMI0) there are 512 pixels and for PV4 -+ * (HDMI1) there are 58. This means that for HDMI1 the -+ * core-clock needs to be the same as the pixel clock -+ * but for HDMI0 the core-clock can be a bit slower - -+ * experiments suggest that 90% is about right so long -+ * as the horizontal blanking period is at least 10% of -+ * the total horizonal time, this isn't always in the -+ * case. -+ */ -+ if (vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0) { -+ min_rate = max(mode->clock * mode->hdisplay / mode->htotal + 1000, -+ mode->clock * 9 / 10) * 1000; -+ } else { -+ min_rate = mode->clock * 1000; -+ } -+ cob_rate = max(cob_rate, min_rate); -+ -+ refresh = drm_mode_vrefresh(mode); -+ drm_for_each_plane_mask(plane, state->dev, crtc_state->plane_mask) { -+ struct drm_plane_state *plane_state = -+ drm_atomic_get_plane_state(state, plane); -+ unsigned height, width; -+ -+ if (!plane_state->fb) -+ continue; -+ -+ height = plane_state->src_h >> 16; -+ width = plane_state->src_w >> 16; -+ -+ pixel_rate += height * width * refresh; -+ } -+ } -+ -+ /* -+ * We need to target a memory bus load of 60% if we have a -+ * single HVS channel enabled, and 40% otherwise. -+ */ -+ if (num_outputs > 1) -+ pixel_rate = pixel_rate / 40; -+ else -+ pixel_rate = pixel_rate / 60; -+ pixel_rate = pixel_rate * 100; -+ -+ return max(cob_rate, pixel_rate / HVS_BUS_WIDTH); -+} -+ - static void - vc4_atomic_complete_commit(struct drm_atomic_state *state) - { -@@ -326,9 +426,20 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - vc4_hvs_mask_underrun(dev, vc4_crtc_state->assigned_channel); - } - -- if (vc4->hvs && vc4->hvs->hvs5) -+ if (vc4->hvs && vc4->hvs->hvs5) { -+ /* -+ * Do a temporary request on the core clock during the -+ * modeset. -+ */ - core_req = clk_request_start(hvs->core_clk, 500000000); - -+ /* -+ * And remove the previous one based on the HVS -+ * requirements if any. -+ */ -+ clk_request_done(hvs->core_req); -+ } -+ - drm_atomic_helper_wait_for_fences(dev, state, false); - - drm_atomic_helper_wait_for_dependencies(state); -@@ -358,8 +469,20 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - - drm_atomic_helper_commit_cleanup_done(state); - -- if (vc4->hvs && vc4->hvs->hvs5) -+ if (vc4->hvs && vc4->hvs->hvs5) { -+ unsigned long core_rate = vc5_hvs_compute_core_rate(vc4, -+ state); -+ -+ /* -+ * Request a clock rate based on the current HVS -+ * requirements. -+ */ -+ hvs->core_req = clk_request_start(hvs->core_clk, -+ core_rate); -+ -+ /* And drop the temporary request */ - clk_request_done(core_req); -+ } - - drm_atomic_state_put(state); - --- -2.18.4 - - -From 22038e7861331f8c772613ba25d81a19397992b7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Sia Jee Heng Date: Thu, 4 Feb 2021 09:42:55 +0800 -Subject: [PATCH 696/834] ASoC: codec: hdmi-codec: Support IEC958 encoded PCM +Subject: [PATCH 669/889] ASoC: codec: hdmi-codec: Support IEC958 encoded PCM format Existing hdmi-codec driver only support standard pcm format. @@ -231123,10 +228497,10 @@ index 403d4c6a49a8..e071add934b7 100644 2.18.4 -From cdea0c58c7069f1dc642ea72b1277b4f606573d0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 28 Apr 2021 11:56:26 +0200 -Subject: [PATCH 697/834] ASoC: hdmi-codec: Rework to support more controls +Subject: [PATCH 670/889] ASoC: hdmi-codec: Rework to support more controls We're going to add more controls to support the IEC958 output, so let's rework the control registration a bit to support more of them. @@ -231205,10 +228579,10 @@ index e071add934b7..f0cd210704e2 100644 2.18.4 -From 0f794be5b9c3046fdcc2b532704ccc24d9692693 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 28 Apr 2021 15:29:13 +0200 -Subject: [PATCH 698/834] snd: iec958: split status creation and fill +Subject: [PATCH 671/889] snd: iec958: split status creation and fill In some situations, like a codec probe, we need to provide an IEC status default but don't have access to the sampling rate and width yet since @@ -231422,10 +228796,10 @@ index f9a211cc1f2c..a60908efe159 100644 2.18.4 -From 08af9552f05a62ffac731e80578629ce77db7933 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 28 Apr 2021 15:29:51 +0200 -Subject: [PATCH 699/834] ASoC: hdmi-codec: Add iec958 controls +Subject: [PATCH 672/889] ASoC: hdmi-codec: Add iec958 controls Signed-off-by: Maxime Ripard --- @@ -231541,10 +228915,10 @@ index f0cd210704e2..1320a9af9d35 100644 2.18.4 -From 09dbd75774b34cb50bdca4c8a5ff2f912e9e4c48 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 30 Apr 2021 14:22:06 +0200 -Subject: [PATCH 700/834] ASoC: hdmi-codec: Add a prepare hook +Subject: [PATCH 673/889] ASoC: hdmi-codec: Add a prepare hook The IEC958 status bit is usually set by the userspace after hw_params has been called, so in order to use whatever is set by the userspace, we @@ -231750,10 +229124,10 @@ index 1320a9af9d35..b9e96d7ed00b 100644 2.18.4 -From 2688f5333308f836eafa60fd6a2662ab88a2de67 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 26 Apr 2021 14:42:26 +0200 -Subject: [PATCH 701/834] drm/vc4: Register HDMI codec +Subject: [PATCH 674/889] drm/vc4: Register HDMI codec The hdmi-codec brings a lot of advanced features, including the HDMI channel mapping. Let's use it in our driver instead of our own codec. @@ -232660,10 +230034,10 @@ index 67c372d743cb..b91b0257dde2 100644 2.18.4 -From 546ef679d7342d6897b595dee27f6405f7a6823f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 27 Apr 2021 16:26:39 +0200 -Subject: [PATCH 702/834] drm/vc4: hdmi: Remove redundant variables +Subject: [PATCH 675/889] drm/vc4: hdmi: Remove redundant variables Signed-off-by: Maxime Ripard --- @@ -232782,10 +230156,10 @@ index b91b0257dde2..295962d83741 100644 2.18.4 -From d080d65284ef0c34e3c906eaad760f61c13e44dc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 28 Apr 2021 16:10:02 +0200 -Subject: [PATCH 703/834] ARM: dts: bcm2711: Tune DMA parameters for HDMI audio +Subject: [PATCH 676/889] ARM: dts: bcm2711: Tune DMA parameters for HDMI audio Enable NO_WAIT_RESP, DMA_WIDE_SOURCE, DMA_WIDE_DEST, and bump the DMA panic and AXI priorities to avoid any DMA transfer error with HBR audio @@ -232823,10 +230197,10 @@ index 2604ccfb6a6b..c6b496f364c3 100644 2.18.4 -From 4a827e9c0565f30681b04bcf59cab23dfd73a534 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 16 Jun 2021 17:44:04 +0100 -Subject: [PATCH 704/834] configs: Enable Anbox support on arm64 builds +Subject: [PATCH 677/889] configs: Enable Anbox support on arm64 builds In order to allow containerised Android apps to run, add the following config settings on 64-bit builds: @@ -232895,10 +230269,10 @@ index 10243e0e0658..8a2c42e5d73b 100644 2.18.4 -From 375d233f4f8943564b1748cf33c70040ef3abce7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: davidschillerJKU Date: Thu, 17 Jun 2021 09:55:45 +0200 -Subject: [PATCH 705/834] configs: add CONFIG_IR_TOY=m +Subject: [PATCH 678/889] configs: add CONFIG_IR_TOY=m This enables support for the Infrared Toy / Irdroid series of infrared transceivers @@ -232974,10 +230348,10 @@ index 8a2c42e5d73b..456b3000e6d6 100644 2.18.4 -From 1a6a73508a836c72d92ef8ef685e1164277c5b9b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 27 Nov 2017 17:14:54 +0000 -Subject: [PATCH 706/834] cgroup: Disable cgroup "memory" by default +Subject: [PATCH 679/889] cgroup: Disable cgroup "memory" by default Some Raspberry Pis have limited RAM and most users won't use the cgroup memory support so it is disabled by default. Enable with: @@ -233065,10 +230439,10 @@ index c8b811e039cc..b4ada2e9f499 100644 2.18.4 -From e3d734214e722429eb750ecb2767f0227b831432 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Jun 2021 12:05:25 +0100 -Subject: [PATCH 707/834] media: i2c: imx290: Support 60fps in 2 lane operation +Subject: [PATCH 680/889] media: i2c: imx290: Support 60fps in 2 lane operation Commit "97589ad61c73 media: i2c: imx290: Add support for 2 data lanes" added support for running in two lane mode (instead of 4), but @@ -233380,10 +230754,10 @@ index 255f66985306..d2e7360712f5 100644 2.18.4 -From 85c412422c27b0a2b14853c2bd317dfa377408cc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Jun 2021 13:00:39 +0100 -Subject: [PATCH 708/834] media: i2c: imx290: Fix the pixel rate at 148.5Mpix/s +Subject: [PATCH 681/889] media: i2c: imx290: Fix the pixel rate at 148.5Mpix/s Whilst the datasheet lists the link frequency changing between 1080p and 720p modes, reality is that with the default blanking @@ -233435,10 +230809,10 @@ index d2e7360712f5..f13a0dd66351 100644 2.18.4 -From db2e02a4d28fca16c82a6330ae020d58f446ff17 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Jun 2021 17:27:46 +0100 -Subject: [PATCH 709/834] media: i2c: imx290: Fix clock setup register +Subject: [PATCH 682/889] media: i2c: imx290: Fix clock setup register assignments When the clock setups were added for the alternate external clocks, @@ -233490,349 +230864,10 @@ index f13a0dd66351..24a7dee571cd 100644 2.18.4 -From 6b35c342c40006c06748c7a0013340723cb92ddd Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Mon, 21 Jun 2021 17:29:22 +0200 -Subject: [PATCH 710/834] Revert "drm/vc4: Increase the core clock based on HVS - load" - -This reverts commit 1c3834201272ba6ae214af5f57acf0ece55142a5. ---- - drivers/gpu/drm/vc4/vc4_drv.h | 1 - - drivers/gpu/drm/vc4/vc4_kms.c | 127 +--------------------------------- - 2 files changed, 2 insertions(+), 126 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 4a652ecd2920..96cc262cb174 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -329,7 +329,6 @@ struct vc4_hvs { - u32 __iomem *dlist; - - struct clk *core_clk; -- struct clk_request *core_req; - - /* Memory manager for CRTCs to allocate space in the display - * list. Units are dwords. -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 962d3f4397ae..48e3dc11c493 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -305,106 +305,6 @@ static void vc5_hvs_pv_muxing_commit(struct vc4_dev *vc4, - } - } - --#define HVS_BUS_WIDTH 4 -- --/* -- * On the BCM2711, the core clock needs to be raised depending on the -- * rate of pixels being fetched from memory by the HVS and then the -- * pixels being output to the PixelValves. -- * -- * Thus, we need to consider the mode on each CRTC to compute the output -- * pixel rate, and all the planes attached to those CRTCs to compute the -- * input rate, and take the highest of the two. -- */ --static unsigned long vc5_hvs_compute_core_rate(struct vc4_dev *vc4, -- struct drm_atomic_state *state) --{ -- struct drm_crtc *crtc; -- unsigned long cob_rate = 0; -- unsigned long pixel_rate = 0; -- unsigned num_outputs = 0; -- -- drm_for_each_crtc(crtc, state->dev) { -- const struct drm_display_mode *mode; -- struct drm_crtc_state *crtc_state; -- struct vc4_encoder *vc4_encoder; -- struct drm_encoder *encoder; -- struct drm_plane *plane; -- unsigned long min_rate; -- unsigned refresh; -- -- crtc_state = drm_atomic_get_new_or_current_crtc_state(state, crtc); -- if (!crtc_state) -- continue; -- -- if (!crtc_state->active) -- continue; -- -- mode = &crtc_state->adjusted_mode; -- encoder = vc4_get_crtc_encoder(crtc, state, -- drm_atomic_get_connector_state); -- if (!encoder) -- continue; -- -- num_outputs++; -- vc4_encoder = to_vc4_encoder(encoder); -- -- /* -- * The HVS only generates the active pixels and stores -- * completed lines in the COB. However, pixel-valve -- * consumes at the HDMI pixel clock rate which can be a -- * lot higher than the number of active pixels e.g. 4K -- * p60 is 594 MHz but active pixels would be 498 MHz. -- * The COB output is one pixel per clock and runs of the -- * the core clock and needs to run fast enough to send -- * the active pixels minus the buffering in pixel-valve. -- * -- * For PV2 (HDMI0) there are 512 pixels and for PV4 -- * (HDMI1) there are 58. This means that for HDMI1 the -- * core-clock needs to be the same as the pixel clock -- * but for HDMI0 the core-clock can be a bit slower - -- * experiments suggest that 90% is about right so long -- * as the horizontal blanking period is at least 10% of -- * the total horizonal time, this isn't always in the -- * case. -- */ -- if (vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0) { -- min_rate = max(mode->clock * mode->hdisplay / mode->htotal + 1000, -- mode->clock * 9 / 10) * 1000; -- } else { -- min_rate = mode->clock * 1000; -- } -- cob_rate = max(cob_rate, min_rate); -- -- refresh = drm_mode_vrefresh(mode); -- drm_for_each_plane_mask(plane, state->dev, crtc_state->plane_mask) { -- struct drm_plane_state *plane_state = -- drm_atomic_get_plane_state(state, plane); -- unsigned height, width; -- -- if (!plane_state->fb) -- continue; -- -- height = plane_state->src_h >> 16; -- width = plane_state->src_w >> 16; -- -- pixel_rate += height * width * refresh; -- } -- } -- -- /* -- * We need to target a memory bus load of 60% if we have a -- * single HVS channel enabled, and 40% otherwise. -- */ -- if (num_outputs > 1) -- pixel_rate = pixel_rate / 40; -- else -- pixel_rate = pixel_rate / 60; -- pixel_rate = pixel_rate * 100; -- -- return max(cob_rate, pixel_rate / HVS_BUS_WIDTH); --} -- - static void - vc4_atomic_complete_commit(struct drm_atomic_state *state) - { -@@ -426,20 +326,9 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - vc4_hvs_mask_underrun(dev, vc4_crtc_state->assigned_channel); - } - -- if (vc4->hvs && vc4->hvs->hvs5) { -- /* -- * Do a temporary request on the core clock during the -- * modeset. -- */ -+ if (vc4->hvs && vc4->hvs->hvs5) - core_req = clk_request_start(hvs->core_clk, 500000000); - -- /* -- * And remove the previous one based on the HVS -- * requirements if any. -- */ -- clk_request_done(hvs->core_req); -- } -- - drm_atomic_helper_wait_for_fences(dev, state, false); - - drm_atomic_helper_wait_for_dependencies(state); -@@ -469,20 +358,8 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - - drm_atomic_helper_commit_cleanup_done(state); - -- if (vc4->hvs && vc4->hvs->hvs5) { -- unsigned long core_rate = vc5_hvs_compute_core_rate(vc4, -- state); -- -- /* -- * Request a clock rate based on the current HVS -- * requirements. -- */ -- hvs->core_req = clk_request_start(hvs->core_clk, -- core_rate); -- -- /* And drop the temporary request */ -+ if (vc4->hvs && vc4->hvs->hvs5) - clk_request_done(core_req); -- } - - drm_atomic_state_put(state); - --- -2.18.4 - - -From 428d91dc3d6ce68937e2ed1a1aa63cee5ecdd9cb Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Wed, 23 Jun 2021 10:57:22 +0200 -Subject: [PATCH 711/834] Revert "drm: Introduce new state accessors in place - of drm_atomic_get_crtc_state" - -This reverts commit 040d0dd82dbfad11984b696e35beb56906f8f4a7. ---- - drivers/gpu/drm/drm_atomic.c | 104 ----------------------------------- - include/drm/drm_atomic.h | 7 --- - 2 files changed, 111 deletions(-) - -diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c -index 22a97d786d58..58527f151984 100644 ---- a/drivers/gpu/drm/drm_atomic.c -+++ b/drivers/gpu/drm/drm_atomic.c -@@ -281,10 +281,6 @@ EXPORT_SYMBOL(__drm_atomic_state_free); - * needed. It will also grab the relevant CRTC lock to make sure that the state - * is consistent. - * -- * This function is deprecated, -- * @drm_atomic_get_old_or_current_crtc_state or -- * @drm_atomic_get_new_or_current_crtc_state should be used instead. -- * - * Returns: - * - * Either the allocated state or the error code encoded into the pointer. When -@@ -325,106 +321,6 @@ drm_atomic_get_crtc_state(struct drm_atomic_state *state, - } - EXPORT_SYMBOL(drm_atomic_get_crtc_state); - --/** -- * drm_atomic_get_old_or_current_crtc_state - get CRTC state -- * @state: global atomic state object -- * @crtc: CRTC to get state object for -- * -- * This function returns the old CRTC state for the given CRTC if it's -- * part of the state, or allocating a copy of the current state -- * otherwise. It will also grab the relevant CRTC lock to make sure that -- * the state is consistent. -- * -- * Returns: -- * -- * Either the allocated state or the error code encoded into the pointer. When -- * the error is EDEADLK then the w/w mutex code has detected a deadlock and the -- * entire atomic sequence must be restarted. All other errors are fatal. -- */ --struct drm_crtc_state * --drm_atomic_get_old_or_current_crtc_state(struct drm_atomic_state *state, -- struct drm_crtc *crtc) --{ -- int ret, index = drm_crtc_index(crtc); -- struct drm_crtc_state *crtc_state; -- -- WARN_ON(!state->acquire_ctx); -- -- crtc_state = drm_atomic_get_old_crtc_state(state, crtc); -- if (crtc_state) -- return crtc_state; -- -- ret = drm_modeset_lock(&crtc->mutex, state->acquire_ctx); -- if (ret) -- return ERR_PTR(ret); -- -- crtc_state = crtc->funcs->atomic_duplicate_state(crtc); -- if (!crtc_state) -- return ERR_PTR(-ENOMEM); -- -- state->crtcs[index].state = crtc_state; -- state->crtcs[index].old_state = crtc->state; -- state->crtcs[index].new_state = crtc_state; -- state->crtcs[index].ptr = crtc; -- crtc_state->state = state; -- -- DRM_DEBUG_ATOMIC("Added [CRTC:%d:%s] %p state to %p\n", -- crtc->base.id, crtc->name, crtc_state, state); -- -- return crtc_state; --} --EXPORT_SYMBOL(drm_atomic_get_old_or_current_crtc_state); -- --/** -- * drm_atomic_get_new_or_current_crtc_state - get CRTC state -- * @state: global atomic state object -- * @crtc: CRTC to get state object for -- * -- * This function returns the new CRTC state for the given CRTC if it's -- * part of the state, or allocating a copy of the current state -- * otherwise. It will also grab the relevant CRTC lock to make sure that -- * the state is consistent. -- * -- * Returns: -- * -- * Either the allocated state or the error code encoded into the pointer. When -- * the error is EDEADLK then the w/w mutex code has detected a deadlock and the -- * entire atomic sequence must be restarted. All other errors are fatal. -- */ --struct drm_crtc_state * --drm_atomic_get_new_or_current_crtc_state(struct drm_atomic_state *state, -- struct drm_crtc *crtc) --{ -- int ret, index = drm_crtc_index(crtc); -- struct drm_crtc_state *crtc_state; -- -- WARN_ON(!state->acquire_ctx); -- -- crtc_state = drm_atomic_get_new_crtc_state(state, crtc); -- if (crtc_state) -- return crtc_state; -- -- ret = drm_modeset_lock(&crtc->mutex, state->acquire_ctx); -- if (ret) -- return ERR_PTR(ret); -- -- crtc_state = crtc->funcs->atomic_duplicate_state(crtc); -- if (!crtc_state) -- return ERR_PTR(-ENOMEM); -- -- state->crtcs[index].state = crtc_state; -- state->crtcs[index].old_state = crtc->state; -- state->crtcs[index].new_state = crtc_state; -- state->crtcs[index].ptr = crtc; -- crtc_state->state = state; -- -- DRM_DEBUG_ATOMIC("Added [CRTC:%d:%s] %p state to %p\n", -- crtc->base.id, crtc->name, crtc_state, state); -- -- return crtc_state; --} --EXPORT_SYMBOL(drm_atomic_get_new_or_current_crtc_state); -- - static int drm_atomic_crtc_check(const struct drm_crtc_state *old_crtc_state, - const struct drm_crtc_state *new_crtc_state) - { -diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h -index feec1676fc03..d07c851d255b 100644 ---- a/include/drm/drm_atomic.h -+++ b/include/drm/drm_atomic.h -@@ -445,13 +445,6 @@ void drm_atomic_state_default_release(struct drm_atomic_state *state); - struct drm_crtc_state * __must_check - drm_atomic_get_crtc_state(struct drm_atomic_state *state, - struct drm_crtc *crtc); --struct drm_crtc_state * __must_check --drm_atomic_get_new_or_current_crtc_state(struct drm_atomic_state *state, -- struct drm_crtc *crtc); --struct drm_crtc_state * __must_check --drm_atomic_get_old_or_current_crtc_state(struct drm_atomic_state *state, -- struct drm_crtc *crtc); -- - struct drm_plane_state * __must_check - drm_atomic_get_plane_state(struct drm_atomic_state *state, - struct drm_plane *plane); --- -2.18.4 - - -From 6c4b01ff5dc58c415225be3121ae61c6d6ccce46 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 14 Jun 2021 15:27:24 +0200 -Subject: [PATCH 712/834] drm/vc4: crtc: Add encoder to vc4_crtc_config_pv +Subject: [PATCH 683/889] drm/vc4: crtc: Add encoder to vc4_crtc_config_pv prototype vc4_crtc_config_pv() retrieves the encoder again, even though its only @@ -233878,10 +230913,10 @@ index cea2cb87973c..5171c8ef9720 100644 2.18.4 -From 967c4a7af789317ad56d42fdc054e3b8ea533d2d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 21 Jun 2021 16:07:22 +0200 -Subject: [PATCH 713/834] drm/vc4: crtc: Rework the encoder retrieval code +Subject: [PATCH 684/889] drm/vc4: crtc: Rework the encoder retrieval code (again) It turns out the encoder retrieval code, in addition to being @@ -233981,10 +231016,10 @@ index 96cc262cb174..c38fa9718e1c 100644 2.18.4 -From e76308f20183b19bc285a094c5893522e9a351ae Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 21 Jun 2021 16:13:02 +0200 -Subject: [PATCH 714/834] drm/vc4: crtc: Add some logging +Subject: [PATCH 685/889] drm/vc4: crtc: Add some logging The encoder retrieval code has been a source of bugs and glitches in the past and the crtc <-> encoder association been wrong in a number of @@ -234025,10 +231060,10 @@ index 44249f8a6877..651b1d67591c 100644 2.18.4 -From 9c092501e54ab9e159b61fc97feba2b191270c96 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 21 Jun 2021 17:19:22 +0200 -Subject: [PATCH 715/834] drm/vc4: Leverage the load tracker on the BCM2711 +Subject: [PATCH 686/889] drm/vc4: Leverage the load tracker on the BCM2711 The load tracker was initially designed to report and warn about a load too high for the HVS. To do so, it computes for each plane the impact @@ -234158,269 +231193,10 @@ index 26ea1f9dd7b3..333335f3c561 100644 2.18.4 -From 90c81d1d576ee2421d61ae0f7f1fa5f9e70af27a Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Wed, 26 May 2021 16:13:02 +0200 -Subject: [PATCH 716/834] drm/vc4: Increase the core clock based on HVS load - -Depending on a given HVS output (HVS to PixelValves) and input (planes -attached to a channel) load, the HVS needs for the core clock to be -raised above its boot time default. - -Failing to do so will result in a vblank timeout and a stalled display -pipeline. - -Signed-off-by: Maxime Ripard ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 15 +++++ - drivers/gpu/drm/vc4/vc4_drv.h | 3 + - drivers/gpu/drm/vc4/vc4_kms.c | 116 ++++++++++++++++++++++++++++++++- - 3 files changed, 131 insertions(+), 3 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 651b1d67591c..f45fb80e822c 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -643,12 +643,27 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, - struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc_state); - struct drm_connector *conn; - struct drm_connector_state *conn_state; -+ struct drm_encoder *encoder; - int ret, i; - - ret = vc4_hvs_atomic_check(crtc, crtc_state); - if (ret) - return ret; - -+ encoder = vc4_get_crtc_encoder(crtc, crtc_state); -+ if (encoder) { -+ const struct drm_display_mode *mode = &crtc_state->adjusted_mode; -+ struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); -+ -+ mode = &crtc_state->adjusted_mode; -+ if (vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0) { -+ vc4_state->hvs_load = max(mode->clock * mode->hdisplay / mode->htotal + 1000, -+ mode->clock * 9 / 10) * 1000; -+ } else { -+ vc4_state->hvs_load = mode->clock * 1000; -+ } -+ } -+ - for_each_new_connector_in_state(crtc_state->state, conn, conn_state, - i) { - if (conn_state->crtc != crtc) -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 3b9a9c92240d..13a752b2fbed 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -326,6 +326,7 @@ struct vc4_hvs { - u32 __iomem *dlist; - - struct clk *core_clk; -+ struct clk_request *core_req; - - /* Memory manager for CRTCs to allocate space in the display - * list. Units are dwords. -@@ -537,6 +538,8 @@ struct vc4_crtc_state { - unsigned int bottom; - } margins; - -+ unsigned long hvs_load; -+ - /* Transitional state below, only valid during atomic commits */ - bool update_muxing; - }; -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index e7dcb64b05ef..e77135b6985c 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -40,6 +40,9 @@ static struct vc4_ctm_state *to_vc4_ctm_state(struct drm_private_state *priv) - struct vc4_hvs_state { - struct drm_private_state base; - unsigned int unassigned_channels; -+ unsigned int num_outputs; -+ unsigned long fifo_load; -+ unsigned long core_clock_rate; - }; - - static struct vc4_hvs_state * -@@ -185,6 +188,19 @@ vc4_ctm_commit(struct vc4_dev *vc4, struct drm_atomic_state *state) - VC4_SET_FIELD(ctm_state->fifo, SCALER_OLEDOFFS_DISPFIFO)); - } - -+static struct vc4_hvs_state * -+vc4_hvs_get_new_global_state(struct drm_atomic_state *state) -+{ -+ struct vc4_dev *vc4 = to_vc4_dev(state->dev); -+ struct drm_private_state *priv_state; -+ -+ priv_state = drm_atomic_get_new_private_obj_state(state, &vc4->hvs_channels); -+ if (IS_ERR(priv_state)) -+ return ERR_CAST(priv_state); -+ -+ return to_vc4_hvs_state(priv_state); -+} -+ - static struct vc4_hvs_state * - vc4_hvs_get_global_state(struct drm_atomic_state *state) - { -@@ -312,10 +328,15 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - struct vc4_dev *vc4 = to_vc4_dev(dev); - struct vc4_hvs *hvs = vc4->hvs; - struct drm_crtc_state *new_crtc_state; -+ struct vc4_hvs_state *hvs_state; - struct drm_crtc *crtc; - struct clk_request *core_req; - int i; - -+ hvs_state = vc4_hvs_get_new_global_state(state); -+ if (WARN_ON(!hvs_state)) -+ return; -+ - for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { - struct vc4_crtc_state *vc4_crtc_state; - -@@ -326,9 +347,20 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - vc4_hvs_mask_underrun(dev, vc4_crtc_state->assigned_channel); - } - -- if (vc4->hvs && vc4->hvs->hvs5) -+ if (vc4->hvs && vc4->hvs->hvs5) { -+ /* -+ * Do a temporary request on the core clock during the -+ * modeset. -+ */ - core_req = clk_request_start(hvs->core_clk, 500000000); - -+ /* -+ * And remove the previous one based on the HVS -+ * requirements if any. -+ */ -+ clk_request_done(hvs->core_req); -+ } -+ - drm_atomic_helper_wait_for_fences(dev, state, false); - - drm_atomic_helper_wait_for_dependencies(state); -@@ -358,8 +390,20 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - - drm_atomic_helper_commit_cleanup_done(state); - -- if (vc4->hvs && vc4->hvs->hvs5) -+ if (vc4->hvs && vc4->hvs->hvs5) { -+ drm_dbg(dev, "Running the core clock at %lu Hz\n", -+ hvs_state->core_clock_rate); -+ -+ /* -+ * Request a clock rate based on the current HVS -+ * requirements. -+ */ -+ hvs->core_req = clk_request_start(hvs->core_clk, -+ hvs_state->core_clock_rate); -+ -+ /* And drop the temporary request */ - clk_request_done(core_req); -+ } - - drm_atomic_state_put(state); - -@@ -703,6 +747,9 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - __drm_atomic_helper_private_obj_duplicate_state(obj, &state->base); - - state->unassigned_channels = old_state->unassigned_channels; -+ state->fifo_load = old_state->fifo_load; -+ state->num_outputs = old_state->num_outputs; -+ state->core_clock_rate = old_state->core_clock_rate; - - return &state->base; - } -@@ -849,6 +896,65 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - return 0; - } - -+static int -+vc4_core_clock_atomic_check(struct drm_atomic_state *state) -+{ -+ struct vc4_dev *vc4 = to_vc4_dev(state->dev); -+ struct drm_private_state *priv_state; -+ struct vc4_hvs_state *hvs_new_state; -+ struct vc4_load_tracker_state *load_state; -+ struct drm_crtc_state *old_crtc_state, *new_crtc_state; -+ struct drm_crtc *crtc; -+ unsigned long pixel_rate; -+ unsigned long cob_rate; -+ unsigned int i; -+ -+ priv_state = drm_atomic_get_private_obj_state(state, -+ &vc4->load_tracker); -+ if (IS_ERR(priv_state)) -+ return PTR_ERR(priv_state); -+ -+ load_state = to_vc4_load_tracker_state(priv_state); -+ -+ hvs_new_state = vc4_hvs_get_global_state(state); -+ if (!hvs_new_state) -+ return -EINVAL; -+ -+ for_each_oldnew_crtc_in_state(state, crtc, -+ old_crtc_state, -+ new_crtc_state, -+ i) { -+ if (old_crtc_state->active) { -+ struct vc4_crtc_state *old_vc4_state = -+ to_vc4_crtc_state(old_crtc_state); -+ -+ hvs_new_state->num_outputs -= 1; -+ hvs_new_state->fifo_load -= old_vc4_state->hvs_load; -+ } -+ -+ if (new_crtc_state->active) { -+ struct vc4_crtc_state *new_vc4_state = -+ to_vc4_crtc_state(new_crtc_state); -+ -+ hvs_new_state->num_outputs += 1; -+ hvs_new_state->fifo_load += new_vc4_state->hvs_load; -+ } -+ } -+ -+ cob_rate = hvs_new_state->fifo_load; -+ pixel_rate = load_state->hvs_load; -+ if (hvs_new_state->num_outputs > 1) { -+ pixel_rate = (pixel_rate * 40) / 100; -+ } else { -+ pixel_rate = (pixel_rate * 60) / 100; -+ } -+ -+ hvs_new_state->core_clock_rate = max(cob_rate, pixel_rate); -+ -+ return 0; -+} -+ -+ - static int - vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) - { -@@ -866,7 +972,11 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) - if (ret) - return ret; - -- return vc4_load_tracker_atomic_check(state); -+ ret = vc4_load_tracker_atomic_check(state); -+ if (ret) -+ return ret; -+ -+ return vc4_core_clock_atomic_check(state); - } - - static const struct drm_mode_config_funcs vc4_mode_funcs = { --- -2.18.4 - - -From 5c38c5c67ecacc37f911420912d4f44c33e160b7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: kFYatek <4499762+kFYatek@users.noreply.github.com> Date: Wed, 23 Jun 2021 01:11:26 +0200 -Subject: [PATCH 717/834] drm/vc4: Fix timings for interlaced modes +Subject: [PATCH 687/889] drm/vc4: Fix timings for interlaced modes Increase the number of post-sync blanking lines on odd fields instead of decreasing it on even fields. This makes the total number of lines @@ -234437,7 +231213,7 @@ Signed-off-by: Mateusz Kwiatkowski 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index f45fb80e822c..0f69f4b7f2cb 100644 +index 651b1d67591c..b341b1f6fbc1 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -342,7 +342,8 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode @@ -234508,10 +231284,10 @@ index 7035c27e84e3..9b62e6225fd0 100644 2.18.4 -From b60ab79bd1b3b1d28df89bf60e19dc2bd1cb91cc Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Thu, 24 Jun 2021 12:00:49 +0100 -Subject: [PATCH 718/834] drm/vc4: Don't create hvs_load_tracker on fkms +Subject: [PATCH 688/889] drm/vc4: Don't create hvs_load_tracker on fkms fkms doesn't use vc4->hvs so protect against that @@ -234537,10 +231313,10 @@ index d7104d8826f2..a95d88fea8d2 100644 2.18.4 -From f465dc8ada96dac47e5faba7f2556d09b78335b4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 24 Jun 2021 14:43:49 +0100 -Subject: [PATCH 719/834] media: rpivid: Fix H265 aux ent reuse of the same +Subject: [PATCH 689/889] media: rpivid: Fix H265 aux ent reuse of the same slot It is legitimate, though unusual, for an aux ent associated with a slot @@ -234694,10 +231470,10 @@ index bb280b215a2e..a5a0e31bd5ba 100644 2.18.4 -From 69f03f7a761e3da2b4f42dc2294f411d64d9c38e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joerg Quinten Date: Fri, 18 Jun 2021 13:02:29 +0200 -Subject: [PATCH 720/834] Support RPi DPI interface in mode6 for 18-bit color +Subject: [PATCH 690/889] Support RPi DPI interface in mode6 for 18-bit color A matching media bus format was added and an overlay for using it, both with FB and VC4 was added as well. @@ -234922,10 +231698,10 @@ index 3c2848e91c1b..c4abd49af073 100644 2.18.4 -From 6584fb37ae7dbecd46a9fccaca8e073d8fb7c024 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joerg Quinten Date: Mon, 21 Jun 2021 16:10:32 +0200 -Subject: [PATCH 721/834] overlays: Add dpi18cpadhi, vc4-kms-dpi-at056tn53v1 +Subject: [PATCH 691/889] overlays: Add dpi18cpadhi, vc4-kms-dpi-at056tn53v1 Signed-off-by: Joerg Quinten --- @@ -235101,10 +231877,10 @@ index 000000000000..f7181c9828bf 2.18.4 -From 83413bd1ffdc2928534828aff7fcc2b0e007d29b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Thu, 24 Jun 2021 17:58:05 +0100 -Subject: [PATCH 722/834] drm: vc4: Fix pixel-wrap issue with DVP teardown +Subject: [PATCH 692/889] drm: vc4: Fix pixel-wrap issue with DVP teardown Adjust the DVP enable/disable sequence to avoid a pixel getting stuck in an internal, non resettable FIFO within PixelValve when changing @@ -235169,57 +231945,10 @@ index 9b62e6225fd0..2d6291a0ca5d 100644 2.18.4 -From bc588e6a48827966e435816e7807ff059d79662a Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Mon, 28 Jun 2021 11:15:13 +0200 -Subject: [PATCH 723/834] drm/vc4: Increase the core clock to a minimum of - 500MHz - -The core clock needs to be raised temporarily during a modeset to -500MHz. However, the HVS core clock requirement might be higher than -500MHz. This rate will be enforced at the end of the mode setting, -meaning that might might end up with a core clock rate lower than -planned on the first mode set. - -Use the maximum value of 500MHz and the HVS core clock rate for our -temporary boost to fix this issue. - -Signed-off-by: Maxime Ripard ---- - drivers/gpu/drm/vc4/vc4_kms.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index e77135b6985c..7d159b32abba 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -348,11 +348,17 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - } - - if (vc4->hvs && vc4->hvs->hvs5) { -+ unsigned long core_rate = max_t(unsigned long, -+ 500000000, -+ hvs_state->core_clock_rate); -+ -+ drm_dbg(dev, "Raising the core clock at %lu Hz\n", core_rate); -+ - /* - * Do a temporary request on the core clock during the - * modeset. - */ -- core_req = clk_request_start(hvs->core_clk, 500000000); -+ core_req = clk_request_start(hvs->core_clk, core_rate); - - /* - * And remove the previous one based on the HVS --- -2.18.4 - - -From 29e0368d696a8e1313bcb0c543d15329c77dc474 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 28 Jun 2021 10:49:04 +0100 -Subject: [PATCH 724/834] media: i2c: ov9281: Remove override of subdev name +Subject: [PATCH 693/889] media: i2c: ov9281: Remove override of subdev name From the original Rockchip driver, the subdev was renamed from the default to being "mov9281 " whereas the @@ -235250,10 +231979,10 @@ index 16777b6f8e14..6bfc79cd5897 100644 2.18.4 -From ddca1754e7f454d0d4e3020868fdda7c0182a78c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 28 Jun 2021 16:07:16 +0200 -Subject: [PATCH 725/834] drm/vc4: hdmi: Use a fixed rate for the HSM clock on +Subject: [PATCH 694/889] drm/vc4: hdmi: Use a fixed rate for the HSM clock on BCM2835 Before the introduction of the BCM2711 support, the HSM clock rate was @@ -235398,10 +232127,10 @@ index 295962d83741..49fc91962fe4 100644 2.18.4 -From e01c84757afb70f0c7159702001ac8bd79711fb9 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 25 Jun 2021 16:22:39 +0200 -Subject: [PATCH 726/834] drm/vc4: hdmi: Enable the scrambler on reconnection +Subject: [PATCH 695/889] drm/vc4: hdmi: Enable the scrambler on reconnection If we have a state already and disconnect/reconnect the display, the SCDC messages won't be sent again since we didn't go through a disable / @@ -235458,10 +232187,10 @@ index ca0016f032e7..e26622099ad5 100644 2.18.4 -From 4f83a375c3409cf426335cbf3e876588d8e21000 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 6 May 2021 16:40:19 +0200 -Subject: [PATCH 727/834] drm/vc4: hdmi: Make sure the controller is powered in +Subject: [PATCH 696/889] drm/vc4: hdmi: Make sure the controller is powered in detect If the HPD GPIO is not available and drm_probe_ddc fails, we end up @@ -235524,10 +232253,10 @@ index e26622099ad5..c406b57d1ed1 100644 2.18.4 -From 14b06f5e9142aa05c54d3f279f1cd0fe66216202 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 29 Jun 2021 09:20:09 +0100 -Subject: [PATCH 728/834] configs: Add CONFIG_MACVTAP=m (arm64 only) +Subject: [PATCH 697/889] configs: Add CONFIG_MACVTAP=m (arm64 only) From the requesting issue: @@ -235571,10 +232300,10 @@ index 456b3000e6d6..da84139ca6ca 100644 2.18.4 -From 14e484213da72b78ba2e8536a1ddd12793880c93 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 29 Jun 2021 12:50:58 +0100 -Subject: [PATCH 729/834] staging: vc04_services: isp: Set the YUV420/YVU420 +Subject: [PATCH 698/889] staging: vc04_services: isp: Set the YUV420/YVU420 format stride to 64 bytes The bcm2835 ISP requires the base address of all input/output planes to have 32 @@ -235616,10 +232345,10 @@ index 7541fb316cb9..f6d6c88d13ba 100644 2.18.4 -From 55d263ca3283511e1d829f8aa38a518e02021c67 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 29 Jun 2021 14:38:23 +0100 -Subject: [PATCH 730/834] Documentation: devicetree: Add documentation for +Subject: [PATCH 699/889] Documentation: devicetree: Add documentation for imx378 sensor The imx378 sensor is compatible with the imx477 and shares common @@ -235767,10 +232496,10 @@ index 937b6a1f99ec..1e0aa06f159d 100644 2.18.4 -From aee985276c6402ea033e13eb30d332aa1be715e8 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 29 Jun 2021 14:41:15 +0100 -Subject: [PATCH 731/834] overlays: Add overlay for imx378 sensor +Subject: [PATCH 700/889] overlays: Add overlay for imx378 sensor This is based off a common overlay which is now also used by the imx477 sensor. @@ -236071,10 +232800,10 @@ index 000000000000..4e444709cc16 2.18.4 -From 0109d70d15bc1ee47f82d3b292218c0dac6b1f84 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 29 Jun 2021 14:43:01 +0100 -Subject: [PATCH 732/834] media: i2c: imx477: Extend driver to support imx378 +Subject: [PATCH 701/889] media: i2c: imx477: Extend driver to support imx378 sensor The imx378 sensor is almost identical to the imx477 and can be @@ -236269,10 +232998,10 @@ index b06add219cb4..521953e71686 100644 2.18.4 -From e4ccebecc9b72ae2b4163efdca1ebb6d6c123040 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 30 Jun 2021 17:03:00 +0100 -Subject: [PATCH 733/834] overlays: Make i2c-rtc and i2c-rtc-gpio share RTCs +Subject: [PATCH 702/889] overlays: Make i2c-rtc and i2c-rtc-gpio share RTCs Lift the set of RTCs out of i2c-rtc and i2c-rtc-gpio to update i2c-rtc-gpio and to reduce duplication. @@ -237200,10 +233929,10 @@ index b9842e11b5e0..1eae9e1a5c96 100644 2.18.4 -From 165318b2c3120d54362348927528ecfd72df09c2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 23 Jun 2021 11:47:38 +0200 -Subject: [PATCH 734/834] dt-bindings: clk: raspberrypi: Remove unused property +Subject: [PATCH 703/889] dt-bindings: clk: raspberrypi: Remove unused property The raspberrypi,firmware property has been documented as required in the binding but was never actually used in the final version of the binding. @@ -237246,10 +233975,10 @@ index d37bc311321d..2047e25700c6 100644 2.18.4 -From b5ddbe2fd84036f1ba1e9ee2c396c2069d432b74 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 23 Jun 2021 11:48:35 +0200 -Subject: [PATCH 735/834] dt-bindings: display: vc4: Add phandle to the +Subject: [PATCH 704/889] dt-bindings: display: vc4: Add phandle to the firmware The vc4 driver will need to tell the firmware that it takes over the @@ -237283,10 +234012,10 @@ index 49a5e041aa49..eac739a812f5 100644 2.18.4 -From 24686b46dbd81ad761cdb779060d0b8a86b9799c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 23 Jun 2021 11:53:46 +0200 -Subject: [PATCH 736/834] firmware: raspberrypi: Add +Subject: [PATCH 705/889] firmware: raspberrypi: Add RPI_FIRMWARE_NOTIFY_DISPLAY_DONE The RPI_FIRMWARE_NOTIFY_DISPLAY_DONE firmware call allows to tell the @@ -237299,7 +234028,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 1 insertion(+) diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h -index 97ff2a59aa03..cc0a0bc8d1e6 100644 +index 86b36c9327e9..0235624456a1 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h @@ -99,6 +99,7 @@ enum rpi_firmware_property_tag { @@ -237314,10 +234043,10 @@ index 97ff2a59aa03..cc0a0bc8d1e6 100644 2.18.4 -From d0121e32aa941f7dd646413b11a18a42116f8c47 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 25 Jun 2021 17:01:33 +0200 -Subject: [PATCH 737/834] drm/vc4: Remove conflicting framebuffers before +Subject: [PATCH 706/889] drm/vc4: Remove conflicting framebuffers before callind bind_all The bind hooks will modify their controller registers, so simplefb is @@ -237355,10 +234084,10 @@ index 3683780b9de8..9b9d088a3131 100644 2.18.4 -From 49d4283dfaa152258d5d7c4acf2f7c1b4b816d37 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 23 Jun 2021 11:54:58 +0200 -Subject: [PATCH 738/834] drm/vc4: Notify the firmware when DRM is in charge +Subject: [PATCH 707/889] drm/vc4: Notify the firmware when DRM is in charge Once the call to drm_fb_helper_remove_conflicting_framebuffers() has been made, simplefb has been unregistered and the KMS driver is entirely @@ -237415,10 +234144,10 @@ index 9b9d088a3131..0d343e08fb18 100644 2.18.4 -From e0fa3d69e5d520e32650a5cbd9113d82e16f8d99 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 23 Jun 2021 11:56:56 +0200 -Subject: [PATCH 739/834] ARM: dts: rpi: Add the firmware node to vc4 +Subject: [PATCH 708/889] ARM: dts: rpi: Add the firmware node to vc4 Add the firmware phandle to the vc4 node so that we can send it the message that we're done with the firmware display. @@ -237463,10 +234192,10 @@ index 1b16cb9ccb88..edc55bba5ff4 100644 2.18.4 -From 9e388b692d12a82b8e84bb4d453959a570ad29df Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 29 Jun 2021 11:36:38 +0200 -Subject: [PATCH 740/834] drm/vc4: hdmi: Put the device on error in +Subject: [PATCH 709/889] drm/vc4: hdmi: Put the device on error in pre_crtc_configure In the vc4_hdmi_encoder_pre_crtc_configure() function error path we @@ -237534,10 +234263,10 @@ index c406b57d1ed1..8fc86d044023 100644 2.18.4 -From 4ddf5fd2ac065822258a067b1ee0193accb778dd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 29 Jun 2021 09:53:52 +0200 -Subject: [PATCH 741/834] drm/vc4: hdmi: Split the CEC disable / enable +Subject: [PATCH 710/889] drm/vc4: hdmi: Split the CEC disable / enable functions in two In order to ease further additions to the CEC enable and disable, let's @@ -237649,10 +234378,10 @@ index 8fc86d044023..fbb525d52ef6 100644 2.18.4 -From 8b66c1276dfd089e3a4cf047c4d58746fe7e5894 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 29 Jun 2021 11:41:57 +0200 -Subject: [PATCH 742/834] drm/vc4: hdmi: Make sure the device is powered with +Subject: [PATCH 711/889] drm/vc4: hdmi: Make sure the device is powered with CEC Similarly to what we encountered with the detect hook with DRM, nothing @@ -237700,10 +234429,10 @@ index fbb525d52ef6..19b3dbce2ae9 100644 2.18.4 -From f06d65d8f79806bf86a040ad5bbb62c44051b0bf Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 2 Jul 2021 17:44:56 +0200 -Subject: [PATCH 743/834] drm/vc4: hdmi: Add missing clk_disable_unprepare on +Subject: [PATCH 712/889] drm/vc4: hdmi: Add missing clk_disable_unprepare on error path In vc4_hdmi_encoder_pre_crtc_configure, if clk_request_start for the HSM @@ -237734,10 +234463,10 @@ index 19b3dbce2ae9..ebe88b5ee52f 100644 2.18.4 -From 9d033c38e84e89891dd2a8c026a4e879e13fd104 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 5 Jul 2021 10:32:30 +0200 -Subject: [PATCH 744/834] drm/vc4: hdmi: Warn if we access the controller while +Subject: [PATCH 713/889] drm/vc4: hdmi: Warn if we access the controller while disabled We've had many silent hangs where the kernel would look like it just @@ -237787,10 +234516,10 @@ index a81fdf90f66b..06b0739e2ba3 100644 2.18.4 -From 329457a3507743fdf513f5d6ae73967df2b94d22 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 5 Jul 2021 10:48:07 +0200 -Subject: [PATCH 745/834] drm/vc4: hdmi: Move initial register read after +Subject: [PATCH 714/889] drm/vc4: hdmi: Move initial register read after pm_runtime_get Commit ecdd08fd9bba ("drm/vc4: hdmi: Make sure the device is powered @@ -237830,10 +234559,10 @@ index ebe88b5ee52f..981c995c36a7 100644 2.18.4 -From a9803852c7fb07b0a543288f447e517d89e49890 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 5 Jul 2021 11:43:12 +0100 -Subject: [PATCH 746/834] vc4/drv: Only notify firmware of display done with +Subject: [PATCH 715/889] vc4/drv: Only notify firmware of display done with kms fkms driver still wants firmware display to be active @@ -237879,10 +234608,10 @@ index 0d343e08fb18..919b2d1e6bd5 100644 2.18.4 -From 5a9f03d9f166301e208a06729507e9dde256a969 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 5 Jul 2021 19:38:21 +0100 -Subject: [PATCH 747/834] dwc_otg: Update NetBSD usb.h header licence +Subject: [PATCH 716/889] dwc_otg: Update NetBSD usb.h header licence NetBSD have changed their licensing requirements such that the 2-clause licence is preferred. Update usb.h in the downstream dwc_otg code @@ -237918,10 +234647,10 @@ index f78593575736..b1cedb1876b7 100644 2.18.4 -From e9634bac56a6c545443b5057ca45b08ec5966079 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 5 Jul 2021 15:47:43 +0200 -Subject: [PATCH 748/834] drm/vc4: hdmi: Drop devm interrupt handler for CEC +Subject: [PATCH 717/889] drm/vc4: hdmi: Drop devm interrupt handler for CEC interrupts The CEC interrupt handlers are registered through the @@ -238030,10 +234759,10 @@ index 981c995c36a7..e06dd2622a0d 100644 2.18.4 -From 0f486a43cc699d01781c16fa3c1a1927af138559 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 5 Jul 2021 17:31:48 +0200 -Subject: [PATCH 749/834] drm/vc4: hdmi: Drop devm interrupt handler for +Subject: [PATCH 718/889] drm/vc4: hdmi: Drop devm interrupt handler for hotplug interrupts The hotplugs interrupt handlers are registered through the @@ -238147,10 +234876,10 @@ index e06dd2622a0d..7fa9c092415d 100644 2.18.4 -From dcf76c1970e5297c9bad86492b2d56fac11e7d79 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 5 Jul 2021 16:15:56 +0200 -Subject: [PATCH 750/834] drm/vc4: hdmi: Only call into DRM framework if +Subject: [PATCH 719/889] drm/vc4: hdmi: Only call into DRM framework if registered Our hotplug handler will currently call the drm_kms_helper_hotplug_event @@ -238188,10 +234917,10 @@ index 7fa9c092415d..d036e21647ef 100644 2.18.4 -From 7bd101d8ba734f4cc02602c01aa66b44dd6323d6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Thu, 8 Jul 2021 13:48:11 +0100 -Subject: [PATCH 751/834] bcm2711_thermal: Don't clamp temperature at zero +Subject: [PATCH 720/889] bcm2711_thermal: Don't clamp temperature at zero The temperature sensor is valid below zero and the linux framework is happy with it. @@ -238218,10 +234947,10 @@ index 67c2a737bc9d..73cf85fc24b7 100644 2.18.4 -From f7ffa876ca3ec2d679151d5626428eaa5c23580d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Van=C4=9Bk?= Date: Wed, 7 Jul 2021 22:48:20 +0200 -Subject: [PATCH 752/834] media: bcm2835-unicam: Forward input status from +Subject: [PATCH 721/889] media: bcm2835-unicam: Forward input status from subdevice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -238277,10 +235006,10 @@ index 0d737e0c7f52..59163f93b207 100644 2.18.4 -From 80886e37ac8b154313147d751670340b56d54941 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: "chipdip.lab" <43340836+chipdipru@users.noreply.github.com> Date: Fri, 9 Jul 2021 16:00:22 +0300 -Subject: [PATCH 753/834] overlays: Add overlay for Chipdip I2S master DAC +Subject: [PATCH 722/889] overlays: Add overlay for Chipdip I2S master DAC Signed-off-by: Evgenij Sapunov --- @@ -238382,301 +235111,10 @@ index 000000000000..a35ac36f8513 2.18.4 -From bdb0ae58debd4ae6f7c7ae8f65e35abf9505480b Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Thu, 8 Jul 2021 19:16:42 +0100 -Subject: [PATCH 754/834] Revert "drm/vc4: Increase the core clock to a minimum - of 500MHz" - -This reverts commit c53f42cc56350b4f4bc5542e48707e5e2bd90720. ---- - drivers/gpu/drm/vc4/vc4_kms.c | 8 +------- - 1 file changed, 1 insertion(+), 7 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 7d159b32abba..e77135b6985c 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -348,17 +348,11 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - } - - if (vc4->hvs && vc4->hvs->hvs5) { -- unsigned long core_rate = max_t(unsigned long, -- 500000000, -- hvs_state->core_clock_rate); -- -- drm_dbg(dev, "Raising the core clock at %lu Hz\n", core_rate); -- - /* - * Do a temporary request on the core clock during the - * modeset. - */ -- core_req = clk_request_start(hvs->core_clk, core_rate); -+ core_req = clk_request_start(hvs->core_clk, 500000000); - - /* - * And remove the previous one based on the HVS --- -2.18.4 - - -From ac5e64b327c5a30311c242cc00cb566b797761f7 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Thu, 8 Jul 2021 19:16:44 +0100 -Subject: [PATCH 755/834] Revert "drm/vc4: Increase the core clock based on HVS - load" - -This reverts commit 69a25f086d2e81d6592f9f18f45f37ebab65297a. ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 15 ----- - drivers/gpu/drm/vc4/vc4_drv.h | 3 - - drivers/gpu/drm/vc4/vc4_kms.c | 116 +-------------------------------- - 3 files changed, 3 insertions(+), 131 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 0f69f4b7f2cb..b341b1f6fbc1 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -644,27 +644,12 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, - struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc_state); - struct drm_connector *conn; - struct drm_connector_state *conn_state; -- struct drm_encoder *encoder; - int ret, i; - - ret = vc4_hvs_atomic_check(crtc, crtc_state); - if (ret) - return ret; - -- encoder = vc4_get_crtc_encoder(crtc, crtc_state); -- if (encoder) { -- const struct drm_display_mode *mode = &crtc_state->adjusted_mode; -- struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); -- -- mode = &crtc_state->adjusted_mode; -- if (vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0) { -- vc4_state->hvs_load = max(mode->clock * mode->hdisplay / mode->htotal + 1000, -- mode->clock * 9 / 10) * 1000; -- } else { -- vc4_state->hvs_load = mode->clock * 1000; -- } -- } -- - for_each_new_connector_in_state(crtc_state->state, conn, conn_state, - i) { - if (conn_state->crtc != crtc) -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 13a752b2fbed..3b9a9c92240d 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -326,7 +326,6 @@ struct vc4_hvs { - u32 __iomem *dlist; - - struct clk *core_clk; -- struct clk_request *core_req; - - /* Memory manager for CRTCs to allocate space in the display - * list. Units are dwords. -@@ -538,8 +537,6 @@ struct vc4_crtc_state { - unsigned int bottom; - } margins; - -- unsigned long hvs_load; -- - /* Transitional state below, only valid during atomic commits */ - bool update_muxing; - }; -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index e77135b6985c..e7dcb64b05ef 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -40,9 +40,6 @@ static struct vc4_ctm_state *to_vc4_ctm_state(struct drm_private_state *priv) - struct vc4_hvs_state { - struct drm_private_state base; - unsigned int unassigned_channels; -- unsigned int num_outputs; -- unsigned long fifo_load; -- unsigned long core_clock_rate; - }; - - static struct vc4_hvs_state * -@@ -188,19 +185,6 @@ vc4_ctm_commit(struct vc4_dev *vc4, struct drm_atomic_state *state) - VC4_SET_FIELD(ctm_state->fifo, SCALER_OLEDOFFS_DISPFIFO)); - } - --static struct vc4_hvs_state * --vc4_hvs_get_new_global_state(struct drm_atomic_state *state) --{ -- struct vc4_dev *vc4 = to_vc4_dev(state->dev); -- struct drm_private_state *priv_state; -- -- priv_state = drm_atomic_get_new_private_obj_state(state, &vc4->hvs_channels); -- if (IS_ERR(priv_state)) -- return ERR_CAST(priv_state); -- -- return to_vc4_hvs_state(priv_state); --} -- - static struct vc4_hvs_state * - vc4_hvs_get_global_state(struct drm_atomic_state *state) - { -@@ -328,15 +312,10 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - struct vc4_dev *vc4 = to_vc4_dev(dev); - struct vc4_hvs *hvs = vc4->hvs; - struct drm_crtc_state *new_crtc_state; -- struct vc4_hvs_state *hvs_state; - struct drm_crtc *crtc; - struct clk_request *core_req; - int i; - -- hvs_state = vc4_hvs_get_new_global_state(state); -- if (WARN_ON(!hvs_state)) -- return; -- - for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { - struct vc4_crtc_state *vc4_crtc_state; - -@@ -347,20 +326,9 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - vc4_hvs_mask_underrun(dev, vc4_crtc_state->assigned_channel); - } - -- if (vc4->hvs && vc4->hvs->hvs5) { -- /* -- * Do a temporary request on the core clock during the -- * modeset. -- */ -+ if (vc4->hvs && vc4->hvs->hvs5) - core_req = clk_request_start(hvs->core_clk, 500000000); - -- /* -- * And remove the previous one based on the HVS -- * requirements if any. -- */ -- clk_request_done(hvs->core_req); -- } -- - drm_atomic_helper_wait_for_fences(dev, state, false); - - drm_atomic_helper_wait_for_dependencies(state); -@@ -390,20 +358,8 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - - drm_atomic_helper_commit_cleanup_done(state); - -- if (vc4->hvs && vc4->hvs->hvs5) { -- drm_dbg(dev, "Running the core clock at %lu Hz\n", -- hvs_state->core_clock_rate); -- -- /* -- * Request a clock rate based on the current HVS -- * requirements. -- */ -- hvs->core_req = clk_request_start(hvs->core_clk, -- hvs_state->core_clock_rate); -- -- /* And drop the temporary request */ -+ if (vc4->hvs && vc4->hvs->hvs5) - clk_request_done(core_req); -- } - - drm_atomic_state_put(state); - -@@ -747,9 +703,6 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - __drm_atomic_helper_private_obj_duplicate_state(obj, &state->base); - - state->unassigned_channels = old_state->unassigned_channels; -- state->fifo_load = old_state->fifo_load; -- state->num_outputs = old_state->num_outputs; -- state->core_clock_rate = old_state->core_clock_rate; - - return &state->base; - } -@@ -896,65 +849,6 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - return 0; - } - --static int --vc4_core_clock_atomic_check(struct drm_atomic_state *state) --{ -- struct vc4_dev *vc4 = to_vc4_dev(state->dev); -- struct drm_private_state *priv_state; -- struct vc4_hvs_state *hvs_new_state; -- struct vc4_load_tracker_state *load_state; -- struct drm_crtc_state *old_crtc_state, *new_crtc_state; -- struct drm_crtc *crtc; -- unsigned long pixel_rate; -- unsigned long cob_rate; -- unsigned int i; -- -- priv_state = drm_atomic_get_private_obj_state(state, -- &vc4->load_tracker); -- if (IS_ERR(priv_state)) -- return PTR_ERR(priv_state); -- -- load_state = to_vc4_load_tracker_state(priv_state); -- -- hvs_new_state = vc4_hvs_get_global_state(state); -- if (!hvs_new_state) -- return -EINVAL; -- -- for_each_oldnew_crtc_in_state(state, crtc, -- old_crtc_state, -- new_crtc_state, -- i) { -- if (old_crtc_state->active) { -- struct vc4_crtc_state *old_vc4_state = -- to_vc4_crtc_state(old_crtc_state); -- -- hvs_new_state->num_outputs -= 1; -- hvs_new_state->fifo_load -= old_vc4_state->hvs_load; -- } -- -- if (new_crtc_state->active) { -- struct vc4_crtc_state *new_vc4_state = -- to_vc4_crtc_state(new_crtc_state); -- -- hvs_new_state->num_outputs += 1; -- hvs_new_state->fifo_load += new_vc4_state->hvs_load; -- } -- } -- -- cob_rate = hvs_new_state->fifo_load; -- pixel_rate = load_state->hvs_load; -- if (hvs_new_state->num_outputs > 1) { -- pixel_rate = (pixel_rate * 40) / 100; -- } else { -- pixel_rate = (pixel_rate * 60) / 100; -- } -- -- hvs_new_state->core_clock_rate = max(cob_rate, pixel_rate); -- -- return 0; --} -- -- - static int - vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) - { -@@ -972,11 +866,7 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) - if (ret) - return ret; - -- ret = vc4_load_tracker_atomic_check(state); -- if (ret) -- return ret; -- -- return vc4_core_clock_atomic_check(state); -+ return vc4_load_tracker_atomic_check(state); - } - - static const struct drm_mode_config_funcs vc4_mode_funcs = { --- -2.18.4 - - -From 6e7a6f66914a309c524be328b39e0c7fa538eb82 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 4 Dec 2020 16:11:32 +0100 -Subject: [PATCH 756/834] drm: Introduce an atomic_commit_setup function +Subject: [PATCH 723/889] drm: Introduce an atomic_commit_setup function Private objects storing a state shared across all CRTCs need to be carefully handled to avoid a use-after-free issue. @@ -238776,10 +235214,10 @@ index f2de050085be..f8225bcfee2e 100644 2.18.4 -From 6f06903e15b91199ae28ae92aa9bff2dc789b6b4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 4 Dec 2020 16:11:33 +0100 -Subject: [PATCH 757/834] drm: Document use-after-free gotcha with private +Subject: [PATCH 724/889] drm: Document use-after-free gotcha with private objects The private objects have a gotcha that could result in a use-after-free, @@ -238826,10 +235264,79 @@ index d07c851d255b..5d34c1df03f3 100644 2.18.4 -From f4d0bfba5752b6df29a78dd036b51854ddb32a12 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 3 Dec 2020 08:46:24 +0100 +Subject: [PATCH 725/889] drm/vc4: hdmi: Don't poll for the infoframes status + on setup + +The infoframes are sent at a regular interval as a data island packet, +so we don't need to wait for them to be sent when we're setting them up. + +However, we do need to poll when we're enabling since the we can't +update the packet RAM until it has been sent. + +Let's add a boolean flag to tell whether we want to poll or not to +support both cases. + +Suggested-by: Dave Stevenson +Signed-off-by: Maxime Ripard +Reviewed-by: Dave Stevenson +Link: https://patchwork.freedesktop.org/patch/msgid/20201203074624.721559-1-maxime@cerno.tech +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index d036e21647ef..87c7817c9003 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -381,7 +381,8 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, + } + + static int vc4_hdmi_stop_packet(struct drm_encoder *encoder, +- enum hdmi_infoframe_type type) ++ enum hdmi_infoframe_type type, ++ bool poll) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); + u32 packet_id = type - 0x80; +@@ -389,6 +390,9 @@ static int vc4_hdmi_stop_packet(struct drm_encoder *encoder, + HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, + HDMI_READ(HDMI_RAM_PACKET_CONFIG) & ~BIT(packet_id)); + ++ if (!poll) ++ return 0; ++ + return wait_for(!(HDMI_READ(HDMI_RAM_PACKET_STATUS) & + BIT(packet_id)), 100); + } +@@ -417,7 +421,7 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, + if (len < 0) + return; + +- ret = vc4_hdmi_stop_packet(encoder, frame->any.type); ++ ret = vc4_hdmi_stop_packet(encoder, frame->any.type, true); + if (ret) { + DRM_ERROR("Failed to wait for infoframe to go idle: %d\n", ret); + return; +@@ -1302,7 +1306,7 @@ static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) + int ret; + + vc4_hdmi->audio.streaming = false; +- ret = vc4_hdmi_stop_packet(encoder, HDMI_INFOFRAME_TYPE_AUDIO); ++ ret = vc4_hdmi_stop_packet(encoder, HDMI_INFOFRAME_TYPE_AUDIO, false); + if (ret) + dev_err(dev, "Failed to stop audio infoframe: %d\n", ret); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 4 Dec 2020 16:11:34 +0100 -Subject: [PATCH 758/834] drm/vc4: Simplify a bit the global atomic_check +Subject: [PATCH 726/889] drm/vc4: Simplify a bit the global atomic_check When we can't allocate a new channel, we can simply return instead of having to handle both cases, and that simplifies a bit the code. @@ -238876,1090 +235383,10 @@ index e7dcb64b05ef..d842889f79e7 100644 2.18.4 -From fc2d339afe43f88648389d9534f8acd6b55272b6 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Fri, 4 Dec 2020 16:11:35 +0100 -Subject: [PATCH 759/834] drm/vc4: kms: Wait on previous FIFO users before a - commit - -If we're having two subsequent, non-blocking, commits on two different -CRTCs that share no resources, there's no guarantee on the order of -execution of both commits. - -However, the second one will consider the first one as the old state, -and will be in charge of freeing it once that second commit is done. - -If the first commit happens after that second commit, it might access -some resources related to its state that has been freed, resulting in a -use-after-free bug. - -The standard DRM objects are protected against this, but our HVS private -state isn't so let's make sure we wait for all the previous FIFO users -to finish their commit before going with our own. - -Signed-off-by: Maxime Ripard -Reviewed-by: Daniel Vetter ---- - drivers/gpu/drm/vc4/vc4_kms.c | 123 +++++++++++++++++++++++++++++++++- - 1 file changed, 122 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index d842889f79e7..4103c9bb58ee 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -40,6 +40,11 @@ static struct vc4_ctm_state *to_vc4_ctm_state(struct drm_private_state *priv) - struct vc4_hvs_state { - struct drm_private_state base; - unsigned int unassigned_channels; -+ -+ struct { -+ unsigned in_use: 1; -+ struct drm_crtc_commit *pending_commit; -+ } fifo_state[HVS_NUM_CHANNELS]; - }; - - static struct vc4_hvs_state * -@@ -185,6 +190,32 @@ vc4_ctm_commit(struct vc4_dev *vc4, struct drm_atomic_state *state) - VC4_SET_FIELD(ctm_state->fifo, SCALER_OLEDOFFS_DISPFIFO)); - } - -+static struct vc4_hvs_state * -+vc4_hvs_get_new_global_state(struct drm_atomic_state *state) -+{ -+ struct vc4_dev *vc4 = to_vc4_dev(state->dev); -+ struct drm_private_state *priv_state; -+ -+ priv_state = drm_atomic_get_new_private_obj_state(state, &vc4->hvs_channels); -+ if (IS_ERR(priv_state)) -+ return ERR_CAST(priv_state); -+ -+ return to_vc4_hvs_state(priv_state); -+} -+ -+static struct vc4_hvs_state * -+vc4_hvs_get_old_global_state(struct drm_atomic_state *state) -+{ -+ struct vc4_dev *vc4 = to_vc4_dev(state->dev); -+ struct drm_private_state *priv_state; -+ -+ priv_state = drm_atomic_get_old_private_obj_state(state, &vc4->hvs_channels); -+ if (IS_ERR(priv_state)) -+ return ERR_CAST(priv_state); -+ -+ return to_vc4_hvs_state(priv_state); -+} -+ - static struct vc4_hvs_state * - vc4_hvs_get_global_state(struct drm_atomic_state *state) - { -@@ -311,8 +342,10 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - struct drm_device *dev = state->dev; - struct vc4_dev *vc4 = to_vc4_dev(dev); - struct vc4_hvs *hvs = vc4->hvs; -+ struct drm_crtc_state *old_crtc_state; - struct drm_crtc_state *new_crtc_state; - struct drm_crtc *crtc; -+ struct vc4_hvs_state *old_hvs_state; - struct clk_request *core_req; - int i; - -@@ -333,6 +366,36 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - - drm_atomic_helper_wait_for_dependencies(state); - -+ old_hvs_state = vc4_hvs_get_old_global_state(state); -+ if (!old_hvs_state) -+ return; -+ -+ for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) { -+ struct vc4_crtc_state *vc4_crtc_state = -+ to_vc4_crtc_state(old_crtc_state); -+ struct drm_crtc_commit *commit; -+ unsigned int channel = vc4_crtc_state->assigned_channel; -+ unsigned long done; -+ -+ if (channel == VC4_HVS_CHANNEL_DISABLED) -+ continue; -+ -+ if (!old_hvs_state->fifo_state[channel].in_use) -+ continue; -+ -+ commit = old_hvs_state->fifo_state[i].pending_commit; -+ if (!commit) -+ continue; -+ -+ done = wait_for_completion_timeout(&commit->hw_done, 10 * HZ); -+ if (!done) -+ drm_err(dev, "Timed out waiting for hw_done\n"); -+ -+ done = wait_for_completion_timeout(&commit->flip_done, 10 * HZ); -+ if (!done) -+ drm_err(dev, "Timed out waiting for flip_done\n"); -+ } -+ - drm_atomic_helper_commit_modeset_disables(dev, state); - - vc4_ctm_commit(vc4, state); -@@ -374,6 +437,36 @@ static void commit_work(struct work_struct *work) - vc4_atomic_complete_commit(state); - } - -+static int vc4_atomic_commit_setup(struct drm_atomic_state *state) -+{ -+ struct drm_crtc_state *crtc_state; -+ struct vc4_hvs_state *hvs_state; -+ struct drm_crtc *crtc; -+ unsigned int i; -+ -+ hvs_state = vc4_hvs_get_new_global_state(state); -+ if (!hvs_state) -+ return -EINVAL; -+ -+ for_each_new_crtc_in_state(state, crtc, crtc_state, i) { -+ struct vc4_crtc_state *vc4_crtc_state = -+ to_vc4_crtc_state(crtc_state); -+ unsigned int channel = -+ vc4_crtc_state->assigned_channel; -+ -+ if (channel == VC4_HVS_CHANNEL_DISABLED) -+ continue; -+ -+ if (!hvs_state->fifo_state[channel].in_use) -+ continue; -+ -+ hvs_state->fifo_state[channel].pending_commit = -+ drm_crtc_commit_get(crtc_state->commit); -+ } -+ -+ return 0; -+} -+ - /** - * vc4_atomic_commit - commit validated state object - * @dev: DRM device -@@ -695,6 +788,7 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - { - struct vc4_hvs_state *old_state = to_vc4_hvs_state(obj->state); - struct vc4_hvs_state *state; -+ unsigned int i; - - state = kzalloc(sizeof(*state), GFP_KERNEL); - if (!state) -@@ -704,6 +798,16 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - - state->unassigned_channels = old_state->unassigned_channels; - -+ for (i = 0; i < HVS_NUM_CHANNELS; i++) { -+ state->fifo_state[i].in_use = old_state->fifo_state[i].in_use; -+ -+ if (!old_state->fifo_state[i].pending_commit) -+ continue; -+ -+ state->fifo_state[i].pending_commit = -+ drm_crtc_commit_get(old_state->fifo_state[i].pending_commit); -+ } -+ - return &state->base; - } - -@@ -711,6 +815,14 @@ static void vc4_hvs_channels_destroy_state(struct drm_private_obj *obj, - struct drm_private_state *state) - { - struct vc4_hvs_state *hvs_state = to_vc4_hvs_state(state); -+ unsigned int i; -+ -+ for (i = 0; i < HVS_NUM_CHANNELS; i++) { -+ if (!hvs_state->fifo_state[i].pending_commit) -+ continue; -+ -+ drm_crtc_commit_put(hvs_state->fifo_state[i].pending_commit); -+ } - - kfree(hvs_state); - } -@@ -807,7 +919,10 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - - /* If we're disabling our CRTC, we put back our channel */ - if (!new_crtc_state->enable) { -- hvs_new_state->unassigned_channels |= BIT(old_vc4_crtc_state->assigned_channel); -+ channel = old_vc4_crtc_state->assigned_channel; -+ -+ hvs_new_state->unassigned_channels |= BIT(channel); -+ hvs_new_state->fifo_state[channel].in_use = false; - new_vc4_crtc_state->assigned_channel = VC4_HVS_CHANNEL_DISABLED; - continue; - } -@@ -843,6 +958,7 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - channel = ffs(matching_channels) - 1; - new_vc4_crtc_state->assigned_channel = channel; - hvs_new_state->unassigned_channels &= ~BIT(channel); -+ hvs_new_state->fifo_state[channel].in_use = true; - } - - return 0; -@@ -868,6 +984,10 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) - return vc4_load_tracker_atomic_check(state); - } - -+static struct drm_mode_config_helper_funcs vc4_mode_config_helpers = { -+ .atomic_commit_setup = vc4_atomic_commit_setup, -+}; -+ - static const struct drm_mode_config_funcs vc4_mode_funcs = { - .atomic_check = vc4_atomic_check, - .atomic_commit = vc4_atomic_commit, -@@ -914,6 +1034,7 @@ int vc4_kms_load(struct drm_device *dev) - } - - dev->mode_config.funcs = &vc4_mode_funcs; -+ dev->mode_config.helper_private = &vc4_mode_config_helpers; - dev->mode_config.preferred_depth = 24; - dev->mode_config.async_page_flip = true; - dev->mode_config.allow_fb_modifiers = true; --- -2.18.4 - - -From 792e9324d200e2ab64f607a76e9df9e1360327f8 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Fri, 4 Dec 2020 16:11:36 +0100 -Subject: [PATCH 760/834] drm/vc4: kms: Remove unassigned_channels from the HVS - state - -The HVS state now has both unassigned_channels that reflects the -channels that are not used in the associated state, and the in_use -boolean for each channel that says whether or not a particular channel -is in use. - -Both express pretty much the same thing, and we need the in_use variable -to properly track the commits, so let's get rid of unassigned_channels. - -Suggested-by: Thomas Zimmermann -Signed-off-by: Maxime Ripard -Reviewed-by: Thomas Zimmermann -Link: https://patchwork.freedesktop.org/patch/msgid/20201204151138.1739736-6-maxime@cerno.tech ---- - drivers/gpu/drm/vc4/vc4_kms.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 4103c9bb58ee..7b02bff7d939 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -39,7 +39,6 @@ static struct vc4_ctm_state *to_vc4_ctm_state(struct drm_private_state *priv) - - struct vc4_hvs_state { - struct drm_private_state base; -- unsigned int unassigned_channels; - - struct { - unsigned in_use: 1; -@@ -796,7 +795,6 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - - __drm_atomic_helper_private_obj_duplicate_state(obj, &state->base); - -- state->unassigned_channels = old_state->unassigned_channels; - - for (i = 0; i < HVS_NUM_CHANNELS; i++) { - state->fifo_state[i].in_use = old_state->fifo_state[i].in_use; -@@ -847,7 +845,6 @@ static int vc4_hvs_channels_obj_init(struct vc4_dev *vc4) - if (!state) - return -ENOMEM; - -- state->unassigned_channels = GENMASK(HVS_NUM_CHANNELS - 1, 0); - drm_atomic_private_obj_init(&vc4->base, &vc4->hvs_channels, - &state->base, - &vc4_hvs_state_funcs); -@@ -892,12 +889,17 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - struct vc4_hvs_state *hvs_new_state; - struct drm_crtc_state *old_crtc_state, *new_crtc_state; - struct drm_crtc *crtc; -+ unsigned int unassigned_channels = 0; - unsigned int i; - - hvs_new_state = vc4_hvs_get_global_state(state); - if (!hvs_new_state) - return -EINVAL; - -+ for (i = 0; i < ARRAY_SIZE(hvs_new_state->fifo_state); i++) -+ if (!hvs_new_state->fifo_state[i].in_use) -+ unassigned_channels |= BIT(i); -+ - for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { - struct vc4_crtc_state *old_vc4_crtc_state = - to_vc4_crtc_state(old_crtc_state); -@@ -920,8 +922,6 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - /* If we're disabling our CRTC, we put back our channel */ - if (!new_crtc_state->enable) { - channel = old_vc4_crtc_state->assigned_channel; -- -- hvs_new_state->unassigned_channels |= BIT(channel); - hvs_new_state->fifo_state[channel].in_use = false; - new_vc4_crtc_state->assigned_channel = VC4_HVS_CHANNEL_DISABLED; - continue; -@@ -951,13 +951,13 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - * the future, we will need to have something smarter, - * but it works so far. - */ -- matching_channels = hvs_new_state->unassigned_channels & vc4_crtc->data->hvs_available_channels; -+ matching_channels = unassigned_channels & vc4_crtc->data->hvs_available_channels; - if (!matching_channels) - return -EINVAL; - - channel = ffs(matching_channels) - 1; - new_vc4_crtc_state->assigned_channel = channel; -- hvs_new_state->unassigned_channels &= ~BIT(channel); -+ unassigned_channels &= ~BIT(channel); - hvs_new_state->fifo_state[channel].in_use = true; - } - --- -2.18.4 - - -From b8b45d036198b44ecb4e49e66d540b8b82004e94 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Fri, 4 Dec 2020 16:11:37 +0100 -Subject: [PATCH 761/834] drm/vc4: kms: Remove async modeset semaphore - -Now that we have proper ordering guaranteed by the previous patch, the -semaphore is redundant and can be removed. - -Acked-by: Thomas Zimmermann -Signed-off-by: Maxime Ripard ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 13 ------------- - drivers/gpu/drm/vc4/vc4_drv.h | 2 -- - drivers/gpu/drm/vc4/vc4_kms.c | 24 ++---------------------- - 3 files changed, 2 insertions(+), 37 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index b341b1f6fbc1..d45fbe2fd3be 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -750,7 +750,6 @@ vc4_async_page_flip_complete(struct vc4_seqno_cb *cb) - container_of(cb, struct vc4_async_flip_state, cb); - struct drm_crtc *crtc = flip_state->crtc; - struct drm_device *dev = crtc->dev; -- struct vc4_dev *vc4 = to_vc4_dev(dev); - struct drm_plane *plane = crtc->primary; - - vc4_plane_async_set_fb(plane, flip_state->fb); -@@ -782,8 +781,6 @@ vc4_async_page_flip_complete(struct vc4_seqno_cb *cb) - } - - kfree(flip_state); -- -- up(&vc4->async_modeset); - } - - /* Implements async (non-vblank-synced) page flips. -@@ -798,7 +795,6 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, - uint32_t flags) - { - struct drm_device *dev = crtc->dev; -- struct vc4_dev *vc4 = to_vc4_dev(dev); - struct drm_plane *plane = crtc->primary; - int ret = 0; - struct vc4_async_flip_state *flip_state; -@@ -827,15 +823,6 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, - flip_state->crtc = crtc; - flip_state->event = event; - -- /* Make sure all other async modesetes have landed. */ -- ret = down_interruptible(&vc4->async_modeset); -- if (ret) { -- drm_framebuffer_put(fb); -- vc4_bo_dec_usecnt(bo); -- kfree(flip_state); -- return ret; -- } -- - /* Save the current FB before it's replaced by the new one in - * drm_atomic_set_fb_for_plane(). We'll need the old FB in - * vc4_async_page_flip_complete() to decrement the BO usecnt and keep -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 3b9a9c92240d..c974bb0ca161 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -216,8 +216,6 @@ struct vc4_dev { - struct work_struct reset_work; - } hangcheck; - -- struct semaphore async_modeset; -- - struct drm_modeset_lock ctm_state_lock; - struct drm_private_obj ctm_manager; - struct drm_private_obj hvs_channels; -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 7b02bff7d939..24dea3acb9de 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -424,8 +424,6 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - clk_request_done(core_req); - - drm_atomic_state_put(state); -- -- up(&vc4->async_modeset); - } - - static void commit_work(struct work_struct *work) -@@ -483,26 +481,17 @@ static int vc4_atomic_commit(struct drm_device *dev, - struct drm_atomic_state *state, - bool nonblock) - { -- struct vc4_dev *vc4 = to_vc4_dev(dev); - int ret; - - if (state->async_update) { -- ret = down_interruptible(&vc4->async_modeset); -- if (ret) -- return ret; -- - ret = drm_atomic_helper_prepare_planes(dev, state); -- if (ret) { -- up(&vc4->async_modeset); -+ if (ret) - return ret; -- } - - drm_atomic_helper_async_commit(dev, state); - - drm_atomic_helper_cleanup_planes(dev, state); - -- up(&vc4->async_modeset); -- - return 0; - } - -@@ -519,21 +508,14 @@ static int vc4_atomic_commit(struct drm_device *dev, - - INIT_WORK(&state->commit_work, commit_work); - -- ret = down_interruptible(&vc4->async_modeset); -- if (ret) -- return ret; -- - ret = drm_atomic_helper_prepare_planes(dev, state); -- if (ret) { -- up(&vc4->async_modeset); -+ if (ret) - return ret; -- } - - if (!nonblock) { - ret = drm_atomic_helper_wait_for_fences(dev, state, true); - if (ret) { - drm_atomic_helper_cleanup_planes(dev, state); -- up(&vc4->async_modeset); - return ret; - } - } -@@ -1013,8 +995,6 @@ int vc4_kms_load(struct drm_device *dev) - vc4->load_tracker_enabled = true; - } - -- sema_init(&vc4->async_modeset, 1); -- - /* Set support for vblank irq fast disable, before drm_vblank_init() */ - dev->vblank_disable_immediate = true; - --- -2.18.4 - - -From 6e6c25e5e31a989bc52feeefc2cee792c91873cd Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Fri, 4 Dec 2020 16:11:38 +0100 -Subject: [PATCH 762/834] drm/vc4: kms: Convert to atomic helpers - -Now that the semaphore is gone, our atomic_commit implementation is -basically drm_atomic_helper_commit with a somewhat custom commit_tail, -the main difference being that we're using wait_for_flip_done instead of -wait_for_vblanks used in the drm_atomic_helper_commit_tail helper. - -Let's switch to using drm_atomic_helper_commit. - -Acked-by: Thomas Zimmermann -Signed-off-by: Maxime Ripard ---- - drivers/gpu/drm/vc4/vc4_kms.c | 122 ++++------------------------------ - 1 file changed, 13 insertions(+), 109 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 24dea3acb9de..45de906ba085 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -335,8 +335,7 @@ static void vc5_hvs_pv_muxing_commit(struct vc4_dev *vc4, - } - } - --static void --vc4_atomic_complete_commit(struct drm_atomic_state *state) -+static void vc4_atomic_commit_tail(struct drm_atomic_state *state) - { - struct drm_device *dev = state->dev; - struct vc4_dev *vc4 = to_vc4_dev(dev); -@@ -361,10 +360,6 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - if (vc4->hvs && vc4->hvs->hvs5) - core_req = clk_request_start(hvs->core_clk, 500000000); - -- drm_atomic_helper_wait_for_fences(dev, state, false); -- -- drm_atomic_helper_wait_for_dependencies(state); -- - old_hvs_state = vc4_hvs_get_old_global_state(state); - if (!old_hvs_state) - return; -@@ -418,29 +413,27 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - - drm_atomic_helper_cleanup_planes(dev, state); - -- drm_atomic_helper_commit_cleanup_done(state); -- - if (vc4->hvs && vc4->hvs->hvs5) - clk_request_done(core_req); -- -- drm_atomic_state_put(state); --} -- --static void commit_work(struct work_struct *work) --{ -- struct drm_atomic_state *state = container_of(work, -- struct drm_atomic_state, -- commit_work); -- vc4_atomic_complete_commit(state); - } - - static int vc4_atomic_commit_setup(struct drm_atomic_state *state) - { -+ struct drm_device *dev = state->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(dev); - struct drm_crtc_state *crtc_state; - struct vc4_hvs_state *hvs_state; - struct drm_crtc *crtc; - unsigned int i; - -+ /* We know for sure we don't want an async update here. Set -+ * state->legacy_cursor_update to false to prevent -+ * drm_atomic_helper_setup_commit() from auto-completing -+ * commit->flip_done. -+ */ -+ if (!vc4->firmware_kms) -+ state->legacy_cursor_update = false; -+ - hvs_state = vc4_hvs_get_new_global_state(state); - if (!hvs_state) - return -EINVAL; -@@ -464,95 +457,6 @@ static int vc4_atomic_commit_setup(struct drm_atomic_state *state) - return 0; - } - --/** -- * vc4_atomic_commit - commit validated state object -- * @dev: DRM device -- * @state: the driver state object -- * @nonblock: nonblocking commit -- * -- * This function commits a with drm_atomic_helper_check() pre-validated state -- * object. This can still fail when e.g. the framebuffer reservation fails. For -- * now this doesn't implement asynchronous commits. -- * -- * RETURNS -- * Zero for success or -errno. -- */ --static int vc4_atomic_commit(struct drm_device *dev, -- struct drm_atomic_state *state, -- bool nonblock) --{ -- int ret; -- -- if (state->async_update) { -- ret = drm_atomic_helper_prepare_planes(dev, state); -- if (ret) -- return ret; -- -- drm_atomic_helper_async_commit(dev, state); -- -- drm_atomic_helper_cleanup_planes(dev, state); -- -- return 0; -- } -- -- /* We know for sure we don't want an async update here. Set -- * state->legacy_cursor_update to false to prevent -- * drm_atomic_helper_setup_commit() from auto-completing -- * commit->flip_done. -- */ -- if (!vc4->firmware_kms) -- state->legacy_cursor_update = false; -- ret = drm_atomic_helper_setup_commit(state, nonblock); -- if (ret) -- return ret; -- -- INIT_WORK(&state->commit_work, commit_work); -- -- ret = drm_atomic_helper_prepare_planes(dev, state); -- if (ret) -- return ret; -- -- if (!nonblock) { -- ret = drm_atomic_helper_wait_for_fences(dev, state, true); -- if (ret) { -- drm_atomic_helper_cleanup_planes(dev, state); -- return ret; -- } -- } -- -- /* -- * This is the point of no return - everything below never fails except -- * when the hw goes bonghits. Which means we can commit the new state on -- * the software side now. -- */ -- -- BUG_ON(drm_atomic_helper_swap_state(state, false) < 0); -- -- /* -- * Everything below can be run asynchronously without the need to grab -- * any modeset locks at all under one condition: It must be guaranteed -- * that the asynchronous work has either been cancelled (if the driver -- * supports it, which at least requires that the framebuffers get -- * cleaned up with drm_atomic_helper_cleanup_planes()) or completed -- * before the new state gets committed on the software side with -- * drm_atomic_helper_swap_state(). -- * -- * This scheme allows new atomic state updates to be prepared and -- * checked in parallel to the asynchronous completion of the previous -- * update. Which is important since compositors need to figure out the -- * composition of the next frame right after having submitted the -- * current layout. -- */ -- -- drm_atomic_state_get(state); -- if (nonblock) -- queue_work(system_unbound_wq, &state->commit_work); -- else -- vc4_atomic_complete_commit(state); -- -- return 0; --} -- - static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev, - struct drm_file *file_priv, - const struct drm_mode_fb_cmd2 *mode_cmd) -@@ -777,7 +681,6 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - - __drm_atomic_helper_private_obj_duplicate_state(obj, &state->base); - -- - for (i = 0; i < HVS_NUM_CHANNELS; i++) { - state->fifo_state[i].in_use = old_state->fifo_state[i].in_use; - -@@ -968,11 +871,12 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) - - static struct drm_mode_config_helper_funcs vc4_mode_config_helpers = { - .atomic_commit_setup = vc4_atomic_commit_setup, -+ .atomic_commit_tail = vc4_atomic_commit_tail, - }; - - static const struct drm_mode_config_funcs vc4_mode_funcs = { - .atomic_check = vc4_atomic_check, -- .atomic_commit = vc4_atomic_commit, -+ .atomic_commit = drm_atomic_helper_commit, - .fb_create = vc4_fb_create, - }; - --- -2.18.4 - - -From 564f93978293fe272d5d995460389eefd57681fa Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Wed, 26 May 2021 16:13:02 +0200 -Subject: [PATCH 763/834] drm/vc4: Increase the core clock based on HVS load - -Depending on a given HVS output (HVS to PixelValves) and input (planes -attached to a channel) load, the HVS needs for the core clock to be -raised above its boot time default. - -Failing to do so will result in a vblank timeout and a stalled display -pipeline. - -Signed-off-by: Maxime Ripard ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 15 +++++ - drivers/gpu/drm/vc4/vc4_drv.h | 3 + - drivers/gpu/drm/vc4/vc4_kms.c | 120 +++++++++++++++++++++++++++++++-- - 3 files changed, 132 insertions(+), 6 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index d45fbe2fd3be..321f47b6dd43 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -644,12 +644,27 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, - struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc_state); - struct drm_connector *conn; - struct drm_connector_state *conn_state; -+ struct drm_encoder *encoder; - int ret, i; - - ret = vc4_hvs_atomic_check(crtc, crtc_state); - if (ret) - return ret; - -+ encoder = vc4_get_crtc_encoder(crtc, crtc_state); -+ if (encoder) { -+ const struct drm_display_mode *mode = &crtc_state->adjusted_mode; -+ struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); -+ -+ mode = &crtc_state->adjusted_mode; -+ if (vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0) { -+ vc4_state->hvs_load = max(mode->clock * mode->hdisplay / mode->htotal + 1000, -+ mode->clock * 9 / 10) * 1000; -+ } else { -+ vc4_state->hvs_load = mode->clock * 1000; -+ } -+ } -+ - for_each_new_connector_in_state(crtc_state->state, conn, conn_state, - i) { - if (conn_state->crtc != crtc) -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index c974bb0ca161..3a86fa276793 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -324,6 +324,7 @@ struct vc4_hvs { - u32 __iomem *dlist; - - struct clk *core_clk; -+ struct clk_request *core_req; - - /* Memory manager for CRTCs to allocate space in the display - * list. Units are dwords. -@@ -535,6 +536,8 @@ struct vc4_crtc_state { - unsigned int bottom; - } margins; - -+ unsigned long hvs_load; -+ - /* Transitional state below, only valid during atomic commits */ - bool update_muxing; - }; -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 45de906ba085..0f7fad6b2393 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -39,9 +39,11 @@ static struct vc4_ctm_state *to_vc4_ctm_state(struct drm_private_state *priv) - - struct vc4_hvs_state { - struct drm_private_state base; -+ unsigned long core_clock_rate; - - struct { - unsigned in_use: 1; -+ unsigned long fifo_load; - struct drm_crtc_commit *pending_commit; - } fifo_state[HVS_NUM_CHANNELS]; - }; -@@ -342,11 +344,20 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) - struct vc4_hvs *hvs = vc4->hvs; - struct drm_crtc_state *old_crtc_state; - struct drm_crtc_state *new_crtc_state; -+ struct vc4_hvs_state *new_hvs_state; - struct drm_crtc *crtc; - struct vc4_hvs_state *old_hvs_state; - struct clk_request *core_req; - int i; - -+ old_hvs_state = vc4_hvs_get_old_global_state(state); -+ if (WARN_ON(!old_hvs_state)) -+ return; -+ -+ new_hvs_state = vc4_hvs_get_new_global_state(state); -+ if (WARN_ON(!new_hvs_state)) -+ return; -+ - for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { - struct vc4_crtc_state *vc4_crtc_state; - -@@ -357,12 +368,19 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) - vc4_hvs_mask_underrun(dev, vc4_crtc_state->assigned_channel); - } - -- if (vc4->hvs && vc4->hvs->hvs5) -+ if (vc4->hvs && vc4->hvs->hvs5) { -+ /* -+ * Do a temporary request on the core clock during the -+ * modeset. -+ */ - core_req = clk_request_start(hvs->core_clk, 500000000); - -- old_hvs_state = vc4_hvs_get_old_global_state(state); -- if (!old_hvs_state) -- return; -+ /* -+ * And remove the previous one based on the HVS -+ * requirements if any. -+ */ -+ clk_request_done(hvs->core_req); -+ } - - for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) { - struct vc4_crtc_state *vc4_crtc_state = -@@ -413,8 +431,20 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) - - drm_atomic_helper_cleanup_planes(dev, state); - -- if (vc4->hvs && vc4->hvs->hvs5) -+ if (vc4->hvs && vc4->hvs->hvs5) { -+ drm_dbg(dev, "Running the core clock at %lu Hz\n", -+ new_hvs_state->core_clock_rate); -+ -+ /* -+ * Request a clock rate based on the current HVS -+ * requirements. -+ */ -+ hvs->core_req = clk_request_start(hvs->core_clk, -+ new_hvs_state->core_clock_rate); -+ -+ /* And drop the temporary request */ - clk_request_done(core_req); -+ } - } - - static int vc4_atomic_commit_setup(struct drm_atomic_state *state) -@@ -683,6 +713,7 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - - for (i = 0; i < HVS_NUM_CHANNELS; i++) { - state->fifo_state[i].in_use = old_state->fifo_state[i].in_use; -+ state->fifo_state[i].fifo_load = old_state->fifo_state[i].fifo_load; - - if (!old_state->fifo_state[i].pending_commit) - continue; -@@ -691,6 +722,9 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - drm_crtc_commit_get(old_state->fifo_state[i].pending_commit); - } - -+ state->core_clock_rate = old_state->core_clock_rate; -+ -+ - return &state->base; - } - -@@ -849,6 +883,76 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - return 0; - } - -+static int -+vc4_core_clock_atomic_check(struct drm_atomic_state *state) -+{ -+ struct vc4_dev *vc4 = to_vc4_dev(state->dev); -+ struct drm_private_state *priv_state; -+ struct vc4_hvs_state *hvs_new_state; -+ struct vc4_load_tracker_state *load_state; -+ struct drm_crtc_state *old_crtc_state, *new_crtc_state; -+ struct drm_crtc *crtc; -+ unsigned int num_outputs; -+ unsigned long pixel_rate; -+ unsigned long cob_rate; -+ unsigned int i; -+ -+ priv_state = drm_atomic_get_private_obj_state(state, -+ &vc4->load_tracker); -+ if (IS_ERR(priv_state)) -+ return PTR_ERR(priv_state); -+ -+ load_state = to_vc4_load_tracker_state(priv_state); -+ -+ hvs_new_state = vc4_hvs_get_global_state(state); -+ if (!hvs_new_state) -+ return -EINVAL; -+ -+ for_each_oldnew_crtc_in_state(state, crtc, -+ old_crtc_state, -+ new_crtc_state, -+ i) { -+ if (old_crtc_state->active) { -+ struct vc4_crtc_state *old_vc4_state = -+ to_vc4_crtc_state(old_crtc_state); -+ unsigned int channel = old_vc4_state->assigned_channel; -+ -+ hvs_new_state->fifo_state[channel].fifo_load = 0; -+ } -+ -+ if (new_crtc_state->active) { -+ struct vc4_crtc_state *new_vc4_state = -+ to_vc4_crtc_state(new_crtc_state); -+ unsigned int channel = new_vc4_state->assigned_channel; -+ -+ hvs_new_state->fifo_state[channel].fifo_load = -+ new_vc4_state->hvs_load; -+ } -+ } -+ -+ cob_rate = 0; -+ num_outputs = 0; -+ for (i = 0; i < HVS_NUM_CHANNELS; i++) { -+ if (!hvs_new_state->fifo_state[i].in_use) -+ continue; -+ -+ num_outputs++; -+ cob_rate += hvs_new_state->fifo_state[i].fifo_load; -+ } -+ -+ pixel_rate = load_state->hvs_load; -+ if (num_outputs > 1) { -+ pixel_rate = (pixel_rate * 40) / 100; -+ } else { -+ pixel_rate = (pixel_rate * 60) / 100; -+ } -+ -+ hvs_new_state->core_clock_rate = max(cob_rate, pixel_rate); -+ -+ return 0; -+} -+ -+ - static int - vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) - { -@@ -866,7 +970,11 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) - if (ret) - return ret; - -- return vc4_load_tracker_atomic_check(state); -+ ret = vc4_load_tracker_atomic_check(state); -+ if (ret) -+ return ret; -+ -+ return vc4_core_clock_atomic_check(state); - } - - static struct drm_mode_config_helper_funcs vc4_mode_config_helpers = { --- -2.18.4 - - -From ee131f4c41e8930d0d8810c709fd9470a0f62422 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Mon, 28 Jun 2021 11:15:13 +0200 -Subject: [PATCH 764/834] drm/vc4: Increase the core clock to a minimum of - 500MHz - -The core clock needs to be raised temporarily during a modeset to -500MHz. However, the HVS core clock requirement might be higher than -500MHz. This rate will be enforced at the end of the mode setting, -meaning that might might end up with a core clock rate lower than -planned on the first mode set. - -Use the maximum value of 500MHz and the HVS core clock rate for our -temporary boost to fix this issue. - -Signed-off-by: Maxime Ripard ---- - drivers/gpu/drm/vc4/vc4_kms.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 0f7fad6b2393..a2a03b52b275 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -369,11 +369,17 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) - } - - if (vc4->hvs && vc4->hvs->hvs5) { -+ unsigned long core_rate = max_t(unsigned long, -+ 500000000, -+ new_hvs_state->core_clock_rate); -+ -+ drm_dbg(dev, "Raising the core clock at %lu Hz\n", core_rate); -+ - /* - * Do a temporary request on the core clock during the - * modeset. - */ -- core_req = clk_request_start(hvs->core_clk, 500000000); -+ core_req = clk_request_start(hvs->core_clk, core_rate); - - /* - * And remove the previous one based on the HVS --- -2.18.4 - - -From 0d4c841623ee574879d0a52f65067abe0b34423a Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Thu, 3 Dec 2020 08:46:24 +0100 -Subject: [PATCH 765/834] drm/vc4: hdmi: Don't poll for the infoframes status - on setup - -The infoframes are sent at a regular interval as a data island packet, -so we don't need to wait for them to be sent when we're setting them up. - -However, we do need to poll when we're enabling since the we can't -update the packet RAM until it has been sent. - -Let's add a boolean flag to tell whether we want to poll or not to -support both cases. - -Suggested-by: Dave Stevenson -Signed-off-by: Maxime Ripard -Reviewed-by: Dave Stevenson -Link: https://patchwork.freedesktop.org/patch/msgid/20201203074624.721559-1-maxime@cerno.tech ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index d036e21647ef..87c7817c9003 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -381,7 +381,8 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, - } - - static int vc4_hdmi_stop_packet(struct drm_encoder *encoder, -- enum hdmi_infoframe_type type) -+ enum hdmi_infoframe_type type, -+ bool poll) - { - struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); - u32 packet_id = type - 0x80; -@@ -389,6 +390,9 @@ static int vc4_hdmi_stop_packet(struct drm_encoder *encoder, - HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, - HDMI_READ(HDMI_RAM_PACKET_CONFIG) & ~BIT(packet_id)); - -+ if (!poll) -+ return 0; -+ - return wait_for(!(HDMI_READ(HDMI_RAM_PACKET_STATUS) & - BIT(packet_id)), 100); - } -@@ -417,7 +421,7 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, - if (len < 0) - return; - -- ret = vc4_hdmi_stop_packet(encoder, frame->any.type); -+ ret = vc4_hdmi_stop_packet(encoder, frame->any.type, true); - if (ret) { - DRM_ERROR("Failed to wait for infoframe to go idle: %d\n", ret); - return; -@@ -1302,7 +1306,7 @@ static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) - int ret; - - vc4_hdmi->audio.streaming = false; -- ret = vc4_hdmi_stop_packet(encoder, HDMI_INFOFRAME_TYPE_AUDIO); -+ ret = vc4_hdmi_stop_packet(encoder, HDMI_INFOFRAME_TYPE_AUDIO, false); - if (ret) - dev_err(dev, "Failed to stop audio infoframe: %d\n", ret); - --- -2.18.4 - - -From 0768eb0613dc127ca1b30dd373efcf374460267f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 15 Dec 2020 16:42:35 +0100 -Subject: [PATCH 766/834] drm/vc4: hvs: Align the HVS atomic hooks to the new +Subject: [PATCH 727/889] drm/vc4: hvs: Align the HVS atomic hooks to the new API Since the CRTC setup in vc4 is split between the PixelValves/TXP and the @@ -239977,11 +235404,11 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-2-maxi 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 321f47b6dd43..8db8c0108f3a 100644 +index b341b1f6fbc1..6cfade4aab17 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -647,7 +647,7 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, - struct drm_encoder *encoder; +@@ -646,7 +646,7 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, + struct drm_connector_state *conn_state; int ret, i; - ret = vc4_hvs_atomic_check(crtc, crtc_state); @@ -239990,10 +235417,10 @@ index 321f47b6dd43..8db8c0108f3a 100644 return ret; diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 3a86fa276793..7387244af483 100644 +index 3b9a9c92240d..f73f0a6a7df8 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -925,11 +925,10 @@ void vc4_irq_reset(struct drm_device *dev); +@@ -924,11 +924,10 @@ void vc4_irq_reset(struct drm_device *dev); extern struct platform_driver vc4_hvs_driver; void vc4_hvs_stop_channel(struct drm_device *dev, unsigned int output); int vc4_hvs_get_fifo_from_output(struct drm_device *dev, unsigned int output); @@ -240055,10 +235482,10 @@ index 22430640786f..79ecaaa1ec42 100644 2.18.4 -From f2decba4290126f084d83dabf0b11cd14b67902d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 2 Nov 2020 14:38:34 +0100 -Subject: [PATCH 767/834] drm: Use the state pointer directly in atomic_check +Subject: [PATCH 728/889] drm: Use the state pointer directly in atomic_check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -240133,10 +235560,10 @@ index 4b46689634dd..743e57c1b44f 100644 static void drm_simple_kms_crtc_enable(struct drm_crtc *crtc, diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c -index 7309a66ea6e4..3e1bb0aefb87 100644 +index e06df6cf180b..d2f747d3695a 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c -@@ -282,7 +282,7 @@ static int mxsfb_crtc_atomic_check(struct drm_crtc *crtc, +@@ -322,7 +322,7 @@ static int mxsfb_crtc_atomic_check(struct drm_crtc *crtc, return -EINVAL; /* TODO: Is this needed ? */ @@ -240176,12 +235603,12 @@ index c0814cb1a296..c7c1fcc03b32 100644 return -EINVAL; } diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 8db8c0108f3a..5772c5fb436c 100644 +index 6cfade4aab17..d44453f27178 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -665,7 +665,7 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, - } - } +@@ -650,7 +650,7 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, + if (ret) + return ret; - for_each_new_connector_in_state(crtc_state->state, conn, conn_state, + for_each_new_connector_in_state(state, conn, conn_state, @@ -240189,10 +235616,10 @@ index 8db8c0108f3a..5772c5fb436c 100644 if (conn_state->crtc != crtc) continue; diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c -index 8d9cd623d995..6c95271f13b6 100644 +index 7d962874b8fe..d85909af1800 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c -@@ -1507,9 +1507,7 @@ zynqmp_disp_crtc_atomic_disable(struct drm_crtc *crtc, +@@ -1508,9 +1508,7 @@ zynqmp_disp_crtc_atomic_disable(struct drm_crtc *crtc, static int zynqmp_disp_crtc_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) { @@ -240207,10 +235634,10 @@ index 8d9cd623d995..6c95271f13b6 100644 2.18.4 -From e165b2078d3d07313f06e752e106786c8d8c6966 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 17 Jan 2018 23:15:18 +0200 -Subject: [PATCH 768/834] drm: vc4: Remove unnecessary drm_plane_cleanup() +Subject: [PATCH 729/889] drm: vc4: Remove unnecessary drm_plane_cleanup() wrapper Use the drm_plane_cleanup() function directly as the drm_plane_funcs @@ -240252,10 +235679,10 @@ index 333335f3c561..b4ba3b3b9129 100644 2.18.4 -From de7ac18cf9266ebcf50558a9ce737ade1168aab7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 18 Mar 2021 17:13:27 +0100 -Subject: [PATCH 769/834] drm/vc4: plane: Remove redundant assignment +Subject: [PATCH 730/889] drm/vc4: plane: Remove redundant assignment The vc4_plane_atomic_async_update function assigns twice in a row the src_h field in the drm_plane_state structure to the same value. Remove @@ -240284,10 +235711,10 @@ index b4ba3b3b9129..faa1ce6d6584 100644 2.18.4 -From a65cc3b3805c08d867748e603cedc33f2a97fd87 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 11 Dec 2020 13:42:36 +0200 -Subject: [PATCH 770/834] drm: automatic legacy gamma support +Subject: [PATCH 731/889] drm: automatic legacy gamma support To support legacy gamma ioctls the drivers need to set drm_crtc_funcs.gamma_set either to a custom implementation or to @@ -240327,10 +235754,10 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20201211114237.213288-2-tomi 19 files changed, 102 insertions(+), 101 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -index c699f77027be..87029151c0f1 100644 +index 3869f8b571ee..12ef26670f61 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -@@ -4988,7 +4988,6 @@ static void dm_disable_vblank(struct drm_crtc *crtc) +@@ -4989,7 +4989,6 @@ static void dm_disable_vblank(struct drm_crtc *crtc) static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = { .reset = dm_crtc_reset_state, .destroy = amdgpu_dm_crtc_destroy, @@ -240674,10 +236101,10 @@ index 0b11d5e8b715..3d698cd10626 100644 .disable_vblank = mtk_drm_crtc_disable_vblank, }; diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.c b/drivers/gpu/drm/nouveau/dispnv50/head.c -index 0542ca22b33a..69029e1c7923 100644 +index 3e5c1f1e5d5e..32f80b69f9a7 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head.c -@@ -501,7 +501,6 @@ nv50_head_destroy(struct drm_crtc *crtc) +@@ -506,7 +506,6 @@ nv50_head_destroy(struct drm_crtc *crtc) static const struct drm_crtc_funcs nv50_head_func = { .reset = nv50_head_reset, @@ -240685,7 +236112,7 @@ index 0542ca22b33a..69029e1c7923 100644 .destroy = nv50_head_destroy, .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, -@@ -516,7 +515,6 @@ nv50_head_func = { +@@ -521,7 +520,6 @@ nv50_head_func = { static const struct drm_crtc_funcs nvd9_head_func = { .reset = nv50_head_reset, @@ -240742,10 +236169,10 @@ index 949511a0a24f..6f3b523e16e8 100644 /* diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 5772c5fb436c..028aa7b83229 100644 +index d44453f27178..c8b5db0b45cf 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -939,7 +939,6 @@ static const struct drm_crtc_funcs vc4_crtc_funcs = { +@@ -937,7 +937,6 @@ static const struct drm_crtc_funcs vc4_crtc_funcs = { .reset = vc4_crtc_reset, .atomic_duplicate_state = vc4_crtc_duplicate_state, .atomic_destroy_state = vc4_crtc_destroy_state, @@ -240784,10 +236211,10 @@ index 85df04c8e62f..dc7e3aef7f13 100644 2.18.4 -From 5326d3543c8058d7690d259797c18bd46a0aa7b1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 18 Nov 2020 10:47:58 +0100 -Subject: [PATCH 771/834] drm: Pass the full state to connectors atomic +Subject: [PATCH 732/889] drm: Pass the full state to connectors atomic functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -241052,7 +236479,7 @@ index ecaa538b2d35..3e5558def1c5 100644 return &intel_dp->mst_encoders[crtc->pipe]->base.base; } diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c -index 5b8cabb099eb..c6367035970e 100644 +index c2d34c91e840..afd2736f040d 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -32,6 +32,7 @@ @@ -241173,10 +236600,10 @@ index f8225bcfee2e..cbe613858a93 100644 2.18.4 -From 778f01104c01f93e6ec71f122ffc6c67dd5137b0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Deepak R Varma Date: Fri, 6 Nov 2020 01:51:35 +0530 -Subject: [PATCH 772/834] drm/vc4: replace idr_init() by idr_init_base() +Subject: [PATCH 733/889] drm/vc4: replace idr_init() by idr_init_base() idr_init() uses base 0 which is an invalid identifier for this driver. The idr_alloc for this driver uses VC4_PERFMONID_MIN as start value for @@ -241211,10 +236638,10 @@ index f4aa75efd16b..18abc06335c1 100644 2.18.4 -From 34096e0302d40152a3f58c18af50759d3447cd47 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 16 Nov 2020 17:41:07 +0000 -Subject: [PATCH 773/834] drm/vc4/vc4_hdmi_regs: Mark some data sets as +Subject: [PATCH 734/889] drm/vc4/vc4_hdmi_regs: Mark some data sets as __maybe_unused MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -241276,10 +236703,10 @@ index 06b0739e2ba3..99dde6e06a37 100644 2.18.4 -From 8e47e6aecc8432d18408492efc23f1eec533b062 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Bernard Zhao Date: Tue, 2 Feb 2021 04:23:38 -0800 -Subject: [PATCH 774/834] drm/vc4: remove unneeded variable: "ret" +Subject: [PATCH 735/889] drm/vc4: remove unneeded variable: "ret" remove unneeded variable: "ret". @@ -241317,10 +236744,10 @@ index b641252939d8..445d3bab89e0 100644 2.18.4 -From 4edc64ce0d4364f564d1781c6e44a65c8bf1399f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jesse Taube Date: Thu, 8 Jul 2021 16:32:16 -0400 -Subject: [PATCH 775/834] overlays: Add overlay for cap1106 capacitive touch +Subject: [PATCH 736/889] overlays: Add overlay for cap1106 capacitive touch sensor Signed-off-by: Jesse Taube @@ -241422,10 +236849,10 @@ index 000000000000..0a585e725f84 2.18.4 -From f4a3e2ff15e1c8ecd02278a001bc180591bf021f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 10 Jul 2021 09:51:52 +0100 -Subject: [PATCH 776/834] configs: Add KEYBOARD_CAP11XX=m +Subject: [PATCH 737/889] configs: Add KEYBOARD_CAP11XX=m See: https://github.com/raspberrypi/linux/pull/4442 @@ -241502,10 +236929,10 @@ index da84139ca6ca..0cd854301692 100644 2.18.4 -From 2314a523e7808ceae150402631096d13cae9d971 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 12 Jul 2021 12:27:59 +0100 -Subject: [PATCH 777/834] drm/vc4: Fix margin calculations for the right/bottom +Subject: [PATCH 738/889] drm/vc4: Fix margin calculations for the right/bottom edges The calculations clipped the right/bottom edge of the clipped @@ -241546,10 +236973,10 @@ index faa1ce6d6584..7947cf47b6e1 100644 2.18.4 -From a12b0cd6f9292f336c5dc12442fa73f4ed5f7892 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 12 Jul 2021 13:06:07 +0100 -Subject: [PATCH 778/834] ydrm/vc4: fkms: Fix margin calculations for the +Subject: [PATCH 739/889] ydrm/vc4: fkms: Fix margin calculations for the right/bottom edges The calculations clipped the right/bottom edge of the clipped @@ -241590,10 +237017,10 @@ index e643bbe96941..d6d50b5f64dd 100644 2.18.4 -From ed728af8bdd531d45d2184c986a479b1f590e681 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 12 Jul 2021 15:15:44 +0100 -Subject: [PATCH 779/834] ARM: dts: bcm2711: fold in the correct interrupt +Subject: [PATCH 740/889] ARM: dts: bcm2711: fold in the correct interrupt The new vec node in bcm2711.dtsi should have the correct interrupt number to start with, rather than include the bcm283x version and @@ -241629,10 +237056,10 @@ index c6b496f364c3..2933cf91c27d 100644 2.18.4 -From 0243394f36e7e45d4e4766c65fc2b7ee87ab9556 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: "Sunip K. Mukherjee" Date: Sun, 4 Jul 2021 16:03:07 -0400 -Subject: [PATCH 780/834] overlays: Add overlay for Si446x Transceiver SPI +Subject: [PATCH 741/889] overlays: Add overlay for Si446x Transceiver SPI See: https://github.com/raspberrypi/linux/pull/4430 @@ -241740,10 +237167,10 @@ index 000000000000..90495f0941fb 2.18.4 -From bc19de734353b56663205e4da447d822517d73f3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:07:30 +0200 -Subject: [PATCH 781/834] drm/vc4: Fix timings for VEC modes +Subject: [PATCH 742/889] drm/vc4: Fix timings for VEC modes This commit fixes vertical timings of the VEC (composite output) modes to accurately represent the 525-line ("NTSC") and 625-line ("PAL") ITU-R @@ -241765,7 +237192,7 @@ Signed-off-by: Mateusz Kwiatkowski 2 files changed, 45 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 028aa7b83229..6bb52539a5a6 100644 +index c8b5db0b45cf..008d264cc372 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -316,8 +316,14 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode @@ -241896,10 +237323,10 @@ index a467ceba75e4..7008684f6936 100644 2.18.4 -From e3544a0369e5a8be1f0a5cd1f65923418e4d96ed Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:07:49 +0200 -Subject: [PATCH 782/834] drm/vc4: Refactor VEC TV mode setting +Subject: [PATCH 743/889] drm/vc4: Refactor VEC TV mode setting Change the mode_set function pointer logic to declarative config0, config1 and custom_freq fields, to make TV mode setting logic more @@ -242069,10 +237496,10 @@ index 7008684f6936..aa3f11c383d7 100644 2.18.4 -From 7e3081fcd393bce1f72d230689bc84fa94692b9b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:07:53 +0200 -Subject: [PATCH 783/834] drm/vc4: Fix definition of PAL-M mode +Subject: [PATCH 744/889] drm/vc4: Fix definition of PAL-M mode PAL-M is a Brazilian analog TV standard that uses a PAL-style chroma subcarrier at 3.575611[888111] MHz on top of 525-line (480i60) timings. @@ -242152,10 +237579,10 @@ index aa3f11c383d7..db489a1a65e3 100644 2.18.4 -From 5e252f8a42f841a8c99e628be9733dc5103a5cf2 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:07:58 +0200 -Subject: [PATCH 784/834] drm/vc4: Add support for more analog TV standards +Subject: [PATCH 745/889] drm/vc4: Add support for more analog TV standards Add support for the following composite output modes (all of them are somewhat more obscure than the previously defined ones): @@ -242306,10 +237733,10 @@ index db489a1a65e3..e316a3943566 100644 2.18.4 -From 8bed5569bd09d5b93fe8eabd4251c59cf3f27397 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:08:01 +0200 -Subject: [PATCH 785/834] drm/vc4: Allow setting the TV norm via module +Subject: [PATCH 746/889] drm/vc4: Allow setting the TV norm via module parameter Similar to the ch7006 and nouveau drivers, introduce a "tv_mode" module @@ -242456,10 +237883,10 @@ index e316a3943566..b3eb3aaf0e89 100644 2.18.4 -From d6dd3eea63465975eb285915e94a9c2376fdb2fd Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:08:05 +0200 -Subject: [PATCH 786/834] drm/vc4: Refactor mode checking logic +Subject: [PATCH 747/889] drm/vc4: Refactor mode checking logic Replace drm_encoder_helper_funcs::atomic_check with drm_connector_helper_funcs::atomic_check - the former is not called @@ -242547,10 +237974,10 @@ index b3eb3aaf0e89..596b59ff6c9a 100644 2.18.4 -From 00ce615ccdc8d5008377e6ad4207085d7cc3ba09 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Thu, 15 Jul 2021 20:08:13 +0100 -Subject: [PATCH 787/834] drm/vc4: Fix typo when getting firmware node +Subject: [PATCH 748/889] drm/vc4: Fix typo when getting firmware node Signed-off-by: Dom Cobley --- @@ -242574,10 +238001,10 @@ index 919b2d1e6bd5..dec3620bc7c5 100644 2.18.4 -From 0776ab53fa2a7b34f0006d76c338bc9144338310 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 16 Jul 2021 15:23:50 +0100 -Subject: [PATCH 788/834] configs: Add SND_SOC_WM8960=m +Subject: [PATCH 749/889] configs: Add SND_SOC_WM8960=m Enable the WM8960 driver module, as used by the wm8960-soundcard overlay. @@ -242657,10 +238084,10 @@ index 0cd854301692..f2ed34ca43b0 100644 2.18.4 -From 95f74f86fd0887182ebada8c086091aa2a747569 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 19 Jul 2021 10:47:02 +0100 -Subject: [PATCH 789/834] ARM: dts: bcm2711: Tidy the HDMI I2C aliases +Subject: [PATCH 750/889] ARM: dts: bcm2711: Tidy the HDMI I2C aliases The bcm2711 vc3-kms-v3d overlay enables the I2C instances used for EDID data. Give these distinct I2C interface numbers (20 & 21) to @@ -242777,10 +238204,10 @@ index a39e5c216e63..9f9a25bb52c3 100644 2.18.4 -From 85c98baae842bf429d0541c4f8a7f434ee0d448f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 20 Jul 2021 15:10:03 +0100 -Subject: [PATCH 790/834] media: i2c: imx477: Fix framerates for 1332x990 mode +Subject: [PATCH 751/889] media: i2c: imx477: Fix framerates for 1332x990 mode The imx477 driver's line length for this mode had not been updated to the value supplied to us by the sensor manufacturer. With this @@ -242808,10 +238235,10 @@ index 521953e71686..fcde88d90a8f 100644 2.18.4 -From 0e283796551423ec025648f21b26ba81b299c55e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 13 Mar 2021 12:25:43 +0100 -Subject: [PATCH 791/834] drm/uapi: Add USB connector type +Subject: [PATCH 752/889] drm/uapi: Add USB connector type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -242865,10 +238292,10 @@ index 863eda048265..8bc13daec0a3 100644 2.18.4 -From d3d1ee8d9e5f0a468f24c6f3ecc3cc5e0538f0a3 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 13 Mar 2021 12:25:45 +0100 -Subject: [PATCH 792/834] drm: Add GUD USB Display driver +Subject: [PATCH 753/889] drm: Add GUD USB Display driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -245572,10 +240999,10 @@ index 000000000000..0b46b54fe56e 2.18.4 -From 4a43d8191c1c9051d7020853500d6cc047c4513c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: kernel test robot Date: Mon, 22 Mar 2021 18:44:33 +0100 -Subject: [PATCH 793/834] drm/gud: fix sizeof use +Subject: [PATCH 754/889] drm/gud: fix sizeof use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -245616,10 +241043,10 @@ index ec495dcd6122..9ae5a0020449 100644 2.18.4 -From 72138879883cb2af1e6ef28c92e42bbfd96e2579 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: kernel test robot Date: Mon, 22 Mar 2021 18:44:34 +0100 -Subject: [PATCH 794/834] drm/gud: Remove unneeded semicolon +Subject: [PATCH 755/889] drm/gud: Remove unneeded semicolon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -245699,10 +241126,10 @@ index 15aa8877407e..4ea7b4dd2c4e 100644 2.18.4 -From 834a852f3adac6ee97c371e1b7a851d0dfd49a55 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Bernard Zhao Date: Fri, 2 Apr 2021 01:55:21 -0700 -Subject: [PATCH 795/834] drm/gud: cleanup coding style a bit +Subject: [PATCH 756/889] drm/gud: cleanup coding style a bit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -245746,10 +241173,10 @@ index de2f2d2dbc60..b65105585578 100644 2.18.4 -From fb5e161de22e7983c872d18be42371037ca83162 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 1 Jul 2021 19:07:47 +0200 -Subject: [PATCH 796/834] drm/gud: Free buffers on device removal +Subject: [PATCH 757/889] drm/gud: Free buffers on device removal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -245812,10 +241239,10 @@ index 610cb05a306a..868099878721 100644 2.18.4 -From 43f10e0e333a4590e7882bfa873d4adb7368dde7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 1 Jul 2021 19:07:48 +0200 -Subject: [PATCH 797/834] drm/gud: Use scatter-gather USB bulk transfer +Subject: [PATCH 758/889] drm/gud: Use scatter-gather USB bulk transfer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -246026,10 +241453,10 @@ index 4ea7b4dd2c4e..da4ebd1fe591 100644 2.18.4 -From c9c15400e525b90a88a6a6d42b60eafa90a14202 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 3 Jul 2021 16:13:20 +0200 -Subject: [PATCH 798/834] drm/gud: Add Raspberry Pi Pico ID +Subject: [PATCH 759/889] drm/gud: Add Raspberry Pi Pico ID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -246063,10 +241490,10 @@ index 8666b4212a16..3afad229bb78 100644 2.18.4 -From 4e8fd46a961fffd888baa62b8bba2a275d0cd802 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 3 Jul 2021 16:13:21 +0200 -Subject: [PATCH 799/834] drm/gud: Add async_flush module parameter +Subject: [PATCH 760/889] drm/gud: Add async_flush module parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -246124,10 +241551,10 @@ index da4ebd1fe591..d04e777ccb37 100644 2.18.4 -From 786fc8167d172c3d32b7d3cfb9de164e4d8cf730 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 8 Jul 2021 23:20:59 +0200 -Subject: [PATCH 800/834] configs: Add CONFIG_DRM_GUD=m +Subject: [PATCH 761/889] configs: Add CONFIG_DRM_GUD=m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -246207,10 +241634,10 @@ index f2ed34ca43b0..13aa02396b7b 100644 2.18.4 -From d37288d1d54e81b832c193136f480305a5c3db73 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 2 Jul 2021 12:03:28 +0200 -Subject: [PATCH 801/834] drm/vc4: hdmi: Make sure the controller is powered up +Subject: [PATCH 762/889] drm/vc4: hdmi: Make sure the controller is powered up during bind In the bind hook, we actually need the device to have the HSM clock @@ -246278,10 +241705,10 @@ index 87c7817c9003..81ea1fbbdaab 100644 2.18.4 -From 22afa5a4bd7a1574349d76d26d87a35238d33093 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 22 Jul 2021 14:34:42 +0100 -Subject: [PATCH 802/834] brcmfmac: Try product-specific clm_blob names first +Subject: [PATCH 763/889] brcmfmac: Try product-specific clm_blob names first Signed-off-by: Phil Elwell --- @@ -246366,7 +241793,7 @@ index adfea97c9a43..b14963be17f1 100644 return ret; } diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c -index 603aff421e38..c86b9d6eb2f3 100644 +index 1f12dfb33938..89cdd2075846 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -1400,7 +1400,8 @@ static int brcmf_pcie_get_memdump(struct device *dev, void *data, size_t len) @@ -246449,10 +241876,10 @@ index 9fb68c2dc7e3..9bf2dbd30ded 100644 2.18.4 -From 0af996d5347b511f9be7bcdc527a60faa409daa0 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Jul 2021 11:05:18 +0100 -Subject: [PATCH 803/834] overlays: Set CMA to 512MB on Pi 4 for vc4 +Subject: [PATCH 764/889] overlays: Set CMA to 512MB on Pi 4 for vc4 Pi 4s have at least 1GB, and there are advantages to having more CMA available (HEVC works out of the box, support for more complex video @@ -246617,10 +242044,10 @@ index 6a11260a4f1a..0480fa7a8129 100644 2.18.4 -From 3b0b13a6b7a0833a8ee36602987505b1104da7ab Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Jul 2021 13:24:09 +0100 -Subject: [PATCH 804/834] ARM: dts: Correct CM4 PHY MDIO address +Subject: [PATCH 765/889] ARM: dts: Correct CM4 PHY MDIO address The firmware patches the PHY MDIO address in the DTB to cope with variations between board revisions, but the default for the CM4 PHY @@ -246652,970 +242079,19 @@ index 9f9a25bb52c3..d9271012a572 100644 2.18.4 -From a297ead027637d1ef5899f239c4b65bc2e509060 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Mon, 26 Jul 2021 18:00:55 +0100 -Subject: [PATCH 805/834] Revert "drm/vc4: Increase the core clock to a minimum - of 500MHz" - -This reverts commit 0a7c2180876d9c7748e055091be21efb959934e2. ---- - drivers/gpu/drm/vc4/vc4_kms.c | 8 +------- - 1 file changed, 1 insertion(+), 7 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index a2a03b52b275..0f7fad6b2393 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -369,17 +369,11 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) - } - - if (vc4->hvs && vc4->hvs->hvs5) { -- unsigned long core_rate = max_t(unsigned long, -- 500000000, -- new_hvs_state->core_clock_rate); -- -- drm_dbg(dev, "Raising the core clock at %lu Hz\n", core_rate); -- - /* - * Do a temporary request on the core clock during the - * modeset. - */ -- core_req = clk_request_start(hvs->core_clk, core_rate); -+ core_req = clk_request_start(hvs->core_clk, 500000000); - - /* - * And remove the previous one based on the HVS --- -2.18.4 - - -From 2dca34c0909db173d5342445eedd594fa946d665 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Mon, 26 Jul 2021 18:01:45 +0100 -Subject: [PATCH 806/834] Revert "drm/vc4: Increase the core clock based on HVS - load" - -This reverts commit 5146eb7b0878d80009e2b27c47a668316683ef7e. ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 15 ----- - drivers/gpu/drm/vc4/vc4_drv.h | 3 - - drivers/gpu/drm/vc4/vc4_kms.c | 120 ++------------------------------- - 3 files changed, 6 insertions(+), 132 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 6bb52539a5a6..0771fd91aee7 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -660,27 +660,12 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, - struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc_state); - struct drm_connector *conn; - struct drm_connector_state *conn_state; -- struct drm_encoder *encoder; - int ret, i; - - ret = vc4_hvs_atomic_check(crtc, state); - if (ret) - return ret; - -- encoder = vc4_get_crtc_encoder(crtc, crtc_state); -- if (encoder) { -- const struct drm_display_mode *mode = &crtc_state->adjusted_mode; -- struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); -- -- mode = &crtc_state->adjusted_mode; -- if (vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0) { -- vc4_state->hvs_load = max(mode->clock * mode->hdisplay / mode->htotal + 1000, -- mode->clock * 9 / 10) * 1000; -- } else { -- vc4_state->hvs_load = mode->clock * 1000; -- } -- } -- - for_each_new_connector_in_state(state, conn, conn_state, - i) { - if (conn_state->crtc != crtc) -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 7387244af483..9d7e0ee768e6 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -324,7 +324,6 @@ struct vc4_hvs { - u32 __iomem *dlist; - - struct clk *core_clk; -- struct clk_request *core_req; - - /* Memory manager for CRTCs to allocate space in the display - * list. Units are dwords. -@@ -536,8 +535,6 @@ struct vc4_crtc_state { - unsigned int bottom; - } margins; - -- unsigned long hvs_load; -- - /* Transitional state below, only valid during atomic commits */ - bool update_muxing; - }; -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 0f7fad6b2393..45de906ba085 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -39,11 +39,9 @@ static struct vc4_ctm_state *to_vc4_ctm_state(struct drm_private_state *priv) - - struct vc4_hvs_state { - struct drm_private_state base; -- unsigned long core_clock_rate; - - struct { - unsigned in_use: 1; -- unsigned long fifo_load; - struct drm_crtc_commit *pending_commit; - } fifo_state[HVS_NUM_CHANNELS]; - }; -@@ -344,20 +342,11 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) - struct vc4_hvs *hvs = vc4->hvs; - struct drm_crtc_state *old_crtc_state; - struct drm_crtc_state *new_crtc_state; -- struct vc4_hvs_state *new_hvs_state; - struct drm_crtc *crtc; - struct vc4_hvs_state *old_hvs_state; - struct clk_request *core_req; - int i; - -- old_hvs_state = vc4_hvs_get_old_global_state(state); -- if (WARN_ON(!old_hvs_state)) -- return; -- -- new_hvs_state = vc4_hvs_get_new_global_state(state); -- if (WARN_ON(!new_hvs_state)) -- return; -- - for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { - struct vc4_crtc_state *vc4_crtc_state; - -@@ -368,19 +357,12 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) - vc4_hvs_mask_underrun(dev, vc4_crtc_state->assigned_channel); - } - -- if (vc4->hvs && vc4->hvs->hvs5) { -- /* -- * Do a temporary request on the core clock during the -- * modeset. -- */ -+ if (vc4->hvs && vc4->hvs->hvs5) - core_req = clk_request_start(hvs->core_clk, 500000000); - -- /* -- * And remove the previous one based on the HVS -- * requirements if any. -- */ -- clk_request_done(hvs->core_req); -- } -+ old_hvs_state = vc4_hvs_get_old_global_state(state); -+ if (!old_hvs_state) -+ return; - - for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) { - struct vc4_crtc_state *vc4_crtc_state = -@@ -431,20 +413,8 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) - - drm_atomic_helper_cleanup_planes(dev, state); - -- if (vc4->hvs && vc4->hvs->hvs5) { -- drm_dbg(dev, "Running the core clock at %lu Hz\n", -- new_hvs_state->core_clock_rate); -- -- /* -- * Request a clock rate based on the current HVS -- * requirements. -- */ -- hvs->core_req = clk_request_start(hvs->core_clk, -- new_hvs_state->core_clock_rate); -- -- /* And drop the temporary request */ -+ if (vc4->hvs && vc4->hvs->hvs5) - clk_request_done(core_req); -- } - } - - static int vc4_atomic_commit_setup(struct drm_atomic_state *state) -@@ -713,7 +683,6 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - - for (i = 0; i < HVS_NUM_CHANNELS; i++) { - state->fifo_state[i].in_use = old_state->fifo_state[i].in_use; -- state->fifo_state[i].fifo_load = old_state->fifo_state[i].fifo_load; - - if (!old_state->fifo_state[i].pending_commit) - continue; -@@ -722,9 +691,6 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - drm_crtc_commit_get(old_state->fifo_state[i].pending_commit); - } - -- state->core_clock_rate = old_state->core_clock_rate; -- -- - return &state->base; - } - -@@ -883,76 +849,6 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - return 0; - } - --static int --vc4_core_clock_atomic_check(struct drm_atomic_state *state) --{ -- struct vc4_dev *vc4 = to_vc4_dev(state->dev); -- struct drm_private_state *priv_state; -- struct vc4_hvs_state *hvs_new_state; -- struct vc4_load_tracker_state *load_state; -- struct drm_crtc_state *old_crtc_state, *new_crtc_state; -- struct drm_crtc *crtc; -- unsigned int num_outputs; -- unsigned long pixel_rate; -- unsigned long cob_rate; -- unsigned int i; -- -- priv_state = drm_atomic_get_private_obj_state(state, -- &vc4->load_tracker); -- if (IS_ERR(priv_state)) -- return PTR_ERR(priv_state); -- -- load_state = to_vc4_load_tracker_state(priv_state); -- -- hvs_new_state = vc4_hvs_get_global_state(state); -- if (!hvs_new_state) -- return -EINVAL; -- -- for_each_oldnew_crtc_in_state(state, crtc, -- old_crtc_state, -- new_crtc_state, -- i) { -- if (old_crtc_state->active) { -- struct vc4_crtc_state *old_vc4_state = -- to_vc4_crtc_state(old_crtc_state); -- unsigned int channel = old_vc4_state->assigned_channel; -- -- hvs_new_state->fifo_state[channel].fifo_load = 0; -- } -- -- if (new_crtc_state->active) { -- struct vc4_crtc_state *new_vc4_state = -- to_vc4_crtc_state(new_crtc_state); -- unsigned int channel = new_vc4_state->assigned_channel; -- -- hvs_new_state->fifo_state[channel].fifo_load = -- new_vc4_state->hvs_load; -- } -- } -- -- cob_rate = 0; -- num_outputs = 0; -- for (i = 0; i < HVS_NUM_CHANNELS; i++) { -- if (!hvs_new_state->fifo_state[i].in_use) -- continue; -- -- num_outputs++; -- cob_rate += hvs_new_state->fifo_state[i].fifo_load; -- } -- -- pixel_rate = load_state->hvs_load; -- if (num_outputs > 1) { -- pixel_rate = (pixel_rate * 40) / 100; -- } else { -- pixel_rate = (pixel_rate * 60) / 100; -- } -- -- hvs_new_state->core_clock_rate = max(cob_rate, pixel_rate); -- -- return 0; --} -- -- - static int - vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) - { -@@ -970,11 +866,7 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) - if (ret) - return ret; - -- ret = vc4_load_tracker_atomic_check(state); -- if (ret) -- return ret; -- -- return vc4_core_clock_atomic_check(state); -+ return vc4_load_tracker_atomic_check(state); - } - - static struct drm_mode_config_helper_funcs vc4_mode_config_helpers = { --- -2.18.4 - - -From a6ccd0b5b3f097da23862c8f0f7968f436cca62d Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Mon, 26 Jul 2021 18:01:54 +0100 -Subject: [PATCH 807/834] Revert "drm/vc4: kms: Convert to atomic helpers" - -This reverts commit c9ba6cf8858b22fad16ddfe261a90181c4f9a504. ---- - drivers/gpu/drm/vc4/vc4_kms.c | 122 ++++++++++++++++++++++++++++++---- - 1 file changed, 109 insertions(+), 13 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 45de906ba085..24dea3acb9de 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -335,7 +335,8 @@ static void vc5_hvs_pv_muxing_commit(struct vc4_dev *vc4, - } - } - --static void vc4_atomic_commit_tail(struct drm_atomic_state *state) -+static void -+vc4_atomic_complete_commit(struct drm_atomic_state *state) - { - struct drm_device *dev = state->dev; - struct vc4_dev *vc4 = to_vc4_dev(dev); -@@ -360,6 +361,10 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) - if (vc4->hvs && vc4->hvs->hvs5) - core_req = clk_request_start(hvs->core_clk, 500000000); - -+ drm_atomic_helper_wait_for_fences(dev, state, false); -+ -+ drm_atomic_helper_wait_for_dependencies(state); -+ - old_hvs_state = vc4_hvs_get_old_global_state(state); - if (!old_hvs_state) - return; -@@ -413,27 +418,29 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) - - drm_atomic_helper_cleanup_planes(dev, state); - -+ drm_atomic_helper_commit_cleanup_done(state); -+ - if (vc4->hvs && vc4->hvs->hvs5) - clk_request_done(core_req); -+ -+ drm_atomic_state_put(state); -+} -+ -+static void commit_work(struct work_struct *work) -+{ -+ struct drm_atomic_state *state = container_of(work, -+ struct drm_atomic_state, -+ commit_work); -+ vc4_atomic_complete_commit(state); - } - - static int vc4_atomic_commit_setup(struct drm_atomic_state *state) - { -- struct drm_device *dev = state->dev; -- struct vc4_dev *vc4 = to_vc4_dev(dev); - struct drm_crtc_state *crtc_state; - struct vc4_hvs_state *hvs_state; - struct drm_crtc *crtc; - unsigned int i; - -- /* We know for sure we don't want an async update here. Set -- * state->legacy_cursor_update to false to prevent -- * drm_atomic_helper_setup_commit() from auto-completing -- * commit->flip_done. -- */ -- if (!vc4->firmware_kms) -- state->legacy_cursor_update = false; -- - hvs_state = vc4_hvs_get_new_global_state(state); - if (!hvs_state) - return -EINVAL; -@@ -457,6 +464,95 @@ static int vc4_atomic_commit_setup(struct drm_atomic_state *state) - return 0; - } - -+/** -+ * vc4_atomic_commit - commit validated state object -+ * @dev: DRM device -+ * @state: the driver state object -+ * @nonblock: nonblocking commit -+ * -+ * This function commits a with drm_atomic_helper_check() pre-validated state -+ * object. This can still fail when e.g. the framebuffer reservation fails. For -+ * now this doesn't implement asynchronous commits. -+ * -+ * RETURNS -+ * Zero for success or -errno. -+ */ -+static int vc4_atomic_commit(struct drm_device *dev, -+ struct drm_atomic_state *state, -+ bool nonblock) -+{ -+ int ret; -+ -+ if (state->async_update) { -+ ret = drm_atomic_helper_prepare_planes(dev, state); -+ if (ret) -+ return ret; -+ -+ drm_atomic_helper_async_commit(dev, state); -+ -+ drm_atomic_helper_cleanup_planes(dev, state); -+ -+ return 0; -+ } -+ -+ /* We know for sure we don't want an async update here. Set -+ * state->legacy_cursor_update to false to prevent -+ * drm_atomic_helper_setup_commit() from auto-completing -+ * commit->flip_done. -+ */ -+ if (!vc4->firmware_kms) -+ state->legacy_cursor_update = false; -+ ret = drm_atomic_helper_setup_commit(state, nonblock); -+ if (ret) -+ return ret; -+ -+ INIT_WORK(&state->commit_work, commit_work); -+ -+ ret = drm_atomic_helper_prepare_planes(dev, state); -+ if (ret) -+ return ret; -+ -+ if (!nonblock) { -+ ret = drm_atomic_helper_wait_for_fences(dev, state, true); -+ if (ret) { -+ drm_atomic_helper_cleanup_planes(dev, state); -+ return ret; -+ } -+ } -+ -+ /* -+ * This is the point of no return - everything below never fails except -+ * when the hw goes bonghits. Which means we can commit the new state on -+ * the software side now. -+ */ -+ -+ BUG_ON(drm_atomic_helper_swap_state(state, false) < 0); -+ -+ /* -+ * Everything below can be run asynchronously without the need to grab -+ * any modeset locks at all under one condition: It must be guaranteed -+ * that the asynchronous work has either been cancelled (if the driver -+ * supports it, which at least requires that the framebuffers get -+ * cleaned up with drm_atomic_helper_cleanup_planes()) or completed -+ * before the new state gets committed on the software side with -+ * drm_atomic_helper_swap_state(). -+ * -+ * This scheme allows new atomic state updates to be prepared and -+ * checked in parallel to the asynchronous completion of the previous -+ * update. Which is important since compositors need to figure out the -+ * composition of the next frame right after having submitted the -+ * current layout. -+ */ -+ -+ drm_atomic_state_get(state); -+ if (nonblock) -+ queue_work(system_unbound_wq, &state->commit_work); -+ else -+ vc4_atomic_complete_commit(state); -+ -+ return 0; -+} -+ - static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev, - struct drm_file *file_priv, - const struct drm_mode_fb_cmd2 *mode_cmd) -@@ -681,6 +777,7 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - - __drm_atomic_helper_private_obj_duplicate_state(obj, &state->base); - -+ - for (i = 0; i < HVS_NUM_CHANNELS; i++) { - state->fifo_state[i].in_use = old_state->fifo_state[i].in_use; - -@@ -871,12 +968,11 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) - - static struct drm_mode_config_helper_funcs vc4_mode_config_helpers = { - .atomic_commit_setup = vc4_atomic_commit_setup, -- .atomic_commit_tail = vc4_atomic_commit_tail, - }; - - static const struct drm_mode_config_funcs vc4_mode_funcs = { - .atomic_check = vc4_atomic_check, -- .atomic_commit = drm_atomic_helper_commit, -+ .atomic_commit = vc4_atomic_commit, - .fb_create = vc4_fb_create, - }; - --- -2.18.4 - - -From c4e174420e8a85336e421dd11063aff275fd7505 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Mon, 26 Jul 2021 18:02:11 +0100 -Subject: [PATCH 808/834] Revert "drm/vc4: kms: Remove async modeset semaphore" - -This reverts commit a28f2f0df6da70dec509b965635f0d5f71f9a9f7. ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 13 +++++++++++++ - drivers/gpu/drm/vc4/vc4_drv.h | 2 ++ - drivers/gpu/drm/vc4/vc4_kms.c | 24 ++++++++++++++++++++++-- - 3 files changed, 37 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 0771fd91aee7..008d264cc372 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -766,6 +766,7 @@ vc4_async_page_flip_complete(struct vc4_seqno_cb *cb) - container_of(cb, struct vc4_async_flip_state, cb); - struct drm_crtc *crtc = flip_state->crtc; - struct drm_device *dev = crtc->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(dev); - struct drm_plane *plane = crtc->primary; - - vc4_plane_async_set_fb(plane, flip_state->fb); -@@ -797,6 +798,8 @@ vc4_async_page_flip_complete(struct vc4_seqno_cb *cb) - } - - kfree(flip_state); -+ -+ up(&vc4->async_modeset); - } - - /* Implements async (non-vblank-synced) page flips. -@@ -811,6 +814,7 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, - uint32_t flags) - { - struct drm_device *dev = crtc->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(dev); - struct drm_plane *plane = crtc->primary; - int ret = 0; - struct vc4_async_flip_state *flip_state; -@@ -839,6 +843,15 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, - flip_state->crtc = crtc; - flip_state->event = event; - -+ /* Make sure all other async modesetes have landed. */ -+ ret = down_interruptible(&vc4->async_modeset); -+ if (ret) { -+ drm_framebuffer_put(fb); -+ vc4_bo_dec_usecnt(bo); -+ kfree(flip_state); -+ return ret; -+ } -+ - /* Save the current FB before it's replaced by the new one in - * drm_atomic_set_fb_for_plane(). We'll need the old FB in - * vc4_async_page_flip_complete() to decrement the BO usecnt and keep -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 9d7e0ee768e6..f73f0a6a7df8 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -216,6 +216,8 @@ struct vc4_dev { - struct work_struct reset_work; - } hangcheck; - -+ struct semaphore async_modeset; -+ - struct drm_modeset_lock ctm_state_lock; - struct drm_private_obj ctm_manager; - struct drm_private_obj hvs_channels; -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 24dea3acb9de..7b02bff7d939 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -424,6 +424,8 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - clk_request_done(core_req); - - drm_atomic_state_put(state); -+ -+ up(&vc4->async_modeset); - } - - static void commit_work(struct work_struct *work) -@@ -481,17 +483,26 @@ static int vc4_atomic_commit(struct drm_device *dev, - struct drm_atomic_state *state, - bool nonblock) - { -+ struct vc4_dev *vc4 = to_vc4_dev(dev); - int ret; - - if (state->async_update) { -- ret = drm_atomic_helper_prepare_planes(dev, state); -+ ret = down_interruptible(&vc4->async_modeset); - if (ret) - return ret; - -+ ret = drm_atomic_helper_prepare_planes(dev, state); -+ if (ret) { -+ up(&vc4->async_modeset); -+ return ret; -+ } -+ - drm_atomic_helper_async_commit(dev, state); - - drm_atomic_helper_cleanup_planes(dev, state); - -+ up(&vc4->async_modeset); -+ - return 0; - } - -@@ -508,14 +519,21 @@ static int vc4_atomic_commit(struct drm_device *dev, - - INIT_WORK(&state->commit_work, commit_work); - -- ret = drm_atomic_helper_prepare_planes(dev, state); -+ ret = down_interruptible(&vc4->async_modeset); - if (ret) - return ret; - -+ ret = drm_atomic_helper_prepare_planes(dev, state); -+ if (ret) { -+ up(&vc4->async_modeset); -+ return ret; -+ } -+ - if (!nonblock) { - ret = drm_atomic_helper_wait_for_fences(dev, state, true); - if (ret) { - drm_atomic_helper_cleanup_planes(dev, state); -+ up(&vc4->async_modeset); - return ret; - } - } -@@ -995,6 +1013,8 @@ int vc4_kms_load(struct drm_device *dev) - vc4->load_tracker_enabled = true; - } - -+ sema_init(&vc4->async_modeset, 1); -+ - /* Set support for vblank irq fast disable, before drm_vblank_init() */ - dev->vblank_disable_immediate = true; - --- -2.18.4 - - -From a6ceb50128346c58e5221822fdeda61d1644a26c Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Mon, 26 Jul 2021 18:02:25 +0100 -Subject: [PATCH 809/834] Revert "drm/vc4: kms: Remove unassigned_channels from - the HVS state" - -This reverts commit 7ccf97eb2d8439b8fbc72b1a1ebd7f376422be32. ---- - drivers/gpu/drm/vc4/vc4_kms.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 7b02bff7d939..4103c9bb58ee 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -39,6 +39,7 @@ static struct vc4_ctm_state *to_vc4_ctm_state(struct drm_private_state *priv) - - struct vc4_hvs_state { - struct drm_private_state base; -+ unsigned int unassigned_channels; - - struct { - unsigned in_use: 1; -@@ -795,6 +796,7 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - - __drm_atomic_helper_private_obj_duplicate_state(obj, &state->base); - -+ state->unassigned_channels = old_state->unassigned_channels; - - for (i = 0; i < HVS_NUM_CHANNELS; i++) { - state->fifo_state[i].in_use = old_state->fifo_state[i].in_use; -@@ -845,6 +847,7 @@ static int vc4_hvs_channels_obj_init(struct vc4_dev *vc4) - if (!state) - return -ENOMEM; - -+ state->unassigned_channels = GENMASK(HVS_NUM_CHANNELS - 1, 0); - drm_atomic_private_obj_init(&vc4->base, &vc4->hvs_channels, - &state->base, - &vc4_hvs_state_funcs); -@@ -889,17 +892,12 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - struct vc4_hvs_state *hvs_new_state; - struct drm_crtc_state *old_crtc_state, *new_crtc_state; - struct drm_crtc *crtc; -- unsigned int unassigned_channels = 0; - unsigned int i; - - hvs_new_state = vc4_hvs_get_global_state(state); - if (!hvs_new_state) - return -EINVAL; - -- for (i = 0; i < ARRAY_SIZE(hvs_new_state->fifo_state); i++) -- if (!hvs_new_state->fifo_state[i].in_use) -- unassigned_channels |= BIT(i); -- - for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { - struct vc4_crtc_state *old_vc4_crtc_state = - to_vc4_crtc_state(old_crtc_state); -@@ -922,6 +920,8 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - /* If we're disabling our CRTC, we put back our channel */ - if (!new_crtc_state->enable) { - channel = old_vc4_crtc_state->assigned_channel; -+ -+ hvs_new_state->unassigned_channels |= BIT(channel); - hvs_new_state->fifo_state[channel].in_use = false; - new_vc4_crtc_state->assigned_channel = VC4_HVS_CHANNEL_DISABLED; - continue; -@@ -951,13 +951,13 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - * the future, we will need to have something smarter, - * but it works so far. - */ -- matching_channels = unassigned_channels & vc4_crtc->data->hvs_available_channels; -+ matching_channels = hvs_new_state->unassigned_channels & vc4_crtc->data->hvs_available_channels; - if (!matching_channels) - return -EINVAL; - - channel = ffs(matching_channels) - 1; - new_vc4_crtc_state->assigned_channel = channel; -- unassigned_channels &= ~BIT(channel); -+ hvs_new_state->unassigned_channels &= ~BIT(channel); - hvs_new_state->fifo_state[channel].in_use = true; - } - --- -2.18.4 - - -From 0d4d411d0fbb097f3db9080460a25789984ea053 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard -Date: Fri, 4 Dec 2020 16:11:35 +0100 -Subject: [PATCH 810/834] Revert "drm/vc4: kms: Wait on previous FIFO users - before a commit" - -This reverts commit f100caadd1f31fde01681b993c8b9641dbdd6611. ---- - drivers/gpu/drm/vc4/vc4_kms.c | 123 +--------------------------------- - 1 file changed, 1 insertion(+), 122 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index 4103c9bb58ee..d842889f79e7 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -40,11 +40,6 @@ static struct vc4_ctm_state *to_vc4_ctm_state(struct drm_private_state *priv) - struct vc4_hvs_state { - struct drm_private_state base; - unsigned int unassigned_channels; -- -- struct { -- unsigned in_use: 1; -- struct drm_crtc_commit *pending_commit; -- } fifo_state[HVS_NUM_CHANNELS]; - }; - - static struct vc4_hvs_state * -@@ -190,32 +185,6 @@ vc4_ctm_commit(struct vc4_dev *vc4, struct drm_atomic_state *state) - VC4_SET_FIELD(ctm_state->fifo, SCALER_OLEDOFFS_DISPFIFO)); - } - --static struct vc4_hvs_state * --vc4_hvs_get_new_global_state(struct drm_atomic_state *state) --{ -- struct vc4_dev *vc4 = to_vc4_dev(state->dev); -- struct drm_private_state *priv_state; -- -- priv_state = drm_atomic_get_new_private_obj_state(state, &vc4->hvs_channels); -- if (IS_ERR(priv_state)) -- return ERR_CAST(priv_state); -- -- return to_vc4_hvs_state(priv_state); --} -- --static struct vc4_hvs_state * --vc4_hvs_get_old_global_state(struct drm_atomic_state *state) --{ -- struct vc4_dev *vc4 = to_vc4_dev(state->dev); -- struct drm_private_state *priv_state; -- -- priv_state = drm_atomic_get_old_private_obj_state(state, &vc4->hvs_channels); -- if (IS_ERR(priv_state)) -- return ERR_CAST(priv_state); -- -- return to_vc4_hvs_state(priv_state); --} -- - static struct vc4_hvs_state * - vc4_hvs_get_global_state(struct drm_atomic_state *state) - { -@@ -342,10 +311,8 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - struct drm_device *dev = state->dev; - struct vc4_dev *vc4 = to_vc4_dev(dev); - struct vc4_hvs *hvs = vc4->hvs; -- struct drm_crtc_state *old_crtc_state; - struct drm_crtc_state *new_crtc_state; - struct drm_crtc *crtc; -- struct vc4_hvs_state *old_hvs_state; - struct clk_request *core_req; - int i; - -@@ -366,36 +333,6 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) - - drm_atomic_helper_wait_for_dependencies(state); - -- old_hvs_state = vc4_hvs_get_old_global_state(state); -- if (!old_hvs_state) -- return; -- -- for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) { -- struct vc4_crtc_state *vc4_crtc_state = -- to_vc4_crtc_state(old_crtc_state); -- struct drm_crtc_commit *commit; -- unsigned int channel = vc4_crtc_state->assigned_channel; -- unsigned long done; -- -- if (channel == VC4_HVS_CHANNEL_DISABLED) -- continue; -- -- if (!old_hvs_state->fifo_state[channel].in_use) -- continue; -- -- commit = old_hvs_state->fifo_state[i].pending_commit; -- if (!commit) -- continue; -- -- done = wait_for_completion_timeout(&commit->hw_done, 10 * HZ); -- if (!done) -- drm_err(dev, "Timed out waiting for hw_done\n"); -- -- done = wait_for_completion_timeout(&commit->flip_done, 10 * HZ); -- if (!done) -- drm_err(dev, "Timed out waiting for flip_done\n"); -- } -- - drm_atomic_helper_commit_modeset_disables(dev, state); - - vc4_ctm_commit(vc4, state); -@@ -437,36 +374,6 @@ static void commit_work(struct work_struct *work) - vc4_atomic_complete_commit(state); - } - --static int vc4_atomic_commit_setup(struct drm_atomic_state *state) --{ -- struct drm_crtc_state *crtc_state; -- struct vc4_hvs_state *hvs_state; -- struct drm_crtc *crtc; -- unsigned int i; -- -- hvs_state = vc4_hvs_get_new_global_state(state); -- if (!hvs_state) -- return -EINVAL; -- -- for_each_new_crtc_in_state(state, crtc, crtc_state, i) { -- struct vc4_crtc_state *vc4_crtc_state = -- to_vc4_crtc_state(crtc_state); -- unsigned int channel = -- vc4_crtc_state->assigned_channel; -- -- if (channel == VC4_HVS_CHANNEL_DISABLED) -- continue; -- -- if (!hvs_state->fifo_state[channel].in_use) -- continue; -- -- hvs_state->fifo_state[channel].pending_commit = -- drm_crtc_commit_get(crtc_state->commit); -- } -- -- return 0; --} -- - /** - * vc4_atomic_commit - commit validated state object - * @dev: DRM device -@@ -788,7 +695,6 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - { - struct vc4_hvs_state *old_state = to_vc4_hvs_state(obj->state); - struct vc4_hvs_state *state; -- unsigned int i; - - state = kzalloc(sizeof(*state), GFP_KERNEL); - if (!state) -@@ -798,16 +704,6 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) - - state->unassigned_channels = old_state->unassigned_channels; - -- for (i = 0; i < HVS_NUM_CHANNELS; i++) { -- state->fifo_state[i].in_use = old_state->fifo_state[i].in_use; -- -- if (!old_state->fifo_state[i].pending_commit) -- continue; -- -- state->fifo_state[i].pending_commit = -- drm_crtc_commit_get(old_state->fifo_state[i].pending_commit); -- } -- - return &state->base; - } - -@@ -815,14 +711,6 @@ static void vc4_hvs_channels_destroy_state(struct drm_private_obj *obj, - struct drm_private_state *state) - { - struct vc4_hvs_state *hvs_state = to_vc4_hvs_state(state); -- unsigned int i; -- -- for (i = 0; i < HVS_NUM_CHANNELS; i++) { -- if (!hvs_state->fifo_state[i].pending_commit) -- continue; -- -- drm_crtc_commit_put(hvs_state->fifo_state[i].pending_commit); -- } - - kfree(hvs_state); - } -@@ -919,10 +807,7 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - - /* If we're disabling our CRTC, we put back our channel */ - if (!new_crtc_state->enable) { -- channel = old_vc4_crtc_state->assigned_channel; -- -- hvs_new_state->unassigned_channels |= BIT(channel); -- hvs_new_state->fifo_state[channel].in_use = false; -+ hvs_new_state->unassigned_channels |= BIT(old_vc4_crtc_state->assigned_channel); - new_vc4_crtc_state->assigned_channel = VC4_HVS_CHANNEL_DISABLED; - continue; - } -@@ -958,7 +843,6 @@ static int vc4_pv_muxing_atomic_check(struct drm_device *dev, - channel = ffs(matching_channels) - 1; - new_vc4_crtc_state->assigned_channel = channel; - hvs_new_state->unassigned_channels &= ~BIT(channel); -- hvs_new_state->fifo_state[channel].in_use = true; - } - - return 0; -@@ -984,10 +868,6 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) - return vc4_load_tracker_atomic_check(state); - } - --static struct drm_mode_config_helper_funcs vc4_mode_config_helpers = { -- .atomic_commit_setup = vc4_atomic_commit_setup, --}; -- - static const struct drm_mode_config_funcs vc4_mode_funcs = { - .atomic_check = vc4_atomic_check, - .atomic_commit = vc4_atomic_commit, -@@ -1034,7 +914,6 @@ int vc4_kms_load(struct drm_device *dev) - } - - dev->mode_config.funcs = &vc4_mode_funcs; -- dev->mode_config.helper_private = &vc4_mode_config_helpers; - dev->mode_config.preferred_depth = 24; - dev->mode_config.async_page_flip = true; - dev->mode_config.allow_fb_modifiers = true; --- -2.18.4 +Date: Wed, 26 May 2021 16:13:02 +0200 +Subject: [PATCH 766/889] drm/vc4: Increase the core clock based on HVS load +Depending on a given HVS output (HVS to PixelValves) and input (planes +attached to a channel) load, the HVS needs for the core clock to be +raised above its boot time default. -From d7069397a173fd3228cfe40fe8078bb21f4d10af Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Mon, 26 Jul 2021 18:03:53 +0100 -Subject: [PATCH 811/834] Revert "Revert "drm/vc4: Increase the core clock - based on HVS load"" +Failing to do so will result in a vblank timeout and a stalled display +pipeline. -This reverts commit 8f42671317d0504008d2ea35110ac8153bab6b3a. +Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_crtc.c | 15 +++++ drivers/gpu/drm/vc4/vc4_drv.h | 3 + @@ -247862,13 +242338,22 @@ index d842889f79e7..10990d7cc285 100644 2.18.4 -From 981917257a0e0fa58df63105fb7a39876e5da1f2 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Mon, 26 Jul 2021 18:07:25 +0100 -Subject: [PATCH 812/834] Revert "Revert "drm/vc4: Increase the core clock to a - minimum of 500MHz"" +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 28 Jun 2021 11:15:13 +0200 +Subject: [PATCH 767/889] drm/vc4: Increase the core clock to a minimum of + 500MHz + +The core clock needs to be raised temporarily during a modeset to +500MHz. However, the HVS core clock requirement might be higher than +500MHz. This rate will be enforced at the end of the mode setting, +meaning that might might end up with a core clock rate lower than +planned on the first mode set. -This reverts commit af4a0a6ba1426de138eab330d901f204c9cecf7c. +Use the maximum value of 500MHz and the HVS core clock rate for our +temporary boost to fix this issue. + +Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_kms.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) @@ -247900,10 +242385,10 @@ index 10990d7cc285..fb2465964d46 100644 2.18.4 -From a34ed09fff9c496baabf805ca7b19f3137403453 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: "chipdip.lab" <43340836+chipdipru@users.noreply.github.com> Date: Mon, 26 Jul 2021 14:43:11 +0300 -Subject: [PATCH 813/834] overlays: Update and rename chipdip-i2s-master-dac +Subject: [PATCH 768/889] overlays: Update and rename chipdip-i2s-master-dac Simple card fragment removed, GPIO fragment added. @@ -248062,10 +242547,10 @@ index a35ac36f8513..000000000000 2.18.4 -From e9f1f011b279fdeed6a62d1389eea71eb48ba763 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: "chipdip.lab" <43340836+chipdipru@users.noreply.github.com> Date: Mon, 26 Jul 2021 14:45:59 +0300 -Subject: [PATCH 814/834] ASoC: bcm: Add chipdip-dac driver +Subject: [PATCH 769/889] ASoC: bcm: Add chipdip-dac driver Driver chipdip-dac.c added into sound/soc/bcm/, files sound/soc/bcm/Kconfig and sound/soc/bcm/Makefile updated. @@ -248398,10 +242883,10 @@ index 000000000000..6cb53692b3c5 2.18.4 -From a234311b9423fe84f4065dbadbe77fe2fd1b4558 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: "chipdip.lab" <43340836+chipdipru@users.noreply.github.com> Date: Mon, 26 Jul 2021 16:34:41 +0300 -Subject: [PATCH 815/834] configs: Add SND_BCM2708_SOC_CHIPDIP_DAC +Subject: [PATCH 770/889] configs: Add SND_BCM2708_SOC_CHIPDIP_DAC Enable the driver for the ChipDip DAC soundcard. @@ -248478,10 +242963,10 @@ index 13aa02396b7b..178848f3c993 100644 2.18.4 -From 4de6970ce593fd33c5656df6dfdcb31cd90880f6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 28 Jul 2021 09:49:21 +0100 -Subject: [PATCH 816/834] char: vc_mem: Delete dead code +Subject: [PATCH 771/889] char: vc_mem: Delete dead code There are no error exists once device_create has succeeded, and therefore no need to call device_destroy from vc_mem_init. @@ -248508,10 +242993,10 @@ index b1b5a95baf02..195b61a4387c 100644 2.18.4 -From f6d360461100273be199ea994262dea268706754 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 28 Jul 2021 11:18:24 +0100 -Subject: [PATCH 817/834] configs: Add RANDOM_TRUST_BOOTLOADER=y +Subject: [PATCH 772/889] configs: Add RANDOM_TRUST_BOOTLOADER=y See: https://github.com/raspberrypi/firmware/issues/1595 @@ -248588,10 +243073,10 @@ index 178848f3c993..58a5e0535b6f 100644 2.18.4 -From 1f6110115d8a7c745428eab5a9dd5ff83a011200 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: WoodenNautilus <86767647+WoodenNautilus@users.noreply.github.com> Date: Tue, 3 Aug 2021 11:13:06 +0200 -Subject: [PATCH 818/834] overlays: Add Ablic S35390A to i2c-rtc and -gpio +Subject: [PATCH 773/889] overlays: Add Ablic S35390A to i2c-rtc and -gpio See: https://github.com/raspberrypi/linux/pull/4492 @@ -248669,10 +243154,10 @@ index fd80027792d2..f51981aafda8 100644 2.18.4 -From cf58d094019a50a0c472b8b5e41fcbfb281df795 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 2 Aug 2021 14:30:15 +0100 -Subject: [PATCH 819/834] dtoverlays: Add orientation (and rotation) parameter +Subject: [PATCH 774/889] dtoverlays: Add orientation (and rotation) parameter to sensor overlays Add the orientation parameter to all the camera sensor overlays to @@ -248897,10 +243382,10 @@ index b7a9c8c539da..277236c03358 100644 2.18.4 -From ac2b08a39d2288f0adf8e941057a60ddb225876f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 3 Aug 2021 11:25:59 +0100 -Subject: [PATCH 820/834] media: i2c: imx290: Add fwnode properties controls +Subject: [PATCH 775/889] media: i2c: imx290: Add fwnode properties controls Add call to v4l2_ctrl_new_fwnode_properties to read and create the fwnode based controls. @@ -248951,10 +243436,10 @@ index 24a7dee571cd..a26106c41cc6 100644 2.18.4 -From c6411d06add690abe38cde2fb1d38c67a0a37717 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 3 Aug 2021 11:30:58 +0100 -Subject: [PATCH 821/834] media: i2c: ov9281: Add fwnode properties controls +Subject: [PATCH 776/889] media: i2c: ov9281: Add fwnode properties controls Add call to v4l2_ctrl_new_fwnode_properties to read and create the fwnode based controls. @@ -249013,10 +243498,10 @@ index 6bfc79cd5897..a6ffcdd47b21 100644 2.18.4 -From e7ab9c5f7269cf350f586311c6eb53232fe8ad41 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 3 Aug 2021 11:33:33 +0100 -Subject: [PATCH 822/834] media: i2c: ov7251: Add fwnode properties controls +Subject: [PATCH 777/889] media: i2c: ov7251: Add fwnode properties controls Add call to v4l2_ctrl_new_fwnode_properties to read and create the fwnode based controls. @@ -249067,10 +243552,10 @@ index 0c10203f822b..2c554626319d 100644 2.18.4 -From bc25d840f323d30e29d1d02ed713ac8c2e74bc13 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 Aug 2021 11:32:30 +0100 -Subject: [PATCH 823/834] overlays: Reduce Pi 4 vc4 CMA size to 320MB +Subject: [PATCH 778/889] overlays: Reduce Pi 4 vc4 CMA size to 320MB Reduce the default CMA allocation requested by the vc4-kms-v3d-pi4 and vc4-fkms-v3d-pi4 overlays to 320MB. @@ -249117,10 +243602,10 @@ index 0480fa7a8129..4285e12a4e53 100644 2.18.4 -From 7a46ea6be7884bc47f7b75a1143357328bd5ceaa Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Wed, 4 Aug 2021 10:10:11 +0200 -Subject: [PATCH 824/834] Revert "overlays: Update display GPIO declarations" +Subject: [PATCH 779/889] Revert "overlays: Update display GPIO declarations" for Goodix This reverts commit b7d685c0b1bd1b98af0e9c1f5d43769982bdbfb2 for Goodix @@ -249147,10 +243632,10 @@ index a11d65f81c5e..8571527de49a 100644 2.18.4 -From e05e3083b57f13b4927784c6e5a4b54668d1d07d Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: pjx3 Date: Sun, 8 Aug 2021 20:09:46 +0100 -Subject: [PATCH 825/834] overlays: Add midi-uart{2345}-overlay.dts +Subject: [PATCH 780/889] overlays: Add midi-uart{2345}-overlay.dts Added overlays for enabling MIDI baudrates on additional UARTs @@ -249401,10 +243886,10 @@ index 000000000000..a1d37f7103ff 2.18.4 -From 379ca6c89a9188cad72b5db0ae0d1b9b84f7ea10 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Wed, 11 Aug 2021 15:33:57 +0100 -Subject: [PATCH 826/834] usb: xhci: workaround for bogus SET_DEQ_PENDING +Subject: [PATCH 781/889] usb: xhci: workaround for bogus SET_DEQ_PENDING endpoint state See https://github.com/raspberrypi/linux/issues/3981 @@ -249428,10 +243913,10 @@ Signed-off-by: Jonathan Bell 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index 0797964e8f36..d5796c49aec7 100644 +index 7649cb9e277f..8bbe602c0a07 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c -@@ -4255,9 +4255,9 @@ void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci, +@@ -4256,9 +4256,9 @@ void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci, } ep = &xhci->devs[slot_id]->eps[ep_index]; if ((ep->ep_state & SET_DEQ_PENDING)) { @@ -249448,10 +243933,10 @@ index 0797964e8f36..d5796c49aec7 100644 2.18.4 -From 342d56f6f2952ad4db8287bb7690b0f8d9307d45 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 16 Aug 2021 11:11:35 +0100 -Subject: [PATCH 827/834] overlays: Add TI BQ32000 RTC support +Subject: [PATCH 782/889] overlays: Add TI BQ32000 RTC support See: https://github.com/raspberrypi/linux/issues/4531 @@ -249558,10 +244043,10 @@ index f51981aafda8..7f749fc2d802 100644 2.18.4 -From 07ef5342d82ea46d2a1eb9a65c4fbc5cf7ee45fa Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Mon, 16 Aug 2021 14:43:06 +0100 -Subject: [PATCH 828/834] xhci: guard accesses to ep_state in +Subject: [PATCH 783/889] xhci: guard accesses to ep_state in xhci_endpoint_reset() See https://github.com/raspberrypi/linux/issues/3981 @@ -249575,10 +244060,10 @@ Signed-off-by: Jonathan Bell 1 file changed, 5 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index a04c4756eb74..05e829a04fee 100644 +index 425a066ed977..c424435fa960 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -3269,10 +3269,13 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd, +@@ -3270,10 +3270,13 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd, return; /* Bail out if toggle is already being cleared by a endpoint reset */ @@ -249592,7 +244077,7 @@ index a04c4756eb74..05e829a04fee 100644 /* Only interrupt and bulk ep's use data toggle, USB2 spec 5.5.4-> */ if (usb_endpoint_xfer_control(&host_ep->desc) || usb_endpoint_xfer_isoc(&host_ep->desc)) -@@ -3358,8 +3361,10 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd, +@@ -3359,8 +3362,10 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd, xhci_free_command(xhci, cfg_cmd); cleanup: xhci_free_command(xhci, stop_cmd); @@ -249607,10 +244092,10 @@ index a04c4756eb74..05e829a04fee 100644 2.18.4 -From 33c137d2cefc9a1cc10ecba1540c991838fe9821 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 27 Jul 2021 22:22:52 +0100 -Subject: [PATCH 829/834] ARM: dts: Adapt to upstream changes +Subject: [PATCH 784/889] ARM: dts: Adapt to upstream changes Signed-off-by: Phil Elwell --- @@ -249945,10 +244430,10 @@ index d9271012a572..1dcbb2173f5d 100644 2.18.4 -From 56b9556e5f053c3dbe9ede0e2fe6107e015dab38 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 18 Aug 2021 17:26:49 +0100 -Subject: [PATCH 830/834] overlays: rpi-poe-plus: Improve the cooling levels +Subject: [PATCH 785/889] overlays: rpi-poe-plus: Improve the cooling levels The PoE HAT cooling levels are not well suited for the PoE+ HAT - the fan fails to come on until the temperature reaches the third trip point @@ -249980,10 +244465,10 @@ index e0138847093b..5b12d02c3707 100644 2.18.4 -From 747b25e1a8e191166da464dbaf1ecf0b0b116351 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 19 Aug 2021 14:28:56 +0100 -Subject: [PATCH 831/834] Makefiles: dt: Always set '-@' on ARCH_BCM2835 +Subject: [PATCH 786/889] Makefiles: dt: Always set '-@' on ARCH_BCM2835 On the BCM2835 architecture, always add the '-@' option to enable the generation of symbols, rather than relying on DTC_FLAGS being empty @@ -250023,10 +244508,10 @@ index 2bca736a7197..69809bf2f45d 100644 2.18.4 -From 2ea25e3377e9df5118054845262e116f560ce44a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Thu, 19 Aug 2021 10:32:35 +0200 -Subject: [PATCH 832/834] overlays: qca7000: Fix URL & README +Subject: [PATCH 787/889] overlays: qca7000: Fix URL & README I2SE has been acquired by in-tech, so fix the URL & README accordingly. @@ -250065,10 +244550,10 @@ index 9a451202a2eb..f695f36024fa 100644 2.18.4 -From 8deac99deee8613c036bf40d8a31093ca1a0c58e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 19 Aug 2021 14:37:04 +0200 -Subject: [PATCH 833/834] drm/probe-helper: Create a HPD IRQ event helper for a +Subject: [PATCH 788/889] drm/probe-helper: Create a HPD IRQ event helper for a single connector The drm_helper_hpd_irq_event() function is iterating over all the @@ -250251,10 +244736,10 @@ index 8d3ed2834d34..04c57564c397 100644 2.18.4 -From 6e06e65b8d9a5f4c3ec84b6dbfd65e1a299a58de Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 19 Aug 2021 13:50:12 +0200 -Subject: [PATCH 834/834] drm/vc4: hdmi: Actually check for the connector +Subject: [PATCH 789/889] drm/vc4: hdmi: Actually check for the connector status in hotplug The drm_helper_hpd_irq_event() documentation states that this function @@ -250316,3 +244801,13367 @@ index 81ea1fbbdaab..01055f5ee175 100644 -- 2.18.4 + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 11 May 2021 17:05:11 +0200 +Subject: [PATCH 790/889] drm/vc4: hdmi: Remove the DDC probing for status + detection + +Commit 9d44abbbb8d5 ("drm/vc4: Fall back to using an EDID probe in the +absence of a GPIO.") added some code to read the EDID through DDC in the +HDMI driver detect hook since the Pi3 had no HPD GPIO back then. +However, commit b1b8f45b3130 ("ARM: dts: bcm2837: Add missing GPIOs of +Expander") changed that a couple of years later. + +This causes an issue though since some TV (like the LG 55C8) when it +comes out of standy will deassert the HPD line, but the EDID will +remain readable. + +It causes an issues nn platforms without an HPD GPIO, like the Pi4, +where the DDC probing will be our primary mean to detect a display, and +thus we will never detect the HPD pulse. This was fine before since the +pulse was small enough that we would never detect it, and we also didn't +have anything (like the scrambler) that needed to be set up in the +display. + +However, now that we have both, the display during the HPD pulse will +clear its scrambler status, and since we won't detect the +disconnect/reconnect cycle we will never enable the scrambler back. + +As our main reason for that DDC probing is gone, let's just remove it. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 01055f5ee175..75f6f293e32a 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -184,8 +184,6 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + if (gpio_get_value_cansleep(vc4_hdmi->hpd_gpio) ^ + vc4_hdmi->hpd_active_low) + connected = true; +- } else if (drm_probe_ddc(vc4_hdmi->ddc)) { +- connected = true; + } else if (HDMI_READ(HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) { + connected = true; + } +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 25 Aug 2021 13:09:01 +0200 +Subject: [PATCH 791/889] drm/vc4: Set a default HSM rate + +When the firmware doesn't setup the HSM rate (such as when booting +without an HDMI cable plugged in), its rate is 0 and thus any register +access results in a CPU stall, even though HSM is enabled. + +Let's enforce a minimum rate at boot to avoid this issue. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 29 ++++++++++++++++++++++++++++- + 1 file changed, 28 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 75f6f293e32a..cc1a05df6195 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -96,6 +96,7 @@ + # define VC4_HD_M_SW_RST BIT(2) + # define VC4_HD_M_ENABLE BIT(0) + ++#define HSM_MIN_CLOCK_FREQ 120000000 + #define CEC_CLOCK_FREQ 40000 + #define HDMI_14_MAX_TMDS_CLK (340 * 1000 * 1000) + +@@ -1190,7 +1191,7 @@ static u32 vc5_hdmi_calc_hsm_clock(struct vc4_hdmi *vc4_hdmi, unsigned long pixe + * pixel clock, but HSM ends up being the limiting factor. + */ + +- return max_t(unsigned long, 120000000, (pixel_rate / 100) * 101); ++ return max_t(unsigned long, HSM_MIN_CLOCK_FREQ, (pixel_rate / 100) * 101); + } + + static u32 vc4_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask) +@@ -2315,6 +2316,32 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + vc4_hdmi->disable_4kp60 = true; + } + ++ /* ++ * If we boot without any cable connected to the HDMI connector, ++ * the firmware will skip the HSM initialization and leave it ++ * with a rate of 0, resulting in a bus lockup when we're ++ * accessing the registers even if it's enabled. ++ * ++ * Let's put a sensible default at runtime_resume so that we ++ * don't end up in this situation. ++ * ++ * Strictly speaking we should be using clk_set_min_rate. ++ * However, the clk-bcm2835 clock driver favors clock rates ++ * under the expected rate, which in the case where we set the ++ * minimum clock rate will be rejected by the clock framework. ++ * ++ * However, even for the two HDMI controllers found on the ++ * BCM2711, using clk_set_rate doesn't cause any issue. Indeed, ++ * the bind callbacks are called in sequence, and before the DRM ++ * device is registered and therefore a mode is set. As such, ++ * we're not at risk of having the first controller set a ++ * different mode and then the second overriding the HSM clock ++ * frequency in its bind. ++ */ ++ ret = clk_set_rate(vc4_hdmi->hsm_clock, HSM_MIN_CLOCK_FREQ); ++ if (ret) ++ goto err_put_ddc; ++ + /* + * We need to have the device powered up at this point to call + * our reset hook and for the CEC init. +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Stefan Wahren +Date: Thu, 19 Aug 2021 15:34:34 +0200 +Subject: [PATCH 792/889] overlays: Add overlay for QCA7000 via UART0 + +This adds an overlay to connect the QCA7000 in UART mode via UART0. +The qcauart driver uses the serial device bus instead of deprecated +line disciplines. + +Signed-off-by: Stefan Wahren +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 11 +++++ + .../dts/overlays/qca7000-uart0-overlay.dts | 46 +++++++++++++++++++ + 3 files changed, 58 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/qca7000-uart0-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index fbcc3e35a747..44aedc149ff0 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -157,6 +157,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + pwm-2chan.dtbo \ + pwm-ir-tx.dtbo \ + qca7000.dtbo \ ++ qca7000-uart0.dtbo \ + rotary-encoder.dtbo \ + rpi-backlight.dtbo \ + rpi-cirrus-wm5102.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index d50d694c9e77..ec769b2d6040 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -2505,12 +2505,23 @@ Params: gpio_pin Output GPIO (default 18) + + Name: qca7000 + Info: in-tech's Evaluation Board for PLC Stamp micro ++ This uses spi0 and a separate GPIO interrupt to connect the QCA7000. + Load: dtoverlay=qca7000,= + Params: int_pin GPIO pin for interrupt signal (default 23) + + speed SPI bus speed (default 12 MHz) + + ++Name: qca7000-uart0 ++Info: in-tech's Evaluation Board for PLC Stamp micro (UART) ++ This uses uart0/ttyAMA0 over GPIOs 14 & 15 to connect the QCA7000. ++ But it requires disabling of onboard Bluetooth on ++ Pi 3B, 3B+, 3A+, 4B and Zero W. ++Load: dtoverlay=qca7000-uart0,= ++Params: baudrate Set the baudrate for the UART (default ++ "115200") ++ ++ + Name: rotary-encoder + Info: Overlay for GPIO connected rotary encoder. + Load: dtoverlay=rotary-encoder,= +diff --git a/arch/arm/boot/dts/overlays/qca7000-uart0-overlay.dts b/arch/arm/boot/dts/overlays/qca7000-uart0-overlay.dts +new file mode 100644 +index 000000000000..5dee70853289 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/qca7000-uart0-overlay.dts +@@ -0,0 +1,46 @@ ++// Overlay for the Qualcomm Atheros QCA7000 on PLC Stamp micro EVK ++// Visit: https://in-tech-smartcharging.com/products/evaluation-tools/plc-stamp-micro-2-evaluation-board for details ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835"; ++ ++ fragment@0 { ++ target = <&uart0>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins>; ++ status = "okay"; ++ ++ eth2: qca7000 { ++ compatible = "qca,qca7000"; ++ current-speed = <115200>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ uart0_pins: uart0_pins { ++ brcm,pins = <14 15>; ++ brcm,function = <4>; /* alt0 */ ++ brcm,pull = <0 2>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target-path = "/aliases"; ++ __overlay__ { ++ serial0 = "/soc/serial@7e201000"; ++ serial1 = "/soc/serial@7e215040"; ++ }; ++ }; ++ ++ __overrides__ { ++ baudrate = <ð2>, "current-speed:0"; ++ }; ++}; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 3 Sep 2021 16:54:06 +0100 +Subject: [PATCH 793/889] configs: Enable the Toneport UX1 Line 6 audio i/f + +See: https://github.com/raspberrypi/linux/issues/4562 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcm2711_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + arch/arm64/configs/bcm2711_defconfig | 1 + + arch/arm64/configs/bcmrpi3_defconfig | 1 + + 5 files changed, 5 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index dcaef9b8c9e7..08846cc44951 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -978,6 +978,7 @@ CONFIG_SND_USB_CAIAQ=m + CONFIG_SND_USB_CAIAQ_INPUT=y + CONFIG_SND_USB_6FIRE=m + CONFIG_SND_USB_HIFACE=m ++CONFIG_SND_USB_TONEPORT=m + CONFIG_SND_SOC=m + CONFIG_SND_BCM2835_SOC_I2S=m + CONFIG_SND_BCM2708_SOC_CHIPDIP_DAC=m +diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig +index b0d099ad9f2d..9466ada74228 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -993,6 +993,7 @@ CONFIG_SND_USB_CAIAQ=m + CONFIG_SND_USB_CAIAQ_INPUT=y + CONFIG_SND_USB_6FIRE=m + CONFIG_SND_USB_HIFACE=m ++CONFIG_SND_USB_TONEPORT=m + CONFIG_SND_SOC=m + CONFIG_SND_BCM2835_SOC_I2S=m + CONFIG_SND_BCM2708_SOC_CHIPDIP_DAC=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index fa02f75b2ed8..cd3492cc367e 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -971,6 +971,7 @@ CONFIG_SND_USB_CAIAQ=m + CONFIG_SND_USB_CAIAQ_INPUT=y + CONFIG_SND_USB_6FIRE=m + CONFIG_SND_USB_HIFACE=m ++CONFIG_SND_USB_TONEPORT=m + CONFIG_SND_SOC=m + CONFIG_SND_BCM2835_SOC_I2S=m + CONFIG_SND_BCM2708_SOC_CHIPDIP_DAC=m +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index 7f254d408ddc..72a51ad19bf5 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -994,6 +994,7 @@ CONFIG_SND_USB_CAIAQ=m + CONFIG_SND_USB_CAIAQ_INPUT=y + CONFIG_SND_USB_6FIRE=m + CONFIG_SND_USB_HIFACE=m ++CONFIG_SND_USB_TONEPORT=m + CONFIG_SND_SOC=m + CONFIG_SND_BCM2835_SOC_I2S=m + CONFIG_SND_BCM2708_SOC_CHIPDIP_DAC=m +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index 58a5e0535b6f..0cecfa4b3986 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -906,6 +906,7 @@ CONFIG_SND_USB_UA101=m + CONFIG_SND_USB_CAIAQ=m + CONFIG_SND_USB_CAIAQ_INPUT=y + CONFIG_SND_USB_6FIRE=m ++CONFIG_SND_USB_TONEPORT=m + CONFIG_SND_SOC=m + CONFIG_SND_BCM2835_SOC_I2S=m + CONFIG_SND_BCM2708_SOC_CHIPDIP_DAC=m +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 8 Sep 2021 13:32:31 +0200 +Subject: [PATCH 794/889] drm/probe: Fix drm_connector_helper_hpd_irq_event + deadlock + +drm_connector_helper_hpd_irq_event() calls +drm_kms_helper_hotplug_event() with the mode-setting lock taken while +it's supposed to be called without that lock taken. + +This results in a lockdep warning, and a deadlock if we were to wake up +a TV through CEC (and possibly other cases). + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/drm_probe_helper.c | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c +index 0a4c7581b510..f8eb1061a55f 100644 +--- a/drivers/gpu/drm/drm_probe_helper.c ++++ b/drivers/gpu/drm/drm_probe_helper.c +@@ -795,8 +795,7 @@ void drm_kms_helper_poll_fini(struct drm_device *dev) + EXPORT_SYMBOL(drm_kms_helper_poll_fini); + + static bool +-_drm_connector_helper_hpd_irq_event(struct drm_connector *connector, +- bool notify) ++_drm_connector_helper_hpd_irq_event(struct drm_connector *connector) + { + struct drm_device *dev = connector->dev; + enum drm_connector_status old_status; +@@ -836,11 +835,6 @@ _drm_connector_helper_hpd_irq_event(struct drm_connector *connector, + if (old_epoch_counter != connector->epoch_counter) + changed = true; + +- if (changed && notify) { +- drm_kms_helper_hotplug_event(dev); +- DRM_DEBUG_KMS("Sent hotplug event\n"); +- } +- + return changed; + } + +@@ -866,9 +860,14 @@ bool drm_connector_helper_hpd_irq_event(struct drm_connector *connector) + bool changed; + + mutex_lock(&dev->mode_config.mutex); +- changed = _drm_connector_helper_hpd_irq_event(connector, true); ++ changed = _drm_connector_helper_hpd_irq_event(connector); + mutex_unlock(&dev->mode_config.mutex); + ++ if (changed) { ++ drm_kms_helper_hotplug_event(dev); ++ DRM_DEBUG_KMS("Sent hotplug event\n"); ++ } ++ + return changed; + } + EXPORT_SYMBOL(drm_connector_helper_hpd_irq_event); +@@ -908,8 +907,7 @@ bool drm_helper_hpd_irq_event(struct drm_device *dev) + mutex_lock(&dev->mode_config.mutex); + drm_connector_list_iter_begin(dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { +- if (_drm_connector_helper_hpd_irq_event(connector, +- false)) ++ if (_drm_connector_helper_hpd_irq_event(connector)) + changed = true; + } + drm_connector_list_iter_end(&conn_iter); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 8 Sep 2021 14:10:32 +0100 +Subject: [PATCH 795/889] overlays: README: Refer to WLAN where possible + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/README | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index ec769b2d6040..890e926636b7 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -235,7 +235,7 @@ Params: + sd_debug Enable debug output from SD driver (default off) + + sdio_overclock Clock (in MHz) to use when the MMC framework +- requests 50MHz for the SDIO/WiFi interface. ++ requests 50MHz for the SDIO/WLAN interface. + + tx_lpi_timer Set the delay in microseconds between going idle + and entering the low power state (default 600). +@@ -611,7 +611,7 @@ Params: swap_lr Reverse the channel allocation, which will also + + + Name: balena-fin +-Info: Overlay that enables WiFi, Bluetooth and the GPIO expander on the ++Info: Overlay that enables WLAN, Bluetooth and the GPIO expander on the + balenaFin carrier board for the Raspberry Pi Compute Module 3/3+ Lite. + Load: dtoverlay=balena-fin + Params: +@@ -694,7 +694,7 @@ Params: + + + Name: disable-wifi +-Info: Disable onboard WiFi on Pi 3B, 3B+, 3A+, 4B and Zero W. ++Info: Disable onboard WLAN on Pi 3B, 3B+, 3A+, 4B and Zero W. + Load: dtoverlay=disable-wifi + Params: + +@@ -2723,7 +2723,7 @@ Name: sdhost + Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock. + N.B. This overlay is designed for situations where the mmc driver is + the default, so it disables the other (mmc) interface - this will kill +- WiFi on a Pi3. If this isn't what you want, either use the sdtweak ++ WLAN on a Pi3. If this isn't what you want, either use the sdtweak + overlay or the new sd_* dtparams of the base DTBs. + Load: dtoverlay=sdhost,= + Params: overclock_50 Clock (in MHz) to use when the MMC framework +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Plowman +Date: Wed, 8 Sep 2021 14:15:17 +0100 +Subject: [PATCH 796/889] media: i2c: imx477: Allow control of on-sensor DPC + +A module parameter "dpc_enable" is added to allow the control of the +sensor's on-board DPC (Defective Pixel Correction) function. + +This is a global setting to be configured before using the sensor; +there is no intention that this would ever be changed on-the-fly. + +Signed-off-by: David Plowman +--- + drivers/media/i2c/imx477.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/media/i2c/imx477.c b/drivers/media/i2c/imx477.c +index fcde88d90a8f..05cb530d331e 100644 +--- a/drivers/media/i2c/imx477.c ++++ b/drivers/media/i2c/imx477.c +@@ -21,6 +21,10 @@ + #include + #include + ++static int dpc_enable = 1; ++module_param(dpc_enable, int, 0644); ++MODULE_PARM_DESC(dpc_enable, "Enable on-sensor DPC"); ++ + #define IMX477_REG_VALUE_08BIT 1 + #define IMX477_REG_VALUE_16BIT 2 + +@@ -1711,6 +1715,10 @@ static int imx477_start_streaming(struct imx477 *imx477) + return ret; + } + ++ /* Set on-sensor DPC. */ ++ imx477_write_reg(imx477, 0x0b05, IMX477_REG_VALUE_08BIT, !!dpc_enable); ++ imx477_write_reg(imx477, 0x0b06, IMX477_REG_VALUE_08BIT, !!dpc_enable); ++ + /* Apply customized values from user */ + ret = __v4l2_ctrl_handler_setup(imx477->sd.ctrl_handler); + if (ret) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 10 Sep 2021 21:10:03 +0100 +Subject: [PATCH 797/889] gpio-fsm: Clamp the delay time to zero + +The sysfs delay_ms value is calculated live, and it is possible for +the time left to appear to be negative briefly if the timer handling +hasn't completed. Ensure the displayed value never goes below zero, +for the sake of appearances. + +Signed-off-by: Phil Elwell +--- + drivers/gpio/gpio-fsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpio/gpio-fsm.c b/drivers/gpio/gpio-fsm.c +index 306f5123546c..3a348f1c6514 100644 +--- a/drivers/gpio/gpio-fsm.c ++++ b/drivers/gpio/gpio-fsm.c +@@ -884,7 +884,7 @@ static ssize_t delay_ms_show(struct device *dev, + const struct gpio_fsm *gf = dev_get_drvdata(dev); + int jiffies_left; + +- jiffies_left = gf->delay_jiffies - jiffies; ++ jiffies_left = max((int)(gf->delay_jiffies - jiffies), 0); + return sprintf(buf, + gf->delay_target_state ? "%u\n" : "-\n", + jiffies_to_msecs(jiffies_left)); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 13 Sep 2021 17:30:18 +0100 +Subject: [PATCH 798/889] drm/vc4: Reset HDMI MISC_CONTROL register. + +The HDMI block can repeat pixels for double clocked modes, +and the firmware is now configuring the block to do this as +the PV is doing it incorrectly when at 2pixels/clock. +If the kernel doesn't reset it then we end up with strange +modes. + +Reset MISC_CONTROL. + +Signed-off-by: Dave Stevenson +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++++++ + drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 3 +++ + 2 files changed, 11 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index cc1a05df6195..463407154e6b 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -80,6 +80,9 @@ + #define VC5_HDMI_VERTB_VSPO_SHIFT 16 + #define VC5_HDMI_VERTB_VSPO_MASK VC4_MASK(29, 16) + ++#define VC5_HDMI_MISC_CONTROL_PIXEL_REP_SHIFT 0 ++#define VC5_HDMI_MISC_CONTROL_PIXEL_REP_MASK VC4_MASK(3, 0) ++ + #define VC5_HDMI_SCRAMBLER_CTL_ENABLE BIT(0) + + #define VC5_HDMI_DEEP_COLOR_CONFIG_1_INIT_PACK_PHASE_SHIFT 8 +@@ -877,6 +880,11 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + reg |= gcp_en ? VC5_HDMI_GCP_CONFIG_GCP_ENABLE : 0; + HDMI_WRITE(HDMI_GCP_CONFIG, reg); + ++ reg = HDMI_READ(HDMI_MISC_CONTROL); ++ reg &= ~VC5_HDMI_MISC_CONTROL_PIXEL_REP_MASK; ++ reg |= VC4_SET_FIELD(0, VC5_HDMI_MISC_CONTROL_PIXEL_REP); ++ HDMI_WRITE(HDMI_MISC_CONTROL, reg); ++ + HDMI_WRITE(HDMI_CLOCK_STOP, 0); + } + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h +index 99dde6e06a37..23930a8fa376 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h +@@ -125,6 +125,7 @@ enum vc4_hdmi_field { + HDMI_VERTB0, + HDMI_VERTB1, + HDMI_VID_CTL, ++ HDMI_MISC_CONTROL, + }; + + struct vc4_hdmi_register { +@@ -235,6 +236,7 @@ static const struct vc4_hdmi_register __maybe_unused vc5_hdmi_hdmi0_fields[] = { + VC4_HDMI_REG(HDMI_VERTB0, 0x0f0), + VC4_HDMI_REG(HDMI_VERTA1, 0x0f4), + VC4_HDMI_REG(HDMI_VERTB1, 0x0f8), ++ VC4_HDMI_REG(HDMI_MISC_CONTROL, 0x100), + VC4_HDMI_REG(HDMI_MAI_CHANNEL_MAP, 0x09c), + VC4_HDMI_REG(HDMI_MAI_CONFIG, 0x0a0), + VC4_HDMI_REG(HDMI_DEEP_COLOR_CONFIG_1, 0x170), +@@ -315,6 +317,7 @@ static const struct vc4_hdmi_register __maybe_unused vc5_hdmi_hdmi1_fields[] = { + VC4_HDMI_REG(HDMI_VERTB0, 0x0f0), + VC4_HDMI_REG(HDMI_VERTA1, 0x0f4), + VC4_HDMI_REG(HDMI_VERTB1, 0x0f8), ++ VC4_HDMI_REG(HDMI_MISC_CONTROL, 0x100), + VC4_HDMI_REG(HDMI_MAI_CHANNEL_MAP, 0x09c), + VC4_HDMI_REG(HDMI_MAI_CONFIG, 0x0a0), + VC4_HDMI_REG(HDMI_DEEP_COLOR_CONFIG_1, 0x170), +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 6 Jul 2021 18:53:28 +0100 +Subject: [PATCH 799/889] drm/vc4: Release workaround buffer and DMA in error + paths and unbind + +On Pi0-3 the driver allocates a buffer and requests a DMA channel +because the ARM can't write to DSI1's registers directly. +However unbind and the error paths in bind don't release the buffer or +the DMA channel. + +Signed-off-by: Dave Stevenson +--- + drivers/gpu/drm/vc4/vc4_dsi.c | 47 +++++++++++++++++++++++++++-------- + 1 file changed, 36 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c +index 9861e2d2c05d..82b82ba7cc9e 100644 +--- a/drivers/gpu/drm/vc4/vc4_dsi.c ++++ b/drivers/gpu/drm/vc4/vc4_dsi.c +@@ -1608,7 +1608,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + if (ret != -EPROBE_DEFER) + DRM_ERROR("Failed to get DMA channel: %d\n", + ret); +- return ret; ++ goto err_free_dma_mem; + } + + /* Get the physical address of the device's registers. The +@@ -1637,7 +1637,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + if (ret) { + if (ret != -EPROBE_DEFER) + dev_err(dev, "Failed to get interrupt: %d\n", ret); +- return ret; ++ goto err_free_dma; + } + + dsi->escape_clock = devm_clk_get(dev, "escape"); +@@ -1645,7 +1645,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + ret = PTR_ERR(dsi->escape_clock); + if (ret != -EPROBE_DEFER) + dev_err(dev, "Failed to get escape clock: %d\n", ret); +- return ret; ++ goto err_free_dma; + } + + dsi->pll_phy_clock = devm_clk_get(dev, "phy"); +@@ -1653,7 +1653,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + ret = PTR_ERR(dsi->pll_phy_clock); + if (ret != -EPROBE_DEFER) + dev_err(dev, "Failed to get phy clock: %d\n", ret); +- return ret; ++ goto err_free_dma; + } + + dsi->pixel_clock = devm_clk_get(dev, "pixel"); +@@ -1661,7 +1661,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + ret = PTR_ERR(dsi->pixel_clock); + if (ret != -EPROBE_DEFER) + dev_err(dev, "Failed to get pixel clock: %d\n", ret); +- return ret; ++ goto err_free_dma; + } + + ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, +@@ -1676,26 +1676,28 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + if (ret == -ENODEV) + return 0; + +- return ret; ++ goto err_free_dma; + } + + if (panel) { + dsi->bridge = devm_drm_panel_bridge_add_typed(dev, panel, + DRM_MODE_CONNECTOR_DSI); +- if (IS_ERR(dsi->bridge)) +- return PTR_ERR(dsi->bridge); ++ if (IS_ERR(dsi->bridge)) { ++ ret = PTR_ERR(dsi->bridge); ++ goto err_free_dma; ++ } + } + + /* The esc clock rate is supposed to always be 100Mhz. */ + ret = clk_set_rate(dsi->escape_clock, 100 * 1000000); + if (ret) { + dev_err(dev, "Failed to set esc clock: %d\n", ret); +- return ret; ++ goto err_free_dma; + } + + ret = vc4_dsi_init_phy_clocks(dsi); + if (ret) +- return ret; ++ goto err_free_dma; + + drm_simple_encoder_init(drm, dsi->encoder, DRM_MODE_ENCODER_DSI); + drm_encoder_helper_add(dsi->encoder, &vc4_dsi_encoder_helper_funcs); +@@ -1703,7 +1705,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + ret = drm_bridge_attach(dsi->encoder, dsi->bridge, NULL, 0); + if (ret) { + dev_err(dev, "bridge attach failed: %d\n", ret); +- return ret; ++ goto err_free_dma; + } + /* Disable the atomic helper calls into the bridge. We + * manually call the bridge pre_enable / enable / etc. calls +@@ -1717,6 +1719,19 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + pm_runtime_enable(dev); + + return 0; ++ ++err_free_dma: ++ if (dsi->reg_dma_chan) { ++ dma_release_channel(dsi->reg_dma_chan); ++ dsi->reg_dma_chan = NULL; ++ } ++err_free_dma_mem: ++ if (dsi->reg_dma_mem) { ++ dma_free_coherent(dev, 4, dsi->reg_dma_mem, dsi->reg_dma_paddr); ++ dsi->reg_dma_mem = NULL; ++ } ++ ++ return ret; + } + + static void vc4_dsi_unbind(struct device *dev, struct device *master, +@@ -1733,6 +1748,16 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master, + */ + list_splice_init(&dsi->bridge_chain, &dsi->encoder->bridge_chain); + drm_encoder_cleanup(dsi->encoder); ++ ++ if (dsi->reg_dma_chan) { ++ dma_release_channel(dsi->reg_dma_chan); ++ dsi->reg_dma_chan = NULL; ++ } ++ ++ if (dsi->reg_dma_mem) { ++ dma_free_coherent(dev, 4, dsi->reg_dma_mem, dsi->reg_dma_paddr); ++ dsi->reg_dma_mem = NULL; ++ } + } + + static const struct component_ops vc4_dsi_ops = { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 18 Jun 2021 21:52:28 +0100 +Subject: [PATCH 800/889] drm/vc4: Correct DSI divider calculations + +The divider calculations tried to find the divider +just faster than the clock requested. However if +it required a divider of 7 then the for loop +aborted without handling the "error" case, and could +end up with a clock lower than requested. + +Correct the loop so that we always have a clock greater +than requested. + +Signed-off-by: Dave Stevenson +--- + drivers/gpu/drm/vc4/vc4_dsi.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c +index 82b82ba7cc9e..1c6939c9c232 100644 +--- a/drivers/gpu/drm/vc4/vc4_dsi.c ++++ b/drivers/gpu/drm/vc4/vc4_dsi.c +@@ -850,11 +850,9 @@ static bool vc4_dsi_encoder_mode_fixup(struct drm_encoder *encoder, + /* Find what divider gets us a faster clock than the requested + * pixel clock. + */ +- for (divider = 1; divider < 8; divider++) { +- if (parent_rate / divider < pll_clock) { +- divider--; ++ for (divider = 1; divider < 7; divider++) { ++ if (parent_rate / (divider + 1) < pll_clock) + break; +- } + } + + /* Now that we've picked a PLL divider, calculate back to its +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 3 Sep 2021 17:47:37 +0100 +Subject: [PATCH 801/889] drm/panel/raspberrypi-touchscreen: Avoid NULL deref + if not initialised + +If a call to rpi_touchscreen_i2c_write from rpi_touchscreen_probe +fails before mipi_dsi_device_register_full is called, then +in trying to log the error message if uses ts->dsi->dev when +it is still NULL. + +Use ts->i2c->dev instead, which is initialised earlier in probe. + +Signed-off-by: Dave Stevenson +--- + drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +index 804bdcc978dd..a6436f533806 100644 +--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c ++++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +@@ -257,7 +257,7 @@ static void rpi_touchscreen_i2c_write(struct rpi_touchscreen *ts, + + ret = i2c_smbus_write_byte_data(ts->i2c, reg, val); + if (ret) +- dev_err(&ts->dsi->dev, "I2C write failed: %d\n", ret); ++ dev_err(&ts->i2c->dev, "I2C write failed: %d\n", ret); + } + + static int rpi_touchscreen_write(struct rpi_touchscreen *ts, u16 reg, u32 val) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 3 Sep 2021 17:52:59 +0100 +Subject: [PATCH 802/889] drm/panel/raspberrypi-touchscreen: Initialise the + bridge in prepare + +The panel has a prepare call which is before video starts, and an +enable call which is after. +The Toshiba bridge should be configured before video, so move +the relevant power and initialisation calls to prepare. + +Signed-off-by: Dave Stevenson +--- + drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +index a6436f533806..e2597361407c 100644 +--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c ++++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +@@ -293,7 +293,7 @@ static int rpi_touchscreen_noop(struct drm_panel *panel) + return 0; + } + +-static int rpi_touchscreen_enable(struct drm_panel *panel) ++static int rpi_touchscreen_prepare(struct drm_panel *panel) + { + struct rpi_touchscreen *ts = panel_to_ts(panel); + int i; +@@ -324,6 +324,13 @@ static int rpi_touchscreen_enable(struct drm_panel *panel) + rpi_touchscreen_write(ts, DSI_STARTDSI, 0x01); + msleep(100); + ++ return 0; ++} ++ ++static int rpi_touchscreen_enable(struct drm_panel *panel) ++{ ++ struct rpi_touchscreen *ts = panel_to_ts(panel); ++ + /* Turn on the backlight. */ + rpi_touchscreen_i2c_write(ts, REG_PWM, 255); + +@@ -378,7 +385,7 @@ static int rpi_touchscreen_get_modes(struct drm_panel *panel, + static const struct drm_panel_funcs rpi_touchscreen_funcs = { + .disable = rpi_touchscreen_disable, + .unprepare = rpi_touchscreen_noop, +- .prepare = rpi_touchscreen_noop, ++ .prepare = rpi_touchscreen_prepare, + .enable = rpi_touchscreen_enable, + .get_modes = rpi_touchscreen_get_modes, + }; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 8 Sep 2021 14:21:38 +0100 +Subject: [PATCH 803/889] drm/panel/raspberrypi-touchscreen: Handle I2C errors. + +rpi_touchscreen_i2c_read returns any errors from i2c_transfer, +or the 8 bit received value. +Check for error values before trying to process the data as +valid. + +Signed-off-by: Dave Stevenson +--- + drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +index e2597361407c..3f0c11fa60a5 100644 +--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c ++++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +@@ -296,13 +296,14 @@ static int rpi_touchscreen_noop(struct drm_panel *panel) + static int rpi_touchscreen_prepare(struct drm_panel *panel) + { + struct rpi_touchscreen *ts = panel_to_ts(panel); +- int i; ++ int i, data; + + rpi_touchscreen_i2c_write(ts, REG_POWERON, 1); + usleep_range(20000, 25000); + /* Wait for nPWRDWN to go low to indicate poweron is done. */ + for (i = 0; i < 100; i++) { +- if (rpi_touchscreen_i2c_read(ts, REG_PORTB) & 1) ++ data = rpi_touchscreen_i2c_read(ts, REG_PORTB); ++ if (data >= 0 && (data & 1)) + break; + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 26 Mar 2021 17:06:36 +0000 +Subject: [PATCH 804/889] drm/panel-simple: Add a timing for the Raspberry Pi + 7" panel + +The Raspberry Pi 7" 800x480 panel uses a Toshiba TC358762 DSI +to DPI bridge chip, so there is a requirement for the timings +to be specified for the end panel. Add such a definition. + +Signed-off-by: Dave Stevenson +--- + drivers/gpu/drm/panel/panel-simple.c | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c +index b7be0561006d..8becb0e31814 100644 +--- a/drivers/gpu/drm/panel/panel-simple.c ++++ b/drivers/gpu/drm/panel/panel-simple.c +@@ -3219,6 +3219,31 @@ static const struct panel_desc qd43003c0_40 = { + .bus_format = MEDIA_BUS_FMT_RGB888_1X24, + }; + ++static const struct drm_display_mode raspberrypi_7inch_mode = { ++ .clock = 25979400 / 1000, ++ .hdisplay = 800, ++ .hsync_start = 800 + 2, ++ .hsync_end = 800 + 2 + 2, ++ .htotal = 800 + 2 + 2 + 46, ++ .vdisplay = 480, ++ .vsync_start = 480 + 7, ++ .vsync_end = 480 + 7 + 2, ++ .vtotal = 480 + 7 + 2 + 21, ++ .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, ++}; ++ ++static const struct panel_desc raspberrypi_7inch = { ++ .modes = &raspberrypi_7inch_mode, ++ .num_modes = 1, ++ .bpc = 8, ++ .size = { ++ .width = 154, ++ .height = 86, ++ }, ++ .bus_format = MEDIA_BUS_FMT_RGB888_1X24, ++ .connector_type = DRM_MODE_CONNECTOR_DSI, ++}; ++ + static const struct display_timing rocktech_rk070er9427_timing = { + .pixelclock = { 26400000, 33300000, 46800000 }, + .hactive = { 800, 800, 800 }, +@@ -4239,6 +4264,9 @@ static const struct of_device_id platform_of_match[] = { + }, { + .compatible = "qiaodian,qd43003c0-40", + .data = &qd43003c0_40, ++ }, { ++ .compatible = "raspberrypi,7inch-dsi", ++ .data = &raspberrypi_7inch, + }, { + .compatible = "rocktech,rk070er9427", + .data = &rocktech_rk070er9427, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 8 Sep 2021 14:46:17 +0100 +Subject: [PATCH 805/889] Input: edt-ft54x6: Clean up timer and workqueue on + remove + +If no interrupt is defined then a timer and workqueue are used +to poll the controller. +On remove these were not being cleaned up correctly. + +Fixes: ca61fdaba79f "Input: edt-ft5x06: Poll the device if no interrupt is +configured." + +Signed-off-by: Dave Stevenson +--- + drivers/input/touchscreen/edt-ft5x06.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c +index 7e8acc0c19be..d4060bc89ce9 100644 +--- a/drivers/input/touchscreen/edt-ft5x06.c ++++ b/drivers/input/touchscreen/edt-ft5x06.c +@@ -1288,6 +1288,10 @@ static int edt_ft5x06_ts_remove(struct i2c_client *client) + { + struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); + ++ if (!client->irq) { ++ del_timer(&tsdata->timer); ++ cancel_work_sync(&tsdata->work_i2c_poll); ++ } + edt_ft5x06_ts_teardown_debugfs(tsdata); + + return 0; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 11 Feb 2021 18:46:06 +0000 +Subject: [PATCH 806/889] regulator: rpi-panel: Register with a unique + backlight name + +There's no reason why 2 Raspberry Pi DSI displays can't be +attached to a Pi Compute Module, so the backlight names need to +be unique. + +Use the parent dev_name. It's not as readable, but is unique. + +Signed-off-by: Dave Stevenson +--- + drivers/regulator/rpi-panel-attiny-regulator.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/regulator/rpi-panel-attiny-regulator.c b/drivers/regulator/rpi-panel-attiny-regulator.c +index ee46bfbf5eee..370b9ae363dd 100644 +--- a/drivers/regulator/rpi-panel-attiny-regulator.c ++++ b/drivers/regulator/rpi-panel-attiny-regulator.c +@@ -181,8 +181,7 @@ static int attiny_i2c_probe(struct i2c_client *i2c, + + props.type = BACKLIGHT_RAW; + props.max_brightness = 0xff; +- bl = devm_backlight_device_register(&i2c->dev, +- "7inch-touchscreen-panel-bl", ++ bl = devm_backlight_device_register(&i2c->dev, dev_name(&i2c->dev), + &i2c->dev, regmap, &attiny_bl, + &props); + if (IS_ERR(bl)) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 8 Sep 2021 14:56:03 +0100 +Subject: [PATCH 807/889] regulator: rpi-panel: Handle I2C errors/timing to the + Atmel + +The Atmel is doing some things in the I2C ISR, during which +period it will not respond to further commands. This is +particularly true of the POWERON command. + +Increase delays appropriately, and retry should I2C errors be +reported. + +Signed-off-by: Dave Stevenson +--- + .../regulator/rpi-panel-attiny-regulator.c | 56 +++++++++++++++---- + 1 file changed, 46 insertions(+), 10 deletions(-) + +diff --git a/drivers/regulator/rpi-panel-attiny-regulator.c b/drivers/regulator/rpi-panel-attiny-regulator.c +index 370b9ae363dd..00fb69efcfa2 100644 +--- a/drivers/regulator/rpi-panel-attiny-regulator.c ++++ b/drivers/regulator/rpi-panel-attiny-regulator.c +@@ -37,11 +37,24 @@ static const struct regmap_config attiny_regmap_config = { + static int attiny_lcd_power_enable(struct regulator_dev *rdev) + { + unsigned int data; ++ int ret, i; + + regmap_write(rdev->regmap, REG_POWERON, 1); ++ msleep(80); ++ + /* Wait for nPWRDWN to go low to indicate poweron is done. */ +- regmap_read_poll_timeout(rdev->regmap, REG_PORTB, data, +- data & BIT(0), 10, 1000000); ++ for (i = 0; i < 20; i++) { ++ ret = regmap_read(rdev->regmap, REG_PORTB, &data); ++ if (!ret) { ++ if (data & BIT(0)) ++ break; ++ } ++ usleep_range(10000, 12000); ++ } ++ usleep_range(10000, 12000); ++ ++ if (ret) ++ pr_err("%s: regmap_read_poll_timeout failed %d\n", __func__, ret); + + /* Default to the same orientation as the closed source + * firmware used for the panel. Runtime rotation +@@ -57,23 +70,34 @@ static int attiny_lcd_power_disable(struct regulator_dev *rdev) + { + regmap_write(rdev->regmap, REG_PWM, 0); + regmap_write(rdev->regmap, REG_POWERON, 0); +- udelay(1); ++ msleep(30); + return 0; + } + + static int attiny_lcd_power_is_enabled(struct regulator_dev *rdev) + { + unsigned int data; +- int ret; ++ int ret, i; + +- ret = regmap_read(rdev->regmap, REG_POWERON, &data); ++ for (i = 0; i < 10; i++) { ++ ret = regmap_read(rdev->regmap, REG_POWERON, &data); ++ if (!ret) ++ break; ++ usleep_range(10000, 12000); ++ } + if (ret < 0) + return ret; + + if (!(data & BIT(0))) + return 0; + +- ret = regmap_read(rdev->regmap, REG_PORTB, &data); ++ for (i = 0; i < 10; i++) { ++ ret = regmap_read(rdev->regmap, REG_PORTB, &data); ++ if (!ret) ++ break; ++ usleep_range(10000, 12000); ++ } ++ + if (ret < 0) + return ret; + +@@ -103,20 +127,32 @@ static int attiny_update_status(struct backlight_device *bl) + { + struct regmap *regmap = bl_get_data(bl); + int brightness = bl->props.brightness; ++ int ret, i; + + if (bl->props.power != FB_BLANK_UNBLANK || + bl->props.fb_blank != FB_BLANK_UNBLANK) + brightness = 0; + +- return regmap_write(regmap, REG_PWM, brightness); ++ for (i = 0; i < 10; i++) { ++ ret = regmap_write(regmap, REG_PWM, brightness); ++ if (!ret) ++ break; ++ } ++ ++ return ret; + } + + static int attiny_get_brightness(struct backlight_device *bl) + { + struct regmap *regmap = bl_get_data(bl); +- int ret, brightness; ++ int ret, brightness, i; ++ ++ for (i = 0; i < 10; i++) { ++ ret = regmap_read(regmap, REG_PWM, &brightness); ++ if (!ret) ++ break; ++ } + +- ret = regmap_read(regmap, REG_PWM, &brightness); + if (ret) + return ret; + +@@ -166,7 +202,7 @@ static int attiny_i2c_probe(struct i2c_client *i2c, + } + + regmap_write(regmap, REG_POWERON, 0); +- mdelay(1); ++ msleep(30); + + config.dev = &i2c->dev; + config.regmap = regmap; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 8 Sep 2021 15:02:05 +0100 +Subject: [PATCH 808/889] regulator: rpi-panel: Serialise operations. + +The driver was using the regmap lock to serialise the +individual accesses, but we really need to protect the +timings of enabling the regulators, including any communication +with the Atmel. + +Use a mutex within the driver to control overall accesses to +the Atmel, instead of the regmap lock. + +Signed-off-by: Dave Stevenson +--- + .../regulator/rpi-panel-attiny-regulator.c | 91 ++++++++++++++++--- + 1 file changed, 80 insertions(+), 11 deletions(-) + +diff --git a/drivers/regulator/rpi-panel-attiny-regulator.c b/drivers/regulator/rpi-panel-attiny-regulator.c +index 00fb69efcfa2..a4af7adad2b5 100644 +--- a/drivers/regulator/rpi-panel-attiny-regulator.c ++++ b/drivers/regulator/rpi-panel-attiny-regulator.c +@@ -27,18 +27,28 @@ + #define REG_POWERON 0x85 + #define REG_PWM 0x86 + ++struct attiny_lcd { ++ /* lock to serialise overall accesses to the Atmel */ ++ struct mutex lock; ++ struct regmap *regmap; ++}; ++ + static const struct regmap_config attiny_regmap_config = { + .reg_bits = 8, + .val_bits = 8, ++ .disable_locking = 1, + .max_register = REG_PWM, + .cache_type = REGCACHE_NONE, + }; + + static int attiny_lcd_power_enable(struct regulator_dev *rdev) + { ++ struct mutex *lock = rdev_get_drvdata(rdev); + unsigned int data; + int ret, i; + ++ mutex_lock(lock); ++ + regmap_write(rdev->regmap, REG_POWERON, 1); + msleep(80); + +@@ -63,33 +73,49 @@ static int attiny_lcd_power_enable(struct regulator_dev *rdev) + */ + regmap_write(rdev->regmap, REG_PORTA, BIT(2)); + ++ mutex_unlock(lock); ++ + return 0; + } + + static int attiny_lcd_power_disable(struct regulator_dev *rdev) + { ++ struct mutex *lock = rdev_get_drvdata(rdev); ++ ++ mutex_lock(lock); ++ + regmap_write(rdev->regmap, REG_PWM, 0); + regmap_write(rdev->regmap, REG_POWERON, 0); + msleep(30); ++ ++ mutex_unlock(lock); ++ + return 0; + } + + static int attiny_lcd_power_is_enabled(struct regulator_dev *rdev) + { ++ struct mutex *lock = rdev_get_drvdata(rdev); + unsigned int data; + int ret, i; + ++ mutex_lock(lock); ++ + for (i = 0; i < 10; i++) { + ret = regmap_read(rdev->regmap, REG_POWERON, &data); + if (!ret) + break; + usleep_range(10000, 12000); + } +- if (ret < 0) ++ if (ret < 0) { ++ mutex_unlock(lock); + return ret; ++ } + +- if (!(data & BIT(0))) ++ if (!(data & BIT(0))) { ++ mutex_unlock(lock); + return 0; ++ } + + for (i = 0; i < 10; i++) { + ret = regmap_read(rdev->regmap, REG_PORTB, &data); +@@ -98,6 +124,8 @@ static int attiny_lcd_power_is_enabled(struct regulator_dev *rdev) + usleep_range(10000, 12000); + } + ++ mutex_unlock(lock); ++ + if (ret < 0) + return ret; + +@@ -125,10 +153,13 @@ static const struct regulator_desc attiny_regulator = { + + static int attiny_update_status(struct backlight_device *bl) + { +- struct regmap *regmap = bl_get_data(bl); ++ struct attiny_lcd *state = bl_get_data(bl); ++ struct regmap *regmap = state->regmap; + int brightness = bl->props.brightness; + int ret, i; + ++ mutex_lock(&state->lock); ++ + if (bl->props.power != FB_BLANK_UNBLANK || + bl->props.fb_blank != FB_BLANK_UNBLANK) + brightness = 0; +@@ -139,20 +170,27 @@ static int attiny_update_status(struct backlight_device *bl) + break; + } + ++ mutex_unlock(&state->lock); ++ + return ret; + } + + static int attiny_get_brightness(struct backlight_device *bl) + { +- struct regmap *regmap = bl_get_data(bl); ++ struct attiny_lcd *state = bl_get_data(bl); ++ struct regmap *regmap = state->regmap; + int ret, brightness, i; + ++ mutex_lock(&state->lock); ++ + for (i = 0; i < 10; i++) { + ret = regmap_read(regmap, REG_PWM, &brightness); + if (!ret) + break; + } + ++ mutex_unlock(&state->lock); ++ + if (ret) + return ret; + +@@ -174,22 +212,30 @@ static int attiny_i2c_probe(struct i2c_client *i2c, + struct regulator_config config = { }; + struct backlight_device *bl; + struct regulator_dev *rdev; ++ struct attiny_lcd *state; + struct regmap *regmap; + unsigned int data; + int ret; + ++ state = devm_kzalloc(&i2c->dev, sizeof(*state), GFP_KERNEL); ++ if (!state) ++ return -ENOMEM; ++ ++ mutex_init(&state->lock); ++ i2c_set_clientdata(i2c, state); ++ + regmap = devm_regmap_init_i2c(i2c, &attiny_regmap_config); + if (IS_ERR(regmap)) { + ret = PTR_ERR(regmap); + dev_err(&i2c->dev, "Failed to allocate register map: %d\n", + ret); +- return ret; ++ goto error; + } + + ret = regmap_read(regmap, REG_ID, &data); + if (ret < 0) { + dev_err(&i2c->dev, "Failed to read REG_ID reg: %d\n", ret); +- return ret; ++ goto error; + } + + switch (data) { +@@ -198,7 +244,8 @@ static int attiny_i2c_probe(struct i2c_client *i2c, + break; + default: + dev_err(&i2c->dev, "Unknown Atmel firmware revision: 0x%02x\n", data); +- return -ENODEV; ++ ret = -ENODEV; ++ goto error; + } + + regmap_write(regmap, REG_POWERON, 0); +@@ -208,23 +255,44 @@ static int attiny_i2c_probe(struct i2c_client *i2c, + config.regmap = regmap; + config.of_node = i2c->dev.of_node; + config.init_data = &attiny_regulator_default; ++ config.driver_data = &state->lock; + + rdev = devm_regulator_register(&i2c->dev, &attiny_regulator, &config); + if (IS_ERR(rdev)) { + dev_err(&i2c->dev, "Failed to register ATTINY regulator\n"); +- return PTR_ERR(rdev); ++ ret = PTR_ERR(rdev); ++ goto error; + } + + props.type = BACKLIGHT_RAW; + props.max_brightness = 0xff; ++ ++ state->regmap = regmap; ++ + bl = devm_backlight_device_register(&i2c->dev, dev_name(&i2c->dev), +- &i2c->dev, regmap, &attiny_bl, ++ &i2c->dev, state, &attiny_bl, + &props); +- if (IS_ERR(bl)) +- return PTR_ERR(bl); ++ if (IS_ERR(bl)) { ++ ret = PTR_ERR(bl); ++ goto error; ++ } + + bl->props.brightness = 0xff; + ++ return 0; ++ ++error: ++ mutex_destroy(&state->lock); ++ ++ return ret; ++} ++ ++static int attiny_i2c_remove(struct i2c_client *client) ++{ ++ struct attiny_lcd *state = i2c_get_clientdata(client); ++ ++ mutex_destroy(&state->lock); ++ + return 0; + } + +@@ -240,6 +308,7 @@ static struct i2c_driver attiny_regulator_driver = { + .of_match_table = of_match_ptr(attiny_dt_ids), + }, + .probe = attiny_i2c_probe, ++ .remove = attiny_i2c_remove, + }; + + module_i2c_driver(attiny_regulator_driver); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 8 Sep 2021 15:41:18 +0100 +Subject: [PATCH 809/889] regulator: rpi-panel: Ensure the backlight is off + during probe. + +The initial state of the Atmel is not defined, so ensure the +backlight PWM is set to 0 by default. + +Signed-off-by: Dave Stevenson +--- + drivers/regulator/rpi-panel-attiny-regulator.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/regulator/rpi-panel-attiny-regulator.c b/drivers/regulator/rpi-panel-attiny-regulator.c +index a4af7adad2b5..b3629a1e0e50 100644 +--- a/drivers/regulator/rpi-panel-attiny-regulator.c ++++ b/drivers/regulator/rpi-panel-attiny-regulator.c +@@ -250,6 +250,7 @@ static int attiny_i2c_probe(struct i2c_client *i2c, + + regmap_write(regmap, REG_POWERON, 0); + msleep(30); ++ regmap_write(regmap, REG_PWM, 0); + + config.dev = &i2c->dev; + config.regmap = regmap; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 9 Sep 2021 18:24:57 +0100 +Subject: [PATCH 810/889] regulator: rpi-panel: Convert to drive lines directly + +The Atmel was doing a load of automatic sequencing of +control lines, however it was combining the touch controller's +reset with the bridge/panel control. + +Change to control the control signals directly rather than +through the automatic POWERON control. + +Signed-off-by: Dave Stevenson +--- + .../regulator/rpi-panel-attiny-regulator.c | 111 ++++++++++-------- + 1 file changed, 60 insertions(+), 51 deletions(-) + +diff --git a/drivers/regulator/rpi-panel-attiny-regulator.c b/drivers/regulator/rpi-panel-attiny-regulator.c +index b3629a1e0e50..995915ca4a9b 100644 +--- a/drivers/regulator/rpi-panel-attiny-regulator.c ++++ b/drivers/regulator/rpi-panel-attiny-regulator.c +@@ -21,11 +21,28 @@ + /* I2C registers of the Atmel microcontroller. */ + #define REG_ID 0x80 + #define REG_PORTA 0x81 +-#define REG_PORTA_HF BIT(2) +-#define REG_PORTA_VF BIT(3) + #define REG_PORTB 0x82 ++#define REG_PORTC 0x83 + #define REG_POWERON 0x85 + #define REG_PWM 0x86 ++#define REG_ADDR_L 0x8c ++#define REG_ADDR_H 0x8d ++#define REG_WRITE_DATA_H 0x90 ++#define REG_WRITE_DATA_L 0x91 ++ ++#define PA_LCD_DITHB BIT(0) ++#define PA_LCD_MODE BIT(1) ++#define PA_LCD_LR BIT(2) ++#define PA_LCD_UD BIT(3) ++ ++#define PB_BRIDGE_PWRDNX_N BIT(0) ++#define PB_LCD_VCC_N BIT(1) ++#define PB_LCD_MAIN BIT(7) ++ ++#define PC_LED_EN BIT(0) ++#define PC_RST_TP_N BIT(1) ++#define PC_RST_LCD_N BIT(2) ++#define PC_RST_BRIDGE_N BIT(3) + + struct attiny_lcd { + /* lock to serialise overall accesses to the Atmel */ +@@ -37,99 +54,91 @@ static const struct regmap_config attiny_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .disable_locking = 1, +- .max_register = REG_PWM, ++ .max_register = REG_WRITE_DATA_L, + .cache_type = REGCACHE_NONE, + }; + + static int attiny_lcd_power_enable(struct regulator_dev *rdev) + { +- struct mutex *lock = rdev_get_drvdata(rdev); +- unsigned int data; +- int ret, i; +- +- mutex_lock(lock); +- +- regmap_write(rdev->regmap, REG_POWERON, 1); +- msleep(80); ++ struct attiny_lcd *state = rdev_get_drvdata(rdev); + +- /* Wait for nPWRDWN to go low to indicate poweron is done. */ +- for (i = 0; i < 20; i++) { +- ret = regmap_read(rdev->regmap, REG_PORTB, &data); +- if (!ret) { +- if (data & BIT(0)) +- break; +- } +- usleep_range(10000, 12000); +- } +- usleep_range(10000, 12000); ++ mutex_lock(&state->lock); + +- if (ret) +- pr_err("%s: regmap_read_poll_timeout failed %d\n", __func__, ret); ++ /* Ensure bridge, and tp stay in reset */ ++ regmap_write(rdev->regmap, REG_PORTC, 0); ++ usleep_range(5000, 10000); + + /* Default to the same orientation as the closed source + * firmware used for the panel. Runtime rotation + * configuration will be supported using VC4's plane + * orientation bits. + */ +- regmap_write(rdev->regmap, REG_PORTA, BIT(2)); ++ regmap_write(rdev->regmap, REG_PORTA, PA_LCD_LR); ++ usleep_range(5000, 10000); ++ regmap_write(rdev->regmap, REG_PORTB, PB_LCD_MAIN); ++ usleep_range(5000, 10000); ++ /* Bring controllers out of reset */ ++ regmap_write(rdev->regmap, REG_PORTC, ++ PC_LED_EN | PC_RST_BRIDGE_N | PC_RST_LCD_N | PC_RST_TP_N); ++ ++ msleep(80); ++ ++ regmap_write(rdev->regmap, REG_ADDR_H, 0x04); ++ usleep_range(5000, 8000); ++ regmap_write(rdev->regmap, REG_ADDR_L, 0x7c); ++ usleep_range(5000, 8000); ++ regmap_write(rdev->regmap, REG_WRITE_DATA_H, 0x00); ++ usleep_range(5000, 8000); ++ regmap_write(rdev->regmap, REG_WRITE_DATA_L, 0x00); ++ ++ msleep(100); + +- mutex_unlock(lock); ++ mutex_unlock(&state->lock); + + return 0; + } + + static int attiny_lcd_power_disable(struct regulator_dev *rdev) + { +- struct mutex *lock = rdev_get_drvdata(rdev); ++ struct attiny_lcd *state = rdev_get_drvdata(rdev); + +- mutex_lock(lock); ++ mutex_lock(&state->lock); + + regmap_write(rdev->regmap, REG_PWM, 0); +- regmap_write(rdev->regmap, REG_POWERON, 0); ++ usleep_range(5000, 10000); ++ regmap_write(rdev->regmap, REG_PORTA, 0); ++ usleep_range(5000, 10000); ++ regmap_write(rdev->regmap, REG_PORTB, PB_LCD_VCC_N); ++ usleep_range(5000, 10000); ++ regmap_write(rdev->regmap, REG_PORTC, 0); + msleep(30); + +- mutex_unlock(lock); ++ mutex_unlock(&state->lock); + + return 0; + } + + static int attiny_lcd_power_is_enabled(struct regulator_dev *rdev) + { +- struct mutex *lock = rdev_get_drvdata(rdev); ++ struct attiny_lcd *state = rdev_get_drvdata(rdev); + unsigned int data; + int ret, i; + +- mutex_lock(lock); +- +- for (i = 0; i < 10; i++) { +- ret = regmap_read(rdev->regmap, REG_POWERON, &data); +- if (!ret) +- break; +- usleep_range(10000, 12000); +- } +- if (ret < 0) { +- mutex_unlock(lock); +- return ret; +- } +- +- if (!(data & BIT(0))) { +- mutex_unlock(lock); +- return 0; +- } ++ mutex_lock(&state->lock); + + for (i = 0; i < 10; i++) { +- ret = regmap_read(rdev->regmap, REG_PORTB, &data); ++ ret = regmap_read(rdev->regmap, REG_PORTC, &data); + if (!ret) + break; + usleep_range(10000, 12000); + } + +- mutex_unlock(lock); ++ mutex_unlock(&state->lock); + + if (ret < 0) + return ret; + +- return data & BIT(0); ++ return data & PC_RST_BRIDGE_N; + } + + static const struct regulator_init_data attiny_regulator_default = { +@@ -256,7 +265,7 @@ static int attiny_i2c_probe(struct i2c_client *i2c, + config.regmap = regmap; + config.of_node = i2c->dev.of_node; + config.init_data = &attiny_regulator_default; +- config.driver_data = &state->lock; ++ config.driver_data = state; + + rdev = devm_regulator_register(&i2c->dev, &attiny_regulator, &config); + if (IS_ERR(rdev)) { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 10 Sep 2021 13:50:28 +0100 +Subject: [PATCH 811/889] regulator: rpi-panel: Add GPIO control for panel and + touch resets + +We need independent control of the resets for the panel&bridge, +vs the touch controller. + +Expose the reset lines that are on the Atmel's port C via the GPIO +API so that they can be controlled appropriately. + +Signed-off-by: Dave Stevenson +--- + .../regulator/rpi-panel-attiny-regulator.c | 115 +++++++++++++++--- + 1 file changed, 97 insertions(+), 18 deletions(-) + +diff --git a/drivers/regulator/rpi-panel-attiny-regulator.c b/drivers/regulator/rpi-panel-attiny-regulator.c +index 995915ca4a9b..998233f14085 100644 +--- a/drivers/regulator/rpi-panel-attiny-regulator.c ++++ b/drivers/regulator/rpi-panel-attiny-regulator.c +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -44,10 +45,30 @@ + #define PC_RST_LCD_N BIT(2) + #define PC_RST_BRIDGE_N BIT(3) + ++enum gpio_signals { ++ RST_BRIDGE_N, /* TC358762 bridge reset */ ++ RST_TP_N, /* Touch controller reset */ ++ NUM_GPIO ++}; ++ ++struct gpio_signal_mappings { ++ unsigned int reg; ++ unsigned int mask; ++}; ++ ++static const struct gpio_signal_mappings mappings[NUM_GPIO] = { ++ [RST_BRIDGE_N] = { REG_PORTC, PC_RST_BRIDGE_N | PC_RST_LCD_N }, ++ [RST_TP_N] = { REG_PORTC, PC_RST_TP_N }, ++}; ++ + struct attiny_lcd { + /* lock to serialise overall accesses to the Atmel */ + struct mutex lock; + struct regmap *regmap; ++ bool gpio_states[NUM_GPIO]; ++ u8 port_states[3]; ++ ++ struct gpio_chip gc; + }; + + static const struct regmap_config attiny_regmap_config = { +@@ -58,6 +79,17 @@ static const struct regmap_config attiny_regmap_config = { + .cache_type = REGCACHE_NONE, + }; + ++static int attiny_set_port_state(struct attiny_lcd *state, int reg, u8 val) ++{ ++ state->port_states[reg - REG_PORTA] = val; ++ return regmap_write(state->regmap, reg, val); ++}; ++ ++static u8 attiny_get_port_state(struct attiny_lcd *state, int reg) ++{ ++ return state->port_states[reg - REG_PORTA]; ++}; ++ + static int attiny_lcd_power_enable(struct regulator_dev *rdev) + { + struct attiny_lcd *state = rdev_get_drvdata(rdev); +@@ -65,7 +97,7 @@ static int attiny_lcd_power_enable(struct regulator_dev *rdev) + mutex_lock(&state->lock); + + /* Ensure bridge, and tp stay in reset */ +- regmap_write(rdev->regmap, REG_PORTC, 0); ++ attiny_set_port_state(state, REG_PORTC, 0); + usleep_range(5000, 10000); + + /* Default to the same orientation as the closed source +@@ -73,26 +105,16 @@ static int attiny_lcd_power_enable(struct regulator_dev *rdev) + * configuration will be supported using VC4's plane + * orientation bits. + */ +- regmap_write(rdev->regmap, REG_PORTA, PA_LCD_LR); ++ attiny_set_port_state(state, REG_PORTA, PA_LCD_LR); + usleep_range(5000, 10000); +- regmap_write(rdev->regmap, REG_PORTB, PB_LCD_MAIN); ++ /* Main regulator on, and power to the panel (LCD_VCC_N) */ ++ attiny_set_port_state(state, REG_PORTB, PB_LCD_MAIN); + usleep_range(5000, 10000); + /* Bring controllers out of reset */ +- regmap_write(rdev->regmap, REG_PORTC, +- PC_LED_EN | PC_RST_BRIDGE_N | PC_RST_LCD_N | PC_RST_TP_N); ++ attiny_set_port_state(state, REG_PORTC, PC_LED_EN); + + msleep(80); + +- regmap_write(rdev->regmap, REG_ADDR_H, 0x04); +- usleep_range(5000, 8000); +- regmap_write(rdev->regmap, REG_ADDR_L, 0x7c); +- usleep_range(5000, 8000); +- regmap_write(rdev->regmap, REG_WRITE_DATA_H, 0x00); +- usleep_range(5000, 8000); +- regmap_write(rdev->regmap, REG_WRITE_DATA_L, 0x00); +- +- msleep(100); +- + mutex_unlock(&state->lock); + + return 0; +@@ -106,11 +128,12 @@ static int attiny_lcd_power_disable(struct regulator_dev *rdev) + + regmap_write(rdev->regmap, REG_PWM, 0); + usleep_range(5000, 10000); +- regmap_write(rdev->regmap, REG_PORTA, 0); ++ ++ attiny_set_port_state(state, REG_PORTA, 0); + usleep_range(5000, 10000); +- regmap_write(rdev->regmap, REG_PORTB, PB_LCD_VCC_N); ++ attiny_set_port_state(state, REG_PORTB, PB_LCD_VCC_N); + usleep_range(5000, 10000); +- regmap_write(rdev->regmap, REG_PORTC, 0); ++ attiny_set_port_state(state, REG_PORTC, 0); + msleep(30); + + mutex_unlock(&state->lock); +@@ -211,6 +234,45 @@ static const struct backlight_ops attiny_bl = { + .get_brightness = attiny_get_brightness, + }; + ++static int attiny_gpio_get_direction(struct gpio_chip *gc, unsigned int off) ++{ ++ return GPIO_LINE_DIRECTION_OUT; ++} ++ ++static void attiny_gpio_set(struct gpio_chip *gc, unsigned int off, int val) ++{ ++ struct attiny_lcd *state = gpiochip_get_data(gc); ++ u8 last_val; ++ ++ if (off >= NUM_GPIO) ++ return; ++ ++ mutex_lock(&state->lock); ++ ++ last_val = attiny_get_port_state(state, mappings[off].reg); ++ if (val) ++ last_val |= mappings[off].mask; ++ else ++ last_val &= ~mappings[off].mask; ++ ++ attiny_set_port_state(state, mappings[off].reg, last_val); ++ ++ if (off == RST_BRIDGE_N && val) { ++ usleep_range(5000, 8000); ++ regmap_write(state->regmap, REG_ADDR_H, 0x04); ++ usleep_range(5000, 8000); ++ regmap_write(state->regmap, REG_ADDR_L, 0x7c); ++ usleep_range(5000, 8000); ++ regmap_write(state->regmap, REG_WRITE_DATA_H, 0x00); ++ usleep_range(5000, 8000); ++ regmap_write(state->regmap, REG_WRITE_DATA_L, 0x00); ++ ++ msleep(100); ++ } ++ ++ mutex_unlock(&state->lock); ++} ++ + /* + * I2C driver interface functions + */ +@@ -289,6 +351,23 @@ static int attiny_i2c_probe(struct i2c_client *i2c, + + bl->props.brightness = 0xff; + ++ state->gc.parent = &i2c->dev; ++ state->gc.label = i2c->name; ++ state->gc.owner = THIS_MODULE; ++ state->gc.of_node = i2c->dev.of_node; ++ state->gc.base = -1; ++ state->gc.ngpio = NUM_GPIO; ++ ++ state->gc.set = attiny_gpio_set; ++ state->gc.get_direction = attiny_gpio_get_direction; ++ state->gc.can_sleep = true; ++ ++ ret = devm_gpiochip_add_data(&i2c->dev, &state->gc, state); ++ if (ret) { ++ dev_err(&i2c->dev, "Failed to create gpiochip: %d\n", ret); ++ goto error; ++ } ++ + return 0; + + error: +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 26 Mar 2021 17:36:12 +0000 +Subject: [PATCH 812/889] defconfig: Add DRM_TOSHIBA_TC358762 and + REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY + +Add the two newer drivers for the Pi 7" touchscreen to the defconfigs + +Signed-off-by: Dave Stevenson +--- + arch/arm/configs/bcm2709_defconfig | 2 ++ + arch/arm/configs/bcm2711_defconfig | 2 ++ + arch/arm/configs/bcmrpi_defconfig | 2 ++ + arch/arm64/configs/bcm2711_defconfig | 2 ++ + arch/arm64/configs/bcmrpi3_defconfig | 3 +++ + 5 files changed, 11 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 08846cc44951..575aa02d9ddc 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -750,6 +750,7 @@ CONFIG_REGULATOR=y + CONFIG_REGULATOR_FIXED_VOLTAGE=m + CONFIG_REGULATOR_ARIZONA_LDO1=m + CONFIG_REGULATOR_ARIZONA_MICSUPP=m ++CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m + CONFIG_RC_CORE=y + CONFIG_LIRC=y + CONFIG_BPF_LIRC_MODE2=y +@@ -937,6 +938,7 @@ CONFIG_DRM_PANEL_JDI_LT070ME05000=m + CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m + CONFIG_DRM_DISPLAY_CONNECTOR=m + CONFIG_DRM_SIMPLE_BRIDGE=m ++CONFIG_DRM_TOSHIBA_TC358762=m + CONFIG_DRM_VC4=m + CONFIG_DRM_VC4_HDMI_CEC=y + CONFIG_TINYDRM_ILI9225=m +diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig +index 9466ada74228..fb8dffa14fc5 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -764,6 +764,7 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y + CONFIG_REGULATOR_ARIZONA_LDO1=m + CONFIG_REGULATOR_ARIZONA_MICSUPP=m + CONFIG_REGULATOR_GPIO=y ++CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m + CONFIG_RC_CORE=y + CONFIG_LIRC=y + CONFIG_BPF_LIRC_MODE2=y +@@ -951,6 +952,7 @@ CONFIG_DRM_PANEL_JDI_LT070ME05000=m + CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m + CONFIG_DRM_DISPLAY_CONNECTOR=m + CONFIG_DRM_SIMPLE_BRIDGE=m ++CONFIG_DRM_TOSHIBA_TC358762=m + CONFIG_DRM_V3D=m + CONFIG_DRM_VC4=m + CONFIG_DRM_VC4_HDMI_CEC=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index cd3492cc367e..ae6160b1e35e 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -743,6 +743,7 @@ CONFIG_REGULATOR=y + CONFIG_REGULATOR_FIXED_VOLTAGE=m + CONFIG_REGULATOR_ARIZONA_LDO1=m + CONFIG_REGULATOR_ARIZONA_MICSUPP=m ++CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m + CONFIG_RC_CORE=y + CONFIG_LIRC=y + CONFIG_BPF_LIRC_MODE2=y +@@ -930,6 +931,7 @@ CONFIG_DRM_PANEL_JDI_LT070ME05000=m + CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m + CONFIG_DRM_DISPLAY_CONNECTOR=m + CONFIG_DRM_SIMPLE_BRIDGE=m ++CONFIG_DRM_TOSHIBA_TC358762=m + CONFIG_DRM_VC4=m + CONFIG_DRM_VC4_HDMI_CEC=y + CONFIG_TINYDRM_ILI9225=m +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index 72a51ad19bf5..9462f85dbfdf 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -760,6 +760,7 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y + CONFIG_REGULATOR_ARIZONA_LDO1=m + CONFIG_REGULATOR_ARIZONA_MICSUPP=m + CONFIG_REGULATOR_GPIO=y ++CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m + CONFIG_RC_CORE=y + CONFIG_LIRC=y + CONFIG_BPF_LIRC_MODE2=y +@@ -952,6 +953,7 @@ CONFIG_DRM_PANEL_JDI_LT070ME05000=m + CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m + CONFIG_DRM_DISPLAY_CONNECTOR=m + CONFIG_DRM_SIMPLE_BRIDGE=m ++CONFIG_DRM_TOSHIBA_TC358762=m + CONFIG_DRM_V3D=m + CONFIG_DRM_VC4=m + CONFIG_DRM_VC4_HDMI_CEC=y +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index 0cecfa4b3986..59fabad5ba02 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -717,6 +717,8 @@ CONFIG_STMPE_SPI=y + CONFIG_MFD_ARIZONA_I2C=m + CONFIG_MFD_ARIZONA_SPI=m + CONFIG_MFD_WM5102=y ++CONFIG_REGULATOR=y ++CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY=m + CONFIG_RC_CORE=y + CONFIG_LIRC=y + CONFIG_BPF_LIRC_MODE2=y +@@ -874,6 +876,7 @@ CONFIG_DRM_PANEL_JDI_LT070ME05000=m + CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m + CONFIG_DRM_DISPLAY_CONNECTOR=m + CONFIG_DRM_SIMPLE_BRIDGE=m ++CONFIG_DRM_TOSHIBA_TC358762=m + CONFIG_DRM_VC4=m + CONFIG_DRM_VC4_HDMI_CEC=y + CONFIG_DRM_GUD=m +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 26 Mar 2021 17:14:44 +0000 +Subject: [PATCH 813/889] dtoverlays: Update 7inch DSI display overlay to use + newer drivers + +The older panel-raspberrypi-touchscreen driver had issues in +that it also controlled the power for the touchscreen without +having an appropriate hook for the touchscreen driver to control +that. + +Mainline has now added a Toshiba TC358762 bridge driver, and +a regulator/backlight driver for the ATTiny microcontroller on +the board. That allows clean integration with the touchscreen +driver. + +Switch the overlays over to using newer drivers. + +Signed-off-by: Dave Stevenson +--- + arch/arm/boot/dts/overlays/README | 11 ++- + .../boot/dts/overlays/edt-ft5406-overlay.dts | 38 +------- + arch/arm/boot/dts/overlays/edt-ft5406.dtsi | 55 ++++++++++++ + .../overlays/vc4-kms-dsi-7inch-overlay.dts | 88 ++++++++++++++++--- + 4 files changed, 141 insertions(+), 51 deletions(-) + create mode 100644 arch/arm/boot/dts/overlays/edt-ft5406.dtsi + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 890e926636b7..eb2c9adfb1a8 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -3365,10 +3365,15 @@ Params: + + Name: vc4-kms-dsi-7inch + Info: Enable the Raspberry Pi DSI 7" screen. +- Use edt-ft5406 for the touchscreen element. ++ Includes the edt-ft5406 for the touchscreen element. + Requires vc4-kms-v3d to be loaded. +-Load: dtoverlay=vc4-kms-dsi-7inch +-Params: ++Load: dtoverlay=vc4-kms-dsi-7inch,= ++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 ++ disable_touch Disables the touch screen overlay driver + + + Name: vc4-kms-dsi-lt070me05000 +diff --git a/arch/arm/boot/dts/overlays/edt-ft5406-overlay.dts b/arch/arm/boot/dts/overlays/edt-ft5406-overlay.dts +index 407af59bf468..f82b4d0e5047 100644 +--- a/arch/arm/boot/dts/overlays/edt-ft5406-overlay.dts ++++ b/arch/arm/boot/dts/overlays/edt-ft5406-overlay.dts +@@ -1,42 +1,10 @@ + /* +- * Device Tree overlay for RaspberryPi 7" Touchscreen panel ++ * Device Tree overlay for EDT 5406 touchscreen controller, as used on the ++ * Raspberry Pi 7" 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?"; +- }; +-}; ++#include "edt-ft5406.dtsi" +diff --git a/arch/arm/boot/dts/overlays/edt-ft5406.dtsi b/arch/arm/boot/dts/overlays/edt-ft5406.dtsi +new file mode 100644 +index 000000000000..0473ff17f19f +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/edt-ft5406.dtsi +@@ -0,0 +1,55 @@ ++/* ++ * Device Tree overlay for an EDT FT5406 touchscreen ++ * ++ * Note that this is included from vc4-kms-dsi-7inch, hence the ++ * fragment numbers not starting at 0. ++ */ ++ ++/ { ++ compatible = "brcm,bcm2835"; ++ ++ fragment@10 { ++ target = <&ft5406>; ++ __overlay__ { ++ touchscreen-inverted-x; ++ }; ++ }; ++ ++ fragment@11 { ++ target = <&ft5406>; ++ __overlay__ { ++ touchscreen-inverted-y; ++ }; ++ }; ++ ++ fragment@12 { ++ 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@13 { ++ target = <&i2c0if>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ __overrides__ { ++ sizex = <&ft5406>,"touchscreen-size-x:0"; ++ sizey = <&ft5406>,"touchscreen-size-y:0"; ++ invx = <0>, "-10"; ++ invy = <0>, "-11"; ++ swapxy = <&ft5406>,"touchscreen-swapped-x-y?"; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/vc4-kms-dsi-7inch-overlay.dts b/arch/arm/boot/dts/overlays/vc4-kms-dsi-7inch-overlay.dts +index 086f4ffd633a..ecd3bef3d65a 100644 +--- a/arch/arm/boot/dts/overlays/vc4-kms-dsi-7inch-overlay.dts ++++ b/arch/arm/boot/dts/overlays/vc4-kms-dsi-7inch-overlay.dts +@@ -6,51 +6,113 @@ + /dts-v1/; + /plugin/; + ++#include "edt-ft5406.dtsi" ++ + / { +- compatible = "brcm,bcm2835"; ++ /* No compatible as it will have come from edt-ft5406.dtsi */ + + fragment@0 { + target = <&dsi1>; + __overlay__ { +- #address-cells = <1>; size-cells = <0>; ++ #address-cells = <1>; ++ #size-cells = <0>; + status = "okay"; + port { +- dsi_out_port: endpoint { +- remote-endpoint = <&panel_dsi_port>; ++ dsi_out: endpoint { ++ remote-endpoint = <&bridge_in>; ++ }; ++ }; ++ bridge@0 { ++ reg = <0>; ++ compatible = "toshiba,tc358762"; ++ vddc-supply = <®_bridge>; ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ bridge_in: endpoint { ++ remote-endpoint = <&dsi_out>; ++ }; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ bridge_out: endpoint { ++ remote-endpoint = <&panel_in>; ++ }; ++ }; + }; + }; + }; + }; + + fragment@1 { ++ target-path = "/"; ++ __overlay__ { ++ panel_disp1: panel_disp1@0 { ++ reg = <0>; ++ compatible = "raspberrypi,7inch-dsi", "simple-panel"; ++ backlight = <®_display>; ++ power-supply = <®_display>; ++ ++ port { ++ panel_in: endpoint { ++ remote-endpoint = <&bridge_out>; ++ }; ++ }; ++ }; ++ ++ reg_bridge: reg_bridge@0 { ++ reg = <0>; ++ compatible = "regulator-fixed"; ++ regulator-name = "bridge_reg"; ++ gpio = <®_display 0 0>; ++ vin-supply = <®_display>; ++ enable-active-high; ++ }; ++ }; ++ }; ++ ++ fragment@2 { + target = <&i2c_csi_dsi>; + __overlay__ { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; +- lcd@45 { +- compatible = "raspberrypi,7inch-touchscreen-panel"; ++ ++ reg_display: reg_display@45 { ++ compatible = "raspberrypi,7inch-touchscreen-panel-regulator"; + reg = <0x45>; +- port { +- panel_dsi_port: endpoint { +- remote-endpoint = <&dsi_out_port>; +- }; +- }; ++ gpio-controller; ++ #gpio-cells = <2>; + }; + }; + }; + +- fragment@2 { ++ fragment@3 { + target = <&i2c0if>; + __overlay__ { + status = "okay"; + }; + }; + +- fragment@3 { ++ fragment@4 { + target = <&i2c0mux>; + __overlay__ { + status = "okay"; + }; + }; ++ fragment@5 { ++ target = <&ft5406>; ++ __overlay__ { ++ vcc-supply = <®_display>; ++ reset-gpio = <®_display 1 1>; ++ }; ++ }; ++ ++ __overrides__ { ++ disable_touch = <0>, "-10-11-12-13"; ++ }; + }; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 14 Sep 2021 15:21:23 +0200 +Subject: [PATCH 814/889] drm/vc4: hdmi: Remove redundant HSM clk + enable/disable in detect + +Our detect function calls pm_runtime_resume_and_get() and +pm_runtime_put() to make sure the device is properly powered before +trying to access the controller. + +However, it also makes sure the HSM clock is properly enabled (and +disabled), which is redundant with what runtime_pm is doing already. +Let's just remove it. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 463407154e6b..8995c1830776 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -182,7 +182,6 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + bool connected = false; + + WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); +- WARN_ON(clk_prepare_enable(vc4_hdmi->hsm_clock)); + + if (vc4_hdmi->hpd_gpio) { + if (gpio_get_value_cansleep(vc4_hdmi->hpd_gpio) ^ +@@ -212,7 +211,6 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + cec_phys_addr_invalidate(vc4_hdmi->cec_adap); + + out: +- clk_disable_unprepare(vc4_hdmi->hsm_clock); + pm_runtime_put(&vc4_hdmi->pdev->dev); + return ret; + } +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 14 Sep 2021 15:23:47 +0200 +Subject: [PATCH 815/889] drm/vc4: hdmi: Remove unnecessary pm_runtime_put + +Unlike pm_runtime_get_sync(), pm_runtime_resume_and_get() doesn't take a +reference on failure, so we don't need to call pm_runtime_put() on +failure. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 8995c1830776..6f25cff3f74c 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -926,7 +926,6 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, + ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); + if (ret < 0) { + DRM_ERROR("Failed to retain power domain: %d\n", ret); +- pm_runtime_put(&vc4_hdmi->pdev->dev); + return; + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 14 Sep 2021 15:25:33 +0200 +Subject: [PATCH 816/889] drm/vc4: hdmi: Simplify exit path of + vc4_hdmi_encoder_pre_crtc_configure + +The exit path of vc4_hdmi_encoder_pre_crtc_configure() is fairly hard to +maintain given its numerous error conditions. + +Switch to a goto based approach to simplify it. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 35 +++++++++++++++++----------------- + 1 file changed, 18 insertions(+), 17 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 6f25cff3f74c..2a068ba7c83f 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -933,24 +933,20 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, + ret = clk_set_rate(vc4_hdmi->pixel_clock, pixel_rate); + if (ret) { + DRM_ERROR("Failed to set pixel clock rate: %d\n", ret); +- pm_runtime_put(&vc4_hdmi->pdev->dev); +- return; ++ goto err_runtime_pm; + } + + ret = clk_prepare_enable(vc4_hdmi->pixel_clock); + if (ret) { + DRM_ERROR("Failed to turn on pixel clock: %d\n", ret); +- pm_runtime_put(&vc4_hdmi->pdev->dev); +- return; ++ goto err_runtime_pm; + } + + hsm_rate = vc4_hdmi->variant->calc_hsm_clock(vc4_hdmi, pixel_rate); + vc4_hdmi->hsm_req = clk_request_start(vc4_hdmi->hsm_clock, hsm_rate); + if (IS_ERR(vc4_hdmi->hsm_req)) { + DRM_ERROR("Failed to set HSM clock rate: %ld\n", PTR_ERR(vc4_hdmi->hsm_req)); +- clk_disable_unprepare(vc4_hdmi->pixel_clock); +- pm_runtime_put(&vc4_hdmi->pdev->dev); +- return; ++ goto err_disable_pixel_clk; + } + + vc4_hdmi_cec_update_clk_div(vc4_hdmi); +@@ -966,21 +962,13 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, + vc4_hdmi->bvb_req = clk_request_start(vc4_hdmi->pixel_bvb_clock, bvb_rate); + if (IS_ERR(vc4_hdmi->bvb_req)) { + DRM_ERROR("Failed to set pixel bvb clock rate: %ld\n", PTR_ERR(vc4_hdmi->bvb_req)); +- clk_request_done(vc4_hdmi->hsm_req); +- clk_disable_unprepare(vc4_hdmi->pixel_clock); +- pm_runtime_put(&vc4_hdmi->pdev->dev); +- return; ++ goto err_remove_hsm_req; + } + + ret = clk_prepare_enable(vc4_hdmi->pixel_bvb_clock); + if (ret) { + DRM_ERROR("Failed to turn on pixel bvb clock: %d\n", ret); +- if (vc4_hdmi->bvb_req) +- clk_request_done(vc4_hdmi->bvb_req); +- clk_request_done(vc4_hdmi->hsm_req); +- clk_disable_unprepare(vc4_hdmi->pixel_clock); +- pm_runtime_put(&vc4_hdmi->pdev->dev); +- return; ++ goto err_remove_bvb_req; + } + + if (vc4_hdmi->variant->phy_init) +@@ -993,6 +981,19 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, + + if (vc4_hdmi->variant->set_timings) + vc4_hdmi->variant->set_timings(vc4_hdmi, conn_state, mode); ++ ++ return; ++ ++err_remove_bvb_req: ++ if (vc4_hdmi->bvb_req) ++ clk_request_done(vc4_hdmi->bvb_req); ++err_remove_hsm_req: ++ clk_request_done(vc4_hdmi->hsm_req); ++err_disable_pixel_clk: ++ clk_disable_unprepare(vc4_hdmi->pixel_clock); ++err_runtime_pm: ++ pm_runtime_put(&vc4_hdmi->pdev->dev); ++ return; + } + + static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 13 May 2021 11:56:21 +0100 +Subject: [PATCH 817/889] staging/bcm2835-codec: Change the default codec res + to 32x32 + +In order to effectively guarantee that a V4L2_EVENT_SOURCE_CHANGE +event occurs, adopt a default resolution of 32x32 so that it +is incredibly unlikely to be decoding a stream of that resolution +and therefore failing to note a "change" requiring the event. + +Signed-off-by: Dave Stevenson +--- + .../bcm2835-codec/bcm2835-v4l2-codec.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index c3ba5c25a2ab..4c01bc42fa31 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -97,8 +97,19 @@ static const char * const components[] = { + #define MAX_W 1920 + #define MAX_H 1920 + #define BPL_ALIGN 32 +-#define DEFAULT_WIDTH 640 +-#define DEFAULT_HEIGHT 480 ++/* ++ * The decoder spec supports the V4L2_EVENT_SOURCE_CHANGE event, but the docs ++ * seem to want it to always be generated on startup, which prevents the client ++ * from configuring the CAPTURE queue based on any parsing it has already done ++ * which may save time and allow allocation of CAPTURE buffers early. Surely ++ * SOURCE_CHANGE means something has changed, not just "always notify". ++ * ++ * For those clients that don't set the CAPTURE resolution, adopt a default ++ * resolution that is seriously unlikely to be correct, therefore almost ++ * guaranteed to get the SOURCE_CHANGE event. ++ */ ++#define DEFAULT_WIDTH 32 ++#define DEFAULT_HEIGHT 32 + /* + * The unanswered question - what is the maximum size of a compressed frame? + * V4L2 mandates that the encoded frame must fit in a single buffer. Sizing +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Sun, 10 Jan 2021 19:05:17 +0000 +Subject: [PATCH 818/889] staging/vchiq-mmal: Add buffer flags for interlaced + video + +Add the buffer flags that the firmware uses to identify fields +on interlaced video + +Signed-off-by: Dave Stevenson +--- + .../vc04_services/vchiq-mmal/mmal-msg.h | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-msg.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-msg.h +index ab63835ce01c..883b77ffae25 100644 +--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-msg.h ++++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-msg.h +@@ -253,6 +253,25 @@ struct mmal_msg_port_action_reply { + /* Signals that a buffer failed to be transmitted */ + #define MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED BIT(10) + ++/* Video buffer header flags ++ * videobufferheaderflags ++ * The following flags describe properties of a video buffer header. ++ * As there is no collision with the MMAL_BUFFER_HEADER_FLAGS_ defines, these ++ * flags will also be present in the MMAL_BUFFER_HEADER_T flags field. ++ */ ++#define MMAL_BUFFER_HEADER_FLAG_FORMAT_SPECIFIC_START_BIT 16 ++#define MMAL_BUFFER_HEADER_FLAG_FORMAT_SPECIFIC_START \ ++ (1 << MMAL_BUFFER_HEADER_FLAG_FORMAT_SPECIFIC_START_BIT) ++/* Signals an interlaced video frame */ ++#define MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED \ ++ (MMAL_BUFFER_HEADER_FLAG_FORMAT_SPECIFIC_START << 0) ++/* ++ * Signals that the top field of the current interlaced frame should be ++ * displayed first ++ */ ++#define MMAL_BUFFER_HEADER_VIDEO_FLAG_TOP_FIELD_FIRST \ ++ (MMAL_BUFFER_HEADER_FLAG_FORMAT_SPECIFIC_START << 1) ++ + struct mmal_driver_buffer { + u32 magic; + u32 component_handle; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 5 Aug 2021 16:38:34 +0100 +Subject: [PATCH 819/889] staging/vchiq-mmal: Add parameters for interlaced + video support + +Adds enum mmal_interlace_type and struct +mmal_parameter_video_interlace_type to allow for querying the +interlacing mode on decoders. + +Signed-off-by: Dave Stevenson +--- + .../vchiq-mmal/mmal-parameters.h | 37 +++++++++++++++++++ + 1 file changed, 37 insertions(+) + +diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h +index 79438d23912f..844a02bf9a22 100644 +--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h ++++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h +@@ -809,6 +809,43 @@ struct mmal_parameter_displayregion { + u32 alpha; + }; + ++enum mmal_interlace_type { ++ /* The data is not interlaced, it is progressive scan */ ++ MMAL_INTERLACE_PROGRESSIVE, ++ /* ++ * The data is interlaced, fields sent separately in temporal order, with ++ * upper field first ++ */ ++ MMAL_INTERLACE_FIELD_SINGLE_UPPER_FIRST, ++ /* ++ * The data is interlaced, fields sent separately in temporal order, with ++ * lower field first ++ */ ++ MMAL_INTERLACE_FIELD_SINGLE_LOWER_FIRST, ++ /* ++ * The data is interlaced, two fields sent together line interleaved, ++ * with the upper field temporally earlier ++ */ ++ MMAL_INTERLACE_FIELDS_INTERLEAVED_UPPER_FIRST, ++ /* ++ * The data is interlaced, two fields sent together line interleaved, ++ * with the lower field temporally earlier ++ */ ++ MMAL_INTERLACE_FIELDS_INTERLEAVED_LOWER_FIRST, ++ /* ++ * The stream may contain a mixture of progressive and interlaced ++ * frames ++ */ ++ MMAL_INTERLACE_MIXED, ++ ++ MMAL_INTERLACE_DUMMY = 0x7FFFFFFF ++}; ++ ++struct mmal_parameter_video_interlace_type { ++ enum mmal_interlace_type mode; /* The interlace type of the content */ ++ u32 bRepeatFirstField; /* Whether to repeat the first field */ ++}; ++ + #define MMAL_MAX_IMAGEFX_PARAMETERS 5 + + struct mmal_parameter_imagefx_parameters { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 18 Dec 2020 19:56:31 +0000 +Subject: [PATCH 820/889] staging/bcm2835-codec: Add support for decoding + interlaced streams + +The video decoder can support decoding interlaced streams, so add +the required plumbing to signal this correctly. + +The encoder and ISP do NOT support interlaced data, so trying to +configure an interlaced format on those nodes will be rejected. + +Signed-off-by: Dave Stevenson +--- + .../bcm2835-codec/bcm2835-v4l2-codec.c | 84 +++++++++++++++++-- + 1 file changed, 77 insertions(+), 7 deletions(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 4c01bc42fa31..3f15c20bb952 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -619,6 +619,7 @@ struct bcm2835_codec_q_data { + unsigned int crop_height; + bool selection_set; + struct v4l2_fract aspect_ratio; ++ enum v4l2_field field; + + unsigned int sizeimage; + unsigned int sequence; +@@ -986,6 +987,10 @@ static void handle_fmt_changed(struct bcm2835_codec_ctx *ctx, + struct bcm2835_codec_q_data *q_data; + struct mmal_msg_event_format_changed *format = + (struct mmal_msg_event_format_changed *)mmal_buf->buffer; ++ struct mmal_parameter_video_interlace_type interlace; ++ int interlace_size = sizeof(interlace); ++ int ret; ++ + v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: Format changed: buff size min %u, rec %u, buff num min %u, rec %u\n", + __func__, + format->buffer_size_min, +@@ -1029,6 +1034,30 @@ static void handle_fmt_changed(struct bcm2835_codec_ctx *ctx, + q_data->aspect_ratio.numerator = format->es.video.par.num; + q_data->aspect_ratio.denominator = format->es.video.par.den; + ++ ret = vchiq_mmal_port_parameter_get(ctx->dev->instance, ++ &ctx->component->output[0], ++ MMAL_PARAMETER_VIDEO_INTERLACE_TYPE, ++ &interlace, ++ &interlace_size); ++ if (!ret) { ++ switch (interlace.mode) { ++ case MMAL_INTERLACE_PROGRESSIVE: ++ default: ++ q_data->field = V4L2_FIELD_NONE; ++ break; ++ case MMAL_INTERLACE_FIELDS_INTERLEAVED_UPPER_FIRST: ++ q_data->field = V4L2_FIELD_INTERLACED_TB; ++ break; ++ case MMAL_INTERLACE_FIELDS_INTERLEAVED_LOWER_FIRST: ++ q_data->field = V4L2_FIELD_INTERLACED_BT; ++ break; ++ } ++ v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: interlace mode %u, v4l2 field %u\n", ++ __func__, interlace.mode, q_data->field); ++ } else { ++ q_data->field = V4L2_FIELD_NONE; ++ } ++ + queue_res_chg_event(ctx); + } + +@@ -1101,6 +1130,22 @@ static void op_buffer_cb(struct vchiq_mmal_instance *instance, + vb2->vb2_buf.timestamp = mmal_buf->pts * 1000; + + vb2_set_plane_payload(&vb2->vb2_buf, 0, mmal_buf->length); ++ switch (mmal_buf->mmal_flags & ++ (MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED | ++ MMAL_BUFFER_HEADER_VIDEO_FLAG_TOP_FIELD_FIRST)) { ++ case 0: ++ case MMAL_BUFFER_HEADER_VIDEO_FLAG_TOP_FIELD_FIRST: /* Bogus */ ++ vb2->field = V4L2_FIELD_NONE; ++ break; ++ case MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED: ++ vb2->field = V4L2_FIELD_INTERLACED_BT; ++ break; ++ case (MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED | ++ MMAL_BUFFER_HEADER_VIDEO_FLAG_TOP_FIELD_FIRST): ++ vb2->field = V4L2_FIELD_INTERLACED_TB; ++ break; ++ } ++ + if (mmal_buf->mmal_flags & MMAL_BUFFER_HEADER_FLAG_KEYFRAME) + vb2->flags |= V4L2_BUF_FLAG_KEYFRAME; + +@@ -1272,7 +1317,7 @@ static int vidioc_g_fmt(struct bcm2835_codec_ctx *ctx, struct v4l2_format *f) + f->fmt.pix_mp.width = q_data->crop_width; + f->fmt.pix_mp.height = q_data->height; + f->fmt.pix_mp.pixelformat = q_data->fmt->fourcc; +- f->fmt.pix_mp.field = V4L2_FIELD_NONE; ++ f->fmt.pix_mp.field = q_data->field; + f->fmt.pix_mp.colorspace = ctx->colorspace; + f->fmt.pix_mp.plane_fmt[0].sizeimage = q_data->sizeimage; + f->fmt.pix_mp.plane_fmt[0].bytesperline = q_data->bytesperline; +@@ -1347,7 +1392,33 @@ static int vidioc_try_fmt(struct bcm2835_codec_ctx *ctx, struct v4l2_format *f, + memset(f->fmt.pix_mp.plane_fmt[0].reserved, 0, + sizeof(f->fmt.pix_mp.plane_fmt[0].reserved)); + +- f->fmt.pix_mp.field = V4L2_FIELD_NONE; ++ if (ctx->dev->role == DECODE) { ++ switch (f->fmt.pix_mp.field) { ++ /* ++ * All of this is pretty much guesswork as we'll set the ++ * interlace format correctly come format changed, and signal ++ * it appropriately on each buffer. ++ */ ++ default: ++ case V4L2_FIELD_NONE: ++ case V4L2_FIELD_ANY: ++ f->fmt.pix_mp.field = V4L2_FIELD_NONE; ++ break; ++ case V4L2_FIELD_INTERLACED: ++ f->fmt.pix_mp.field = V4L2_FIELD_INTERLACED; ++ break; ++ case V4L2_FIELD_TOP: ++ case V4L2_FIELD_BOTTOM: ++ case V4L2_FIELD_INTERLACED_TB: ++ f->fmt.pix_mp.field = V4L2_FIELD_INTERLACED_TB; ++ break; ++ case V4L2_FIELD_INTERLACED_BT: ++ f->fmt.pix_mp.field = V4L2_FIELD_INTERLACED_BT; ++ break; ++ } ++ } else { ++ f->fmt.pix_mp.field = V4L2_FIELD_NONE; ++ } + + return 0; + } +@@ -1430,6 +1501,8 @@ static int vidioc_s_fmt(struct bcm2835_codec_ctx *ctx, struct v4l2_format *f, + ctx->ycbcr_enc = f->fmt.pix_mp.ycbcr_enc; + ctx->quant = f->fmt.pix_mp.quantization; + ++ q_data->field = f->fmt.pix_mp.field; ++ + /* All parameters should have been set correctly by try_fmt */ + q_data->bytesperline = f->fmt.pix_mp.plane_fmt[0].bytesperline; + q_data->sizeimage = f->fmt.pix_mp.plane_fmt[0].sizeimage; +@@ -2429,11 +2502,6 @@ static int bcm2835_codec_buf_prepare(struct vb2_buffer *vb) + if (V4L2_TYPE_IS_OUTPUT(vb->vb2_queue->type)) { + if (vbuf->field == V4L2_FIELD_ANY) + vbuf->field = V4L2_FIELD_NONE; +- if (vbuf->field != V4L2_FIELD_NONE) { +- v4l2_err(&ctx->dev->v4l2_dev, "%s field isn't supported\n", +- __func__); +- return -EINVAL; +- } + } + + if (vb2_plane_size(vb, 0) < q_data->sizeimage) { +@@ -2735,6 +2803,7 @@ static int bcm2835_codec_open(struct file *file) + ctx->q_data[V4L2_M2M_SRC].crop_width, + ctx->q_data[V4L2_M2M_SRC].height, + ctx->q_data[V4L2_M2M_SRC].fmt); ++ ctx->q_data[V4L2_M2M_SRC].field = V4L2_FIELD_NONE; + + ctx->q_data[V4L2_M2M_DST].crop_width = DEFAULT_WIDTH; + ctx->q_data[V4L2_M2M_DST].crop_height = DEFAULT_HEIGHT; +@@ -2749,6 +2818,7 @@ static int bcm2835_codec_open(struct file *file) + ctx->q_data[V4L2_M2M_DST].fmt); + ctx->q_data[V4L2_M2M_DST].aspect_ratio.numerator = 1; + ctx->q_data[V4L2_M2M_DST].aspect_ratio.denominator = 1; ++ ctx->q_data[V4L2_M2M_DST].field = V4L2_FIELD_NONE; + + ctx->colorspace = V4L2_COLORSPACE_REC709; + ctx->bitrate = 10 * 1000 * 1000; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 5 Aug 2021 15:11:23 +0100 +Subject: [PATCH 821/889] staging/bcm2835-codec: Correct ENUM_FRAMESIZES + stepsize to 2 + +Being YUV420 formats, the step size is always 2 to avoid part +chroma subsampling. + +Signed-off-by: Dave Stevenson +--- + .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 3f15c20bb952..96de610e8354 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -2222,10 +2222,10 @@ static int vidioc_enum_framesizes(struct file *file, void *fh, + + fsize->stepwise.min_width = MIN_W; + fsize->stepwise.max_width = MAX_W; +- fsize->stepwise.step_width = 1; ++ fsize->stepwise.step_width = 2; + fsize->stepwise.min_height = MIN_H; + fsize->stepwise.max_height = MAX_H; +- fsize->stepwise.step_height = 1; ++ fsize->stepwise.step_height = 2; + + return 0; + } +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 5 Aug 2021 16:46:42 +0100 +Subject: [PATCH 822/889] staging/bcm2835-codec: Return buffers to QUEUED not + ERROR state + +Should start_streaming fail, or buffers be queued during +stop_streaming, they should be returned to the core as QUEUED +and not (as currently) as ERROR. + +Signed-off-by: Dave Stevenson +--- + .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 96de610e8354..d2b64a369ae8 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -1111,7 +1111,7 @@ static void op_buffer_cb(struct vchiq_mmal_instance *instance, + v4l2_dbg(2, debug, &ctx->dev->v4l2_dev, "%s: Empty buffer - flags %04x", + __func__, mmal_buf->mmal_flags); + if (!(mmal_buf->mmal_flags & MMAL_BUFFER_HEADER_FLAG_EOS)) { +- vb2_buffer_done(&vb2->vb2_buf, VB2_BUF_STATE_ERROR); ++ vb2_buffer_done(&vb2->vb2_buf, VB2_BUF_STATE_QUEUED); + if (!port->enabled) + complete(&ctx->frame_cmplt); + return; +@@ -2683,7 +2683,7 @@ static void bcm2835_codec_stop_streaming(struct vb2_queue *q) + v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: return buffer %p\n", + __func__, vbuf); + +- v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR); ++ v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_QUEUED); + } + + /* Disable MMAL port - this will flush buffers back */ +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 6 Aug 2021 13:43:48 +0100 +Subject: [PATCH 823/889] staging/bcm2835_codec: Log MMAL flags in hex + +The flags is a bitmask, so it's far easier to interpret as hex +data instead of decimal. + +Signed-off-by: Dave Stevenson +--- + .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index d2b64a369ae8..202830aee5b6 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -1071,7 +1071,7 @@ static void op_buffer_cb(struct vchiq_mmal_instance *instance, + struct vb2_v4l2_buffer *vb2; + + v4l2_dbg(2, debug, &ctx->dev->v4l2_dev, +- "%s: status:%d, buf:%p, length:%lu, flags %u, pts %lld\n", ++ "%s: status:%d, buf:%p, length:%lu, flags %04x, pts %lld\n", + __func__, status, mmal_buf, mmal_buf->length, + mmal_buf->mmal_flags, mmal_buf->pts); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Sat, 11 Sep 2021 17:21:07 +0100 +Subject: [PATCH 824/889] staging: bcm2835-codec: Allow custom specified + strides/bytesperline. + +If the client provides a bytesperline value in try_fmt/s_fmt then +validate it and correct if necessary. + +Signed-off-by: Dave Stevenson +--- + .../vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 202830aee5b6..8e6a3ab629fc 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -1347,7 +1347,7 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv, + static int vidioc_try_fmt(struct bcm2835_codec_ctx *ctx, struct v4l2_format *f, + struct bcm2835_codec_fmt *fmt) + { +- unsigned int sizeimage; ++ unsigned int sizeimage, min_bytesperline; + + /* + * The V4L2 specification requires the driver to correct the format +@@ -1375,8 +1375,12 @@ static int vidioc_try_fmt(struct bcm2835_codec_ctx *ctx, struct v4l2_format *f, + f->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 16); + } + f->fmt.pix_mp.num_planes = 1; ++ min_bytesperline = get_bytesperline(f->fmt.pix_mp.width, fmt); ++ if (f->fmt.pix_mp.plane_fmt[0].bytesperline < min_bytesperline) ++ f->fmt.pix_mp.plane_fmt[0].bytesperline = min_bytesperline; + f->fmt.pix_mp.plane_fmt[0].bytesperline = +- get_bytesperline(f->fmt.pix_mp.width, fmt); ++ ALIGN(f->fmt.pix_mp.plane_fmt[0].bytesperline, fmt->bytesperline_align); ++ + sizeimage = get_sizeimage(f->fmt.pix_mp.plane_fmt[0].bytesperline, + f->fmt.pix_mp.width, f->fmt.pix_mp.height, + fmt); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 6 Aug 2021 15:44:21 +0100 +Subject: [PATCH 825/889] staging/vchiq-mmal: Add the deinterlace image effects + enums + +As we're wanting to wrap the image_fx component for deinterlacing, +add the deinterlace algorithm values to enum mmal_parameter_imagefx + +Signed-off-by: Dave Stevenson +--- + drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h +index 844a02bf9a22..622508dc6e27 100644 +--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h ++++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h +@@ -398,6 +398,9 @@ enum mmal_parameter_imagefx { + MMAL_PARAM_IMAGEFX_COLOURPOINT, + MMAL_PARAM_IMAGEFX_COLOURBALANCE, + MMAL_PARAM_IMAGEFX_CARTOON, ++ MMAL_PARAM_IMAGEFX_DEINTERLACE_DOUBLE, ++ MMAL_PARAM_IMAGEFX_DEINTERLACE_ADV, ++ MMAL_PARAM_IMAGEFX_DEINTERLACE_FAST, + }; + + enum MMAL_PARAM_FLICKERAVOID { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dom Cobley +Date: Fri, 6 Aug 2021 15:37:16 +0100 +Subject: [PATCH 826/889] staging/bcm2835_codec: Add support for image_fx to + deinterlace + +Adds another /dev/video node wrapping image_fx doing deinterlace. + +Co-developed-by: Dave Stevenson +Signed-off-by: Dom Cobley +--- + .../bcm2835-codec/bcm2835-v4l2-codec.c | 152 +++++++++++++++++- + 1 file changed, 150 insertions(+), 2 deletions(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 8e6a3ab629fc..38b59aa21069 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -58,6 +58,10 @@ static int isp_video_nr = 12; + module_param(isp_video_nr, int, 0644); + MODULE_PARM_DESC(isp_video_nr, "isp video device number"); + ++static int deinterlace_video_nr = 18; ++module_param(deinterlace_video_nr, int, 0644); ++MODULE_PARM_DESC(deinterlace_video_nr, "deinterlace video device number"); ++ + /* + * Workaround for GStreamer v4l2convert component not considering Bayer formats + * as raw, and therefore not considering a V4L2 device that supports them as +@@ -71,22 +75,33 @@ static unsigned int debug; + module_param(debug, uint, 0644); + MODULE_PARM_DESC(debug, "activates debug info (0-3)"); + ++static bool advanced_deinterlace = true; ++module_param(advanced_deinterlace, bool, 0644); ++MODULE_PARM_DESC(advanced_deinterlace, "Use advanced deinterlace"); ++ ++static int field_override; ++module_param(field_override, int, 0644); ++MODULE_PARM_DESC(field_override, "force TB(8)/BT(9) field"); ++ + enum bcm2835_codec_role { + DECODE, + ENCODE, + ISP, ++ DEINTERLACE, + }; + + static const char * const roles[] = { + "decode", + "encode", +- "isp" ++ "isp", ++ "image_fx", + }; + + static const char * const components[] = { + "ril.video_decode", + "ril.video_encode", + "ril.isp", ++ "ril.image_fx", + }; + + /* Timeout for stop_streaming to allow all buffers to return */ +@@ -683,6 +698,7 @@ struct bcm2835_codec_driver { + struct bcm2835_codec_dev *encode; + struct bcm2835_codec_dev *decode; + struct bcm2835_codec_dev *isp; ++ struct bcm2835_codec_dev *deinterlace; + }; + + enum { +@@ -1196,6 +1212,19 @@ static void vb2_to_mmal_buffer(struct m2m_mmal_buffer *buf, + do_div(pts, 1000); + buf->mmal.pts = pts; + buf->mmal.dts = MMAL_TIME_UNKNOWN; ++ ++ switch (field_override ? field_override : vb2->field) { ++ default: ++ case V4L2_FIELD_NONE: ++ break; ++ case V4L2_FIELD_INTERLACED_BT: ++ buf->mmal.mmal_flags |= MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED; ++ break; ++ case V4L2_FIELD_INTERLACED_TB: ++ buf->mmal.mmal_flags |= MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED | ++ MMAL_BUFFER_HEADER_VIDEO_FLAG_TOP_FIELD_FIRST; ++ break; ++ } + } + + /* device_run() - prepares and starts the device +@@ -1396,7 +1425,7 @@ static int vidioc_try_fmt(struct bcm2835_codec_ctx *ctx, struct v4l2_format *f, + memset(f->fmt.pix_mp.plane_fmt[0].reserved, 0, + sizeof(f->fmt.pix_mp.plane_fmt[0].reserved)); + +- if (ctx->dev->role == DECODE) { ++ if (ctx->dev->role == DECODE || ctx->dev->role == DEINTERLACE) { + switch (f->fmt.pix_mp.field) { + /* + * All of this is pretty much guesswork as we'll set the +@@ -1686,6 +1715,46 @@ static int vidioc_g_selection(struct file *file, void *priv, + break; + case ISP: + break; ++ case DEINTERLACE: ++ if (s->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { ++ switch (s->target) { ++ case V4L2_SEL_TGT_COMPOSE_DEFAULT: ++ case V4L2_SEL_TGT_COMPOSE: ++ s->r.left = 0; ++ s->r.top = 0; ++ s->r.width = q_data->crop_width; ++ s->r.height = q_data->crop_height; ++ break; ++ case V4L2_SEL_TGT_COMPOSE_BOUNDS: ++ s->r.left = 0; ++ s->r.top = 0; ++ s->r.width = q_data->crop_width; ++ s->r.height = q_data->crop_height; ++ break; ++ default: ++ return -EINVAL; ++ } ++ } else { ++ /* must be V4L2_BUF_TYPE_VIDEO_OUTPUT */ ++ switch (s->target) { ++ case V4L2_SEL_TGT_CROP_DEFAULT: ++ case V4L2_SEL_TGT_CROP_BOUNDS: ++ s->r.top = 0; ++ s->r.left = 0; ++ s->r.width = q_data->bytesperline; ++ s->r.height = q_data->height; ++ break; ++ case V4L2_SEL_TGT_CROP: ++ s->r.top = 0; ++ s->r.left = 0; ++ s->r.width = q_data->crop_width; ++ s->r.height = q_data->crop_height; ++ break; ++ default: ++ return -EINVAL; ++ } ++ } ++ break; + } + + return 0; +@@ -1761,6 +1830,41 @@ static int vidioc_s_selection(struct file *file, void *priv, + break; + case ISP: + break; ++ case DEINTERLACE: ++ if (s->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { ++ switch (s->target) { ++ case V4L2_SEL_TGT_COMPOSE: ++ /* Accept cropped image */ ++ s->r.left = 0; ++ s->r.top = 0; ++ s->r.width = min(s->r.width, q_data->crop_width); ++ s->r.height = min(s->r.height, q_data->height); ++ q_data->crop_width = s->r.width; ++ q_data->crop_height = s->r.height; ++ q_data->selection_set = true; ++ break; ++ default: ++ return -EINVAL; ++ } ++ break; ++ } else { ++ /* must be V4L2_BUF_TYPE_VIDEO_OUTPUT */ ++ switch (s->target) { ++ case V4L2_SEL_TGT_CROP: ++ /* Only support crop from (0,0) */ ++ s->r.top = 0; ++ s->r.left = 0; ++ s->r.width = min(s->r.width, q_data->crop_width); ++ s->r.height = min(s->r.height, q_data->height); ++ q_data->crop_width = s->r.width; ++ q_data->crop_height = s->r.height; ++ q_data->selection_set = true; ++ break; ++ default: ++ return -EINVAL; ++ } ++ break; ++ } + } + + return 0; +@@ -2335,6 +2439,30 @@ static int bcm2835_codec_create_component(struct bcm2835_codec_ctx *ctx) + MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS, + &enable, + sizeof(enable)); ++ } else if (dev->role == DEINTERLACE) { ++ /* Select the default deinterlace algorithm. */ ++ int half_framerate = 0; ++ int default_frame_interval = -1; /* don't interpolate */ ++ int frame_type = 5; /* 0=progressive, 3=TFF, 4=BFF, 5=see frame */ ++ int use_qpus = 0; ++ enum mmal_parameter_imagefx effect = ++ advanced_deinterlace && ctx->q_data[V4L2_M2M_SRC].crop_width <= 800 ? ++ MMAL_PARAM_IMAGEFX_DEINTERLACE_ADV : ++ MMAL_PARAM_IMAGEFX_DEINTERLACE_FAST; ++ struct mmal_parameter_imagefx_parameters params = { ++ .effect = effect, ++ .num_effect_params = 4, ++ .effect_parameter = { frame_type, ++ default_frame_interval, ++ half_framerate, ++ use_qpus }, ++ }; ++ ++ vchiq_mmal_port_parameter_set(dev->instance, ++ &ctx->component->output[0], ++ MMAL_PARAMETER_IMAGE_EFFECT_PARAMETERS, ++ ¶ms, ++ sizeof(params)); + } + + setup_mmal_port_format(ctx, &ctx->q_data[V4L2_M2M_SRC], +@@ -3173,6 +3301,16 @@ static int bcm2835_codec_create(struct bcm2835_codec_driver *drv, + function = MEDIA_ENT_F_PROC_VIDEO_SCALER; + video_nr = isp_video_nr; + break; ++ case DEINTERLACE: ++ v4l2_disable_ioctl(vfd, VIDIOC_ENCODER_CMD); ++ v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD); ++ v4l2_disable_ioctl(vfd, VIDIOC_DECODER_CMD); ++ v4l2_disable_ioctl(vfd, VIDIOC_TRY_DECODER_CMD); ++ v4l2_disable_ioctl(vfd, VIDIOC_S_PARM); ++ v4l2_disable_ioctl(vfd, VIDIOC_G_PARM); ++ function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER; ++ video_nr = deinterlace_video_nr; ++ break; + default: + ret = -EINVAL; + goto unreg_dev; +@@ -3268,6 +3406,10 @@ static int bcm2835_codec_probe(struct platform_device *pdev) + if (ret) + goto out; + ++ ret = bcm2835_codec_create(drv, &drv->deinterlace, DEINTERLACE); ++ if (ret) ++ goto out; ++ + /* Register the media device node */ + if (media_device_register(mdev) < 0) + goto out; +@@ -3277,6 +3419,10 @@ static int bcm2835_codec_probe(struct platform_device *pdev) + return 0; + + out: ++ if (drv->deinterlace) { ++ bcm2835_codec_destroy(drv->deinterlace); ++ drv->deinterlace = NULL; ++ } + if (drv->isp) { + bcm2835_codec_destroy(drv->isp); + drv->isp = NULL; +@@ -3298,6 +3444,8 @@ static int bcm2835_codec_remove(struct platform_device *pdev) + + media_device_unregister(&drv->mdev); + ++ bcm2835_codec_destroy(drv->deinterlace); ++ + bcm2835_codec_destroy(drv->isp); + + bcm2835_codec_destroy(drv->encode); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dom Cobley +Date: Tue, 14 Sep 2021 16:44:18 +0100 +Subject: [PATCH 827/889] staging/bcm2835-v4l2_codec: Fix for encode selection + API + +Matches correct behaviour from DECODE and DEINTERLACE + +Signed-off-by: Dom Cobley +--- + .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 38b59aa21069..8df0eb2b532a 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -1819,7 +1819,7 @@ static int vidioc_s_selection(struct file *file, void *priv, + s->r.top = 0; + s->r.left = 0; + s->r.width = min(s->r.width, q_data->crop_width); +- s->r.height = min(s->r.height, q_data->crop_height); ++ s->r.height = min(s->r.height, q_data->height); + q_data->crop_width = s->r.width; + q_data->crop_height = s->r.height; + q_data->selection_set = true; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jeff Geerling +Date: Thu, 16 Sep 2021 13:07:23 -0500 +Subject: [PATCH 828/889] drm/amdgpu: Add missing conversion of + is_hdr_metadata_different for amdgpu + +--- + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +index 12ef26670f61..b93961704bf3 100644 +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +@@ -7755,7 +7755,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) + dm_old_crtc_state->abm_level; + + hdr_changed = +- is_hdr_metadata_different(old_con_state, new_con_state); ++ !drm_connector_atomic_hdr_metadata_equal(old_con_state, new_con_state); + + if (!scaling_changed && !abm_changed && !hdr_changed) + continue; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 17 Sep 2021 15:18:51 +0100 +Subject: [PATCH 829/889] configs: Add CAN_PEAK_USB=m + +Add the driver for the PEAK Systems USB CAN interface. + +See: https://github.com/raspberrypi/linux/issues/4583 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcm2711_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + arch/arm64/configs/bcm2711_defconfig | 1 + + arch/arm64/configs/bcmrpi3_defconfig | 1 + + 5 files changed, 5 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 575aa02d9ddc..e9314965177d 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -419,6 +419,7 @@ CONFIG_CAN_MCP251X=m + CONFIG_CAN_MCP251XFD=m + CONFIG_CAN_EMS_USB=m + CONFIG_CAN_GS_USB=m ++CONFIG_CAN_PEAK_USB=m + CONFIG_BT=m + CONFIG_BT_RFCOMM=m + CONFIG_BT_RFCOMM_TTY=y +diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig +index fb8dffa14fc5..0863b1666af3 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -420,6 +420,7 @@ CONFIG_CAN_MCP251X=m + CONFIG_CAN_MCP251XFD=m + CONFIG_CAN_EMS_USB=m + CONFIG_CAN_GS_USB=m ++CONFIG_CAN_PEAK_USB=m + CONFIG_BT=m + CONFIG_BT_RFCOMM=m + CONFIG_BT_RFCOMM_TTY=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index ae6160b1e35e..b437a7274f6e 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -413,6 +413,7 @@ CONFIG_CAN_MCP251X=m + CONFIG_CAN_MCP251XFD=m + CONFIG_CAN_EMS_USB=m + CONFIG_CAN_GS_USB=m ++CONFIG_CAN_PEAK_USB=m + CONFIG_BT=m + CONFIG_BT_RFCOMM=m + CONFIG_BT_RFCOMM_TTY=y +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index 9462f85dbfdf..532935a02228 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -417,6 +417,7 @@ CONFIG_CAN_MCP251X=m + CONFIG_CAN_MCP251XFD=m + CONFIG_CAN_EMS_USB=m + CONFIG_CAN_GS_USB=m ++CONFIG_CAN_PEAK_USB=m + CONFIG_BT=m + CONFIG_BT_RFCOMM=m + CONFIG_BT_RFCOMM_TTY=y +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index 59fabad5ba02..241c6c3efca6 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -411,6 +411,7 @@ CONFIG_CAN_VCAN=m + CONFIG_CAN_MCP251X=m + CONFIG_CAN_MCP251XFD=m + CONFIG_CAN_EMS_USB=m ++CONFIG_CAN_PEAK_USB=m + CONFIG_BT=m + CONFIG_BT_RFCOMM=m + CONFIG_BT_RFCOMM_TTY=y +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 20 Sep 2021 11:18:41 +0100 +Subject: [PATCH 830/889] Revert "ARM: proc-v7: Force misalignment of early + stmia" + +This reverts commit fe4cc0ed5923d3b91d4cb25f8f6cbbf5a6f8c06f. + +The speculative patch that this commit reverts is proving to not be +effective any more, so revert it and try a new approach. + +Signed-off-by: Phil Elwell +--- + arch/arm/mm/proc-v7.S | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S +index 3e77e8982df3..28c9d32fa99a 100644 +--- a/arch/arm/mm/proc-v7.S ++++ b/arch/arm/mm/proc-v7.S +@@ -287,8 +287,6 @@ __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 +@@ -476,8 +474,6 @@ __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} +@@ -561,7 +557,7 @@ ENDPROC(__v7_setup) + .bss + .align 2 + __v7_setup_stack: +- .space 4 * 8 @ 7 registers + 1 spare ++ .space 4 * 7 @ 7 registers + + __INITDATA + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 20 Sep 2021 11:59:23 +0100 +Subject: [PATCH 831/889] ARM: proc-v7: Retry uncached stmia if necessary + +A failure of some CPU cores to come online has been traced to the +failure of a stm instruction while the cache is disabled. The symptom +is that the saved values read back as zeroes, a catastrophic error since +one of the values is a return address. + +This patch forces a readback and retry until the correct value is +returned, + +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 retrying is an +attempt to avoid the problem. + +The previous attempted fix (forcing the accesses to only be 4-byte +aligned) appears to have only worked for a while and likely for less +obvious reasons such as a change in code alignment. + +See: https://github.com/Hexxeh/rpi-firmware/issues/232 + +Signed-off-by: Phil Elwell +--- + arch/arm/mm/proc-v7.S | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S +index 28c9d32fa99a..950ceb970470 100644 +--- a/arch/arm/mm/proc-v7.S ++++ b/arch/arm/mm/proc-v7.S +@@ -288,7 +288,11 @@ __v7_ca17mp_setup: + 1: adr r0, __v7_setup_stack_ptr + ldr r12, [r0] + add r12, r12, r0 @ the local stack ++1: + stmia r12, {r1-r6, lr} @ v7_invalidate_l1 touches r0-r6 ++ ldr r0, [r12, #(6 * 4)] @ read back the return address ++ teq r0, lr @ confirm it is correct ++ bne 1b @ retrying if not + bl v7_invalidate_l1 + ldmia r12, {r1-r6, lr} + #ifdef CONFIG_SMP +@@ -474,7 +478,11 @@ __v7_setup: + adr r0, __v7_setup_stack_ptr + ldr r12, [r0] + add r12, r12, r0 @ the local stack ++1: + stmia r12, {r1-r6, lr} @ v7_invalidate_l1 touches r0-r6 ++ ldr r0, [r12, #(6 * 4)] @ read back the return address ++ teq r0, lr @ confirm it is correct ++ bne 1b @ retrying if not + bl v7_invalidate_l1 + ldmia r12, {r1-r6, lr} + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Wed, 1 Sep 2021 16:34:50 +0100 +Subject: [PATCH 832/889] media: rpivid: Avoid returning EINVAL to a G_FMT + ioctl + +V4L2 spec says that G/S/TRY_FMT IOCTLs should never return errors for +anything other than wrong buffer types. Improve the capture format +function such that this is so and unsupported values get converted +to supported ones properly. + +Signed-off-by: John Cox +--- + drivers/staging/media/rpivid/rpivid.c | 1 - + drivers/staging/media/rpivid/rpivid.h | 2 - + drivers/staging/media/rpivid/rpivid_video.c | 99 +++++++++++---------- + drivers/staging/media/rpivid/rpivid_video.h | 3 +- + 4 files changed, 54 insertions(+), 51 deletions(-) + +diff --git a/drivers/staging/media/rpivid/rpivid.c b/drivers/staging/media/rpivid/rpivid.c +index 9d93ed757ebc..848a1823ec7f 100644 +--- a/drivers/staging/media/rpivid/rpivid.c ++++ b/drivers/staging/media/rpivid/rpivid.c +@@ -239,7 +239,6 @@ static int rpivid_open(struct file *file) + /* The only bit of format info that we can guess now is H265 src + * Everything else we need more info for + */ +- ctx->src_fmt.pixelformat = RPIVID_SRC_PIXELFORMAT_DEFAULT; + rpivid_prepare_src_format(&ctx->src_fmt); + + v4l2_fh_add(&ctx->fh); +diff --git a/drivers/staging/media/rpivid/rpivid.h b/drivers/staging/media/rpivid/rpivid.h +index c4bc72d512ab..3d4ff825b21a 100644 +--- a/drivers/staging/media/rpivid/rpivid.h ++++ b/drivers/staging/media/rpivid/rpivid.h +@@ -35,8 +35,6 @@ + + #define RPIVID_QUIRK_NO_DMA_OFFSET BIT(0) + +-#define RPIVID_SRC_PIXELFORMAT_DEFAULT V4L2_PIX_FMT_HEVC_SLICE +- + enum rpivid_irq_status { + RPIVID_IRQ_NONE, + RPIVID_IRQ_ERROR, +diff --git a/drivers/staging/media/rpivid/rpivid_video.c b/drivers/staging/media/rpivid/rpivid_video.c +index 705015890e71..1efaa99a55f6 100644 +--- a/drivers/staging/media/rpivid/rpivid_video.c ++++ b/drivers/staging/media/rpivid/rpivid_video.c +@@ -27,6 +27,8 @@ + + #define RPIVID_MIN_WIDTH 16U + #define RPIVID_MIN_HEIGHT 16U ++#define RPIVID_DEFAULT_WIDTH 1920U ++#define RPIVID_DEFAULT_HEIGHT 1088U + #define RPIVID_MAX_WIDTH 4096U + #define RPIVID_MAX_HEIGHT 4096U + +@@ -70,25 +72,22 @@ size_t rpivid_bit_buf_size(unsigned int w, unsigned int h, unsigned int bits_min + return rpivid_round_up_size(bits_alloc); + } + +-int rpivid_prepare_src_format(struct v4l2_pix_format_mplane *pix_fmt) ++void rpivid_prepare_src_format(struct v4l2_pix_format_mplane *pix_fmt) + { + size_t size; + u32 w; + u32 h; + +- if (pix_fmt->pixelformat != V4L2_PIX_FMT_HEVC_SLICE) +- return -EINVAL; +- + w = pix_fmt->width; + h = pix_fmt->height; + if (!w || !h) { +- w = 1920; +- h = 1080; ++ w = RPIVID_DEFAULT_WIDTH; ++ h = RPIVID_DEFAULT_HEIGHT; + } +- if (w > 4096) +- w = 4096; +- if (h > 4096) +- h = 4096; ++ if (w > RPIVID_MAX_WIDTH) ++ w = RPIVID_MAX_WIDTH; ++ if (h > RPIVID_MAX_HEIGHT) ++ h = RPIVID_MAX_HEIGHT; + + if (!pix_fmt->plane_fmt[0].sizeimage || + pix_fmt->plane_fmt[0].sizeimage > SZ_32M) { +@@ -98,6 +97,7 @@ int rpivid_prepare_src_format(struct v4l2_pix_format_mplane *pix_fmt) + /* Set a minimum */ + size = max_t(u32, SZ_4K, pix_fmt->plane_fmt[0].sizeimage); + ++ pix_fmt->pixelformat = V4L2_PIX_FMT_HEVC_SLICE; + pix_fmt->width = w; + pix_fmt->height = h; + pix_fmt->num_planes = 1; +@@ -105,22 +105,33 @@ int rpivid_prepare_src_format(struct v4l2_pix_format_mplane *pix_fmt) + /* Zero bytes per line for encoded source. */ + pix_fmt->plane_fmt[0].bytesperline = 0; + pix_fmt->plane_fmt[0].sizeimage = size; +- +- return 0; + } + +-int rpivid_prepare_dst_format(struct v4l2_pix_format_mplane *pix_fmt) ++/* Take any pix_format and make it valid */ ++static void rpivid_prepare_dst_format(struct v4l2_pix_format_mplane *pix_fmt) + { + unsigned int width = pix_fmt->width; + unsigned int height = pix_fmt->height; + unsigned int sizeimage = pix_fmt->plane_fmt[0].sizeimage; + unsigned int bytesperline = pix_fmt->plane_fmt[0].bytesperline; + +- switch (pix_fmt->pixelformat) { ++ if (!width) ++ width = RPIVID_DEFAULT_WIDTH; ++ if (width > RPIVID_MAX_WIDTH) ++ width = RPIVID_MAX_WIDTH; ++ if (!height) ++ height = RPIVID_DEFAULT_HEIGHT; ++ if (height > RPIVID_MAX_HEIGHT) ++ height = RPIVID_MAX_HEIGHT; ++ + /* For column formats set bytesperline to column height (stride2) */ ++ switch (pix_fmt->pixelformat) { ++ default: ++ pix_fmt->pixelformat = V4L2_PIX_FMT_NV12_COL128; ++ fallthrough; + case V4L2_PIX_FMT_NV12_COL128: + /* Width rounds up to columns */ +- width = ALIGN(min(width, RPIVID_MAX_WIDTH), 128); ++ width = ALIGN(width, 128); + + /* 16 aligned height - not sure we even need that */ + height = ALIGN(height, 16); +@@ -140,7 +151,7 @@ int rpivid_prepare_dst_format(struct v4l2_pix_format_mplane *pix_fmt) + /* width in pixels (3 pels = 4 bytes) rounded to 128 byte + * columns + */ +- width = ALIGN(((min(width, RPIVID_MAX_WIDTH) + 2) / 3), 32) * 3; ++ width = ALIGN(((width + 2) / 3), 32) * 3; + + /* 16-aligned height. */ + height = ALIGN(height, 16); +@@ -157,9 +168,6 @@ int rpivid_prepare_dst_format(struct v4l2_pix_format_mplane *pix_fmt) + sizeimage = constrain2x(sizeimage, + bytesperline * width * 4 / 3); + break; +- +- default: +- return -EINVAL; + } + + pix_fmt->width = width; +@@ -169,7 +177,6 @@ int rpivid_prepare_dst_format(struct v4l2_pix_format_mplane *pix_fmt) + pix_fmt->plane_fmt[0].bytesperline = bytesperline; + pix_fmt->plane_fmt[0].sizeimage = sizeimage; + pix_fmt->num_planes = 1; +- return 0; + } + + static int rpivid_querycap(struct file *file, void *priv, +@@ -260,14 +267,13 @@ static u32 pixelformat_from_sps(const struct v4l2_ctrl_hevc_sps * const sps, + { + u32 pf = 0; + +- // Use width 0 as a signifier of unsetness +- if (!is_sps_set(sps)) { ++ if (!is_sps_set(sps) || !rpivid_hevc_validate_sps(sps)) { + /* Treat this as an error? For now return both */ + if (index == 0) + pf = V4L2_PIX_FMT_NV12_COL128; + else if (index == 1) + pf = V4L2_PIX_FMT_NV12_10_COL128; +- } else if (index == 0 && rpivid_hevc_validate_sps(sps)) { ++ } else if (index == 0) { + if (sps->bit_depth_luma_minus8 == 0) + pf = V4L2_PIX_FMT_NV12_COL128; + else if (sps->bit_depth_luma_minus8 == 2) +@@ -282,11 +288,14 @@ rpivid_hevc_default_dst_fmt(struct rpivid_ctx * const ctx) + { + const struct v4l2_ctrl_hevc_sps * const sps = + rpivid_find_control_data(ctx, V4L2_CID_MPEG_VIDEO_HEVC_SPS); +- struct v4l2_pix_format_mplane pix_fmt = { +- .width = sps->pic_width_in_luma_samples, +- .height = sps->pic_height_in_luma_samples, +- .pixelformat = pixelformat_from_sps(sps, 0) +- }; ++ struct v4l2_pix_format_mplane pix_fmt; ++ ++ memset(&pix_fmt, 0, sizeof(pix_fmt)); ++ if (is_sps_set(sps)) { ++ pix_fmt.width = sps->pic_width_in_luma_samples; ++ pix_fmt.height = sps->pic_height_in_luma_samples; ++ pix_fmt.pixelformat = pixelformat_from_sps(sps, 0); ++ } + + rpivid_prepare_dst_format(&pix_fmt); + return pix_fmt; +@@ -315,14 +324,23 @@ static int rpivid_enum_fmt_vid_cap(struct file *file, void *priv, + return 0; + } + ++/* ++ * get dst format - sets it to default if otherwise unset ++ * returns a pointer to the struct as a convienience ++ */ ++static struct v4l2_pix_format_mplane *get_dst_fmt(struct rpivid_ctx *const ctx) ++{ ++ if (!ctx->dst_fmt_set) ++ ctx->dst_fmt = rpivid_hevc_default_dst_fmt(ctx); ++ return &ctx->dst_fmt; ++} ++ + static int rpivid_g_fmt_vid_cap(struct file *file, void *priv, + struct v4l2_format *f) + { + struct rpivid_ctx *ctx = rpivid_file2ctx(file); + +- if (!ctx->dst_fmt_set) +- ctx->dst_fmt = rpivid_hevc_default_dst_fmt(ctx); +- f->fmt.pix_mp = ctx->dst_fmt; ++ f->fmt.pix_mp = *get_dst_fmt(ctx); + return 0; + } + +@@ -358,31 +376,20 @@ static int rpivid_try_fmt_vid_cap(struct file *file, void *priv, + break; + } + +- // If we can't use requested fmt then set to default +- if (pixelformat == 0) { +- pixelformat = pixelformat_from_sps(sps, 0); +- // If we don't have a default then give up +- if (pixelformat == 0) +- return -EINVAL; +- } +- + // We don't have any way of finding out colourspace so believe + // anything we are told - take anything set in src as a default + if (f->fmt.pix_mp.colorspace == V4L2_COLORSPACE_DEFAULT) + copy_color(&f->fmt.pix_mp, &ctx->src_fmt); + + f->fmt.pix_mp.pixelformat = pixelformat; +- return rpivid_prepare_dst_format(&f->fmt.pix_mp); ++ rpivid_prepare_dst_format(&f->fmt.pix_mp); ++ return 0; + } + + static int rpivid_try_fmt_vid_out(struct file *file, void *priv, + struct v4l2_format *f) + { +- if (rpivid_prepare_src_format(&f->fmt.pix_mp)) { +- // Set default src format +- f->fmt.pix_mp.pixelformat = RPIVID_SRC_PIXELFORMAT_DEFAULT; +- rpivid_prepare_src_format(&f->fmt.pix_mp); +- } ++ rpivid_prepare_src_format(&f->fmt.pix_mp); + return 0; + } + +@@ -474,7 +481,7 @@ static int rpivid_queue_setup(struct vb2_queue *vq, unsigned int *nbufs, + if (V4L2_TYPE_IS_OUTPUT(vq->type)) + pix_fmt = &ctx->src_fmt; + else +- pix_fmt = &ctx->dst_fmt; ++ pix_fmt = get_dst_fmt(ctx); + + if (*nplanes) { + if (sizes[0] < pix_fmt->plane_fmt[0].sizeimage) +diff --git a/drivers/staging/media/rpivid/rpivid_video.h b/drivers/staging/media/rpivid/rpivid_video.h +index a3b228556497..e22cc0e32aa3 100644 +--- a/drivers/staging/media/rpivid/rpivid_video.h ++++ b/drivers/staging/media/rpivid/rpivid_video.h +@@ -28,7 +28,6 @@ int rpivid_queue_init(void *priv, struct vb2_queue *src_vq, + size_t rpivid_bit_buf_size(unsigned int w, unsigned int h, unsigned int bits_minus8); + size_t rpivid_round_up_size(const size_t x); + +-int rpivid_prepare_src_format(struct v4l2_pix_format_mplane *pix_fmt); +-int rpivid_prepare_dst_format(struct v4l2_pix_format_mplane *pix_fmt); ++void rpivid_prepare_src_format(struct v4l2_pix_format_mplane *pix_fmt); + + #endif +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 22 Sep 2021 15:38:13 +0100 +Subject: [PATCH 833/889] net: phy: lan87xx: Allow more time for link detect + +With EDPWRDOWN set in idle, it must be cleared before checking for +ENERGYON going high, indicating that a link is being established. +The existing code allows 640ms for ENERGYON to go high, but on +Raspberry Pis that appears not to be enough, causing link detection +to fail. + +Increase the polling timeout to 1500ms - with a polling interval of +10ms it shouldn't cause unnecessary delays. + +See: https://github.com/raspberrypi/linux/issues/4393 + +Signed-off-by: Phil Elwell +--- + drivers/net/phy/smsc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c +index caf7291ffaf8..9983eeded624 100644 +--- a/drivers/net/phy/smsc.c ++++ b/drivers/net/phy/smsc.c +@@ -195,12 +195,12 @@ static int lan87xx_read_status(struct phy_device *phydev) + if (rc < 0) + return rc; + +- /* Wait max 640 ms to detect energy and the timeout is not ++ /* Wait max 1500 ms to detect energy and the timeout is not + * an actual error. + */ + read_poll_timeout(phy_read, rc, + rc & MII_LAN83C185_ENERGYON || rc < 0, +- 10000, 640000, true, phydev, ++ 10000, 1500000, true, phydev, + MII_LAN83C185_CTRL_STATUS); + if (rc < 0) + return rc; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Wed, 22 Sep 2021 18:57:19 +0100 +Subject: [PATCH 834/889] media: rpivid: Remove unused ctx state variable and + defines + +Remove unused ctx state tracking variable and associated defines. +Their presence implies they might be used, but they aren't. + +Signed-off-by: John Cox +--- + drivers/staging/media/rpivid/rpivid.h | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/drivers/staging/media/rpivid/rpivid.h b/drivers/staging/media/rpivid/rpivid.h +index 3d4ff825b21a..31d320b596b4 100644 +--- a/drivers/staging/media/rpivid/rpivid.h ++++ b/drivers/staging/media/rpivid/rpivid.h +@@ -81,12 +81,6 @@ typedef void (*rpivid_irq_callback)(struct rpivid_dev *dev, void *ctx); + struct rpivid_q_aux; + #define RPIVID_AUX_ENT_COUNT VB2_MAX_FRAME + +- +-#define RPIVID_CTX_STATE_STOPPED 0 /* stream_off */ +-#define RPIVID_CTX_STATE_STREAM_ON 1 /* decoding */ +-#define RPIVID_CTX_STATE_STREAM_STOP 2 /* in stream_off */ +-#define RPIVID_CTX_STATE_STREAM_ERR 3 /* stream_on but broken */ +- + struct rpivid_ctx { + struct v4l2_fh fh; + struct rpivid_dev *dev; +@@ -95,7 +89,6 @@ struct rpivid_ctx { + struct v4l2_pix_format_mplane dst_fmt; + int dst_fmt_set; + +- atomic_t stream_state; + struct clk_request *clk_req; + int src_stream_on; + int dst_stream_on; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Wed, 22 Sep 2021 19:05:30 +0100 +Subject: [PATCH 835/889] media: rpivid: Ensure IRQs have completed before + uniniting context + +Before uniniting the decode context sync with the IRQ queues to ensure +that decode no longer has any buffers in use. This fixes a problem that +manifested as ffmpeg leaking CMA buffers when it did a stream off on +OUTPUT before CAPTURE, though in reality it was probably much more +dangerous than that. + +Signed-off-by: John Cox +--- + drivers/staging/media/rpivid/rpivid_h265.c | 58 ++++++++++++++++++++-- + 1 file changed, 53 insertions(+), 5 deletions(-) + +diff --git a/drivers/staging/media/rpivid/rpivid_h265.c b/drivers/staging/media/rpivid/rpivid_h265.c +index a5a0e31bd5ba..17b3a565c315 100644 +--- a/drivers/staging/media/rpivid/rpivid_h265.c ++++ b/drivers/staging/media/rpivid/rpivid_h265.c +@@ -2365,12 +2365,50 @@ static void dec_state_delete(struct rpivid_ctx *const ctx) + kfree(s); + } + +-static void rpivid_h265_stop(struct rpivid_ctx *ctx) ++struct irq_sync { ++ atomic_t done; ++ wait_queue_head_t wq; ++ struct rpivid_hw_irq_ent irq_ent; ++}; ++ ++static void phase2_sync_claimed(struct rpivid_dev *const dev, void *v) + { +- struct rpivid_dev *const dev = ctx->dev; +- unsigned int i; ++ struct irq_sync *const sync = v; + +- v4l2_info(&dev->v4l2_dev, "%s\n", __func__); ++ atomic_set(&sync->done, 1); ++ wake_up(&sync->wq); ++} ++ ++static void phase1_sync_claimed(struct rpivid_dev *const dev, void *v) ++{ ++ struct irq_sync *const sync = v; ++ ++ rpivid_hw_irq_active1_enable_claim(dev, 1); ++ rpivid_hw_irq_active2_claim(dev, &sync->irq_ent, phase2_sync_claimed, sync); ++} ++ ++/* Sync with IRQ operations ++ * ++ * Claims phase1 and phase2 in turn and waits for the phase2 claim so any ++ * pending IRQ ops will have completed by the time this returns ++ * ++ * phase1 has counted enables so must reenable once claimed ++ * phase2 has unlimited enables ++ */ ++static void irq_sync(struct rpivid_dev *const dev) ++{ ++ struct irq_sync sync; ++ ++ atomic_set(&sync.done, 0); ++ init_waitqueue_head(&sync.wq); ++ ++ rpivid_hw_irq_active1_claim(dev, &sync.irq_ent, phase1_sync_claimed, &sync); ++ wait_event(sync.wq, atomic_read(&sync.done)); ++} ++ ++static void h265_ctx_uninit(struct rpivid_dev *const dev, struct rpivid_ctx *ctx) ++{ ++ unsigned int i; + + dec_env_uninit(ctx); + dec_state_delete(ctx); +@@ -2387,6 +2425,16 @@ static void rpivid_h265_stop(struct rpivid_ctx *ctx) + gptr_free(dev, ctx->coeff_bufs + i); + } + ++static void rpivid_h265_stop(struct rpivid_ctx *ctx) ++{ ++ struct rpivid_dev *const dev = ctx->dev; ++ ++ v4l2_info(&dev->v4l2_dev, "%s\n", __func__); ++ ++ irq_sync(dev); ++ h265_ctx_uninit(dev, ctx); ++} ++ + static int rpivid_h265_start(struct rpivid_ctx *ctx) + { + struct rpivid_dev *const dev = ctx->dev; +@@ -2448,7 +2496,7 @@ static int rpivid_h265_start(struct rpivid_ctx *ctx) + return 0; + + fail: +- rpivid_h265_stop(ctx); ++ h265_ctx_uninit(dev, ctx); + return -ENOMEM; + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 9 Oct 2020 10:40:27 +0100 +Subject: [PATCH 836/889] staging: bcm2835-codec: Allow decode res changed + before STREAMON(CAPTURE) + +The V4L2 stateful video decoder API requires that you can STREAMON +on only the OUTPUT queue, feed in buffers, and wait for the +SOURCE_CHANGE event. +This requires that we enable the MMAL output port at the same time +as the input port, because the output port is the one that creates +the SOURCE_CHANGED event. + +Signed-off-by: Dave Stevenson +--- + .../bcm2835-codec/bcm2835-v4l2-codec.c | 137 +++++++++++++++--- + 1 file changed, 117 insertions(+), 20 deletions(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 8df0eb2b532a..f8fe8effa06d 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -1498,6 +1498,7 @@ static int vidioc_s_fmt(struct bcm2835_codec_ctx *ctx, struct v4l2_format *f, + struct vb2_queue *vq; + struct vchiq_mmal_port *port; + bool update_capture_port = false; ++ bool reenable_port = false; + int ret; + + v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "Setting format for type %d, wxh: %dx%d, fmt: %08x, size %u\n", +@@ -1575,6 +1576,24 @@ static int vidioc_s_fmt(struct bcm2835_codec_ctx *ctx, struct v4l2_format *f, + if (!port) + return 0; + ++ if (port->enabled) { ++ /* ++ * This should only ever happen with DECODE and the MMAL output ++ * port that has been enabled for resolution changed events. ++ * In this case no buffers have been allocated or sent to the ++ * component, so warn on that. ++ */ ++ WARN_ON(ctx->dev->role != DECODE || ++ f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE || ++ atomic_read(&port->buffers_with_vpu)); ++ ++ ret = vchiq_mmal_port_disable(ctx->dev->instance, port); ++ if (ret) ++ v4l2_err(&ctx->dev->v4l2_dev, "%s: Error disabling port update buffer count, ret %d\n", ++ __func__, ret); ++ reenable_port = true; ++ } ++ + setup_mmal_port_format(ctx, q_data, port); + ret = vchiq_mmal_port_set_format(ctx->dev->instance, port); + if (ret) { +@@ -1589,6 +1608,14 @@ static int vidioc_s_fmt(struct bcm2835_codec_ctx *ctx, struct v4l2_format *f, + port->minimum_buffer.size); + } + ++ if (reenable_port) { ++ ret = vchiq_mmal_port_enable(ctx->dev->instance, ++ port, ++ op_buffer_cb); ++ if (ret) ++ v4l2_err(&ctx->dev->v4l2_dev, "%s: Failed enabling o/p port, ret %d\n", ++ __func__, ret); ++ } + v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "Set format for type %d, wxh: %dx%d, fmt: %08x, size %u\n", + f->type, q_data->crop_width, q_data->height, + q_data->fmt->fourcc, q_data->sizeimage); +@@ -2467,9 +2494,11 @@ static int bcm2835_codec_create_component(struct bcm2835_codec_ctx *ctx) + + setup_mmal_port_format(ctx, &ctx->q_data[V4L2_M2M_SRC], + &ctx->component->input[0]); ++ ctx->component->input[0].cb_ctx = ctx; + + setup_mmal_port_format(ctx, &ctx->q_data[V4L2_M2M_DST], + &ctx->component->output[0]); ++ ctx->component->output[0].cb_ctx = ctx; + + ret = vchiq_mmal_port_set_format(dev->instance, + &ctx->component->input[0]); +@@ -2724,6 +2753,24 @@ static void bcm2835_codec_buffer_cleanup(struct vb2_buffer *vb) + bcm2835_codec_mmal_buf_cleanup(&buf->mmal); + } + ++static void bcm2835_codec_flush_buffers(struct bcm2835_codec_ctx *ctx, ++ struct vchiq_mmal_port *port) ++{ ++ int ret; ++ ++ while (atomic_read(&port->buffers_with_vpu)) { ++ v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: Waiting for buffers to be returned - %d outstanding\n", ++ __func__, atomic_read(&port->buffers_with_vpu)); ++ ret = wait_for_completion_timeout(&ctx->frame_cmplt, ++ COMPLETE_TIMEOUT); ++ if (ret <= 0) { ++ v4l2_err(&ctx->dev->v4l2_dev, "%s: Timeout waiting for buffers to be returned - %d outstanding\n", ++ __func__, ++ atomic_read(&port->buffers_with_vpu)); ++ break; ++ } ++ } ++} + static int bcm2835_codec_start_streaming(struct vb2_queue *q, + unsigned int count) + { +@@ -2731,7 +2778,7 @@ static int bcm2835_codec_start_streaming(struct vb2_queue *q, + struct bcm2835_codec_dev *dev = ctx->dev; + struct bcm2835_codec_q_data *q_data = get_q_data(ctx, q->type); + struct vchiq_mmal_port *port = get_port_data(ctx, q->type); +- int ret; ++ int ret = 0; + + v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: type: %d count %d\n", + __func__, q->type, count); +@@ -2746,6 +2793,34 @@ static int bcm2835_codec_start_streaming(struct vb2_queue *q, + ctx->component_enabled = true; + } + ++ if (port->enabled) { ++ unsigned int num_buffers; ++ ++ init_completion(&ctx->frame_cmplt); ++ ++ /* ++ * This should only ever happen with DECODE and the MMAL output ++ * port that has been enabled for resolution changed events. ++ * In this case no buffers have been allocated or sent to the ++ * component, so warn on that. ++ */ ++ WARN_ON(ctx->dev->role != DECODE); ++ WARN_ON(q->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); ++ WARN_ON(atomic_read(&port->buffers_with_vpu)); ++ ++ /* ++ * Disable will reread the port format, so retain buffer count. ++ */ ++ num_buffers = port->current_buffer.num; ++ ++ ret = vchiq_mmal_port_disable(dev->instance, port); ++ if (ret) ++ v4l2_err(&ctx->dev->v4l2_dev, "%s: Error disabling port update buffer count, ret %d\n", ++ __func__, ret); ++ bcm2835_codec_flush_buffers(ctx, port); ++ port->current_buffer.num = num_buffers; ++ } ++ + if (count < port->minimum_buffer.num) + count = port->minimum_buffer.num; + +@@ -2760,6 +2835,22 @@ static int bcm2835_codec_start_streaming(struct vb2_queue *q, + __func__, ret); + } + ++ if (dev->role == DECODE && ++ q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && ++ !ctx->component->output[0].enabled) { ++ /* ++ * Decode needs to enable the MMAL output/V4L2 CAPTURE ++ * port at this point too so that we have everything ++ * set up for dynamic resolution changes. ++ */ ++ ret = vchiq_mmal_port_enable(dev->instance, ++ &ctx->component->output[0], ++ op_buffer_cb); ++ if (ret) ++ v4l2_err(&ctx->dev->v4l2_dev, "%s: Failed enabling o/p port, ret %d\n", ++ __func__, ret); ++ } ++ + if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + /* + * Create the EOS buffer. +@@ -2771,7 +2862,6 @@ static int bcm2835_codec_start_streaming(struct vb2_queue *q, + &q_data->eos_buffer.mmal); + q_data->eos_buffer_in_use = false; + +- port->cb_ctx = ctx; + ret = vchiq_mmal_port_enable(dev->instance, + port, + ip_buffer_cb); +@@ -2779,14 +2869,17 @@ static int bcm2835_codec_start_streaming(struct vb2_queue *q, + v4l2_err(&ctx->dev->v4l2_dev, "%s: Failed enabling i/p port, ret %d\n", + __func__, ret); + } else { +- port->cb_ctx = ctx; +- ret = vchiq_mmal_port_enable(dev->instance, +- port, +- op_buffer_cb); +- if (ret) +- v4l2_err(&ctx->dev->v4l2_dev, "%s: Failed enabling o/p port, ret %d\n", +- __func__, ret); ++ if (!port->enabled) { ++ ret = vchiq_mmal_port_enable(dev->instance, ++ port, ++ op_buffer_cb); ++ if (ret) ++ v4l2_err(&ctx->dev->v4l2_dev, "%s: Failed enabling o/p port, ret %d\n", ++ __func__, ret); ++ } + } ++ v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: Done, ret %d\n", ++ __func__, ret); + return ret; + } + +@@ -2825,17 +2918,21 @@ static void bcm2835_codec_stop_streaming(struct vb2_queue *q) + __func__, V4L2_TYPE_IS_OUTPUT(q->type) ? "i/p" : "o/p", + ret); + +- while (atomic_read(&port->buffers_with_vpu)) { +- v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: Waiting for buffers to be returned - %d outstanding\n", +- __func__, atomic_read(&port->buffers_with_vpu)); +- ret = wait_for_completion_timeout(&ctx->frame_cmplt, +- COMPLETE_TIMEOUT); +- if (ret <= 0) { +- v4l2_err(&ctx->dev->v4l2_dev, "%s: Timeout waiting for buffers to be returned - %d outstanding\n", +- __func__, +- atomic_read(&port->buffers_with_vpu)); +- break; +- } ++ bcm2835_codec_flush_buffers(ctx, port); ++ ++ if (dev->role == DECODE && ++ q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && ++ ctx->component->input[0].enabled) { ++ /* ++ * For decode we need to keep the MMAL output port enabled for ++ * resolution changed events whenever the input is enabled. ++ */ ++ ret = vchiq_mmal_port_enable(dev->instance, ++ &ctx->component->output[0], ++ op_buffer_cb); ++ if (ret) ++ v4l2_err(&ctx->dev->v4l2_dev, "%s: Failed enabling o/p port, ret %d\n", ++ __func__, ret); + } + + /* If both ports disabled, then disable the component */ +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 15 Sep 2021 17:44:19 +0100 +Subject: [PATCH 837/889] staging/bcm2835-codec: Do not send buffers to the VPU + unless streaming + +With video decode we now enable both input and output ports on +the component. This means that buffers will get passed to the VPU +earlier than desired if they are queued befoer STREAMON. + +Check that the queue is streaming before sending buffers to the VPU. + +Signed-off-by: Dave Stevenson +--- + .../bcm2835-codec/bcm2835-v4l2-codec.c | 64 +++++++++++-------- + 1 file changed, 38 insertions(+), 26 deletions(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index f8fe8effa06d..4156018dbf7a 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -1244,35 +1244,47 @@ static void device_run(void *priv) + + v4l2_dbg(3, debug, &ctx->dev->v4l2_dev, "%s: off we go\n", __func__); + +- src_buf = v4l2_m2m_buf_remove(&ctx->fh.m2m_ctx->out_q_ctx); +- if (src_buf) { +- m2m = container_of(src_buf, struct v4l2_m2m_buffer, vb); +- src_m2m_buf = container_of(m2m, struct m2m_mmal_buffer, m2m); +- vb2_to_mmal_buffer(src_m2m_buf, src_buf); +- +- ret = vchiq_mmal_submit_buffer(dev->instance, +- &ctx->component->input[0], +- &src_m2m_buf->mmal); +- v4l2_dbg(3, debug, &ctx->dev->v4l2_dev, "%s: Submitted ip buffer len %lu, pts %llu, flags %04x\n", +- __func__, src_m2m_buf->mmal.length, +- src_m2m_buf->mmal.pts, src_m2m_buf->mmal.mmal_flags); +- if (ret) +- v4l2_err(&ctx->dev->v4l2_dev, "%s: Failed submitting ip buffer\n", +- __func__); ++ if (ctx->fh.m2m_ctx->out_q_ctx.q.streaming) { ++ src_buf = v4l2_m2m_buf_remove(&ctx->fh.m2m_ctx->out_q_ctx); ++ if (src_buf) { ++ m2m = container_of(src_buf, struct v4l2_m2m_buffer, vb); ++ src_m2m_buf = container_of(m2m, struct m2m_mmal_buffer, ++ m2m); ++ vb2_to_mmal_buffer(src_m2m_buf, src_buf); ++ ++ ret = vchiq_mmal_submit_buffer(dev->instance, ++ &ctx->component->input[0], ++ &src_m2m_buf->mmal); ++ v4l2_dbg(3, debug, &ctx->dev->v4l2_dev, ++ "%s: Submitted ip buffer len %lu, pts %llu, flags %04x\n", ++ __func__, src_m2m_buf->mmal.length, ++ src_m2m_buf->mmal.pts, ++ src_m2m_buf->mmal.mmal_flags); ++ if (ret) ++ v4l2_err(&ctx->dev->v4l2_dev, ++ "%s: Failed submitting ip buffer\n", ++ __func__); ++ } + } + +- dst_buf = v4l2_m2m_buf_remove(&ctx->fh.m2m_ctx->cap_q_ctx); +- if (dst_buf) { +- m2m = container_of(dst_buf, struct v4l2_m2m_buffer, vb); +- dst_m2m_buf = container_of(m2m, struct m2m_mmal_buffer, m2m); +- vb2_to_mmal_buffer(dst_m2m_buf, dst_buf); ++ if (ctx->fh.m2m_ctx->cap_q_ctx.q.streaming) { ++ dst_buf = v4l2_m2m_buf_remove(&ctx->fh.m2m_ctx->cap_q_ctx); ++ if (dst_buf) { ++ m2m = container_of(dst_buf, struct v4l2_m2m_buffer, vb); ++ dst_m2m_buf = container_of(m2m, struct m2m_mmal_buffer, ++ m2m); ++ vb2_to_mmal_buffer(dst_m2m_buf, dst_buf); + +- ret = vchiq_mmal_submit_buffer(dev->instance, +- &ctx->component->output[0], +- &dst_m2m_buf->mmal); +- if (ret) +- v4l2_err(&ctx->dev->v4l2_dev, "%s: Failed submitting op buffer\n", +- __func__); ++ v4l2_dbg(3, debug, &ctx->dev->v4l2_dev, ++ "%s: Submitted op buffer\n", __func__); ++ ret = vchiq_mmal_submit_buffer(dev->instance, ++ &ctx->component->output[0], ++ &dst_m2m_buf->mmal); ++ if (ret) ++ v4l2_err(&ctx->dev->v4l2_dev, ++ "%s: Failed submitting op buffer\n", ++ __func__); ++ } + } + + v4l2_dbg(3, debug, &ctx->dev->v4l2_dev, "%s: Submitted src %p, dst %p\n", +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 15 Sep 2021 17:49:41 +0100 +Subject: [PATCH 838/889] staging/mmal-vchiq: Rationalise included headers + +The list of includes was slightly over generic, and wasn't +in alphabetical order. Clean it up. + +Signed-off-by: Dave Stevenson +--- + drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +index 014fbace54cd..a322b97e3f65 100644 +--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c ++++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +@@ -15,16 +15,15 @@ + + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include ++#include + #include + #include +-#include +-#include +-#include +-#include + #include +-#include ++#include ++#include + + #include "mmal-common.h" + #include "mmal-parameters.h" +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 16 Sep 2021 16:32:53 +0100 +Subject: [PATCH 839/889] staging: bcm2835-codec: Format changed should trigger + drain + +When a format changed event occurs, the spec says that it +triggers an implicit drain, and that needs to be signalled +via -EPIPE. + +For BCM2835, the format changed event happens at the point +the format change occurs, so no further buffers exist from +before the resolution changed point. We therefore signal the +last buffer immediately. +We don't have a V4L2 available to us at this point, so set +the videobuf2 queue last_buffer_dequeued flag directly. + +Signed-off-by: Dave Stevenson +--- + .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 4156018dbf7a..73afe99268ff 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -1005,6 +1005,7 @@ static void handle_fmt_changed(struct bcm2835_codec_ctx *ctx, + (struct mmal_msg_event_format_changed *)mmal_buf->buffer; + struct mmal_parameter_video_interlace_type interlace; + int interlace_size = sizeof(interlace); ++ struct vb2_queue *vq; + int ret; + + v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: Format changed: buff size min %u, rec %u, buff num min %u, rec %u\n", +@@ -1074,6 +1075,10 @@ static void handle_fmt_changed(struct bcm2835_codec_ctx *ctx, + q_data->field = V4L2_FIELD_NONE; + } + ++ vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); ++ if (vq->streaming) ++ vq->last_buffer_dequeued = true; ++ + queue_res_chg_event(ctx); + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 16 Sep 2021 16:39:07 +0100 +Subject: [PATCH 840/889] staging: bcm2835-codec: Signal the firmware to stop + on all changes + +The firmware defaults to not stopping video decode if only the +pixel aspect ratio or colourspace change. V4L2 requires us +to stop decoding on any change, therefore tell the firmware +of the desire for this alternate behaviour. + +Signed-off-by: Dave Stevenson +--- + .../vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 10 ++++++++++ + .../staging/vc04_services/vchiq-mmal/mmal-parameters.h | 3 +++ + 2 files changed, 13 insertions(+) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 73afe99268ff..6c6e0ba34a0b 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -2483,6 +2483,16 @@ static int bcm2835_codec_create_component(struct bcm2835_codec_ctx *ctx) + MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS, + &enable, + sizeof(enable)); ++ /* ++ * Enable firmware option to stop on colourspace and pixel ++ * aspect ratio changed ++ */ ++ enable = 1; ++ vchiq_mmal_port_parameter_set(dev->instance, ++ &ctx->component->control, ++ MMAL_PARAMETER_VIDEO_STOP_ON_PAR_COLOUR_CHANGE, ++ &enable, ++ sizeof(enable)); + } else if (dev->role == DEINTERLACE) { + /* Select the default deinterlace algorithm. */ + int half_framerate = 0; +diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h +index 622508dc6e27..21087496a481 100644 +--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h ++++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h +@@ -682,6 +682,9 @@ enum mmal_parameter_video_type { + + /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */ + MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS, ++ ++ /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */ ++ MMAL_PARAMETER_VIDEO_STOP_ON_PAR_COLOUR_CHANGE, + }; + + /** Valid mirror modes */ +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 15 Sep 2021 17:54:11 +0100 +Subject: [PATCH 841/889] staging/mmal-vchiq: Add module parameter to enable + logging. + +Adds a module parameter "debug" to enable various logging levels. + +Signed-off-by: Dave Stevenson +--- + .../vc04_services/vchiq-mmal/mmal-vchiq.c | 156 ++++++++++-------- + 1 file changed, 85 insertions(+), 71 deletions(-) + +diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +index a322b97e3f65..12a670bcc535 100644 +--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c ++++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +@@ -31,6 +31,17 @@ + #include "mmal-msg.h" + + #include "vc-sm-cma/vc_sm_knl.h" ++ ++#define pr_dbg_lvl(__level, __debug, __fmt, __arg...) \ ++ do { \ ++ if (__debug >= (__level)) \ ++ printk(KERN_DEBUG __fmt, ##__arg); \ ++ } while (0) ++ ++static unsigned int debug; ++module_param(debug, uint, 0644); ++MODULE_PARM_DESC(debug, "activates debug info (0-3)"); ++ + /* + * maximum number of components supported. + * This matches the maximum permitted by default on the VPU +@@ -381,7 +392,8 @@ buffer_from_host(struct vchiq_mmal_instance *instance, + if (!port->enabled) + return -EINVAL; + +- pr_debug("instance:%u buffer:%p\n", instance->service_handle, buf); ++ pr_dbg_lvl(3, debug, "instance:%u buffer:%p\n", ++ instance->service_handle, buf); + + /* get context */ + if (!buf->msg_context) { +@@ -549,11 +561,11 @@ static void event_to_host_cb(struct vchiq_mmal_instance *instance, + msg_context->u.bulk.pts = MMAL_TIME_UNKNOWN; + msg_context->u.bulk.cmd = msg->u.event_to_host.cmd; + +- pr_debug("event component:%u port type:%d num:%d cmd:0x%x length:%d\n", +- msg->u.event_to_host.client_component, +- msg->u.event_to_host.port_type, +- msg->u.event_to_host.port_num, +- msg->u.event_to_host.cmd, msg->u.event_to_host.length); ++ pr_dbg_lvl(3, debug, "event component:%u port type:%d num:%d cmd:0x%x length:%d\n", ++ msg->u.event_to_host.client_component, ++ msg->u.event_to_host.port_type, ++ msg->u.event_to_host.port_num, ++ msg->u.event_to_host.cmd, msg->u.event_to_host.length); + } + + schedule_work(&msg_context->u.bulk.work); +@@ -566,8 +578,8 @@ static void buffer_to_host_cb(struct vchiq_mmal_instance *instance, + struct mmal_msg_context *msg_context; + u32 handle; + +- pr_debug("%s: instance:%p msg:%p msg_len:%d\n", +- __func__, instance, msg, msg_len); ++ pr_dbg_lvl(3, debug, "%s: instance:%p msg:%p msg_len:%d\n", ++ __func__, instance, msg, msg_len); + + if (msg->u.buffer_from_host.drvbuf.magic == MMAL_MAGIC) { + handle = msg->u.buffer_from_host.drvbuf.client_context; +@@ -837,42 +849,43 @@ static int send_synchronous_mmal_msg(struct vchiq_mmal_instance *instance, + + static void dump_port_info(struct vchiq_mmal_port *port) + { +- pr_debug("port handle:0x%x enabled:%d\n", port->handle, port->enabled); ++ pr_dbg_lvl(3, debug, "port handle:0x%x enabled:%d\n", port->handle, ++ port->enabled); + +- pr_debug("buffer minimum num:%d size:%d align:%d\n", +- port->minimum_buffer.num, +- port->minimum_buffer.size, port->minimum_buffer.alignment); ++ pr_dbg_lvl(3, debug, "buffer minimum num:%d size:%d align:%d\n", ++ port->minimum_buffer.num, ++ port->minimum_buffer.size, port->minimum_buffer.alignment); + +- pr_debug("buffer recommended num:%d size:%d align:%d\n", +- port->recommended_buffer.num, +- port->recommended_buffer.size, +- port->recommended_buffer.alignment); ++ pr_dbg_lvl(3, debug, "buffer recommended num:%d size:%d align:%d\n", ++ port->recommended_buffer.num, ++ port->recommended_buffer.size, ++ port->recommended_buffer.alignment); + +- pr_debug("buffer current values num:%d size:%d align:%d\n", +- port->current_buffer.num, +- port->current_buffer.size, port->current_buffer.alignment); ++ pr_dbg_lvl(3, debug, "buffer current values num:%d size:%d align:%d\n", ++ port->current_buffer.num, ++ port->current_buffer.size, port->current_buffer.alignment); + +- pr_debug("elementary stream: type:%d encoding:0x%x variant:0x%x\n", +- port->format.type, +- port->format.encoding, port->format.encoding_variant); ++ pr_dbg_lvl(3, debug, "elementary stream: type:%d encoding:0x%x variant:0x%x\n", ++ port->format.type, ++ port->format.encoding, port->format.encoding_variant); + +- pr_debug(" bitrate:%d flags:0x%x\n", +- port->format.bitrate, port->format.flags); ++ pr_dbg_lvl(3, debug, " bitrate:%d flags:0x%x\n", ++ port->format.bitrate, port->format.flags); + + if (port->format.type == MMAL_ES_TYPE_VIDEO) { +- pr_debug +- ("es video format: width:%d height:%d colourspace:0x%x\n", +- port->es.video.width, port->es.video.height, +- port->es.video.color_space); +- +- pr_debug(" : crop xywh %d,%d,%d,%d\n", +- port->es.video.crop.x, +- port->es.video.crop.y, +- port->es.video.crop.width, port->es.video.crop.height); +- pr_debug(" : framerate %d/%d aspect %d/%d\n", +- port->es.video.frame_rate.num, +- port->es.video.frame_rate.den, +- port->es.video.par.num, port->es.video.par.den); ++ pr_dbg_lvl(3, debug, ++ "es video format: width:%d height:%d colourspace:0x%x\n", ++ port->es.video.width, port->es.video.height, ++ port->es.video.color_space); ++ ++ pr_dbg_lvl(3, debug, " : crop xywh %d,%d,%d,%d\n", ++ port->es.video.crop.x, ++ port->es.video.crop.y, ++ port->es.video.crop.width, port->es.video.crop.height); ++ pr_dbg_lvl(3, debug, " : framerate %d/%d aspect %d/%d\n", ++ port->es.video.frame_rate.num, ++ port->es.video.frame_rate.den, ++ port->es.video.par.num, port->es.video.par.den); + } + } + +@@ -903,7 +916,7 @@ static int port_info_set(struct vchiq_mmal_instance *instance, + struct mmal_msg *rmsg; + struct vchiq_header *rmsg_handle; + +- pr_debug("setting port info port %p\n", port); ++ pr_dbg_lvl(1, debug, "setting port info port %p\n", port); + if (!port) + return -1; + dump_port_info(port); +@@ -946,8 +959,8 @@ static int port_info_set(struct vchiq_mmal_instance *instance, + /* return operation status */ + ret = -rmsg->u.port_info_get_reply.status; + +- pr_debug("%s:result:%d component:0x%x port:%d\n", __func__, ret, +- port->component->handle, port->handle); ++ pr_dbg_lvl(1, debug, "%s:result:%d component:0x%x port:%d\n", __func__, ++ ret, port->component->handle, port->handle); + + release_msg: + vchiq_release_message(instance->service_handle, rmsg_handle); +@@ -1037,13 +1050,13 @@ static int port_info_get(struct vchiq_mmal_instance *instance, + rmsg->u.port_info_get_reply.extradata, + port->format.extradata_size); + +- pr_debug("received port info\n"); ++ pr_dbg_lvl(1, debug, "received port info\n"); + dump_port_info(port); + + release_msg: + +- pr_debug("%s:result:%d component:0x%x port:%d\n", +- __func__, ret, port->component->handle, port->handle); ++ pr_dbg_lvl(1, debug, "%s:result:%d component:0x%x port:%d\n", ++ __func__, ret, port->component->handle, port->handle); + + vchiq_release_message(instance->service_handle, rmsg_handle); + +@@ -1088,9 +1101,9 @@ static int create_component(struct vchiq_mmal_instance *instance, + component->outputs = rmsg->u.component_create_reply.output_num; + component->clocks = rmsg->u.component_create_reply.clock_num; + +- pr_debug("Component handle:0x%x in:%d out:%d clock:%d\n", +- component->handle, +- component->inputs, component->outputs, component->clocks); ++ pr_dbg_lvl(2, debug, "Component handle:0x%x in:%d out:%d clock:%d\n", ++ component->handle, ++ component->inputs, component->outputs, component->clocks); + + release_msg: + vchiq_release_message(instance->service_handle, rmsg_handle); +@@ -1259,10 +1272,9 @@ static int port_action_port(struct vchiq_mmal_instance *instance, + + ret = -rmsg->u.port_action_reply.status; + +- pr_debug("%s:result:%d component:0x%x port:%d action:%s(%d)\n", +- __func__, +- ret, port->component->handle, port->handle, +- port_action_type_names[action_type], action_type); ++ pr_dbg_lvl(2, debug, "%s:result:%d component:0x%x port:%d action:%s(%d)\n", ++ __func__, ret, port->component->handle, port->handle, ++ port_action_type_names[action_type], action_type); + + release_msg: + vchiq_release_message(instance->service_handle, rmsg_handle); +@@ -1306,11 +1318,11 @@ static int port_action_handle(struct vchiq_mmal_instance *instance, + + ret = -rmsg->u.port_action_reply.status; + +- pr_debug("%s:result:%d component:0x%x port:%d action:%s(%d) connect component:0x%x connect port:%d\n", +- __func__, +- ret, port->component->handle, port->handle, +- port_action_type_names[action_type], +- action_type, connect_component_handle, connect_port_handle); ++ pr_dbg_lvl(2, debug, ++ "%s:result:%d component:0x%x port:%d action:%s(%d) connect component:0x%x connect port:%d\n", ++ __func__, ret, port->component->handle, port->handle, ++ port_action_type_names[action_type], ++ action_type, connect_component_handle, connect_port_handle); + + release_msg: + vchiq_release_message(instance->service_handle, rmsg_handle); +@@ -1349,9 +1361,9 @@ static int port_parameter_set(struct vchiq_mmal_instance *instance, + + ret = -rmsg->u.port_parameter_set_reply.status; + +- pr_debug("%s:result:%d component:0x%x port:%d parameter:%d\n", +- __func__, +- ret, port->component->handle, port->handle, parameter_id); ++ pr_dbg_lvl(1, debug, "%s:result:%d component:0x%x port:%d parameter:%d\n", ++ __func__, ret, port->component->handle, port->handle, ++ parameter_id); + + release_msg: + vchiq_release_message(instance->service_handle, rmsg_handle); +@@ -1409,8 +1421,9 @@ static int port_parameter_get(struct vchiq_mmal_instance *instance, + /* Always report the size of the returned parameter to the caller */ + *value_size = rmsg->u.port_parameter_get_reply.size; + +- pr_debug("%s:result:%d component:0x%x port:%d parameter:%d\n", __func__, +- ret, port->component->handle, port->handle, parameter_id); ++ pr_dbg_lvl(1, debug, "%s:result:%d component:0x%x port:%d parameter:%d\n", ++ __func__, ret, port->component->handle, port->handle, ++ parameter_id); + + release_msg: + vchiq_release_message(instance->service_handle, rmsg_handle); +@@ -1667,7 +1680,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance, + if (!dst) { + /* do not make new connection */ + ret = 0; +- pr_debug("not making new connection\n"); ++ pr_dbg_lvl(3, debug, "not making new connection\n"); + goto release_unlock; + } + +@@ -1685,14 +1698,14 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance, + /* set new format */ + ret = port_info_set(instance, dst); + if (ret) { +- pr_debug("setting port info failed\n"); ++ pr_dbg_lvl(1, debug, "setting port info failed\n"); + goto release_unlock; + } + + /* read what has actually been set */ + ret = port_info_get(instance, dst); + if (ret) { +- pr_debug("read back port info failed\n"); ++ pr_dbg_lvl(1, debug, "read back port info failed\n"); + goto release_unlock; + } + +@@ -1701,9 +1714,9 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance, + MMAL_MSG_PORT_ACTION_TYPE_CONNECT, + dst->component->handle, dst->handle); + if (ret < 0) { +- pr_debug("connecting port %d:%d to %d:%d failed\n", +- src->component->handle, src->handle, +- dst->component->handle, dst->handle); ++ pr_dbg_lvl(2, debug, "connecting port %d:%d to %d:%d failed\n", ++ src->component->handle, src->handle, ++ dst->component->handle, dst->handle); + goto release_unlock; + } + src->connected = dst; +@@ -1728,7 +1741,8 @@ int vchiq_mmal_submit_buffer(struct vchiq_mmal_instance *instance, + * videobuf2 won't let us have the dmabuf there. + */ + if (port->zero_copy && buffer->dma_buf && !buffer->vcsm_handle) { +- pr_debug("%s: import dmabuf %p\n", __func__, buffer->dma_buf); ++ pr_dbg_lvl(2, debug, "%s: import dmabuf %p\n", ++ __func__, buffer->dma_buf); + ret = vc_sm_cma_import_dmabuf(buffer->dma_buf, + &buffer->vcsm_handle); + if (ret) { +@@ -1744,8 +1758,8 @@ int vchiq_mmal_submit_buffer(struct vchiq_mmal_instance *instance, + vc_sm_cma_free(buffer->vcsm_handle); + return ret; + } +- pr_debug("%s: import dmabuf %p - got vc handle %08X\n", +- __func__, buffer->dma_buf, buffer->vc_handle); ++ pr_dbg_lvl(2, debug, "%s: import dmabuf %p - got vc handle %08X\n", ++ __func__, buffer->dma_buf, buffer->vc_handle); + } + + ret = buffer_from_host(instance, port, buffer); +@@ -1784,8 +1798,8 @@ int mmal_vchi_buffer_cleanup(struct mmal_buffer *buf) + if (buf->vcsm_handle) { + int ret; + +- pr_debug("%s: vc_sm_cma_free on handle %p\n", __func__, +- buf->vcsm_handle); ++ pr_dbg_lvl(2, debug, "%s: vc_sm_cma_free on handle %p\n", __func__, ++ buf->vcsm_handle); + ret = vc_sm_cma_free(buf->vcsm_handle); + if (ret) + pr_err("%s: vcsm_free failed, ret %d\n", __func__, ret); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 16 Sep 2021 16:46:58 +0100 +Subject: [PATCH 842/889] staging: bcm2835-codec: Queue flushed buffers instead + of completing + +When a buffer is returned on a port that is disabled, return it +to the videobuf2 QUEUED state instead of DONE which returns it +to the client. + +Signed-off-by: Dave Stevenson +--- + .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 6c6e0ba34a0b..03c9ccb35ee1 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -926,7 +926,9 @@ static void ip_buffer_cb(struct vchiq_mmal_instance *instance, + + v4l2_dbg(3, debug, &ctx->dev->v4l2_dev, "%s: no error. Return buffer %p\n", + __func__, &buf->m2m.vb.vb2_buf); +- vb2_buffer_done(&buf->m2m.vb.vb2_buf, VB2_BUF_STATE_DONE); ++ vb2_buffer_done(&buf->m2m.vb.vb2_buf, ++ port->enabled ? VB2_BUF_STATE_DONE : ++ VB2_BUF_STATE_QUEUED); + + ctx->num_ip_buffers++; + v4l2_dbg(2, debug, &ctx->dev->v4l2_dev, "%s: done %d input buffers\n", +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 21 Sep 2021 17:17:57 +0100 +Subject: [PATCH 843/889] staging: mmal-vchiq: Reset buffers_with_vpu on + port_enable + +Should we go through the timeout failure case with port_disable +not returning all buffers for whatever reason, the +buffers_with_vpu counter gets left at a non-zero value, which +will cause reference counting issues should the instance be +reused. + +Reset the count when the port is enabled again, but before +any buffers have been sent to the VPU. + +Signed-off-by: Dave Stevenson +--- + drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +index 12a670bcc535..a6cdc7dc9c30 100644 +--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c ++++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +@@ -1500,6 +1500,8 @@ static int port_enable(struct vchiq_mmal_instance *instance, + + port->enabled = 1; + ++ atomic_set(&port->buffers_with_vpu, 0); ++ + if (port->buffer_cb) { + /* send buffer headers to videocore */ + hdr_count = 1; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 22 Sep 2021 16:42:49 +0100 +Subject: [PATCH 844/889] staging: bcm2835_codec: Correct flushing code for + refcounting + +Completions don't reference count, so setting the completion +on the first buffer returned and then not reinitialising it +means that the flush function doesn't behave as intended. + +Signal the completion when the last buffer is returned. + +Signed-off-by: Dave Stevenson +--- + .../bcm2835-codec/bcm2835-v4l2-codec.c | 20 ++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 03c9ccb35ee1..1b8611549f4f 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -934,7 +934,7 @@ static void ip_buffer_cb(struct vchiq_mmal_instance *instance, + v4l2_dbg(2, debug, &ctx->dev->v4l2_dev, "%s: done %d input buffers\n", + __func__, ctx->num_ip_buffers); + +- if (!port->enabled) ++ if (!port->enabled && atomic_read(&port->buffers_with_vpu)) + complete(&ctx->frame_cmplt); + } + +@@ -1135,7 +1135,8 @@ static void op_buffer_cb(struct vchiq_mmal_instance *instance, + __func__, mmal_buf->mmal_flags); + if (!(mmal_buf->mmal_flags & MMAL_BUFFER_HEADER_FLAG_EOS)) { + vb2_buffer_done(&vb2->vb2_buf, VB2_BUF_STATE_QUEUED); +- if (!port->enabled) ++ if (!port->enabled && ++ atomic_read(&port->buffers_with_vpu)) + complete(&ctx->frame_cmplt); + return; + } +@@ -1178,7 +1179,7 @@ static void op_buffer_cb(struct vchiq_mmal_instance *instance, + v4l2_dbg(2, debug, &ctx->dev->v4l2_dev, "%s: done %d output buffers\n", + __func__, ctx->num_op_buffers); + +- if (!port->enabled) ++ if (!port->enabled && atomic_read(&port->buffers_with_vpu)) + complete(&ctx->frame_cmplt); + } + +@@ -1596,6 +1597,8 @@ static int vidioc_s_fmt(struct bcm2835_codec_ctx *ctx, struct v4l2_format *f, + return 0; + + if (port->enabled) { ++ unsigned int num_buffers; ++ + /* + * This should only ever happen with DECODE and the MMAL output + * port that has been enabled for resolution changed events. +@@ -1606,10 +1609,18 @@ static int vidioc_s_fmt(struct bcm2835_codec_ctx *ctx, struct v4l2_format *f, + f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE || + atomic_read(&port->buffers_with_vpu)); + ++ /* ++ * Disable will reread the port format, so retain buffer count. ++ */ ++ num_buffers = port->current_buffer.num; ++ + ret = vchiq_mmal_port_disable(ctx->dev->instance, port); + if (ret) + v4l2_err(&ctx->dev->v4l2_dev, "%s: Error disabling port update buffer count, ret %d\n", + __func__, ret); ++ ++ port->current_buffer.num = num_buffers; ++ + reenable_port = true; + } + +@@ -2787,7 +2798,7 @@ static void bcm2835_codec_flush_buffers(struct bcm2835_codec_ctx *ctx, + { + int ret; + +- while (atomic_read(&port->buffers_with_vpu)) { ++ if (atomic_read(&port->buffers_with_vpu)) { + v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: Waiting for buffers to be returned - %d outstanding\n", + __func__, atomic_read(&port->buffers_with_vpu)); + ret = wait_for_completion_timeout(&ctx->frame_cmplt, +@@ -2796,7 +2807,6 @@ static void bcm2835_codec_flush_buffers(struct bcm2835_codec_ctx *ctx, + v4l2_err(&ctx->dev->v4l2_dev, "%s: Timeout waiting for buffers to be returned - %d outstanding\n", + __func__, + atomic_read(&port->buffers_with_vpu)); +- break; + } + } + } +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 20 Sep 2021 15:00:51 +0100 +Subject: [PATCH 845/889] staging: bcm2835-codec: Ensure all ctrls are set on + streamon + +Currently the code was only setting some controls from +bcm2835_codec_set_ctrls, but it's simpler to use +v4l2_ctrl_handler_setup to avoid forgetting to adding new +controls to the list. + +Signed-off-by: Dave Stevenson +--- + .../bcm2835-codec/bcm2835-v4l2-codec.c | 51 +++++++------------ + 1 file changed, 19 insertions(+), 32 deletions(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 1b8611549f4f..f5eaff3e4612 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -2437,33 +2437,6 @@ static const struct v4l2_ioctl_ops bcm2835_codec_ioctl_ops = { + .vidioc_enum_framesizes = vidioc_enum_framesizes, + }; + +-static int bcm2835_codec_set_ctrls(struct bcm2835_codec_ctx *ctx) +-{ +- /* +- * Query the control handler for the value of the various controls and +- * set them. +- */ +- 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, +- }; +- int i; +- +- for (i = 0; i < ARRAY_SIZE(control_ids); i++) { +- struct v4l2_ctrl *ctrl; +- +- ctrl = v4l2_ctrl_find(&ctx->hdl, control_ids[i]); +- if (ctrl) +- bcm2835_codec_s_ctrl(ctrl); +- } +- +- return 0; +-} +- + static int bcm2835_codec_create_component(struct bcm2835_codec_ctx *ctx) + { + struct bcm2835_codec_dev *dev = ctx->dev; +@@ -2567,9 +2540,6 @@ static int bcm2835_codec_create_component(struct bcm2835_codec_ctx *ctx) + ctx->q_data[V4L2_M2M_SRC].sizeimage, + ctx->component->output[0].minimum_buffer.size); + +- /* Now we have a component we can set all the ctrls */ +- bcm2835_codec_set_ctrls(ctx); +- + /* Enable SPS Timing header so framerate information is encoded + * in the H264 header. + */ +@@ -2598,6 +2568,10 @@ static int bcm2835_codec_create_component(struct bcm2835_codec_ctx *ctx) + ctx->q_data[V4L2_M2M_DST].sizeimage, + ctx->component->output[0].minimum_buffer.size); + } ++ ++ /* Now we have a component we can set all the ctrls */ ++ ret = v4l2_ctrl_handler_setup(&ctx->hdl); ++ + v4l2_dbg(2, debug, &dev->v4l2_dev, "%s: component created as %s\n", + __func__, components[dev->role]); + +@@ -3099,7 +3073,9 @@ static int bcm2835_codec_open(struct file *file) + file->private_data = &ctx->fh; + ctx->dev = dev; + hdl = &ctx->hdl; +- if (dev->role == ENCODE) { ++ switch (dev->role) { ++ case ENCODE: ++ { + /* Encode controls */ + v4l2_ctrl_handler_init(hdl, 9); + +@@ -3158,7 +3134,10 @@ static int bcm2835_codec_open(struct file *file) + } + ctx->fh.ctrl_handler = hdl; + v4l2_ctrl_handler_setup(hdl); +- } else if (dev->role == DECODE) { ++ } ++ break; ++ case DECODE: ++ { + v4l2_ctrl_handler_init(hdl, 1); + + v4l2_ctrl_new_std(hdl, &bcm2835_codec_ctrl_ops, +@@ -3171,6 +3150,14 @@ static int bcm2835_codec_open(struct file *file) + ctx->fh.ctrl_handler = hdl; + v4l2_ctrl_handler_setup(hdl); + } ++ break; ++ case ISP: ++ case DEINTERLACE: ++ { ++ v4l2_ctrl_handler_init(hdl, 0); ++ } ++ break; ++ } + + ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(dev->m2m_dev, ctx, &queue_init); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 20 Sep 2021 14:37:17 +0100 +Subject: [PATCH 846/889] staging: bcm2835-codec: Add support for H&V Flips to + ISP + +The ISP can do H & V flips whilst resizing or converting +the image, so expose that via V4L2_CID_[H|V]FLIP. + +Signed-off-by: Dave Stevenson +--- + .../bcm2835-codec/bcm2835-v4l2-codec.c | 48 +++++++++++++++++++ + 1 file changed, 48 insertions(+) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index f5eaff3e4612..6078d6e2ace0 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -679,6 +679,9 @@ struct bcm2835_codec_ctx { + enum v4l2_xfer_func xfer_func; + enum v4l2_quantization quant; + ++ int hflip; ++ int vflip; ++ + /* Source and destination queue data */ + struct bcm2835_codec_q_data q_data[2]; + s32 bitrate; +@@ -2202,6 +2205,34 @@ static int bcm2835_codec_s_ctrl(struct v4l2_ctrl *ctrl) + sizeof(mmal_bool)); + break; + } ++ case V4L2_CID_HFLIP: ++ case V4L2_CID_VFLIP: { ++ u32 u32_value; ++ ++ if (ctrl->id == V4L2_CID_HFLIP) ++ ctx->hflip = ctrl->val; ++ else ++ ctx->vflip = ctrl->val; ++ ++ if (!ctx->component) ++ break; ++ ++ if (ctx->hflip && ctx->vflip) ++ u32_value = MMAL_PARAM_MIRROR_BOTH; ++ else if (ctx->hflip) ++ u32_value = MMAL_PARAM_MIRROR_HORIZONTAL; ++ else if (ctx->vflip) ++ u32_value = MMAL_PARAM_MIRROR_VERTICAL; ++ else ++ u32_value = MMAL_PARAM_MIRROR_NONE; ++ ++ ret = vchiq_mmal_port_parameter_set(ctx->dev->instance, ++ &ctx->component->input[0], ++ MMAL_PARAMETER_MIRROR, ++ &u32_value, ++ sizeof(u32_value)); ++ break; ++ } + + default: + v4l2_err(&ctx->dev->v4l2_dev, "Invalid control\n"); +@@ -3152,6 +3183,23 @@ static int bcm2835_codec_open(struct file *file) + } + break; + case ISP: ++ { ++ v4l2_ctrl_handler_init(hdl, 2); ++ ++ v4l2_ctrl_new_std(hdl, &bcm2835_codec_ctrl_ops, ++ V4L2_CID_HFLIP, ++ 1, 0, 1, 0); ++ v4l2_ctrl_new_std(hdl, &bcm2835_codec_ctrl_ops, ++ V4L2_CID_VFLIP, ++ 1, 0, 1, 0); ++ if (hdl->error) { ++ rc = hdl->error; ++ goto free_ctrl_handler; ++ } ++ ctx->fh.ctrl_handler = hdl; ++ v4l2_ctrl_handler_setup(hdl); ++ } ++ break; + case DEINTERLACE: + { + v4l2_ctrl_handler_init(hdl, 0); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Guennadi Liakhovetski +Date: Sun, 19 Sep 2021 13:30:43 +0200 +Subject: [PATCH 847/889] overlays: add support for the MLX90640 thermal camera + +This allows using the video-i2c camera driver with MLX90640 thermal +infrared sensors, connected to Raspberry Pi. CONFIG_VIDEO_V4L2_I2C +has to be selected to use the camera. + +Signed-off-by: Guennadi Liakhovetski +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 +++++ + .../boot/dts/overlays/mlx90640-overlay.dts | 22 +++++++++++++++++++ + 3 files changed, 29 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/mlx90640-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 44aedc149ff0..5dc1f892934e 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -129,6 +129,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + midi-uart5.dtbo \ + minipitft13.dtbo \ + miniuart-bt.dtbo \ ++ mlx90640.dtbo \ + mmc.dtbo \ + mpu6050.dtbo \ + mz61581.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index eb2c9adfb1a8..06d1dfdbf1cd 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -2152,6 +2152,12 @@ Params: krnbt Set to "on" to enable autoprobing of Bluetooth + driver without need of hciattach/btattach + + ++Name: mlx90640 ++Info: Overlay for i2c connected mlx90640 thermal camera ++Load: dtoverlay=mlx90640 ++Params: ++ ++ + Name: mmc + Info: Selects the bcm2835-mmc SD/MMC driver, optionally with overclock + Load: dtoverlay=mmc,= +diff --git a/arch/arm/boot/dts/overlays/mlx90640-overlay.dts b/arch/arm/boot/dts/overlays/mlx90640-overlay.dts +new file mode 100644 +index 000000000000..a2655ed82585 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/mlx90640-overlay.dts +@@ -0,0 +1,22 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835"; ++ ++ fragment@0 { ++ target = <&i2c_arm>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ clock-frequency = <400000>; ++ ++ mlx90640: mlx90640@33 { ++ compatible = "melexis,mlx90640"; ++ reg = <0x33>; ++ status = "okay"; ++ }; ++ }; ++ }; ++}; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: GabyPCgeeK +Date: Mon, 27 Sep 2021 04:43:21 -0400 +Subject: [PATCH 848/889] overlays: Add generic mcp2515 overlay + +Can configure mcp2515 on spi0/1/2 without the need for multiple overlays. +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 15 ++ + .../arm/boot/dts/overlays/mcp2515-overlay.dts | 156 ++++++++++++++++++ + 3 files changed, 172 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/mcp2515-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 5dc1f892934e..65e8b3f7c7e8 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -113,6 +113,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + mbed-dac.dtbo \ + mcp23017.dtbo \ + mcp23s17.dtbo \ ++ mcp2515.dtbo \ + mcp2515-can0.dtbo \ + mcp2515-can1.dtbo \ + mcp251xfd.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 06d1dfdbf1cd..cda354151d79 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -1977,6 +1977,21 @@ Params: s08-spi--present 4-bit integer, bitmap indicating MCP23S08 + or INTB output of MCP23S17 is connected. + + ++Name: mcp2515 ++Info: Configures the MCP2515 CAN controller on spi0/1/2 ++ 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=mcp2515,= ++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 ++ ++ + Name: mcp2515-can0 + Info: Configures the MCP2515 CAN controller on spi0.0 + Load: dtoverlay=mcp2515-can0,= +diff --git a/arch/arm/boot/dts/overlays/mcp2515-overlay.dts b/arch/arm/boot/dts/overlays/mcp2515-overlay.dts +new file mode 100644 +index 000000000000..cda1fb0b1199 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/mcp2515-overlay.dts +@@ -0,0 +1,156 @@ ++// 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__ { ++ mcp2515_pins: mcp2515_pins { ++ brcm,pins = <25>; ++ brcm,function = ; ++ }; ++ }; ++ }; ++ ++ fragment@9 { ++ target-path = "/clocks"; ++ __overlay__ { ++ clk_mcp2515_osc: mcp2515-osc { ++ #clock-cells = <0>; ++ compatible = "fixed-clock"; ++ clock-frequency = <16000000>; ++ }; ++ }; ++ }; ++ ++ mcp2515_frag: fragment@10 { ++ target = <&spi0>; ++ __overlay__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ mcp2515: mcp2515@0 { ++ compatible = "microchip,mcp2515"; ++ reg = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mcp2515_pins>; ++ spi-max-frequency = <10000000>; ++ interrupt-parent = <&gpio>; ++ interrupts = <25 IRQ_TYPE_LEVEL_LOW>; ++ clocks = <&clk_mcp2515_osc>; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ spi0-0 = <0>, "+0", ++ <&mcp2515_frag>, "target:0=", <&spi0>, ++ <&mcp2515>, "reg:0=0", ++ <&mcp2515_pins>, "name=mcp2515_spi0_0_pins", ++ <&clk_mcp2515_osc>, "name=mcp2515-spi0-0-osc"; ++ spi0-1 = <0>, "+1", ++ <&mcp2515_frag>, "target:0=", <&spi0>, ++ <&mcp2515>, "reg:0=1", ++ <&mcp2515_pins>, "name=mcp2515_spi0_1_pins", ++ <&clk_mcp2515_osc>, "name=mcp2515-spi0-1-osc"; ++ spi1-0 = <0>, "+2", ++ <&mcp2515_frag>, "target:0=", <&spi1>, ++ <&mcp2515>, "reg:0=0", ++ <&mcp2515_pins>, "name=mcp2515_spi1_0_pins", ++ <&clk_mcp2515_osc>, "name=mcp2515-spi1-0-osc"; ++ spi1-1 = <0>, "+3", ++ <&mcp2515_frag>, "target:0=", <&spi1>, ++ <&mcp2515>, "reg:0=1", ++ <&mcp2515_pins>, "name=mcp2515_spi1_1_pins", ++ <&clk_mcp2515_osc>, "name=mcp2515-spi1-1-osc"; ++ spi1-2 = <0>, "+4", ++ <&mcp2515_frag>, "target:0=", <&spi1>, ++ <&mcp2515>, "reg:0=2", ++ <&mcp2515_pins>, "name=mcp2515_spi1_2_pins", ++ <&clk_mcp2515_osc>, "name=mcp2515-spi1-2-osc"; ++ spi2-0 = <0>, "+5", ++ <&mcp2515_frag>, "target:0=", <&spi2>, ++ <&mcp2515>, "reg:0=0", ++ <&mcp2515_pins>, "name=mcp2515_spi2_0_pins", ++ <&clk_mcp2515_osc>, "name=mcp2515-spi2-0-osc"; ++ spi2-1 = <0>, "+6", ++ <&mcp2515_frag>, "target:0=", <&spi2>, ++ <&mcp2515>, "reg:0=1", ++ <&mcp2515_pins>, "name=mcp2515_spi2_1_pins", ++ <&clk_mcp2515_osc>, "name=mcp2515-spi2-1-osc"; ++ spi2-2 = <0>, "+7", ++ <&mcp2515_frag>, "target:0=", <&spi2>, ++ <&mcp2515>, "reg:0=2", ++ <&mcp2515_pins>, "name=mcp2515_spi2_2_pins", ++ <&clk_mcp2515_osc>, "name=mcp2515-spi2-2-osc"; ++ oscillator = <&clk_mcp2515_osc>, "clock-frequency:0"; ++ speed = <&mcp2515>, "spi-max-frequency:0"; ++ interrupt = <&mcp2515_pins>, "brcm,pins:0", ++ <&mcp2515>, "interrupts:0"; ++ }; ++}; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 21 Sep 2021 15:32:50 +0100 +Subject: [PATCH 849/889] regulator: rpi-panel: Remove get_brightness hook + +The driver was implementing a get_brightness function that +tried to read back the PWM setting of the display to report +as the current brightness. +The controller on the display does not support that, therefore +we end up reporting a brightness of 0, and that confuses +systemd's backlight service. + +Remove the hook so that the framework returns the current +brightness automatically. + +Signed-off-by: Dave Stevenson +--- + .../regulator/rpi-panel-attiny-regulator.c | 23 ------------------- + 1 file changed, 23 deletions(-) + +diff --git a/drivers/regulator/rpi-panel-attiny-regulator.c b/drivers/regulator/rpi-panel-attiny-regulator.c +index 998233f14085..8090b9a485b5 100644 +--- a/drivers/regulator/rpi-panel-attiny-regulator.c ++++ b/drivers/regulator/rpi-panel-attiny-regulator.c +@@ -207,31 +207,8 @@ static int attiny_update_status(struct backlight_device *bl) + return ret; + } + +-static int attiny_get_brightness(struct backlight_device *bl) +-{ +- struct attiny_lcd *state = bl_get_data(bl); +- struct regmap *regmap = state->regmap; +- int ret, brightness, i; +- +- mutex_lock(&state->lock); +- +- for (i = 0; i < 10; i++) { +- ret = regmap_read(regmap, REG_PWM, &brightness); +- if (!ret) +- break; +- } +- +- mutex_unlock(&state->lock); +- +- if (ret) +- return ret; +- +- return brightness; +-} +- + static const struct backlight_ops attiny_bl = { + .update_status = attiny_update_status, +- .get_brightness = attiny_get_brightness, + }; + + static int attiny_gpio_get_direction(struct gpio_chip *gc, unsigned int off) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: madimario +Date: Tue, 28 Sep 2021 04:20:06 -0400 +Subject: [PATCH 850/889] bcm2835_smi_dev: Fix handling of word-odd lengths + +The read and write functions did not use the correct pointer offset +when dealing with an odd number of bytes after a DMA transfer. Also, +only handle the remaining odd bytes if the DMA transfer completed +successfully. + +Submitted-by: @madimario (GitHub) +Signed-off-by: Phil Elwell +--- + drivers/char/broadcom/bcm2835_smi_dev.c | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +diff --git a/drivers/char/broadcom/bcm2835_smi_dev.c b/drivers/char/broadcom/bcm2835_smi_dev.c +index 9db8f1e3db0f..34976fa4ed59 100644 +--- a/drivers/char/broadcom/bcm2835_smi_dev.c ++++ b/drivers/char/broadcom/bcm2835_smi_dev.c +@@ -191,6 +191,7 @@ bcm2835_read_file(struct file *f, char __user *user_ptr, + size_t count, loff_t *offs) + { + int odd_bytes; ++ size_t count_check; + + dev_dbg(inst->dev, "User reading %zu bytes from SMI.", count); + /* We don't want to DMA a number of bytes % 4 != 0 (32 bit FIFO) */ +@@ -199,6 +200,7 @@ bcm2835_read_file(struct file *f, char __user *user_ptr, + else + odd_bytes = count; + count -= odd_bytes; ++ count_check = count; + if (count) { + struct bcm2835_smi_bounce_info *bounce; + +@@ -209,15 +211,16 @@ bcm2835_read_file(struct file *f, char __user *user_ptr, + count = dma_bounce_user(DMA_DEV_TO_MEM, user_ptr, + count, bounce); + } +- if (odd_bytes) { ++ if (odd_bytes && (count == count_check)) { + /* Read from FIFO directly if not using DMA */ + uint8_t buf[DMA_THRESHOLD_BYTES]; ++ unsigned long bytes_not_transferred; + + bcm2835_smi_read_buf(smi_inst, buf, odd_bytes); +- if (copy_to_user(user_ptr, buf, odd_bytes)) ++ bytes_not_transferred = copy_to_user(user_ptr + count, buf, odd_bytes); ++ if (bytes_not_transferred) + dev_err(inst->dev, "copy_to_user() failed."); +- count += odd_bytes; +- ++ count += odd_bytes - bytes_not_transferred; + } + return count; + } +@@ -227,6 +230,7 @@ bcm2835_write_file(struct file *f, const char __user *user_ptr, + size_t count, loff_t *offs) + { + int odd_bytes; ++ size_t count_check; + + dev_dbg(inst->dev, "User writing %zu bytes to SMI.", count); + if (count > DMA_THRESHOLD_BYTES) +@@ -234,6 +238,7 @@ bcm2835_write_file(struct file *f, const char __user *user_ptr, + else + odd_bytes = count; + count -= odd_bytes; ++ count_check = count; + if (count) { + struct bcm2835_smi_bounce_info *bounce; + +@@ -245,14 +250,16 @@ bcm2835_write_file(struct file *f, const char __user *user_ptr, + (char __user *)user_ptr, + count, bounce); + } +- if (odd_bytes) { ++ if (odd_bytes && (count == count_check)) { + uint8_t buf[DMA_THRESHOLD_BYTES]; ++ unsigned long bytes_not_transferred; + +- if (copy_from_user(buf, user_ptr, odd_bytes)) ++ bytes_not_transferred = copy_from_user(buf, user_ptr + count, odd_bytes); ++ if (bytes_not_transferred) + dev_err(inst->dev, "copy_from_user() failed."); + else + bcm2835_smi_write_buf(smi_inst, buf, odd_bytes); +- count += odd_bytes; ++ count += odd_bytes - bytes_not_transferred; + } + return count; + } +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dom Cobley +Date: Fri, 17 Sep 2021 19:08:27 +0100 +Subject: [PATCH 851/889] Revert "raspberrypi-firmware: Export the general + transaction function." + +This reverts commit 121592a1f507d2b5900db5f7c6510b532563dc09. +--- + drivers/firmware/raspberrypi.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c +index 45511deddf6c..849e63bb426d 100644 +--- a/drivers/firmware/raspberrypi.c ++++ b/drivers/firmware/raspberrypi.c +@@ -48,7 +48,7 @@ static void response_callback(struct mbox_client *cl, void *msg) + * Sends a request to the firmware through the BCM2835 mailbox driver, + * and synchronously waits for the reply. + */ +-int ++static int + rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + { + u32 message = MBOX_MSG(chan, data); +@@ -73,7 +73,6 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + + return ret; + } +-EXPORT_SYMBOL_GPL(rpi_firmware_transaction); + + /** + * rpi_firmware_property_list - Submit firmware property list +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dom Cobley +Date: Fri, 17 Sep 2021 19:10:29 +0100 +Subject: [PATCH 852/889] Revert "firmware: Updated mailbox header" + +This reverts commit 02038a75fb5ae9e0b8dac3de3f30f37ea613201e. +--- + include/soc/bcm2835/raspberrypi-firmware.h | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h +index 0235624456a1..b2c462446cf7 100644 +--- a/include/soc/bcm2835/raspberrypi-firmware.h ++++ b/include/soc/bcm2835/raspberrypi-firmware.h +@@ -9,8 +9,6 @@ + #include + #include + +-#define RPI_FIRMWARE_CHAN_FB 1 +- + struct rpi_firmware; + + enum rpi_firmware_property_status { +@@ -190,6 +188,5 @@ static inline struct rpi_firmware *rpi_firmware_get(struct device_node *firmware + return NULL; + } + #endif +-int rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data); + + #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 8 Sep 2021 21:12:26 +0200 +Subject: [PATCH 853/889] drm/vc4: Fix out of order frames during asynchronous + page flips + +When doing an asynchronous page flip (PAGE_FLIP ioctl with the +DRM_MODE_PAGE_FLIP_ASYNC flag set), the current code waits for the +possible GPU buffer being rendered through a call to +vc4_queue_seqno_cb(). + +On the BCM2835-37, the GPU driver is part of the vc4 driver and that +function is defined in vc4_gem.c to wait for the buffer to be rendered, +and once it's done, call a callback. + +However, on the BCM2711 used on the RaspberryPi4, the GPU driver is +separate (v3d) and that function won't do anything. This was working +because we were going into a path, due to uninitialized variables, that +was always scheduling the callback. + +However, we were never actually waiting for the buffer to be rendered +which was resulting in frames being displayed out of order. + +The generic API to signal those kind of completion in the kernel are the +DMA fences, and fortunately the v3d drivers supports them and signal +when its job is done. That API also provides an equivalent function that +allows to have a callback being executed when the fence is signalled as +done. + +Let's change our driver a bit to rely on the previous function for the +older SoCs, and on DMA fences for the BCM2711. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 37 ++++++++++++++++++++++++++++++++-- + 1 file changed, 35 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 6ac60e187015..59e10c37b740 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -769,6 +769,7 @@ struct vc4_async_flip_state { + struct drm_pending_vblank_event *event; + + struct vc4_seqno_cb cb; ++ struct dma_fence_cb fence_cb; + }; + + /* Called when the V3D execution for the BO being flipped to is done, so that +@@ -817,6 +818,39 @@ vc4_async_page_flip_complete(struct vc4_seqno_cb *cb) + up(&vc4->async_modeset); + } + ++static void vc4_async_page_flip_fence_complete(struct dma_fence *fence, ++ struct dma_fence_cb *cb) ++{ ++ struct vc4_async_flip_state *flip_state = ++ container_of(cb, struct vc4_async_flip_state, fence_cb); ++ ++ vc4_async_page_flip_complete(&flip_state->cb); ++ dma_fence_put(fence); ++} ++ ++static int vc4_async_set_fence_cb(struct drm_device *dev, ++ struct vc4_async_flip_state *flip_state) ++{ ++ struct drm_framebuffer *fb = flip_state->fb; ++ struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0); ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ struct dma_fence *fence; ++ ++ if (!vc4->hvs->hvs5) { ++ struct vc4_bo *bo = to_vc4_bo(&cma_bo->base); ++ ++ return vc4_queue_seqno_cb(dev, &flip_state->cb, bo->seqno, ++ vc4_async_page_flip_complete); ++ } ++ ++ fence = dma_fence_get(dma_resv_get_excl(cma_bo->base.resv)); ++ if (dma_fence_add_callback(fence, &flip_state->fence_cb, ++ vc4_async_page_flip_fence_complete)) ++ vc4_async_page_flip_fence_complete(fence, &flip_state->fence_cb); ++ ++ return 0; ++} ++ + /* Implements async (non-vblank-synced) page flips. + * + * The page flip ioctl needs to return immediately, so we grab the +@@ -887,8 +921,7 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, + */ + drm_atomic_set_fb_for_plane(plane->state, fb); + +- vc4_queue_seqno_cb(dev, &flip_state->cb, bo->seqno, +- vc4_async_page_flip_complete); ++ vc4_async_set_fence_cb(dev, flip_state); + + /* Driver takes ownership of state on successful async commit. */ + return 0; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Juerg Haefliger +Date: Tue, 28 Sep 2021 16:56:19 +0200 +Subject: [PATCH 854/889] drm/vc4: hdmi: Fix bvb clock enable error checking + +Check for errors only if we actually tried to enable the bvb clock. + +Fixes: 01a6d727b407 ("vc4/drm: hdmi: Handle case when bvb clock is null") +Signed-off-by: Juerg Haefliger +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 2a068ba7c83f..f1adaa9dc5f3 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -958,11 +958,12 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, + else + bvb_rate = 75000000; + +- if (vc4_hdmi->pixel_bvb_clock) ++ if (vc4_hdmi->pixel_bvb_clock) { + vc4_hdmi->bvb_req = clk_request_start(vc4_hdmi->pixel_bvb_clock, bvb_rate); +- if (IS_ERR(vc4_hdmi->bvb_req)) { +- DRM_ERROR("Failed to set pixel bvb clock rate: %ld\n", PTR_ERR(vc4_hdmi->bvb_req)); +- goto err_remove_hsm_req; ++ if (IS_ERR(vc4_hdmi->bvb_req)) { ++ DRM_ERROR("Failed to set pixel bvb clock rate: %ld\n", PTR_ERR(vc4_hdmi->bvb_req)); ++ goto err_remove_hsm_req; ++ } + } + + ret = clk_prepare_enable(vc4_hdmi->pixel_bvb_clock); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Juerg Haefliger +Date: Wed, 29 Sep 2021 11:39:46 +0200 +Subject: [PATCH 855/889] Revert "mmc: sdhci-iproc: Fix vmmc regulators on + iProc" + +This reverts commit aed19399a01733dbad9be8bf026a4f7dd823b04f. + +Commit 6c92ae1e452f ("mmc: sdhci: Introduce sdhci_set_power_and_bus_voltage()") +introduced a generic helper that does the same thing so use that instead in +the following commit. + +Signed-off-by: Juerg Haefliger +--- + drivers/mmc/host/sdhci-iproc.c | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c +index 7658898cf39b..b9eb2ec61a83 100644 +--- a/drivers/mmc/host/sdhci-iproc.c ++++ b/drivers/mmc/host/sdhci-iproc.c +@@ -173,17 +173,6 @@ static unsigned int sdhci_iproc_get_max_clock(struct sdhci_host *host) + return pltfm_host->clock; + } + +-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); +-} +- + /* + * There is a known bug on BCM2711's SDHCI core integration where the + * controller will hang when the difference between the core clock and the bus +@@ -218,7 +207,6 @@ static const struct sdhci_ops sdhci_iproc_32only_ops = { + .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, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Juerg Haefliger +Date: Wed, 29 Sep 2021 11:42:23 +0200 +Subject: [PATCH 856/889] mmc: sdhci-iproc: Fix vmmc regulators (pre-bcm2711) + +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. + +Signed-off-by: Juerg Haefliger +Signed-off-by: Phil Elwell +--- + drivers/mmc/host/sdhci-iproc.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c +index b9eb2ec61a83..404870e6b759 100644 +--- a/drivers/mmc/host/sdhci-iproc.c ++++ b/drivers/mmc/host/sdhci-iproc.c +@@ -207,6 +207,7 @@ static const struct sdhci_ops sdhci_iproc_32only_ops = { + .write_b = sdhci_iproc_writeb, + .set_clock = sdhci_set_clock, + .get_max_clock = sdhci_iproc_get_max_clock, ++ .set_power = sdhci_set_power_and_bus_voltage, + .set_bus_width = sdhci_set_bus_width, + .reset = sdhci_reset, + .set_uhs_signaling = sdhci_set_uhs_signaling, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lee Jackson +Date: Fri, 27 Aug 2021 14:36:55 +0800 +Subject: [PATCH 857/889] media: dt-bindings: media: i2c: Add IMX519 CMOS + sensor binding Add YAML device tree binding for IMX519 CMOS image sensor, and + the relevant MAINTAINERS entries. + +Signed-off-by: Lee Jackson +--- + .../devicetree/bindings/media/i2c/imx519.yaml | 113 ++++++++++++++++++ + MAINTAINERS | 8 ++ + 2 files changed, 121 insertions(+) + create mode 100644 Documentation/devicetree/bindings/media/i2c/imx519.yaml + +diff --git a/Documentation/devicetree/bindings/media/i2c/imx519.yaml b/Documentation/devicetree/bindings/media/i2c/imx519.yaml +new file mode 100644 +index 000000000000..717230a21764 +--- /dev/null ++++ b/Documentation/devicetree/bindings/media/i2c/imx519.yaml +@@ -0,0 +1,113 @@ ++# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) ++%YAML 1.2 ++--- ++$id: http://devicetree.org/schemas/media/i2c/imx519.yaml# ++$schema: http://devicetree.org/meta-schemas/core.yaml# ++ ++title: Sony 1/2.5-Inch 16Mpixel CMOS Digital Image Sensor ++ ++maintainers: ++ - Lee Jackson ++ ++description: |- ++ The Sony IMX519 is a 1/2.5-inch CMOS active pixel digital image sensor ++ with an active array size of 4656H x 3496V. It is programmable through ++ I2C interface. The I2C address is fixed to 0x1A as per sensor data sheet. ++ Image data is sent through MIPI CSI-2, which is configured as either 2 or ++ 4 data lanes. ++ ++properties: ++ compatible: ++ const: sony,imx519 ++ ++ reg: ++ description: I2C device address ++ maxItems: 1 ++ ++ clocks: ++ maxItems: 1 ++ ++ VDIG-supply: ++ description: ++ Digital I/O voltage supply, 1.05 volts ++ ++ VANA-supply: ++ description: ++ Analog voltage supply, 2.8 volts ++ ++ VDDL-supply: ++ description: ++ Digital core voltage supply, 1.8 volts ++ ++ reset-gpios: ++ description: |- ++ Reference to the GPIO connected to the xclr pin, if any. ++ Must be released (set high) after all supplies and INCK are applied. ++ ++ # See ../video-interfaces.txt for more details ++ port: ++ type: object ++ properties: ++ endpoint: ++ type: object ++ properties: ++ data-lanes: ++ description: |- ++ The sensor supports either two-lane, or four-lane operation. ++ For two-lane operation the property must be set to <1 2>. ++ items: ++ - const: 1 ++ - const: 2 ++ ++ clock-noncontinuous: ++ type: boolean ++ description: |- ++ MIPI CSI-2 clock is non-continuous if this property is present, ++ otherwise it's continuous. ++ ++ link-frequencies: ++ allOf: ++ - $ref: /schemas/types.yaml#/definitions/uint64-array ++ description: ++ Allowed data bus frequencies. ++ ++ required: ++ - link-frequencies ++ ++required: ++ - compatible ++ - reg ++ - clocks ++ - VANA-supply ++ - VDIG-supply ++ - VDDL-supply ++ - port ++ ++additionalProperties: false ++ ++examples: ++ - | ++ i2c0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ imx519: sensor@1a { ++ compatible = "sony,imx519"; ++ reg = <0x1a>; ++ clocks = <&imx519_clk>; ++ VANA-supply = <&imx519_vana>; /* 2.8v */ ++ VDIG-supply = <&imx519_vdig>; /* 1.05v */ ++ VDDL-supply = <&imx519_vddl>; /* 1.8v */ ++ ++ port { ++ imx519_0: endpoint { ++ remote-endpoint = <&csi1_ep>; ++ data-lanes = <1 2>; ++ clock-noncontinuous; ++ link-frequencies = /bits/ 64 <493500000>; ++ }; ++ }; ++ }; ++ }; ++ ++... +diff --git a/MAINTAINERS b/MAINTAINERS +index 5917adffd4b2..f891ab0af53f 100644 +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -16372,6 +16372,14 @@ F: Documentation/devicetree/bindings/media/i2c/imx378.yaml + F: Documentation/devicetree/bindings/media/i2c/imx477.yaml + F: drivers/media/i2c/imx477.c + ++SONY IMX519 SENSOR DRIVER ++M: Arducam Kernel Maintenance ++L: linux-media@vger.kernel.org ++S: Maintained ++T: git git://linuxtv.org/media_tree.git ++F: Documentation/devicetree/bindings/media/i2c/imx519.yaml ++F: drivers/media/i2c/imx519.c ++ + SONY MEMORYSTICK SUBSYSTEM + M: Maxim Levitsky + M: Alex Dubov +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lee Jackson +Date: Fri, 27 Aug 2021 13:48:52 +0800 +Subject: [PATCH 858/889] media: i2c: Add driver for IMX519 sensor Adds a + driver for the 16MPix IMX519 CSI2 sensor. Whilst the sensor supports 2 or 4 + CSI2 data lanes, this driver currently only supports 2 lanes. + +The following Bayer modes are currently available: + +4656x3496 10-bit @ 10fps +3840x2160 10-bit (cropped) @ 21fps +2328x1748 10-bit (binned) @ 30fps +1920x1080 10-bit (cropped/binned) @ 60fps +1280x720 10-bit (cropped/binned) @ 120fps + +Signed-off-by: Lee Jackson +--- + drivers/media/i2c/Kconfig | 11 + + drivers/media/i2c/Makefile | 1 + + drivers/media/i2c/imx519.c | 2023 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 2035 insertions(+) + create mode 100644 drivers/media/i2c/imx519.c + +diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig +index 6ce7fd0c4cc2..4c97729be222 100644 +--- a/drivers/media/i2c/Kconfig ++++ b/drivers/media/i2c/Kconfig +@@ -836,6 +836,17 @@ config VIDEO_IMX355 + To compile this driver as a module, choose M here: the + module will be called imx355. + ++config VIDEO_IMX519 ++ tristate "Arducam IMX519 sensor support" ++ depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API ++ depends on MEDIA_CAMERA_SUPPORT ++ help ++ This is a Video4Linux2 sensor driver for the Arducam ++ IMX519 camera. ++ ++ To compile this driver as a module, choose M here: the ++ module will be called IMX519. ++ + config VIDEO_OV2640 + tristate "OmniVision OV2640 sensor support" + depends on VIDEO_V4L2 && I2C +diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile +index 6a00378cb351..944aea27f362 100644 +--- a/drivers/media/i2c/Makefile ++++ b/drivers/media/i2c/Makefile +@@ -122,6 +122,7 @@ obj-$(CONFIG_VIDEO_IMX290) += imx290.o + obj-$(CONFIG_VIDEO_IMX477) += imx477.o + obj-$(CONFIG_VIDEO_IMX319) += imx319.o + obj-$(CONFIG_VIDEO_IMX355) += imx355.o ++obj-$(CONFIG_VIDEO_IMX519) += imx519.o + obj-$(CONFIG_VIDEO_MAX9286) += max9286.o + rdacm20-camera_module-objs := rdacm20.o max9271.o + obj-$(CONFIG_VIDEO_RDACM20) += rdacm20-camera_module.o +diff --git a/drivers/media/i2c/imx519.c b/drivers/media/i2c/imx519.c +new file mode 100644 +index 000000000000..d541f231a4f3 +--- /dev/null ++++ b/drivers/media/i2c/imx519.c +@@ -0,0 +1,2023 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * A V4L2 driver for Sony IMX519 cameras. ++ * Copyright (C) 2021 Arducam Technology co., Ltd. ++ * ++ * Based on Sony IMX477 camera driver ++ * Copyright (C) 2020 Raspberry Pi (Trading) Ltd ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define IMX519_REG_VALUE_08BIT 1 ++#define IMX519_REG_VALUE_16BIT 2 ++ ++/* Chip ID */ ++#define IMX519_REG_CHIP_ID 0x0016 ++#define IMX519_CHIP_ID 0x0519 ++ ++#define IMX519_REG_MODE_SELECT 0x0100 ++#define IMX519_MODE_STANDBY 0x00 ++#define IMX519_MODE_STREAMING 0x01 ++ ++#define IMX519_REG_ORIENTATION 0x101 ++ ++#define IMX519_XCLK_FREQ 24000000 ++ ++#define IMX519_DEFAULT_LINK_FREQ 493500000 ++ ++/* Pixel rate is fixed at 686MHz for all the modes */ ++#define IMX519_PIXEL_RATE 686000000 ++ ++/* V_TIMING internal */ ++#define IMX519_REG_FRAME_LENGTH 0x0340 ++#define IMX519_FRAME_LENGTH_MAX 0xffdc ++ ++/* Long exposure multiplier */ ++#define IMX519_LONG_EXP_SHIFT_MAX 7 ++#define IMX519_LONG_EXP_SHIFT_REG 0x3100 ++ ++/* Exposure control */ ++#define IMX519_REG_EXPOSURE 0x0202 ++#define IMX519_EXPOSURE_OFFSET 32 ++#define IMX519_EXPOSURE_MIN 1 ++#define IMX519_EXPOSURE_STEP 1 ++#define IMX519_EXPOSURE_DEFAULT 0x3e8 ++#define IMX519_EXPOSURE_MAX (IMX519_FRAME_LENGTH_MAX - \ ++ IMX519_EXPOSURE_OFFSET) ++ ++/* Analog gain control */ ++#define IMX519_REG_ANALOG_GAIN 0x0204 ++#define IMX519_ANA_GAIN_MIN 0 ++#define IMX519_ANA_GAIN_MAX 960 ++#define IMX519_ANA_GAIN_STEP 1 ++#define IMX519_ANA_GAIN_DEFAULT 0x0 ++ ++/* Digital gain control */ ++#define IMX519_REG_DIGITAL_GAIN 0x020e ++#define IMX519_DGTL_GAIN_MIN 0x0100 ++#define IMX519_DGTL_GAIN_MAX 0xffff ++#define IMX519_DGTL_GAIN_DEFAULT 0x0100 ++#define IMX519_DGTL_GAIN_STEP 1 ++ ++/* Test Pattern Control */ ++#define IMX519_REG_TEST_PATTERN 0x0600 ++#define IMX519_TEST_PATTERN_DISABLE 0 ++#define IMX519_TEST_PATTERN_SOLID_COLOR 1 ++#define IMX519_TEST_PATTERN_COLOR_BARS 2 ++#define IMX519_TEST_PATTERN_GREY_COLOR 3 ++#define IMX519_TEST_PATTERN_PN9 4 ++ ++/* Test pattern colour components */ ++#define IMX519_REG_TEST_PATTERN_R 0x0602 ++#define IMX519_REG_TEST_PATTERN_GR 0x0604 ++#define IMX519_REG_TEST_PATTERN_B 0x0606 ++#define IMX519_REG_TEST_PATTERN_GB 0x0608 ++#define IMX519_TEST_PATTERN_COLOUR_MIN 0 ++#define IMX519_TEST_PATTERN_COLOUR_MAX 0x0fff ++#define IMX519_TEST_PATTERN_COLOUR_STEP 1 ++#define IMX519_TEST_PATTERN_R_DEFAULT IMX519_TEST_PATTERN_COLOUR_MAX ++#define IMX519_TEST_PATTERN_GR_DEFAULT 0 ++#define IMX519_TEST_PATTERN_B_DEFAULT 0 ++#define IMX519_TEST_PATTERN_GB_DEFAULT 0 ++ ++/* IMX519 native and active pixel array size. */ ++#define IMX519_NATIVE_WIDTH 4672U ++#define IMX519_NATIVE_HEIGHT 3648U ++#define IMX519_PIXEL_ARRAY_LEFT 8U ++#define IMX519_PIXEL_ARRAY_TOP 48U ++#define IMX519_PIXEL_ARRAY_WIDTH 4656U ++#define IMX519_PIXEL_ARRAY_HEIGHT 3496U ++ ++struct imx519_reg { ++ u16 address; ++ u8 val; ++}; ++ ++struct imx519_reg_list { ++ unsigned int num_of_regs; ++ const struct imx519_reg *regs; ++}; ++ ++/* Mode : resolution and related config&values */ ++struct imx519_mode { ++ /* Frame width */ ++ unsigned int width; ++ ++ /* Frame height */ ++ unsigned int height; ++ ++ /* H-timing in pixels */ ++ unsigned int line_length_pix; ++ ++ /* Analog crop rectangle. */ ++ struct v4l2_rect crop; ++ ++ /* Highest possible framerate. */ ++ struct v4l2_fract timeperframe_min; ++ ++ /* Default framerate. */ ++ struct v4l2_fract timeperframe_default; ++ ++ /* Default register values */ ++ struct imx519_reg_list reg_list; ++}; ++ ++static const struct imx519_reg mode_common_regs[] = { ++ {0x0136, 0x18}, ++ {0x0137, 0x00}, ++ {0x3c7e, 0x01}, ++ {0x3c7f, 0x07}, ++ {0x3020, 0x00}, ++ {0x3e35, 0x01}, ++ {0x3f7f, 0x01}, ++ {0x5609, 0x57}, ++ {0x5613, 0x51}, ++ {0x561f, 0x5e}, ++ {0x5623, 0xd2}, ++ {0x5637, 0x11}, ++ {0x5657, 0x11}, ++ {0x5659, 0x12}, ++ {0x5733, 0x60}, ++ {0x5905, 0x57}, ++ {0x590f, 0x51}, ++ {0x591b, 0x5e}, ++ {0x591f, 0xd2}, ++ {0x5933, 0x11}, ++ {0x5953, 0x11}, ++ {0x5955, 0x12}, ++ {0x5a2f, 0x60}, ++ {0x5a85, 0x57}, ++ {0x5a8f, 0x51}, ++ {0x5a9b, 0x5e}, ++ {0x5a9f, 0xd2}, ++ {0x5ab3, 0x11}, ++ {0x5ad3, 0x11}, ++ {0x5ad5, 0x12}, ++ {0x5baf, 0x60}, ++ {0x5c15, 0x2a}, ++ {0x5c17, 0x80}, ++ {0x5c19, 0x31}, ++ {0x5c1b, 0x87}, ++ {0x5c25, 0x25}, ++ {0x5c27, 0x7b}, ++ {0x5c29, 0x2a}, ++ {0x5c2b, 0x80}, ++ {0x5c2d, 0x31}, ++ {0x5c2f, 0x87}, ++ {0x5c35, 0x2b}, ++ {0x5c37, 0x81}, ++ {0x5c39, 0x31}, ++ {0x5c3b, 0x87}, ++ {0x5c45, 0x25}, ++ {0x5c47, 0x7b}, ++ {0x5c49, 0x2a}, ++ {0x5c4b, 0x80}, ++ {0x5c4d, 0x31}, ++ {0x5c4f, 0x87}, ++ {0x5c55, 0x2d}, ++ {0x5c57, 0x83}, ++ {0x5c59, 0x32}, ++ {0x5c5b, 0x88}, ++ {0x5c65, 0x29}, ++ {0x5c67, 0x7f}, ++ {0x5c69, 0x2e}, ++ {0x5c6b, 0x84}, ++ {0x5c6d, 0x32}, ++ {0x5c6f, 0x88}, ++ {0x5e69, 0x04}, ++ {0x5e9d, 0x00}, ++ {0x5f18, 0x10}, ++ {0x5f1a, 0x0e}, ++ {0x5f20, 0x12}, ++ {0x5f22, 0x10}, ++ {0x5f24, 0x0e}, ++ {0x5f28, 0x10}, ++ {0x5f2a, 0x0e}, ++ {0x5f30, 0x12}, ++ {0x5f32, 0x10}, ++ {0x5f34, 0x0e}, ++ {0x5f38, 0x0f}, ++ {0x5f39, 0x0d}, ++ {0x5f3c, 0x11}, ++ {0x5f3d, 0x0f}, ++ {0x5f3e, 0x0d}, ++ {0x5f61, 0x07}, ++ {0x5f64, 0x05}, ++ {0x5f67, 0x03}, ++ {0x5f6a, 0x03}, ++ {0x5f6d, 0x07}, ++ {0x5f70, 0x07}, ++ {0x5f73, 0x05}, ++ {0x5f76, 0x02}, ++ {0x5f79, 0x07}, ++ {0x5f7c, 0x07}, ++ {0x5f7f, 0x07}, ++ {0x5f82, 0x07}, ++ {0x5f85, 0x03}, ++ {0x5f88, 0x02}, ++ {0x5f8b, 0x01}, ++ {0x5f8e, 0x01}, ++ {0x5f91, 0x04}, ++ {0x5f94, 0x05}, ++ {0x5f97, 0x02}, ++ {0x5f9d, 0x07}, ++ {0x5fa0, 0x07}, ++ {0x5fa3, 0x07}, ++ {0x5fa6, 0x07}, ++ {0x5fa9, 0x03}, ++ {0x5fac, 0x01}, ++ {0x5faf, 0x01}, ++ {0x5fb5, 0x03}, ++ {0x5fb8, 0x02}, ++ {0x5fbb, 0x01}, ++ {0x5fc1, 0x07}, ++ {0x5fc4, 0x07}, ++ {0x5fc7, 0x07}, ++ {0x5fd1, 0x00}, ++ {0x6302, 0x79}, ++ {0x6305, 0x78}, ++ {0x6306, 0xa5}, ++ {0x6308, 0x03}, ++ {0x6309, 0x20}, ++ {0x630b, 0x0a}, ++ {0x630d, 0x48}, ++ {0x630f, 0x06}, ++ {0x6311, 0xa4}, ++ {0x6313, 0x03}, ++ {0x6314, 0x20}, ++ {0x6316, 0x0a}, ++ {0x6317, 0x31}, ++ {0x6318, 0x4a}, ++ {0x631a, 0x06}, ++ {0x631b, 0x40}, ++ {0x631c, 0xa4}, ++ {0x631e, 0x03}, ++ {0x631f, 0x20}, ++ {0x6321, 0x0a}, ++ {0x6323, 0x4a}, ++ {0x6328, 0x80}, ++ {0x6329, 0x01}, ++ {0x632a, 0x30}, ++ {0x632b, 0x02}, ++ {0x632c, 0x20}, ++ {0x632d, 0x02}, ++ {0x632e, 0x30}, ++ {0x6330, 0x60}, ++ {0x6332, 0x90}, ++ {0x6333, 0x01}, ++ {0x6334, 0x30}, ++ {0x6335, 0x02}, ++ {0x6336, 0x20}, ++ {0x6338, 0x80}, ++ {0x633a, 0xa0}, ++ {0x633b, 0x01}, ++ {0x633c, 0x60}, ++ {0x633d, 0x02}, ++ {0x633e, 0x60}, ++ {0x633f, 0x01}, ++ {0x6340, 0x30}, ++ {0x6341, 0x02}, ++ {0x6342, 0x20}, ++ {0x6343, 0x03}, ++ {0x6344, 0x80}, ++ {0x6345, 0x03}, ++ {0x6346, 0x90}, ++ {0x6348, 0xf0}, ++ {0x6349, 0x01}, ++ {0x634a, 0x20}, ++ {0x634b, 0x02}, ++ {0x634c, 0x10}, ++ {0x634d, 0x03}, ++ {0x634e, 0x60}, ++ {0x6350, 0xa0}, ++ {0x6351, 0x01}, ++ {0x6352, 0x60}, ++ {0x6353, 0x02}, ++ {0x6354, 0x50}, ++ {0x6355, 0x02}, ++ {0x6356, 0x60}, ++ {0x6357, 0x01}, ++ {0x6358, 0x30}, ++ {0x6359, 0x02}, ++ {0x635a, 0x30}, ++ {0x635b, 0x03}, ++ {0x635c, 0x90}, ++ {0x635f, 0x01}, ++ {0x6360, 0x10}, ++ {0x6361, 0x01}, ++ {0x6362, 0x40}, ++ {0x6363, 0x02}, ++ {0x6364, 0x50}, ++ {0x6368, 0x70}, ++ {0x636a, 0xa0}, ++ {0x636b, 0x01}, ++ {0x636c, 0x50}, ++ {0x637d, 0xe4}, ++ {0x637e, 0xb4}, ++ {0x638c, 0x8e}, ++ {0x638d, 0x38}, ++ {0x638e, 0xe3}, ++ {0x638f, 0x4c}, ++ {0x6390, 0x30}, ++ {0x6391, 0xc3}, ++ {0x6392, 0xae}, ++ {0x6393, 0xba}, ++ {0x6394, 0xeb}, ++ {0x6395, 0x6e}, ++ {0x6396, 0x34}, ++ {0x6397, 0xe3}, ++ {0x6398, 0xcf}, ++ {0x6399, 0x3c}, ++ {0x639a, 0xf3}, ++ {0x639b, 0x0c}, ++ {0x639c, 0x30}, ++ {0x639d, 0xc1}, ++ {0x63b9, 0xa3}, ++ {0x63ba, 0xfe}, ++ {0x7600, 0x01}, ++ {0x79a0, 0x01}, ++ {0x79a1, 0x01}, ++ {0x79a2, 0x01}, ++ {0x79a3, 0x01}, ++ {0x79a4, 0x01}, ++ {0x79a5, 0x20}, ++ {0x79a9, 0x00}, ++ {0x79aa, 0x01}, ++ {0x79ad, 0x00}, ++ {0x79af, 0x00}, ++ {0x8173, 0x01}, ++ {0x835c, 0x01}, ++ {0x8a74, 0x01}, ++ {0x8c1f, 0x00}, ++ {0x8c27, 0x00}, ++ {0x8c3b, 0x03}, ++ {0x9004, 0x0b}, ++ {0x920c, 0x6a}, ++ {0x920d, 0x22}, ++ {0x920e, 0x6a}, ++ {0x920f, 0x23}, ++ {0x9214, 0x6a}, ++ {0x9215, 0x20}, ++ {0x9216, 0x6a}, ++ {0x9217, 0x21}, ++ {0x9385, 0x3e}, ++ {0x9387, 0x1b}, ++ {0x938d, 0x4d}, ++ {0x938f, 0x43}, ++ {0x9391, 0x1b}, ++ {0x9395, 0x4d}, ++ {0x9397, 0x43}, ++ {0x9399, 0x1b}, ++ {0x939d, 0x3e}, ++ {0x939f, 0x2f}, ++ {0x93a5, 0x43}, ++ {0x93a7, 0x2f}, ++ {0x93a9, 0x2f}, ++ {0x93ad, 0x34}, ++ {0x93af, 0x2f}, ++ {0x93b5, 0x3e}, ++ {0x93b7, 0x2f}, ++ {0x93bd, 0x4d}, ++ {0x93bf, 0x43}, ++ {0x93c1, 0x2f}, ++ {0x93c5, 0x4d}, ++ {0x93c7, 0x43}, ++ {0x93c9, 0x2f}, ++ {0x974b, 0x02}, ++ {0x995c, 0x8c}, ++ {0x995d, 0x00}, ++ {0x995e, 0x00}, ++ {0x9963, 0x64}, ++ {0x9964, 0x50}, ++ {0xaa0a, 0x26}, ++ {0xae03, 0x04}, ++ {0xae04, 0x03}, ++ {0xae05, 0x03}, ++ {0xbc1c, 0x08}, ++ {0xbcf1, 0x02}, ++}; ++ ++/* 16 mpix 10fps */ ++static const struct imx519_reg mode_4656x3496_regs[] = { ++ {0x0111, 0x02}, ++ {0x0112, 0x0a}, ++ {0x0113, 0x0a}, ++ {0x0114, 0x01}, ++ {0x0342, 0x42}, ++ {0x0343, 0x00}, ++ {0x0340, 0x0d}, ++ {0x0341, 0xf4}, ++ {0x0344, 0x00}, ++ {0x0345, 0x00}, ++ {0x0346, 0x00}, ++ {0x0347, 0x00}, ++ {0x0348, 0x12}, ++ {0x0349, 0x2f}, ++ {0x034a, 0x0d}, ++ {0x034b, 0xa7}, ++ {0x0220, 0x00}, ++ {0x0221, 0x11}, ++ {0x0222, 0x01}, ++ {0x0900, 0x00}, ++ {0x0901, 0x11}, ++ {0x0902, 0x0a}, ++ {0x3f4c, 0x01}, ++ {0x3f4d, 0x01}, ++ {0x4254, 0x7f}, ++ {0x0401, 0x00}, ++ {0x0404, 0x00}, ++ {0x0405, 0x10}, ++ {0x0408, 0x00}, ++ {0x0409, 0x00}, ++ {0x040a, 0x00}, ++ {0x040b, 0x00}, ++ {0x040c, 0x12}, ++ {0x040d, 0x30}, ++ {0x040e, 0x0d}, ++ {0x040f, 0xa8}, ++ {0x034c, 0x12}, ++ {0x034d, 0x30}, ++ {0x034e, 0x0d}, ++ {0x034f, 0xa8}, ++ {0x0301, 0x06}, ++ {0x0303, 0x04}, ++ {0x0305, 0x04}, ++ {0x0306, 0x01}, ++ {0x0307, 0x57}, ++ {0x0309, 0x0a}, ++ {0x030b, 0x02}, ++ {0x030d, 0x04}, ++ {0x030e, 0x01}, ++ {0x030f, 0x49}, ++ {0x0310, 0x01}, ++ {0x0820, 0x07}, ++ {0x0821, 0xb6}, ++ {0x0822, 0x00}, ++ {0x0823, 0x00}, ++ {0x3e20, 0x01}, ++ {0x3e37, 0x00}, ++ {0x3e3b, 0x00}, ++ {0x0106, 0x00}, ++ {0x0b00, 0x00}, ++ {0x3230, 0x00}, ++ {0x3f14, 0x01}, ++ {0x3f3c, 0x01}, ++ {0x3f0d, 0x0a}, ++ {0x3fbc, 0x00}, ++ {0x3c06, 0x00}, ++ {0x3c07, 0x48}, ++ {0x3c0a, 0x00}, ++ {0x3c0b, 0x00}, ++ {0x3f78, 0x00}, ++ {0x3f79, 0x40}, ++ {0x3f7c, 0x00}, ++ {0x3f7d, 0x00}, ++}; ++ ++/* 4k 21fps mode */ ++static const struct imx519_reg mode_3840x2160_regs[] = { ++ {0x0111, 0x02}, ++ {0x0112, 0x0a}, ++ {0x0113, 0x0a}, ++ {0x0114, 0x01}, ++ {0x0342, 0x38}, ++ {0x0343, 0x70}, ++ {0x0340, 0x08}, ++ {0x0341, 0xd4}, ++ {0x0344, 0x01}, ++ {0x0345, 0x98}, ++ {0x0346, 0x02}, ++ {0x0347, 0xa0}, ++ {0x0348, 0x10}, ++ {0x0349, 0x97}, ++ {0x034a, 0x0b}, ++ {0x034b, 0x17}, ++ {0x0220, 0x00}, ++ {0x0221, 0x11}, ++ {0x0222, 0x01}, ++ {0x0900, 0x00}, ++ {0x0901, 0x11}, ++ {0x0902, 0x0a}, ++ {0x3f4c, 0x01}, ++ {0x3f4d, 0x01}, ++ {0x4254, 0x7f}, ++ {0x0401, 0x00}, ++ {0x0404, 0x00}, ++ {0x0405, 0x10}, ++ {0x0408, 0x00}, ++ {0x0409, 0x00}, ++ {0x040a, 0x00}, ++ {0x040b, 0x00}, ++ {0x040c, 0x0f}, ++ {0x040d, 0x00}, ++ {0x040e, 0x08}, ++ {0x040f, 0x70}, ++ {0x034c, 0x0f}, ++ {0x034d, 0x00}, ++ {0x034e, 0x08}, ++ {0x034f, 0x70}, ++ {0x0301, 0x06}, ++ {0x0303, 0x04}, ++ {0x0305, 0x04}, ++ {0x0306, 0x01}, ++ {0x0307, 0x57}, ++ {0x0309, 0x0a}, ++ {0x030b, 0x02}, ++ {0x030d, 0x04}, ++ {0x030e, 0x01}, ++ {0x030f, 0x49}, ++ {0x0310, 0x01}, ++ {0x0820, 0x07}, ++ {0x0821, 0xb6}, ++ {0x0822, 0x00}, ++ {0x0823, 0x00}, ++ {0x3e20, 0x01}, ++ {0x3e37, 0x00}, ++ {0x3e3b, 0x00}, ++ {0x0106, 0x00}, ++ {0x0b00, 0x00}, ++ {0x3230, 0x00}, ++ {0x3f14, 0x01}, ++ {0x3f3c, 0x01}, ++ {0x3f0d, 0x0a}, ++ {0x3fbc, 0x00}, ++ {0x3c06, 0x00}, ++ {0x3c07, 0x48}, ++ {0x3c0a, 0x00}, ++ {0x3c0b, 0x00}, ++ {0x3f78, 0x00}, ++ {0x3f79, 0x40}, ++ {0x3f7c, 0x00}, ++ {0x3f7d, 0x00}, ++}; ++ ++/* 2x2 binned 30fps mode */ ++static const struct imx519_reg mode_2328x1748_regs[] = { ++ {0x0111, 0x02}, ++ {0x0112, 0x0a}, ++ {0x0113, 0x0a}, ++ {0x0114, 0x01}, ++ {0x0342, 0x24}, ++ {0x0343, 0x12}, ++ {0x0340, 0x09}, ++ {0x0341, 0xac}, ++ {0x0344, 0x00}, ++ {0x0345, 0x00}, ++ {0x0346, 0x00}, ++ {0x0347, 0x00}, ++ {0x0348, 0x12}, ++ {0x0349, 0x2f}, ++ {0x034a, 0x0d}, ++ {0x034b, 0xa7}, ++ {0x0220, 0x00}, ++ {0x0221, 0x11}, ++ {0x0222, 0x01}, ++ {0x0900, 0x01}, ++ {0x0901, 0x22}, ++ {0x0902, 0x0a}, ++ {0x3f4c, 0x01}, ++ {0x3f4d, 0x01}, ++ {0x4254, 0x7f}, ++ {0x0401, 0x00}, ++ {0x0404, 0x00}, ++ {0x0405, 0x10}, ++ {0x0408, 0x00}, ++ {0x0409, 0x00}, ++ {0x040a, 0x00}, ++ {0x040b, 0x00}, ++ {0x040c, 0x09}, ++ {0x040d, 0x18}, ++ {0x040e, 0x06}, ++ {0x040f, 0xd4}, ++ {0x034c, 0x09}, ++ {0x034d, 0x18}, ++ {0x034e, 0x06}, ++ {0x034f, 0xd4}, ++ {0x0301, 0x06}, ++ {0x0303, 0x04}, ++ {0x0305, 0x04}, ++ {0x0306, 0x01}, ++ {0x0307, 0x57}, ++ {0x0309, 0x0a}, ++ {0x030b, 0x02}, ++ {0x030d, 0x04}, ++ {0x030e, 0x01}, ++ {0x030f, 0x49}, ++ {0x0310, 0x01}, ++ {0x0820, 0x07}, ++ {0x0821, 0xb6}, ++ {0x0822, 0x00}, ++ {0x0823, 0x00}, ++ {0x3e20, 0x01}, ++ {0x3e37, 0x00}, ++ {0x3e3b, 0x00}, ++ {0x0106, 0x00}, ++ {0x0b00, 0x00}, ++ {0x3230, 0x00}, ++ {0x3f14, 0x01}, ++ {0x3f3c, 0x01}, ++ {0x3f0d, 0x0a}, ++ {0x3fbc, 0x00}, ++ {0x3c06, 0x00}, ++ {0x3c07, 0x48}, ++ {0x3c0a, 0x00}, ++ {0x3c0b, 0x00}, ++ {0x3f78, 0x00}, ++ {0x3f79, 0x40}, ++ {0x3f7c, 0x00}, ++ {0x3f7d, 0x00}, ++}; ++ ++/* 1080p 60fps mode */ ++static const struct imx519_reg mode_1920x1080_regs[] = { ++ {0x0111, 0x02}, ++ {0x0112, 0x0a}, ++ {0x0113, 0x0a}, ++ {0x0114, 0x01}, ++ {0x0342, 0x25}, ++ {0x0343, 0xd9}, ++ {0x0340, 0x04}, ++ {0x0341, 0x9c}, ++ {0x0344, 0x01}, ++ {0x0345, 0x98}, ++ {0x0346, 0x02}, ++ {0x0347, 0xa2}, ++ {0x0348, 0x10}, ++ {0x0349, 0x97}, ++ {0x034a, 0x0b}, ++ {0x034b, 0x15}, ++ {0x0220, 0x00}, ++ {0x0221, 0x11}, ++ {0x0222, 0x01}, ++ {0x0900, 0x01}, ++ {0x0901, 0x22}, ++ {0x0902, 0x0a}, ++ {0x3f4c, 0x01}, ++ {0x3f4d, 0x01}, ++ {0x4254, 0x7f}, ++ {0x0401, 0x00}, ++ {0x0404, 0x00}, ++ {0x0405, 0x10}, ++ {0x0408, 0x00}, ++ {0x0409, 0x00}, ++ {0x040a, 0x00}, ++ {0x040b, 0x00}, ++ {0x040c, 0x07}, ++ {0x040d, 0x80}, ++ {0x040e, 0x04}, ++ {0x040f, 0x38}, ++ {0x034c, 0x07}, ++ {0x034d, 0x80}, ++ {0x034e, 0x04}, ++ {0x034f, 0x38}, ++ {0x0301, 0x06}, ++ {0x0303, 0x04}, ++ {0x0305, 0x04}, ++ {0x0306, 0x01}, ++ {0x0307, 0x57}, ++ {0x0309, 0x0a}, ++ {0x030b, 0x02}, ++ {0x030d, 0x04}, ++ {0x030e, 0x01}, ++ {0x030f, 0x49}, ++ {0x0310, 0x01}, ++ {0x0820, 0x07}, ++ {0x0821, 0xb6}, ++ {0x0822, 0x00}, ++ {0x0823, 0x00}, ++ {0x3e20, 0x01}, ++ {0x3e37, 0x00}, ++ {0x3e3b, 0x00}, ++ {0x0106, 0x00}, ++ {0x0b00, 0x00}, ++ {0x3230, 0x00}, ++ {0x3f14, 0x01}, ++ {0x3f3c, 0x01}, ++ {0x3f0d, 0x0a}, ++ {0x3fbc, 0x00}, ++ {0x3c06, 0x00}, ++ {0x3c07, 0x48}, ++ {0x3c0a, 0x00}, ++ {0x3c0b, 0x00}, ++ {0x3f78, 0x00}, ++ {0x3f79, 0x40}, ++ {0x3f7c, 0x00}, ++ {0x3f7d, 0x00}, ++}; ++ ++/* 720p 120fps mode */ ++static const struct imx519_reg mode_1280x720_regs[] = { ++ {0x0111, 0x02}, ++ {0x0112, 0x0a}, ++ {0x0113, 0x0a}, ++ {0x0114, 0x01}, ++ {0x0342, 0x1b}, ++ {0x0343, 0x3b}, ++ {0x0340, 0x03}, ++ {0x0341, 0x34}, ++ {0x0344, 0x04}, ++ {0x0345, 0x18}, ++ {0x0346, 0x04}, ++ {0x0347, 0x12}, ++ {0x0348, 0x0e}, ++ {0x0349, 0x17}, ++ {0x034a, 0x09}, ++ {0x034b, 0xb6}, ++ {0x0220, 0x00}, ++ {0x0221, 0x11}, ++ {0x0222, 0x01}, ++ {0x0900, 0x01}, ++ {0x0901, 0x22}, ++ {0x0902, 0x0a}, ++ {0x3f4c, 0x01}, ++ {0x3f4d, 0x01}, ++ {0x4254, 0x7f}, ++ {0x0401, 0x00}, ++ {0x0404, 0x00}, ++ {0x0405, 0x10}, ++ {0x0408, 0x00}, ++ {0x0409, 0x00}, ++ {0x040a, 0x00}, ++ {0x040b, 0x00}, ++ {0x040c, 0x05}, ++ {0x040d, 0x00}, ++ {0x040e, 0x02}, ++ {0x040f, 0xd0}, ++ {0x034c, 0x05}, ++ {0x034d, 0x00}, ++ {0x034e, 0x02}, ++ {0x034f, 0xd0}, ++ {0x0301, 0x06}, ++ {0x0303, 0x04}, ++ {0x0305, 0x04}, ++ {0x0306, 0x01}, ++ {0x0307, 0x57}, ++ {0x0309, 0x0a}, ++ {0x030b, 0x02}, ++ {0x030d, 0x04}, ++ {0x030e, 0x01}, ++ {0x030f, 0x49}, ++ {0x0310, 0x01}, ++ {0x0820, 0x07}, ++ {0x0821, 0xb6}, ++ {0x0822, 0x00}, ++ {0x0823, 0x00}, ++ {0x3e20, 0x01}, ++ {0x3e37, 0x00}, ++ {0x3e3b, 0x00}, ++ {0x0106, 0x00}, ++ {0x0b00, 0x00}, ++ {0x3230, 0x00}, ++ {0x3f14, 0x01}, ++ {0x3f3c, 0x01}, ++ {0x3f0d, 0x0a}, ++ {0x3fbc, 0x00}, ++ {0x3c06, 0x00}, ++ {0x3c07, 0x48}, ++ {0x3c0a, 0x00}, ++ {0x3c0b, 0x00}, ++ {0x3f78, 0x00}, ++ {0x3f79, 0x40}, ++ {0x3f7c, 0x00}, ++ {0x3f7d, 0x00}, ++}; ++ ++/* Mode configs */ ++static const struct imx519_mode supported_modes_10bit[] = { ++ { ++ .width = 4656, ++ .height = 3496, ++ .line_length_pix = 0x4200, ++ .crop = { ++ .left = IMX519_PIXEL_ARRAY_LEFT, ++ .top = IMX519_PIXEL_ARRAY_TOP, ++ .width = 4656, ++ .height = 3496, ++ }, ++ .timeperframe_min = { ++ .numerator = 100, ++ .denominator = 1000 ++ }, ++ .timeperframe_default = { ++ .numerator = 100, ++ .denominator = 1000 ++ }, ++ .reg_list = { ++ .num_of_regs = ARRAY_SIZE(mode_4656x3496_regs), ++ .regs = mode_4656x3496_regs, ++ } ++ }, ++ { ++ .width = 3840, ++ .height = 2160, ++ .line_length_pix = 0x3870, ++ .crop = { ++ .left = IMX519_PIXEL_ARRAY_LEFT + 408, ++ .top = IMX519_PIXEL_ARRAY_TOP + 672, ++ .width = 3840, ++ .height = 2160, ++ }, ++ .timeperframe_min = { ++ .numerator = 100, ++ .denominator = 2100 ++ }, ++ .timeperframe_default = { ++ .numerator = 100, ++ .denominator = 2100 ++ }, ++ .reg_list = { ++ .num_of_regs = ARRAY_SIZE(mode_3840x2160_regs), ++ .regs = mode_3840x2160_regs, ++ } ++ }, ++ { ++ .width = 2328, ++ .height = 1748, ++ .line_length_pix = 0x2412, ++ .crop = { ++ .left = IMX519_PIXEL_ARRAY_LEFT, ++ .top = IMX519_PIXEL_ARRAY_TOP, ++ .width = 4656, ++ .height = 3496, ++ }, ++ .timeperframe_min = { ++ .numerator = 100, ++ .denominator = 3000 ++ }, ++ .timeperframe_default = { ++ .numerator = 100, ++ .denominator = 3000 ++ }, ++ .reg_list = { ++ .num_of_regs = ARRAY_SIZE(mode_2328x1748_regs), ++ .regs = mode_2328x1748_regs, ++ } ++ }, ++ { ++ .width = 1920, ++ .height = 1080, ++ .line_length_pix = 0x25D9, ++ .crop = { ++ .left = IMX519_PIXEL_ARRAY_LEFT + 408, ++ .top = IMX519_PIXEL_ARRAY_TOP + 674, ++ .width = 3840, ++ .height = 2160, ++ }, ++ .timeperframe_min = { ++ .numerator = 100, ++ .denominator = 6000 ++ }, ++ .timeperframe_default = { ++ .numerator = 100, ++ .denominator = 6000 ++ }, ++ .reg_list = { ++ .num_of_regs = ARRAY_SIZE(mode_1920x1080_regs), ++ .regs = mode_1920x1080_regs, ++ } ++ }, ++ { ++ .width = 1280, ++ .height = 720, ++ .line_length_pix = 0x1B3B, ++ .crop = { ++ .left = IMX519_PIXEL_ARRAY_LEFT + 1048, ++ .top = IMX519_PIXEL_ARRAY_TOP + 1042, ++ .width = 2560, ++ .height = 1440, ++ }, ++ .timeperframe_min = { ++ .numerator = 100, ++ .denominator = 12000 ++ }, ++ .timeperframe_default = { ++ .numerator = 100, ++ .denominator = 12000 ++ }, ++ .reg_list = { ++ .num_of_regs = ARRAY_SIZE(mode_1280x720_regs), ++ .regs = mode_1280x720_regs, ++ } ++ } ++}; ++ ++/* ++ * The supported formats. ++ * This table MUST contain 4 entries per format, to cover the various flip ++ * combinations in the order ++ * - no flip ++ * - h flip ++ * - v flip ++ * - h&v flips ++ */ ++static const u32 codes[] = { ++ /* 10-bit modes. */ ++ MEDIA_BUS_FMT_SRGGB10_1X10, ++ MEDIA_BUS_FMT_SGRBG10_1X10, ++ MEDIA_BUS_FMT_SGBRG10_1X10, ++ MEDIA_BUS_FMT_SBGGR10_1X10, ++}; ++ ++static const char * const imx519_test_pattern_menu[] = { ++ "Disabled", ++ "Color Bars", ++ "Solid Color", ++ "Grey Color Bars", ++ "PN9" ++}; ++ ++static const int imx519_test_pattern_val[] = { ++ IMX519_TEST_PATTERN_DISABLE, ++ IMX519_TEST_PATTERN_COLOR_BARS, ++ IMX519_TEST_PATTERN_SOLID_COLOR, ++ IMX519_TEST_PATTERN_GREY_COLOR, ++ IMX519_TEST_PATTERN_PN9, ++}; ++ ++/* regulator supplies */ ++static const char * const imx519_supply_name[] = { ++ /* Supplies can be enabled in any order */ ++ "VANA", /* Analog (2.8V) supply */ ++ "VDIG", /* Digital Core (1.05V) supply */ ++ "VDDL", /* IF (1.8V) supply */ ++}; ++ ++#define IMX519_NUM_SUPPLIES ARRAY_SIZE(imx519_supply_name) ++ ++/* ++ * Initialisation delay between XCLR low->high and the moment when the sensor ++ * can start capture (i.e. can leave software standby), given by T7 in the ++ * datasheet is 8ms. This does include I2C setup time as well. ++ * ++ * Note, that delay between XCLR low->high and reading the CCI ID register (T6 ++ * in the datasheet) is much smaller - 600us. ++ */ ++#define IMX519_XCLR_MIN_DELAY_US 8000 ++#define IMX519_XCLR_DELAY_RANGE_US 1000 ++ ++struct imx519 { ++ struct v4l2_subdev sd; ++ struct media_pad pad; ++ ++ unsigned int fmt_code; ++ ++ struct clk *xclk; ++ ++ struct gpio_desc *reset_gpio; ++ struct regulator_bulk_data supplies[IMX519_NUM_SUPPLIES]; ++ ++ struct v4l2_ctrl_handler ctrl_handler; ++ /* V4L2 Controls */ ++ struct v4l2_ctrl *pixel_rate; ++ struct v4l2_ctrl *exposure; ++ struct v4l2_ctrl *vflip; ++ struct v4l2_ctrl *hflip; ++ struct v4l2_ctrl *vblank; ++ struct v4l2_ctrl *hblank; ++ ++ /* Current mode */ ++ const struct imx519_mode *mode; ++ ++ /* ++ * Mutex for serialized access: ++ * Protect sensor module set pad format and start/stop streaming safely. ++ */ ++ struct mutex mutex; ++ ++ /* Streaming on/off */ ++ bool streaming; ++ ++ /* Rewrite common registers on stream on? */ ++ bool common_regs_written; ++ ++ /* Current long exposure factor in use. Set through V4L2_CID_VBLANK */ ++ unsigned int long_exp_shift; ++}; ++ ++static inline struct imx519 *to_imx519(struct v4l2_subdev *_sd) ++{ ++ return container_of(_sd, struct imx519, sd); ++} ++ ++/* Read registers up to 2 at a time */ ++static int imx519_read_reg(struct imx519 *imx519, u16 reg, u32 len, u32 *val) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&imx519->sd); ++ struct i2c_msg msgs[2]; ++ u8 addr_buf[2] = { reg >> 8, reg & 0xff }; ++ u8 data_buf[4] = { 0, }; ++ int ret; ++ ++ if (len > 4) ++ return -EINVAL; ++ ++ /* Write register address */ ++ msgs[0].addr = client->addr; ++ msgs[0].flags = 0; ++ msgs[0].len = ARRAY_SIZE(addr_buf); ++ msgs[0].buf = addr_buf; ++ ++ /* Read data from register */ ++ msgs[1].addr = client->addr; ++ msgs[1].flags = I2C_M_RD; ++ msgs[1].len = len; ++ msgs[1].buf = &data_buf[4 - len]; ++ ++ ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); ++ if (ret != ARRAY_SIZE(msgs)) ++ return -EIO; ++ ++ *val = get_unaligned_be32(data_buf); ++ ++ return 0; ++} ++ ++/* Write registers up to 2 at a time */ ++static int imx519_write_reg(struct imx519 *imx519, u16 reg, u32 len, u32 val) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&imx519->sd); ++ u8 buf[6]; ++ ++ if (len > 4) ++ return -EINVAL; ++ ++ put_unaligned_be16(reg, buf); ++ put_unaligned_be32(val << (8 * (4 - len)), buf + 2); ++ if (i2c_master_send(client, buf, len + 2) != len + 2) ++ return -EIO; ++ ++ return 0; ++} ++ ++/* Write a list of registers */ ++static int imx519_write_regs(struct imx519 *imx519, ++ const struct imx519_reg *regs, u32 len) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&imx519->sd); ++ unsigned int i; ++ int ret; ++ ++ for (i = 0; i < len; i++) { ++ ret = imx519_write_reg(imx519, regs[i].address, 1, regs[i].val); ++ if (ret) { ++ dev_err_ratelimited(&client->dev, ++ "Failed to write reg 0x%4.4x. error = %d\n", ++ regs[i].address, ret); ++ ++ return ret; ++ } ++ } ++ ++ return 0; ++} ++ ++/* Get bayer order based on flip setting. */ ++static u32 imx519_get_format_code(struct imx519 *imx519) ++{ ++ unsigned int i; ++ ++ lockdep_assert_held(&imx519->mutex); ++ ++ i = (imx519->vflip->val ? 2 : 0) | ++ (imx519->hflip->val ? 1 : 0); ++ ++ return codes[i]; ++} ++ ++static int imx519_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) ++{ ++ struct imx519 *imx519 = to_imx519(sd); ++ struct v4l2_mbus_framefmt *try_fmt_img = ++ v4l2_subdev_get_try_format(sd, fh->pad, 0); ++ struct v4l2_rect *try_crop; ++ ++ mutex_lock(&imx519->mutex); ++ ++ /* Initialize try_fmt for the image pad */ ++ try_fmt_img->width = supported_modes_10bit[0].width; ++ try_fmt_img->height = supported_modes_10bit[0].height; ++ try_fmt_img->code = imx519_get_format_code(imx519); ++ try_fmt_img->field = V4L2_FIELD_NONE; ++ ++ /* Initialize try_crop */ ++ try_crop = v4l2_subdev_get_try_crop(sd, fh->pad, 0); ++ try_crop->left = IMX519_PIXEL_ARRAY_LEFT; ++ try_crop->top = IMX519_PIXEL_ARRAY_TOP; ++ try_crop->width = IMX519_PIXEL_ARRAY_WIDTH; ++ try_crop->height = IMX519_PIXEL_ARRAY_HEIGHT; ++ ++ mutex_unlock(&imx519->mutex); ++ ++ return 0; ++} ++ ++static void imx519_adjust_exposure_range(struct imx519 *imx519) ++{ ++ int exposure_max, exposure_def; ++ ++ /* Honour the VBLANK limits when setting exposure. */ ++ exposure_max = imx519->mode->height + imx519->vblank->val - ++ IMX519_EXPOSURE_OFFSET; ++ exposure_def = min(exposure_max, imx519->exposure->val); ++ __v4l2_ctrl_modify_range(imx519->exposure, imx519->exposure->minimum, ++ exposure_max, imx519->exposure->step, ++ exposure_def); ++} ++ ++static int imx519_set_frame_length(struct imx519 *imx519, unsigned int val) ++{ ++ int ret = 0; ++ ++ imx519->long_exp_shift = 0; ++ ++ while (val > IMX519_FRAME_LENGTH_MAX) { ++ imx519->long_exp_shift++; ++ val >>= 1; ++ } ++ ++ ret = imx519_write_reg(imx519, IMX519_REG_FRAME_LENGTH, ++ IMX519_REG_VALUE_16BIT, val); ++ if (ret) ++ return ret; ++ ++ return imx519_write_reg(imx519, IMX519_LONG_EXP_SHIFT_REG, ++ IMX519_REG_VALUE_08BIT, imx519->long_exp_shift); ++} ++ ++static int imx519_set_ctrl(struct v4l2_ctrl *ctrl) ++{ ++ struct imx519 *imx519 = ++ container_of(ctrl->handler, struct imx519, ctrl_handler); ++ struct i2c_client *client = v4l2_get_subdevdata(&imx519->sd); ++ int ret = 0; ++ ++ /* ++ * The VBLANK control may change the limits of usable exposure, so check ++ * and adjust if necessary. ++ */ ++ if (ctrl->id == V4L2_CID_VBLANK) ++ imx519_adjust_exposure_range(imx519); ++ ++ /* ++ * Applying V4L2 control value only happens ++ * when power is up for streaming ++ */ ++ if (pm_runtime_get_if_in_use(&client->dev) == 0) ++ return 0; ++ ++ switch (ctrl->id) { ++ case V4L2_CID_ANALOGUE_GAIN: ++ ret = imx519_write_reg(imx519, IMX519_REG_ANALOG_GAIN, ++ IMX519_REG_VALUE_16BIT, ctrl->val); ++ break; ++ case V4L2_CID_EXPOSURE: ++ ret = imx519_write_reg(imx519, IMX519_REG_EXPOSURE, ++ IMX519_REG_VALUE_16BIT, ctrl->val >> ++ imx519->long_exp_shift); ++ break; ++ case V4L2_CID_DIGITAL_GAIN: ++ ret = imx519_write_reg(imx519, IMX519_REG_DIGITAL_GAIN, ++ IMX519_REG_VALUE_16BIT, ctrl->val); ++ break; ++ case V4L2_CID_TEST_PATTERN: ++ ret = imx519_write_reg(imx519, IMX519_REG_TEST_PATTERN, ++ IMX519_REG_VALUE_16BIT, ++ imx519_test_pattern_val[ctrl->val]); ++ break; ++ case V4L2_CID_TEST_PATTERN_RED: ++ ret = imx519_write_reg(imx519, IMX519_REG_TEST_PATTERN_R, ++ IMX519_REG_VALUE_16BIT, ctrl->val); ++ break; ++ case V4L2_CID_TEST_PATTERN_GREENR: ++ ret = imx519_write_reg(imx519, IMX519_REG_TEST_PATTERN_GR, ++ IMX519_REG_VALUE_16BIT, ctrl->val); ++ break; ++ case V4L2_CID_TEST_PATTERN_BLUE: ++ ret = imx519_write_reg(imx519, IMX519_REG_TEST_PATTERN_B, ++ IMX519_REG_VALUE_16BIT, ctrl->val); ++ break; ++ case V4L2_CID_TEST_PATTERN_GREENB: ++ ret = imx519_write_reg(imx519, IMX519_REG_TEST_PATTERN_GB, ++ IMX519_REG_VALUE_16BIT, ctrl->val); ++ break; ++ case V4L2_CID_HFLIP: ++ case V4L2_CID_VFLIP: ++ ret = imx519_write_reg(imx519, IMX519_REG_ORIENTATION, 1, ++ imx519->hflip->val | ++ imx519->vflip->val << 1); ++ break; ++ case V4L2_CID_VBLANK: ++ ret = imx519_set_frame_length(imx519, ++ imx519->mode->height + 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; ++ } ++ ++ pm_runtime_put(&client->dev); ++ ++ return ret; ++} ++ ++static const struct v4l2_ctrl_ops imx519_ctrl_ops = { ++ .s_ctrl = imx519_set_ctrl, ++}; ++ ++static int imx519_enum_mbus_code(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_mbus_code_enum *code) ++{ ++ struct imx519 *imx519 = to_imx519(sd); ++ ++ if (code->index > 0) ++ return -EINVAL; ++ ++ code->code = imx519_get_format_code(imx519); ++ ++ return 0; ++} ++ ++static int imx519_enum_frame_size(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_frame_size_enum *fse) ++{ ++ struct imx519 *imx519 = to_imx519(sd); ++ ++ if (fse->index >= ARRAY_SIZE(supported_modes_10bit)) ++ return -EINVAL; ++ ++ if (fse->code != imx519_get_format_code(imx519)) ++ return -EINVAL; ++ ++ fse->min_width = supported_modes_10bit[fse->index].width; ++ fse->max_width = fse->min_width; ++ fse->min_height = supported_modes_10bit[fse->index].height; ++ fse->max_height = fse->min_height; ++ ++ return 0; ++} ++ ++static void imx519_reset_colorspace(struct v4l2_mbus_framefmt *fmt) ++{ ++ fmt->colorspace = V4L2_COLORSPACE_SRGB; ++ fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace); ++ fmt->quantization = V4L2_MAP_QUANTIZATION_DEFAULT(true, ++ fmt->colorspace, ++ fmt->ycbcr_enc); ++ fmt->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(fmt->colorspace); ++} ++ ++static void imx519_update_image_pad_format(struct imx519 *imx519, ++ const struct imx519_mode *mode, ++ struct v4l2_subdev_format *fmt) ++{ ++ fmt->format.width = mode->width; ++ fmt->format.height = mode->height; ++ fmt->format.field = V4L2_FIELD_NONE; ++ imx519_reset_colorspace(&fmt->format); ++} ++ ++static int imx519_get_pad_format(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_format *fmt) ++{ ++ struct imx519 *imx519 = to_imx519(sd); ++ ++ if (fmt->pad != 0) ++ return -EINVAL; ++ ++ mutex_lock(&imx519->mutex); ++ ++ if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { ++ struct v4l2_mbus_framefmt *try_fmt = ++ v4l2_subdev_get_try_format(&imx519->sd, cfg, fmt->pad); ++ /* update the code which could change due to vflip or hflip: */ ++ try_fmt->code = imx519_get_format_code(imx519); ++ fmt->format = *try_fmt; ++ } else { ++ imx519_update_image_pad_format(imx519, imx519->mode, ++ fmt); ++ fmt->format.code = imx519_get_format_code(imx519); ++ } ++ ++ mutex_unlock(&imx519->mutex); ++ return 0; ++} ++ ++static ++unsigned int imx519_get_frame_length(const struct imx519_mode *mode, ++ const struct v4l2_fract *timeperframe) ++{ ++ u64 frame_length; ++ ++ frame_length = (u64)timeperframe->numerator * IMX519_PIXEL_RATE; ++ do_div(frame_length, ++ (u64)timeperframe->denominator * mode->line_length_pix); ++ ++ if (WARN_ON(frame_length > IMX519_FRAME_LENGTH_MAX)) ++ frame_length = IMX519_FRAME_LENGTH_MAX; ++ ++ return max_t(unsigned int, frame_length, mode->height); ++} ++ ++static void imx519_set_framing_limits(struct imx519 *imx519) ++{ ++ unsigned int frm_length_min, frm_length_default, hblank; ++ const struct imx519_mode *mode = imx519->mode; ++ ++ frm_length_min = imx519_get_frame_length(mode, &mode->timeperframe_min); ++ frm_length_default = ++ imx519_get_frame_length(mode, &mode->timeperframe_default); ++ ++ /* Default to no long exposure multiplier. */ ++ imx519->long_exp_shift = 0; ++ ++ /* Update limits and set FPS to default */ ++ __v4l2_ctrl_modify_range(imx519->vblank, frm_length_min - mode->height, ++ ((1 << IMX519_LONG_EXP_SHIFT_MAX) * ++ IMX519_FRAME_LENGTH_MAX) - mode->height, ++ 1, frm_length_default - mode->height); ++ ++ /* Setting this will adjust the exposure limits as well. */ ++ __v4l2_ctrl_s_ctrl(imx519->vblank, frm_length_default - mode->height); ++ ++ /* ++ * Currently PPL is fixed to the mode specified value, so hblank ++ * depends on mode->width only, and is not changeable in any ++ * way other than changing the mode. ++ */ ++ hblank = mode->line_length_pix - mode->width; ++ __v4l2_ctrl_modify_range(imx519->hblank, hblank, hblank, 1, hblank); ++} ++ ++static int imx519_set_pad_format(struct v4l2_subdev *sd, ++ struct v4l2_subdev_pad_config *cfg, ++ struct v4l2_subdev_format *fmt) ++{ ++ struct v4l2_mbus_framefmt *framefmt; ++ const struct imx519_mode *mode; ++ struct imx519 *imx519 = to_imx519(sd); ++ ++ if (fmt->pad != 0) ++ return -EINVAL; ++ ++ mutex_lock(&imx519->mutex); ++ ++ /* Bayer order varies with flips */ ++ fmt->format.code = imx519_get_format_code(imx519); ++ ++ mode = v4l2_find_nearest_size(supported_modes_10bit, ++ ARRAY_SIZE(supported_modes_10bit), ++ width, height, ++ fmt->format.width, ++ fmt->format.height); ++ imx519_update_image_pad_format(imx519, mode, fmt); ++ if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { ++ framefmt = v4l2_subdev_get_try_format(sd, cfg, ++ fmt->pad); ++ *framefmt = fmt->format; ++ } else { ++ imx519->mode = mode; ++ imx519->fmt_code = fmt->format.code; ++ imx519_set_framing_limits(imx519); ++ } ++ ++ mutex_unlock(&imx519->mutex); ++ ++ return 0; ++} ++ ++static const struct v4l2_rect * ++__imx519_get_pad_crop(struct imx519 *imx519, 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(&imx519->sd, cfg, pad); ++ case V4L2_SUBDEV_FORMAT_ACTIVE: ++ return &imx519->mode->crop; ++ } ++ ++ return NULL; ++} ++ ++static int imx519_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 imx519 *imx519 = to_imx519(sd); ++ ++ mutex_lock(&imx519->mutex); ++ sel->r = *__imx519_get_pad_crop(imx519, cfg, sel->pad, ++ sel->which); ++ mutex_unlock(&imx519->mutex); ++ ++ return 0; ++ } ++ ++ case V4L2_SEL_TGT_NATIVE_SIZE: ++ sel->r.left = 0; ++ sel->r.top = 0; ++ sel->r.width = IMX519_NATIVE_WIDTH; ++ sel->r.height = IMX519_NATIVE_HEIGHT; ++ ++ return 0; ++ ++ case V4L2_SEL_TGT_CROP_DEFAULT: ++ case V4L2_SEL_TGT_CROP_BOUNDS: ++ sel->r.left = IMX519_PIXEL_ARRAY_LEFT; ++ sel->r.top = IMX519_PIXEL_ARRAY_TOP; ++ sel->r.width = IMX519_PIXEL_ARRAY_WIDTH; ++ sel->r.height = IMX519_PIXEL_ARRAY_HEIGHT; ++ ++ return 0; ++ } ++ ++ return -EINVAL; ++} ++ ++/* Start streaming */ ++static int imx519_start_streaming(struct imx519 *imx519) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&imx519->sd); ++ const struct imx519_reg_list *reg_list; ++ int ret; ++ ++ if (!imx519->common_regs_written) { ++ ret = imx519_write_regs(imx519, mode_common_regs, ++ ARRAY_SIZE(mode_common_regs)); ++ ++ if (ret) { ++ dev_err(&client->dev, "%s failed to set common settings\n", ++ __func__); ++ return ret; ++ } ++ imx519->common_regs_written = true; ++ } ++ ++ /* Apply default values of current mode */ ++ reg_list = &imx519->mode->reg_list; ++ ret = imx519_write_regs(imx519, reg_list->regs, reg_list->num_of_regs); ++ if (ret) { ++ dev_err(&client->dev, "%s failed to set mode\n", __func__); ++ return ret; ++ } ++ ++ /* Apply customized values from user */ ++ ret = __v4l2_ctrl_handler_setup(imx519->sd.ctrl_handler); ++ if (ret) ++ return ret; ++ ++ /* set stream on register */ ++ return imx519_write_reg(imx519, IMX519_REG_MODE_SELECT, ++ IMX519_REG_VALUE_08BIT, IMX519_MODE_STREAMING); ++} ++ ++/* Stop streaming */ ++static void imx519_stop_streaming(struct imx519 *imx519) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&imx519->sd); ++ int ret; ++ ++ /* set stream off register */ ++ ret = imx519_write_reg(imx519, IMX519_REG_MODE_SELECT, ++ IMX519_REG_VALUE_08BIT, IMX519_MODE_STANDBY); ++ if (ret) ++ dev_err(&client->dev, "%s failed to set stream\n", __func__); ++} ++ ++static int imx519_set_stream(struct v4l2_subdev *sd, int enable) ++{ ++ struct imx519 *imx519 = to_imx519(sd); ++ struct i2c_client *client = v4l2_get_subdevdata(sd); ++ int ret = 0; ++ ++ mutex_lock(&imx519->mutex); ++ if (imx519->streaming == enable) { ++ mutex_unlock(&imx519->mutex); ++ return 0; ++ } ++ ++ if (enable) { ++ ret = pm_runtime_get_sync(&client->dev); ++ if (ret < 0) { ++ pm_runtime_put_noidle(&client->dev); ++ goto err_unlock; ++ } ++ ++ /* ++ * Apply default & customized values ++ * and then start streaming. ++ */ ++ ret = imx519_start_streaming(imx519); ++ if (ret) ++ goto err_rpm_put; ++ } else { ++ imx519_stop_streaming(imx519); ++ pm_runtime_put(&client->dev); ++ } ++ ++ imx519->streaming = enable; ++ ++ /* vflip and hflip cannot change during streaming */ ++ __v4l2_ctrl_grab(imx519->vflip, enable); ++ __v4l2_ctrl_grab(imx519->hflip, enable); ++ ++ mutex_unlock(&imx519->mutex); ++ ++ return ret; ++ ++err_rpm_put: ++ pm_runtime_put(&client->dev); ++err_unlock: ++ mutex_unlock(&imx519->mutex); ++ ++ return ret; ++} ++ ++/* Power/clock management functions */ ++static int imx519_power_on(struct device *dev) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct v4l2_subdev *sd = i2c_get_clientdata(client); ++ struct imx519 *imx519 = to_imx519(sd); ++ int ret; ++ ++ ret = regulator_bulk_enable(IMX519_NUM_SUPPLIES, ++ imx519->supplies); ++ if (ret) { ++ dev_err(&client->dev, "%s: failed to enable regulators\n", ++ __func__); ++ return ret; ++ } ++ ++ ret = clk_prepare_enable(imx519->xclk); ++ if (ret) { ++ dev_err(&client->dev, "%s: failed to enable clock\n", ++ __func__); ++ goto reg_off; ++ } ++ ++ gpiod_set_value_cansleep(imx519->reset_gpio, 1); ++ usleep_range(IMX519_XCLR_MIN_DELAY_US, ++ IMX519_XCLR_MIN_DELAY_US + IMX519_XCLR_DELAY_RANGE_US); ++ ++ return 0; ++ ++reg_off: ++ regulator_bulk_disable(IMX519_NUM_SUPPLIES, imx519->supplies); ++ return ret; ++} ++ ++static int imx519_power_off(struct device *dev) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct v4l2_subdev *sd = i2c_get_clientdata(client); ++ struct imx519 *imx519 = to_imx519(sd); ++ ++ gpiod_set_value_cansleep(imx519->reset_gpio, 0); ++ regulator_bulk_disable(IMX519_NUM_SUPPLIES, imx519->supplies); ++ clk_disable_unprepare(imx519->xclk); ++ ++ /* Force reprogramming of the common registers when powered up again. */ ++ imx519->common_regs_written = false; ++ ++ return 0; ++} ++ ++static int __maybe_unused imx519_suspend(struct device *dev) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct v4l2_subdev *sd = i2c_get_clientdata(client); ++ struct imx519 *imx519 = to_imx519(sd); ++ ++ if (imx519->streaming) ++ imx519_stop_streaming(imx519); ++ ++ return 0; ++} ++ ++static int __maybe_unused imx519_resume(struct device *dev) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct v4l2_subdev *sd = i2c_get_clientdata(client); ++ struct imx519 *imx519 = to_imx519(sd); ++ int ret; ++ ++ if (imx519->streaming) { ++ ret = imx519_start_streaming(imx519); ++ if (ret) ++ goto error; ++ } ++ ++ return 0; ++ ++error: ++ imx519_stop_streaming(imx519); ++ imx519->streaming = 0; ++ return ret; ++} ++ ++static int imx519_get_regulators(struct imx519 *imx519) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&imx519->sd); ++ unsigned int i; ++ ++ for (i = 0; i < IMX519_NUM_SUPPLIES; i++) ++ imx519->supplies[i].supply = imx519_supply_name[i]; ++ ++ return devm_regulator_bulk_get(&client->dev, ++ IMX519_NUM_SUPPLIES, ++ imx519->supplies); ++} ++ ++/* Verify chip ID */ ++static int imx519_identify_module(struct imx519 *imx519, u32 expected_id) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&imx519->sd); ++ int ret; ++ u32 val; ++ ++ ret = imx519_read_reg(imx519, IMX519_REG_CHIP_ID, ++ IMX519_REG_VALUE_16BIT, &val); ++ if (ret) { ++ dev_err(&client->dev, "failed to read chip id %x, with error %d\n", ++ expected_id, ret); ++ return ret; ++ } ++ ++ if (val != expected_id) { ++ dev_err(&client->dev, "chip id mismatch: %x!=%x\n", ++ expected_id, val); ++ return -EIO; ++ } ++ ++ dev_info(&client->dev, "Device found is imx%x\n", val); ++ ++ return 0; ++} ++ ++static const struct v4l2_subdev_core_ops imx519_core_ops = { ++ .subscribe_event = v4l2_ctrl_subdev_subscribe_event, ++ .unsubscribe_event = v4l2_event_subdev_unsubscribe, ++}; ++ ++static const struct v4l2_subdev_video_ops imx519_video_ops = { ++ .s_stream = imx519_set_stream, ++}; ++ ++static const struct v4l2_subdev_pad_ops imx519_pad_ops = { ++ .enum_mbus_code = imx519_enum_mbus_code, ++ .get_fmt = imx519_get_pad_format, ++ .set_fmt = imx519_set_pad_format, ++ .get_selection = imx519_get_selection, ++ .enum_frame_size = imx519_enum_frame_size, ++}; ++ ++static const struct v4l2_subdev_ops imx519_subdev_ops = { ++ .core = &imx519_core_ops, ++ .video = &imx519_video_ops, ++ .pad = &imx519_pad_ops, ++}; ++ ++static const struct v4l2_subdev_internal_ops imx519_internal_ops = { ++ .open = imx519_open, ++}; ++ ++/* Initialize control handlers */ ++static int imx519_init_controls(struct imx519 *imx519) ++{ ++ struct v4l2_ctrl_handler *ctrl_hdlr; ++ struct i2c_client *client = v4l2_get_subdevdata(&imx519->sd); ++ struct v4l2_fwnode_device_properties props; ++ unsigned int i; ++ int ret; ++ ++ ctrl_hdlr = &imx519->ctrl_handler; ++ ret = v4l2_ctrl_handler_init(ctrl_hdlr, 16); ++ if (ret) ++ return ret; ++ ++ mutex_init(&imx519->mutex); ++ ctrl_hdlr->lock = &imx519->mutex; ++ ++ /* By default, PIXEL_RATE is read only */ ++ imx519->pixel_rate = v4l2_ctrl_new_std(ctrl_hdlr, &imx519_ctrl_ops, ++ V4L2_CID_PIXEL_RATE, ++ IMX519_PIXEL_RATE, ++ IMX519_PIXEL_RATE, 1, ++ IMX519_PIXEL_RATE); ++ ++ /* ++ * Create the controls here, but mode specific limits are setup ++ * in the imx519_set_framing_limits() call below. ++ */ ++ imx519->vblank = v4l2_ctrl_new_std(ctrl_hdlr, &imx519_ctrl_ops, ++ V4L2_CID_VBLANK, 0, 0xffff, 1, 0); ++ imx519->hblank = v4l2_ctrl_new_std(ctrl_hdlr, &imx519_ctrl_ops, ++ V4L2_CID_HBLANK, 0, 0xffff, 1, 0); ++ ++ /* HBLANK is read-only for now, but does change with mode. */ ++ if (imx519->hblank) ++ imx519->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; ++ ++ imx519->exposure = v4l2_ctrl_new_std(ctrl_hdlr, &imx519_ctrl_ops, ++ V4L2_CID_EXPOSURE, ++ IMX519_EXPOSURE_MIN, ++ IMX519_EXPOSURE_MAX, ++ IMX519_EXPOSURE_STEP, ++ IMX519_EXPOSURE_DEFAULT); ++ ++ v4l2_ctrl_new_std(ctrl_hdlr, &imx519_ctrl_ops, V4L2_CID_ANALOGUE_GAIN, ++ IMX519_ANA_GAIN_MIN, IMX519_ANA_GAIN_MAX, ++ IMX519_ANA_GAIN_STEP, IMX519_ANA_GAIN_DEFAULT); ++ ++ v4l2_ctrl_new_std(ctrl_hdlr, &imx519_ctrl_ops, V4L2_CID_DIGITAL_GAIN, ++ IMX519_DGTL_GAIN_MIN, IMX519_DGTL_GAIN_MAX, ++ IMX519_DGTL_GAIN_STEP, IMX519_DGTL_GAIN_DEFAULT); ++ ++ imx519->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &imx519_ctrl_ops, ++ V4L2_CID_HFLIP, 0, 1, 1, 0); ++ if (imx519->hflip) ++ imx519->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT; ++ ++ imx519->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &imx519_ctrl_ops, ++ V4L2_CID_VFLIP, 0, 1, 1, 0); ++ if (imx519->vflip) ++ imx519->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT; ++ ++ v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &imx519_ctrl_ops, ++ V4L2_CID_TEST_PATTERN, ++ ARRAY_SIZE(imx519_test_pattern_menu) - 1, ++ 0, 0, imx519_test_pattern_menu); ++ for (i = 0; i < 4; i++) { ++ /* ++ * The assumption is that ++ * V4L2_CID_TEST_PATTERN_GREENR == V4L2_CID_TEST_PATTERN_RED + 1 ++ * V4L2_CID_TEST_PATTERN_BLUE == V4L2_CID_TEST_PATTERN_RED + 2 ++ * V4L2_CID_TEST_PATTERN_GREENB == V4L2_CID_TEST_PATTERN_RED + 3 ++ */ ++ v4l2_ctrl_new_std(ctrl_hdlr, &imx519_ctrl_ops, ++ V4L2_CID_TEST_PATTERN_RED + i, ++ IMX519_TEST_PATTERN_COLOUR_MIN, ++ IMX519_TEST_PATTERN_COLOUR_MAX, ++ IMX519_TEST_PATTERN_COLOUR_STEP, ++ IMX519_TEST_PATTERN_COLOUR_MAX); ++ /* The "Solid color" pattern is white by default */ ++ } ++ ++ if (ctrl_hdlr->error) { ++ ret = ctrl_hdlr->error; ++ dev_err(&client->dev, "%s control init failed (%d)\n", ++ __func__, ret); ++ goto error; ++ } ++ ++ ret = v4l2_fwnode_device_parse(&client->dev, &props); ++ if (ret) ++ goto error; ++ ++ ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx519_ctrl_ops, ++ &props); ++ if (ret) ++ goto error; ++ ++ imx519->sd.ctrl_handler = ctrl_hdlr; ++ ++ /* Setup exposure and frame/line length limits. */ ++ imx519_set_framing_limits(imx519); ++ ++ return 0; ++ ++error: ++ v4l2_ctrl_handler_free(ctrl_hdlr); ++ mutex_destroy(&imx519->mutex); ++ ++ return ret; ++} ++ ++static void imx519_free_controls(struct imx519 *imx519) ++{ ++ v4l2_ctrl_handler_free(imx519->sd.ctrl_handler); ++ mutex_destroy(&imx519->mutex); ++} ++ ++static int imx519_check_hwcfg(struct device *dev) ++{ ++ struct fwnode_handle *endpoint; ++ struct v4l2_fwnode_endpoint ep_cfg = { ++ .bus_type = V4L2_MBUS_CSI2_DPHY ++ }; ++ int ret = -EINVAL; ++ ++ endpoint = fwnode_graph_get_next_endpoint(dev_fwnode(dev), NULL); ++ if (!endpoint) { ++ dev_err(dev, "endpoint node not found\n"); ++ return -EINVAL; ++ } ++ ++ if (v4l2_fwnode_endpoint_alloc_parse(endpoint, &ep_cfg)) { ++ dev_err(dev, "could not parse endpoint\n"); ++ goto error_out; ++ } ++ ++ /* Check the number of MIPI CSI2 data lanes */ ++ if (ep_cfg.bus.mipi_csi2.num_data_lanes != 2) { ++ dev_err(dev, "only 2 data lanes are currently supported\n"); ++ goto error_out; ++ } ++ ++ /* Check the link frequency set in device tree */ ++ if (!ep_cfg.nr_of_link_frequencies) { ++ dev_err(dev, "link-frequency property not found in DT\n"); ++ goto error_out; ++ } ++ ++ if (ep_cfg.nr_of_link_frequencies != 1 || ++ ep_cfg.link_frequencies[0] != IMX519_DEFAULT_LINK_FREQ) { ++ dev_err(dev, "Link frequency not supported: %lld\n", ++ ep_cfg.link_frequencies[0]); ++ goto error_out; ++ } ++ ++ ret = 0; ++ ++error_out: ++ v4l2_fwnode_endpoint_free(&ep_cfg); ++ fwnode_handle_put(endpoint); ++ ++ return ret; ++} ++ ++static const struct of_device_id imx519_dt_ids[] = { ++ { .compatible = "sony,imx519"}, ++ { /* sentinel */ } ++}; ++ ++static int imx519_probe(struct i2c_client *client) ++{ ++ struct device *dev = &client->dev; ++ struct imx519 *imx519; ++ const struct of_device_id *match; ++ u32 xclk_freq; ++ int ret; ++ ++ imx519 = devm_kzalloc(&client->dev, sizeof(*imx519), GFP_KERNEL); ++ if (!imx519) ++ return -ENOMEM; ++ ++ v4l2_i2c_subdev_init(&imx519->sd, client, &imx519_subdev_ops); ++ ++ match = of_match_device(imx519_dt_ids, dev); ++ if (!match) ++ return -ENODEV; ++ ++ /* Check the hardware configuration in device tree */ ++ if (imx519_check_hwcfg(dev)) ++ return -EINVAL; ++ ++ /* Get system clock (xclk) */ ++ imx519->xclk = devm_clk_get(dev, NULL); ++ if (IS_ERR(imx519->xclk)) { ++ dev_err(dev, "failed to get xclk\n"); ++ return PTR_ERR(imx519->xclk); ++ } ++ ++ xclk_freq = clk_get_rate(imx519->xclk); ++ if (xclk_freq != IMX519_XCLK_FREQ) { ++ dev_err(dev, "xclk frequency not supported: %d Hz\n", ++ xclk_freq); ++ return -EINVAL; ++ } ++ ++ ret = imx519_get_regulators(imx519); ++ if (ret) { ++ dev_err(dev, "failed to get regulators\n"); ++ return ret; ++ } ++ ++ /* Request optional enable pin */ ++ imx519->reset_gpio = devm_gpiod_get_optional(dev, "reset", ++ GPIOD_OUT_HIGH); ++ ++ /* ++ * The sensor must be powered for imx519_identify_module() ++ * to be able to read the CHIP_ID register ++ */ ++ ret = imx519_power_on(dev); ++ if (ret) ++ return ret; ++ ++ ret = imx519_identify_module(imx519, IMX519_CHIP_ID); ++ if (ret) ++ goto error_power_off; ++ ++ /* Set default mode to max resolution */ ++ imx519->mode = &supported_modes_10bit[0]; ++ imx519->fmt_code = MEDIA_BUS_FMT_SRGGB10_1X10; ++ ++ /* Enable runtime PM and turn off the device */ ++ pm_runtime_set_active(dev); ++ pm_runtime_enable(dev); ++ pm_runtime_idle(dev); ++ ++ /* This needs the pm runtime to be registered. */ ++ ret = imx519_init_controls(imx519); ++ if (ret) ++ goto error_power_off; ++ ++ /* Initialize subdev */ ++ imx519->sd.internal_ops = &imx519_internal_ops; ++ imx519->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | ++ V4L2_SUBDEV_FL_HAS_EVENTS; ++ imx519->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; ++ ++ /* Initialize source pads */ ++ imx519->pad.flags = MEDIA_PAD_FL_SOURCE; ++ ++ ret = media_entity_pads_init(&imx519->sd.entity, 1, &imx519->pad); ++ if (ret) { ++ dev_err(dev, "failed to init entity pads: %d\n", ret); ++ goto error_handler_free; ++ } ++ ++ ret = v4l2_async_register_subdev_sensor_common(&imx519->sd); ++ if (ret < 0) { ++ dev_err(dev, "failed to register sensor sub-device: %d\n", ret); ++ goto error_media_entity; ++ } ++ ++ return 0; ++ ++error_media_entity: ++ media_entity_cleanup(&imx519->sd.entity); ++ ++error_handler_free: ++ imx519_free_controls(imx519); ++ ++error_power_off: ++ pm_runtime_disable(&client->dev); ++ pm_runtime_set_suspended(&client->dev); ++ imx519_power_off(&client->dev); ++ ++ return ret; ++} ++ ++static int imx519_remove(struct i2c_client *client) ++{ ++ struct v4l2_subdev *sd = i2c_get_clientdata(client); ++ struct imx519 *imx519 = to_imx519(sd); ++ ++ v4l2_async_unregister_subdev(sd); ++ media_entity_cleanup(&sd->entity); ++ imx519_free_controls(imx519); ++ ++ pm_runtime_disable(&client->dev); ++ if (!pm_runtime_status_suspended(&client->dev)) ++ imx519_power_off(&client->dev); ++ pm_runtime_set_suspended(&client->dev); ++ ++ return 0; ++} ++ ++MODULE_DEVICE_TABLE(of, imx519_dt_ids); ++ ++static const struct dev_pm_ops imx519_pm_ops = { ++ SET_SYSTEM_SLEEP_PM_OPS(imx519_suspend, imx519_resume) ++ SET_RUNTIME_PM_OPS(imx519_power_off, imx519_power_on, NULL) ++}; ++ ++static struct i2c_driver imx519_i2c_driver = { ++ .driver = { ++ .name = "imx519", ++ .of_match_table = imx519_dt_ids, ++ .pm = &imx519_pm_ops, ++ }, ++ .probe_new = imx519_probe, ++ .remove = imx519_remove, ++}; ++ ++module_i2c_driver(imx519_i2c_driver); ++ ++MODULE_AUTHOR("Lee Jackson "); ++MODULE_DESCRIPTION("Sony IMX519 sensor driver"); ++MODULE_LICENSE("GPL v2"); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Arducam +Date: Wed, 15 Sep 2021 09:02:08 +0800 +Subject: [PATCH 859/889] media: i2c: imx519: Advertise embedded data node on + media pad 1 This commit updates the imx519 driver to adverise support for + embedded data streams. + +The imx519 sensor subdevice overloads the media pad to differentiate +between image stream (pad 0) and embedded data stream (pad 1) when +performing the v4l2_subdev_pad_ops functions. + +Signed-off-by: Lee Jackson +--- + drivers/media/i2c/imx519.c | 138 +++++++++++++++++++++++++++---------- + 1 file changed, 103 insertions(+), 35 deletions(-) + +diff --git a/drivers/media/i2c/imx519.c b/drivers/media/i2c/imx519.c +index d541f231a4f3..4e98704a6834 100644 +--- a/drivers/media/i2c/imx519.c ++++ b/drivers/media/i2c/imx519.c +@@ -93,6 +93,16 @@ + #define IMX519_TEST_PATTERN_B_DEFAULT 0 + #define IMX519_TEST_PATTERN_GB_DEFAULT 0 + ++/* Embedded metadata stream structure */ ++#define IMX519_EMBEDDED_LINE_WIDTH 16384 ++#define IMX519_NUM_EMBEDDED_LINES 1 ++ ++enum pad_types { ++ IMAGE_PAD, ++ METADATA_PAD, ++ NUM_PADS ++}; ++ + /* IMX519 native and active pixel array size. */ + #define IMX519_NATIVE_WIDTH 4672U + #define IMX519_NATIVE_HEIGHT 3648U +@@ -970,7 +980,7 @@ static const char * const imx519_supply_name[] = { + + struct imx519 { + struct v4l2_subdev sd; +- struct media_pad pad; ++ struct media_pad pad[NUM_PADS]; + + unsigned int fmt_code; + +@@ -1101,7 +1111,9 @@ static int imx519_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) + { + struct imx519 *imx519 = to_imx519(sd); + struct v4l2_mbus_framefmt *try_fmt_img = +- v4l2_subdev_get_try_format(sd, fh->pad, 0); ++ v4l2_subdev_get_try_format(sd, fh->pad, IMAGE_PAD); ++ struct v4l2_mbus_framefmt *try_fmt_meta = ++ v4l2_subdev_get_try_format(sd, fh->pad, METADATA_PAD); + struct v4l2_rect *try_crop; + + mutex_lock(&imx519->mutex); +@@ -1112,8 +1124,14 @@ static int imx519_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) + try_fmt_img->code = imx519_get_format_code(imx519); + try_fmt_img->field = V4L2_FIELD_NONE; + ++ /* Initialize try_fmt for the embedded metadata pad */ ++ try_fmt_meta->width = IMX519_EMBEDDED_LINE_WIDTH; ++ try_fmt_meta->height = IMX519_NUM_EMBEDDED_LINES; ++ try_fmt_meta->code = MEDIA_BUS_FMT_SENSOR_DATA; ++ try_fmt_meta->field = V4L2_FIELD_NONE; ++ + /* Initialize try_crop */ +- try_crop = v4l2_subdev_get_try_crop(sd, fh->pad, 0); ++ try_crop = v4l2_subdev_get_try_crop(sd, fh->pad, IMAGE_PAD); + try_crop->left = IMX519_PIXEL_ARRAY_LEFT; + try_crop->top = IMX519_PIXEL_ARRAY_TOP; + try_crop->width = IMX519_PIXEL_ARRAY_WIDTH; +@@ -1246,10 +1264,20 @@ static int imx519_enum_mbus_code(struct v4l2_subdev *sd, + { + struct imx519 *imx519 = to_imx519(sd); + +- if (code->index > 0) ++ if (code->pad >= NUM_PADS) + return -EINVAL; + +- code->code = imx519_get_format_code(imx519); ++ if (code->pad == IMAGE_PAD) { ++ if (code->index > 0) ++ return -EINVAL; ++ ++ code->code = imx519_get_format_code(imx519); ++ } else { ++ if (code->index > 0) ++ return -EINVAL; ++ ++ code->code = MEDIA_BUS_FMT_SENSOR_DATA; ++ } + + return 0; + } +@@ -1260,16 +1288,29 @@ static int imx519_enum_frame_size(struct v4l2_subdev *sd, + { + struct imx519 *imx519 = to_imx519(sd); + +- if (fse->index >= ARRAY_SIZE(supported_modes_10bit)) ++ if (fse->pad >= NUM_PADS) + return -EINVAL; + +- if (fse->code != imx519_get_format_code(imx519)) +- return -EINVAL; ++ if (fse->pad == IMAGE_PAD) { ++ if (fse->index >= ARRAY_SIZE(supported_modes_10bit)) ++ return -EINVAL; ++ ++ if (fse->code != imx519_get_format_code(imx519)) ++ return -EINVAL; ++ ++ fse->min_width = supported_modes_10bit[fse->index].width; ++ fse->max_width = fse->min_width; ++ fse->min_height = supported_modes_10bit[fse->index].height; ++ fse->max_height = fse->min_height; ++ } else { ++ if (fse->code != MEDIA_BUS_FMT_SENSOR_DATA || fse->index > 0) ++ return -EINVAL; + +- fse->min_width = supported_modes_10bit[fse->index].width; +- fse->max_width = fse->min_width; +- fse->min_height = supported_modes_10bit[fse->index].height; +- fse->max_height = fse->min_height; ++ fse->min_width = IMX519_EMBEDDED_LINE_WIDTH; ++ fse->max_width = fse->min_width; ++ fse->min_height = IMX519_NUM_EMBEDDED_LINES; ++ fse->max_height = fse->min_height; ++ } + + return 0; + } +@@ -1294,13 +1335,21 @@ static void imx519_update_image_pad_format(struct imx519 *imx519, + imx519_reset_colorspace(&fmt->format); + } + ++static void imx519_update_metadata_pad_format(struct v4l2_subdev_format *fmt) ++{ ++ fmt->format.width = IMX519_EMBEDDED_LINE_WIDTH; ++ fmt->format.height = IMX519_NUM_EMBEDDED_LINES; ++ fmt->format.code = MEDIA_BUS_FMT_SENSOR_DATA; ++ fmt->format.field = V4L2_FIELD_NONE; ++} ++ + static int imx519_get_pad_format(struct v4l2_subdev *sd, + struct v4l2_subdev_pad_config *cfg, + struct v4l2_subdev_format *fmt) + { + struct imx519 *imx519 = to_imx519(sd); + +- if (fmt->pad != 0) ++ if (fmt->pad >= NUM_PADS) + return -EINVAL; + + mutex_lock(&imx519->mutex); +@@ -1309,12 +1358,19 @@ static int imx519_get_pad_format(struct v4l2_subdev *sd, + struct v4l2_mbus_framefmt *try_fmt = + v4l2_subdev_get_try_format(&imx519->sd, cfg, fmt->pad); + /* update the code which could change due to vflip or hflip: */ +- try_fmt->code = imx519_get_format_code(imx519); ++ try_fmt->code = fmt->pad == IMAGE_PAD ? ++ imx519_get_format_code(imx519) : ++ MEDIA_BUS_FMT_SENSOR_DATA; + fmt->format = *try_fmt; + } else { +- imx519_update_image_pad_format(imx519, imx519->mode, +- fmt); +- fmt->format.code = imx519_get_format_code(imx519); ++ if (fmt->pad == IMAGE_PAD) { ++ imx519_update_image_pad_format(imx519, imx519->mode, ++ fmt); ++ fmt->format.code = ++ imx519_get_format_code(imx519); ++ } else { ++ imx519_update_metadata_pad_format(fmt); ++ } + } + + mutex_unlock(&imx519->mutex); +@@ -1375,28 +1431,39 @@ static int imx519_set_pad_format(struct v4l2_subdev *sd, + const struct imx519_mode *mode; + struct imx519 *imx519 = to_imx519(sd); + +- if (fmt->pad != 0) ++ if (fmt->pad >= NUM_PADS) + return -EINVAL; + + mutex_lock(&imx519->mutex); + +- /* Bayer order varies with flips */ +- fmt->format.code = imx519_get_format_code(imx519); ++ if (fmt->pad == IMAGE_PAD) { ++ /* Bayer order varies with flips */ ++ fmt->format.code = imx519_get_format_code(imx519); + +- mode = v4l2_find_nearest_size(supported_modes_10bit, +- ARRAY_SIZE(supported_modes_10bit), +- width, height, +- fmt->format.width, +- fmt->format.height); +- imx519_update_image_pad_format(imx519, mode, fmt); +- if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { +- framefmt = v4l2_subdev_get_try_format(sd, cfg, +- fmt->pad); +- *framefmt = fmt->format; ++ mode = v4l2_find_nearest_size(supported_modes_10bit, ++ ARRAY_SIZE(supported_modes_10bit), ++ width, height, ++ fmt->format.width, ++ fmt->format.height); ++ imx519_update_image_pad_format(imx519, mode, fmt); ++ if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { ++ framefmt = v4l2_subdev_get_try_format(sd, cfg, ++ fmt->pad); ++ *framefmt = fmt->format; ++ } else { ++ imx519->mode = mode; ++ imx519->fmt_code = fmt->format.code; ++ imx519_set_framing_limits(imx519); ++ } + } else { +- imx519->mode = mode; +- imx519->fmt_code = fmt->format.code; +- imx519_set_framing_limits(imx519); ++ if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { ++ framefmt = v4l2_subdev_get_try_format(sd, cfg, ++ fmt->pad); ++ *framefmt = fmt->format; ++ } else { ++ /* Only one embedded data mode is supported */ ++ imx519_update_metadata_pad_format(fmt); ++ } + } + + mutex_unlock(&imx519->mutex); +@@ -1952,9 +2019,10 @@ static int imx519_probe(struct i2c_client *client) + imx519->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; + + /* Initialize source pads */ +- imx519->pad.flags = MEDIA_PAD_FL_SOURCE; ++ imx519->pad[IMAGE_PAD].flags = MEDIA_PAD_FL_SOURCE; ++ imx519->pad[METADATA_PAD].flags = MEDIA_PAD_FL_SOURCE; + +- ret = media_entity_pads_init(&imx519->sd.entity, 1, &imx519->pad); ++ ret = media_entity_pads_init(&imx519->sd.entity, NUM_PADS, imx519->pad); + if (ret) { + dev_err(dev, "failed to init entity pads: %d\n", ret); + goto error_handler_free; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lee Jackson +Date: Thu, 26 Aug 2021 11:15:26 +0800 +Subject: [PATCH 860/889] configs: Add CONFIG_VIDEO_IMX519=m Include the driver + module for the IMX519. + +Signed-off-by: Lee Jackson +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcm2711_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + arch/arm64/configs/bcm2711_defconfig | 1 + + arch/arm64/configs/bcmrpi3_defconfig | 1 + + 5 files changed, 5 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index e9314965177d..01647771d82c 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -925,6 +925,7 @@ CONFIG_VIDEO_TW9906=m + CONFIG_VIDEO_IMX219=m + CONFIG_VIDEO_IMX290=m + CONFIG_VIDEO_IMX477=m ++CONFIG_VIDEO_IMX519=m + CONFIG_VIDEO_OV5647=m + CONFIG_VIDEO_OV7251=m + CONFIG_VIDEO_OV7640=m +diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig +index 0863b1666af3..b20048096ead 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -939,6 +939,7 @@ CONFIG_VIDEO_TW9906=m + CONFIG_VIDEO_IMX219=m + CONFIG_VIDEO_IMX290=m + CONFIG_VIDEO_IMX477=m ++CONFIG_VIDEO_IMX519=m + CONFIG_VIDEO_OV5647=m + CONFIG_VIDEO_OV7251=m + CONFIG_VIDEO_OV7640=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index b437a7274f6e..a2fd71f42c63 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -918,6 +918,7 @@ CONFIG_VIDEO_TW9906=m + CONFIG_VIDEO_IMX219=m + CONFIG_VIDEO_IMX290=m + CONFIG_VIDEO_IMX477=m ++CONFIG_VIDEO_IMX519=m + CONFIG_VIDEO_OV5647=m + CONFIG_VIDEO_OV7251=m + CONFIG_VIDEO_OV7640=m +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index 532935a02228..2465c624456c 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -940,6 +940,7 @@ CONFIG_VIDEO_TW9906=m + CONFIG_VIDEO_IMX219=m + CONFIG_VIDEO_IMX290=m + CONFIG_VIDEO_IMX477=m ++CONFIG_VIDEO_IMX519=m + CONFIG_VIDEO_OV5647=m + CONFIG_VIDEO_OV7251=m + CONFIG_VIDEO_OV7640=m +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index 241c6c3efca6..26fe691cb9a2 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -863,6 +863,7 @@ CONFIG_VIDEO_TW9906=m + CONFIG_VIDEO_IMX219=m + CONFIG_VIDEO_IMX290=m + CONFIG_VIDEO_IMX477=m ++CONFIG_VIDEO_IMX519=m + CONFIG_VIDEO_OV5647=m + CONFIG_VIDEO_OV7251=m + CONFIG_VIDEO_OV7640=m +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lee Jackson +Date: Fri, 27 Aug 2021 14:45:43 +0800 +Subject: [PATCH 861/889] overlays: Add imx519-overlay.dts Added overlays for + enabling IMX519 and add the relevant information to the README. + +Signed-off-by: Lee Jackson +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 11 ++ + arch/arm/boot/dts/overlays/imx519-overlay.dts | 115 ++++++++++++++++++ + 3 files changed, 127 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/imx519-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 65e8b3f7c7e8..d10ff5c61a12 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -98,6 +98,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + imx290.dtbo \ + imx378.dtbo \ + imx477.dtbo \ ++ imx519.dtbo \ + iqaudio-codec.dtbo \ + iqaudio-dac.dtbo \ + iqaudio-dacplus.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index cda354151d79..aa2271cd6c29 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -1738,6 +1738,17 @@ Params: rotation Mounting rotation of the camera sensor (0 or + 2 = external, default external) + + ++Name: imx519 ++Info: Sony IMX519 camera module. ++ Uses Unicam 1, which is the standard camera connector on most Pi ++ variants. ++Load: dtoverlay=imx519,= ++Params: rotation Mounting rotation of the camera sensor (0 or ++ 180, default 0) ++ orientation Sensor orientation (0 = front, 1 = rear, ++ 2 = external, default external) ++ ++ + Name: iqaudio-codec + Info: Configures the IQaudio Codec audio card + Load: dtoverlay=iqaudio-codec +diff --git a/arch/arm/boot/dts/overlays/imx519-overlay.dts b/arch/arm/boot/dts/overlays/imx519-overlay.dts +new file mode 100644 +index 000000000000..693c267af1f0 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/imx519-overlay.dts +@@ -0,0 +1,115 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++// Definitions for imx519 camera module on VC I2C bus ++/dts-v1/; ++/plugin/; ++ ++#include ++ ++/{ ++ compatible = "brcm,bcm2835"; ++ ++ fragment@0 { ++ target = <&i2c_csi_dsi>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ imx519: imx519@1a { ++ compatible = "sony,imx519"; ++ reg = <0x1a>; ++ status = "okay"; ++ ++ clocks = <&imx519_clk>; ++ clock-names = "xclk"; ++ ++ VANA-supply = <&cam1_reg>; /* 2.8v */ ++ VDIG-supply = <&imx519_vdig>; /* 1.8v */ ++ VDDL-supply = <&imx519_vddl>; /* 1.2v */ ++ ++ rotation = <0>; ++ orientation = <2>; ++ ++ port { ++ imx519_0: endpoint { ++ remote-endpoint = <&csi1_ep>; ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ clock-noncontinuous; ++ link-frequencies = ++ /bits/ 64 <493500000>; ++ }; ++ }; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&csi1>; ++ __overlay__ { ++ status = "okay"; ++ ++ port{ ++ csi1_ep: endpoint{ ++ remote-endpoint = <&imx519_0>; ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ clock-noncontinuous; ++ }; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c0if>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@3 { ++ target-path="/"; ++ __overlay__ { ++ imx519_vdig: fixedregulator@1 { ++ compatible = "regulator-fixed"; ++ regulator-name = "imx519_vdig"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ }; ++ imx519_vddl: fixedregulator@2 { ++ compatible = "regulator-fixed"; ++ regulator-name = "imx519_vddl"; ++ regulator-min-microvolt = <1200000>; ++ regulator-max-microvolt = <1200000>; ++ }; ++ ++ imx519_clk: camera-clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <24000000>; ++ }; ++ }; ++ }; ++ ++ fragment@4 { ++ target = <&i2c0mux>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@5 { ++ target = <&cam1_reg>; ++ __overlay__ { ++ status = "okay"; ++ regulator-name = "imx519_vana"; ++ regulator-min-microvolt = <2800000>; ++ regulator-max-microvolt = <2800000>; ++ }; ++ }; ++ ++ __overrides__ { ++ rotation = <&imx519>,"rotation:0"; ++ orientation = <&imx519>,"orientation:0"; ++ }; ++}; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 4 Oct 2021 14:15:38 +0100 +Subject: [PATCH 862/889] dtoverlays: Add overlay for ST7735R (160x128) TinyDRM + driver + +Adds an overlay to configure the TinyDRM driver for ST7735R +based 160x128 and 128x128 (untested) displays such as the +Adafruit 1.8" display. + +Signed-off-by: Dave Stevenson +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 14 ++++ + .../dts/overlays/adafruit-st7735r-overlay.dts | 83 +++++++++++++++++++ + 3 files changed, 98 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/adafruit-st7735r-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index d10ff5c61a12..b36c618b01d0 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += overlay_map.dtb + + dtbo-$(CONFIG_ARCH_BCM2835) += \ + act-led.dtbo \ ++ adafruit-st7735r.dtbo \ + adafruit18.dtbo \ + adau1977-adc.dtbo \ + adau7002-simple.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index aa2271cd6c29..5064d8eb2040 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -299,9 +299,23 @@ Params: activelow Set to "on" to invert the sense of the LED + REQUIRED + + ++Name: adafruit-st7735r ++Info: Overlay for the SPI-connected Adafruit 1.8" 160x128 or 128x128 displays, ++ based on the ST7735R chip. ++ This overlay uses the newer DRM/KMS "Tiny" driver. ++Load: dtoverlay=adafruit-st7735r,= ++Params: 128x128 Select the 128x128 driver (default 160x128) ++ rotate Display rotation {0,90,180,270} (default 90) ++ speed SPI bus speed in Hz (default 4000000) ++ dc_pin GPIO pin for D/C (default 24) ++ reset_pin GPIO pin for RESET (default 25) ++ led_pin GPIO used to control backlight (default 18) ++ ++ + Name: adafruit18 + Info: Overlay for the SPI-connected Adafruit 1.8" display (based on the + ST7735R chip). It includes support for the "green tab" version. ++ This overlay uses the older fbtft driver. + Load: dtoverlay=adafruit18,= + Params: green Use the adafruit18_green variant. + rotate Display rotation {0,90,180,270} +diff --git a/arch/arm/boot/dts/overlays/adafruit-st7735r-overlay.dts b/arch/arm/boot/dts/overlays/adafruit-st7735r-overlay.dts +new file mode 100644 +index 000000000000..bf186811ec5d +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/adafruit-st7735r-overlay.dts +@@ -0,0 +1,83 @@ ++/* ++ * adafruit-st7735r-overlay.dts ++ * ++ * ST7735R based SPI LCD displays. Either ++ * Adafruit 1.8" 160x128 ++ * or ++ * Okaya 1.44" 128x128 ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++#include ++ ++/ { ++ compatible = "brcm,bcm2835"; ++ ++ fragment@0 { ++ target = <&spidev0>; ++ __overlay__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ adafruit_pins: adafruit_pins { ++ brcm,pins = <25 24>; ++ brcm,function = <1>; /* out */ ++ }; ++ backlight_pins: backlight_pins { ++ brcm,pins = <18>; ++ brcm,function = <1>; /* out */ ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target-path = "/"; ++ __overlay__ { ++ af18_backlight: backlight { ++ compatible = "gpio-backlight"; ++ gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&backlight_pins>; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&spi0>; ++ __overlay__ { ++ /* needed to avoid dtc warning */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ af18: adafruit18@0 { ++ compatible = "jianda,jd-t18003-t01"; ++ reg = <0>; ++ spi-max-frequency = <32000000>; ++ dc-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>; ++ reset-gpios = <&gpio 25 GPIO_ACTIVE_HIGH>; ++ rotate = <90>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&adafruit_pins>; ++ backlight = <&af18_backlight>; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ 128x128 = <&af18>, "compatible=okaya,rh128128t"; ++ speed = <&af18>,"spi-max-frequency:0"; ++ rotate = <&af18>,"rotate:0"; ++ dc_pin = <&af18>,"dc-gpios:4", <&adafruit_pins>,"brcm,pins:4"; ++ reset_pin = <&af18>,"reset-gpios:4", ++ <&adafruit_pins>,"brcm,pins:0"; ++ led_pin = <&af18_backlight>,"gpios:4", ++ <&backlight_pins>,"brcm,pins:0"; ++ }; ++}; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jonathan Bell +Date: Wed, 6 Oct 2021 15:27:53 +0100 +Subject: [PATCH 863/889] dwc_otg: pay attention to qh->interval when + rescheduling periodic queues + +A regression introduced in https://github.com/raspberrypi/linux/pull/3887 +meant that if the newly scheduled transfer immediately returned data, and +the driver resubmitted a single URB after every transfer, then the effective +polling interval would end up being approx 1ms. + +Use the larger of SCHEDULE_SLOP or the configured endpoint interval. + +Signed-off-by: Jonathan Bell +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +index 4503af692aef..f51fad1e6b70 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +@@ -691,7 +691,7 @@ int dwc_otg_hcd_qh_add(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) + } else { + /* If the QH wasn't in a schedule, then sched_frame is stale. */ + qh->sched_frame = dwc_frame_num_inc(dwc_otg_hcd_get_frame_number(hcd), +- SCHEDULE_SLOP); ++ max_t(uint32_t, qh->interval, SCHEDULE_SLOP)); + status = schedule_periodic(hcd, qh); + qh->start_split_frame = qh->sched_frame; + if ( !hcd->periodic_qh_count ) { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Joerg Schambacher +Date: Wed, 6 Oct 2021 17:19:58 +0200 +Subject: [PATCH 864/889] Hifiberry DAC+ADCPro DT overlay: add optional + headphone amp + +This is a copy of the approach from our DAC+ driver. +It allows to probe (and activate) an optional TPA6130A2 headphone +amplifier. + +Signed-off-by: Joerg Schambacher +--- + .../boot/dts/overlays/hifiberry-dacplusadcpro-overlay.dts | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/arch/arm/boot/dts/overlays/hifiberry-dacplusadcpro-overlay.dts b/arch/arm/boot/dts/overlays/hifiberry-dacplusadcpro-overlay.dts +index cafa2ccd7ff7..561cd84bbb79 100644 +--- a/arch/arm/boot/dts/overlays/hifiberry-dacplusadcpro-overlay.dts ++++ b/arch/arm/boot/dts/overlays/hifiberry-dacplusadcpro-overlay.dts +@@ -43,6 +43,11 @@ + clocks = <&dacpro_osc>; + status = "okay"; + }; ++ hpamp: hpamp@60 { ++ compatible = "ti,tpa6130a2"; ++ reg = <0x60>; ++ status = "disabled"; ++ }; + }; + }; + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Joerg Schambacher +Date: Wed, 6 Oct 2021 17:21:07 +0200 +Subject: [PATCH 865/889] Hifiberry DAC+ADCPro: adding optional headphone amp + control + +This is a copy of the code and approach from our DAC+ driver. +It allows to probe (and activate) an optional TPA6130A2 headphone +amplifier. Updated email address. + +Signed-off-by: Joerg Schambacher +--- + sound/soc/bcm/Kconfig | 3 +- + sound/soc/bcm/hifiberry_dacplusadcpro.c | 74 ++++++++++++++++++++++++- + 2 files changed, 73 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index d65df373c39e..c85714895f1e 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -79,7 +79,8 @@ config SND_BCM2708_SOC_HIFIBERRY_DACPLUSADCPRO + tristate "Support for HifiBerry DAC+ADC PRO" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S + select SND_SOC_PCM512x_I2C +- select SND_SOC_PCM186X_I2C ++ select SND_SOC_PCM186X_I2C ++ select SND_SOC_TPA6130A2 + select COMMON_CLK_HIFIBERRY_DACPRO + help + Say Y or M if you want to add support for HifiBerry DAC+ADC PRO. +diff --git a/sound/soc/bcm/hifiberry_dacplusadcpro.c b/sound/soc/bcm/hifiberry_dacplusadcpro.c +index 79eccdb4dc8c..517a70fba7d7 100644 +--- a/sound/soc/bcm/hifiberry_dacplusadcpro.c ++++ b/sound/soc/bcm/hifiberry_dacplusadcpro.c +@@ -4,8 +4,8 @@ + * Author: Daniel Matuschek, Stuart MacLean + * Copyright 2014-2015 + * based on code by Florian Meier +- * ADC added by Joerg Schambacher +- * Copyright 2018-19 ++ * ADC, HP added by Joerg Schambacher ++ * Copyright 2018-21 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -468,6 +469,15 @@ static struct snd_soc_dai_link snd_rpi_hifiberry_dacplusadcpro_dai[] = { + }, + }; + ++/* aux device for optional headphone amp */ ++static struct snd_soc_aux_dev hifiberry_dacplusadcpro_aux_devs[] = { ++ { ++ .dlc = { ++ .name = "tpa6130a2.1-0060", ++ }, ++ }, ++}; ++ + /* audio machine driver */ + static struct snd_soc_card snd_rpi_hifiberry_dacplusadcpro = { + .name = "snd_rpi_hifiberry_dacplusadcpro", +@@ -477,10 +487,68 @@ static struct snd_soc_card snd_rpi_hifiberry_dacplusadcpro = { + .num_links = ARRAY_SIZE(snd_rpi_hifiberry_dacplusadcpro_dai), + }; + ++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; ++}; ++ ++static struct property tpa_enable_prop = { ++ .name = "status", ++ .length = 4 + 1, /* length 'okay' + 1 */ ++ .value = "okay", ++ }; ++ + static int snd_rpi_hifiberry_dacplusadcpro_probe(struct platform_device *pdev) + { + int ret = 0, i = 0; + struct snd_soc_card *card = &snd_rpi_hifiberry_dacplusadcpro; ++ struct device_node *tpa_node; ++ struct property *tpa_prop; ++ struct of_changeset ocs; ++ int len; ++ ++ /* probe for head phone amp */ ++ ret = hb_hp_detect(); ++ if (ret < 0) ++ return ret; ++ if (ret) { ++ card->aux_dev = hifiberry_dacplusadcpro_aux_devs; ++ card->num_aux_devs = ++ ARRAY_SIZE(hifiberry_dacplusadcpro_aux_devs); ++ tpa_node = of_find_compatible_node(NULL, NULL, "ti,tpa6130a2"); ++ tpa_prop = of_find_property(tpa_node, "status", &len); ++ ++ if (strcmp((char *)tpa_prop->value, "okay")) { ++ /* and activate headphone using change_sets */ ++ dev_info(&pdev->dev, "activating headphone amplifier"); ++ of_changeset_init(&ocs); ++ ret = of_changeset_update_property(&ocs, tpa_node, ++ &tpa_enable_prop); ++ if (ret) { ++ dev_err(&pdev->dev, ++ "cannot activate headphone amplifier\n"); ++ return -ENODEV; ++ } ++ ret = of_changeset_apply(&ocs); ++ if (ret) { ++ dev_err(&pdev->dev, ++ "cannot activate headphone amplifier\n"); ++ return -ENODEV; ++ } ++ } ++ } + + snd_rpi_hifiberry_dacplusadcpro.dev = &pdev->dev; + if (pdev->dev.of_node) { +@@ -531,7 +599,7 @@ static struct platform_driver snd_rpi_hifiberry_dacplusadcpro_driver = { + + module_platform_driver(snd_rpi_hifiberry_dacplusadcpro_driver); + +-MODULE_AUTHOR("Joerg Schambacher "); ++MODULE_AUTHOR("Joerg Schambacher "); + MODULE_AUTHOR("Daniel Matuschek "); + MODULE_DESCRIPTION("ASoC Driver for HiFiBerry DAC+ADC"); + MODULE_LICENSE("GPL v2"); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sten Spans +Date: Tue, 12 Oct 2021 20:10:00 +0200 +Subject: [PATCH 866/889] Add module for 8111h chip used in various CM4 boards + +--- + arch/arm/configs/bcm2711_defconfig | 1 + + arch/arm64/configs/bcm2711_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig +index b20048096ead..a380d6f6ad37 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -514,6 +514,7 @@ CONFIG_BCMGENET=y + CONFIG_ENC28J60=m + CONFIG_QCA7000_SPI=m + CONFIG_QCA7000_UART=m ++CONFIG_R8169=m + CONFIG_WIZNET_W5100=m + CONFIG_WIZNET_W5100_SPI=m + CONFIG_MICREL_PHY=y +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index 2465c624456c..aae05dfcaaf3 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -509,6 +509,7 @@ CONFIG_BCMGENET=y + CONFIG_ENC28J60=m + CONFIG_QCA7000_SPI=m + CONFIG_QCA7000_UART=m ++CONFIG_R8169=m + CONFIG_WIZNET_W5100=m + CONFIG_WIZNET_W5100_SPI=m + CONFIG_MICREL_PHY=y +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 8 Jul 2021 09:37:10 +0100 +Subject: [PATCH 867/889] clk: bcm2835: Pass DT node to rpi_firmware_get + +The fw_node pointer has already been retrieved, and using it allows +us to remove a downstream patch to the firmware driver. + +Signed-off-by: Phil Elwell +--- + drivers/clk/bcm/clk-bcm2835.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c +index 20155bb28e3c..39fabced602a 100644 +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -2345,7 +2345,7 @@ static int bcm2835_clk_probe(struct platform_device *pdev) + + fw_node = of_parse_phandle(dev->of_node, "firmware", 0); + if (fw_node) { +- struct rpi_firmware *fw = rpi_firmware_get(NULL); ++ struct rpi_firmware *fw = rpi_firmware_get(fw_node); + if (!fw) + return -EPROBE_DEFER; + cprman->fw = fw; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 14 Oct 2021 11:09:18 +0100 +Subject: [PATCH 868/889] drivers/gpio: Add a driver that wraps the PWM API as + a GPIO controller + +For cases where spare PWM outputs are available, but are desired +to be addressed a standard outputs instead. +Wraps a PWM channel as a new GPIO chip with the one output. + +Signed-off-by: Dave Stevenson +--- + drivers/gpio/Kconfig | 8 +++ + drivers/gpio/Makefile | 1 + + drivers/gpio/gpio-pwm.c | 144 ++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 153 insertions(+) + create mode 100644 drivers/gpio/gpio-pwm.c + +diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig +index f021a024d096..d4f77fa37d40 100644 +--- a/drivers/gpio/Kconfig ++++ b/drivers/gpio/Kconfig +@@ -473,6 +473,14 @@ config GPIO_PMIC_EIC_SPRD + help + Say yes here to support Spreadtrum PMIC EIC device. + ++config GPIO_PWM ++ tristate "PWM chip GPIO" ++ depends on OF_GPIO ++ depends on PWM ++ help ++ Turn on support for exposing a PWM chip as a GPIO ++ driver. ++ + config GPIO_PXA + bool "PXA GPIO support" + depends on ARCH_PXA || ARCH_MMP || COMPILE_TEST +diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile +index a66b89e3d0c3..71dda8a5625d 100644 +--- a/drivers/gpio/Makefile ++++ b/drivers/gpio/Makefile +@@ -120,6 +120,7 @@ obj-$(CONFIG_GPIO_PCI_IDIO_16) += gpio-pci-idio-16.o + obj-$(CONFIG_GPIO_PISOSR) += gpio-pisosr.o + obj-$(CONFIG_GPIO_PL061) += gpio-pl061.o + obj-$(CONFIG_GPIO_PMIC_EIC_SPRD) += gpio-pmic-eic-sprd.o ++obj-$(CONFIG_GPIO_PWM) += gpio-pwm.o + obj-$(CONFIG_GPIO_PXA) += gpio-pxa.o + obj-$(CONFIG_GPIO_RASPBERRYPI_EXP) += gpio-raspberrypi-exp.o + obj-$(CONFIG_GPIO_RC5T583) += gpio-rc5t583.o +diff --git a/drivers/gpio/gpio-pwm.c b/drivers/gpio/gpio-pwm.c +new file mode 100644 +index 000000000000..89f5d6b353ab +--- /dev/null ++++ b/drivers/gpio/gpio-pwm.c +@@ -0,0 +1,144 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * GPIO driver wrapping PWM API ++ * ++ * PWM 0% and PWM 100% are equivalent to digital GPIO ++ * outputs, and there are times where it is useful to use ++ * PWM outputs as straight GPIOs (eg outputs of NXP PCA9685 ++ * I2C PWM chip). This driver wraps the PWM API as a GPIO ++ * controller. ++ * ++ * Copyright (C) 2021 Raspberry Pi (Trading) Ltd. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++struct pwm_gpio { ++ struct gpio_chip gc; ++ struct pwm_device **pwm; ++}; ++ ++static int pwm_gpio_get_direction(struct gpio_chip *gc, unsigned int off) ++{ ++ return GPIO_LINE_DIRECTION_OUT; ++} ++ ++static void pwm_gpio_set(struct gpio_chip *gc, unsigned int off, int val) ++{ ++ struct pwm_gpio *pwm_gpio = gpiochip_get_data(gc); ++ struct pwm_state state; ++ ++ pwm_get_state(pwm_gpio->pwm[off], &state); ++ state.duty_cycle = val ? state.period : 0; ++ pwm_apply_state(pwm_gpio->pwm[off], &state); ++} ++ ++static int pwm_gpio_parse_dt(struct pwm_gpio *pwm_gpio, ++ struct device *dev) ++{ ++ struct device_node *node = dev->of_node; ++ struct pwm_state state; ++ int ret = 0, i, num_gpios; ++ const char *pwm_name; ++ ++ if (!node) ++ return -ENODEV; ++ ++ num_gpios = of_property_count_strings(node, "pwm-names"); ++ if (num_gpios <= 0) ++ return 0; ++ ++ pwm_gpio->pwm = devm_kzalloc(dev, ++ sizeof(*pwm_gpio->pwm) * num_gpios, ++ GFP_KERNEL); ++ if (!pwm_gpio->pwm) ++ return -ENOMEM; ++ ++ for (i = 0; i < num_gpios; i++) { ++ ret = of_property_read_string_index(node, "pwm-names", i, ++ &pwm_name); ++ if (ret) { ++ dev_err(dev, "unable to get pwm device index %d, name %s", ++ i, pwm_name); ++ goto error; ++ } ++ ++ pwm_gpio->pwm[i] = devm_pwm_get(dev, pwm_name); ++ if (IS_ERR(pwm_gpio->pwm[i])) { ++ ret = PTR_ERR(pwm_gpio->pwm[i]); ++ if (ret != -EPROBE_DEFER) ++ dev_err(dev, "unable to request PWM\n"); ++ goto error; ++ } ++ ++ /* Sync up PWM state. */ ++ pwm_init_state(pwm_gpio->pwm[i], &state); ++ ++ state.duty_cycle = 0; ++ pwm_apply_state(pwm_gpio->pwm[i], &state); ++ } ++ ++ pwm_gpio->gc.ngpio = num_gpios; ++ ++error: ++ return ret; ++} ++ ++static int pwm_gpio_probe(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct pwm_gpio *pwm_gpio; ++ int ret; ++ ++ pwm_gpio = devm_kzalloc(dev, sizeof(*pwm_gpio), GFP_KERNEL); ++ if (!pwm_gpio) ++ return -ENOMEM; ++ ++ pwm_gpio->gc.parent = dev; ++ pwm_gpio->gc.label = "pwm-gpio"; ++ pwm_gpio->gc.owner = THIS_MODULE; ++ pwm_gpio->gc.of_node = dev->of_node; ++ pwm_gpio->gc.base = -1; ++ ++ pwm_gpio->gc.get_direction = pwm_gpio_get_direction; ++ pwm_gpio->gc.set = pwm_gpio_set; ++ pwm_gpio->gc.can_sleep = true; ++ ++ ret = pwm_gpio_parse_dt(pwm_gpio, dev); ++ if (ret) ++ return ret; ++ ++ if (!pwm_gpio->gc.ngpio) ++ return 0; ++ ++ return devm_gpiochip_add_data(dev, &pwm_gpio->gc, pwm_gpio); ++} ++ ++static int pwm_gpio_remove(struct platform_device *pdev) ++{ ++ return 0; ++} ++ ++static const struct of_device_id pwm_gpio_of_match[] = { ++ { .compatible = "pwm-gpio" }, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, pwm_gpio_of_match); ++ ++static struct platform_driver pwm_gpio_driver = { ++ .driver = { ++ .name = "pwm-gpio", ++ .of_match_table = of_match_ptr(pwm_gpio_of_match), ++ }, ++ .probe = pwm_gpio_probe, ++ .remove = pwm_gpio_remove, ++}; ++module_platform_driver(pwm_gpio_driver); ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Dave Stevenson "); ++MODULE_DESCRIPTION("PWM GPIO driver"); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 15 Oct 2021 08:46:19 +0100 +Subject: [PATCH 869/889] mmc: sdhost: Pass DT pointer to rpi_firmware_get + +Using the rpi_firmware API as intended allows proper reference counting +of the firmware device and means we can remove a downstream patch to +the firmware driver. + +Signed-off-by: Phil Elwell +--- + drivers/mmc/host/bcm2835-sdhost.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c +index 7caba5e12f79..2c4124082785 100644 +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -147,6 +147,8 @@ + struct bcm2835_host { + spinlock_t lock; + ++ struct rpi_firmware *fw; ++ + void __iomem *ioaddr; + phys_addr_t bus_addr; + +@@ -1558,7 +1560,7 @@ void bcm2835_sdhost_set_clock(struct bcm2835_host *host, unsigned int clock) + if (host->firmware_sets_cdiv) { + u32 msg[3] = { clock, 0, 0 }; + +- rpi_firmware_property(rpi_firmware_get(NULL), ++ rpi_firmware_property(host->fw, + RPI_FIRMWARE_SET_SDHOST_CLOCK, + &msg, sizeof(msg)); + +@@ -2100,6 +2102,13 @@ static int bcm2835_sdhost_probe(struct platform_device *pdev) + goto err; + } + ++ host->fw = rpi_firmware_get( ++ of_parse_phandle(dev->of_node, "firmware", 0)); ++ if (!host->fw) { ++ ret = -EPROBE_DEFER; ++ goto err; ++ } ++ + host->max_clk = clk_get_rate(clk); + + host->irq = platform_get_irq(pdev, 0); +@@ -2124,7 +2133,7 @@ static int bcm2835_sdhost_probe(struct platform_device *pdev) + msg[1] = ~0; + msg[2] = ~0; + +- rpi_firmware_property(rpi_firmware_get(NULL), ++ rpi_firmware_property(host->fw, + RPI_FIRMWARE_SET_SDHOST_CLOCK, + &msg, sizeof(msg)); + +@@ -2142,6 +2151,8 @@ static int bcm2835_sdhost_probe(struct platform_device *pdev) + + err: + pr_debug("bcm2835_sdhost_probe -> err %d\n", ret); ++ if (host->fw) ++ rpi_firmware_put(host->fw); + if (host->dma_chan_rxtx) + dma_release_channel(host->dma_chan_rxtx); + mmc_free_host(mmc); +@@ -2164,6 +2175,7 @@ static int bcm2835_sdhost_remove(struct platform_device *pdev) + del_timer_sync(&host->timer); + + tasklet_kill(&host->finish_tasklet); ++ rpi_firmware_put(host->fw); + if (host->dma_chan_rxtx) + dma_release_channel(host->dma_chan_rxtx); + mmc_free_host(host->mmc); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 15 Oct 2021 09:19:01 +0100 +Subject: [PATCH 870/889] ARM: dts: Give sdhost a firmware reference + +Using the rpi_firmware API as intended allows proper reference counting +of the firmware device and means we can remove a downstream patch to +the firmware driver. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm270x.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/bcm270x.dtsi b/arch/arm/boot/dts/bcm270x.dtsi +index 8a0e2f200997..badcf341ecd2 100644 +--- a/arch/arm/boot/dts/bcm270x.dtsi ++++ b/arch/arm/boot/dts/bcm270x.dtsi +@@ -208,6 +208,7 @@ + bus-width = <4>; + brcm,overclock-50 = <0>; + brcm,pio-limit = <1>; ++ firmware = <&firmware>; + }; + + &spi0 { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 15 Oct 2021 11:45:36 +0100 +Subject: [PATCH 871/889] rtc: pcf85063: Always clear EXT_TEST from set_time + +Power-on reset after the insertion of a battery does not always complete +successfully, leading to corrupted register content. The EXT_TEST bit +will stop the clock from running, but currently the driver will never +recover. + +Safely handle the erroneous state by clearing EXT_TEST as part of the +usual set_time method. + +Signed-off-by: Phil Elwell +--- + drivers/rtc/rtc-pcf85063.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c +index 62684ca3a665..fc293d4d8901 100644 +--- a/drivers/rtc/rtc-pcf85063.c ++++ b/drivers/rtc/rtc-pcf85063.c +@@ -34,6 +34,7 @@ + #define PCF85063_REG_CTRL1 0x00 /* status */ + #define PCF85063_REG_CTRL1_CAP_SEL BIT(0) + #define PCF85063_REG_CTRL1_STOP BIT(5) ++#define PCF85063_REG_CTRL1_EXT_TEST BIT(7) + + #define PCF85063_REG_CTRL2 0x01 + #define PCF85063_CTRL2_AF BIT(6) +@@ -117,6 +118,7 @@ static int pcf85063_rtc_set_time(struct device *dev, struct rtc_time *tm) + * reset state until all time/date registers are written + */ + rc = regmap_update_bits(pcf85063->regmap, PCF85063_REG_CTRL1, ++ PCF85063_REG_CTRL1_EXT_TEST | + PCF85063_REG_CTRL1_STOP, + PCF85063_REG_CTRL1_STOP); + if (rc) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 11 Oct 2021 17:33:05 +0100 +Subject: [PATCH 872/889] char: vcio: Rewrite as a firmware node child + +The old vcio driver is a simple character device that manually locates +the firmware driver. Initialising it before the firmware driver causes +a failure, and no retries are attempted. + +Rewrite vcio as a platform driver that depends on a DT node for its +instantiation and the location of the firmware driver, making use of +the miscdevice framework to reduce the code size. + +N.B. Using miscdevice changes the udev SUBSYSTEM string, so a change +to the companion udev rule is required in order to continue to set +the correct device permissions, e.g.: + + KERNEL="vcio", GROUP="video", MODE="0660" + +See: https://github.com/raspberrypi/linux/issues/4620 + +Signed-off-by: Phil Elwell +--- + drivers/char/broadcom/vcio.c | 133 ++++++++++++++++------------------- + 1 file changed, 62 insertions(+), 71 deletions(-) + +diff --git a/drivers/char/broadcom/vcio.c b/drivers/char/broadcom/vcio.c +index a39155a94fb7..ac314617229c 100644 +--- a/drivers/char/broadcom/vcio.c ++++ b/drivers/char/broadcom/vcio.c +@@ -1,6 +1,7 @@ + /* + * Copyright (C) 2010 Broadcom + * Copyright (C) 2015 Noralf Trønnes ++ * Copyright (C) 2021 Raspberry Pi (Trading) Ltd. + * + * 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 +@@ -8,8 +9,6 @@ + * + */ + +-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +- + #include + #include + #include +@@ -19,24 +18,22 @@ + #include + #include + #include ++#include + #include + +-#define MBOX_CHAN_PROPERTY 8 +- ++#define MODULE_NAME "vcio" + #define VCIO_IOC_MAGIC 100 + #define IOCTL_MBOX_PROPERTY _IOWR(VCIO_IOC_MAGIC, 0, char *) + #ifdef CONFIG_COMPAT + #define IOCTL_MBOX_PROPERTY32 _IOWR(VCIO_IOC_MAGIC, 0, compat_uptr_t) + #endif + +-static struct { +- dev_t devt; +- struct cdev cdev; +- struct class *class; ++struct vcio_data { + struct rpi_firmware *fw; +-} vcio; ++ struct miscdevice misc_dev; ++}; + +-static int vcio_user_property_list(void *user) ++static int vcio_user_property_list(struct vcio_data *vcio, void *user) + { + u32 *buf, size; + int ret; +@@ -55,7 +52,7 @@ static int vcio_user_property_list(void *user) + } + + /* Strip off protocol encapsulation */ +- ret = rpi_firmware_property_list(vcio.fw, &buf[2], size - 12); ++ ret = rpi_firmware_property_list(vcio->fw, &buf[2], size - 12); + if (ret) { + kfree(buf); + return ret; +@@ -87,9 +84,12 @@ static int vcio_device_release(struct inode *inode, struct file *file) + static long vcio_device_ioctl(struct file *file, unsigned int ioctl_num, + unsigned long ioctl_param) + { ++ struct vcio_data *vcio = container_of(file->private_data, ++ struct vcio_data, misc_dev); ++ + switch (ioctl_num) { + case IOCTL_MBOX_PROPERTY: +- return vcio_user_property_list((void *)ioctl_param); ++ return vcio_user_property_list(vcio, (void *)ioctl_param); + default: + pr_err("unknown ioctl: %x\n", ioctl_num); + return -EINVAL; +@@ -100,9 +100,12 @@ static long vcio_device_ioctl(struct file *file, unsigned int ioctl_num, + static long vcio_device_compat_ioctl(struct file *file, unsigned int ioctl_num, + unsigned long ioctl_param) + { ++ struct vcio_data *vcio = container_of(file->private_data, ++ struct vcio_data, misc_dev); ++ + switch (ioctl_num) { + case IOCTL_MBOX_PROPERTY32: +- return vcio_user_property_list(compat_ptr(ioctl_param)); ++ return vcio_user_property_list(vcio, compat_ptr(ioctl_param)); + default: + pr_err("unknown ioctl: %x\n", ioctl_num); + return -EINVAL; +@@ -119,77 +122,65 @@ const struct file_operations vcio_fops = { + .release = vcio_device_release, + }; + +-static int __init vcio_init(void) ++static int vcio_probe(struct platform_device *pdev) + { +- struct device_node *np; +- static struct device *dev; +- int ret; +- +- np = of_find_compatible_node(NULL, NULL, +- "raspberrypi,bcm2835-firmware"); +- if (!of_device_is_available(np)) +- return -ENODEV; +- +- vcio.fw = rpi_firmware_get(np); +- if (!vcio.fw) +- return -ENODEV; +- +- ret = alloc_chrdev_region(&vcio.devt, 0, 1, "vcio"); +- if (ret) { +- pr_err("failed to allocate device number\n"); +- return ret; +- } +- +- cdev_init(&vcio.cdev, &vcio_fops); +- vcio.cdev.owner = THIS_MODULE; +- ret = cdev_add(&vcio.cdev, vcio.devt, 1); +- if (ret) { +- pr_err("failed to register device\n"); +- goto err_unregister_chardev; +- } ++ struct device *dev = &pdev->dev; ++ struct device_node *np = dev->of_node; ++ struct device_node *fw_node; ++ struct rpi_firmware *fw; ++ struct vcio_data *vcio; + +- /* +- * Create sysfs entries +- * 'bcm2708_vcio' is used for backwards compatibility so we don't break +- * userspace. Raspian has a udev rule that changes the permissions. +- */ +- vcio.class = class_create(THIS_MODULE, "bcm2708_vcio"); +- if (IS_ERR(vcio.class)) { +- ret = PTR_ERR(vcio.class); +- pr_err("failed to create class\n"); +- goto err_cdev_del; ++ fw_node = of_get_parent(np); ++ if (!fw_node) { ++ dev_err(dev, "Missing firmware node\n"); ++ return -ENOENT; + } + +- dev = device_create(vcio.class, NULL, vcio.devt, NULL, "vcio"); +- if (IS_ERR(dev)) { +- ret = PTR_ERR(dev); +- pr_err("failed to create device\n"); +- goto err_class_destroy; +- } ++ fw = rpi_firmware_get(fw_node); ++ of_node_put(fw_node); ++ if (!fw) ++ return -EPROBE_DEFER; + +- return 0; ++ vcio = devm_kzalloc(dev, sizeof(struct vcio_data), GFP_KERNEL); ++ if (!vcio) ++ return -ENOMEM; + +-err_class_destroy: +- class_destroy(vcio.class); +-err_cdev_del: +- cdev_del(&vcio.cdev); +-err_unregister_chardev: +- unregister_chrdev_region(vcio.devt, 1); ++ vcio->fw = fw; ++ vcio->misc_dev.fops = &vcio_fops; ++ vcio->misc_dev.minor = MISC_DYNAMIC_MINOR; ++ vcio->misc_dev.name = "vcio"; ++ vcio->misc_dev.parent = dev; + +- return ret; ++ return misc_register(&vcio->misc_dev); + } +-module_init(vcio_init); + +-static void __exit vcio_exit(void) ++static int vcio_remove(struct platform_device *pdev) + { +- device_destroy(vcio.class, vcio.devt); +- class_destroy(vcio.class); +- cdev_del(&vcio.cdev); +- unregister_chrdev_region(vcio.devt, 1); ++ struct device *dev = &pdev->dev; ++ ++ misc_deregister(dev_get_drvdata(dev)); ++ return 0; + } +-module_exit(vcio_exit); ++ ++static const struct of_device_id vcio_ids[] = { ++ { .compatible = "raspberrypi,vcio" }, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, vcio_ids); ++ ++static struct platform_driver vcio_driver = { ++ .driver = { ++ .name = MODULE_NAME, ++ .of_match_table = of_match_ptr(vcio_ids), ++ }, ++ .probe = vcio_probe, ++ .remove = vcio_remove, ++}; ++ ++module_platform_driver(vcio_driver); + + MODULE_AUTHOR("Gray Girling"); + MODULE_AUTHOR("Noralf Trønnes"); + MODULE_DESCRIPTION("Mailbox userspace access"); + MODULE_LICENSE("GPL"); ++MODULE_ALIAS("platform:rpi-vcio"); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 12 Oct 2021 09:59:54 +0100 +Subject: [PATCH 873/889] ARM: dts: Make vcio a child of the firmware node + +In order to resolve a potential startup order bug, the vcio driver has +been rewritten as a platform driver that depends on a DT node for +its instantiation and to locate the firmware driver. + +Add that DT node. + +See: https://github.com/raspberrypi/linux/issues/4620 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm270x-rpi.dtsi | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm270x-rpi.dtsi b/arch/arm/boot/dts/bcm270x-rpi.dtsi +index 68a7e1c09db1..dc302248ae2a 100644 +--- a/arch/arm/boot/dts/bcm270x-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm270x-rpi.dtsi +@@ -152,3 +152,9 @@ + status = "disabled"; + }; + }; ++ ++&firmware { ++ vcio: vcio { ++ compatible = "raspberrypi,vcio"; ++ }; ++}; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 18 Oct 2021 11:12:42 +0100 +Subject: [PATCH 874/889] ARM: dts: bcm2835_audio missing firmware reference + +The firmware driver has been changed to count its clients. An earlier +commit removed the downstream patch permitting the hacky technique of +passing NULL to rpi_firmware_get to pick up the last instace, but +failed to add the necessary "firmware" property to the bcm2835_audio +node. Correct that omission. + +See: https://github.com/raspberrypi/linux/issues/4634 + https://github.com/raspberrypi/linux/issues/4635 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm270x-rpi.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/bcm270x-rpi.dtsi b/arch/arm/boot/dts/bcm270x-rpi.dtsi +index dc302248ae2a..efca67213816 100644 +--- a/arch/arm/boot/dts/bcm270x-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm270x-rpi.dtsi +@@ -148,6 +148,7 @@ + /* Onboard audio */ + audio: bcm2835_audio { + compatible = "brcm,bcm2835-audio"; ++ brcm,firmware = <&firmware>; + brcm,pwm-channels = <8>; + status = "disabled"; + }; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 18 Oct 2021 11:13:35 +0100 +Subject: [PATCH 875/889] ARM: dts: Delete vestigial vcsm node + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm270x-rpi.dtsi | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm270x-rpi.dtsi b/arch/arm/boot/dts/bcm270x-rpi.dtsi +index efca67213816..57e7d5f60d3e 100644 +--- a/arch/arm/boot/dts/bcm270x-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm270x-rpi.dtsi +@@ -65,12 +65,6 @@ + status = "okay"; + }; + +- vcsm: vcsm { +- compatible = "raspberrypi,bcm2835-vcsm"; +- firmware = <&firmware>; +- status = "okay"; +- }; +- + /* External sound card */ + sound: sound { + status = "disabled"; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 18 Oct 2021 16:39:11 +0100 +Subject: [PATCH 876/889] config: Enable FSFS_FS_SECURITY + +Add a negligible amount of core kernel code for capability-based +access control on F2FS. + +See: https://github.com/raspberrypi/linux/issues/2778 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcm2711_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + arch/arm64/configs/bcm2711_defconfig | 1 + + arch/arm64/configs/bcmrpi3_defconfig | 1 + + 5 files changed, 5 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 01647771d82c..7b4c28badf91 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1379,6 +1379,7 @@ CONFIG_BTRFS_FS=m + CONFIG_BTRFS_FS_POSIX_ACL=y + CONFIG_NILFS2_FS=m + CONFIG_F2FS_FS=y ++CONFIG_F2FS_FS_SECURITY=y + CONFIG_FS_ENCRYPTION=y + CONFIG_FANOTIFY=y + CONFIG_QFMT_V1=m +diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig +index a380d6f6ad37..a4543d42fc55 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -1418,6 +1418,7 @@ CONFIG_BTRFS_FS=m + CONFIG_BTRFS_FS_POSIX_ACL=y + CONFIG_NILFS2_FS=m + CONFIG_F2FS_FS=y ++CONFIG_F2FS_FS_SECURITY=y + CONFIG_FS_ENCRYPTION=y + CONFIG_FANOTIFY=y + CONFIG_QFMT_V1=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index a2fd71f42c63..5f1bd057138d 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1390,6 +1390,7 @@ CONFIG_BTRFS_FS=m + CONFIG_BTRFS_FS_POSIX_ACL=y + CONFIG_NILFS2_FS=m + CONFIG_F2FS_FS=y ++CONFIG_F2FS_FS_SECURITY=y + CONFIG_FANOTIFY=y + CONFIG_QFMT_V1=m + CONFIG_QFMT_V2=m +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index aae05dfcaaf3..88fa0a35d802 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -1425,6 +1425,7 @@ CONFIG_BTRFS_FS=m + CONFIG_BTRFS_FS_POSIX_ACL=y + CONFIG_NILFS2_FS=m + CONFIG_F2FS_FS=y ++CONFIG_F2FS_FS_SECURITY=y + CONFIG_FS_ENCRYPTION=y + CONFIG_FANOTIFY=y + CONFIG_QFMT_V1=m +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index 26fe691cb9a2..00352da73009 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -1274,6 +1274,7 @@ CONFIG_BTRFS_FS=m + CONFIG_BTRFS_FS_POSIX_ACL=y + CONFIG_NILFS2_FS=m + CONFIG_F2FS_FS=y ++CONFIG_F2FS_FS_SECURITY=y + CONFIG_FS_ENCRYPTION=y + CONFIG_FANOTIFY=y + CONFIG_QFMT_V1=m +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 19 Oct 2021 11:23:43 +0100 +Subject: [PATCH 877/889] gpio: bcm-virt: Fix the get() method + +The get() method does not understand the on-the-wire encoding of the +remote GPIO states, thinking they are simple on/off bits when they are +really pairs of 16-bit counts. Rewrite the get() handler to return the +value last written, which will eventually match the actual GPIO state +if there are no other changes. + +See: https://github.com/raspberrypi/linux/issues/4638 + +Signed-off-by: Phil Elwell +--- + drivers/gpio/gpio-bcm-virt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpio/gpio-bcm-virt.c b/drivers/gpio/gpio-bcm-virt.c +index 49e28ad9760e..55c40190e88a 100644 +--- a/drivers/gpio/gpio-bcm-virt.c ++++ b/drivers/gpio/gpio-bcm-virt.c +@@ -49,7 +49,7 @@ static int brcmvirt_gpio_get(struct gpio_chip *gc, unsigned off) + unsigned v; + gpio = container_of(gc, struct brcmvirt_gpio, gc); + v = readl(gpio->ts_base + off); +- return (v >> off) & 1; ++ return (s16)((v >> 16) - v) > 0; + } + + static void brcmvirt_gpio_set(struct gpio_chip *gc, unsigned off, int val) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Erik Tagirov +Date: Wed, 20 Oct 2021 09:51:26 +0200 +Subject: [PATCH 878/889] configs: Add CONFIG_FB_SIMPLE to bcmrpi3_defconfig + +See: https://github.com/raspberrypi/linux/pull/4640 + +Signed-off-by: Erik Tagirov +--- + arch/arm64/configs/bcmrpi3_defconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index 00352da73009..a137f1c0721a 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -885,6 +885,7 @@ CONFIG_DRM_GUD=m + CONFIG_FB=y + CONFIG_FB_BCM2708=y + CONFIG_FB_UDL=m ++CONFIG_FB_SIMPLE=y + CONFIG_FB_SSD1307=m + CONFIG_FB_RPISENSE=m + CONFIG_BACKLIGHT_RPI=m +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Plowman +Date: Thu, 21 Oct 2021 14:41:55 +0100 +Subject: [PATCH 879/889] media: i2c: imx219: Sensor should report RAW color + space + +Tested on Raspberry Pi running libcamera. + +Signed-off-by: David Plowman +--- + drivers/media/i2c/imx219.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c +index 79faa8cce94e..6aed851865ec 100644 +--- a/drivers/media/i2c/imx219.c ++++ b/drivers/media/i2c/imx219.c +@@ -681,7 +681,7 @@ static void imx219_set_default_format(struct imx219 *imx219) + + fmt = &imx219->fmt; + fmt->code = MEDIA_BUS_FMT_SRGGB10_1X10; +- fmt->colorspace = V4L2_COLORSPACE_SRGB; ++ fmt->colorspace = V4L2_COLORSPACE_RAW; + fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace); + fmt->quantization = V4L2_MAP_QUANTIZATION_DEFAULT(true, + fmt->colorspace, +@@ -877,7 +877,7 @@ static int imx219_enum_frame_size(struct v4l2_subdev *sd, + + static void imx219_reset_colorspace(struct v4l2_mbus_framefmt *fmt) + { +- fmt->colorspace = V4L2_COLORSPACE_SRGB; ++ fmt->colorspace = V4L2_COLORSPACE_RAW; + fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace); + fmt->quantization = V4L2_MAP_QUANTIZATION_DEFAULT(true, + fmt->colorspace, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Plowman +Date: Thu, 21 Oct 2021 14:44:01 +0100 +Subject: [PATCH 880/889] media: i2c: imx290: Sensor should report RAW color + space + +Tested on Raspberry Pi running libcamera. + +Signed-off-by: David Plowman +--- + drivers/media/i2c/imx290.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c +index a26106c41cc6..def912308daa 100644 +--- a/drivers/media/i2c/imx290.c ++++ b/drivers/media/i2c/imx290.c +@@ -885,7 +885,7 @@ static int imx290_set_fmt(struct v4l2_subdev *sd, + + fmt->format.code = imx290->formats[i].code; + fmt->format.field = V4L2_FIELD_NONE; +- fmt->format.colorspace = V4L2_COLORSPACE_SRGB; ++ fmt->format.colorspace = V4L2_COLORSPACE_RAW; + fmt->format.ycbcr_enc = + V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->format.colorspace); + fmt->format.quantization = +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Plowman +Date: Thu, 21 Oct 2021 14:44:43 +0100 +Subject: [PATCH 881/889] media: i2c: imx477: Sensor should report RAW color + space + +Tested on Raspberry Pi running libcamera. + +Signed-off-by: David Plowman +--- + drivers/media/i2c/imx477.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/media/i2c/imx477.c b/drivers/media/i2c/imx477.c +index 05cb530d331e..cd3296f8ab41 100644 +--- a/drivers/media/i2c/imx477.c ++++ b/drivers/media/i2c/imx477.c +@@ -1471,7 +1471,7 @@ static int imx477_enum_frame_size(struct v4l2_subdev *sd, + + static void imx477_reset_colorspace(struct v4l2_mbus_framefmt *fmt) + { +- fmt->colorspace = V4L2_COLORSPACE_SRGB; ++ fmt->colorspace = V4L2_COLORSPACE_RAW; + fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace); + fmt->quantization = V4L2_MAP_QUANTIZATION_DEFAULT(true, + fmt->colorspace, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Plowman +Date: Thu, 21 Oct 2021 14:45:07 +0100 +Subject: [PATCH 882/889] media: i2c: imx519: Sensor should report RAW color + space + +Tested on Raspberry Pi running libcamera. + +Signed-off-by: David Plowman +--- + drivers/media/i2c/imx519.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/media/i2c/imx519.c b/drivers/media/i2c/imx519.c +index 4e98704a6834..675b4a94e065 100644 +--- a/drivers/media/i2c/imx519.c ++++ b/drivers/media/i2c/imx519.c +@@ -1317,7 +1317,7 @@ static int imx519_enum_frame_size(struct v4l2_subdev *sd, + + static void imx519_reset_colorspace(struct v4l2_mbus_framefmt *fmt) + { +- fmt->colorspace = V4L2_COLORSPACE_SRGB; ++ fmt->colorspace = V4L2_COLORSPACE_RAW; + fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace); + fmt->quantization = V4L2_MAP_QUANTIZATION_DEFAULT(true, + fmt->colorspace, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Plowman +Date: Thu, 21 Oct 2021 14:47:00 +0100 +Subject: [PATCH 883/889] media: i2c: ov5647: Sensor should report RAW color + space + +Tested on Raspberry Pi running libcamera. + +Signed-off-by: David Plowman +--- + drivers/media/i2c/ov5647.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c +index 98a5329d68fb..03c92e419806 100644 +--- a/drivers/media/i2c/ov5647.c ++++ b/drivers/media/i2c/ov5647.c +@@ -601,7 +601,7 @@ static struct ov5647_mode supported_modes_8bit[] = { + { + .format = { + .code = MEDIA_BUS_FMT_SBGGR8_1X8, +- .colorspace = V4L2_COLORSPACE_SRGB, ++ .colorspace = V4L2_COLORSPACE_RAW, + .field = V4L2_FIELD_NONE, + .width = 640, + .height = 480 +@@ -627,7 +627,7 @@ static struct ov5647_mode supported_modes_10bit[] = { + { + .format = { + .code = MEDIA_BUS_FMT_SBGGR10_1X10, +- .colorspace = V4L2_COLORSPACE_SRGB, ++ .colorspace = V4L2_COLORSPACE_RAW, + .field = V4L2_FIELD_NONE, + .width = 2592, + .height = 1944 +@@ -651,7 +651,7 @@ static struct ov5647_mode supported_modes_10bit[] = { + { + .format = { + .code = MEDIA_BUS_FMT_SBGGR10_1X10, +- .colorspace = V4L2_COLORSPACE_SRGB, ++ .colorspace = V4L2_COLORSPACE_RAW, + .field = V4L2_FIELD_NONE, + .width = 1920, + .height = 1080 +@@ -674,7 +674,7 @@ static struct ov5647_mode supported_modes_10bit[] = { + { + .format = { + .code = MEDIA_BUS_FMT_SBGGR10_1X10, +- .colorspace = V4L2_COLORSPACE_SRGB, ++ .colorspace = V4L2_COLORSPACE_RAW, + .field = V4L2_FIELD_NONE, + .width = 1296, + .height = 972 +@@ -698,7 +698,7 @@ static struct ov5647_mode supported_modes_10bit[] = { + { + .format = { + .code = MEDIA_BUS_FMT_SBGGR10_1X10, +- .colorspace = V4L2_COLORSPACE_SRGB, ++ .colorspace = V4L2_COLORSPACE_RAW, + .field = V4L2_FIELD_NONE, + .width = 640, + .height = 480 +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Plowman +Date: Thu, 21 Oct 2021 14:47:20 +0100 +Subject: [PATCH 884/889] media: i2c: ov9281: Sensor should report RAW color + space + +Tested on Raspberry Pi running libcamera. + +Signed-off-by: David Plowman +--- + drivers/media/i2c/ov9281.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/media/i2c/ov9281.c b/drivers/media/i2c/ov9281.c +index a6ffcdd47b21..f7ec4470d356 100644 +--- a/drivers/media/i2c/ov9281.c ++++ b/drivers/media/i2c/ov9281.c +@@ -507,7 +507,7 @@ static int ov9281_set_fmt(struct v4l2_subdev *sd, + fmt->format.width = mode->width; + fmt->format.height = mode->height; + fmt->format.field = V4L2_FIELD_NONE; +- fmt->format.colorspace = V4L2_COLORSPACE_SRGB; ++ fmt->format.colorspace = V4L2_COLORSPACE_RAW; + fmt->format.ycbcr_enc = + V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->format.colorspace); + fmt->format.quantization = +@@ -557,7 +557,7 @@ static int ov9281_get_fmt(struct v4l2_subdev *sd, + fmt->format.height = mode->height; + fmt->format.code = ov9281->code; + fmt->format.field = V4L2_FIELD_NONE; +- fmt->format.colorspace = V4L2_COLORSPACE_SRGB; ++ fmt->format.colorspace = V4L2_COLORSPACE_RAW; + fmt->format.ycbcr_enc = + V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->format.colorspace); + fmt->format.quantization = +@@ -908,7 +908,7 @@ static int ov9281_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) + try_fmt->height = def_mode->height; + try_fmt->code = MEDIA_BUS_FMT_Y10_1X10; + try_fmt->field = V4L2_FIELD_NONE; +- try_fmt->colorspace = V4L2_COLORSPACE_SRGB; ++ try_fmt->colorspace = V4L2_COLORSPACE_RAW; + try_fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(try_fmt->colorspace); + try_fmt->quantization = + V4L2_MAP_QUANTIZATION_DEFAULT(true, try_fmt->colorspace, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: David Plowman +Date: Thu, 21 Oct 2021 14:49:15 +0100 +Subject: [PATCH 885/889] vc04_services: isp: Report input node as wanting full + range RAW color space + +RAW color spaces are more usually reported as having full range +quantization. + +Tested using libcamera. + +Signed-off-by: David Plowman +--- + drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c b/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c +index 08dce8bba9bb..df57c2f74a03 100644 +--- a/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c ++++ b/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c +@@ -1032,7 +1032,9 @@ static int bcm2835_isp_node_try_fmt(struct file *file, void *priv, + /* In all cases, we only support the defaults for these: */ + f->fmt.pix.ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(f->fmt.pix.colorspace); + f->fmt.pix.xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(f->fmt.pix.colorspace); +- is_rgb = f->fmt.pix.colorspace == V4L2_COLORSPACE_SRGB; ++ /* RAW counts as sRGB here so that we get full range. */ ++ is_rgb = f->fmt.pix.colorspace == V4L2_COLORSPACE_SRGB || ++ f->fmt.pix.colorspace == V4L2_COLORSPACE_RAW; + f->fmt.pix.quantization = V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, f->fmt.pix.colorspace, + f->fmt.pix.ycbcr_enc); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 23 Sep 2020 15:16:18 +0100 +Subject: [PATCH 886/889] media/bcm2835-unicam: Parse pad numbers correctly + +The driver was making big assumptions about the source device +using pad 0 and 1, which doesn't follow for more complex +devices where Unicam's source device may be a sink device for +something else. + +Read the pad numbers through media controller, and reference +them appropriately. + +Signed-off-by: Dave Stevenson +--- + .../media/platform/bcm2835/bcm2835-unicam.c | 89 ++++++++++++------- + 1 file changed, 58 insertions(+), 31 deletions(-) + +diff --git a/drivers/media/platform/bcm2835/bcm2835-unicam.c b/drivers/media/platform/bcm2835/bcm2835-unicam.c +index 59163f93b207..bbcaa1bd419f 100644 +--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c ++++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c +@@ -380,6 +380,8 @@ struct unicam_node { + int open; + bool streaming; + unsigned int pad_id; ++ /* Source pad id on the sensor for this node */ ++ unsigned int src_pad_id; + /* Pointer pointing to current v4l2_buffer */ + struct unicam_buffer *cur_frm; + /* Pointer pointing to next v4l2_buffer */ +@@ -590,7 +592,7 @@ static int __subdev_get_format(struct unicam_device *dev, + { + struct v4l2_subdev_format sd_fmt = { + .which = V4L2_SUBDEV_FORMAT_ACTIVE, +- .pad = pad_id ++ .pad = dev->node[pad_id].src_pad_id, + }; + int ret; + +@@ -612,7 +614,7 @@ static int __subdev_set_format(struct unicam_device *dev, + { + struct v4l2_subdev_format sd_fmt = { + .which = V4L2_SUBDEV_FORMAT_ACTIVE, +- .pad = pad_id ++ .pad = dev->node[pad_id].src_pad_id, + }; + int ret; + +@@ -1977,7 +1979,7 @@ static int unicam_enum_framesizes(struct file *file, void *priv, + + fse.which = V4L2_SUBDEV_FORMAT_ACTIVE; + fse.index = fsize->index; +- fse.pad = node->pad_id; ++ fse.pad = node->src_pad_id; + + ret = v4l2_subdev_call(dev->sensor, pad, enum_frame_size, NULL, &fse); + if (ret) +@@ -2002,6 +2004,7 @@ static int unicam_enum_frameintervals(struct file *file, void *priv, + const struct unicam_fmt *fmt; + struct v4l2_subdev_frame_interval_enum fie = { + .index = fival->index, ++ .pad = node->src_pad_id, + .width = fival->width, + .height = fival->height, + .which = V4L2_SUBDEV_FORMAT_ACTIVE, +@@ -2093,8 +2096,13 @@ static int unicam_enum_dv_timings(struct file *file, void *priv, + { + struct unicam_node *node = video_drvdata(file); + struct unicam_device *dev = node->dev; ++ int ret; ++ ++ timings->pad = node->src_pad_id; ++ ret = v4l2_subdev_call(dev->sensor, pad, enum_dv_timings, timings); ++ timings->pad = node->pad_id; + +- return v4l2_subdev_call(dev->sensor, pad, enum_dv_timings, timings); ++ return ret; + } + + static int unicam_dv_timings_cap(struct file *file, void *priv, +@@ -2102,8 +2110,13 @@ static int unicam_dv_timings_cap(struct file *file, void *priv, + { + struct unicam_node *node = video_drvdata(file); + struct unicam_device *dev = node->dev; ++ int ret; ++ ++ cap->pad = node->src_pad_id; ++ ret = v4l2_subdev_call(dev->sensor, pad, dv_timings_cap, cap); ++ cap->pad = node->pad_id; + +- return v4l2_subdev_call(dev->sensor, pad, dv_timings_cap, cap); ++ return ret; + } + + static int unicam_subscribe_event(struct v4l2_fh *fh, +@@ -2374,14 +2387,12 @@ static int register_node(struct unicam_device *unicam, struct unicam_node *node, + */ + fmt = get_first_supported_format(unicam); + +- if (!fmt) +- /* No compatible formats */ +- return -EINVAL; +- +- mbus_fmt.code = fmt->code; +- ret = __subdev_set_format(unicam, &mbus_fmt, pad_id); +- if (ret) +- return -EINVAL; ++ if (fmt) { ++ mbus_fmt.code = fmt->code; ++ ret = __subdev_set_format(unicam, &mbus_fmt, pad_id); ++ if (ret) ++ return -EINVAL; ++ } + } + if (mbus_fmt.field != V4L2_FIELD_NONE) { + /* Interlaced not supported - disable it now. */ +@@ -2391,7 +2402,8 @@ static int register_node(struct unicam_device *unicam, struct unicam_node *node, + return -EINVAL; + } + +- node->v_fmt.fmt.pix.pixelformat = fmt->fourcc ? fmt->fourcc ++ if (fmt) ++ node->v_fmt.fmt.pix.pixelformat = fmt->fourcc ? fmt->fourcc + : fmt->repacked_fourcc; + } else { + /* Fix this node format as embedded data. */ +@@ -2404,7 +2416,8 @@ static int register_node(struct unicam_device *unicam, struct unicam_node *node, + node->fmt = fmt; + + /* Read current subdev format */ +- unicam_reset_format(node); ++ if (fmt) ++ unicam_reset_format(node); + + if (v4l2_subdev_has_op(unicam->sensor, video, s_std)) { + v4l2_std_id tvnorms; +@@ -2493,6 +2506,7 @@ static int register_node(struct unicam_device *unicam, struct unicam_node *node, + unicam_err(unicam, "Unable to allocate dummy buffer.\n"); + return -ENOMEM; + } ++ + if (pad_id == METADATA_PAD || + !v4l2_subdev_has_op(unicam->sensor, video, s_std)) { + v4l2_disable_ioctl(&node->video_dev, VIDIOC_S_STD); +@@ -2551,7 +2565,8 @@ static int register_node(struct unicam_device *unicam, struct unicam_node *node, + node->registered = true; + + if (pad_id != METADATA_PAD || unicam->sensor_embedded_data) { +- ret = media_create_pad_link(&unicam->sensor->entity, pad_id, ++ ret = media_create_pad_link(&unicam->sensor->entity, ++ node->src_pad_id, + &node->video_dev.entity, 0, + MEDIA_LNK_FL_ENABLED | + MEDIA_LNK_FL_IMMUTABLE); +@@ -2583,8 +2598,10 @@ static void unregister_nodes(struct unicam_device *unicam) + } + } + +-static int unicam_probe_complete(struct unicam_device *unicam) ++static int unicam_async_complete(struct v4l2_async_notifier *notifier) + { ++ struct unicam_device *unicam = to_unicam_device(notifier->v4l2_dev); ++ unsigned int i, source_pads = 0; + int ret; + + unicam->v4l2_dev.notify = unicam_notify; +@@ -2593,7 +2610,20 @@ static int unicam_probe_complete(struct unicam_device *unicam) + if (!unicam->sensor_config) + return -ENOMEM; + +- unicam->sensor_embedded_data = (unicam->sensor->entity.num_pads >= 2); ++ for (i = 0; i < unicam->sensor->entity.num_pads; i++) { ++ if (unicam->sensor->entity.pads[i].flags & MEDIA_PAD_FL_SOURCE) { ++ if (source_pads < MAX_NODES) { ++ unicam->node[source_pads].src_pad_id = i; ++ unicam_err(unicam, "source pad %u is index %u\n", ++ source_pads, i); ++ } ++ source_pads++; ++ } ++ } ++ if (!source_pads) { ++ unicam_err(unicam, "No source pads on sensor.\n"); ++ goto unregister; ++ } + + ret = register_node(unicam, &unicam->node[IMAGE_PAD], + V4L2_BUF_TYPE_VIDEO_CAPTURE, IMAGE_PAD); +@@ -2602,11 +2632,15 @@ static int unicam_probe_complete(struct unicam_device *unicam) + goto unregister; + } + +- ret = register_node(unicam, &unicam->node[METADATA_PAD], +- V4L2_BUF_TYPE_META_CAPTURE, METADATA_PAD); +- if (ret) { +- unicam_err(unicam, "Unable to register metadata video device.\n"); +- goto unregister; ++ if (source_pads >= 2) { ++ unicam->sensor_embedded_data = true; ++ ++ ret = register_node(unicam, &unicam->node[METADATA_PAD], ++ V4L2_BUF_TYPE_META_CAPTURE, METADATA_PAD); ++ if (ret) { ++ unicam_err(unicam, "Unable to register metadata video device.\n"); ++ goto unregister; ++ } + } + + ret = v4l2_device_register_ro_subdev_nodes(&unicam->v4l2_dev); +@@ -2629,13 +2663,6 @@ static int unicam_probe_complete(struct unicam_device *unicam) + return ret; + } + +-static int unicam_async_complete(struct v4l2_async_notifier *notifier) +-{ +- struct unicam_device *unicam = to_unicam_device(notifier->v4l2_dev); +- +- return unicam_probe_complete(unicam); +-} +- + static const struct v4l2_async_notifier_operations unicam_async_ops = { + .bound = unicam_async_bound, + .complete = unicam_async_complete, +@@ -2744,7 +2771,7 @@ static int of_unicam_connect_subdevs(struct unicam_device *dev) + dev->notifier.ops = &unicam_async_ops; + + dev->asd.match_type = V4L2_ASYNC_MATCH_FWNODE; +- dev->asd.match.fwnode = of_fwnode_handle(sensor_node); ++ dev->asd.match.fwnode = fwnode_graph_get_remote_endpoint(of_fwnode_handle(ep_node)); + ret = v4l2_async_notifier_add_subdev(&dev->notifier, &dev->asd); + if (ret) { + unicam_err(dev, "Error adding subdevice: %d\n", ret); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 15 Oct 2021 17:57:27 +0100 +Subject: [PATCH 887/889] media/bcm2835-unicam: Add support for configuration + via MC API + +Adds Media Controller API support for more complex pipelines. +libcamera is about to switch to using this mechanism for configuring +sensors. + +This can be enabled by either a module parameter, or device tree. + +Various functions have been moved to group video-centric and +mc-centric functions together. + +Based on a similar conversion done to ti-vpe. + +Signed-off-by: Dave Stevenson +--- + .../media/platform/bcm2835/bcm2835-unicam.c | 2125 ++++++++++------- + 1 file changed, 1314 insertions(+), 811 deletions(-) + +diff --git a/drivers/media/platform/bcm2835/bcm2835-unicam.c b/drivers/media/platform/bcm2835/bcm2835-unicam.c +index bbcaa1bd419f..d4a005657ca2 100644 +--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c ++++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c +@@ -81,6 +81,10 @@ static int debug; + module_param(debug, int, 0644); + MODULE_PARM_DESC(debug, "Debug level 0-3"); + ++static int media_controller; ++module_param(media_controller, int, 0644); ++MODULE_PARM_DESC(media_controller, "Use media controller API"); ++ + #define unicam_dbg(level, dev, fmt, arg...) \ + v4l2_dbg(level, debug, &(dev)->v4l2_dev, fmt, ##arg) + #define unicam_info(dev, fmt, arg...) \ +@@ -117,7 +121,7 @@ MODULE_PARM_DESC(debug, "Debug level 0-3"); + #define MIN_WIDTH 16 + #define MIN_HEIGHT 16 + /* Default size of the embedded buffer */ +-#define UNICAM_EMBEDDED_SIZE 8192 ++#define UNICAM_EMBEDDED_SIZE 16384 + + /* + * Size of the dummy buffer. Can be any size really, but the DMA +@@ -131,6 +135,22 @@ enum pad_types { + MAX_NODES + }; + ++#define MASK_CS_DEFAULT BIT(V4L2_COLORSPACE_DEFAULT) ++#define MASK_CS_SMPTE170M BIT(V4L2_COLORSPACE_SMPTE170M) ++#define MASK_CS_SMPTE240M BIT(V4L2_COLORSPACE_SMPTE240M) ++#define MASK_CS_REC709 BIT(V4L2_COLORSPACE_REC709) ++#define MASK_CS_BT878 BIT(V4L2_COLORSPACE_BT878) ++#define MASK_CS_470_M BIT(V4L2_COLORSPACE_470_SYSTEM_M) ++#define MASK_CS_470_BG BIT(V4L2_COLORSPACE_470_SYSTEM_BG) ++#define MASK_CS_JPEG BIT(V4L2_COLORSPACE_JPEG) ++#define MASK_CS_SRGB BIT(V4L2_COLORSPACE_SRGB) ++#define MASK_CS_OPRGB BIT(V4L2_COLORSPACE_OPRGB) ++#define MASK_CS_BT2020 BIT(V4L2_COLORSPACE_BT2020) ++#define MASK_CS_RAW BIT(V4L2_COLORSPACE_RAW) ++#define MASK_CS_DCI_P3 BIT(V4L2_COLORSPACE_DCI_P3) ++ ++#define MAX_COLORSPACE 32 ++ + /* + * struct unicam_fmt - Unicam media bus format information + * @pixelformat: V4L2 pixel format FCC identifier. 0 if n/a. +@@ -139,8 +159,14 @@ enum pad_types { + * @code: V4L2 media bus format code. + * @depth: Bits per pixel as delivered from the source. + * @csi_dt: CSI data type. ++ * @valid_colorspaces: Bitmask of valid colorspaces so that the Media Controller ++ * centric try_fmt can validate the colorspace and pass ++ * v4l2-compliance. + * @check_variants: Flag to denote that there are multiple mediabus formats + * still in the list that could match this V4L2 format. ++ * @mc_skip: Media Controller shouldn't list this format via ENUM_FMT as it is ++ * a duplicate of an earlier format. ++ * @metadata_fmt: This format only applies to the metadata pad. + */ + struct unicam_fmt { + u32 fourcc; +@@ -148,7 +174,10 @@ struct unicam_fmt { + u32 code; + u8 depth; + u8 csi_dt; +- u8 check_variants; ++ u32 valid_colorspaces; ++ u8 check_variants:1; ++ u8 mc_skip:1; ++ u8 metadata_fmt:1; + }; + + static const struct unicam_fmt formats[] = { +@@ -159,173 +188,216 @@ static const struct unicam_fmt formats[] = { + .depth = 16, + .csi_dt = 0x1e, + .check_variants = 1, ++ .valid_colorspaces = MASK_CS_SMPTE170M | MASK_CS_REC709 | ++ MASK_CS_JPEG, + }, { + .fourcc = V4L2_PIX_FMT_UYVY, + .code = MEDIA_BUS_FMT_UYVY8_2X8, + .depth = 16, + .csi_dt = 0x1e, + .check_variants = 1, ++ .valid_colorspaces = MASK_CS_SMPTE170M | MASK_CS_REC709 | ++ MASK_CS_JPEG, + }, { + .fourcc = V4L2_PIX_FMT_YVYU, + .code = MEDIA_BUS_FMT_YVYU8_2X8, + .depth = 16, + .csi_dt = 0x1e, + .check_variants = 1, ++ .valid_colorspaces = MASK_CS_SMPTE170M | MASK_CS_REC709 | ++ MASK_CS_JPEG, + }, { + .fourcc = V4L2_PIX_FMT_VYUY, + .code = MEDIA_BUS_FMT_VYUY8_2X8, + .depth = 16, + .csi_dt = 0x1e, + .check_variants = 1, ++ .valid_colorspaces = MASK_CS_SMPTE170M | MASK_CS_REC709 | ++ MASK_CS_JPEG, + }, { + .fourcc = V4L2_PIX_FMT_YUYV, + .code = MEDIA_BUS_FMT_YUYV8_1X16, + .depth = 16, + .csi_dt = 0x1e, ++ .mc_skip = 1, ++ .valid_colorspaces = MASK_CS_SMPTE170M | MASK_CS_REC709 | ++ MASK_CS_JPEG, + }, { + .fourcc = V4L2_PIX_FMT_UYVY, + .code = MEDIA_BUS_FMT_UYVY8_1X16, + .depth = 16, + .csi_dt = 0x1e, ++ .mc_skip = 1, ++ .valid_colorspaces = MASK_CS_SMPTE170M | MASK_CS_REC709 | ++ MASK_CS_JPEG, + }, { + .fourcc = V4L2_PIX_FMT_YVYU, + .code = MEDIA_BUS_FMT_YVYU8_1X16, + .depth = 16, + .csi_dt = 0x1e, ++ .mc_skip = 1, ++ .valid_colorspaces = MASK_CS_SMPTE170M | MASK_CS_REC709 | ++ MASK_CS_JPEG, + }, { + .fourcc = V4L2_PIX_FMT_VYUY, + .code = MEDIA_BUS_FMT_VYUY8_1X16, + .depth = 16, + .csi_dt = 0x1e, ++ .mc_skip = 1, ++ .valid_colorspaces = MASK_CS_SMPTE170M | MASK_CS_REC709 | ++ MASK_CS_JPEG, + }, { + /* RGB Formats */ + .fourcc = V4L2_PIX_FMT_RGB565, /* gggbbbbb rrrrrggg */ + .code = MEDIA_BUS_FMT_RGB565_2X8_LE, + .depth = 16, + .csi_dt = 0x22, ++ .valid_colorspaces = MASK_CS_SRGB, + }, { + .fourcc = V4L2_PIX_FMT_RGB565X, /* rrrrrggg gggbbbbb */ + .code = MEDIA_BUS_FMT_RGB565_2X8_BE, + .depth = 16, +- .csi_dt = 0x22 ++ .csi_dt = 0x22, ++ .valid_colorspaces = MASK_CS_SRGB, + }, { + .fourcc = V4L2_PIX_FMT_RGB555, /* gggbbbbb arrrrrgg */ + .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, + .depth = 16, + .csi_dt = 0x21, ++ .valid_colorspaces = MASK_CS_SRGB, + }, { + .fourcc = V4L2_PIX_FMT_RGB555X, /* arrrrrgg gggbbbbb */ + .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, + .depth = 16, + .csi_dt = 0x21, ++ .valid_colorspaces = MASK_CS_SRGB, + }, { + .fourcc = V4L2_PIX_FMT_RGB24, /* rgb */ + .code = MEDIA_BUS_FMT_RGB888_1X24, + .depth = 24, + .csi_dt = 0x24, ++ .valid_colorspaces = MASK_CS_SRGB, + }, { + .fourcc = V4L2_PIX_FMT_BGR24, /* bgr */ + .code = MEDIA_BUS_FMT_BGR888_1X24, + .depth = 24, + .csi_dt = 0x24, ++ .valid_colorspaces = MASK_CS_SRGB, + }, { + .fourcc = V4L2_PIX_FMT_RGB32, /* argb */ + .code = MEDIA_BUS_FMT_ARGB8888_1X32, + .depth = 32, + .csi_dt = 0x0, ++ .valid_colorspaces = MASK_CS_SRGB, + }, { + /* Bayer Formats */ + .fourcc = V4L2_PIX_FMT_SBGGR8, + .code = MEDIA_BUS_FMT_SBGGR8_1X8, + .depth = 8, + .csi_dt = 0x2a, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SGBRG8, + .code = MEDIA_BUS_FMT_SGBRG8_1X8, + .depth = 8, + .csi_dt = 0x2a, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SGRBG8, + .code = MEDIA_BUS_FMT_SGRBG8_1X8, + .depth = 8, + .csi_dt = 0x2a, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SRGGB8, + .code = MEDIA_BUS_FMT_SRGGB8_1X8, + .depth = 8, + .csi_dt = 0x2a, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SBGGR10P, + .repacked_fourcc = V4L2_PIX_FMT_SBGGR10, + .code = MEDIA_BUS_FMT_SBGGR10_1X10, + .depth = 10, + .csi_dt = 0x2b, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SGBRG10P, + .repacked_fourcc = V4L2_PIX_FMT_SGBRG10, + .code = MEDIA_BUS_FMT_SGBRG10_1X10, + .depth = 10, + .csi_dt = 0x2b, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SGRBG10P, + .repacked_fourcc = V4L2_PIX_FMT_SGRBG10, + .code = MEDIA_BUS_FMT_SGRBG10_1X10, + .depth = 10, + .csi_dt = 0x2b, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SRGGB10P, + .repacked_fourcc = V4L2_PIX_FMT_SRGGB10, + .code = MEDIA_BUS_FMT_SRGGB10_1X10, + .depth = 10, + .csi_dt = 0x2b, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SBGGR12P, + .repacked_fourcc = V4L2_PIX_FMT_SBGGR12, + .code = MEDIA_BUS_FMT_SBGGR12_1X12, + .depth = 12, + .csi_dt = 0x2c, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SGBRG12P, + .repacked_fourcc = V4L2_PIX_FMT_SGBRG12, + .code = MEDIA_BUS_FMT_SGBRG12_1X12, + .depth = 12, + .csi_dt = 0x2c, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SGRBG12P, + .repacked_fourcc = V4L2_PIX_FMT_SGRBG12, + .code = MEDIA_BUS_FMT_SGRBG12_1X12, + .depth = 12, + .csi_dt = 0x2c, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SRGGB12P, + .repacked_fourcc = V4L2_PIX_FMT_SRGGB12, + .code = MEDIA_BUS_FMT_SRGGB12_1X12, + .depth = 12, + .csi_dt = 0x2c, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SBGGR14P, + .repacked_fourcc = V4L2_PIX_FMT_SBGGR14, + .code = MEDIA_BUS_FMT_SBGGR14_1X14, + .depth = 14, + .csi_dt = 0x2d, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SGBRG14P, + .repacked_fourcc = V4L2_PIX_FMT_SGBRG14, + .code = MEDIA_BUS_FMT_SGBRG14_1X14, + .depth = 14, + .csi_dt = 0x2d, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SGRBG14P, + .repacked_fourcc = V4L2_PIX_FMT_SGRBG14, + .code = MEDIA_BUS_FMT_SGRBG14_1X14, + .depth = 14, + .csi_dt = 0x2d, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_SRGGB14P, + .repacked_fourcc = V4L2_PIX_FMT_SRGGB14, + .code = MEDIA_BUS_FMT_SRGGB14_1X14, + .depth = 14, + .csi_dt = 0x2d, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + /* + * 16 bit Bayer formats could be supported, but there is no CSI2 +@@ -338,30 +410,35 @@ static const struct unicam_fmt formats[] = { + .code = MEDIA_BUS_FMT_Y8_1X8, + .depth = 8, + .csi_dt = 0x2a, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_Y10P, + .repacked_fourcc = V4L2_PIX_FMT_Y10, + .code = MEDIA_BUS_FMT_Y10_1X10, + .depth = 10, + .csi_dt = 0x2b, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_Y12P, + .repacked_fourcc = V4L2_PIX_FMT_Y12, + .code = MEDIA_BUS_FMT_Y12_1X12, + .depth = 12, + .csi_dt = 0x2c, ++ .valid_colorspaces = MASK_CS_RAW, + }, { + .fourcc = V4L2_PIX_FMT_Y14P, + .repacked_fourcc = V4L2_PIX_FMT_Y14, + .code = MEDIA_BUS_FMT_Y14_1X14, + .depth = 14, + .csi_dt = 0x2d, ++ .valid_colorspaces = MASK_CS_RAW, + }, + /* Embedded data format */ + { + .fourcc = V4L2_META_FMT_SENSOR_DATA, + .code = MEDIA_BUS_FMT_SENSOR_DATA, + .depth = 8, ++ .metadata_fmt = 1, + } + }; + +@@ -406,6 +483,7 @@ struct unicam_node { + struct unicam_device *dev; + struct media_pad pad; + unsigned int embedded_lines; ++ struct media_pipeline pipe; + /* + * Dummy buffer intended to be used by unicam + * if we have no other queued buffers to swap to. +@@ -459,6 +537,8 @@ struct unicam_device { + + struct unicam_node node[MAX_NODES]; + struct v4l2_ctrl_handler ctrl_handler; ++ ++ bool mc_api; + }; + + static inline struct unicam_device * +@@ -908,6 +988,7 @@ static irqreturn_t unicam_isr(int irq, void *dev) + return IRQ_HANDLED; + } + ++/* V4L2 Common IOCTLs */ + static int unicam_querycap(struct file *file, void *priv, + struct v4l2_capability *cap) + { +@@ -925,6 +1006,38 @@ static int unicam_querycap(struct file *file, void *priv, + return 0; + } + ++static int unicam_log_status(struct file *file, void *fh) ++{ ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; ++ u32 reg; ++ ++ /* status for sub devices */ ++ v4l2_device_call_all(&dev->v4l2_dev, 0, core, log_status); ++ ++ unicam_info(dev, "-----Receiver status-----\n"); ++ unicam_info(dev, "V4L2 width/height: %ux%u\n", ++ node->v_fmt.fmt.pix.width, node->v_fmt.fmt.pix.height); ++ unicam_info(dev, "Mediabus format: %08x\n", node->fmt->code); ++ unicam_info(dev, "V4L2 format: %08x\n", ++ node->v_fmt.fmt.pix.pixelformat); ++ reg = reg_read(dev, UNICAM_IPIPE); ++ unicam_info(dev, "Unpacking/packing: %u / %u\n", ++ get_field(reg, UNICAM_PUM_MASK), ++ get_field(reg, UNICAM_PPM_MASK)); ++ unicam_info(dev, "----Live data----\n"); ++ unicam_info(dev, "Programmed stride: %4u\n", ++ reg_read(dev, UNICAM_IBLS)); ++ unicam_info(dev, "Detected resolution: %ux%u\n", ++ reg_read(dev, UNICAM_IHSTA), ++ reg_read(dev, UNICAM_IVSTA)); ++ unicam_info(dev, "Write pointer: %08x\n", ++ reg_read(dev, UNICAM_IBWP)); ++ ++ return 0; ++} ++ ++/* V4L2 Video Centric IOCTLs */ + static int unicam_enum_fmt_vid_cap(struct file *file, void *priv, + struct v4l2_fmtdesc *f) + { +@@ -1269,913 +1382,1271 @@ static int unicam_g_fmt_meta_cap(struct file *file, void *priv, + return 0; + } + +-static int unicam_queue_setup(struct vb2_queue *vq, +- unsigned int *nbuffers, +- unsigned int *nplanes, +- unsigned int sizes[], +- struct device *alloc_devs[]) ++static int unicam_enum_input(struct file *file, void *priv, ++ struct v4l2_input *inp) + { +- struct unicam_node *node = vb2_get_drv_priv(vq); ++ struct unicam_node *node = video_drvdata(file); + struct unicam_device *dev = node->dev; +- unsigned int size = node->pad_id == IMAGE_PAD ? +- node->v_fmt.fmt.pix.sizeimage : +- node->v_fmt.fmt.meta.buffersize; ++ int ret; + +- if (vq->num_buffers + *nbuffers < 3) +- *nbuffers = 3 - vq->num_buffers; ++ if (inp->index != 0) ++ return -EINVAL; + +- if (*nplanes) { +- if (sizes[0] < size) { +- unicam_err(dev, "sizes[0] %i < size %u\n", sizes[0], +- size); +- return -EINVAL; +- } +- size = sizes[0]; ++ inp->type = V4L2_INPUT_TYPE_CAMERA; ++ if (v4l2_subdev_has_op(dev->sensor, video, s_dv_timings)) { ++ inp->capabilities = V4L2_IN_CAP_DV_TIMINGS; ++ inp->std = 0; ++ } else if (v4l2_subdev_has_op(dev->sensor, video, s_std)) { ++ inp->capabilities = V4L2_IN_CAP_STD; ++ if (v4l2_subdev_call(dev->sensor, video, g_tvnorms, &inp->std) < 0) ++ inp->std = V4L2_STD_ALL; ++ } else { ++ inp->capabilities = 0; ++ inp->std = 0; + } + +- *nplanes = 1; +- sizes[0] = size; ++ if (v4l2_subdev_has_op(dev->sensor, video, g_input_status)) { ++ ret = v4l2_subdev_call(dev->sensor, video, g_input_status, ++ &inp->status); ++ if (ret < 0) ++ return ret; ++ } + ++ snprintf(inp->name, sizeof(inp->name), "Camera 0"); + return 0; + } + +-static int unicam_buffer_prepare(struct vb2_buffer *vb) ++static int unicam_g_input(struct file *file, void *priv, unsigned int *i) + { +- struct unicam_node *node = vb2_get_drv_priv(vb->vb2_queue); +- struct unicam_device *dev = node->dev; +- struct unicam_buffer *buf = to_unicam_buffer(vb); +- unsigned long size; ++ *i = 0; + +- if (WARN_ON(!node->fmt)) +- return -EINVAL; ++ return 0; ++} + +- size = node->pad_id == IMAGE_PAD ? node->v_fmt.fmt.pix.sizeimage : +- node->v_fmt.fmt.meta.buffersize; +- if (vb2_plane_size(vb, 0) < size) { +- unicam_err(dev, "data will not fit into plane (%lu < %lu)\n", +- vb2_plane_size(vb, 0), size); ++static int unicam_s_input(struct file *file, void *priv, unsigned int i) ++{ ++ /* ++ * FIXME: Ideally we would like to be able to query the source ++ * subdevice for information over the input connectors it supports, ++ * and map that through in to a call to video_ops->s_routing. ++ * There is no infrastructure support for defining that within ++ * devicetree at present. Until that is implemented we can't ++ * map a user physical connector number to s_routing input number. ++ */ ++ if (i > 0) + return -EINVAL; +- } + +- vb2_set_plane_payload(&buf->vb.vb2_buf, 0, size); + return 0; + } + +-static void unicam_buffer_queue(struct vb2_buffer *vb) ++static int unicam_querystd(struct file *file, void *priv, ++ v4l2_std_id *std) + { +- struct unicam_node *node = vb2_get_drv_priv(vb->vb2_queue); +- struct unicam_buffer *buf = to_unicam_buffer(vb); +- unsigned long flags; ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; + +- spin_lock_irqsave(&node->dma_queue_lock, flags); +- list_add_tail(&buf->list, &node->dma_queue); +- spin_unlock_irqrestore(&node->dma_queue_lock, flags); ++ return v4l2_subdev_call(dev->sensor, video, querystd, std); + } + +-static void unicam_set_packing_config(struct unicam_device *dev) ++static int unicam_g_std(struct file *file, void *priv, v4l2_std_id *std) + { +- u32 pack, unpack; +- u32 val; ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; + +- if (dev->node[IMAGE_PAD].v_fmt.fmt.pix.pixelformat == +- dev->node[IMAGE_PAD].fmt->fourcc) { +- unpack = UNICAM_PUM_NONE; +- pack = UNICAM_PPM_NONE; +- } else { +- switch (dev->node[IMAGE_PAD].fmt->depth) { +- case 8: +- unpack = UNICAM_PUM_UNPACK8; +- break; +- case 10: +- unpack = UNICAM_PUM_UNPACK10; +- break; +- case 12: +- unpack = UNICAM_PUM_UNPACK12; +- break; +- case 14: +- unpack = UNICAM_PUM_UNPACK14; +- break; +- case 16: +- unpack = UNICAM_PUM_UNPACK16; +- break; +- default: +- unpack = UNICAM_PUM_NONE; +- break; +- } ++ return v4l2_subdev_call(dev->sensor, video, g_std, std); ++} + +- /* Repacking is always to 16bpp */ +- pack = UNICAM_PPM_PACK16; +- } ++static int unicam_s_std(struct file *file, void *priv, v4l2_std_id std) ++{ ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; ++ int ret; ++ v4l2_std_id current_std; + +- val = 0; +- set_field(&val, unpack, UNICAM_PUM_MASK); +- set_field(&val, pack, UNICAM_PPM_MASK); +- reg_write(dev, UNICAM_IPIPE, val); ++ ret = v4l2_subdev_call(dev->sensor, video, g_std, ¤t_std); ++ if (ret) ++ return ret; ++ ++ if (std == current_std) ++ return 0; ++ ++ if (vb2_is_busy(&node->buffer_queue)) ++ return -EBUSY; ++ ++ ret = v4l2_subdev_call(dev->sensor, video, s_std, std); ++ ++ /* Force recomputation of bytesperline */ ++ node->v_fmt.fmt.pix.bytesperline = 0; ++ ++ unicam_reset_format(node); ++ ++ return ret; + } + +-static void unicam_cfg_image_id(struct unicam_device *dev) ++static int unicam_s_edid(struct file *file, void *priv, struct v4l2_edid *edid) + { +- if (dev->bus_type == V4L2_MBUS_CSI2_DPHY) { +- /* CSI2 mode, hardcode VC 0 for now. */ +- reg_write(dev, UNICAM_IDI0, +- (0 << 6) | dev->node[IMAGE_PAD].fmt->csi_dt); +- } else { +- /* CCP2 mode */ +- reg_write(dev, UNICAM_IDI0, +- 0x80 | dev->node[IMAGE_PAD].fmt->csi_dt); +- } ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; ++ ++ return v4l2_subdev_call(dev->sensor, pad, set_edid, edid); + } + +-static void unicam_enable_ed(struct unicam_device *dev) ++static int unicam_g_edid(struct file *file, void *priv, struct v4l2_edid *edid) + { +- u32 val = reg_read(dev, UNICAM_DCS); +- +- set_field(&val, 2, UNICAM_EDL_MASK); +- /* Do not wrap at the end of the embedded data buffer */ +- set_field(&val, 0, UNICAM_DBOB); ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; + +- reg_write(dev, UNICAM_DCS, val); ++ return v4l2_subdev_call(dev->sensor, pad, get_edid, edid); + } + +-static void unicam_start_rx(struct unicam_device *dev, dma_addr_t *addr) ++static int unicam_s_selection(struct file *file, void *priv, ++ struct v4l2_selection *sel) + { +- int line_int_freq = dev->node[IMAGE_PAD].v_fmt.fmt.pix.height >> 2; +- unsigned int size, i; +- u32 val; ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; ++ struct v4l2_subdev_selection sdsel = { ++ .which = V4L2_SUBDEV_FORMAT_ACTIVE, ++ .target = sel->target, ++ .flags = sel->flags, ++ .r = sel->r, ++ }; + +- if (line_int_freq < 128) +- line_int_freq = 128; ++ if (sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ++ return -EINVAL; + +- /* Enable lane clocks */ +- val = 1; +- for (i = 0; i < dev->active_data_lanes; i++) +- val = val << 2 | 1; +- clk_write(dev, val); ++ return v4l2_subdev_call(dev->sensor, pad, set_selection, NULL, &sdsel); ++} + +- /* Basic init */ +- reg_write(dev, UNICAM_CTRL, UNICAM_MEM); ++static int unicam_g_selection(struct file *file, void *priv, ++ struct v4l2_selection *sel) ++{ ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; ++ struct v4l2_subdev_selection sdsel = { ++ .which = V4L2_SUBDEV_FORMAT_ACTIVE, ++ .target = sel->target, ++ }; ++ int ret; + +- /* Enable analogue control, and leave in reset. */ +- val = UNICAM_AR; +- set_field(&val, 7, UNICAM_CTATADJ_MASK); +- set_field(&val, 7, UNICAM_PTATADJ_MASK); +- reg_write(dev, UNICAM_ANA, val); +- usleep_range(1000, 2000); ++ if (sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ++ return -EINVAL; + +- /* Come out of reset */ +- reg_write_field(dev, UNICAM_ANA, 0, UNICAM_AR); ++ ret = v4l2_subdev_call(dev->sensor, pad, get_selection, NULL, &sdsel); ++ if (!ret) ++ sel->r = sdsel.r; + +- /* Peripheral reset */ +- reg_write_field(dev, UNICAM_CTRL, 1, UNICAM_CPR); +- reg_write_field(dev, UNICAM_CTRL, 0, UNICAM_CPR); ++ return ret; ++} + +- reg_write_field(dev, UNICAM_CTRL, 0, UNICAM_CPE); ++static int unicam_enum_framesizes(struct file *file, void *priv, ++ struct v4l2_frmsizeenum *fsize) ++{ ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; ++ const struct unicam_fmt *fmt; ++ struct v4l2_subdev_frame_size_enum fse; ++ int ret; + +- /* Enable Rx control. */ +- val = reg_read(dev, UNICAM_CTRL); +- if (dev->bus_type == V4L2_MBUS_CSI2_DPHY) { +- set_field(&val, UNICAM_CPM_CSI2, UNICAM_CPM_MASK); +- set_field(&val, UNICAM_DCM_STROBE, UNICAM_DCM_MASK); +- } else { +- set_field(&val, UNICAM_CPM_CCP2, UNICAM_CPM_MASK); +- set_field(&val, dev->bus_flags, UNICAM_DCM_MASK); ++ /* check for valid format */ ++ fmt = find_format_by_pix(dev, fsize->pixel_format); ++ if (!fmt) { ++ unicam_dbg(3, dev, "Invalid pixel code: %x\n", ++ fsize->pixel_format); ++ return -EINVAL; + } +- /* Packet framer timeout */ +- set_field(&val, 0xf, UNICAM_PFT_MASK); +- set_field(&val, 128, UNICAM_OET_MASK); +- reg_write(dev, UNICAM_CTRL, val); +- +- reg_write(dev, UNICAM_IHWIN, 0); +- reg_write(dev, UNICAM_IVWIN, 0); +- +- /* AXI bus access QoS setup */ +- val = reg_read(dev, UNICAM_PRI); +- set_field(&val, 0, UNICAM_BL_MASK); +- set_field(&val, 0, UNICAM_BS_MASK); +- set_field(&val, 0xe, UNICAM_PP_MASK); +- set_field(&val, 8, UNICAM_NP_MASK); +- set_field(&val, 2, UNICAM_PT_MASK); +- set_field(&val, 1, UNICAM_PE); +- reg_write(dev, UNICAM_PRI, val); +- +- reg_write_field(dev, UNICAM_ANA, 0, UNICAM_DDL); ++ fse.code = fmt->code; + +- /* Always start in trigger frame capture mode (UNICAM_FCM set) */ +- val = UNICAM_FSIE | UNICAM_FEIE | UNICAM_FCM | UNICAM_IBOB; +- set_field(&val, line_int_freq, UNICAM_LCIE_MASK); +- reg_write(dev, UNICAM_ICTL, val); +- reg_write(dev, UNICAM_STA, UNICAM_STA_MASK_ALL); +- reg_write(dev, UNICAM_ISTA, UNICAM_ISTA_MASK_ALL); ++ fse.which = V4L2_SUBDEV_FORMAT_ACTIVE; ++ fse.index = fsize->index; ++ fse.pad = node->src_pad_id; + +- /* tclk_term_en */ +- reg_write_field(dev, UNICAM_CLT, 2, UNICAM_CLT1_MASK); +- /* tclk_settle */ +- reg_write_field(dev, UNICAM_CLT, 6, UNICAM_CLT2_MASK); +- /* td_term_en */ +- reg_write_field(dev, UNICAM_DLT, 2, UNICAM_DLT1_MASK); +- /* ths_settle */ +- reg_write_field(dev, UNICAM_DLT, 6, UNICAM_DLT2_MASK); +- /* trx_enable */ +- reg_write_field(dev, UNICAM_DLT, 0, UNICAM_DLT3_MASK); ++ ret = v4l2_subdev_call(dev->sensor, pad, enum_frame_size, NULL, &fse); ++ if (ret) ++ return ret; + +- reg_write_field(dev, UNICAM_CTRL, 0, UNICAM_SOE); ++ unicam_dbg(1, dev, "%s: index: %d code: %x W:[%d,%d] H:[%d,%d]\n", ++ __func__, fse.index, fse.code, fse.min_width, fse.max_width, ++ fse.min_height, fse.max_height); + +- /* Packet compare setup - required to avoid missing frame ends */ +- val = 0; +- set_field(&val, 1, UNICAM_PCE); +- set_field(&val, 1, UNICAM_GI); +- set_field(&val, 1, UNICAM_CPH); +- set_field(&val, 0, UNICAM_PCVC_MASK); +- set_field(&val, 1, UNICAM_PCDT_MASK); +- reg_write(dev, UNICAM_CMP0, val); ++ fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; ++ fsize->discrete.width = fse.max_width; ++ fsize->discrete.height = fse.max_height; + +- /* Enable clock lane and set up terminations */ +- val = 0; +- if (dev->bus_type == V4L2_MBUS_CSI2_DPHY) { +- /* CSI2 */ +- set_field(&val, 1, UNICAM_CLE); +- set_field(&val, 1, UNICAM_CLLPE); +- if (dev->bus_flags & V4L2_MBUS_CSI2_CONTINUOUS_CLOCK) { +- set_field(&val, 1, UNICAM_CLTRE); +- set_field(&val, 1, UNICAM_CLHSE); +- } +- } else { +- /* CCP2 */ +- set_field(&val, 1, UNICAM_CLE); +- set_field(&val, 1, UNICAM_CLHSE); +- set_field(&val, 1, UNICAM_CLTRE); +- } +- reg_write(dev, UNICAM_CLK, val); ++ return 0; ++} + +- /* +- * Enable required data lanes with appropriate terminations. +- * The same value needs to be written to UNICAM_DATn registers for +- * the active lanes, and 0 for inactive ones. +- */ +- val = 0; +- if (dev->bus_type == V4L2_MBUS_CSI2_DPHY) { +- /* CSI2 */ +- set_field(&val, 1, UNICAM_DLE); +- set_field(&val, 1, UNICAM_DLLPE); +- if (dev->bus_flags & V4L2_MBUS_CSI2_CONTINUOUS_CLOCK) { +- set_field(&val, 1, UNICAM_DLTRE); +- set_field(&val, 1, UNICAM_DLHSE); +- } +- } else { +- /* CCP2 */ +- set_field(&val, 1, UNICAM_DLE); +- set_field(&val, 1, UNICAM_DLHSE); +- set_field(&val, 1, UNICAM_DLTRE); +- } +- reg_write(dev, UNICAM_DAT0, val); ++static int unicam_enum_frameintervals(struct file *file, void *priv, ++ struct v4l2_frmivalenum *fival) ++{ ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; ++ const struct unicam_fmt *fmt; ++ struct v4l2_subdev_frame_interval_enum fie = { ++ .index = fival->index, ++ .pad = node->src_pad_id, ++ .width = fival->width, ++ .height = fival->height, ++ .which = V4L2_SUBDEV_FORMAT_ACTIVE, ++ }; ++ int ret; + +- if (dev->active_data_lanes == 1) +- val = 0; +- reg_write(dev, UNICAM_DAT1, val); ++ fmt = find_format_by_pix(dev, fival->pixel_format); ++ if (!fmt) ++ return -EINVAL; + +- if (dev->max_data_lanes > 2) { +- /* +- * Registers UNICAM_DAT2 and UNICAM_DAT3 only valid if the +- * instance supports more than 2 data lanes. +- */ +- if (dev->active_data_lanes == 2) +- val = 0; +- reg_write(dev, UNICAM_DAT2, val); ++ fie.code = fmt->code; ++ ret = v4l2_subdev_call(dev->sensor, pad, enum_frame_interval, ++ NULL, &fie); ++ if (ret) ++ return ret; + +- if (dev->active_data_lanes == 3) +- val = 0; +- reg_write(dev, UNICAM_DAT3, val); +- } ++ fival->type = V4L2_FRMIVAL_TYPE_DISCRETE; ++ fival->discrete = fie.interval; + +- reg_write(dev, UNICAM_IBLS, +- dev->node[IMAGE_PAD].v_fmt.fmt.pix.bytesperline); +- size = dev->node[IMAGE_PAD].v_fmt.fmt.pix.sizeimage; +- unicam_wr_dma_addr(dev, addr[IMAGE_PAD], size, IMAGE_PAD); +- unicam_set_packing_config(dev); +- unicam_cfg_image_id(dev); ++ return 0; ++} + +- val = reg_read(dev, UNICAM_MISC); +- set_field(&val, 1, UNICAM_FL0); +- set_field(&val, 1, UNICAM_FL1); +- reg_write(dev, UNICAM_MISC, val); ++static int unicam_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a) ++{ ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; + +- if (dev->node[METADATA_PAD].streaming && dev->sensor_embedded_data) { +- size = dev->node[METADATA_PAD].v_fmt.fmt.meta.buffersize; +- unicam_enable_ed(dev); +- unicam_wr_dma_addr(dev, addr[METADATA_PAD], size, METADATA_PAD); +- } ++ return v4l2_g_parm_cap(video_devdata(file), dev->sensor, a); ++} + +- /* Enable peripheral */ +- reg_write_field(dev, UNICAM_CTRL, 1, UNICAM_CPE); ++static int unicam_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a) ++{ ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; + +- /* Load image pointers */ +- reg_write_field(dev, UNICAM_ICTL, 1, UNICAM_LIP_MASK); ++ return v4l2_s_parm_cap(video_devdata(file), dev->sensor, a); ++} + +- /* Load embedded data buffer pointers if needed */ +- if (dev->node[METADATA_PAD].streaming && dev->sensor_embedded_data) +- reg_write_field(dev, UNICAM_DCS, 1, UNICAM_LDP); ++static int unicam_g_dv_timings(struct file *file, void *priv, ++ struct v4l2_dv_timings *timings) ++{ ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; + +- /* +- * Enable trigger only for the first frame to +- * sync correctly to the FS from the source. +- */ +- reg_write_field(dev, UNICAM_ICTL, 1, UNICAM_TFC); ++ return v4l2_subdev_call(dev->sensor, video, g_dv_timings, timings); + } + +-static void unicam_disable(struct unicam_device *dev) ++static int unicam_s_dv_timings(struct file *file, void *priv, ++ struct v4l2_dv_timings *timings) + { +- /* Analogue lane control disable */ +- reg_write_field(dev, UNICAM_ANA, 1, UNICAM_DDL); ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; ++ struct v4l2_dv_timings current_timings; ++ int ret; + +- /* Stop the output engine */ +- reg_write_field(dev, UNICAM_CTRL, 1, UNICAM_SOE); ++ ret = v4l2_subdev_call(dev->sensor, video, g_dv_timings, ++ ¤t_timings); + +- /* Disable the data lanes. */ +- reg_write(dev, UNICAM_DAT0, 0); +- reg_write(dev, UNICAM_DAT1, 0); ++ if (ret < 0) ++ return ret; + +- if (dev->max_data_lanes > 2) { +- reg_write(dev, UNICAM_DAT2, 0); +- reg_write(dev, UNICAM_DAT3, 0); +- } ++ if (v4l2_match_dv_timings(timings, ¤t_timings, 0, false)) ++ return 0; + +- /* Peripheral reset */ +- reg_write_field(dev, UNICAM_CTRL, 1, UNICAM_CPR); +- usleep_range(50, 100); +- reg_write_field(dev, UNICAM_CTRL, 0, UNICAM_CPR); ++ if (vb2_is_busy(&node->buffer_queue)) ++ return -EBUSY; + +- /* Disable peripheral */ +- reg_write_field(dev, UNICAM_CTRL, 0, UNICAM_CPE); ++ ret = v4l2_subdev_call(dev->sensor, video, s_dv_timings, timings); + +- /* Clear ED setup */ +- reg_write(dev, UNICAM_DCS, 0); ++ /* Force recomputation of bytesperline */ ++ node->v_fmt.fmt.pix.bytesperline = 0; + +- /* Disable all lane clocks */ +- clk_write(dev, 0); +-} ++ unicam_reset_format(node); + +-static void unicam_return_buffers(struct unicam_node *node, +- enum vb2_buffer_state state) +-{ +- struct unicam_buffer *buf, *tmp; +- unsigned long flags; +- +- spin_lock_irqsave(&node->dma_queue_lock, flags); +- list_for_each_entry_safe(buf, tmp, &node->dma_queue, list) { +- list_del(&buf->list); +- vb2_buffer_done(&buf->vb.vb2_buf, state); +- } ++ return ret; ++} + +- if (node->cur_frm) +- vb2_buffer_done(&node->cur_frm->vb.vb2_buf, +- state); +- if (node->next_frm && node->cur_frm != node->next_frm) +- vb2_buffer_done(&node->next_frm->vb.vb2_buf, +- state); ++static int unicam_query_dv_timings(struct file *file, void *priv, ++ struct v4l2_dv_timings *timings) ++{ ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; + +- node->cur_frm = NULL; +- node->next_frm = NULL; +- spin_unlock_irqrestore(&node->dma_queue_lock, flags); ++ return v4l2_subdev_call(dev->sensor, video, query_dv_timings, timings); + } + +-static int unicam_start_streaming(struct vb2_queue *vq, unsigned int count) ++static int unicam_enum_dv_timings(struct file *file, void *priv, ++ struct v4l2_enum_dv_timings *timings) + { +- struct unicam_node *node = vb2_get_drv_priv(vq); ++ struct unicam_node *node = video_drvdata(file); + struct unicam_device *dev = node->dev; +- dma_addr_t buffer_addr[MAX_NODES] = { 0 }; +- unsigned long flags; +- unsigned int i; + int ret; + +- node->streaming = true; +- if (!(dev->node[IMAGE_PAD].open && dev->node[IMAGE_PAD].streaming && +- (!dev->node[METADATA_PAD].open || +- dev->node[METADATA_PAD].streaming))) { +- /* +- * Metadata pad must be enabled before image pad if it is +- * wanted. +- */ +- unicam_dbg(3, dev, "Not all nodes are streaming yet."); +- return 0; +- } ++ timings->pad = node->src_pad_id; ++ ret = v4l2_subdev_call(dev->sensor, pad, enum_dv_timings, timings); ++ timings->pad = node->pad_id; + +- dev->sequence = 0; +- ret = unicam_runtime_get(dev); +- if (ret < 0) { +- unicam_dbg(3, dev, "unicam_runtime_get failed\n"); +- goto err_streaming; +- } ++ return ret; ++} + +- dev->active_data_lanes = dev->max_data_lanes; ++static int unicam_dv_timings_cap(struct file *file, void *priv, ++ struct v4l2_dv_timings_cap *cap) ++{ ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; ++ int ret; + +- if (dev->bus_type == V4L2_MBUS_CSI2_DPHY) { +- struct v4l2_mbus_config mbus_config = { 0 }; ++ cap->pad = node->src_pad_id; ++ ret = v4l2_subdev_call(dev->sensor, pad, dv_timings_cap, cap); ++ cap->pad = node->pad_id; + +- ret = v4l2_subdev_call(dev->sensor, pad, get_mbus_config, +- 0, &mbus_config); +- if (ret < 0 && ret != -ENOIOCTLCMD) { +- unicam_dbg(3, dev, "g_mbus_config failed\n"); +- goto err_pm_put; +- } ++ return ret; ++} + +- dev->active_data_lanes = +- (mbus_config.flags & V4L2_MBUS_CSI2_LANE_MASK) >> +- __ffs(V4L2_MBUS_CSI2_LANE_MASK); +- if (!dev->active_data_lanes) +- dev->active_data_lanes = dev->max_data_lanes; +- if (dev->active_data_lanes > dev->max_data_lanes) { +- unicam_err(dev, "Device has requested %u data lanes, which is >%u configured in DT\n", +- dev->active_data_lanes, +- dev->max_data_lanes); +- ret = -EINVAL; +- goto err_pm_put; +- } ++static int unicam_subscribe_event(struct v4l2_fh *fh, ++ const struct v4l2_event_subscription *sub) ++{ ++ switch (sub->type) { ++ case V4L2_EVENT_FRAME_SYNC: ++ return v4l2_event_subscribe(fh, sub, 2, NULL); ++ case V4L2_EVENT_SOURCE_CHANGE: ++ return v4l2_event_subscribe(fh, sub, 4, NULL); + } + +- unicam_dbg(1, dev, "Running with %u data lanes\n", +- dev->active_data_lanes); +- +- dev->vpu_req = clk_request_start(dev->vpu_clock, MIN_VPU_CLOCK_RATE); +- if (!dev->vpu_req) { +- unicam_err(dev, "failed to set up VPU clock\n"); +- goto err_pm_put; +- } ++ return v4l2_ctrl_subscribe_event(fh, sub); ++} + +- ret = clk_prepare_enable(dev->vpu_clock); +- if (ret) { +- unicam_err(dev, "Failed to enable VPU clock: %d\n", ret); +- goto err_pm_put; +- } ++static void unicam_notify(struct v4l2_subdev *sd, ++ unsigned int notification, void *arg) ++{ ++ struct unicam_device *dev = to_unicam_device(sd->v4l2_dev); + +- ret = clk_set_rate(dev->clock, 100 * 1000 * 1000); +- if (ret) { +- unicam_err(dev, "failed to set up CSI clock\n"); +- goto err_vpu_clock; ++ switch (notification) { ++ case V4L2_DEVICE_NOTIFY_EVENT: ++ v4l2_event_queue(&dev->node[IMAGE_PAD].video_dev, arg); ++ break; ++ default: ++ break; + } ++} + +- ret = clk_prepare_enable(dev->clock); +- if (ret) { +- unicam_err(dev, "Failed to enable CSI clock: %d\n", ret); +- goto err_vpu_clock; +- } ++/* unicam capture ioctl operations */ ++static const struct v4l2_ioctl_ops unicam_ioctl_ops = { ++ .vidioc_querycap = unicam_querycap, ++ .vidioc_enum_fmt_vid_cap = unicam_enum_fmt_vid_cap, ++ .vidioc_g_fmt_vid_cap = unicam_g_fmt_vid_cap, ++ .vidioc_s_fmt_vid_cap = unicam_s_fmt_vid_cap, ++ .vidioc_try_fmt_vid_cap = unicam_try_fmt_vid_cap, + +- for (i = 0; i < ARRAY_SIZE(dev->node); i++) { +- struct unicam_buffer *buf; ++ .vidioc_enum_fmt_meta_cap = unicam_enum_fmt_meta_cap, ++ .vidioc_g_fmt_meta_cap = unicam_g_fmt_meta_cap, ++ .vidioc_s_fmt_meta_cap = unicam_g_fmt_meta_cap, ++ .vidioc_try_fmt_meta_cap = unicam_g_fmt_meta_cap, + +- if (!dev->node[i].streaming) +- continue; ++ .vidioc_enum_input = unicam_enum_input, ++ .vidioc_g_input = unicam_g_input, ++ .vidioc_s_input = unicam_s_input, + +- spin_lock_irqsave(&dev->node[i].dma_queue_lock, flags); +- buf = list_first_entry(&dev->node[i].dma_queue, +- struct unicam_buffer, list); +- dev->node[i].cur_frm = buf; +- dev->node[i].next_frm = buf; +- list_del(&buf->list); +- spin_unlock_irqrestore(&dev->node[i].dma_queue_lock, flags); ++ .vidioc_querystd = unicam_querystd, ++ .vidioc_s_std = unicam_s_std, ++ .vidioc_g_std = unicam_g_std, + +- buffer_addr[i] = +- vb2_dma_contig_plane_dma_addr(&buf->vb.vb2_buf, 0); +- } ++ .vidioc_g_edid = unicam_g_edid, ++ .vidioc_s_edid = unicam_s_edid, + +- unicam_start_rx(dev, buffer_addr); ++ .vidioc_enum_framesizes = unicam_enum_framesizes, ++ .vidioc_enum_frameintervals = unicam_enum_frameintervals, + +- ret = v4l2_subdev_call(dev->sensor, video, s_stream, 1); +- if (ret < 0) { +- unicam_err(dev, "stream on failed in subdev\n"); +- goto err_disable_unicam; +- } ++ .vidioc_g_selection = unicam_g_selection, ++ .vidioc_s_selection = unicam_s_selection, + +- dev->clocks_enabled = true; +- return 0; ++ .vidioc_g_parm = unicam_g_parm, ++ .vidioc_s_parm = unicam_s_parm, + +-err_disable_unicam: +- unicam_disable(dev); +- clk_disable_unprepare(dev->clock); +-err_vpu_clock: +- clk_request_done(dev->vpu_req); +- clk_disable_unprepare(dev->vpu_clock); +-err_pm_put: +- unicam_runtime_put(dev); +-err_streaming: +- unicam_return_buffers(node, VB2_BUF_STATE_QUEUED); +- node->streaming = false; ++ .vidioc_s_dv_timings = unicam_s_dv_timings, ++ .vidioc_g_dv_timings = unicam_g_dv_timings, ++ .vidioc_query_dv_timings = unicam_query_dv_timings, ++ .vidioc_enum_dv_timings = unicam_enum_dv_timings, ++ .vidioc_dv_timings_cap = unicam_dv_timings_cap, + +- return ret; +-} ++ .vidioc_reqbufs = vb2_ioctl_reqbufs, ++ .vidioc_create_bufs = vb2_ioctl_create_bufs, ++ .vidioc_prepare_buf = vb2_ioctl_prepare_buf, ++ .vidioc_querybuf = vb2_ioctl_querybuf, ++ .vidioc_qbuf = vb2_ioctl_qbuf, ++ .vidioc_dqbuf = vb2_ioctl_dqbuf, ++ .vidioc_expbuf = vb2_ioctl_expbuf, ++ .vidioc_streamon = vb2_ioctl_streamon, ++ .vidioc_streamoff = vb2_ioctl_streamoff, + +-static void unicam_stop_streaming(struct vb2_queue *vq) +-{ +- struct unicam_node *node = vb2_get_drv_priv(vq); +- struct unicam_device *dev = node->dev; ++ .vidioc_log_status = unicam_log_status, ++ .vidioc_subscribe_event = unicam_subscribe_event, ++ .vidioc_unsubscribe_event = v4l2_event_unsubscribe, ++}; + +- node->streaming = false; ++/* V4L2 Media Controller Centric IOCTLs */ + +- if (node->pad_id == IMAGE_PAD) { +- /* +- * Stop streaming the sensor and disable the peripheral. +- * We cannot continue streaming embedded data with the +- * image pad disabled. +- */ +- if (v4l2_subdev_call(dev->sensor, video, s_stream, 0) < 0) +- unicam_err(dev, "stream off failed in subdev\n"); ++static int unicam_mc_enum_fmt_vid_cap(struct file *file, void *priv, ++ struct v4l2_fmtdesc *f) ++{ ++ int i, j; + +- unicam_disable(dev); ++ for (i = 0, j = 0; i < ARRAY_SIZE(formats); i++) { ++ if (f->mbus_code && formats[i].code != f->mbus_code) ++ continue; ++ if (formats[i].mc_skip || formats[i].metadata_fmt) ++ continue; + +- if (dev->clocks_enabled) { +- clk_request_done(dev->vpu_req); +- clk_disable_unprepare(dev->vpu_clock); +- clk_disable_unprepare(dev->clock); +- dev->clocks_enabled = false; ++ if (formats[i].fourcc) { ++ if (j == f->index) { ++ f->pixelformat = formats[i].fourcc; ++ f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ return 0; ++ } ++ j++; ++ } ++ if (formats[i].repacked_fourcc) { ++ if (j == f->index) { ++ f->pixelformat = formats[i].repacked_fourcc; ++ f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ return 0; ++ } ++ j++; + } +- unicam_runtime_put(dev); +- +- } else if (node->pad_id == METADATA_PAD) { +- /* +- * Allow the hardware to spin in the dummy buffer. +- * This is only really needed if the embedded data pad is +- * disabled before the image pad. +- */ +- unicam_wr_dma_addr(dev, node->dummy_buf_dma_addr, +- DUMMY_BUF_SIZE, METADATA_PAD); + } + +- /* Clear all queued buffers for the node */ +- unicam_return_buffers(node, VB2_BUF_STATE_ERROR); ++ return -EINVAL; + } + +-static int unicam_enum_input(struct file *file, void *priv, +- struct v4l2_input *inp) ++static int unicam_mc_g_fmt_vid_cap(struct file *file, void *priv, ++ struct v4l2_format *f) + { + struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; +- int ret; + +- if (inp->index != 0) ++ if (node->pad_id != IMAGE_PAD) + return -EINVAL; + +- inp->type = V4L2_INPUT_TYPE_CAMERA; +- if (v4l2_subdev_has_op(dev->sensor, video, s_dv_timings)) { +- inp->capabilities = V4L2_IN_CAP_DV_TIMINGS; +- inp->std = 0; +- } else if (v4l2_subdev_has_op(dev->sensor, video, s_std)) { +- inp->capabilities = V4L2_IN_CAP_STD; +- if (v4l2_subdev_call(dev->sensor, video, g_tvnorms, &inp->std) < 0) +- inp->std = V4L2_STD_ALL; +- } else { +- inp->capabilities = 0; +- inp->std = 0; ++ *f = node->v_fmt; ++ ++ return 0; ++} ++ ++static void unicam_mc_try_fmt(struct unicam_node *node, struct v4l2_format *f, ++ const struct unicam_fmt **ret_fmt) ++{ ++ struct v4l2_pix_format *v4l2_format = &f->fmt.pix; ++ struct unicam_device *dev = node->dev; ++ const struct unicam_fmt *fmt; ++ int is_rgb; ++ ++ /* ++ * Default to the first format if the requested pixel format code isn't ++ * supported. ++ */ ++ fmt = find_format_by_pix(dev, v4l2_format->pixelformat); ++ if (!fmt) { ++ fmt = &formats[0]; ++ v4l2_format->pixelformat = fmt->fourcc; + } + +- if (v4l2_subdev_has_op(dev->sensor, video, g_input_status)) { +- ret = v4l2_subdev_call(dev->sensor, video, g_input_status, +- &inp->status); +- if (ret < 0) +- return ret; ++ unicam_calc_format_size_bpl(dev, fmt, f); ++ ++ if (v4l2_format->field == V4L2_FIELD_ANY) ++ v4l2_format->field = V4L2_FIELD_NONE; ++ ++ if (ret_fmt) ++ *ret_fmt = fmt; ++ ++ if (v4l2_format->colorspace >= MAX_COLORSPACE || ++ !(fmt->valid_colorspaces & (1 << v4l2_format->colorspace))) { ++ v4l2_format->colorspace = __ffs(fmt->valid_colorspaces); ++ ++ v4l2_format->xfer_func = ++ V4L2_MAP_XFER_FUNC_DEFAULT(v4l2_format->colorspace); ++ v4l2_format->ycbcr_enc = ++ V4L2_MAP_YCBCR_ENC_DEFAULT(v4l2_format->colorspace); ++ is_rgb = v4l2_format->colorspace == V4L2_COLORSPACE_SRGB; ++ v4l2_format->quantization = ++ V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, ++ v4l2_format->colorspace, ++ v4l2_format->ycbcr_enc); + } + +- snprintf(inp->name, sizeof(inp->name), "Camera 0"); ++ unicam_dbg(3, dev, "%s: %08x %ux%u (bytesperline %u sizeimage %u)\n", ++ __func__, v4l2_format->pixelformat, ++ v4l2_format->width, v4l2_format->height, ++ v4l2_format->bytesperline, v4l2_format->sizeimage); ++} ++ ++static int unicam_mc_try_fmt_vid_cap(struct file *file, void *priv, ++ struct v4l2_format *f) ++{ ++ struct unicam_node *node = video_drvdata(file); ++ ++ unicam_mc_try_fmt(node, f, NULL); + return 0; + } + +-static int unicam_g_input(struct file *file, void *priv, unsigned int *i) ++static int unicam_mc_s_fmt_vid_cap(struct file *file, void *priv, ++ struct v4l2_format *f) + { +- *i = 0; ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; ++ const struct unicam_fmt *fmt; ++ ++ if (vb2_is_busy(&node->buffer_queue)) { ++ unicam_dbg(3, dev, "%s device busy\n", __func__); ++ return -EBUSY; ++ } ++ ++ unicam_mc_try_fmt(node, f, &fmt); ++ ++ node->v_fmt = *f; ++ node->fmt = fmt; + + return 0; + } + +-static int unicam_s_input(struct file *file, void *priv, unsigned int i) ++static int unicam_mc_enum_framesizes(struct file *file, void *fh, ++ struct v4l2_frmsizeenum *fsize) + { +- /* +- * FIXME: Ideally we would like to be able to query the source +- * subdevice for information over the input connectors it supports, +- * and map that through in to a call to video_ops->s_routing. +- * There is no infrastructure support for defining that within +- * devicetree at present. Until that is implemented we can't +- * map a user physical connector number to s_routing input number. +- */ +- if (i > 0) ++ struct unicam_node *node = video_drvdata(file); ++ struct unicam_device *dev = node->dev; ++ ++ if (fsize->index > 0) ++ return -EINVAL; ++ ++ if (!find_format_by_pix(dev, fsize->pixel_format)) { ++ unicam_dbg(3, dev, "Invalid pixel format 0x%08x\n", ++ fsize->pixel_format); + return -EINVAL; ++ } ++ ++ fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE; ++ fsize->stepwise.min_width = MIN_WIDTH; ++ fsize->stepwise.max_width = MAX_WIDTH; ++ fsize->stepwise.step_width = 1; ++ fsize->stepwise.min_height = MIN_HEIGHT; ++ fsize->stepwise.max_height = MAX_HEIGHT; ++ fsize->stepwise.step_height = 1; + + return 0; + } + +-static int unicam_querystd(struct file *file, void *priv, +- v4l2_std_id *std) ++static int unicam_mc_enum_fmt_meta_cap(struct file *file, void *priv, ++ struct v4l2_fmtdesc *f) ++{ ++ int i, j; ++ ++ for (i = 0, j = 0; i < ARRAY_SIZE(formats); i++) { ++ if (f->mbus_code && formats[i].code != f->mbus_code) ++ continue; ++ if (!formats[i].metadata_fmt) ++ continue; ++ ++ if (formats[i].fourcc) { ++ if (j == f->index) { ++ f->pixelformat = formats[i].fourcc; ++ f->type = V4L2_BUF_TYPE_META_CAPTURE; ++ return 0; ++ } ++ j++; ++ } ++ } ++ ++ return -EINVAL; ++} ++ ++static int unicam_mc_g_fmt_meta_cap(struct file *file, void *priv, ++ struct v4l2_format *f) + { + struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; + +- return v4l2_subdev_call(dev->sensor, video, querystd, std); ++ if (node->pad_id != METADATA_PAD) ++ return -EINVAL; ++ ++ *f = node->v_fmt; ++ ++ return 0; + } + +-static int unicam_g_std(struct file *file, void *priv, v4l2_std_id *std) ++static int unicam_mc_try_fmt_meta_cap(struct file *file, void *priv, ++ struct v4l2_format *f) + { + struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; + +- return v4l2_subdev_call(dev->sensor, video, g_std, std); ++ if (node->pad_id != METADATA_PAD) ++ return -EINVAL; ++ ++ f->fmt.meta.dataformat = V4L2_META_FMT_SENSOR_DATA; ++ ++ return 0; + } + +-static int unicam_s_std(struct file *file, void *priv, v4l2_std_id std) ++static int unicam_mc_s_fmt_meta_cap(struct file *file, void *priv, ++ struct v4l2_format *f) + { + struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; ++ ++ if (node->pad_id != METADATA_PAD) ++ return -EINVAL; ++ ++ unicam_mc_try_fmt_meta_cap(file, priv, f); ++ ++ node->v_fmt = *f; ++ ++ return 0; ++} ++ ++static const struct v4l2_ioctl_ops unicam_mc_ioctl_ops = { ++ .vidioc_querycap = unicam_querycap, ++ .vidioc_enum_fmt_vid_cap = unicam_mc_enum_fmt_vid_cap, ++ .vidioc_g_fmt_vid_cap = unicam_mc_g_fmt_vid_cap, ++ .vidioc_try_fmt_vid_cap = unicam_mc_try_fmt_vid_cap, ++ .vidioc_s_fmt_vid_cap = unicam_mc_s_fmt_vid_cap, ++ ++ .vidioc_enum_fmt_meta_cap = unicam_mc_enum_fmt_meta_cap, ++ .vidioc_g_fmt_meta_cap = unicam_mc_g_fmt_meta_cap, ++ .vidioc_try_fmt_meta_cap = unicam_mc_try_fmt_meta_cap, ++ .vidioc_s_fmt_meta_cap = unicam_mc_s_fmt_meta_cap, ++ ++ .vidioc_enum_framesizes = unicam_mc_enum_framesizes, ++ .vidioc_reqbufs = vb2_ioctl_reqbufs, ++ .vidioc_create_bufs = vb2_ioctl_create_bufs, ++ .vidioc_prepare_buf = vb2_ioctl_prepare_buf, ++ .vidioc_querybuf = vb2_ioctl_querybuf, ++ .vidioc_qbuf = vb2_ioctl_qbuf, ++ .vidioc_dqbuf = vb2_ioctl_dqbuf, ++ .vidioc_expbuf = vb2_ioctl_expbuf, ++ .vidioc_streamon = vb2_ioctl_streamon, ++ .vidioc_streamoff = vb2_ioctl_streamoff, ++ ++ .vidioc_log_status = unicam_log_status, ++ .vidioc_subscribe_event = unicam_subscribe_event, ++ .vidioc_unsubscribe_event = v4l2_event_unsubscribe, ++}; ++ ++static int ++unicam_mc_subdev_link_validate_get_format(struct media_pad *pad, ++ struct v4l2_subdev_format *fmt) ++{ ++ if (is_media_entity_v4l2_subdev(pad->entity)) { ++ struct v4l2_subdev *sd = ++ media_entity_to_v4l2_subdev(pad->entity); ++ ++ fmt->which = V4L2_SUBDEV_FORMAT_ACTIVE; ++ fmt->pad = pad->index; ++ return v4l2_subdev_call(sd, pad, get_fmt, NULL, fmt); ++ } ++ ++ return -EINVAL; ++} ++ ++static int unicam_mc_video_link_validate(struct media_link *link) ++{ ++ struct video_device *vd = container_of(link->sink->entity, ++ struct video_device, entity); ++ struct unicam_node *node = container_of(vd, struct unicam_node, ++ video_dev); ++ struct unicam_device *unicam = node->dev; ++ struct v4l2_subdev_format source_fmt; + int ret; +- v4l2_std_id current_std; + +- ret = v4l2_subdev_call(dev->sensor, video, g_std, ¤t_std); +- if (ret) +- return ret; ++ if (!media_entity_remote_pad(link->sink->entity->pads)) { ++ unicam_dbg(1, unicam, ++ "video node %s pad not connected\n", vd->name); ++ return -ENOTCONN; ++ } + +- if (std == current_std) ++ ret = unicam_mc_subdev_link_validate_get_format(link->source, ++ &source_fmt); ++ if (ret < 0) + return 0; + +- if (vb2_is_busy(&node->buffer_queue)) +- return -EBUSY; ++ if (node->pad_id == IMAGE_PAD) { ++ struct v4l2_pix_format *pix_fmt = &node->v_fmt.fmt.pix; ++ const struct unicam_fmt *fmt; + +- ret = v4l2_subdev_call(dev->sensor, video, s_std, std); ++ if (source_fmt.format.width != pix_fmt->width || ++ source_fmt.format.height != pix_fmt->height) { ++ unicam_err(unicam, ++ "Wrong width or height %ux%u (remote pad set to %ux%u)\n", ++ pix_fmt->width, pix_fmt->height, ++ source_fmt.format.width, ++ source_fmt.format.height); ++ return -EINVAL; ++ } ++ ++ fmt = find_format_by_code(source_fmt.format.code); ++ ++ if (!fmt || (fmt->fourcc != pix_fmt->pixelformat && ++ fmt->repacked_fourcc != pix_fmt->pixelformat)) ++ return -EINVAL; ++ } else { ++ struct v4l2_meta_format *meta_fmt = &node->v_fmt.fmt.meta; ++ ++ if (source_fmt.format.width != meta_fmt->buffersize || ++ source_fmt.format.height != 1 || ++ source_fmt.format.code != MEDIA_BUS_FMT_SENSOR_DATA) { ++ unicam_err(unicam, ++ "Wrong metadata width/height/code %ux%u %08x (remote pad set to %ux%u %08x)\n", ++ meta_fmt->buffersize, 1, ++ MEDIA_BUS_FMT_SENSOR_DATA, ++ source_fmt.format.width, ++ source_fmt.format.height, ++ source_fmt.format.code); ++ return -EINVAL; ++ } ++ } ++ ++ return 0; ++} ++ ++static const struct media_entity_operations unicam_mc_entity_ops = { ++ .link_validate = unicam_mc_video_link_validate, ++}; ++ ++/* videobuf2 Operations */ ++ ++static int unicam_queue_setup(struct vb2_queue *vq, ++ unsigned int *nbuffers, ++ unsigned int *nplanes, ++ unsigned int sizes[], ++ struct device *alloc_devs[]) ++{ ++ struct unicam_node *node = vb2_get_drv_priv(vq); ++ struct unicam_device *dev = node->dev; ++ unsigned int size = node->pad_id == IMAGE_PAD ? ++ node->v_fmt.fmt.pix.sizeimage : ++ node->v_fmt.fmt.meta.buffersize; ++ ++ if (vq->num_buffers + *nbuffers < 3) ++ *nbuffers = 3 - vq->num_buffers; ++ ++ if (*nplanes) { ++ if (sizes[0] < size) { ++ unicam_err(dev, "sizes[0] %i < size %u\n", sizes[0], ++ size); ++ return -EINVAL; ++ } ++ size = sizes[0]; ++ } ++ ++ *nplanes = 1; ++ sizes[0] = size; ++ ++ return 0; ++} ++ ++static int unicam_buffer_prepare(struct vb2_buffer *vb) ++{ ++ struct unicam_node *node = vb2_get_drv_priv(vb->vb2_queue); ++ struct unicam_device *dev = node->dev; ++ struct unicam_buffer *buf = to_unicam_buffer(vb); ++ unsigned long size; ++ ++ if (WARN_ON(!node->fmt)) ++ return -EINVAL; ++ ++ size = node->pad_id == IMAGE_PAD ? node->v_fmt.fmt.pix.sizeimage : ++ node->v_fmt.fmt.meta.buffersize; ++ if (vb2_plane_size(vb, 0) < size) { ++ unicam_err(dev, "data will not fit into plane (%lu < %lu)\n", ++ vb2_plane_size(vb, 0), size); ++ return -EINVAL; ++ } ++ ++ vb2_set_plane_payload(&buf->vb.vb2_buf, 0, size); ++ return 0; ++} ++ ++static void unicam_buffer_queue(struct vb2_buffer *vb) ++{ ++ struct unicam_node *node = vb2_get_drv_priv(vb->vb2_queue); ++ struct unicam_buffer *buf = to_unicam_buffer(vb); ++ unsigned long flags; ++ ++ spin_lock_irqsave(&node->dma_queue_lock, flags); ++ list_add_tail(&buf->list, &node->dma_queue); ++ spin_unlock_irqrestore(&node->dma_queue_lock, flags); ++} ++ ++static void unicam_set_packing_config(struct unicam_device *dev) ++{ ++ u32 pack, unpack; ++ u32 val; ++ ++ if (dev->node[IMAGE_PAD].v_fmt.fmt.pix.pixelformat == ++ dev->node[IMAGE_PAD].fmt->fourcc) { ++ unpack = UNICAM_PUM_NONE; ++ pack = UNICAM_PPM_NONE; ++ } else { ++ switch (dev->node[IMAGE_PAD].fmt->depth) { ++ case 8: ++ unpack = UNICAM_PUM_UNPACK8; ++ break; ++ case 10: ++ unpack = UNICAM_PUM_UNPACK10; ++ break; ++ case 12: ++ unpack = UNICAM_PUM_UNPACK12; ++ break; ++ case 14: ++ unpack = UNICAM_PUM_UNPACK14; ++ break; ++ case 16: ++ unpack = UNICAM_PUM_UNPACK16; ++ break; ++ default: ++ unpack = UNICAM_PUM_NONE; ++ break; ++ } ++ ++ /* Repacking is always to 16bpp */ ++ pack = UNICAM_PPM_PACK16; ++ } ++ ++ val = 0; ++ set_field(&val, unpack, UNICAM_PUM_MASK); ++ set_field(&val, pack, UNICAM_PPM_MASK); ++ reg_write(dev, UNICAM_IPIPE, val); ++} ++ ++static void unicam_cfg_image_id(struct unicam_device *dev) ++{ ++ if (dev->bus_type == V4L2_MBUS_CSI2_DPHY) { ++ /* CSI2 mode, hardcode VC 0 for now. */ ++ reg_write(dev, UNICAM_IDI0, ++ (0 << 6) | dev->node[IMAGE_PAD].fmt->csi_dt); ++ } else { ++ /* CCP2 mode */ ++ reg_write(dev, UNICAM_IDI0, ++ 0x80 | dev->node[IMAGE_PAD].fmt->csi_dt); ++ } ++} ++ ++static void unicam_enable_ed(struct unicam_device *dev) ++{ ++ u32 val = reg_read(dev, UNICAM_DCS); ++ ++ set_field(&val, 2, UNICAM_EDL_MASK); ++ /* Do not wrap at the end of the embedded data buffer */ ++ set_field(&val, 0, UNICAM_DBOB); ++ ++ reg_write(dev, UNICAM_DCS, val); ++} ++ ++static void unicam_start_rx(struct unicam_device *dev, dma_addr_t *addr) ++{ ++ int line_int_freq = dev->node[IMAGE_PAD].v_fmt.fmt.pix.height >> 2; ++ unsigned int size, i; ++ u32 val; ++ ++ if (line_int_freq < 128) ++ line_int_freq = 128; ++ ++ /* Enable lane clocks */ ++ val = 1; ++ for (i = 0; i < dev->active_data_lanes; i++) ++ val = val << 2 | 1; ++ clk_write(dev, val); ++ ++ /* Basic init */ ++ reg_write(dev, UNICAM_CTRL, UNICAM_MEM); ++ ++ /* Enable analogue control, and leave in reset. */ ++ val = UNICAM_AR; ++ set_field(&val, 7, UNICAM_CTATADJ_MASK); ++ set_field(&val, 7, UNICAM_PTATADJ_MASK); ++ reg_write(dev, UNICAM_ANA, val); ++ usleep_range(1000, 2000); ++ ++ /* Come out of reset */ ++ reg_write_field(dev, UNICAM_ANA, 0, UNICAM_AR); ++ ++ /* Peripheral reset */ ++ reg_write_field(dev, UNICAM_CTRL, 1, UNICAM_CPR); ++ reg_write_field(dev, UNICAM_CTRL, 0, UNICAM_CPR); ++ ++ reg_write_field(dev, UNICAM_CTRL, 0, UNICAM_CPE); ++ ++ /* Enable Rx control. */ ++ val = reg_read(dev, UNICAM_CTRL); ++ if (dev->bus_type == V4L2_MBUS_CSI2_DPHY) { ++ set_field(&val, UNICAM_CPM_CSI2, UNICAM_CPM_MASK); ++ set_field(&val, UNICAM_DCM_STROBE, UNICAM_DCM_MASK); ++ } else { ++ set_field(&val, UNICAM_CPM_CCP2, UNICAM_CPM_MASK); ++ set_field(&val, dev->bus_flags, UNICAM_DCM_MASK); ++ } ++ /* Packet framer timeout */ ++ set_field(&val, 0xf, UNICAM_PFT_MASK); ++ set_field(&val, 128, UNICAM_OET_MASK); ++ reg_write(dev, UNICAM_CTRL, val); ++ ++ reg_write(dev, UNICAM_IHWIN, 0); ++ reg_write(dev, UNICAM_IVWIN, 0); ++ ++ /* AXI bus access QoS setup */ ++ val = reg_read(dev, UNICAM_PRI); ++ set_field(&val, 0, UNICAM_BL_MASK); ++ set_field(&val, 0, UNICAM_BS_MASK); ++ set_field(&val, 0xe, UNICAM_PP_MASK); ++ set_field(&val, 8, UNICAM_NP_MASK); ++ set_field(&val, 2, UNICAM_PT_MASK); ++ set_field(&val, 1, UNICAM_PE); ++ reg_write(dev, UNICAM_PRI, val); ++ ++ reg_write_field(dev, UNICAM_ANA, 0, UNICAM_DDL); ++ ++ /* Always start in trigger frame capture mode (UNICAM_FCM set) */ ++ val = UNICAM_FSIE | UNICAM_FEIE | UNICAM_FCM | UNICAM_IBOB; ++ set_field(&val, line_int_freq, UNICAM_LCIE_MASK); ++ reg_write(dev, UNICAM_ICTL, val); ++ reg_write(dev, UNICAM_STA, UNICAM_STA_MASK_ALL); ++ reg_write(dev, UNICAM_ISTA, UNICAM_ISTA_MASK_ALL); ++ ++ /* tclk_term_en */ ++ reg_write_field(dev, UNICAM_CLT, 2, UNICAM_CLT1_MASK); ++ /* tclk_settle */ ++ reg_write_field(dev, UNICAM_CLT, 6, UNICAM_CLT2_MASK); ++ /* td_term_en */ ++ reg_write_field(dev, UNICAM_DLT, 2, UNICAM_DLT1_MASK); ++ /* ths_settle */ ++ reg_write_field(dev, UNICAM_DLT, 6, UNICAM_DLT2_MASK); ++ /* trx_enable */ ++ reg_write_field(dev, UNICAM_DLT, 0, UNICAM_DLT3_MASK); ++ ++ reg_write_field(dev, UNICAM_CTRL, 0, UNICAM_SOE); ++ ++ /* Packet compare setup - required to avoid missing frame ends */ ++ val = 0; ++ set_field(&val, 1, UNICAM_PCE); ++ set_field(&val, 1, UNICAM_GI); ++ set_field(&val, 1, UNICAM_CPH); ++ set_field(&val, 0, UNICAM_PCVC_MASK); ++ set_field(&val, 1, UNICAM_PCDT_MASK); ++ reg_write(dev, UNICAM_CMP0, val); ++ ++ /* Enable clock lane and set up terminations */ ++ val = 0; ++ if (dev->bus_type == V4L2_MBUS_CSI2_DPHY) { ++ /* CSI2 */ ++ set_field(&val, 1, UNICAM_CLE); ++ set_field(&val, 1, UNICAM_CLLPE); ++ if (dev->bus_flags & V4L2_MBUS_CSI2_CONTINUOUS_CLOCK) { ++ set_field(&val, 1, UNICAM_CLTRE); ++ set_field(&val, 1, UNICAM_CLHSE); ++ } ++ } else { ++ /* CCP2 */ ++ set_field(&val, 1, UNICAM_CLE); ++ set_field(&val, 1, UNICAM_CLHSE); ++ set_field(&val, 1, UNICAM_CLTRE); ++ } ++ reg_write(dev, UNICAM_CLK, val); ++ ++ /* ++ * Enable required data lanes with appropriate terminations. ++ * The same value needs to be written to UNICAM_DATn registers for ++ * the active lanes, and 0 for inactive ones. ++ */ ++ val = 0; ++ if (dev->bus_type == V4L2_MBUS_CSI2_DPHY) { ++ /* CSI2 */ ++ set_field(&val, 1, UNICAM_DLE); ++ set_field(&val, 1, UNICAM_DLLPE); ++ if (dev->bus_flags & V4L2_MBUS_CSI2_CONTINUOUS_CLOCK) { ++ set_field(&val, 1, UNICAM_DLTRE); ++ set_field(&val, 1, UNICAM_DLHSE); ++ } ++ } else { ++ /* CCP2 */ ++ set_field(&val, 1, UNICAM_DLE); ++ set_field(&val, 1, UNICAM_DLHSE); ++ set_field(&val, 1, UNICAM_DLTRE); ++ } ++ reg_write(dev, UNICAM_DAT0, val); ++ ++ if (dev->active_data_lanes == 1) ++ val = 0; ++ reg_write(dev, UNICAM_DAT1, val); ++ ++ if (dev->max_data_lanes > 2) { ++ /* ++ * Registers UNICAM_DAT2 and UNICAM_DAT3 only valid if the ++ * instance supports more than 2 data lanes. ++ */ ++ if (dev->active_data_lanes == 2) ++ val = 0; ++ reg_write(dev, UNICAM_DAT2, val); ++ ++ if (dev->active_data_lanes == 3) ++ val = 0; ++ reg_write(dev, UNICAM_DAT3, val); ++ } ++ ++ reg_write(dev, UNICAM_IBLS, ++ dev->node[IMAGE_PAD].v_fmt.fmt.pix.bytesperline); ++ size = dev->node[IMAGE_PAD].v_fmt.fmt.pix.sizeimage; ++ unicam_wr_dma_addr(dev, addr[IMAGE_PAD], size, IMAGE_PAD); ++ unicam_set_packing_config(dev); ++ unicam_cfg_image_id(dev); ++ ++ val = reg_read(dev, UNICAM_MISC); ++ set_field(&val, 1, UNICAM_FL0); ++ set_field(&val, 1, UNICAM_FL1); ++ reg_write(dev, UNICAM_MISC, val); + +- /* Force recomputation of bytesperline */ +- node->v_fmt.fmt.pix.bytesperline = 0; ++ if (dev->node[METADATA_PAD].streaming && dev->sensor_embedded_data) { ++ size = dev->node[METADATA_PAD].v_fmt.fmt.meta.buffersize; ++ unicam_enable_ed(dev); ++ unicam_wr_dma_addr(dev, addr[METADATA_PAD], size, METADATA_PAD); ++ } + +- unicam_reset_format(node); ++ /* Enable peripheral */ ++ reg_write_field(dev, UNICAM_CTRL, 1, UNICAM_CPE); + +- return ret; +-} ++ /* Load image pointers */ ++ reg_write_field(dev, UNICAM_ICTL, 1, UNICAM_LIP_MASK); + +-static int unicam_s_edid(struct file *file, void *priv, struct v4l2_edid *edid) +-{ +- struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; ++ /* Load embedded data buffer pointers if needed */ ++ if (dev->node[METADATA_PAD].streaming && dev->sensor_embedded_data) ++ reg_write_field(dev, UNICAM_DCS, 1, UNICAM_LDP); + +- return v4l2_subdev_call(dev->sensor, pad, set_edid, edid); ++ /* ++ * Enable trigger only for the first frame to ++ * sync correctly to the FS from the source. ++ */ ++ reg_write_field(dev, UNICAM_ICTL, 1, UNICAM_TFC); + } + +-static int unicam_g_edid(struct file *file, void *priv, struct v4l2_edid *edid) ++static void unicam_disable(struct unicam_device *dev) + { +- struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; +- +- return v4l2_subdev_call(dev->sensor, pad, get_edid, edid); +-} ++ /* Analogue lane control disable */ ++ reg_write_field(dev, UNICAM_ANA, 1, UNICAM_DDL); + +-static int unicam_s_selection(struct file *file, void *priv, +- struct v4l2_selection *sel) +-{ +- struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; +- struct v4l2_subdev_selection sdsel = { +- .which = V4L2_SUBDEV_FORMAT_ACTIVE, +- .target = sel->target, +- .flags = sel->flags, +- .r = sel->r, +- }; ++ /* Stop the output engine */ ++ reg_write_field(dev, UNICAM_CTRL, 1, UNICAM_SOE); + +- if (sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) +- return -EINVAL; ++ /* Disable the data lanes. */ ++ reg_write(dev, UNICAM_DAT0, 0); ++ reg_write(dev, UNICAM_DAT1, 0); + +- return v4l2_subdev_call(dev->sensor, pad, set_selection, NULL, &sdsel); +-} ++ if (dev->max_data_lanes > 2) { ++ reg_write(dev, UNICAM_DAT2, 0); ++ reg_write(dev, UNICAM_DAT3, 0); ++ } + +-static int unicam_g_selection(struct file *file, void *priv, +- struct v4l2_selection *sel) +-{ +- struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; +- struct v4l2_subdev_selection sdsel = { +- .which = V4L2_SUBDEV_FORMAT_ACTIVE, +- .target = sel->target, +- }; +- int ret; ++ /* Peripheral reset */ ++ reg_write_field(dev, UNICAM_CTRL, 1, UNICAM_CPR); ++ usleep_range(50, 100); ++ reg_write_field(dev, UNICAM_CTRL, 0, UNICAM_CPR); + +- if (sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) +- return -EINVAL; ++ /* Disable peripheral */ ++ reg_write_field(dev, UNICAM_CTRL, 0, UNICAM_CPE); + +- ret = v4l2_subdev_call(dev->sensor, pad, get_selection, NULL, &sdsel); +- if (!ret) +- sel->r = sdsel.r; ++ /* Clear ED setup */ ++ reg_write(dev, UNICAM_DCS, 0); + +- return ret; ++ /* Disable all lane clocks */ ++ clk_write(dev, 0); + } + +-static int unicam_enum_framesizes(struct file *file, void *priv, +- struct v4l2_frmsizeenum *fsize) ++static void unicam_return_buffers(struct unicam_node *node, ++ enum vb2_buffer_state state) + { +- struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; +- const struct unicam_fmt *fmt; +- struct v4l2_subdev_frame_size_enum fse; +- int ret; ++ struct unicam_buffer *buf, *tmp; ++ unsigned long flags; + +- /* check for valid format */ +- fmt = find_format_by_pix(dev, fsize->pixel_format); +- if (!fmt) { +- unicam_dbg(3, dev, "Invalid pixel code: %x\n", +- fsize->pixel_format); +- return -EINVAL; ++ spin_lock_irqsave(&node->dma_queue_lock, flags); ++ list_for_each_entry_safe(buf, tmp, &node->dma_queue, list) { ++ list_del(&buf->list); ++ vb2_buffer_done(&buf->vb.vb2_buf, state); + } +- fse.code = fmt->code; +- +- fse.which = V4L2_SUBDEV_FORMAT_ACTIVE; +- fse.index = fsize->index; +- fse.pad = node->src_pad_id; +- +- ret = v4l2_subdev_call(dev->sensor, pad, enum_frame_size, NULL, &fse); +- if (ret) +- return ret; +- +- unicam_dbg(1, dev, "%s: index: %d code: %x W:[%d,%d] H:[%d,%d]\n", +- __func__, fse.index, fse.code, fse.min_width, fse.max_width, +- fse.min_height, fse.max_height); + +- fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; +- fsize->discrete.width = fse.max_width; +- fsize->discrete.height = fse.max_height; ++ if (node->cur_frm) ++ vb2_buffer_done(&node->cur_frm->vb.vb2_buf, ++ state); ++ if (node->next_frm && node->cur_frm != node->next_frm) ++ vb2_buffer_done(&node->next_frm->vb.vb2_buf, ++ state); + +- return 0; ++ node->cur_frm = NULL; ++ node->next_frm = NULL; ++ spin_unlock_irqrestore(&node->dma_queue_lock, flags); + } + +-static int unicam_enum_frameintervals(struct file *file, void *priv, +- struct v4l2_frmivalenum *fival) ++static int unicam_start_streaming(struct vb2_queue *vq, unsigned int count) + { +- struct unicam_node *node = video_drvdata(file); ++ struct unicam_node *node = vb2_get_drv_priv(vq); + struct unicam_device *dev = node->dev; +- const struct unicam_fmt *fmt; +- struct v4l2_subdev_frame_interval_enum fie = { +- .index = fival->index, +- .pad = node->src_pad_id, +- .width = fival->width, +- .height = fival->height, +- .which = V4L2_SUBDEV_FORMAT_ACTIVE, +- }; ++ dma_addr_t buffer_addr[MAX_NODES] = { 0 }; ++ unsigned long flags; ++ unsigned int i; + int ret; + +- fmt = find_format_by_pix(dev, fival->pixel_format); +- if (!fmt) +- return -EINVAL; +- +- fie.code = fmt->code; +- ret = v4l2_subdev_call(dev->sensor, pad, enum_frame_interval, +- NULL, &fie); +- if (ret) +- return ret; +- +- fival->type = V4L2_FRMIVAL_TYPE_DISCRETE; +- fival->discrete = fie.interval; +- +- return 0; +-} ++ node->streaming = true; ++ if (!(dev->node[IMAGE_PAD].open && dev->node[IMAGE_PAD].streaming && ++ (!dev->node[METADATA_PAD].open || ++ dev->node[METADATA_PAD].streaming))) { ++ /* ++ * Metadata pad must be enabled before image pad if it is ++ * wanted. ++ */ ++ unicam_dbg(3, dev, "Not all nodes are streaming yet."); ++ return 0; ++ } + +-static int unicam_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a) +-{ +- struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; ++ dev->sequence = 0; ++ ret = unicam_runtime_get(dev); ++ if (ret < 0) { ++ unicam_dbg(3, dev, "unicam_runtime_get failed\n"); ++ goto err_streaming; ++ } + +- return v4l2_g_parm_cap(video_devdata(file), dev->sensor, a); +-} ++ ret = media_pipeline_start(&node->video_dev.entity, &node->pipe); ++ if (ret < 0) { ++ unicam_err(dev, "Failed to start media pipeline: %d\n", ret); ++ goto err_pm_put; ++ } + +-static int unicam_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a) +-{ +- struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; ++ dev->active_data_lanes = dev->max_data_lanes; + +- return v4l2_s_parm_cap(video_devdata(file), dev->sensor, a); +-} ++ if (dev->bus_type == V4L2_MBUS_CSI2_DPHY) { ++ struct v4l2_mbus_config mbus_config = { 0 }; + +-static int unicam_g_dv_timings(struct file *file, void *priv, +- struct v4l2_dv_timings *timings) +-{ +- struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; ++ ret = v4l2_subdev_call(dev->sensor, pad, get_mbus_config, ++ 0, &mbus_config); ++ if (ret < 0 && ret != -ENOIOCTLCMD) { ++ unicam_dbg(3, dev, "g_mbus_config failed\n"); ++ goto error_pipeline; ++ } + +- return v4l2_subdev_call(dev->sensor, video, g_dv_timings, timings); +-} ++ dev->active_data_lanes = ++ (mbus_config.flags & V4L2_MBUS_CSI2_LANE_MASK) >> ++ __ffs(V4L2_MBUS_CSI2_LANE_MASK); ++ if (!dev->active_data_lanes) ++ dev->active_data_lanes = dev->max_data_lanes; ++ if (dev->active_data_lanes > dev->max_data_lanes) { ++ unicam_err(dev, "Device has requested %u data lanes, which is >%u configured in DT\n", ++ dev->active_data_lanes, ++ dev->max_data_lanes); ++ ret = -EINVAL; ++ goto error_pipeline; ++ } ++ } + +-static int unicam_s_dv_timings(struct file *file, void *priv, +- struct v4l2_dv_timings *timings) +-{ +- struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; +- struct v4l2_dv_timings current_timings; +- int ret; ++ unicam_dbg(1, dev, "Running with %u data lanes\n", ++ dev->active_data_lanes); + +- ret = v4l2_subdev_call(dev->sensor, video, g_dv_timings, +- ¤t_timings); ++ dev->vpu_req = clk_request_start(dev->vpu_clock, MIN_VPU_CLOCK_RATE); ++ if (!dev->vpu_req) { ++ unicam_err(dev, "failed to set up VPU clock\n"); ++ goto error_pipeline; ++ } + +- if (ret < 0) +- return ret; ++ ret = clk_prepare_enable(dev->vpu_clock); ++ if (ret) { ++ unicam_err(dev, "Failed to enable VPU clock: %d\n", ret); ++ goto error_pipeline; ++ } + +- if (v4l2_match_dv_timings(timings, ¤t_timings, 0, false)) +- return 0; ++ ret = clk_set_rate(dev->clock, 100 * 1000 * 1000); ++ if (ret) { ++ unicam_err(dev, "failed to set up CSI clock\n"); ++ goto err_vpu_clock; ++ } + +- if (vb2_is_busy(&node->buffer_queue)) +- return -EBUSY; ++ ret = clk_prepare_enable(dev->clock); ++ if (ret) { ++ unicam_err(dev, "Failed to enable CSI clock: %d\n", ret); ++ goto err_vpu_clock; ++ } + +- ret = v4l2_subdev_call(dev->sensor, video, s_dv_timings, timings); ++ for (i = 0; i < ARRAY_SIZE(dev->node); i++) { ++ struct unicam_buffer *buf; + +- /* Force recomputation of bytesperline */ +- node->v_fmt.fmt.pix.bytesperline = 0; ++ if (!dev->node[i].streaming) ++ continue; + +- unicam_reset_format(node); ++ spin_lock_irqsave(&dev->node[i].dma_queue_lock, flags); ++ buf = list_first_entry(&dev->node[i].dma_queue, ++ struct unicam_buffer, list); ++ dev->node[i].cur_frm = buf; ++ dev->node[i].next_frm = buf; ++ list_del(&buf->list); ++ spin_unlock_irqrestore(&dev->node[i].dma_queue_lock, flags); + +- return ret; +-} ++ buffer_addr[i] = ++ vb2_dma_contig_plane_dma_addr(&buf->vb.vb2_buf, 0); ++ } + +-static int unicam_query_dv_timings(struct file *file, void *priv, +- struct v4l2_dv_timings *timings) +-{ +- struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; ++ unicam_start_rx(dev, buffer_addr); + +- return v4l2_subdev_call(dev->sensor, video, query_dv_timings, timings); +-} ++ ret = v4l2_subdev_call(dev->sensor, video, s_stream, 1); ++ if (ret < 0) { ++ unicam_err(dev, "stream on failed in subdev\n"); ++ goto err_disable_unicam; ++ } + +-static int unicam_enum_dv_timings(struct file *file, void *priv, +- struct v4l2_enum_dv_timings *timings) +-{ +- struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; +- int ret; ++ dev->clocks_enabled = true; ++ return 0; + +- timings->pad = node->src_pad_id; +- ret = v4l2_subdev_call(dev->sensor, pad, enum_dv_timings, timings); +- timings->pad = node->pad_id; ++err_disable_unicam: ++ unicam_disable(dev); ++ clk_disable_unprepare(dev->clock); ++err_vpu_clock: ++ clk_request_done(dev->vpu_req); ++ clk_disable_unprepare(dev->vpu_clock); ++error_pipeline: ++ media_pipeline_stop(&node->video_dev.entity); ++err_pm_put: ++ unicam_runtime_put(dev); ++err_streaming: ++ unicam_return_buffers(node, VB2_BUF_STATE_QUEUED); ++ node->streaming = false; + + return ret; + } + +-static int unicam_dv_timings_cap(struct file *file, void *priv, +- struct v4l2_dv_timings_cap *cap) ++static void unicam_stop_streaming(struct vb2_queue *vq) + { +- struct unicam_node *node = video_drvdata(file); ++ struct unicam_node *node = vb2_get_drv_priv(vq); + struct unicam_device *dev = node->dev; +- int ret; + +- cap->pad = node->src_pad_id; +- ret = v4l2_subdev_call(dev->sensor, pad, dv_timings_cap, cap); +- cap->pad = node->pad_id; +- +- return ret; +-} ++ node->streaming = false; + +-static int unicam_subscribe_event(struct v4l2_fh *fh, +- const struct v4l2_event_subscription *sub) +-{ +- switch (sub->type) { +- case V4L2_EVENT_FRAME_SYNC: +- return v4l2_event_subscribe(fh, sub, 2, NULL); +- case V4L2_EVENT_SOURCE_CHANGE: +- return v4l2_event_subscribe(fh, sub, 4, NULL); +- } ++ if (node->pad_id == IMAGE_PAD) { ++ /* ++ * Stop streaming the sensor and disable the peripheral. ++ * We cannot continue streaming embedded data with the ++ * image pad disabled. ++ */ ++ if (v4l2_subdev_call(dev->sensor, video, s_stream, 0) < 0) ++ unicam_err(dev, "stream off failed in subdev\n"); + +- return v4l2_ctrl_subscribe_event(fh, sub); +-} ++ unicam_disable(dev); + +-static int unicam_log_status(struct file *file, void *fh) +-{ +- struct unicam_node *node = video_drvdata(file); +- struct unicam_device *dev = node->dev; +- u32 reg; ++ media_pipeline_stop(&node->video_dev.entity); + +- /* status for sub devices */ +- v4l2_device_call_all(&dev->v4l2_dev, 0, core, log_status); ++ if (dev->clocks_enabled) { ++ clk_request_done(dev->vpu_req); ++ clk_disable_unprepare(dev->vpu_clock); ++ clk_disable_unprepare(dev->clock); ++ dev->clocks_enabled = false; ++ } ++ unicam_runtime_put(dev); + +- unicam_info(dev, "-----Receiver status-----\n"); +- unicam_info(dev, "V4L2 width/height: %ux%u\n", +- node->v_fmt.fmt.pix.width, node->v_fmt.fmt.pix.height); +- unicam_info(dev, "Mediabus format: %08x\n", node->fmt->code); +- unicam_info(dev, "V4L2 format: %08x\n", +- node->v_fmt.fmt.pix.pixelformat); +- reg = reg_read(dev, UNICAM_IPIPE); +- unicam_info(dev, "Unpacking/packing: %u / %u\n", +- get_field(reg, UNICAM_PUM_MASK), +- get_field(reg, UNICAM_PPM_MASK)); +- unicam_info(dev, "----Live data----\n"); +- unicam_info(dev, "Programmed stride: %4u\n", +- reg_read(dev, UNICAM_IBLS)); +- unicam_info(dev, "Detected resolution: %ux%u\n", +- reg_read(dev, UNICAM_IHSTA), +- reg_read(dev, UNICAM_IVSTA)); +- unicam_info(dev, "Write pointer: %08x\n", +- reg_read(dev, UNICAM_IBWP)); ++ } else if (node->pad_id == METADATA_PAD) { ++ /* ++ * Allow the hardware to spin in the dummy buffer. ++ * This is only really needed if the embedded data pad is ++ * disabled before the image pad. ++ */ ++ unicam_wr_dma_addr(dev, node->dummy_buf_dma_addr, ++ DUMMY_BUF_SIZE, METADATA_PAD); ++ } + +- return 0; ++ /* Clear all queued buffers for the node */ ++ unicam_return_buffers(node, VB2_BUF_STATE_ERROR); + } + +-static void unicam_notify(struct v4l2_subdev *sd, +- unsigned int notification, void *arg) +-{ +- struct unicam_device *dev = to_unicam_device(sd->v4l2_dev); +- +- switch (notification) { +- case V4L2_DEVICE_NOTIFY_EVENT: +- v4l2_event_queue(&dev->node[IMAGE_PAD].video_dev, arg); +- break; +- default: +- break; +- } +-} + + static const struct vb2_ops unicam_video_qops = { + .wait_prepare = vb2_ops_wait_prepare, +@@ -2258,60 +2729,6 @@ static const struct v4l2_file_operations unicam_fops = { + .mmap = vb2_fop_mmap, + }; + +-/* unicam capture ioctl operations */ +-static const struct v4l2_ioctl_ops unicam_ioctl_ops = { +- .vidioc_querycap = unicam_querycap, +- .vidioc_enum_fmt_vid_cap = unicam_enum_fmt_vid_cap, +- .vidioc_g_fmt_vid_cap = unicam_g_fmt_vid_cap, +- .vidioc_s_fmt_vid_cap = unicam_s_fmt_vid_cap, +- .vidioc_try_fmt_vid_cap = unicam_try_fmt_vid_cap, +- +- .vidioc_enum_fmt_meta_cap = unicam_enum_fmt_meta_cap, +- .vidioc_g_fmt_meta_cap = unicam_g_fmt_meta_cap, +- .vidioc_s_fmt_meta_cap = unicam_g_fmt_meta_cap, +- .vidioc_try_fmt_meta_cap = unicam_g_fmt_meta_cap, +- +- .vidioc_enum_input = unicam_enum_input, +- .vidioc_g_input = unicam_g_input, +- .vidioc_s_input = unicam_s_input, +- +- .vidioc_querystd = unicam_querystd, +- .vidioc_s_std = unicam_s_std, +- .vidioc_g_std = unicam_g_std, +- +- .vidioc_g_edid = unicam_g_edid, +- .vidioc_s_edid = unicam_s_edid, +- +- .vidioc_enum_framesizes = unicam_enum_framesizes, +- .vidioc_enum_frameintervals = unicam_enum_frameintervals, +- +- .vidioc_g_selection = unicam_g_selection, +- .vidioc_s_selection = unicam_s_selection, +- +- .vidioc_g_parm = unicam_g_parm, +- .vidioc_s_parm = unicam_s_parm, +- +- .vidioc_s_dv_timings = unicam_s_dv_timings, +- .vidioc_g_dv_timings = unicam_g_dv_timings, +- .vidioc_query_dv_timings = unicam_query_dv_timings, +- .vidioc_enum_dv_timings = unicam_enum_dv_timings, +- .vidioc_dv_timings_cap = unicam_dv_timings_cap, +- +- .vidioc_reqbufs = vb2_ioctl_reqbufs, +- .vidioc_create_bufs = vb2_ioctl_create_bufs, +- .vidioc_prepare_buf = vb2_ioctl_prepare_buf, +- .vidioc_querybuf = vb2_ioctl_querybuf, +- .vidioc_qbuf = vb2_ioctl_qbuf, +- .vidioc_dqbuf = vb2_ioctl_dqbuf, +- .vidioc_expbuf = vb2_ioctl_expbuf, +- .vidioc_streamon = vb2_ioctl_streamon, +- .vidioc_streamoff = vb2_ioctl_streamoff, +- +- .vidioc_log_status = unicam_log_status, +- .vidioc_subscribe_event = unicam_subscribe_event, +- .vidioc_unsubscribe_event = v4l2_event_unsubscribe, +-}; +- + static int + unicam_async_bound(struct v4l2_async_notifier *notifier, + struct v4l2_subdev *subdev, +@@ -2362,11 +2779,11 @@ static void unicam_node_release(struct video_device *vdev) + unicam_put(node->dev); + } + +-static int register_node(struct unicam_device *unicam, struct unicam_node *node, +- enum v4l2_buf_type type, int pad_id) ++static int unicam_set_default_format(struct unicam_device *unicam, ++ struct unicam_node *node, ++ int pad_id, ++ const struct unicam_fmt **ret_fmt) + { +- struct video_device *vdev; +- struct vb2_queue *q; + struct v4l2_mbus_framefmt mbus_fmt = {0}; + const struct unicam_fmt *fmt; + int ret; +@@ -2411,15 +2828,69 @@ static int register_node(struct unicam_device *unicam, struct unicam_node *node, + node->v_fmt.fmt.meta.dataformat = fmt->fourcc; + } + ++ *ret_fmt = fmt; ++ ++ return 0; ++} ++ ++static void unicam_mc_set_default_format(struct unicam_node *node, int pad_id) ++{ ++ if (pad_id == IMAGE_PAD) { ++ struct v4l2_pix_format *pix_fmt = &node->v_fmt.fmt.pix; ++ ++ pix_fmt->width = 640; ++ pix_fmt->height = 480; ++ pix_fmt->field = V4L2_FIELD_NONE; ++ pix_fmt->colorspace = V4L2_COLORSPACE_SRGB; ++ pix_fmt->ycbcr_enc = V4L2_YCBCR_ENC_601; ++ pix_fmt->quantization = V4L2_QUANTIZATION_LIM_RANGE; ++ pix_fmt->xfer_func = V4L2_XFER_FUNC_SRGB; ++ pix_fmt->pixelformat = formats[0].fourcc; ++ unicam_calc_format_size_bpl(node->dev, &formats[0], ++ &node->v_fmt); ++ node->v_fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ ++ node->fmt = &formats[0]; ++ } else { ++ const struct unicam_fmt *fmt; ++ ++ /* Fix this node format as embedded data. */ ++ fmt = find_format_by_code(MEDIA_BUS_FMT_SENSOR_DATA); ++ node->v_fmt.fmt.meta.dataformat = fmt->fourcc; ++ node->fmt = fmt; ++ ++ node->v_fmt.fmt.meta.buffersize = UNICAM_EMBEDDED_SIZE; ++ node->embedded_lines = 1; ++ node->v_fmt.type = V4L2_BUF_TYPE_META_CAPTURE; ++ } ++} ++ ++static int register_node(struct unicam_device *unicam, struct unicam_node *node, ++ enum v4l2_buf_type type, int pad_id) ++{ ++ struct video_device *vdev; ++ struct vb2_queue *q; ++ int ret; ++ + node->dev = unicam; + node->pad_id = pad_id; +- node->fmt = fmt; + +- /* Read current subdev format */ +- if (fmt) +- unicam_reset_format(node); ++ if (!unicam->mc_api) { ++ const struct unicam_fmt *fmt; ++ ++ ret = unicam_set_default_format(unicam, node, pad_id, &fmt); ++ if (ret) ++ return ret; ++ node->fmt = fmt; ++ /* Read current subdev format */ ++ if (fmt) ++ unicam_reset_format(node); ++ } else { ++ unicam_mc_set_default_format(node, pad_id); ++ } + +- if (v4l2_subdev_has_op(unicam->sensor, video, s_std)) { ++ if (!unicam->mc_api && ++ v4l2_subdev_has_op(unicam->sensor, video, s_std)) { + v4l2_std_id tvnorms; + + if (WARN_ON(!v4l2_subdev_has_op(unicam->sensor, video, +@@ -2442,12 +2913,15 @@ static int register_node(struct unicam_device *unicam, struct unicam_node *node, + + vdev = &node->video_dev; + if (pad_id == IMAGE_PAD) { +- /* Add controls from the subdevice */ +- ret = v4l2_ctrl_add_handler(&unicam->ctrl_handler, +- unicam->sensor->ctrl_handler, NULL, +- true); +- if (ret < 0) +- return ret; ++ if (!unicam->mc_api) { ++ /* Add controls from the subdevice */ ++ ret = v4l2_ctrl_add_handler(&unicam->ctrl_handler, ++ unicam->sensor->ctrl_handler, ++ NULL, ++ true); ++ if (ret < 0) ++ return ret; ++ } + + /* + * If the sensor subdevice has any controls, associate the node +@@ -2479,7 +2953,8 @@ static int register_node(struct unicam_device *unicam, struct unicam_node *node, + + vdev->release = unicam_node_release; + vdev->fops = &unicam_fops; +- vdev->ioctl_ops = &unicam_ioctl_ops; ++ vdev->ioctl_ops = unicam->mc_api ? &unicam_mc_ioctl_ops : ++ &unicam_ioctl_ops; + vdev->v4l2_dev = &unicam->v4l2_dev; + vdev->vfl_dir = VFL_DIR_RX; + vdev->queue = q; +@@ -2487,6 +2962,10 @@ static int register_node(struct unicam_device *unicam, struct unicam_node *node, + vdev->device_caps = (pad_id == IMAGE_PAD) ? + V4L2_CAP_VIDEO_CAPTURE : V4L2_CAP_META_CAPTURE; + vdev->device_caps |= V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; ++ if (unicam->mc_api) { ++ vdev->device_caps |= V4L2_CAP_IO_MC; ++ vdev->entity.ops = &unicam_mc_entity_ops; ++ } + + /* Define the device names */ + snprintf(vdev->name, sizeof(vdev->name), "%s-%s", UNICAM_MODULE_NAME, +@@ -2506,48 +2985,61 @@ static int register_node(struct unicam_device *unicam, struct unicam_node *node, + unicam_err(unicam, "Unable to allocate dummy buffer.\n"); + return -ENOMEM; + } +- +- if (pad_id == METADATA_PAD || +- !v4l2_subdev_has_op(unicam->sensor, video, s_std)) { +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_S_STD); +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_G_STD); +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_ENUMSTD); +- } +- if (pad_id == METADATA_PAD || +- !v4l2_subdev_has_op(unicam->sensor, video, querystd)) +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_QUERYSTD); +- if (pad_id == METADATA_PAD || +- !v4l2_subdev_has_op(unicam->sensor, video, s_dv_timings)) { +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_S_EDID); +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_G_EDID); +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_DV_TIMINGS_CAP); +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_G_DV_TIMINGS); +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_S_DV_TIMINGS); +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_ENUM_DV_TIMINGS); +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_QUERY_DV_TIMINGS); +- } +- if (pad_id == METADATA_PAD || +- !v4l2_subdev_has_op(unicam->sensor, pad, enum_frame_interval)) +- v4l2_disable_ioctl(&node->video_dev, +- VIDIOC_ENUM_FRAMEINTERVALS); +- if (pad_id == METADATA_PAD || +- !v4l2_subdev_has_op(unicam->sensor, video, g_frame_interval)) +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_G_PARM); +- if (pad_id == METADATA_PAD || +- !v4l2_subdev_has_op(unicam->sensor, video, s_frame_interval)) +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_S_PARM); +- +- if (pad_id == METADATA_PAD || +- !v4l2_subdev_has_op(unicam->sensor, pad, enum_frame_size)) +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_ENUM_FRAMESIZES); +- +- if (node->pad_id == METADATA_PAD || +- !v4l2_subdev_has_op(unicam->sensor, pad, set_selection)) +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_S_SELECTION); +- +- if (node->pad_id == METADATA_PAD || +- !v4l2_subdev_has_op(unicam->sensor, pad, get_selection)) +- v4l2_disable_ioctl(&node->video_dev, VIDIOC_G_SELECTION); ++ if (!unicam->mc_api) { ++ if (pad_id == METADATA_PAD || ++ !v4l2_subdev_has_op(unicam->sensor, video, s_std)) { ++ v4l2_disable_ioctl(&node->video_dev, VIDIOC_S_STD); ++ v4l2_disable_ioctl(&node->video_dev, VIDIOC_G_STD); ++ v4l2_disable_ioctl(&node->video_dev, VIDIOC_ENUMSTD); ++ } ++ if (pad_id == METADATA_PAD || ++ !v4l2_subdev_has_op(unicam->sensor, video, querystd)) ++ v4l2_disable_ioctl(&node->video_dev, VIDIOC_QUERYSTD); ++ if (pad_id == METADATA_PAD || ++ !v4l2_subdev_has_op(unicam->sensor, video, s_dv_timings)) { ++ v4l2_disable_ioctl(&node->video_dev, VIDIOC_S_EDID); ++ v4l2_disable_ioctl(&node->video_dev, VIDIOC_G_EDID); ++ v4l2_disable_ioctl(&node->video_dev, ++ VIDIOC_DV_TIMINGS_CAP); ++ v4l2_disable_ioctl(&node->video_dev, ++ VIDIOC_G_DV_TIMINGS); ++ v4l2_disable_ioctl(&node->video_dev, ++ VIDIOC_S_DV_TIMINGS); ++ v4l2_disable_ioctl(&node->video_dev, ++ VIDIOC_ENUM_DV_TIMINGS); ++ v4l2_disable_ioctl(&node->video_dev, ++ VIDIOC_QUERY_DV_TIMINGS); ++ } ++ if (pad_id == METADATA_PAD || ++ !v4l2_subdev_has_op(unicam->sensor, pad, ++ enum_frame_interval)) ++ v4l2_disable_ioctl(&node->video_dev, ++ VIDIOC_ENUM_FRAMEINTERVALS); ++ if (pad_id == METADATA_PAD || ++ !v4l2_subdev_has_op(unicam->sensor, video, ++ g_frame_interval)) ++ v4l2_disable_ioctl(&node->video_dev, VIDIOC_G_PARM); ++ if (pad_id == METADATA_PAD || ++ !v4l2_subdev_has_op(unicam->sensor, video, ++ s_frame_interval)) ++ v4l2_disable_ioctl(&node->video_dev, VIDIOC_S_PARM); ++ ++ if (pad_id == METADATA_PAD || ++ !v4l2_subdev_has_op(unicam->sensor, pad, ++ enum_frame_size)) ++ v4l2_disable_ioctl(&node->video_dev, ++ VIDIOC_ENUM_FRAMESIZES); ++ ++ if (node->pad_id == METADATA_PAD || ++ !v4l2_subdev_has_op(unicam->sensor, pad, set_selection)) ++ v4l2_disable_ioctl(&node->video_dev, ++ VIDIOC_S_SELECTION); ++ ++ if (node->pad_id == METADATA_PAD || ++ !v4l2_subdev_has_op(unicam->sensor, pad, get_selection)) ++ v4l2_disable_ioctl(&node->video_dev, ++ VIDIOC_G_SELECTION); ++ } + + ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1); + if (ret) { +@@ -2614,7 +3106,7 @@ static int unicam_async_complete(struct v4l2_async_notifier *notifier) + if (unicam->sensor->entity.pads[i].flags & MEDIA_PAD_FL_SOURCE) { + if (source_pads < MAX_NODES) { + unicam->node[source_pads].src_pad_id = i; +- unicam_err(unicam, "source pad %u is index %u\n", ++ unicam_dbg(3, unicam, "source pad %u is index %u\n", + source_pads, i); + } + source_pads++; +@@ -2643,7 +3135,10 @@ static int unicam_async_complete(struct v4l2_async_notifier *notifier) + } + } + +- ret = v4l2_device_register_ro_subdev_nodes(&unicam->v4l2_dev); ++ if (unicam->mc_api) ++ ret = v4l2_device_register_subdev_nodes(&unicam->v4l2_dev); ++ else ++ ret = v4l2_device_register_ro_subdev_nodes(&unicam->v4l2_dev); + if (ret) { + unicam_err(unicam, "Unable to register subdev nodes.\n"); + goto unregister; +@@ -2803,6 +3298,14 @@ static int unicam_probe(struct platform_device *pdev) + kref_init(&unicam->kref); + unicam->pdev = pdev; + ++ /* ++ * Adopt the current setting of the module parameter, and check if ++ * device tree requests it. ++ */ ++ unicam->mc_api = media_controller; ++ if (of_property_read_bool(pdev->dev.of_node, "brcm,media-controller")) ++ unicam->mc_api = true; ++ + unicam->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(unicam->base)) { + unicam_err(unicam, "Failed to get main io block\n"); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sakari Ailus +Date: Tue, 5 Jul 2016 11:41:15 +0200 +Subject: [PATCH 888/889] media: v4l: subdev: Improve link format validation + debug messages + +Commit db8e94e7cf27d8bc101ef5b8ee5c1af77cd5b1c9 upstream + +The existing link format validation failure debug message in media-entity.c +helped to pinpoint the point of failure but provided no additional +information what's wrong. Tell the user exactly why the validation failed. + +Signed-off-by: Sakari Ailus +Signed-off-by: Mauro Carvalho Chehab +--- + drivers/media/v4l2-core/v4l2-subdev.c | 48 +++++++++++++++++++++++---- + 1 file changed, 41 insertions(+), 7 deletions(-) + +diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c +index fbf0dcb313c8..bf3aa9252458 100644 +--- a/drivers/media/v4l2-core/v4l2-subdev.c ++++ b/drivers/media/v4l2-core/v4l2-subdev.c +@@ -768,21 +768,55 @@ int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd, + struct v4l2_subdev_format *source_fmt, + struct v4l2_subdev_format *sink_fmt) + { ++ bool pass = true; ++ + /* The width, height and code must match. */ +- if (source_fmt->format.width != sink_fmt->format.width +- || source_fmt->format.height != sink_fmt->format.height +- || source_fmt->format.code != sink_fmt->format.code) +- return -EPIPE; ++ if (source_fmt->format.width != sink_fmt->format.width) { ++ dev_dbg(sd->entity.graph_obj.mdev->dev, ++ "%s: width does not match (source %u, sink %u)\n", ++ __func__, ++ source_fmt->format.width, sink_fmt->format.width); ++ pass = false; ++ } ++ ++ if (source_fmt->format.height != sink_fmt->format.height) { ++ dev_dbg(sd->entity.graph_obj.mdev->dev, ++ "%s: height does not match (source %u, sink %u)\n", ++ __func__, ++ source_fmt->format.height, sink_fmt->format.height); ++ pass = false; ++ } ++ ++ if (source_fmt->format.code != sink_fmt->format.code) { ++ dev_dbg(sd->entity.graph_obj.mdev->dev, ++ "%s: media bus code does not match (source 0x%8.8x, sink 0x%8.8x)\n", ++ __func__, ++ source_fmt->format.code, sink_fmt->format.code); ++ pass = false; ++ } + + /* The field order must match, or the sink field order must be NONE + * to support interlaced hardware connected to bridges that support + * progressive formats only. + */ + if (source_fmt->format.field != sink_fmt->format.field && +- sink_fmt->format.field != V4L2_FIELD_NONE) +- return -EPIPE; ++ sink_fmt->format.field != V4L2_FIELD_NONE) { ++ dev_dbg(sd->entity.graph_obj.mdev->dev, ++ "%s: field does not match (source %u, sink %u)\n", ++ __func__, ++ source_fmt->format.field, sink_fmt->format.field); ++ pass = false; ++ } + +- return 0; ++ if (pass) ++ return 0; ++ ++ dev_dbg(sd->entity.graph_obj.mdev->dev, ++ "%s: link was \"%s\":%u -> \"%s\":%u\n", __func__, ++ link->source->entity->name, link->source->index, ++ link->sink->entity->name, link->sink->index); ++ ++ return -EPIPE; + } + EXPORT_SYMBOL_GPL(v4l2_subdev_link_validate_default); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Fri, 22 Oct 2021 13:11:38 +0100 +Subject: [PATCH 889/889] media: bcm2835-codec: Limit video callbacks + +Limit the number of allowed video callbacks. This helps with limiting +the size of the coded input FIFO which in turn helps to control latency. +Choose -5 as the magic number as it translates to DPB+5 buffers which +has been proven to be a good number in the past. + +Ideally coded buffers would not be returned to the user until they +had been decoded into the DPB or been discarded as bad, but that grade +of control is unavailable to us. + +Signed-off-by: John Cox +--- + .../vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +index 6078d6e2ace0..e8452c82d088 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -2510,6 +2510,14 @@ static int bcm2835_codec_create_component(struct bcm2835_codec_ctx *ctx) + MMAL_PARAMETER_VIDEO_STOP_ON_PAR_COLOUR_CHANGE, + &enable, + sizeof(enable)); ++ ++ enable = (unsigned int)-5; ++ vchiq_mmal_port_parameter_set(dev->instance, ++ &ctx->component->control, ++ MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS, ++ &enable, ++ sizeof(enable)); ++ + } else if (dev->role == DEINTERLACE) { + /* Select the default deinterlace algorithm. */ + int half_framerate = 0; +-- +2.18.4 + diff --git a/SPECS/raspberrypi2.spec b/SPECS/raspberrypi2.spec index e43a228..19043f5 100644 --- a/SPECS/raspberrypi2.spec +++ b/SPECS/raspberrypi2.spec @@ -1,5 +1,5 @@ -%global commit_firmware_long 25e2b597ebfb2495eab4816a276758dcc6ea21f1 -%global commit_linux_long 2dd846fe1a7266153e129b55c01b6ac59119d395 +%global commit_firmware_long d2ab264b688a223e23029ffbba86820c8c6cb329 +%global commit_linux_long f814bfc5f4d3005eb266a1556be8b7b8770629bd ExclusiveArch: aarch64 armv7hl @@ -32,7 +32,7 @@ ExclusiveArch: aarch64 armv7hl %define extra_version 1 %define kversion 5.10 -%define kfullversion %{kversion}.60 +%define kfullversion %{kversion}.74 Name: raspberrypi2 Version: %{kfullversion} @@ -292,6 +292,9 @@ cp $(ls -1 /boot/config-kernel-*-*|sort -V|tail -1) /boot/config-kernel.inc %doc /boot/LICENCE.broadcom %changelog +* Sat Oct 23 2021 Pablo Greco - 5.10.74 +- Update to version v5.10.74 + * Sat Aug 21 2021 Pablo Greco - 5.10.60 - Update to version v5.10.60 - Support booting from initramfs (markvnl)