diff --git a/.raspberrypi2.metadata b/.raspberrypi2.metadata index 90557dc..ce2fb35 100644 --- a/.raspberrypi2.metadata +++ b/.raspberrypi2.metadata @@ -1,3 +1,3 @@ ac61f2459040c09af1d5abd4ed100c3d316b443e SOURCES/linux-5.15.tar.xz -d098546cce110434e14e61840613e613ab83f9f6 SOURCES/f95b607c72f9f6d4ea27140635f1e55078ef6f74.tar.gz -cd643a5ce8d03597ca99ec94883373335d9055df SOURCES/patch-5.15.59.xz +3eb231be42d1b671573d4054c3927b84d18aa793 SOURCES/bfbd42ef2c93eb4c4b688759a9c879423b479448.tar.gz +494c9936b6ae0b5f845fe80e2ac99d14c9e32e66 SOURCES/patch-5.15.74.xz diff --git a/SOURCES/bcm2709_selinux_config.patch b/SOURCES/bcm2709_selinux_config.patch index c23b19b..8ad8bf3 100644 --- a/SOURCES/bcm2709_selinux_config.patch +++ b/SOURCES/bcm2709_selinux_config.patch @@ -4,14 +4,14 @@ Date: Fri, 7 Aug 2020 02:59:05 +0000 Subject: [PATCH 1/2] configs 2709 --- - arch/arm/configs/bcm2709_defconfig | 35 ++++++++++++++++++++++++++++-- - 1 file changed, 33 insertions(+), 2 deletions(-) + arch/arm/configs/bcm2709_defconfig | 40 ++++++++++++++++++++++++++++-- + 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 16698a5..a9c8fac 100644 +index 0267c16..3b92fcf 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -1508,8 +1508,6 @@ CONFIG_NLS_KOI8_R=m +@@ -1520,8 +1520,6 @@ CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_DLM=m CONFIG_SECURITY=y @@ -20,7 +20,7 @@ index 16698a5..a9c8fac 100644 CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CHACHA20POLY1305=m CONFIG_CRYPTO_ADIANTUM=m -@@ -1542,3 +1540,36 @@ CONFIG_IRQSOFF_TRACER=y +@@ -1554,3 +1552,36 @@ CONFIG_IRQSOFF_TRACER=y CONFIG_SCHED_TRACER=y CONFIG_BLK_DEV_IO_TRACE=y # CONFIG_UPROBE_EVENTS is not set diff --git a/SOURCES/bcm2711_selinux_config.patch b/SOURCES/bcm2711_selinux_config.patch index 5f1262e..a74adfc 100644 --- a/SOURCES/bcm2711_selinux_config.patch +++ b/SOURCES/bcm2711_selinux_config.patch @@ -4,15 +4,15 @@ Date: Fri, 7 Aug 2020 02:59:05 +0000 Subject: [PATCH 2/2] configs 2711 --- - arch/arm/configs/bcm2711_defconfig | 35 +++++++++++++++++++++++++-- - arch/arm64/configs/bcm2711_defconfig | 36 ++++++++++++++++++++++++++-- - 2 files changed, 67 insertions(+), 4 deletions(-) + arch/arm/configs/bcm2711_defconfig | 40 +++++++++++++++++++++++++-- + arch/arm64/configs/bcm2711_defconfig | 41 ++++++++++++++++++++++++++-- + 2 files changed, 77 insertions(+), 4 deletions(-) diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig -index e9da4fd..507aadc 100644 +index 2639d29..6ae2229 100644 --- a/arch/arm/configs/bcm2711_defconfig +++ b/arch/arm/configs/bcm2711_defconfig -@@ -1532,8 +1532,6 @@ CONFIG_NLS_KOI8_R=m +@@ -1551,8 +1551,6 @@ CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_DLM=m CONFIG_SECURITY=y @@ -21,7 +21,7 @@ index e9da4fd..507aadc 100644 CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CHACHA20POLY1305=m CONFIG_CRYPTO_ADIANTUM=m -@@ -1566,3 +1564,36 @@ CONFIG_IRQSOFF_TRACER=y +@@ -1585,3 +1583,36 @@ CONFIG_IRQSOFF_TRACER=y CONFIG_SCHED_TRACER=y CONFIG_BLK_DEV_IO_TRACE=y # CONFIG_UPROBE_EVENTS is not set @@ -59,10 +59,10 @@ index e9da4fd..507aadc 100644 +CONFIG_WIREGUARD=m +CONFIG_FW_LOADER_COMPRESS=y diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig -index 410e2f7..107e053 100644 +index 4c06a60..c8c5836 100644 --- a/arch/arm64/configs/bcm2711_defconfig +++ b/arch/arm64/configs/bcm2711_defconfig -@@ -1545,8 +1545,6 @@ CONFIG_NLS_KOI8_R=m +@@ -1568,8 +1568,6 @@ CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_DLM=m CONFIG_SECURITY=y @@ -70,8 +70,8 @@ index 410e2f7..107e053 100644 -CONFIG_LSM="" CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CHACHA20POLY1305=m - CONFIG_CRYPTO_ADIANTUM=m -@@ -1578,3 +1576,37 @@ CONFIG_IRQSOFF_TRACER=y + CONFIG_CRYPTO_CBC=m +@@ -1604,3 +1602,37 @@ CONFIG_IRQSOFF_TRACER=y CONFIG_SCHED_TRACER=y CONFIG_BLK_DEV_IO_TRACE=y # CONFIG_UPROBE_EVENTS is not set diff --git a/SOURCES/rpi-5.15.x.patch b/SOURCES/rpi-5.15.x.patch index 7884e20..b16fc39 100644 --- a/SOURCES/rpi-5.15.x.patch +++ b/SOURCES/rpi-5.15.x.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 19 Aug 2021 15:59:29 +0200 -Subject: [PATCH 0001/1050] drm/vc4: hdmi: Split the CEC disable / enable +Subject: [PATCH 0001/1183] 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 @@ -16,10 +16,10 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-5-maxi 1 file changed, 45 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index ef7bea7c43a0..6b61fb1866ff 100644 +index 9b3e642a08e1..7380fa4cd8dd 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1740,7 +1740,7 @@ static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) +@@ -1748,7 +1748,7 @@ static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) return ret; } @@ -28,7 +28,7 @@ index ef7bea7c43a0..6b61fb1866ff 100644 { struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); /* clock period in microseconds */ -@@ -1753,38 +1753,53 @@ static int vc4_hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable) +@@ -1761,38 +1761,53 @@ static int vc4_hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable) val |= ((4700 / usecs) << VC4_HDMI_CEC_CNT_TO_4700_US_SHIFT) | ((4500 / usecs) << VC4_HDMI_CEC_CNT_TO_4500_US_SHIFT); @@ -118,7 +118,7 @@ index ef7bea7c43a0..6b61fb1866ff 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 19 Aug 2021 15:59:30 +0200 -Subject: [PATCH 0002/1050] drm/vc4: hdmi: Make sure the device is powered with +Subject: [PATCH 0002/1183] drm/vc4: hdmi: Make sure the device is powered with CEC Similarly to what we encountered with the detect hook with DRM, nothing @@ -140,10 +140,10 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-6-maxi 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 6b61fb1866ff..80d7fdc7257b 100644 +index 7380fa4cd8dd..be471436df7f 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1745,8 +1745,14 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) +@@ -1753,8 +1753,14 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); /* clock period in microseconds */ const u32 usecs = 1000000 / CEC_CLOCK_FREQ; @@ -159,7 +159,7 @@ index 6b61fb1866ff..80d7fdc7257b 100644 val &= ~(VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET | VC4_HDMI_CEC_CNT_TO_4700_US_MASK | VC4_HDMI_CEC_CNT_TO_4500_US_MASK); -@@ -1789,6 +1795,8 @@ static int vc4_hdmi_cec_disable(struct cec_adapter *adap) +@@ -1797,6 +1803,8 @@ static int vc4_hdmi_cec_disable(struct cec_adapter *adap) HDMI_WRITE(HDMI_CEC_CNTRL_5, HDMI_READ(HDMI_CEC_CNTRL_5) | VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET); @@ -175,7 +175,7 @@ index 6b61fb1866ff..80d7fdc7257b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 19 Aug 2021 15:59:31 +0200 -Subject: [PATCH 0003/1050] drm/vc4: hdmi: Warn if we access the controller +Subject: [PATCH 0003/1183] 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 @@ -193,7 +193,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-7-maxi 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h -index 19d2fdc446bc..99dde6e06a37 100644 +index f126fa425a1d..23930a8fa376 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h @@ -1,6 +1,8 @@ @@ -205,7 +205,7 @@ index 19d2fdc446bc..99dde6e06a37 100644 #include "vc4_hdmi.h" #define VC4_HDMI_PACKET_STRIDE 0x24 -@@ -412,6 +414,8 @@ static inline u32 vc4_hdmi_read(struct vc4_hdmi *hdmi, +@@ -415,6 +417,8 @@ static inline u32 vc4_hdmi_read(struct vc4_hdmi *hdmi, const struct vc4_hdmi_variant *variant = hdmi->variant; void __iomem *base; @@ -214,7 +214,7 @@ index 19d2fdc446bc..99dde6e06a37 100644 if (reg >= variant->num_registers) { dev_warn(&hdmi->pdev->dev, "Invalid register ID %u\n", reg); -@@ -438,6 +442,8 @@ static inline void vc4_hdmi_write(struct vc4_hdmi *hdmi, +@@ -441,6 +445,8 @@ static inline void vc4_hdmi_write(struct vc4_hdmi *hdmi, const struct vc4_hdmi_variant *variant = hdmi->variant; void __iomem *base; @@ -230,7 +230,7 @@ index 19d2fdc446bc..99dde6e06a37 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 25 Oct 2021 17:28:54 +0200 -Subject: [PATCH 0004/1050] drm/vc4: hdmi: Remove the DDC probing for status +Subject: [PATCH 0004/1183] drm/vc4: hdmi: Remove the DDC probing for status detection Commit 9d44abbbb8d5 ("drm/vc4: Fall back to using an EDID probe in the @@ -264,13 +264,13 @@ Link: https://lore.kernel.org/r/20211025152903.1088803-2-maxime@cerno.tech 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 80d7fdc7257b..689dc242b155 100644 +index be471436df7f..7762da1be7c6 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -176,8 +176,6 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) - if (vc4_hdmi->hpd_gpio && - gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) { - connected = true; +@@ -179,8 +179,6 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + if (vc4_hdmi->hpd_gpio) { + if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) + connected = true; - } else if (drm_probe_ddc(vc4_hdmi->ddc)) { - connected = true; } else if (HDMI_READ(HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) { @@ -283,7 +283,7 @@ index 80d7fdc7257b..689dc242b155 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 25 Oct 2021 17:29:01 +0200 -Subject: [PATCH 0005/1050] drm/vc4: hdmi: Raise the maximum clock rate +Subject: [PATCH 0005/1183] 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. @@ -301,10 +301,10 @@ Link: https://lore.kernel.org/r/20211025152903.1088803-9-maxime@cerno.tech 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 689dc242b155..8a30f65efe76 100644 +index 7762da1be7c6..a7980040973b 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2378,7 +2378,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { +@@ -2385,7 +2385,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { .encoder_type = VC4_ENCODER_TYPE_HDMI0, .debugfs_name = "hdmi0_regs", .card_name = "vc4-hdmi-0", @@ -319,54 +319,8 @@ index 689dc242b155..8a30f65efe76 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard -Date: Mon, 25 Oct 2021 17:28:55 +0200 -Subject: [PATCH 0006/1050] drm/vc4: hdmi: Fix HPD GPIO detection - -Prior to commit 6800234ceee0 ("drm/vc4: hdmi: Convert to gpiod"), in the -detect hook, if we had an HPD GPIO we would only rely on it and return -whatever state it was in. - -However, that commit changed that by mistake to only consider the case -where we have a GPIO and it returns a logical high, and would fall back -to the other methods otherwise. - -Since we can read the EDIDs when the HPD signal is low on some displays, -we changed the detection status from disconnected to connected, and we -would ignore an HPD pulse. - -Fixes: 6800234ceee0 ("drm/vc4: hdmi: Convert to gpiod") -Signed-off-by: Maxime Ripard -Reviewed-by: Dave Stevenson -Link: https://lore.kernel.org/r/20211025152903.1088803-3-maxime@cerno.tech ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 8a30f65efe76..c1440bf1994d 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -173,9 +173,9 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) - - WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); - -- if (vc4_hdmi->hpd_gpio && -- gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) { -- connected = true; -+ if (vc4_hdmi->hpd_gpio) { -+ if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) -+ 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: Mon, 25 Oct 2021 16:11:08 +0200 -Subject: [PATCH 0007/1050] drm/vc4: hdmi: Add a spinlock to protect register +Subject: [PATCH 0006/1183] drm/vc4: hdmi: Add a spinlock to protect register access The vc4 HDMI driver has multiple path shared between the CEC, ALSA and @@ -389,10 +343,10 @@ Signed-off-by: Maxime Ripard 4 files changed, 236 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index c1440bf1994d..8ff47f77e87e 100644 +index a7980040973b..e8b3d29aa2fe 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -119,6 +119,10 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) +@@ -122,6 +122,10 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) static void vc4_hdmi_reset(struct vc4_hdmi *vc4_hdmi) { @@ -403,7 +357,7 @@ index c1440bf1994d..8ff47f77e87e 100644 HDMI_WRITE(HDMI_M_CTL, VC4_HD_M_SW_RST); udelay(1); HDMI_WRITE(HDMI_M_CTL, 0); -@@ -130,24 +134,36 @@ static void vc4_hdmi_reset(struct vc4_hdmi *vc4_hdmi) +@@ -133,24 +137,36 @@ static void vc4_hdmi_reset(struct vc4_hdmi *vc4_hdmi) VC4_HDMI_SW_RESET_FORMAT_DETECT); HDMI_WRITE(HDMI_SW_RESET_CONTROL, 0); @@ -440,7 +394,7 @@ index c1440bf1994d..8ff47f77e87e 100644 value = HDMI_READ(HDMI_CEC_CNTRL_1); value &= ~VC4_HDMI_CEC_DIV_CLK_CNT_MASK; -@@ -155,9 +171,11 @@ static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) +@@ -158,9 +174,11 @@ static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) * Set the clock divider: the hsm_clock rate and this divider * setting will give a 40 kHz CEC clock. */ @@ -453,7 +407,7 @@ index c1440bf1994d..8ff47f77e87e 100644 } #else static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) {} -@@ -176,8 +194,16 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) +@@ -179,8 +197,16 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) if (vc4_hdmi->hpd_gpio) { if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) connected = true; @@ -472,7 +426,7 @@ index c1440bf1994d..8ff47f77e87e 100644 } if (connected) { -@@ -371,9 +397,12 @@ static int vc4_hdmi_stop_packet(struct drm_encoder *encoder, +@@ -374,9 +400,12 @@ static int vc4_hdmi_stop_packet(struct drm_encoder *encoder, { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); u32 packet_id = type - 0x80; @@ -485,7 +439,7 @@ index c1440bf1994d..8ff47f77e87e 100644 if (!poll) return 0; -@@ -393,6 +422,7 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, +@@ -396,6 +425,7 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, void __iomem *base = __vc4_hdmi_get_field_base(vc4_hdmi, ram_packet_start->reg); uint8_t buffer[VC4_HDMI_PACKET_STRIDE]; @@ -493,7 +447,7 @@ index c1440bf1994d..8ff47f77e87e 100644 ssize_t len, i; int ret; -@@ -410,6 +440,8 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, +@@ -413,6 +443,8 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, return; } @@ -502,7 +456,7 @@ index c1440bf1994d..8ff47f77e87e 100644 for (i = 0; i < len; i += 7) { writel(buffer[i + 0] << 0 | buffer[i + 1] << 8 | -@@ -427,6 +459,9 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, +@@ -430,6 +462,9 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, HDMI_READ(HDMI_RAM_PACKET_CONFIG) | BIT(packet_id)); @@ -512,7 +466,7 @@ index c1440bf1994d..8ff47f77e87e 100644 ret = wait_for((HDMI_READ(HDMI_RAM_PACKET_STATUS) & BIT(packet_id)), 100); if (ret) -@@ -546,6 +581,7 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) +@@ -549,6 +584,7 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) { struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode; struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); @@ -520,7 +474,7 @@ index c1440bf1994d..8ff47f77e87e 100644 if (!vc4_hdmi_supports_scrambling(encoder, mode)) return; -@@ -556,8 +592,10 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) +@@ -559,8 +595,10 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) drm_scdc_set_high_tmds_clock_ratio(vc4_hdmi->ddc, true); drm_scdc_set_scrambling(vc4_hdmi->ddc, true); @@ -531,7 +485,7 @@ index c1440bf1994d..8ff47f77e87e 100644 queue_delayed_work(system_wq, &vc4_hdmi->scrambling_work, msecs_to_jiffies(SCRAMBLING_POLLING_DELAY_MS)); -@@ -567,6 +605,7 @@ static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder) +@@ -570,6 +608,7 @@ static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); struct drm_crtc *crtc = encoder->crtc; @@ -539,7 +493,7 @@ index c1440bf1994d..8ff47f77e87e 100644 /* * At boot, encoder->crtc will be NULL. Since we don't know the -@@ -582,8 +621,10 @@ static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder) +@@ -585,8 +624,10 @@ static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder) if (delayed_work_pending(&vc4_hdmi->scrambling_work)) cancel_delayed_work_sync(&vc4_hdmi->scrambling_work); @@ -550,7 +504,7 @@ index c1440bf1994d..8ff47f77e87e 100644 drm_scdc_set_scrambling(vc4_hdmi->ddc, false); drm_scdc_set_high_tmds_clock_ratio(vc4_hdmi->ddc, false); -@@ -609,15 +650,23 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, +@@ -612,15 +653,23 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); @@ -574,7 +528,7 @@ index c1440bf1994d..8ff47f77e87e 100644 vc4_hdmi_disable_scrambling(encoder); } -@@ -625,10 +674,13 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, +@@ -628,10 +677,13 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); @@ -588,7 +542,7 @@ index c1440bf1994d..8ff47f77e87e 100644 if (vc4_hdmi->variant->phy_disable) vc4_hdmi->variant->phy_disable(vc4_hdmi); -@@ -647,8 +699,11 @@ static void vc4_hdmi_encoder_disable(struct drm_encoder *encoder) +@@ -650,8 +702,11 @@ static void vc4_hdmi_encoder_disable(struct drm_encoder *encoder) static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable) { @@ -600,7 +554,7 @@ index c1440bf1994d..8ff47f77e87e 100644 csc_ctl = VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR, VC4_HD_CSC_CTL_ORDER); -@@ -678,14 +733,19 @@ static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable) +@@ -681,14 +736,19 @@ static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable) /* The RGB order applies even when CSC is disabled. */ HDMI_WRITE(HDMI_CSC_CTL, csc_ctl); @@ -620,7 +574,7 @@ index c1440bf1994d..8ff47f77e87e 100644 if (enable) { /* CEA VICs other than #1 requre limited range RGB * output unless overridden by an AVI infoframe. -@@ -717,6 +777,8 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable) +@@ -720,6 +780,8 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable) } HDMI_WRITE(HDMI_CSC_CTL, csc_ctl); @@ -629,9 +583,9 @@ index c1440bf1994d..8ff47f77e87e 100644 } static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, -@@ -740,6 +802,9 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, - mode->crtc_vsync_end - - interlaced, +@@ -743,6 +805,9 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + VC4_SET_FIELD(mode->crtc_vtotal - + mode->crtc_vsync_end, VC4_HDMI_VERTB_VBP)); + unsigned long flags; + @@ -639,7 +593,7 @@ index c1440bf1994d..8ff47f77e87e 100644 HDMI_WRITE(HDMI_HORZA, (vsync_pos ? VC4_HDMI_HORZA_VPOS : 0) | -@@ -763,6 +828,8 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, +@@ -766,6 +831,8 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, HDMI_WRITE(HDMI_VERTB0, vertb_even); HDMI_WRITE(HDMI_VERTB1, vertb); @@ -648,9 +602,9 @@ index c1440bf1994d..8ff47f77e87e 100644 } static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, -@@ -786,10 +853,13 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, - mode->crtc_vsync_end - - interlaced, +@@ -789,10 +856,13 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + VC4_SET_FIELD(mode->crtc_vtotal - + mode->crtc_vsync_end - interlaced, VC4_HDMI_VERTB_VBP)); + unsigned long flags; unsigned char gcp; @@ -662,8 +616,8 @@ index c1440bf1994d..8ff47f77e87e 100644 HDMI_WRITE(HDMI_VEC_INTERFACE_XBAR, 0x354021); HDMI_WRITE(HDMI_HORZA, (vsync_pos ? VC5_HDMI_HORZA_VPOS : 0) | -@@ -848,13 +918,18 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, - HDMI_WRITE(HDMI_GCP_CONFIG, reg); +@@ -856,13 +926,18 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + HDMI_WRITE(HDMI_MISC_CONTROL, reg); HDMI_WRITE(HDMI_CLOCK_STOP, 0); + @@ -681,7 +635,7 @@ index c1440bf1994d..8ff47f77e87e 100644 drift = HDMI_READ(HDMI_FIFO_CTL); drift &= VC4_HDMI_FIFO_VALID_WRITE_MASK; -@@ -862,12 +937,20 @@ static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) +@@ -870,12 +945,20 @@ static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) drift & ~VC4_HDMI_FIFO_CTL_RECENTER); HDMI_WRITE(HDMI_FIFO_CTL, drift | VC4_HDMI_FIFO_CTL_RECENTER); @@ -702,7 +656,7 @@ index c1440bf1994d..8ff47f77e87e 100644 ret = wait_for(HDMI_READ(HDMI_FIFO_CTL) & VC4_HDMI_FIFO_CTL_RECENTER_DONE, 1); WARN_ONCE(ret, "Timeout waiting for " -@@ -901,6 +984,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, +@@ -909,6 +992,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); unsigned long pixel_rate = vc4_conn_state->pixel_rate; unsigned long bvb_rate, hsm_rate; @@ -710,7 +664,7 @@ index c1440bf1994d..8ff47f77e87e 100644 int ret; /* -@@ -969,11 +1053,15 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, +@@ -977,11 +1061,15 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, if (vc4_hdmi->variant->phy_init) vc4_hdmi->variant->phy_init(vc4_hdmi, vc4_conn_state); @@ -726,7 +680,7 @@ index c1440bf1994d..8ff47f77e87e 100644 if (vc4_hdmi->variant->set_timings) vc4_hdmi->variant->set_timings(vc4_hdmi, conn_state, mode); -@@ -993,6 +1081,7 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, +@@ -1001,6 +1089,7 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode; struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); @@ -734,7 +688,7 @@ index c1440bf1994d..8ff47f77e87e 100644 if (vc4_encoder->hdmi_monitor && drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED) { -@@ -1007,7 +1096,9 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, +@@ -1015,7 +1104,9 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, vc4_encoder->limited_rgb_range = false; } @@ -744,7 +698,7 @@ index c1440bf1994d..8ff47f77e87e 100644 } static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, -@@ -1018,8 +1109,11 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, +@@ -1026,8 +1117,11 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; @@ -756,7 +710,7 @@ index c1440bf1994d..8ff47f77e87e 100644 HDMI_WRITE(HDMI_VID_CTL, VC4_HD_VID_CTL_ENABLE | VC4_HD_VID_CTL_CLRRGB | -@@ -1036,6 +1130,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, +@@ -1044,6 +1138,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, HDMI_READ(HDMI_SCHEDULER_CONTROL) | VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); @@ -765,7 +719,7 @@ index c1440bf1994d..8ff47f77e87e 100644 ret = wait_for(HDMI_READ(HDMI_SCHEDULER_CONTROL) & VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE, 1000); WARN_ONCE(ret, "Timeout waiting for " -@@ -1048,6 +1144,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, +@@ -1056,6 +1152,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, HDMI_READ(HDMI_SCHEDULER_CONTROL) & ~VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); @@ -774,7 +728,7 @@ index c1440bf1994d..8ff47f77e87e 100644 ret = wait_for(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) & VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE), 1000); WARN_ONCE(ret, "Timeout waiting for " -@@ -1055,6 +1153,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, +@@ -1063,6 +1161,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, } if (vc4_encoder->hdmi_monitor) { @@ -783,7 +737,7 @@ index c1440bf1994d..8ff47f77e87e 100644 WARN_ON(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) & VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE)); HDMI_WRITE(HDMI_SCHEDULER_CONTROL, -@@ -1064,6 +1164,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, +@@ -1072,6 +1172,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, VC4_HDMI_RAM_PACKET_ENABLE); @@ -792,7 +746,7 @@ index c1440bf1994d..8ff47f77e87e 100644 vc4_hdmi_set_infoframes(encoder); } -@@ -1187,6 +1289,7 @@ static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi, +@@ -1195,6 +1297,7 @@ static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi, unsigned int samplerate) { u32 hsm_clock = clk_get_rate(vc4_hdmi->audio_clock); @@ -800,7 +754,7 @@ index c1440bf1994d..8ff47f77e87e 100644 unsigned long n, m; rational_best_approximation(hsm_clock, samplerate, -@@ -1196,9 +1299,11 @@ static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi, +@@ -1204,9 +1307,11 @@ static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi, VC4_HD_MAI_SMP_M_SHIFT) + 1, &n, &m); @@ -812,7 +766,7 @@ index c1440bf1994d..8ff47f77e87e 100644 } static void vc4_hdmi_set_n_cts(struct vc4_hdmi *vc4_hdmi, unsigned int samplerate) -@@ -1209,6 +1314,8 @@ static void vc4_hdmi_set_n_cts(struct vc4_hdmi *vc4_hdmi, unsigned int samplerat +@@ -1217,6 +1322,8 @@ static void vc4_hdmi_set_n_cts(struct vc4_hdmi *vc4_hdmi, unsigned int samplerat u32 n, cts; u64 tmp; @@ -821,7 +775,7 @@ index c1440bf1994d..8ff47f77e87e 100644 n = 128 * samplerate / 1000; tmp = (u64)(mode->clock * 1000) * n; do_div(tmp, 128 * samplerate); -@@ -1238,6 +1345,7 @@ static int vc4_hdmi_audio_startup(struct device *dev, void *data) +@@ -1246,6 +1353,7 @@ static int vc4_hdmi_audio_startup(struct device *dev, void *data) { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; @@ -829,7 +783,7 @@ index c1440bf1994d..8ff47f77e87e 100644 /* * If the HDMI encoder hasn't probed, or the encoder is -@@ -1249,12 +1357,14 @@ static int vc4_hdmi_audio_startup(struct device *dev, void *data) +@@ -1257,12 +1365,14 @@ static int vc4_hdmi_audio_startup(struct device *dev, void *data) vc4_hdmi->audio.streaming = true; @@ -844,7 +798,7 @@ index c1440bf1994d..8ff47f77e87e 100644 if (vc4_hdmi->variant->phy_rng_enable) vc4_hdmi->variant->phy_rng_enable(vc4_hdmi); -@@ -1266,6 +1376,7 @@ static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) +@@ -1274,6 +1384,7 @@ static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) { struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; struct device *dev = &vc4_hdmi->pdev->dev; @@ -852,7 +806,7 @@ index c1440bf1994d..8ff47f77e87e 100644 int ret; vc4_hdmi->audio.streaming = false; -@@ -1273,20 +1384,29 @@ static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) +@@ -1281,20 +1392,29 @@ static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) if (ret) dev_err(dev, "Failed to stop audio infoframe: %d\n", ret); @@ -882,7 +836,7 @@ index c1440bf1994d..8ff47f77e87e 100644 if (vc4_hdmi->variant->phy_rng_disable) vc4_hdmi->variant->phy_rng_disable(vc4_hdmi); -@@ -1341,6 +1461,7 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, +@@ -1349,6 +1469,7 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; unsigned int sample_rate = params->sample_rate; unsigned int channels = params->channels; @@ -890,7 +844,7 @@ index c1440bf1994d..8ff47f77e87e 100644 u32 audio_packet_config, channel_mask; u32 channel_map; u32 mai_audio_format; -@@ -1349,14 +1470,15 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, +@@ -1357,14 +1478,15 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, dev_dbg(dev, "%s: %u Hz, %d bit, %d channels\n", __func__, sample_rate, params->sample_width, channels); @@ -908,7 +862,7 @@ index c1440bf1994d..8ff47f77e87e 100644 mai_sample_rate = sample_rate_to_mai_fmt(sample_rate); if (params->iec.status[0] & IEC958_AES0_NONAUDIO && params->channels == 8) -@@ -1394,8 +1516,11 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, +@@ -1402,8 +1524,11 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, channel_map = vc4_hdmi->variant->channel_map(vc4_hdmi, channel_mask); HDMI_WRITE(HDMI_MAI_CHANNEL_MAP, channel_map); HDMI_WRITE(HDMI_AUDIO_PACKET_CONFIG, audio_packet_config); @@ -920,7 +874,7 @@ index c1440bf1994d..8ff47f77e87e 100644 memcpy(&vc4_hdmi->audio.infoframe, ¶ms->cea, sizeof(params->cea)); vc4_hdmi_set_audio_infoframe(encoder); -@@ -1669,6 +1794,8 @@ static void vc4_cec_read_msg(struct vc4_hdmi *vc4_hdmi, u32 cntrl1) +@@ -1677,6 +1802,8 @@ static void vc4_cec_read_msg(struct vc4_hdmi *vc4_hdmi, u32 cntrl1) struct cec_msg *msg = &vc4_hdmi->cec_rx_msg; unsigned int i; @@ -929,7 +883,7 @@ index c1440bf1994d..8ff47f77e87e 100644 msg->len = 1 + ((cntrl1 & VC4_HDMI_CEC_REC_WRD_CNT_MASK) >> VC4_HDMI_CEC_REC_WRD_CNT_SHIFT); -@@ -1687,11 +1814,12 @@ static void vc4_cec_read_msg(struct vc4_hdmi *vc4_hdmi, u32 cntrl1) +@@ -1695,11 +1822,12 @@ static void vc4_cec_read_msg(struct vc4_hdmi *vc4_hdmi, u32 cntrl1) } } @@ -944,7 +898,7 @@ index c1440bf1994d..8ff47f77e87e 100644 cntrl1 = HDMI_READ(HDMI_CEC_CNTRL_1); vc4_hdmi->cec_tx_ok = cntrl1 & VC4_HDMI_CEC_TX_STATUS_GOOD; cntrl1 &= ~VC4_HDMI_CEC_START_XMIT_BEGIN; -@@ -1700,11 +1828,24 @@ static irqreturn_t vc4_cec_irq_handler_tx_bare(int irq, void *priv) +@@ -1708,11 +1836,24 @@ static irqreturn_t vc4_cec_irq_handler_tx_bare(int irq, void *priv) return IRQ_WAKE_THREAD; } @@ -970,7 +924,7 @@ index c1440bf1994d..8ff47f77e87e 100644 vc4_hdmi->cec_rx_msg.len = 0; cntrl1 = HDMI_READ(HDMI_CEC_CNTRL_1); vc4_cec_read_msg(vc4_hdmi, cntrl1); -@@ -1717,6 +1858,18 @@ static irqreturn_t vc4_cec_irq_handler_rx_bare(int irq, void *priv) +@@ -1725,6 +1866,18 @@ static irqreturn_t vc4_cec_irq_handler_rx_bare(int irq, void *priv) return IRQ_WAKE_THREAD; } @@ -989,7 +943,7 @@ index c1440bf1994d..8ff47f77e87e 100644 static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) { struct vc4_hdmi *vc4_hdmi = priv; -@@ -1727,14 +1880,17 @@ static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) +@@ -1735,14 +1888,17 @@ static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) if (!(stat & VC4_HDMI_CPU_CEC)) return IRQ_NONE; @@ -1009,7 +963,7 @@ index c1440bf1994d..8ff47f77e87e 100644 return ret; } -@@ -1743,6 +1899,7 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) +@@ -1751,6 +1907,7 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); /* clock period in microseconds */ const u32 usecs = 1000000 / CEC_CLOCK_FREQ; @@ -1017,7 +971,7 @@ index c1440bf1994d..8ff47f77e87e 100644 u32 val; int ret; -@@ -1750,6 +1907,8 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) +@@ -1758,6 +1915,8 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) if (ret) return ret; @@ -1026,7 +980,7 @@ index c1440bf1994d..8ff47f77e87e 100644 val = HDMI_READ(HDMI_CEC_CNTRL_5); val &= ~(VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET | VC4_HDMI_CEC_CNT_TO_4700_US_MASK | -@@ -1780,12 +1939,17 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) +@@ -1788,12 +1947,17 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) if (!vc4_hdmi->variant->external_irq_controller) HDMI_WRITE(HDMI_CEC_CPU_MASK_CLEAR, VC4_HDMI_CPU_CEC); @@ -1044,7 +998,7 @@ index c1440bf1994d..8ff47f77e87e 100644 if (!vc4_hdmi->variant->external_irq_controller) HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, VC4_HDMI_CPU_CEC); -@@ -1793,6 +1957,8 @@ static int vc4_hdmi_cec_disable(struct cec_adapter *adap) +@@ -1801,6 +1965,8 @@ static int vc4_hdmi_cec_disable(struct cec_adapter *adap) HDMI_WRITE(HDMI_CEC_CNTRL_5, HDMI_READ(HDMI_CEC_CNTRL_5) | VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET); @@ -1053,7 +1007,7 @@ index c1440bf1994d..8ff47f77e87e 100644 pm_runtime_put(&vc4_hdmi->pdev->dev); return 0; -@@ -1809,10 +1975,14 @@ static int vc4_hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable) +@@ -1817,10 +1983,14 @@ static int vc4_hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable) static int vc4_hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr) { struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); @@ -1068,7 +1022,7 @@ index c1440bf1994d..8ff47f77e87e 100644 return 0; } -@@ -1821,6 +1991,7 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, +@@ -1829,6 +1999,7 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, { struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); struct drm_device *dev = vc4_hdmi->connector.dev; @@ -1076,7 +1030,7 @@ index c1440bf1994d..8ff47f77e87e 100644 u32 val; unsigned int i; -@@ -1829,6 +2000,8 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, +@@ -1837,6 +2008,8 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, return -ENOMEM; } @@ -1085,7 +1039,7 @@ index c1440bf1994d..8ff47f77e87e 100644 for (i = 0; i < msg->len; i += 4) HDMI_WRITE(HDMI_CEC_TX_DATA_1 + (i >> 2), (msg->msg[i]) | -@@ -1844,6 +2017,9 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, +@@ -1852,6 +2025,9 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, val |= VC4_HDMI_CEC_START_XMIT_BEGIN; HDMI_WRITE(HDMI_CEC_CNTRL_1, val); @@ -1095,7 +1049,7 @@ index c1440bf1994d..8ff47f77e87e 100644 return 0; } -@@ -1858,6 +2034,7 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) +@@ -1866,6 +2042,7 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) struct cec_connector_info conn_info; struct platform_device *pdev = vc4_hdmi->pdev; struct device *dev = &pdev->dev; @@ -1103,7 +1057,7 @@ index c1440bf1994d..8ff47f77e87e 100644 u32 value; int ret; -@@ -1877,10 +2054,12 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) +@@ -1885,10 +2062,12 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) cec_fill_conn_info_from_drm(&conn_info, &vc4_hdmi->connector); cec_s_conn_info(vc4_hdmi->cec_adap, &conn_info); @@ -1116,7 +1070,7 @@ index c1440bf1994d..8ff47f77e87e 100644 vc4_hdmi_cec_update_clk_div(vc4_hdmi); -@@ -1899,7 +2078,9 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) +@@ -1907,7 +2086,9 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) if (ret) goto err_remove_cec_rx_handler; } else { @@ -1126,7 +1080,7 @@ index c1440bf1994d..8ff47f77e87e 100644 ret = request_threaded_irq(platform_get_irq(pdev, 0), vc4_cec_irq_handler, -@@ -2169,6 +2350,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) +@@ -2177,6 +2358,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi = devm_kzalloc(dev, sizeof(*vc4_hdmi), GFP_KERNEL); if (!vc4_hdmi) return -ENOMEM; @@ -1266,10 +1220,10 @@ index 36535480f8e2..62148f0dc284 100644 + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); } diff --git a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h -index 99dde6e06a37..fc971506bd4f 100644 +index 23930a8fa376..24056441a4bb 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h -@@ -442,6 +442,8 @@ static inline void vc4_hdmi_write(struct vc4_hdmi *hdmi, +@@ -445,6 +445,8 @@ static inline void vc4_hdmi_write(struct vc4_hdmi *hdmi, const struct vc4_hdmi_variant *variant = hdmi->variant; void __iomem *base; @@ -1285,7 +1239,7 @@ index 99dde6e06a37..fc971506bd4f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 25 Oct 2021 16:11:09 +0200 -Subject: [PATCH 0008/1050] drm/vc4: hdmi: Use a mutex to prevent concurrent +Subject: [PATCH 0007/1183] drm/vc4: hdmi: Use a mutex to prevent concurrent framework access The vc4 HDMI controller registers into the KMS, CEC and ALSA @@ -1321,10 +1275,10 @@ Signed-off-by: Maxime Ripard 2 files changed, 126 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 8ff47f77e87e..c7bc51ff9561 100644 +index e8b3d29aa2fe..34e8cb580f8b 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -189,6 +189,8 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) +@@ -192,6 +192,8 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); bool connected = false; @@ -1333,7 +1287,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); if (vc4_hdmi->hpd_gpio) { -@@ -219,11 +221,13 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) +@@ -222,11 +224,13 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) vc4_hdmi_enable_scrambling(&vc4_hdmi->encoder.base.base); pm_runtime_put(&vc4_hdmi->pdev->dev); @@ -1347,7 +1301,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 return connector_status_disconnected; } -@@ -240,10 +244,14 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) +@@ -243,10 +247,14 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) int ret = 0; struct edid *edid; @@ -1364,7 +1318,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 vc4_encoder->hdmi_monitor = drm_detect_hdmi_monitor(edid); -@@ -263,6 +271,9 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) +@@ -266,6 +274,9 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) } } @@ -1374,7 +1328,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 return ret; } -@@ -479,6 +490,8 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder) +@@ -482,6 +493,8 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder) union hdmi_infoframe frame; int ret; @@ -1383,7 +1337,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, connector, mode); if (ret < 0) { -@@ -530,6 +543,8 @@ static void vc4_hdmi_set_hdr_infoframe(struct drm_encoder *encoder) +@@ -533,6 +546,8 @@ static void vc4_hdmi_set_hdr_infoframe(struct drm_encoder *encoder) struct drm_connector_state *conn_state = connector->state; union hdmi_infoframe frame; @@ -1392,7 +1346,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 if (!vc4_hdmi->variant->supports_hdr) return; -@@ -546,6 +561,8 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) +@@ -549,6 +564,8 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); @@ -1401,7 +1355,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 vc4_hdmi_set_avi_infoframe(encoder); vc4_hdmi_set_spd_infoframe(encoder); /* -@@ -565,6 +582,8 @@ static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder, +@@ -568,6 +585,8 @@ static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder, struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); struct drm_display_info *display = &vc4_hdmi->connector.display_info; @@ -1410,7 +1364,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 if (!vc4_encoder->hdmi_monitor) return false; -@@ -583,6 +602,8 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) +@@ -586,6 +605,8 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); unsigned long flags; @@ -1419,7 +1373,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 if (!vc4_hdmi_supports_scrambling(encoder, mode)) return; -@@ -652,6 +673,8 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, +@@ -655,6 +676,8 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); unsigned long flags; @@ -1428,7 +1382,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0); -@@ -668,6 +691,8 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, +@@ -671,6 +694,8 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); vc4_hdmi_disable_scrambling(encoder); @@ -1437,7 +1391,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 } static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, -@@ -677,6 +702,8 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, +@@ -680,6 +705,8 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, unsigned long flags; int ret; @@ -1446,7 +1400,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_VID_CTL, HDMI_READ(HDMI_VID_CTL) | VC4_HD_VID_CTL_BLANKPIX); -@@ -691,6 +718,8 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, +@@ -694,6 +721,8 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, ret = pm_runtime_put(&vc4_hdmi->pdev->dev); if (ret < 0) DRM_ERROR("Failed to release power domain: %d\n", ret); @@ -1455,7 +1409,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 } static void vc4_hdmi_encoder_disable(struct drm_encoder *encoder) -@@ -987,6 +1016,8 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, +@@ -995,6 +1024,8 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, unsigned long flags; int ret; @@ -1464,7 +1418,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 /* * As stated in RPi's vc4 firmware "HDMI state machine (HSM) clock must * be faster than pixel clock, infinitesimally faster, tested in -@@ -1007,13 +1038,13 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, +@@ -1015,13 +1046,13 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, ret = clk_set_min_rate(vc4_hdmi->hsm_clock, hsm_rate); if (ret) { DRM_ERROR("Failed to set HSM clock rate: %d\n", ret); @@ -1480,7 +1434,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 } ret = clk_set_rate(vc4_hdmi->pixel_clock, pixel_rate); -@@ -1065,13 +1096,16 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, +@@ -1073,13 +1104,16 @@ 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); @@ -1498,7 +1452,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 return; } -@@ -1083,6 +1117,8 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, +@@ -1091,6 +1125,8 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); unsigned long flags; @@ -1507,7 +1461,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 if (vc4_encoder->hdmi_monitor && drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED) { if (vc4_hdmi->variant->csc_setup) -@@ -1099,6 +1135,8 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, +@@ -1107,6 +1143,8 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_FIFO_CTL, VC4_HDMI_FIFO_CTL_MASTER_SLAVE_N); spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); @@ -1516,7 +1470,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 } static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, -@@ -1112,6 +1150,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, +@@ -1120,6 +1158,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, unsigned long flags; int ret; @@ -1525,7 +1479,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_VID_CTL, -@@ -1171,6 +1211,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, +@@ -1179,6 +1219,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, vc4_hdmi_recenter_fifo(vc4_hdmi); vc4_hdmi_enable_scrambling(encoder); @@ -1534,7 +1488,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 } static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder) -@@ -1314,6 +1356,7 @@ static void vc4_hdmi_set_n_cts(struct vc4_hdmi *vc4_hdmi, unsigned int samplerat +@@ -1322,6 +1364,7 @@ static void vc4_hdmi_set_n_cts(struct vc4_hdmi *vc4_hdmi, unsigned int samplerat u32 n, cts; u64 tmp; @@ -1542,7 +1496,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 lockdep_assert_held(&vc4_hdmi->hw_lock); n = 128 * samplerate / 1000; -@@ -1347,13 +1390,17 @@ static int vc4_hdmi_audio_startup(struct device *dev, void *data) +@@ -1355,13 +1398,17 @@ static int vc4_hdmi_audio_startup(struct device *dev, void *data) struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; unsigned long flags; @@ -1561,7 +1515,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 vc4_hdmi->audio.streaming = true; -@@ -1369,6 +1416,8 @@ static int vc4_hdmi_audio_startup(struct device *dev, void *data) +@@ -1377,6 +1424,8 @@ static int vc4_hdmi_audio_startup(struct device *dev, void *data) if (vc4_hdmi->variant->phy_rng_enable) vc4_hdmi->variant->phy_rng_enable(vc4_hdmi); @@ -1570,7 +1524,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 return 0; } -@@ -1379,6 +1428,8 @@ static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) +@@ -1387,6 +1436,8 @@ static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) unsigned long flags; int ret; @@ -1579,7 +1533,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 vc4_hdmi->audio.streaming = false; ret = vc4_hdmi_stop_packet(encoder, HDMI_INFOFRAME_TYPE_AUDIO, false); if (ret) -@@ -1398,6 +1449,8 @@ static void vc4_hdmi_audio_shutdown(struct device *dev, void *data) +@@ -1406,6 +1457,8 @@ static void vc4_hdmi_audio_shutdown(struct device *dev, void *data) struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); unsigned long flags; @@ -1588,7 +1542,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_MAI_CTL, -@@ -1412,6 +1465,8 @@ static void vc4_hdmi_audio_shutdown(struct device *dev, void *data) +@@ -1420,6 +1473,8 @@ static void vc4_hdmi_audio_shutdown(struct device *dev, void *data) vc4_hdmi->audio.streaming = false; vc4_hdmi_audio_reset(vc4_hdmi); @@ -1597,7 +1551,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 } static int sample_rate_to_mai_fmt(int samplerate) -@@ -1470,6 +1525,8 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, +@@ -1478,6 +1533,8 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, dev_dbg(dev, "%s: %u Hz, %d bit, %d channels\n", __func__, sample_rate, params->sample_width, channels); @@ -1606,7 +1560,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 vc4_hdmi_audio_set_mai_clock(vc4_hdmi, sample_rate); spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); -@@ -1524,6 +1581,8 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, +@@ -1532,6 +1589,8 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, memcpy(&vc4_hdmi->audio.infoframe, ¶ms->cea, sizeof(params->cea)); vc4_hdmi_set_audio_infoframe(encoder); @@ -1615,7 +1569,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 return 0; } -@@ -1566,7 +1625,9 @@ static int vc4_hdmi_audio_get_eld(struct device *dev, void *data, +@@ -1574,7 +1633,9 @@ static int vc4_hdmi_audio_get_eld(struct device *dev, void *data, struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); struct drm_connector *connector = &vc4_hdmi->connector; @@ -1625,7 +1579,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 return 0; } -@@ -1903,6 +1964,17 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) +@@ -1911,6 +1972,17 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) u32 val; int ret; @@ -1643,7 +1597,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); if (ret) return ret; -@@ -1949,6 +2021,17 @@ static int vc4_hdmi_cec_disable(struct cec_adapter *adap) +@@ -1957,6 +2029,17 @@ static int vc4_hdmi_cec_disable(struct cec_adapter *adap) struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); unsigned long flags; @@ -1661,7 +1615,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); if (!vc4_hdmi->variant->external_irq_controller) -@@ -1977,6 +2060,17 @@ static int vc4_hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr) +@@ -1985,6 +2068,17 @@ static int vc4_hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr) struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); unsigned long flags; @@ -1679,7 +1633,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); HDMI_WRITE(HDMI_CEC_CNTRL_1, (HDMI_READ(HDMI_CEC_CNTRL_1) & ~VC4_HDMI_CEC_ADDR_MASK) | -@@ -1995,6 +2089,17 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, +@@ -2003,6 +2097,17 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, u32 val; unsigned int i; @@ -1697,7 +1651,7 @@ index 8ff47f77e87e..c7bc51ff9561 100644 if (msg->len > 16) { drm_err(dev, "Attempting to transmit too much data (%d)\n", msg->len); return -ENOMEM; -@@ -2350,6 +2455,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) +@@ -2358,6 +2463,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi = devm_kzalloc(dev, sizeof(*vc4_hdmi), GFP_KERNEL); if (!vc4_hdmi) return -ENOMEM; @@ -1737,7 +1691,7 @@ index a84a074b5157..44e11ef6f425 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 19 Oct 2021 14:19:29 +0200 -Subject: [PATCH 0009/1050] drm/vc4: hdmi: Prevent access to crtc->state +Subject: [PATCH 0008/1183] drm/vc4: hdmi: Prevent access to crtc->state outside of KMS Accessing the crtc->state pointer from outside the modesetting context @@ -1764,10 +1718,10 @@ Signed-off-by: Maxime Ripard 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index c7bc51ff9561..1e60c696bdbd 100644 +index 34e8cb580f8b..ef555f3311e1 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -485,8 +485,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder) +@@ -488,8 +488,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder) struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); struct drm_connector *connector = &vc4_hdmi->connector; struct drm_connector_state *cstate = connector->state; @@ -1777,7 +1731,7 @@ index c7bc51ff9561..1e60c696bdbd 100644 union hdmi_infoframe frame; int ret; -@@ -598,8 +597,8 @@ static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder, +@@ -601,8 +600,8 @@ static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder, static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) { @@ -1787,7 +1741,7 @@ index c7bc51ff9561..1e60c696bdbd 100644 unsigned long flags; lockdep_assert_held(&vc4_hdmi->mutex); -@@ -625,18 +624,21 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) +@@ -628,18 +627,21 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); @@ -1811,7 +1765,7 @@ index c7bc51ff9561..1e60c696bdbd 100644 return; if (delayed_work_pending(&vc4_hdmi->scrambling_work)) -@@ -1009,8 +1011,8 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, +@@ -1017,8 +1019,8 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, vc4_hdmi_encoder_get_connector_state(encoder, state); struct vc4_hdmi_connector_state *vc4_conn_state = conn_state_to_vc4_hdmi_conn_state(conn_state); @@ -1821,7 +1775,7 @@ index c7bc51ff9561..1e60c696bdbd 100644 unsigned long pixel_rate = vc4_conn_state->pixel_rate; unsigned long bvb_rate, hsm_rate; unsigned long flags; -@@ -1112,9 +1114,9 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, +@@ -1120,9 +1122,9 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { @@ -1833,7 +1787,7 @@ index c7bc51ff9561..1e60c696bdbd 100644 unsigned long flags; mutex_lock(&vc4_hdmi->mutex); -@@ -1142,8 +1144,8 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, +@@ -1150,8 +1152,8 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { @@ -1843,7 +1797,7 @@ index c7bc51ff9561..1e60c696bdbd 100644 struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; -@@ -1219,6 +1221,19 @@ static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder) +@@ -1227,6 +1229,19 @@ static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder) { } @@ -1863,7 +1817,7 @@ index c7bc51ff9561..1e60c696bdbd 100644 #define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL #define WIFI_2_4GHz_CH1_MAX_FREQ 2422000000ULL -@@ -1297,6 +1312,7 @@ vc4_hdmi_encoder_mode_valid(struct drm_encoder *encoder, +@@ -1305,6 +1320,7 @@ vc4_hdmi_encoder_mode_valid(struct drm_encoder *encoder, static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { .atomic_check = vc4_hdmi_encoder_atomic_check, @@ -1871,7 +1825,7 @@ index c7bc51ff9561..1e60c696bdbd 100644 .mode_valid = vc4_hdmi_encoder_mode_valid, .disable = vc4_hdmi_encoder_disable, .enable = vc4_hdmi_encoder_enable, -@@ -1350,9 +1366,7 @@ static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi, +@@ -1358,9 +1374,7 @@ static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi, static void vc4_hdmi_set_n_cts(struct vc4_hdmi *vc4_hdmi, unsigned int samplerate) { @@ -1906,7 +1860,7 @@ index 44e11ef6f425..f0cfcb75b2ae 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 24 Sep 2021 14:27:38 +0200 -Subject: [PATCH 0010/1050] drm/vc4: hdmi: Check the device state in prepare() +Subject: [PATCH 0009/1183] drm/vc4: hdmi: Check the device state in prepare() Even though we already check that the encoder->crtc pointer is there during in startup(), which is part of the open() path in ASoC, nothing @@ -1923,10 +1877,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 1e60c696bdbd..010e69af0e28 100644 +index ef555f3311e1..680aecb5c6a4 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1398,20 +1398,36 @@ static inline struct vc4_hdmi *dai_to_hdmi(struct snd_soc_dai *dai) +@@ -1406,20 +1406,36 @@ static inline struct vc4_hdmi *dai_to_hdmi(struct snd_soc_dai *dai) return snd_soc_card_get_drvdata(card); } @@ -1970,7 +1924,7 @@ index 1e60c696bdbd..010e69af0e28 100644 mutex_unlock(&vc4_hdmi->mutex); return -ENODEV; } -@@ -1541,6 +1557,11 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, +@@ -1549,6 +1565,11 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, mutex_lock(&vc4_hdmi->mutex); @@ -1989,7 +1943,7 @@ index 1e60c696bdbd..010e69af0e28 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 19 Oct 2021 17:31:58 +0200 -Subject: [PATCH 0011/1050] drm/vc4: hdmi: Introduce an output_enabled flag +Subject: [PATCH 0010/1183] drm/vc4: hdmi: Introduce an output_enabled flag We currently poke at encoder->crtc in the ALSA code path to determine whether the HDMI output is enabled or not, and thus whether we should @@ -2007,10 +1961,10 @@ Signed-off-by: Maxime Ripard 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 010e69af0e28..eed771a0a566 100644 +index 680aecb5c6a4..1d8cb99c40d0 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -726,6 +726,11 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, +@@ -729,6 +729,11 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, static void vc4_hdmi_encoder_disable(struct drm_encoder *encoder) { @@ -2022,7 +1976,7 @@ index 010e69af0e28..eed771a0a566 100644 } static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, bool enable) -@@ -1219,6 +1224,11 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, +@@ -1227,6 +1232,11 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder) { @@ -2034,7 +1988,7 @@ index 010e69af0e28..eed771a0a566 100644 } static void vc4_hdmi_encoder_atomic_mode_set(struct drm_encoder *encoder, -@@ -1400,14 +1410,12 @@ static inline struct vc4_hdmi *dai_to_hdmi(struct snd_soc_dai *dai) +@@ -1408,14 +1418,12 @@ static inline struct vc4_hdmi *dai_to_hdmi(struct snd_soc_dai *dai) static bool vc4_hdmi_audio_can_stream(struct vc4_hdmi *vc4_hdmi) { @@ -2075,7 +2029,7 @@ index f0cfcb75b2ae..f41c6353cded 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 19 Oct 2021 19:13:46 +0200 -Subject: [PATCH 0012/1050] drm/vc4: hdmi: Introduce a scdc_enabled flag +Subject: [PATCH 0011/1183] drm/vc4: hdmi: Introduce a scdc_enabled flag We currently rely on two functions, vc4_hdmi_supports_scrambling() and vc4_hdmi_mode_needs_scrambling() to determine if we should enable and @@ -2108,10 +2062,10 @@ Signed-off-by: Maxime Ripard 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index eed771a0a566..bad5ac56cddf 100644 +index 1d8cb99c40d0..f0ac2fd99cb1 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -617,6 +617,8 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) +@@ -620,6 +620,8 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) VC5_HDMI_SCRAMBLER_CTL_ENABLE); spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); @@ -2120,7 +2074,7 @@ index eed771a0a566..bad5ac56cddf 100644 queue_delayed_work(system_wq, &vc4_hdmi->scrambling_work, msecs_to_jiffies(SCRAMBLING_POLLING_DELAY_MS)); } -@@ -624,22 +626,14 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) +@@ -627,22 +629,14 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); @@ -2145,7 +2099,7 @@ index eed771a0a566..bad5ac56cddf 100644 if (delayed_work_pending(&vc4_hdmi->scrambling_work)) cancel_delayed_work_sync(&vc4_hdmi->scrambling_work); -@@ -2513,6 +2507,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) +@@ -2521,6 +2515,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi->pdev = pdev; vc4_hdmi->variant = variant; @@ -2184,7 +2138,7 @@ index f41c6353cded..0c51c91f9d5c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 26 May 2021 16:07:01 +0200 -Subject: [PATCH 0013/1050] drm/vc4: Make vc4_crtc_get_encoder public +Subject: [PATCH 0012/1183] drm/vc4: Make vc4_crtc_get_encoder public We'll need that function in vc4_kms to compute the core clock rate requirements. @@ -2196,7 +2150,7 @@ Signed-off-by: Maxime Ripard 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 88dbb282d15c..ea0aa8934738 100644 +index 3b8576f19321..8a1fab73b163 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -281,10 +281,10 @@ static u32 vc4_crtc_get_fifo_full_level_bits(struct vc4_crtc *vc4_crtc, @@ -2237,7 +2191,7 @@ index 94c178738fc1..ee2b0909bfd1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 14 Jun 2021 15:27:24 +0200 -Subject: [PATCH 0014/1050] drm/vc4: crtc: Add encoder to vc4_crtc_config_pv +Subject: [PATCH 0013/1183] drm/vc4: crtc: Add encoder to vc4_crtc_config_pv prototype vc4_crtc_config_pv() retrieves the encoder again, even though its only @@ -2252,7 +2206,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index ea0aa8934738..251c2f57eb97 100644 +index 8a1fab73b163..f6eb77f7240b 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -315,12 +315,11 @@ static void vc4_crtc_pixelvalve_reset(struct drm_crtc *crtc) @@ -2270,7 +2224,7 @@ index ea0aa8934738..251c2f57eb97 100644 struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); const struct vc4_pv_data *pv_data = vc4_crtc_to_vc4_pv_data(vc4_crtc); -@@ -599,7 +598,7 @@ static void vc4_crtc_atomic_enable(struct drm_crtc *crtc, +@@ -601,7 +600,7 @@ static void vc4_crtc_atomic_enable(struct drm_crtc *crtc, if (vc4_encoder->pre_crtc_configure) vc4_encoder->pre_crtc_configure(encoder, state); @@ -2286,7 +2240,7 @@ index ea0aa8934738..251c2f57eb97 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 21 Jun 2021 16:07:22 +0200 -Subject: [PATCH 0015/1050] drm/vc4: crtc: Rework the encoder retrieval code +Subject: [PATCH 0014/1183] drm/vc4: crtc: Rework the encoder retrieval code (again) It turns out the encoder retrieval code, in addition to being @@ -2308,7 +2262,7 @@ Signed-off-by: Maxime Ripard 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 251c2f57eb97..a75cdd2b3574 100644 +index f6eb77f7240b..93c8993eed64 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -282,26 +282,14 @@ static u32 vc4_crtc_get_fifo_full_level_bits(struct vc4_crtc *vc4_crtc, @@ -2343,7 +2297,7 @@ index 251c2f57eb97..a75cdd2b3574 100644 return NULL; } -@@ -552,8 +540,7 @@ static void vc4_crtc_atomic_disable(struct drm_crtc *crtc, +@@ -554,8 +542,7 @@ static void vc4_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc); struct vc4_crtc_state *old_vc4_state = to_vc4_crtc_state(old_state); @@ -2353,7 +2307,7 @@ index 251c2f57eb97..a75cdd2b3574 100644 struct drm_device *dev = crtc->dev; require_hvs_enabled(dev); -@@ -580,10 +567,11 @@ static void vc4_crtc_atomic_disable(struct drm_crtc *crtc, +@@ -582,10 +569,11 @@ static void vc4_crtc_atomic_disable(struct drm_crtc *crtc, static void vc4_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { @@ -2389,7 +2343,7 @@ index ee2b0909bfd1..044c12c05d8b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 21 Jun 2021 16:13:02 +0200 -Subject: [PATCH 0016/1050] drm/vc4: crtc: Add some logging +Subject: [PATCH 0015/1183] 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 @@ -2403,10 +2357,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index a75cdd2b3574..05d00fd86143 100644 +index 93c8993eed64..38bfd67de323 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -543,6 +543,9 @@ static void vc4_crtc_atomic_disable(struct drm_crtc *crtc, +@@ -545,6 +545,9 @@ static void vc4_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, old_state); struct drm_device *dev = crtc->dev; @@ -2416,7 +2370,7 @@ index a75cdd2b3574..05d00fd86143 100644 require_hvs_enabled(dev); /* Disable vblank irq handling before crtc is disabled. */ -@@ -574,6 +577,9 @@ static void vc4_crtc_atomic_enable(struct drm_crtc *crtc, +@@ -576,6 +579,9 @@ static void vc4_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, new_state); struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); @@ -2433,7 +2387,7 @@ index a75cdd2b3574..05d00fd86143 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 21 Jun 2021 17:19:22 +0200 -Subject: [PATCH 0017/1050] drm/vc4: Leverage the load tracker on the BCM2711 +Subject: [PATCH 0016/1183] 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 @@ -2546,10 +2500,10 @@ index 6030d4a82155..69b710569a84 100644 * disabled through the debugfs load_tracker file. */ diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c -index 19161b6ab27f..ac761c683663 100644 +index 8574acefd40e..906d3f394cfa 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -529,11 +529,6 @@ static void vc4_plane_calc_load(struct drm_plane_state *state) +@@ -525,11 +525,6 @@ static void vc4_plane_calc_load(struct drm_plane_state *state) struct vc4_plane_state *vc4_state; struct drm_crtc_state *crtc_state; unsigned int vscale_factor; @@ -2568,7 +2522,7 @@ index 19161b6ab27f..ac761c683663 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 26 May 2021 16:13:02 +0200 -Subject: [PATCH 0018/1050] drm/vc4: Increase the core clock based on HVS load +Subject: [PATCH 0017/1183] 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 @@ -2585,10 +2539,10 @@ Signed-off-by: Maxime Ripard 3 files changed, 119 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 05d00fd86143..c9b684d36fb2 100644 +index 38bfd67de323..0b4f05451ac5 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -661,12 +661,27 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, +@@ -663,12 +663,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; @@ -2820,7 +2774,7 @@ index 69b710569a84..06a4f765a51c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 19 Aug 2021 15:53:03 +0200 -Subject: [PATCH 0019/1050] drm/vc4: select PM +Subject: [PATCH 0018/1183] drm/vc4: select PM We already depend on runtime PM to get the power domains and clocks for most of the devices supported by the vc4 driver, so let's just select it @@ -2832,10 +2786,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig -index 345a5570a3da..52a1c309cb4a 100644 +index e2c147d4015e..4ed07b7cefe3 100644 --- a/drivers/gpu/drm/vc4/Kconfig +++ b/drivers/gpu/drm/vc4/Kconfig -@@ -9,6 +9,7 @@ config DRM_VC4 +@@ -10,6 +10,7 @@ config DRM_VC4 select DRM_KMS_CMA_HELPER select DRM_GEM_CMA_HELPER select DRM_PANEL_BRIDGE @@ -2850,7 +2804,7 @@ index 345a5570a3da..52a1c309cb4a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 19 Aug 2021 14:37:04 +0200 -Subject: [PATCH 0020/1050] drm/probe-helper: Create a HPD IRQ event helper for +Subject: [PATCH 0019/1183] 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 @@ -3050,7 +3004,7 @@ index 8d3ed2834d34..04c57564c397 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 19 Aug 2021 13:50:12 +0200 -Subject: [PATCH 0021/1050] drm/vc4: hdmi: Actually check for the connector +Subject: [PATCH 0020/1183] drm/vc4: hdmi: Actually check for the connector status in hotplug The drm_helper_hpd_irq_event() documentation states that this function @@ -3092,10 +3046,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index bad5ac56cddf..987d073b206b 100644 +index f0ac2fd99cb1..1863b87adca9 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1793,10 +1793,11 @@ static void vc4_hdmi_audio_exit(struct vc4_hdmi *vc4_hdmi) +@@ -1801,10 +1801,11 @@ static void vc4_hdmi_audio_exit(struct vc4_hdmi *vc4_hdmi) static irqreturn_t vc4_hdmi_hpd_irq_thread(int irq, void *priv) { struct vc4_hdmi *vc4_hdmi = priv; @@ -3116,7 +3070,7 @@ index bad5ac56cddf..987d073b206b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 15 Dec 2021 10:51:14 +0100 -Subject: [PATCH 0022/1050] firmware: raspberrypi: Add +Subject: [PATCH 0021/1183] firmware: raspberrypi: Add RPI_FIRMWARE_NOTIFY_DISPLAY_DONE The RPI_FIRMWARE_NOTIFY_DISPLAY_DONE firmware call allows to tell the @@ -3149,7 +3103,7 @@ index 73ad784fca96..811ea668c4a1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 15 Dec 2021 10:51:16 +0100 -Subject: [PATCH 0023/1050] drm/vc4: Remove conflicting framebuffers before +Subject: [PATCH 0022/1183] drm/vc4: Remove conflicting framebuffers before callind bind_all The bind hooks will modify their controller registers, so simplefb is @@ -3164,10 +3118,10 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20211215095117.176435-4-maxi 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index f6c16c5aee68..3c0c7e77b4c8 100644 +index ef8fa2850ed6..f44e01672abf 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -253,15 +253,15 @@ static int vc4_drm_bind(struct device *dev) +@@ -272,15 +272,15 @@ static int vc4_drm_bind(struct device *dev) if (ret) return ret; @@ -3194,7 +3148,7 @@ index f6c16c5aee68..3c0c7e77b4c8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 15 Dec 2021 10:51:17 +0100 -Subject: [PATCH 0024/1050] drm/vc4: Notify the firmware when DRM is in charge +Subject: [PATCH 0023/1183] 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 @@ -3212,7 +3166,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20211215095117.176435-5-maxi 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 3c0c7e77b4c8..2150637e40dc 100644 +index f44e01672abf..9698fda00e2f 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -37,6 +37,8 @@ @@ -3224,7 +3178,7 @@ index 3c0c7e77b4c8..2150637e40dc 100644 #include "uapi/drm/vc4_drm.h" #include "vc4_drv.h" -@@ -217,6 +219,7 @@ static void vc4_match_add_drivers(struct device *dev, +@@ -226,6 +228,7 @@ static const struct of_device_id vc4_dma_range_matches[] = { static int vc4_drm_bind(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -3232,7 +3186,7 @@ index 3c0c7e77b4c8..2150637e40dc 100644 struct drm_device *drm; struct vc4_dev *vc4; struct device_node *node; -@@ -253,10 +256,29 @@ static int vc4_drm_bind(struct device *dev) +@@ -272,10 +275,29 @@ static int vc4_drm_bind(struct device *dev) if (ret) return ret; @@ -3269,7 +3223,7 @@ index 3c0c7e77b4c8..2150637e40dc 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dan Pasanen Date: Thu, 21 Sep 2017 09:55:42 -0500 -Subject: [PATCH 0025/1050] arm: partially revert +Subject: [PATCH 0024/1183] arm: partially revert 702b94bff3c50542a6e4ab9a4f4cef093262fe65 * Re-expose some dmi APIs for use in VCSM @@ -3380,7 +3334,7 @@ index e21249548e9f..33e4a9b8f1ba 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 29 Oct 2018 14:45:45 +0000 -Subject: [PATCH 0026/1050] Revert "rtc: pcf8523: properly handle oscillator +Subject: [PATCH 0025/1183] Revert "rtc: pcf8523: properly handle oscillator stop bit" This reverts commit ede44c908d44b166a5b6bd7caacd105c2ff5a70f. @@ -3434,7 +3388,7 @@ index 8b6fb20774bf..ad2231f1faac 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 15 Mar 2019 21:11:10 +0000 -Subject: [PATCH 0027/1050] Revert "staging: bcm2835-audio: Drop DT dependency" +Subject: [PATCH 0026/1183] Revert "staging: bcm2835-audio: Drop DT dependency" This reverts commit b7491a9fca2dc2535b9dc922550a37c5baae9d3d. --- @@ -3536,7 +3490,7 @@ index c250fbef2fa3..b42917c25050 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Apr 2020 13:41:10 +0100 -Subject: [PATCH 0028/1050] Revert "spi: spidev: Fix CS polarity if GPIO +Subject: [PATCH 0027/1183] Revert "spi: spidev: Fix CS polarity if GPIO descriptors are used" This reverts commit 83b2a8fe43bda0c11981ad6afa5dd0104d78be28. @@ -3574,7 +3528,7 @@ index 1bd73e322b7b..795bef1efcc6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 1 Mar 2021 09:12:44 +0000 -Subject: [PATCH 0029/1050] Revert "Bluetooth: Always request for user +Subject: [PATCH 0028/1183] Revert "Bluetooth: Always request for user confirmation for Just Works (LE SC)" This reverts commit ffee202a78c2980688bc5d2f7d56480e69a5e0c9. @@ -3625,7 +3579,7 @@ index 11f853d0500f..3efb60918dda 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 1 Mar 2021 09:14:35 +0000 -Subject: [PATCH 0030/1050] Revert "Bluetooth: Always request for user +Subject: [PATCH 0029/1183] Revert "Bluetooth: Always request for user confirmation for Just Works" This reverts commit 92516cd97fd4d8ad5b1421a0d51771044f453a5f. @@ -3674,7 +3628,7 @@ index 3efb60918dda..6f555b3c96a6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 0031/1050] smsx95xx: fix crimes against truesize +Subject: [PATCH 0030/1183] 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. @@ -3686,7 +3640,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 4e39e4345084..e425af15ce60 100644 +index 7cf9206638c3..e1f2051ce189 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -67,6 +67,10 @@ static bool turbo_mode = true; @@ -3700,7 +3654,7 @@ index 4e39e4345084..e425af15ce60 100644 static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data, int in_pm) { -@@ -1838,7 +1842,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) +@@ -1837,7 +1841,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 */ @@ -3710,7 +3664,7 @@ index 4e39e4345084..e425af15ce60 100644 return 1; } -@@ -1856,7 +1861,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) +@@ -1855,7 +1860,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 */ @@ -3727,7 +3681,7 @@ index 4e39e4345084..e425af15ce60 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Sam Nazarko Date: Fri, 1 Apr 2016 17:27:21 +0100 -Subject: [PATCH 0032/1050] smsc95xx: Experimental: Enable turbo_mode and +Subject: [PATCH 0031/1183] smsc95xx: Experimental: Enable turbo_mode and packetsize=2560 by default See: http://forum.kodi.tv/showthread.php?tid=285288 @@ -3736,7 +3690,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 e425af15ce60..cb846a0021ac 100644 +index e1f2051ce189..271740d9f7cc 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -71,6 +71,10 @@ static bool truesize_mode = false; @@ -3750,7 +3704,7 @@ index e425af15ce60..cb846a0021ac 100644 static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data, int in_pm) { -@@ -917,13 +921,13 @@ static int smsc95xx_reset(struct usbnet *dev) +@@ -915,13 +919,13 @@ static int smsc95xx_reset(struct usbnet *dev) if (!turbo_mode) { burst_cap = 0; @@ -3776,7 +3730,7 @@ index e425af15ce60..cb846a0021ac 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 0033/1050] Allow mac address to be set in smsc95xx +Subject: [PATCH 0032/1183] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -3784,7 +3738,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 cb846a0021ac..64ad4f1daee4 100644 +index 271740d9f7cc..7b0d7dc531c0 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -50,6 +50,7 @@ @@ -3806,7 +3760,7 @@ index cb846a0021ac..64ad4f1daee4 100644 static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data, int in_pm) { -@@ -773,6 +778,53 @@ static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) +@@ -771,6 +776,53 @@ static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) return phy_mii_ioctl(netdev->phydev, rq, cmd); } @@ -3860,7 +3814,7 @@ index cb846a0021ac..64ad4f1daee4 100644 static void smsc95xx_init_mac_address(struct usbnet *dev) { /* maybe the boot loader passed the MAC address in devicetree */ -@@ -795,6 +847,10 @@ static void smsc95xx_init_mac_address(struct usbnet *dev) +@@ -793,6 +845,10 @@ static void smsc95xx_init_mac_address(struct usbnet *dev) } } @@ -3878,7 +3832,7 @@ index cb846a0021ac..64ad4f1daee4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 27 Nov 2017 17:14:54 +0000 -Subject: [PATCH 0034/1050] cgroup: Disable cgroup "memory" by default +Subject: [PATCH 0033/1183] 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: @@ -3893,10 +3847,10 @@ Signed-off-by: Phil Elwell 1 file changed, 38 insertions(+) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c -index e7c3b0e586f2..1a64a49cb0fb 100644 +index 4b19f7fc4deb..af770a8606a9 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c -@@ -5833,6 +5833,9 @@ int __init cgroup_init_early(void) +@@ -5875,6 +5875,9 @@ int __init cgroup_init_early(void) return 0; } @@ -3906,7 +3860,7 @@ index e7c3b0e586f2..1a64a49cb0fb 100644 /** * cgroup_init - cgroup initialization * -@@ -5871,6 +5874,12 @@ int __init cgroup_init(void) +@@ -5913,6 +5916,12 @@ int __init cgroup_init(void) mutex_unlock(&cgroup_mutex); @@ -3919,7 +3873,7 @@ index e7c3b0e586f2..1a64a49cb0fb 100644 for_each_subsys(ss, ssid) { if (ss->early_init) { struct cgroup_subsys_state *css = -@@ -6455,6 +6464,10 @@ static int __init cgroup_disable(char *str) +@@ -6503,6 +6512,10 @@ static int __init cgroup_disable(char *str) strcmp(token, ss->legacy_name)) continue; @@ -3930,7 +3884,7 @@ index e7c3b0e586f2..1a64a49cb0fb 100644 static_branch_disable(cgroup_subsys_enabled_key[i]); pr_info("Disabling %s control group subsystem\n", ss->name); -@@ -6473,6 +6486,31 @@ static int __init cgroup_disable(char *str) +@@ -6521,6 +6534,31 @@ static int __init cgroup_disable(char *str) } __setup("cgroup_disable=", cgroup_disable); @@ -3969,7 +3923,7 @@ index e7c3b0e586f2..1a64a49cb0fb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 12:43:36 +0000 -Subject: [PATCH 0035/1050] Protect __release_resource against resources +Subject: [PATCH 0034/1183] Protect __release_resource against resources without parents Without this patch, removing a device tree overlay can crash here. @@ -4003,7 +3957,7 @@ index 20e10e48f052..d40758ec7b9d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:33:30 +0000 -Subject: [PATCH 0036/1050] irq-bcm2836: Avoid "Invalid trigger warning" +Subject: [PATCH 0035/1183] irq-bcm2836: Avoid "Invalid trigger warning" Initialise the level for each IRQ to avoid a warning from the arm arch timer code. @@ -4033,7 +3987,7 @@ index 501facdb4570..b6a7036305d8 100644 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 0037/1050] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 0036/1183] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -4168,7 +4122,7 @@ index adc1556ed332..0ae3b5d4d2de 100644 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 0038/1050] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH 0037/1183] irqchip: irq-bcm2835: Add 2836 FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -4273,7 +4227,7 @@ index 0ae3b5d4d2de..a6ffff76c539 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 0039/1050] spi: spidev: Completely disable the spidev warning +Subject: [PATCH 0038/1183] 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. @@ -4303,7 +4257,7 @@ index 795bef1efcc6..9a3b8a51eaef 100644 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 0040/1050] dmaengine: bcm2835: Load driver early and support +Subject: [PATCH 0039/1183] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -4412,7 +4366,7 @@ index 630dfbb01a40..bf7ba96a39f9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jun 2016 16:48:41 +0100 -Subject: [PATCH 0041/1050] rtc: Add SPI alias for pcf2123 driver +Subject: [PATCH 0040/1183] rtc: Add SPI alias for pcf2123 driver Without this alias, Device Tree won't cause the driver to be loaded. @@ -4438,7 +4392,7 @@ index 7473e6c8a183..4b986b338654 100644 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 0042/1050] watchdog: bcm2835: Support setting reboot partition +Subject: [PATCH 0041/1183] watchdog: bcm2835: Support setting reboot partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -4546,7 +4500,7 @@ index 94907176a0e4..58d5a1b89584 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 Apr 2016 19:40:12 +0100 -Subject: [PATCH 0043/1050] reboot: Use power off rather than busy spinning +Subject: [PATCH 0042/1183] reboot: Use power off rather than busy spinning when halt is requested --- @@ -4575,7 +4529,7 @@ index 3044fcb8d073..fe22c46d9943 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Nov 2016 13:02:52 +0000 -Subject: [PATCH 0044/1050] bcm: Make RASPBERRYPI_POWER depend on PM +Subject: [PATCH 0043/1183] bcm: Make RASPBERRYPI_POWER depend on PM --- drivers/soc/bcm/Kconfig | 1 + @@ -4600,7 +4554,7 @@ index 24f92a6e882a..a6a705ec30c7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Fri, 2 Sep 2016 16:45:27 +0100 -Subject: [PATCH 0045/1050] Register the clocks early during the boot process, +Subject: [PATCH 0044/1183] 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. @@ -4651,7 +4605,7 @@ index 3667b4d731e7..9332379565cb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 6 Dec 2016 17:05:39 +0000 -Subject: [PATCH 0046/1050] bcm2835-rng: Avoid initialising if already enabled +Subject: [PATCH 0045/1183] bcm2835-rng: Avoid initialising if already enabled Avoids the 0x40000 cycles of warmup again if firmware has already used it --- @@ -4682,7 +4636,7 @@ index e7dd457e9b22..f9a4a89e762b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 0047/1050] clk-bcm2835: Mark used PLLs and dividers CRITICAL +Subject: [PATCH 0046/1183] 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 @@ -4716,7 +4670,7 @@ index 9332379565cb..d111f7f4fc81 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 0048/1050] clk-bcm2835: Add claim-clocks property +Subject: [PATCH 0047/1183] 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, @@ -4842,7 +4796,7 @@ index d111f7f4fc81..76bf4c81316e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 6 Mar 2017 09:06:18 +0000 -Subject: [PATCH 0049/1050] clk-bcm2835: Read max core clock from firmware +Subject: [PATCH 0048/1183] 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 @@ -4963,7 +4917,7 @@ index 76bf4c81316e..9b9a799a487d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:36:44 +0000 -Subject: [PATCH 0050/1050] sound: Demote deferral errors to INFO level +Subject: [PATCH 0049/1183] 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. @@ -5004,7 +4958,7 @@ index 5da762807824..ed7ddf3a7198 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Claggy3 Date: Sat, 11 Feb 2017 14:00:30 +0000 -Subject: [PATCH 0051/1050] Update vfpmodule.c +Subject: [PATCH 0050/1183] 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 @@ -5147,7 +5101,7 @@ index 2cb355c1b5b7..1e2dcf81aefa 100644 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 0052/1050] i2c: bcm2835: Add debug support +Subject: [PATCH 0051/1183] i2c: bcm2835: Add debug support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -5342,7 +5296,7 @@ index f72c6576d8a3..394282a37f67 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Jan 2018 16:52:45 +0000 -Subject: [PATCH 0053/1050] irqchip: irq-bcm2836: Remove regmap and syscon use +Subject: [PATCH 0052/1183] 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 @@ -5462,7 +5416,7 @@ index b6a7036305d8..867c3b43490c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Oct 2017 15:04:29 +0100 -Subject: [PATCH 0054/1050] lan78xx: Enable LEDs and auto-negotiation +Subject: [PATCH 0053/1183] 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 @@ -5517,7 +5471,7 @@ index 3e1a83a22fdd..26e0f1678b38 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Feb 2016 17:26:48 +0000 -Subject: [PATCH 0055/1050] amba_pl011: Don't use DT aliases for numbering +Subject: [PATCH 0054/1183] 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 @@ -5552,7 +5506,7 @@ index 300a8bbb4b80..35b9ca5bbae9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:07:39 +0000 -Subject: [PATCH 0056/1050] amba_pl011: Round input clock up +Subject: [PATCH 0055/1183] 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 @@ -5644,7 +5598,7 @@ index 35b9ca5bbae9..310c7fa6baea 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 29 Sep 2017 10:32:19 +0100 -Subject: [PATCH 0057/1050] amba_pl011: Insert mb() for correct FIFO handling +Subject: [PATCH 0056/1183] 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 @@ -5677,7 +5631,7 @@ index 310c7fa6baea..ad0a5e7a8abb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 29 Sep 2017 10:32:19 +0100 -Subject: [PATCH 0058/1050] amba_pl011: Add cts-event-workaround DT property +Subject: [PATCH 0057/1183] 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 @@ -5735,7 +5689,7 @@ index ad0a5e7a8abb..a4cd3d98359a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 29 Jan 2020 09:35:19 +0000 -Subject: [PATCH 0059/1050] tty: amba-pl011: Avoid rare write-when-full error +Subject: [PATCH 0058/1183] 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 @@ -5783,7 +5737,7 @@ index a4cd3d98359a..740389fa601b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 0060/1050] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 0059/1183] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -5829,7 +5783,7 @@ index a2938995c7c1..ce67182de720 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 0061/1050] Main bcm2708/bcm2709 linux port +Subject: [PATCH 0060/1183] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -5991,7 +5945,7 @@ index 86b7ce3549c5..f0c2ad3d59c9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 0062/1050] Add dwc_otg driver +Subject: [PATCH 0061/1183] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -7120,7 +7074,7 @@ index 26f9fb9f67ca..fe8c7a85e141 100644 return i; } diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c -index ac6c5ccfe1cb..75aefadab23a 100644 +index 98bdae4ac314..ad9c7d74c39d 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -5582,7 +5582,7 @@ static void port_event(struct usb_hub *hub, int port1) @@ -67814,7 +67768,7 @@ index 000000000000..cdc9963176e5 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 0063/1050] bcm2708 framebuffer driver +Subject: [PATCH 0062/1183] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -71388,7 +71342,7 @@ index 811ea668c4a1..3b847c9acb5a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Thu, 14 Mar 2019 13:27:54 +0000 -Subject: [PATCH 0064/1050] Pulled in the multi frame buffer support from the +Subject: [PATCH 0063/1183] Pulled in the multi frame buffer support from the Pi3 repo --- @@ -72223,7 +72177,7 @@ index 3b847c9acb5a..e93414410485 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 0065/1050] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 0064/1183] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -72570,7 +72524,7 @@ index 4c14e8be7267..3c6f12b76214 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 0066/1050] Speed up console framebuffer imageblit function +Subject: [PATCH 0065/1183] 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 @@ -72785,7 +72739,7 @@ index a2bb276a8b24..436494fba15a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 0067/1050] dmaengine: Add support for BCM2708 +Subject: [PATCH 0066/1183] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -73439,7 +73393,7 @@ index 000000000000..6ca874d332a8 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 0068/1050] MMC: added alternative MMC driver +Subject: [PATCH 0067/1183] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -73667,7 +73621,7 @@ bcm2835-mmc: uninitialized_var is no more create mode 100644 drivers/mmc/host/bcm2835-mmc.c diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c -index a196116444a3..a992dd6dafc5 100644 +index 3222a9d0c245..64ec07b29de8 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -171,6 +171,13 @@ static DEFINE_MUTEX(open_lock); @@ -75477,7 +75431,7 @@ index 37f975875102..fca1b210266b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 0069/1050] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 0068/1183] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -77989,7 +77943,7 @@ index 000000000000..2c4124082785 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 28 Oct 2016 15:36:43 +0100 -Subject: [PATCH 0070/1050] vc_mem: Add vc_mem driver for querying firmware +Subject: [PATCH 0069/1183] vc_mem: Add vc_mem driver for querying firmware memory addresses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -78498,7 +78452,7 @@ index 000000000000..3c7079237496 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 0071/1050] Add /dev/gpiomem device for rootless user GPIO +Subject: [PATCH 0070/1183] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren @@ -78809,7 +78763,7 @@ index 000000000000..f5e7f1ba8fb6 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 0072/1050] Add SMI driver +Subject: [PATCH 0071/1183] Add SMI driver Signed-off-by: Luke Wren @@ -80746,7 +80700,7 @@ index 000000000000..ee3a75edfc03 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 0073/1050] Add Chris Boot's i2c driver +Subject: [PATCH 0072/1183] Add Chris Boot's i2c driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -81417,7 +81371,7 @@ index 000000000000..962f2e5c7455 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 0074/1050] char: broadcom: Add vcio module +Subject: [PATCH 0073/1183] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -81682,7 +81636,7 @@ index 000000000000..d2598663a2b5 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 0075/1050] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 0074/1183] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -81762,7 +81716,7 @@ index 4b8978b254f9..54619623fe86 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 0076/1050] BCM2708: Add core Device Tree support +Subject: [PATCH 0075/1183] BCM2708: Add core Device Tree support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -82559,7 +82513,7 @@ Signed-off-by: Phil Elwell create mode 120000 arch/arm64/boot/dts/overlays diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index 27ca1ca6e827..ab6a5c6ea5ee 100644 +index 7a72fc636a7a..1d4daf4b836f 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -1,4 +1,11 @@ @@ -82574,7 +82528,7 @@ index 27ca1ca6e827..ab6a5c6ea5ee 100644 dtb-$(CONFIG_ARCH_ALPINE) += \ alpine-db.dtb dtb-$(CONFIG_MACH_ARTPEC6) += \ -@@ -1499,3 +1506,13 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ +@@ -1500,3 +1507,13 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-portwell-neptune.dtb \ aspeed-bmc-quanta-q71l.dtb \ aspeed-bmc-supermicro-x11spi.dtb @@ -111941,7 +111895,7 @@ index 0a8a4689c3eb..dff7d1ef5ff4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 0077/1050] leds: Add the "input" trigger, for pwr_led +Subject: [PATCH 0076/1183] leds: Add the "input" trigger, for pwr_led The "input" trigger makes the associated GPIO an input. This is to support the Raspberry Pi PWR LED, which is driven by external hardware in normal use. @@ -112124,7 +112078,7 @@ index a0b730be40ad..cb9a65b4b0f4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:54:08 +0100 -Subject: [PATCH 0078/1050] Added Device IDs for August DVB-T 205 +Subject: [PATCH 0077/1183] Added Device IDs for August DVB-T 205 --- drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 4 ++++ @@ -112152,7 +112106,7 @@ index 795a012d4020..adb1028d5f25 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Nov 2016 16:50:04 +0000 -Subject: [PATCH 0079/1050] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 0078/1183] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -113775,7 +113729,7 @@ index d802ded21ed6..a77c495f8378 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 0080/1050] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 0079/1183] 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 @@ -113816,7 +113770,7 @@ index 1c5af2fef142..3e670131f2a8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 0081/1050] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH 0080/1183] mfd: Add Raspberry Pi Sense HAT core driver mfd: Add rpi_sense_core of compatible string --- @@ -114701,7 +114655,7 @@ index 000000000000..56196dc2af10 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 25 Jan 2016 15:48:59 +0000 -Subject: [PATCH 0082/1050] Add support for all the downstream rpi sound card +Subject: [PATCH 0081/1183] Add support for all the downstream rpi sound card drivers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -131696,7 +131650,7 @@ index ed7ddf3a7198..4ed5645704d7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 0083/1050] rpi_display: add backlight driver and overlay +Subject: [PATCH 0082/1183] 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 @@ -131879,7 +131833,7 @@ index 000000000000..14a0d9b03739 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Feb 2016 19:56:04 +0000 -Subject: [PATCH 0084/1050] bcm2835-virtgpio: Virtual GPIO driver +Subject: [PATCH 0083/1183] bcm2835-virtgpio: Virtual GPIO driver Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. @@ -132146,7 +132100,7 @@ index 000000000000..49e28ad9760e From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH 0085/1050] OF: DT-Overlay configfs interface +Subject: [PATCH 0084/1183] 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. @@ -132587,7 +132541,7 @@ index 000000000000..178f0629b0f0 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Cheong2K Date: Fri, 26 Feb 2016 18:20:10 +0800 -Subject: [PATCH 0086/1050] brcm: adds support for BCM43341 wifi +Subject: [PATCH 0085/1183] brcm: adds support for BCM43341 wifi brcmfmac: Disable power management @@ -132699,7 +132653,7 @@ index f7961b22e051..73db8489a8a9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Dec 2015 13:37:07 +0000 -Subject: [PATCH 0087/1050] hci_h5: Don't send conf_req when ACTIVE +Subject: [PATCH 0086/1183] 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. @@ -132728,7 +132682,7 @@ index e0ea9d25bb39..c43911488880 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 0088/1050] config: Add default configs +Subject: [PATCH 0087/1183] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1445 +++++++++++++++++++++++++ @@ -139998,7 +139952,7 @@ index 000000000000..235fecf9c903 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:43:57 -0800 -Subject: [PATCH 0089/1050] ARM64: Round-Robin dispatch IRQs between CPUs. +Subject: [PATCH 0088/1183] 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 @@ -140078,7 +140032,7 @@ index 867c3b43490c..f9da3f2a5f01 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 11 Feb 2017 01:18:31 -0800 -Subject: [PATCH 0090/1050] ARM64: Force hardware emulation of deprecated +Subject: [PATCH 0089/1183] ARM64: Force hardware emulation of deprecated instructions. --- @@ -140086,10 +140040,10 @@ Subject: [PATCH 0090/1050] ARM64: Force hardware emulation of deprecated 1 file changed, 5 insertions(+) diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c -index 0e86e8b9cedd..62078b06feb1 100644 +index c5da9d1e954a..cf34ae0755db 100644 --- a/arch/arm64/kernel/armv8_deprecated.c +++ b/arch/arm64/kernel/armv8_deprecated.c -@@ -182,10 +182,15 @@ static void __init register_insn_emulation(struct insn_emulation_ops *ops) +@@ -183,10 +183,15 @@ static void __init register_insn_emulation(struct insn_emulation_ops *ops) switch (ops->status) { case INSN_DEPRECATED: @@ -140112,7 +140066,7 @@ index 0e86e8b9cedd..62078b06feb1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 25 Aug 2017 19:18:13 +0100 -Subject: [PATCH 0091/1050] cache: export clean and invalidate +Subject: [PATCH 0090/1183] cache: export clean and invalidate hack: cache: Fix linker error --- @@ -140173,7 +140127,7 @@ index 830bbfb26ca5..097248743b4c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Tue, 14 Nov 2017 15:13:15 +0000 -Subject: [PATCH 0092/1050] AXI performance monitor driver (#2222) +Subject: [PATCH 0091/1183] AXI performance monitor driver (#2222) Uses the debugfs I/F to provide access to the AXI bus performance monitors. @@ -140875,7 +140829,7 @@ index 000000000000..5ae2bdaa88b4 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 0093/1050] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 0092/1183] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -140944,7 +140898,7 @@ index bfc556f76720..73ec2427fbcf 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 16 Jul 2018 14:40:13 +0100 -Subject: [PATCH 0094/1050] dwc-otg: FIQ: Fix "bad mode in data abort handler" +Subject: [PATCH 0093/1183] 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 @@ -141066,7 +141020,7 @@ index 73ec2427fbcf..9b6c921106b5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 Dec 2017 09:18:32 +0000 -Subject: [PATCH 0095/1050] ARM: Activate FIQs to avoid __irq_startup warnings +Subject: [PATCH 0094/1183] 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. @@ -141108,7 +141062,7 @@ index 98ca3e3fa847..c3fe7d3cf482 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 20 Feb 2018 10:07:27 +0000 -Subject: [PATCH 0096/1050] i2c-gpio: Also set bus numbers from reg property +Subject: [PATCH 0095/1183] 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 @@ -141149,7 +141103,7 @@ index 7a048abbf92b..08ad370c9881 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: hdoverobinson Date: Tue, 13 Mar 2018 06:58:39 -0400 -Subject: [PATCH 0097/1050] added capture_clear option to pps-gpio via +Subject: [PATCH 0096/1183] added capture_clear option to pps-gpio via dtoverlay (#2433) --- @@ -141177,7 +141131,7 @@ index 2f4b11b4dfcd..b10b43538542 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 9 Mar 2018 12:01:00 +0000 -Subject: [PATCH 0098/1050] lan78xx: Read initial EEE status from DT +Subject: [PATCH 0097/1183] lan78xx: Read initial EEE status from DT Add two new DT properties: * microchip,eee-enabled - a boolean to enable EEE @@ -141223,7 +141177,7 @@ index 26e0f1678b38..e56ec891ed53 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 0099/1050] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 0098/1183] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -141261,7 +141215,7 @@ index 2dcaf31eb9cd..8a9d8214d8af 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nick Bulleid Date: Thu, 10 May 2018 21:57:02 +0100 -Subject: [PATCH 0100/1050] Add ability to export gpio used by gpio-poweroff +Subject: [PATCH 0099/1183] Add ability to export gpio used by gpio-poweroff Signed-off-by: Nick Bulleid @@ -141326,7 +141280,7 @@ index 3e670131f2a8..e5dca66360a7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 12 May 2018 21:35:43 +0100 -Subject: [PATCH 0101/1050] firmware/raspberrypi: Notify firmware of a reboot +Subject: [PATCH 0100/1183] firmware/raspberrypi: Notify firmware of a reboot Register for reboot notifications, sending RPI_FIRMWARE_NOTIFY_REBOOT over the mailbox interface on reception. @@ -141416,7 +141370,7 @@ index 54619623fe86..48d724aba308 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 14 Jun 2018 11:21:04 +0100 -Subject: [PATCH 0102/1050] irqchip: irq-bcm2835: Calc. FIQ_START at boot-time +Subject: [PATCH 0101/1183] 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 @@ -141488,7 +141442,7 @@ index 8950debf451b..7ed1b1fc642d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 14 Jun 2018 15:07:26 +0100 -Subject: [PATCH 0103/1050] of: configfs: Use of_overlay_fdt_apply API call +Subject: [PATCH 0102/1183] 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 @@ -141608,7 +141562,7 @@ index 178f0629b0f0..ac04301dabe1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 13 Jun 2018 15:21:10 +0100 -Subject: [PATCH 0104/1050] net: lan78xx: Disable TCP Segmentation Offload +Subject: [PATCH 0103/1183] net: lan78xx: Disable TCP Segmentation Offload (TSO) TSO seems to be having issues when packets are dropped and the @@ -141671,7 +141625,7 @@ index e56ec891ed53..cb940eeebcf4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 20 Jun 2018 12:20:01 +0100 -Subject: [PATCH 0105/1050] brcmfmac: Re-enable firmware roaming support +Subject: [PATCH 0104/1183] 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 @@ -141706,7 +141660,7 @@ index 591dcd04b4b4..e3758bd86acf 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 5 Apr 2018 14:46:11 +0100 -Subject: [PATCH 0106/1050] lan78xx: Move enabling of EEE into PHY init code +Subject: [PATCH 0105/1183] 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 @@ -141776,7 +141730,7 @@ index cb940eeebcf4..89ecb0ce8685 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 17 Sep 2018 17:31:18 +0100 -Subject: [PATCH 0107/1050] cxd2880: CXD2880_SPI_DRV should select DVB_CXD2880 +Subject: [PATCH 0106/1183] cxd2880: CXD2880_SPI_DRV should select DVB_CXD2880 with MEDIA_SUBDRV_AUTOSELECT --- @@ -141802,7 +141756,7 @@ index 857ef4ace6e9..deae75ea3c44 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sat, 13 Oct 2018 13:31:21 +0200 -Subject: [PATCH 0108/1050] firmware: raspberrypi: Add backward compatible +Subject: [PATCH 0107/1183] firmware: raspberrypi: Add backward compatible get_throttled Avoid a hard userspace ABI change by adding a compatible get_throttled @@ -141887,7 +141841,7 @@ index 48d724aba308..2a9edea7f0f1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 6 Nov 2018 12:57:48 +0000 -Subject: [PATCH 0109/1050] sc16is7xx: Don't spin if no data received +Subject: [PATCH 0108/1183] sc16is7xx: Don't spin if no data received See: https://github.com/raspberrypi/linux/issues/2676 @@ -141916,7 +141870,7 @@ index 0ab788058fa2..a7b40ee6b94d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Ram Chandrasekar Date: Mon, 7 May 2018 11:54:08 -0600 -Subject: [PATCH 0110/1050] drivers: thermal: step_wise: add support for +Subject: [PATCH 0109/1183] drivers: thermal: step_wise: add support for hysteresis Step wise governor increases the mitigation level when the temperature @@ -142011,7 +141965,7 @@ index 12acb12aac50..9c8d615f3b63 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Tue, 2 Oct 2018 11:14:15 +0100 -Subject: [PATCH 0111/1050] drivers: thermal: step_wise: avoid throttling at +Subject: [PATCH 0110/1183] drivers: thermal: step_wise: avoid throttling at hysteresis temperature after dropping below it Signed-off-by: Serge Schneider @@ -142039,7 +141993,7 @@ index 9c8d615f3b63..629f02fce2f2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Fri, 2 Nov 2018 11:55:49 +0000 -Subject: [PATCH 0112/1050] Update issue templates (#2736) +Subject: [PATCH 0111/1183] Update issue templates (#2736) --- .github/ISSUE_TEMPLATE/bug_report.md | 34 ++++++++++++++++++++++++++++ @@ -142093,7 +142047,7 @@ index 000000000000..09bdc4a96838 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Nov 2018 19:46:58 +0000 -Subject: [PATCH 0113/1050] net: lan78xx: Support auto-downshift to 100Mb/s +Subject: [PATCH 0112/1183] 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 @@ -142194,7 +142148,7 @@ index 517288da19fd..626c450d71f4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 10 Jan 2019 17:58:06 +0000 -Subject: [PATCH 0114/1050] firmware: raspberrypi: Report the fw variant during +Subject: [PATCH 0113/1183] firmware: raspberrypi: Report the fw variant during probe The driver already reported the firmware build date during probe. @@ -142303,7 +142257,7 @@ index e93414410485..119141c91bad 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joshua Emele Date: Wed, 7 Nov 2018 16:07:40 -0800 -Subject: [PATCH 0115/1050] lan78xx: Debounce link events to minimize poll +Subject: [PATCH 0114/1183] lan78xx: Debounce link events to minimize poll storm The bInterval is set to 4 (i.e. 8 microframes => 1ms) and the only bit @@ -142355,7 +142309,7 @@ index 89ecb0ce8685..28eb51919c46 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 5 Mar 2019 09:51:22 +0000 -Subject: [PATCH 0116/1050] lan78xx: EEE support is now a PHY property +Subject: [PATCH 0115/1183] 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. @@ -142387,7 +142341,7 @@ index 28eb51919c46..865240711576 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 20 Jul 2018 22:03:41 +0100 -Subject: [PATCH 0117/1050] bcm2835-dma: Add support for per-channel flags +Subject: [PATCH 0116/1183] 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 @@ -142441,7 +142395,7 @@ index bf7ba96a39f9..87b5d0bef355 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Fri, 29 Mar 2019 10:53:14 +0000 -Subject: [PATCH 0118/1050] rtc: rv3028: Add backup switchover mode support +Subject: [PATCH 0117/1183] rtc: rv3028: Add backup switchover mode support Signed-off-by: Phil Howard --- @@ -142497,7 +142451,7 @@ index 12c807306893..757c0ff82bdb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: P33M Date: Thu, 2 May 2019 11:53:45 +0100 -Subject: [PATCH 0119/1050] lan78xx: use default alignment for rx buffers +Subject: [PATCH 0118/1183] 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 @@ -142526,7 +142480,7 @@ index 865240711576..0cf3f00b52ff 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:56:59 +0000 -Subject: [PATCH 0120/1050] media: tc358743: Increase FIFO level to 374. +Subject: [PATCH 0119/1183] 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 @@ -142563,7 +142517,7 @@ index 3205cd8298dd..ae879e0835ff 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Thu, 21 Sep 2017 17:30:24 +0200 -Subject: [PATCH 0121/1050] media: tc358743: fix connected/active CSI-2 lane +Subject: [PATCH 0120/1183] media: tc358743: fix connected/active CSI-2 lane reporting g_mbus_config was supposed to indicate all supported lane numbers, not @@ -142645,7 +142599,7 @@ index 841e190aedd9..80a641840071 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:57:21 +0000 -Subject: [PATCH 0122/1050] media: tc358743: Add support for 972Mbit/s link +Subject: [PATCH 0121/1183] media: tc358743: Add support for 972Mbit/s link freq. Adds register setups for running the CSI lanes at 972Mbit/s, @@ -142731,7 +142685,7 @@ index 1f4d78b147bb..d5c6e1f0d8bd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:57:34 +0000 -Subject: [PATCH 0123/1050] media: tc358743: Check I2C succeeded during probe. +Subject: [PATCH 0122/1183] 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. @@ -142835,7 +142789,7 @@ index d5c6e1f0d8bd..80e7afe88a8c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:57:46 +0000 -Subject: [PATCH 0124/1050] media: adv7180: Default to the first valid input +Subject: [PATCH 0123/1183] media: adv7180: Default to the first valid input The hardware default is differential CVBS on AIN1 & 2, which isn't very useful. @@ -142886,7 +142840,7 @@ index d9a99fcfacb1..b0c3635eab71 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:57:56 +0000 -Subject: [PATCH 0125/1050] media: adv7180: Add YPrPb support for ADV7282M +Subject: [PATCH 0124/1183] 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 @@ -142916,7 +142870,7 @@ index b0c3635eab71..725d52f8c742 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:58:08 +0000 -Subject: [PATCH 0126/1050] media: videodev2: Add helper defines for printing +Subject: [PATCH 0125/1183] media: videodev2: Add helper defines for printing FOURCCs New helper defines that allow printing of a FOURCC using @@ -142950,7 +142904,7 @@ index 9260791b8438..fba99eb8eeee 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:59:06 +0000 -Subject: [PATCH 0127/1050] dt-bindings: Document BCM283x CSI2/CCP2 receiver +Subject: [PATCH 0126/1183] dt-bindings: Document BCM283x CSI2/CCP2 receiver Document the DT bindings for the CSI2/CCP2 receiver peripheral (known as Unicam) on BCM283x SoCs. @@ -143060,7 +143014,7 @@ index 000000000000..7714fb374b34 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 31 Oct 2018 14:59:40 +0000 -Subject: [PATCH 0128/1050] MAINTAINERS: Add entry for BCM2835 Unicam driver +Subject: [PATCH 0127/1183] MAINTAINERS: Add entry for BCM2835 Unicam driver Adds entry for the new BCM2835 Unicam (CSI-2 receiver) driver @@ -143094,7 +143048,7 @@ index edc32575828b..44897643a19c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 22 Nov 2018 17:31:06 +0000 -Subject: [PATCH 0129/1050] media: tc358743: Return an appropriate colorspace +Subject: [PATCH 0128/1183] media: tc358743: Return an appropriate colorspace from tc358743_set_fmt When calling tc358743_set_fmt, the code was calling tc358743_get_fmt @@ -143198,7 +143152,7 @@ index 80e7afe88a8c..69f2d676448e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 29 Oct 2018 16:20:46 +0000 -Subject: [PATCH 0130/1050] staging: mmal-vchiq: Avoid use of bool in +Subject: [PATCH 0129/1183] staging: mmal-vchiq: Avoid use of bool in structures Fixes up a checkpatch error "Avoid using bool structure members @@ -143229,7 +143183,7 @@ index 76d3f0399964..61b9c09144b1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 24 Sep 2018 18:15:38 +0100 -Subject: [PATCH 0131/1050] staging: mmal-vchiq: Add support for event +Subject: [PATCH 0130/1183] staging: mmal-vchiq: Add support for event callbacks. (Preparation for the codec driver). @@ -143598,7 +143552,7 @@ index 1dc81ecf9268..e87f88f99338 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 24 Sep 2018 18:26:02 +0100 -Subject: [PATCH 0132/1050] staging: vc04_services: Support sending data to +Subject: [PATCH 0131/1183] staging: vc04_services: Support sending data to MMAL ports Add the ability to send data to ports. This only supports @@ -143646,7 +143600,7 @@ index e78858d24c4e..2fbb813c27f1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 29 Oct 2018 17:57:45 +0000 -Subject: [PATCH 0133/1050] media: videobuf2: Allow exporting of a struct +Subject: [PATCH 0132/1183] media: videobuf2: Allow exporting of a struct dmabuf videobuf2 only allowed exporting a dmabuf as a file descriptor, @@ -143738,7 +143692,7 @@ index 3b5986cee073..4b72d0e16ee3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 22 Jan 2019 12:04:09 +0000 -Subject: [PATCH 0134/1050] staging: mmal-vchiq: Fix client_component for 64 +Subject: [PATCH 0133/1183] staging: mmal-vchiq: Fix client_component for 64 bit kernel The MMAL client_component field is used with the event @@ -143779,7 +143733,7 @@ index 2fbb813c27f1..d6d98b20c76a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 24 Jan 2019 15:09:28 +0000 -Subject: [PATCH 0135/1050] clk: clk-bcm2835: Use %zd when printing size_t +Subject: [PATCH 0134/1183] 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". @@ -143809,7 +143763,7 @@ index 9b9a799a487d..44f1c05fce85 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 13 Feb 2019 12:33:29 +0000 -Subject: [PATCH 0136/1050] staging: mmal_vchiq: Add in the Bayer encoding +Subject: [PATCH 0135/1183] staging: mmal_vchiq: Add in the Bayer encoding formats The list of formats was copied before Bayer support was added. @@ -143866,7 +143820,7 @@ index 2be9941a1f30..44ba91aa6d47 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 18 Feb 2019 15:52:29 +0000 -Subject: [PATCH 0137/1050] staging: mmal-vchiq: Update mmal_parameters.h with +Subject: [PATCH 0136/1183] staging: mmal-vchiq: Update mmal_parameters.h with recently defined params mmal_parameters.h hasn't been updated to reflect additions made @@ -143928,7 +143882,7 @@ index a1e39b1b1701..1793103b18fd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 1 May 2019 13:27:23 +0100 -Subject: [PATCH 0138/1050] staging: mmal-vchiq: Free the event context for +Subject: [PATCH 0137/1183] staging: mmal-vchiq: Free the event context for control ports vchiq_mmal_component_init calls init_event_context for the @@ -143962,7 +143916,7 @@ index d6d98b20c76a..b4893e08f54a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 2 May 2019 15:50:01 +0100 -Subject: [PATCH 0139/1050] staging: mmal-vchiq: Fix memory leak in error path +Subject: [PATCH 0138/1183] staging: mmal-vchiq: Fix memory leak in error path On error, vchiq_mmal_component_init could leave the event context allocated for ports. @@ -144044,7 +143998,7 @@ index b4893e08f54a..38303b030156 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 12 Jun 2019 17:15:05 +0100 -Subject: [PATCH 0140/1050] w1: w1-gpio: Make GPIO an output for strong pullup +Subject: [PATCH 0139/1183] 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 @@ -144077,7 +144031,7 @@ index d4632aace402..4832cd8c2596 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 20 Feb 2019 08:49:39 +0000 -Subject: [PATCH 0141/1050] arm: bcm2835: Fix FIQ early ioremap +Subject: [PATCH 0140/1183] arm: bcm2835: Fix FIQ early ioremap The ioremapping creates mappings within the vmalloc area. The equivalent early function, create_mapping, now checks that the @@ -144156,7 +144110,7 @@ index 9b6c921106b5..9bd9842da59f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 29 May 2019 15:47:42 +0100 -Subject: [PATCH 0142/1050] arm: bcm2835: DMA can only address 1GB +Subject: [PATCH 0141/1183] 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. @@ -144187,7 +144141,7 @@ index 9bd9842da59f..7d59a9364175 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sat, 4 May 2019 17:06:15 +0200 -Subject: [PATCH 0143/1050] hwrng: iproc-rng200: Add BCM2838 support +Subject: [PATCH 0142/1183] 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. @@ -144348,7 +144302,7 @@ index a43743887db1..f689cd63deae 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Wed, 12 Sep 2018 14:44:53 +0100 -Subject: [PATCH 0144/1050] bcmgenet: constrain max DMA burst length +Subject: [PATCH 0143/1183] bcmgenet: constrain max DMA burst length --- drivers/net/ethernet/broadcom/genet/bcmgenet.h | 2 +- @@ -144374,7 +144328,7 @@ index 0a6d91b0f0aa..5e653f21aeb9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 27 Mar 2019 13:45:46 +0000 -Subject: [PATCH 0145/1050] bcmgenet: Better coalescing parameter defaults +Subject: [PATCH 0144/1183] bcmgenet: Better coalescing parameter defaults Set defaults for TX and RX packet coalescing to be equivalent to: @@ -144423,7 +144377,7 @@ index ea1391753752..2b5d47a06c7b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 14 May 2019 17:17:59 +0100 -Subject: [PATCH 0146/1050] net: genet: enable link energy detect powerdown for +Subject: [PATCH 0145/1183] net: genet: enable link energy detect powerdown for external PHYs There are several warts surrounding bcmgenet_mii_probe() as this @@ -144441,7 +144395,7 @@ Signed-off-by: Jonathan Bell 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c -index 89d16c587bb7..817cd0042e30 100644 +index dbd2ede53f94..2956e3888397 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c @@ -293,6 +293,8 @@ int bcmgenet_mii_probe(struct net_device *dev) @@ -144460,7 +144414,7 @@ index 89d16c587bb7..817cd0042e30 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Mon, 13 May 2019 11:05:27 +0000 -Subject: [PATCH 0147/1050] spi: bcm2835: enable shared interrupt support +Subject: [PATCH 0146/1183] spi: bcm2835: enable shared interrupt support Add shared interrupt support for this driver. @@ -144501,7 +144455,7 @@ index 0933948d7df3..2a0cab8435b0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Jan 2019 16:11:50 +0000 -Subject: [PATCH 0148/1050] clk-bcm2835: Don't wait for pllh lock +Subject: [PATCH 0147/1183] clk-bcm2835: Don't wait for pllh lock Signed-off-by: Phil Elwell --- @@ -144545,7 +144499,7 @@ index 44f1c05fce85..8d624034ecbf 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 11 Jan 2019 17:31:07 -0800 -Subject: [PATCH 0149/1050] soc: bcm: bcm2835-pm: Add support for 2711. +Subject: [PATCH 0148/1183] 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 @@ -144657,7 +144611,7 @@ index ed37dc40e82a..b2d157091e12 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 May 2019 15:11:05 -0700 -Subject: [PATCH 0150/1050] clk: bcm2835: Add support for setting leaf clock +Subject: [PATCH 0149/1183] 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 @@ -144716,7 +144670,7 @@ index 8d624034ecbf..bfeb6cac0393 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 May 2019 15:24:04 -0700 -Subject: [PATCH 0151/1050] clk: bcm2835: Allow reparenting leaf clocks while +Subject: [PATCH 0150/1183] clk: bcm2835: Allow reparenting leaf clocks while they're running. This falls under the same "we can reprogram glitch-free as long as we @@ -144793,7 +144747,7 @@ index bfeb6cac0393..857a8e16d014 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 11 Jun 2019 10:55:00 +0100 -Subject: [PATCH 0152/1050] usb: add plumbing for updating interrupt endpoint +Subject: [PATCH 0151/1183] usb: add plumbing for updating interrupt endpoint interval state xHCI caches device and endpoint data after the interface is configured, @@ -144818,10 +144772,10 @@ 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 9e28d715fa3b..c32babfc8af5 100644 +index 6c5934dbe9b3..504476aa43cc 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c -@@ -1969,6 +1969,16 @@ int usb_hcd_alloc_bandwidth(struct usb_device *udev, +@@ -1972,6 +1972,16 @@ int usb_hcd_alloc_bandwidth(struct usb_device *udev, return ret; } @@ -144865,10 +144819,10 @@ index 7a32053e941f..e8045997d6ec 100644 * usb_disable_endpoint -- Disable an endpoint by address * @dev: the device whose endpoint is being disabled diff --git a/include/linux/usb.h b/include/linux/usb.h -index 7ccaa76a9a96..77d9a69534f0 100644 +index da1329b85329..5d15720c405c 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h -@@ -1840,6 +1840,8 @@ extern int usb_clear_halt(struct usb_device *dev, int pipe); +@@ -1842,6 +1842,8 @@ extern int usb_clear_halt(struct usb_device *dev, int pipe); extern int usb_reset_configuration(struct usb_device *dev); extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate); extern void usb_reset_endpoint(struct usb_device *dev, unsigned int epaddr); @@ -144878,10 +144832,10 @@ index 7ccaa76a9a96..77d9a69534f0 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 2c1fc9212cf2..2a0d491f2ce3 100644 +index 98d1921f02b1..cfa04bbe55a9 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h -@@ -384,6 +384,11 @@ struct hc_driver { +@@ -385,6 +385,11 @@ struct hc_driver { * or bandwidth constraints. */ void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); @@ -144893,7 +144847,7 @@ index 2c1fc9212cf2..2a0d491f2ce3 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 */ -@@ -448,6 +453,8 @@ extern void usb_hcd_unmap_urb_setup_for_dma(struct usb_hcd *, struct urb *); +@@ -449,6 +454,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); @@ -144909,7 +144863,7 @@ index 2c1fc9212cf2..2a0d491f2ce3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 11 Jun 2019 11:33:39 +0100 -Subject: [PATCH 0153/1050] xhci: implement xhci_fixup_endpoint for interval +Subject: [PATCH 0152/1183] xhci: implement xhci_fixup_endpoint for interval adjustments Must be called in a non-atomic context, after the endpoint @@ -144922,10 +144876,10 @@ Signed-off-by: Jonathan Bell 1 file changed, 104 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index d76c10f9ad80..e274674ff1d6 100644 +index 3cac7e40456e..2aeca990dae0 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -1619,6 +1619,109 @@ static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id, +@@ -1610,6 +1610,109 @@ static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id, return ret; } @@ -145035,7 +144989,7 @@ index d76c10f9ad80..e274674ff1d6 100644 /* * non-error returns are a promise to giveback() the urb later * we drop ownership so next owner (or urb unlink) can get it -@@ -5445,6 +5548,7 @@ static const struct hc_driver xhci_hc_driver = { +@@ -5436,6 +5539,7 @@ static const struct hc_driver xhci_hc_driver = { .endpoint_reset = xhci_endpoint_reset, .check_bandwidth = xhci_check_bandwidth, .reset_bandwidth = xhci_reset_bandwidth, @@ -145050,7 +145004,7 @@ index d76c10f9ad80..e274674ff1d6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 11 Jun 2019 11:42:03 +0100 -Subject: [PATCH 0154/1050] usbhid: call usb_fixup_endpoint after mangling +Subject: [PATCH 0153/1183] usbhid: call usb_fixup_endpoint after mangling intervals Lets the mousepoll override mechanism work with xhci. @@ -145079,7 +145033,7 @@ index 8a9d8214d8af..3541229ef9dc 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 11 Jun 2019 17:38:28 +0100 -Subject: [PATCH 0155/1050] arm: bcm2835: Add bcm2838 compatible string. +Subject: [PATCH 0154/1183] arm: bcm2835: Add bcm2838 compatible string. Signed-off-by: Phil Elwell --- @@ -145105,7 +145059,7 @@ index 7d59a9364175..282a023027fc 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Oct 2018 17:22:43 -0700 -Subject: [PATCH 0156/1050] drm/v3d: Add support for 2711. +Subject: [PATCH 0155/1183] drm/v3d: Add support for 2711. Signed-off-by: Eric Anholt --- @@ -145131,7 +145085,7 @@ index 6407a006d6ec..daf7f8b75fa5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 14 Jan 2019 12:35:43 -0800 -Subject: [PATCH 0157/1050] drm/v3d: Skip MMU flush if the device is currently +Subject: [PATCH 0156/1183] 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 @@ -145189,7 +145143,7 @@ index 5a453532901f..8986e7b96461 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 14 Jan 2019 14:47:57 -0800 -Subject: [PATCH 0158/1050] drm/v3d: Hook up the runtime PM ops. +Subject: [PATCH 0157/1183] 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 @@ -145263,7 +145217,7 @@ index daf7f8b75fa5..e573e67031a5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 12 Jul 2019 15:38:35 +0100 -Subject: [PATCH 0159/1050] i2c: bcm2835: Set clock-stretch timeout to 35ms +Subject: [PATCH 0158/1183] 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 @@ -145316,7 +145270,7 @@ index 394282a37f67..d768247c7e50 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 6 Aug 2019 15:23:14 +0100 -Subject: [PATCH 0160/1050] clk-bcm2835: Avoid null pointer exception +Subject: [PATCH 0159/1183] clk-bcm2835: Avoid null pointer exception clk_desc_array[BCM2835_PLLB] doesn't exist so we dereference null when iterating @@ -145351,7 +145305,7 @@ index 857a8e16d014..fe005f9dbe02 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 14 Jan 2019 15:13:17 -0800 -Subject: [PATCH 0161/1050] drm/v3d: HACK: gut runtime pm for now. +Subject: [PATCH 0160/1183] 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 @@ -145468,7 +145422,7 @@ index e573e67031a5..b8f3d12d9d96 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 May 2019 13:22:53 -0700 -Subject: [PATCH 0162/1050] drm/v3d: Clock V3D down when not in use. +Subject: [PATCH 0161/1183] 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. @@ -145639,7 +145593,7 @@ index 805d6f6cba0e..fd4aa45054b5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Thu, 9 May 2019 14:30:37 +0100 -Subject: [PATCH 0163/1050] drivers: char: add chardev for mmap'ing the RPiVid +Subject: [PATCH 0162/1183] drivers: char: add chardev for mmap'ing the RPiVid control registers Based on the gpiomem driver, allow mapping of the decoder register @@ -146097,7 +146051,7 @@ index b2d157091e12..f70a810c55f7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Thu, 1 Aug 2019 16:41:20 +0100 -Subject: [PATCH 0164/1050] hid: usb: Add device quirks for Freeway Airmouse T3 +Subject: [PATCH 0163/1183] hid: usb: Add device quirks for Freeway Airmouse T3 and MX3 These wireless mouse/keyboard combo remote control devices specify @@ -146118,7 +146072,7 @@ Signed-off-by: Jonathan Bell 2 files changed, 8 insertions(+) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h -index 42b5b050b72d..b6f8f840f47c 100644 +index cb2b48d6915e..b6e5cdb5eb5e 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -225,6 +225,9 @@ @@ -146131,7 +146085,7 @@ index 42b5b050b72d..b6f8f840f47c 100644 #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1306,6 +1309,9 @@ +@@ -1308,6 +1311,9 @@ #define USB_VENDOR_ID_XAT 0x2505 #define USB_DEVICE_ID_XAT_CSR 0x0220 @@ -146168,7 +146122,7 @@ index 544d1197aca4..4b5975950f1c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Tue, 16 Jul 2019 12:18:21 +0100 -Subject: [PATCH 0165/1050] Add HDMI1 facility to the driver. +Subject: [PATCH 0164/1183] 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 @@ -146261,7 +146215,7 @@ index 51066ac8eea5..b42a2fb12248 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 9 Aug 2019 08:51:43 +0100 -Subject: [PATCH 0166/1050] net: bcmgenet: Workaround #2 for Pi4 Ethernet fail +Subject: [PATCH 0165/1183] 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 @@ -146318,7 +146272,7 @@ index 2b5d47a06c7b..5feba08c2dce 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 13 Aug 2019 15:53:29 +0100 -Subject: [PATCH 0167/1050] xhci: Use more event ring segment table entries +Subject: [PATCH 0166/1183] 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 @@ -146365,7 +146319,7 @@ index b398d3fdabf6..d85554139d99 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 79fa34f1e31c..0a0cc4373b02 100644 +index 10a4230d95c3..fe616761837a 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1673,8 +1673,8 @@ struct urb_priv { @@ -146386,7 +146340,7 @@ index 79fa34f1e31c..0a0cc4373b02 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 15 Aug 2019 12:02:34 +0100 -Subject: [PATCH 0168/1050] configs: arm64/bcm2711: Enable V3D +Subject: [PATCH 0167/1183] configs: arm64/bcm2711: Enable V3D Enable the V3D driver, which depends on BCM2835_POWER. @@ -146420,7 +146374,7 @@ index 9a5c44606337..b0e048697964 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 Sep 2019 18:16:56 +0100 -Subject: [PATCH 0169/1050] arch/arm: Add model string to cpuinfo +Subject: [PATCH 0168/1183] arch/arm: Add model string to cpuinfo Signed-off-by: Phil Elwell --- @@ -146462,7 +146416,7 @@ index 284a80c0b6e1..12e73ce6e8fa 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 Sep 2019 18:17:25 +0100 -Subject: [PATCH 0170/1050] arch/arm64: Add Revision, Serial, Model to cpuinfo +Subject: [PATCH 0169/1183] arch/arm64: Add Revision, Serial, Model to cpuinfo Signed-off-by: Phil Elwell --- @@ -146526,7 +146480,7 @@ index 591c18a889a5..ae90c11f9623 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 28 Aug 2019 13:34:30 +0100 -Subject: [PATCH 0171/1050] media: dt-bindings: Add binding for the Sony IMX219 +Subject: [PATCH 0170/1183] media: dt-bindings: Add binding for the Sony IMX219 sensor The IMX219 is an 8MPix CSI2 sensor, supporting 2 or 4 data lanes. @@ -146610,7 +146564,7 @@ index 000000000000..a02f1ce1e120 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 6 Sep 2019 15:04:51 +0100 -Subject: [PATCH 0172/1050] v4l2: Add a Greyworld AWB mode. +Subject: [PATCH 0171/1183] 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) @@ -151683,7 +151637,7 @@ index 5532b5f68493..ee1684f51d97 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 6 Sep 2019 15:13:06 +0100 -Subject: [PATCH 0173/1050] staging: bcm2835-camera: Add greyworld AWB mode +Subject: [PATCH 0172/1183] 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. @@ -151728,7 +151682,7 @@ index 1793103b18fd..27bafc5f01d2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 18 Sep 2019 17:22:36 +0100 -Subject: [PATCH 0174/1050] drm/v3d: Delete pm_runtime support +Subject: [PATCH 0173/1183] drm/v3d: Delete pm_runtime support The pm_runtime was blocking changelist submission, so delete it as a temporary workaround. @@ -151798,7 +151752,7 @@ index 8986e7b96461..618503f2f2f1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Thu, 19 Sep 2019 20:45:30 +0200 -Subject: [PATCH 0175/1050] ARM: bcm: Switch board, clk and pinctrl to bcm2711 +Subject: [PATCH 0174/1183] ARM: bcm: Switch board, clk and pinctrl to bcm2711 compatible After the decision to use bcm2711 compatible for upstream, we should @@ -151830,7 +151784,7 @@ index 282a023027fc..e538e0f899a5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Tue, 24 Sep 2019 18:26:55 +0100 -Subject: [PATCH 0176/1050] Rename HDMI ALSA device names, check for enable +Subject: [PATCH 0175/1183] Rename HDMI ALSA device names, check for enable state HDMI Alsa devices renamed to match names used by DRM, to @@ -151976,7 +151930,7 @@ index eb8a8a5b7ec8..f926784c622d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Proeller Date: Thu, 10 Oct 2019 19:12:08 +0200 -Subject: [PATCH 0177/1050] dt-bindings: Add binding for the Infineon IRS1125 +Subject: [PATCH 0176/1183] dt-bindings: Add binding for the Infineon IRS1125 sensor Adds a binding for the Infineon IRS1125 time-of-flight depth @@ -152049,7 +152003,7 @@ index 000000000000..25a48028c957 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Proeller Date: Thu, 10 Oct 2019 19:12:36 +0200 -Subject: [PATCH 0178/1050] media: i2c: Add a driver for the Infineon IRS1125 +Subject: [PATCH 0177/1183] media: i2c: Add a driver for the Infineon IRS1125 depth sensor The Infineon IRS1125 is a time of flight depth sensor that @@ -153294,7 +153248,7 @@ index 000000000000..dccaca23aa76 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 Nov 2019 20:18:08 +0000 -Subject: [PATCH 0179/1050] drm/v3d: Suppress all but the first MMU error +Subject: [PATCH 0178/1183] 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. @@ -153339,7 +153293,7 @@ index e714d5318f30..0f7a23f051df 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 12 Nov 2019 16:41:21 +0000 -Subject: [PATCH 0180/1050] drm/v3d: Plug dma_fence leak +Subject: [PATCH 0179/1183] 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 @@ -153373,7 +153327,7 @@ index 272320c6b1fe..ac07f67aafe7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 6 Nov 2019 13:57:48 +0000 -Subject: [PATCH 0181/1050] staging: vchiq_arm: Register vcsm-cma as a platform +Subject: [PATCH 0180/1183] staging: vchiq_arm: Register vcsm-cma as a platform driver Following the same pattern as bcm2835-camera and bcm2835-audio, @@ -153419,7 +153373,7 @@ index 099359fc0115..5b937babbf25 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 6 Nov 2019 13:57:58 +0000 -Subject: [PATCH 0182/1050] staging: vchiq_arm: Register bcm2835-codec as a +Subject: [PATCH 0181/1183] staging: vchiq_arm: Register bcm2835-codec as a platform driver Following the same pattern as bcm2835-camera and bcm2835-audio, @@ -153465,7 +153419,7 @@ index 5b937babbf25..887929caf27d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: James Hughes Date: Thu, 31 Oct 2019 14:39:44 +0000 -Subject: [PATCH 0183/1050] net:phy:2711 Allow ethernet LED mode to be set via +Subject: [PATCH 0182/1183] net:phy:2711 Allow ethernet LED mode to be set via device tree Add device tree entries and code to allow the specification of @@ -153526,7 +153480,7 @@ index b330efb98209..211e1b8e4d56 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 23 Aug 2019 16:34:38 +0100 -Subject: [PATCH 0184/1050] v3d_drv: Handle missing clock more gracefully +Subject: [PATCH 0183/1183] v3d_drv: Handle missing clock more gracefully Signed-off-by: popcornmix --- @@ -153559,7 +153513,7 @@ index 176bc5a572ab..8d7f0bf55ce2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 5 Sep 2019 17:59:14 +0100 -Subject: [PATCH 0185/1050] v3d_gem: Kick the clock so firmware knows we are +Subject: [PATCH 0184/1183] 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 @@ -153592,7 +153546,7 @@ index ac07f67aafe7..4636791617e1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 9 Sep 2019 15:49:56 +0100 -Subject: [PATCH 0186/1050] clk-raspberrypi: Allow cpufreq driver to also +Subject: [PATCH 0185/1183] clk-raspberrypi: Allow cpufreq driver to also adjust gpu clocks For performance/power it is beneficial to adjust gpu clocks with arm clock. @@ -153604,7 +153558,7 @@ Signed-off-by: popcornmix 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c -index dd3b71eafabf..19f4e3b7b190 100644 +index 56c5166f841a..904327cfd9d4 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c @@ -97,7 +97,7 @@ static int raspberrypi_clock_property(struct rpi_firmware *firmware, @@ -153623,7 +153577,7 @@ index dd3b71eafabf..19f4e3b7b190 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 3 Sep 2019 20:28:00 +0100 -Subject: [PATCH 0187/1050] clk-bcm2835: Disable v3d clock +Subject: [PATCH 0186/1183] clk-bcm2835: Disable v3d clock This is controlled by firmware, see clk-raspberrypi.c @@ -153687,7 +153641,7 @@ index fe005f9dbe02..4f983b82eab1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 29 Jan 2019 16:13:25 +0000 -Subject: [PATCH 0188/1050] staging: vchiq_arm: Set up dma ranges on child +Subject: [PATCH 0187/1183] staging: vchiq_arm: Set up dma ranges on child devices The VCHIQ driver now loads the audio, camera, codec, and vc-sm @@ -153726,7 +153680,7 @@ index 887929caf27d..2cc3f8c4098e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 18 Jun 2019 12:15:50 +0100 -Subject: [PATCH 0189/1050] staging: vchiq: Use the old dma controller for OF +Subject: [PATCH 0188/1183] 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 @@ -153783,7 +153737,7 @@ index 2cc3f8c4098e..9d7eeb3f6614 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Fri, 27 Dec 2019 11:40:56 +0100 -Subject: [PATCH 0190/1050] ARM: bcm: Backport BCM2711 support from upstream +Subject: [PATCH 0189/1183] ARM: bcm: Backport BCM2711 support from upstream Make the BCM2711 a different machine, but keep it in board_bcm2835. @@ -153836,7 +153790,7 @@ index e538e0f899a5..91a758c61f48 100644 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 0191/1050] Initialise rpi-firmware before clk-bcm2835 +Subject: [PATCH 0190/1183] 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 @@ -153891,7 +153845,7 @@ index 2a7a0a9933d7..fa105074f05f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 3 Feb 2020 17:30:46 +0000 -Subject: [PATCH 0192/1050] staging: vchiq_arm: Give vchiq children DT nodes +Subject: [PATCH 0191/1183] 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 @@ -153936,7 +153890,7 @@ index 9d7eeb3f6614..d373197a67d9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 6 Jan 2020 16:04:30 +0000 -Subject: [PATCH 0193/1050] pinctrl: bcm2835: Remove gpiochip on error +Subject: [PATCH 0192/1183] 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. @@ -153967,7 +153921,7 @@ index ce67182de720..90ce5d11f3a6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 2 Mar 2020 14:40:19 +0000 -Subject: [PATCH 0194/1050] drivers: char: vcio: Use common compat header +Subject: [PATCH 0193/1183] drivers: char: vcio: Use common compat header The definition of compat_ptr is now common for most platforms, but requires the inclusion of . @@ -153996,7 +153950,7 @@ index d2598663a2b5..a39155a94fb7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 2 Mar 2020 14:42:23 +0000 -Subject: [PATCH 0195/1050] video: fbdev: bcm2708_fb: Use common compat header +Subject: [PATCH 0194/1183] video: fbdev: bcm2708_fb: Use common compat header The definition of compat_ptr is now common for most platforms, but requires the inclusion of . @@ -154025,7 +153979,7 @@ index 0e9ec3f593b8..17e9260655e4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 6 Feb 2020 12:23:15 +0000 -Subject: [PATCH 0196/1050] of: overlay: Correct symbol path fixups +Subject: [PATCH 0195/1183] 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 @@ -154068,7 +154022,7 @@ index d1187123c4fc..be471ef07c7e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jim Quinlan Date: Mon, 15 Jan 2018 18:28:39 -0500 -Subject: [PATCH 0197/1050] dt-bindings: pci: Add DT docs for Brcmstb PCIe +Subject: [PATCH 0196/1183] dt-bindings: pci: Add DT docs for Brcmstb PCIe device The DT bindings description of the Brcmstb PCIe device is described. This @@ -154153,7 +154107,7 @@ index 000000000000..a1a9ad5e70ca From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 Apr 2020 11:22:44 +0100 -Subject: [PATCH 0198/1050] bcmgenet: Disable skip_umac_reset by default +Subject: [PATCH 0197/1183] bcmgenet: Disable skip_umac_reset by default Possible fixed upstream by 'net: bcmgenet: keep MAC in reset until PHY is up' @@ -154182,7 +154136,7 @@ index 5feba08c2dce..e24c27abd432 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 24 Jan 2020 14:22:06 +0000 -Subject: [PATCH 0199/1050] drm/fourcc: Add packed 10bit YUV 4:2:0 format +Subject: [PATCH 0198/1183] 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). @@ -154245,7 +154199,7 @@ index 808c73c52820..57094b5c410f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Fri, 13 Dec 2019 17:04:25 +0100 -Subject: [PATCH 0200/1050] media: uapi: hevc: Add scaling matrix control +Subject: [PATCH 0199/1183] media: uapi: hevc: Add scaling matrix control Taken from https://patchwork.linuxtv.org/patch/60728/ Changes (mainly documentation) have been requested. @@ -154261,7 +154215,7 @@ Signed-off-by: Jernej Skrabec 4 files changed, 65 insertions(+), 2 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst -index 976d34445a24..dca893cb9f18 100644 +index f1421cf1a1b3..9a8e576116a0 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -3181,6 +3181,47 @@ enum v4l2_mpeg_video_hevc_size_of_length_field - @@ -154411,7 +154365,7 @@ index 781371bff2ad..1c6567b13b7e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Fri, 13 Dec 2019 17:04:27 +0100 -Subject: [PATCH 0201/1050] media: uapi: hevc: Add segment address field +Subject: [PATCH 0200/1183] media: uapi: hevc: Add segment address field From https://patchwork.linuxtv.org/patch/60725/ Changes requested, but mainly docs. @@ -154428,7 +154382,7 @@ Signed-off-by: Jernej Skrabec 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst -index dca893cb9f18..b699257ebb96 100644 +index 9a8e576116a0..f1553554f3e8 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -2961,6 +2961,9 @@ enum v4l2_mpeg_video_hevc_size_of_length_field - @@ -154478,7 +154432,7 @@ index 1c6567b13b7e..7cbbbf055f47 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 24 Jan 2020 14:28:21 +0000 -Subject: [PATCH 0202/1050] media: videodev2.h: Add a format for column +Subject: [PATCH 0201/1183] 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 @@ -154801,7 +154755,7 @@ index fba99eb8eeee..0cfd4089653f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 17 Mar 2020 10:53:16 +0000 -Subject: [PATCH 0203/1050] media: dt-bindings: media: Add binding for the +Subject: [PATCH 0202/1183] 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. @@ -154916,7 +154870,7 @@ index 44897643a19c..3803afa12f77 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 5 Mar 2020 18:30:41 +0000 -Subject: [PATCH 0204/1050] staging: media: Add Raspberry Pi V4L2 H265 decoder +Subject: [PATCH 0203/1183] 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. @@ -159298,7 +159252,7 @@ index 000000000000..9c4f3fb2f9f6 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 13 Feb 2020 17:51:09 +0100 -Subject: [PATCH 0205/1050] dt-bindings: clock: Add a binding for the RPi +Subject: [PATCH 0204/1183] dt-bindings: clock: Add a binding for the RPi Firmware clocks The firmare running on the RPi VideoCore can be used to discover and @@ -159368,7 +159322,7 @@ index 000000000000..d37bc311321d From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 13 Feb 2020 16:45:24 +0100 -Subject: [PATCH 0206/1050] dt-bindings: display: vc4: hdmi: Add BCM2711 HDMI +Subject: [PATCH 0205/1183] dt-bindings: display: vc4: hdmi: Add BCM2711 HDMI controllers bindings The HDMI controllers found in the BCM2711 SoC need some adjustments to the @@ -159548,7 +159502,7 @@ index 031e35e76db2..e7ef3a36327b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 27 Jan 2020 10:22:44 +0000 -Subject: [PATCH 0207/1050] drm: Checking of the pitch is only valid for linear +Subject: [PATCH 0206/1183] drm: Checking of the pitch is only valid for linear formats framebuffer_check was computing a minimum pitch value and ensuring @@ -159594,7 +159548,7 @@ index 07f5abc875e9..8683b59bcbcb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Apr 2020 22:18:52 +0100 -Subject: [PATCH 0208/1050] driver: char: rpivid: Remove legacy name support +Subject: [PATCH 0207/1183] driver: char: rpivid: Remove legacy name support Signed-off-by: Phil Elwell --- @@ -159653,7 +159607,7 @@ index fbf3d4f3fe0c..5f4c91924ec1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Apr 2020 10:46:19 +0100 -Subject: [PATCH 0209/1050] spi: Force CS_HIGH if GPIO descriptors are used +Subject: [PATCH 0208/1183] 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 @@ -159683,10 +159637,10 @@ Signed-off-by: Phil Elwell 1 file changed, 9 insertions(+) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c -index d0bbf8f9414d..c5f1e4c4b7cb 100644 +index 556d65af5e23..147ca28faedf 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c -@@ -3469,6 +3469,7 @@ static int __spi_validate_bits_per_word(struct spi_controller *ctlr, +@@ -3478,6 +3478,7 @@ static int __spi_validate_bits_per_word(struct spi_controller *ctlr, */ int spi_setup(struct spi_device *spi) { @@ -159694,7 +159648,7 @@ index d0bbf8f9414d..c5f1e4c4b7cb 100644 unsigned bad_bits, ugly_bits; int status; -@@ -3490,6 +3491,14 @@ int spi_setup(struct spi_device *spi) +@@ -3499,6 +3500,14 @@ int spi_setup(struct spi_device *spi) (SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL | SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL))) return -EINVAL; @@ -159716,7 +159670,7 @@ index d0bbf8f9414d..c5f1e4c4b7cb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 21 Apr 2020 11:30:23 +0100 -Subject: [PATCH 0210/1050] driver: char: rpivid: Don't map more than wanted +Subject: [PATCH 0209/1183] 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. @@ -159773,7 +159727,7 @@ index 5f4c91924ec1..9f38083f4cb6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 1 Apr 2020 08:39:49 +0100 -Subject: [PATCH 0211/1050] media: bcm2835-unicam: Driver for CCP2/CSI2 camera +Subject: [PATCH 0210/1183] media: bcm2835-unicam: Driver for CCP2/CSI2 camera interface Add driver for the Unicam camera receiver block on @@ -162506,7 +162460,7 @@ index 000000000000..ae059a171d0f From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 1 Apr 2020 08:46:29 +0100 -Subject: [PATCH 0212/1050] media: uapi: v4l2-core: Add sensor ancillary data +Subject: [PATCH 0211/1183] media: uapi: v4l2-core: Add sensor ancillary data V4L2 foucc type. Add V4L2_META_FMT_SENSOR_DATA format 4CC. @@ -162604,7 +162558,7 @@ index 0cfd4089653f..58cbf8a9c5b7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 21 Jan 2020 14:06:47 +0000 -Subject: [PATCH 0213/1050] media: uapi: Add MEDIA_BUS_FMT_SENSOR_DATA media +Subject: [PATCH 0212/1183] media: uapi: Add MEDIA_BUS_FMT_SENSOR_DATA media bus format This patch adds MEDIA_BUS_FMT_SENSOR_DATA used by the bcm2835-unicam @@ -162675,7 +162629,7 @@ index 0dfc11ee243a..aa56d7f54784 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 7 Apr 2020 10:42:14 +0100 -Subject: [PATCH 0214/1050] media: bcm2835-unicam: Add support for mulitple +Subject: [PATCH 0213/1183] media: bcm2835-unicam: Add support for mulitple device nodes. Move device node specific state out of the device state structure and @@ -163764,7 +163718,7 @@ index 9da9f22c3db5..b34551a3f44b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 16 Apr 2020 11:35:41 +0100 -Subject: [PATCH 0215/1050] media: bcm2835-unicam: Add embedded data node. +Subject: [PATCH 0214/1183] 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 @@ -164938,7 +164892,7 @@ index b34551a3f44b..d5e0f70b600c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 2 Apr 2020 16:08:51 +0100 -Subject: [PATCH 0216/1050] media: bcm2835-unicam: Use dummy buffer if none +Subject: [PATCH 0215/1183] media: bcm2835-unicam: Use dummy buffer if none have been queued If no buffer has been queued by a userland application, we use an @@ -165252,7 +165206,7 @@ index d5e0f70b600c..933f1ba49e3d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 24 Mar 2020 23:13:02 +0200 -Subject: [PATCH 0217/1050] media: bcm2835-unicam: Disable event-related ioctls +Subject: [PATCH 0216/1183] media: bcm2835-unicam: Disable event-related ioctls on metadata node The unicam driver supports both the SOURCE_CHANGE and CTRL events. Both @@ -165289,7 +165243,7 @@ index 933f1ba49e3d..2d4c7a247fc5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 24 Mar 2020 23:13:02 +0200 -Subject: [PATCH 0218/1050] media: bcm2835-unicam: Add support for the +Subject: [PATCH 0217/1183] media: bcm2835-unicam: Add support for the FRAME_SYNC event The FRAME_SYNC event is useful for userspace image processing algorithms @@ -165350,7 +165304,7 @@ index 2d4c7a247fc5..21d3a8585118 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 21 Apr 2020 16:26:03 +0100 -Subject: [PATCH 0219/1050] media: bcm2835-unicam: Re-fetch mbus code from +Subject: [PATCH 0218/1183] 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 @@ -165405,7 +165359,7 @@ index 21d3a8585118..d4684fb2797f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 23 Apr 2020 10:20:26 +0100 -Subject: [PATCH 0220/1050] media: uapi: v4l2-core: Add ISP statistics output +Subject: [PATCH 0219/1183] media: uapi: v4l2-core: Add ISP statistics output V4L2 fourcc type Add V4L2_META_FMT_BCM2835_ISP_STATS V4L2 format type. @@ -165512,7 +165466,7 @@ index 58cbf8a9c5b7..f56bae0c4671 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 21 Apr 2020 15:06:19 +0100 -Subject: [PATCH 0221/1050] media: uapi: v4l-ctrls: Add CID base for the +Subject: [PATCH 0220/1183] media: uapi: v4l-ctrls: Add CID base for the bcm2835-isp driver We are reserving controls for the new bcm2835-isp driver. @@ -165692,7 +165646,7 @@ index ee1684f51d97..cda42967cdb3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 22 Apr 2020 08:32:32 +0100 -Subject: [PATCH 0222/1050] staging: vchiq: Load bcm2835_isp driver from vchiq +Subject: [PATCH 0221/1183] 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. @@ -165737,7 +165691,7 @@ index d373197a67d9..e2eafacb0a80 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 4 Apr 2019 13:33:47 +0100 -Subject: [PATCH 0223/1050] bcm2835-dma: Add proper 40-bit DMA support +Subject: [PATCH 0222/1183] 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. @@ -166543,7 +166497,7 @@ index 87b5d0bef355..ac0458a8027f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Apr 2020 16:45:02 +0100 -Subject: [PATCH 0224/1050] media: bcm2835-unicam: Add support for +Subject: [PATCH 0223/1183] media: bcm2835-unicam: Add support for VIDIOC_[S|G]_SELECTION Sensors are now reflecting cropping and scaling parameters through @@ -166631,7 +166585,7 @@ index d4684fb2797f..0e1d525a0b35 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Apr 2020 22:05:09 +0100 -Subject: [PATCH 0225/1050] media: bcm2835-unicam: Do not stop streaming in +Subject: [PATCH 0224/1183] media: bcm2835-unicam: Do not stop streaming in unicam_release unicam_release calls _vb2_fop_release, which will call stop_streaming @@ -166665,7 +166619,7 @@ index 0e1d525a0b35..c7e211d04ed3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 30 Apr 2020 09:52:50 +0100 -Subject: [PATCH 0226/1050] media: bcm2835-unicam: Fix reference counting in +Subject: [PATCH 0225/1183] media: bcm2835-unicam: Fix reference counting in unicam_open The reference counting of node->open was only incremented after @@ -166709,7 +166663,7 @@ index c7e211d04ed3..a79fc4d99d36 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jacko Dirks Date: Tue, 5 May 2020 14:28:14 +0200 -Subject: [PATCH 0227/1050] media: i2c: tc358743: Fix fallthrough warning +Subject: [PATCH 0226/1183] media: i2c: tc358743: Fix fallthrough warning Signed-off-by: Jacko Dirks --- @@ -166735,7 +166689,7 @@ index 69f2d676448e..2985dd9e46cd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jacko Dirks Date: Tue, 5 May 2020 14:33:31 +0200 -Subject: [PATCH 0228/1050] media: bcm2835: unicam: Fix uninitialized warning +Subject: [PATCH 0227/1183] media: bcm2835: unicam: Fix uninitialized warning Signed-off-by: Jacko Dirks --- @@ -166762,7 +166716,7 @@ index a79fc4d99d36..92e5deb4c6fd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 5 May 2020 19:45:41 +0100 -Subject: [PATCH 0229/1050] video: bcm2708_fb: Disable FB if no displays found +Subject: [PATCH 0228/1183] 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 @@ -166802,7 +166756,7 @@ index 17e9260655e4..dac5c021ce52 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 7 May 2020 15:50:54 +0100 -Subject: [PATCH 0230/1050] dt-bindings: media: i2c: Add IMX477 CMOS sensor +Subject: [PATCH 0229/1183] dt-bindings: media: i2c: Add IMX477 CMOS sensor binding Add YAML device tree binding for IMX477 CMOS image sensor. @@ -166939,7 +166893,7 @@ index 000000000000..0994e13e67f6 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 13 May 2020 18:28:27 +0100 -Subject: [PATCH 0231/1050] media: bcm2835-unicam: Always service interrupts +Subject: [PATCH 0230/1183] 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 @@ -166996,7 +166950,7 @@ index 92e5deb4c6fd..52a534d932bf 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 13 May 2020 20:10:15 +0100 -Subject: [PATCH 0232/1050] sc16is7xx: Fix for hardware flow control +Subject: [PATCH 0231/1183] sc16is7xx: Fix for hardware flow control The SC16IS7XX hardware flow control is mishandled by the driver in a number of ways: @@ -167072,7 +167026,7 @@ index a7b40ee6b94d..e30d7d371221 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 15 May 2020 13:42:10 +0100 -Subject: [PATCH 0233/1050] staging: vc04_services: mmal-vchiq: Update +Subject: [PATCH 0232/1183] staging: vc04_services: mmal-vchiq: Update parameters list Adds in a couple of new MMAL parameter defines. @@ -167106,7 +167060,7 @@ index 27bafc5f01d2..89059bca0b77 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 15 May 2020 13:48:59 +0100 -Subject: [PATCH 0234/1050] staging:vc04_services: bcm2835-camera: Request +Subject: [PATCH 0233/1183] staging:vc04_services: bcm2835-camera: Request headers with I-frame V4L2 wishes to have the codec header bytes in the same buffer as the @@ -167142,7 +167096,7 @@ index 1b184d5c6b82..6b348e399c06 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 19 May 2020 11:46:47 +0100 -Subject: [PATCH 0235/1050] media: bcm2835-unicam: Retain packing information +Subject: [PATCH 0234/1183] media: bcm2835-unicam: Retain packing information on G_FMT The change to retrieve the pixel format always on g_fmt didn't @@ -167196,7 +167150,7 @@ index 52a534d932bf..b32b2d33a4e2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 5 May 2020 15:23:32 +0100 -Subject: [PATCH 0236/1050] zswap: Defer zswap initialisation +Subject: [PATCH 0235/1183] 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 @@ -167327,7 +167281,7 @@ index 7944e3e57e78..4719af5f27fe 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 28 May 2020 11:09:48 +0100 -Subject: [PATCH 0237/1050] media: bcm2835-unicam: change minimum number of +Subject: [PATCH 0236/1183] 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 @@ -167361,7 +167315,7 @@ index b32b2d33a4e2..e76323af0952 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Fri, 5 Jun 2020 09:22:49 +0000 -Subject: [PATCH 0238/1050] snd_bcm2835: disable HDMI audio when vc4 is used +Subject: [PATCH 0237/1183] snd_bcm2835: disable HDMI audio when vc4 is used (#3640) Things don't work too well when both the vc4 driver and the firmware @@ -167400,7 +167354,7 @@ index f926784c622d..31968fec297f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Apr 2018 14:42:27 +0100 -Subject: [PATCH 0239/1050] gpiolib: Don't prevent IRQ usage of output GPIOs +Subject: [PATCH 0238/1183] 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 @@ -167456,7 +167410,7 @@ index 320baed949ee..a929cb5d495b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 11 Jun 2020 09:57:03 +0100 -Subject: [PATCH 0240/1050] PCI: brcmstb: Add DT property to control L1SS +Subject: [PATCH 0239/1183] 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. @@ -167541,7 +167495,7 @@ index cc30215f5a43..77967a37cbd9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Proeller Date: Tue, 16 Jun 2020 13:24:31 +0200 -Subject: [PATCH 0241/1050] media: irs1125: Using i2c_transfer for ic2 reads +Subject: [PATCH 0240/1183] 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. @@ -167612,7 +167566,7 @@ index 25e1dd5a08ef..6680afea5894 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Proeller Date: Tue, 16 Jun 2020 13:27:42 +0200 -Subject: [PATCH 0242/1050] media: irs1125: Refactoring and debug messages +Subject: [PATCH 0241/1183] media: irs1125: Refactoring and debug messages Changed some variable names to comply with checkpatch --strict mode. Debug messages added. @@ -167741,7 +167695,7 @@ index 6680afea5894..289f0c25b141 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Proeller Date: Tue, 16 Jun 2020 13:31:36 +0200 -Subject: [PATCH 0243/1050] media: irs1125: Atomic access to imager +Subject: [PATCH 0242/1183] media: irs1125: Atomic access to imager reconfiguration Instead of changing the exposure and framerate settings for all sequences, @@ -168130,7 +168084,7 @@ index dccaca23aa76..96d676123d5e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Markus Proeller Date: Tue, 16 Jun 2020 13:33:56 +0200 -Subject: [PATCH 0244/1050] media: irs1125: Keep HW in sync after imager reset +Subject: [PATCH 0243/1183] 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 @@ -168317,7 +168271,7 @@ index d59e05004a03..30c3d2640386 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxim Mikityanskiy Date: Sat, 20 Jun 2020 15:40:00 +0300 -Subject: [PATCH 0245/1050] staging: bcm2835-audio: Add missing MODULE_ALIAS +Subject: [PATCH 0244/1183] 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 @@ -168353,7 +168307,7 @@ index 31968fec297f..a0cba3823e5e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Jun 2020 11:51:05 +0100 -Subject: [PATCH 0246/1050] brcmfmac: Prefer a ccode from OTP over nvram file +Subject: [PATCH 0245/1183] 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. @@ -168490,7 +168444,7 @@ index dcbe55b56e43..309214a9cd40 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 23 Jun 2020 10:05:57 +0100 -Subject: [PATCH 0247/1050] drivers: media: Remove the downstream version of +Subject: [PATCH 0246/1183] drivers: media: Remove the downstream version of bcm2835-unicam About to be replaced by the upstream version. @@ -171681,7 +171635,7 @@ index ae059a171d0f..000000000000 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 4 May 2020 12:25:41 +0300 -Subject: [PATCH 0248/1050] media: bcm2835-unicam: Driver for CCP2/CSI2 camera +Subject: [PATCH 0247/1183] media: bcm2835-unicam: Driver for CCP2/CSI2 camera interface Add a driver for the Unicam camera receiver block on BCM283x processors. @@ -174849,7 +174803,7 @@ index 000000000000..ae059a171d0f From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 23 Jun 2020 14:32:51 +0100 -Subject: [PATCH 0249/1050] media: bcm2835-unicam: Add support for +Subject: [PATCH 0248/1183] 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 @@ -174911,7 +174865,7 @@ index 2e9387cbc1e0..9adfb2d217af 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 26 Jun 2020 15:53:44 +0100 -Subject: [PATCH 0250/1050] media: bcm2835-unicam: Avoid gcc warning over {0} +Subject: [PATCH 0249/1183] media: bcm2835-unicam: Avoid gcc warning over {0} on endpoint Older gcc versions object to = { 0 } initialisation if the first @@ -174944,7 +174898,7 @@ index 9adfb2d217af..a65e1da55142 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Fri, 12 Jun 2020 15:53:46 +0200 -Subject: [PATCH 0251/1050] media: i2c: imx290: set the format before +Subject: [PATCH 0250/1183] media: i2c: imx290: set the format before VIDIOC_SUBDEV_G_FMT is called Commit d46cfdc86c30d5ec768924f0b1e2683c8d20b671 upstream. @@ -174990,7 +174944,7 @@ index bf7a6c37ca5d..f6ae24a964d4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Jun 2020 08:28:51 +0100 -Subject: [PATCH 0252/1050] media: i2c: imx290: Add support for 74.25MHz clock +Subject: [PATCH 0251/1183] 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. @@ -175260,7 +175214,7 @@ index f6ae24a964d4..45b10a8aafa1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 11 Jun 2020 13:41:43 +0100 -Subject: [PATCH 0253/1050] media: i2c: imx290: Correct range for V4L2_CID_GAIN +Subject: [PATCH 0252/1183] 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 @@ -175292,7 +175246,7 @@ index 45b10a8aafa1..f89584a9bbd7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 11 Jun 2020 14:36:40 +0100 -Subject: [PATCH 0254/1050] media: i2c: imx290: Convert HMAX setting into +Subject: [PATCH 0253/1183] media: i2c: imx290: Convert HMAX setting into V4L2_CID_HBLANK Userspace needs to know HBLANK if it is to work out exposure times @@ -175457,7 +175411,7 @@ index f89584a9bbd7..e77ddd0dea4e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 11 Jun 2020 18:09:12 +0100 -Subject: [PATCH 0255/1050] media: i2c: imx290: Add support for V4L2_CID_VBLANK +Subject: [PATCH 0254/1183] 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, @@ -175604,7 +175558,7 @@ index e77ddd0dea4e..ceb71d83c993 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 11 Jun 2020 18:19:13 +0100 -Subject: [PATCH 0256/1050] media: i2c: imx290: Add exposure control to the +Subject: [PATCH 0255/1183] media: i2c: imx290: Add exposure control to the driver. Adds support for V4L2_CID_EXPOSURE so that userspace can control @@ -175703,7 +175657,7 @@ index ceb71d83c993..3e52c43b837d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 11 Jun 2020 18:34:16 +0100 -Subject: [PATCH 0257/1050] media: i2c: imx290: Add H and V flip controls +Subject: [PATCH 0256/1183] 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. @@ -175792,7 +175746,7 @@ index 3e52c43b837d..375a83ce71d0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Jun 2020 16:52:14 +0100 -Subject: [PATCH 0258/1050] media: dt-bindings: media: i2c: Add mono version to +Subject: [PATCH 0257/1183] media: dt-bindings: media: i2c: Add mono version to IMX290 bindings The IMX290 module is available as either monochrome or colour and @@ -175834,7 +175788,7 @@ index a3cc21410f7c..294e63650d9e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Jun 2020 17:03:11 +0100 -Subject: [PATCH 0259/1050] media : i2c: imx290: Add support for the mono +Subject: [PATCH 0258/1183] media : i2c: imx290: Add support for the mono sensor variant. The IMX290 module is available as either mono or colour (Bayer). @@ -176025,7 +175979,7 @@ index 375a83ce71d0..aeb95161b4fe 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 26 Jun 2020 18:11:49 +0100 -Subject: [PATCH 0260/1050] media: i2c: imx290: Switch set_hmax to use +Subject: [PATCH 0259/1183] media: i2c: imx290: Switch set_hmax to use imx290_write_buffered_reg imx290_set_hmax was using two independent writes to set up hmax, @@ -176074,7 +176028,7 @@ index aeb95161b4fe..e64124a521b2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 2 Jul 2020 13:53:20 +0100 -Subject: [PATCH 0261/1050] serial: 8250: bcm2835aux - defer if clock is zero +Subject: [PATCH 0260/1183] serial: 8250: bcm2835aux - defer if clock is zero See: https://github.com/raspberrypi/linux/issues/3700 @@ -176108,7 +176062,7 @@ index fd95860cd661..fc36e5963e30 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 May 2020 16:59:03 +0100 -Subject: [PATCH 0262/1050] media: Add a pixel format for MIPI packed 12bit +Subject: [PATCH 0261/1183] media: Add a pixel format for MIPI packed 12bit luma only. This is the format used by monochrome 12bit image sensors. @@ -176216,7 +176170,7 @@ index f56bae0c4671..a3ed5b2524c4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Jun 2020 17:51:03 +0100 -Subject: [PATCH 0263/1050] media: Add a pixel format for MIPI packed 14bit +Subject: [PATCH 0262/1183] media: Add a pixel format for MIPI packed 14bit luma only. This is the format used by monochrome 14bit image sensors. @@ -176333,7 +176287,7 @@ index a3ed5b2524c4..12f356c48616 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Jun 2020 17:53:32 +0100 -Subject: [PATCH 0264/1050] media: bcm2835-unicam: Add support for 12bit mono +Subject: [PATCH 0263/1183] media: bcm2835-unicam: Add support for 12bit mono packed format Now that V4L2_PIX_FMT_Y12P is defined, allow passing raw 12bit @@ -176364,7 +176318,7 @@ index a65e1da55142..5edb58cc9f03 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Jun 2020 18:03:47 +0100 -Subject: [PATCH 0265/1050] media: bcm2835-unicam: Add support for 14bit mono +Subject: [PATCH 0264/1183] media: bcm2835-unicam: Add support for 14bit mono sources Now that V4L2_PIX_FMT_Y14 and V4L2_PIX_FMT_Y14P are defined, @@ -176399,7 +176353,7 @@ index 5edb58cc9f03..778153943160 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 1 Jul 2020 10:57:57 +0100 -Subject: [PATCH 0266/1050] media: bcm2835-unicam: Add support for unpacked +Subject: [PATCH 0265/1183] media: bcm2835-unicam: Add support for unpacked 14bit Bayer formats Now that the 14bit non-packed Bayer formats are defined, add them @@ -176447,7 +176401,7 @@ index 778153943160..c97ecfc0e55b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Jul 2020 20:28:27 +0100 -Subject: [PATCH 0267/1050] bcm2835-dma: Add NO_WAIT_RESP flag +Subject: [PATCH 0266/1183] 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. @@ -176507,7 +176461,7 @@ index ac0458a8027f..84b1009da23b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Jul 2020 10:31:53 +0100 -Subject: [PATCH 0268/1050] media: i2c: imx290: Explicitly set v&h blank on +Subject: [PATCH 0267/1183] media: i2c: imx290: Explicitly set v&h blank on mode change __v4l2_ctrl_modify_range only updates the current value should @@ -176559,7 +176513,7 @@ index e64124a521b2..0b520a7f88b1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Jul 2020 11:23:48 +0100 -Subject: [PATCH 0269/1050] media: i2c: imx290: Add support for g_selection to +Subject: [PATCH 0268/1183] media: i2c: imx290: Add support for g_selection to report cropping Userspace needs to know the cropping arrangements for each mode, @@ -176721,7 +176675,7 @@ index 0b520a7f88b1..e475d7889bc8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Jul 2020 11:51:26 +0100 -Subject: [PATCH 0270/1050] media: i2c: imx290: Set the colorspace fields in +Subject: [PATCH 0269/1183] media: i2c: imx290: Set the colorspace fields in the format The colorspace fields were left untouched in imx290_set_fmt @@ -176758,7 +176712,7 @@ index e475d7889bc8..def5e8fe41a0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Jul 2020 14:23:40 +0100 -Subject: [PATCH 0271/1050] media: bcm2835-unicam: Reinstate V4L2_CAP_READWRITE +Subject: [PATCH 0270/1183] media: bcm2835-unicam: Reinstate V4L2_CAP_READWRITE in the caps v4l2-compliance throws a failure if the device doesn't advertise @@ -176792,7 +176746,7 @@ index c97ecfc0e55b..20b46a9e04c3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Jul 2020 14:52:43 +0100 -Subject: [PATCH 0272/1050] media: bcm2835-unicam: Ensure type is VIDEO_CAPTURE +Subject: [PATCH 0271/1183] 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 @@ -176834,7 +176788,7 @@ index 20b46a9e04c3..de288f87ff2f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 11 May 2020 13:02:22 +0100 -Subject: [PATCH 0273/1050] media: bcm2835: unicam: Set VPU min clock freq to +Subject: [PATCH 0272/1183] media: bcm2835: unicam: Set VPU min clock freq to 250Mhz. When streaming with Unicam, the VPU must have a clock frequency of at @@ -176967,7 +176921,7 @@ index de288f87ff2f..295db7564614 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 11 May 2020 13:06:27 +0100 -Subject: [PATCH 0274/1050] dt-bindings: bcm2835-unicam: Update documentation +Subject: [PATCH 0273/1183] dt-bindings: bcm2835-unicam: Update documentation with new clock params Update the documentation to reflect the new "VPU" clock needed @@ -177011,7 +176965,7 @@ index 7714fb374b34..164d0377dcd2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Jul 2020 10:33:19 +0100 -Subject: [PATCH 0275/1050] leds: Add the actpwr trigger +Subject: [PATCH 0274/1183] 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 @@ -177257,7 +177211,7 @@ index 000000000000..1a52107ceb03 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 22 Jul 2020 17:59:31 +0100 -Subject: [PATCH 0276/1050] bcm2835-dma: Advertise the full DMA range +Subject: [PATCH 0275/1183] bcm2835-dma: Advertise the full DMA range Unless the DMA mask is set wider than 32 bits, DMA mapping will use a bounce buffer. @@ -177340,7 +177294,7 @@ index 84b1009da23b..d1127b9058a4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Wed, 19 Aug 2020 17:02:22 +0300 -Subject: [PATCH 0277/1050] media: bcm2835: unicam: Select MEDIA_CONTROLLER and +Subject: [PATCH 0276/1183] media: bcm2835: unicam: Select MEDIA_CONTROLLER and VIDEO_V4L2_SUBDEV_API That is what almost all other drivers appear to be doing. @@ -177373,7 +177327,7 @@ index ec46e3ef053c..7d5a0e6ba762 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Wed, 19 Aug 2020 17:05:53 +0300 -Subject: [PATCH 0278/1050] staging: media: rpivid: Select MEDIA_CONTROLLER and +Subject: [PATCH 0277/1183] staging: media: rpivid: Select MEDIA_CONTROLLER and MEDIA_CONTROLLER_REQUEST_API MEDIA_CONTROLLER_REQUEST_API is a hidden option. If rpivid depends on it, @@ -177411,7 +177365,7 @@ index 58b470c80db1..304c3edf0e71 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 27 Aug 2020 16:30:26 +0100 -Subject: [PATCH 0279/1050] media: bcm2835-unicam: Drop WARN on uing direct +Subject: [PATCH 0278/1183] media: bcm2835-unicam: Drop WARN on uing direct cache alias Pi 0&1 pass all ARM accesses through the VPU L2 cache, therefore @@ -177451,7 +177405,7 @@ index 295db7564614..35ddb97f7f75 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 10 Jul 2020 12:40:50 +0100 -Subject: [PATCH 0280/1050] media: i2c: tc358743: Only allow supported pixel +Subject: [PATCH 0279/1183] media: i2c: tc358743: Only allow supported pixel fmts in set_fmt Fix commit "media: tc358743: Return an appropriate colorspace from @@ -177487,7 +177441,7 @@ index 2985dd9e46cd..da166e6a41d6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 3 Sep 2020 14:02:41 +0100 -Subject: [PATCH 0281/1050] dwc_otg: whitelist_table is now productlist_table +Subject: [PATCH 0280/1183] dwc_otg: whitelist_table is now productlist_table --- drivers/usb/core/otg_productlist.h | 2 +- @@ -177513,7 +177467,7 @@ index 1839e169469b..b16e528859a8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 3 Sep 2020 17:09:07 +0100 -Subject: [PATCH 0282/1050] include/firmware: Add enum for +Subject: [PATCH 0281/1183] include/firmware: Add enum for RPI_FIRMWARE_FRAMEBUFFER_GET_DISPLAY_ID Used by audio and FKMS. @@ -177542,7 +177496,7 @@ index 119141c91bad..6a7b665a1a82 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 8 May 2020 10:00:12 +0100 -Subject: [PATCH 0283/1050] media: i2c: Add driver for Sony IMX477 sensor +Subject: [PATCH 0282/1183] 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 @@ -179821,7 +179775,7 @@ index 000000000000..db615dbe1497 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 8 May 2020 09:41:17 +0100 -Subject: [PATCH 0284/1050] media: i2c: imx477: Add support for adaptive frame +Subject: [PATCH 0283/1183] media: i2c: imx477: Add support for adaptive frame control Use V4L2_CID_EXPOSURE_AUTO_PRIORITY to control if the driver should @@ -180009,7 +179963,7 @@ index db615dbe1497..f76582f27181 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 19 May 2020 16:56:33 +0100 -Subject: [PATCH 0285/1050] media: i2c: imx477: Return correct result on sensor +Subject: [PATCH 0284/1183] media: i2c: imx477: Return correct result on sensor id verification The test should return -EIO if the register read id does not match @@ -180040,7 +179994,7 @@ index f76582f27181..f4cdc2d4158e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 4 Jul 2020 01:45:08 +0300 -Subject: [PATCH 0286/1050] media: i2c: imx477: Parse and register properties +Subject: [PATCH 0285/1183] media: i2c: imx477: Parse and register properties Parse device properties and register controls for them using the V4L2 fwnode properties helpers. @@ -180091,7 +180045,7 @@ index f4cdc2d4158e..d0848f3f3c09 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 13 May 2020 18:28:27 +0100 -Subject: [PATCH 0287/1050] media: bcm2835-unicam: Always service interrupts +Subject: [PATCH 0286/1183] 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 @@ -180148,7 +180102,7 @@ index 35ddb97f7f75..d4ba911fe7e7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jacko Dirks Date: Tue, 5 May 2020 14:33:31 +0200 -Subject: [PATCH 0288/1050] media: bcm2835: unicam: Fix uninitialized warning +Subject: [PATCH 0287/1183] media: bcm2835: unicam: Fix uninitialized warning Signed-off-by: Jacko Dirks --- @@ -180175,7 +180129,7 @@ index d4ba911fe7e7..8b091d3a0d15 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 23 Jun 2020 15:14:05 +0100 -Subject: [PATCH 0289/1050] media: bcm2835-unicam: Fixup review comments from +Subject: [PATCH 0288/1183] media: bcm2835-unicam: Fixup review comments from Hans. Updates the driver based on the upstream review comments from @@ -180427,7 +180381,7 @@ index 8b091d3a0d15..7dc96c3e8e83 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 19 May 2020 11:46:47 +0100 -Subject: [PATCH 0290/1050] media: bcm2835-unicam: Retain packing information +Subject: [PATCH 0289/1183] media: bcm2835-unicam: Retain packing information on G_FMT The change to retrieve the pixel format always on g_fmt didn't @@ -180481,7 +180435,7 @@ index 7dc96c3e8e83..98ae97c367ea 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 28 May 2020 11:09:48 +0100 -Subject: [PATCH 0291/1050] media: bcm2835-unicam: change minimum number of +Subject: [PATCH 0290/1183] 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 @@ -180515,7 +180469,7 @@ index 98ae97c367ea..6501fb205e20 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 1 Sep 2020 18:15:27 +0100 -Subject: [PATCH 0292/1050] staging/fbtft: Add support for display variants +Subject: [PATCH 0291/1183] 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 @@ -180730,7 +180684,7 @@ index 06afaa9d505b..c6ec045a447c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 3 Feb 2020 09:32:22 +0000 -Subject: [PATCH 0293/1050] brcmfmac: Increase power saving delay to 2s +Subject: [PATCH 0292/1183] 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, @@ -180769,7 +180723,7 @@ index fefa8c058350..077852e6b049 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 21 Sep 2020 14:02:44 +0100 -Subject: [PATCH 0294/1050] rpivid_h265: Fix width/height typo +Subject: [PATCH 0293/1183] rpivid_h265: Fix width/height typo Signed-off-by: popcornmix --- @@ -180796,7 +180750,7 @@ index 47d4de42c584..b677910e237c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 25 Sep 2020 15:07:23 +0100 -Subject: [PATCH 0295/1050] net: bcmgenet: Reset RBUF on first open +Subject: [PATCH 0294/1183] 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 @@ -180872,7 +180826,7 @@ index e24c27abd432..9a90637fb556 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Sep 2020 20:23:30 +0100 -Subject: [PATCH 0296/1050] char: Add broadcom char drivers back to build files +Subject: [PATCH 0295/1183] char: Add broadcom char drivers back to build files See: https://github.com/raspberrypi/linux/issues/3875 Signed-off-by: popcornmix @@ -180910,7 +180864,7 @@ index 264eb398fdd4..9bcd7d729cb0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Wed, 7 Oct 2020 15:09:29 +0100 -Subject: [PATCH 0297/1050] dwc_otg: initialise sched_frame for periodic QHs +Subject: [PATCH 0296/1183] 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 @@ -180949,7 +180903,7 @@ index 2823dc9af63f..4503af692aef 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 8 Oct 2020 15:35:14 +0100 -Subject: [PATCH 0298/1050] staging: bcm2835-camera: Replace deprecated +Subject: [PATCH 0297/1183] staging: bcm2835-camera: Replace deprecated V4L2_PIX_FMT_BGR32 V4L2_PIX_FMT_BGR32 is deprecated as it is ambiguous over where @@ -180985,7 +180939,7 @@ index 6b348e399c06..5d14ddb28339 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 8 Oct 2020 18:49:52 +0100 -Subject: [PATCH 0299/1050] staging: vc04_services: Add new vc-sm-cma driver +Subject: [PATCH 0298/1183] staging: vc04_services: Add new vc-sm-cma driver Add Broadcom VideoCore Shared Memory support. @@ -183949,7 +183903,7 @@ index 000000000000..988fdd967922 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 6 May 2020 18:09:04 +0100 -Subject: [PATCH 0300/1050] staging: vchiq-mmal: Add support for 14bit Bayer +Subject: [PATCH 0299/1183] staging: vchiq-mmal: Add support for 14bit Bayer Add in the missing defines. @@ -183982,7 +183936,7 @@ index 44ba91aa6d47..be8af09a6c80 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 6 May 2020 18:11:14 +0100 -Subject: [PATCH 0301/1050] staging: mmal-vchiq: Add monochrome image formats +Subject: [PATCH 0300/1183] staging: mmal-vchiq: Add monochrome image formats Adds support for monochrome image formats in the various MIPI packings. @@ -184017,7 +183971,7 @@ index be8af09a6c80..897e6cdf8dd9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 25 Sep 2018 16:07:55 +0100 -Subject: [PATCH 0302/1050] staging: mmal-vchiq: Use vc-sm-cma to support zero +Subject: [PATCH 0301/1183] 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 @@ -184191,7 +184145,7 @@ index e87f88f99338..247521fbcc1d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 8 Oct 2020 20:24:12 +0100 -Subject: [PATCH 0303/1050] staging: vc04_services: Add a V4L2 M2M codec driver +Subject: [PATCH 0302/1183] staging: vc04_services: Add a V4L2 M2M codec driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -187366,7 +187320,7 @@ index 89059bca0b77..0a1edad8d4a8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2020 00:48:55 +0200 -Subject: [PATCH 0304/1050] bcm2835-dma: only reserve channel 0 if legacy dma +Subject: [PATCH 0303/1183] 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 @@ -187404,7 +187358,7 @@ index d1127b9058a4..0cbfa9d559a2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 12 Oct 2020 17:03:14 +0100 -Subject: [PATCH 0305/1050] uapi: bcm2835-isp: Add bcm2835-isp uapi header file +Subject: [PATCH 0304/1183] 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. @@ -187749,7 +187703,7 @@ index 000000000000..cf8c0437f159 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 23 Apr 2020 10:17:37 +0100 -Subject: [PATCH 0306/1050] staging: vc04_services: ISP: Add a more complex ISP +Subject: [PATCH 0305/1183] staging: vc04_services: ISP: Add a more complex ISP processing component Driver for the BCM2835 ISP hardware block. This driver uses the MMAL @@ -190184,7 +190138,7 @@ index 0a1edad8d4a8..efda4dc039c3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 30 Sep 2020 12:00:54 +0100 -Subject: [PATCH 0307/1050] gpio: Add gpio-fsm driver +Subject: [PATCH 0306/1183] 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 @@ -191528,7 +191482,7 @@ index 000000000000..eb40cfdc71df From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 26 Oct 2020 10:23:22 +0000 -Subject: [PATCH 0308/1050] staging: bcm2835-audio: Add disable-headphones flag +Subject: [PATCH 0307/1183] 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. @@ -191568,7 +191522,7 @@ index a0cba3823e5e..ccda115ab9e0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 26 Oct 2020 16:38:21 +0000 -Subject: [PATCH 0309/1050] rpisense-fb: Set pseudo_pallete to prevent crash on +Subject: [PATCH 0308/1183] rpisense-fb: Set pseudo_pallete to prevent crash on fbcon takeover Signed-off-by: Serge Schneider @@ -191604,7 +191558,7 @@ index 26432a5a0b4b..325977def531 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 27 Oct 2020 09:59:49 +0000 -Subject: [PATCH 0310/1050] dwc_otg: Minimise header and fix build warnings +Subject: [PATCH 0309/1183] 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. @@ -192509,7 +192463,7 @@ index e55ea9c74be4..76e94b4ebb43 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 27 Oct 2020 12:10:40 +0000 -Subject: [PATCH 0311/1050] rpivid_h625: Fix build warnings +Subject: [PATCH 0310/1183] rpivid_h625: Fix build warnings Signed-off-by: Phil Elwell --- @@ -192583,7 +192537,7 @@ index b677910e237c..fc3caed58187 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 27 Oct 2020 12:12:22 +0000 -Subject: [PATCH 0312/1050] bcm2708_fb: Fix a build warning +Subject: [PATCH 0311/1183] bcm2708_fb: Fix a build warning Signed-off-by: Phil Elwell --- @@ -192611,7 +192565,7 @@ index dac5c021ce52..365c5b96b8a0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Thu, 22 Oct 2020 15:30:55 +0100 -Subject: [PATCH 0313/1050] watchdog: bcm2835: Ignore params after the +Subject: [PATCH 0312/1183] watchdog: bcm2835: Ignore params after the partition number Use sscanf to extract the partition number and ignore extra parameters @@ -192646,7 +192600,7 @@ index 58d5a1b89584..e8d151d524fd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 20 Oct 2020 11:55:37 +0100 -Subject: [PATCH 0314/1050] firmware: raspberrypi: Add support for tryonce +Subject: [PATCH 0313/1183] firmware: raspberrypi: Add support for tryonce reboot flag Define a new mailbox (SET_REBOOT_FLAGS) which may be used to @@ -192726,7 +192680,7 @@ index 6a7b665a1a82..ee361b90eb29 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 14 May 2019 17:00:41 +0100 -Subject: [PATCH 0315/1050] phy: broadcom: split out the BCM54213PE from the +Subject: [PATCH 0314/1183] phy: broadcom: split out the BCM54213PE from the BCM54210E IDs The last nibble is a revision ID, and the 54213pe is a later rev @@ -192805,7 +192759,7 @@ index c2c2147dfeb8..ea2f8ea92d54 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 29 Oct 2020 14:10:56 +0000 -Subject: [PATCH 0316/1050] phy: broadcom: Add bcm54213pe configuration +Subject: [PATCH 0315/1183] phy: broadcom: Add bcm54213pe configuration Signed-off-by: Phil Elwell --- @@ -192845,7 +192799,7 @@ index 6f93379bfdd9..05492268ae42 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 Nov 2020 17:08:33 +0000 -Subject: [PATCH 0317/1050] PCI: brcmstb: Restore initial fundamental reset +Subject: [PATCH 0316/1183] 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 @@ -192886,7 +192840,7 @@ index 77967a37cbd9..d26844f03e25 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 6 Nov 2020 18:45:10 +0000 -Subject: [PATCH 0318/1050] Input: edt-ft5x06: Poll the device if no interrupt +Subject: [PATCH 0317/1183] Input: edt-ft5x06: Poll the device if no interrupt is configured. Not all systems have the interrupt line wired up, so switch to @@ -192989,7 +192943,7 @@ index bb2e1cbffba7..339eae4ec7a8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 23 Apr 2020 10:17:18 +0100 -Subject: [PATCH 0319/1050] drm/panel/raspberrypi-touchscreen: Use independent +Subject: [PATCH 0318/1183] drm/panel/raspberrypi-touchscreen: Use independent I2C actions with delay. We now have the hardware I2C controller pinmuxed to the drive the @@ -193053,7 +193007,7 @@ index 145047e19394..2ef5f611a334 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 10 Nov 2020 11:21:56 +0000 -Subject: [PATCH 0320/1050] drm/panel/raspberrypi-ts: Insert delay before +Subject: [PATCH 0319/1183] drm/panel/raspberrypi-ts: Insert delay before polling for startup state In switching to the hardware I2C controller there is an issue @@ -193085,7 +193039,7 @@ index 2ef5f611a334..bd15c2f2e247 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 12 Nov 2020 17:01:52 +0000 -Subject: [PATCH 0321/1050] dt-bindings: Add compatible for BCM2711 DSI1 +Subject: [PATCH 0320/1183] 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. @@ -193114,7 +193068,7 @@ index 32608578a352..112bc56de0b1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 2 Dec 2020 15:22:23 +0000 -Subject: [PATCH 0322/1050] media: bcm2835-unicam: Correctly handle error +Subject: [PATCH 0321/1183] media: bcm2835-unicam: Correctly handle error propagation for stream on On a failure in start_streaming(), the error code would not propagate to @@ -193147,7 +193101,7 @@ index 6501fb205e20..c13a0a20fd12 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 2 Dec 2020 15:26:09 +0000 -Subject: [PATCH 0323/1050] media: bcm2835-unicam: Return early from +Subject: [PATCH 0322/1183] media: bcm2835-unicam: Return early from stop_streaming() if stopped clk_disable_unprepare() is called unconditionally in stop_streaming(). @@ -193217,7 +193171,7 @@ index c13a0a20fd12..60309de02369 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 2 Dec 2020 16:48:41 +0000 -Subject: [PATCH 0324/1050] media: bcm2835-unicam: Clear clock state when +Subject: [PATCH 0323/1183] media: bcm2835-unicam: Clear clock state when stopping streaming Commit 65e08c465020d4c5b51afb452efc2246d80fd66f failed to clear the @@ -193248,7 +193202,7 @@ index 60309de02369..a8b3f5433f04 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 3 Dec 2020 13:44:42 +0000 -Subject: [PATCH 0325/1050] PCI: brcmstb: Advertise MSI-X support +Subject: [PATCH 0324/1183] 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 @@ -193281,7 +193235,7 @@ index d26844f03e25..44f0ea66b60b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 15 Dec 2020 16:38:37 +0000 -Subject: [PATCH 0326/1050] net: lan78xx: Ack pending PHY ints when resetting +Subject: [PATCH 0325/1183] 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 @@ -193319,7 +193273,7 @@ index 0cf3f00b52ff..ac68716136cf 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 9 Dec 2020 11:30:12 +0000 -Subject: [PATCH 0327/1050] media: i2c: imx477: Selection compliance fixes +Subject: [PATCH 0326/1183] 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 @@ -193405,7 +193359,7 @@ index d0848f3f3c09..07a1e023ade8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: gesangtome Date: Fri, 1 Jan 2021 18:03:17 +0800 -Subject: [PATCH 0328/1050] vc-sm-cma: fixed kbuild problem +Subject: [PATCH 0327/1183] vc-sm-cma: fixed kbuild problem error logs: drivers/staging/vc04_services/vc-sm-cma/Kconfig:1:error: recursive dependency detected! @@ -193441,7 +193395,7 @@ index a7c1a7bf516e..5df9198cdab1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 Jan 2021 10:43:20 +0000 -Subject: [PATCH 0329/1050] staging/vc04_services: Add additional unpacked raw +Subject: [PATCH 0328/1183] staging/vc04_services: Add additional unpacked raw formats Support has been added for the unpacked (16bpp) versions of @@ -193498,7 +193452,7 @@ index 8eb6334ee055..59f7ad3a5b3b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 Jan 2021 10:45:16 +0000 -Subject: [PATCH 0330/1050] staging/bcm2835-codec: Add the unpacked (16bpp) raw +Subject: [PATCH 0329/1183] staging/bcm2835-codec: Add the unpacked (16bpp) raw formats Now that the firmware supports the unpacked (16bpp) variants @@ -193671,7 +193625,7 @@ index 8a8f1e8db7d0..c883db63808f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 Jan 2021 11:41:26 +0000 -Subject: [PATCH 0331/1050] staging/bcm2835-codec: Log the number of excess +Subject: [PATCH 0330/1183] staging/bcm2835-codec: Log the number of excess supported formats When logging that the firmware has provided more supported formats @@ -193720,7 +193674,7 @@ index c883db63808f..94691ab7175a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 Jan 2021 11:37:10 +0000 -Subject: [PATCH 0332/1050] staging/bcm2835-isp: Add the unpacked (16bpp) raw +Subject: [PATCH 0331/1183] staging/bcm2835-isp: Add the unpacked (16bpp) raw formats Now that the firmware supports the unpacked (16bpp) variants @@ -193902,7 +193856,7 @@ index 8bb3d115b27a..9a313ffcabf5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 7 Jan 2021 11:43:22 +0000 -Subject: [PATCH 0333/1050] staging/bcm2835-isp: Log the number of excess +Subject: [PATCH 0332/1183] staging/bcm2835-isp: Log the number of excess supported formats When logging that the firmware has provided more supported formats @@ -193937,7 +193891,7 @@ index 9a313ffcabf5..afac2ad65790 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 6 Jan 2021 18:16:10 +0000 -Subject: [PATCH 0334/1050] bcm2835-dma: Avoid losing CS flags after interrupt +Subject: [PATCH 0333/1183] bcm2835-dma: Avoid losing CS flags after interrupt Signed-off-by: Dom Cobley --- @@ -193964,7 +193918,7 @@ index 0cbfa9d559a2..9878d1bed589 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 8 Jan 2021 13:37:25 +0000 -Subject: [PATCH 0335/1050] arch/arm: Add __memset alias to memset_rpi.S +Subject: [PATCH 0334/1183] arch/arm: Add __memset alias to memset_rpi.S memset_rpi.S is an optimised memset implementation, but doesn't define __memset (which was just added to memset.S). As a result, building @@ -194003,7 +193957,7 @@ index e8469cecabc1..bda4c5b99367 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 30 Dec 2020 14:51:29 +0000 -Subject: [PATCH 0336/1050] bcm2835-dma: Add bcm2835-dma: Add DMA_WIDE_SOURCE +Subject: [PATCH 0335/1183] bcm2835-dma: Add bcm2835-dma: Add DMA_WIDE_SOURCE and DMA_WIDE_DEST flags Use (reserved) bits 24 and 25 of the dreq value @@ -194073,7 +194027,7 @@ index 9878d1bed589..6aee9e97d207 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 14 Jan 2021 09:18:42 +0000 -Subject: [PATCH 0337/1050] uapi: bcm2835-isp: Add colour denoise configuration +Subject: [PATCH 0336/1183] uapi: bcm2835-isp: Add colour denoise configuration Add a configuration structure for colour denoise to the bcm2835_isp driver. @@ -194135,7 +194089,7 @@ index cf8c0437f159..c50e3ca81565 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 14 Jan 2021 09:20:52 +0000 -Subject: [PATCH 0338/1050] staging: vc04_services: ISP: Add colour denoise +Subject: [PATCH 0337/1183] staging: vc04_services: ISP: Add colour denoise control Add colour denoise control to the bcm2835 driver through a new v4l2 @@ -194220,7 +194174,7 @@ index efda4dc039c3..79438d23912f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 28 Jan 2021 11:30:04 +0000 -Subject: [PATCH 0339/1050] spi: bcm2835: Workaround/fix for zero-length +Subject: [PATCH 0338/1183] spi: bcm2835: Workaround/fix for zero-length transfers A relatively recent commit ([1]) contained optimisation for the PIO @@ -194276,7 +194230,7 @@ index 2a0cab8435b0..4e27135eba32 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 29 Jan 2021 10:34:11 +0000 -Subject: [PATCH 0340/1050] kbuild: Silence unavoidable dtc overlay warnings +Subject: [PATCH 0339/1183] 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 @@ -194313,7 +194267,7 @@ index dff7d1ef5ff4..fa25e95035a9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 4 Feb 2021 17:29:32 +0000 -Subject: [PATCH 0341/1050] media: i2c: imx290: Replace V4L2_CID_GAIN with +Subject: [PATCH 0340/1183] media: i2c: imx290: Replace V4L2_CID_GAIN with V4L2_CID_ANALOGUE_GAIN Most software (including libcamera) requires V4L2_CID_ANALOGUE_GAIN, @@ -194357,7 +194311,7 @@ index def5e8fe41a0..1028a339beee 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 4 Feb 2021 21:21:44 +0000 -Subject: [PATCH 0342/1050] media: i2c: imx290: Fix number of controls in +Subject: [PATCH 0341/1183] media: i2c: imx290: Fix number of controls in v4l2_ctrl_handler_init The number is only a hint, but may as well be correct. @@ -194391,7 +194345,7 @@ index 1028a339beee..401afc4dc67d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 11 Jan 2021 15:23:07 +0100 -Subject: [PATCH 0343/1050] dt-binding: display: bcm2711-hdmi: Add CEC and +Subject: [PATCH 0342/1183] dt-binding: display: bcm2711-hdmi: Add CEC and hotplug interrupts The CEC and hotplug interrupts were missing when that binding was @@ -194423,7 +194377,7 @@ index a1d5a32660e0..57324a5f0271 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 8 Feb 2021 11:48:35 +0000 -Subject: [PATCH 0344/1050] staging:bcm2835-camera: Fix the cherry-pick of AWB +Subject: [PATCH 0343/1183] staging:bcm2835-camera: Fix the cherry-pick of AWB Greyworld The cherry-pick of the patch that added the greyworld AWB mode @@ -194457,7 +194411,7 @@ index a7af25f90449..f73daa38fa66 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 12 Jan 2021 13:55:39 +0000 -Subject: [PATCH 0345/1050] bcm2835-isp: Allow formats with different colour +Subject: [PATCH 0344/1183] bcm2835-isp: Allow formats with different colour spaces. Each supported format now includes a mask showing the allowed colour @@ -195177,7 +195131,7 @@ index 4d24aec7203d..5cca8bdd1d65 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 8 Feb 2021 16:01:37 +0000 -Subject: [PATCH 0346/1050] staging: rpivid: Fix crash when CMA alloc fails +Subject: [PATCH 0345/1183] 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 @@ -195303,7 +195257,7 @@ index fc3caed58187..e6b07920aa8c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 10 Feb 2021 10:18:53 +0000 -Subject: [PATCH 0347/1050] media: i2c: imx477: Remove auto frame length +Subject: [PATCH 0346/1183] media: i2c: imx477: Remove auto frame length adjusting The V4L2_CID_EXPOSURE_AUTO_PRIORITY was used to let the sensor control @@ -195451,7 +195405,7 @@ index 07a1e023ade8..217780b88ad1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 10 Feb 2021 10:50:32 +0000 -Subject: [PATCH 0348/1050] media: i2c: imx477: Add very long exposure control +Subject: [PATCH 0347/1183] media: i2c: imx477: Add very long exposure control to the driver Add support for very long exposures by using the exposure multiplier @@ -195583,7 +195537,7 @@ index 217780b88ad1..7907d5142d17 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 17 Feb 2021 18:08:12 +0000 -Subject: [PATCH 0349/1050] media: i2c: imx290: Fix up exposure calcuations and +Subject: [PATCH 0348/1183] media: i2c: imx290: Fix up exposure calcuations and ranges Should now correspond exactly to the datasheet. @@ -195648,7 +195602,7 @@ index 401afc4dc67d..36e9261af23d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 18 Feb 2021 11:58:29 +0000 -Subject: [PATCH 0350/1050] media: i2c: imx290: Handle exposure correctly when +Subject: [PATCH 0349/1183] media: i2c: imx290: Handle exposure correctly when vblank changes When vblank changes we must modify the exposure range. Also, with this @@ -195696,7 +195650,7 @@ index 36e9261af23d..836d3684c273 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 18 Feb 2021 15:05:57 +0000 -Subject: [PATCH 0351/1050] media: i2c: imx477: Fix crop height for 2028x1080 +Subject: [PATCH 0350/1183] media: i2c: imx477: Fix crop height for 2028x1080 mode The crop height for this mode was set at 2600 lines, it should be 2160 @@ -195727,7 +195681,7 @@ index 7907d5142d17..27ee391eee49 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 18 Feb 2021 15:23:11 +0000 -Subject: [PATCH 0352/1050] media: i2c: imx477: Replace existing 1012x760 mode +Subject: [PATCH 0351/1183] 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 @@ -195930,7 +195884,7 @@ index 27ee391eee49..178ddc43bb73 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 19 Feb 2021 10:30:49 +0000 -Subject: [PATCH 0353/1050] media: i2c: imx477: Remove internal +Subject: [PATCH 0352/1183] 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 @@ -196006,7 +195960,7 @@ index 178ddc43bb73..74e8d892d4a6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 19 Feb 2021 11:06:40 +0000 -Subject: [PATCH 0354/1050] media: i2c: imx477: Remove unused function +Subject: [PATCH 0353/1183] media: i2c: imx477: Remove unused function parameter The struct imx477 *ctrl parameter is not used in the function @@ -196047,7 +196001,7 @@ index 74e8d892d4a6..31e48512c165 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 5 Mar 2021 15:40:45 +0000 -Subject: [PATCH 0355/1050] media: bcm2835-unicam: Fix bug in buffer swapping +Subject: [PATCH 0354/1183] media: bcm2835-unicam: Fix bug in buffer swapping logic If multiple sets of interrupts occur simultaneously, it may be unsafe @@ -196129,7 +196083,7 @@ index a8b3f5433f04..234f0eaf9c8c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 8 Mar 2021 15:32:25 +0000 -Subject: [PATCH 0356/1050] Assign crypto aliases to different AES +Subject: [PATCH 0355/1183] Assign crypto aliases to different AES implementation modules The kernel modules aes-neon-blk and aes-neon-bs perform poorly, at least on @@ -196244,7 +196198,7 @@ index fb507d569922..cc52829d426a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 1 Feb 2021 18:48:47 +0000 -Subject: [PATCH 0357/1050] media/v4l2_m2m: In buffered mode run jobs if either +Subject: [PATCH 0356/1183] media/v4l2_m2m: In buffered mode run jobs if either port is streaming In order to get the intended behaviour of the stateful video @@ -196259,7 +196213,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 3de683b5e06d..9af3a2f9a041 100644 +index 8aeed39c415f..533fb839fb0b 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, @@ -196283,7 +196237,7 @@ index 3de683b5e06d..9af3a2f9a041 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 1 Feb 2021 18:55:37 +0000 -Subject: [PATCH 0358/1050] staging/bcm2835-codec: Correct logging of size_t to +Subject: [PATCH 0357/1183] staging/bcm2835-codec: Correct logging of size_t to %zu Fixes: "staging/bcm2835-codec: Log the number of excess supported formats" @@ -196323,7 +196277,7 @@ index 94691ab7175a..0c4d8bf77b91 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 2 Feb 2021 15:50:18 +0000 -Subject: [PATCH 0359/1050] staging/bcm2835-codec: Add support for pixel aspect +Subject: [PATCH 0358/1183] staging/bcm2835-codec: Add support for pixel aspect ratio If the format is detected by the driver and a V4L2_EVENT_SOURCE_CHANGE @@ -196411,7 +196365,7 @@ index 0c4d8bf77b91..46f659e55f18 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 2 Feb 2021 16:46:39 +0000 -Subject: [PATCH 0360/1050] staging/bcm2835-codec: Implement additional +Subject: [PATCH 0359/1183] staging/bcm2835-codec: Implement additional g_selection calls for decode v4l_cropcap calls our vidioc_g_pixelaspect function to get the pixel @@ -196452,7 +196406,7 @@ index 46f659e55f18..7aa6c53e279e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 10 Mar 2021 19:07:48 +0000 -Subject: [PATCH 0361/1050] staging/bcm2835-codec: Add VC-1 support. +Subject: [PATCH 0360/1183] staging/bcm2835-codec: Add VC-1 support. Providing the relevant licence has been purchased, then Pi0-3 can decode VC-1. @@ -196487,7 +196441,7 @@ index 7aa6c53e279e..5729a8a7d94e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 17 Mar 2021 12:45:53 +0000 -Subject: [PATCH 0362/1050] hack: fixup bcm2835-unicam +Subject: [PATCH 0361/1183] hack: fixup bcm2835-unicam --- drivers/media/platform/bcm2835/bcm2835-unicam.c | 3 +++ @@ -196514,7 +196468,7 @@ index 234f0eaf9c8c..db99d1562904 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Zefa Chen Date: Fri, 17 May 2019 18:23:03 +0800 -Subject: [PATCH 0363/1050] media: i2c: add ov9281 driver. +Subject: [PATCH 0362/1183] media: i2c: add ov9281 driver. Change-Id: I7b77250bbc56d2f861450cf77271ad15f9b88ab1 Signed-off-by: Zefa Chen @@ -197743,7 +197697,7 @@ index 000000000000..6d1d3ddc3970 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 14 Apr 2020 15:47:09 +0100 -Subject: [PATCH 0364/1050] media: i2c: ov9281: fix mclk issue when probe +Subject: [PATCH 0363/1183] media: i2c: ov9281: fix mclk issue when probe multiple camera. Takes the ov9281 part only from the Rockchip's patch. @@ -197809,7 +197763,7 @@ index 6d1d3ddc3970..68142ec69c5c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 14 Apr 2020 15:51:50 +0100 -Subject: [PATCH 0365/1050] media: i2c: ov9281: add enum_frame_interval +Subject: [PATCH 0364/1183] 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 @@ -197912,7 +197866,7 @@ index 68142ec69c5c..52bba5dff953 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 14 Apr 2020 16:12:33 +0100 -Subject: [PATCH 0366/1050] media: i2c: ov9281: Fixup for recent kernel +Subject: [PATCH 0365/1183] 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 @@ -198595,7 +198549,7 @@ index 52bba5dff953..b28dbe6d08c3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 6 Jul 2020 17:51:32 +0100 -Subject: [PATCH 0367/1050] media: i2c: ov9281: Read chip ID via 2 reads +Subject: [PATCH 0366/1183] 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 @@ -198643,7 +198597,7 @@ index b28dbe6d08c3..837b37198bb4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Jul 2020 18:29:10 +0100 -Subject: [PATCH 0368/1050] media: i2c: ov9281: Add support for 8 bit readout +Subject: [PATCH 0367/1183] 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. @@ -198837,7 +198791,7 @@ index 837b37198bb4..05cf78416bc7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sun, 22 Nov 2020 11:01:08 +0000 -Subject: [PATCH 0369/1050] media: ov9281: Add 1280x720 and 640x480 modes +Subject: [PATCH 0368/1183] media: ov9281: Add 1280x720 and 640x480 modes Breaks out common register set and adds the different registers for 1280x720 (cropped) and 640x480 (skipped) modes @@ -199052,7 +199006,7 @@ index 05cf78416bc7..132cbf6aad8a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mathias Anhalt Date: Sun, 24 Jan 2021 15:15:01 +0100 -Subject: [PATCH 0370/1050] Fixed picture line bug in all ov9281 modes +Subject: [PATCH 0369/1183] Fixed picture line bug in all ov9281 modes Signed-off-by: Mathias Anhalt --- @@ -199096,7 +199050,7 @@ index 132cbf6aad8a..eff9bc356326 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mathias Anhalt Date: Wed, 3 Feb 2021 20:34:09 +0100 -Subject: [PATCH 0371/1050] Added hflip and vflip controls to ov9281 +Subject: [PATCH 0370/1183] Added hflip and vflip controls to ov9281 Signed-off-by: Mathias Anhalt --- @@ -199214,7 +199168,7 @@ index eff9bc356326..8d799b8b53c6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 15 Jan 2020 13:40:38 +0000 -Subject: [PATCH 0372/1050] media: ov5647: Fix return codes from +Subject: [PATCH 0371/1183] media: ov5647: Fix return codes from ov5647_write/ov5647_read functions. Previously they were returning positive non-zero codes for success, @@ -199309,7 +199263,7 @@ index d346d18ce629..c5c68ec75473 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 4 Jul 2020 01:45:08 +0300 -Subject: [PATCH 0373/1050] media: i2c: ov5647: Parse and register properties +Subject: [PATCH 0372/1183] media: i2c: ov5647: Parse and register properties Parse device properties and register controls for them using the V4L2 fwnode properties helpers. @@ -199364,7 +199318,7 @@ index c5c68ec75473..9158f44ec822 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 22 Feb 2021 18:47:19 +0000 -Subject: [PATCH 0374/1050] clk-raspberrypi: Also support HEVC clock +Subject: [PATCH 0373/1183] clk-raspberrypi: Also support HEVC clock Signed-off-by: Dom Cobley --- @@ -199372,10 +199326,10 @@ Signed-off-by: Dom Cobley 1 file changed, 1 insertion(+) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c -index 19f4e3b7b190..1e1bee7f43ed 100644 +index 904327cfd9d4..0b38fb334185 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c -@@ -271,6 +271,7 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, +@@ -276,6 +276,7 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, case RPI_FIRMWARE_CORE_CLK_ID: case RPI_FIRMWARE_M2MC_CLK_ID: case RPI_FIRMWARE_V3D_CLK_ID: @@ -199390,7 +199344,7 @@ index 19f4e3b7b190..1e1bee7f43ed 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 22 Feb 2021 18:50:50 +0000 -Subject: [PATCH 0375/1050] rpivid: Request maximum hevc clock +Subject: [PATCH 0374/1183] rpivid: Request maximum hevc clock Query maximum and minimum clock from driver and use those @@ -199447,7 +199401,7 @@ index 3b9e51ca05b3..b377c17dfb21 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 17 Mar 2021 12:34:57 +0000 -Subject: [PATCH 0376/1050] staging/bcm2835-camera: Add support for DMABUFs +Subject: [PATCH 0375/1183] staging/bcm2835-camera: Add support for DMABUFs DMABUFs are all handled by videobuf2, so there is no reason not to enable support for them. @@ -199490,7 +199444,7 @@ index 5d14ddb28339..0a8721eaa6d3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 19 Feb 2021 10:25:01 +0000 -Subject: [PATCH 0377/1050] staging: fbtft: Add minipitft13 variant +Subject: [PATCH 0376/1183] 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 @@ -199600,7 +199554,7 @@ index 861a154144e6..3bcd9ee17b6c 100644 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 0378/1050] dwc-otg: fix clang -Wignored-attributes warning +Subject: [PATCH 0377/1183] dwc-otg: fix clang -Wignored-attributes warning warning: attribute declaration must precede definition --- @@ -199642,7 +199596,7 @@ index 537cc237b4bc..86b4aaf977fb 100644 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 0379/1050] dwc-otg: fix clang -Wsometimes-uninitialized +Subject: [PATCH 0378/1183] dwc-otg: fix clang -Wsometimes-uninitialized warning warning: variable 'retval' is used uninitialized whenever 'if' condition is false @@ -199670,7 +199624,7 @@ index 799ab14b9eda..e1c1e3804095 100644 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 0380/1050] dwc-otg: fix clang -Wpointer-bool-conversion +Subject: [PATCH 0379/1183] dwc-otg: fix clang -Wpointer-bool-conversion warning warning: address of array 'desc->wMaxPacketSize' will always evaluate to 'true' @@ -199701,7 +199655,7 @@ index 9dabbe5c9791..2ffd4f11d0bf 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 4 Nov 2020 18:54:20 +0000 -Subject: [PATCH 0381/1050] staging: vcsm-cma: Fix memory leak from not +Subject: [PATCH 0380/1183] staging: vcsm-cma: Fix memory leak from not detaching dmabuf When importing there was a missing call to detach the buffer, @@ -199784,7 +199738,7 @@ index 40ce67f06fac..88c4df822922 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 13 Apr 2021 11:00:01 +0200 -Subject: [PATCH 0382/1050] clk: Introduce a clock request API +Subject: [PATCH 0381/1183] 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 @@ -199829,7 +199783,7 @@ Signed-off-by: Maxime Ripard 2 files changed, 125 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index d6dc58bd07b3..bc569c1670ad 100644 +index 0674dbc62eb5..9daf76537d6c 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -77,12 +77,14 @@ struct clk_core { @@ -199860,7 +199814,7 @@ index d6dc58bd07b3..bc569c1670ad 100644 /*** runtime pm ***/ static int clk_pm_runtime_get(struct clk_core *core) { -@@ -1452,10 +1460,14 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate) +@@ -1451,10 +1459,14 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate) { int ret; struct clk_rate_request req; @@ -199875,7 +199829,7 @@ index d6dc58bd07b3..bc569c1670ad 100644 ret = clk_core_round_rate_nolock(hw->core, &req); if (ret) return 0; -@@ -1476,6 +1488,7 @@ EXPORT_SYMBOL_GPL(clk_hw_round_rate); +@@ -1475,6 +1487,7 @@ EXPORT_SYMBOL_GPL(clk_hw_round_rate); long clk_round_rate(struct clk *clk, unsigned long rate) { struct clk_rate_request req; @@ -199883,7 +199837,7 @@ index d6dc58bd07b3..bc569c1670ad 100644 int ret; if (!clk) -@@ -1489,6 +1502,9 @@ long clk_round_rate(struct clk *clk, unsigned long rate) +@@ -1488,6 +1501,9 @@ long clk_round_rate(struct clk *clk, unsigned long rate) clk_core_get_boundaries(clk->core, &req.min_rate, &req.max_rate); req.rate = rate; @@ -199893,7 +199847,7 @@ index d6dc58bd07b3..bc569c1670ad 100644 ret = clk_core_round_rate_nolock(clk->core, &req); if (clk->exclusive_count) -@@ -1956,6 +1972,7 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, +@@ -1955,6 +1971,7 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, unsigned long new_rate; unsigned long min_rate; unsigned long max_rate; @@ -199901,7 +199855,7 @@ index d6dc58bd07b3..bc569c1670ad 100644 int p_index = 0; long ret; -@@ -1970,6 +1987,9 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, +@@ -1969,6 +1986,9 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, clk_core_get_boundaries(core, &min_rate, &max_rate); @@ -199911,7 +199865,7 @@ index d6dc58bd07b3..bc569c1670ad 100644 /* find the closest rate and parent clk/rate */ if (clk_core_can_round(core)) { struct clk_rate_request req; -@@ -2166,6 +2186,7 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, +@@ -2165,6 +2185,7 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, { int ret, cnt; struct clk_rate_request req; @@ -199919,7 +199873,7 @@ index d6dc58bd07b3..bc569c1670ad 100644 lockdep_assert_held(&prepare_lock); -@@ -2180,6 +2201,9 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, +@@ -2179,6 +2200,9 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, clk_core_get_boundaries(core, &req.min_rate, &req.max_rate); req.rate = req_rate; @@ -199929,7 +199883,7 @@ index d6dc58bd07b3..bc569c1670ad 100644 ret = clk_core_round_rate_nolock(core, &req); /* restore the protection */ -@@ -2273,6 +2297,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) +@@ -2272,6 +2296,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) ret = clk_core_set_rate_nolock(clk->core, rate); @@ -199939,7 +199893,7 @@ index d6dc58bd07b3..bc569c1670ad 100644 if (clk->exclusive_count) clk_core_rate_protect(clk->core); -@@ -2444,6 +2471,99 @@ int clk_set_max_rate(struct clk *clk, unsigned long rate) +@@ -2443,6 +2470,99 @@ int clk_set_max_rate(struct clk *clk, unsigned long rate) } EXPORT_SYMBOL_GPL(clk_set_max_rate); @@ -200039,7 +199993,7 @@ index d6dc58bd07b3..bc569c1670ad 100644 /** * clk_get_parent - return the parent of a clk * @clk: the clk whose parent gets returned -@@ -3916,6 +4036,7 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw) +@@ -3915,6 +4035,7 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw) goto fail_parents; INIT_HLIST_HEAD(&core->clks); @@ -200076,7 +200030,7 @@ index 266e8de3cb51..2aa52140d8a9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 13 Apr 2021 16:48:35 +0100 -Subject: [PATCH 0383/1050] bcm2835-unicam: Switch to new clock api +Subject: [PATCH 0382/1183] bcm2835-unicam: Switch to new clock api Signed-off-by: Dom Cobley --- @@ -200135,7 +200089,7 @@ index db99d1562904..a603891986b9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 19 Apr 2021 19:30:26 +0100 -Subject: [PATCH 0384/1050] rpivid: Switch to new clock api +Subject: [PATCH 0383/1183] rpivid: Switch to new clock api Signed-off-by: Dom Cobley --- @@ -200197,7 +200151,7 @@ index b377c17dfb21..def891a86e55 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 20 Apr 2021 13:34:18 +0100 -Subject: [PATCH 0385/1050] rpivid: Only clk_request_done once +Subject: [PATCH 0384/1183] rpivid: Only clk_request_done once Fixes: 25486f49bfe2e3ae13b90478d1eebd91413136ad Signed-off-by: Dom Cobley @@ -200229,7 +200183,7 @@ index def891a86e55..37c8f62649d6 100644 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 0386/1050] dwc_otg: fix an undeclared variable Replace an +Subject: [PATCH 0385/1183] 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 @@ -200259,7 +200213,7 @@ index 50c8705185ad..2ee27450c6f6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 15 Apr 2021 17:30:35 +0100 -Subject: [PATCH 0387/1050] drm/panel: jdi-lt070me05000: Use +Subject: [PATCH 0386/1183] drm/panel: jdi-lt070me05000: Use gpiod_set_value_cansleep There is no reason why the control GPIOs for the panel can not @@ -200332,7 +200286,7 @@ index 3c86ad262d5e..ff827cc7a060 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 21 Apr 2021 12:14:44 +0200 -Subject: [PATCH 0388/1050] clk: requests: Ignore if the pointer is null +Subject: [PATCH 0387/1183] clk: requests: Ignore if the pointer is null Signed-off-by: Maxime Ripard --- @@ -200340,10 +200294,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 3 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index bc569c1670ad..cdcbcf5053d7 100644 +index 9daf76537d6c..de82a4f572bc 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2541,6 +2541,9 @@ void clk_request_done(struct clk_request *req) +@@ -2540,6 +2540,9 @@ void clk_request_done(struct clk_request *req) { struct clk_core *core = req->clk->core; @@ -200360,7 +200314,7 @@ index bc569c1670ad..cdcbcf5053d7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 22 Apr 2021 10:45:37 +0200 -Subject: [PATCH 0389/1050] clk: requests: Dereference the request pointer +Subject: [PATCH 0388/1183] clk: requests: Dereference the request pointer after the check The current code will first dereference the req pointer and then test if @@ -200373,10 +200327,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index cdcbcf5053d7..b829858525ae 100644 +index de82a4f572bc..751193365d2c 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2539,10 +2539,11 @@ EXPORT_SYMBOL_GPL(clk_request_start); +@@ -2538,10 +2538,11 @@ EXPORT_SYMBOL_GPL(clk_request_start); */ void clk_request_done(struct clk_request *req) { @@ -200396,7 +200350,7 @@ index cdcbcf5053d7..b829858525ae 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Mar 2021 18:28:40 +0000 -Subject: [PATCH 0390/1050] staging/bcm2835-codec: Fix support for levels 4.1 +Subject: [PATCH 0389/1183] 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 @@ -200438,7 +200392,7 @@ index 5729a8a7d94e..4622057e71cb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 4 Feb 2021 19:08:23 +0000 -Subject: [PATCH 0391/1050] staging/bcm2835-codec: Set the colourspace +Subject: [PATCH 0390/1183] staging/bcm2835-codec: Set the colourspace appropriately for RGB formats Video decode supports YUV and RGB formats. YUV needs to report SMPTE170M @@ -200528,7 +200482,7 @@ index 4622057e71cb..08429a42c847 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 9 Dec 2020 18:53:56 +0000 -Subject: [PATCH 0392/1050] staging/bcm2835-codec: Pass corrupt frame flag. +Subject: [PATCH 0391/1183] 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. @@ -200576,7 +200530,7 @@ index 08429a42c847..3ed9f47a37fe 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Mar 2021 18:34:50 +0000 -Subject: [PATCH 0393/1050] staging/bcm2835-camera: Add support for H264 levels +Subject: [PATCH 0392/1183] 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 @@ -200640,7 +200594,7 @@ index f73daa38fa66..f3480a5c5170 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 15 Apr 2021 11:07:55 +0100 -Subject: [PATCH 0394/1050] staging/bcm2835-codec: Do not update crop from +Subject: [PATCH 0393/1183] staging/bcm2835-codec: Do not update crop from S_FMT after res change During decode, setting the CAPTURE queue format was setting the crop @@ -200682,7 +200636,7 @@ index 3ed9f47a37fe..a97666a1a4be 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 23 Apr 2021 16:16:49 +0100 -Subject: [PATCH 0395/1050] staging/bcm2835-isp: Fix compiler warning +Subject: [PATCH 0394/1183] 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 @@ -200713,7 +200667,7 @@ index 5cca8bdd1d65..08dce8bba9bb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 27 Apr 2021 08:59:01 +0100 -Subject: [PATCH 0396/1050] gpio-poweroff: Remember the old poweroff handler +Subject: [PATCH 0395/1183] 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 @@ -200772,7 +200726,7 @@ index e5dca66360a7..81e7acb8acb5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 11 May 2021 12:52:26 +0100 -Subject: [PATCH 0397/1050] media: i2c: ov5647: Correct pixel array offset +Subject: [PATCH 0396/1183] 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). @@ -200803,7 +200757,7 @@ index 9158f44ec822..4228e98e7975 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 11 May 2021 12:57:22 +0100 -Subject: [PATCH 0398/1050] media: i2c: ov5647: Correct minimum VBLANK value +Subject: [PATCH 0397/1183] 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 @@ -200835,7 +200789,7 @@ index 4228e98e7975..62adb70df488 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 12 May 2021 07:39:21 +0100 -Subject: [PATCH 0399/1050] media: i2c: ov5647: Fix v4l2-compliance failure +Subject: [PATCH 0398/1183] media: i2c: ov5647: Fix v4l2-compliance failure subscribing to events Fixes the following v4l2-compliance failure: @@ -200867,7 +200821,7 @@ index 62adb70df488..4b6f4962e644 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 21 May 2020 11:49:37 +0100 -Subject: [PATCH 0400/1050] media: rpivid: Remove the need to have +Subject: [PATCH 0399/1183] media: rpivid: Remove the need to have num_entry_points set VAAPI H265 has num entry points but never sets it. Allow a VAAPI @@ -201850,7 +201804,7 @@ index e6b07920aa8c..434a366ecfc2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 11 Mar 2021 12:51:00 +0000 -Subject: [PATCH 0401/1050] media: rpivid: Convert to MPLANE +Subject: [PATCH 0400/1183] media: rpivid: Convert to MPLANE Use multi-planar interface rather than single plane interface. This allows dmabufs holding compressed data to be resized. @@ -202193,7 +202147,7 @@ index 9c4f3fb2f9f6..5c0fd9c8a6d7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 11 Mar 2021 18:43:15 +0000 -Subject: [PATCH 0402/1050] media: rpivid: Add an enable count to irq claim Qs +Subject: [PATCH 0401/1183] 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 @@ -202437,7 +202391,7 @@ index cf4cc8be8a55..ec73a2332b73 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Sun, 21 Mar 2021 16:38:54 -0300 -Subject: [PATCH 0403/1050] RFC: media: Add media_request_{pin,unpin} API +Subject: [PATCH 0402/1183] 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. @@ -202539,7 +202493,7 @@ index 3cd25a2717ce..0de5c2c94188 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 11 Mar 2021 19:08:00 +0000 -Subject: [PATCH 0404/1050] media: rpivid: Add a Pass0 to accumulate slices and +Subject: [PATCH 0403/1183] media: rpivid: Add a Pass0 to accumulate slices and rework job finish Due to overheads in assembling controls and requests it is worth having @@ -202566,7 +202520,7 @@ 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 9af3a2f9a041..af012cf788b0 100644 +index 533fb839fb0b..f5ea8e724fdb 100644 --- a/drivers/media/v4l2-core/v4l2-mem2mem.c +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c @@ -492,8 +492,6 @@ void v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev, @@ -203605,7 +203559,7 @@ index ada6107ab675..396263bb352e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 29 Mar 2021 17:42:16 +0100 -Subject: [PATCH 0405/1050] media: rpivid: Map cmd buffer directly +Subject: [PATCH 0404/1183] 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. @@ -203775,7 +203729,7 @@ index 396263bb352e..2bb86d564b33 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 1 Apr 2021 16:20:58 +0100 -Subject: [PATCH 0406/1050] media: rpivid: Improve values returned when setting +Subject: [PATCH 0405/1183] media: rpivid: Improve values returned when setting output format Guess a better value for the compressed bitstream buffer size @@ -204001,7 +203955,7 @@ index 5c0fd9c8a6d7..a3b228556497 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Sat, 3 Apr 2021 16:27:03 +0100 -Subject: [PATCH 0407/1050] media: rpivid: Improve stream_on/off conformance & +Subject: [PATCH 0406/1183] media: rpivid: Improve stream_on/off conformance & clock setup Fix stream on & off such that failures leave the driver in the correct @@ -204273,7 +204227,7 @@ index 3d882a6853a5..705015890e71 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 8 Apr 2021 18:34:09 +0100 -Subject: [PATCH 0408/1050] media: rpivid: Improve SPS/PPS error +Subject: [PATCH 0407/1183] media: rpivid: Improve SPS/PPS error handling/validation Move size and width checking from bitstream processing to control @@ -204539,7 +204493,7 @@ index ee5a48f26912..bb280b215a2e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: jc-kynesim Date: Fri, 11 Jun 2021 15:14:31 +0100 -Subject: [PATCH 0409/1050] bcm2835: Allow compressed frames to set sizeimage +Subject: [PATCH 0408/1183] bcm2835: Allow compressed frames to set sizeimage (#4386) Allow the user to set sizeimage in TRY_FMT and S_FMT if the format @@ -204592,7 +204546,7 @@ index a97666a1a4be..c3ba5c25a2ab 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 11 Jun 2021 12:47:07 +0100 -Subject: [PATCH 0410/1050] media: i2c: imx477: Fix for long exposure limit +Subject: [PATCH 0409/1183] media: i2c: imx477: Fix for long exposure limit calculations Do not scale IMX477_EXPOSURE_OFFSET with the long exposure factor during @@ -204624,7 +204578,7 @@ index 31e48512c165..07ccdf738883 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 8 Jul 2021 09:37:10 +0100 -Subject: [PATCH 0411/1050] clk: bcm2835: Pass DT node to rpi_firmware_get +Subject: [PATCH 0410/1183] 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. @@ -204654,7 +204608,7 @@ index 961acade005f..e4dfbe2cf50e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 30 Apr 2019 19:15:30 +0100 -Subject: [PATCH 0412/1050] bcm2835-pcm.c: Support multichannel audio +Subject: [PATCH 0411/1183] bcm2835-pcm.c: Support multichannel audio --- .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 13 +++++++------ @@ -204694,7 +204648,7 @@ index f2ef1d641e70..5e9a6e28c4c6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 27 Oct 2020 12:24:14 +0000 -Subject: [PATCH 0413/1050] bcm2835-pcm: Fix up multichannel pcm audio +Subject: [PATCH 0412/1183] bcm2835-pcm: Fix up multichannel pcm audio Fixes: a9c1660ff5f02d048c5f31abf1fd1108ccf9ef87 Signed-off-by: Dom Cobley @@ -204736,7 +204690,7 @@ index 5e9a6e28c4c6..f2ef1d641e70 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Jun 2021 12:05:25 +0100 -Subject: [PATCH 0414/1050] media: i2c: imx290: Support 60fps in 2 lane +Subject: [PATCH 0413/1183] media: i2c: imx290: Support 60fps in 2 lane operation Commit "97589ad61c73 media: i2c: imx290: Add support for 2 data lanes" @@ -205052,7 +205006,7 @@ index 836d3684c273..af75e10593fa 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Jun 2021 13:00:39 +0100 -Subject: [PATCH 0415/1050] media: i2c: imx290: Fix the pixel rate at +Subject: [PATCH 0414/1183] media: i2c: imx290: Fix the pixel rate at 148.5Mpix/s Whilst the datasheet lists the link frequency changing between @@ -205108,7 +205062,7 @@ index af75e10593fa..6b990e8c6bff 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Jun 2021 17:27:46 +0100 -Subject: [PATCH 0416/1050] media: i2c: imx290: Fix clock setup register +Subject: [PATCH 0415/1183] media: i2c: imx290: Fix clock setup register assignments When the clock setups were added for the alternate external clocks, @@ -205163,7 +205117,7 @@ index 6b990e8c6bff..7aee4a30bcdd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 24 Jun 2021 14:43:49 +0100 -Subject: [PATCH 0417/1050] media: rpivid: Fix H265 aux ent reuse of the same +Subject: [PATCH 0416/1183] media: rpivid: Fix H265 aux ent reuse of the same slot It is legitimate, though unusual, for an aux ent associated with a slot @@ -205320,7 +205274,7 @@ index bb280b215a2e..a5a0e31bd5ba 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 28 Jun 2021 10:49:04 +0100 -Subject: [PATCH 0418/1050] media: i2c: ov9281: Remove override of subdev name +Subject: [PATCH 0417/1183] 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 @@ -205354,7 +205308,7 @@ index 8d799b8b53c6..5f1b83d77473 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 29 Jun 2021 12:50:58 +0100 -Subject: [PATCH 0419/1050] staging: vc04_services: isp: Set the YUV420/YVU420 +Subject: [PATCH 0418/1183] 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 @@ -205399,7 +205353,7 @@ index 7541fb316cb9..f6d6c88d13ba 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 29 Jun 2021 14:38:23 +0100 -Subject: [PATCH 0420/1050] Documentation: devicetree: Add documentation for +Subject: [PATCH 0419/1183] Documentation: devicetree: Add documentation for imx378 sensor The imx378 sensor is compatible with the imx477 and shares common @@ -205550,7 +205504,7 @@ index 32109bc90bf4..6545cad26858 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 29 Jun 2021 14:43:01 +0100 -Subject: [PATCH 0421/1050] media: i2c: imx477: Extend driver to support imx378 +Subject: [PATCH 0420/1183] media: i2c: imx477: Extend driver to support imx378 sensor The imx378 sensor is almost identical to the imx477 and can be @@ -205748,7 +205702,7 @@ index 07ccdf738883..bc0fb02a159e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 23 Jun 2021 11:47:38 +0200 -Subject: [PATCH 0422/1050] dt-bindings: clk: raspberrypi: Remove unused +Subject: [PATCH 0421/1183] dt-bindings: clk: raspberrypi: Remove unused property The raspberrypi,firmware property has been documented as required in the @@ -205795,7 +205749,7 @@ index d37bc311321d..2047e25700c6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 23 Jun 2021 11:48:35 +0200 -Subject: [PATCH 0423/1050] dt-bindings: display: vc4: Add phandle to the +Subject: [PATCH 0422/1183] dt-bindings: display: vc4: Add phandle to the firmware The vc4 driver will need to tell the firmware that it takes over the @@ -205832,7 +205786,7 @@ index 49a5e041aa49..eac739a812f5 100644 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 0424/1050] media: bcm2835-unicam: Forward input status from +Subject: [PATCH 0423/1183] media: bcm2835-unicam: Forward input status from subdevice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -205891,7 +205845,7 @@ index a603891986b9..cf5d16103d56 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Thu, 15 Jul 2021 15:55:22 +0100 -Subject: [PATCH 0425/1050] media: v4l2-subdev: add subdev-wide state struct +Subject: [PATCH 0424/1183] media: v4l2-subdev: add subdev-wide state struct Signed-off-by: Dom Cobley --- @@ -206386,69 +206340,9 @@ index 08dce8bba9bb..00b044e7d77e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Tue, 19 May 2020 14:54:28 +0100 -Subject: [PATCH 0426/1050] 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 -virtual device, but it is the one that does the allocations. -The DMA addresses are consumed by primarily the HVS or V3D, and -those require VideoCore cache alias address mapping, and so will be -under /soc. - -During probe find the a suitable device node for HVS or V3D, -and adopt the DMA configuration of that node. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_drv.c | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 2150637e40dc..0a889f765672 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.c -+++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -216,6 +216,14 @@ static void vc4_match_add_drivers(struct device *dev, - } - } - -+const struct of_device_id vc4_dma_range_matches[] = { -+ { .compatible = "brcm,bcm2835-hvs" }, -+ { .compatible = "brcm,bcm2835-v3d" }, -+ { .compatible = "brcm,cygnus-v3d" }, -+ { .compatible = "brcm,vc4-v3d" }, -+ {} -+}; -+ - static int vc4_drm_bind(struct device *dev) - { - struct platform_device *pdev = to_platform_device(dev); -@@ -234,6 +242,16 @@ static int vc4_drm_bind(struct device *dev) - vc4_drm_driver.driver_features &= ~DRIVER_RENDER; - of_node_put(node); - -+ node = of_find_matching_node_and_match(NULL, vc4_dma_range_matches, -+ NULL); -+ if (node) { -+ ret = of_dma_configure(dev, node, true); -+ of_node_put(node); -+ -+ if (ret) -+ return ret; -+ } -+ - vc4 = devm_drm_dev_alloc(dev, &vc4_drm_driver, struct vc4_dev, base); - if (IS_ERR(vc4)) - return PTR_ERR(vc4); --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joerg Quinten Date: Fri, 18 Jun 2021 13:02:29 +0200 -Subject: [PATCH 0427/1050] Support RPi DPI interface in mode6 for 18-bit color +Subject: [PATCH 0425/1183] 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. @@ -206568,7 +206462,7 @@ index e7a2fac30ae4..6e143e47d967 100644 - MEDIA_BUS_FMT_RGB666_1X24_CPADHI diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c -index 8dd7013c75f2..281b8d908f37 100644 +index 1a9685eb8002..9b4376ca0454 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -2472,6 +2472,38 @@ static const struct panel_desc innolux_at043tn24 = { @@ -206676,7 +206570,7 @@ index aa56d7f54784..6ad34f88c7dd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 15 Dec 2021 10:17:38 +0100 -Subject: [PATCH 0428/1050] drm/vc4: plane: Add support for DRM_FORMAT_P030 +Subject: [PATCH 0426/1183] drm/vc4: plane: Add support for DRM_FORMAT_P030 The P030 format, used with the DRM_FORMAT_MOD_BROADCOM_SAND128 modifier, is a format output by the video decoder on the BCM2711. @@ -206692,7 +206586,7 @@ Link: https://lore.kernel.org/r/20211215091739.135042-3-maxime@cerno.tech 1 file changed, 96 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c -index ac761c683663..022cd12f561e 100644 +index 906d3f394cfa..7777b92e51c4 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -33,6 +33,7 @@ static const struct hvs_format { @@ -206716,7 +206610,7 @@ index ac761c683663..022cd12f561e 100644 }; static const struct hvs_format *vc4_get_hvs_format(u32 drm_format) -@@ -762,47 +769,90 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -758,47 +765,90 @@ static int vc4_plane_mode_set(struct drm_plane *plane, case DRM_FORMAT_MOD_BROADCOM_SAND128: case DRM_FORMAT_MOD_BROADCOM_SAND256: { uint32_t param = fourcc_mod_broadcom_param(fb->modifier); @@ -206834,7 +206728,7 @@ index ac761c683663..022cd12f561e 100644 } pitch0 = VC4_SET_FIELD(param, SCALER_TILE_HEIGHT); -@@ -955,7 +1005,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -951,7 +1001,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, /* Pitch word 1/2 */ for (i = 1; i < num_planes; i++) { @@ -206844,7 +206738,7 @@ index ac761c683663..022cd12f561e 100644 vc4_dlist_write(vc4_state, VC4_SET_FIELD(fb->pitches[i], SCALER_SRC_PITCH)); -@@ -1315,6 +1366,13 @@ static bool vc4_format_mod_supported(struct drm_plane *plane, +@@ -1311,6 +1362,13 @@ static bool vc4_format_mod_supported(struct drm_plane *plane, default: return false; } @@ -206858,7 +206752,7 @@ index ac761c683663..022cd12f561e 100644 case DRM_FORMAT_RGBX1010102: case DRM_FORMAT_BGRX1010102: case DRM_FORMAT_RGBA1010102: -@@ -1347,8 +1405,11 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, +@@ -1343,8 +1401,11 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, struct drm_plane *plane = NULL; struct vc4_plane *vc4_plane; u32 formats[ARRAY_SIZE(hvs_formats)]; @@ -206870,7 +206764,7 @@ index ac761c683663..022cd12f561e 100644 static const uint64_t modifiers[] = { DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED, DRM_FORMAT_MOD_BROADCOM_SAND128, -@@ -1363,13 +1424,17 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, +@@ -1359,13 +1420,17 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, if (!vc4_plane) return ERR_PTR(-ENOMEM); @@ -206898,7 +206792,7 @@ index ac761c683663..022cd12f561e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 15 Dec 2021 10:17:39 +0100 -Subject: [PATCH 0429/1050] drm/vc4: plane: Add support for YUV color encodings +Subject: [PATCH 0427/1183] drm/vc4: plane: Add support for YUV color encodings and ranges The BT601/BT709 color encoding and limited vs full @@ -206917,10 +206811,10 @@ Link: https://lore.kernel.org/r/20211215091739.135042-4-maxime@cerno.tech 2 files changed, 82 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c -index 022cd12f561e..920a9eefe426 100644 +index 7777b92e51c4..a82a0b1190eb 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -623,6 +623,51 @@ static int vc4_plane_allocate_lbm(struct drm_plane_state *state) +@@ -619,6 +619,51 @@ static int vc4_plane_allocate_lbm(struct drm_plane_state *state) return 0; } @@ -206972,7 +206866,7 @@ index 022cd12f561e..920a9eefe426 100644 /* Writes out a full display list for an active plane to the plane's * private dlist state. */ -@@ -1017,9 +1062,20 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -1013,9 +1058,20 @@ static int vc4_plane_mode_set(struct drm_plane *plane, /* Colorspace conversion words */ if (vc4_state->is_yuv) { @@ -206996,7 +206890,7 @@ index 022cd12f561e..920a9eefe426 100644 } vc4_state->lbm_offset = 0; -@@ -1448,6 +1504,15 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, +@@ -1444,6 +1500,15 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y); @@ -207064,7 +206958,7 @@ index 8ac2f088106a..e3761ffbac7b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 19 May 2020 16:20:30 +0100 -Subject: [PATCH 0430/1050] drm/vc4: Add FKMS as an acceptable node for dma +Subject: [PATCH 0428/1183] drm/vc4: Add FKMS as an acceptable node for dma ranges. Under FKMS, the firmware (via FKMS) also requires the VideoCore cache @@ -207079,12 +206973,12 @@ Signed-off-by: Dave Stevenson 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 0a889f765672..44c9ea24b9f6 100644 +index 9698fda00e2f..806b43759a14 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -218,6 +218,7 @@ static void vc4_match_add_drivers(struct device *dev, - - const struct of_device_id vc4_dma_range_matches[] = { +@@ -219,6 +219,7 @@ static void vc4_match_add_drivers(struct device *dev, + static const struct of_device_id vc4_dma_range_matches[] = { + { .compatible = "brcm,bcm2711-hvs" }, { .compatible = "brcm,bcm2835-hvs" }, + { .compatible = "raspberrypi,rpi-firmware-kms" }, { .compatible = "brcm,bcm2835-v3d" }, @@ -207095,48 +206989,9 @@ index 0a889f765672..44c9ea24b9f6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 31 Jul 2019 17:36:34 +0100 -Subject: [PATCH 0431/1050] 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 -to also disable the HDMI audio interface. - -See: https://github.com/raspberrypi/linux/issues/2489 - -Signed-off-by: Phil Elwell ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 6 ++++-- - 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 987d073b206b..01cefacc1b8b 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1693,10 +1693,12 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) - const __be32 *addr; - int index; - int ret; -+ int len; - -- if (!of_find_property(dev->of_node, "dmas", NULL)) { -+ if (!of_find_property(dev->of_node, "dmas", &len) || -+ len == 0) { - dev_warn(dev, -- "'dmas' DT property is missing, no HDMI audio\n"); -+ "'dmas' DT property is missing or empty, no HDMI audio\n"); - return 0; - } - --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 6 Oct 2020 18:44:42 +0100 -Subject: [PATCH 0432/1050] drm/vc4: Add debugfs node that dumps the current +Subject: [PATCH 0429/1183] drm/vc4: Add debugfs node that dumps the current display lists This allows easy analysis of display lists when debugging. @@ -207212,7 +207067,7 @@ index 9d88bfb50c9b..327ffe2fcbb5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 21 Oct 2020 18:34:56 +0100 -Subject: [PATCH 0433/1050] drm/vc4: Add all the HDMI registers into the +Subject: [PATCH 0430/1183] drm/vc4: Add all the HDMI registers into the debugfs dumps The vc5 HDMI registers hadn't been added into the debugfs @@ -207226,10 +207081,10 @@ Signed-off-by: Dave Stevenson 2 files changed, 47 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 01cefacc1b8b..8029478d3284 100644 +index 1863b87adca9..5c6812af1133 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -113,6 +113,12 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) +@@ -116,6 +116,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); @@ -207242,7 +207097,7 @@ index 01cefacc1b8b..8029478d3284 100644 return 0; } -@@ -2362,6 +2368,7 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) +@@ -2368,6 +2374,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; @@ -207250,7 +207105,7 @@ index 01cefacc1b8b..8029478d3284 100644 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi"); if (!res) -@@ -2458,6 +2465,38 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) +@@ -2464,6 +2471,38 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) return PTR_ERR(vc4_hdmi->reset); } @@ -207313,39 +207168,9 @@ index 0c51c91f9d5c..275c4674d50f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Mon, 26 Oct 2020 12:38:27 +0000 -Subject: [PATCH 0434/1050] 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. -Add "brcm,bcm2711-hvs" to that list of components. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_drv.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 44c9ea24b9f6..902c66de3bd5 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.c -+++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -218,6 +218,7 @@ static void vc4_match_add_drivers(struct device *dev, - - const struct of_device_id vc4_dma_range_matches[] = { - { .compatible = "brcm,bcm2835-hvs" }, -+ { .compatible = "brcm,bcm2711-hvs" }, - { .compatible = "raspberrypi,rpi-firmware-kms" }, - { .compatible = "brcm,bcm2835-v3d" }, - { .compatible = "brcm,cygnus-v3d" }, --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 9 Nov 2020 19:49:32 +0000 -Subject: [PATCH 0435/1050] vc4_hdmi: Report that 3d/stereo is allowed +Subject: [PATCH 0431/1183] vc4_hdmi: Report that 3d/stereo is allowed Signed-off-by: Dom Cobley --- @@ -207353,10 +207178,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 8029478d3284..1d341803251e 100644 +index 5c6812af1133..fb24f91d1b4c 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -399,6 +399,7 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, +@@ -402,6 +402,7 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, connector->interlace_allowed = 1; connector->doublescan_allowed = 0; @@ -207371,7 +207196,7 @@ index 8029478d3284..1d341803251e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 10 Nov 2020 20:04:08 +0000 -Subject: [PATCH 0436/1050] vc4: Clear unused infoframe packet RAM registers +Subject: [PATCH 0432/1183] vc4: Clear unused infoframe packet RAM registers Using a hdmi analyser the bytes in packet ram registers beyond the length were visible in the @@ -207385,10 +207210,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 1d341803251e..79487ca562aa 100644 +index fb24f91d1b4c..1c65dd40917d 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -437,9 +437,11 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, +@@ -440,9 +440,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; @@ -207401,7 +207226,7 @@ index 1d341803251e..79487ca562aa 100644 unsigned long flags; ssize_t len, i; int ret; -@@ -475,6 +477,13 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, +@@ -478,6 +480,13 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, packet_reg += 4; } @@ -207422,7 +207247,7 @@ index 1d341803251e..79487ca562aa 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 12 Feb 2021 17:31:37 +0000 -Subject: [PATCH 0437/1050] drm/vc4: Change the default DPI format to being +Subject: [PATCH 0433/1183] 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 @@ -207461,115 +207286,8 @@ index afb446f49e9c..dde2c6014748 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley -Date: Sun, 24 Jan 2021 15:44:10 +0000 -Subject: [PATCH 0438/1050] 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. - -Reduce the threshold where we deassert DREQ to avoid the fifo overfilling - -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 79487ca562aa..5eb9400caa7f 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1613,10 +1613,10 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, - - /* Set the MAI threshold */ - HDMI_WRITE(HDMI_MAI_THR, -- VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICHIGH) | -- VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) | -- VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQHIGH) | -- VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQLOW)); -+ VC4_SET_FIELD(0x08, VC4_HD_MAI_THR_PANICHIGH) | -+ VC4_SET_FIELD(0x08, VC4_HD_MAI_THR_PANICLOW) | -+ VC4_SET_FIELD(0x06, VC4_HD_MAI_THR_DREQHIGH) | -+ VC4_SET_FIELD(0x08, VC4_HD_MAI_THR_DREQLOW)); - - HDMI_WRITE(HDMI_MAI_CONFIG, - VC4_HDMI_MAI_CONFIG_BIT_REVERSE | --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Mon, 15 Mar 2021 13:28:06 +0000 -Subject: [PATCH 0439/1050] vc4/drm: vc4_plane: Remove subpixel positioning - check - -There is little harm in ignoring fractional coordinates -(they just get truncated). - -Without this: -modetest -M vc4 -F tiles,gradient -s 32:1920x1080-60 -P89@74:1920x1080*.1.1@XR24 - -is rejected. We have the same issue in Kodi when trying to -use zoom options on video. - -Note: even if all coordinates are fully integer. e.g. -src:[0,0,1920,1080] dest:[-10,-10,1940,1100] - -it will still get rejected as drm_atomic_helper_check_plane_state -uses drm_rect_clip_scaled which transforms this to fractional src coords - -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_plane.c | 21 ++++++++------------- - 1 file changed, 8 insertions(+), 13 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c -index 920a9eefe426..f0f80ef43f96 100644 ---- a/drivers/gpu/drm/vc4/vc4_plane.c -+++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -339,7 +339,6 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) - struct vc4_plane_state *vc4_state = to_vc4_plane_state(state); - struct drm_framebuffer *fb = state->fb; - struct drm_gem_cma_object *bo = drm_fb_cma_get_gem_obj(fb, 0); -- u32 subpixel_src_mask = (1 << 16) - 1; - int num_planes = fb->format->num_planes; - struct drm_crtc_state *crtc_state; - u32 h_subsample = fb->format->hsub; -@@ -361,18 +360,14 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) - for (i = 0; i < num_planes; i++) - vc4_state->offsets[i] = bo->paddr + fb->offsets[i]; - -- /* We don't support subpixel source positioning for scaling. */ -- if ((state->src.x1 & subpixel_src_mask) || -- (state->src.x2 & subpixel_src_mask) || -- (state->src.y1 & subpixel_src_mask) || -- (state->src.y2 & subpixel_src_mask)) { -- return -EINVAL; -- } -- -- vc4_state->src_x = state->src.x1 >> 16; -- vc4_state->src_y = state->src.y1 >> 16; -- vc4_state->src_w[0] = (state->src.x2 - state->src.x1) >> 16; -- vc4_state->src_h[0] = (state->src.y2 - state->src.y1) >> 16; -+ /* We don't support subpixel source positioning for scaling, -+ * but fractional coordinates can be generated by clipping -+ * so just round for now -+ */ -+ vc4_state->src_x = DIV_ROUND_CLOSEST(state->src.x1, 1<<16); -+ vc4_state->src_y = DIV_ROUND_CLOSEST(state->src.y1, 1<<16); -+ vc4_state->src_w[0] = DIV_ROUND_CLOSEST(state->src.x2, 1<<16) - vc4_state->src_x; -+ vc4_state->src_h[0] = DIV_ROUND_CLOSEST(state->src.y2, 1<<16) - vc4_state->src_y; - - vc4_state->crtc_x = state->dst.x1; - vc4_state->crtc_y = state->dst.y1; --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dom Cobley Date: Tue, 13 Apr 2021 14:10:03 +0100 -Subject: [PATCH 0440/1050] drm/vc4: hdmi: Convert to the new clock request API +Subject: [PATCH 0434/1183] 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 @@ -207616,306 +207334,8 @@ index 06a4f765a51c..87e51d4d86f4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson -Date: Thu, 11 Feb 2021 18:37:04 +0000 -Subject: [PATCH 0441/1050] 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. - -Amend the setup accordingly. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index c9b684d36fb2..7dfd28fa619a 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -317,7 +317,8 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode - u32 pixel_rep = (mode->flags & DRM_MODE_FLAG_DBLCLK) ? 2 : 1; - bool is_dsi = (vc4_encoder->type == VC4_ENCODER_TYPE_DSI0 || - vc4_encoder->type == VC4_ENCODER_TYPE_DSI1); -- u32 format = is_dsi ? PV_CONTROL_FORMAT_DSIV_24 : PV_CONTROL_FORMAT_24; -+ bool is_dsi1 = vc4_encoder->type == VC4_ENCODER_TYPE_DSI1; -+ u32 format = is_dsi1 ? PV_CONTROL_FORMAT_DSIV_24 : PV_CONTROL_FORMAT_24; - u8 ppc = pv_data->pixels_per_clock; - bool debug_dump_regs = false; - --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Mon, 8 Feb 2021 11:22:01 +0000 -Subject: [PATCH 0442/1050] drm/vc4: Register dsi0 as the correct vc4 encoder - type - -vc4_dsi was registering both dsi0 and dsi1 as VC4_ENCODER_TYPE_DSI1 -which seemed to work OK for a single DSI display, but fails -if there are two DSI displays connected. - -Update to register the correct type. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_dsi.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index ca8506316660..0903e771c6fb 100644 ---- a/drivers/gpu/drm/vc4/vc4_dsi.c -+++ b/drivers/gpu/drm/vc4/vc4_dsi.c -@@ -1510,7 +1510,8 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) - return -ENOMEM; - - INIT_LIST_HEAD(&dsi->bridge_chain); -- vc4_dsi_encoder->base.type = VC4_ENCODER_TYPE_DSI1; -+ vc4_dsi_encoder->base.type = dsi->variant->port ? -+ VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0; - vc4_dsi_encoder->dsi = dsi; - dsi->encoder = &vc4_dsi_encoder->base.base; - --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 10 Feb 2021 18:46:22 +0000 -Subject: [PATCH 0443/1050] 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 -transfers always timed out due to enabling/checking incorrect -bits in the interrupt enable and status registers. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_dsi.c | 111 ++++++++++++++++++++++++++-------- - 1 file changed, 85 insertions(+), 26 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index 0903e771c6fb..2b0d22c40af1 100644 ---- a/drivers/gpu/drm/vc4/vc4_dsi.c -+++ b/drivers/gpu/drm/vc4/vc4_dsi.c -@@ -181,8 +181,50 @@ - - #define DSI0_TXPKT_PIX_FIFO 0x20 /* AKA PIX_FIFO */ - --#define DSI0_INT_STAT 0x24 --#define DSI0_INT_EN 0x28 -+#define DSI0_INT_STAT 0x24 -+#define DSI0_INT_EN 0x28 -+# define DSI0_INT_FIFO_ERR BIT(25) -+# define DSI0_INT_CMDC_DONE_MASK VC4_MASK(24, 23) -+# define DSI0_INT_CMDC_DONE_SHIFT 23 -+# define DSI0_INT_CMDC_DONE_NO_REPEAT 1 -+# define DSI0_INT_CMDC_DONE_REPEAT 3 -+# define DSI0_INT_PHY_DIR_RTF BIT(22) -+# define DSI0_INT_PHY_D1_ULPS BIT(21) -+# define DSI0_INT_PHY_D1_STOP BIT(20) -+# define DSI0_INT_PHY_RXLPDT BIT(19) -+# define DSI0_INT_PHY_RXTRIG BIT(18) -+# define DSI0_INT_PHY_D0_ULPS BIT(17) -+# define DSI0_INT_PHY_D0_LPDT BIT(16) -+# define DSI0_INT_PHY_D0_FTR BIT(15) -+# define DSI0_INT_PHY_D0_STOP BIT(14) -+/* Signaled when the clock lane enters the given state. */ -+# define DSI0_INT_PHY_CLK_ULPS BIT(13) -+# define DSI0_INT_PHY_CLK_HS BIT(12) -+# define DSI0_INT_PHY_CLK_FTR BIT(11) -+/* Signaled on timeouts */ -+# define DSI0_INT_PR_TO BIT(10) -+# define DSI0_INT_TA_TO BIT(9) -+# define DSI0_INT_LPRX_TO BIT(8) -+# define DSI0_INT_HSTX_TO BIT(7) -+/* Contention on a line when trying to drive the line low */ -+# define DSI0_INT_ERR_CONT_LP1 BIT(6) -+# define DSI0_INT_ERR_CONT_LP0 BIT(5) -+/* Control error: incorrect line state sequence on data lane 0. */ -+# define DSI0_INT_ERR_CONTROL BIT(4) -+# define DSI0_INT_ERR_SYNC_ESC BIT(3) -+# define DSI0_INT_RX2_PKT BIT(2) -+# define DSI0_INT_RX1_PKT BIT(1) -+# define DSI0_INT_CMD_PKT BIT(0) -+ -+#define DSI0_INTERRUPTS_ALWAYS_ENABLED (DSI0_INT_ERR_SYNC_ESC | \ -+ DSI0_INT_ERR_CONTROL | \ -+ DSI0_INT_ERR_CONT_LP0 | \ -+ DSI0_INT_ERR_CONT_LP1 | \ -+ DSI0_INT_HSTX_TO | \ -+ DSI0_INT_LPRX_TO | \ -+ DSI0_INT_TA_TO | \ -+ DSI0_INT_PR_TO) -+ - # define DSI1_INT_PHY_D3_ULPS BIT(30) - # define DSI1_INT_PHY_D3_STOP BIT(29) - # define DSI1_INT_PHY_D2_ULPS BIT(28) -@@ -894,6 +936,9 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder) - - DSI_PORT_WRITE(PHY_AFEC0, afec0); - -+ /* AFEC reset hold time */ -+ mdelay(1); -+ - DSI_PORT_WRITE(PHY_AFEC1, - VC4_SET_FIELD(6, DSI0_PHY_AFEC1_IDR_DLANE1) | - VC4_SET_FIELD(6, DSI0_PHY_AFEC1_IDR_DLANE0) | -@@ -1060,12 +1105,9 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder) - DSI_PORT_WRITE(CTRL, DSI_PORT_READ(CTRL) | DSI1_CTRL_EN); - - /* Bring AFE out of reset. */ -- if (dsi->variant->port == 0) { -- } else { -- DSI_PORT_WRITE(PHY_AFEC0, -- DSI_PORT_READ(PHY_AFEC0) & -- ~DSI1_PHY_AFEC0_RESET); -- } -+ DSI_PORT_WRITE(PHY_AFEC0, -+ DSI_PORT_READ(PHY_AFEC0) & -+ ~DSI_PORT_BIT(PHY_AFEC0_RESET)); - - vc4_dsi_ulps(dsi, false); - -@@ -1184,13 +1226,28 @@ static ssize_t vc4_dsi_host_transfer(struct mipi_dsi_host *host, - /* Enable the appropriate interrupt for the transfer completion. */ - dsi->xfer_result = 0; - reinit_completion(&dsi->xfer_completion); -- DSI_PORT_WRITE(INT_STAT, DSI1_INT_TXPKT1_DONE | DSI1_INT_PHY_DIR_RTF); -- if (msg->rx_len) { -- DSI_PORT_WRITE(INT_EN, (DSI1_INTERRUPTS_ALWAYS_ENABLED | -- DSI1_INT_PHY_DIR_RTF)); -+ if (dsi->variant->port == 0) { -+ DSI_PORT_WRITE(INT_STAT, -+ DSI0_INT_CMDC_DONE_MASK | DSI1_INT_PHY_DIR_RTF); -+ if (msg->rx_len) { -+ DSI_PORT_WRITE(INT_EN, (DSI0_INTERRUPTS_ALWAYS_ENABLED | -+ DSI0_INT_PHY_DIR_RTF)); -+ } else { -+ DSI_PORT_WRITE(INT_EN, -+ (DSI0_INTERRUPTS_ALWAYS_ENABLED | -+ VC4_SET_FIELD(DSI0_INT_CMDC_DONE_NO_REPEAT, -+ DSI0_INT_CMDC_DONE))); -+ } - } else { -- DSI_PORT_WRITE(INT_EN, (DSI1_INTERRUPTS_ALWAYS_ENABLED | -- DSI1_INT_TXPKT1_DONE)); -+ DSI_PORT_WRITE(INT_STAT, -+ DSI1_INT_TXPKT1_DONE | DSI1_INT_PHY_DIR_RTF); -+ if (msg->rx_len) { -+ DSI_PORT_WRITE(INT_EN, (DSI1_INTERRUPTS_ALWAYS_ENABLED | -+ DSI1_INT_PHY_DIR_RTF)); -+ } else { -+ DSI_PORT_WRITE(INT_EN, (DSI1_INTERRUPTS_ALWAYS_ENABLED | -+ DSI1_INT_TXPKT1_DONE)); -+ } - } - - /* Send the packet. */ -@@ -1207,7 +1264,7 @@ static ssize_t vc4_dsi_host_transfer(struct mipi_dsi_host *host, - ret = dsi->xfer_result; - } - -- DSI_PORT_WRITE(INT_EN, DSI1_INTERRUPTS_ALWAYS_ENABLED); -+ DSI_PORT_WRITE(INT_EN, DSI_PORT_BIT(INTERRUPTS_ALWAYS_ENABLED)); - - if (ret) - goto reset_fifo_and_return; -@@ -1253,7 +1310,7 @@ static ssize_t vc4_dsi_host_transfer(struct mipi_dsi_host *host, - DSI_PORT_BIT(CTRL_RESET_FIFOS)); - - DSI_PORT_WRITE(TXPKT1C, 0); -- DSI_PORT_WRITE(INT_EN, DSI1_INTERRUPTS_ALWAYS_ENABLED); -+ DSI_PORT_WRITE(INT_EN, DSI_PORT_BIT(INTERRUPTS_ALWAYS_ENABLED)); - return ret; - } - -@@ -1390,26 +1447,28 @@ static irqreturn_t vc4_dsi_irq_handler(int irq, void *data) - DSI_PORT_WRITE(INT_STAT, stat); - - dsi_handle_error(dsi, &ret, stat, -- DSI1_INT_ERR_SYNC_ESC, "LPDT sync"); -+ DSI_PORT_BIT(INT_ERR_SYNC_ESC), "LPDT sync"); - dsi_handle_error(dsi, &ret, stat, -- DSI1_INT_ERR_CONTROL, "data lane 0 sequence"); -+ DSI_PORT_BIT(INT_ERR_CONTROL), "data lane 0 sequence"); - dsi_handle_error(dsi, &ret, stat, -- DSI1_INT_ERR_CONT_LP0, "LP0 contention"); -+ DSI_PORT_BIT(INT_ERR_CONT_LP0), "LP0 contention"); - dsi_handle_error(dsi, &ret, stat, -- DSI1_INT_ERR_CONT_LP1, "LP1 contention"); -+ DSI_PORT_BIT(INT_ERR_CONT_LP1), "LP1 contention"); - dsi_handle_error(dsi, &ret, stat, -- DSI1_INT_HSTX_TO, "HSTX timeout"); -+ DSI_PORT_BIT(INT_HSTX_TO), "HSTX timeout"); - dsi_handle_error(dsi, &ret, stat, -- DSI1_INT_LPRX_TO, "LPRX timeout"); -+ DSI_PORT_BIT(INT_LPRX_TO), "LPRX timeout"); - dsi_handle_error(dsi, &ret, stat, -- DSI1_INT_TA_TO, "turnaround timeout"); -+ DSI_PORT_BIT(INT_TA_TO), "turnaround timeout"); - dsi_handle_error(dsi, &ret, stat, -- DSI1_INT_PR_TO, "peripheral reset timeout"); -+ DSI_PORT_BIT(INT_PR_TO), "peripheral reset timeout"); - -- if (stat & (DSI1_INT_TXPKT1_DONE | DSI1_INT_PHY_DIR_RTF)) { -+ if (stat & ((dsi->variant->port ? DSI1_INT_TXPKT1_DONE : -+ DSI0_INT_CMDC_DONE_MASK) | -+ DSI_PORT_BIT(INT_PHY_DIR_RTF))) { - complete(&dsi->xfer_completion); - ret = IRQ_HANDLED; -- } else if (stat & DSI1_INT_HSTX_TO) { -+ } else if (stat & DSI_PORT_BIT(INT_HSTX_TO)) { - complete(&dsi->xfer_completion); - dsi->xfer_result = -ETIMEDOUT; - ret = IRQ_HANDLED; --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Thu, 15 Apr 2021 16:18:16 +0100 -Subject: [PATCH 0444/1050] drm/vc4: Add correct stop condition to - vc4_dsi_encoder_disable iteration - -vc4_dsi_encoder_disable is partially an open coded version of -drm_bridge_chain_disable, but it missed a termination condition -in the loop for ->disable which meant that no post_disable -calls were made. - -Add in the termination clause. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_dsi.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index 2b0d22c40af1..bb5afcd11fa7 100644 ---- a/drivers/gpu/drm/vc4/vc4_dsi.c -+++ b/drivers/gpu/drm/vc4/vc4_dsi.c -@@ -803,6 +803,9 @@ static void vc4_dsi_encoder_disable(struct drm_encoder *encoder) - list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) { - if (iter->funcs->disable) - iter->funcs->disable(iter); -+ -+ if (iter == dsi->bridge) -+ break; - } - - vc4_dsi_ulps(dsi, true); --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson Date: Thu, 7 Jan 2021 16:30:55 +0000 -Subject: [PATCH 0445/1050] drm/atomic: Don't fixup modes that haven't been +Subject: [PATCH 0435/1183] drm/atomic: Don't fixup modes that haven't been reset Signed-off-by: Dave Stevenson @@ -207946,7 +207366,7 @@ index aa09a19fae37..cd48d4aa20dd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 5 May 2021 15:35:34 +0200 -Subject: [PATCH 0446/1050] clk: Always clamp the rounded rate +Subject: [PATCH 0436/1183] 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 @@ -207961,10 +207381,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 2 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index b829858525ae..e79569eef194 100644 +index 751193365d2c..c775f2153b66 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1355,6 +1355,8 @@ static int clk_core_determine_round_nolock(struct clk_core *core, +@@ -1354,6 +1354,8 @@ static int clk_core_determine_round_nolock(struct clk_core *core, if (!core) return 0; @@ -207980,7 +207400,7 @@ index b829858525ae..e79569eef194 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 26 May 2021 16:13:02 +0200 -Subject: [PATCH 0447/1050] drm/vc4: Increase the core clock based on HVS load +Subject: [PATCH 0437/1183] 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 @@ -208045,7 +207465,7 @@ index 87e51d4d86f4..3453932835b1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 27 Oct 2021 14:38:50 +0100 -Subject: [PATCH 0448/1050] drm/vc4: hdmi: Simplify the connector state +Subject: [PATCH 0438/1183] drm/vc4: hdmi: Simplify the connector state retrieval When we have the entire DRM state, retrieving the connector state only @@ -208059,10 +207479,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 5eb9400caa7f..f615f37d271c 100644 +index 1c65dd40917d..cb4785c33c06 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1003,30 +1003,15 @@ static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) +@@ -1011,30 +1011,15 @@ static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) "VC4_HDMI_FIFO_CTL_RECENTER_DONE"); } @@ -208101,100 +207521,9 @@ index 5eb9400caa7f..f615f37d271c 100644 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 0449/1050] 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 -properly match the modelines. - -Additionally fix the value of PV_VCONTROL_ODD_DELAY, which did not take -pixels_per_clock into account, causing some displays to invert the -fields when driven by bcm2711. - -Signed-off-by: Mateusz Kwiatkowski ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 7 ++++--- - drivers/gpu/drm/vc4/vc4_hdmi.c | 12 ++++++------ - 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 7dfd28fa619a..0b4f05451ac5 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -344,7 +344,8 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode - PV_HORZB_HACTIVE)); - - CRTC_WRITE(PV_VERTA, -- VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end, -+ VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end + -+ interlace, - PV_VERTA_VBP) | - VC4_SET_FIELD(mode->crtc_vsync_end - mode->crtc_vsync_start, - PV_VERTA_VSYNC)); -@@ -356,7 +357,7 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode - if (interlace) { - CRTC_WRITE(PV_VERTA_EVEN, - VC4_SET_FIELD(mode->crtc_vtotal - -- mode->crtc_vsync_end - 1, -+ mode->crtc_vsync_end, - PV_VERTA_VBP) | - VC4_SET_FIELD(mode->crtc_vsync_end - - mode->crtc_vsync_start, -@@ -376,7 +377,7 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode - PV_VCONTROL_CONTINUOUS | - (is_dsi ? PV_VCONTROL_DSI : 0) | - PV_VCONTROL_INTERLACE | -- VC4_SET_FIELD(mode->htotal * pixel_rep / 2, -+ VC4_SET_FIELD(mode->htotal * pixel_rep / (2 * ppc), - PV_VCONTROL_ODD_DELAY)); - CRTC_WRITE(PV_VSYNCD_EVEN, 0); - } else { -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index f615f37d271c..3b5d864b3ffb 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -841,12 +841,12 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, - VC4_HDMI_VERTA_VFP) | - VC4_SET_FIELD(mode->crtc_vdisplay, VC4_HDMI_VERTA_VAL)); - u32 vertb = (VC4_SET_FIELD(0, VC4_HDMI_VERTB_VSPO) | -- VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end, -+ VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end + -+ interlaced, - VC4_HDMI_VERTB_VBP)); - u32 vertb_even = (VC4_SET_FIELD(0, VC4_HDMI_VERTB_VSPO) | - VC4_SET_FIELD(mode->crtc_vtotal - -- mode->crtc_vsync_end - -- interlaced, -+ mode->crtc_vsync_end, - VC4_HDMI_VERTB_VBP)); - unsigned long flags; - -@@ -892,12 +892,12 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, - VC5_HDMI_VERTA_VFP) | - VC4_SET_FIELD(mode->crtc_vdisplay, VC5_HDMI_VERTA_VAL)); - u32 vertb = (VC4_SET_FIELD(0, VC5_HDMI_VERTB_VSPO) | -- VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end, -+ VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end + -+ interlaced, - VC4_HDMI_VERTB_VBP)); - u32 vertb_even = (VC4_SET_FIELD(0, VC5_HDMI_VERTB_VSPO) | - VC4_SET_FIELD(mode->crtc_vtotal - -- mode->crtc_vsync_end - -- interlaced, -+ mode->crtc_vsync_end, - VC4_HDMI_VERTB_VBP)); - unsigned long flags; - unsigned char gcp; --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 5 Jul 2021 19:38:21 +0100 -Subject: [PATCH 0450/1050] dwc_otg: Update NetBSD usb.h header licence +Subject: [PATCH 0439/1183] 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 @@ -208231,53 +207560,9 @@ index f78593575736..b1cedb1876b7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Mon, 12 Jul 2021 12:27:59 +0100 -Subject: [PATCH 0451/1050] drm/vc4: Fix margin calculations for the - right/bottom edges - -The calculations clipped the right/bottom edge of the clipped -range based on the left/top margins. - -Fixes: 666e73587f90 ("drm/vc4: Take margin setup into account when updating planes") -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_plane.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c -index f0f80ef43f96..c737fff3cf8d 100644 ---- a/drivers/gpu/drm/vc4/vc4_plane.c -+++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -310,16 +310,16 @@ static int vc4_plane_margins_adj(struct drm_plane_state *pstate) - adjhdisplay, - crtc_state->mode.hdisplay); - vc4_pstate->crtc_x += left; -- if (vc4_pstate->crtc_x > crtc_state->mode.hdisplay - left) -- vc4_pstate->crtc_x = crtc_state->mode.hdisplay - left; -+ if (vc4_pstate->crtc_x > crtc_state->mode.hdisplay - right) -+ vc4_pstate->crtc_x = crtc_state->mode.hdisplay - right; - - adjvdisplay = crtc_state->mode.vdisplay - (top + bottom); - vc4_pstate->crtc_y = DIV_ROUND_CLOSEST(vc4_pstate->crtc_y * - adjvdisplay, - crtc_state->mode.vdisplay); - vc4_pstate->crtc_y += top; -- if (vc4_pstate->crtc_y > crtc_state->mode.vdisplay - top) -- vc4_pstate->crtc_y = crtc_state->mode.vdisplay - top; -+ if (vc4_pstate->crtc_y > crtc_state->mode.vdisplay - bottom) -+ vc4_pstate->crtc_y = crtc_state->mode.vdisplay - bottom; - - vc4_pstate->crtc_w = DIV_ROUND_CLOSEST(vc4_pstate->crtc_w * - adjhdisplay, --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:07:30 +0200 -Subject: [PATCH 0452/1050] drm/vc4: Fix timings for VEC modes +Subject: [PATCH 0440/1183] 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 @@ -208433,7 +207718,7 @@ index 11fc3d6f66b1..4e2250b8fa23 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:07:49 +0200 -Subject: [PATCH 0453/1050] drm/vc4: Refactor VEC TV mode setting +Subject: [PATCH 0441/1183] 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 @@ -208606,7 +207891,7 @@ index 4e2250b8fa23..809690f2dd55 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:07:53 +0200 -Subject: [PATCH 0454/1050] drm/vc4: Fix definition of PAL-M mode +Subject: [PATCH 0442/1183] 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. @@ -208689,7 +207974,7 @@ index 809690f2dd55..231ed492cb71 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:07:58 +0200 -Subject: [PATCH 0455/1050] drm/vc4: Add support for more analog TV standards +Subject: [PATCH 0443/1183] 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): @@ -208843,7 +208128,7 @@ index 231ed492cb71..e0bd484321d1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:08:01 +0200 -Subject: [PATCH 0456/1050] drm/vc4: Allow setting the TV norm via module +Subject: [PATCH 0444/1183] drm/vc4: Allow setting the TV norm via module parameter Similar to the ch7006 and nouveau drivers, introduce a "tv_mode" module @@ -208993,7 +208278,7 @@ index e0bd484321d1..fb4360c0d9e3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:08:05 +0200 -Subject: [PATCH 0457/1050] drm/vc4: Refactor mode checking logic +Subject: [PATCH 0445/1183] 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 @@ -209084,7 +208369,7 @@ index fb4360c0d9e3..b684595a5d0b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 7 Sep 2020 17:32:27 +0100 -Subject: [PATCH 0458/1050] drm/vc4: Add firmware-kms mode +Subject: [PATCH 0446/1183] drm/vc4: Add firmware-kms mode This is a squash of all firmware-kms related patches from previous branches, up to and including @@ -209190,10 +208475,10 @@ index ba2d8ea562af..2936a7e333a9 100644 debugfs_create_bool("hvs_load_tracker", S_IRUGO | S_IWUSR, minor->debugfs_root, &vc4->load_tracker_enabled); diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 902c66de3bd5..c5d0bf2db2e5 100644 +index 806b43759a14..be19bc2ca756 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -226,6 +226,18 @@ const struct of_device_id vc4_dma_range_matches[] = { +@@ -226,6 +226,18 @@ static const struct of_device_id vc4_dma_range_matches[] = { {} }; @@ -211604,7 +210889,7 @@ index ee361b90eb29..7fdce4033b46 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 20 Jul 2021 15:10:03 +0100 -Subject: [PATCH 0459/1050] media: i2c: imx477: Fix framerates for 1332x990 +Subject: [PATCH 0447/1183] media: i2c: imx477: Fix framerates for 1332x990 mode The imx477 driver's line length for this mode had not been updated to @@ -211636,7 +210921,7 @@ index f550ff0d8b72..ba03c68e64a0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 27 Jul 2021 09:27:49 +0100 -Subject: [PATCH 0460/1050] ASoC: bcm: Compiler warnings in audioinjector-octo +Subject: [PATCH 0448/1183] ASoC: bcm: Compiler warnings in audioinjector-octo Avoid compiler warnings by using the "fallthrough" pseudo-keyword in place of the old "/* fall through */" comment convention. @@ -211704,7 +210989,7 @@ index 47d622df3ec7..db507f341867 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 27 Jul 2021 11:17:08 +0100 -Subject: [PATCH 0461/1050] media: i2c: tc358743: Fix compiler warning +Subject: [PATCH 0449/1183] media: i2c: tc358743: Fix compiler warning Avoid a compiler warning by using the "fallthrough" pseudo-keyword in place of the old "/* fall through */" comment convention. @@ -211734,7 +211019,7 @@ index da166e6a41d6..e3de5b213e05 100644 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 0462/1050] ASoC: bcm: Add chipdip-dac driver +Subject: [PATCH 0450/1183] 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. @@ -212070,7 +211355,7 @@ index 000000000000..6cb53692b3c5 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 3 Aug 2021 11:25:59 +0100 -Subject: [PATCH 0463/1050] media: i2c: imx290: Add fwnode properties controls +Subject: [PATCH 0451/1183] media: i2c: imx290: Add fwnode properties controls Add call to v4l2_ctrl_new_fwnode_properties to read and create the fwnode based controls. @@ -212124,7 +211409,7 @@ index c09b5a22e1a8..4291c77f5a01 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 3 Aug 2021 11:30:58 +0100 -Subject: [PATCH 0464/1050] media: i2c: ov9281: Add fwnode properties controls +Subject: [PATCH 0452/1183] media: i2c: ov9281: Add fwnode properties controls Add call to v4l2_ctrl_new_fwnode_properties to read and create the fwnode based controls. @@ -212186,7 +211471,7 @@ index c89dc98ad708..e4604746e930 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 3 Aug 2021 11:33:33 +0100 -Subject: [PATCH 0465/1050] media: i2c: ov7251: Add fwnode properties controls +Subject: [PATCH 0453/1183] media: i2c: ov7251: Add fwnode properties controls Add call to v4l2_ctrl_new_fwnode_properties to read and create the fwnode based controls. @@ -212240,7 +211525,7 @@ index ebb299f207e5..083a62b267f2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 6 Aug 2021 10:47:11 +0100 -Subject: [PATCH 0466/1050] media: v4l2: Remove v4l2-ctrls.c +Subject: [PATCH 0454/1183] media: v4l2: Remove v4l2-ctrls.c v4l2-ctrls.c has been split into 4 files v4l2-ctrls-*.c, the original is redundant, confusing and probably should have been removed by a @@ -217311,7 +216596,7 @@ index b750ce3ae723..000000000000 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 6 Aug 2021 10:53:50 +0100 -Subject: [PATCH 0467/1050] media: v4l2: Add HEVC_SCALING_MATRIX attribute to +Subject: [PATCH 0455/1183] media: v4l2: Add HEVC_SCALING_MATRIX attribute to v4l2-ctrl-* Add code to support V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX to @@ -217377,7 +216662,7 @@ index 421300e13a41..eae300c58274 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 5 Aug 2021 15:18:50 +0100 -Subject: [PATCH 0468/1050] media: rpivid: Update to compile with new hevc +Subject: [PATCH 0456/1183] media: rpivid: Update to compile with new hevc decode params DPB entries have moved from slice params to the new decode params @@ -217586,7 +216871,7 @@ index a5a0e31bd5ba..b630805dbef3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 6 Aug 2021 14:32:44 +0100 -Subject: [PATCH 0469/1050] media: v4l2: Add Greyworld AWB control name +Subject: [PATCH 0457/1183] media: v4l2: Add Greyworld AWB control name Add name for greyworld to white_balance preset names. This patch previously applied to v4l2-ctrl.c but that was split @@ -217616,7 +216901,7 @@ index eae300c58274..e085f330296a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 14 Apr 2021 15:01:16 +0200 -Subject: [PATCH 0470/1050] videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY +Subject: [PATCH 0458/1183] videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY Add a new flag that indicates that this control is a dynamically sized array. Also document this flag. @@ -217676,7 +216961,7 @@ index 12f356c48616..272761a87020 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Thu, 15 Apr 2021 13:56:53 +0200 -Subject: [PATCH 0471/1050] v4l2-ctrls: add support for dynamically allocated +Subject: [PATCH 0459/1183] v4l2-ctrls: add support for dynamically allocated arrays. Implement support for dynamically allocated arrays. @@ -218378,7 +217663,7 @@ index 575b59fbac77..ebd9cef13309 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 29 Apr 2021 19:17:06 +0100 -Subject: [PATCH 0472/1050] media: rpivid: Make slice ctrl dynamic +Subject: [PATCH 0460/1183] media: rpivid: Make slice ctrl dynamic Allows the user to submit a whole frames worth of slice headers in one lump along with a single bitstream dmabuf for the whole lot. @@ -218723,7 +218008,7 @@ index b630805dbef3..72d4c2e20b5f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 6 May 2021 13:48:05 +0100 -Subject: [PATCH 0473/1050] media: rpivid: Only create aux entries for H265 if +Subject: [PATCH 0461/1183] media: rpivid: Only create aux entries for H265 if needed Only create aux entries of mv info for frames where that info might @@ -218840,7 +218125,7 @@ index 72d4c2e20b5f..e3a5c331ca10 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Wed, 11 Aug 2021 15:33:57 +0100 -Subject: [PATCH 0474/1050] usb: xhci: workaround for bogus SET_DEQ_PENDING +Subject: [PATCH 0462/1183] usb: xhci: workaround for bogus SET_DEQ_PENDING endpoint state See https://github.com/raspberrypi/linux/issues/3981 @@ -218887,7 +218172,7 @@ index f9707997969d..78981c0b754f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 8 Sep 2021 14:15:17 +0100 -Subject: [PATCH 0475/1050] media: i2c: imx477: Allow control of on-sensor DPC +Subject: [PATCH 0463/1183] 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. @@ -218933,7 +218218,7 @@ index ba03c68e64a0..96486a7f007c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Thu, 15 Apr 2021 13:15:14 +0100 -Subject: [PATCH 0476/1050] sound/usb: add device quirks for A4Tech FHD 1080p +Subject: [PATCH 0464/1183] sound/usb: add device quirks for A4Tech FHD 1080p webcams These devices use a type of Sonix chipset that produces broken microphone @@ -218947,10 +218232,10 @@ Signed-off-by: Jonathan Bell 1 file changed, 2 insertions(+) diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c -index 968d90caeefa..a203e151153a 100644 +index 5b4d8f5eade2..2925368ccea6 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c -@@ -1921,6 +1921,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { +@@ -1925,6 +1925,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { QUIRK_FLAG_GENERIC_IMPLICIT_FB), DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */ QUIRK_FLAG_GENERIC_IMPLICIT_FB), @@ -218966,7 +218251,7 @@ index 968d90caeefa..a203e151153a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Wed, 15 Sep 2021 17:56:45 +0100 -Subject: [PATCH 0477/1050] sound/usb: call usb_autopm_get_interface() for +Subject: [PATCH 0465/1183] sound/usb: call usb_autopm_get_interface() for devices that should not be suspended Webcams with microphones are composite devices, and autosuspend is set @@ -218983,10 +218268,10 @@ Signed-off-by: Jonathan Bell 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/usb/card.c b/sound/usb/card.c -index 1764b9302d46..fbbe330a52e3 100644 +index 713b84d8d42f..a819d84533a7 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c -@@ -817,8 +817,14 @@ static int usb_audio_probe(struct usb_interface *intf, +@@ -825,8 +825,14 @@ static int usb_audio_probe(struct usb_interface *intf, if (ignore_ctl_error) chip->quirk_flags |= QUIRK_FLAG_IGNORE_CTL_ERROR; @@ -219009,7 +218294,7 @@ index 1764b9302d46..fbbe330a52e3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 22 Jul 2021 14:34:42 +0100 -Subject: [PATCH 0478/1050] brcmfmac: Try product-specific clm_blob names first +Subject: [PATCH 0466/1183] brcmfmac: Try product-specific clm_blob names first Signed-off-by: Phil Elwell --- @@ -219180,7 +218465,7 @@ index 9fb68c2dc7e3..9bf2dbd30ded 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 1 Nov 2018 17:31:37 +0000 -Subject: [PATCH 0479/1050] staging: vchiq_arm: Add 36-bit address support +Subject: [PATCH 0467/1183] staging: vchiq_arm: 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 @@ -219450,7 +218735,7 @@ index e8e39a154c74..b7653e8ce9e0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 21 Jul 2020 17:34:09 +0100 -Subject: [PATCH 0480/1050] staging: vchiq_arm: children inherit DMA config +Subject: [PATCH 0468/1183] 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 @@ -219492,7 +218777,7 @@ index ff4fae2b51f9..16f3de4c27f1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: detule Date: Tue, 2 Oct 2018 04:10:08 -0400 -Subject: [PATCH 0481/1050] staging: vchiq_arm: Usa a DMA pool for small bulks +Subject: [PATCH 0469/1183] staging: vchiq_arm: Usa a DMA pool for small bulks During a bulk transfer we request a DMA allocation to hold the scatter-gather list. Most of the time, this allocation is small @@ -219618,277 +218903,8 @@ index 16f3de4c27f1..f3d2fe5bbfa0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson -Date: Mon, 13 Sep 2021 17:30:18 +0100 -Subject: [PATCH 0482/1050] 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 3b5d864b3ffb..91af33d54935 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -79,6 +79,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 -@@ -963,6 +966,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); - - spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h -index fc971506bd4f..24056441a4bb 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 0483/1050] 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 | 51 ++++++++++++++++++++++++++--------- - 1 file changed, 39 insertions(+), 12 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index bb5afcd11fa7..86f3bec1937f 100644 ---- a/drivers/gpu/drm/vc4/vc4_dsi.c -+++ b/drivers/gpu/drm/vc4/vc4_dsi.c -@@ -1612,7 +1612,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 -@@ -1641,7 +1641,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"); -@@ -1649,7 +1649,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"); -@@ -1657,7 +1657,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"); -@@ -1665,7 +1665,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, -@@ -1680,33 +1680,37 @@ 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); - - ret = drm_bridge_attach(dsi->encoder, dsi->bridge, NULL, 0); -- if (ret) -- return ret; -+ if (ret) { -+ dev_err(dev, "bridge attach failed: %d\n", ret); -+ goto err_free_dma; -+ } - /* Disable the atomic helper calls into the bridge. We - * manually call the bridge pre_enable / enable / etc. calls - * from our driver, since we need to sequence them within the -@@ -1719,6 +1723,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, -@@ -1735,6 +1752,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 0484/1050] 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 86f3bec1937f..f2479f80487a 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: Wed, 8 Sep 2021 14:21:38 +0100 -Subject: [PATCH 0485/1050] drm/panel/raspberrypi-touchscreen: Handle I2C +Subject: [PATCH 0470/1183] drm/panel/raspberrypi-touchscreen: Handle I2C errors. rpi_touchscreen_i2c_read returns any errors from i2c_transfer, @@ -219929,7 +218945,7 @@ index bd15c2f2e247..329341bcfa50 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 26 Mar 2021 17:06:36 +0000 -Subject: [PATCH 0486/1050] drm/panel-simple: Add a timing for the Raspberry Pi +Subject: [PATCH 0471/1183] drm/panel-simple: Add a timing for the Raspberry Pi 7" panel The Raspberry Pi 7" 800x480 panel uses a Toshiba TC358762 DSI @@ -219942,7 +218958,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c -index 281b8d908f37..7a6331479a5b 100644 +index 9b4376ca0454..47c4790ba3a9 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -3759,6 +3759,31 @@ static const struct panel_desc qishenglong_gopher2b_lcd = { @@ -219994,7 +219010,7 @@ index 281b8d908f37..7a6331479a5b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 8 Sep 2021 14:46:17 +0100 -Subject: [PATCH 0487/1050] Input: edt-ft54x6: Clean up timer and workqueue on +Subject: [PATCH 0472/1183] Input: edt-ft54x6: Clean up timer and workqueue on remove If no interrupt is defined then a timer and workqueue are used @@ -220031,7 +219047,7 @@ index 339eae4ec7a8..aabd1246b788 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 11 Feb 2021 18:46:06 +0000 -Subject: [PATCH 0488/1050] regulator: rpi-panel: Register with a unique +Subject: [PATCH 0473/1183] regulator: rpi-panel: Register with a unique backlight name There's no reason why 2 Raspberry Pi DSI displays can't be @@ -220066,7 +219082,7 @@ index 991b4730d768..00fb69efcfa2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 8 Sep 2021 15:02:05 +0100 -Subject: [PATCH 0489/1050] regulator: rpi-panel: Serialise operations. +Subject: [PATCH 0474/1183] regulator: rpi-panel: Serialise operations. The driver was using the regmap lock to serialise the individual accesses, but we really need to protect the @@ -220326,7 +219342,7 @@ index 00fb69efcfa2..a4af7adad2b5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 8 Sep 2021 15:41:18 +0100 -Subject: [PATCH 0490/1050] regulator: rpi-panel: Ensure the backlight is off +Subject: [PATCH 0475/1183] regulator: rpi-panel: Ensure the backlight is off during probe. The initial state of the Atmel is not defined, so ensure the @@ -220356,7 +219372,7 @@ index a4af7adad2b5..b3629a1e0e50 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 9 Sep 2021 18:24:57 +0100 -Subject: [PATCH 0491/1050] regulator: rpi-panel: Convert to drive lines +Subject: [PATCH 0476/1183] regulator: rpi-panel: Convert to drive lines directly The Atmel was doing a load of automatic sequencing of @@ -220562,7 +219578,7 @@ index b3629a1e0e50..995915ca4a9b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 10 Sep 2021 13:50:28 +0100 -Subject: [PATCH 0492/1050] regulator: rpi-panel: Add GPIO control for panel +Subject: [PATCH 0477/1183] regulator: rpi-panel: Add GPIO control for panel and touch resets We need independent control of the resets for the panel&bridge, @@ -220770,7 +219786,7 @@ index 995915ca4a9b..998233f14085 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 13 May 2021 11:56:21 +0100 -Subject: [PATCH 0493/1050] staging/bcm2835-codec: Change the default codec res +Subject: [PATCH 0478/1183] staging/bcm2835-codec: Change the default codec res to 32x32 In order to effectively guarantee that a V4L2_EVENT_SOURCE_CHANGE @@ -220816,7 +219832,7 @@ index c3ba5c25a2ab..4c01bc42fa31 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sun, 10 Jan 2021 19:05:17 +0000 -Subject: [PATCH 0494/1050] staging/vchiq-mmal: Add buffer flags for interlaced +Subject: [PATCH 0479/1183] staging/vchiq-mmal: Add buffer flags for interlaced video Add the buffer flags that the firmware uses to identify fields @@ -220864,7 +219880,7 @@ index ab63835ce01c..883b77ffae25 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 5 Aug 2021 16:38:34 +0100 -Subject: [PATCH 0495/1050] staging/vchiq-mmal: Add parameters for interlaced +Subject: [PATCH 0480/1183] staging/vchiq-mmal: Add parameters for interlaced video support Adds enum mmal_interlace_type and struct @@ -220931,7 +219947,7 @@ index 79438d23912f..844a02bf9a22 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 18 Dec 2020 19:56:31 +0000 -Subject: [PATCH 0496/1050] staging/bcm2835-codec: Add support for decoding +Subject: [PATCH 0481/1183] staging/bcm2835-codec: Add support for decoding interlaced streams The video decoder can support decoding interlaced streams, so add @@ -221110,7 +220126,7 @@ index 4c01bc42fa31..3f15c20bb952 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 5 Aug 2021 15:11:23 +0100 -Subject: [PATCH 0497/1050] staging/bcm2835-codec: Correct ENUM_FRAMESIZES +Subject: [PATCH 0482/1183] staging/bcm2835-codec: Correct ENUM_FRAMESIZES stepsize to 2 Being YUV420 formats, the step size is always 2 to avoid part @@ -221145,7 +220161,7 @@ index 3f15c20bb952..96de610e8354 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 5 Aug 2021 16:46:42 +0100 -Subject: [PATCH 0498/1050] staging/bcm2835-codec: Return buffers to QUEUED not +Subject: [PATCH 0483/1183] staging/bcm2835-codec: Return buffers to QUEUED not ERROR state Should start_streaming fail, or buffers be queued during @@ -221186,7 +220202,7 @@ index 96de610e8354..d2b64a369ae8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 6 Aug 2021 13:43:48 +0100 -Subject: [PATCH 0499/1050] staging/bcm2835_codec: Log MMAL flags in hex +Subject: [PATCH 0484/1183] 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. @@ -221216,7 +220232,7 @@ index d2b64a369ae8..202830aee5b6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sat, 11 Sep 2021 17:21:07 +0100 -Subject: [PATCH 0500/1050] staging: bcm2835-codec: Allow custom specified +Subject: [PATCH 0485/1183] staging: bcm2835-codec: Allow custom specified strides/bytesperline. If the client provides a bytesperline value in try_fmt/s_fmt then @@ -221261,7 +220277,7 @@ index 202830aee5b6..8e6a3ab629fc 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 6 Aug 2021 15:44:21 +0100 -Subject: [PATCH 0501/1050] staging/vchiq-mmal: Add the deinterlace image +Subject: [PATCH 0486/1183] staging/vchiq-mmal: Add the deinterlace image effects enums As we're wanting to wrap the image_fx component for deinterlacing, @@ -221293,7 +220309,7 @@ index 844a02bf9a22..622508dc6e27 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Fri, 6 Aug 2021 15:37:16 +0100 -Subject: [PATCH 0502/1050] staging/bcm2835_codec: Add support for image_fx to +Subject: [PATCH 0487/1183] staging/bcm2835_codec: Add support for image_fx to deinterlace Adds another /dev/video node wrapping image_fx doing deinterlace. @@ -221566,7 +220582,7 @@ index 8e6a3ab629fc..38b59aa21069 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 14 Sep 2021 16:44:18 +0100 -Subject: [PATCH 0503/1050] staging/bcm2835-v4l2_codec: Fix for encode +Subject: [PATCH 0488/1183] staging/bcm2835-v4l2_codec: Fix for encode selection API Matches correct behaviour from DECODE and DEINTERLACE @@ -221596,7 +220612,7 @@ index 38b59aa21069..8df0eb2b532a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 2 Dec 2019 14:48:05 +0000 -Subject: [PATCH 0504/1050] Add Raspberry Pi PoE+ HAT support +Subject: [PATCH 0489/1183] Add Raspberry Pi PoE+ HAT support Signed-off-by: Serge Schneider --- @@ -221890,7 +220906,7 @@ index 7fdce4033b46..dd3bbc75e531 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Sep 2021 15:18:51 +0100 -Subject: [PATCH 0505/1050] configs: Add CAN_PEAK_USB=m +Subject: [PATCH 0490/1183] configs: Add CAN_PEAK_USB=m Add the driver for the PEAK Systems USB CAN interface. @@ -221972,7 +220988,7 @@ index 235fecf9c903..6af6d68a8f38 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 22 Sep 2021 09:16:46 +0100 -Subject: [PATCH 0506/1050] ARM: dts: Restore downstream dtbs to Makefile +Subject: [PATCH 0491/1183] ARM: dts: Restore downstream dtbs to Makefile Signed-off-by: Phil Elwell --- @@ -221980,7 +220996,7 @@ Signed-off-by: Phil Elwell 1 file changed, 10 insertions(+) diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index ab6a5c6ea5ee..6fb13ebc2837 100644 +index 1d4daf4b836f..a254e6342d4e 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -1,8 +1,18 @@ @@ -222009,7 +221025,7 @@ index ab6a5c6ea5ee..6fb13ebc2837 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 1 Sep 2021 16:34:50 +0100 -Subject: [PATCH 0507/1050] media: rpivid: Avoid returning EINVAL to a G_FMT +Subject: [PATCH 0492/1183] media: rpivid: Avoid returning EINVAL to a G_FMT ioctl V4L2 spec says that G/S/TRY_FMT IOCTLs should never return errors for @@ -222298,7 +221314,7 @@ index a3b228556497..e22cc0e32aa3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 22 Sep 2021 15:38:13 +0100 -Subject: [PATCH 0508/1050] net: phy: lan87xx: Allow more time for link detect +Subject: [PATCH 0493/1183] 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. @@ -222317,10 +221333,10 @@ Signed-off-by: Phil Elwell 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c -index d8cac02a79b9..c168a7f95a25 100644 +index 636b0907a598..2004bc0dae60 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c -@@ -228,12 +228,12 @@ static int lan87xx_read_status(struct phy_device *phydev) +@@ -230,12 +230,12 @@ static int lan87xx_read_status(struct phy_device *phydev) if (rc < 0) return rc; @@ -222342,7 +221358,7 @@ index d8cac02a79b9..c168a7f95a25 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 22 Sep 2021 18:57:19 +0100 -Subject: [PATCH 0509/1050] media: rpivid: Remove unused ctx state variable and +Subject: [PATCH 0494/1183] media: rpivid: Remove unused ctx state variable and defines Remove unused ctx state tracking variable and associated defines. @@ -222385,7 +221401,7 @@ index aa8448566c09..fe6cf1806410 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 22 Sep 2021 19:05:30 +0100 -Subject: [PATCH 0510/1050] media: rpivid: Ensure IRQs have completed before +Subject: [PATCH 0495/1183] media: rpivid: Ensure IRQs have completed before uniniting context Before uniniting the decode context sync with the IRQ queues to ensure @@ -222491,7 +221507,7 @@ index e3a5c331ca10..834e34a8373f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 9 Oct 2020 10:40:27 +0100 -Subject: [PATCH 0511/1050] staging: bcm2835-codec: Allow decode res changed +Subject: [PATCH 0496/1183] staging: bcm2835-codec: Allow decode res changed before STREAMON(CAPTURE) The V4L2 stateful video decoder API requires that you can STREAMON @@ -222735,7 +221751,7 @@ index 8df0eb2b532a..f8fe8effa06d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 15 Sep 2021 17:44:19 +0100 -Subject: [PATCH 0512/1050] staging/bcm2835-codec: Do not send buffers to the +Subject: [PATCH 0497/1183] staging/bcm2835-codec: Do not send buffers to the VPU unless streaming With video decode we now enable both input and output ports on @@ -222834,7 +221850,7 @@ index f8fe8effa06d..4156018dbf7a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 15 Sep 2021 17:49:41 +0100 -Subject: [PATCH 0513/1050] staging/mmal-vchiq: Rationalise included headers +Subject: [PATCH 0498/1183] staging/mmal-vchiq: Rationalise included headers The list of includes was slightly over generic, and wasn't in alphabetical order. Clean it up. @@ -222876,7 +221892,7 @@ index c88393f22d87..e5ba3b067ae3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 16 Sep 2021 16:32:53 +0100 -Subject: [PATCH 0514/1050] staging: bcm2835-codec: Format changed should +Subject: [PATCH 0499/1183] staging: bcm2835-codec: Format changed should trigger drain When a format changed event occurs, the spec says that it @@ -222925,7 +221941,7 @@ index 4156018dbf7a..73afe99268ff 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 16 Sep 2021 16:39:07 +0100 -Subject: [PATCH 0515/1050] staging: bcm2835-codec: Signal the firmware to stop +Subject: [PATCH 0500/1183] staging: bcm2835-codec: Signal the firmware to stop on all changes The firmware defaults to not stopping video decode if only the @@ -222981,7 +221997,7 @@ index 622508dc6e27..21087496a481 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 15 Sep 2021 17:54:11 +0100 -Subject: [PATCH 0516/1050] staging/mmal-vchiq: Add module parameter to enable +Subject: [PATCH 0501/1183] staging/mmal-vchiq: Add module parameter to enable logging. Adds a module parameter "debug" to enable various logging levels. @@ -223308,7 +222324,7 @@ index e5ba3b067ae3..139ca5a733cd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 16 Sep 2021 16:46:58 +0100 -Subject: [PATCH 0517/1050] staging: bcm2835-codec: Queue flushed buffers +Subject: [PATCH 0502/1183] staging: bcm2835-codec: Queue flushed buffers instead of completing When a buffer is returned on a port that is disabled, return it @@ -223342,7 +222358,7 @@ index 6c6e0ba34a0b..03c9ccb35ee1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 21 Sep 2021 17:17:57 +0100 -Subject: [PATCH 0518/1050] staging: mmal-vchiq: Reset buffers_with_vpu on +Subject: [PATCH 0503/1183] staging: mmal-vchiq: Reset buffers_with_vpu on port_enable Should we go through the timeout failure case with port_disable @@ -223379,7 +222395,7 @@ index 139ca5a733cd..87194606185a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 22 Sep 2021 16:42:49 +0100 -Subject: [PATCH 0519/1050] staging: bcm2835_codec: Correct flushing code for +Subject: [PATCH 0504/1183] staging: bcm2835_codec: Correct flushing code for refcounting Completions don't reference count, so setting the completion @@ -223477,7 +222493,7 @@ index 03c9ccb35ee1..1b8611549f4f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 20 Sep 2021 15:00:51 +0100 -Subject: [PATCH 0520/1050] staging: bcm2835-codec: Ensure all ctrls are set on +Subject: [PATCH 0505/1183] staging: bcm2835-codec: Ensure all ctrls are set on streamon Currently the code was only setting some controls from @@ -223594,7 +222610,7 @@ index 1b8611549f4f..f5eaff3e4612 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 20 Sep 2021 14:37:17 +0100 -Subject: [PATCH 0521/1050] staging: bcm2835-codec: Add support for H&V Flips +Subject: [PATCH 0506/1183] staging: bcm2835-codec: Add support for H&V Flips to ISP The ISP can do H & V flips whilst resizing or converting @@ -223685,7 +222701,7 @@ index f5eaff3e4612..6078d6e2ace0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Sun, 19 Sep 2021 13:30:43 +0200 -Subject: [PATCH 0522/1050] overlays: add support for the MLX90640 thermal +Subject: [PATCH 0507/1183] overlays: add support for the MLX90640 thermal camera This allows using the video-i2c camera driver with MLX90640 thermal @@ -223764,7 +222780,7 @@ index 000000000000..a2655ed82585 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: GabyPCgeeK Date: Mon, 27 Sep 2021 04:43:21 -0400 -Subject: [PATCH 0523/1050] overlays: Add generic mcp2515 overlay +Subject: [PATCH 0508/1183] overlays: Add generic mcp2515 overlay Can configure mcp2515 on spi0/1/2 without the need for multiple overlays. --- @@ -223981,7 +222997,7 @@ index 000000000000..cda1fb0b1199 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 21 Sep 2021 15:32:50 +0100 -Subject: [PATCH 0524/1050] regulator: rpi-panel: Remove get_brightness hook +Subject: [PATCH 0509/1183] 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 @@ -224041,7 +223057,7 @@ index 998233f14085..8090b9a485b5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: madimario Date: Tue, 28 Sep 2021 04:20:06 -0400 -Subject: [PATCH 0525/1050] bcm2835_smi_dev: Fix handling of word-odd lengths +Subject: [PATCH 0510/1183] 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, @@ -224138,7 +223154,7 @@ index 9db8f1e3db0f..34976fa4ed59 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Juerg Haefliger Date: Wed, 29 Sep 2021 11:39:46 +0200 -Subject: [PATCH 0526/1050] Revert "mmc: sdhci-iproc: Fix vmmc regulators on +Subject: [PATCH 0511/1183] Revert "mmc: sdhci-iproc: Fix vmmc regulators on iProc" This reverts commit aed19399a01733dbad9be8bf026a4f7dd823b04f. @@ -224189,7 +223205,7 @@ index 37b0e1cfe7b7..032bf852397f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Juerg Haefliger Date: Wed, 29 Sep 2021 11:42:23 +0200 -Subject: [PATCH 0527/1050] mmc: sdhci-iproc: Fix vmmc regulators (pre-bcm2711) +Subject: [PATCH 0512/1183] 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 @@ -224223,7 +223239,7 @@ index 032bf852397f..499046ab8113 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Fri, 27 Aug 2021 14:36:55 +0800 -Subject: [PATCH 0528/1050] dt-bindings: media: i2c: Add IMX519 CMOS sensor +Subject: [PATCH 0513/1183] dt-bindings: media: i2c: Add IMX519 CMOS sensor binding Add YAML device tree binding for IMX519 CMOS image sensor, and @@ -224381,7 +223397,7 @@ index 6545cad26858..f08f05ce0ec9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Fri, 27 Aug 2021 13:48:52 +0800 -Subject: [PATCH 0529/1050] media: i2c: Add driver for IMX519 sensor +Subject: [PATCH 0514/1183] 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 @@ -226474,7 +225490,7 @@ index 000000000000..5eaf1f28da35 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Arducam Date: Wed, 15 Sep 2021 09:02:08 +0800 -Subject: [PATCH 0530/1050] media: i2c: imx519: Advertise embedded data node on +Subject: [PATCH 0515/1183] media: i2c: imx519: Advertise embedded data node on media pad 1 This commit updates the imx519 driver to adverise support for embedded @@ -226729,7 +225745,7 @@ index 5eaf1f28da35..fe7e49a70367 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Thu, 26 Aug 2021 11:15:26 +0800 -Subject: [PATCH 0531/1050] configs: Add CONFIG_VIDEO_IMX519=m +Subject: [PATCH 0516/1183] configs: Add CONFIG_VIDEO_IMX519=m Include the driver module for the IMX519. @@ -226809,7 +225825,7 @@ index 6af6d68a8f38..6b0ca5314ab3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Fri, 27 Aug 2021 14:45:43 +0800 -Subject: [PATCH 0532/1050] overlays: Add imx519-overlay.dts +Subject: [PATCH 0517/1183] overlays: Add imx519-overlay.dts Added overlays for enabling IMX519 and add the relevant information to the README. @@ -226984,7 +226000,7 @@ index 000000000000..693c267af1f0 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 4 Oct 2021 14:15:38 +0100 -Subject: [PATCH 0533/1050] dtoverlays: Add overlay for ST7735R (160x128) +Subject: [PATCH 0518/1183] dtoverlays: Add overlay for ST7735R (160x128) TinyDRM driver Adds an overlay to configure the TinyDRM driver for ST7735R @@ -227135,7 +226151,7 @@ index 000000000000..bf186811ec5d From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Wed, 6 Oct 2021 15:27:53 +0100 -Subject: [PATCH 0534/1050] dwc_otg: pay attention to qh->interval when +Subject: [PATCH 0519/1183] dwc_otg: pay attention to qh->interval when rescheduling periodic queues A regression introduced in https://github.com/raspberrypi/linux/pull/3887 @@ -227170,7 +226186,7 @@ index 4503af692aef..f51fad1e6b70 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joerg Schambacher Date: Wed, 6 Oct 2021 17:19:58 +0200 -Subject: [PATCH 0535/1050] Hifiberry DAC+ADCPro DT overlay: add optional +Subject: [PATCH 0520/1183] Hifiberry DAC+ADCPro DT overlay: add optional headphone amp This is a copy of the approach from our DAC+ driver. @@ -227205,7 +226221,7 @@ index cafa2ccd7ff7..561cd84bbb79 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joerg Schambacher Date: Wed, 6 Oct 2021 17:21:07 +0200 -Subject: [PATCH 0536/1050] Hifiberry DAC+ADCPro: adding optional headphone amp +Subject: [PATCH 0521/1183] Hifiberry DAC+ADCPro: adding optional headphone amp control This is a copy of the code and approach from our DAC+ driver. @@ -227356,7 +226372,7 @@ index 79eccdb4dc8c..517a70fba7d7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Sten Spans Date: Tue, 12 Oct 2021 20:10:00 +0200 -Subject: [PATCH 0537/1050] Add module for 8111h chip used in various CM4 +Subject: [PATCH 0522/1183] Add module for 8111h chip used in various CM4 boards --- @@ -227395,7 +226411,7 @@ index d1966d92664b..234e68865bff 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 14 Oct 2021 11:09:18 +0100 -Subject: [PATCH 0538/1050] drivers/gpio: Add a driver that wraps the PWM API +Subject: [PATCH 0523/1183] 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 @@ -227598,7 +226614,7 @@ index 000000000000..89f5d6b353ab From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 15 Oct 2021 11:45:36 +0100 -Subject: [PATCH 0539/1050] rtc: pcf85063: Always clear EXT_TEST from set_time +Subject: [PATCH 0524/1183] 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 @@ -227640,7 +226656,7 @@ index 14da4ab30104..ea75b71a1f16 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 Oct 2021 17:33:05 +0100 -Subject: [PATCH 0540/1050] char: vcio: Rewrite as a firmware node child +Subject: [PATCH 0525/1183] 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 @@ -227883,7 +226899,7 @@ index a39155a94fb7..ac314617229c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 12 Oct 2021 09:59:54 +0100 -Subject: [PATCH 0541/1050] ARM: dts: Make vcio a child of the firmware node +Subject: [PATCH 0526/1183] 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 @@ -227919,7 +226935,7 @@ index 68a7e1c09db1..dc302248ae2a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 18 Oct 2021 11:12:42 +0100 -Subject: [PATCH 0542/1050] ARM: dts: bcm2835_audio missing firmware reference +Subject: [PATCH 0527/1183] 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 @@ -227954,7 +226970,7 @@ index dc302248ae2a..efca67213816 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 18 Oct 2021 11:13:35 +0100 -Subject: [PATCH 0543/1050] ARM: dts: Delete vestigial vcsm node +Subject: [PATCH 0528/1183] ARM: dts: Delete vestigial vcsm node Signed-off-by: Phil Elwell --- @@ -227985,7 +227001,7 @@ index efca67213816..57e7d5f60d3e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 18 Oct 2021 16:39:11 +0100 -Subject: [PATCH 0544/1050] config: Enable FSFS_FS_SECURITY +Subject: [PATCH 0529/1183] config: Enable FSFS_FS_SECURITY Add a negligible amount of core kernel code for capability-based access control on F2FS. @@ -228068,7 +227084,7 @@ index 6b0ca5314ab3..f16857163068 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 19 Oct 2021 11:23:43 +0100 -Subject: [PATCH 0545/1050] gpio: bcm-virt: Fix the get() method +Subject: [PATCH 0530/1183] 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 @@ -228103,7 +227119,7 @@ index 49e28ad9760e..55c40190e88a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Erik Tagirov Date: Wed, 20 Oct 2021 09:51:26 +0200 -Subject: [PATCH 0546/1050] configs: Add CONFIG_FB_SIMPLE to bcmrpi3_defconfig +Subject: [PATCH 0531/1183] configs: Add CONFIG_FB_SIMPLE to bcmrpi3_defconfig See: https://github.com/raspberrypi/linux/pull/4640 @@ -228131,7 +227147,7 @@ index f16857163068..b252255397fa 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 21 Oct 2021 14:41:55 +0100 -Subject: [PATCH 0547/1050] media: i2c: imx219: Sensor should report RAW color +Subject: [PATCH 0532/1183] media: i2c: imx219: Sensor should report RAW color space Tested on Raspberry Pi running libcamera. @@ -228170,7 +227186,7 @@ index e10af3f74b38..7ef1f2b9b7a8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 21 Oct 2021 14:44:01 +0100 -Subject: [PATCH 0548/1050] media: i2c: imx290: Sensor should report RAW color +Subject: [PATCH 0533/1183] media: i2c: imx290: Sensor should report RAW color space Tested on Raspberry Pi running libcamera. @@ -228200,7 +227216,7 @@ index 4291c77f5a01..a6f4ba5b9345 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 21 Oct 2021 14:44:43 +0100 -Subject: [PATCH 0549/1050] media: i2c: imx477: Sensor should report RAW color +Subject: [PATCH 0534/1183] media: i2c: imx477: Sensor should report RAW color space Tested on Raspberry Pi running libcamera. @@ -228230,7 +227246,7 @@ index 96486a7f007c..54bc4e858081 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 21 Oct 2021 14:45:07 +0100 -Subject: [PATCH 0550/1050] media: i2c: imx519: Sensor should report RAW color +Subject: [PATCH 0535/1183] media: i2c: imx519: Sensor should report RAW color space Tested on Raspberry Pi running libcamera. @@ -228260,7 +227276,7 @@ index fe7e49a70367..fa09cfca8afe 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 21 Oct 2021 14:47:00 +0100 -Subject: [PATCH 0551/1050] media: i2c: ov5647: Sensor should report RAW color +Subject: [PATCH 0536/1183] media: i2c: ov5647: Sensor should report RAW color space Tested on Raspberry Pi running libcamera. @@ -228317,7 +227333,7 @@ index 4b6f4962e644..ac9074acdd9c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 21 Oct 2021 14:47:20 +0100 -Subject: [PATCH 0552/1050] media: i2c: ov9281: Sensor should report RAW color +Subject: [PATCH 0537/1183] media: i2c: ov9281: Sensor should report RAW color space Tested on Raspberry Pi running libcamera. @@ -228365,7 +227381,7 @@ index e4604746e930..f0d5551b23c1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 21 Oct 2021 14:49:15 +0100 -Subject: [PATCH 0553/1050] vc04_services: isp: Report input node as wanting +Subject: [PATCH 0538/1183] vc04_services: isp: Report input node as wanting full range RAW color space RAW color spaces are more usually reported as having full range @@ -228400,7 +227416,7 @@ index 00b044e7d77e..c62f2fb25e94 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 23 Sep 2020 15:16:18 +0100 -Subject: [PATCH 0554/1050] media/bcm2835-unicam: Parse pad numbers correctly +Subject: [PATCH 0539/1183] 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 @@ -228637,7 +227653,7 @@ index f1ea1c2da6c3..642764ebf4b8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 15 Oct 2021 17:57:27 +0100 -Subject: [PATCH 0555/1050] media/bcm2835-unicam: Add support for configuration +Subject: [PATCH 0540/1183] media/bcm2835-unicam: Add support for configuration via MC API Adds Media Controller API support for more complex pipelines. @@ -231356,7 +230372,7 @@ index 642764ebf4b8..80196cd1a54c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 25 Oct 2021 11:48:18 +0100 -Subject: [PATCH 0556/1050] ARM: dts: vc4-kms-v3d: Always disable firmware HDMI +Subject: [PATCH 0541/1183] ARM: dts: vc4-kms-v3d: Always disable firmware HDMI Both the firmware audio driver and the vc4-kms-v3d driver are capable of providing HDMI audio, but only one should be active at any time. @@ -231411,7 +230427,7 @@ index 4285e12a4e53..76229cad7803 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: soyer Date: Sat, 23 Oct 2021 12:23:50 +0200 -Subject: [PATCH 0557/1050] staging/bcm2835-camera: Add support for +Subject: [PATCH 0542/1183] staging/bcm2835-camera: Add support for H264_MIN_QP, H264_MAX_QP Signed-off-by: Gergo Koteles @@ -231473,7 +230489,7 @@ index f3480a5c5170..de59f435696d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Gergo Koteles Date: Sun, 24 Oct 2021 23:18:09 +0200 -Subject: [PATCH 0558/1050] staging/bcm2835-camera: Add support for +Subject: [PATCH 0543/1183] staging/bcm2835-camera: Add support for MPEG_VIDEO_FORCE_KEY_FRAME Signed-off-by: Gergo Koteles @@ -231524,7 +230540,7 @@ index de59f435696d..b1b02fbc473d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Sep 2021 10:37:15 +0100 -Subject: [PATCH 0559/1050] ARM: dts: Add Pi Zero 2 support +Subject: [PATCH 0544/1183] ARM: dts: Add Pi Zero 2 support Signed-off-by: Phil Elwell --- @@ -231537,7 +230553,7 @@ Signed-off-by: Phil Elwell create mode 100644 arch/arm64/boot/dts/broadcom/bcm2710-rpi-zero-2.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index 6fb13ebc2837..caf687bf8f5c 100644 +index a254e6342d4e..26d93febbf27 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -7,6 +7,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \ @@ -231757,7 +230773,7 @@ index 000000000000..f76f553599ef From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 19 Oct 2021 14:13:53 +0100 -Subject: [PATCH 0560/1050] clk-raspberrypi: Support VEC clock +Subject: [PATCH 0545/1183] clk-raspberrypi: Support VEC clock Signed-off-by: Dom Cobley --- @@ -231765,7 +230781,7 @@ Signed-off-by: Dom Cobley 1 file changed, 3 insertions(+) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c -index 1e1bee7f43ed..c4829d62faad 100644 +index 0b38fb334185..c52b7a9f4c6a 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c @@ -33,6 +33,7 @@ enum rpi_firmware_clk_id { @@ -231784,7 +230800,7 @@ index 1e1bee7f43ed..c4829d62faad 100644 }; #define RPI_FIRMWARE_STATE_ENABLE_BIT BIT(0) -@@ -273,6 +275,7 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, +@@ -278,6 +280,7 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, case RPI_FIRMWARE_V3D_CLK_ID: case RPI_FIRMWARE_HEVC_CLK_ID: case RPI_FIRMWARE_PIXEL_BVB_CLK_ID: @@ -231799,7 +230815,7 @@ index 1e1bee7f43ed..c4829d62faad 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 19 Oct 2021 14:15:45 +0100 -Subject: [PATCH 0561/1050] dt: Move VEC clock to clk-raspberrypi +Subject: [PATCH 0546/1183] dt: Move VEC clock to clk-raspberrypi clk-2835 is deprecated and gets an innacurate clock for VEC (107MHz). Switch to clk-raspberrypi which uses the right PLL to get an accurate 108MHz. @@ -231843,7 +230859,7 @@ index 06d8c3882cb7..15f3975f1ca1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 19 Oct 2021 14:14:55 +0100 -Subject: [PATCH 0562/1050] clk-bcm2835: Remove VEC clock support +Subject: [PATCH 0547/1183] clk-bcm2835: Remove VEC clock support Signed-off-by: Dom Cobley --- @@ -231883,7 +230899,7 @@ index e4dfbe2cf50e..7112a9c4f7e3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 27 Apr 2021 14:24:21 +0200 -Subject: [PATCH 0563/1050] drm/vc4: Add support for gamma on BCM2711 +Subject: [PATCH 0548/1183] drm/vc4: Add support for gamma on BCM2711 BCM2711 changes from a 256 entry lookup table to a 16 point piecewise linear function as the pipeline bitdepth has increased @@ -232167,7 +231183,7 @@ index e3761ffbac7b..9ac2b7f122ee 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 28 Apr 2021 12:32:10 +0200 -Subject: [PATCH 0564/1050] drm/vc4: Add debugfs node that dumps the vc5 gamma +Subject: [PATCH 0549/1183] drm/vc4: Add debugfs node that dumps the vc5 gamma PWL entries This helps with debugging the conversion from a 256 point gamma LUT to @@ -232287,7 +231303,7 @@ index e9df33b586a7..d0637293bb59 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 14 Jun 2021 15:28:30 +0200 -Subject: [PATCH 0565/1050] drm/vc4: hvs: Force modeset on gamma lut change +Subject: [PATCH 0550/1183] drm/vc4: hvs: Force modeset on gamma lut change The HVS Gamma block can only be updated when idle, so we need to disable the HVS channel when the gamma property is set in an atomic commit. @@ -232402,7 +231418,7 @@ index d0637293bb59..ca3870bac136 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: neocortex-vision Date: Thu, 28 Oct 2021 17:37:36 +0100 -Subject: [PATCH 0566/1050] media: i2c: imx477: Add vsync trigger_mode +Subject: [PATCH 0551/1183] media: i2c: imx477: Add vsync trigger_mode parameter trigger_mode == 0 (default) => no effect / no registers written @@ -232473,7 +231489,7 @@ index 54bc4e858081..2b4dfdd7975a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:08:08 +0200 -Subject: [PATCH 0567/1050] drm/vc4: Relax VEC modeline requirements and add +Subject: [PATCH 0552/1183] drm/vc4: Relax VEC modeline requirements and add progressive mode support Make vc4_vec_encoder_atomic_check() accept arbitrary modelines, as long @@ -232637,7 +231653,7 @@ index b684595a5d0b..661fac65b8a8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mateusz Kwiatkowski Date: Thu, 15 Jul 2021 01:08:11 +0200 -Subject: [PATCH 0568/1050] drm/vc4: Make VEC progressive modes readily +Subject: [PATCH 0553/1183] drm/vc4: Make VEC progressive modes readily accessible Add predefined modelines for the 240p (NTSC) and 288p (PAL) progressive @@ -232809,7 +231825,7 @@ index 661fac65b8a8..d263fdaa1ee8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Sun, 31 Oct 2021 11:47:59 +0000 -Subject: [PATCH 0569/1050] bcm2835-v4l2-codec: Remove advertised support of +Subject: [PATCH 0554/1183] bcm2835-v4l2-codec: Remove advertised support of VP8 The support for this format by firmware is very limited @@ -232843,7 +231859,7 @@ index 6078d6e2ace0..97c8afa0861e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 1 Nov 2021 15:44:31 +0000 -Subject: [PATCH 0570/1050] ARM: dts: Rename Zero 2 W DT files +Subject: [PATCH 0555/1183] ARM: dts: Rename Zero 2 W DT files Retain the old names for backwards compatibility for a while, while the necessary firmware change rolls out. @@ -232857,7 +231873,7 @@ Signed-off-by: Phil Elwell create mode 100644 arch/arm/boot/dts/bcm2710-rpi-zero-2-w.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index caf687bf8f5c..414c14ed9ca8 100644 +index 26d93febbf27..bcf9fd79f5bc 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -8,6 +8,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \ @@ -233241,7 +232257,7 @@ index 42185a450666..daa12bd30d6b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 2 Nov 2021 11:13:42 +0000 -Subject: [PATCH 0571/1050] brcmfmac: Don't promote INFO logging to ERR +Subject: [PATCH 0556/1183] brcmfmac: Don't promote INFO logging to ERR An unwanted side effect of enabling the BRCMDBG config setting is redefining brcmf_info to be brcmf_err. This can be alarming to users @@ -233279,7 +232295,7 @@ index 9bb5f709d41a..ca49700cca50 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 21 Oct 2021 15:06:02 +0100 -Subject: [PATCH 0572/1050] dtoverlays: Update all image sensor overlays for +Subject: [PATCH 0557/1183] dtoverlays: Update all image sensor overlays for Media Controller option Add an option to enable configuration via the Media Controller API @@ -233642,7 +232658,7 @@ index a1f8af36d2e7..d679d9ba84b6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 26 Oct 2021 16:38:44 +0100 -Subject: [PATCH 0573/1050] ARM: dt: Add DT nodes for the WLAN interfaces +Subject: [PATCH 0558/1183] ARM: dt: Add DT nodes for the WLAN interfaces Mirror upstream changes into the downstream dts files. @@ -233733,7 +232749,7 @@ index 6d0f0c9aae0f..2bd223a405a7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 28 Oct 2021 15:03:16 +0100 -Subject: [PATCH 0574/1050] brcmfmac: Read alternative firmware names from DT +Subject: [PATCH 0559/1183] brcmfmac: Read alternative firmware names from DT Add the ability to load the names of alternative firmwares from the Device Tree node. This permits separate firmwares for 43436s and 43438 @@ -233939,7 +232955,7 @@ index 89de65d32ed5..88c08fee58f6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 28 Oct 2021 15:09:25 +0100 -Subject: [PATCH 0575/1050] ARM: dts: Provide WLAN firmware names for Zero 2 W +Subject: [PATCH 0560/1183] ARM: dts: Provide WLAN firmware names for Zero 2 W BCM43430/2 may be BCM43430B0 or BCM43436P, and BCM43430/1 can be either BCM43430A1 or BCM43436S, the former being upstream names and the @@ -233985,7 +233001,7 @@ index 2bd223a405a7..1cd3d01a166d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 2 Nov 2021 16:01:36 +0000 -Subject: [PATCH 0576/1050] drm: Check whether the gamma lut has changed before +Subject: [PATCH 0561/1183] drm: Check whether the gamma lut has changed before updating drm_crtc_legacy_gamma_set updates the gamma_lut blob unconditionally, @@ -234024,7 +233040,7 @@ index bb14f488c8f6..f99b77d15dac 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 3 Nov 2021 11:53:13 +0000 -Subject: [PATCH 0577/1050] brcmfmac: Protect against reprobing +Subject: [PATCH 0562/1183] brcmfmac: Protect against reprobing It is important to reinitialise the firmware array pointers to protect against the case that the brcmfmac driver is reprobed without first @@ -234069,7 +233085,7 @@ index 88c08fee58f6..67b0ad9819f4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 20 Oct 2021 13:31:22 +0200 -Subject: [PATCH 0578/1050] drm/vc4: kms: Fix return code check +Subject: [PATCH 0563/1183] drm/vc4: kms: Fix return code check The HVS global state functions return an error pointer, but in most cases we check if it's NULL, possibly resulting in an invalid pointer @@ -234117,7 +233133,7 @@ index 2bf3436e4512..0334529fa3ea 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 4 Nov 2021 14:04:37 +0100 -Subject: [PATCH 0579/1050] drm/vc4: kms: Move clock request to our HVS state +Subject: [PATCH 0564/1183] drm/vc4: kms: Move clock request to our HVS state Our current clock request has been stored so far on the main HVS structure, but even though we shouldn't have two commits in parallel and @@ -234184,7 +233200,7 @@ index 0334529fa3ea..6d78cd5335c8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 3 Nov 2021 12:21:14 +0100 -Subject: [PATCH 0580/1050] overlays: Add fbtft overlay +Subject: [PATCH 0565/1183] overlays: Add fbtft overlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -234970,7 +233986,7 @@ index 000000000000..db45f8c53bcc From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 10 Nov 2021 09:48:50 +0000 -Subject: [PATCH 0581/1050] configs: Regenerate defconfigs +Subject: [PATCH 0566/1183] configs: Regenerate defconfigs Signed-off-by: Phil Elwell --- @@ -235088,7 +234104,7 @@ index b252255397fa..29d98dc91225 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 10 Nov 2021 09:52:22 +0000 -Subject: [PATCH 0582/1050] configs: Add NTFS3 support +Subject: [PATCH 0567/1183] configs: Add NTFS3 support ntfs3 provides improved support for NTFS filesystems without the performance hit of a userspace FUSE filesystem. @@ -235169,7 +234185,7 @@ index 29d98dc91225..38fff49a5951 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 10 Nov 2021 09:54:35 +0000 -Subject: [PATCH 0583/1050] configs: Add kernel SMB3 server support +Subject: [PATCH 0568/1183] configs: Add kernel SMB3 server support Enable the in-kernel (module) SMB3 server. @@ -235249,7 +234265,7 @@ index 38fff49a5951..82c996f54a8d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: arturo182 Date: Tue, 9 Nov 2021 16:21:56 +0100 -Subject: [PATCH 0584/1050] config: Set TCA8418 to module +Subject: [PATCH 0569/1183] config: Set TCA8418 to module This chip is a popular way to add a matrix keyboard using I2C. --- @@ -235327,7 +234343,7 @@ index 82c996f54a8d..4e7296ad96c2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 11 Nov 2021 10:24:02 +0000 -Subject: [PATCH 0585/1050] overlays: Additional parameters for gpio-poweroff +Subject: [PATCH 0570/1183] overlays: Additional parameters for gpio-poweroff The gpio-poweroff driver supports active-delay-ms and inactive-delay-ms properties. Add parameters to set these parameters - active_delay_ms @@ -235385,7 +234401,7 @@ index 416aa2bc797a..8153f83f0427 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: VMsunghwan Date: Tue, 16 Nov 2021 03:24:36 +0900 -Subject: [PATCH 0586/1050] configs: Add TCA6416 driver module +Subject: [PATCH 0571/1183] configs: Add TCA6416 driver module Add a matrix keyboard on I2C @@ -235465,7 +234481,7 @@ index 4e7296ad96c2..5a8cc83a7386 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 8 Nov 2021 13:55:15 +0000 -Subject: [PATCH 0587/1050] drm: Fix double free from checking if gamma lut has +Subject: [PATCH 0572/1183] drm: Fix double free from checking if gamma lut has been updated The code falls through to "fail" under all conditions, so there is no @@ -235497,7 +234513,7 @@ index f99b77d15dac..da282e7454a8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 8 Nov 2021 17:32:45 +0000 -Subject: [PATCH 0588/1050] drm/vc4: Enable gamma block only when required. +Subject: [PATCH 0573/1183] drm/vc4: Enable gamma block only when required. With HVS5 the gamma block is now only reprogrammed with a disable/enable. Loading the table from vc4_hvs_init_channel @@ -235569,7 +234585,7 @@ index ca3870bac136..0a9b2ea949e3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 8 Nov 2021 18:25:49 +0000 -Subject: [PATCH 0589/1050] drm/vc4: Only add gamma properties once. +Subject: [PATCH 0574/1183] drm/vc4: Only add gamma properties once. Two calls were made to drm_crtc_enable_color_mgmt to add gamma and CTM, however they were both set to add the gamma properties, @@ -235601,7 +234617,7 @@ index 38fd3b7d9b38..4af8ce915b09 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 10 Nov 2021 15:55:32 +0000 -Subject: [PATCH 0590/1050] dtoverlays: Remove i2c0mux and i20if status from +Subject: [PATCH 0575/1183] dtoverlays: Remove i2c0mux and i20if status from edt-ft5406.dtsi edt-ft5406.dtsi is included from vc4-kms-dsi-7inch which was @@ -235688,7 +234704,7 @@ index ecd3bef3d65a..5e1700d0367a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 10 Nov 2021 16:36:12 +0000 -Subject: [PATCH 0591/1050] drm/vc4: Validate the size of the gamma_lut +Subject: [PATCH 0576/1183] drm/vc4: Validate the size of the gamma_lut Add a check to vc4_hvs_gamma_check to ensure a new non-empty gamma LUT is of the correct length before accepting it. @@ -235726,7 +234742,7 @@ index 0a9b2ea949e3..082e8a8b2531 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 16 Nov 2021 10:34:34 +0000 -Subject: [PATCH 0592/1050] drm/vc4: Don't try disabling SCDC on Pi0-3. +Subject: [PATCH 0577/1183] drm/vc4: Don't try disabling SCDC on Pi0-3. The code that set the scdc_enabled flag to ensure it was disabled at boot time also ran on Pi0-3 where there is no @@ -235744,10 +234760,10 @@ Signed-off-by: Dave Stevenson 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 91af33d54935..67a92f9fed0f 100644 +index cb4785c33c06..41685c23a9ce 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2558,7 +2558,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) +@@ -2556,7 +2556,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) * vc4_hdmi_disable_scrambling() will thus run at boot, make * sure it's disabled, and avoid any inconsistency. */ @@ -235764,7 +234780,7 @@ index 91af33d54935..67a92f9fed0f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Sean McAvoy Date: Fri, 19 Nov 2021 02:36:24 -0500 -Subject: [PATCH 0593/1050] enable several virtual devices for hosting virtual +Subject: [PATCH 0578/1183] enable several virtual devices for hosting virtual machines --- @@ -235835,7 +234851,7 @@ index 5a8cc83a7386..05f1eba91510 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Ilya Trukhanov Date: Sat, 20 Nov 2021 16:26:36 +0200 -Subject: [PATCH 0594/1050] configs: add CONFIG_HID_PLAYSTATION=m and +Subject: [PATCH 0579/1183] configs: add CONFIG_HID_PLAYSTATION=m and CONFIG_PLAYSTATION_FF=y Enables support for the PlayStation 5 'DualSense' controller and its @@ -235931,7 +234947,7 @@ index 05f1eba91510..2a319d0550a2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Michael Heimpold Date: Thu, 4 Nov 2021 23:09:07 +0100 -Subject: [PATCH 0595/1050] configs: add LEDS_PWM=y +Subject: [PATCH 0580/1183] configs: add LEDS_PWM=y Enable support for PWM driven LEDs. @@ -236011,7 +235027,7 @@ index 2a319d0550a2..c4dff0b42461 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 22 Nov 2021 10:28:55 +0000 -Subject: [PATCH 0596/1050] configs: Add USB gadget support (for Zero 2 W) +Subject: [PATCH 0581/1183] configs: Add USB gadget support (for Zero 2 W) Bring the Pi 3 kernel in line with the Pi Zero and Pi 4 by enabling USB gadget support, which is useful on Zero 2 W. @@ -236059,7 +235075,7 @@ index 317b0018d6e2..e844c6d60011 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Mon, 22 Nov 2021 13:10:39 +0000 -Subject: [PATCH 0597/1050] media: i2c: ov5647: Support HFLIP and VFLIP +Subject: [PATCH 0582/1183] media: i2c: ov5647: Support HFLIP and VFLIP Add these missing V4L2 controls. Tested binned and full resolution modes in all four orientations using Raspberry Pi running libcamera. @@ -236254,7 +235270,7 @@ index ac9074acdd9c..9275952afccc 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 16 Nov 2021 12:38:44 +0000 -Subject: [PATCH 0598/1050] drivers: bcm2835_isp: Allow multiple users for the +Subject: [PATCH 0583/1183] drivers: bcm2835_isp: Allow multiple users for the ISP driver. Add a second (identical) set of device nodes to allow concurrent use of the ISP @@ -236433,7 +235449,7 @@ index c62f2fb25e94..3b0bab17e03d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 25 Nov 2021 08:59:58 +0000 -Subject: [PATCH 0599/1050] drivers: bcm2835_isp: Fix div by 0 bug. +Subject: [PATCH 0584/1183] drivers: bcm2835_isp: Fix div by 0 bug. Fix a possible division by 0 bug when setting up the mmal port for the stats port. @@ -236462,7 +235478,7 @@ index f6d6c88d13ba..a545dbf2b5dd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Wed, 17 Nov 2021 04:57:56 +0300 -Subject: [PATCH 0600/1050] Pass V4L2_CID_MPEG_VIDEO_H264_MIN_QP/MAX_QP to +Subject: [PATCH 0585/1183] Pass V4L2_CID_MPEG_VIDEO_H264_MIN_QP/MAX_QP to bcm2835-v4l2-codec Following raspberrypi/linux#4704. This is necessary to set up @@ -236535,7 +235551,7 @@ index 97c8afa0861e..d11148c3cb45 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Nov 2021 15:20:06 +0000 -Subject: [PATCH 0601/1050] ARM: dts: Update rpi-400 and cm4 dts to match 4-b +Subject: [PATCH 0586/1183] ARM: dts: Update rpi-400 and cm4 dts to match 4-b The Pi 4B dts file has had numerous updates since the Pi 400 and CM4 dts files were written. Apply those updates to the other files to @@ -236874,7 +235890,7 @@ index 76dd97513a20..b688ac19c66c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 29 Nov 2021 12:14:49 +0000 -Subject: [PATCH 0602/1050] spi: spidev: Restore loading from Device Tree +Subject: [PATCH 0587/1183] spi: spidev: Restore loading from Device Tree As happens occasionally, an upstream change has once again prevented spidev from being loaded via Device Tree. We now need "spidev" to be @@ -236905,7 +235921,7 @@ index 9a3b8a51eaef..36966627f49b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Nov 2021 14:45:33 +0000 -Subject: [PATCH 0603/1050] drm/vc4: Add support for composite syncs to vc4_dpi +Subject: [PATCH 0588/1183] drm/vc4: Add support for composite syncs to vc4_dpi The hardware can combine H&V syncs onto the output enable line as composite syncs, so add the relevant configuration to do that. @@ -236966,7 +235982,7 @@ index dde2c6014748..4dd8df6ddcbe 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 19 Nov 2021 16:16:40 +0000 -Subject: [PATCH 0604/1050] drm/vc4: Ensure vc4_hdmi doesn't use 2711 HPD +Subject: [PATCH 0589/1183] drm/vc4: Ensure vc4_hdmi doesn't use 2711 HPD registers on Pi0-3 The existing logic was flawed in that it could try reading the @@ -236983,7 +235999,7 @@ Signed-off-by: Dave Stevenson 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 67a92f9fed0f..e463a126f5b7 100644 +index 41685c23a9ce..f08ef747f89d 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -206,14 +206,8 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) @@ -237022,7 +236038,7 @@ index 67a92f9fed0f..e463a126f5b7 100644 /* HDMI audio codec callbacks */ static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi, unsigned int samplerate) -@@ -2779,6 +2785,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { +@@ -2776,6 +2782,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { .phy_rng_disable = vc5_hdmi_phy_rng_disable, .channel_map = vc5_hdmi_channel_map, .supports_hdr = true, @@ -237030,7 +236046,7 @@ index 67a92f9fed0f..e463a126f5b7 100644 }; static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { -@@ -2807,6 +2814,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { +@@ -2804,6 +2811,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { .phy_rng_disable = vc5_hdmi_phy_rng_disable, .channel_map = vc5_hdmi_channel_map, .supports_hdr = true, @@ -237059,7 +236075,7 @@ index 275c4674d50f..ea5c3e2a2a27 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 26 Nov 2021 14:37:40 +0000 -Subject: [PATCH 0605/1050] input: edt-ft5x06: Handle unreliable TOUCH_UP +Subject: [PATCH 0590/1183] input: edt-ft5x06: Handle unreliable TOUCH_UP events The ft5x06 is unreliable in sending touch up events, so some @@ -237129,7 +236145,7 @@ index aabd1246b788..f03349617a5e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 26 Nov 2021 16:56:37 +0000 -Subject: [PATCH 0606/1050] dtoverlays: Use edt-ft5506 for 10 points, instead +Subject: [PATCH 0591/1183] dtoverlays: Use edt-ft5506 for 10 points, instead of edt-ft5x06 Whilst all the datasheets describe FT5x06 as supporting "up to @@ -237165,7 +236181,7 @@ index 6f9b4d02460b..2d0ff0e8b24e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 26 Nov 2021 16:46:22 +0000 -Subject: [PATCH 0607/1050] staging/bcm2835-codec: bytesperline for +Subject: [PATCH 0592/1183] staging/bcm2835-codec: bytesperline for YUV420/YVU420 needs to be 64 Matching https://github.com/raspberrypi/linux/pull/4419, the ISP @@ -237213,7 +236229,7 @@ index d11148c3cb45..90fb41e20be1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 29 Nov 2021 16:39:35 +0000 -Subject: [PATCH 0608/1050] media: rpivid: remove min_buffers_needed from src +Subject: [PATCH 0593/1183] media: rpivid: remove min_buffers_needed from src queue Remove min_buffers_needed=1 from src queue init. Src buffers are bound @@ -237244,7 +236260,7 @@ index 1efaa99a55f6..93b3d86b41e3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 29 Nov 2021 19:11:29 +0000 -Subject: [PATCH 0609/1050] staging/bcm2835-codec: Allow a different stride +Subject: [PATCH 0594/1183] staging/bcm2835-codec: Allow a different stride alignment per role Deinterlace and decode aren't affected in the same way as encode @@ -237840,7 +236856,7 @@ index 90fb41e20be1..fdbaa96c25a0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 30 Nov 2021 10:39:41 +0000 -Subject: [PATCH 0610/1050] drivers: bcm2835_unicam: Add logging message when a +Subject: [PATCH 0595/1183] drivers: bcm2835_unicam: Add logging message when a frame is dropped. If a dummy buffer is still active on a frame start, it indicates that this frame @@ -237872,7 +236888,7 @@ index 80196cd1a54c..61b08f655058 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 29 Nov 2021 18:31:37 +0000 -Subject: [PATCH 0611/1050] regulator/rpi-panel-attiny: Don't read the LCD +Subject: [PATCH 0596/1183] regulator/rpi-panel-attiny: Don't read the LCD power status The I2C to the Atmel is very fussy, and locks up easily on @@ -237924,7 +236940,7 @@ index 8090b9a485b5..8b80c0de1022 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Nov 2021 14:50:10 +0000 -Subject: [PATCH 0612/1050] regulator/rpi-panel-attiny: Use two transactions +Subject: [PATCH 0597/1183] regulator/rpi-panel-attiny: Use two transactions for I2C read The I2C to the Atmel is very fussy, and locks up easily on @@ -237998,7 +237014,7 @@ index 8b80c0de1022..e3decc419814 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 30 Nov 2021 17:28:50 +0000 -Subject: [PATCH 0613/1050] input: edt-ft5x06: Only look at the number of +Subject: [PATCH 0598/1183] input: edt-ft5x06: Only look at the number of points reported Register 0x02 in the FT5x06 is TD_STATUS containing the number @@ -238048,7 +237064,7 @@ index f03349617a5e..719a5ad821ff 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 25 Nov 2021 14:46:55 +0000 -Subject: [PATCH 0614/1050] drm/vc4: Move HDMI reset to pm_resume +Subject: [PATCH 0599/1183] drm/vc4: Move HDMI reset to pm_resume Pi0-3 have power domains attached to the pm_runtime hooks for the HDMI block. Initialisation done in the reset called @@ -238063,15 +237079,15 @@ Reset and initialise the HDMI block from pm_resume. Signed-off-by: Dave Stevenson --- - drivers/gpu/drm/vc4/vc4_hdmi.c | 61 ++++++++++++++++++----------- - drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 4 +- - 2 files changed, 41 insertions(+), 24 deletions(-) + drivers/gpu/drm/vc4/vc4_hdmi.c | 53 ++++++++++++++++++++--------- + drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 4 +-- + 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index e463a126f5b7..8beb1f324202 100644 +index f08ef747f89d..6d445889be77 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2195,7 +2195,6 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) +@@ -2193,7 +2193,6 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) struct platform_device *pdev = vc4_hdmi->pdev; struct device *dev = &pdev->dev; unsigned long flags; @@ -238079,7 +237095,7 @@ index e463a126f5b7..8beb1f324202 100644 int ret; if (!of_find_property(dev->of_node, "interrupts", NULL)) { -@@ -2214,15 +2213,6 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) +@@ -2212,15 +2211,6 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) cec_fill_conn_info_from_drm(&conn_info, &vc4_hdmi->connector); cec_s_conn_info(vc4_hdmi->cec_adap, &conn_info); @@ -238095,7 +237111,7 @@ index e463a126f5b7..8beb1f324202 100644 if (vc4_hdmi->variant->external_irq_controller) { ret = request_threaded_irq(platform_get_irq_byname(pdev, "cec-rx"), vc4_cec_irq_handler_rx_bare, -@@ -2285,6 +2275,29 @@ static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) +@@ -2283,6 +2273,29 @@ static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) cec_unregister_adapter(vc4_hdmi->cec_adap); } @@ -238125,7 +237141,7 @@ index e463a126f5b7..8beb1f324202 100644 #else static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) { -@@ -2293,6 +2306,10 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) +@@ -2291,6 +2304,10 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) {}; @@ -238136,7 +237152,7 @@ index e463a126f5b7..8beb1f324202 100644 #endif static int vc4_hdmi_build_regset(struct vc4_hdmi *vc4_hdmi, -@@ -2527,6 +2544,15 @@ static int vc4_hdmi_runtime_resume(struct device *dev) +@@ -2525,6 +2542,15 @@ static int vc4_hdmi_runtime_resume(struct device *dev) if (ret) return ret; @@ -238152,30 +237168,24 @@ index e463a126f5b7..8beb1f324202 100644 return 0; } -@@ -2617,20 +2643,11 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) - if (ret) - goto err_put_ddc; +@@ -2617,17 +2643,10 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + + pm_runtime_enable(dev); - /* -- * We need to have the device powered up at this point to call -- * our reset hook and for the CEC init. +- * We need to have the device powered up at this point to call +- * our reset hook and for the CEC init. - */ -- ret = vc4_hdmi_runtime_resume(dev); -- if (ret) -- goto err_put_ddc; -- -- pm_runtime_get_noresume(dev); -- pm_runtime_set_active(dev); - pm_runtime_enable(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret) + goto err_disable_runtime_pm; - if (vc4_hdmi->variant->reset) - vc4_hdmi->variant->reset(vc4_hdmi); -+ ret = pm_runtime_resume_and_get(dev); -+ if (ret) -+ goto err_put_ddc; - +- if ((of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi0") || of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi1")) && + HDMI_READ(HDMI_VID_CTL) & VC4_HD_VID_CTL_ENABLE) { diff --git a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h index 24056441a4bb..72b769412482 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h @@ -238205,7 +237215,7 @@ index 24056441a4bb..72b769412482 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 2 Dec 2021 13:53:36 +0000 -Subject: [PATCH 0615/1050] clk: bcm: rpi: Add the BCM283x pixel clock. +Subject: [PATCH 0600/1183] clk: bcm: rpi: Add the BCM283x pixel clock. The clk-bcm2835 handling of the pixel clock does not function correctly when the HDMI power domain is disabled. @@ -238219,10 +237229,10 @@ Signed-off-by: Dave Stevenson 1 file changed, 1 insertion(+) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c -index c4829d62faad..99cc4c856de1 100644 +index c52b7a9f4c6a..62971532eaaa 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c -@@ -276,6 +276,7 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, +@@ -281,6 +281,7 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, case RPI_FIRMWARE_HEVC_CLK_ID: case RPI_FIRMWARE_PIXEL_BVB_CLK_ID: case RPI_FIRMWARE_VEC_CLK_ID: @@ -238237,7 +237247,7 @@ index c4829d62faad..99cc4c856de1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 2 Dec 2021 14:11:09 +0000 -Subject: [PATCH 0616/1050] dt: bcm283x: Change BCM283x HDMI to use firmware +Subject: [PATCH 0601/1183] dt: bcm283x: Change BCM283x HDMI to use firmware clock driver The clk-bcm2835 handling of the pixel clock does not function @@ -238272,7 +237282,7 @@ index 15f3975f1ca1..7f46a6ec512c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 11 Nov 2021 13:33:25 +0000 -Subject: [PATCH 0617/1050] overlays: vc4-kms-v3d: Change composite handling +Subject: [PATCH 0602/1183] overlays: vc4-kms-v3d: Change composite handling On a Pi 4, enabling composite video disables the HDMI output. As a consequence, the composite output is disabled by default. Change the @@ -238340,7 +237350,7 @@ index 62e1d77a8182..351fc160e803 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 2 Dec 2021 18:10:55 +0000 -Subject: [PATCH 0618/1050] drm/panel-simple: Populate bpc when using panel-dpi +Subject: [PATCH 0603/1183] drm/panel-simple: Populate bpc when using panel-dpi panel-dpi doesn't know the bit depth, so in the same way that DPI is guessed for the connector type, guess that it'll be 8bpc. @@ -238351,7 +237361,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c -index 7a6331479a5b..5d63eb3b6556 100644 +index 47c4790ba3a9..ce8a6386d6f4 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -607,6 +607,8 @@ static int panel_dpi_probe(struct device *dev, @@ -238370,7 +237380,7 @@ index 7a6331479a5b..5d63eb3b6556 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 2 Dec 2021 18:16:21 +0000 -Subject: [PATCH 0619/1050] drm/panel-simple: Allow the bus format to be read +Subject: [PATCH 0604/1183] drm/panel-simple: Allow the bus format to be read from DT for panel-dpi The "panel-dpi" compatible string configures panel from device tree, @@ -238386,7 +237396,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c -index 5d63eb3b6556..c0d178bcbefa 100644 +index ce8a6386d6f4..e9d3522821c1 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -598,6 +598,7 @@ static int panel_dpi_probe(struct device *dev, @@ -238404,7 +237414,7 @@ index 5d63eb3b6556..c0d178bcbefa 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 2 Dec 2021 18:21:46 +0000 -Subject: [PATCH 0620/1050] drm/vc4: dpi: Add option for inverting pixel clock +Subject: [PATCH 0605/1183] drm/vc4: dpi: Add option for inverting pixel clock and output enable DRM provides flags for inverting pixel clock and output enable @@ -238525,7 +237535,7 @@ index 4dd8df6ddcbe..e19c34d5dbd6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 2 Dec 2021 18:28:29 +0000 -Subject: [PATCH 0621/1050] drm/vc4: dpi: Ensure a default format is selected +Subject: [PATCH 0606/1183] drm/vc4: dpi: Ensure a default format is selected In a couple of error/incomplete configuration cases, the DPI_FORMAT bits wouldn't get set. @@ -238576,7 +237586,7 @@ index e19c34d5dbd6..08147d0eab83 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 2 Dec 2021 18:24:44 +0000 -Subject: [PATCH 0622/1050] dt: bcm270x: Add GPIO defines for RGB565 DPI output +Subject: [PATCH 0607/1183] dt: bcm270x: Add GPIO defines for RGB565 DPI output modes Adds the pinctrl defines for the RGB565 DPI output modes. @@ -238626,7 +237636,7 @@ index badcf341ecd2..49f9019dc125 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 2 Dec 2021 18:06:37 +0000 -Subject: [PATCH 0623/1050] dtoverlays: Add a generic DPI panel overlay for KMS +Subject: [PATCH 0608/1183] dtoverlays: Add a generic DPI panel overlay for KMS Uses the "panel-dpi" compatible to set panel timings from DT. @@ -238795,7 +237805,7 @@ index 000000000000..def175746f66 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Mon, 26 Oct 2020 14:03:35 +0000 -Subject: [PATCH 0624/1050] xhci: quirks: add link TRB quirk for VL805 +Subject: [PATCH 0609/1183] 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 @@ -238847,7 +237857,7 @@ index 78981c0b754f..674f94ca1608 100644 /* Don't update the ring cycle state for the producer (us). */ addr = xhci_trb_virt_to_dma(new_seg, new_deq); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index 0a0cc4373b02..8763ca7f87e7 100644 +index fe616761837a..921272b6f7ae 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1903,6 +1903,7 @@ struct xhci_hcd { @@ -238865,7 +237875,7 @@ index 0a0cc4373b02..8763ca7f87e7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Fri, 3 Dec 2021 14:32:05 +0000 -Subject: [PATCH 0625/1050] xhci: correct room_on_ring() for cases where there +Subject: [PATCH 0610/1183] xhci: correct room_on_ring() for cases where there is a single segment Don't calculate space based on the number of TRBs in the current segment, @@ -238900,7 +237910,7 @@ index 674f94ca1608..fe8037ebad0e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 8 Dec 2021 13:22:48 +0100 -Subject: [PATCH 0626/1050] media: imx219: Advertise embedded data node on +Subject: [PATCH 0611/1183] media: imx219: Advertise embedded data node on media pad 1 This commit updates the imx219 driver to adverise support for embedded @@ -239322,7 +238332,7 @@ index 7ef1f2b9b7a8..ddc6db846f94 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 Dec 2021 15:57:15 +0000 -Subject: [PATCH 0627/1050] vc4/drm: Ignore vc4_hdmi->output_enabled for +Subject: [PATCH 0612/1183] vc4/drm: Ignore vc4_hdmi->output_enabled for allowing audio (#4759) Otherwise we reject audio playback when switching hdmi modes @@ -239334,7 +238344,7 @@ Signed-off-by: Dom Cobley 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 8beb1f324202..79d94b193b62 100644 +index 6d445889be77..03e07a631d23 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -211,6 +211,7 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) @@ -239429,7 +238439,7 @@ index ea5c3e2a2a27..be3f93a86e62 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: peterharperuk <77111776+peterharperuk@users.noreply.github.com> Date: Mon, 13 Dec 2021 14:00:35 +0000 -Subject: [PATCH 0628/1050] ARM: dts: Create bcm2711-rpi-cm4s.dts (#4761) +Subject: [PATCH 0613/1183] ARM: dts: Create bcm2711-rpi-cm4s.dts (#4761) Signed-off-by: Peter Harper --- @@ -239439,7 +238449,7 @@ Signed-off-by: Peter Harper create mode 100644 arch/arm/boot/dts/bcm2711-rpi-cm4s.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index 414c14ed9ca8..f9acf5c4a59b 100644 +index bcf9fd79f5bc..d7dd7b0c1fba 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -16,7 +16,8 @@ dtb-$(CONFIG_ARCH_BCM2835) += \ @@ -239863,7 +238873,7 @@ index 000000000000..226e71198f6a From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Mon, 13 Dec 2021 15:05:56 +0000 -Subject: [PATCH 0629/1050] xhci: refactor out TRBS_PER_SEGMENT define in +Subject: [PATCH 0614/1183] xhci: refactor out TRBS_PER_SEGMENT define in runtime code In anticipation of adjusting the number of utilised TRBs in a ring @@ -240091,10 +239101,10 @@ index fe8037ebad0e..0730fe8fe25b 100644 return -EINVAL; } diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index e274674ff1d6..6fa69874a1ec 100644 +index 2aeca990dae0..02e9b0ca0cb8 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -879,8 +879,8 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci) +@@ -870,8 +870,8 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci) seg = ring->deq_seg; do { memset(seg->trbs, 0, @@ -240105,7 +239115,7 @@ index e274674ff1d6..6fa69874a1ec 100644 cpu_to_le32(~TRB_CYCLE); seg = seg->next; } while (seg != ring->deq_seg); -@@ -891,7 +891,7 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci) +@@ -882,7 +882,7 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci) ring->enq_seg = ring->deq_seg; ring->enqueue = ring->dequeue; @@ -240115,7 +239125,7 @@ index e274674ff1d6..6fa69874a1ec 100644 * Ring is now zeroed, so the HW should look for change of ownership * when the cycle bit is set to 1. diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index 8763ca7f87e7..3d9fe1cc0cbf 100644 +index 921272b6f7ae..915a7c28cd4a 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1635,6 +1635,7 @@ struct xhci_ring { @@ -240133,7 +239143,7 @@ index 8763ca7f87e7..3d9fe1cc0cbf 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Mon, 13 Dec 2021 16:04:03 +0000 -Subject: [PATCH 0630/1050] usb: xhci: add VLI_TRB_CACHE_BUG quirk +Subject: [PATCH 0615/1183] usb: xhci: add VLI_TRB_CACHE_BUG quirk The VL805 fetches up to 4 transfer TRBs at a time. TRB reads don't cross a 64B boundary, and if a TRB is fetched and is not on a 64B boundary, @@ -240198,7 +239208,7 @@ index fdc866c51e34..224ed7c9dbcc 100644 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index 3d9fe1cc0cbf..63acb4feec2f 100644 +index 915a7c28cd4a..c653210eac81 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1905,6 +1905,7 @@ struct xhci_hcd { @@ -240216,7 +239226,7 @@ index 3d9fe1cc0cbf..63acb4feec2f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Dec 2021 21:53:18 +0000 -Subject: [PATCH 0631/1050] drm/vc4: Fix build without DRM_VC4_HDMI_CEC +Subject: [PATCH 0616/1183] drm/vc4: Fix build without DRM_VC4_HDMI_CEC As reported by @asavah. @@ -240228,10 +239238,10 @@ Signed-off-by: Phil Elwell 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 79d94b193b62..0f52cad40f02 100644 +index 03e07a631d23..7e0c1f0934b6 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2281,7 +2281,7 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) +@@ -2279,7 +2279,7 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) {}; @@ -240247,7 +239257,7 @@ index 79d94b193b62..0f52cad40f02 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sat, 20 Nov 2021 10:48:36 +0000 -Subject: [PATCH 0632/1050] dt: Create static regulators and clocks for camera +Subject: [PATCH 0617/1183] dt: Create static regulators and clocks for camera nodes Unloading regulators through dynamic device tree doesn't work @@ -240667,7 +239677,7 @@ index 55237d03ed94..000000000000 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sat, 20 Nov 2021 14:43:29 +0000 -Subject: [PATCH 0633/1050] dtoverlays: Convert the camera sensor overlays to +Subject: [PATCH 0618/1183] dtoverlays: Convert the camera sensor overlays to use the new regs and clks. Now that we have regulators and clocks defined in the base DT for @@ -241159,7 +240169,7 @@ index b2b9a47c6d27..35d9f79980fe 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 22 Nov 2021 12:31:35 +0000 -Subject: [PATCH 0634/1050] media: i2c: ov5647: Add support for regulator +Subject: [PATCH 0619/1183] media: i2c: ov5647: Add support for regulator control. The driver supported using GPIOs to control the shutdown line, @@ -241276,7 +240286,7 @@ index 9275952afccc..491246786f7c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 22 Nov 2021 12:30:18 +0000 -Subject: [PATCH 0635/1050] dtoverlays: Convert ov5647 to use the regulator +Subject: [PATCH 0620/1183] dtoverlays: Convert ov5647 to use the regulator framework Fixing up shutdown GPIOs via overrides is ugly, and doesn't work @@ -241330,7 +240340,7 @@ index a7b4085d4e57..018d424a0f71 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 14 Dec 2021 17:18:49 +0000 -Subject: [PATCH 0636/1050] media: i2c: ov7251: Make the enable GPIO optional. +Subject: [PATCH 0621/1183] media: i2c: ov7251: Make the enable GPIO optional. Not all implementations wire up the enable GPIO and may just tie it to a supply rail. @@ -241362,7 +240372,7 @@ index 083a62b267f2..2bcc3b70918f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 14 Dec 2021 14:54:15 +0000 -Subject: [PATCH 0637/1050] ARM: dts: bcm2711-cm4s Correct i2c0mux to use 0/1 +Subject: [PATCH 0622/1183] ARM: dts: bcm2711-cm4s Correct i2c0mux to use 0/1 and 28/29 & 2 regulators CM4S follows CM1/3, so based on the documentation cameras/displays @@ -241417,7 +240427,7 @@ index 226e71198f6a..f279edfeaf6f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 22 Nov 2021 12:44:29 +0000 -Subject: [PATCH 0638/1050] dtoverlays: Add option to select camera as on CAM0 +Subject: [PATCH 0623/1183] dtoverlays: Add option to select camera as on CAM0 of CM Parameterise the overlays so that they can have an optional @@ -242393,7 +241403,7 @@ index d679d9ba84b6..c85782688e39 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joerg Schambacher Date: Wed, 15 Dec 2021 19:27:00 +0100 -Subject: [PATCH 0639/1050] ASoC:ma120x0p: Increase maximum sample rate to +Subject: [PATCH 0624/1183] ASoC:ma120x0p: Increase maximum sample rate to 192KHz Change the maximum sample rate for the amplifier to @@ -242424,7 +241434,7 @@ index e1591b6aff43..c447d37450b7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 16 Dec 2021 16:25:00 +0000 -Subject: [PATCH 0640/1050] staging/bcm2835-isp: Fix cleanup after init fail +Subject: [PATCH 0625/1183] staging/bcm2835-isp: Fix cleanup after init fail bcm2835_isp_remove is called on an initialisation failure, but at that point the drvdata hasn't been set. This causes a crash when e.g. using @@ -242468,7 +241478,7 @@ index 3b0bab17e03d..9aea0b998bd6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 18 Nov 2021 14:04:00 +0100 -Subject: [PATCH 0641/1050] drm/vc4: kms: Take old state core clock rate into +Subject: [PATCH 0626/1183] drm/vc4: kms: Take old state core clock rate into account During a commit, the core clock, which feeds the HVS, needs to run at @@ -242512,7 +241522,7 @@ index 6d78cd5335c8..20fa5a15d6f6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 29 Nov 2021 12:18:39 +0100 -Subject: [PATCH 0642/1050] drm/vc4: hvs: Store channel in variable +Subject: [PATCH 0627/1183] drm/vc4: hvs: Store channel in variable The assigned_channel field of our vc4_crtc_state structure is accessed multiple times in vc4_hvs_atomic_flush, so let's move it to a variable @@ -242571,7 +241581,7 @@ index 082e8a8b2531..c1e5c2131f37 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 6 Dec 2021 16:17:56 +0100 -Subject: [PATCH 0643/1050] drm/vc4: hvs: Remove dlist setup duplication +Subject: [PATCH 0628/1183] drm/vc4: hvs: Remove dlist setup duplication Setting the DISPLISTx register needs to occur in every case, and we don't need to protect the register using the event_lock, so we can just @@ -242612,7 +241622,7 @@ index c1e5c2131f37..89f2c3d43be1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 6 Dec 2021 16:31:33 +0100 -Subject: [PATCH 0644/1050] drm/vc4: hvs: Move the dlist setup to its own +Subject: [PATCH 0629/1183] drm/vc4: hvs: Move the dlist setup to its own function The vc4_hvs_update_dlist function mostly deals with setting up the @@ -242689,7 +241699,7 @@ index 89f2c3d43be1..e9fbe02f4581 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 6 Dec 2021 16:32:10 +0100 -Subject: [PATCH 0645/1050] drm/vc4: hvs: Ignore atomic_flush if we're disabled +Subject: [PATCH 0630/1183] drm/vc4: hvs: Ignore atomic_flush if we're disabled atomic_flush will be called for each CRTC even if they aren't enabled. @@ -242722,7 +241732,7 @@ index e9fbe02f4581..78a9346bdfd2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Fri, 10 Dec 2021 18:03:18 +0000 -Subject: [PATCH 0646/1050] drm/vc4: Skip writes to disabled packet RAM +Subject: [PATCH 0631/1183] drm/vc4: Skip writes to disabled packet RAM This path actually occurs when audio is started during a hdmi mode set. As the data will be written by vc4_hdmi_set_infoframes when packet RAM @@ -242735,7 +241745,7 @@ Signed-off-by: Dom Cobley 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 0f52cad40f02..90a01075e2d3 100644 +index 7e0c1f0934b6..050be66e7202 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -685,6 +685,7 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, @@ -242788,7 +241798,7 @@ index be3f93a86e62..ea5c3e2a2a27 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 14 Apr 2021 16:21:08 +0200 -Subject: [PATCH 0647/1050] drm/edid: Rename drm_hdmi_avi_infoframe_colorspace +Subject: [PATCH 0632/1183] drm/edid: Rename drm_hdmi_avi_infoframe_colorspace to _colorimetry The drm_hdmi_avi_infoframe_colorspace() function actually sets the @@ -242868,7 +241878,7 @@ index 05d2d750fa53..092a925c6cf5 100644 /* nonsense combination */ drm_WARN_ON(encoder->base.dev, crtc_state->limited_color_range && diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 90a01075e2d3..46753fd4f456 100644 +index 050be66e7202..efc96f1957e0 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -517,7 +517,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder) @@ -242902,7 +241912,7 @@ index c24559f5329d..1be502b8fc44 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 12 Jan 2021 15:55:07 +0100 -Subject: [PATCH 0648/1050] drm/vc4: hdmi: Add full range RGB helper +Subject: [PATCH 0633/1183] drm/vc4: hdmi: Add full range RGB helper We're going to need to tell whether we want to run with a full or limited range RGB output in multiple places in the code, so let's create @@ -242915,7 +241925,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 46753fd4f456..aab5bfd98b77 100644 +index efc96f1957e0..a65b92bd1a04 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -108,6 +108,15 @@ static bool vc4_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode) @@ -242951,7 +241961,7 @@ index 46753fd4f456..aab5bfd98b77 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 12 Jan 2021 15:57:50 +0100 -Subject: [PATCH 0649/1050] drm/vc4: hdmi: Use full range helper in csc +Subject: [PATCH 0634/1183] drm/vc4: hdmi: Use full range helper in csc functions The CSC callbacks takes a boolean as an argument to tell whether we're @@ -242970,7 +241980,7 @@ Signed-off-by: Maxime Ripard 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index aab5bfd98b77..b32f2c71fd09 100644 +index a65b92bd1a04..c48032a88467 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -505,7 +505,6 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, @@ -243086,7 +242096,7 @@ index ea5c3e2a2a27..7468754fc2a7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 13 Jan 2021 11:07:48 +0100 -Subject: [PATCH 0650/1050] drm/vc4: hdmi: Move XBAR setup to csc_setup +Subject: [PATCH 0635/1183] drm/vc4: hdmi: Move XBAR setup to csc_setup On the BCM2711, the HDMI_VEC_INTERFACE_XBAR register configuration depends on whether we're using an RGB or YUV output. Let's move that @@ -243099,7 +242109,7 @@ Signed-off-by: Maxime Ripard 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 b32f2c71fd09..79f5f46330dd 100644 +index c48032a88467..c67eaba72246 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -792,6 +792,8 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, @@ -243126,7 +242136,7 @@ index b32f2c71fd09..79f5f46330dd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 13 Jan 2021 11:20:08 +0100 -Subject: [PATCH 0651/1050] drm/vc4: hdmi: Replace CSC_CTL hardcoded value by +Subject: [PATCH 0636/1183] drm/vc4: hdmi: Replace CSC_CTL hardcoded value by defines On BCM2711, the HDMI_CSC_CTL register value has been hardcoded to an @@ -243140,7 +242150,7 @@ Signed-off-by: Maxime Ripard 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 79f5f46330dd..3e9f70947b6a 100644 +index c67eaba72246..f802c8da9d46 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -786,9 +786,8 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, @@ -243176,7 +242186,7 @@ index 9ac2b7f122ee..f7c48aed655b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 13 Jan 2021 11:30:21 +0100 -Subject: [PATCH 0652/1050] drm/vc4: hdmi: Define colorspace matrices +Subject: [PATCH 0637/1183] drm/vc4: hdmi: Define colorspace matrices The current CSC setup code for the BCM2711 uses a sequence of register writes to configure the CSC depending on whether we output using a full @@ -243194,7 +242204,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 50 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 3e9f70947b6a..e937ee05db6b 100644 +index f802c8da9d46..306283b9d545 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -782,6 +782,52 @@ static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, @@ -243297,7 +242307,7 @@ index 3e9f70947b6a..e937ee05db6b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 18 Jan 2021 09:51:12 +0100 -Subject: [PATCH 0653/1050] drm/vc4: hdmi: Change CSC callback prototype +Subject: [PATCH 0638/1183] drm/vc4: hdmi: Change CSC callback prototype In order to support the YUV output, we'll need the atomic state to know what is the state of the associated property in the CSC setup callback. @@ -243312,7 +242322,7 @@ Signed-off-by: Maxime Ripard 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index e937ee05db6b..7c21f03c8a17 100644 +index 306283b9d545..75041eaf712f 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -742,6 +742,7 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, @@ -243368,7 +242378,7 @@ index 7468754fc2a7..e297dfdd9932 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 2 Dec 2021 16:58:17 +0100 -Subject: [PATCH 0654/1050] drm/vc4: hdmi: Move clock validation to its own +Subject: [PATCH 0639/1183] drm/vc4: hdmi: Move clock validation to its own function Our code is doing the same clock rate validation in multiple instances. @@ -243380,7 +242390,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 7c21f03c8a17..c57f0a61471d 100644 +index 75041eaf712f..0ec703fbe197 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1251,6 +1251,19 @@ static void vc4_hdmi_encoder_atomic_mode_set(struct drm_encoder *encoder, @@ -243437,7 +242447,7 @@ index 7c21f03c8a17..c57f0a61471d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 2 Dec 2021 17:04:18 +0100 -Subject: [PATCH 0655/1050] drm/vc4: hdmi: Move clock calculation into its own +Subject: [PATCH 0640/1183] drm/vc4: hdmi: Move clock calculation into its own function The code to compute our clock rate for a given setup will be called in @@ -243450,7 +242460,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index c57f0a61471d..d25d653d07d4 100644 +index 0ec703fbe197..a829590a3ada 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1264,6 +1264,35 @@ vc4_hdmi_encoder_clock_valid(const struct vc4_hdmi *vc4_hdmi, @@ -243530,7 +242540,7 @@ index c57f0a61471d..d25d653d07d4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 13 Dec 2021 15:33:11 +0100 -Subject: [PATCH 0656/1050] drm/vc4: hdmi: Take the sink maximum TMDS clock +Subject: [PATCH 0641/1183] drm/vc4: hdmi: Take the sink maximum TMDS clock into account In the function that validates that the clock isn't too high, we've only @@ -243547,7 +242557,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index d25d653d07d4..ac988ad5f1da 100644 +index a829590a3ada..8c202a6f91be 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1255,12 +1255,18 @@ static enum drm_mode_status @@ -243576,7 +242586,7 @@ index d25d653d07d4..ac988ad5f1da 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 10 Dec 2021 15:00:04 +0100 -Subject: [PATCH 0657/1050] drm/vc4: hdmi: Take bpp into account for the +Subject: [PATCH 0642/1183] drm/vc4: hdmi: Take bpp into account for the scrambler The current code only base its decision for whether the scrambler must be @@ -243593,7 +242603,7 @@ Signed-off-by: Maxime Ripard 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index ac988ad5f1da..153cf025163a 100644 +index 8c202a6f91be..0b42b06f8e7f 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -103,9 +103,17 @@ @@ -243665,7 +242675,7 @@ index e297dfdd9932..6041571ab41f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 10 Dec 2021 15:29:56 +0100 -Subject: [PATCH 0658/1050] drm/vc4: hdmi: Always try to have the highest bpc +Subject: [PATCH 0643/1183] drm/vc4: hdmi: Always try to have the highest bpc Currently we take the max_bpc property as the bpc value and do not try anything else. @@ -243684,7 +242694,7 @@ Signed-off-by: Maxime Ripard 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 153cf025163a..fcfd9504a7bc 100644 +index 0b42b06f8e7f..5d566aa1c0b0 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -357,6 +357,7 @@ vc4_hdmi_connector_duplicate_state(struct drm_connector *connector) @@ -243804,7 +242814,7 @@ index 6041571ab41f..36d2a60cc565 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 4 Dec 2020 17:12:06 +0100 -Subject: [PATCH 0659/1050] drm/vc4: hdmi: Support HDMI YUV output +Subject: [PATCH 0644/1183] drm/vc4: hdmi: Support HDMI YUV output In addition to the RGB444 output, the BCM2711 HDMI controller supports the YUV444 and YUV422 output formats. @@ -243821,7 +242831,7 @@ Signed-off-by: Maxime Ripard 4 files changed, 309 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index fcfd9504a7bc..c0fb275e2190 100644 +index 5d566aa1c0b0..9dd0dc3a5167 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -103,15 +103,30 @@ @@ -244395,7 +243405,7 @@ index f7c48aed655b..88e9a398758e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Mon, 16 Aug 2021 13:39:08 +0200 -Subject: [PATCH 0660/1050] media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS +Subject: [PATCH 0645/1183] media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS control commit a9c80593ff80ddb7c6496624e5384e1ea3460a72 upstream. @@ -244455,7 +243465,7 @@ index cda42967cdb3..781f06077c94 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Mon, 16 Aug 2021 13:39:09 +0200 -Subject: [PATCH 0661/1050] media: v4l2-ctrls: Document V4L2_CID_NOTIFY_GAINS +Subject: [PATCH 0646/1183] media: v4l2-ctrls: Document V4L2_CID_NOTIFY_GAINS control commit 311a839a1ad255ebcb7291fb4e0d2ec2f32312a7 upstream. @@ -244509,7 +243519,7 @@ index de43f5c8486d..71f23f131f97 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Penk Chen Date: Mon, 20 Dec 2021 03:44:56 +0900 -Subject: [PATCH 0662/1050] Extending ili9881c driver support for nwe080 panel +Subject: [PATCH 0647/1183] Extending ili9881c driver support for nwe080 panel Signed-off-by: Penk Chen --- @@ -244833,7 +243843,7 @@ index 534dd7414d42..6e03d9b0be60 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Penk Chen Date: Mon, 20 Dec 2021 03:45:46 +0900 -Subject: [PATCH 0663/1050] Enable ili9881 panel and pwm backlight driver by +Subject: [PATCH 0648/1183] Enable ili9881 panel and pwm backlight driver by default Signed-off-by: Penk Chen @@ -244889,7 +243899,7 @@ index 0fffa3b4f72b..62c8654fb68b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Penk Chen Date: Mon, 20 Dec 2021 03:46:26 +0900 -Subject: [PATCH 0664/1050] Add panel overlay for CutiePi +Subject: [PATCH 0649/1183] Add panel overlay for CutiePi Signed-off-by: Penk Chen --- @@ -245074,7 +244084,7 @@ index bc6e3bce22c7..9fd31bcd5569 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Van=C4=9Bk?= Date: Tue, 28 Dec 2021 15:43:10 +0100 -Subject: [PATCH 0665/1050] dtoverlays: Enable cam1_clock when using tc358743 +Subject: [PATCH 0650/1183] dtoverlays: Enable cam1_clock when using tc358743 or irs1125 This fixes a regression introduced in 131f1322039284932ccb601a5cffdd9ca5d36d96 @@ -245124,7 +244134,7 @@ index c85782688e39..c3eebfd1f6ee 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 4 Jan 2022 13:56:42 +0000 -Subject: [PATCH 0666/1050] uapi/v4l2-controls: Reset +Subject: [PATCH 0651/1183] uapi/v4l2-controls: Reset V4L2_CID_USER_BCM2835_ISP_BASE to same as 5.10 https://github.com/raspberrypi/linux/issues/4440 @@ -245163,7 +244173,7 @@ index 781f06077c94..df3a8448375f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Thu, 30 Dec 2021 14:28:37 +0100 -Subject: [PATCH 0667/1050] drm/vc4: hdmi: Fix HDMI monitor detection in polled +Subject: [PATCH 0652/1183] drm/vc4: hdmi: Fix HDMI monitor detection in polled mode When vc4_hdmi_connector_detect() was called in @@ -245179,7 +244189,7 @@ Signed-off-by: Matthias Reichl 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index c0fb275e2190..3d0f7e9d77fd 100644 +index 9dd0dc3a5167..d83e00767c1e 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -243,7 +243,6 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) @@ -245215,7 +244225,7 @@ index c0fb275e2190..3d0f7e9d77fd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Thu, 30 Dec 2021 15:12:19 +0100 -Subject: [PATCH 0668/1050] drm/vc4: hdmi: Fix no video output on DVI monitors +Subject: [PATCH 0653/1183] drm/vc4: hdmi: Fix no video output on DVI monitors The drm edid parser doesn't signal RGB support on DVI monitors with old edid versions, leading to 8-bit RGB mode being rejected @@ -245230,7 +244240,7 @@ Signed-off-by: Matthias Reichl 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 3d0f7e9d77fd..4659b59b348a 100644 +index d83e00767c1e..9b9c79a99ed4 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1415,9 +1415,6 @@ vc4_hdmi_sink_supports_format_bpc(const struct vc4_hdmi *vc4_hdmi, @@ -245250,7 +244260,7 @@ index 3d0f7e9d77fd..4659b59b348a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Andriy Gelman Date: Sun, 2 Jan 2022 12:22:52 -0500 -Subject: [PATCH 0669/1050] staging/bcm2835-codec: Fix typo +Subject: [PATCH 0654/1183] staging/bcm2835-codec: Fix typo Signed-off-by: Andriy Gelman --- @@ -245277,7 +244287,7 @@ index fdbaa96c25a0..472d97d1d228 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 4 Jan 2022 14:46:01 +0000 -Subject: [PATCH 0670/1050] media: i2c: ov9281: Increase diff between VTS and +Subject: [PATCH 0655/1183] media: i2c: ov9281: Increase diff between VTS and max exposure The driver did allow the exposure to go up to VTS - 4 lines, @@ -245343,7 +244353,7 @@ index f0d5551b23c1..7d939128899b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Andreas Blaesius Date: Wed, 5 Jan 2022 20:38:39 +0100 -Subject: [PATCH 0671/1050] Use GitHubs issue form for bug reports +Subject: [PATCH 0656/1183] Use GitHubs issue form for bug reports Use GitHubs issue form for bug reports. @@ -245519,7 +244529,7 @@ index 000000000000..338282d8eb46 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Padmanabha Srinivasaiah Date: Thu, 30 Dec 2021 21:45:10 +0100 -Subject: [PATCH 0672/1050] bcm2835-v4l2-isp: Add missing lock initialization +Subject: [PATCH 0657/1183] bcm2835-v4l2-isp: Add missing lock initialization ISP device allocation is dynamic hence the locks too. struct mutex queue_lock is not initialized which result in bug. @@ -245576,7 +244586,7 @@ index 9aea0b998bd6..57e0ecc193f3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jeff LaBundy Date: Tue, 29 Jan 2019 19:35:45 -0600 -Subject: [PATCH 0673/1050] configs: Enable Azoteq IQS550/572/525 +Subject: [PATCH 0658/1183] configs: Enable Azoteq IQS550/572/525 This patch enables the Azoteq IQS550/572/525 trackpad/touchscreen controller as a module. @@ -245657,7 +244667,7 @@ index c4dff0b42461..c7d9a50ec713 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jeff LaBundy Date: Mon, 28 Jan 2019 23:11:47 -0600 -Subject: [PATCH 0674/1050] overlays: Add overlay for Azoteq IQS550 +Subject: [PATCH 0659/1183] overlays: Add overlay for Azoteq IQS550 This patch adds a device tree overlay for the Azoteq IQS550 trackpad/touchscreen controller. @@ -245765,7 +244775,7 @@ index 000000000000..bb5a4d921962 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 7 Jan 2022 11:12:08 +0000 -Subject: [PATCH 0675/1050] dtoverlays: Add backlight-gpio parameter to +Subject: [PATCH 0660/1183] dtoverlays: Add backlight-gpio parameter to vc4-kms-dpi-generic To allow for the cases where a simple panel does have a GPIO @@ -245833,7 +244843,7 @@ index def175746f66..7846d56c1d1a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: marcone <48169102+marcone@users.noreply.github.com> Date: Mon, 10 Jan 2022 11:37:39 -0800 -Subject: [PATCH 0676/1050] configs: add CONFIG_LEDS_TRIGGER_PATTERN=m +Subject: [PATCH 0661/1183] configs: add CONFIG_LEDS_TRIGGER_PATTERN=m Enable the pattern led trigger. @@ -245913,7 +244923,7 @@ index c7d9a50ec713..c741bcbb0c4a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sat, 8 Jan 2022 13:24:10 +0000 -Subject: [PATCH 0677/1050] drm/vc4: Add alpha_blend_mode property to each +Subject: [PATCH 0662/1183] drm/vc4: Add alpha_blend_mode property to each plane. Move from only supporting the default of pre-multiplied @@ -245926,10 +244936,10 @@ Signed-off-by: Dave Stevenson 1 file changed, 49 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c -index c737fff3cf8d..7714066b6298 100644 +index a82a0b1190eb..b258e9e68411 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -663,6 +663,48 @@ static const u32 colorspace_coeffs[2][DRM_COLOR_ENCODING_MAX][3] = { +@@ -664,6 +664,48 @@ static const u32 colorspace_coeffs[2][DRM_COLOR_ENCODING_MAX][3] = { } }; @@ -245978,7 +244988,7 @@ index c737fff3cf8d..7714066b6298 100644 /* Writes out a full display list for an active plane to the plane's * private dlist state. */ -@@ -945,13 +987,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -946,13 +988,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, /* Position Word 2: Source Image Size, Alpha */ vc4_state->pos2_offset = vc4_state->dlist_count; vc4_dlist_write(vc4_state, @@ -245993,7 +245003,7 @@ index c737fff3cf8d..7714066b6298 100644 VC4_SET_FIELD(vc4_state->src_w[0], SCALER_POS2_WIDTH) | VC4_SET_FIELD(vc4_state->src_h[0], -@@ -996,14 +1033,9 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -997,14 +1034,9 @@ static int vc4_plane_mode_set(struct drm_plane *plane, vc4_dlist_write(vc4_state, VC4_SET_FIELD(state->alpha >> 4, SCALER5_CTL2_ALPHA) | @@ -246010,7 +245020,7 @@ index c737fff3cf8d..7714066b6298 100644 ); /* Position Word 1: Scaled Image Dimensions. */ -@@ -1493,6 +1525,10 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, +@@ -1494,6 +1526,10 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, drm_plane_helper_add(plane, &vc4_plane_helper_funcs); drm_plane_create_alpha_property(plane); @@ -246028,7 +245038,7 @@ index c737fff3cf8d..7714066b6298 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 11 Jan 2022 10:48:30 +0000 -Subject: [PATCH 0678/1050] arm: Fix custom rpi __memset32 and __memset64 +Subject: [PATCH 0663/1183] arm: Fix custom rpi __memset32 and __memset64 See: https://github.com/raspberrypi/linux/issues/4798 @@ -246091,7 +245101,7 @@ index bda4c5b99367..087d68ea5d18 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 12 Jan 2022 12:48:53 +0000 -Subject: [PATCH 0679/1050] overlays: Add vl805 overlay +Subject: [PATCH 0664/1183] overlays: Add vl805 overlay With the automatic VL805 support being removed from the standard CM4 dtb (since most CM4 carriers don't have a VL805), retain support @@ -246174,7 +245184,7 @@ index 000000000000..81adf34b29f2 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 12 Jan 2022 17:27:03 +0000 -Subject: [PATCH 0680/1050] arm: Fix annoying .eh_frame section warnings +Subject: [PATCH 0665/1183] arm: Fix annoying .eh_frame section warnings Replace the cfi directives with the UNWIND equivalents. This prevents the .eh_frame section from being created, eliminating the warnings. @@ -246307,7 +245317,7 @@ index 8b0760c0904c..5715dfd95859 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 13 Jan 2022 11:30:42 +0000 -Subject: [PATCH 0681/1050] drm/vc4: Disable Gamma control on HVS5 due to +Subject: [PATCH 0666/1183] drm/vc4: Disable Gamma control on HVS5 due to issues writing the table Still under investigation, but the conditions under which the HVS @@ -246349,7 +245359,7 @@ index 4af8ce915b09..160cefd0585e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Thu, 13 Jan 2022 15:47:23 +0000 -Subject: [PATCH 0682/1050] drm/vc4: hdmi: Fix clock value used for validating +Subject: [PATCH 0667/1183] drm/vc4: hdmi: Fix clock value used for validating hdmi modes We are using mode->crt_clock here which is filled by drm_mode_set_crtcinfo() @@ -246365,7 +245375,7 @@ Signed-off-by: Dom Cobley 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 4659b59b348a..696cb1e723bb 100644 +index 9b9c79a99ed4..372ae7c7a7fe 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1496,7 +1496,7 @@ vc4_hdmi_encoder_compute_mode_clock(const struct drm_display_mode *mode, @@ -246384,7 +245394,7 @@ index 4659b59b348a..696cb1e723bb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 12 Jan 2022 14:39:46 +0000 -Subject: [PATCH 0683/1050] ARM: dts: Remove VL805 USB node from CM4 dts +Subject: [PATCH 0668/1183] ARM: dts: Remove VL805 USB node from CM4 dts Neither the CM4 module nor the CM4IO board have a VL805 USB3 controller. The existing "usb@0,0" node is a hangover from the @@ -246422,7 +245432,7 @@ index 062e888a3ecd..6e99da17e3c5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 19 Jan 2022 17:22:57 +0000 -Subject: [PATCH 0684/1050] mfd: simple-mfd-i2c: Add configuration for RPi POE +Subject: [PATCH 0669/1183] mfd: simple-mfd-i2c: Add configuration for RPi POE HAT The Raspbery Pi PoE+ HAT exposes a fan controller and power @@ -246493,7 +245503,7 @@ index 51536691ad9d..16eb2a3d0d29 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 19 Jan 2022 17:26:22 +0000 -Subject: [PATCH 0685/1050] pwm: raspberrypi-poe: Add option of being created +Subject: [PATCH 0670/1183] pwm: raspberrypi-poe: Add option of being created by MFD or FW The firmware can only use I2C0 if the kernel isn't, therefore @@ -246670,7 +245680,7 @@ index c877de37734d..1d9ab15a01a5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 20 Jan 2022 15:48:03 +0000 -Subject: [PATCH 0686/1050] power: rpi-poe: Drop CURRENT_AVG as it is not +Subject: [PATCH 0671/1183] power: rpi-poe: Drop CURRENT_AVG as it is not hardware averaged As documented the _AVG parameters are meant to be hardware @@ -246719,7 +245729,7 @@ index 0c96b2c1e8ab..7cf1014aa524 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 20 Jan 2022 15:50:27 +0000 -Subject: [PATCH 0687/1050] power: rpi-poe: Add option of being created by MFD +Subject: [PATCH 0672/1183] power: rpi-poe: Add option of being created by MFD or FW The firmware can only use I2C0 if the kernel isn't, therefore @@ -246959,7 +245969,7 @@ index 7cf1014aa524..e96f98c39f0e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 19 Jan 2022 17:33:14 +0000 -Subject: [PATCH 0688/1050] defconfigs: Add MFD_RASPBERRYPI_POE_HAT to Pi +Subject: [PATCH 0673/1183] defconfigs: Add MFD_RASPBERRYPI_POE_HAT to Pi defconfigs. Required for PoE HAT when driven from Linux over I2C. @@ -247040,7 +246050,7 @@ index c741bcbb0c4a..19cba51847c7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 19 Jan 2022 17:29:13 +0000 -Subject: [PATCH 0689/1050] dtoverlays: Add option for PoE HAT to use Linux I2C +Subject: [PATCH 0674/1183] dtoverlays: Add option for PoE HAT to use Linux I2C instead of FW. Adds parameter "i2c" to use the PoE HAT I2C MFD driver to instantiate @@ -247208,7 +246218,7 @@ index 011f92ad33f3..b78868945e72 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 18 Jan 2022 13:13:14 +0000 -Subject: [PATCH 0690/1050] drivers: bcm2835_unicam: Disable trigger mode +Subject: [PATCH 0675/1183] drivers: bcm2835_unicam: Disable trigger mode operation On a Pi3 B/B+ platform the imx219 sensor frequently generates a single corrupt @@ -247271,7 +246281,7 @@ index 61b08f655058..1a7524282046 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 21 Jan 2022 08:49:13 +0000 -Subject: [PATCH 0691/1050] arm: Remove spurious .fnend directive +Subject: [PATCH 0676/1183] arm: Remove spurious .fnend directive ...a.k.a. Fix annoying build error @@ -247303,40 +246313,8 @@ index 883023aaa6c2..65a6e065a7f2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson -Date: Fri, 22 Oct 2021 16:48:50 +0100 -Subject: [PATCH 0692/1050] drm/vc4: dsi: Correct max divider to 255 (not 7) - -The integer divider from parent PLL to DSI clock is capable -of going up to /255, not just /7 that the driver was trying. -This allows for slower link frequencies on the DSI bus where -the resolution permits. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_dsi.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index f2479f80487a..f19ce4d00378 100644 ---- a/drivers/gpu/drm/vc4/vc4_dsi.c -+++ b/drivers/gpu/drm/vc4/vc4_dsi.c -@@ -850,7 +850,7 @@ 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 < 7; divider++) { -+ for (divider = 1; divider < 255; divider++) { - if (parent_rate / (divider + 1) < pll_clock) - break; - } --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson Date: Fri, 21 Jan 2022 14:11:57 +0000 -Subject: [PATCH 0693/1050] defconfig: Add BACKLIGHT_PWM to bcm2709 and bcmrpi +Subject: [PATCH 0677/1183] defconfig: Add BACKLIGHT_PWM to bcm2709 and bcmrpi defconfigs BACKLIGHT_PWM can be used with DPI displays, so add it to the @@ -247392,7 +246370,7 @@ index 19cba51847c7..6f06ebb08a8d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 21 Jan 2022 14:22:01 +0000 -Subject: [PATCH 0694/1050] dtoverlays: Add pwm backlight option to +Subject: [PATCH 0678/1183] dtoverlays: Add pwm backlight option to vc4-kms-dpi-generic Adds the option of a PWM controlled backlight on a generic @@ -247507,7 +246485,7 @@ index 7846d56c1d1a..b62c0945582f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 21 Jan 2022 15:12:25 +0000 -Subject: [PATCH 0695/1050] dtoverlays: Correct [h|v]sync_invert config in +Subject: [PATCH 0679/1183] dtoverlays: Correct [h|v]sync_invert config in vc4-kms-dpi-generic Both the base node and override set these parameters to 0, @@ -247551,7 +246529,7 @@ index b62c0945582f..54bcd7d8505c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 21 Jan 2022 12:24:57 +0000 -Subject: [PATCH 0696/1050] ARM: dts: BCM2711 AON_INTR2 generates IRQ edges +Subject: [PATCH 0680/1183] ARM: dts: BCM2711 AON_INTR2 generates IRQ edges THe AON_INTR2 controller manages the HDMI interrupts, combining them into a single interrupt passed to the GIC. bcm2711.dtsi declares the @@ -247596,7 +246574,7 @@ index 2ac2125ce7d3..f8c327b3c660 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Andreas Watterott <1488433+awatterott@users.noreply.github.com> Date: Sat, 22 Jan 2022 12:32:09 +0100 -Subject: [PATCH 0697/1050] update rpi-display-overlay.dts pins for 5.10+ +Subject: [PATCH 0681/1183] update rpi-display-overlay.dts pins for 5.10+ backlight has been turned off --- @@ -247623,7 +246601,7 @@ index de87432ff2be..2cf937b56456 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 25 Jan 2022 15:48:53 +0000 -Subject: [PATCH 0698/1050] media: i2c: imx219: Correct the minimum vblanking +Subject: [PATCH 0682/1183] media: i2c: imx219: Correct the minimum vblanking value The datasheet for this sensor documents the minimum vblanking as being @@ -247655,7 +246633,7 @@ index ddc6db846f94..6ee046096ef4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 8 Apr 2020 16:12:02 +0100 -Subject: [PATCH 0699/1050] drm/vc4_hdmi: Add Broadcast RGB property to allow +Subject: [PATCH 0683/1183] drm/vc4_hdmi: Add Broadcast RGB property to allow override of RGB range Copy Intel's "Broadcast RGB" property semantics to add manual override @@ -247669,7 +246647,7 @@ Signed-off-by: Dave Stevenson 2 files changed, 118 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 696cb1e723bb..f135ec975c0a 100644 +index 372ae7c7a7fe..f915d96ff512 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -57,6 +57,14 @@ @@ -247885,7 +246863,7 @@ index 49935370c08f..0d2de05839c4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: coldspark29 Date: Wed, 18 Aug 2021 14:42:22 +0200 -Subject: [PATCH 0700/1050] configs: Add CONFIG_MAX30102=m +Subject: [PATCH 0684/1183] configs: Add CONFIG_MAX30102=m See: https://github.com/raspberrypi/linux/pull/4535 @@ -247965,7 +246943,7 @@ index 6f06ebb08a8d..6210be66f700 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: coldspark29 Date: Wed, 18 Aug 2021 13:41:04 +0200 -Subject: [PATCH 0701/1050] overlays: Add MAX30102 HR to i2c-sensor overlay +Subject: [PATCH 0685/1183] overlays: Add MAX30102 HR to i2c-sensor overlay Add support for the MAX30102 heart rate and blood oxygen sensor to the i2c-sensor overlay. @@ -248051,7 +247029,7 @@ index b05b0fa91942..33965be4b1e8 100755 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Mon, 31 Jan 2022 17:12:10 -0700 -Subject: [PATCH 0702/1050] misc: bcm2835_smi: Use proper enum types for +Subject: [PATCH 0686/1183] misc: bcm2835_smi: Use proper enum types for dma_{,un}map_single() Clang warns: @@ -248142,7 +247120,7 @@ index f1a7f6a3e966..831b7038c78d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Mon, 31 Jan 2022 17:15:35 -0700 -Subject: [PATCH 0703/1050] ASoC: ma120x0p: Remove unnecessary const specifier +Subject: [PATCH 0687/1183] ASoC: ma120x0p: Remove unnecessary const specifier Clang warns: @@ -248186,7 +247164,7 @@ index c447d37450b7..ac812e83178d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Mon, 31 Jan 2022 17:20:55 -0700 -Subject: [PATCH 0704/1050] ASoC: bcm: allo-piano-dac-plus: Remove unnecessary +Subject: [PATCH 0688/1183] ASoC: bcm: allo-piano-dac-plus: Remove unnecessary const specifiers Clang warns: @@ -248267,7 +247245,7 @@ index fd0fe58421b0..3efc898c601d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Mon, 31 Jan 2022 17:23:38 -0700 -Subject: [PATCH 0705/1050] media: bcm2835-unicam: Set ret on error path in +Subject: [PATCH 0689/1183] media: bcm2835-unicam: Set ret on error path in unicam_async_complete() Clang warns: @@ -248316,7 +247294,7 @@ index 1a7524282046..4bba864b2366 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Mon, 31 Jan 2022 17:50:43 -0700 -Subject: [PATCH 0706/1050] media: i2c: ov9281: Initialize id_msb to zero in +Subject: [PATCH 0690/1183] media: i2c: ov9281: Initialize id_msb to zero in ov9281_check_sensor_id() Clang warns: @@ -248370,7 +247348,7 @@ index 7d939128899b..0a5f9e0927ae 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Fri, 28 Jan 2022 13:36:51 -0800 -Subject: [PATCH 0707/1050] i2c: bcm2835: Make clock-stretch timeout +Subject: [PATCH 0691/1183] i2c: bcm2835: Make clock-stretch timeout configurable The default clock-stretch timeout is 35 mS, which works well for @@ -248421,7 +247399,7 @@ index d768247c7e50..7408e2c136b0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: tiagofreire-pt <41837236+tiagofreire-pt@users.noreply.github.com> Date: Sat, 29 Jan 2022 10:01:36 +0000 -Subject: [PATCH 0708/1050] Patching lan78xx for SOF_TIMESTAMPING_TX_SOFTWARE +Subject: [PATCH 0692/1183] Patching lan78xx for SOF_TIMESTAMPING_TX_SOFTWARE support --- @@ -248447,7 +247425,7 @@ index ac68716136cf..2ccda40a7d0a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 31 Jan 2022 16:28:43 +0000 -Subject: [PATCH 0709/1050] drm/vc4: Add DRM 210101010 RGB formats for hvs5. +Subject: [PATCH 0693/1183] drm/vc4: Add DRM 210101010 RGB formats for hvs5. HVS5 supports the 210101010 RGB[A|X] formats, but they were missing from the DRM to HVS mapping list, so weren't available. @@ -248459,7 +247437,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c -index 7714066b6298..7a0f9d55777d 100644 +index b258e9e68411..aab4dfa282e5 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -135,6 +135,34 @@ static const struct hvs_format { @@ -248504,7 +247482,7 @@ index 7714066b6298..7a0f9d55777d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 31 Jan 2022 21:01:25 +0000 -Subject: [PATCH 0710/1050] overlays: Add spi0-0cs overlay +Subject: [PATCH 0694/1183] overlays: Add spi0-0cs overlay An overlay to enable SPI0 without claiming any chip select GPIOs. @@ -248599,7 +247577,7 @@ index 000000000000..0d2acabf56a4 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 31 Jan 2022 17:25:19 +0000 -Subject: [PATCH 0711/1050] dtoverlays: Rework vc4-kms-dpi overlays to remove +Subject: [PATCH 0695/1183] dtoverlays: Rework vc4-kms-dpi overlays to remove duplication Removes all the common panel, dpi, and backlight configuration @@ -249167,7 +248145,7 @@ index b03394844abd..4c1aa1c70158 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 28 Jan 2022 17:37:43 -0600 -Subject: [PATCH 0712/1050] media: uapi: Document format +Subject: [PATCH 0696/1183] media: uapi: Document format MEDIA_BUS_FMT_RGB565_1X24_CPADHI Add support for MEDIA_BUS_FMT_RGB565_1X24_CPADHI. This format is used @@ -249233,7 +248211,7 @@ index 6e143e47d967..6901f53d2196 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 28 Jan 2022 17:38:40 -0600 -Subject: [PATCH 0713/1050] media: uapi: add MEDIA_BUS_FMT_RGB565_1X24_CPADHI +Subject: [PATCH 0697/1183] media: uapi: add MEDIA_BUS_FMT_RGB565_1X24_CPADHI Add the MEDIA_BUS_FMT_RGB565_1X24_CPADHI format used by the Geekworm MZP280 panel for the Raspberry Pi. @@ -249270,7 +248248,7 @@ index 6ad34f88c7dd..bd33edf8f5f7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 28 Jan 2022 17:39:54 -0600 -Subject: [PATCH 0714/1050] drm/vc4: dpi: Support DPI interface in mode3 for +Subject: [PATCH 0698/1183] drm/vc4: dpi: Support DPI interface in mode3 for RGB565 Add support for the VC4 DPI driver to utilize DPI mode 3. This is @@ -249307,7 +248285,7 @@ index 08147d0eab83..0d4fb6818d51 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 28 Jan 2022 17:40:50 -0600 -Subject: [PATCH 0715/1050] dt-bindings: vendor-prefixes: Add Geekworm +Subject: [PATCH 0699/1183] dt-bindings: vendor-prefixes: Add Geekworm Add vendor prefix for Geekworm (https://geekworm.com). @@ -249336,7 +248314,7 @@ index 008fb3c902ed..3c65028f5335 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 28 Jan 2022 17:41:18 -0600 -Subject: [PATCH 0716/1050] dt-bindings: display: simple: add Geekworm MZP280 +Subject: [PATCH 0700/1183] dt-bindings: display: simple: add Geekworm MZP280 Panel The Geekworm MZP280 panel is a 480x640 (portrait) panel with a @@ -249376,7 +248354,7 @@ index 6637cb1243c3..37a9e6d12118 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 28 Jan 2022 17:42:12 -0600 -Subject: [PATCH 0717/1050] drm/panel: simple: add Geekworm MZP280 Panel +Subject: [PATCH 0701/1183] drm/panel: simple: add Geekworm MZP280 Panel Add support for the Geekworm MZP280 Panel @@ -249387,7 +248365,7 @@ Acked-by: Maxime Ripard 1 file changed, 29 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c -index c0d178bcbefa..93a4a9bd1adc 100644 +index e9d3522821c1..da3630e8873e 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -2321,6 +2321,32 @@ static const struct panel_desc friendlyarm_hd702e = { @@ -249440,7 +248418,7 @@ index c0d178bcbefa..93a4a9bd1adc 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 2 Feb 2022 09:11:20 +0000 -Subject: [PATCH 0718/1050] overlays: README: Deprecate vc4-kms-kippah-7inch +Subject: [PATCH 0702/1183] overlays: README: Deprecate vc4-kms-kippah-7inch The vc4-kms-kippah-7inch overlay has been replaced by the container overlay vc4-kms-dpi-panel, using the "kippah-7inch" parameter. The @@ -249477,7 +248455,7 @@ index d92f41146c13..cfc8bfbcbef8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 1 Feb 2022 12:20:20 +0000 -Subject: [PATCH 0719/1050] drm/panel: Add and initialise an orientation field +Subject: [PATCH 0703/1183] drm/panel: Add and initialise an orientation field to drm_panel Current usage of drm_connector_set_panel_orientation is from a panel's @@ -249498,10 +248476,10 @@ Signed-off-by: Dave Stevenson 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c -index c916f4b8907e..a63d6d238e3c 100644 +index b32295abd9e7..c28328a990da 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c -@@ -79,6 +79,10 @@ static int panel_bridge_attach(struct drm_bridge *bridge, +@@ -80,6 +80,10 @@ static int panel_bridge_attach(struct drm_bridge *bridge, return ret; } @@ -249576,7 +248554,7 @@ index 4602f833eb51..830b4d058622 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 1 Feb 2022 12:24:51 +0000 -Subject: [PATCH 0720/1050] drm/panel: simple: Remove custom handling of +Subject: [PATCH 0704/1183] drm/panel: simple: Remove custom handling of orientation Panel orientation is now handled by the drm_panel and @@ -249588,7 +248566,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 11 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c -index 93a4a9bd1adc..8f7e4af449f6 100644 +index da3630e8873e..20d90e1b654b 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -195,8 +195,6 @@ struct panel_simple { @@ -249630,7 +248608,7 @@ index 93a4a9bd1adc..8f7e4af449f6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Wed, 2 Feb 2022 10:42:00 -0600 -Subject: [PATCH 0721/1050] overlays: Add rotate property to vc4-kms-dpi-panel +Subject: [PATCH 0705/1183] overlays: Add rotate property to vc4-kms-dpi-panel Allow a user to specify the panel rotation in devicetree as 0, 90, 180, or 270 by setting a parameter. @@ -249687,7 +248665,7 @@ index 02d7f7fb109c..f78fa48b19f9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Wed, 2 Feb 2022 10:43:32 -0600 -Subject: [PATCH 0722/1050] overlays: Add Geekworm mzp280 to vc4-kms-dpi-panel +Subject: [PATCH 0706/1183] overlays: Add Geekworm mzp280 to vc4-kms-dpi-panel Add support for the Geekworm mzp280 DPI panel to the generic vc4-kms-dpi-panel overlay. @@ -249741,7 +248719,7 @@ index 63b616f0345c..ee9e2e8fd246 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 5 Jan 2022 19:14:48 +0000 -Subject: [PATCH 0723/1050] drm/panel: Add panel driver for Ilitek ILI9806E +Subject: [PATCH 0707/1183] drm/panel: Add panel driver for Ilitek ILI9806E panel The Ilitek ILI9806E driver is used in the Pimoroni HyperPixel4 @@ -249758,7 +248736,7 @@ Signed-off-by: Dave Stevenson create mode 100644 drivers/gpu/drm/panel/panel-ilitek-ili9806e.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig -index af1402d83d51..2e072531cfcf 100644 +index 479ffdb64486..ec27f6671b73 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -139,6 +139,17 @@ config DRM_PANEL_ILITEK_ILI9341 @@ -250290,7 +249268,7 @@ index 000000000000..90300f0de477 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 26 Jan 2022 16:02:31 +0000 -Subject: [PATCH 0724/1050] drm/panel: Add panel driver for TDO Y17B based +Subject: [PATCH 0708/1183] drm/panel: Add panel driver for TDO Y17B based panels The Top DisplayOptoelectronics (TDO) T17B driver chip is used @@ -250308,10 +249286,10 @@ Signed-off-by: Dave Stevenson create mode 100644 drivers/gpu/drm/panel/panel-tdo-y17p.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig -index 2e072531cfcf..a4833515c659 100644 +index ec27f6671b73..59cb2e9026cd 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig -@@ -560,6 +560,17 @@ config DRM_PANEL_SONY_ACX565AKM +@@ -562,6 +562,17 @@ config DRM_PANEL_SONY_ACX565AKM Say Y here if you want to enable support for the Sony ACX565AKM 800x600 3.5" panel (found on the Nokia N900). @@ -250633,7 +249611,7 @@ index 000000000000..8edabb1d81ce From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 1 Feb 2022 15:27:01 +0000 -Subject: [PATCH 0725/1050] drm/panel/panel-sitronix-st7701: Support SPI config +Subject: [PATCH 0709/1183] drm/panel/panel-sitronix-st7701: Support SPI config and RGB data The ST7701 supports numerous different interface mechanisms for @@ -251203,7 +250181,7 @@ index 320a2a8fd459..0744f6810706 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 6 Jan 2022 13:15:46 +0000 -Subject: [PATCH 0726/1050] defconfig: Enable Pimoroni HyperPixel drivers in Pi +Subject: [PATCH 0710/1183] defconfig: Enable Pimoroni HyperPixel drivers in Pi defconfigs Drivers for Pimoroni HyperPixel4, HyperPixel 4 Square, and @@ -251307,7 +250285,7 @@ index 6210be66f700..98c473412018 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 4 Feb 2022 11:33:28 +0000 -Subject: [PATCH 0727/1050] bindings: Add sck-idle-input to spi-gpio +Subject: [PATCH 0711/1183] bindings: Add sck-idle-input to spi-gpio Signed-off-by: Phil Elwell --- @@ -251336,7 +250314,7 @@ index 0d0b6d9dad1c..9136f081f420 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 12 Jan 2022 08:23:28 +0000 -Subject: [PATCH 0728/1050] spi: gpio: Add sck-idle-input property +Subject: [PATCH 0712/1183] spi: gpio: Add sck-idle-input property The sck-idle-input property indicates that the spi-gpio driver should return the SCK line to an input when the chip select signals are @@ -251399,7 +250377,7 @@ index 0584f4d2fde2..6890a14eed8e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 6 Jan 2022 13:04:34 +0000 -Subject: [PATCH 0729/1050] dtoverlays: Add overlays for Pimoroni Hyperpixel +Subject: [PATCH 0713/1183] dtoverlays: Add overlays for Pimoroni Hyperpixel displays Adds an overlays for the Pimoroni HyperPixel4, HyperPixel 4 @@ -251813,7 +250791,7 @@ index 000000000000..700046348ecf From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 3 Feb 2022 11:17:16 +0000 -Subject: [PATCH 0730/1050] dtoverlay: Reduce size of PCIE IB window in +Subject: [PATCH 0714/1183] dtoverlay: Reduce size of PCIE IB window in pcie-32-dma overlay The PCIE inbound window is rounded up to a power of 2, so the default @@ -251870,7 +250848,7 @@ index cca3e83721b7..955703563df7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 2 Feb 2022 17:47:54 +0000 -Subject: [PATCH 0731/1050] ARM: dts: Permanently disable hdmi1 and ddc1 on +Subject: [PATCH 0715/1183] ARM: dts: Permanently disable hdmi1 and ddc1 on CM4S CM4S has no HDMI1 output, so it is advisable to disable the controller @@ -251917,69 +250895,8 @@ index a30458a2014e..30068ca41d0e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell -Date: Thu, 3 Feb 2022 15:51:41 +0000 -Subject: [PATCH 0732/1050] net: phy: lan87xx: Decrease phy polling rate - -Polling at 100Hz for 1.5s consumes quite a bit of kworker time with no -obvious benefit. Reduce that polling rate to ~6Hz. - -To further save CPU and power, defer the next poll if no energy is -detected. - -See: https://github.com/raspberrypi/linux/issues/4780 - -Signed-off-by: Phil Elwell ---- - drivers/net/phy/smsc.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c -index c168a7f95a25..92fa77486f2d 100644 ---- a/drivers/net/phy/smsc.c -+++ b/drivers/net/phy/smsc.c -@@ -218,6 +218,8 @@ static int lan87xx_read_status(struct phy_device *phydev) - int err = genphy_read_status(phydev); - - if (!phydev->link && priv->energy_enable) { -+ int energy_detected; -+ - /* Disable EDPD to wake up PHY */ - int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS); - if (rc < 0) -@@ -233,7 +235,7 @@ static int lan87xx_read_status(struct phy_device *phydev) - */ - read_poll_timeout(phy_read, rc, - rc & MII_LAN83C185_ENERGYON || rc < 0, -- 10000, 1500000, true, phydev, -+ 150000, 1500000, true, phydev, - MII_LAN83C185_CTRL_STATUS); - if (rc < 0) - return rc; -@@ -243,10 +245,16 @@ static int lan87xx_read_status(struct phy_device *phydev) - if (rc < 0) - return rc; - -+ energy_detected = !!(rc & MII_LAN83C185_ENERGYON); -+ - rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS, - rc | MII_LAN83C185_EDPWRDOWN); - if (rc < 0) - return rc; -+ -+ /* Save CPU and power by deferring the next poll */ -+ if (!energy_detected) -+ msleep(2000); - } - - return err; --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Phil Elwell Date: Sat, 5 Feb 2022 18:41:07 +0000 -Subject: [PATCH 0733/1050] drm: panel: Fix compilation warnings +Subject: [PATCH 0716/1183] drm: panel: Fix compilation warnings See: https://github.com/raspberrypi/linux/pull/4812 @@ -252022,7 +250939,7 @@ index 8edabb1d81ce..074bf0dadfba 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 4 Feb 2022 16:12:35 +0000 -Subject: [PATCH 0734/1050] media: bcm2835-unicam: Handle a repeated frame +Subject: [PATCH 0717/1183] media: bcm2835-unicam: Handle a repeated frame start with no end In the case of 2 frame starts being received with no frame end @@ -252091,7 +251008,7 @@ index 4bba864b2366..1e0101bb3af9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Feb 2022 16:06:11 +0000 -Subject: [PATCH 0735/1050] overlays: rpi-poe(-plus): Fix parameters +Subject: [PATCH 0718/1183] overlays: rpi-poe(-plus): Fix parameters The support of PoE HATs is complicated because there are two methods to control them - via the firmware, and directly over I2C - the choice @@ -252219,7 +251136,7 @@ index b78868945e72..54deda2f18c3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Wed, 9 Feb 2022 22:20:17 +0100 -Subject: [PATCH 0736/1050] dtoverlays: fix overrides in vc4-kms-dpi-generic +Subject: [PATCH 0719/1183] dtoverlays: fix overrides in vc4-kms-dpi-generic Apparently broken by commit 3c033975. Introduce new names to allow for proper addressing of overrides. @@ -252278,7 +251195,7 @@ index 1e5c5080592b..3e7e172c6c3d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Wed, 9 Feb 2022 22:23:11 +0100 -Subject: [PATCH 0737/1050] dtoverlays: add rgb565-padhi output to +Subject: [PATCH 0720/1183] dtoverlays: add rgb565-padhi output to vc4-kms-dpi-generic This mode is used by some DPI based display adapters, such as the @@ -252323,7 +251240,7 @@ index 3e7e172c6c3d..bf2ac6fe1b0d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 8 Feb 2022 13:49:11 +0000 -Subject: [PATCH 0738/1050] media: i2c: imx219: Scale the pixel clock rate for +Subject: [PATCH 0721/1183] media: i2c: imx219: Scale the pixel clock rate for the 640x480 mode The 640x480 mode uses a special binning mode for high framerate operation where @@ -252458,7 +251375,7 @@ index 6ee046096ef4..4339ddcb5ebc 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 14 Feb 2022 15:34:51 +0000 -Subject: [PATCH 0739/1050] drm/vc4: For DPI, MEDIA_BUS_FMT_RGB565_1X16 is mode +Subject: [PATCH 0722/1183] drm/vc4: For DPI, MEDIA_BUS_FMT_RGB565_1X16 is mode 1, not 3. The mapping is incorrect for RGB565_1X16 as it should be @@ -252489,7 +251406,7 @@ index 0d4fb6818d51..1bf1a4c6033d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 14 Feb 2022 15:59:32 +0000 -Subject: [PATCH 0740/1050] dtoverlays: Add additional mappings to +Subject: [PATCH 0723/1183] dtoverlays: Add additional mappings to vc4-kms-dpi-generic Adds mappings for bgr666, bgr666-padhi, and bgr888. @@ -252542,7 +251459,7 @@ index bf2ac6fe1b0d..85875c266296 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 17 Dec 2021 13:36:52 +0000 -Subject: [PATCH 0741/1050] drm/dsi: Document the meaning and spec references +Subject: [PATCH 0724/1183] drm/dsi: Document the meaning and spec references for MIPI_DSI_MODE_* The MIPI_DSI_MODE_* flags have fairly terse descriptions and no reference @@ -252624,7 +251541,7 @@ index af7ba8071eb0..eea8d86e0668 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 20 Jan 2022 17:29:36 +0000 -Subject: [PATCH 0742/1050] drm/bridge: tc358762: Ignore EPROBE_DEFER when +Subject: [PATCH 0725/1183] drm/bridge: tc358762: Ignore EPROBE_DEFER when logging errors mipi_dsi_attach can fail due to resources not being available @@ -252655,7 +251572,7 @@ index 1bfdfc6affaf..7cda18a12e98 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 30 Sep 2021 17:51:16 +0100 -Subject: [PATCH 0743/1050] drm/vc4: Rename bridge to out_bridge +Subject: [PATCH 0726/1183] drm/vc4: Rename bridge to out_bridge In preparation for converting the encoder to being a bridge, rename the variable holding the next bridge in the chain to @@ -252663,11 +251580,11 @@ out_bridge, so that our bridge can be called bridge. Signed-off-by: Dave Stevenson --- - drivers/gpu/drm/vc4/vc4_dsi.c | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) + drivers/gpu/drm/vc4/vc4_dsi.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index f19ce4d00378..bfb59a1665ec 100644 +index b7b2c76770dc..50f43b16e716 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -553,7 +553,7 @@ struct vc4_dsi { @@ -252688,48 +251605,28 @@ index f19ce4d00378..bfb59a1665ec 100644 break; } -@@ -1667,7 +1667,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) +@@ -1687,9 +1687,9 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + return ret; } - ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, -- &panel, &dsi->bridge); -+ &panel, &dsi->out_bridge); - if (ret) { - /* If the bridge or panel pointed by dev->of_node is not - * enabled, just return 0 here so that we don't prevent the DRM -@@ -1682,10 +1682,10 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) - } +- dsi->bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); +- if (IS_ERR(dsi->bridge)) +- return PTR_ERR(dsi->bridge); ++ dsi->out_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); ++ if (IS_ERR(dsi->out_bridge)) ++ return PTR_ERR(dsi->out_bridge); - if (panel) { -- dsi->bridge = devm_drm_panel_bridge_add_typed(dev, panel, -- DRM_MODE_CONNECTOR_DSI); -- if (IS_ERR(dsi->bridge)) { -- ret = PTR_ERR(dsi->bridge); -+ dsi->out_bridge = devm_drm_panel_bridge_add_typed(dev, panel, -+ DRM_MODE_CONNECTOR_DSI); -+ if (IS_ERR(dsi->out_bridge)) { -+ ret = PTR_ERR(dsi->out_bridge); - goto err_free_dma; - } - } -@@ -1704,7 +1704,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + /* The esc clock rate is supposed to always be 100Mhz. */ + ret = clk_set_rate(dsi->escape_clock, 100 * 1000000); +@@ -1705,7 +1705,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) drm_simple_encoder_init(drm, dsi->encoder, DRM_MODE_ENCODER_DSI); drm_encoder_helper_add(dsi->encoder, &vc4_dsi_encoder_helper_funcs); - ret = drm_bridge_attach(dsi->encoder, dsi->bridge, NULL, 0); + ret = drm_bridge_attach(dsi->encoder, dsi->out_bridge, NULL, 0); - if (ret) { - dev_err(dev, "bridge attach failed: %d\n", ret); - goto err_free_dma; -@@ -1741,7 +1741,7 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master, - { - struct vc4_dsi *dsi = dev_get_drvdata(dev); - -- if (dsi->bridge) -+ if (dsi->out_bridge) - pm_runtime_disable(dev); - - /* + if (ret) + return ret; + /* Disable the atomic helper calls into the bridge. We -- 2.18.4 @@ -252737,7 +251634,7 @@ index f19ce4d00378..bfb59a1665ec 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 7 Feb 2022 17:14:51 +0000 -Subject: [PATCH 0744/1050] drm/vc4: Move DSI initialisation to +Subject: [PATCH 0727/1183] drm/vc4: Move DSI initialisation to encoder_mode_set. Breaking the bridge chain does not work for atomic bridges/panels @@ -252752,7 +251649,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index bfb59a1665ec..0db98e26ab25 100644 +index 50f43b16e716..37c48ea4dc54 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -872,19 +872,19 @@ static bool vc4_dsi_encoder_mode_fixup(struct drm_encoder *encoder, @@ -252809,7 +251706,7 @@ index bfb59a1665ec..0db98e26ab25 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 15 Dec 2021 17:44:49 +0000 -Subject: [PATCH 0745/1050] drm/vc4: Remove splitting the bridge chain from the +Subject: [PATCH 0728/1183] drm/vc4: Remove splitting the bridge chain from the driver. Splitting the bridge chain fails for atomic bridges as the @@ -252821,11 +251718,11 @@ move into the framework. Signed-off-by: Dave Stevenson --- - drivers/gpu/drm/vc4/vc4_dsi.c | 38 ----------------------------------- - 1 file changed, 38 deletions(-) + drivers/gpu/drm/vc4/vc4_dsi.c | 33 --------------------------------- + 1 file changed, 33 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index 0db98e26ab25..34c398b4eb10 100644 +index 37c48ea4dc54..19f710051365 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -554,7 +554,6 @@ struct vc4_dsi { @@ -252885,7 +251782,7 @@ index 0db98e26ab25..34c398b4eb10 100644 if (debug_dump_regs) { struct drm_printer p = drm_info_printer(&dsi->pdev->dev); dev_info(&dsi->pdev->dev, "DSI regs after:\n"); -@@ -1578,7 +1552,6 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) +@@ -1588,7 +1562,6 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) if (!vc4_dsi_encoder) return -ENOMEM; @@ -252893,22 +251790,17 @@ index 0db98e26ab25..34c398b4eb10 100644 vc4_dsi_encoder->base.type = dsi->variant->port ? VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0; vc4_dsi_encoder->dsi = dsi; -@@ -1718,12 +1691,6 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) - dev_err(dev, "bridge attach failed: %d\n", ret); - goto err_free_dma; - } -- /* Disable the atomic helper calls into the bridge. We -- * manually call the bridge pre_enable / enable / etc. calls -- * from our driver, since we need to sequence them within the -- * encoder's enable/disable paths. -- */ +@@ -1722,7 +1695,6 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + * from our driver, since we need to sequence them within the + * encoder's enable/disable paths. + */ - list_splice_init(&dsi->encoder->bridge_chain, &dsi->bridge_chain); vc4_debugfs_add_regset32(drm, dsi->variant->debugfs_name, &dsi->regset); -@@ -1753,11 +1720,6 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master, - if (dsi->out_bridge) - pm_runtime_disable(dev); +@@ -1738,11 +1710,6 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master, + + pm_runtime_disable(dev); - /* - * Restore the bridge_chain so the bridge detach procedure can happen @@ -252916,8 +251808,8 @@ index 0db98e26ab25..34c398b4eb10 100644 - */ - list_splice_init(&dsi->bridge_chain, &dsi->encoder->bridge_chain); drm_encoder_cleanup(dsi->encoder); + } - if (dsi->reg_dma_chan) { -- 2.18.4 @@ -252925,7 +251817,7 @@ index 0db98e26ab25..34c398b4eb10 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 15 Dec 2021 17:47:14 +0000 -Subject: [PATCH 0746/1050] drm/vc4: Convert vc4_dsi to use atomic +Subject: [PATCH 0729/1183] drm/vc4: Convert vc4_dsi to use atomic enable/disable/mode_set. The atomic calls are preferred as the non-atomic ones @@ -252938,7 +251830,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index 34c398b4eb10..a2daf23526ed 100644 +index 19f710051365..70bee90383cc 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -792,7 +792,8 @@ dsi_esc_timing(u32 ns) @@ -253016,7 +251908,7 @@ index 34c398b4eb10..a2daf23526ed 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 15 Dec 2021 17:57:45 +0000 -Subject: [PATCH 0747/1050] drm/vc4: Convert vc4_dsi to using a bridge instead +Subject: [PATCH 0730/1183] drm/vc4: Convert vc4_dsi to using a bridge instead of encoder. Remove the encoder functions, and create a bridge attached to @@ -253032,11 +251924,11 @@ from the general control into _enable and _disable. Signed-off-by: Dave Stevenson --- - drivers/gpu/drm/vc4/vc4_dsi.c | 124 ++++++++++++++++++++++++---------- - 1 file changed, 90 insertions(+), 34 deletions(-) + drivers/gpu/drm/vc4/vc4_dsi.c | 135 +++++++++++++++++++++++----------- + 1 file changed, 94 insertions(+), 41 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index a2daf23526ed..f9cb7a2ad289 100644 +index 70bee90383cc..76fe8cfd8850 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -554,6 +554,7 @@ struct vc4_dsi { @@ -253068,7 +251960,9 @@ index a2daf23526ed..f9cb7a2ad289 100644 - struct drm_atomic_state *state) +static void vc4_dsi_bridge_disable(struct drm_bridge *bridge, + struct drm_bridge_state *state) -+{ + { +- struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder); +- struct vc4_dsi *dsi = vc4_encoder->dsi; + struct vc4_dsi *dsi = bridge_to_vc4_dsi(bridge); + u32 disp0_ctrl; + @@ -253079,9 +251973,7 @@ index a2daf23526ed..f9cb7a2ad289 100644 + +static void vc4_dsi_bridge_post_disable(struct drm_bridge *bridge, + struct drm_bridge_state *state) - { -- struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder); -- struct vc4_dsi *dsi = vc4_encoder->dsi; ++{ + struct vc4_dsi *dsi = bridge_to_vc4_dsi(bridge); struct device *dev = &dsi->pdev->dev; @@ -253257,18 +252149,29 @@ index a2daf23526ed..f9cb7a2ad289 100644 }; static const struct vc4_dsi_variant bcm2711_dsi1_variant = { -@@ -1691,9 +1744,8 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) - goto err_free_dma; +@@ -1692,16 +1745,12 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + return ret; drm_simple_encoder_init(drm, dsi->encoder, DRM_MODE_ENCODER_DSI); - drm_encoder_helper_add(dsi->encoder, &vc4_dsi_encoder_helper_funcs); - ret = drm_bridge_attach(dsi->encoder, dsi->out_bridge, NULL, 0); +- if (ret) +- return ret; +- /* Disable the atomic helper calls into the bridge. We +- * manually call the bridge pre_enable / enable / etc. calls +- * from our driver, since we need to sequence them within the +- * encoder's enable/disable paths. +- */ + ret = drm_bridge_attach(dsi->encoder, &dsi->bridge, NULL, 0); - if (ret) { - dev_err(dev, "bridge attach failed: %d\n", ret); - goto err_free_dma; -@@ -1755,6 +1807,10 @@ static int vc4_dsi_dev_probe(struct platform_device *pdev) ++ if (ret) { ++ dev_err(dev, "bridge attach failed: %d\n", ret); ++ goto err_free_dma; ++ } + + vc4_debugfs_add_regset32(drm, dsi->variant->debugfs_name, &dsi->regset); + +@@ -1735,6 +1784,10 @@ static int vc4_dsi_dev_probe(struct platform_device *pdev) return -ENOMEM; dev_set_drvdata(dev, dsi); @@ -253286,7 +252189,7 @@ index a2daf23526ed..f9cb7a2ad289 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 11 Feb 2022 14:15:26 +0000 -Subject: [PATCH 0748/1050] drm/vc4: Remove entry to ULPS from vc4_dsi +Subject: [PATCH 0731/1183] drm/vc4: Remove entry to ULPS from vc4_dsi post_disable Post_disable was sending the D-PHY sequence to put any device @@ -253305,7 +252208,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c -index f9cb7a2ad289..0b80247961bb 100644 +index 76fe8cfd8850..820e8ecab52d 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -816,8 +816,6 @@ static void vc4_dsi_bridge_post_disable(struct drm_bridge *bridge, @@ -253324,7 +252227,7 @@ index f9cb7a2ad289..0b80247961bb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Wed, 16 Feb 2022 14:31:02 +0000 -Subject: [PATCH 0749/1050] usb: xhci: add a quirk for Superspeed bulk OUT +Subject: [PATCH 0732/1183] usb: xhci: add a quirk for Superspeed bulk OUT transfers on VL805 The VL805 has a bug in its internal FIFO space accounting that results @@ -253412,7 +252315,7 @@ index 0730fe8fe25b..5d6cc93594ee 100644 if (first_trb) { first_trb = false; diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index 63acb4feec2f..1b5b03615d30 100644 +index c653210eac81..78407f21e6a8 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1906,6 +1906,7 @@ struct xhci_hcd { @@ -253430,7 +252333,7 @@ index 63acb4feec2f..1b5b03615d30 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Feb 2022 15:16:56 +0000 -Subject: [PATCH 0750/1050] dtoverlays: Correct link frequency for ov7251 +Subject: [PATCH 0733/1183] dtoverlays: Correct link frequency for ov7251 It was incorrect, so the driver rejected it. @@ -253459,7 +252362,7 @@ index 0e44be8a4468..fcb889f591f7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Tue, 15 Feb 2022 23:07:30 +0000 -Subject: [PATCH 0751/1050] media: i2c: Add acpi support to ov7251 +Subject: [PATCH 0734/1183] media: i2c: Add acpi support to ov7251 Add support for enumeration through ACPI to the ov7251 driver @@ -253504,7 +252407,7 @@ index 2bcc3b70918f..aaaeca14dcc1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Tue, 15 Feb 2022 23:07:31 +0000 -Subject: [PATCH 0752/1050] media: i2c: Provide ov7251_check_hwcfg() +Subject: [PATCH 0735/1183] media: i2c: Provide ov7251_check_hwcfg() Move the endpoint checking from .probe() to a dedicated function, and additionally check that the firmware provided link frequencies @@ -253631,7 +252534,7 @@ index aaaeca14dcc1..e4faf28c6b58 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Tue, 15 Feb 2022 23:07:32 +0000 -Subject: [PATCH 0753/1050] media: i2c: Add ov7251_pll_configure() +Subject: [PATCH 0736/1183] media: i2c: Add ov7251_pll_configure() Rather than having the pll settings hidden inside mode blobs, define them in structs and use a dedicated function to set them. This makes @@ -253903,7 +252806,7 @@ index e4faf28c6b58..a7576f662250 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Tue, 15 Feb 2022 23:07:33 +0000 -Subject: [PATCH 0754/1050] media: i2c: Add support for 19.2MHz clock to ov7251 +Subject: [PATCH 0737/1183] media: i2c: Add support for 19.2MHz clock to ov7251 The OV7251 sensor is used as the IR camera sensor on the Microsoft Surface line of tablets; this provides a 19.2MHz external clock. Add @@ -254053,7 +252956,7 @@ index a7576f662250..084d68b852f7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Tue, 15 Feb 2022 23:07:34 +0000 -Subject: [PATCH 0755/1050] media: i2c: Add ov7251_detect_chip() +Subject: [PATCH 0738/1183] media: i2c: Add ov7251_detect_chip() .probe() is quite busy for this driver; make it cleaner by moving the chip verification to a dedicated function. @@ -254157,7 +253060,7 @@ index 084d68b852f7..492b7082254e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Tue, 15 Feb 2022 23:07:35 +0000 -Subject: [PATCH 0756/1050] media: i2c: Add pm_runtime support to ov7251 +Subject: [PATCH 0739/1183] media: i2c: Add pm_runtime support to ov7251 Add pm_runtime support to the ov7251 driver. @@ -254371,7 +253274,7 @@ index 492b7082254e..4d047226e370 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Tue, 15 Feb 2022 23:07:36 +0000 -Subject: [PATCH 0757/1050] media: i2c: Remove .s_power() from ov7251 +Subject: [PATCH 0740/1183] media: i2c: Remove .s_power() from ov7251 The .s_power() callback is deprecated, and now that we have pm_runtime functionality in the driver there's no further use for it. Delete the @@ -254466,7 +253369,7 @@ index 4d047226e370..18f4c28c573e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Feb 2022 14:48:30 +0000 -Subject: [PATCH 0758/1050] media: i2c: ov7251: Reinstate setting +Subject: [PATCH 0741/1183] media: i2c: ov7251: Reinstate setting ov7251_global_init_setting "media: i2c: Remove .s_power() from ov7251" removed the call that @@ -254504,7 +253407,7 @@ index 18f4c28c573e..3ba98ad4850b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sat, 12 Feb 2022 09:47:38 +0000 -Subject: [PATCH 0759/1050] media: i2c: ov7251: V4L2_CID_PIXEL_RATE is fixed +Subject: [PATCH 0742/1183] media: i2c: ov7251: V4L2_CID_PIXEL_RATE is fixed The pixel rate doesn't actually change based on the mode, and can not be set by userspace. @@ -254614,7 +253517,7 @@ index 3ba98ad4850b..06e45f46e723 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sat, 12 Feb 2022 09:53:47 +0000 -Subject: [PATCH 0760/1050] media: i2c: ov7251: V4L2_CID_LINK_FREQUENCY is +Subject: [PATCH 0743/1183] media: i2c: ov7251: V4L2_CID_LINK_FREQUENCY is fixed The link frequency does not change with the mode, so remove @@ -254728,7 +253631,7 @@ index 06e45f46e723..419fce0348a7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sat, 12 Feb 2022 11:57:19 +0000 -Subject: [PATCH 0761/1050] media: i2c: ov7251: Initialise current_mode during +Subject: [PATCH 0744/1183] media: i2c: ov7251: Initialise current_mode during probe Initialise ov7251->current_mode during probe to avoid the issue @@ -254760,7 +253663,7 @@ index 419fce0348a7..8f782c83eac7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sat, 12 Feb 2022 12:05:02 +0000 -Subject: [PATCH 0762/1050] media: i2c: ov7251: Add V4L2_CID_HBLANK control +Subject: [PATCH 0745/1183] media: i2c: ov7251: Add V4L2_CID_HBLANK control HBLANK is a fixed value in this driver, so add as a fixed read-only control. @@ -254851,7 +253754,7 @@ index 8f782c83eac7..04cc0118d28f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Sat, 12 Feb 2022 12:33:13 +0000 -Subject: [PATCH 0763/1050] media: i2c: ov7251: Do not reset gain on mode +Subject: [PATCH 0746/1183] media: i2c: ov7251: Do not reset gain on mode change There is no reaon why changing mode should reset the analogue @@ -254916,7 +253819,7 @@ index 04cc0118d28f..db3ac100686c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Feb 2022 15:57:01 +0000 -Subject: [PATCH 0764/1050] media: i2c: ov7251: Fix link_freq validation loop +Subject: [PATCH 0747/1183] media: i2c: ov7251: Fix link_freq validation loop If only one link frequency was configured, then ov7251_check_hwcfg failed as the conditions weren't checked in the appropriate places. @@ -254955,7 +253858,7 @@ index db3ac100686c..5de185e2db12 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Feb 2022 16:23:23 +0000 -Subject: [PATCH 0765/1050] media: i2c: ov7251: Add get_selection for +Subject: [PATCH 0748/1183] media: i2c: ov7251: Add get_selection for NATIVE_SIZE, CROP_BOUNDS, CROP_DEFAULT As required by libcamera, add get_selection handling for @@ -255039,7 +253942,7 @@ index 5de185e2db12..00074b68ee43 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Feb 2022 16:24:51 +0000 -Subject: [PATCH 0766/1050] media: i2c: ov7251: Set VTS instead of having full +Subject: [PATCH 0749/1183] media: i2c: ov7251: Set VTS instead of having full tables for FPS. The driver did have a full copy of the registers for each of @@ -255418,7 +254321,7 @@ index 00074b68ee43..6118c234f342 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Feb 2022 16:44:33 +0000 -Subject: [PATCH 0767/1050] media: i2c: ov7251: Limit exposure based on VTS +Subject: [PATCH 0750/1183] media: i2c: ov7251: Limit exposure based on VTS The maximum exposure is dictated by VTS, so compute it rather than having the value in the mode table. @@ -255502,7 +254405,7 @@ index 6118c234f342..54eee4fddabe 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Feb 2022 17:00:27 +0000 -Subject: [PATCH 0768/1050] media: i2c: ov7251: Separate modes from frame +Subject: [PATCH 0751/1183] media: i2c: ov7251: Separate modes from frame intervals The modes and frame intervals are independent, therefore @@ -255742,7 +254645,7 @@ index 54eee4fddabe..108658ac6994 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Feb 2022 18:08:39 +0000 -Subject: [PATCH 0769/1050] media: i2c: ov7251: Add V4L2_CID_VBLANK +Subject: [PATCH 0752/1183] media: i2c: ov7251: Add V4L2_CID_VBLANK This is a raw sensor so should be implementing V4L2_CID_VBLANK instead of the frame_interval ops, as per docs at @@ -255901,7 +254804,7 @@ index 108658ac6994..65bb3e0fd265 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Feb 2022 18:31:56 +0000 -Subject: [PATCH 0770/1050] media: i2c: ov7251: Switch from V4L2_CID_GAIN to +Subject: [PATCH 0753/1183] media: i2c: ov7251: Switch from V4L2_CID_GAIN to V4L2_CID_ANALOGUE_GAIN The control is specifically for analogue gain, therefore switch @@ -255943,7 +254846,7 @@ index 65bb3e0fd265..adc8e1980cfd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Feb 2022 18:12:36 +0000 -Subject: [PATCH 0771/1050] dtoverlays: Switch ov7251 to using Media Controller +Subject: [PATCH 0754/1183] dtoverlays: Switch ov7251 to using Media Controller by default We should have all the functionality required by now, so switch @@ -255973,7 +254876,7 @@ index fcb889f591f7..3cf109ec998f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 14 Feb 2022 17:21:05 +0100 -Subject: [PATCH 0772/1050] drm/vc4: hvs: Use pointer to HVS in HVS_READ and +Subject: [PATCH 0755/1183] drm/vc4: hvs: Use pointer to HVS in HVS_READ and HVS_WRITE macros Those macros are really about the HVS itself, and thus its associated @@ -256481,7 +255384,7 @@ index 20fa5a15d6f6..dcb27969fba7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 16 Dec 2021 14:54:54 +0100 -Subject: [PATCH 0773/1050] drm/vc4: hvs: Defer dlist slots deallocation +Subject: [PATCH 0756/1183] drm/vc4: hvs: Defer dlist slots deallocation During normal operations, the cursor position update is done through an asynchronous plane update, which on the vc4 driver basically just @@ -256902,7 +255805,7 @@ index 88e9a398758e..c7b2be063189 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 20 Feb 2022 16:27:11 +0000 -Subject: [PATCH 0774/1050] ARM: dts: Add GPIO line names for downstream RPis +Subject: [PATCH 0757/1183] ARM: dts: Add GPIO line names for downstream RPis Largely copied from the upstream dts files, with a few additions and tweaks. @@ -257904,7 +256807,7 @@ index 38629ebfa47f..601b0573c7a7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Joerg Schambacher Date: Wed, 23 Feb 2022 12:08:42 +0100 -Subject: [PATCH 0775/1050] overlays:fixes probing of Hifiberry DAC2 HD +Subject: [PATCH 0758/1183] overlays:fixes probing of Hifiberry DAC2 HD Removed clocks-declarations in I2C sections of the DT-overlay which kept the devices from probing. @@ -257975,7 +256878,7 @@ index c5583e010339..b9165138c7ad 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: nmbath Date: Thu, 24 Feb 2022 13:10:01 +0000 -Subject: [PATCH 0776/1050] overlays: Overlays for WaveShare 2-Chan CAN FD HAT +Subject: [PATCH 0759/1183] overlays: Overlays for WaveShare 2-Chan CAN FD HAT This patch adds the overlays for the Waveshare 2-Channel Isolated CAN FD Expansion HAT for Raspberry Pi, Multi Protections. This HAT @@ -258310,7 +257213,7 @@ index 000000000000..b2504922c8de From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 25 Feb 2022 09:53:56 +0000 -Subject: [PATCH 0777/1050] overlays: Add "drm" parameter to pitft35-resistive +Subject: [PATCH 0760/1183] overlays: Add "drm" parameter to pitft35-resistive The "drm" parameter forces the use of the hx8357d DRM driver, when by default the fb_hx8357d framebuffer driver will be used in preference. @@ -258356,7 +257259,7 @@ index 37629f18a740..713532cb2272 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 25 Feb 2022 15:08:56 +0000 -Subject: [PATCH 0778/1050] configs: Add CONFIG_TINYDRM_HX8357D=m +Subject: [PATCH 0761/1183] configs: Add CONFIG_TINYDRM_HX8357D=m See: https://forums.raspberrypi.com/viewtopic.php?t=330088 @@ -258436,7 +257339,7 @@ index 98c473412018..01ef1bdc4900 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 1 Mar 2022 15:12:15 +0000 -Subject: [PATCH 0779/1050] usb: xhci: rework XHCI_VLI_SS_BULK_OUT_BUG quirk +Subject: [PATCH 0762/1183] usb: xhci: rework XHCI_VLI_SS_BULK_OUT_BUG quirk Fix incorrectly applying the quirk for bulk IN endpoints and remove the commentary which is not completely accurate based on observed behaviour. @@ -258493,7 +257396,7 @@ index 5d6cc93594ee..6b4cb26407d5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 1 Mar 2022 15:17:04 +0000 -Subject: [PATCH 0780/1050] usb: xhci: expand the scope of +Subject: [PATCH 0763/1183] usb: xhci: expand the scope of XHCI_VLI_SS_BULK_OUT_BUG Further testing has revealed that any TRB with buffer length that is not @@ -258513,10 +257416,10 @@ Signed-off-by: Jonathan Bell 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index 6fa69874a1ec..c2d698048d6f 100644 +index 02e9b0ca0cb8..a624e491e64c 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -1417,9 +1417,12 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb) +@@ -1408,9 +1408,12 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb) static int xhci_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) { @@ -258529,7 +257432,7 @@ index 6fa69874a1ec..c2d698048d6f 100644 if (xhci_urb_suitable_for_idt(urb)) return 0; -@@ -1428,6 +1431,16 @@ static int xhci_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, +@@ -1419,6 +1422,16 @@ static int xhci_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, if (xhci_urb_temp_buffer_required(hcd, urb)) return xhci_map_temp_buffer(hcd, urb); } @@ -258546,7 +257449,7 @@ index 6fa69874a1ec..c2d698048d6f 100644 return usb_hcd_map_urb_for_dma(hcd, urb, mem_flags); } -@@ -1441,7 +1454,8 @@ static void xhci_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) +@@ -1432,7 +1445,8 @@ static void xhci_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) if (urb->num_sgs && (urb->transfer_flags & URB_DMA_MAP_SINGLE)) unmap_temp_buf = true; @@ -258563,7 +257466,7 @@ index 6fa69874a1ec..c2d698048d6f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 25 Feb 2022 18:16:13 +0000 -Subject: [PATCH 0781/1050] media/i2c: Add driver for Omnivision OV2311 +Subject: [PATCH 0764/1183] media/i2c: Add driver for Omnivision OV2311 Omnivision OV2311 is a CSI2 1600x1300 global shutter image sensor. Add a driver for it. @@ -259804,7 +258707,7 @@ index 000000000000..a6d68e760742 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 25 Feb 2022 18:16:26 +0000 -Subject: [PATCH 0782/1050] dtoverlays: Add overlay for Omnivision OV2311 image +Subject: [PATCH 0765/1183] dtoverlays: Add overlay for Omnivision OV2311 image sensor Adds an overlay for the OV2311 1600x1300 monochrome global @@ -259962,7 +258865,7 @@ index 000000000000..9f8e1b3edccc From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 25 Feb 2022 18:14:39 +0000 -Subject: [PATCH 0783/1050] defconfigs: Add OV2311 image sensor to Pi +Subject: [PATCH 0766/1183] defconfigs: Add OV2311 image sensor to Pi defconfigs Signed-off-by: Dave Stevenson @@ -260041,7 +258944,7 @@ index 01ef1bdc4900..039d06428669 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 2 Mar 2022 17:23:16 +0000 -Subject: [PATCH 0784/1050] staging/vc-sm-cma: Avoid log spamming on Pi0/1 over +Subject: [PATCH 0767/1183] staging/vc-sm-cma: Avoid log spamming on Pi0/1 over cache alias. Pi 0/1 use the 0x80000000 cache alias as the ARM also sees the world @@ -260088,7 +258991,7 @@ index 88c4df822922..82a9c6e7f277 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Wed, 2 Mar 2022 16:47:37 +0000 -Subject: [PATCH 0785/1050] staging: vc04_services: isp: Permit all sRGB colour +Subject: [PATCH 0768/1183] staging: vc04_services: isp: Permit all sRGB colour spaces on ISP outputs ISP outputs actually support all colour spaces that are fundamentally @@ -260255,7 +259158,7 @@ index a545dbf2b5dd..5ab232ff9bd9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 3 Mar 2022 16:45:53 +0000 -Subject: [PATCH 0786/1050] drivers: staging: bcm2835-isp: Do not cleanup mmal +Subject: [PATCH 0769/1183] drivers: staging: bcm2835-isp: Do not cleanup mmal vcsm buffer on stop_streaming On stop_streaming() the vcsm buffer handle gets released by the buffer cleanup @@ -260304,7 +259207,7 @@ index 57e0ecc193f3..9ea817073dcd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 8 Sep 2021 21:12:26 +0200 -Subject: [PATCH 0787/1050] drm/vc4: Fix out of order frames during +Subject: [PATCH 0770/1183] drm/vc4: Fix out of order frames during asynchronous page flips When doing an asynchronous page flip (PAGE_FLIP ioctl with the @@ -260407,7 +259310,7 @@ index 49016f7e6b9f..da264e2c4982 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Mon, 7 Mar 2022 10:00:33 +0000 -Subject: [PATCH 0788/1050] staging: vc04_services: codec: Add support for +Subject: [PATCH 0771/1183] staging: vc04_services: codec: Add support for V4L2_PIX_FMT_RGBA32 format We already support V4L2_PIX_FMT_BGR32 which is the same thing with red @@ -260443,7 +259346,7 @@ index 472d97d1d228..4451ceecb265 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 4 Mar 2022 15:58:51 +0100 -Subject: [PATCH 0789/1050] drm/vc4: kms: Store channel in local variable +Subject: [PATCH 0772/1183] drm/vc4: kms: Store channel in local variable We use the channel from our vc4_crtc_state structure in multiple places, let's store it in a local variable to make it cleaner. @@ -260519,7 +259422,7 @@ index dcb27969fba7..db82e40fbbce 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 4 Mar 2022 15:59:08 +0100 -Subject: [PATCH 0790/1050] drm/vc4: kms: Warn if we have an incompatible +Subject: [PATCH 0773/1183] drm/vc4: kms: Warn if we have an incompatible muxing setup The documentation explicitly states we must prevent the output @@ -260554,7 +259457,7 @@ index db82e40fbbce..1dbb6e0427fc 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 4 Mar 2022 15:59:40 +0100 -Subject: [PATCH 0791/1050] drm/vc4: kms: Improve logging +Subject: [PATCH 0774/1183] drm/vc4: kms: Improve logging When debugging, finding out what muxing decisions were made and what the actual core clock rate is is always useful, so let's add some more @@ -260626,7 +259529,7 @@ index 1dbb6e0427fc..0ac34db76b47 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Mar 2022 12:47:49 +0000 -Subject: [PATCH 0792/1050] ARM: dts: bcm2711-rpi-ds: Disable the BCM2835 STC +Subject: [PATCH 0775/1183] ARM: dts: bcm2711-rpi-ds: Disable the BCM2835 STC Although BCM2711 still includes the old BCM2835 system timer, the newer per-core local timers are preferred because they are more efficient to @@ -260659,7 +259562,7 @@ index ebf73b789b4a..cd5c43adc56b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 16 Dec 2021 15:25:35 +0000 -Subject: [PATCH 0793/1050] drm/bridge: Introduce pre_enable_upstream_first to +Subject: [PATCH 0776/1183] drm/bridge: Introduce pre_enable_upstream_first to alter bridge init order DSI sink devices typically want the DSI host powered up and configured @@ -260693,10 +259596,10 @@ Signed-off-by: Dave Stevenson 2 files changed, 137 insertions(+), 48 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c -index a8ed66751c2d..e0f57427a545 100644 +index 7ee29f073857..726a393b8896 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c -@@ -463,20 +463,15 @@ EXPORT_SYMBOL(drm_bridge_chain_disable); +@@ -462,20 +462,15 @@ EXPORT_SYMBOL(drm_bridge_chain_disable); * encoder chain, starting from the first bridge to the last. These are called * after completing the encoder's prepare op. * @@ -260722,7 +259625,7 @@ index a8ed66751c2d..e0f57427a545 100644 } EXPORT_SYMBOL(drm_bridge_chain_post_disable); -@@ -518,24 +513,14 @@ EXPORT_SYMBOL(drm_bridge_chain_mode_set); +@@ -517,24 +512,14 @@ EXPORT_SYMBOL(drm_bridge_chain_mode_set); * chain, starting from the last bridge to the first. These are called * before calling the encoder's commit op. * @@ -260751,7 +259654,7 @@ index a8ed66751c2d..e0f57427a545 100644 } EXPORT_SYMBOL(drm_bridge_chain_pre_enable); -@@ -607,6 +592,25 @@ void drm_atomic_bridge_chain_disable(struct drm_bridge *bridge, +@@ -606,6 +591,25 @@ void drm_atomic_bridge_chain_disable(struct drm_bridge *bridge, } EXPORT_SYMBOL(drm_atomic_bridge_chain_disable); @@ -260777,7 +259680,7 @@ index a8ed66751c2d..e0f57427a545 100644 /** * drm_atomic_bridge_chain_post_disable - cleans up after disabling all bridges * in the encoder chain -@@ -617,6 +621,9 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_disable); +@@ -616,6 +620,9 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_disable); * &drm_bridge_funcs.post_disable) op for all the bridges in the encoder chain, * starting from the first bridge to the last. These are called after completing * &drm_encoder_helper_funcs.atomic_disable @@ -260787,7 +259690,7 @@ index a8ed66751c2d..e0f57427a545 100644 * * Note: the bridge passed should be the one closest to the encoder */ -@@ -624,30 +631,75 @@ void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge, +@@ -623,30 +630,75 @@ void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge, struct drm_atomic_state *old_state) { struct drm_encoder *encoder; @@ -260875,7 +259778,7 @@ index a8ed66751c2d..e0f57427a545 100644 /** * drm_atomic_bridge_chain_pre_enable - prepares for enabling all bridges in * the encoder chain -@@ -659,32 +711,61 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_post_disable); +@@ -658,32 +710,61 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_post_disable); * starting from the last bridge to the first. These are called before calling * &drm_encoder_helper_funcs.atomic_enable * @@ -260950,7 +259853,7 @@ index a8ed66751c2d..e0f57427a545 100644 if (iter == bridge) break; diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h -index 46bdfa48c413..e1466106b319 100644 +index 1648ce265cba..3e4e87069f70 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -761,6 +761,14 @@ struct drm_bridge { @@ -260975,7 +259878,7 @@ index 46bdfa48c413..e1466106b319 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 23 Feb 2022 15:36:56 +0000 -Subject: [PATCH 0794/1050] drm/panel: Add prepare_upstream_first flag to +Subject: [PATCH 0777/1183] drm/panel: Add prepare_upstream_first flag to drm_panel Mapping to the drm_bridge flag pre_enable_upstream_first, @@ -260990,10 +259893,10 @@ Signed-off-by: Dave Stevenson 2 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c -index a63d6d238e3c..f11ff627d5d6 100644 +index c28328a990da..875bf577baae 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c -@@ -225,6 +225,9 @@ struct drm_bridge *drm_panel_bridge_add_typed(struct drm_panel *panel, +@@ -226,6 +226,9 @@ struct drm_bridge *drm_panel_bridge_add_typed(struct drm_panel *panel, panel_bridge->bridge.ops = DRM_BRIDGE_OP_MODES; panel_bridge->bridge.type = connector_type; @@ -261031,7 +259934,7 @@ index 830b4d058622..971f788ec6ca 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 11 Mar 2022 17:24:37 +0000 -Subject: [PATCH 0795/1050] drm: Include drm_connector.h from drm_panel.h +Subject: [PATCH 0778/1183] drm: Include drm_connector.h from drm_panel.h drm_panel.h wants to reference enum drm_panel_orientation which is defined in drm_connector.h (despite the name). @@ -261073,7 +259976,7 @@ index 971f788ec6ca..99eb628d7dcb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 16 Dec 2021 15:33:43 +0000 -Subject: [PATCH 0796/1050] drm/tc358762: Set the pre_enable_upstream_first +Subject: [PATCH 0779/1183] drm/tc358762: Set the pre_enable_upstream_first flag to configure DSI host TC358762 wants the DSI host to be prepared before it is powered up, so @@ -261104,7 +260007,7 @@ index 7cda18a12e98..82d13182697e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Thu, 3 Mar 2022 23:06:15 +0300 -Subject: [PATCH 0797/1050] bcm2835-codec: /dev/video31 as interface to +Subject: [PATCH 0780/1183] bcm2835-codec: /dev/video31 as interface to image_encode JPEG encoder Signed-off-by: Maxim Devaev @@ -261911,7 +260814,7 @@ index 21087496a481..a1a5e6c9cb74 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 2 Mar 2022 22:03:00 +0000 -Subject: [PATCH 0798/1050] media: entity: Skip non-data links in graph +Subject: [PATCH 0781/1183] media: entity: Skip non-data links in graph iteration When iterating over the media graph, don't follow links that are not @@ -261947,7 +260850,7 @@ index f40f41977142..2a6e16fb0048 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 2 Mar 2022 22:03:01 +0000 -Subject: [PATCH 0799/1050] media: media.h: Add new media link type +Subject: [PATCH 0782/1183] media: media.h: Add new media link type To describe in the kernel the connection between devices and their supporting peripherals (for example, a camera sensor and the vcm @@ -262031,7 +260934,7 @@ index 200fa8462b90..afbae7213d35 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 2 Mar 2022 22:03:02 +0000 -Subject: [PATCH 0800/1050] media: entity: Add link_type_name() helper +Subject: [PATCH 0783/1183] media: entity: Add link_type_name() helper Now we have three types of media link, printing the right name during debug output is slightly more complicated. Add a helper function to @@ -262086,7 +260989,7 @@ index 2a6e16fb0048..29d1285c805a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 2 Mar 2022 22:03:03 +0000 -Subject: [PATCH 0801/1050] media: entity: Add support for ancillary links +Subject: [PATCH 0784/1183] media: entity: Add support for ancillary links Add functions to create ancillary links, so that they don't need to be manually created by users. @@ -262163,7 +261066,7 @@ index 09737b47881f..72c7cd885d6b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Wed, 2 Mar 2022 22:03:04 +0000 -Subject: [PATCH 0802/1050] media: v4l2-async: Create links during +Subject: [PATCH 0785/1183] media: v4l2-async: Create links during v4l2_async_match_notify() Upon an async fwnode match, there's some typical behaviour that the @@ -262236,7 +261139,7 @@ index cd9e78c63791..84a12788d62c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Sep 2021 12:33:35 +0100 -Subject: [PATCH 0803/1050] dt-bindings: media: i2c: Add binding for ad5398 VCM +Subject: [PATCH 0786/1183] dt-bindings: media: i2c: Add binding for ad5398 VCM Add a binding for Analog Devices AD5398 10bit current sinking DAC when used as a lens VCM driver. @@ -262282,7 +261185,7 @@ index 000000000000..446ac9717598 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Sep 2021 14:04:28 +0100 -Subject: [PATCH 0804/1050] media: i2c: Add driver for AD5398 VCM lens driver +Subject: [PATCH 0787/1183] media: i2c: Add driver for AD5398 VCM lens driver Adds a driver for the Analog Devices AD5398 10 bit I2C DAC which is commonly used for driving VCM lens @@ -262681,7 +261584,7 @@ index 000000000000..102c3143f7d7 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 16 Mar 2022 12:15:41 +0000 -Subject: [PATCH 0805/1050] media: i2c: ov5647: Use +Subject: [PATCH 0788/1183] media: i2c: ov5647: Use v4l2_async_register_subdev_sensor for lens binding v4l2_async_register_subdev doesn't bind in lens or flash drivers, @@ -262713,7 +261616,7 @@ index 491246786f7c..befdb53bda1d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 29 Sep 2021 14:25:49 +0100 -Subject: [PATCH 0806/1050] defconfigs: Add AD5398 VCM to all Pi defconfigs +Subject: [PATCH 0789/1183] defconfigs: Add AD5398 VCM to all Pi defconfigs Supports AD5398 controlled lens, as found on some 3rd party OV5647 and IMX219 image sensors. @@ -262794,7 +261697,7 @@ index 039d06428669..c98578ac5de0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 11 Mar 2022 15:32:00 +0000 -Subject: [PATCH 0807/1050] dtoverlays: Add VCM option to imx219 +Subject: [PATCH 0790/1183] dtoverlays: Add VCM option to imx219 Signed-off-by: Dave Stevenson --- @@ -262850,7 +261753,7 @@ index bc1217397dd5..d73f76aba8b6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 15 Mar 2022 18:36:10 +0000 -Subject: [PATCH 0808/1050] dtoverlay: Add VCM option to ov5647 overlay +Subject: [PATCH 0791/1183] dtoverlay: Add VCM option to ov5647 overlay Signed-off-by: Dave Stevenson --- @@ -262903,7 +261806,7 @@ index a1221024d334..af2c86383e1f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 17 Mar 2022 15:13:10 +0000 -Subject: [PATCH 0809/1050] media: i2c: Rename ad5398 to ad5398_vcm +Subject: [PATCH 0792/1183] media: i2c: Rename ad5398 to ad5398_vcm There's already a regulator module called ad5398 that exposes this device through the regulator API. That is meaningless in @@ -262942,7 +261845,7 @@ rename to drivers/media/i2c/ad5398_vcm.c From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 21 Feb 2022 10:59:02 +0100 -Subject: [PATCH 0810/1050] drm/object: Add +Subject: [PATCH 0793/1183] drm/object: Add drm_object_property_get_default_value() function Upstream commit adf47b75297ebc71c53b6dc2d3c55f42b8fb79fd. @@ -263079,7 +261982,7 @@ index c34a3e8030e1..912f1e415685 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 21 Feb 2022 10:59:03 +0100 -Subject: [PATCH 0811/1050] drm/object: Add default zpos value at reset +Subject: [PATCH 0794/1183] drm/object: Add default zpos value at reset Upstream commit 1a7998dab5dd3d11bada7e3921781922082e7fe6 @@ -263139,7 +262042,7 @@ index ddcf5c2c8e6a..1412cee404ca 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 21 Feb 2022 10:59:14 +0100 -Subject: [PATCH 0812/1050] drm/object: Add default color encoding and range +Subject: [PATCH 0795/1183] drm/object: Add default color encoding and range value at reset Upstream commit 9a48ab11714c955456fefdd4ab532d324fbef563 @@ -263199,7 +262102,7 @@ index 1412cee404ca..3b6d3bdbd099 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 25 Jan 2022 17:28:18 +0000 -Subject: [PATCH 0813/1050] drm/vc4: Support zpos on all planes +Subject: [PATCH 0796/1183] drm/vc4: Support zpos on all planes Adds the zpos property to all planes, and creates the dlist by placing the fragments in the correct order based on zpos. @@ -263289,10 +262192,10 @@ index 0ac34db76b47..78c4d57fe597 100644 ret = vc4_ctm_obj_init(vc4); if (ret) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c -index 7a0f9d55777d..0e791620d97b 100644 +index aab4dfa282e5..0475f14c63f4 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -1572,9 +1572,14 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, +@@ -1573,9 +1573,14 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, DRM_COLOR_YCBCR_BT709, DRM_COLOR_YCBCR_LIMITED_RANGE); @@ -263307,7 +262210,7 @@ index 7a0f9d55777d..0e791620d97b 100644 int vc4_plane_create_additional_planes(struct drm_device *drm) { struct drm_plane *cursor_plane; -@@ -1590,7 +1595,7 @@ int vc4_plane_create_additional_planes(struct drm_device *drm) +@@ -1591,7 +1596,7 @@ int vc4_plane_create_additional_planes(struct drm_device *drm) * modest number of planes to expose, that should hopefully * still cover any sane usecase. */ @@ -263316,7 +262219,7 @@ index 7a0f9d55777d..0e791620d97b 100644 struct drm_plane *plane = vc4_plane_init(drm, DRM_PLANE_TYPE_OVERLAY); -@@ -1599,17 +1604,28 @@ int vc4_plane_create_additional_planes(struct drm_device *drm) +@@ -1600,17 +1605,28 @@ int vc4_plane_create_additional_planes(struct drm_device *drm) plane->possible_crtcs = GENMASK(drm->mode_config.num_crtc - 1, 0); @@ -263354,7 +262257,7 @@ index 7a0f9d55777d..0e791620d97b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Rafael Sobral Date: Fri, 18 Mar 2022 23:25:16 -0300 -Subject: [PATCH 0814/1050] CM3 cam1_reg and cam1_reg_gpio fix +Subject: [PATCH 0797/1183] CM3 cam1_reg and cam1_reg_gpio fix property name is gpio and not gpios --- @@ -263383,7 +262286,7 @@ index fb99c3b1c7f1..f7f18331db02 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 19 Mar 2022 22:19:51 +0000 -Subject: [PATCH 0815/1050] overlays: Fix cam*_reg_gpio parameter on CM1 +Subject: [PATCH 0798/1183] overlays: Fix cam*_reg_gpio parameter on CM1 See: https://github.com/raspberrypi/linux/pull/4945 @@ -263414,7 +262317,7 @@ index dd59f884d796..c7845d2ba7ff 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jeff LaBundy Date: Sat, 19 Mar 2022 20:31:30 -0500 -Subject: [PATCH 0816/1050] overlays: iqs550: Enable interrupt pull-down +Subject: [PATCH 0799/1183] overlays: iqs550: Enable interrupt pull-down The device's active-high interrupt normally serves as a push-pull output, but becomes high-impedance during bootloader mode. Enable @@ -263466,7 +262369,7 @@ index bb5a4d921962..c3956937055f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 21 Mar 2022 18:27:45 +0000 -Subject: [PATCH 0817/1050] dtoverlays: Connect the backlight to the pitft35 +Subject: [PATCH 0800/1183] dtoverlays: Connect the backlight to the pitft35 display DRM will automatically handle the backlight with the display if @@ -263506,7 +262409,7 @@ index 713532cb2272..e11e1920024a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 7 Mar 2022 15:19:38 +0000 -Subject: [PATCH 0818/1050] drm/vc4: hdmi: Add CSC for BT601/709/2020 limited +Subject: [PATCH 0801/1183] drm/vc4: hdmi: Add CSC for BT601/709/2020 limited and full range output The HVS always composes in the RGB domain, but there is a colourspace @@ -263526,7 +262429,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 146 insertions(+), 52 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index f135ec975c0a..234f018de8c2 100644 +index f915d96ff512..77c8f732f47d 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -139,8 +139,8 @@ static bool vc4_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode, @@ -263819,7 +262722,7 @@ index f135ec975c0a..234f018de8c2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2022 14:44:49 +0000 -Subject: [PATCH 0819/1050] Revert "usb: xhci: expand the scope of +Subject: [PATCH 0802/1183] Revert "usb: xhci: expand the scope of XHCI_VLI_SS_BULK_OUT_BUG" This reverts commit 40686d87f87a46b3abf48a8dcaee5e0a031deafb. @@ -263832,10 +262735,10 @@ Signed-off-by: Phil Elwell 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index c2d698048d6f..6fa69874a1ec 100644 +index a624e491e64c..02e9b0ca0cb8 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -1417,12 +1417,9 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb) +@@ -1408,12 +1408,9 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb) static int xhci_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) { @@ -263848,7 +262751,7 @@ index c2d698048d6f..6fa69874a1ec 100644 if (xhci_urb_suitable_for_idt(urb)) return 0; -@@ -1431,16 +1428,6 @@ static int xhci_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, +@@ -1422,16 +1419,6 @@ static int xhci_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, if (xhci_urb_temp_buffer_required(hcd, urb)) return xhci_map_temp_buffer(hcd, urb); } @@ -263865,7 +262768,7 @@ index c2d698048d6f..6fa69874a1ec 100644 return usb_hcd_map_urb_for_dma(hcd, urb, mem_flags); } -@@ -1454,8 +1441,7 @@ static void xhci_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) +@@ -1445,8 +1432,7 @@ static void xhci_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) if (urb->num_sgs && (urb->transfer_flags & URB_DMA_MAP_SINGLE)) unmap_temp_buf = true; @@ -263882,14 +262785,14 @@ index c2d698048d6f..6fa69874a1ec 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 14 Mar 2022 17:56:10 +0000 -Subject: [PATCH 0820/1050] vc4/drm: vc4_plane: Keep fractional source coords +Subject: [PATCH 0803/1183] vc4/drm: vc4_plane: Keep fractional source coords inside state Signed-off-by: Dom Cobley --- drivers/gpu/drm/vc4/vc4_drv.h | 2 +- - drivers/gpu/drm/vc4/vc4_plane.c | 67 ++++++++++++++++----------------- - 2 files changed, 34 insertions(+), 35 deletions(-) + drivers/gpu/drm/vc4/vc4_plane.c | 68 ++++++++++++++++----------------- + 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index abd279e1ca58..7164017d35fa 100644 @@ -263905,7 +262808,7 @@ index abd279e1ca58..7164017d35fa 100644 u32 src_w[2], src_h[2]; diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c -index 0e791620d97b..2ace5e9edc8f 100644 +index 0475f14c63f4..2ace5e9edc8f 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -179,9 +179,9 @@ static const struct hvs_format *vc4_get_hvs_format(u32 drm_format) @@ -263920,18 +262823,19 @@ index 0e791620d97b..2ace5e9edc8f 100644 return VC4_SCALING_PPF; else return VC4_SCALING_TPZ; -@@ -388,14 +388,10 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) +@@ -388,15 +388,10 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) for (i = 0; i < num_planes; i++) vc4_state->offsets[i] = bo->paddr + fb->offsets[i]; -- /* We don't support subpixel source positioning for scaling, +- /* +- * We don't support subpixel source positioning for scaling, - * but fractional coordinates can be generated by clipping - * so just round for now - */ -- vc4_state->src_x = DIV_ROUND_CLOSEST(state->src.x1, 1<<16); -- vc4_state->src_y = DIV_ROUND_CLOSEST(state->src.y1, 1<<16); -- vc4_state->src_w[0] = DIV_ROUND_CLOSEST(state->src.x2, 1<<16) - vc4_state->src_x; -- vc4_state->src_h[0] = DIV_ROUND_CLOSEST(state->src.y2, 1<<16) - vc4_state->src_y; +- vc4_state->src_x = DIV_ROUND_CLOSEST(state->src.x1, 1 << 16); +- vc4_state->src_y = DIV_ROUND_CLOSEST(state->src.y1, 1 << 16); +- vc4_state->src_w[0] = DIV_ROUND_CLOSEST(state->src.x2, 1 << 16) - vc4_state->src_x; +- vc4_state->src_h[0] = DIV_ROUND_CLOSEST(state->src.y2, 1 << 16) - vc4_state->src_y; + vc4_state->src_x = state->src.x1; + vc4_state->src_y = state->src.y1; + vc4_state->src_w[0] = state->src.x2 - vc4_state->src_x; @@ -263939,7 +262843,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 vc4_state->crtc_x = state->dst.x1; vc4_state->crtc_y = state->dst.y1; -@@ -448,7 +444,7 @@ static void vc4_write_tpz(struct vc4_plane_state *vc4_state, u32 src, u32 dst) +@@ -449,7 +444,7 @@ static void vc4_write_tpz(struct vc4_plane_state *vc4_state, u32 src, u32 dst) { u32 scale, recip; @@ -263948,7 +262852,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 /* The specs note that while the reciprocal would be defined * as (1<<32)/scale, ~0 is close enough. -@@ -494,7 +490,7 @@ static u32 vc4_lbm_size(struct drm_plane_state *state) +@@ -495,7 +490,7 @@ static u32 vc4_lbm_size(struct drm_plane_state *state) if (vc4_state->x_scaling[0] == VC4_SCALING_TPZ) pix_per_line = vc4_state->crtc_w; else @@ -263957,7 +262861,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 if (!vc4_state->is_yuv) { if (vc4_state->y_scaling[0] == VC4_SCALING_TPZ) -@@ -585,7 +581,8 @@ static void vc4_plane_calc_load(struct drm_plane_state *state) +@@ -586,7 +581,8 @@ static void vc4_plane_calc_load(struct drm_plane_state *state) for (i = 0; i < fb->format->num_planes; i++) { /* Even if the bandwidth/plane required for a single frame is * @@ -263967,7 +262871,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 * * when downscaling, we have to read more pixels per line in * the time frame reserved for a single line, so the bandwidth -@@ -594,11 +591,11 @@ static void vc4_plane_calc_load(struct drm_plane_state *state) +@@ -595,11 +591,11 @@ static void vc4_plane_calc_load(struct drm_plane_state *state) * load by this number. We're likely over-estimating the read * demand, but that's better than under-estimating it. */ @@ -263983,7 +262887,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 vc4_state->hvs_load += vc4_state->crtc_h * vc4_state->crtc_w; } -@@ -751,7 +748,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -752,7 +748,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, bool mix_plane_alpha; bool covers_screen; u32 scl0, scl1, pitch0; @@ -263993,7 +262897,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 u32 hvs_format = format->hvs; unsigned int rotation; int ret, i; -@@ -763,6 +761,9 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -764,6 +761,9 @@ static int vc4_plane_mode_set(struct drm_plane *plane, if (ret) return ret; @@ -264003,7 +262907,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 /* SCL1 is used for Cb/Cr scaling of planar formats. For RGB * and 4:4:4, scl1 should be set to scl0 so both channels of * the scaler do the same thing. For YUV, the Y plane needs -@@ -783,9 +784,11 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -784,9 +784,11 @@ static int vc4_plane_mode_set(struct drm_plane *plane, DRM_MODE_REFLECT_Y); /* We must point to the last line when Y reflection is enabled. */ @@ -264017,7 +262921,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 switch (base_format_mod) { case DRM_FORMAT_MOD_LINEAR: -@@ -800,7 +803,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -801,7 +803,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, (i ? v_subsample : 1) * fb->pitches[i]; @@ -264026,7 +262930,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 (i ? h_subsample : 1) * fb->format->cpp[i]; } -@@ -823,7 +826,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -824,7 +826,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, * pitch * tile_h == tile_size * tiles_per_row */ u32 tiles_w = fb->pitches[0] >> (tile_size_shift - tile_h_shift); @@ -264035,7 +262939,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 u32 tiles_r = tiles_w - tiles_l; u32 tiles_t = src_y >> tile_h_shift; /* Intra-tile offsets, which modify the base address (the -@@ -833,7 +836,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -834,7 +836,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, u32 tile_y = (src_y >> 4) & 1; u32 subtile_y = (src_y >> 2) & 3; u32 utile_y = src_y & 3; @@ -264044,7 +262948,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 u32 y_off = src_y & tile_h_mask; /* When Y reflection is requested we must set the -@@ -929,7 +932,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -930,7 +932,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, * of the 12-pixels in that 128-bit word is the * first pixel to be used */ @@ -264053,7 +262957,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 u32 aligned = remaining_pixels / 12; u32 last_bits = remaining_pixels % 12; -@@ -951,12 +954,12 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -952,12 +954,12 @@ static int vc4_plane_mode_set(struct drm_plane *plane, return -EINVAL; } pix_per_tile = tile_w / fb->format->cpp[0]; @@ -264068,7 +262972,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 vc4_state->offsets[i] += param * tile_w * tile; vc4_state->offsets[i] += src_y / -@@ -1017,10 +1020,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -1018,10 +1020,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, vc4_dlist_write(vc4_state, (mix_plane_alpha ? SCALER_POS2_ALPHA_MIX : 0) | vc4_hvs4_get_alpha_blend_mode(state) | @@ -264081,7 +262985,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 /* Position Word 3: Context. Written by the HVS. */ vc4_dlist_write(vc4_state, 0xc0c0c0c0); -@@ -1078,10 +1079,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -1079,10 +1079,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, /* Position Word 2: Source Image Size */ vc4_state->pos2_offset = vc4_state->dlist_count; vc4_dlist_write(vc4_state, @@ -264101,7 +263005,7 @@ index 0e791620d97b..2ace5e9edc8f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Fri, 9 Apr 2021 15:00:40 +0100 -Subject: [PATCH 0821/1050] vc4/drm: Handle fractional coordinates using the +Subject: [PATCH 0804/1183] vc4/drm: Handle fractional coordinates using the phase field Signed-off-by: Dom Cobley @@ -264212,7 +263116,7 @@ index 2ace5e9edc8f..69c860c81126 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 26 Jan 2022 15:58:13 +0000 -Subject: [PATCH 0822/1050] drm: Add chroma siting properties +Subject: [PATCH 0805/1183] drm: Add chroma siting properties Signed-off-by: Dom Cobley --- @@ -264396,7 +263300,7 @@ index fed97e35626f..ef61f7ae8ab6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Thu, 27 Jan 2022 15:32:04 +0000 -Subject: [PATCH 0823/1050] vc4/drm:plane: Make use of chroma siting parameter +Subject: [PATCH 0806/1183] vc4/drm:plane: Make use of chroma siting parameter Signed-off-by: Dom Cobley --- @@ -264462,7 +263366,7 @@ index 69c860c81126..4595c09c782d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 22 Mar 2022 15:16:40 +0000 -Subject: [PATCH 0824/1050] drivers: staging: bcm2835-isp: Clear LS table +Subject: [PATCH 0807/1183] drivers: staging: bcm2835-isp: Clear LS table handle in the firmware When all nodes have stopped streaming, ensure the firmware has released its @@ -264505,7 +263409,7 @@ index 9ea817073dcd..b674992aee01 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sun, 27 Feb 2022 13:47:09 +0100 -Subject: [PATCH 0825/1050] dt-bindings: display: add bindings for MIPI DBI +Subject: [PATCH 0808/1183] dt-bindings: display: add bindings for MIPI DBI compatible SPI panels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -264688,7 +263592,7 @@ index 000000000000..f29789994b18 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sun, 27 Feb 2022 13:47:11 +0100 -Subject: [PATCH 0826/1050] drm/modes: Add of_get_drm_panel_display_mode() +Subject: [PATCH 0809/1183] drm/modes: Add of_get_drm_panel_display_mode() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -264808,7 +263712,7 @@ index 29ba4adf0c53..2fa6b2c33b3f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sun, 27 Feb 2022 13:47:12 +0100 -Subject: [PATCH 0827/1050] drm/mipi-dbi: Add driver_private member to struct +Subject: [PATCH 0810/1183] drm/mipi-dbi: Add driver_private member to struct mipi_dbi_dev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -264859,7 +263763,7 @@ index 05e194958265..0981f80eb706 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sun, 27 Feb 2022 13:47:13 +0100 -Subject: [PATCH 0828/1050] drm/tiny: Add MIPI DBI compatible SPI driver +Subject: [PATCH 0811/1183] drm/tiny: Add MIPI DBI compatible SPI driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -265387,7 +264291,7 @@ index 000000000000..7f8c6c51387f From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 2 Mar 2022 18:17:44 +0100 -Subject: [PATCH 0829/1050] configs: Add MIPI DBI display driver +Subject: [PATCH 0812/1183] configs: Add MIPI DBI display driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -265470,7 +264374,7 @@ index c98578ac5de0..a24f2c241ed9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 7 Mar 2022 17:05:49 +0100 -Subject: [PATCH 0830/1050] overlays: Add overlay for MIPI DBI displays +Subject: [PATCH 0813/1183] overlays: Add overlay for MIPI DBI displays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -265761,7 +264665,7 @@ index 000000000000..0677f79cce6e From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Sun, 27 Mar 2022 22:42:47 +1100 -Subject: [PATCH 0831/1050] audioinjector.net: stereo and zero, use +Subject: [PATCH 0814/1183] audioinjector.net: stereo and zero, use dev_err_probe, report success Use dev_err_probe to follow best practice, and leave a message in @@ -265796,7 +264700,7 @@ index 3f24fa739081..ad337201c558 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 26 Mar 2022 18:59:27 +0100 -Subject: [PATCH 0832/1050] Revert "update rpi-display-overlay.dts pins for +Subject: [PATCH 0815/1183] Revert "update rpi-display-overlay.dts pins for 5.10+" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -265834,7 +264738,7 @@ index 2cf937b56456..de87432ff2be 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sun, 27 Mar 2022 18:54:17 +0200 -Subject: [PATCH 0833/1050] overlays/rpi-display: Add support for DRM driver +Subject: [PATCH 0816/1183] overlays/rpi-display: Add support for DRM driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -265978,7 +264882,7 @@ index de87432ff2be..789644b9f251 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 28 Mar 2022 11:52:48 +0100 -Subject: [PATCH 0834/1050] bcm2835-codec: Return empty buffers to the VPU +Subject: [PATCH 0817/1183] bcm2835-codec: Return empty buffers to the VPU instead of queueing to vbuf2 The encoder can skip frames totally should rate control overshoot @@ -266033,7 +264937,7 @@ index ebda39a2cc06..8abdd7f6b7fd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Tue, 29 Mar 2022 16:10:06 +0100 -Subject: [PATCH 0835/1050] mm,page_alloc,cma: introduce a customisable +Subject: [PATCH 0818/1183] mm,page_alloc,cma: introduce a customisable threshold for allocating pages in cma On some platforms the cma area can be half the entire system memory, @@ -266051,7 +264955,7 @@ Signed-off-by: David Plowman 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 61d7967897ce..6f9dc74b04d8 100644 +index a71722b4e464..53a201aafe18 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -190,6 +190,27 @@ EXPORT_SYMBOL(init_on_alloc); @@ -266106,7 +265010,7 @@ index 61d7967897ce..6f9dc74b04d8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 30 Mar 2022 09:48:41 +0100 -Subject: [PATCH 0836/1050] pinctrl: bcm2835: Only return non-GPIOs to inputs +Subject: [PATCH 0819/1183] pinctrl: bcm2835: Only return non-GPIOs to inputs Allowing GPIO state to persist allows the use of gpioset to control GPIO levels without having to use the --mode=wait feature. @@ -266154,7 +265058,7 @@ index 90ce5d11f3a6..fc2cc1966041 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 30 Mar 2022 11:43:25 +0100 -Subject: [PATCH 0837/1050] ARM: dts: Enable PMU on Cortex-A72 in AArch32 state +Subject: [PATCH 0820/1183] ARM: dts: Enable PMU on Cortex-A72 in AArch32 state There is no specific AArch32 driver for the Cortex-A72 PMU, but the Cortex-A7 one works and is much better than no PMU driver at all. @@ -266184,7 +265088,7 @@ index f8c327b3c660..ff84a093ad18 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 31 Mar 2022 12:03:36 +0100 -Subject: [PATCH 0838/1050] drm/panel: ilitek-ili9881c: Clean up on +Subject: [PATCH 0821/1183] drm/panel: ilitek-ili9881c: Clean up on mipi_dsi_attach failure mipi_dsi_attach is allowed to fail, and currently the probe @@ -266221,7 +265125,7 @@ index 6e03d9b0be60..5446b07439f4 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 31 Mar 2022 12:05:04 +0100 -Subject: [PATCH 0839/1050] drm/panel: panel-ilitek9881c: Add +Subject: [PATCH 0822/1183] drm/panel: panel-ilitek9881c: Add prepare_upstream_first flag The panel sends MIPI DCS commands during prepare and is expecting @@ -266255,7 +265159,7 @@ index 5446b07439f4..c2afc4368553 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 31 Mar 2022 17:55:51 +0100 -Subject: [PATCH 0840/1050] brcmfmac: Restore ISO3166 and 0 rev as a fallback +Subject: [PATCH 0823/1183] brcmfmac: Restore ISO3166 and 0 rev as a fallback Commit b0b524f079a2 ("brcmfmac: use ISO3166 country code and 0 rev as fallback") was a welcome addition for Raspberry Pi as it replaced @@ -266312,7 +265216,7 @@ index 077852e6b049..94ab63dfc1c6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: 6by9 <6by9@users.noreply.github.com> Date: Fri, 1 Apr 2022 11:31:38 +0100 -Subject: [PATCH 0841/1050] drm/vc4: Force trigger of dlist update on margins +Subject: [PATCH 0824/1183] drm/vc4: Force trigger of dlist update on margins change (#4970) When the margins are changed, the dlist needs to be regenerated @@ -266378,7 +265282,7 @@ index 7164017d35fa..918dbf8d8058 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 3 Apr 2022 15:27:46 +0100 -Subject: [PATCH 0842/1050] configs: Re-enable all GSPCA camera modules +Subject: [PATCH 0825/1183] configs: Re-enable all GSPCA camera modules The GSPCA camera modules were lost due to change in a default value - when has that happened before? @@ -266691,7 +265595,7 @@ index a24f2c241ed9..b218f552442c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Fri, 23 Oct 2020 14:39:23 +0200 -Subject: [PATCH 0843/1050] drm/atomic-helpers: remove legacy_cursor_update +Subject: [PATCH 0826/1183] drm/atomic-helpers: remove legacy_cursor_update hacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -266804,10 +265708,10 @@ index c9b051ab18e0..08e0347f382d 100644 if (ret) { drm_dbg_atomic(&dev_priv->drm, diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c -index fab09e7c6efc..3f91a9400160 100644 +index 458f4e4316dd..67a503d3dd0a 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c -@@ -246,6 +246,8 @@ void msm_atomic_commit_tail(struct drm_atomic_state *state) +@@ -231,6 +231,8 @@ void msm_atomic_commit_tail(struct drm_atomic_state *state) /* async updates are limited to single-crtc updates: */ WARN_ON(crtc_mask != drm_crtc_mask(async_crtc)); @@ -266823,7 +265727,7 @@ index fab09e7c6efc..3f91a9400160 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 31 Mar 2022 15:27:43 +0200 -Subject: [PATCH 0844/1050] Revert "drm/vc4: hvs: Defer dlist slots +Subject: [PATCH 0827/1183] Revert "drm/vc4: hvs: Defer dlist slots deallocation" This reverts commit e99a1b69da07ee3b89a6b8005b854e6c04bfb450. @@ -267178,7 +266082,7 @@ index c7b2be063189..88e9a398758e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 6 Apr 2022 20:35:13 +0100 -Subject: [PATCH 0845/1050] drm/vc4_hdmi: Force modeset when bpc changes +Subject: [PATCH 0828/1183] drm/vc4_hdmi: Force modeset when bpc changes See: https://forum.libreelec.tv/thread/25427-le-10-0-2-on-rpi4-not-playing-files-that-10-0-1-had-no-problems-with/ @@ -267201,7 +266105,7 @@ Signed-off-by: Dom Cobley 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 234f018de8c2..801033c1bf3b 100644 +index 77c8f732f47d..05db942c9787 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1809,6 +1809,9 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, @@ -267233,7 +266137,7 @@ index 234f018de8c2..801033c1bf3b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 15 Jun 2021 18:18:42 +0100 -Subject: [PATCH 0846/1050] media: i2c: imx258: Remove unused defines +Subject: [PATCH 0829/1183] media: i2c: imx258: Remove unused defines The IMX258_FLL_* defines are unused. Remove them. @@ -267266,7 +266170,7 @@ index c249507aa2db..f3172e165354 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 15 Jun 2021 18:34:38 +0100 -Subject: [PATCH 0847/1050] media: i2c: imx258: Make image geometry meet sensor +Subject: [PATCH 0830/1183] media: i2c: imx258: Make image geometry meet sensor requirements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -267419,7 +266323,7 @@ index f3172e165354..c494cdf69bc8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 30 Mar 2022 14:55:01 +0100 -Subject: [PATCH 0848/1050] media: i2c: imx258: Disable digital cropping on +Subject: [PATCH 0831/1183] media: i2c: imx258: Disable digital cropping on binned modes The binned modes set DIG_CROP_X_OFFSET and DIG_CROP_IMAGE_WIDTH @@ -267472,7 +266376,7 @@ index c494cdf69bc8..c150742d9c75 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 15 Jun 2021 18:29:52 +0100 -Subject: [PATCH 0849/1050] media: i2c: imx258: Implement HFLIP and VFLIP +Subject: [PATCH 0832/1183] media: i2c: imx258: Implement HFLIP and VFLIP controls. The sensor supports H & V flips, so implement the relevant controls. @@ -267747,7 +266651,7 @@ index c150742d9c75..7e3874461772 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 15 Jun 2021 18:38:46 +0100 -Subject: [PATCH 0850/1050] media: i2c: imx258: Remove redundant I2C writes. +Subject: [PATCH 0833/1183] media: i2c: imx258: Remove redundant I2C writes. Registers 0x0202 and 0x0203 are written via the control handler for V4L2_CID_EXPOSURE, so are not needed from the mode lists. @@ -267795,7 +266699,7 @@ index 7e3874461772..72992f406425 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 15 Jun 2021 18:45:40 +0100 -Subject: [PATCH 0851/1050] media: i2c: imx258: Add regulator control +Subject: [PATCH 0834/1183] media: i2c: imx258: Add regulator control The device tree bindings define the relevant regulators for the sensor, so update the driver to request the regulators and control @@ -267910,7 +266814,7 @@ index 72992f406425..43ad104eb1a2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 15 Jun 2021 18:56:33 +0100 -Subject: [PATCH 0852/1050] media: i2c: imx258: Make V4L2_CID_VBLANK +Subject: [PATCH 0835/1183] media: i2c: imx258: Make V4L2_CID_VBLANK configurable. The values and ranges of V4L2_CID_VBLANK are all computed, @@ -267992,7 +266896,7 @@ index 43ad104eb1a2..e21a2eadf48a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 15 Jun 2021 19:01:46 +0100 -Subject: [PATCH 0853/1050] media: i2c: imx258: Register the ctrls from fwnode +Subject: [PATCH 0836/1183] media: i2c: imx258: Register the ctrls from fwnode properties Use v4l2_ctrl_new_fwnode_properties to register the standard @@ -268034,7 +266938,7 @@ index e21a2eadf48a..8f80ec208e4f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 16 Jun 2021 13:08:00 +0100 -Subject: [PATCH 0854/1050] media: i2c: imx258: Add support for 24MHz clock +Subject: [PATCH 0837/1183] media: i2c: imx258: Add support for 24MHz clock There's no reason why the clock must be 19.2MHz and nothing else (indeed this isn't even a frequency listed in the datasheet), @@ -268326,7 +267230,7 @@ index 8f80ec208e4f..e0c74e871633 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 16 Jun 2021 16:27:06 +0100 -Subject: [PATCH 0855/1050] media: i2c: imx258: Add support for running on 2 +Subject: [PATCH 0838/1183] media: i2c: imx258: Add support for running on 2 CSI data lanes Extends the driver to also support 2 data lanes. @@ -268743,7 +267647,7 @@ index e0c74e871633..f1d136616e35 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 16 Jun 2021 17:19:17 +0100 -Subject: [PATCH 0856/1050] media: i2c: imx258: Follow normal V4L2 behaviours +Subject: [PATCH 0839/1183] media: i2c: imx258: Follow normal V4L2 behaviours for clipping exposure V4L2 sensor drivers are expected are expected to clip the supported @@ -268852,7 +267756,7 @@ index f1d136616e35..e485176f49ff 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 23 Mar 2022 15:48:49 +0000 -Subject: [PATCH 0857/1050] media: i2c: imx258: Add get_selection for pixel +Subject: [PATCH 0840/1183] media: i2c: imx258: Add get_selection for pixel array information Libcamera requires the cropping information for each mode, so @@ -269027,7 +267931,7 @@ index e485176f49ff..21a8cc4d9e01 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 31 Mar 2022 15:33:59 +0100 -Subject: [PATCH 0858/1050] media: i2c: imx258: Allow configuration of clock +Subject: [PATCH 0841/1183] media: i2c: imx258: Allow configuration of clock lane behaviour The sensor supports the clock lane either remaining in HS mode @@ -269093,7 +267997,7 @@ index 21a8cc4d9e01..d4b3fefa31c6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 31 Mar 2022 15:39:40 +0100 -Subject: [PATCH 0859/1050] media: i2c: imx258: Correct max FRM_LENGTH_LINES +Subject: [PATCH 0842/1183] media: i2c: imx258: Correct max FRM_LENGTH_LINES value The data sheet states that the maximum value for registers @@ -269125,7 +268029,7 @@ index d4b3fefa31c6..9f193625d61b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 31 Mar 2022 16:45:36 +0100 -Subject: [PATCH 0860/1050] media: i2c: imx258: Add support for long exposure +Subject: [PATCH 0843/1183] media: i2c: imx258: Add support for long exposure modes The sensor has a register CIT_LSHIFT which extends the exposure @@ -269231,7 +268135,7 @@ index 9f193625d61b..ab6db06d294b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 31 Mar 2022 17:12:12 +0100 -Subject: [PATCH 0861/1050] media: i2c: imx258: Issue reset before starting +Subject: [PATCH 0844/1183] media: i2c: imx258: Issue reset before starting streaming Whilst not documented, register 0x0103 bit 0 is the soft @@ -269278,7 +268182,7 @@ index ab6db06d294b..ace09856adda 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 1 Apr 2022 18:54:12 +0100 -Subject: [PATCH 0862/1050] media: i2c: imx258: Set pixel_rate range to the +Subject: [PATCH 0845/1183] media: i2c: imx258: Set pixel_rate range to the same as the value With a read only control there is limited point in advertising @@ -269343,7 +268247,7 @@ index ace09856adda..7647938f58cf 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 1 Apr 2022 18:56:54 +0100 -Subject: [PATCH 0863/1050] media: i2c: imx258: Support faster pixel rate on +Subject: [PATCH 0846/1183] media: i2c: imx258: Support faster pixel rate on binned modes With the binned modes, there is little point in faithfully @@ -269603,7 +268507,7 @@ index 7647938f58cf..63692f75c641 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 23 Mar 2022 14:07:56 +0000 -Subject: [PATCH 0864/1050] defconfigs: Add IMX258 to the Pi defconfigs +Subject: [PATCH 0847/1183] defconfigs: Add IMX258 to the Pi defconfigs Signed-off-by: Dave Stevenson --- @@ -269681,7 +268585,7 @@ index b218f552442c..d4ffabfdc9c6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 10 Jun 2021 17:42:47 +0100 -Subject: [PATCH 0865/1050] dtoverlays: Add overlay for Sony IMX258 image +Subject: [PATCH 0848/1183] dtoverlays: Add overlay for Sony IMX258 image sensor Signed-off-by: Dave Stevenson @@ -269894,7 +268798,7 @@ index 000000000000..12326040c457 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Tue, 12 Apr 2022 02:28:07 +1000 -Subject: [PATCH 0866/1050] Add support for the AudioInjector.net bare i2s +Subject: [PATCH 0849/1183] Add support for the AudioInjector.net bare i2s sound card Signed-off-by: Matt Flax @@ -269997,7 +268901,7 @@ index 000000000000..7565ac4d1c28 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 30 Mar 2022 17:49:31 +0100 -Subject: [PATCH 0867/1050] vc4_hdmi: Remove +Subject: [PATCH 0850/1183] vc4_hdmi: Remove VC4_HDMI_SCHEDULER_CONTROL_VERT_ALWAYS_KEEPOUT This bit ensures data island packets are never generated when disallowed by HDCP. @@ -270009,7 +268913,7 @@ Signed-off-by: Dom Cobley 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 801033c1bf3b..dc7ca3db6865 100644 +index 05db942c9787..b25a5b8186ef 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1551,9 +1551,6 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, @@ -270029,7 +268933,7 @@ index 801033c1bf3b..dc7ca3db6865 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 13 Apr 2022 13:50:30 +0100 -Subject: [PATCH 0868/1050] configs: bcm2711_defconfig: Enable KASLR +Subject: [PATCH 0851/1183] configs: bcm2711_defconfig: Enable KASLR Although KASLR is enabled in the old bcmrpi3_defconfig, it is omitted from bcm2711_defconfig. Correct that oversight. @@ -270060,7 +268964,7 @@ index 98832f25ad60..250770ba059e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 12 Apr 2022 18:30:49 +0100 -Subject: [PATCH 0869/1050] config: Enable CONFIG_MODULE_COMPRESS_XZ +Subject: [PATCH 0852/1183] config: Enable CONFIG_MODULE_COMPRESS_XZ See: https://github.com/raspberrypi/linux/issues/4966 Signed-off-by: Dom Cobley @@ -270139,7 +269043,7 @@ index d4ffabfdc9c6..45de87991995 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 13 Apr 2022 19:28:35 +0200 -Subject: [PATCH 0870/1050] overlays: mipi-dbi-spi: width-mm and height-mm are +Subject: [PATCH 0853/1183] overlays: mipi-dbi-spi: width-mm and height-mm are mandatory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -270178,7 +269082,7 @@ index 0677f79cce6e..42b0e6b6318a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 19 Apr 2022 17:12:34 +0100 -Subject: [PATCH 0871/1050] configs: (Re)Enable CONFIG_IR_TOY +Subject: [PATCH 0854/1183] configs: (Re)Enable CONFIG_IR_TOY Somehow or other, CONFIG_IR_TOY=m got dropped from the standard Pi defconfigs around 5.13. Restore it. @@ -270261,7 +269165,7 @@ index 45de87991995..f38d6ac58fdb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 19 Apr 2022 20:21:26 +0100 -Subject: [PATCH 0872/1050] config: Enable the NFT_SYNPROXY module +Subject: [PATCH 0855/1183] config: Enable the NFT_SYNPROXY module The NFT_SYNPROXY module is apparently useful for port scan protection, and at 11kB barely changes the size of the downloads. @@ -270344,7 +269248,7 @@ index f38d6ac58fdb..e162165e947d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 19 Jan 2022 16:22:19 +0100 -Subject: [PATCH 0873/1050] clk: Introduce Kunit Tests for the framework +Subject: [PATCH 0856/1183] clk: Introduce Kunit Tests for the framework Let's test various parts of the rate-related clock API with the kunit testing framework. @@ -271200,7 +270104,7 @@ index 000000000000..a8d7eba01de7 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 5 May 2021 15:35:34 +0200 -Subject: [PATCH 0874/1050] clk: Always clamp the rounded rate +Subject: [PATCH 0857/1183] 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 @@ -271381,7 +270285,7 @@ index a8d7eba01de7..2279be699001 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 17 Jan 2022 16:38:10 +0100 -Subject: [PATCH 0875/1050] clk: Use clamp instead of open-coding our own +Subject: [PATCH 0858/1183] clk: Use clamp instead of open-coding our own The code in clk_set_rate_range() will, if the current rate is outside of the new range, force it to the minimum or maximum. @@ -271397,10 +270301,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index e79569eef194..771c1a8d1a55 100644 +index c775f2153b66..db27c68f7935 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2414,11 +2414,7 @@ int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max) +@@ -2413,11 +2413,7 @@ int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max) * this corner case when determining the rate */ @@ -271420,7 +270324,7 @@ index e79569eef194..771c1a8d1a55 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 17 Jan 2022 16:43:13 +0100 -Subject: [PATCH 0876/1050] clk: Always set the rate on clk_set_range_rate +Subject: [PATCH 0859/1183] clk: Always set the rate on clk_set_range_rate When we change a clock minimum or maximum using clk_set_rate_range(), clk_set_min_rate() or clk_set_max_rate(), the current code will only @@ -271448,10 +270352,10 @@ Signed-off-by: Maxime Ripard 2 files changed, 49 insertions(+), 54 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 771c1a8d1a55..4e1cd771a64b 100644 +index db27c68f7935..be224b640be2 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2399,28 +2399,29 @@ int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max) +@@ -2398,28 +2398,29 @@ int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max) goto out; } @@ -271624,7 +270528,7 @@ index 2279be699001..2c5d30a9372e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 17 Jan 2022 16:43:52 +0100 -Subject: [PATCH 0877/1050] clk: Add clk_drop_range +Subject: [PATCH 0860/1183] clk: Add clk_drop_range In order to reset the range on a clock, we need to call clk_set_rate_range with a minimum of 0 and a maximum of ULONG_MAX. Since @@ -271689,7 +270593,7 @@ index 2aa52140d8a9..28b9f9c09686 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 25 Mar 2022 11:27:28 +0100 -Subject: [PATCH 0878/1050] clk: test: Test clk_set_rate_range on orphan mux +Subject: [PATCH 0861/1183] clk: test: Test clk_set_rate_range on orphan mux A bug recently affected the Tegra30 where calling clk_set_rate_range() on a clock would make it change its rate to the minimum. @@ -271853,7 +270757,7 @@ index a92600311506..146b1759798e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 25 Mar 2022 17:11:44 +0100 -Subject: [PATCH 0879/1050] clk: Drop the rate range on clk_put() +Subject: [PATCH 0862/1183] clk: Drop the rate range on clk_put() When clk_put() is called we don't make another clk_set_rate() call to re-evaluate the rate boundaries. This is unlike clk_set_rate_range() @@ -271880,10 +270784,10 @@ Signed-off-by: Maxime Ripard 2 files changed, 139 insertions(+), 14 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 4e1cd771a64b..87f5871c764d 100644 +index be224b640be2..566ca57a53c2 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2358,19 +2358,15 @@ int clk_set_rate_exclusive(struct clk *clk, unsigned long rate) +@@ -2357,19 +2357,15 @@ int clk_set_rate_exclusive(struct clk *clk, unsigned long rate) } EXPORT_SYMBOL_GPL(clk_set_rate_exclusive); @@ -271908,7 +270812,7 @@ index 4e1cd771a64b..87f5871c764d 100644 if (!clk) return 0; -@@ -2383,8 +2379,6 @@ int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max) +@@ -2382,8 +2378,6 @@ int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max) return -EINVAL; } @@ -271917,7 +270821,7 @@ index 4e1cd771a64b..87f5871c764d 100644 if (clk->exclusive_count) clk_core_rate_unprotect(clk->core); -@@ -2428,6 +2422,28 @@ int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max) +@@ -2427,6 +2421,28 @@ int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max) if (clk->exclusive_count) clk_core_rate_protect(clk->core); @@ -271946,7 +270850,7 @@ index 4e1cd771a64b..87f5871c764d 100644 clk_prepare_unlock(); return ret; -@@ -4485,9 +4501,10 @@ void __clk_put(struct clk *clk) +@@ -4484,9 +4500,10 @@ void __clk_put(struct clk *clk) } hlist_del(&clk->clks_node); @@ -272099,7 +271003,7 @@ index 146b1759798e..efd5ffaf7e35 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 1 Apr 2022 17:08:26 +0200 -Subject: [PATCH 0880/1050] clk: tests: Add test suites description +Subject: [PATCH 0863/1183] clk: tests: Add test suites description We start to have a few test suites, and we'll add more, so it will get pretty confusing to figure out what is supposed to be tested in what @@ -272197,7 +271101,7 @@ index efd5ffaf7e35..4e4428fe9278 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 1 Apr 2022 14:53:49 +0200 -Subject: [PATCH 0881/1050] clk: tests: Add reference to the orphan mux bug +Subject: [PATCH 0864/1183] clk: tests: Add reference to the orphan mux bug report Some more context might be useful for unit-tests covering a previously @@ -272231,7 +271135,7 @@ index 4e4428fe9278..77230ccae180 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 8 Apr 2022 09:54:39 +0200 -Subject: [PATCH 0882/1050] clk: tests: Add tests for uncached clock +Subject: [PATCH 0865/1183] clk: tests: Add tests for uncached clock The clock framework supports clocks that can have their rate changed without the kernel knowing about it using the CLK_GET_RATE_NOCACHE flag. @@ -272361,7 +271265,7 @@ index 77230ccae180..e417c69d8492 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 7 Apr 2022 14:21:55 +0200 -Subject: [PATCH 0883/1050] clk: tests: Add tests for single parent mux +Subject: [PATCH 0866/1183] clk: tests: Add tests for single parent mux We have a few tests for a mux with a single parent, testing the case where it used to be orphan. @@ -272601,7 +271505,7 @@ index e417c69d8492..beca502949fa 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 7 Apr 2022 14:58:34 +0200 -Subject: [PATCH 0884/1050] clk: tests: Add tests for mux with multiple parents +Subject: [PATCH 0867/1183] clk: tests: Add tests for mux with multiple parents We'll need to test a few corner cases that occur when we have a mux clock whose default parent is missing. @@ -272768,7 +271672,7 @@ index beca502949fa..6c9cbfac3d00 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Sat, 2 Apr 2022 17:27:40 +0200 -Subject: [PATCH 0885/1050] clk: tests: Add some tests for orphan with multiple +Subject: [PATCH 0868/1183] clk: tests: Add some tests for orphan with multiple parents Let's leverage the dummy mux with multiple parents we have to create a @@ -272984,7 +271888,7 @@ index 6c9cbfac3d00..45c33e22fdce 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 8 Apr 2022 10:06:11 +0200 -Subject: [PATCH 0886/1050] clk: Take into account uncached clocks in +Subject: [PATCH 0869/1183] clk: Take into account uncached clocks in clk_set_rate_range() clk_set_rate_range() will use the last requested rate for the clock when @@ -273004,10 +271908,10 @@ Signed-off-by: Maxime Ripard 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 87f5871c764d..b278482e5fa8 100644 +index 566ca57a53c2..eb472d686dfd 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2393,6 +2393,10 @@ static int clk_set_rate_range_nolock(struct clk *clk, +@@ -2392,6 +2392,10 @@ static int clk_set_rate_range_nolock(struct clk *clk, goto out; } @@ -273018,7 +271922,7 @@ index 87f5871c764d..b278482e5fa8 100644 /* * Since the boundaries have been changed, let's give the * opportunity to the provider to adjust the clock rate based on -@@ -2410,7 +2414,7 @@ static int clk_set_rate_range_nolock(struct clk *clk, +@@ -2409,7 +2413,7 @@ static int clk_set_rate_range_nolock(struct clk *clk, * - the determine_rate() callback does not really check for * this corner case when determining the rate */ @@ -273076,7 +271980,7 @@ index 45c33e22fdce..cad3abd27e0c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 1 Apr 2022 11:09:29 +0200 -Subject: [PATCH 0887/1050] clk: Fix clk_get_parent() documentation +Subject: [PATCH 0870/1183] clk: Fix clk_get_parent() documentation The clk_get_parent() documentation in the header states that it will return a valid pointer, or an error pointer on failure. @@ -273153,7 +272057,7 @@ index 28b9f9c09686..433364d18fe0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 1 Apr 2022 15:26:46 +0200 -Subject: [PATCH 0888/1050] clk: Set req_rate on reparenting +Subject: [PATCH 0871/1183] clk: Set req_rate on reparenting If a non-rate clock started by default with a parent that never registered, core->req_rate will be 0. The expectation is that whenever @@ -273174,10 +272078,10 @@ Signed-off-by: Maxime Ripard 2 files changed, 249 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index b278482e5fa8..fc3876a994b6 100644 +index eb472d686dfd..8d8bc55ffb47 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1774,6 +1774,23 @@ static void clk_core_update_orphan_status(struct clk_core *core, bool is_orphan) +@@ -1773,6 +1773,23 @@ static void clk_core_update_orphan_status(struct clk_core *core, bool is_orphan) clk_core_update_orphan_status(child, is_orphan); } @@ -273201,7 +272105,7 @@ index b278482e5fa8..fc3876a994b6 100644 static void clk_reparent(struct clk_core *core, struct clk_core *new_parent) { bool was_orphan = core->orphan; -@@ -1798,6 +1815,7 @@ static void clk_reparent(struct clk_core *core, struct clk_core *new_parent) +@@ -1797,6 +1814,7 @@ static void clk_reparent(struct clk_core *core, struct clk_core *new_parent) } core->parent = new_parent; @@ -273495,7 +272399,7 @@ index c7099e864688..d2f711e42b81 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 1 Apr 2022 15:27:09 +0200 -Subject: [PATCH 0889/1050] clk: Skip set_rate_range if our clock is orphan +Subject: [PATCH 0872/1183] clk: Skip set_rate_range if our clock is orphan clk_set_rate_range will now force a clk_set_rate() call to core->req_rate. However, if our clock is orphan, req_rate will be 0 and @@ -273518,10 +272422,10 @@ Signed-off-by: Maxime Ripard 2 files changed, 65 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index fc3876a994b6..9415866b012e 100644 +index 8d8bc55ffb47..92a276698574 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2415,6 +2415,12 @@ static int clk_set_rate_range_nolock(struct clk *clk, +@@ -2414,6 +2414,12 @@ static int clk_set_rate_range_nolock(struct clk *clk, if (clk->core->flags & CLK_GET_RATE_NOCACHE) rate = clk_core_get_rate_recalc(clk->core); @@ -273626,7 +272530,7 @@ index d2f711e42b81..2b22b7090968 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Sat, 2 Apr 2022 13:45:05 +0200 -Subject: [PATCH 0890/1050] clk: Add our request boundaries in +Subject: [PATCH 0873/1183] clk: Add our request boundaries in clk_core_init_rate_req The expectation is that a new clk_rate_request is initialized through a @@ -273650,10 +272554,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 9415866b012e..17ae7e6a05e5 100644 +index 92a276698574..e6e13e844e1d 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1389,6 +1389,8 @@ static void clk_core_init_rate_req(struct clk_core * const core, +@@ -1388,6 +1388,8 @@ static void clk_core_init_rate_req(struct clk_core * const core, if (WARN_ON(!core || !req)) return; @@ -273662,7 +272566,7 @@ index 9415866b012e..17ae7e6a05e5 100644 parent = core->parent; if (parent) { req->best_parent_hw = parent->hw; -@@ -1464,7 +1466,6 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate) +@@ -1463,7 +1465,6 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate) struct clk_rate_request req; struct clk_request *clk_req; @@ -273670,7 +272574,7 @@ index 9415866b012e..17ae7e6a05e5 100644 req.rate = rate; list_for_each_entry(clk_req, &hw->core->pending_requests, list) -@@ -1501,7 +1502,6 @@ long clk_round_rate(struct clk *clk, unsigned long rate) +@@ -1500,7 +1501,6 @@ long clk_round_rate(struct clk *clk, unsigned long rate) if (clk->exclusive_count) clk_core_rate_unprotect(clk->core); @@ -273678,7 +272582,7 @@ index 9415866b012e..17ae7e6a05e5 100644 req.rate = rate; list_for_each_entry(clk_req, &clk->core->pending_requests, list) -@@ -2015,8 +2015,6 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, +@@ -2014,8 +2014,6 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, struct clk_rate_request req; req.rate = rate; @@ -273694,7 +272598,7 @@ index 9415866b012e..17ae7e6a05e5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Sat, 2 Apr 2022 13:48:03 +0200 -Subject: [PATCH 0891/1050] clk: Change clk_core_init_rate_req prototype +Subject: [PATCH 0874/1183] clk: Change clk_core_init_rate_req prototype The expectation is that a clk_rate_request structure is supposed to be initialized using clk_core_init_rate_req(), yet the rate we want to @@ -273711,10 +272615,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 17ae7e6a05e5..a18f4b2ec43f 100644 +index e6e13e844e1d..e4b1031d925b 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1382,13 +1382,15 @@ static int clk_core_determine_round_nolock(struct clk_core *core, +@@ -1381,13 +1381,15 @@ static int clk_core_determine_round_nolock(struct clk_core *core, } static void clk_core_init_rate_req(struct clk_core * const core, @@ -273731,7 +272635,7 @@ index 17ae7e6a05e5..a18f4b2ec43f 100644 clk_core_get_boundaries(core, &req->min_rate, &req->max_rate); parent = core->parent; -@@ -1416,7 +1418,7 @@ static int clk_core_round_rate_nolock(struct clk_core *core, +@@ -1415,7 +1417,7 @@ static int clk_core_round_rate_nolock(struct clk_core *core, return 0; } @@ -273740,7 +272644,7 @@ index 17ae7e6a05e5..a18f4b2ec43f 100644 if (clk_core_can_round(core)) return clk_core_determine_round_nolock(core, req); -@@ -2014,9 +2016,7 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, +@@ -2013,9 +2015,7 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, if (clk_core_can_round(core)) { struct clk_rate_request req; @@ -273758,7 +272662,7 @@ index 17ae7e6a05e5..a18f4b2ec43f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Sat, 2 Apr 2022 14:49:56 +0200 -Subject: [PATCH 0892/1050] clk: Introduce clk_hw_init_rate_request() +Subject: [PATCH 0875/1183] clk: Introduce clk_hw_init_rate_request() Some drivers (at91, imx, qcom) use __clk_determine_rate directly, and thus will need to initialise a clk_rate_request structure. @@ -273778,10 +272682,10 @@ Signed-off-by: Maxime Ripard 2 files changed, 26 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index a18f4b2ec43f..ca978500782f 100644 +index e4b1031d925b..aff8da360cb4 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1403,6 +1403,26 @@ static void clk_core_init_rate_req(struct clk_core * const core, +@@ -1402,6 +1402,26 @@ static void clk_core_init_rate_req(struct clk_core * const core, } } @@ -273839,7 +272743,7 @@ index f59c875271a0..402aef48119b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Sat, 2 Apr 2022 14:01:37 +0200 -Subject: [PATCH 0893/1050] clk: Add missing clk_core_init_rate_req calls +Subject: [PATCH 0876/1183] clk: Add missing clk_core_init_rate_req calls Some callers of clk_core_round_rate_nolock() will initialize the clk_rate_request structure by hand, missing a few parameters that leads @@ -273856,10 +272760,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index ca978500782f..890834d0bbdb 100644 +index aff8da360cb4..cc93c20c1903 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1488,7 +1488,7 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate) +@@ -1487,7 +1487,7 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate) struct clk_rate_request req; struct clk_request *clk_req; @@ -273868,7 +272772,7 @@ index ca978500782f..890834d0bbdb 100644 list_for_each_entry(clk_req, &hw->core->pending_requests, list) req.min_rate = max(clk_req->rate, req.min_rate); -@@ -1524,7 +1524,7 @@ long clk_round_rate(struct clk *clk, unsigned long rate) +@@ -1523,7 +1523,7 @@ long clk_round_rate(struct clk *clk, unsigned long rate) if (clk->exclusive_count) clk_core_rate_unprotect(clk->core); @@ -273877,7 +272781,7 @@ index ca978500782f..890834d0bbdb 100644 list_for_each_entry(clk_req, &clk->core->pending_requests, list) req.min_rate = max(clk_req->rate, req.min_rate); -@@ -2236,8 +2236,7 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, +@@ -2235,8 +2235,7 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, if (cnt < 0) return cnt; @@ -273894,7 +272798,7 @@ index ca978500782f..890834d0bbdb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Sat, 2 Apr 2022 14:06:53 +0200 -Subject: [PATCH 0894/1050] clk: Remove redundant clk_core_init_rate_req() call +Subject: [PATCH 0877/1183] clk: Remove redundant clk_core_init_rate_req() call Since all the users of clk_core_round_rate_nolock() will now properly initialize, there's no need for it to initialize the request itself. @@ -273915,10 +272819,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 2 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 890834d0bbdb..30b7d299f238 100644 +index cc93c20c1903..8ec5f623c668 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1438,8 +1438,6 @@ static int clk_core_round_rate_nolock(struct clk_core *core, +@@ -1437,8 +1437,6 @@ static int clk_core_round_rate_nolock(struct clk_core *core, return 0; } @@ -273934,7 +272838,7 @@ index 890834d0bbdb..30b7d299f238 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Sat, 2 Apr 2022 13:52:55 +0200 -Subject: [PATCH 0895/1050] clk: Switch from __clk_determine_rate to +Subject: [PATCH 0878/1183] clk: Switch from __clk_determine_rate to clk_core_round_rate_nolock clk_mux_determine_rate_flags() will call into __clk_determine_rate() @@ -273956,7 +272860,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 30b7d299f238..c4f85073348b 100644 +index 8ec5f623c668..ad92bd037bf9 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -550,6 +550,9 @@ static bool mux_is_better_rate(unsigned long rate, unsigned long now, @@ -274000,7 +272904,7 @@ index 30b7d299f238..c4f85073348b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 7 Apr 2022 14:11:37 +0200 -Subject: [PATCH 0896/1050] clk: Introduce clk_core_has_parent() +Subject: [PATCH 0879/1183] clk: Introduce clk_core_has_parent() We will need to know if a clk_core pointer has a given parent in other functions, so let's create a clk_core_has_parent() function that @@ -274018,7 +272922,7 @@ Signed-off-by: Maxime Ripard 2 files changed, 53 insertions(+), 15 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index c4f85073348b..323b61585aff 100644 +index ad92bd037bf9..1b3a82b51b9e 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -553,6 +553,26 @@ static bool mux_is_better_rate(unsigned long rate, unsigned long now, @@ -274048,7 +272952,7 @@ index c4f85073348b..323b61585aff 100644 int clk_mux_determine_rate_flags(struct clk_hw *hw, struct clk_rate_request *req, unsigned long flags) -@@ -2693,25 +2713,11 @@ void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent) +@@ -2692,25 +2712,11 @@ void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent) */ bool clk_has_parent(struct clk *clk, struct clk *parent) { @@ -274141,7 +273045,7 @@ index 2b22b7090968..9dbc116f49a8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Sat, 2 Apr 2022 14:36:59 +0200 -Subject: [PATCH 0897/1050] clk: Stop forwarding clk_rate_requests to the +Subject: [PATCH 0880/1183] clk: Stop forwarding clk_rate_requests to the parent If the clock cannot modify its rate and has CLK_SET_RATE_PARENT, @@ -274175,7 +273079,7 @@ Signed-off-by: Maxime Ripard 2 files changed, 227 insertions(+), 7 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 323b61585aff..d27ce02ee691 100644 +index 1b3a82b51b9e..33b1c4db265c 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -550,6 +550,10 @@ static bool mux_is_better_rate(unsigned long rate, unsigned long now, @@ -274269,7 +273173,7 @@ index 323b61585aff..d27ce02ee691 100644 } } -@@ -1458,6 +1488,8 @@ static bool clk_core_can_round(struct clk_core * const core) +@@ -1457,6 +1487,8 @@ static bool clk_core_can_round(struct clk_core * const core) static int clk_core_round_rate_nolock(struct clk_core *core, struct clk_rate_request *req) { @@ -274278,7 +273182,7 @@ index 323b61585aff..d27ce02ee691 100644 lockdep_assert_held(&prepare_lock); if (!core) { -@@ -1467,8 +1499,20 @@ static int clk_core_round_rate_nolock(struct clk_core *core, +@@ -1466,8 +1498,20 @@ static int clk_core_round_rate_nolock(struct clk_core *core, if (clk_core_can_round(core)) return clk_core_determine_round_nolock(core, req); @@ -274516,7 +273420,7 @@ index 9dbc116f49a8..ee91d1efea23 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Sat, 2 Apr 2022 14:37:39 +0200 -Subject: [PATCH 0898/1050] clk: Zero the clk_rate_request structure +Subject: [PATCH 0881/1183] clk: Zero the clk_rate_request structure In order to make sure we don't carry anything over from an already existing clk_rate_request pointer we would pass to @@ -274531,10 +273435,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 2 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index d27ce02ee691..51fb72525fab 100644 +index 33b1c4db265c..ab9b048f7fde 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1447,6 +1447,8 @@ static void clk_core_init_rate_req(struct clk_core * const core, +@@ -1446,6 +1446,8 @@ static void clk_core_init_rate_req(struct clk_core * const core, if (WARN_ON(!core || !req)) return; @@ -274550,7 +273454,7 @@ index d27ce02ee691..51fb72525fab 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 5 Apr 2022 15:20:27 +0200 -Subject: [PATCH 0899/1050] clk: Test the clock pointer in clk_hw_get_name() +Subject: [PATCH 0882/1183] clk: Test the clock pointer in clk_hw_get_name() Unlike __clk_get_name(), clk_hw_get_name() doesn't test wether passed clk_hw pointer is NULL or not and dereferences it directly. This can @@ -274566,7 +273470,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 51fb72525fab..85f945ece77b 100644 +index ab9b048f7fde..8545dee8c16f 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -277,7 +277,7 @@ EXPORT_SYMBOL_GPL(__clk_get_name); @@ -274585,7 +273489,7 @@ index 51fb72525fab..85f945ece77b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 17 Jan 2022 17:19:30 +0100 -Subject: [PATCH 0900/1050] clk: bcm: rpi: Add variant structure +Subject: [PATCH 0883/1183] clk: bcm: rpi: Add variant structure We only export a bunch of firmware clocks, and some of them require special treatment. @@ -274603,7 +273507,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 56 insertions(+), 20 deletions(-) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c -index 99cc4c856de1..edc052c33030 100644 +index 62971532eaaa..33f7d6662631 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c @@ -58,6 +58,8 @@ static char *rpi_firmware_clk_names[] = { @@ -274691,7 +273595,7 @@ index 99cc4c856de1..edc052c33030 100644 if (ret) { dev_err(rpi->dev, "Failed to initialize clkdev\n"); return ERR_PTR(ret); -@@ -266,30 +305,27 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, +@@ -271,30 +310,27 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi, return ret; while (clks->id) { @@ -274743,7 +273647,7 @@ index 99cc4c856de1..edc052c33030 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 17 Jan 2022 17:31:06 +0100 -Subject: [PATCH 0901/1050] clk: bcm: rpi: Set a default minimum rate +Subject: [PATCH 0884/1183] clk: bcm: rpi: Set a default minimum rate The M2MC clock provides the state machine clock for both HDMI controllers. @@ -274761,7 +273665,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 26 insertions(+) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c -index edc052c33030..70bacccc1b5a 100644 +index 33f7d6662631..20d0b829134b 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c @@ -78,6 +78,7 @@ struct raspberrypi_clk_data { @@ -274818,7 +273722,7 @@ index edc052c33030..70bacccc1b5a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 17 Jan 2022 17:36:23 +0100 -Subject: [PATCH 0902/1050] clk: bcm: rpi: Run some clocks at the minimum rate +Subject: [PATCH 0885/1183] clk: bcm: rpi: Run some clocks at the minimum rate allowed The core clock and M2MC clocks are shared between some devices (Unicam @@ -274841,7 +273745,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 37 insertions(+) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c -index 70bacccc1b5a..10226a6f5a4b 100644 +index 20d0b829134b..4abecd6f528d 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c @@ -79,6 +79,7 @@ struct raspberrypi_clk_variant { @@ -274922,7 +273826,7 @@ index 70bacccc1b5a..10226a6f5a4b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 16 Mar 2022 09:51:32 +0100 -Subject: [PATCH 0903/1050] Revert "drm/vc4: kms: Move clock request to our HVS +Subject: [PATCH 0886/1183] Revert "drm/vc4: kms: Move clock request to our HVS state" This reverts commit c65633a429b15f9d182a5bc7d6387fecbd5b7bb0. @@ -274983,7 +273887,7 @@ index 78c4d57fe597..29d3aa347b17 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 16 Mar 2022 09:51:44 +0100 -Subject: [PATCH 0904/1050] Revert "drm/vc4: Increase the core clock based on +Subject: [PATCH 0887/1183] Revert "drm/vc4: Increase the core clock based on HVS load" This reverts commit 02c8543cc6940f8201e9beb601bd56421d911e83. @@ -275043,7 +273947,7 @@ index 29d3aa347b17..e998a126a3b1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 16 Mar 2022 09:52:34 +0100 -Subject: [PATCH 0905/1050] Revert "drm/vc4: hdmi: Convert to the new clock +Subject: [PATCH 0888/1183] Revert "drm/vc4: hdmi: Convert to the new clock request API" This reverts commit 5dbb9357519a9479eacdda130713bf0dc44e069c. @@ -275088,7 +273992,7 @@ index e998a126a3b1..a05482e95846 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 16 Mar 2022 09:53:03 +0100 -Subject: [PATCH 0906/1050] Revert "bcm2835-unicam: Switch to new clock api" +Subject: [PATCH 0889/1183] Revert "bcm2835-unicam: Switch to new clock api" This reverts commit 702228eb413876739f4fee8a9ec66b3e4e54efac. --- @@ -275147,7 +274051,7 @@ index 1e0101bb3af9..401d2c4d734f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 16 Mar 2022 09:58:31 +0100 -Subject: [PATCH 0907/1050] Revert "rpivid: Switch to new clock api" +Subject: [PATCH 0890/1183] Revert "rpivid: Switch to new clock api" This reverts commit ec7556e20c2c29c3df9493248a1a4d60ed20ae38. --- @@ -275220,7 +274124,7 @@ index 93b3d86b41e3..8007c4dbcf89 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 16 Mar 2022 09:41:44 +0100 -Subject: [PATCH 0908/1050] Revert "clk: requests: Dereference the request +Subject: [PATCH 0891/1183] Revert "clk: requests: Dereference the request pointer after the check" This reverts commit 12917adc036f82c4fda3b80a068d0d51c947d6a6. @@ -275229,10 +274133,10 @@ This reverts commit 12917adc036f82c4fda3b80a068d0d51c947d6a6. 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 85f945ece77b..948b3e803589 100644 +index 8545dee8c16f..b08147923bde 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2670,11 +2670,10 @@ EXPORT_SYMBOL_GPL(clk_request_start); +@@ -2669,11 +2669,10 @@ EXPORT_SYMBOL_GPL(clk_request_start); */ void clk_request_done(struct clk_request *req) { @@ -275252,7 +274156,7 @@ index 85f945ece77b..948b3e803589 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 16 Mar 2022 09:41:48 +0100 -Subject: [PATCH 0909/1050] Revert "clk: requests: Ignore if the pointer is +Subject: [PATCH 0892/1183] Revert "clk: requests: Ignore if the pointer is null" This reverts commit f078b2c9b1901f6297154788ac07f56547ddcb7a. @@ -275261,10 +274165,10 @@ This reverts commit f078b2c9b1901f6297154788ac07f56547ddcb7a. 1 file changed, 3 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 948b3e803589..58b686957822 100644 +index b08147923bde..9fcf6476afd9 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2672,9 +2672,6 @@ void clk_request_done(struct clk_request *req) +@@ -2671,9 +2671,6 @@ void clk_request_done(struct clk_request *req) { struct clk_core *core = req->clk->core; @@ -275281,7 +274185,7 @@ index 948b3e803589..58b686957822 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 16 Mar 2022 09:41:49 +0100 -Subject: [PATCH 0910/1050] Revert "clk: Introduce a clock request API" +Subject: [PATCH 0893/1183] Revert "clk: Introduce a clock request API" This reverts commit 23fbabe348436e250deca7c5f2fd0caf620af174. --- @@ -275290,7 +274194,7 @@ This reverts commit 23fbabe348436e250deca7c5f2fd0caf620af174. 2 files changed, 125 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 58b686957822..5f3fa8f5b205 100644 +index 9fcf6476afd9..24e243860e27 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -77,14 +77,12 @@ struct clk_core { @@ -275321,7 +274225,7 @@ index 58b686957822..5f3fa8f5b205 100644 /*** runtime pm ***/ static int clk_pm_runtime_get(struct clk_core *core) { -@@ -1557,13 +1549,9 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate) +@@ -1556,13 +1548,9 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate) { int ret; struct clk_rate_request req; @@ -275335,7 +274239,7 @@ index 58b686957822..5f3fa8f5b205 100644 ret = clk_core_round_rate_nolock(hw->core, &req); if (ret) return 0; -@@ -1584,7 +1572,6 @@ EXPORT_SYMBOL_GPL(clk_hw_round_rate); +@@ -1583,7 +1571,6 @@ EXPORT_SYMBOL_GPL(clk_hw_round_rate); long clk_round_rate(struct clk *clk, unsigned long rate) { struct clk_rate_request req; @@ -275343,7 +274247,7 @@ index 58b686957822..5f3fa8f5b205 100644 int ret; if (!clk) -@@ -1597,9 +1584,6 @@ long clk_round_rate(struct clk *clk, unsigned long rate) +@@ -1596,9 +1583,6 @@ long clk_round_rate(struct clk *clk, unsigned long rate) clk_core_init_rate_req(clk->core, &req, rate); @@ -275353,7 +274257,7 @@ index 58b686957822..5f3fa8f5b205 100644 ret = clk_core_round_rate_nolock(clk->core, &req); if (clk->exclusive_count) -@@ -2085,7 +2069,6 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, +@@ -2084,7 +2068,6 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, unsigned long new_rate; unsigned long min_rate; unsigned long max_rate; @@ -275361,7 +274265,7 @@ index 58b686957822..5f3fa8f5b205 100644 int p_index = 0; long ret; -@@ -2100,9 +2083,6 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, +@@ -2099,9 +2082,6 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, clk_core_get_boundaries(core, &min_rate, &max_rate); @@ -275371,7 +274275,7 @@ index 58b686957822..5f3fa8f5b205 100644 /* find the closest rate and parent clk/rate */ if (clk_core_can_round(core)) { struct clk_rate_request req; -@@ -2295,7 +2275,6 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, +@@ -2294,7 +2274,6 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, { int ret, cnt; struct clk_rate_request req; @@ -275379,7 +274283,7 @@ index 58b686957822..5f3fa8f5b205 100644 lockdep_assert_held(&prepare_lock); -@@ -2309,9 +2288,6 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, +@@ -2308,9 +2287,6 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, clk_core_init_rate_req(core, &req, req_rate); @@ -275389,7 +274293,7 @@ index 58b686957822..5f3fa8f5b205 100644 ret = clk_core_round_rate_nolock(core, &req); /* restore the protection */ -@@ -2405,9 +2381,6 @@ int clk_set_rate(struct clk *clk, unsigned long rate) +@@ -2404,9 +2380,6 @@ int clk_set_rate(struct clk *clk, unsigned long rate) ret = clk_core_set_rate_nolock(clk->core, rate); @@ -275399,7 +274303,7 @@ index 58b686957822..5f3fa8f5b205 100644 if (clk->exclusive_count) clk_core_rate_protect(clk->core); -@@ -2602,99 +2575,6 @@ int clk_set_max_rate(struct clk *clk, unsigned long rate) +@@ -2601,99 +2574,6 @@ int clk_set_max_rate(struct clk *clk, unsigned long rate) } EXPORT_SYMBOL_GPL(clk_set_max_rate); @@ -275499,7 +274403,7 @@ index 58b686957822..5f3fa8f5b205 100644 /** * clk_get_parent - return the parent of a clk * @clk: the clk whose parent gets returned -@@ -4153,7 +4033,6 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw) +@@ -4152,7 +4032,6 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw) goto fail_parents; INIT_HLIST_HEAD(&core->clks); @@ -275536,7 +274440,7 @@ index 433364d18fe0..3b8cf492ff1a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 15 Apr 2022 14:17:41 +0200 -Subject: [PATCH 0911/1050] clk: Add clk_get_rate_range +Subject: [PATCH 0894/1183] clk: Add clk_get_rate_range With the recent introduction of clock drivers that will force their clock rate to either the minimum or maximum boundaries, it becomes @@ -275562,10 +274466,10 @@ Signed-off-by: Maxime Ripard 2 files changed, 77 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index 5f3fa8f5b205..f3dfb6b23030 100644 +index 24e243860e27..704d80e45325 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2575,6 +2575,24 @@ int clk_set_max_rate(struct clk *clk, unsigned long rate) +@@ -2574,6 +2574,24 @@ int clk_set_max_rate(struct clk *clk, unsigned long rate) } EXPORT_SYMBOL_GPL(clk_set_max_rate); @@ -275681,7 +274585,7 @@ index 3b8cf492ff1a..39710b8453fa 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 15 Apr 2022 14:45:17 +0200 -Subject: [PATCH 0912/1050] clk: tests: Add some tests for clk_get_rate_range() +Subject: [PATCH 0895/1183] clk: tests: Add some tests for clk_get_rate_range() Let's introduce a bunch of unit tests to make sure the values returned by clk_get_rate_range() are sane. @@ -275912,7 +274816,7 @@ index ee91d1efea23..1e120fe33783 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 15 Apr 2022 15:00:44 +0200 -Subject: [PATCH 0913/1050] clk: tests: Add missing test case for ranges +Subject: [PATCH 0896/1183] clk: tests: Add missing test case for ranges Let's add a test on the rate range after a reparenting. This fails for now, but it's worth having it to document the corner cases we don't @@ -275996,7 +274900,7 @@ index 1e120fe33783..af40d46987e7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 24 Mar 2022 11:57:57 +0100 -Subject: [PATCH 0914/1050] drm/vc4: hdmi: Rework hdmi_enable_4kp60 detection +Subject: [PATCH 0897/1183] drm/vc4: hdmi: Rework hdmi_enable_4kp60 detection In order to support higher HDMI frequencies, users have to set the hdmi_enable_4kp60 parameter in their config.txt file. @@ -276044,7 +274948,7 @@ index 6626299e37ec..30b5bf4a7f14 100644 struct vc4_plane { diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index dc7ca3db6865..82f00eb905c1 100644 +index b25a5b8186ef..3f0607315487 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -292,6 +292,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) @@ -276078,7 +274982,7 @@ index dc7ca3db6865..82f00eb905c1 100644 return MODE_CLOCK_HIGH; if (info->max_tmds_clock && clock > (info->max_tmds_clock * 1000)) -@@ -3158,14 +3160,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) +@@ -3156,14 +3158,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi->disable_wifi_frequencies = of_property_read_bool(dev->of_node, "wifi-2.4ghz-coexistence"); @@ -276142,7 +275046,7 @@ index 9dcc26d505b0..05b3621ff652 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 25 Mar 2022 15:48:48 +0100 -Subject: [PATCH 0915/1050] drm/vc4: kms: Warn if clk_set_min_rate fails +Subject: [PATCH 0898/1183] drm/vc4: kms: Warn if clk_set_min_rate fails We currently ignore the clk_set_min_rate return code assuming it would succeed. However, it can fail if we ask for a rate higher than the @@ -276184,7 +275088,7 @@ index a05482e95846..a41d3c8c0458 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 25 Mar 2022 17:09:41 +0100 -Subject: [PATCH 0916/1050] drm/vc4: Make sure we don't end up with a core +Subject: [PATCH 0899/1183] drm/vc4: Make sure we don't end up with a core clock too high Following the clock rate range improvements to the clock framework, @@ -276248,7 +275152,7 @@ index a41d3c8c0458..e33ce608d174 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 13 Apr 2022 16:22:49 +0200 -Subject: [PATCH 0917/1050] drm/vc4: kms: Use maximum FIFO load for the HVS +Subject: [PATCH 0900/1183] drm/vc4: kms: Use maximum FIFO load for the HVS clock rate The core clock computation takes into account both the load due to the @@ -276294,7 +275198,7 @@ index e33ce608d174..190aadef350f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 15 Apr 2022 15:26:07 +0200 -Subject: [PATCH 0918/1050] rpivid: Use clk_get_max_rate() +Subject: [PATCH 0901/1183] rpivid: Use clk_get_max_rate() The driver was using clk_round_rate() to figure out the maximum clock rate that was allowed for the HEVC clock. @@ -276326,7 +275230,7 @@ index 8007c4dbcf89..bab3ed3ff361 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Alberto Solavagione Date: Wed, 20 Apr 2022 17:15:42 +0200 -Subject: [PATCH 0919/1050] clk-bcm2835: use subsys_initcall for the clock +Subject: [PATCH 0902/1183] clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled Co-authored-by: Davide Scovotto @@ -276360,7 +275264,7 @@ index 7112a9c4f7e3..9ed157b0a37a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Scovotto Davide Date: Wed, 20 Apr 2022 17:22:17 +0200 -Subject: [PATCH 0920/1050] tpm_tis_spi_main: Force probe routine to run +Subject: [PATCH 0903/1183] tpm_tis_spi_main: Force probe routine to run synchronously with driver and device registration when IMA is enabled Co-authored-by: Alberto Solavagione @@ -276394,7 +275298,7 @@ index aaa59a00eeae..b6cf04812078 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: andrum99 <97977513+andrum99@users.noreply.github.com> Date: Sun, 24 Apr 2022 17:23:23 +0100 -Subject: [PATCH 0921/1050] overlays: Add "drm" parameter to pitft28-resistive +Subject: [PATCH 0904/1183] overlays: Add "drm" parameter to pitft28-resistive Add "drm" parameter to the pitft28-resistive, forcing use of the mi0283qt DRM driver. @@ -276445,7 +275349,7 @@ index 4a4a3f44c29d..9e9f90ad51e0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 19 Apr 2022 19:57:29 +0100 -Subject: [PATCH 0922/1050] ARM: dts: Add i2c0mux node to Model B rev 1 +Subject: [PATCH 0905/1183] ARM: dts: Add i2c0mux node to Model B rev 1 The lack of an i2c0mux label prevents the i2c-rtc overlay from being applied. @@ -276479,7 +275383,7 @@ index c2d83b61a63c..9bea71078d5f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 24 Apr 2022 20:25:34 +0100 -Subject: [PATCH 0923/1050] overlays: Fix pitft28/35-resistive rotate params +Subject: [PATCH 0906/1183] overlays: Fix pitft28/35-resistive rotate params The drm drivers uses the property name "rotation", not "rotate" as used by the fbtft drivers. Fix suggested by notro. @@ -276527,7 +275431,7 @@ index e11e1920024a..fc0f5e5446ee 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 25 Apr 2022 17:45:16 +0200 -Subject: [PATCH 0924/1050] ARM: dts: bcm2835: Switch HSM clock to firmware +Subject: [PATCH 0907/1183] ARM: dts: bcm2835: Switch HSM clock to firmware When the bootloader boots without a display connected to the HDMI connector, it won't initialize the HSM clock. @@ -276568,7 +275472,7 @@ index 7f46a6ec512c..69c91c5d7775 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 27 Apr 2022 14:45:35 +0100 -Subject: [PATCH 0925/1050] drm/vc4_kms: Protect hvs dereference on fkms +Subject: [PATCH 0908/1183] drm/vc4_kms: Protect hvs dereference on fkms fkms has a null hvs pointer so this crashes. Protect against it @@ -276597,7 +275501,7 @@ index 190aadef350f..064093ad890a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Thu, 28 Apr 2022 16:11:20 +0100 -Subject: [PATCH 0926/1050] Revert "fbdev: Fix unregistering of framebuffers +Subject: [PATCH 0909/1183] Revert "fbdev: Fix unregistering of framebuffers without device" This reverts commit 2388f826cdc9af2651991adc0feb79de9bdf2232. @@ -276632,7 +275536,7 @@ index 0c761186a54d..9bacac0a8f58 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Thu, 28 Apr 2022 16:11:34 +0100 -Subject: [PATCH 0927/1050] Revert "fbdev: Hot-unplug firmware fb devices on +Subject: [PATCH 0910/1183] Revert "fbdev: Hot-unplug firmware fb devices on forced removal" This reverts commit c894ac44786cfed383a6c6b20c1bfb12eb96018a. @@ -276726,7 +275630,7 @@ index 3d7306c9a706..02f362c661c8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 29 Apr 2022 08:50:43 +0100 -Subject: [PATCH 0928/1050] config: Update bcmrpi3_defconfig +Subject: [PATCH 0911/1183] config: Update bcmrpi3_defconfig Bring bcmrpi3_defconfig roughly into line with bcm2711_defconfig. @@ -277004,7 +275908,7 @@ index e162165e947d..eec9e1c1f292 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 29 Apr 2022 09:19:10 +0100 -Subject: [PATCH 0929/1050] staging: vchiq_arm: Add log_level module params +Subject: [PATCH 0912/1183] staging: vchiq_arm: Add log_level module params Add module parameters to control the logging levels for the various vchiq logging categories. @@ -277037,7 +275941,7 @@ index f3d2fe5bbfa0..3e9bd2aa1142 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 May 2022 09:11:27 +0100 -Subject: [PATCH 0930/1050] configs: Add CONFIG_EEPROM_AT25=m +Subject: [PATCH 0913/1183] configs: Add CONFIG_EEPROM_AT25=m Enable support for more SPI EEPROMs and FRAMs. @@ -277119,7 +276023,7 @@ index eec9e1c1f292..6e9597b2b68d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 5 May 2022 12:16:57 +0100 -Subject: [PATCH 0931/1050] configs: Enable DM_WRITECACHE module on BCM2711 +Subject: [PATCH 0914/1183] configs: Enable DM_WRITECACHE module on BCM2711 For Pi 4 (which has high speed USB and PCIe), enable DM_WRITECACHE as a module to allow an external SSD to be used as a fast write cache for a @@ -277164,7 +276068,7 @@ index f763b3f666ae..1188bdc2a4b7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 May 2022 00:02:54 +0100 -Subject: [PATCH 0932/1050] configs: Restore settings lost since 5.10 +Subject: [PATCH 0915/1183] configs: Restore settings lost since 5.10 Signed-off-by: Phil Elwell --- @@ -277332,7 +276236,7 @@ index 6e9597b2b68d..3ce71ab7c997 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Thu, 21 Apr 2022 14:14:29 +0800 -Subject: [PATCH 0933/1050] dt-bindings: vendor-prefixes: Add Arducam +Subject: [PATCH 0916/1183] dt-bindings: vendor-prefixes: Add Arducam Add vendor prefix for Arducam (https://arducam.com). @@ -277361,7 +276265,7 @@ index 3c65028f5335..c2665870c465 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Thu, 21 Apr 2022 14:18:44 +0800 -Subject: [PATCH 0934/1050] media: dt-bindings: media: i2c: Add Arducam +Subject: [PATCH 0917/1183] media: dt-bindings: media: i2c: Add Arducam Pivariety Series CMOS sensor binding Add YAML device tree binding for Arducam Pivariety CMOS image sensor, and @@ -277518,7 +276422,7 @@ index 682b40c17f23..ca65f8656693 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Thu, 14 Apr 2022 17:31:01 +0800 -Subject: [PATCH 0935/1050] media: i2c: Add driver of Arducam Pivariety series +Subject: [PATCH 0918/1183] media: i2c: Add driver of Arducam Pivariety series camera Add a driver for the Arducam Pivariety series CSI2 camera sensor. @@ -279162,7 +278066,7 @@ index 000000000000..b2b8cbc47138 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Thu, 21 Apr 2022 11:36:41 +0800 -Subject: [PATCH 0936/1050] configs: Add CONFIG_VIDEO_ARDUCAM_PIVARIETY=m +Subject: [PATCH 0919/1183] configs: Add CONFIG_VIDEO_ARDUCAM_PIVARIETY=m Include the driver module for the ARDUCAM_PIVARIETY. @@ -279242,7 +278146,7 @@ index 3ce71ab7c997..1f20261ab813 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Thu, 21 Apr 2022 13:15:34 +0800 -Subject: [PATCH 0937/1050] overlays: Add arducam-pivariety-overlay.dts +Subject: [PATCH 0920/1183] overlays: Add arducam-pivariety-overlay.dts Added overlays for enabling Arducam Pivariety and add the relevant information to the README. @@ -279400,7 +278304,7 @@ index 000000000000..935179fa8851 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 6 May 2022 15:34:44 +0100 -Subject: [PATCH 0938/1050] thermal: broadcom: Use dev_err_probe to suppress +Subject: [PATCH 0921/1183] thermal: broadcom: Use dev_err_probe to suppress defer errors It is quite common for the devm_thermal_zone_of_sensor_register @@ -279432,7 +278336,7 @@ index e9bef5c3414b..c6ff8d1eca74 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Michael Shych Date: Sat, 30 Apr 2022 14:49:04 +0300 -Subject: [PATCH 0939/1050] dt-bindings: hwmon: add microchip,emc2305.yaml dt +Subject: [PATCH 0922/1183] dt-bindings: hwmon: add microchip,emc2305.yaml dt binding description. Submitted to linux-hwmon mailing list at @@ -279514,7 +278418,7 @@ index 000000000000..52ae4c2924d6 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 10 May 2022 14:03:30 +0100 -Subject: [PATCH 0940/1050] dtbindings: Fixup microchip,emc2305.yaml bindings +Subject: [PATCH 0923/1183] dtbindings: Fixup microchip,emc2305.yaml bindings The bindings submitted to mainline had some issues, so fix them up. @@ -279560,7 +278464,7 @@ index 52ae4c2924d6..efdc3cecb03d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Michael Shych Date: Sat, 30 Apr 2022 14:49:03 +0300 -Subject: [PATCH 0941/1050] hwmon: (emc2305) add support for EMC2301/2/3/5 +Subject: [PATCH 0924/1183] hwmon: (emc2305) add support for EMC2301/2/3/5 RPM-based PWM Fan Speed Controller. Submitted to linux-hwmon mailing list at @@ -280257,7 +279161,7 @@ index 000000000000..5c896fdfc525 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 5 May 2022 15:46:07 +0100 -Subject: [PATCH 0942/1050] hwmon: emc2305: fixups for driver submitted to +Subject: [PATCH 0925/1183] hwmon: emc2305: fixups for driver submitted to mailing lists The driver had a number of issues, checkpatch warnings/errors, @@ -280489,7 +279393,7 @@ index 5c896fdfc525..c78d672ff713 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Michael Shych Date: Sat, 30 Apr 2022 14:49:05 +0300 -Subject: [PATCH 0943/1050] docs: hwmon: add emc2305.rst to docs +Subject: [PATCH 0926/1183] docs: hwmon: add emc2305.rst to docs Submitted to linux-hwmon mailing list at https://patchwork.kernel.org/project/linux-hwmon/patch/20220430114905.53448-4-michaelsh@nvidia.com/ @@ -280556,7 +279460,7 @@ index 000000000000..258da49d18f9 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 May 2022 17:22:55 +0100 -Subject: [PATCH 0944/1050] configs: Enable the EMC2305 fan controller driver +Subject: [PATCH 0927/1183] configs: Enable the EMC2305 fan controller driver Signed-off-by: Phil Elwell --- @@ -280649,7 +279553,7 @@ index 1f20261ab813..f1910ae088c8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 May 2022 17:20:11 +0100 -Subject: [PATCH 0945/1050] dtoverlays: Add i2c-fan overlay +Subject: [PATCH 0928/1183] dtoverlays: Add i2c-fan overlay Add an i2c-fan overlay, initially with support for the EMC2301 fan controller found on the CM4IO board. @@ -280825,7 +279729,7 @@ index 000000000000..e9424c376d54 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 May 2022 15:35:50 +0100 -Subject: [PATCH 0946/1050] SQUASH: overlays: arducam-pivariety: Strip leading +Subject: [PATCH 0929/1183] SQUASH: overlays: arducam-pivariety: Strip leading zero Newer versions of dtc warn about node addresses with leading zeroes. @@ -280855,7 +279759,7 @@ index 935179fa8851..7434e242dba6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 May 2022 15:40:02 +0100 -Subject: [PATCH 0947/1050] overlays: Remove other leading zeroes from node +Subject: [PATCH 0930/1183] overlays: Remove other leading zeroes from node addresses Newer versions of dtc warn about node addresses with leading zeroes. @@ -280927,7 +279831,7 @@ index af2c86383e1f..d06ee9229b0d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 6 May 2022 12:24:31 +0200 -Subject: [PATCH 0948/1050] clk: Add locking to clk_get_rate_range +Subject: [PATCH 0931/1183] clk: Add locking to clk_get_rate_range clk_get_rate_range() is missing the proper locks, making lockdep complain. @@ -280938,10 +279842,10 @@ Signed-off-by: Maxime Ripard 1 file changed, 2 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index f3dfb6b23030..de6715cd57c0 100644 +index 704d80e45325..cc9b7a42a055 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2589,7 +2589,9 @@ void clk_get_rate_range(struct clk *clk, unsigned long *min, unsigned long *max) +@@ -2588,7 +2588,9 @@ void clk_get_rate_range(struct clk *clk, unsigned long *min, unsigned long *max) if (!clk || !min || !max) return; @@ -280958,7 +279862,7 @@ index f3dfb6b23030..de6715cd57c0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 16 Mar 2022 16:44:45 +0100 -Subject: [PATCH 0949/1050] drm/vc4: plane: Prevent async update if we don't +Subject: [PATCH 0932/1183] drm/vc4: plane: Prevent async update if we don't have a dlist The vc4 planes are setup in hardware by creating a hardware descriptor @@ -281001,7 +279905,7 @@ index 4595c09c782d..3462c9b6d7cf 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 21 Apr 2022 14:27:11 +0200 -Subject: [PATCH 0950/1050] drm/vc4: Consolidate Hardware Revision Check +Subject: [PATCH 0933/1183] drm/vc4: Consolidate Hardware Revision Check A new generation of controller has been introduced with the BCM2711/RaspberryPi4. This generation needs a bunch of quirks, and over @@ -281069,7 +279973,7 @@ index 8e63ad283068..93adb5c272dd 100644 * implemented as private driver state in vc4_kms, not here. */ diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index c5d0bf2db2e5..822744f3d7f3 100644 +index be19bc2ca756..cda0b70dd404 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -246,10 +246,13 @@ static int vc4_drm_bind(struct device *dev) @@ -281369,7 +280273,7 @@ index 3462c9b6d7cf..f0482d1ef821 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 18 Mar 2022 09:46:35 +0100 -Subject: [PATCH 0951/1050] drm/vc4: bo: Rename vc4_dumb_create +Subject: [PATCH 0934/1183] drm/vc4: bo: Rename vc4_dumb_create We're going to add a new variant of the dumb BO allocation function, so let's rename vc4_dumb_create() to something a bit more specific. @@ -281399,7 +280303,7 @@ index f642bd6e71ff..0ce742ebda83 100644 int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8); struct vc4_bo *bo = NULL; diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 822744f3d7f3..97c81d2916ca 100644 +index cda0b70dd404..776bf2d86ae0 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -177,7 +177,7 @@ static struct drm_driver vc4_drm_driver = { @@ -281435,7 +280339,7 @@ index 17dd7bab636d..335a974cf22a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 21 Apr 2022 10:59:41 +0200 -Subject: [PATCH 0952/1050] drm/vc4: bo: Split out Dumb buffers fixup +Subject: [PATCH 0935/1183] drm/vc4: bo: Split out Dumb buffers fixup The vc4_bo_dumb_create() both fixes up the allocation arguments to match the hardware constraints and actually performs the allocation. @@ -281475,7 +280379,7 @@ index 0ce742ebda83..8752d88f1f71 100644 bo = vc4_bo_create(dev, args->size, false, VC4_BO_TYPE_DUMB); if (IS_ERR(bo)) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 97c81d2916ca..e082432f19ac 100644 +index 776bf2d86ae0..36d1b3e9cd1d 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -65,6 +65,19 @@ void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index) @@ -281517,7 +280421,7 @@ index 335a974cf22a..6caf640e38e7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 21 Apr 2022 11:08:22 +0200 -Subject: [PATCH 0953/1050] drm/vc4: drv: Register a different driver on +Subject: [PATCH 0936/1183] drm/vc4: drv: Register a different driver on BCM2711 Prior to the BCM2711/RaspberryPi4, the GPU was a part of the display @@ -281542,7 +280446,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index e082432f19ac..48d99248dfb5 100644 +index 36d1b3e9cd1d..4d8c662624dc 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -78,6 +78,19 @@ int vc4_dumb_fixup_args(struct drm_mode_create_dumb *args) @@ -281652,7 +280556,7 @@ index e082432f19ac..48d99248dfb5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 21 Apr 2022 11:13:00 +0200 -Subject: [PATCH 0954/1050] drm/vc4: kms: Register a different +Subject: [PATCH 0937/1183] drm/vc4: kms: Register a different drm_mode_config_funcs on BCM2711 On the BCM2711, our current definition of drm_mode_config_funcs uses the @@ -281702,7 +280606,7 @@ index 716c40e9d37b..98a30e4bf185 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 21 Apr 2022 11:39:27 +0200 -Subject: [PATCH 0955/1050] drm/vc4: plane: Register a different +Subject: [PATCH 0938/1183] drm/vc4: plane: Register a different drm_plane_helper_funcs on BCM2711 On the BCM2711, our current definition of drm_plane_helper_funcs uses @@ -281756,7 +280660,7 @@ index f0482d1ef821..d79654e2f65b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 21 Apr 2022 17:29:02 +0200 -Subject: [PATCH 0956/1050] drm/vc4: drv: Skip BO Backend Initialization on +Subject: [PATCH 0939/1183] drm/vc4: drv: Skip BO Backend Initialization on BCM2711 On the BCM2711, we currently call the vc4_bo_cache_init() and @@ -281773,7 +280677,7 @@ Signed-off-by: Maxime Ripard 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 48d99248dfb5..aa52709722de 100644 +index 4d8c662624dc..dbc52933ec02 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -324,19 +324,23 @@ static int vc4_drm_bind(struct device *dev) @@ -281814,7 +280718,7 @@ index 48d99248dfb5..aa52709722de 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 2 May 2022 10:20:56 +0200 -Subject: [PATCH 0957/1050] drm/vc4: crtc: Use an union to store the page flip +Subject: [PATCH 0940/1183] drm/vc4: crtc: Use an union to store the page flip callback We'll need to extend the vc4_async_flip_state structure to rely on @@ -281904,7 +280808,7 @@ index 93adb5c272dd..b3e078638b4b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 2 May 2022 15:25:20 +0200 -Subject: [PATCH 0958/1050] drm/vc4: crtc: Move the BO handling out of common +Subject: [PATCH 0941/1183] drm/vc4: crtc: Move the BO handling out of common page-flip callback We'll soon introduce another completion callback source that won't need @@ -281978,7 +280882,7 @@ index b3e078638b4b..2749ee3b5f06 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 2 May 2022 15:27:36 +0200 -Subject: [PATCH 0959/1050] drm/vc4: crtc: Move the BO Handling out of Common +Subject: [PATCH 0942/1183] drm/vc4: crtc: Move the BO Handling out of Common Page-Flip Handler The function vc4_async_page_flip() handles asynchronous page-flips in @@ -282102,7 +281006,7 @@ index 2749ee3b5f06..4020fd9e5603 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 2 May 2022 15:28:05 +0200 -Subject: [PATCH 0960/1050] drm/vc4: crtc: Don't call into BO Handling on Async +Subject: [PATCH 0943/1183] drm/vc4: crtc: Don't call into BO Handling on Async Page-Flips on BCM2711 The BCM2711 doesn't have a v3d GPU so we don't want to call into its BO @@ -282160,7 +281064,7 @@ index 4020fd9e5603..f10f98dc927f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 21 Apr 2022 16:29:43 +0200 -Subject: [PATCH 0961/1050] drm/vc4: Warn if some v3d code is run on BCM2711 +Subject: [PATCH 0944/1183] drm/vc4: Warn if some v3d code is run on BCM2711 The BCM2711 has a separate driver for the v3d, and thus we can't call into any of the driver entrypoints that rely on the v3d being there. @@ -282351,7 +281255,7 @@ index 8752d88f1f71..90633e15ab92 100644 return -EINVAL; diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index aa52709722de..93e094bc6da2 100644 +index dbc52933ec02..4fe07db6d911 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -101,6 +101,9 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, @@ -282939,7 +281843,7 @@ index 7cf82b071de2..e315aeb5fef5 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Suriyan Laohaprapanon Date: Wed, 11 May 2022 18:00:22 +0100 -Subject: [PATCH 0962/1050] dtoverlays: Fix incorrect property name for display +Subject: [PATCH 0945/1183] dtoverlays: Fix incorrect property name for display rotation --- @@ -282975,7 +281879,7 @@ index bf186811ec5d..6e69bd7fa031 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Thu, 5 May 2022 18:50:04 +0100 -Subject: [PATCH 0963/1050] drm/vc4_hdmi: Force a modeset when Broadcast RGB +Subject: [PATCH 0946/1183] drm/vc4_hdmi: Force a modeset when Broadcast RGB setting changes Without this the change is not visible until the next modeset @@ -282986,7 +281890,7 @@ Signed-off-by: Dom Cobley 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 82f00eb905c1..e54aff882a3c 100644 +index 3f0607315487..eaaf55292914 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -334,14 +334,17 @@ static int vc4_hdmi_connector_atomic_check(struct drm_connector *connector, @@ -283014,7 +281918,7 @@ index 82f00eb905c1..e54aff882a3c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 1 Apr 2022 17:10:37 +0100 -Subject: [PATCH 0964/1050] drm/atomic: If margins are updated, update all +Subject: [PATCH 0947/1183] drm/atomic: If margins are updated, update all planes. Margins may be implemented by scaling the planes, but as there @@ -283080,7 +281984,7 @@ index d6814f145bd5..46976131e6a6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 16 May 2022 12:16:46 +0100 -Subject: [PATCH 0965/1050] overlays: Add gpio-hog overlay +Subject: [PATCH 0948/1183] overlays: Add gpio-hog overlay Add an overlay to activate a hog on a specified pin. Note that hogged GPIOs are not available for other uses, i.e. drivers or @@ -283170,53 +282074,9 @@ index 000000000000..c9e39046fed9 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jonathan Bell -Date: Mon, 16 May 2022 10:28:27 +0100 -Subject: [PATCH 0966/1050] mmc: block: Don't do single-sector reads during - recovery - -See https://github.com/raspberrypi/linux/issues/5019 - -If an SD card has degraded performance such that IO operations time out -then the MMC block layer will leak SG DMA mappings in the swiotlb during -recovery. It retries the same SG and this causes the leak, as it is -mapped twice - once in sdhci_pre_req() and again during single-block -reads in sdhci_prepare_data(). - -Resetting the card (including power-cycling if a regulator for vmmc is -present) ought to be enough to recover a stuck state, so for now don't -try single-block reads in the recovery path. - -Signed-off-by: Jonathan Bell ---- - drivers/mmc/core/block.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c -index a992dd6dafc5..78184372bc4e 100644 ---- a/drivers/mmc/core/block.c -+++ b/drivers/mmc/core/block.c -@@ -1870,7 +1870,11 @@ static void mmc_blk_mq_rw_recovery(struct mmc_queue *mq, struct request *req) - } - - /* FIXME: Missing single sector read for large sector size */ -- if (!mmc_large_sector(card) && rq_data_dir(req) == READ && -+ /* -+ * XXX: don't do single-sector reads, as it leaks a SG DMA -+ * mapping when reusing the still-pending req. -+ */ -+ if (0 && !mmc_large_sector(card) && rq_data_dir(req) == READ && - brq->data.blocks > 1) { - /* Read one sector at a time */ - mmc_blk_read_single(mq, req); --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 May 2022 13:39:00 +0100 -Subject: [PATCH 0967/1050] configs: Regenerate defconfigs +Subject: [PATCH 0949/1183] configs: Regenerate defconfigs Signed-off-by: Phil Elwell --- @@ -283334,7 +282194,7 @@ index f1910ae088c8..95885c250f30 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 16 May 2022 17:33:48 +0100 -Subject: [PATCH 0968/1050] vc04_services: vchiq-mmal: Add defines for +Subject: [PATCH 0950/1183] vc04_services: vchiq-mmal: Add defines for mmal_es_format flags There is a flags field in struct mmal_es_format, but the defines @@ -283374,7 +282234,7 @@ index a118efd21d98..e0c331eb8799 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 16 May 2022 17:37:35 +0100 -Subject: [PATCH 0969/1050] vc04_services: bcm2835-codec: Add support for +Subject: [PATCH 0951/1183] vc04_services: bcm2835-codec: Add support for V4L2_PIX_FMT_NV12_COL128 V4L2_PIX_FMT_NV12_COL128 is supported by the ISP and the input of @@ -283534,7 +282394,7 @@ index 8abdd7f6b7fd..dc7c0b97fbc8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 17 May 2022 17:21:43 +0100 -Subject: [PATCH 0970/1050] drm/vc4: Add HDMI format detection registers to +Subject: [PATCH 0952/1183] drm/vc4: Add HDMI format detection registers to register list The block can detect what the incoming image timings are for @@ -283608,7 +282468,7 @@ index 0198de96c7b2..5a56761e75af 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 17 May 2022 17:23:17 +0100 -Subject: [PATCH 0971/1050] drm/vc4: Add MISC_CONTROL register for vc4. +Subject: [PATCH 0953/1183] drm/vc4: Add MISC_CONTROL register for vc4. The MISC_CONTROL register allows configuration of pixel repetition for pixel doubling in the HDMI block instead of PixelValve. @@ -283637,48 +282497,8 @@ index 5a56761e75af..48db438550b1 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson -Date: Tue, 17 May 2022 17:32:04 +0100 -Subject: [PATCH 0972/1050] drm/vc4: Correct HDMI timing registers for - interlaced modes - -For interlaced modes the timings were not being correctly -programmed into the HDMI block, so correct them. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index e54aff882a3c..b8fb80f3c7cb 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1242,13 +1242,13 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, - VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay, - VC5_HDMI_VERTA_VFP) | - VC4_SET_FIELD(mode->crtc_vdisplay, VC5_HDMI_VERTA_VAL)); -- u32 vertb = (VC4_SET_FIELD(0, VC5_HDMI_VERTB_VSPO) | -- VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end + -- interlaced, -+ u32 vertb = (VC4_SET_FIELD(mode->htotal >> (2 - pixel_rep), -+ VC5_HDMI_VERTB_VSPO) | -+ VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end, - VC4_HDMI_VERTB_VBP)); - u32 vertb_even = (VC4_SET_FIELD(0, VC5_HDMI_VERTB_VSPO) | - VC4_SET_FIELD(mode->crtc_vtotal - -- mode->crtc_vsync_end, -+ mode->crtc_vsync_end - interlaced, - VC4_HDMI_VERTB_VBP)); - unsigned long flags; - unsigned char gcp; --- -2.18.4 - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson Date: Tue, 17 May 2022 17:34:11 +0100 -Subject: [PATCH 0973/1050] drm/vc4: Move pixel doubling from Pixelvalve to +Subject: [PATCH 0954/1183] drm/vc4: Move pixel doubling from Pixelvalve to HDMI block With the change to 2 pixels/clock, the pixel doubling in the PV @@ -283713,7 +282533,7 @@ index f10f98dc927f..f11b824d1ab5 100644 vc4_encoder->type == VC4_ENCODER_TYPE_DSI1); bool is_dsi1 = vc4_encoder->type == VC4_ENCODER_TYPE_DSI1; diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index b8fb80f3c7cb..ed5c21eab117 100644 +index eaaf55292914..61159996ed91 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -87,6 +87,8 @@ @@ -283792,7 +282612,7 @@ index b8fb80f3c7cb..ed5c21eab117 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Manivannan Sadhasivam Date: Mon, 20 Dec 2021 00:09:47 +0200 -Subject: [PATCH 0974/1050] dt-bindings: media: i2c: Add IMX296 CMOS sensor +Subject: [PATCH 0955/1183] dt-bindings: media: i2c: Add IMX296 CMOS sensor binding Add YAML devicetree binding for IMX296 CMOS image sensor. Let's also @@ -283934,7 +282754,7 @@ index ca65f8656693..00bf77ac8ba2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 20 Dec 2021 00:09:48 +0200 -Subject: [PATCH 0975/1050] media: i2c: IMX296 camera sensor driver +Subject: [PATCH 0956/1183] media: i2c: IMX296 camera sensor driver The IMX296LLR is a monochrome 1.60MP CMOS sensor from Sony. The driver supports cropping and binning (but not both at the same time due to @@ -285212,7 +284032,7 @@ index 000000000000..4be03180deac From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 17 May 2022 11:27:49 +0100 -Subject: [PATCH 0976/1050] overlays: Add imx296 overlay +Subject: [PATCH 0957/1183] overlays: Add imx296 overlay Add an overlay for the Sony IMX296 camera sensor. @@ -285378,7 +284198,7 @@ index 000000000000..85b6f7e7fca1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 20 May 2022 11:58:21 +0100 -Subject: [PATCH 0977/1050] configs: Enable the IMX296 device module in +Subject: [PATCH 0958/1183] configs: Enable the IMX296 device module in platform defconfig Build this module by default for the following: @@ -285463,7 +284283,7 @@ index 95885c250f30..e456d05c8116 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 17 May 2022 12:58:37 +0100 -Subject: [PATCH 0978/1050] media: imx296: Fix Bayer order +Subject: [PATCH 0959/1183] media: imx296: Fix Bayer order Switch the Bayer ordering advertised by the device driver from BGGR to RGGB. @@ -285501,7 +284321,7 @@ index 4be03180deac..33944155a6ce 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 20 May 2022 09:55:42 +0100 -Subject: [PATCH 0979/1050] media: imx296: Add standby and stream on/off delays +Subject: [PATCH 0960/1183] media: imx296: Add standby and stream on/off delays Add a 1.5ms delay after coming out of standby. Add a 2ms delay after going into or coming out of streaming state. @@ -285561,7 +284381,7 @@ index 33944155a6ce..c0da6f841d8f 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 20 May 2022 09:56:11 +0100 -Subject: [PATCH 0980/1050] media: imx296: Only advertise the full resolution +Subject: [PATCH 0961/1183] media: imx296: Only advertise the full resolution mode The 1/4 resolution derived mode does not stream correctly, so remove it from @@ -285592,7 +284412,7 @@ index c0da6f841d8f..c565f319be94 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 20 May 2022 11:33:11 +0100 -Subject: [PATCH 0981/1050] media: imx296: Add horizontal and vertical flips +Subject: [PATCH 0962/1183] media: imx296: Add horizontal and vertical flips support Add support for hflip and vflip controls. Adjust the mbus_code value reported @@ -285752,7 +284572,7 @@ index c565f319be94..21133bf8b685 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 20 May 2022 11:50:24 +0100 -Subject: [PATCH 0982/1050] media: imx296: Adjust exposure limits on vblank +Subject: [PATCH 0963/1183] media: imx296: Adjust exposure limits on vblank changes The exposure lines control limits are adjusted appropriately during any change @@ -285830,7 +284650,7 @@ index 21133bf8b685..aaebf26d1a5b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 20 May 2022 12:05:33 +0100 -Subject: [PATCH 0983/1050] media: imx296: Set gain delay to 1 frame +Subject: [PATCH 0964/1183] media: imx296: Set gain delay to 1 frame In order to behave in a similar manner to the rolling shutter sensors, set the gain delay to 1 frame. This simplifies userland control of the gain value. @@ -285860,7 +284680,7 @@ index aaebf26d1a5b..64d46badbee7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 20 May 2022 13:18:58 +0100 -Subject: [PATCH 0984/1050] media: imx296: Add the link frequency control +Subject: [PATCH 0965/1183] media: imx296: Add the link frequency control Add the V4L2_CID_LINK_FREQ menu control for the imx296. Report a single value of 1188 Mhz for the link frequency. @@ -285912,7 +284732,7 @@ index 64d46badbee7..c1e71ae0442d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Lawrence Date: Sat, 21 May 2022 20:36:52 -0400 -Subject: [PATCH 0985/1050] configs: add RV8803 RTC module to Raspberry Pi +Subject: [PATCH 0966/1183] configs: add RV8803 RTC module to Raspberry Pi board defconfigs --- @@ -285990,7 +284810,7 @@ index e456d05c8116..092e7b6b100b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Lawrence Date: Sat, 21 May 2022 20:38:21 -0400 -Subject: [PATCH 0986/1050] overlays: add RV8803 RTC overlay to the generic ARM +Subject: [PATCH 0967/1183] overlays: add RV8803 RTC overlay to the generic ARM RTC device tree --- @@ -286036,7 +284856,7 @@ index 7f749fc2d802..5e03764b67b0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 25 May 2022 15:57:40 +0100 -Subject: [PATCH 0987/1050] vc-sm-cma: Restore correct cache maintainance +Subject: [PATCH 0968/1183] vc-sm-cma: Restore correct cache maintainance operations We have been using the more expensive flush operations rather than @@ -286074,7 +284894,7 @@ index 82a9c6e7f277..268f97ee8673 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 17 May 2022 12:46:42 +0100 -Subject: [PATCH 0988/1050] kms/vc4_hdmi: Refuse 4096x2160@60 hdmi modes +Subject: [PATCH 0969/1183] kms/vc4_hdmi: Refuse 4096x2160@60 hdmi modes These are no reliable without overclocking. See: https://github.com/raspberrypi/linux/issues/5034 @@ -286104,7 +284924,7 @@ index 0f600a35f09f..4a8940ca91df 100644 struct vc4_plane { diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index ed5c21eab117..5d37cd0741b6 100644 +index 61159996ed91..678d2e543c0d 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1822,6 +1822,7 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, @@ -286179,7 +284999,7 @@ index 8969d233d753..b0acdff916b8 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 3 Jun 2022 21:55:22 +0100 -Subject: [PATCH 0989/1050] overlays: Document the rv8803 i2c-rtc parameter +Subject: [PATCH 0970/1183] overlays: Document the rv8803 i2c-rtc parameter Signed-off-by: Phil Elwell --- @@ -286215,7 +285035,7 @@ index 52352b083498..e423abbd535c 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dag Bakke Date: Mon, 30 May 2022 11:57:06 +0200 -Subject: [PATCH 0990/1050] overlays: dht11: make sensor readable via hwmon +Subject: [PATCH 0971/1183] overlays: dht11: make sensor readable via hwmon Add a patch to make the sensor readable via the IIO/hwmon bridge. @@ -286275,7 +285095,7 @@ index 6feeeb402493..8b0fc6b7a3cb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Mon, 30 May 2022 10:10:37 +0100 -Subject: [PATCH 0991/1050] media: i2c: imx477: Correct minimum exposure lines +Subject: [PATCH 0972/1183] media: i2c: imx477: Correct minimum exposure lines The minimum number of exposure lines value (IMX477_EXPOSURE_MIN) was previously 20 but this is not correct. The datasheet is not completely @@ -286309,7 +285129,7 @@ index 2b4dfdd7975a..ac79c57292b3 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 1 Jun 2022 19:21:09 -0700 -Subject: [PATCH 0992/1050] arm64: Initialize jump labels before +Subject: [PATCH 0973/1183] arm64: Initialize jump labels before setup_machine_fdt() commit 73e2d827a501d48dceeb5b9b267a4cd283d6b1ae upstream. @@ -286401,7 +285221,7 @@ index be5f85b0a24d..644b7cd38e3e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 20 Apr 2022 18:08:38 +0100 -Subject: [PATCH 0993/1050] drm/v3d: Switch clock setting to new api +Subject: [PATCH 0974/1183] drm/v3d: Switch clock setting to new api Signed-off-by: Dom Cobley --- @@ -286460,7 +285280,7 @@ index 4636791617e1..a7afccc2e8eb 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 20 Apr 2022 17:40:47 +0100 -Subject: [PATCH 0994/1050] clk-raspberrypi: Enable minimize for all firmware +Subject: [PATCH 0975/1183] clk-raspberrypi: Enable minimize for all firmware clocks Signed-off-by: Dom Cobley @@ -286469,7 +285289,7 @@ Signed-off-by: Dom Cobley 1 file changed, 5 insertions(+) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c -index 10226a6f5a4b..c782843d07ac 100644 +index 4abecd6f528d..18aac870f159 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c @@ -130,18 +130,23 @@ raspberrypi_clk_variants[RPI_FIRMWARE_NUM_CLK_ID] = { @@ -286503,7 +285323,7 @@ index 10226a6f5a4b..c782843d07ac 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Aug 2021 08:57:48 +0100 -Subject: [PATCH 0995/1050] ARM: dts: Add bcm2709-rpi-cm2.dts +Subject: [PATCH 0976/1183] ARM: dts: Add bcm2709-rpi-cm2.dts Compute Module 2 is a CM3 with a 2836. The DTS file reflects that. @@ -286515,7 +285335,7 @@ Signed-off-by: Phil Elwell create mode 100644 arch/arm/boot/dts/bcm2709-rpi-cm2.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index f9acf5c4a59b..9ccee6490bfb 100644 +index d7dd7b0c1fba..3dfe451bcb16 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -15,6 +15,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \ @@ -286758,7 +285578,7 @@ index 000000000000..17fd77bd5744 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 6 Jun 2022 16:03:58 +0100 -Subject: [PATCH 0996/1050] spi: bcm2835: Fix for shared interrupts +Subject: [PATCH 0977/1183] spi: bcm2835: Fix for shared interrupts BCM2711 shares an interrupt betweem 5 SPI interfaces (0, 3, 4, 5 & 6). Another interrupt is shared between SPI1, SPI2 and UART1, which also @@ -286812,7 +285632,7 @@ index 4e27135eba32..360c2c95f3b9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 3 Jun 2022 16:45:10 +0100 -Subject: [PATCH 0997/1050] drm: vc4: Fix colour order for xRGB1555 on HVS5 +Subject: [PATCH 0978/1183] drm: vc4: Fix colour order for xRGB1555 on HVS5 Same as the xRGB8888 formats, HVS5 has managed to swap the colour channels for the xRGB1555 formats as well. Add the relevant @@ -286849,7 +285669,7 @@ index d79654e2f65b..9fbff67da873 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 3 Jun 2022 16:49:09 +0100 -Subject: [PATCH 0998/1050] drm: vc4: 0 is a valid value for pixel_order_hvs5, +Subject: [PATCH 0979/1183] drm: vc4: 0 is a valid value for pixel_order_hvs5, so fix conditionals vc4_plane_mode_set for HVS5 was using pixel_order unless pixel_order_hvs5 @@ -286973,7 +285793,7 @@ index 9fbff67da873..00b2c74a44dd 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 6 Jun 2022 12:23:28 +0100 -Subject: [PATCH 0999/1050] drm: vc4: Omit pixel_order from the hvs_format for +Subject: [PATCH 0980/1183] drm: vc4: Omit pixel_order from the hvs_format for hvs5 only formats pixel_order is used for the earlier versions of the HVS, so is @@ -287033,7 +285853,7 @@ index 00b2c74a44dd..a17e2a6ecb50 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 3 Jun 2022 16:57:04 +0100 -Subject: [PATCH 1000/1050] drm: vc4: Add 3:3:2 and 4:4:4:4 RGB/RGBX/RGBA +Subject: [PATCH 0981/1183] drm: vc4: Add 3:3:2 and 4:4:4:4 RGB/RGBX/RGBA formats The hardware supports the 332 8bpp and 4:4:4:4 16bpp formats, @@ -287144,7 +285964,7 @@ index a17e2a6ecb50..849385ff9761 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 6 Jun 2022 14:53:56 +0100 -Subject: [PATCH 1001/1050] drm: vc4: Add comments for which +Subject: [PATCH 0982/1183] drm: vc4: Add comments for which HVS_PIXEL_ORDER_xxx defines apply The HVS_PIXEL_ORDER_xxx defines apply to specific HVS_PIXEL_FORMAT_xxx @@ -287186,7 +286006,7 @@ index 88e9a398758e..82b0fdabe2a0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 7 Jun 2022 13:37:38 +0100 -Subject: [PATCH 1002/1050] ARM: dts: zero-2-w: Better names for GPIOs 14 & 15 +Subject: [PATCH 0983/1183] ARM: dts: zero-2-w: Better names for GPIOs 14 & 15 GPIOs 14 and 15 are currently labelled TXD0 and RXD0, which matches comments on the schematic but 1) doesn't reflect their likely usage @@ -287222,7 +286042,7 @@ index 601b0573c7a7..c0d7bd733278 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 7 Jun 2022 14:00:37 +0100 -Subject: [PATCH 1003/1050] ARM: dts: zero-w: Better names for GPIOs 14 & 15 +Subject: [PATCH 0984/1183] ARM: dts: zero-w: Better names for GPIOs 14 & 15 GPIOs 14 and 15 are currently labelled TXD0 and RXD0, which matches comments on the schematic but 1) doesn't reflect their likely usage @@ -287258,7 +286078,7 @@ index d96a5c82e069..b49c3cb1438d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 19 May 2022 17:30:02 +0100 -Subject: [PATCH 1004/1050] vc04_services: bcm2835-codec: Set crop_height for +Subject: [PATCH 0985/1183] vc04_services: bcm2835-codec: Set crop_height for compressed formats In particular for the encoder where the CAPTURE format dictates @@ -287293,7 +286113,7 @@ index dc7c0b97fbc8..7dcb3d5aa608 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 19 May 2022 17:38:53 +0100 -Subject: [PATCH 1005/1050] vc04_services: bcm2835-codec: Set port format from +Subject: [PATCH 0986/1183] vc04_services: bcm2835-codec: Set port format from s_selection s_selection allows the crop region of an uncompressed pixel @@ -287363,7 +286183,7 @@ index 7dcb3d5aa608..6df12827713a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 1 Jun 2022 15:43:51 +0100 -Subject: [PATCH 1006/1050] drm/vc4_hdmi: Allow hotplug detect to be forced +Subject: [PATCH 0987/1183] drm/vc4_hdmi: Allow hotplug detect to be forced See: https://forum.libreelec.tv/thread/24783-tv-avr-turns-back-on-right-after-turning-them-off @@ -287386,7 +286206,7 @@ Signed-off-by: Dom Cobley 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 5d37cd0741b6..793dc56746ee 100644 +index 678d2e543c0d..03edf5cc2a58 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -40,6 +40,8 @@ @@ -287427,7 +286247,7 @@ index 5d37cd0741b6..793dc56746ee 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Fri, 13 May 2022 17:21:42 +0800 -Subject: [PATCH 1007/1050] media: dt-bindings: media: i2c: Add Arducam 64MP +Subject: [PATCH 0988/1183] media: dt-bindings: media: i2c: Add Arducam 64MP CMOS sensor binding Add YAML device tree binding for Arducam 64MP CMOS image sensor, and @@ -287587,7 +286407,7 @@ index c8219b71a017..35010235557e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Fri, 13 May 2022 17:11:35 +0800 -Subject: [PATCH 1008/1050] media: i2c: Add driver of Arducam 64MP camera +Subject: [PATCH 0989/1183] media: i2c: Add driver of Arducam 64MP camera Add a driver for the Arducam 64MP camera sensor. Whilst the sensor supports 2 or 4 CSI2 data lanes, this driver @@ -290058,7 +288878,7 @@ index 000000000000..58a1bc710819 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Wed, 18 May 2022 15:18:59 +0800 -Subject: [PATCH 1009/1050] media: i2c: arducam_64mp: Advertise embedded data +Subject: [PATCH 0990/1183] media: i2c: arducam_64mp: Advertise embedded data node on media pad 1 This commit updates the arducam_64mp driver to adverise support for @@ -290320,7 +289140,7 @@ index 58a1bc710819..42b777b96496 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Mon, 16 May 2022 10:03:23 +0800 -Subject: [PATCH 1010/1050] configs: Add CONFIG_VIDEO_ARDUCAM_64MP=m +Subject: [PATCH 0991/1183] configs: Add CONFIG_VIDEO_ARDUCAM_64MP=m Include the driver module for the Arducam 64MP. @@ -290400,7 +289220,7 @@ index 092e7b6b100b..7fffb6eaabb2 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lee Jackson Date: Mon, 16 May 2022 10:20:19 +0800 -Subject: [PATCH 1011/1050] overlays: Add arducam-64mp-overlay.dts +Subject: [PATCH 0992/1183] overlays: Add arducam-64mp-overlay.dts Added overlays for enabling Arducam 64MP and add the relevant information to the README. @@ -290558,7 +289378,7 @@ index 000000000000..19c8cb6e451c From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Jun 2022 11:57:30 +0100 -Subject: [PATCH 1012/1050] ARM: dts: bcm2711: Use the rpi-vid-decoder driver +Subject: [PATCH 0993/1183] ARM: dts: bcm2711: Use the rpi-vid-decoder driver The rpi-vid-decoder driver has been the preferred option for a while, so make it the default. @@ -290617,7 +289437,7 @@ index cd5c43adc56b..5b18e8f92145 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Jun 2022 12:00:32 +0100 -Subject: [PATCH 1013/1050] overlays: Delete+deprecate the rpivid-v4l2 overlay +Subject: [PATCH 0994/1183] overlays: Delete+deprecate the rpivid-v4l2 overlay Now that the rpivid-vid-decoder driver is the default, this overlay is no longer needed. @@ -290737,7 +289557,7 @@ index bdd1c0e5a915..000000000000 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Jun 2022 13:47:22 +0100 -Subject: [PATCH 1014/1050] ARM64: dts: Add Zero 2 W and CM4S +Subject: [PATCH 0995/1183] ARM64: dts: Add Zero 2 W and CM4S Zero 2 W and CM4S are 64-bit-capable, so their DTBs should be buildable in the arm64 tree. @@ -290802,7 +289622,7 @@ index 000000000000..28e0980a374b From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 21 Jun 2022 08:51:43 +0100 -Subject: [PATCH 1015/1050] configs: Enable pstore and ramoops as built-ins +Subject: [PATCH 0996/1183] configs: Enable pstore and ramoops as built-ins The pstore and ramoops modules together allow kernel crash logs to be preserved across a reboot. They have beeb configued as built-ins @@ -290915,7 +289735,7 @@ index 7fffb6eaabb2..4cf932c3c2b6 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 21 Jun 2022 08:59:53 +0100 -Subject: [PATCH 1016/1050] overlays: Add the ramoops overlay +Subject: [PATCH 0997/1183] overlays: Add the ramoops overlay The ramoops overlay enables the preservation of crash logs across a reboot. @@ -291073,7 +289893,7 @@ index 000000000000..4f3d30ef069a From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 21 Jun 2022 14:30:47 +0100 -Subject: [PATCH 1017/1050] configs: Enable the MAX7300/7301 GPIO expanders +Subject: [PATCH 0998/1183] configs: Enable the MAX7300/7301 GPIO expanders Signed-off-by: Phil Elwell --- @@ -291186,7 +290006,7 @@ index 4cf932c3c2b6..0b32007fd58e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 23 Jun 2022 15:19:58 +0100 -Subject: [PATCH 1018/1050] media: i2c: imx477: Enable sensor temperature +Subject: [PATCH 0999/1183] media: i2c: imx477: Enable sensor temperature readout Enable the internal thermal sensor which returns the temperature values through @@ -291216,7 +290036,7 @@ index ac79c57292b3..53e0656da53d 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Thu, 16 Sep 2021 14:27:41 -0700 -Subject: [PATCH 1019/1050] net: phy: broadcom: Enable 10BaseT DAC early wake +Subject: [PATCH 1000/1183] net: phy: broadcom: Enable 10BaseT DAC early wake Enable the DAC early wake when then link operates at 10BaseT allows power savings in the hundreds of milli Watts by shutting down the @@ -291430,7 +290250,7 @@ index ea2f8ea92d54..69510a74a793 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 20 Sep 2021 14:54:14 -0700 -Subject: [PATCH 1020/1050] net: phy: broadcom: Add IDDQ-SR mode +Subject: [PATCH 1001/1183] net: phy: broadcom: Add IDDQ-SR mode Add support for putting the PHY into IDDQ Soft Recovery mode by setting the TOP_MISC register bits accordingly. This requires us to implement a @@ -291571,7 +290391,7 @@ index 69510a74a793..2585e8070626 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 20 Sep 2021 14:54:15 -0700 -Subject: [PATCH 1021/1050] net: phy: broadcom: Wire suspend/resume for +Subject: [PATCH 1002/1183] net: phy: broadcom: Wire suspend/resume for BCM50610 and BCM50610M These two Ethernet PHYs support IDDQ-SR therefore wire-up the suspend @@ -291612,7 +290432,7 @@ index 1bff74e9b8d4..80ce421ffcd7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 20 Sep 2021 14:54:16 -0700 -Subject: [PATCH 1022/1050] net: phy: broadcom: Utilize appropriate suspend for +Subject: [PATCH 1003/1183] net: phy: broadcom: Utilize appropriate suspend for BCM54810/11 Since we enable APD and DLL/RXC/TXC disable we need to use @@ -291654,7 +290474,7 @@ index 80ce421ffcd7..7beae63d6daa 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Lemon Date: Tue, 21 Jun 2022 22:04:52 -0700 -Subject: [PATCH 1023/1050] net: phy: broadcom: Add Broadcom PTP hooks to +Subject: [PATCH 1004/1183] net: phy: broadcom: Add Broadcom PTP hooks to bcm-phy-lib Add 'struct bcm_ptp_private' to bcm54xx_phy_priv which points to @@ -291788,7 +290608,7 @@ index 7beae63d6daa..6cbd8238aeb9 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Lemon Date: Tue, 21 Jun 2022 22:04:53 -0700 -Subject: [PATCH 1024/1050] net: phy: broadcom: Add PTP support for some +Subject: [PATCH 1005/1183] net: phy: broadcom: Add PTP support for some Broadcom PHYs. This adds PTP support for BCM54210E Broadcom PHYs, in particular, @@ -292572,7 +291392,7 @@ index 000000000000..6f462c232e9e From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Lemon Date: Tue, 21 Jun 2022 22:04:54 -0700 -Subject: [PATCH 1025/1050] net: phy: Add support for 1PPS out and external +Subject: [PATCH 1006/1183] net: phy: Add support for 1PPS out and external timestamps The perout function is used to generate a 1PPS signal, synchronized @@ -292893,7 +291713,7 @@ index 6f462c232e9e..ef00d6163061 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Lemon Date: Fri, 29 Apr 2022 17:40:11 -0700 -Subject: [PATCH 1026/1050] Add PHY_ID_BCM54213PE identifier. +Subject: [PATCH 1007/1183] Add PHY_ID_BCM54213PE identifier. The BCM54213PE identifier is a RPI-specific addition. Add this case to the PHY model selector. @@ -292924,7 +291744,7 @@ index ef00d6163061..08a1824d4a53 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonathan Lemon Date: Wed, 4 May 2022 14:33:05 -0700 -Subject: [PATCH 1027/1050] Populate phy driver block for BCM54213PE +Subject: [PATCH 1008/1183] Populate phy driver block for BCM54213PE The BCM54213PE identifier is a RPI-specific addition. Populate the remainder of the driver functions, including the @@ -292963,7 +291783,7 @@ index 6cbd8238aeb9..3c4035d5489a 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 27 Jun 2022 12:42:34 +0100 -Subject: [PATCH 1028/1050] configs: Rengenerate +Subject: [PATCH 1009/1183] configs: Rengenerate Signed-off-by: Dom Cobley --- @@ -293041,7 +291861,7 @@ index 0b32007fd58e..a70aa7cac783 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 27 Jun 2022 12:43:12 +0100 -Subject: [PATCH 1029/1050] config: Enable CONFIG_NETWORK_PHY_TIMESTAMPIN on +Subject: [PATCH 1010/1183] config: Enable CONFIG_NETWORK_PHY_TIMESTAMPIN on 2711 See: https://github.com/raspberrypi/linux/issues/4151 @@ -293083,7 +291903,7 @@ index e29836af6e48..1690de23a254 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 1 Jul 2022 15:51:49 +0100 -Subject: [PATCH 1030/1050] drm/vc4: Correct interlaced timings again +Subject: [PATCH 1011/1183] drm/vc4: Correct interlaced timings again The back porch timings were correct, only the sync offset was wrong. Correct timing is now reported for 1080i and 576i, but the h offset is @@ -293096,7 +291916,7 @@ Signed-off-by: Dave Stevenson 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 793dc56746ee..7e649446153b 100644 +index 03edf5cc2a58..4bb97d4ea2c1 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1260,11 +1260,12 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, @@ -293121,7 +291941,7 @@ index 793dc56746ee..7e649446153b 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 4 Jul 2022 11:48:57 +0100 -Subject: [PATCH 1031/1050] media: dt-bindings: imx258: Add alternate +Subject: [PATCH 1012/1183] media: dt-bindings: imx258: Add alternate compatible strings There are a number of variants of the imx258 modules that can not @@ -293157,7 +291977,7 @@ index cde0f7383b2a..3fc30a79c538 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 21 Jun 2022 14:55:41 +0100 -Subject: [PATCH 1032/1050] media: i2c: imx258: Change register settings for +Subject: [PATCH 1013/1183] media: i2c: imx258: Change register settings for variants of the sensor Sony have advised that there are variants of the IMX258 sensor which @@ -293341,7 +292161,7 @@ index 63692f75c641..55f82571421e 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 4 Jul 2022 11:50:18 +0100 -Subject: [PATCH 1033/1050] dtoverlays: Use PDAF variant for imx258 overlay +Subject: [PATCH 1014/1183] dtoverlays: Use PDAF variant for imx258 overlay There are a number of variants of the imx258 sensor. The only version that is currently made into a module for use with the Pi @@ -293375,7 +292195,7 @@ index 7a8ed540438e..3cefd59663a0 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 5 Jul 2022 09:04:55 +0100 -Subject: [PATCH 1034/1050] staging: vc04_services: Fix clang14 warning +Subject: [PATCH 1015/1183] staging: vc04_services: Fix clang14 warning Insert a break to fix a fallthrough warning from clang14. Since the fallthrough was to another break, this is a cosmetic change. @@ -293407,7 +292227,7 @@ index 122f2f66096f..dc0829b483ec 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 5 Jul 2022 17:00:50 +0100 -Subject: [PATCH 1035/1050] overlays: Support i2c3-6 in container overlays +Subject: [PATCH 1016/1183] overlays: Support i2c3-6 in container overlays The I2C container overlays (i2c-rtc, i2c-fan and now i2c-sensor) take parameters to select which I2C bus to use. Extend the list of @@ -294249,7 +293069,7 @@ index 33965be4b1e8..f8a39659d83e 100755 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 6 Jul 2022 08:43:27 +0100 -Subject: [PATCH 1036/1050] overlays: README: i2c3-6 are BCM2711 only +Subject: [PATCH 1017/1183] overlays: README: i2c3-6 are BCM2711 only State clearly that the i2c3, i2c4, i2c5 and i2c6 are only for BCM2711. @@ -294332,7 +293152,7 @@ index a7300ac76ce9..08e499900e26 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 4 Jul 2022 18:10:23 +0100 -Subject: [PATCH 1037/1050] media: i2c: ov9281: Correct min/def vts for 640x400 +Subject: [PATCH 1018/1183] media: i2c: ov9281: Correct min/def vts for 640x400 A VTS of 421 in the 640x400 mode only streams at 130.2fps instead of the expected ~261fps. This appears to be an invalid @@ -294365,7 +293185,7 @@ index 0a5f9e0927ae..2fb40e63c585 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 4 Jul 2022 18:12:56 +0100 -Subject: [PATCH 1038/1050] media: i2c: ov9281: Change exposure default value +Subject: [PATCH 1019/1183] media: i2c: ov9281: Change exposure default value with mode choice When the exposure range is updated due to changing VBLANK, adopt @@ -294400,7 +293220,7 @@ index 2fb40e63c585..552b65847953 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Julianno Francisco do Canto Silva Date: Mon, 11 Jul 2022 16:38:57 -0300 -Subject: [PATCH 1039/1050] Overlay for GalaxyCore GC9A01 displays (#5086) +Subject: [PATCH 1020/1183] Overlay for GalaxyCore GC9A01 displays (#5086) This includes an overlay for easy use of displays based on GalaxyCore's GC9A01 single chip driver, attaching them on `spi0` as `fb1` framebuffer. --- @@ -294619,7 +293439,7 @@ index 000000000000..f1bcd1aeffad From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 13 Jul 2022 09:35:12 +0100 -Subject: [PATCH 1040/1050] rpi-simple-soundcard: Add Dion Audio KIWI streamer +Subject: [PATCH 1021/1183] rpi-simple-soundcard: Add Dion Audio KIWI streamer Signed-off-by: Miquel Blauw --- @@ -294674,7 +293494,7 @@ index c25351e6ee90..5f754afb7f79 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 13 Jul 2022 09:37:38 +0100 -Subject: [PATCH 1041/1050] overlays: Add dionaudio-kiwi +Subject: [PATCH 1022/1183] overlays: Add dionaudio-kiwi Add support for the Dion Audio KIWI streamer. @@ -294767,7 +293587,7 @@ index 000000000000..128ef54eb89f From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Wed, 13 Jul 2022 18:00:21 +0200 -Subject: [PATCH 1042/1050] pinctrl: bcm2835: drop irq_enable/disable callbacks +Subject: [PATCH 1023/1183] pinctrl: bcm2835: drop irq_enable/disable callbacks commit db1b3ecee9dbb010f0ac951e3953167f5e088c6f upstream. @@ -294828,7 +293648,7 @@ index fc2cc1966041..822e37fc9483 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 15 Jul 2022 11:36:25 +0100 -Subject: [PATCH 1043/1050] ARM: dts: Enable USB by default on CM4S +Subject: [PATCH 1024/1183] ARM: dts: Enable USB by default on CM4S Signed-off-by: Phil Elwell --- @@ -294863,7 +293683,7 @@ index 30068ca41d0e..03c6a5e29284 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 19 Jul 2022 08:46:14 +0100 -Subject: [PATCH 1044/1050] Revert "ext4: make mb_optimize_scan performance +Subject: [PATCH 1025/1183] Revert "ext4: make mb_optimize_scan performance mount option work with extents" This reverts commit 3c65b7309d2e0dd8d134e7813cd95debd91ea07b. @@ -294879,7 +293699,7 @@ Signed-off-by: Phil Elwell 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c -index ad78bddfb637..49a095ec1014 100644 +index 0c7498a59943..094bda1fac90 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1000,7 +1000,7 @@ static inline int should_optimize_scan(struct ext4_allocation_context *ac) @@ -294898,7 +293718,7 @@ index ad78bddfb637..49a095ec1014 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 19 Jul 2022 13:15:00 +0100 -Subject: [PATCH 1045/1050] dtoverlays: Add nohdmi options to vc4-kms-v3d +Subject: [PATCH 1026/1183] dtoverlays: Add nohdmi options to vc4-kms-v3d overlays There are cases where hotplug detect is incorrectly wired @@ -294969,7 +293789,7 @@ index 76229cad7803..39df2133b3ee 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 20 Jul 2022 14:53:42 +0100 -Subject: [PATCH 1046/1050] configs: Enable IIO software trigger modules +Subject: [PATCH 1027/1183] configs: Enable IIO software trigger modules See: https://github.com/raspberrypi/linux/issues/4984 @@ -295099,7 +293919,7 @@ index a70aa7cac783..9787988e3d45 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 21 Jul 2022 10:02:09 +0100 -Subject: [PATCH 1047/1050] configs: Enable IP_VS_IPV6 (for loadbalancing) +Subject: [PATCH 1028/1183] configs: Enable IP_VS_IPV6 (for loadbalancing) The Raspberry Pi defconfigs enable suport for IP Virtual Servers with many of the optional features, but for some reason exclude the IPV6 @@ -295185,7 +294005,7 @@ index 9787988e3d45..c99d210e79ce 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 21 Jul 2022 11:32:08 +0100 -Subject: [PATCH 1048/1050] configs: Enable CEPH_FS=m +Subject: [PATCH 1029/1183] configs: Enable CEPH_FS=m Add support for the CEPH distributed filesystem. @@ -295267,7 +294087,7 @@ index c99d210e79ce..786840551d70 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 21 Jul 2022 18:15:33 +0100 -Subject: [PATCH 1049/1050] overlays: Make more overlays runtime-capable +Subject: [PATCH 1030/1183] overlays: Make more overlays runtime-capable The kernel now rejects the creation of a DT node with the same name as an existing node, so take care not to do that. @@ -295642,7 +294462,7 @@ index 986d725a2652..64163bf932b7 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 22 Jul 2022 14:20:49 +0100 -Subject: [PATCH 1050/1050] overlays: Mark more overlays as Pi4-specific +Subject: [PATCH 1031/1183] overlays: Mark more overlays as Pi4-specific Signed-off-by: Phil Elwell --- @@ -295688,3 +294508,16919 @@ index 3944b0c30986..df63a1793b42 100644 -- 2.18.4 + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Joerg Schambacher +Date: Thu, 4 Aug 2022 12:31:17 +0200 +Subject: [PATCH 1032/1183] overlays:Adds HiFiBerry AMP3 + +Adds AMP3 board definitions. + +Signed-off-by: Joerg Schambacher +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 ++ + .../dts/overlays/hifiberry-amp3-overlay.dts | 57 +++++++++++++++++++ + 3 files changed, 64 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/hifiberry-amp3-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index e73249383d7a..f5120cce577b 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -75,6 +75,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + hdmi-backlight-hwhack-gpio.dtbo \ + hifiberry-amp.dtbo \ + hifiberry-amp100.dtbo \ ++ hifiberry-amp3.dtbo \ + hifiberry-dac.dtbo \ + hifiberry-dacplus.dtbo \ + hifiberry-dacplusadc.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index d9301e206e3d..d238957215ea 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -1408,6 +1408,12 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec + Will be overwritten by ALSA user settings. + + ++Name: hifiberry-amp3 ++Info: Configures the HifiBerry Amp3 audio card ++Load: dtoverlay=hifiberry-amp3 ++Params: ++ ++ + Name: hifiberry-dac + Info: Configures the HifiBerry DAC audio cards + Load: dtoverlay=hifiberry-dac +diff --git a/arch/arm/boot/dts/overlays/hifiberry-amp3-overlay.dts b/arch/arm/boot/dts/overlays/hifiberry-amp3-overlay.dts +new file mode 100644 +index 000000000000..a01e263a133b +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/hifiberry-amp3-overlay.dts +@@ -0,0 +1,57 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++// Definitions for HiFiBerry's Amp3 ++/dts-v1/; ++/plugin/; ++#include ++#include ++ ++ ++/ { ++ compatible = "brcm,bcm2835"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ hifiberry_amp3_pins: hifiberry_amp3_pins { ++ brcm,pins = <23 17>; ++ brcm,function = <0 1>; ++ brcm,pull = <2 1>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ hifiberry_amp2: ma120x0p@20 { ++ #sound-dai-cells = <0>; ++ compatible = "ma,ma120x0p"; ++ reg = <0x20>; ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hifiberry_amp3_pins>; ++ error_gp-gpios = <&gpio 23 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "hifiberry,hifiberry-amp3"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++}; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Joerg Schambacher +Date: Thu, 4 Aug 2022 15:15:09 +0200 +Subject: [PATCH 1033/1183] rpi-simple-soundcard: adds definitions for the + HiFiBerry AMP3 card + +Uses Infineon MA120x0 amplifier and supports full sample rate of 192ksps. + +Signed-off-by: Joerg Schambacher +--- + sound/soc/bcm/rpi-simple-soundcard.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/sound/soc/bcm/rpi-simple-soundcard.c b/sound/soc/bcm/rpi-simple-soundcard.c +index 5f754afb7f79..fd1e42956066 100644 +--- a/sound/soc/bcm/rpi-simple-soundcard.c ++++ b/sound/soc/bcm/rpi-simple-soundcard.c +@@ -253,6 +253,28 @@ static struct snd_rpi_simple_drvdata drvdata_hifiberry_amp = { + .fixed_bclk_ratio = 64, + }; + ++SND_SOC_DAILINK_DEFS(hifiberry_amp3, ++ DAILINK_COMP_ARRAY(COMP_EMPTY()), ++ DAILINK_COMP_ARRAY(COMP_CODEC("ma120x0p.1-0020", "ma120x0p-amp")), ++ DAILINK_COMP_ARRAY(COMP_EMPTY())); ++ ++static struct snd_soc_dai_link snd_hifiberry_amp3_dai[] = { ++ { ++ .name = "HifiberryAmp3", ++ .stream_name = "Hifiberry Amp3", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ SND_SOC_DAILINK_REG(hifiberry_amp3), ++ }, ++}; ++ ++static struct snd_rpi_simple_drvdata drvdata_hifiberry_amp3 = { ++ .card_name = "snd_rpi_hifiberry_amp3", ++ .dai = snd_hifiberry_amp3_dai, ++ .fixed_bclk_ratio = 64, ++}; ++ + SND_SOC_DAILINK_DEFS(hifiberry_dac, + DAILINK_COMP_ARRAY(COMP_EMPTY()), + DAILINK_COMP_ARRAY(COMP_CODEC("pcm5102a-codec", "pcm5102a-hifi")), +@@ -370,6 +392,8 @@ static const struct of_device_id snd_rpi_simple_of_match[] = { + .data = (void *) &drvdata_hifiberrydacplusdsp }, + { .compatible = "hifiberry,hifiberry-amp", + .data = (void *) &drvdata_hifiberry_amp }, ++ { .compatible = "hifiberry,hifiberry-amp3", ++ .data = (void *) &drvdata_hifiberry_amp3 }, + { .compatible = "hifiberry,hifiberry-dac", + .data = (void *) &drvdata_hifiberry_dac }, + { .compatible = "dionaudio,dionaudio-kiwi", +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Naushir Patuck +Date: Mon, 8 Aug 2022 10:01:41 +0100 +Subject: [PATCH 1034/1183] media: bcm2835-unicam: Correctly handle FS + FE ISR + condtion + +If we get a simultaneous FS + FE interrupt for the same frame, it cannot be +marked as completed and returned to userland as the framebuffer will be refilled +by Unicam on the next sensor frame. Additionally, the timestamp will be set to 0 +as the FS interrupt handling code will not have run yet. + +To avoid these problems, the frame is considered dropped in the FE handler, +and will be returned to userland on the subsequent sensor frame. + +Signed-off-by: Naushir Patuck +--- + .../media/platform/bcm2835/bcm2835-unicam.c | 28 +++++++++++++------ + 1 file changed, 20 insertions(+), 8 deletions(-) + +diff --git a/drivers/media/platform/bcm2835/bcm2835-unicam.c b/drivers/media/platform/bcm2835/bcm2835-unicam.c +index 401d2c4d734f..cad7f018b221 100644 +--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c ++++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c +@@ -920,7 +920,9 @@ static irqreturn_t unicam_isr(int irq, void *dev) + * to use. + */ + for (i = 0; i < ARRAY_SIZE(unicam->node); i++) { +- if (!unicam->node[i].streaming) ++ struct unicam_node *node = &unicam->node[i]; ++ ++ if (!node->streaming) + continue; + + /* +@@ -930,14 +932,24 @@ static irqreturn_t unicam_isr(int irq, void *dev) + * + FS + LS). In this case, we cannot signal the buffer + * as complete, as the HW will reuse that buffer. + */ +- if (unicam->node[i].cur_frm && +- unicam->node[i].cur_frm != unicam->node[i].next_frm) { +- unicam_process_buffer_complete(&unicam->node[i], +- sequence); +- unicam->node[i].cur_frm = unicam->node[i].next_frm; +- unicam->node[i].next_frm = NULL; ++ if (node->cur_frm && node->cur_frm != node->next_frm) { ++ /* ++ * This condition checks if FE + FS for the same ++ * frame has occurred. In such cases, we cannot ++ * return out the frame, as no buffer handling ++ * or timestamping has yet been done as part of ++ * the FS handler. ++ */ ++ if (!node->cur_frm->vb.vb2_buf.timestamp) { ++ unicam_dbg(2, unicam, "ISR: FE without FS, dropping frame\n"); ++ continue; ++ } ++ ++ unicam_process_buffer_complete(node, sequence); ++ node->cur_frm = node->next_frm; ++ node->next_frm = NULL; + } else { +- unicam->node[i].cur_frm = unicam->node[i].next_frm; ++ node->cur_frm = node->next_frm; + } + } + unicam->sequence++; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 29 Jul 2022 17:46:49 +0100 +Subject: [PATCH 1035/1183] media: video-mux: Read CSI2 config from FW, and + pass to receiver + +There is no obligation for all source devices on a video-mux to +require the same bus configuration, so read the configuration +from the sink ports, and relay via get_mbus_config on the source +port. +If the sources support get_mbus_config, then call that first. + +Signed-off-by: Dave Stevenson +--- + drivers/media/platform/video-mux.c | 71 +++++++++++++++++++++++++++++- + 1 file changed, 69 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/platform/video-mux.c b/drivers/media/platform/video-mux.c +index 905005e271ca..dd03e6229d2c 100644 +--- a/drivers/media/platform/video-mux.c ++++ b/drivers/media/platform/video-mux.c +@@ -20,11 +20,28 @@ + #include + #include + ++struct video_mux_asd { ++ struct v4l2_async_subdev base; ++ unsigned int port; ++}; ++ ++static inline struct video_mux_asd *to_video_mux_asd(struct v4l2_async_subdev *asd) ++{ ++ return container_of(asd, struct video_mux_asd, base); ++} ++ ++struct video_mux_pad_cfg { ++ unsigned int num_lanes; ++ bool non_continuous; ++ struct v4l2_subdev *source; ++}; ++ + struct video_mux { + struct v4l2_subdev subdev; + struct v4l2_async_notifier notifier; + struct media_pad *pads; + struct v4l2_mbus_framefmt *format_mbus; ++ struct video_mux_pad_cfg *cfg; + struct mux_control *mux; + struct mutex lock; + int active; +@@ -330,10 +347,37 @@ static int video_mux_init_cfg(struct v4l2_subdev *sd, + return 0; + } + ++static int video_mux_get_mbus_config(struct v4l2_subdev *sd, ++ unsigned int pad, ++ struct v4l2_mbus_config *cfg) ++{ ++ struct video_mux *vmux = v4l2_subdev_to_video_mux(sd); ++ const u32 mask = V4L2_MBUS_CSI2_LANE_MASK; ++ int ret; ++ ++ ret = v4l2_subdev_call(vmux->cfg[vmux->active].source, pad, get_mbus_config, ++ 0, cfg); ++ ++ if (ret != -ENOIOCTLCMD) ++ return ret; ++ ++ cfg->type = V4L2_MBUS_CSI2_DPHY; ++ cfg->flags = (vmux->cfg[vmux->active].num_lanes << __ffs(mask)) & mask; ++ ++ /* Support for non-continuous CSI-2 clock is missing in pdate mode */ ++ if (vmux->cfg[vmux->active].non_continuous) ++ cfg->flags |= V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK; ++ else ++ cfg->flags |= V4L2_MBUS_CSI2_CONTINUOUS_CLOCK; ++ ++ return 0; ++}; ++ + static const struct v4l2_subdev_pad_ops video_mux_pad_ops = { + .init_cfg = video_mux_init_cfg, + .get_fmt = video_mux_get_format, + .set_fmt = video_mux_set_format, ++ .get_mbus_config = video_mux_get_mbus_config, + }; + + static const struct v4l2_subdev_ops video_mux_subdev_ops = { +@@ -346,6 +390,9 @@ static int video_mux_notify_bound(struct v4l2_async_notifier *notifier, + struct v4l2_async_subdev *asd) + { + struct video_mux *vmux = notifier_to_video_mux(notifier); ++ unsigned int port = to_video_mux_asd(asd)->port; ++ ++ vmux->cfg[port].source = sd; + + return v4l2_create_fwnode_links(sd, &vmux->subdev); + } +@@ -363,7 +410,7 @@ static int video_mux_async_register(struct video_mux *vmux, + v4l2_async_notifier_init(&vmux->notifier); + + for (i = 0; i < num_input_pads; i++) { +- struct v4l2_async_subdev *asd; ++ struct video_mux_asd *asd; + struct fwnode_handle *ep, *remote_ep; + + ep = fwnode_graph_get_endpoint_by_id( +@@ -381,7 +428,8 @@ static int video_mux_async_register(struct video_mux *vmux, + fwnode_handle_put(remote_ep); + + asd = v4l2_async_notifier_add_fwnode_remote_subdev( +- &vmux->notifier, ep, struct v4l2_async_subdev); ++ &vmux->notifier, ep, struct video_mux_asd); ++ asd->port = i; + + fwnode_handle_put(ep); + +@@ -407,6 +455,9 @@ static int video_mux_probe(struct platform_device *pdev) + { + struct device_node *np = pdev->dev.of_node; + struct device *dev = &pdev->dev; ++ struct v4l2_fwnode_endpoint fwnode_ep = { ++ .bus_type = V4L2_MBUS_CSI2_DPHY ++ }; + struct device_node *ep; + struct video_mux *vmux; + unsigned int num_pads = 0; +@@ -461,10 +512,26 @@ static int video_mux_probe(struct platform_device *pdev) + if (!vmux->format_mbus) + return -ENOMEM; + ++ vmux->cfg = devm_kcalloc(dev, num_pads, sizeof(*vmux->cfg), GFP_KERNEL); ++ if (!vmux->cfg) ++ return -ENOMEM; ++ + for (i = 0; i < num_pads; i++) { + vmux->pads[i].flags = (i < num_pads - 1) ? MEDIA_PAD_FL_SINK + : MEDIA_PAD_FL_SOURCE; + vmux->format_mbus[i] = video_mux_format_mbus_default; ++ ++ ep = of_graph_get_endpoint_by_regs(pdev->dev.of_node, i, 0); ++ if (ep) { ++ ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &fwnode_ep); ++ if (!ret) { ++ /* Get number of data lanes */ ++ vmux->cfg[i].num_lanes = fwnode_ep.bus.mipi_csi2.num_data_lanes; ++ vmux->cfg[i].non_continuous = fwnode_ep.bus.mipi_csi2.flags & ++ V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK; ++ } ++ of_node_put(ep); ++ } + } + + vmux->subdev.entity.function = MEDIA_ENT_F_VID_MUX; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 8 Aug 2022 17:12:45 +0100 +Subject: [PATCH 1036/1183] media: i2c: imx290: Add compatible strings for + IMX327 and IMX462 + +IMX327 is the previous generation to IMX290, and supports up to 1080p60 +as 10 or 12 bit. +IMX290 adds 1080p120 in 10 bit mode. +IMX462 adds 1080p120 in both 10 and 12 bit modes. + +Add compatible strings for all variants. + +Signed-off-by: Dave Stevenson +--- + drivers/media/i2c/imx290.c | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c +index a6f4ba5b9345..c5abef46ed5d 100644 +--- a/drivers/media/i2c/imx290.c ++++ b/drivers/media/i2c/imx290.c +@@ -1,10 +1,14 @@ + // SPDX-License-Identifier: GPL-2.0 + /* +- * Sony IMX290 & IMX327 CMOS Image Sensor Driver ++ * Sony IMX462 / IMX290 / IMX327 CMOS Image Sensor Driver ++ * ++ * The IMX462, IMX290,and IMX327 are very similar 1920x1080 1/2.8 CMOS image ++ * sensors. ++ * IMX327 can support up to 60fps with 10 or 12bit readout. ++ * IMX290 adds support for 120fps, but only 10bit and when connected over 4 ++ * CSI-2 lanes. ++ * IMX462 adds support for 120fps in both 10 and 12bit readout modes. + * +- * The IMX290 and IMX327 are very similar 1920x1080 1/2.8 CMOS image sensors. +- * IMX327 can support up to 60fps, whilst IMX290 can support up to 120fps, but +- * only 10bit and when connected over 4 CSI-2 lanes. + * The modules don't appear to have a mechanism to identify whether the mono or + * colour variant is connected, therefore it is done via compatible string. + * +@@ -1232,8 +1236,19 @@ static s64 imx290_check_link_freqs(const struct imx290 *imx290, + } + + static const struct of_device_id imx290_of_match[] = { ++ /* ++ * imx327 supports 1080p60 at 10 and 12bit. ++ * imx290 adds 10bit 1080p120. ++ * imx462 adds 10 and 12bit 1080p120. ++ * This driver currently maxes out at 1080p60, which is supported by all ++ * of them, but add the compatible strings for future implementation. ++ */ ++ { .compatible = "sony,imx327", .data = imx290_colour_formats }, ++ { .compatible = "sony,imx327-mono", .data = imx290_mono_formats }, + { .compatible = "sony,imx290", .data = imx290_colour_formats }, + { .compatible = "sony,imx290-mono", .data = imx290_mono_formats }, ++ { .compatible = "sony,imx462", .data = imx290_colour_formats }, ++ { .compatible = "sony,imx462-mono", .data = imx290_mono_formats }, + { /* sentinel */ } + }; + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 8 Aug 2022 17:24:53 +0100 +Subject: [PATCH 1037/1183] dtoverlays: Add overlays for Sony IMX327 and IMX462 + image sensors + +These are currently identical to IMX290, but have slightly +different maximum frame rate capabilities. + +Add overlays for the different compatible strings. + +Signed-off-by: Dave Stevenson +--- + arch/arm/boot/dts/overlays/Makefile | 2 + + arch/arm/boot/dts/overlays/README | 49 ++++++++++++++++++- + arch/arm/boot/dts/overlays/imx327-overlay.dts | 32 ++++++++++++ + arch/arm/boot/dts/overlays/imx462-overlay.dts | 32 ++++++++++++ + 4 files changed, 113 insertions(+), 2 deletions(-) + create mode 100644 arch/arm/boot/dts/overlays/imx327-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/imx462-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index f5120cce577b..d258c90804fc 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -109,7 +109,9 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + imx258.dtbo \ + imx290.dtbo \ + imx296.dtbo \ ++ imx327.dtbo \ + imx378.dtbo \ ++ imx462.dtbo \ + imx477.dtbo \ + imx519.dtbo \ + iqaudio-codec.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index d238957215ea..49c3a72902af 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -2049,8 +2049,7 @@ Params: rotation Mounting rotation of the camera sensor (0 or + Name: imx290 + Info: Sony IMX290 camera module. + Uses Unicam 1, which is the standard camera connector on most Pi +- variants. NB This currently uses 4 CSI2 data lanes and therefore will +- only work on a CM. ++ variants. + Load: dtoverlay=imx290, + Params: 4lane Enable 4 CSI2 lanes. This requires a Compute + Module (1, 3, or 4). +@@ -2085,6 +2084,29 @@ Params: rotation Mounting rotation of the camera sensor (0 or + Compute Module (CSI0, i2c_vc, and cam0_reg). + + ++Name: imx327 ++Info: Sony IMX327 camera module. ++ Uses Unicam 1, which is the standard camera connector on most Pi ++ variants. ++Load: dtoverlay=imx327, ++Params: 4lane Enable 4 CSI2 lanes. This requires a Compute ++ Module (1, 3, or 4). ++ clock-frequency Sets the clock frequency to match that used on ++ the board. ++ Modules from Vision Components use 37.125MHz ++ (the default), whilst those from Innomaker use ++ 74.25MHz. ++ mono Denote that the module is a mono sensor. ++ orientation Sensor orientation (0 = front, 1 = rear, ++ 2 = external, default external) ++ rotation Mounting rotation of the camera sensor (0 or ++ 180, default 0) ++ media-controller Configure use of Media Controller API for ++ configuring the sensor (default on) ++ cam0 Adopt the default configuration for CAM0 on a ++ Compute Module (CSI0, i2c_vc, and cam0_reg). ++ ++ + Name: imx378 + Info: Sony IMX378 camera module. + Uses Unicam 1, which is the standard camera connector on most Pi +@@ -2100,6 +2122,29 @@ Params: rotation Mounting rotation of the camera sensor (0 or + Compute Module (CSI0, i2c_vc, and cam0_reg). + + ++Name: imx462 ++Info: Sony IMX462 camera module. ++ Uses Unicam 1, which is the standard camera connector on most Pi ++ variants. ++Load: dtoverlay=imx462, ++Params: 4lane Enable 4 CSI2 lanes. This requires a Compute ++ Module (1, 3, or 4). ++ clock-frequency Sets the clock frequency to match that used on ++ the board. ++ Modules from Vision Components use 37.125MHz ++ (the default), whilst those from Innomaker use ++ 74.25MHz. ++ mono Denote that the module is a mono sensor. ++ orientation Sensor orientation (0 = front, 1 = rear, ++ 2 = external, default external) ++ rotation Mounting rotation of the camera sensor (0 or ++ 180, default 0) ++ media-controller Configure use of Media Controller API for ++ configuring the sensor (default on) ++ cam0 Adopt the default configuration for CAM0 on a ++ Compute Module (CSI0, i2c_vc, and cam0_reg). ++ ++ + Name: imx477 + Info: Sony IMX477 camera module. + Uses Unicam 1, which is the standard camera connector on most Pi +diff --git a/arch/arm/boot/dts/overlays/imx327-overlay.dts b/arch/arm/boot/dts/overlays/imx327-overlay.dts +new file mode 100644 +index 000000000000..d01a67c5df09 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/imx327-overlay.dts +@@ -0,0 +1,32 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++// Definitions for IMX327 camera module on VC I2C bus ++/dts-v1/; ++/plugin/; ++ ++#include ++#include "imx290_327-overlay.dtsi" ++ ++/{ ++ compatible = "brcm,bcm2835"; ++ ++ // Fragment numbers deliberately high to avoid conflicts with the ++ // included imx290_327 overlay file. ++ ++ fragment@101 { ++ target = <&cam_node>; ++ __overlay__ { ++ compatible = "sony,imx327"; ++ }; ++ }; ++ ++ fragment@102 { ++ target = <&cam_node>; ++ __dormant__ { ++ compatible = "sony,imx327-mono"; ++ }; ++ }; ++ ++ __overrides__ { ++ mono = <0>, "-101+102"; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/imx462-overlay.dts b/arch/arm/boot/dts/overlays/imx462-overlay.dts +new file mode 100644 +index 000000000000..e2b54a7a9f98 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/imx462-overlay.dts +@@ -0,0 +1,32 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++// Definitions for IMX462 camera module on VC I2C bus ++/dts-v1/; ++/plugin/; ++ ++#include ++#include "imx290_327-overlay.dtsi" ++ ++/{ ++ compatible = "brcm,bcm2835"; ++ ++ // Fragment numbers deliberately high to avoid conflicts with the ++ // included imx290_327 overlay file. ++ ++ fragment@101 { ++ target = <&cam_node>; ++ __overlay__ { ++ compatible = "sony,imx462"; ++ }; ++ }; ++ ++ fragment@102 { ++ target = <&cam_node>; ++ __dormant__ { ++ compatible = "sony,imx462-mono"; ++ }; ++ }; ++ ++ __overrides__ { ++ mono = <0>, "-101+102"; ++ }; ++}; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 12 Jul 2022 13:34:56 +0100 +Subject: [PATCH 1038/1183] defconfigs: Add VIDEO_MUX to all defconfigs + +Supports camera multiplexers using the mux framework. + +Signed-off-by: Dave Stevenson +--- + 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 0267c16af7be..9d4710c2df87 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -917,6 +917,7 @@ CONFIG_RADIO_TEF6862=m + CONFIG_RADIO_WL1273=m + CONFIG_RADIO_WL128X=m + CONFIG_V4L_PLATFORM_DRIVERS=y ++CONFIG_VIDEO_MUX=m + CONFIG_VIDEO_BCM2835_UNICAM=m + CONFIG_VIDEO_UDA1342=m + CONFIG_VIDEO_SONY_BTF_MPX=m +diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig +index 446d62e8fa2b..47c3a3c94ee6 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -934,6 +934,7 @@ CONFIG_RADIO_TEF6862=m + CONFIG_RADIO_WL1273=m + CONFIG_RADIO_WL128X=m + CONFIG_V4L_PLATFORM_DRIVERS=y ++CONFIG_VIDEO_MUX=m + CONFIG_VIDEO_BCM2835_UNICAM=m + CONFIG_VIDEO_UDA1342=m + CONFIG_VIDEO_SONY_BTF_MPX=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index a7f28d4bbc0b..c62199977b7d 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -910,6 +910,7 @@ CONFIG_RADIO_TEF6862=m + CONFIG_RADIO_WL1273=m + CONFIG_RADIO_WL128X=m + CONFIG_V4L_PLATFORM_DRIVERS=y ++CONFIG_VIDEO_MUX=m + CONFIG_VIDEO_BCM2835_UNICAM=m + CONFIG_VIDEO_UDA1342=m + CONFIG_VIDEO_SONY_BTF_MPX=m +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index d36557e5a106..2c8e5e0cdab6 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -936,6 +936,7 @@ CONFIG_RADIO_TEF6862=m + CONFIG_RADIO_WL1273=m + CONFIG_RADIO_WL128X=m + CONFIG_V4L_PLATFORM_DRIVERS=y ++CONFIG_VIDEO_MUX=m + CONFIG_VIDEO_BCM2835_UNICAM=m + CONFIG_V4L_TEST_DRIVERS=y + CONFIG_VIDEO_VIMC=m +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index 786840551d70..9d3d4e6842d9 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -877,6 +877,7 @@ CONFIG_RADIO_TEF6862=m + CONFIG_RADIO_WL1273=m + CONFIG_RADIO_WL128X=m + CONFIG_V4L_PLATFORM_DRIVERS=y ++CONFIG_VIDEO_MUX=m + CONFIG_VIDEO_BCM2835_UNICAM=m + CONFIG_V4L_TEST_DRIVERS=y + CONFIG_VIDEO_VIMC=m +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 11 Jul 2022 09:23:57 +0100 +Subject: [PATCH 1039/1183] dtoverlays: Reshuffle image sensor overlays to + allow use with muxes + +There are third-party CSI-2 muxes available that ideally want to +be configured to have any of the supported image sensors. +That wants the sensor configuration to be split out into fragements +that can be included in the relevant places, and then an overall +overlay that pulls them in. + +Signed-off-by: Dave Stevenson +--- + arch/arm/boot/dts/overlays/Makefile | 2 + + arch/arm/boot/dts/overlays/README | 68 ++ + .../dts/overlays/camera-mux-2port-overlay.dts | 409 +++++++++++ + .../dts/overlays/camera-mux-4port-overlay.dts | 684 ++++++++++++++++++ + arch/arm/boot/dts/overlays/imx219-overlay.dts | 47 +- + arch/arm/boot/dts/overlays/imx219.dtsi | 27 + + arch/arm/boot/dts/overlays/imx258-overlay.dts | 141 ++-- + arch/arm/boot/dts/overlays/imx258.dtsi | 27 + + arch/arm/boot/dts/overlays/imx290-overlay.dts | 4 +- + .../boot/dts/overlays/imx290_327-overlay.dtsi | 53 +- + arch/arm/boot/dts/overlays/imx290_327.dtsi | 24 + + arch/arm/boot/dts/overlays/imx378-overlay.dts | 2 +- + arch/arm/boot/dts/overlays/imx477-overlay.dts | 2 +- + .../boot/dts/overlays/imx477_378-overlay.dtsi | 52 +- + arch/arm/boot/dts/overlays/imx477_378.dtsi | 24 + + arch/arm/boot/dts/overlays/ov2311-overlay.dts | 48 +- + arch/arm/boot/dts/overlays/ov2311.dtsi | 26 + + arch/arm/boot/dts/overlays/ov5647-overlay.dts | 48 +- + arch/arm/boot/dts/overlays/ov5647.dtsi | 25 + + arch/arm/boot/dts/overlays/ov7251-overlay.dts | 48 +- + arch/arm/boot/dts/overlays/ov7251.dtsi | 28 + + arch/arm/boot/dts/overlays/ov9281-overlay.dts | 47 +- + arch/arm/boot/dts/overlays/ov9281.dtsi | 27 + + 23 files changed, 1552 insertions(+), 311 deletions(-) + create mode 100644 arch/arm/boot/dts/overlays/camera-mux-2port-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/camera-mux-4port-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/imx219.dtsi + create mode 100644 arch/arm/boot/dts/overlays/imx258.dtsi + create mode 100644 arch/arm/boot/dts/overlays/imx290_327.dtsi + create mode 100644 arch/arm/boot/dts/overlays/imx477_378.dtsi + create mode 100644 arch/arm/boot/dts/overlays/ov2311.dtsi + create mode 100644 arch/arm/boot/dts/overlays/ov5647.dtsi + create mode 100644 arch/arm/boot/dts/overlays/ov7251.dtsi + create mode 100644 arch/arm/boot/dts/overlays/ov9281.dtsi + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index d258c90804fc..74e76db75a2c 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -34,6 +34,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + audiosense-pi.dtbo \ + audremap.dtbo \ + balena-fin.dtbo \ ++ camera-mux-2port.dtbo \ ++ camera-mux-4port.dtbo \ + cap1106.dtbo \ + chipdip-dac.dtbo \ + cma.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 49c3a72902af..309642ff5244 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -686,6 +686,74 @@ Info: This overlay is now deprecated - see i2c-sensor + Load: + + ++Name: camera-mux-2port ++Info: Configures a 2 port camera multiplexer ++ Note that currently ALL IMX290 modules share a common clock, therefore ++ all modules will need to have the same clock frequency. ++Load: dtoverlay=camera-mux-2port,= ++Params: cam0-imx219 Select IMX219 for camera on port 0 ++ cam0-imx258 Select IMX258 for camera on port 0 ++ cam0-imx290 Select IMX290 for camera on port 0 ++ cam0-imx477 Select IMX477 for camera on port 0 ++ cam0-ov2311 Select OV2311 for camera on port 0 ++ cam0-ov5647 Select OV5647 for camera on port 0 ++ cam0-ov7251 Select OV7251 for camera on port 0 ++ cam0-ov9281 Select OV9281 for camera on port 0 ++ cam0-imx290-clk-freq Set clock frequency for an IMX290 on port 0 ++ cam1-imx219 Select IMX219 for camera on port 1 ++ cam1-imx258 Select IMX258 for camera on port 1 ++ cam1-imx290 Select IMX290 for camera on port 1 ++ cam1-imx477 Select IMX477 for camera on port 1 ++ cam1-ov2311 Select OV2311 for camera on port 1 ++ cam1-ov5647 Select OV5647 for camera on port 1 ++ cam1-ov7251 Select OV7251 for camera on port 1 ++ cam1-ov9281 Select OV9281 for camera on port 1 ++ cam1-imx290-clk-freq Set clock frequency for an IMX290 on port 1 ++ ++ ++Name: camera-mux-4port ++Info: Configures a 4 port camera multiplexer ++ Note that currently ALL IMX290 modules share a common clock, therefore ++ all modules will need to have the same clock frequency. ++Load: dtoverlay=camera-mux-4port,= ++Params: cam0-imx219 Select IMX219 for camera on port 0 ++ cam0-imx258 Select IMX258 for camera on port 0 ++ cam0-imx290 Select IMX290 for camera on port 0 ++ cam0-imx477 Select IMX477 for camera on port 0 ++ cam0-ov2311 Select OV2311 for camera on port 0 ++ cam0-ov5647 Select OV5647 for camera on port 0 ++ cam0-ov7251 Select OV7251 for camera on port 0 ++ cam0-ov9281 Select OV9281 for camera on port 0 ++ cam0-imx290-clk-freq Set clock frequency for an IMX290 on port 0 ++ cam1-imx219 Select IMX219 for camera on port 1 ++ cam1-imx258 Select IMX258 for camera on port 1 ++ cam1-imx290 Select IMX290 for camera on port 1 ++ cam1-imx477 Select IMX477 for camera on port 1 ++ cam1-ov2311 Select OV2311 for camera on port 1 ++ cam1-ov5647 Select OV5647 for camera on port 1 ++ cam1-ov7251 Select OV7251 for camera on port 1 ++ cam1-ov9281 Select OV9281 for camera on port 1 ++ cam1-imx290-clk-freq Set clock frequency for an IMX290 on port 1 ++ cam2-imx219 Select IMX219 for camera on port 2 ++ cam2-imx258 Select IMX258 for camera on port 2 ++ cam2-imx290 Select IMX290 for camera on port 2 ++ cam2-imx477 Select IMX477 for camera on port 2 ++ cam2-ov2311 Select OV2311 for camera on port 2 ++ cam2-ov5647 Select OV5647 for camera on port 2 ++ cam2-ov7251 Select OV7251 for camera on port 2 ++ cam2-ov9281 Select OV9281 for camera on port 2 ++ cam2-imx290-clk-freq Set clock frequency for an IMX290 on port 2 ++ cam3-imx219 Select IMX219 for camera on port 3 ++ cam3-imx258 Select IMX258 for camera on port 3 ++ cam3-imx290 Select IMX290 for camera on port 3 ++ cam3-imx477 Select IMX477 for camera on port 3 ++ cam3-ov2311 Select OV2311 for camera on port 3 ++ cam3-ov5647 Select OV5647 for camera on port 3 ++ cam3-ov7251 Select OV7251 for camera on port 3 ++ cam3-ov9281 Select OV9281 for camera on port 3 ++ cam3-imx290-clk-freq Set clock frequency for an IMX290 on port 3 ++ ++ + Name: cap1106 + Info: Enables the ability to use the cap1106 touch sensor as a keyboard + Load: dtoverlay=cap1106,= +diff --git a/arch/arm/boot/dts/overlays/camera-mux-2port-overlay.dts b/arch/arm/boot/dts/overlays/camera-mux-2port-overlay.dts +new file mode 100644 +index 000000000000..ef24d5a7f78c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/camera-mux-2port-overlay.dts +@@ -0,0 +1,409 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++// Overlay to configure a 2 port camera multiplexer ++// ++// Configuration is based on the Arducam Doubleplexer ++// which uses a PCA9543 I2C multiplexer to handle the ++// I2C, and GPIO 4 to control the MIPI mux, and GPIO 17 ++// to enable the CSI-2 mux output (gpio-hog). ++ ++/dts-v1/; ++/plugin/; ++ ++#include ++ ++/{ ++ compatible = "brcm,bcm2835"; ++ ++ /* Fragments that complete the individual sensor fragments */ ++ /* IMX290 */ ++ fragment@0 { ++ target = <&imx290_0_ep>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ link-frequencies = ++ /bits/ 64 <445500000 297000000>; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&imx290_1_ep>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ link-frequencies = ++ /bits/ 64 <445500000 297000000>; ++ }; ++ }; ++ ++ /* IMX477 */ ++ fragment@10 { ++ target = <&imx477_0>; ++ __overlay__ { ++ compatible = "sony,imx477"; ++ }; ++ }; ++ ++ fragment@11 { ++ target = <&imx477_1>; ++ __overlay__ { ++ compatible = "sony,imx477"; ++ }; ++ }; ++ ++ /* Additional fragments affecting the mux nodes */ ++ fragment@100 { ++ target = <&mux_in0>; ++ __dormant__ { ++ data-lanes = <1>; ++ }; ++ }; ++ fragment@101 { ++ target = <&mux_in0>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ }; ++ }; ++ ++ fragment@102 { ++ target = <&mux_in1>; ++ __dormant__ { ++ data-lanes = <1>; ++ }; ++ }; ++ fragment@103 { ++ target = <&mux_in1>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ }; ++ }; ++ ++ /* Mux define */ ++ fragment@200 { ++ target = <&i2c_csi_dsi>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pca@70 { ++ reg = <0x70>; ++ compatible = "nxp,pca9543"; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ i2c@0 { ++ reg = <0>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ #define cam_node imx219_0 ++ #define cam_endpoint imx219_0_ep ++ #define cam1_clk clk_24mhz ++ #include "imx219.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx477_0 ++ #define cam_endpoint imx477_0_ep ++ #define cam1_clk clk_24mhz ++ #include "imx477_378.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov5647_0 ++ #define cam_endpoint ov5647_0_ep ++ #define cam1_clk clk_25mhz ++ #include "ov5647.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov7251_0 ++ #define cam_endpoint ov7251_0_ep ++ #define cam1_clk clk_24mhz ++ #include "ov7251.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov9281_0 ++ #define cam_endpoint ov9281_0_ep ++ #define cam1_clk clk_24mhz ++ #include "ov9281.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx258_0 ++ #define cam_endpoint imx258_0_ep ++ #define cam1_clk clk_24mhz ++ #include "imx258.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx290_0 ++ #define cam_endpoint imx290_0_ep ++ #define cam1_clk clk_imx290 ++ #include "imx290_327.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov2311_0 ++ #define cam_endpoint ov2311_0_ep ++ #define cam1_clk clk_24mhz ++ #include "ov2311.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ }; ++ ++ i2c@1 { ++ reg = <1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ #define cam_node imx219_1 ++ #define cam_endpoint imx219_1_ep ++ #define cam1_clk clk_24mhz ++ #include "imx219.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx477_1 ++ #define cam_endpoint imx477_1_ep ++ #define cam1_clk clk_24mhz ++ #include "imx477_378.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov5647_1 ++ #define cam_endpoint ov5647_1_ep ++ #define cam1_clk clk_25mhz ++ #include "ov5647.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov7251_1 ++ #define cam_endpoint ov7251_1_ep ++ #define cam1_clk clk_24mhz ++ #include "ov7251.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov9281_1 ++ #define cam_endpoint ov9281_1_ep ++ #define cam1_clk clk_24mhz ++ #include "ov9281.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx258_1 ++ #define cam_endpoint imx258_1_ep ++ #define cam1_clk clk_24mhz ++ #include "imx258.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx290_1 ++ #define cam_endpoint imx290_1_ep ++ #define cam1_clk clk_imx290 ++ #include "imx290_327.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov2311_1 ++ #define cam_endpoint ov2311_1_ep ++ #define cam1_clk clk_24mhz ++ #include "ov2311.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ }; ++ }; ++ }; ++ }; ++ ++ fragment@201 { ++ target = <&csi1>; ++ __overlay__ { ++ status = "okay"; ++ ++ brcm,media-controller; ++ ++ port { ++ csi1_ep: endpoint { ++ remote-endpoint = <&mux_out>; ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ }; ++ }; ++ }; ++ }; ++ ++ fragment@202 { ++ target = <&i2c0if>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@203 { ++ target-path="/"; ++ __overlay__ { ++ mux: mux-controller { ++ compatible = "gpio-mux"; ++ #mux-control-cells = <0>; ++ ++ mux-gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ video-mux { ++ compatible = "video-mux"; ++ mux-controls = <&mux>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ ++ mux_in0: endpoint { ++ clock-lanes = <0>; ++ }; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ ++ mux_in1: endpoint { ++ clock-lanes = <0>; ++ }; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ ++ mux_out: endpoint { ++ remote-endpoint = <&csi1_ep>; ++ clock-lanes = <0>; ++ }; ++ }; ++ }; ++ ++ clk_24mhz: clk_24mhz { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ ++ clock-frequency = <24000000>; ++ status = "okay"; ++ }; ++ ++ clk_25mhz: clk_25mhz { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ ++ clock-frequency = <25000000>; ++ status = "okay"; ++ }; ++ ++ clk_imx290: clk_imx290 { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ ++ clock-frequency = <37125000>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@204 { ++ target = <&i2c0mux>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@205 { ++ target = <&gpio>; ++ __overlay__ { ++ mipi_sw_oe_hog { ++ gpio-hog; ++ gpios = <17 GPIO_ACTIVE_LOW>; ++ output-high; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ cam0-imx219 = <&mux_in0>, "remote-endpoint:0=",<&imx219_0_ep>, ++ <&imx219_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&mux_in0>, "clock-noncontinuous?", ++ <&imx219_0>, "status=okay"; ++ cam0-imx477 = <&mux_in0>, "remote-endpoint:0=",<&imx477_0_ep>, ++ <&imx477_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&mux_in0>, "clock-noncontinuous?", ++ <&imx477_0>, "status=okay"; ++ cam0-ov5647 = <&mux_in0>, "remote-endpoint:0=",<&ov5647_0_ep>, ++ <&ov5647_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&ov5647_0>, "status=okay"; ++ cam0-ov7251 = <&mux_in0>, "remote-endpoint:0=",<&ov7251_0_ep>, ++ <&ov7251_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&ov7251_0>, "status=okay", ++ <0>,"+100-101"; ++ cam0-ov9281 = <&mux_in0>, "remote-endpoint:0=",<&ov9281_0_ep>, ++ <&ov9281_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&ov9281_0>, "status=okay"; ++ cam0-imx258 = <&mux_in0>, "remote-endpoint:0=",<&imx258_0_ep>, ++ <&imx258_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&imx258_0>, "status=okay"; ++ cam0-imx290 = <&mux_in0>, "remote-endpoint:0=",<&imx290_0_ep>, ++ <&imx290_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&imx290_0>, "status=okay"; ++ cam0-ov2311 = <&mux_in0>, "remote-endpoint:0=",<&ov2311_0_ep>, ++ <&ov2311_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&ov2311_0>, "status=okay"; ++ ++ cam1-imx219 = <&mux_in1>, "remote-endpoint:0=",<&imx219_1_ep>, ++ <&imx219_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&mux_in1>, "clock-noncontinuous?", ++ <&imx219_1>, "status=okay"; ++ cam1-imx477 = <&mux_in1>, "remote-endpoint:0=",<&imx477_1_ep>, ++ <&imx477_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&mux_in1>, "clock-noncontinuous?", ++ <&imx477_1>, "status=okay"; ++ cam1-ov5647 = <&mux_in1>, "remote-endpoint:0=",<&ov5647_1_ep>, ++ <&ov5647_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&ov5647_1>, "status=okay"; ++ cam1-ov7251 = <&mux_in1>, "remote-endpoint:0=",<&ov7251_1_ep>, ++ <&ov7251_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&ov7251_1>, "status=okay", ++ <0>,"+102-103"; ++ cam1-ov9281 = <&mux_in1>, "remote-endpoint:0=",<&ov9281_1_ep>, ++ <&ov9281_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&ov9281_1>, "status=okay"; ++ cam1-imx258 = <&mux_in1>, "remote-endpoint:0=",<&imx258_1_ep>, ++ <&imx258_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&imx258_1>, "status=okay"; ++ cam1-imx290 = <&mux_in1>, "remote-endpoint:0=",<&imx290_1_ep>, ++ <&imx290_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&imx290_1>, "status=okay"; ++ cam1-ov2311 = <&mux_in1>, "remote-endpoint:0=",<&ov2311_1_ep>, ++ <&ov2311_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&ov2311_1>, "status=okay"; ++ ++ cam0-imx290-clk-freq = <&clk_imx290>,"clock-frequency:0", ++ <&imx290_0>,"clock-frequency:0"; ++ cam1-imx290-clk-freq = <&clk_imx290>,"clock-frequency:0", ++ <&imx290_1>,"clock-frequency:0"; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/camera-mux-4port-overlay.dts b/arch/arm/boot/dts/overlays/camera-mux-4port-overlay.dts +new file mode 100644 +index 000000000000..e1a9529c4173 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/camera-mux-4port-overlay.dts +@@ -0,0 +1,684 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++ ++// Overlay to configure a 4 port camera multiplexer ++// ++// Configuration is based on the Arducam 4 channel multiplexer ++// which uses a PCA9543 I2C multiplexer to handle the ++// I2C, and GPIOs 4, 17, and 18 to control the MIPI muxes. ++ ++/dts-v1/; ++/plugin/; ++ ++#include ++ ++/{ ++ compatible = "brcm,bcm2835"; ++ ++ /* Fragments that complete the individual sensor fragments */ ++ /* IMX290 */ ++ fragment@0 { ++ target = <&imx290_0_ep>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ link-frequencies = ++ /bits/ 64 <445500000 297000000>; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&imx290_1_ep>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ link-frequencies = ++ /bits/ 64 <445500000 297000000>; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&imx290_2_ep>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ link-frequencies = ++ /bits/ 64 <445500000 297000000>; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&imx290_3_ep>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ link-frequencies = ++ /bits/ 64 <445500000 297000000>; ++ }; ++ }; ++ ++ /* IMX477 */ ++ fragment@10 { ++ target = <&imx477_0>; ++ __overlay__ { ++ compatible = "sony,imx477"; ++ }; ++ }; ++ ++ fragment@11 { ++ target = <&imx477_1>; ++ __overlay__ { ++ compatible = "sony,imx477"; ++ }; ++ }; ++ ++ fragment@12 { ++ target = <&imx477_2>; ++ __overlay__ { ++ compatible = "sony,imx477"; ++ }; ++ }; ++ ++ fragment@13 { ++ target = <&imx477_3>; ++ __overlay__ { ++ compatible = "sony,imx477"; ++ }; ++ }; ++ ++ /* Additional fragments affecting the mux nodes */ ++ fragment@100 { ++ target = <&mux_in0>; ++ __dormant__ { ++ data-lanes = <1>; ++ }; ++ }; ++ fragment@101 { ++ target = <&mux_in0>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ }; ++ }; ++ ++ fragment@102 { ++ target = <&mux_in1>; ++ __dormant__ { ++ data-lanes = <1>; ++ }; ++ }; ++ fragment@103 { ++ target = <&mux_in1>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ }; ++ }; ++ ++ fragment@104 { ++ target = <&mux_in2>; ++ __dormant__ { ++ data-lanes = <1>; ++ }; ++ }; ++ fragment@105 { ++ target = <&mux_in2>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ }; ++ }; ++ ++ fragment@106 { ++ target = <&mux_in3>; ++ __dormant__ { ++ data-lanes = <1>; ++ }; ++ }; ++ fragment@107 { ++ target = <&mux_in3>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ }; ++ }; ++ ++ /* Mux define */ ++ fragment@200 { ++ target = <&i2c_csi_dsi>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pca@70 { ++ reg = <0x70>; ++ compatible = "nxp,pca9544"; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ i2c@0 { ++ reg = <0>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ #define cam_node imx219_0 ++ #define cam_endpoint imx219_0_ep ++ #define cam1_clk clk_24mhz ++ #include "imx219.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx477_0 ++ #define cam_endpoint imx477_0_ep ++ #define cam1_clk clk_24mhz ++ #include "imx477_378.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov5647_0 ++ #define cam_endpoint ov5647_0_ep ++ #define cam1_clk clk_25mhz ++ #include "ov5647.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov7251_0 ++ #define cam_endpoint ov7251_0_ep ++ #define cam1_clk clk_24mhz ++ #include "ov7251.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov9281_0 ++ #define cam_endpoint ov9281_0_ep ++ #define cam1_clk clk_24mhz ++ #include "ov9281.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx258_0 ++ #define cam_endpoint imx258_0_ep ++ #define cam1_clk clk_24mhz ++ #include "imx258.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx290_0 ++ #define cam_endpoint imx290_0_ep ++ #define cam1_clk clk_imx290 ++ #include "imx290_327.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov2311_0 ++ #define cam_endpoint ov2311_0_ep ++ #define cam1_clk clk_24mhz ++ #include "ov2311.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ }; ++ ++ i2c@1 { ++ reg = <1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ #define cam_node imx219_1 ++ #define cam_endpoint imx219_1_ep ++ #define cam1_clk clk_24mhz ++ #include "imx219.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx477_1 ++ #define cam_endpoint imx477_1_ep ++ #define cam1_clk clk_24mhz ++ #include "imx477_378.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov5647_1 ++ #define cam_endpoint ov5647_1_ep ++ #define cam1_clk clk_25mhz ++ #include "ov5647.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov7251_1 ++ #define cam_endpoint ov7251_1_ep ++ #define cam1_clk clk_24mhz ++ #include "ov7251.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov9281_1 ++ #define cam_endpoint ov9281_1_ep ++ #define cam1_clk clk_24mhz ++ #include "ov9281.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx258_1 ++ #define cam_endpoint imx258_1_ep ++ #define cam1_clk clk_24mhz ++ #include "imx258.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx290_1 ++ #define cam_endpoint imx290_1_ep ++ #define cam1_clk clk_imx290 ++ #include "imx290_327.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov2311_1 ++ #define cam_endpoint ov2311_1_ep ++ #define cam1_clk clk_24mhz ++ #include "ov2311.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ }; ++ ++ i2c@2 { ++ reg = <2>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ #define cam_node imx219_2 ++ #define cam_endpoint imx219_2_ep ++ #define cam1_clk clk_24mhz ++ #include "imx219.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx477_2 ++ #define cam_endpoint imx477_2_ep ++ #define cam1_clk clk_24mhz ++ #include "imx477_378.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov5647_2 ++ #define cam_endpoint ov5647_2_ep ++ #define cam1_clk clk_25mhz ++ #include "ov5647.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov7251_2 ++ #define cam_endpoint ov7251_2_ep ++ #define cam1_clk clk_24mhz ++ #include "ov7251.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov9281_2 ++ #define cam_endpoint ov9281_2_ep ++ #define cam1_clk clk_24mhz ++ #include "ov9281.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx258_2 ++ #define cam_endpoint imx258_2_ep ++ #define cam1_clk clk_24mhz ++ #include "imx258.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx290_2 ++ #define cam_endpoint imx290_2_ep ++ #define cam1_clk clk_imx290 ++ #include "imx290_327.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov2311_2 ++ #define cam_endpoint ov2311_2_ep ++ #define cam1_clk clk_24mhz ++ #include "ov2311.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ }; ++ ++ i2c@3 { ++ reg = <3>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ #define cam_node imx219_3 ++ #define cam_endpoint imx219_3_ep ++ #define cam1_clk clk_24mhz ++ #include "imx219.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx477_3 ++ #define cam_endpoint imx477_3_ep ++ #define cam1_clk clk_24mhz ++ #include "imx477_378.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov5647_3 ++ #define cam_endpoint ov5647_3_ep ++ #define cam1_clk clk_25mhz ++ #include "ov5647.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov7251_3 ++ #define cam_endpoint ov7251_3_ep ++ #define cam1_clk clk_24mhz ++ #include "ov7251.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov9281_3 ++ #define cam_endpoint ov9281_3_ep ++ #define cam1_clk clk_24mhz ++ #include "ov9281.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx258_3 ++ #define cam_endpoint imx258_3_ep ++ #define cam1_clk clk_24mhz ++ #include "imx258.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node imx290_3 ++ #define cam_endpoint imx290_3_ep ++ #define cam1_clk clk_imx290 ++ #include "imx290_327.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ ++ #define cam_node ov2311_3 ++ #define cam_endpoint ov2311_3_ep ++ #define cam1_clk clk_24mhz ++ #include "ov2311.dtsi" ++ #undef cam_node ++ #undef cam_endpoint ++ #undef cam1_clk ++ }; ++ }; ++ }; ++ }; ++ ++ fragment@201 { ++ target = <&csi1>; ++ __overlay__ { ++ status = "okay"; ++ ++ brcm,media-controller; ++ ++ port { ++ csi1_ep: endpoint { ++ remote-endpoint = <&mux_out>; ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ }; ++ }; ++ }; ++ }; ++ ++ fragment@202 { ++ target = <&i2c0if>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@203 { ++ target-path="/"; ++ __overlay__ { ++ mux: mux-controller { ++ compatible = "gpio-mux"; ++ #mux-control-cells = <0>; ++ ++ /* SEL, En2, En1 */ ++ mux-gpios = <&gpio 4 GPIO_ACTIVE_HIGH>, ++ <&gpio 18 GPIO_ACTIVE_HIGH>, ++ <&gpio 17 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ video-mux { ++ compatible = "video-mux"; ++ mux-controls = <&mux>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ /* GPIO mappings settings for selecting the different ++ * camera connectors are not direct, hence port@ values ++ * are not straight forward. ++ */ ++ port@2 { ++ /* Port A - GPIO 17 = 0, GPIO 18 = 1,GPIO 4 = 0 */ ++ reg = <2>; ++ ++ mux_in0: endpoint { ++ clock-lanes = <0>; ++ }; ++ }; ++ ++ port@3 { ++ /* Port B - GPIO 17 = 0, GPIO 18 = 1,GPIO 4 = 1 */ ++ reg = <3>; ++ ++ mux_in1: endpoint { ++ clock-lanes = <0>; ++ }; ++ }; ++ ++ port@4 { ++ /* Port C - GPIO 17 = 1, GPIO 18 = 0, GPIO 4 = 0 */ ++ reg = <4>; ++ ++ mux_in2: endpoint { ++ clock-lanes = <0>; ++ }; ++ }; ++ ++ port@5 { ++ /* Port D - GPIO 17 = 1, GPIO 18 = 0, GPIO 4 = 1 */ ++ reg = <5>; ++ ++ mux_in3: endpoint { ++ clock-lanes = <0>; ++ }; ++ }; ++ ++ port@6 { ++ /* Output port needs to be the highest port number */ ++ reg = <6>; ++ ++ mux_out: endpoint { ++ remote-endpoint = <&csi1_ep>; ++ clock-lanes = <0>; ++ }; ++ }; ++ }; ++ ++ clk_24mhz: clk_24mhz { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ ++ clock-frequency = <24000000>; ++ status = "okay"; ++ }; ++ ++ clk_25mhz: clk_25mhz { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ ++ clock-frequency = <25000000>; ++ status = "okay"; ++ }; ++ ++ clk_imx290: clk_imx290 { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ ++ clock-frequency = <37125000>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@204 { ++ target = <&i2c0mux>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ __overrides__ { ++ cam0-imx219 = <&mux_in0>, "remote-endpoint:0=",<&imx219_0_ep>, ++ <&imx219_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&mux_in0>, "clock-noncontinuous?", ++ <&imx219_0>, "status=okay"; ++ cam0-imx477 = <&mux_in0>, "remote-endpoint:0=",<&imx477_0_ep>, ++ <&imx477_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&mux_in0>, "clock-noncontinuous?", ++ <&imx477_0>, "status=okay"; ++ cam0-ov5647 = <&mux_in0>, "remote-endpoint:0=",<&ov5647_0_ep>, ++ <&ov5647_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&ov5647_0>, "status=okay"; ++ cam0-ov7251 = <&mux_in0>, "remote-endpoint:0=",<&ov7251_0_ep>, ++ <&ov7251_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&ov7251_0>, "status=okay", ++ <0>,"+100-101"; ++ cam0-ov9281 = <&mux_in0>, "remote-endpoint:0=",<&ov9281_0_ep>, ++ <&ov9281_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&ov9281_0>, "status=okay"; ++ cam0-imx258 = <&mux_in0>, "remote-endpoint:0=",<&imx258_0_ep>, ++ <&imx258_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&imx258_0>, "status=okay"; ++ cam0-imx290 = <&mux_in0>, "remote-endpoint:0=",<&imx290_0_ep>, ++ <&imx290_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&imx290_0>, "status=okay"; ++ cam0-ov2311 = <&mux_in0>, "remote-endpoint:0=",<&ov2311_0_ep>, ++ <&ov2311_0_ep>, "remote-endpoint:0=",<&mux_in0>, ++ <&ov2311_0>, "status=okay"; ++ ++ cam1-imx219 = <&mux_in1>, "remote-endpoint:0=",<&imx219_1_ep>, ++ <&imx219_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&mux_in1>, "clock-noncontinuous?", ++ <&imx219_1>, "status=okay"; ++ cam1-imx477 = <&mux_in1>, "remote-endpoint:0=",<&imx477_1_ep>, ++ <&imx477_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&mux_in1>, "clock-noncontinuous?", ++ <&imx477_1>, "status=okay"; ++ cam1-ov5647 = <&mux_in1>, "remote-endpoint:0=",<&ov5647_1_ep>, ++ <&ov5647_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&ov5647_1>, "status=okay"; ++ cam1-ov7251 = <&mux_in1>, "remote-endpoint:0=",<&ov7251_1_ep>, ++ <&ov7251_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&ov7251_1>, "status=okay", ++ <0>,"+102-103"; ++ cam1-ov9281 = <&mux_in1>, "remote-endpoint:0=",<&ov9281_1_ep>, ++ <&ov9281_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&ov9281_1>, "status=okay"; ++ cam1-imx258 = <&mux_in1>, "remote-endpoint:0=",<&imx258_1_ep>, ++ <&imx258_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&imx258_1>, "status=okay"; ++ cam1-imx290 = <&mux_in1>, "remote-endpoint:0=",<&imx290_1_ep>, ++ <&imx290_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&imx290_1>, "status=okay"; ++ cam1-ov2311 = <&mux_in1>, "remote-endpoint:0=",<&ov2311_1_ep>, ++ <&ov2311_1_ep>, "remote-endpoint:0=",<&mux_in1>, ++ <&ov2311_1>, "status=okay"; ++ ++ cam2-imx219 = <&mux_in2>, "remote-endpoint:0=",<&imx219_2_ep>, ++ <&imx219_2_ep>, "remote-endpoint:0=",<&mux_in2>, ++ <&mux_in2>, "clock-noncontinuous?", ++ <&imx219_2>, "status=okay"; ++ cam2-imx477 = <&mux_in2>, "remote-endpoint:0=",<&imx477_2_ep>, ++ <&imx477_2_ep>, "remote-endpoint:0=",<&mux_in2>, ++ <&mux_in2>, "clock-noncontinuous?", ++ <&imx477_2>, "status=okay"; ++ cam2-ov5647 = <&mux_in2>, "remote-endpoint:0=",<&ov5647_2_ep>, ++ <&ov5647_2_ep>, "remote-endpoint:0=",<&mux_in2>, ++ <&ov5647_2>, "status=okay"; ++ cam2-ov7251 = <&mux_in2>, "remote-endpoint:0=",<&ov7251_2_ep>, ++ <&ov7251_2_ep>, "remote-endpoint:0=",<&mux_in2>, ++ <&ov7251_2>, "status=okay", ++ <0>,"+104-105"; ++ cam2-ov9281 = <&mux_in2>, "remote-endpoint:0=",<&ov9281_2_ep>, ++ <&ov9281_2_ep>, "remote-endpoint:0=",<&mux_in2>, ++ <&ov9281_2>, "status=okay"; ++ cam2-imx258 = <&mux_in2>, "remote-endpoint:0=",<&imx258_2_ep>, ++ <&imx258_2>, "status=okay", ++ <&imx258_2>, "remote-endpoint:0=",<&mux_in2>; ++ cam2-imx290 = <&mux_in2>, "remote-endpoint:0=",<&imx290_2_ep>, ++ <&imx290_2_ep>, "remote-endpoint:0=",<&mux_in2>, ++ <&imx290_2>, "status=okay"; ++ cam2-ov2311 = <&mux_in2>, "remote-endpoint:0=",<&ov2311_2_ep>, ++ <&ov2311_2_ep>, "remote-endpoint:0=",<&mux_in2>, ++ <&ov2311_2>, "status=okay"; ++ ++ cam3-imx219 = <&mux_in3>, "remote-endpoint:0=",<&imx219_3_ep>, ++ <&imx219_3_ep>, "remote-endpoint:0=",<&mux_in3>, ++ <&mux_in3>, "clock-noncontinuous?", ++ <&imx219_3>, "status=okay"; ++ cam3-imx477 = <&mux_in3>, "remote-endpoint:0=",<&imx477_3_ep>, ++ <&imx477_3_ep>, "remote-endpoint:0=",<&mux_in3>, ++ <&mux_in3>, "clock-noncontinuous?", ++ <&imx477_3>, "status=okay"; ++ cam3-ov5647 = <&mux_in3>, "remote-endpoint:0=",<&ov5647_3_ep>, ++ <&ov5647_3_ep>, "remote-endpoint:0=",<&mux_in3>, ++ <&ov5647_3>, "status=okay"; ++ cam3-ov7251 = <&mux_in3>, "remote-endpoint:0=",<&ov7251_3_ep>, ++ <&ov7251_3_ep>, "remote-endpoint:0=",<&mux_in3>, ++ <&ov7251_3>, "status=okay", ++ <0>,"+106-107"; ++ cam3-ov9281 = <&mux_in3>, "remote-endpoint:0=",<&ov9281_3_ep>, ++ <&ov9281_3_ep>, "remote-endpoint:0=",<&mux_in3>, ++ <&ov9281_3>, "status=okay"; ++ cam3-imx258 = <&mux_in3>, "remote-endpoint:0=",<&imx258_3_ep>, ++ <&imx258_3_ep>, "remote-endpoint:0=",<&mux_in3>, ++ <&imx258_3>, "status=okay"; ++ cam3-imx290 = <&mux_in3>, "remote-endpoint:0=",<&imx290_3_ep>, ++ <&imx290_3_ep>, "remote-endpoint:0=",<&mux_in3>, ++ <&imx290_3>, "status=okay"; ++ cam3-ov2311 = <&mux_in3>, "remote-endpoint:0=",<&ov2311_3_ep>, ++ <&ov2311_3_ep>, "remote-endpoint:0=",<&mux_in3>, ++ <&ov2311_3>, "status=okay"; ++ ++ cam0-imx290-clk-freq = <&clk_imx290>,"clock-frequency:0", ++ <&imx290_0>,"clock-frequency:0"; ++ cam1-imx290-clk-freq = <&clk_imx290>,"clock-frequency:0", ++ <&imx290_1>,"clock-frequency:0"; ++ cam2-imx290-clk-freq = <&clk_imx290>,"clock-frequency:0", ++ <&imx290_2>,"clock-frequency:0"; ++ cam3-imx290-clk-freq = <&clk_imx290>,"clock-frequency:0", ++ <&imx290_3>,"clock-frequency:0"; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/imx219-overlay.dts b/arch/arm/boot/dts/overlays/imx219-overlay.dts +index 0134fb2677c6..aa97450ac994 100644 +--- a/arch/arm/boot/dts/overlays/imx219-overlay.dts ++++ b/arch/arm/boot/dts/overlays/imx219-overlay.dts +@@ -37,32 +37,7 @@ + #size-cells = <0>; + status = "okay"; + +- imx219: imx219@10 { +- compatible = "sony,imx219"; +- reg = <0x10>; +- status = "okay"; +- +- clocks = <&cam1_clk>; +- clock-names = "xclk"; +- +- VANA-supply = <&cam1_reg>; /* 2.8v */ +- VDIG-supply = <&cam_dummy_reg>; /* 1.8v */ +- VDDL-supply = <&cam_dummy_reg>; /* 1.2v */ +- +- rotation = <180>; +- orientation = <2>; +- +- port { +- imx219_0: endpoint { +- remote-endpoint = <&csi_ep>; +- clock-lanes = <0>; +- data-lanes = <1 2>; +- clock-noncontinuous; +- link-frequencies = +- /bits/ 64 <456000000>; +- }; +- }; +- }; ++ #include "imx219.dtsi" + + vcm: ad5398@c { + compatible = "adi,ad5398"; +@@ -81,7 +56,7 @@ + + port { + csi_ep: endpoint { +- remote-endpoint = <&imx219_0>; ++ remote-endpoint = <&cam_endpoint>; + clock-lanes = <0>; + data-lanes = <1 2>; + clock-noncontinuous; +@@ -91,16 +66,24 @@ + }; + + __overrides__ { +- rotation = <&imx219>,"rotation:0"; +- orientation = <&imx219>,"orientation:0"; ++ rotation = <&cam_node>,"rotation:0"; ++ orientation = <&cam_node>,"orientation:0"; + media-controller = <&csi>,"brcm,media-controller?"; + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>, + <&csi_frag>, "target:0=",<&csi0>, + <&clk_frag>, "target:0=",<&cam0_clk>, +- <&imx219>, "clocks:0=",<&cam0_clk>, +- <&imx219>, "VANA-supply:0=",<&cam0_reg>, ++ <&cam_node>, "clocks:0=",<&cam0_clk>, ++ <&cam_node>, "VANA-supply:0=",<&cam0_reg>, + <&vcm>, "VANA-supply:0=", <&cam0_reg>; + vcm = <&vcm>, "status=okay", +- <&imx219>,"lens-focus:0=", <&vcm>; ++ <&cam_node>,"lens-focus:0=", <&vcm>; + }; + }; ++ ++&cam_node { ++ status = "okay"; ++}; ++ ++&cam_endpoint { ++ remote-endpoint = <&csi_ep>; ++}; +diff --git a/arch/arm/boot/dts/overlays/imx219.dtsi b/arch/arm/boot/dts/overlays/imx219.dtsi +new file mode 100644 +index 000000000000..fa870f77ef07 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/imx219.dtsi +@@ -0,0 +1,27 @@ ++// Fragment that configures an imx219 ++ ++cam_node: imx219@10 { ++ compatible = "sony,imx219"; ++ reg = <0x10>; ++ status = "disabled"; ++ ++ clocks = <&cam1_clk>; ++ clock-names = "xclk"; ++ ++ VANA-supply = <&cam1_reg>; /* 2.8v */ ++ VDIG-supply = <&cam_dummy_reg>; /* 1.8v */ ++ VDDL-supply = <&cam_dummy_reg>; /* 1.2v */ ++ ++ rotation = <180>; ++ orientation = <2>; ++ ++ port { ++ cam_endpoint: endpoint { ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ clock-noncontinuous; ++ link-frequencies = ++ /bits/ 64 <456000000>; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/imx258-overlay.dts b/arch/arm/boot/dts/overlays/imx258-overlay.dts +index 3cefd59663a0..7117682ab095 100644 +--- a/arch/arm/boot/dts/overlays/imx258-overlay.dts ++++ b/arch/arm/boot/dts/overlays/imx258-overlay.dts +@@ -8,14 +8,14 @@ + /{ + compatible = "brcm,bcm2835"; + +- fragment@2 { ++ fragment@0 { + target = <&i2c0if>; + __overlay__ { + status = "okay"; + }; + }; + +- clk_frag: fragment@3 { ++ clk_frag: fragment@1 { + target = <&cam1_clk>; + cam_clk: __overlay__ { + clock-frequency = <24000000>; +@@ -23,63 +23,42 @@ + }; + }; + +- fragment@4 { ++ fragment@2 { + target = <&i2c0mux>; + __overlay__ { + status = "okay"; + }; + }; + +- reg_frag: fragment@5 { +- target = <&cam1_reg>; +- cam_reg: __overlay__ { +- regulator-name = "imx258_vana"; +- startup-delay-us = <300000>; +- regulator-min-microvolt = <2700000>; +- regulator-max-microvolt = <2700000>; ++ fragment@11 { ++ target = <&cam_endpoint>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ link-frequencies = /bits/ 64 <633600000 ++ 320000000>; + }; + }; + +- i2c_frag: fragment@100 { +- target = <&i2c_csi_dsi>; +- __overlay__ { +- #address-cells = <1>; +- #size-cells = <0>; +- status = "okay"; ++ fragment@12 { ++ target = <&cam_endpoint>; ++ __dormant__ { ++ data-lanes = <1 2 3 4>; ++ link-frequencies = ++ /bits/ 64 <633600000 320000000>; ++ }; ++ }; + +- imx258: imx258@10 { +- compatible = "sony,imx258-pdaf"; +- reg = <0x10>; +- status = "okay"; +- +- clocks = <&cam1_clk>; +- clock-names = "xclk"; +- +- vana-supply = <&cam1_reg>; /* 2.8v */ +- vdig-supply = <&cam_dummy_reg>; /* 1.05v */ +- vif-supply = <&cam_dummy_reg>; /* 1.8v */ +- +- rotation = <180>; +- orientation = <2>; +- +- port { +- imx258_0: endpoint { +- remote-endpoint = <&csi_ep>; +- clock-lanes = <0>; +- clock-noncontinuous; +- link-frequencies = +- /bits/ 64 <633600000 +- 320000000>; +- }; +- }; +- }; ++ fragment@13 { ++ target = <&csi_ep>; ++ __overlay__ { ++ data-lanes = <1 2>; ++ }; ++ }; + +- vcm: ad5398@c { +- compatible = "adi,ad5398"; +- reg = <0x0c>; +- status = "disabled"; +- VANA-supply = <&cam1_reg>; +- }; ++ fragment@14 { ++ target = <&csi_ep>; ++ __dormant__ { ++ data-lanes = <1 2 3 4>; + }; + }; + +@@ -91,7 +70,7 @@ + + port { + csi_ep: endpoint { +- remote-endpoint = <&imx258_0>; ++ remote-endpoint = <&cam_endpoint>; + clock-lanes = <0>; + clock-noncontinuous; + }; +@@ -99,50 +78,54 @@ + }; + }; + +- fragment@102 { +- target = <&imx258_0>; +- __overlay__ { +- data-lanes = <1 2>; +- link-frequencies = /bits/ 64 <633600000 +- 320000000>; +- }; +- }; +- +- fragment@103 { +- target = <&imx258_0>; +- __dormant__ { +- data-lanes = <1 2 3 4>; +- link-frequencies = +- /bits/ 64 <633600000 320000000>; ++ reg_frag: fragment@5 { ++ target = <&cam1_reg>; ++ cam_reg: __overlay__ { ++ regulator-name = "imx258_vana"; ++ startup-delay-us = <300000>; ++ regulator-min-microvolt = <2700000>; ++ regulator-max-microvolt = <2700000>; + }; + }; + +- fragment@104 { +- target = <&csi_ep>; ++ i2c_frag: fragment@100 { ++ target = <&i2c_csi_dsi>; + __overlay__ { +- data-lanes = <1 2>; +- }; +- }; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + +- fragment@105 { +- target = <&csi_ep>; +- __dormant__ { +- data-lanes = <1 2 3 4>; ++ #include "imx258.dtsi" ++ ++ vcm: ad5398@c { ++ compatible = "adi,ad5398"; ++ reg = <0x0c>; ++ status = "disabled"; ++ VANA-supply = <&cam1_reg>; ++ }; + }; + }; + + __overrides__ { +- rotation = <&imx258>,"rotation:0"; +- orientation = <&imx258>,"orientation:0"; ++ rotation = <&cam_node>,"rotation:0"; ++ orientation = <&cam_node>,"orientation:0"; + media-controller = <&csi>,"brcm,media-controller?"; + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>, + <&csi_frag>, "target:0=",<&csi0>, + <&clk_frag>, "target:0=",<&cam0_clk>, + <®_frag>, "target:0=",<&cam0_reg>, +- <&imx258>, "clocks:0=",<&cam0_clk>, +- <&imx258>, "vana-supply:0=",<&cam0_reg>; ++ <&cam_node>, "clocks:0=",<&cam0_clk>, ++ <&cam_node>, "vana-supply:0=",<&cam0_reg>; + vcm = <&vcm>, "status=okay", +- <&imx258>,"lens-focus:0=", <&vcm>; +- 4lane = <0>, "-102+103-104+105"; ++ <&cam_node>,"lens-focus:0=", <&vcm>; ++ 4lane = <0>, "-11+12-13+14"; + }; + }; ++ ++&cam_node { ++ status = "okay"; ++}; ++ ++&cam_endpoint { ++ remote-endpoint = <&csi_ep>; ++}; +diff --git a/arch/arm/boot/dts/overlays/imx258.dtsi b/arch/arm/boot/dts/overlays/imx258.dtsi +new file mode 100644 +index 000000000000..cca81e1aa8b3 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/imx258.dtsi +@@ -0,0 +1,27 @@ ++// Fragment that configures a Sony IMX258 ++ ++cam_node: imx258@10 { ++ compatible = "sony,imx258"; ++ reg = <0x10>; ++ status = "disabled"; ++ ++ clocks = <&cam1_clk>; ++ clock-names = "xclk"; ++ ++ vana-supply = <&cam1_reg>; /* 2.8v */ ++ vdig-supply = <&cam_dummy_reg>; /* 1.05v */ ++ vif-supply = <&cam_dummy_reg>; /* 1.8v */ ++ ++ rotation = <180>; ++ orientation = <2>; ++ ++ port { ++ cam_endpoint: endpoint { ++ clock-lanes = <0>; ++ clock-noncontinuous; ++ link-frequencies = ++ /bits/ 64 <633600000 ++ 320000000>; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/imx290-overlay.dts b/arch/arm/boot/dts/overlays/imx290-overlay.dts +index e536aa7f9e33..2e70e17ed29b 100644 +--- a/arch/arm/boot/dts/overlays/imx290-overlay.dts ++++ b/arch/arm/boot/dts/overlays/imx290-overlay.dts +@@ -13,14 +13,14 @@ + // included imx290_327 overlay file. + + fragment@101 { +- target = <&imx290>; ++ target = <&cam_node>; + __overlay__ { + compatible = "sony,imx290"; + }; + }; + + fragment@102 { +- target = <&imx290>; ++ target = <&cam_node>; + __dormant__ { + compatible = "sony,imx290-mono"; + }; +diff --git a/arch/arm/boot/dts/overlays/imx290_327-overlay.dtsi b/arch/arm/boot/dts/overlays/imx290_327-overlay.dtsi +index 111d69597554..d8141de672e2 100644 +--- a/arch/arm/boot/dts/overlays/imx290_327-overlay.dtsi ++++ b/arch/arm/boot/dts/overlays/imx290_327-overlay.dtsi +@@ -16,28 +16,7 @@ + #size-cells = <0>; + status = "okay"; + +- imx290: imx290@1a { +- reg = <0x1a>; +- status = "okay"; +- +- clocks = <&cam1_clk>; +- clock-names = "xclk"; +- clock-frequency = <37125000>; +- +- rotation = <0>; +- orientation = <2>; +- +- vdda-supply = <&cam1_reg>; /* 2.8v */ +- vdddo-supply = <&cam_dummy_reg>; /* 1.8v */ +- vddd-supply = <&cam_dummy_reg>; /* 1.5v */ +- +- port { +- imx290_0: endpoint { +- remote-endpoint = <&csi1_ep>; +- clock-lanes = <0>; +- }; +- }; +- }; ++ #include "imx290_327.dtsi" + }; + }; + +@@ -48,8 +27,8 @@ + brcm,media-controller; + + port { +- csi1_ep: endpoint { +- remote-endpoint = <&imx290_0>; ++ csi_ep: endpoint { ++ remote-endpoint = <&cam_endpoint>; + }; + }; + }; +@@ -78,7 +57,7 @@ + }; + + fragment@6 { +- target = <&imx290_0>; ++ target = <&cam_endpoint>; + __overlay__ { + data-lanes = <1 2>; + link-frequencies = +@@ -87,7 +66,7 @@ + }; + + fragment@7 { +- target = <&imx290_0>; ++ target = <&cam_endpoint>; + __dormant__ { + data-lanes = <1 2 3 4>; + link-frequencies = +@@ -96,14 +75,14 @@ + }; + + fragment@8 { +- target = <&csi1_ep>; ++ target = <&csi_ep>; + __overlay__ { + data-lanes = <1 2>; + }; + }; + + fragment@9 { +- target = <&csi1_ep>; ++ target = <&csi_ep>; + __dormant__ { + data-lanes = <1 2 3 4>; + }; +@@ -112,14 +91,22 @@ + __overrides__ { + 4lane = <0>, "-6+7-8+9"; + clock-frequency = <&cam_clk>,"clock-frequency:0", +- <&imx290>,"clock-frequency:0"; +- rotation = <&imx290>,"rotation:0"; +- orientation = <&imx290>,"orientation:0"; ++ <&cam_node>,"clock-frequency:0"; ++ rotation = <&cam_node>,"rotation:0"; ++ orientation = <&cam_node>,"orientation:0"; + media-controller = <&csi>,"brcm,media-controller?"; + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>, + <&csi_frag>, "target:0=",<&csi0>, + <&clk_frag>, "target:0=",<&cam0_clk>, +- <&imx290>, "clocks:0=",<&cam0_clk>, +- <&imx290>, "vdda-supply:0=",<&cam0_reg>; ++ <&cam_node>, "clocks:0=",<&cam0_clk>, ++ <&cam_node>, "vdda-supply:0=",<&cam0_reg>; + }; + }; ++ ++&cam_node { ++ status = "okay"; ++}; ++ ++&cam_endpoint { ++ remote-endpoint = <&csi_ep>; ++}; +diff --git a/arch/arm/boot/dts/overlays/imx290_327.dtsi b/arch/arm/boot/dts/overlays/imx290_327.dtsi +new file mode 100644 +index 000000000000..9afe7e9f470c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/imx290_327.dtsi +@@ -0,0 +1,24 @@ ++// Fragment to configure and IMX290 / IMX327 / IMX462 image sensor ++ ++cam_node: imx290@1a { ++ compatible = "sony,imx290"; ++ reg = <0x1a>; ++ status = "disabled"; ++ ++ clocks = <&cam1_clk>; ++ clock-names = "xclk"; ++ clock-frequency = <37125000>; ++ ++ rotation = <0>; ++ orientation = <2>; ++ ++ vdda-supply = <&cam1_reg>; /* 2.8v */ ++ vdddo-supply = <&cam_dummy_reg>; /* 1.8v */ ++ vddd-supply = <&cam_dummy_reg>; /* 1.5v */ ++ ++ port { ++ cam_endpoint: endpoint { ++ clock-lanes = <0>; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/imx378-overlay.dts b/arch/arm/boot/dts/overlays/imx378-overlay.dts +index 74c7288d12f5..6a999914056a 100644 +--- a/arch/arm/boot/dts/overlays/imx378-overlay.dts ++++ b/arch/arm/boot/dts/overlays/imx378-overlay.dts +@@ -5,6 +5,6 @@ + + #include "imx477_378-overlay.dtsi" + +-&imx477 { ++&cam_node { + compatible = "sony,imx378"; + }; +diff --git a/arch/arm/boot/dts/overlays/imx477-overlay.dts b/arch/arm/boot/dts/overlays/imx477-overlay.dts +index ca315d120e6b..f6482a990cfc 100644 +--- a/arch/arm/boot/dts/overlays/imx477-overlay.dts ++++ b/arch/arm/boot/dts/overlays/imx477-overlay.dts +@@ -5,6 +5,6 @@ + + #include "imx477_378-overlay.dtsi" + +-&imx477 { ++&cam_node { + compatible = "sony,imx477"; + }; +diff --git a/arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi b/arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi +index bfea40ce98d6..7afc0a248569 100644 +--- a/arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi ++++ b/arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi +@@ -4,14 +4,14 @@ + /{ + compatible = "brcm,bcm2835"; + +- fragment@2 { ++ fragment@0 { + target = <&i2c0if>; + __overlay__ { + status = "okay"; + }; + }; + +- clk_frag: fragment@3 { ++ clk_frag: fragment@1 { + target = <&cam1_clk>; + cam_clk: __overlay__ { + clock-frequency = <24000000>; +@@ -19,14 +19,14 @@ + }; + }; + +- fragment@4 { ++ fragment@2 { + target = <&i2c0mux>; + __overlay__ { + status = "okay"; + }; + }; + +- reg_frag: fragment@5 { ++ reg_frag: fragment@3 { + target = <&cam1_reg>; + cam_reg: __overlay__ { + startup-delay-us = <300000>; +@@ -40,31 +40,7 @@ + #size-cells = <0>; + status = "okay"; + +- imx477: imx477@1a { +- reg = <0x1a>; +- status = "okay"; +- +- clocks = <&cam1_clk>; +- clock-names = "xclk"; +- +- VANA-supply = <&cam1_reg>; /* 2.8v */ +- VDIG-supply = <&cam_dummy_reg>; /* 1.05v */ +- VDDL-supply = <&cam_dummy_reg>; /* 1.8v */ +- +- rotation = <180>; +- orientation = <2>; +- +- port { +- imx477_0: endpoint { +- remote-endpoint = <&csi_ep>; +- clock-lanes = <0>; +- data-lanes = <1 2>; +- clock-noncontinuous; +- link-frequencies = +- /bits/ 64 <450000000>; +- }; +- }; +- }; ++ #include "imx477_378.dtsi" + }; + }; + +@@ -76,7 +52,7 @@ + + port { + csi_ep: endpoint { +- remote-endpoint = <&imx477_0>; ++ remote-endpoint = <&cam_endpoint>; + clock-lanes = <0>; + data-lanes = <1 2>; + clock-noncontinuous; +@@ -86,14 +62,22 @@ + }; + + __overrides__ { +- rotation = <&imx477>,"rotation:0"; +- orientation = <&imx477>,"orientation:0"; ++ rotation = <&cam_node>,"rotation:0"; ++ orientation = <&cam_node>,"orientation:0"; + media-controller = <&csi>,"brcm,media-controller?"; + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>, + <&csi_frag>, "target:0=",<&csi0>, + <&clk_frag>, "target:0=",<&cam0_clk>, + <®_frag>, "target:0=",<&cam0_reg>, +- <&imx477>, "clocks:0=",<&cam0_clk>, +- <&imx477>, "vdda-supply:0=",<&cam0_reg>; ++ <&cam_node>, "clocks:0=",<&cam0_clk>, ++ <&cam_node>, "VANA-supply:0=",<&cam0_reg>; + }; + }; ++ ++&cam_node { ++ status = "okay"; ++}; ++ ++&cam_endpoint { ++ remote-endpoint = <&csi_ep>; ++}; +diff --git a/arch/arm/boot/dts/overlays/imx477_378.dtsi b/arch/arm/boot/dts/overlays/imx477_378.dtsi +new file mode 100644 +index 000000000000..a0c154c2a11f +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/imx477_378.dtsi +@@ -0,0 +1,24 @@ ++cam_node: imx477@1a { ++ reg = <0x1a>; ++ status = "disabled"; ++ ++ clocks = <&cam1_clk>; ++ clock-names = "xclk"; ++ ++ VANA-supply = <&cam1_reg>; /* 2.8v */ ++ VDIG-supply = <&cam_dummy_reg>; /* 1.05v */ ++ VDDL-supply = <&cam_dummy_reg>; /* 1.8v */ ++ ++ rotation = <180>; ++ orientation = <2>; ++ ++ port { ++ cam_endpoint: endpoint { ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ clock-noncontinuous; ++ link-frequencies = ++ /bits/ 64 <450000000>; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/ov2311-overlay.dts b/arch/arm/boot/dts/overlays/ov2311-overlay.dts +index 9f8e1b3edccc..aeefca50e8a2 100644 +--- a/arch/arm/boot/dts/overlays/ov2311-overlay.dts ++++ b/arch/arm/boot/dts/overlays/ov2311-overlay.dts +@@ -15,31 +15,7 @@ + #size-cells = <0>; + status = "okay"; + +- ov2311: ov2311@60 { +- compatible = "ovti,ov2311"; +- reg = <0x60>; +- status = "okay"; +- +- clocks = <&cam1_clk>; +- clock-names = "xvclk"; +- +- avdd-supply = <&cam1_reg>; +- dovdd-supply = <&cam_dummy_reg>; +- dvdd-supply = <&cam_dummy_reg>; +- +- rotation = <0>; +- orientation = <2>; +- +- port { +- ov2311_0: endpoint { +- remote-endpoint = <&csi1_ep>; +- clock-lanes = <0>; +- data-lanes = <1 2>; +- link-frequencies = +- /bits/ 64 <400000000>; +- }; +- }; +- }; ++ #include "ov2311.dtsi" + }; + }; + +@@ -50,8 +26,8 @@ + brcm,media-controller; + + port { +- csi1_ep: endpoint { +- remote-endpoint = <&ov2311_0>; ++ csi_ep: endpoint { ++ remote-endpoint = <&cam_endpoint>; + data-lanes = <1 2>; + }; + }; +@@ -72,7 +48,7 @@ + }; + }; + +- clk_frag: fragment@4 { ++ clk_frag: fragment@4{ + target = <&cam1_clk>; + __overlay__ { + status = "okay"; +@@ -81,13 +57,21 @@ + }; + + __overrides__ { +- rotation = <&ov2311>,"rotation:0"; +- orientation = <&ov2311>,"orientation:0"; ++ rotation = <&cam_node>,"rotation:0"; ++ orientation = <&cam_node>,"orientation:0"; + media-controller = <&csi>,"brcm,media-controller?"; + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>, + <&csi_frag>, "target:0=",<&csi0>, + <&clk_frag>, "target:0=",<&cam0_clk>, +- <&ov2311>, "clocks:0=",<&cam0_clk>, +- <&ov2311>, "avdd-supply:0=",<&cam0_reg>; ++ <&cam_node>, "clocks:0=",<&cam0_clk>, ++ <&cam_node>, "avdd-supply:0=",<&cam0_reg>; + }; + }; ++ ++&cam_node { ++ status = "okay"; ++}; ++ ++&cam_endpoint { ++ remote-endpoint = <&csi_ep>; ++}; +diff --git a/arch/arm/boot/dts/overlays/ov2311.dtsi b/arch/arm/boot/dts/overlays/ov2311.dtsi +new file mode 100644 +index 000000000000..a1714d6941c3 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/ov2311.dtsi +@@ -0,0 +1,26 @@ ++// Fragment that configures an ov2311 ++ ++cam_node: ov2311@60 { ++ compatible = "ovti,ov2311"; ++ reg = <0x60>; ++ status = "disabled"; ++ ++ clocks = <&cam1_clk>; ++ clock-names = "xvclk"; ++ ++ avdd-supply = <&cam1_reg>; ++ dovdd-supply = <&cam_dummy_reg>; ++ dvdd-supply = <&cam_dummy_reg>; ++ ++ rotation = <0>; ++ orientation = <2>; ++ ++ port { ++ cam_endpoint: endpoint { ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ link-frequencies = ++ /bits/ 64 <400000000>; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/ov5647-overlay.dts b/arch/arm/boot/dts/overlays/ov5647-overlay.dts +index d06ee9229b0d..3fcb0b8d9952 100644 +--- a/arch/arm/boot/dts/overlays/ov5647-overlay.dts ++++ b/arch/arm/boot/dts/overlays/ov5647-overlay.dts +@@ -13,31 +13,7 @@ + #size-cells = <0>; + status = "okay"; + +- ov5647: ov5647@36 { +- compatible = "ovti,ov5647"; +- reg = <0x36>; +- status = "okay"; +- +- clocks = <&cam1_clk>; +- +- avdd-supply = <&cam1_reg>; +- dovdd-supply = <&cam_dummy_reg>; +- dvdd-supply = <&cam_dummy_reg>; +- +- rotation = <0>; +- orientation = <2>; +- +- port { +- ov5647_0: endpoint { +- remote-endpoint = <&csi1_ep>; +- clock-lanes = <0>; +- data-lanes = <1 2>; +- clock-noncontinuous; +- link-frequencies = +- /bits/ 64 <297000000>; +- }; +- }; +- }; ++ #include "ov5647.dtsi" + + vcm: ad5398@c { + compatible = "adi,ad5398"; +@@ -55,8 +31,8 @@ + brcm,media-controller; + + port { +- csi1_ep: endpoint { +- remote-endpoint = <&ov5647_0>; ++ csi_ep: endpoint { ++ remote-endpoint = <&cam_endpoint>; + data-lanes = <1 2>; + }; + }; +@@ -93,16 +69,24 @@ + }; + + __overrides__ { +- rotation = <&ov5647>,"rotation:0"; +- orientation = <&ov5647>,"orientation:0"; ++ rotation = <&cam_node>,"rotation:0"; ++ orientation = <&cam_node>,"orientation:0"; + media-controller = <&csi>,"brcm,media-controller?"; + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>, + <&csi_frag>, "target:0=",<&csi0>, + <®_frag>, "target:0=",<&cam0_reg>, + <&clk_frag>, "target:0=",<&cam0_clk>, +- <&ov5647>, "clocks:0=",<&cam0_clk>, +- <&ov5647>, "avdd-supply:0=",<&cam0_reg>; ++ <&cam_node>, "clocks:0=",<&cam0_clk>, ++ <&cam_node>, "avdd-supply:0=",<&cam0_reg>; + vcm = <&vcm>, "status=okay", +- <&ov5647>,"lens-focus:0=", <&vcm>; ++ <&cam_node>,"lens-focus:0=", <&vcm>; + }; + }; ++ ++&cam_node { ++ status = "okay"; ++}; ++ ++&cam_endpoint { ++ remote-endpoint = <&csi_ep>; ++}; +diff --git a/arch/arm/boot/dts/overlays/ov5647.dtsi b/arch/arm/boot/dts/overlays/ov5647.dtsi +new file mode 100644 +index 000000000000..6455a191a394 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/ov5647.dtsi +@@ -0,0 +1,25 @@ ++cam_node: ov5647@36 { ++ compatible = "ovti,ov5647"; ++ reg = <0x36>; ++ status = "disabled"; ++ ++ clocks = <&cam1_clk>; ++ ++ avdd-supply = <&cam1_reg>; ++ dovdd-supply = <&cam_dummy_reg>; ++ dvdd-supply = <&cam_dummy_reg>; ++ ++ rotation = <0>; ++ orientation = <2>; ++ ++ port { ++ cam_endpoint: endpoint { ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ clock-noncontinuous; ++ link-frequencies = ++ /bits/ 64 <297000000>; ++ }; ++ }; ++}; ++ +diff --git a/arch/arm/boot/dts/overlays/ov7251-overlay.dts b/arch/arm/boot/dts/overlays/ov7251-overlay.dts +index 3cf109ec998f..9e490aa90fa0 100644 +--- a/arch/arm/boot/dts/overlays/ov7251-overlay.dts ++++ b/arch/arm/boot/dts/overlays/ov7251-overlay.dts +@@ -15,33 +15,7 @@ + #size-cells = <0>; + status = "okay"; + +- ov7251: ov7251@60 { +- compatible = "ovti,ov7251"; +- reg = <0x60>; +- status = "okay"; +- +- clocks = <&cam1_clk>; +- clock-names = "xclk"; +- clock-frequency = <24000000>; +- +- vdddo-supply = <&cam_dummy_reg>; +- vdda-supply = <&cam1_reg>; +- vddd-supply = <&cam_dummy_reg>; +- +- rotation = <0>; +- orientation = <2>; +- +- port { +- ov7251_0: endpoint { +- remote-endpoint = <&csi1_ep>; +- clock-lanes = <0>; +- data-lanes = <1>; +- clock-noncontinuous; +- link-frequencies = +- /bits/ 64 <240000000>; +- }; +- }; +- }; ++ #include "ov7251.dtsi" + }; + }; + +@@ -52,8 +26,8 @@ + brcm,media-controller; + + port { +- csi1_ep: endpoint { +- remote-endpoint = <&ov7251_0>; ++ csi_ep: endpoint { ++ remote-endpoint = <&cam_endpoint>; + data-lanes = <1>; + }; + }; +@@ -83,13 +57,21 @@ + }; + + __overrides__ { +- rotation = <&ov7251>,"rotation:0"; +- orientation = <&ov7251>,"orientation:0"; ++ rotation = <&cam_node>,"rotation:0"; ++ orientation = <&cam_node>,"orientation:0"; + media-controller = <&csi>,"brcm,media-controller?"; + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>, + <&csi_frag>, "target:0=",<&csi0>, + <&clk_frag>, "target:0=",<&cam0_clk>, +- <&ov7251>, "clocks:0=",<&cam0_clk>, +- <&ov7251>, "vdda-supply:0=",<&cam0_reg>; ++ <&cam_node>, "clocks:0=",<&cam0_clk>, ++ <&cam_node>, "vdda-supply:0=",<&cam0_reg>; + }; + }; ++ ++&cam_node { ++ status = "okay"; ++}; ++ ++&cam_endpoint { ++ remote-endpoint = <&csi_ep>; ++}; +diff --git a/arch/arm/boot/dts/overlays/ov7251.dtsi b/arch/arm/boot/dts/overlays/ov7251.dtsi +new file mode 100644 +index 000000000000..561fed1db837 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/ov7251.dtsi +@@ -0,0 +1,28 @@ ++// Fragment that configures an ov7251 ++ ++cam_node: ov7251@60 { ++ compatible = "ovti,ov7251"; ++ reg = <0x60>; ++ status = "disabled"; ++ ++ clocks = <&cam1_clk>; ++ clock-names = "xclk"; ++ clock-frequency = <24000000>; ++ ++ vdddo-supply = <&cam_dummy_reg>; ++ vdda-supply = <&cam1_reg>; ++ vddd-supply = <&cam_dummy_reg>; ++ ++ rotation = <0>; ++ orientation = <2>; ++ ++ port { ++ cam_endpoint: endpoint { ++ clock-lanes = <0>; ++ data-lanes = <1>; ++ clock-noncontinuous; ++ link-frequencies = ++ /bits/ 64 <240000000>; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/ov9281-overlay.dts b/arch/arm/boot/dts/overlays/ov9281-overlay.dts +index 8c08a3a1077c..8a678d420c38 100644 +--- a/arch/arm/boot/dts/overlays/ov9281-overlay.dts ++++ b/arch/arm/boot/dts/overlays/ov9281-overlay.dts +@@ -15,32 +15,7 @@ + #size-cells = <0>; + status = "okay"; + +- ov9281: ov9281@60 { +- compatible = "ovti,ov9281"; +- reg = <0x60>; +- status = "okay"; +- +- clocks = <&cam1_clk>; +- clock-names = "xvclk"; +- +- avdd-supply = <&cam1_reg>; +- dovdd-supply = <&cam_dummy_reg>; +- dvdd-supply = <&cam_dummy_reg>; +- +- rotation = <0>; +- orientation = <2>; +- +- port { +- ov9281_0: endpoint { +- remote-endpoint = <&csi1_ep>; +- clock-lanes = <0>; +- data-lanes = <1 2>; +- clock-noncontinuous; +- link-frequencies = +- /bits/ 64 <400000000>; +- }; +- }; +- }; ++ #include "ov9281.dtsi" + }; + }; + +@@ -51,8 +26,8 @@ + brcm,media-controller; + + port { +- csi1_ep: endpoint { +- remote-endpoint = <&ov9281_0>; ++ csi_ep: endpoint { ++ remote-endpoint = <&cam_endpoint>; + data-lanes = <1 2>; + clock-noncontinuous; + }; +@@ -83,13 +58,21 @@ + }; + + __overrides__ { +- rotation = <&ov9281>,"rotation:0"; +- orientation = <&ov9281>,"orientation:0"; ++ rotation = <&cam_node>,"rotation:0"; ++ orientation = <&cam_node>,"orientation:0"; + media-controller = <&csi>,"brcm,media-controller?"; + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>, + <&csi_frag>, "target:0=",<&csi0>, + <&clk_frag>, "target:0=",<&cam0_clk>, +- <&ov9281>, "clocks:0=",<&cam0_clk>, +- <&ov9281>, "avdd-supply:0=",<&cam0_reg>; ++ <&cam_node>, "clocks:0=",<&cam0_clk>, ++ <&cam_node>, "avdd-supply:0=",<&cam0_reg>; + }; + }; ++ ++&cam_node { ++ status = "okay"; ++}; ++ ++&cam_endpoint { ++ remote-endpoint = <&csi_ep>; ++}; +diff --git a/arch/arm/boot/dts/overlays/ov9281.dtsi b/arch/arm/boot/dts/overlays/ov9281.dtsi +new file mode 100644 +index 000000000000..7df43bc6ef39 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/ov9281.dtsi +@@ -0,0 +1,27 @@ ++// Fragment that configures an ov9281 ++ ++cam_node: ov9281@60 { ++ compatible = "ovti,ov9281"; ++ reg = <0x60>; ++ status = "disabled"; ++ ++ clocks = <&cam1_clk>; ++ clock-names = "xvclk"; ++ ++ avdd-supply = <&cam1_reg>; ++ dovdd-supply = <&cam_dummy_reg>; ++ dvdd-supply = <&cam_dummy_reg>; ++ ++ rotation = <0>; ++ orientation = <2>; ++ ++ port { ++ cam_endpoint: endpoint { ++ clock-lanes = <0>; ++ data-lanes = <1 2>; ++ clock-noncontinuous; ++ link-frequencies = ++ /bits/ 64 <400000000>; ++ }; ++ }; ++}; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxim Devaev +Date: Tue, 5 Jul 2022 01:54:18 +0300 +Subject: [PATCH 1040/1183] bcm2835-v4l2-codec: support H.264 5.0 and 5.1 + levels + +--- + .../vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 12 ++++++++++-- + 1 file changed, 10 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 6df12827713a..ca063a25ab12 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -2189,6 +2189,12 @@ static int bcm2835_codec_set_level_profile(struct bcm2835_codec_ctx *ctx, + case V4L2_MPEG_VIDEO_H264_LEVEL_4_2: + param.level = MMAL_VIDEO_LEVEL_H264_42; + break; ++ case V4L2_MPEG_VIDEO_H264_LEVEL_5_0: ++ param.level = MMAL_VIDEO_LEVEL_H264_5; ++ break; ++ case V4L2_MPEG_VIDEO_H264_LEVEL_5_1: ++ param.level = MMAL_VIDEO_LEVEL_H264_51; ++ break; + default: + /* Should never get here */ + break; +@@ -3276,7 +3282,7 @@ static int bcm2835_codec_open(struct file *file) + 1, 60); + v4l2_ctrl_new_std_menu(hdl, &bcm2835_codec_ctrl_ops, + V4L2_CID_MPEG_VIDEO_H264_LEVEL, +- V4L2_MPEG_VIDEO_H264_LEVEL_4_2, ++ V4L2_MPEG_VIDEO_H264_LEVEL_5_1, + ~(BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1B) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_1) | +@@ -3290,7 +3296,9 @@ static int bcm2835_codec_open(struct file *file) + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_2) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_1) | +- BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_2)), ++ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_2) | ++ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_5_0) | ++ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_5_1)), + V4L2_MPEG_VIDEO_H264_LEVEL_4_0); + v4l2_ctrl_new_std_menu(hdl, &bcm2835_codec_ctrl_ops, + V4L2_CID_MPEG_VIDEO_H264_PROFILE, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 16 Aug 2022 14:28:29 +0100 +Subject: [PATCH 1041/1183] configs: Add support for Cilium on 2711 64-bit + +See: https://github.com/raspberrypi/linux/issues/5127 + +Signed-off-by: Phil Elwell +--- + arch/arm64/configs/bcm2711_defconfig | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index 2c8e5e0cdab6..17246b634d6d 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -6,6 +6,7 @@ CONFIG_GENERIC_IRQ_DEBUGFS=y + CONFIG_NO_HZ=y + CONFIG_HIGH_RES_TIMERS=y + CONFIG_BPF_SYSCALL=y ++CONFIG_BPF_JIT=y + CONFIG_PREEMPT=y + CONFIG_BSD_PROCESS_ACCT=y + CONFIG_BSD_PROCESS_ACCT_V3=y +@@ -77,7 +78,8 @@ CONFIG_ZSMALLOC=m + CONFIG_NET=y + CONFIG_PACKET=y + CONFIG_UNIX=y +-CONFIG_XFRM_USER=y ++CONFIG_XFRM_USER=m ++CONFIG_XFRM_STATISTICS=y + CONFIG_NET_KEY=m + CONFIG_INET=y + CONFIG_IP_MULTICAST=y +@@ -379,6 +381,7 @@ CONFIG_NET_CLS_RSVP=m + CONFIG_NET_CLS_RSVP6=m + CONFIG_NET_CLS_FLOW=m + CONFIG_NET_CLS_CGROUP=m ++CONFIG_NET_CLS_BPF=y + CONFIG_NET_EMATCH=y + CONFIG_NET_EMATCH_CMP=m + CONFIG_NET_EMATCH_NBYTE=m +@@ -1564,9 +1567,12 @@ CONFIG_SECURITY_APPARMOR=y + CONFIG_LSM="" + CONFIG_CRYPTO_USER=m + CONFIG_CRYPTO_CHACHA20POLY1305=m ++CONFIG_CRYPTO_CBC=m + CONFIG_CRYPTO_ADIANTUM=m ++CONFIG_CRYPTO_HMAC=m + CONFIG_CRYPTO_XCBC=m + CONFIG_CRYPTO_WP512=m ++CONFIG_CRYPTO_AES=m + CONFIG_CRYPTO_CAST5=m + CONFIG_CRYPTO_DES=y + CONFIG_CRYPTO_LZ4=m +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dom Cobley +Date: Mon, 13 Jun 2022 16:47:31 +0200 +Subject: [PATCH 1042/1183] drm/vc4: plane: Remove subpixel positioning check + +[ Upstream commit 517db1ab1566dba3093dbdb8de4263ba4aa66416 ] + +There is little harm in ignoring fractional coordinates +(they just get truncated). + +Without this: +modetest -M vc4 -F tiles,gradient -s 32:1920x1080-60 -P89@74:1920x1080*.1.1@XR24 + +is rejected. We have the same issue in Kodi when trying to +use zoom options on video. + +Note: even if all coordinates are fully integer. e.g. +src:[0,0,1920,1080] dest:[-10,-10,1940,1100] + +it will still get rejected as drm_atomic_helper_check_plane_state +uses drm_rect_clip_scaled which transforms this to fractional src coords + +Fixes: 21af94cf1a4c ("drm/vc4: Add support for scaling of display planes.") +Signed-off-by: Dom Cobley +Link: https://lore.kernel.org/r/20220613144800.326124-5-maxime@cerno.tech +Signed-off-by: Maxime Ripard +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/vc4/vc4_plane.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 849385ff9761..5d8dc921bfa7 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -458,10 +458,15 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) + for (i = 0; i < num_planes; i++) + vc4_state->offsets[i] = bo->paddr + fb->offsets[i]; + +- vc4_state->src_x = state->src.x1; +- vc4_state->src_y = state->src.y1; +- vc4_state->src_w[0] = state->src.x2 - vc4_state->src_x; +- vc4_state->src_h[0] = state->src.y2 - vc4_state->src_y; ++ /* ++ * We don't support subpixel source positioning for scaling, ++ * but fractional coordinates can be generated by clipping ++ * so just round for now ++ */ ++ vc4_state->src_x = DIV_ROUND_CLOSEST(state->src.x1, 1 << 16); ++ vc4_state->src_y = DIV_ROUND_CLOSEST(state->src.y1, 1 << 16); ++ vc4_state->src_w[0] = DIV_ROUND_CLOSEST(state->src.x2, 1 << 16) - vc4_state->src_x; ++ vc4_state->src_h[0] = DIV_ROUND_CLOSEST(state->src.y2, 1 << 16) - vc4_state->src_y; + + vc4_state->crtc_x = state->dst.x1; + vc4_state->crtc_y = state->dst.y1; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Sun, 21 Aug 2022 16:36:25 +0100 +Subject: [PATCH 1043/1183] overlays: gpio-fan: Add hyst (hysteresis) param + +See: https://forums.raspberrypi.com/viewtopic.php?t=339143 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/gpio-fan-overlay.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts b/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts +index 77a7bbb41e3b..fa77c3f397f0 100644 +--- a/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts ++++ b/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts +@@ -75,5 +75,6 @@ + __overrides__ { + gpiopin = <&fan0>,"gpios:4", <&fan0>,"brcm,pins:0"; + temp = <&cpu_hot>,"temperature:0"; ++ hyst = <&cpu_hot>,"hysteresis:0"; + }; + }; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Sun, 21 Aug 2022 16:46:39 +0100 +Subject: [PATCH 1044/1183] overlays: gpio-fan: Document the hyst parameter + +See: https://forums.raspberrypi.com/viewtopic.php?t=339143 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/README | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 309642ff5244..2d54622331a5 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -1168,6 +1168,9 @@ Load: dtoverlay=gpio-fan,= + Params: gpiopin GPIO used to control the fan (default 12) + temp Temperature at which the fan switches on, in + millicelcius (default 55000) ++ hyst Temperature delta (in millicelcius) below ++ temp at which the fan will drop to minrpm ++ (default 10000) + + + Name: gpio-hog +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ashish Vara +Date: Mon, 15 Aug 2022 01:09:07 +0530 +Subject: [PATCH 1045/1183] sound: soc: bcm: Added Sound card driver for + Dacberry400 Audio card for Raspberry Pi 400 + +Added Sound card driver for DACberry400 Audio card. + +Signed-off-by: Ashish Vara +--- + sound/soc/bcm/Kconfig | 7 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/dacberry400.c | 258 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 267 insertions(+) + create mode 100644 sound/soc/bcm/dacberry400.c + +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index c85714895f1e..c865ad6f50b9 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -324,3 +324,10 @@ config SND_RPI_WM8804_SOUNDCARD + help + Say Y or M if you want to add support for the Raspberry Pi + generic driver for WM8804 based soundcards. ++ ++config SND_DACBERRY400 ++ tristate "Support for DACBERRY400 Soundcard" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_TLV320AIC3X_I2C ++ help ++ Say Y or M if you want to add support for tlv320aic3x add-on +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index 1efb734f1c86..46d1ece070a3 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -48,6 +48,7 @@ snd-soc-rpi-simple-soundcard-objs := rpi-simple-soundcard.o + snd-soc-rpi-wm8804-soundcard-objs := rpi-wm8804-soundcard.o + snd-soc-pifi-40-objs := pifi-40.o + snd-soc-chipdip-dac-objs := chipdip-dac.o ++snd-soc-dacberry400-objs := dacberry400.o + + obj-$(CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD) += snd-soc-googlevoicehat-codec.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o +@@ -80,3 +81,4 @@ obj-$(CONFIG_SND_RPI_SIMPLE_SOUNDCARD) += snd-soc-rpi-simple-soundcard.o + obj-$(CONFIG_SND_RPI_WM8804_SOUNDCARD) += snd-soc-rpi-wm8804-soundcard.o + obj-$(CONFIG_SND_BCM2708_SOC_PIFI_40) += snd-soc-pifi-40.o + obj-$(CONFIG_SND_BCM2708_SOC_CHIPDIP_DAC) += snd-soc-chipdip-dac.o ++obj-$(CONFIG_SND_DACBERRY400) += snd-soc-dacberry400.o +diff --git a/sound/soc/bcm/dacberry400.c b/sound/soc/bcm/dacberry400.c +new file mode 100644 +index 000000000000..55c2613669dd +--- /dev/null ++++ b/sound/soc/bcm/dacberry400.c +@@ -0,0 +1,258 @@ ++/* ++ * ASoC Driver for Dacberry400 soundcard ++ * Author: ++ * Ashish Vara ++ * Copyright 2022 ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "../sound/soc/codecs/tlv320aic3x.h" ++ ++static const struct snd_kcontrol_new dacberry400_controls[] = { ++ SOC_DAPM_PIN_SWITCH("MIC Jack"), ++ SOC_DAPM_PIN_SWITCH("Line In"), ++ SOC_DAPM_PIN_SWITCH("Line Out"), ++ SOC_DAPM_PIN_SWITCH("Headphone Jack"), ++}; ++ ++static const struct snd_soc_dapm_widget dacberry400_widgets[] = { ++ SND_SOC_DAPM_HP("Headphone Jack", NULL), ++ SND_SOC_DAPM_MIC("MIC Jack", NULL), ++ SND_SOC_DAPM_LINE("Line In", NULL), ++ SND_SOC_DAPM_LINE("Line Out", NULL), ++}; ++ ++static const struct snd_soc_dapm_route dacberry400_audio_map[] = { ++ {"Headphone Jack", NULL, "HPLOUT"}, ++ {"Headphone Jack", NULL, "HPROUT"}, ++ ++ {"LINE1L", NULL, "Line In"}, ++ {"LINE1R", NULL, "Line In"}, ++ ++ {"Line Out", NULL, "LLOUT"}, ++ {"Line Out", NULL, "RLOUT"}, ++ ++ {"MIC3L", NULL, "MIC Jack"}, ++ {"MIC3R", NULL, "MIC Jack"}, ++}; ++ ++static int snd_rpi_dacberry400_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); ++ struct snd_soc_component *component = codec_dai->component; ++ int ret; ++ ++ ret = snd_soc_dai_set_sysclk(codec_dai, 2, 12000000, ++ SND_SOC_CLOCK_OUT); ++ ++ if (ret && ret != -ENOTSUPP) ++ goto err; ++ ++ snd_soc_component_write(component, HPRCOM_CFG, 0x20); ++ snd_soc_component_write(component, DACL1_2_HPLOUT_VOL, 0x80); ++ snd_soc_component_write(component, DACR1_2_HPROUT_VOL, 0x80); ++err: ++ return ret; ++} ++ ++static int snd_rpi_dacberry400_set_bias_level(struct snd_soc_card *card, ++ struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) ++{ ++ struct snd_soc_pcm_runtime *rtd; ++ struct snd_soc_dai *codec_dai; ++ struct snd_soc_component *component; ++ struct dacberry_priv *aic3x; ++ u8 hpcom_reg = 0; ++ ++ rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); ++ codec_dai = asoc_rtd_to_codec(rtd, 0); ++ component = codec_dai->component; ++ aic3x = snd_soc_component_get_drvdata(component); ++ if (dapm->dev != codec_dai->dev) ++ return 0; ++ ++ switch (level) { ++ case SND_SOC_BIAS_PREPARE: ++ if (dapm->bias_level != SND_SOC_BIAS_STANDBY) ++ break; ++ /* UNMUTE ADC/DAC */ ++ hpcom_reg = snd_soc_component_read(component, HPLCOM_CFG); ++ snd_soc_component_write(component, HPLCOM_CFG, hpcom_reg | 0x20); ++ snd_soc_component_write(component, LINE1R_2_RADC_CTRL, 0x04); ++ snd_soc_component_write(component, LINE1L_2_LADC_CTRL, 0x04); ++ snd_soc_component_write(component, LADC_VOL, 0x00); ++ snd_soc_component_write(component, RADC_VOL, 0x00); ++ pr_info("%s: unmute ADC/DAC\n", __func__); ++ break; ++ ++ case SND_SOC_BIAS_STANDBY: ++ if (dapm->bias_level != SND_SOC_BIAS_PREPARE) ++ break; ++ /* MUTE ADC/DAC */ ++ snd_soc_component_write(component, LDAC_VOL, 0x80); ++ snd_soc_component_write(component, RDAC_VOL, 0x80); ++ snd_soc_component_write(component, LADC_VOL, 0x80); ++ snd_soc_component_write(component, RADC_VOL, 0x80); ++ snd_soc_component_write(component, LINE1R_2_RADC_CTRL, 0x00); ++ snd_soc_component_write(component, LINE1L_2_LADC_CTRL, 0x00); ++ snd_soc_component_write(component, HPLCOM_CFG, 0x00); ++ pr_info("%s: mute ADC/DAC\n", __func__); ++ break; ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++static int snd_rpi_dacberry400_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ int ret = 0; ++ u8 data; ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); ++ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); ++ struct snd_soc_component *component = codec_dai->component; ++ int fsref = (params_rate(params) % 11025 == 0) ? 44100 : 48000; ++ int channels = params_channels(params); ++ int width = 32; ++ u8 clock = 0; ++ ++ data = (LDAC2LCH | RDAC2RCH); ++ data |= (fsref == 44100) ? FSREF_44100 : FSREF_48000; ++ if (params_rate(params) >= 64000) ++ data |= DUAL_RATE_MODE; ++ ret = snd_soc_component_write(component, 0x7, data); ++ width = params_width(params); ++ ++ clock = snd_soc_component_read(component, 2); ++ ++ ret = snd_soc_dai_set_bclk_ratio(cpu_dai, channels*width); ++ ++ return ret; ++} ++ ++static const struct snd_soc_ops snd_rpi_dacberry400_ops = { ++ .hw_params = snd_rpi_dacberry400_hw_params, ++}; ++ ++ ++SND_SOC_DAILINK_DEFS(rpi_dacberry400, ++ DAILINK_COMP_ARRAY(COMP_CPU("bcm2835-i2s.0")), ++ DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x.1-0018", "tlv320aic3x-hifi")), ++ DAILINK_COMP_ARRAY(COMP_PLATFORM("bcm2835-i2s.0"))); ++ ++static struct snd_soc_dai_link snd_rpi_dacberry400_dai[] = { ++{ ++ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ .init = snd_rpi_dacberry400_init, ++ .ops = &snd_rpi_dacberry400_ops, ++ .symmetric_rate = 1, ++ SND_SOC_DAILINK_REG(rpi_dacberry400), ++}, ++}; ++ ++static struct snd_soc_card snd_rpi_dacberry400 = { ++ .owner = THIS_MODULE, ++ .dai_link = snd_rpi_dacberry400_dai, ++ .num_links = ARRAY_SIZE(snd_rpi_dacberry400_dai), ++ .controls = dacberry400_controls, ++ .num_controls = ARRAY_SIZE(dacberry400_controls), ++ .dapm_widgets = dacberry400_widgets, ++ .num_dapm_widgets = ARRAY_SIZE(dacberry400_widgets), ++ .dapm_routes = dacberry400_audio_map, ++ .num_dapm_routes = ARRAY_SIZE(dacberry400_audio_map), ++ .set_bias_level = snd_rpi_dacberry400_set_bias_level, ++}; ++ ++static int snd_rpi_dacberry400_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_rpi_dacberry400.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_card *card = &snd_rpi_dacberry400; ++ struct snd_soc_dai_link *dai = &snd_rpi_dacberry400_dai[0]; ++ ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ if (i2s_node) { ++ dai->cpus->dai_name = NULL; ++ dai->cpus->of_node = i2s_node; ++ dai->platforms->name = NULL; ++ dai->platforms->of_node = i2s_node; ++ of_node_put(i2s_node); ++ } ++ ++ if (of_property_read_string(pdev->dev.of_node, "card_name", ++ &card->name)) ++ card->name = "tlvaudioCODEC"; ++ ++ if (of_property_read_string(pdev->dev.of_node, "dai_name", ++ &dai->name)) ++ dai->name = "tlvaudio CODEC"; ++ ++ } ++ ++ ret = snd_soc_register_card(&snd_rpi_dacberry400); ++ if (ret) { ++ if (ret != -EPROBE_DEFER) ++ dev_err(&pdev->dev, ++ "snd_soc_register_card() failed: %d\n", ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int snd_rpi_dacberry400_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_rpi_dacberry400); ++} ++ ++static const struct of_device_id dacberry400_match_id[] = { ++ { .compatible = "osaelectronics,dacberry400",}, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, dacberry400_match_id); ++ ++static struct platform_driver snd_rpi_dacberry400_driver = { ++ .driver = { ++ .name = "snd-rpi-dacberry400", ++ .owner = THIS_MODULE, ++ .of_match_table = dacberry400_match_id, ++ }, ++ .probe = snd_rpi_dacberry400_probe, ++ .remove = snd_rpi_dacberry400_remove, ++}; ++ ++module_platform_driver(snd_rpi_dacberry400_driver); ++ ++MODULE_AUTHOR("Ashish Vara"); ++MODULE_DESCRIPTION("Dacberry400 sound card driver"); ++MODULE_LICENSE("GPL"); ++MODULE_ALIAS("platform:dacberry400"); ++MODULE_SOFTDEP("pre: snd-soc-tlv320aic3x"); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ashish Vara +Date: Mon, 22 Aug 2022 13:11:37 +0530 +Subject: [PATCH 1046/1183] overlays: Add dacberry400 + +Added overlay file for dacberry400 audio card. + +Signed-off-by: Ashish Vara +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 ++ + .../boot/dts/overlays/dacberry400-overlay.dts | 71 +++++++++++++++++++ + 3 files changed, 78 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/dacberry400-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 74e76db75a2c..4bbe05ed9760 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -40,6 +40,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + chipdip-dac.dtbo \ + cma.dtbo \ + cutiepi-panel.dtbo \ ++ dacberry400.dtbo \ + dht11.dtbo \ + dionaudio-kiwi.dtbo \ + dionaudio-loco.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 2d54622331a5..3152c2354670 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -789,6 +789,12 @@ Load: dtoverlay=cutiepi-panel + Params: + + ++Name: dacberry400 ++Info: Configures the dacberry400 add on soundcard ++Load: dtoverlay=dacberry400 ++Params: ++ ++ + Name: dht11 + Info: Overlay for the DHT11/DHT21/DHT22 humidity/temperature sensors + Also sometimes found with the part number(s) AM230x. +diff --git a/arch/arm/boot/dts/overlays/dacberry400-overlay.dts b/arch/arm/boot/dts/overlays/dacberry400-overlay.dts +new file mode 100644 +index 000000000000..4e03baadbd71 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/dacberry400-overlay.dts +@@ -0,0 +1,71 @@ ++// Definitions for DACberry400 ++/dts-v1/; ++/plugin/; ++/ { ++ compatible = "brcm,bcm2835"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target-path = "/"; ++ __overlay__ { ++ codec_1v8_reg: codec-1v8-reg { ++ compatible = "regulator-fixed"; ++ regulator-name = "tlv320aic3104_1v8"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&gpio>; ++ __overlay__ { ++ codec_rst: codec-rst { ++ brcm,pins = <26>; ++ brcm,function = <1>; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ tlv320aic3104@18 { ++ #sound-dai-cells = <0>; ++ reg = <0x18>; ++ ++ compatible = "ti,tlv320aic3x"; ++ AVDD-supply = <&vdd_3v3_reg>; ++ DRVDD-supply = <&vdd_3v3_reg>; ++ DVDD-supply = <&codec_1v8_reg>; ++ IOVDD-supply = <&codec_1v8_reg>; ++ ++ gpio-controller; ++ reset-gpios = <&gpio 26 1>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@4 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "osaelectronics,dacberry400"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++}; ++ ++ +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ashish Vara +Date: Mon, 22 Aug 2022 13:51:12 +0530 +Subject: [PATCH 1047/1183] configs: Enable DACBERRY400 + +Signed-off-by: Ashish Vara +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcm2711_defconfig | 1 + + arch/arm64/configs/bcm2711_defconfig | 1 + + arch/arm64/configs/bcmrpi3_defconfig | 1 + + 4 files changed, 4 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 9d4710c2df87..985722d0d858 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1039,6 +1039,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m + CONFIG_SND_BCM2708_SOC_ALLO_KATANA_DAC=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_PISOUND=m ++CONFIG_SND_DACBERRY400=m + CONFIG_SND_SOC_AD193X_SPI=m + CONFIG_SND_SOC_AD193X_I2C=m + CONFIG_SND_SOC_ADAU1701=m +diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig +index 47c3a3c94ee6..cbf7a2965615 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -1058,6 +1058,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m + CONFIG_SND_BCM2708_SOC_ALLO_KATANA_DAC=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_PISOUND=m ++CONFIG_SND_DACBERRY400=m + CONFIG_SND_SOC_AD193X_SPI=m + CONFIG_SND_SOC_AD193X_I2C=m + CONFIG_SND_SOC_ADAU1701=m +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index 17246b634d6d..62191389d52b 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -1068,6 +1068,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m + CONFIG_SND_BCM2708_SOC_ALLO_KATANA_DAC=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_PISOUND=m ++CONFIG_SND_DACBERRY400=m + CONFIG_SND_SOC_AD193X_SPI=m + CONFIG_SND_SOC_AD193X_I2C=m + CONFIG_SND_SOC_ADAU1701=m +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index 9d3d4e6842d9..96be5e202550 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -1005,6 +1005,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m + CONFIG_SND_BCM2708_SOC_ALLO_KATANA_DAC=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_PISOUND=m ++CONFIG_SND_DACBERRY400=m + CONFIG_SND_SOC_AD193X_SPI=m + CONFIG_SND_SOC_AD193X_I2C=m + CONFIG_SND_SOC_ADAU1701=m +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: AMuszkat <53743735+AMuszkat@users.noreply.github.com> +Date: Tue, 23 Aug 2022 09:25:53 +0200 +Subject: [PATCH 1048/1183] overlays: merus-amp: Set GPIO 8 as input np + +Set GPIO 8 as input np for proper msel configuration at boot up. +--- + arch/arm/boot/dts/overlays/merus-amp-overlay.dts | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/merus-amp-overlay.dts b/arch/arm/boot/dts/overlays/merus-amp-overlay.dts +index 4501fbdc253d..ec5c7c28f728 100644 +--- a/arch/arm/boot/dts/overlays/merus-amp-overlay.dts ++++ b/arch/arm/boot/dts/overlays/merus-amp-overlay.dts +@@ -5,7 +5,6 @@ + #include + #include + +- + / { + compatible = "brcm,bcm2835"; + +@@ -20,9 +19,9 @@ + target = <&gpio>; + __overlay__ { + merus_amp_pins: merus_amp_pins { +- brcm,pins = <23>; +- brcm,function = <0>; /* in */ +- brcm,pull = <2>; /* up */ ++ brcm,pins = <23 8>; ++ brcm,function = <0 0>; ++ brcm,pull = <2 0>; + }; + }; + }; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 3 Feb 2022 15:51:41 +0000 +Subject: [PATCH 1049/1183] net: phy: lan87xx: Decrease phy polling rate + +Polling at 100Hz for 1.5s consumes quite a bit of kworker time with no +obvious benefit. Reduce that polling rate to ~6Hz. + +To further save CPU and power, defer the next poll if no energy is +detected. + +See: https://github.com/raspberrypi/linux/issues/4780 + +Signed-off-by: Phil Elwell +--- + drivers/net/phy/smsc.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c +index 2004bc0dae60..960382c3d717 100644 +--- a/drivers/net/phy/smsc.c ++++ b/drivers/net/phy/smsc.c +@@ -220,6 +220,8 @@ static int lan87xx_read_status(struct phy_device *phydev) + int err = genphy_read_status(phydev); + + if (!phydev->link && priv->energy_enable && phydev->irq == PHY_POLL) { ++ int energy_detected; ++ + /* Disable EDPD to wake up PHY */ + int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS); + if (rc < 0) +@@ -235,7 +237,7 @@ static int lan87xx_read_status(struct phy_device *phydev) + */ + read_poll_timeout(phy_read, rc, + rc & MII_LAN83C185_ENERGYON || rc < 0, +- 10000, 1500000, true, phydev, ++ 150000, 1500000, true, phydev, + MII_LAN83C185_CTRL_STATUS); + if (rc < 0) + return rc; +@@ -245,10 +247,16 @@ static int lan87xx_read_status(struct phy_device *phydev) + if (rc < 0) + return rc; + ++ energy_detected = !!(rc & MII_LAN83C185_ENERGYON); ++ + rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS, + rc | MII_LAN83C185_EDPWRDOWN); + if (rc < 0) + return rc; ++ ++ /* Save CPU and power by deferring the next poll */ ++ if (!energy_detected) ++ msleep(2000); + } + + return err; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jonathan Bell +Date: Mon, 16 May 2022 10:28:27 +0100 +Subject: [PATCH 1050/1183] mmc: block: Don't do single-sector reads during + recovery + +See https://github.com/raspberrypi/linux/issues/5019 + +If an SD card has degraded performance such that IO operations time out +then the MMC block layer will leak SG DMA mappings in the swiotlb during +recovery. It retries the same SG and this causes the leak, as it is +mapped twice - once in sdhci_pre_req() and again during single-block +reads in sdhci_prepare_data(). + +Resetting the card (including power-cycling if a regulator for vmmc is +present) ought to be enough to recover a stuck state, so for now don't +try single-block reads in the recovery path. + +Signed-off-by: Jonathan Bell +--- + drivers/mmc/core/block.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c +index 64ec07b29de8..277b16d926ed 100644 +--- a/drivers/mmc/core/block.c ++++ b/drivers/mmc/core/block.c +@@ -1870,7 +1870,7 @@ static void mmc_blk_mq_rw_recovery(struct mmc_queue *mq, struct request *req) + return; + } + +- if (rq_data_dir(req) == READ && brq->data.blocks > ++ if (0 && rq_data_dir(req) == READ && brq->data.blocks > + queue_physical_block_size(mq->queue) >> 9) { + /* Read one (native) sector at a time */ + mmc_blk_read_single(mq, req); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Joerg Schambacher +Date: Wed, 24 Aug 2022 11:41:36 +0200 +Subject: [PATCH 1051/1183] rpi-simple-soundcard: limits sample rate of Merus + Amp board + +Adding a dedicated hw_params function to limit the maximum sample +rate of the IFX/Merus board to 48000ksps. + +Thanks to Ariel Muszkat for the support. + +Signed-off-by: Joerg Schambacher +--- + sound/soc/bcm/rpi-simple-soundcard.c | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/bcm/rpi-simple-soundcard.c b/sound/soc/bcm/rpi-simple-soundcard.c +index fd1e42956066..85ef1a2207f4 100644 +--- a/sound/soc/bcm/rpi-simple-soundcard.c ++++ b/sound/soc/bcm/rpi-simple-soundcard.c +@@ -145,6 +145,26 @@ static struct snd_soc_ops snd_rpi_simple_ops = { + .hw_params = snd_rpi_simple_hw_params, + }; + ++static int snd_merus_amp_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); ++ int rate; ++ ++ rate = params_rate(params); ++ if (rate > 48000) { ++ dev_err(rtd->card->dev, ++ "Unsupported samplerate %d\n", ++ rate); ++ return -EINVAL; ++ } ++ return 0; ++} ++ ++static struct snd_soc_ops snd_merus_amp_ops = { ++ .hw_params = snd_merus_amp_hw_params, ++}; ++ + enum adau1977_clk_id { + ADAU1977_SYSCLK, + }; +@@ -340,13 +360,14 @@ static struct snd_rpi_simple_drvdata drvdata_rpi_dac = { + + SND_SOC_DAILINK_DEFS(merus_amp, + DAILINK_COMP_ARRAY(COMP_EMPTY()), +- DAILINK_COMP_ARRAY(COMP_CODEC("ma120x0p.1-0020","ma120x0p-amp")), ++ DAILINK_COMP_ARRAY(COMP_CODEC("ma120x0p.1-0020", "ma120x0p-amp")), + DAILINK_COMP_ARRAY(COMP_EMPTY())); + + static struct snd_soc_dai_link snd_merus_amp_dai[] = { + { + .name = "MerusAmp", + .stream_name = "Merus Audio Amp", ++ .ops = &snd_merus_amp_ops, + .dai_fmt = SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell <8911409+pelwell@users.noreply.github.com> +Date: Wed, 24 Aug 2022 11:14:40 +0100 +Subject: [PATCH 1052/1183] drm/vc4: Add async update support for cursor planes + +Now that cursors are implemented as regular planes, all cursor +movements result in atomic updates. As the firmware-kms driver +doesn't support asynchronous updates, these are synchronous, which +limits the update rate to the screen refresh rate. Xorg seems unaware +of this (or at least of the effect of this), because if the mouse is +configured with a higher update rate than the screen then continuous +mouse movement results in an increasing backlog of mouse events - +cue extreme lag. + +Add minimal support for asynchronous updates - limited to cursor +planes - to eliminate the lag. + +See: https://github.com/raspberrypi/linux/pull/4971 + https://github.com/raspberrypi/linux/issues/4988 + +Signed-off-by: Phil Elwell +--- + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 46 ++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +index 99e379c9812b..94df930b3232 100644 +--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -672,6 +672,50 @@ static int vc4_plane_atomic_check(struct drm_plane *plane, + return vc4_plane_to_mb(plane, &vc4_plane->mb, new_plane_state); + } + ++static void vc4_plane_atomic_async_update(struct drm_plane *plane, ++ struct drm_atomic_state *state) ++{ ++ struct drm_plane_state *new_plane_state = ++ drm_atomic_get_new_plane_state(state, plane); ++ ++ swap(plane->state->fb, new_plane_state->fb); ++ plane->state->crtc_x = new_plane_state->crtc_x; ++ plane->state->crtc_y = new_plane_state->crtc_y; ++ plane->state->crtc_w = new_plane_state->crtc_w; ++ plane->state->crtc_h = new_plane_state->crtc_h; ++ plane->state->src_x = new_plane_state->src_x; ++ plane->state->src_y = new_plane_state->src_y; ++ plane->state->src_w = new_plane_state->src_w; ++ plane->state->src_h = new_plane_state->src_h; ++ plane->state->alpha = new_plane_state->alpha; ++ plane->state->pixel_blend_mode = new_plane_state->pixel_blend_mode; ++ plane->state->rotation = new_plane_state->rotation; ++ plane->state->zpos = new_plane_state->zpos; ++ plane->state->normalized_zpos = new_plane_state->normalized_zpos; ++ plane->state->color_encoding = new_plane_state->color_encoding; ++ plane->state->color_range = new_plane_state->color_range; ++ plane->state->src = new_plane_state->src; ++ plane->state->dst = new_plane_state->dst; ++ plane->state->visible = new_plane_state->visible; ++ ++ vc4_plane_set_blank(plane, false); ++} ++ ++static int vc4_plane_atomic_async_check(struct drm_plane *plane, ++ struct drm_atomic_state *state) ++{ ++ struct drm_plane_state *new_plane_state = ++ drm_atomic_get_new_plane_state(state, plane); ++ int ret = -EINVAL; ++ ++ if (plane->type == 2 && ++ plane->state->fb && ++ new_plane_state->crtc->state->active) ++ ret = 0; ++ ++ return ret; ++} ++ + /* Called during init to allocate the plane's atomic state. */ + static void vc4_plane_reset(struct drm_plane *plane) + { +@@ -766,6 +810,8 @@ static const struct drm_plane_helper_funcs vc4_plane_helper_funcs = { + .atomic_check = vc4_plane_atomic_check, + .atomic_update = vc4_plane_atomic_update, + .atomic_disable = vc4_plane_atomic_disable, ++ .atomic_async_check = vc4_plane_atomic_async_check, ++ .atomic_async_update = vc4_plane_atomic_async_update, + }; + + static struct drm_plane *vc4_fkms_plane_init(struct drm_device *dev, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 26 Aug 2022 10:12:58 +0100 +Subject: [PATCH 1053/1183] Revert "usbnet: smsc95xx: Avoid link settings race + on interrupt reception" + +This reverts commit 09201006dac9bf11a8e6755a11c74d5bccd54e7c. + +See: https://github.com/raspberrypi/linux/issues/5145 + +Signed-off-by: Phil Elwell +--- + drivers/net/usb/smsc95xx.c | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index 7b0d7dc531c0..220026c0b50e 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -577,7 +577,7 @@ static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev) + return smsc95xx_write_reg(dev, AFC_CFG, afc_cfg); + } + +-static void smsc95xx_mac_update_fullduplex(struct usbnet *dev) ++static int smsc95xx_link_reset(struct usbnet *dev) + { + struct smsc95xx_priv *pdata = dev->driver_priv; + unsigned long flags; +@@ -594,16 +594,14 @@ static void smsc95xx_mac_update_fullduplex(struct usbnet *dev) + spin_unlock_irqrestore(&pdata->mac_cr_lock, flags); + + ret = smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr); +- if (ret < 0) { +- if (ret != -ENODEV) +- netdev_warn(dev->net, +- "Error updating MAC full duplex mode\n"); +- return; +- } ++ if (ret < 0) ++ return ret; + + ret = smsc95xx_phy_update_flowcontrol(dev); + if (ret < 0) + netdev_warn(dev->net, "Error updating PHY flow control\n"); ++ ++ return ret; + } + + static void smsc95xx_status(struct usbnet *dev, struct urb *urb) +@@ -620,7 +618,7 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) + netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata); + + if (intdata & INT_ENP_PHY_INT_) +- ; ++ usbnet_defer_kevent(dev, EVENT_LINK_RESET); + else + netdev_warn(dev->net, "unexpected interrupt, intdata=0x%08X\n", + intdata); +@@ -1128,7 +1126,6 @@ static void smsc95xx_handle_link_change(struct net_device *net) + struct usbnet *dev = netdev_priv(net); + + phy_print_status(net->phydev); +- smsc95xx_mac_update_fullduplex(dev); + usbnet_defer_kevent(dev, EVENT_LINK_CHANGE); + } + +@@ -2036,6 +2033,7 @@ static const struct driver_info smsc95xx_info = { + .description = "smsc95xx USB 2.0 Ethernet", + .bind = smsc95xx_bind, + .unbind = smsc95xx_unbind, ++ .link_reset = smsc95xx_link_reset, + .reset = smsc95xx_reset, + .check_connect = smsc95xx_start_phy, + .stop = smsc95xx_stop, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 26 Aug 2022 10:13:27 +0100 +Subject: [PATCH 1054/1183] Revert "usbnet: smsc95xx: Don't clear read-only PHY + interrupt" + +This reverts commit 04887243887630f2478a330730d13d87a079b6c8. + +See: https://github.com/raspberrypi/linux/issues/5145 + +Signed-off-by: Phil Elwell +--- + drivers/net/usb/smsc95xx.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index 220026c0b50e..64ad4f1daee4 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -583,6 +583,10 @@ static int smsc95xx_link_reset(struct usbnet *dev) + unsigned long flags; + int ret; + ++ ret = smsc95xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL_); ++ if (ret < 0) ++ return ret; ++ + spin_lock_irqsave(&pdata->mac_cr_lock, flags); + if (pdata->phydev->duplex != DUPLEX_FULL) { + pdata->mac_cr &= ~MAC_CR_FDPX_; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 25 Aug 2022 12:16:37 +0100 +Subject: [PATCH 1055/1183] defconfigs: Add CONFIG_MUX_GPIO. + +This config was missed from +06ccedb39414 ("defconfigs: Add VIDEO_MUX to all defconfigs") +so we had the mux framework, but not the control of GPIOs. + +Signed-off-by: Dave Stevenson +--- + 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 985722d0d858..d5b4a5d49151 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1403,6 +1403,7 @@ CONFIG_PWM_BCM2835=m + CONFIG_PWM_PCA9685=m + CONFIG_PWM_RASPBERRYPI_POE=m + CONFIG_RPI_AXIPERF=m ++CONFIG_MUX_GPIO=m + CONFIG_EXT4_FS=y + CONFIG_EXT4_FS_POSIX_ACL=y + CONFIG_EXT4_FS_SECURITY=y +diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig +index cbf7a2965615..4aa61225fd51 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -1427,6 +1427,7 @@ CONFIG_PWM_PCA9685=m + CONFIG_PWM_RASPBERRYPI_POE=m + CONFIG_RPI_AXIPERF=m + CONFIG_NVMEM_RMEM=m ++CONFIG_MUX_GPIO=m + CONFIG_EXT4_FS=y + CONFIG_EXT4_FS_POSIX_ACL=y + CONFIG_EXT4_FS_SECURITY=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index c62199977b7d..fc3e2c3dac8c 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1395,6 +1395,7 @@ CONFIG_PWM_BCM2835=m + CONFIG_PWM_PCA9685=m + CONFIG_PWM_RASPBERRYPI_POE=m + CONFIG_RPI_AXIPERF=m ++CONFIG_MUX_GPIO=m + CONFIG_EXT4_FS=y + CONFIG_EXT4_FS_POSIX_ACL=y + CONFIG_EXT4_FS_SECURITY=y +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index 62191389d52b..6ea6ca64ebe0 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -1444,6 +1444,7 @@ CONFIG_ANDROID=y + CONFIG_ANDROID_BINDER_IPC=y + CONFIG_ANDROID_BINDERFS=y + CONFIG_NVMEM_RMEM=m ++CONFIG_MUX_GPIO=m + CONFIG_EXT4_FS=y + CONFIG_EXT4_FS_POSIX_ACL=y + CONFIG_EXT4_FS_SECURITY=y +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index 96be5e202550..f230ddb4675a 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -1343,6 +1343,7 @@ CONFIG_ANDROID=y + CONFIG_ANDROID_BINDER_IPC=y + CONFIG_ANDROID_BINDERFS=y + CONFIG_NVMEM_RMEM=m ++CONFIG_MUX_GPIO=m + CONFIG_EXT4_FS=y + CONFIG_EXT4_FS_POSIX_ACL=y + CONFIG_EXT4_FS_SECURITY=y +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lee Jackson +Date: Fri, 26 Aug 2022 11:41:49 +0800 +Subject: [PATCH 1056/1183] media: i2c: arducam-pivariety: Add custom controls + +Add support for strobe_shift, strobe_width and mode custom controls. + +Signed-off-by: Lee Jackson +--- + drivers/media/i2c/arducam-pivariety.c | 6 ++++++ + drivers/media/i2c/arducam-pivariety.h | 3 +++ + 2 files changed, 9 insertions(+) + +diff --git a/drivers/media/i2c/arducam-pivariety.c b/drivers/media/i2c/arducam-pivariety.c +index 3d2af2d96496..ef82f282654d 100644 +--- a/drivers/media/i2c/arducam-pivariety.c ++++ b/drivers/media/i2c/arducam-pivariety.c +@@ -1140,6 +1140,12 @@ static const char *pivariety_ctrl_get_name(u32 id) + return "trigger_mode"; + case V4L2_CID_ARDUCAM_IRCUT: + return "ircut"; ++ case V4L2_CID_ARDUCAM_STROBE_SHIFT: ++ return "strobe_shift"; ++ case V4L2_CID_ARDUCAM_STROBE_WIDTH: ++ return "strobe_width"; ++ case V4L2_CID_ARDUCAM_MODE: ++ return "mode"; + default: + return NULL; + } +diff --git a/drivers/media/i2c/arducam-pivariety.h b/drivers/media/i2c/arducam-pivariety.h +index b2b8cbc47138..99d5ada309e8 100644 +--- a/drivers/media/i2c/arducam-pivariety.h ++++ b/drivers/media/i2c/arducam-pivariety.h +@@ -52,6 +52,9 @@ + #define V4L2_CID_ARDUCAM_BASE (V4L2_CID_USER_BASE + 0x1000) + #define V4L2_CID_ARDUCAM_EXT_TRI (V4L2_CID_ARDUCAM_BASE + 1) + #define V4L2_CID_ARDUCAM_IRCUT (V4L2_CID_ARDUCAM_BASE + 8) ++#define V4L2_CID_ARDUCAM_STROBE_SHIFT (V4L2_CID_ARDUCAM_BASE + 14) ++#define V4L2_CID_ARDUCAM_STROBE_WIDTH (V4L2_CID_ARDUCAM_BASE + 15) ++#define V4L2_CID_ARDUCAM_MODE (V4L2_CID_ARDUCAM_BASE + 16) + + enum image_dt { + IMAGE_DT_YUV420_8 = 0x18, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 30 Aug 2022 09:35:48 +0100 +Subject: [PATCH 1057/1183] configs: Add LAN7430 driver on BCM2711 + +See: https://github.com/raspberrypi/linux/issues/4117 + +Signed-off-by: Phil Elwell +--- + 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 4aa61225fd51..34df1b94ae11 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -514,6 +514,7 @@ CONFIG_VETH=m + CONFIG_NET_VRF=m + CONFIG_BCMGENET=y + CONFIG_ENC28J60=m ++CONFIG_LAN743X=m + CONFIG_QCA7000_SPI=m + CONFIG_QCA7000_UART=m + CONFIG_R8169=m +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index 6ea6ca64ebe0..b2e7ba8c3275 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -518,6 +518,7 @@ CONFIG_NET_VRF=m + CONFIG_VSOCKMON=m + CONFIG_BCMGENET=y + CONFIG_ENC28J60=m ++CONFIG_LAN743X=m + CONFIG_QCA7000_SPI=m + CONFIG_QCA7000_UART=m + CONFIG_R8169=m +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: rlcamp +Date: Wed, 31 Aug 2022 05:47:41 -0700 +Subject: [PATCH 1058/1183] overlays: Add a pull (up/down) parameter to + pps-gpio + +Square wave output from RTCs such as the DS3231 requires a pullup +resistor. This commit allows the pin's internal pull resistors to be +used by specifying "pull=up" or "pull=down" as necessary. +--- + arch/arm/boot/dts/overlays/README | 2 ++ + arch/arm/boot/dts/overlays/pps-gpio-overlay.dts | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 3152c2354670..f95848125540 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -3102,6 +3102,8 @@ Params: gpiopin Input GPIO (default "18") + off) + capture_clear Generate clear events on the trailing edge + (default off) ++ pull Desired pull-up/down state (off, down, up) ++ Default is "off". + + + Name: pwm +diff --git a/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts b/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts +index 524a1c1d3670..a4f6b868aad8 100644 +--- a/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts +@@ -34,5 +34,6 @@ + <&pps_pins>,"reg:0"; + assert_falling_edge = <&pps>,"assert-falling-edge?"; + capture_clear = <&pps>,"capture-clear?"; ++ pull = <&pps_pins>,"brcm,pull:0"; + }; + }; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Peter Rosin +Date: Mon, 25 Apr 2022 22:35:50 +0200 +Subject: [PATCH 1059/1183] hwmon: (lm75) Add Atmel AT30TS74 support + +commit c851b715d38de0c262a63de16ad954ed39b47aca upstream. + +Atmel (now Microchip) AT30TS74 is an LM75 compatible sensor. Add it. + +Signed-off-by: Peter Rosin +Link: https://lore.kernel.org/r/9494dfbc-f506-3e94-501d-6760c487c93d@axentia.se +Signed-off-by: Guenter Roeck +--- + drivers/hwmon/Kconfig | 1 + + drivers/hwmon/lm75.c | 14 ++++++++++++++ + 2 files changed, 15 insertions(+) + +diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig +index 09effe73c111..996cdc103639 100644 +--- a/drivers/hwmon/Kconfig ++++ b/drivers/hwmon/Kconfig +@@ -1222,6 +1222,7 @@ config SENSORS_LM75 + temperature sensor chip, with models including: + + - Analog Devices ADT75 ++ - Atmel (now Microchip) AT30TS74 + - Dallas Semiconductor DS75, DS1775 and DS7505 + - Global Mixed-mode Technology (GMT) G751 + - Maxim MAX6625 and MAX6626 +diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c +index afdbb63237b9..66dc826f7962 100644 +--- a/drivers/hwmon/lm75.c ++++ b/drivers/hwmon/lm75.c +@@ -26,6 +26,7 @@ + + enum lm75_type { /* keep sorted in alphabetical order */ + adt75, ++ at30ts74, + ds1775, + ds75, + ds7505, +@@ -128,6 +129,14 @@ static const struct lm75_params device_params[] = { + .default_resolution = 12, + .default_sample_time = MSEC_PER_SEC / 10, + }, ++ [at30ts74] = { ++ .set_mask = 3 << 5, /* 12-bit mode*/ ++ .default_resolution = 12, ++ .default_sample_time = 200, ++ .num_sample_times = 4, ++ .sample_times = (unsigned int []){ 25, 50, 100, 200 }, ++ .resolutions = (u8 []) {9, 10, 11, 12 }, ++ }, + [ds1775] = { + .clr_mask = 3 << 5, + .set_mask = 2 << 5, /* 11-bit mode */ +@@ -645,6 +654,7 @@ static int lm75_probe(struct i2c_client *client) + + static const struct i2c_device_id lm75_ids[] = { + { "adt75", adt75, }, ++ { "at30ts74", at30ts74, }, + { "ds1775", ds1775, }, + { "ds75", ds75, }, + { "ds7505", ds7505, }, +@@ -680,6 +690,10 @@ static const struct of_device_id __maybe_unused lm75_of_match[] = { + .compatible = "adi,adt75", + .data = (void *)adt75 + }, ++ { ++ .compatible = "atmel,at30ts74", ++ .data = (void *)at30ts74 ++ }, + { + .compatible = "dallas,ds1775", + .data = (void *)ds1775 +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 11 Aug 2022 13:49:16 +0100 +Subject: [PATCH 1060/1183] drm/vc4: Configure the HVS COB allocations + +The HVS Composite Output Buffer (COB) is the memory used to +generate the output pixel data. +Until now the vc4 driver has been relying on the firmware to +have set these to sensible values. + +In testing triple screen support it has been noted that only +1 line was being assigned to HVS channel 2. Whilst that is fine +for the transposer (TXP), and indeed needed as only some pixels +have an alpha channel, it is insufficient to run a live display. + +Split the COB more evenly between the 3 HVS channels. + +Signed-off-by: Dave Stevenson + +Revert vc4_regs change +--- + drivers/gpu/drm/vc4/vc4_hvs.c | 56 ++++++++++++++++++++++++++++++++++- + 1 file changed, 55 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c +index b0acdff916b8..8bfb9dcb4ba7 100644 +--- a/drivers/gpu/drm/vc4/vc4_hvs.c ++++ b/drivers/gpu/drm/vc4/vc4_hvs.c +@@ -879,7 +879,7 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) + struct vc4_hvs *hvs = NULL; + int ret; + u32 dispctrl; +- u32 reg; ++ u32 reg, top; + + hvs = devm_kzalloc(&pdev->dev, sizeof(*hvs), GFP_KERNEL); + if (!hvs) +@@ -1003,6 +1003,60 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) + + HVS_WRITE(SCALER_DISPCTRL, dispctrl); + ++ /* Recompute Composite Output Buffer (COB) allocations for the displays ++ */ ++ if (!vc4->is_vc5) { ++ /* The COB is 20736 pixels, or just over 10 lines at 2048 wide. ++ * The bottom 2048 pixels are full 32bpp RGBA (intended for the ++ * TXP composing RGBA to memory), whilst the remainder are only ++ * 24bpp RGB. ++ * ++ * Assign 3 lines to channels 1 & 2, and just over 4 lines to ++ * channel 0. ++ */ ++ #define VC4_COB_SIZE 20736 ++ #define VC4_COB_LINE_WIDTH 2048 ++ #define VC4_COB_NUM_LINES 3 ++ reg = 0; ++ top = VC4_COB_LINE_WIDTH * VC4_COB_NUM_LINES; ++ reg |= (top - 1) << 16; ++ HVS_WRITE(SCALER_DISPBASE2, reg); ++ reg = top; ++ top += VC4_COB_LINE_WIDTH * VC4_COB_NUM_LINES; ++ reg |= (top - 1) << 16; ++ HVS_WRITE(SCALER_DISPBASE1, reg); ++ reg = top; ++ top = VC4_COB_SIZE; ++ reg |= (top - 1) << 16; ++ HVS_WRITE(SCALER_DISPBASE0, reg); ++ } else { ++ /* The COB is 44416 pixels, or 10.8 lines at 4096 wide. ++ * The bottom 4096 pixels are full RGBA (intended for the TXP ++ * composing RGBA to memory), whilst the remainder are only ++ * RGB. Addressing is always pixel wide. ++ * ++ * Assign 3 lines of 4096 to channels 1 & 2, and just over 4 ++ * lines. to channel 0. ++ */ ++ #define VC5_COB_SIZE 44416 ++ #define VC5_COB_LINE_WIDTH 4096 ++ #define VC5_COB_NUM_LINES 3 ++ reg = 0; ++ top = VC5_COB_LINE_WIDTH * VC5_COB_NUM_LINES; ++ reg |= top << 16; ++ HVS_WRITE(SCALER_DISPBASE2, reg); ++ top += 16; ++ reg = top; ++ top += VC5_COB_LINE_WIDTH * VC5_COB_NUM_LINES; ++ reg |= top << 16; ++ HVS_WRITE(SCALER_DISPBASE1, reg); ++ top += 16; ++ reg = top; ++ top = VC5_COB_SIZE; ++ reg |= top << 16; ++ HVS_WRITE(SCALER_DISPBASE0, reg); ++ } ++ + ret = devm_request_irq(dev, platform_get_irq(pdev, 0), + vc4_hvs_irq_handler, 0, "vc4 hvs", drm); + if (ret) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 11 Aug 2022 13:59:34 +0100 +Subject: [PATCH 1061/1183] drm/vc4: Set AXI panic modes for the HVS + +The HVS can change AXI request mode based on how full the COB +FIFOs are. +Until now the vc4 driver has been relying on the firmware to +have set these to sensible values. + +With HVS channel 2 now being used for live video, change the +panic mode for all channels to be explicitly set by the driver, +and the same for all channels. + +Signed-off-by: Dave Stevenson +--- + drivers/gpu/drm/vc4/vc4_hvs.c | 11 +++++++++++ + drivers/gpu/drm/vc4/vc4_regs.h | 6 ++++++ + 2 files changed, 17 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c +index 8bfb9dcb4ba7..4e67dbf6c8ba 100644 +--- a/drivers/gpu/drm/vc4/vc4_hvs.c ++++ b/drivers/gpu/drm/vc4/vc4_hvs.c +@@ -1001,6 +1001,17 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) + SCALER_DISPCTRL_DSPEISLUR(2) | + SCALER_DISPCTRL_SCLEIRQ); + ++ /* Set AXI panic mode. ++ * VC4 panics when < 2 lines in FIFO. ++ * VC5 panics when less than 1 line in the FIFO. ++ */ ++ dispctrl &= ~(SCALER_DISPCTRL_PANIC0_MASK | ++ SCALER_DISPCTRL_PANIC1_MASK | ++ SCALER_DISPCTRL_PANIC2_MASK); ++ dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC0); ++ dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC1); ++ dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC2); ++ + HVS_WRITE(SCALER_DISPCTRL, dispctrl); + + /* Recompute Composite Output Buffer (COB) allocations for the displays +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 82b0fdabe2a0..0b61f09c925c 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -220,6 +220,12 @@ + #define SCALER_DISPCTRL 0x00000000 + /* Global register for clock gating the HVS */ + # define SCALER_DISPCTRL_ENABLE BIT(31) ++# define SCALER_DISPCTRL_PANIC0_MASK VC4_MASK(25, 24) ++# define SCALER_DISPCTRL_PANIC0_SHIFT 24 ++# define SCALER_DISPCTRL_PANIC1_MASK VC4_MASK(27, 26) ++# define SCALER_DISPCTRL_PANIC1_SHIFT 26 ++# define SCALER_DISPCTRL_PANIC2_MASK VC4_MASK(29, 28) ++# define SCALER_DISPCTRL_PANIC2_SHIFT 28 + # define SCALER_DISPCTRL_DSP3_MUX_MASK VC4_MASK(19, 18) + # define SCALER_DISPCTRL_DSP3_MUX_SHIFT 18 + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 11 Aug 2022 15:49:16 +0100 +Subject: [PATCH 1062/1183] drm/vc4: SCALER_DISPBKGND_AUTOHS is only valid on + HVS4 + +The bit used for SCALER_DISPBKGND_AUTOHS in SCALER_DISPBKGNDX +has been repurposed on HVS5 to configure whether a display can +win back-to-back arbitration wins for the COB. + +This is not desirable, therefore only select this bit on HVS4, +and explicitly clear it on HVS5. + +Signed-off-by: Dave Stevenson +--- + drivers/gpu/drm/vc4/vc4_hvs.c | 10 ++++++---- + drivers/gpu/drm/vc4/vc4_regs.h | 1 + + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c +index 4e67dbf6c8ba..566785523416 100644 +--- a/drivers/gpu/drm/vc4/vc4_hvs.c ++++ b/drivers/gpu/drm/vc4/vc4_hvs.c +@@ -485,23 +485,26 @@ static int vc4_hvs_init_channel(struct vc4_hvs *hvs, struct drm_crtc *crtc, + * mode. + */ + dispctrl = SCALER_DISPCTRLX_ENABLE; ++ dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(chan)); + +- if (!vc4->is_vc5) ++ if (!vc4->is_vc5) { + dispctrl |= VC4_SET_FIELD(mode->hdisplay, + SCALER_DISPCTRLX_WIDTH) | + VC4_SET_FIELD(mode->vdisplay, + SCALER_DISPCTRLX_HEIGHT) | + (oneshot ? SCALER_DISPCTRLX_ONESHOT : 0); +- else ++ dispbkgndx |= SCALER_DISPBKGND_AUTOHS; ++ } else { + dispctrl |= VC4_SET_FIELD(mode->hdisplay, + SCALER5_DISPCTRLX_WIDTH) | + VC4_SET_FIELD(mode->vdisplay, + SCALER5_DISPCTRLX_HEIGHT) | + (oneshot ? SCALER5_DISPCTRLX_ONESHOT : 0); ++ dispbkgndx &= ~SCALER5_DISPBKGND_BCK2BCK; ++ } + + HVS_WRITE(SCALER_DISPCTRLX(chan), dispctrl); + +- dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(chan)); + dispbkgndx &= ~SCALER_DISPBKGND_GAMMA; + dispbkgndx &= ~SCALER_DISPBKGND_INTERLACE; + +@@ -510,7 +513,6 @@ static int vc4_hvs_init_channel(struct vc4_hvs *hvs, struct drm_crtc *crtc, + dispbkgndx |= SCALER_DISPBKGND_GAMMA; + + HVS_WRITE(SCALER_DISPBKGNDX(chan), dispbkgndx | +- SCALER_DISPBKGND_AUTOHS | + (interlace ? SCALER_DISPBKGND_INTERLACE : 0)); + + /* Reload the LUT, since the SRAMs would have been disabled if +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 0b61f09c925c..eeeeb3024fa3 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -366,6 +366,7 @@ + + #define SCALER_DISPBKGND0 0x00000044 + # define SCALER_DISPBKGND_AUTOHS BIT(31) ++# define SCALER5_DISPBKGND_BCK2BCK BIT(31) + # define SCALER_DISPBKGND_INTERLACE BIT(30) + # define SCALER_DISPBKGND_GAMMA BIT(29) + # define SCALER_DISPBKGND_TESTMODE_MASK VC4_MASK(28, 25) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Thu, 11 Aug 2022 15:52:28 +0100 +Subject: [PATCH 1063/1183] drm/vc4: Correct interrupt masking bit assignment + for HVS5 + +HVS5 has moved the interrupt enable bits around within the +DISPCTRL register, therefore the configuration has to be updated +to account for this. + +Signed-off-by: Dave Stevenson +--- + drivers/gpu/drm/vc4/vc4_hvs.c | 52 +++++++++++++++++++++++----------- + drivers/gpu/drm/vc4/vc4_regs.h | 10 +++++-- + 2 files changed, 44 insertions(+), 18 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c +index 566785523416..e0d4c86dee34 100644 +--- a/drivers/gpu/drm/vc4/vc4_hvs.c ++++ b/drivers/gpu/drm/vc4/vc4_hvs.c +@@ -817,7 +817,8 @@ void vc4_hvs_mask_underrun(struct vc4_hvs *hvs, int channel) + { + u32 dispctrl = HVS_READ(SCALER_DISPCTRL); + +- dispctrl &= ~SCALER_DISPCTRL_DSPEISLUR(channel); ++ dispctrl &= ~(hvs->vc4->is_vc5 ? SCALER5_DISPCTRL_DSPEISLUR(channel) : ++ SCALER_DISPCTRL_DSPEISLUR(channel)); + + HVS_WRITE(SCALER_DISPCTRL, dispctrl); + } +@@ -826,7 +827,8 @@ void vc4_hvs_unmask_underrun(struct vc4_hvs *hvs, int channel) + { + u32 dispctrl = HVS_READ(SCALER_DISPCTRL); + +- dispctrl |= SCALER_DISPCTRL_DSPEISLUR(channel); ++ dispctrl |= (hvs->vc4->is_vc5 ? SCALER5_DISPCTRL_DSPEISLUR(channel) : ++ SCALER_DISPCTRL_DSPEISLUR(channel)); + + HVS_WRITE(SCALER_DISPSTAT, + SCALER_DISPSTAT_EUFLOW(channel)); +@@ -850,14 +852,17 @@ static irqreturn_t vc4_hvs_irq_handler(int irq, void *data) + int channel; + u32 control; + u32 status; ++ u32 dspeislur; + + status = HVS_READ(SCALER_DISPSTAT); + control = HVS_READ(SCALER_DISPCTRL); + + for (channel = 0; channel < SCALER_CHANNELS_COUNT; channel++) { ++ dspeislur = vc4->is_vc5 ? SCALER5_DISPCTRL_DSPEISLUR(channel) : ++ SCALER_DISPCTRL_DSPEISLUR(channel); + /* Interrupt masking is not always honored, so check it here. */ + if (status & SCALER_DISPSTAT_EUFLOW(channel) && +- control & SCALER_DISPCTRL_DSPEISLUR(channel)) { ++ control & dspeislur) { + vc4_hvs_mask_underrun(hvs, channel); + vc4_hvs_report_underrun(dev); + +@@ -989,19 +994,34 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) + SCALER_DISPCTRL_DISPEIRQ(1) | + SCALER_DISPCTRL_DISPEIRQ(2); + +- dispctrl &= ~(SCALER_DISPCTRL_DMAEIRQ | +- SCALER_DISPCTRL_SLVWREIRQ | +- SCALER_DISPCTRL_SLVRDEIRQ | +- SCALER_DISPCTRL_DSPEIEOF(0) | +- SCALER_DISPCTRL_DSPEIEOF(1) | +- SCALER_DISPCTRL_DSPEIEOF(2) | +- SCALER_DISPCTRL_DSPEIEOLN(0) | +- SCALER_DISPCTRL_DSPEIEOLN(1) | +- SCALER_DISPCTRL_DSPEIEOLN(2) | +- SCALER_DISPCTRL_DSPEISLUR(0) | +- SCALER_DISPCTRL_DSPEISLUR(1) | +- SCALER_DISPCTRL_DSPEISLUR(2) | +- SCALER_DISPCTRL_SCLEIRQ); ++ if (!vc4->is_vc5) ++ dispctrl &= ~(SCALER_DISPCTRL_DMAEIRQ | ++ SCALER_DISPCTRL_SLVWREIRQ | ++ SCALER_DISPCTRL_SLVRDEIRQ | ++ SCALER_DISPCTRL_DSPEIEOF(0) | ++ SCALER_DISPCTRL_DSPEIEOF(1) | ++ SCALER_DISPCTRL_DSPEIEOF(2) | ++ SCALER_DISPCTRL_DSPEIEOLN(0) | ++ SCALER_DISPCTRL_DSPEIEOLN(1) | ++ SCALER_DISPCTRL_DSPEIEOLN(2) | ++ SCALER_DISPCTRL_DSPEISLUR(0) | ++ SCALER_DISPCTRL_DSPEISLUR(1) | ++ SCALER_DISPCTRL_DSPEISLUR(2) | ++ SCALER_DISPCTRL_SCLEIRQ); ++ else ++ dispctrl &= ~(SCALER_DISPCTRL_DMAEIRQ | ++ SCALER5_DISPCTRL_SLVEIRQ | ++ SCALER5_DISPCTRL_DSPEIEOF(0) | ++ SCALER5_DISPCTRL_DSPEIEOF(1) | ++ SCALER5_DISPCTRL_DSPEIEOF(2) | ++ SCALER5_DISPCTRL_DSPEIEOLN(0) | ++ SCALER5_DISPCTRL_DSPEIEOLN(1) | ++ SCALER5_DISPCTRL_DSPEIEOLN(2) | ++ SCALER5_DISPCTRL_DSPEISLUR(0) | ++ SCALER5_DISPCTRL_DSPEISLUR(1) | ++ SCALER5_DISPCTRL_DSPEISLUR(2) | ++ SCALER_DISPCTRL_SCLEIRQ); ++ + + /* Set AXI panic mode. + * VC4 panics when < 2 lines in FIFO. +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index eeeeb3024fa3..b65abdfc4505 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -234,15 +234,21 @@ + * always enabled. + */ + # define SCALER_DISPCTRL_DSPEISLUR(x) BIT(13 + (x)) ++# define SCALER5_DISPCTRL_DSPEISLUR(x) BIT(9 + ((x) * 4)) + /* Enables Display 0 end-of-line-N contribution to + * SCALER_DISPSTAT_IRQDISP0 + */ + # define SCALER_DISPCTRL_DSPEIEOLN(x) BIT(8 + ((x) * 2)) ++# define SCALER5_DISPCTRL_DSPEIEOLN(x) BIT(8 + ((x) * 4)) + /* Enables Display 0 EOF contribution to SCALER_DISPSTAT_IRQDISP0 */ + # define SCALER_DISPCTRL_DSPEIEOF(x) BIT(7 + ((x) * 2)) ++# define SCALER5_DISPCTRL_DSPEIEOF(x) BIT(7 + ((x) * 4)) + +-# define SCALER_DISPCTRL_SLVRDEIRQ BIT(6) +-# define SCALER_DISPCTRL_SLVWREIRQ BIT(5) ++# define SCALER5_DISPCTRL_DSPEIVST(x) BIT(6 + ((x) * 4)) ++ ++# define SCALER_DISPCTRL_SLVRDEIRQ BIT(6) /* HVS4 only */ ++# define SCALER_DISPCTRL_SLVWREIRQ BIT(5) /* HVS4 only */ ++# define SCALER5_DISPCTRL_SLVEIRQ BIT(5) + # define SCALER_DISPCTRL_DMAEIRQ BIT(4) + /* Enables interrupt generation on the enabled EOF/EOLN/EISLUR + * bits and short frames.. +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Naushir Patuck +Date: Fri, 2 Sep 2022 08:35:35 +0100 +Subject: [PATCH 1064/1183] media: bcm2835-unicam: Fix for possible dummy + buffer overrun + +The Unicam hardware has been observed to cause a buffer overrun when using the +dummy buffer as a circular buffer. The conditions that cause the overrun are not +fully known, but it seems to occur when the memory bus is heavily loaded. + +To avoid the overrun, program the hardware with a buffer size of 0 when using +the dummy buffer. This will cause overrun into the allocated dummy buffer, but +avoid out of bounds writes. + +Signed-off-by: Naushir Patuck +--- + drivers/media/platform/bcm2835/bcm2835-unicam.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/drivers/media/platform/bcm2835/bcm2835-unicam.c b/drivers/media/platform/bcm2835/bcm2835-unicam.c +index cad7f018b221..506a3b3837b0 100644 +--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c ++++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c +@@ -127,8 +127,11 @@ MODULE_PARM_DESC(media_controller, "Use media controller API"); + #define UNICAM_EMBEDDED_SIZE 16384 + + /* +- * Size of the dummy buffer. Can be any size really, but the DMA +- * allocation works in units of page sizes. ++ * Size of the dummy buffer allocation. ++ * ++ * Due to a HW bug causing buffer overruns in circular buffer mode under certain ++ * (not yet fully known) conditions, the dummy buffer allocation is set to a ++ * a single page size, but the hardware gets programmed with a buffer size of 0. + */ + #define DUMMY_BUF_SIZE (PAGE_SIZE) + +@@ -844,8 +847,7 @@ static void unicam_schedule_dummy_buffer(struct unicam_node *node) + unicam_dbg(3, dev, "Scheduling dummy buffer for node %d\n", + node->pad_id); + +- unicam_wr_dma_addr(dev, node->dummy_buf_dma_addr, DUMMY_BUF_SIZE, +- node->pad_id); ++ unicam_wr_dma_addr(dev, node->dummy_buf_dma_addr, 0, node->pad_id); + node->next_frm = NULL; + } + +@@ -2665,8 +2667,8 @@ static void unicam_stop_streaming(struct vb2_queue *vq) + * 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); ++ unicam_wr_dma_addr(dev, node->dummy_buf_dma_addr, 0, ++ METADATA_PAD); + } + + /* Clear all queued buffers for the node */ +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Joerg Schambacher +Date: Fri, 2 Sep 2022 11:50:16 +0200 +Subject: [PATCH 1065/1183] ASoC:ma120x0p: Extend the volume range to -144dB + (mute) + +Adjusts the usable volume range down to -144dB to allow 'muting' +of the amplifier through volume control. + +Signed-off-by: Joerg Schambacher +--- + sound/soc/codecs/ma120x0p.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/codecs/ma120x0p.c b/sound/soc/codecs/ma120x0p.c +index ac812e83178d..992c72cf0f5a 100644 +--- a/sound/soc/codecs/ma120x0p.c ++++ b/sound/soc/codecs/ma120x0p.c +@@ -894,13 +894,13 @@ static SOC_VALUE_ENUM_SINGLE_DECL(pwr_mode_ctrl, + pwr_mode_values); + + static const DECLARE_TLV_DB_SCALE(ma120x0p_vol_tlv, -5000, 100, 0); +-static const DECLARE_TLV_DB_SCALE(ma120x0p_lim_tlv, -5000, 100, 0); ++static const DECLARE_TLV_DB_SCALE(ma120x0p_lim_tlv, -14400, 100, 0); + static const DECLARE_TLV_DB_SCALE(ma120x0p_lr_tlv, -5000, 100, 0); + + static const struct snd_kcontrol_new ma120x0p_snd_controls[] = { + //Master Volume + SOC_SINGLE_RANGE_TLV("A.Mstr Vol Volume", +- ma_vol_db_master__a, 0, 0x18, 0x4a, 1, ma120x0p_vol_tlv), ++ ma_vol_db_master__a, 0, 0x18, 0xa8, 1, ma120x0p_vol_tlv), + + //L-R Volume ch0 + SOC_SINGLE_RANGE_TLV("B.L Vol Volume", +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Pablo Greco +Date: Sat, 15 Oct 2022 18:16:06 +0000 +Subject: [PATCH 1066/1183] 3d2d12fb7815 + +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 4bb97d4ea2c1..bfc9e1151965 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -3221,6 +3221,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + + pm_runtime_enable(dev); + ++ /* ++ * We need to have the device powered up at this point to call ++ * our reset hook and for the CEC init. ++ */ ++ ret = pm_runtime_resume_and_get(dev); ++ if (ret) ++ goto err_disable_runtime_pm; ++ + ret = pm_runtime_resume_and_get(dev); + if (ret) + goto err_disable_runtime_pm; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dom Cobley +Date: Mon, 5 Sep 2022 12:45:06 +0100 +Subject: [PATCH 1067/1183] Revert "Revert "usbnet: smsc95xx: Don't clear + read-only PHY interrupt"" + +This reverts commit b50b2815045cbc86e3b34178e9df69a988991a61. +--- + drivers/net/usb/smsc95xx.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index 64ad4f1daee4..220026c0b50e 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -583,10 +583,6 @@ static int smsc95xx_link_reset(struct usbnet *dev) + unsigned long flags; + int ret; + +- ret = smsc95xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL_); +- if (ret < 0) +- return ret; +- + spin_lock_irqsave(&pdata->mac_cr_lock, flags); + if (pdata->phydev->duplex != DUPLEX_FULL) { + pdata->mac_cr &= ~MAC_CR_FDPX_; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dom Cobley +Date: Mon, 5 Sep 2022 12:45:07 +0100 +Subject: [PATCH 1068/1183] Revert "Revert "usbnet: smsc95xx: Avoid link + settings race on interrupt reception"" + +This reverts commit c7cbb86f4763c5d9b52698e6f58b6d1719ade011. +--- + drivers/net/usb/smsc95xx.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index 220026c0b50e..7b0d7dc531c0 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -577,7 +577,7 @@ static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev) + return smsc95xx_write_reg(dev, AFC_CFG, afc_cfg); + } + +-static int smsc95xx_link_reset(struct usbnet *dev) ++static void smsc95xx_mac_update_fullduplex(struct usbnet *dev) + { + struct smsc95xx_priv *pdata = dev->driver_priv; + unsigned long flags; +@@ -594,14 +594,16 @@ static int smsc95xx_link_reset(struct usbnet *dev) + spin_unlock_irqrestore(&pdata->mac_cr_lock, flags); + + ret = smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr); +- if (ret < 0) +- return ret; ++ if (ret < 0) { ++ if (ret != -ENODEV) ++ netdev_warn(dev->net, ++ "Error updating MAC full duplex mode\n"); ++ return; ++ } + + ret = smsc95xx_phy_update_flowcontrol(dev); + if (ret < 0) + netdev_warn(dev->net, "Error updating PHY flow control\n"); +- +- return ret; + } + + static void smsc95xx_status(struct usbnet *dev, struct urb *urb) +@@ -618,7 +620,7 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) + netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata); + + if (intdata & INT_ENP_PHY_INT_) +- usbnet_defer_kevent(dev, EVENT_LINK_RESET); ++ ; + else + netdev_warn(dev->net, "unexpected interrupt, intdata=0x%08X\n", + intdata); +@@ -1126,6 +1128,7 @@ static void smsc95xx_handle_link_change(struct net_device *net) + struct usbnet *dev = netdev_priv(net); + + phy_print_status(net->phydev); ++ smsc95xx_mac_update_fullduplex(dev); + usbnet_defer_kevent(dev, EVENT_LINK_CHANGE); + } + +@@ -2033,7 +2036,6 @@ static const struct driver_info smsc95xx_info = { + .description = "smsc95xx USB 2.0 Ethernet", + .bind = smsc95xx_bind, + .unbind = smsc95xx_unbind, +- .link_reset = smsc95xx_link_reset, + .reset = smsc95xx_reset, + .check_connect = smsc95xx_start_phy, + .stop = smsc95xx_stop, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dom Cobley +Date: Mon, 5 Sep 2022 12:45:08 +0100 +Subject: [PATCH 1069/1183] Revert "Revert "usbnet: smsc95xx: Forward PHY + interrupts to PHY driver to avoid polling"" + +This reverts commit bb0401e1e9875b361aff49e75b9ef9e6688359bc. +--- + drivers/net/usb/smsc95xx.c | 113 ++++++++++++++++++++----------------- + 1 file changed, 61 insertions(+), 52 deletions(-) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index 7b0d7dc531c0..4fd95c80627f 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -18,6 +18,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include "smsc95xx.h" +@@ -52,6 +54,9 @@ + SUSPEND_SUSPEND2 | SUSPEND_SUSPEND3) + #define MAC_ADDR_LEN (6) + ++#define SMSC95XX_NR_IRQS (1) /* raise to 12 for GPIOs */ ++#define PHY_HWIRQ (SMSC95XX_NR_IRQS - 1) ++ + struct smsc95xx_priv { + u32 mac_cr; + u32 hash_hi; +@@ -60,6 +65,9 @@ struct smsc95xx_priv { + spinlock_t mac_cr_lock; + u8 features; + u8 suspend_flags; ++ struct irq_chip irqchip; ++ struct irq_domain *irqdomain; ++ struct fwnode_handle *irqfwnode; + struct mii_bus *mdiobus; + struct phy_device *phydev; + }; +@@ -608,6 +616,8 @@ static void smsc95xx_mac_update_fullduplex(struct usbnet *dev) + + static void smsc95xx_status(struct usbnet *dev, struct urb *urb) + { ++ struct smsc95xx_priv *pdata = dev->driver_priv; ++ unsigned long flags; + u32 intdata; + + if (urb->actual_length != 4) { +@@ -619,11 +629,15 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) + intdata = get_unaligned_le32(urb->transfer_buffer); + netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata); + ++ local_irq_save(flags); ++ + if (intdata & INT_ENP_PHY_INT_) +- ; ++ generic_handle_domain_irq(pdata->irqdomain, PHY_HWIRQ); + else + netdev_warn(dev->net, "unexpected interrupt, intdata=0x%08X\n", + intdata); ++ ++ local_irq_restore(flags); + } + + /* Enable or disable Tx & Rx checksum offload engines */ +@@ -1136,8 +1150,9 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + { + struct smsc95xx_priv *pdata; + bool is_internal_phy; ++ char usb_path[64]; ++ int ret, phy_irq; + u32 val; +- int ret; + + printk(KERN_INFO SMSC_CHIPNAME " v" SMSC_DRIVER_VERSION "\n"); + +@@ -1177,10 +1192,38 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + if (ret) + goto free_pdata; + ++ /* create irq domain for use by PHY driver and GPIO consumers */ ++ usb_make_path(dev->udev, usb_path, sizeof(usb_path)); ++ pdata->irqfwnode = irq_domain_alloc_named_fwnode(usb_path); ++ if (!pdata->irqfwnode) { ++ ret = -ENOMEM; ++ goto free_pdata; ++ } ++ ++ pdata->irqdomain = irq_domain_create_linear(pdata->irqfwnode, ++ SMSC95XX_NR_IRQS, ++ &irq_domain_simple_ops, ++ pdata); ++ if (!pdata->irqdomain) { ++ ret = -ENOMEM; ++ goto free_irqfwnode; ++ } ++ ++ phy_irq = irq_create_mapping(pdata->irqdomain, PHY_HWIRQ); ++ if (!phy_irq) { ++ ret = -ENOENT; ++ goto remove_irqdomain; ++ } ++ ++ pdata->irqchip = dummy_irq_chip; ++ pdata->irqchip.name = SMSC_CHIPNAME; ++ irq_set_chip_and_handler_name(phy_irq, &pdata->irqchip, ++ handle_simple_irq, "phy"); ++ + pdata->mdiobus = mdiobus_alloc(); + if (!pdata->mdiobus) { + ret = -ENOMEM; +- goto free_pdata; ++ goto dispose_irq; + } + + ret = smsc95xx_read_reg(dev, HW_CFG, &val); +@@ -1213,6 +1256,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + goto unregister_mdio; + } + ++ pdata->phydev->irq = phy_irq; + pdata->phydev->is_internal = is_internal_phy; + + /* detect device revision as different features may be available */ +@@ -1255,6 +1299,15 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + free_mdio: + mdiobus_free(pdata->mdiobus); + ++dispose_irq: ++ irq_dispose_mapping(phy_irq); ++ ++remove_irqdomain: ++ irq_domain_remove(pdata->irqdomain); ++ ++free_irqfwnode: ++ irq_domain_free_fwnode(pdata->irqfwnode); ++ + free_pdata: + kfree(pdata); + return ret; +@@ -1267,6 +1320,9 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf) + phy_disconnect(dev->net->phydev); + mdiobus_unregister(pdata->mdiobus); + mdiobus_free(pdata->mdiobus); ++ irq_dispose_mapping(irq_find_mapping(pdata->irqdomain, PHY_HWIRQ)); ++ irq_domain_remove(pdata->irqdomain); ++ irq_domain_free_fwnode(pdata->irqfwnode); + netif_dbg(dev, ifdown, dev->net, "free pdata\n"); + kfree(pdata); + } +@@ -1291,29 +1347,6 @@ static u32 smsc_crc(const u8 *buffer, size_t len, int filter) + return crc << ((filter % 2) * 16); + } + +-static int smsc95xx_enable_phy_wakeup_interrupts(struct usbnet *dev, u16 mask) +-{ +- int ret; +- +- netdev_dbg(dev->net, "enabling PHY wakeup interrupts\n"); +- +- /* read to clear */ +- ret = smsc95xx_mdio_read_nopm(dev, PHY_INT_SRC); +- if (ret < 0) +- return ret; +- +- /* enable interrupt source */ +- ret = smsc95xx_mdio_read_nopm(dev, PHY_INT_MASK); +- if (ret < 0) +- return ret; +- +- ret |= mask; +- +- smsc95xx_mdio_write_nopm(dev, PHY_INT_MASK, ret); +- +- return 0; +-} +- + static int smsc95xx_link_ok_nopm(struct usbnet *dev) + { + int ret; +@@ -1480,7 +1513,6 @@ static int smsc95xx_enter_suspend3(struct usbnet *dev) + static int smsc95xx_autosuspend(struct usbnet *dev, u32 link_up) + { + struct smsc95xx_priv *pdata = dev->driver_priv; +- int ret; + + if (!netif_running(dev->net)) { + /* interface is ifconfig down so fully power down hw */ +@@ -1499,27 +1531,10 @@ static int smsc95xx_autosuspend(struct usbnet *dev, u32 link_up) + } + + netdev_dbg(dev->net, "autosuspend entering SUSPEND1\n"); +- +- /* enable PHY wakeup events for if cable is attached */ +- ret = smsc95xx_enable_phy_wakeup_interrupts(dev, +- PHY_INT_MASK_ANEG_COMP_); +- if (ret < 0) { +- netdev_warn(dev->net, "error enabling PHY wakeup ints\n"); +- return ret; +- } +- + netdev_info(dev->net, "entering SUSPEND1 mode\n"); + return smsc95xx_enter_suspend1(dev); + } + +- /* enable PHY wakeup events so we remote wakeup if cable is pulled */ +- ret = smsc95xx_enable_phy_wakeup_interrupts(dev, +- PHY_INT_MASK_LINK_DOWN_); +- if (ret < 0) { +- netdev_warn(dev->net, "error enabling PHY wakeup ints\n"); +- return ret; +- } +- + netdev_dbg(dev->net, "autosuspend entering SUSPEND3\n"); + return smsc95xx_enter_suspend3(dev); + } +@@ -1585,13 +1600,6 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) + } + + if (pdata->wolopts & WAKE_PHY) { +- ret = smsc95xx_enable_phy_wakeup_interrupts(dev, +- (PHY_INT_MASK_ANEG_COMP_ | PHY_INT_MASK_LINK_DOWN_)); +- if (ret < 0) { +- netdev_warn(dev->net, "error enabling PHY wakeup ints\n"); +- goto done; +- } +- + /* if link is down then configure EDPD and enter SUSPEND1, + * otherwise enter SUSPEND0 below + */ +@@ -1825,11 +1833,12 @@ static int smsc95xx_resume(struct usb_interface *intf) + return ret; + } + ++ phy_init_hw(pdata->phydev); ++ + ret = usbnet_resume(intf); + if (ret < 0) + netdev_warn(dev->net, "usbnet_resume error\n"); + +- phy_init_hw(pdata->phydev); + return ret; + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dom Cobley +Date: Mon, 5 Sep 2022 12:45:09 +0100 +Subject: [PATCH 1070/1183] Revert "Revert "usbnet: smsc95xx: Fix deadlock on + runtime resume"" + +This reverts commit 2f82838ec69a86ffe786e57a37d4bcf746760017. +--- + drivers/net/usb/smsc95xx.c | 26 ++++++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index 4fd95c80627f..cedd187bf2d2 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -70,6 +70,7 @@ struct smsc95xx_priv { + struct fwnode_handle *irqfwnode; + struct mii_bus *mdiobus; + struct phy_device *phydev; ++ struct task_struct *pm_task; + }; + + static bool turbo_mode = true; +@@ -91,13 +92,14 @@ MODULE_PARM_DESC(macaddr, "MAC address"); + static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, + u32 *data, int in_pm) + { ++ struct smsc95xx_priv *pdata = dev->driver_priv; + u32 buf; + int ret; + int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16); + + BUG_ON(!dev); + +- if (!in_pm) ++ if (current != pdata->pm_task) + fn = usbnet_read_cmd; + else + fn = usbnet_read_cmd_nopm; +@@ -121,13 +123,14 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, + static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index, + u32 data, int in_pm) + { ++ struct smsc95xx_priv *pdata = dev->driver_priv; + u32 buf; + int ret; + int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16); + + BUG_ON(!dev); + +- if (!in_pm) ++ if (current != pdata->pm_task) + fn = usbnet_write_cmd; + else + fn = usbnet_write_cmd_nopm; +@@ -1546,9 +1549,12 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) + u32 val, link_up; + int ret; + ++ pdata->pm_task = current; ++ + ret = usbnet_suspend(intf, message); + if (ret < 0) { + netdev_warn(dev->net, "usbnet_suspend error\n"); ++ pdata->pm_task = NULL; + return ret; + } + +@@ -1788,6 +1794,7 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) + if (ret && PMSG_IS_AUTO(message)) + usbnet_resume(intf); + ++ pdata->pm_task = NULL; + return ret; + } + +@@ -1808,29 +1815,31 @@ static int smsc95xx_resume(struct usb_interface *intf) + /* do this first to ensure it's cleared even in error case */ + pdata->suspend_flags = 0; + ++ pdata->pm_task = current; ++ + if (suspend_flags & SUSPEND_ALLMODES) { + /* clear wake-up sources */ + ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val); + if (ret < 0) +- return ret; ++ goto done; + + val &= ~(WUCSR_WAKE_EN_ | WUCSR_MPEN_); + + ret = smsc95xx_write_reg_nopm(dev, WUCSR, val); + if (ret < 0) +- return ret; ++ goto done; + + /* clear wake-up status */ + ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); + if (ret < 0) +- return ret; ++ goto done; + + val &= ~PM_CTL_WOL_EN_; + val |= PM_CTL_WUPS_; + + ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); + if (ret < 0) +- return ret; ++ goto done; + } + + phy_init_hw(pdata->phydev); +@@ -1839,15 +1848,20 @@ static int smsc95xx_resume(struct usb_interface *intf) + if (ret < 0) + netdev_warn(dev->net, "usbnet_resume error\n"); + ++done: ++ pdata->pm_task = NULL; + return ret; + } + + static int smsc95xx_reset_resume(struct usb_interface *intf) + { + struct usbnet *dev = usb_get_intfdata(intf); ++ struct smsc95xx_priv *pdata = dev->driver_priv; + int ret; + ++ pdata->pm_task = current; + ret = smsc95xx_reset(dev); ++ pdata->pm_task = NULL; + if (ret < 0) + return ret; + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 5 Sep 2022 11:44:23 +0100 +Subject: [PATCH 1071/1183] media: i2c: imx290: Updating VBLANK should update + exposure in all states + +The code to update the range of the exposure control was after a +check that the sensor was powered up. This is incorrect as the +range should be updated under all conditions. + +Move the range update code to the correct place. + +Fixes: 52d076ea221e "media: i2c: imx290: Handle exposure correctly when vblank changes" + +Signed-off-by: Dave Stevenson +--- + drivers/media/i2c/imx290.c | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c +index c5abef46ed5d..2c0c0b9aa82d 100644 +--- a/drivers/media/i2c/imx290.c ++++ b/drivers/media/i2c/imx290.c +@@ -690,17 +690,6 @@ static int imx290_set_vmax(struct imx290 *imx290, u32 val) + if (ret) + dev_err(imx290->dev, "Unable to write vmax\n"); + +- /* +- * Changing vblank changes the allowed range for exposure. +- * We don't supply the current exposure as default here as it +- * may lie outside the new range. We will reset it just below. +- */ +- __v4l2_ctrl_modify_range(imx290->exposure, +- IMX290_EXPOSURE_MIN, +- vmax - 2, +- IMX290_EXPOSURE_STEP, +- vmax - 2); +- + /* + * Becuse of the way exposure works for this sensor, updating + * vblank causes the effective exposure to change, so we must +@@ -732,6 +721,21 @@ static int imx290_set_ctrl(struct v4l2_ctrl *ctrl) + int ret = 0; + u8 val; + ++ if (ctrl->id == V4L2_CID_VBLANK) { ++ u32 vmax = ctrl->val + imx290->current_mode->height; ++ ++ /* ++ * Changing vblank changes the allowed range for exposure. ++ * We don't supply the current exposure as default here as it ++ * may lie outside the new range. We will reset it just below. ++ */ ++ __v4l2_ctrl_modify_range(imx290->exposure, ++ IMX290_EXPOSURE_MIN, ++ vmax - 2, ++ IMX290_EXPOSURE_STEP, ++ vmax - 2); ++ } ++ + /* V4L2 controls values will be applied only when power is already up */ + if (!pm_runtime_get_if_in_use(imx290->dev)) + return 0; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 5 Sep 2022 11:50:30 +0100 +Subject: [PATCH 1072/1183] Revert "media: i2c: imx290: Explicitly set v&h + blank on mode change" + +This reverts commit 090d29f5854aa7b6511b0ae8a926929130fd3978. + +Whilst the behaviour of not resetting the frame rate to the +"correct"/default value on mode change is useful, it is not correct +under the V4L2 API. + +Revert the patch so that blanking values persist. + +Signed-off-by: Dave Stevenson +--- + drivers/media/i2c/imx290.c | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c +index 2c0c0b9aa82d..da7d0d9fffb8 100644 +--- a/drivers/media/i2c/imx290.c ++++ b/drivers/media/i2c/imx290.c +@@ -916,23 +916,17 @@ static int imx290_set_fmt(struct v4l2_subdev *sd, + __v4l2_ctrl_s_ctrl_int64(imx290->pixel_rate, + imx290_calc_pixel_rate(imx290)); + +- if (imx290->hblank) { ++ if (imx290->hblank) + __v4l2_ctrl_modify_range(imx290->hblank, + imx290->hmax_min - mode->width, + IMX290_HMAX_MAX - mode->width, + 1, mode->hmax - mode->width); +- __v4l2_ctrl_s_ctrl(imx290->hblank, +- mode->hmax - mode->width); +- } +- if (imx290->vblank) { ++ if (imx290->vblank) + __v4l2_ctrl_modify_range(imx290->vblank, + mode->vmax - mode->height, + IMX290_VMAX_MAX - mode->height, + 1, + mode->vmax - mode->height); +- __v4l2_ctrl_s_ctrl(imx290->vblank, +- mode->vmax - mode->height); +- } + if (imx290->exposure) + __v4l2_ctrl_modify_range(imx290->exposure, + IMX290_EXPOSURE_MIN, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 5 Sep 2022 15:10:05 +0100 +Subject: [PATCH 1073/1183] media: i2c: imx290: Drop incorrect comment about + pixelrate + +commit b5eca6fd4284 ("media: i2c: imx290: Fix the pixel rate at 148.5Mpix/s") +corrected imx290_calc_pixel_rate to always return the correct +pixle rate of 148.5Mpix/s, but didn't remove the comment that said +it relied on some other parameters. + +Drop that comment. + +Signed-off-by: Dave Stevenson +--- + drivers/media/i2c/imx290.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c +index da7d0d9fffb8..0f97ff1bca8d 100644 +--- a/drivers/media/i2c/imx290.c ++++ b/drivers/media/i2c/imx290.c +@@ -1369,8 +1369,7 @@ static int imx290_probe(struct i2c_client *client) + + /* + * Initialize the frame format. In particular, imx290->current_mode +- * and imx290->bpp are set to defaults: imx290_calc_pixel_rate() call +- * below relies on these fields. ++ * and imx290->bpp are set to defaults. + */ + imx290_entity_init_cfg(&imx290->sd, NULL); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 5 Sep 2022 15:32:41 +0100 +Subject: [PATCH 1074/1183] media: i2c: imx290: Do not reset exposure time from + set_fmt + +V4L2 controls are meant to be persistent, and only altered if +the values break hardware constraints. + +In imx290_set_fmt the CID_VBLANK parameter was being reset to +the mode default, and therefore the maximum exposure value +potentially also changed. + +VBLANK is no longer reset, and even if it is, then the set_ctrl +that will be called will alter the range for the exposure +control. Therefore there is no need to reset the exposure time +from set_fmt. + +Signed-off-by: Dave Stevenson +--- + drivers/media/i2c/imx290.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c +index 0f97ff1bca8d..f7971b972045 100644 +--- a/drivers/media/i2c/imx290.c ++++ b/drivers/media/i2c/imx290.c +@@ -927,12 +927,6 @@ static int imx290_set_fmt(struct v4l2_subdev *sd, + IMX290_VMAX_MAX - mode->height, + 1, + mode->vmax - mode->height); +- if (imx290->exposure) +- __v4l2_ctrl_modify_range(imx290->exposure, +- IMX290_EXPOSURE_MIN, +- mode->vmax - 2, +- IMX290_EXPOSURE_STEP, +- mode->vmax - 2); + } + + *format = fmt->format; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 5 Sep 2022 12:16:32 +0100 +Subject: [PATCH 1075/1183] overlays: Add the Raspberry Pi sound cards + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 4 ++ + arch/arm/boot/dts/overlays/README | 70 +++++++++++++++++++ + .../dts/overlays/rpi-codeczero-overlay.dts | 9 +++ + .../boot/dts/overlays/rpi-dacplus-overlay.dts | 17 +++++ + .../boot/dts/overlays/rpi-dacpro-overlay.dts | 17 +++++ + .../dts/overlays/rpi-digiampplus-overlay.dts | 17 +++++ + 6 files changed, 134 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/rpi-codeczero-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/rpi-dacplus-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/rpi-dacpro-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/rpi-digiampplus-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 4bbe05ed9760..013fa0645650 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -187,7 +187,11 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + rotary-encoder.dtbo \ + rpi-backlight.dtbo \ + rpi-cirrus-wm5102.dtbo \ ++ rpi-codeczero.dtbo \ + rpi-dac.dtbo \ ++ rpi-dacplus.dtbo \ ++ rpi-dacpro.dtbo \ ++ rpi-digiampplus.dtbo \ + rpi-display.dtbo \ + rpi-ft5406.dtbo \ + rpi-poe.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index f95848125540..45afd13b5b7a 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -3251,12 +3251,82 @@ Load: dtoverlay=rpi-cirrus-wm5102 + Params: + + ++Name: rpi-codeczero ++Info: Configures the Raspberry Pi Codec Zero sound card ++Load: dtoverlay=rpi-codeczero ++Params: ++ ++ + Name: rpi-dac + Info: Configures the RPi DAC audio card + Load: dtoverlay=rpi-dac + Params: + + ++Name: rpi-dacplus ++Info: Configures the Raspberry Pi DAC+ card ++Load: dtoverlay=rpi-dacplus,= ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ digital volume control. Enable by adding ++ "dtparam=24db_digital_gain" to config.txt ++ before any "dtoverlay" lines. ++ The default behaviour is that the digital ++ volume control is limited to a maximum of ++ 0dB. ie. it can attenuate but not provide ++ gain. For most users, this will be desired ++ as it will prevent clipping. By appending ++ the 24db_digital_gain parameter, the digital ++ volume control will allow up to 24dB of ++ gain. If this parameter is enabled, it is the ++ responsibility of the user to ensure that ++ the digital volume control is set to a value ++ that does not result in clipping/distortion! ++ ++ ++Name: rpi-dacpro ++Info: Configures the Raspberry Pi DAC Pro sound card ++Load: dtoverlay=rpi-dacpro,= ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ digital volume control. Enable by adding ++ "dtparam=24db_digital_gain" to config.txt ++ before any "dtoverlay" lines. ++ The default behaviour is that the digital ++ volume control is limited to a maximum of ++ 0dB. ie. it can attenuate but not provide ++ gain. For most users, this will be desired ++ as it will prevent clipping. By appending ++ the 24db_digital_gain parameter, the digital ++ volume control will allow up to 24dB of ++ gain. If this parameter is enabled, it is the ++ responsibility of the user to ensure that ++ the digital volume control is set to a value ++ that does not result in clipping/distortion! ++ ++ ++Name: rpi-digiampplus ++Info: Configures the Raspberry Pi DigiAMP+ sound card ++Load: dtoverlay=rpi-digiampplus,= ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ digital volume control. Enable by adding ++ "dtparam=24db_digital_gain" to config.txt ++ before any "dtoverlay" lines. ++ The default behaviour is that the digital ++ volume control is limited to a maximum of ++ 0dB. ie. it can attenuate but not provide ++ gain. For most users, this will be desired ++ as it will prevent clipping. By appending ++ the 24db_digital_gain parameter, the digital ++ volume control will allow up to 24dB of ++ gain. If this parameter is enabled, it is the ++ responsibility of the user to ensure that ++ the digital volume control is set to a value ++ that does not result in clipping/distortion! ++ auto_mute_amp If specified, unmute/mute the DigiAMP+ when ++ starting/stopping audio playback (default "on"). ++ unmute_amp If specified, unmute the DigiAMP+ amp once when ++ the DAC driver module loads (default "off"). ++ ++ + Name: rpi-display + Info: RPi-Display - 2.8" Touch Display by Watterott + Linux has 2 drivers that support this display and this overlay supports +diff --git a/arch/arm/boot/dts/overlays/rpi-codeczero-overlay.dts b/arch/arm/boot/dts/overlays/rpi-codeczero-overlay.dts +new file mode 100644 +index 000000000000..c3b0564b2fb2 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/rpi-codeczero-overlay.dts +@@ -0,0 +1,9 @@ ++// Overlay for the Raspberry Pi Codec Zero soundcard ++ ++#include "iqaudio-codec-overlay.dts" ++ ++&iqaudio_dac { ++ card_name = "RPi Codec Zero"; ++ dai_name = "Raspberry Pi Codec Zero"; ++ dai_stream_name = "Raspberry Pi Codec Zero HiFi"; ++}; +diff --git a/arch/arm/boot/dts/overlays/rpi-dacplus-overlay.dts b/arch/arm/boot/dts/overlays/rpi-dacplus-overlay.dts +new file mode 100644 +index 000000000000..47557aa17f19 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/rpi-dacplus-overlay.dts +@@ -0,0 +1,17 @@ ++// Overlay for the Raspberry Pi DAC Plus soundcard ++ ++#include "iqaudio-dacplus-overlay.dts" ++ ++&iqaudio_dac { ++ card_name = "RPi DAC+"; ++ dai_name = "Raspberry Pi DAC+"; ++ dai_stream_name = "Raspberry Pi DAC+ HiFi"; ++ /delete-property/ mute-gpios; ++}; ++ ++/ { ++ __overrides__ { ++ /delete-property/ auto_mute_amp; ++ /delete-property/ unmute_amp; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/rpi-dacpro-overlay.dts b/arch/arm/boot/dts/overlays/rpi-dacpro-overlay.dts +new file mode 100644 +index 000000000000..412260c64edf +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/rpi-dacpro-overlay.dts +@@ -0,0 +1,17 @@ ++// Overlay for the Raspberry Pi DAC Pro soundcard ++ ++#include "iqaudio-dacplus-overlay.dts" ++ ++&iqaudio_dac { ++ card_name = "RPi DAC Pro"; ++ dai_name = "Raspberry Pi DAC Pro"; ++ dai_stream_name = "Raspberry Pi DAC Pro HiFi"; ++ /delete-property/ mute-gpios; ++}; ++ ++/ { ++ __overrides__ { ++ /delete-property/ auto_mute_amp; ++ /delete-property/ unmute_amp; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/rpi-digiampplus-overlay.dts b/arch/arm/boot/dts/overlays/rpi-digiampplus-overlay.dts +new file mode 100644 +index 000000000000..5e73d6c1bf42 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/rpi-digiampplus-overlay.dts +@@ -0,0 +1,17 @@ ++// Overlay for the Raspberry Pi DAC Plus soundcard ++ ++#include "iqaudio-dacplus-overlay.dts" ++ ++&iqaudio_dac { ++ card_name = "RPi DigiAMP+"; ++ dai_name = "Raspberry Pi DigiAMP+"; ++ dai_stream_name = "Raspberry Pi DigiAMP+ HiFi"; ++ iqaudio-dac,auto-mute-amp; ++}; ++ ++/ { ++ __overrides__ { ++ unmute_amp = <&iqaudio_dac>,"iqaudio-dac,unmute-amp?", ++ <&iqaudio_dac>,"iqaudio-dac,auto-mute-amp!"; ++ }; ++}; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 6 Sep 2022 14:43:34 +0100 +Subject: [PATCH 1076/1183] overlays: Rename unofficial "rpi-" overlays + +There are a number of overlays - some very old - with names beginning +with "rpi-", even though they aren't for products made by Raspberry Pi. +Rename them to make their status clearer. The entries in the overlay +map will translate the old names to the new ones, with a warning message +that may be displayed in the GUI. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 8 +- + arch/arm/boot/dts/overlays/README | 100 +++++++++++------- + ...-overlay.dts => cirrus-wm5102-overlay.dts} | 0 + ...pi-dac-overlay.dts => i2s-dac-overlay.dts} | 0 + arch/arm/boot/dts/overlays/overlay_map.dts | 16 +++ + ...to-overlay.dts => proto-codec-overlay.dts} | 0 + ....dts => watterott-rpi-display-overlay.dts} | 0 + 7 files changed, 80 insertions(+), 44 deletions(-) + rename arch/arm/boot/dts/overlays/{rpi-cirrus-wm5102-overlay.dts => cirrus-wm5102-overlay.dts} (100%) + rename arch/arm/boot/dts/overlays/{rpi-dac-overlay.dts => i2s-dac-overlay.dts} (100%) + rename arch/arm/boot/dts/overlays/{rpi-proto-overlay.dts => proto-codec-overlay.dts} (100%) + rename arch/arm/boot/dts/overlays/{rpi-display-overlay.dts => watterott-rpi-display-overlay.dts} (100%) + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 013fa0645650..0464857d7ced 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -38,6 +38,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + camera-mux-4port.dtbo \ + cap1106.dtbo \ + chipdip-dac.dtbo \ ++ cirrus-wm5102.dtbo \ + cma.dtbo \ + cutiepi-panel.dtbo \ + dacberry400.dtbo \ +@@ -106,6 +107,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + i2c4.dtbo \ + i2c5.dtbo \ + i2c6.dtbo \ ++ i2s-dac.dtbo \ + i2s-gpio28-31.dtbo \ + ilitek251x.dtbo \ + imx219.dtbo \ +@@ -177,6 +179,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + pitft28-resistive.dtbo \ + pitft35-resistive.dtbo \ + pps-gpio.dtbo \ ++ proto-codec.dtbo \ + pwm.dtbo \ + pwm-2chan.dtbo \ + pwm-ir-tx.dtbo \ +@@ -186,17 +189,13 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + ramoops-pi4.dtbo \ + rotary-encoder.dtbo \ + rpi-backlight.dtbo \ +- rpi-cirrus-wm5102.dtbo \ + rpi-codeczero.dtbo \ +- rpi-dac.dtbo \ + rpi-dacplus.dtbo \ + rpi-dacpro.dtbo \ + rpi-digiampplus.dtbo \ +- rpi-display.dtbo \ + rpi-ft5406.dtbo \ + rpi-poe.dtbo \ + rpi-poe-plus.dtbo \ +- rpi-proto.dtbo \ + rpi-sense.dtbo \ + rpi-tv.dtbo \ + rra-digidac1-wm8741-audio.dtbo \ +@@ -273,6 +272,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + w1-gpio.dtbo \ + w1-gpio-pullup.dtbo \ + w5500.dtbo \ ++ watterott-rpi-display.dtbo \ + waveshare-can-fd-hat-mode-a.dtbo \ + waveshare-can-fd-hat-mode-b.dtbo \ + wittypi.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 45afd13b5b7a..e6b754ec58ed 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -766,6 +766,12 @@ Load: dtoverlay=chipdip-dac + Params: + + ++Name: cirrus-wm5102 ++Info: Configures the Cirrus Logic Audio Card ++Load: dtoverlay=cirrus-wm5102 ++Params: ++ ++ + Name: cma + Info: Set custom CMA sizes, only use if you know what you are doing, might + clash with other overlays like vc4-fkms-v3d and vc4-kms-v3d. +@@ -2072,6 +2078,12 @@ Params: pins_0_1 Use GPIOs 0 and 1 + "100000") + + ++Name: i2s-dac ++Info: Configures any passive I2S DAC soundcard. ++Load: dtoverlay=i2s-dac ++Params: ++ ++ + Name: i2s-gpio28-31 + Info: move I2S function block to GPIO 28 to 31 + Load: dtoverlay=i2s-gpio28-31 +@@ -3106,6 +3118,12 @@ Params: gpiopin Input GPIO (default "18") + Default is "off". + + ++Name: proto-codec ++Info: Configures the PROTO Audio Codec card ++Load: dtoverlay=proto-codec ++Params: ++ ++ + Name: pwm + Info: Configures a single PWM channel + Legal pin,function combinations for each channel: +@@ -3246,9 +3264,8 @@ Params: + + + Name: rpi-cirrus-wm5102 +-Info: Configures the Cirrus Logic Audio Card +-Load: dtoverlay=rpi-cirrus-wm5102 +-Params: ++Info: This overlay has been renamed to cirrus-wm5102 ++Load: + + + Name: rpi-codeczero +@@ -3258,9 +3275,8 @@ Params: + + + Name: rpi-dac +-Info: Configures the RPi DAC audio card +-Load: dtoverlay=rpi-dac +-Params: ++Info: This overlay has been renaamed to i2s-dac. ++Load: + + + Name: rpi-dacplus +@@ -3328,37 +3344,8 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec + + + Name: rpi-display +-Info: RPi-Display - 2.8" Touch Display by Watterott +- Linux has 2 drivers that support this display and this overlay supports +- both. +- +- Examples: +- fbtft/fb_ili9341: dtoverlay=rpi-display +- drm/mi0283qt: dtoverlay=rpi-display,drm,backlight-pwm,rotate=180 +- +- Some notable differences with the DRM driver compared to fbtft: +- - The display is turned on when it's first used and not on driver load +- as with fbtft. So if nothing uses the display it stays off. +- - Can run with a higher SPI clock increasing framerate. This is possible +- since the driver avoids messing up the controller configuration due to +- transmission errors by running config commands at 10MHz and only pixel +- data at full speed (occasional pixel glitch might occur). +- - PWM backlight is supported. +- +-Load: dtoverlay=rpi-display,= +-Params: speed Display SPI bus speed +- rotate Display rotation {0,90,180,270} +- fps Delay between frame updates (fbtft only) +- debug Debug output level {0-7} (fbtft only) +- xohms Touchpanel sensitivity (X-plate resistance) +- swapxy Swap x and y axis +- backlight Change backlight GPIO pin {e.g. 12, 18} +- (fbtft only) +- drm Use DRM/KMS driver mi0283qt instead of fbtft. +- Set the SPI clock to 70MHz. +- This has to be the first parameter. +- backlight-pwm Use pwm for backlight (drm only). NB: Disables +- audio headphone output as that also uses PWM. ++Info: This overlay has been renamed to watterott-rpi-display ++Load: + + + Name: rpi-ft5406 +@@ -3418,9 +3405,8 @@ Params: poe_fan_temp0 Temperature (in millicelcius) at which the fan + + + Name: rpi-proto +-Info: Configures the RPi Proto audio card +-Load: dtoverlay=rpi-proto +-Params: ++Info: This overlay has been renamaed to proto-codec. ++Load: + + + Name: rpi-sense +@@ -4409,6 +4395,40 @@ Params: int_pin GPIO used for INT (default 25) + cs SPI bus Chip Select (default 0) + + ++Name: watterott-rpi-display ++Info: Watterott RPi-Display - 2.8" Touch Display ++ Linux has 2 drivers that support this display and this overlay supports ++ both. ++ ++ Examples: ++ fbtft/fb_ili9341: dtoverlay=watterott-rpi-display ++ drm/mi0283qt: dtoverlay=watterott-rpi-display,drm,backlight-pwm,rotate=180 ++ ++ Some notable differences with the DRM driver compared to fbtft: ++ - The display is turned on when it's first used and not on driver load ++ as with fbtft. So if nothing uses the display it stays off. ++ - Can run with a higher SPI clock increasing framerate. This is possible ++ since the driver avoids messing up the controller configuration due to ++ transmission errors by running config commands at 10MHz and only pixel ++ data at full speed (occasional pixel glitch might occur). ++ - PWM backlight is supported. ++ ++Load: dtoverlay=watterott-rpi-display,= ++Params: speed Display SPI bus speed ++ rotate Display rotation {0,90,180,270} ++ fps Delay between frame updates (fbtft only) ++ debug Debug output level {0-7} (fbtft only) ++ xohms Touchpanel sensitivity (X-plate resistance) ++ swapxy Swap x and y axis ++ backlight Change backlight GPIO pin {e.g. 12, 18} ++ (fbtft only) ++ drm Use DRM/KMS driver mi0283qt instead of fbtft. ++ Set the SPI clock to 70MHz. ++ This has to be the first parameter. ++ backlight-pwm Use pwm for backlight (drm only). NB: Disables ++ audio headphone output as that also uses PWM. ++ ++ + Name: waveshare-can-fd-hat-mode-a + Info: Overlay for the Waveshare 2-Channel Isolated CAN FD Expansion HAT + for Raspberry Pi, Multi Protections. Use this overlay when the +diff --git a/arch/arm/boot/dts/overlays/rpi-cirrus-wm5102-overlay.dts b/arch/arm/boot/dts/overlays/cirrus-wm5102-overlay.dts +similarity index 100% +rename from arch/arm/boot/dts/overlays/rpi-cirrus-wm5102-overlay.dts +rename to arch/arm/boot/dts/overlays/cirrus-wm5102-overlay.dts +diff --git a/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts b/arch/arm/boot/dts/overlays/i2s-dac-overlay.dts +similarity index 100% +rename from arch/arm/boot/dts/overlays/rpi-dac-overlay.dts +rename to arch/arm/boot/dts/overlays/i2s-dac-overlay.dts +diff --git a/arch/arm/boot/dts/overlays/overlay_map.dts b/arch/arm/boot/dts/overlays/overlay_map.dts +index df63a1793b42..aa4dbebacd56 100644 +--- a/arch/arm/boot/dts/overlays/overlay_map.dts ++++ b/arch/arm/boot/dts/overlays/overlay_map.dts +@@ -86,6 +86,22 @@ + bcm2711; + }; + ++ rpi-cirrus-wm5102 { ++ renamed = "cirrus-wm5102"; ++ }; ++ ++ rpi-dac { ++ renamed = "i2s-dac"; ++ }; ++ ++ rpi-display { ++ renamed = "watterott-rpi-display"; ++ }; ++ ++ rpi-proto { ++ renamed = "proto-codec"; ++ }; ++ + rpivid-v4l2 { + deprecated = "no longer necessary"; + }; +diff --git a/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts b/arch/arm/boot/dts/overlays/proto-codec-overlay.dts +similarity index 100% +rename from arch/arm/boot/dts/overlays/rpi-proto-overlay.dts +rename to arch/arm/boot/dts/overlays/proto-codec-overlay.dts +diff --git a/arch/arm/boot/dts/overlays/rpi-display-overlay.dts b/arch/arm/boot/dts/overlays/watterott-rpi-display-overlay.dts +similarity index 100% +rename from arch/arm/boot/dts/overlays/rpi-display-overlay.dts +rename to arch/arm/boot/dts/overlays/watterott-rpi-display-overlay.dts +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 7 Sep 2022 09:38:24 +0100 +Subject: [PATCH 1077/1183] overlays: Shorten overlay name to watterott-display + +watterott-rpi-display, although accurate, is too cumbersome, leading to +some potentially very long lines, Shorten it to watterott-display. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 2 +- + arch/arm/boot/dts/overlays/README | 10 +++++----- + arch/arm/boot/dts/overlays/overlay_map.dts | 2 +- + ...splay-overlay.dts => watterott-display-overlay.dts} | 0 + 4 files changed, 7 insertions(+), 7 deletions(-) + rename arch/arm/boot/dts/overlays/{watterott-rpi-display-overlay.dts => watterott-display-overlay.dts} (100%) + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 0464857d7ced..61a5a16af804 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -272,7 +272,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + w1-gpio.dtbo \ + w1-gpio-pullup.dtbo \ + w5500.dtbo \ +- watterott-rpi-display.dtbo \ ++ watterott-display.dtbo \ + waveshare-can-fd-hat-mode-a.dtbo \ + waveshare-can-fd-hat-mode-b.dtbo \ + wittypi.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index e6b754ec58ed..d4a3c32033a6 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -3344,7 +3344,7 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec + + + Name: rpi-display +-Info: This overlay has been renamed to watterott-rpi-display ++Info: This overlay has been renamed to watterott-display + Load: + + +@@ -4395,14 +4395,14 @@ Params: int_pin GPIO used for INT (default 25) + cs SPI bus Chip Select (default 0) + + +-Name: watterott-rpi-display ++Name: watterott-display + Info: Watterott RPi-Display - 2.8" Touch Display + Linux has 2 drivers that support this display and this overlay supports + both. + + Examples: +- fbtft/fb_ili9341: dtoverlay=watterott-rpi-display +- drm/mi0283qt: dtoverlay=watterott-rpi-display,drm,backlight-pwm,rotate=180 ++ fbtft/fb_ili9341: dtoverlay=watterott-display ++ drm/mi0283qt: dtoverlay=watterott-display,drm,backlight-pwm,rotate=180 + + Some notable differences with the DRM driver compared to fbtft: + - The display is turned on when it's first used and not on driver load +@@ -4413,7 +4413,7 @@ Info: Watterott RPi-Display - 2.8" Touch Display + data at full speed (occasional pixel glitch might occur). + - PWM backlight is supported. + +-Load: dtoverlay=watterott-rpi-display,= ++Load: dtoverlay=watterott-display,= + Params: speed Display SPI bus speed + rotate Display rotation {0,90,180,270} + fps Delay between frame updates (fbtft only) +diff --git a/arch/arm/boot/dts/overlays/overlay_map.dts b/arch/arm/boot/dts/overlays/overlay_map.dts +index aa4dbebacd56..18d888109019 100644 +--- a/arch/arm/boot/dts/overlays/overlay_map.dts ++++ b/arch/arm/boot/dts/overlays/overlay_map.dts +@@ -95,7 +95,7 @@ + }; + + rpi-display { +- renamed = "watterott-rpi-display"; ++ renamed = "watterott-display"; + }; + + rpi-proto { +diff --git a/arch/arm/boot/dts/overlays/watterott-rpi-display-overlay.dts b/arch/arm/boot/dts/overlays/watterott-display-overlay.dts +similarity index 100% +rename from arch/arm/boot/dts/overlays/watterott-rpi-display-overlay.dts +rename to arch/arm/boot/dts/overlays/watterott-display-overlay.dts +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Fri, 10 Sep 2021 15:09:39 +0200 +Subject: [PATCH 1078/1183] drm/bridge: Add a function to abstract away panels + +Display drivers so far need to have a lot of boilerplate to first +retrieve either the panel or bridge that they are connected to using +drm_of_find_panel_or_bridge(), and then either deal with each with ad-hoc +functions or create a drm panel bridge through drm_panel_bridge_add. + +In order to reduce the boilerplate and hopefully create a path of least +resistance towards using the DRM panel bridge layer, let's create the +function devm_drm_of_get_bridge() to reduce that boilerplate. + +Signed-off-by: Maxime Ripard +Reviewed-by: Sam Ravnborg +Link: https://patchwork.freedesktop.org/patch/msgid/20210910130941.1740182-2-maxime@cerno.tech +--- + drivers/gpu/drm/drm_bridge.c | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c +index 726a393b8896..0755224763bd 100644 +--- a/drivers/gpu/drm/drm_bridge.c ++++ b/drivers/gpu/drm/drm_bridge.c +@@ -1313,6 +1313,40 @@ struct drm_bridge *of_drm_find_bridge(struct device_node *np) + return NULL; + } + EXPORT_SYMBOL(of_drm_find_bridge); ++ ++/** ++ * devm_drm_of_get_bridge - Return next bridge in the chain ++ * @dev: device to tie the bridge lifetime to ++ * @np: device tree node containing encoder output ports ++ * @port: port in the device tree node ++ * @endpoint: endpoint in the device tree node ++ * ++ * Given a DT node's port and endpoint number, finds the connected node ++ * and returns the associated bridge if any, or creates and returns a ++ * drm panel bridge instance if a panel is connected. ++ * ++ * Returns a pointer to the bridge if successful, or an error pointer ++ * otherwise. ++ */ ++struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, ++ struct device_node *np, ++ u32 port, u32 endpoint) ++{ ++ struct drm_bridge *bridge; ++ struct drm_panel *panel; ++ int ret; ++ ++ ret = drm_of_find_panel_or_bridge(np, port, endpoint, ++ &panel, &bridge); ++ if (ret) ++ return ERR_PTR(ret); ++ ++ if (panel) ++ bridge = devm_drm_panel_bridge_add(dev, panel); ++ ++ return bridge; ++} ++EXPORT_SYMBOL(devm_drm_of_get_bridge); + #endif + + MODULE_AUTHOR("Ajay Kumar "); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Fri, 17 Sep 2021 20:09:25 +0200 +Subject: [PATCH 1079/1183] drm/bridge: Move devm_drm_of_get_bridge to + bridge/panel.c + +By depending on devm_drm_panel_bridge_add(), devm_drm_of_get_bridge() +introduces a circular dependency between the modules drm (where +devm_drm_of_get_bridge() ends up) and drm_kms_helper (where +devm_drm_panel_bridge_add() is). + +Fix this by moving devm_drm_of_get_bridge() to bridge/panel.c and thus +drm_kms_helper. + +Fixes: 87ea95808d53 ("drm/bridge: Add a function to abstract away panels") +Reported-by: Stephen Rothwell +Signed-off-by: Maxime Ripard +Tested-by: Heiko Stuebner +Acked-by: Thomas Zimmermann +Link: https://patchwork.freedesktop.org/patch/msgid/20210917180925.2602266-1-maxime@cerno.tech +--- + drivers/gpu/drm/drm_bridge.c | 34 ---------------------------------- + 1 file changed, 34 deletions(-) + +diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c +index 0755224763bd..726a393b8896 100644 +--- a/drivers/gpu/drm/drm_bridge.c ++++ b/drivers/gpu/drm/drm_bridge.c +@@ -1313,40 +1313,6 @@ struct drm_bridge *of_drm_find_bridge(struct device_node *np) + return NULL; + } + EXPORT_SYMBOL(of_drm_find_bridge); +- +-/** +- * devm_drm_of_get_bridge - Return next bridge in the chain +- * @dev: device to tie the bridge lifetime to +- * @np: device tree node containing encoder output ports +- * @port: port in the device tree node +- * @endpoint: endpoint in the device tree node +- * +- * Given a DT node's port and endpoint number, finds the connected node +- * and returns the associated bridge if any, or creates and returns a +- * drm panel bridge instance if a panel is connected. +- * +- * Returns a pointer to the bridge if successful, or an error pointer +- * otherwise. +- */ +-struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, +- struct device_node *np, +- u32 port, u32 endpoint) +-{ +- struct drm_bridge *bridge; +- struct drm_panel *panel; +- int ret; +- +- ret = drm_of_find_panel_or_bridge(np, port, endpoint, +- &panel, &bridge); +- if (ret) +- return ERR_PTR(ret); +- +- if (panel) +- bridge = devm_drm_panel_bridge_add(dev, panel); +- +- return bridge; +-} +-EXPORT_SYMBOL(devm_drm_of_get_bridge); + #endif + + MODULE_AUTHOR("Ajay Kumar "); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Fri, 10 Sep 2021 15:09:40 +0200 +Subject: [PATCH 1080/1183] drm/vc4: dpi: Switch to devm_drm_of_get_bridge + +The new devm_drm_of_get_bridge removes most of the boilerplate we +have to deal with. Let's switch to it. + +Signed-off-by: Maxime Ripard +Acked-by: Sam Ravnborg +Link: https://patchwork.freedesktop.org/patch/msgid/20210910130941.1740182-3-maxime@cerno.tech +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 15 ++++----------- + 1 file changed, 4 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index 1bf1a4c6033d..e1ce6d24cbae 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -268,26 +268,19 @@ static const struct of_device_id vc4_dpi_dt_match[] = { + static int vc4_dpi_init_bridge(struct vc4_dpi *dpi) + { + struct device *dev = &dpi->pdev->dev; +- struct drm_panel *panel; + struct drm_bridge *bridge; +- int ret; + +- ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, +- &panel, &bridge); +- if (ret) { ++ bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); ++ if (IS_ERR(bridge)) { + /* If nothing was connected in the DT, that's not an + * error. + */ +- if (ret == -ENODEV) ++ if (PTR_ERR(bridge) == -ENODEV) + return 0; + else +- return ret; ++ return PTR_ERR(bridge); + } + +- if (panel) +- bridge = drm_panel_bridge_add_typed(panel, +- DRM_MODE_CONNECTOR_DPI); +- + return drm_bridge_attach(dpi->encoder, bridge, NULL, 0); + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Thomas Zimmermann +Date: Mon, 2 May 2022 16:25:12 +0200 +Subject: [PATCH 1081/1183] drm: Add DRM-managed mutex_init() + +Add drmm_mutex_init(), a helper that provides managed mutex cleanup. The +mutex will be destroyed with the final reference of the DRM device. + +Signed-off-by: Thomas Zimmermann +Reviewed-by: Jocelyn Falempe +Reviewed-by: Daniel Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20220502142514.2174-2-tzimmermann@suse.de +--- + drivers/gpu/drm/drm_managed.c | 27 +++++++++++++++++++++++++++ + include/drm/drm_managed.h | 3 +++ + 2 files changed, 30 insertions(+) + +diff --git a/drivers/gpu/drm/drm_managed.c b/drivers/gpu/drm/drm_managed.c +index 37d7db6223be..4cf214de50c4 100644 +--- a/drivers/gpu/drm/drm_managed.c ++++ b/drivers/gpu/drm/drm_managed.c +@@ -8,6 +8,7 @@ + #include + + #include ++#include + #include + #include + +@@ -262,3 +263,29 @@ void drmm_kfree(struct drm_device *dev, void *data) + free_dr(dr_match); + } + EXPORT_SYMBOL(drmm_kfree); ++ ++static void drmm_mutex_release(struct drm_device *dev, void *res) ++{ ++ struct mutex *lock = res; ++ ++ mutex_destroy(lock); ++} ++ ++/** ++ * drmm_mutex_init - &drm_device-managed mutex_init() ++ * @dev: DRM device ++ * @lock: lock to be initialized ++ * ++ * Returns: ++ * 0 on success, or a negative errno code otherwise. ++ * ++ * This is a &drm_device-managed version of mutex_init(). The initialized ++ * lock is automatically destroyed on the final drm_dev_put(). ++ */ ++int drmm_mutex_init(struct drm_device *dev, struct mutex *lock) ++{ ++ mutex_init(lock); ++ ++ return drmm_add_action_or_reset(dev, drmm_mutex_release, lock); ++} ++EXPORT_SYMBOL(drmm_mutex_init); +diff --git a/include/drm/drm_managed.h b/include/drm/drm_managed.h +index b45c6fbf53ac..359883942612 100644 +--- a/include/drm/drm_managed.h ++++ b/include/drm/drm_managed.h +@@ -8,6 +8,7 @@ + #include + + struct drm_device; ++struct mutex; + + typedef void (*drmres_release_t)(struct drm_device *dev, void *res); + +@@ -104,4 +105,6 @@ char *drmm_kstrdup(struct drm_device *dev, const char *s, gfp_t gfp); + + void drmm_kfree(struct drm_device *dev, void *data); + ++int drmm_mutex_init(struct drm_device *dev, struct mutex *lock); ++ + #endif +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 23 May 2022 15:42:24 +0200 +Subject: [PATCH 1082/1183] drm/mipi-dsi: Detach devices when removing the host + +Whenever the MIPI-DSI host is unregistered, the code of +mipi_dsi_host_unregister() loops over every device currently found on that +bus and will unregister it. + +However, it doesn't detach it from the bus first, which leads to all kind +of resource leaks if the host wants to perform some clean up whenever a +device is detached. + +Fixes: 068a00233969 ("drm: Add MIPI DSI bus support") +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/drm_mipi_dsi.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c +index 5dd475e82995..2c43d54766f3 100644 +--- a/drivers/gpu/drm/drm_mipi_dsi.c ++++ b/drivers/gpu/drm/drm_mipi_dsi.c +@@ -300,6 +300,7 @@ static int mipi_dsi_remove_device_fn(struct device *dev, void *priv) + { + struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev); + ++ mipi_dsi_detach(dsi); + mipi_dsi_device_unregister(dsi); + + return 0; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 17 May 2022 15:09:33 +0200 +Subject: [PATCH 1083/1183] drm/crtc: Introduce drmm_crtc_init_with_planes + +The DRM-managed function to register a CRTC is +drmm_crtc_alloc_with_planes(), which will allocate the underlying +structure and initialisation the CRTC. + +However, we might want to separate the structure creation and the CRTC +initialisation, for example if the structure is shared across multiple +DRM entities, for example an encoder and a connector. + +Let's create an helper to only initialise a CRTC that would be passed as +an argument. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/drm_crtc.c | 93 +++++++++++++++++++++++++++++++++----- + include/drm/drm_crtc.h | 9 ++++ + 2 files changed, 90 insertions(+), 12 deletions(-) + +diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c +index 26a77a735905..2cd855fdc519 100644 +--- a/drivers/gpu/drm/drm_crtc.c ++++ b/drivers/gpu/drm/drm_crtc.c +@@ -341,9 +341,10 @@ static int __drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc * + * The @primary and @cursor planes are only relevant for legacy uAPI, see + * &drm_crtc.primary and &drm_crtc.cursor. + * +- * Note: consider using drmm_crtc_alloc_with_planes() instead of +- * drm_crtc_init_with_planes() to let the DRM managed resource infrastructure +- * take care of cleanup and deallocation. ++ * Note: consider using drmm_crtc_alloc_with_planes() or ++ * drmm_crtc_init_with_planes() instead of drm_crtc_init_with_planes() ++ * to let the DRM managed resource infrastructure take care of cleanup ++ * and deallocation. + * + * Returns: + * Zero on success, error code on failure. +@@ -368,14 +369,87 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc, + } + EXPORT_SYMBOL(drm_crtc_init_with_planes); + +-static void drmm_crtc_alloc_with_planes_cleanup(struct drm_device *dev, +- void *ptr) ++static void drmm_crtc_init_with_planes_cleanup(struct drm_device *dev, ++ void *ptr) + { + struct drm_crtc *crtc = ptr; + + drm_crtc_cleanup(crtc); + } + ++static int __drmm_crtc_init_with_planes(struct drm_device *dev, ++ struct drm_crtc *crtc, ++ struct drm_plane *primary, ++ struct drm_plane *cursor, ++ const struct drm_crtc_funcs *funcs, ++ const char *name, ++ va_list args) ++{ ++ int ret; ++ ++ drm_WARN_ON(dev, funcs && funcs->destroy); ++ ++ ret = __drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs, ++ name, args); ++ if (ret) ++ return ret; ++ ++ ret = drmm_add_action_or_reset(dev, drmm_crtc_init_with_planes_cleanup, ++ crtc); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ ++/** ++ * drmm_crtc_init_with_planes - Initialise a new CRTC object with ++ * specified primary and cursor planes. ++ * @dev: DRM device ++ * @crtc: CRTC object to init ++ * @primary: Primary plane for CRTC ++ * @cursor: Cursor plane for CRTC ++ * @funcs: callbacks for the new CRTC ++ * @name: printf style format string for the CRTC name, or NULL for default name ++ * ++ * Inits a new object created as base part of a driver crtc object. Drivers ++ * should use this function instead of drm_crtc_init(), which is only provided ++ * for backwards compatibility with drivers which do not yet support universal ++ * planes). For really simple hardware which has only 1 plane look at ++ * drm_simple_display_pipe_init() instead. ++ * ++ * Cleanup is automatically handled through registering ++ * drmm_crtc_cleanup() with drmm_add_action(). The crtc structure should ++ * be allocated with drmm_kzalloc(). ++ * ++ * The @drm_crtc_funcs.destroy hook must be NULL. ++ * ++ * The @primary and @cursor planes are only relevant for legacy uAPI, see ++ * &drm_crtc.primary and &drm_crtc.cursor. ++ * ++ * Returns: ++ * Zero on success, error code on failure. ++ */ ++int drmm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc, ++ struct drm_plane *primary, ++ struct drm_plane *cursor, ++ const struct drm_crtc_funcs *funcs, ++ const char *name, ...) ++{ ++ va_list ap; ++ int ret; ++ ++ va_start(ap, name); ++ ret = __drmm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs, ++ name, ap); ++ va_end(ap); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++EXPORT_SYMBOL(drmm_crtc_init_with_planes); ++ + void *__drmm_crtc_alloc_with_planes(struct drm_device *dev, + size_t size, size_t offset, + struct drm_plane *primary, +@@ -398,17 +472,12 @@ void *__drmm_crtc_alloc_with_planes(struct drm_device *dev, + crtc = container + offset; + + va_start(ap, name); +- ret = __drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs, +- name, ap); ++ ret = __drmm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs, ++ name, ap); + va_end(ap); + if (ret) + return ERR_PTR(ret); + +- ret = drmm_add_action_or_reset(dev, drmm_crtc_alloc_with_planes_cleanup, +- crtc); +- if (ret) +- return ERR_PTR(ret); +- + return container; + } + EXPORT_SYMBOL(__drmm_crtc_alloc_with_planes); +diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h +index 13eeba2a750a..af54b36b8876 100644 +--- a/include/drm/drm_crtc.h ++++ b/include/drm/drm_crtc.h +@@ -1221,6 +1221,15 @@ int drm_crtc_init_with_planes(struct drm_device *dev, + struct drm_plane *cursor, + const struct drm_crtc_funcs *funcs, + const char *name, ...); ++ ++__printf(6, 7) ++int drmm_crtc_init_with_planes(struct drm_device *dev, ++ struct drm_crtc *crtc, ++ struct drm_plane *primary, ++ struct drm_plane *cursor, ++ const struct drm_crtc_funcs *funcs, ++ const char *name, ...); ++ + void drm_crtc_cleanup(struct drm_crtc *crtc); + + __printf(7, 8) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 17 May 2022 15:09:33 +0200 +Subject: [PATCH 1084/1183] drm/encoder: Introduce drmm_encoder_init + +The DRM-managed function to register an encoder is +drmm_encoder_alloc() and its variants, which will allocate the underlying +structure and initialisation the encoder. + +However, we might want to separate the structure creation and the encoder +initialisation, for example if the structure is shared across multiple DRM +entities, for example an encoder and a connector. + +Let's create an helper to only initialise an encoder that would be passed +as an argument. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/drm_encoder.c | 74 +++++++++++++++++++++++++++++------ + include/drm/drm_encoder.h | 6 +++ + 2 files changed, 69 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/drm_encoder.c b/drivers/gpu/drm/drm_encoder.c +index 72e982323a5e..1d3700b43df4 100644 +--- a/drivers/gpu/drm/drm_encoder.c ++++ b/drivers/gpu/drm/drm_encoder.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + #include "drm_crtc_internal.h" + +@@ -148,9 +149,9 @@ static int __drm_encoder_init(struct drm_device *dev, + * the encoder structure. The encoder structure should not be allocated with + * devm_kzalloc(). + * +- * Note: consider using drmm_encoder_alloc() instead of drm_encoder_init() to +- * let the DRM managed resource infrastructure take care of cleanup and +- * deallocation. ++ * Note: consider using drmm_encoder_alloc() or drmm_encoder_init() ++ * instead of drm_encoder_init() to let the DRM managed resource ++ * infrastructure take care of cleanup and deallocation. + * + * Returns: + * Zero on success, error code on failure. +@@ -212,6 +213,29 @@ static void drmm_encoder_alloc_release(struct drm_device *dev, void *ptr) + drm_encoder_cleanup(encoder); + } + ++static int __drmm_encoder_init(struct drm_device *dev, ++ struct drm_encoder *encoder, ++ const struct drm_encoder_funcs *funcs, ++ int encoder_type, ++ const char *name, ++ va_list args) ++{ ++ int ret; ++ ++ if (drm_WARN_ON(dev, funcs && funcs->destroy)) ++ return -EINVAL; ++ ++ ret = __drm_encoder_init(dev, encoder, funcs, encoder_type, name, args); ++ if (ret) ++ return ret; ++ ++ ret = drmm_add_action_or_reset(dev, drmm_encoder_alloc_release, encoder); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ + void *__drmm_encoder_alloc(struct drm_device *dev, size_t size, size_t offset, + const struct drm_encoder_funcs *funcs, + int encoder_type, const char *name, ...) +@@ -221,9 +245,6 @@ void *__drmm_encoder_alloc(struct drm_device *dev, size_t size, size_t offset, + va_list ap; + int ret; + +- if (WARN_ON(funcs && funcs->destroy)) +- return ERR_PTR(-EINVAL); +- + container = drmm_kzalloc(dev, size, GFP_KERNEL); + if (!container) + return ERR_PTR(-EINVAL); +@@ -231,19 +252,50 @@ void *__drmm_encoder_alloc(struct drm_device *dev, size_t size, size_t offset, + encoder = container + offset; + + va_start(ap, name); +- ret = __drm_encoder_init(dev, encoder, funcs, encoder_type, name, ap); ++ ret = __drmm_encoder_init(dev, encoder, funcs, encoder_type, name, ap); + va_end(ap); + if (ret) + return ERR_PTR(ret); + +- ret = drmm_add_action_or_reset(dev, drmm_encoder_alloc_release, encoder); +- if (ret) +- return ERR_PTR(ret); +- + return container; + } + EXPORT_SYMBOL(__drmm_encoder_alloc); + ++/** ++ * drmm_encoder_init - Initialize a preallocated encoder ++ * @dev: drm device ++ * @encoder: the encoder to init ++ * @funcs: callbacks for this encoder (optional) ++ * @encoder_type: user visible type of the encoder ++ * @name: printf style format string for the encoder name, or NULL for default name ++ * ++ * Initializes a preallocated encoder. Encoder should be subclassed as ++ * part of driver encoder objects. Cleanup is automatically handled ++ * through registering drm_encoder_cleanup() with drmm_add_action(). The ++ * encoder structure should be allocated with drmm_kzalloc(). ++ * ++ * The @drm_encoder_funcs.destroy hook must be NULL. ++ * ++ * Returns: ++ * Zero on success, error code on failure. ++ */ ++int drmm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, ++ const struct drm_encoder_funcs *funcs, ++ int encoder_type, const char *name, ...) ++{ ++ va_list ap; ++ int ret; ++ ++ va_start(ap, name); ++ ret = __drmm_encoder_init(dev, encoder, funcs, encoder_type, name, ap); ++ va_end(ap); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++EXPORT_SYMBOL(drmm_encoder_init); ++ + static struct drm_crtc *drm_encoder_get_crtc(struct drm_encoder *encoder) + { + struct drm_connector *connector; +diff --git a/include/drm/drm_encoder.h b/include/drm/drm_encoder.h +index 6e91a0280f31..3a09682af685 100644 +--- a/include/drm/drm_encoder.h ++++ b/include/drm/drm_encoder.h +@@ -194,6 +194,12 @@ int drm_encoder_init(struct drm_device *dev, + const struct drm_encoder_funcs *funcs, + int encoder_type, const char *name, ...); + ++__printf(5, 6) ++int drmm_encoder_init(struct drm_device *dev, ++ struct drm_encoder *encoder, ++ const struct drm_encoder_funcs *funcs, ++ int encoder_type, const char *name, ...); ++ + __printf(6, 7) + void *__drmm_encoder_alloc(struct drm_device *dev, + size_t size, size_t offset, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 17 May 2022 13:22:54 +0200 +Subject: [PATCH 1085/1183] drm/connector: Reorder headers + +Unlike most of the other files in DRM, and Linux in general, the headers in +drm_connector.c aren't sorted alphabetically. Let's fix that. + +Acked-by: Sam Ravnborg +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/drm_connector.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c +index e9b7926d9b66..b4cc7721649b 100644 +--- a/drivers/gpu/drm/drm_connector.c ++++ b/drivers/gpu/drm/drm_connector.c +@@ -22,13 +22,13 @@ + + #include + #include ++#include + #include + #include +-#include +-#include +-#include + #include ++#include + #include ++#include + + #include + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 17 May 2022 15:03:34 +0200 +Subject: [PATCH 1086/1183] drm/connector: Mention the cleanup after + drm_connector_init + +Unlike encoders and CRTCs, the drm_connector_init() and +drm_connector_init_with_ddc() don't mention how the cleanup is supposed to +be done. Let's add it. + +Acked-by: Sam Ravnborg +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/drm_connector.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c +index b4cc7721649b..99951fbf556b 100644 +--- a/drivers/gpu/drm/drm_connector.c ++++ b/drivers/gpu/drm/drm_connector.c +@@ -213,6 +213,10 @@ void drm_connector_free_work_fn(struct work_struct *work) + * Initialises a preallocated connector. Connectors should be + * subclassed as part of driver connector objects. + * ++ * At driver unload time the driver's &drm_connector_funcs.destroy hook ++ * should call drm_connector_cleanup() and free the connector structure. ++ * The connector structure should not be allocated with devm_kzalloc(). ++ * + * Returns: + * Zero on success, error code on failure. + */ +@@ -335,6 +339,10 @@ EXPORT_SYMBOL(drm_connector_init); + * Initialises a preallocated connector. Connectors should be + * subclassed as part of driver connector objects. + * ++ * At driver unload time the driver's &drm_connector_funcs.destroy hook ++ * should call drm_connector_cleanup() and free the connector structure. ++ * The connector structure should not be allocated with devm_kzalloc(). ++ * + * Ensures that the ddc field of the connector is correctly set. + * + * Returns: +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 22 Jun 2022 10:33:59 +0200 +Subject: [PATCH 1087/1183] drm/connector: Clarify when + drm_connector_unregister is needed + +The current documentation for drm_connector_unregister() mentions that +it's needed for connectors that have been registered through +drm_dev_register(). + +However, this was a typo and was meant to be drm_connector_register(), +which only applies to connectors registered after drm_dev_register() has +been called. + +In addition, it was also mentioning that connectors are unregistered +automatically when drm_dev_unregister() is called. This part is a bit +misleading, since it might make it appear that +drm_connector_unregister() applies either to all connectors, or none of +them. + +After discussing it with Daniel, it appears that we always need to call +drm_connector_unregister() on connectors that have been registered with +drm_connector_register(), but only those. + +drm_connector_init() already mentions that it only needs +drm_connector_cleanup(), so let's clarify the drm_connector_register() +and drm_connector_unregister() documentation to point at each other, and +remove the misleading part about drm_dev_unregister(). + +Acked-by: Sam Ravnborg +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/drm_connector.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c +index 99951fbf556b..9f2f04b106e1 100644 +--- a/drivers/gpu/drm/drm_connector.c ++++ b/drivers/gpu/drm/drm_connector.c +@@ -507,6 +507,9 @@ EXPORT_SYMBOL(drm_connector_cleanup); + * e.g. DP MST connectors. All other connectors will be registered automatically + * when calling drm_dev_register(). + * ++ * When the connector is no longer available, callers must call ++ * drm_connector_unregister(). ++ * + * Returns: + * Zero on success, error code on failure. + */ +@@ -556,9 +559,8 @@ EXPORT_SYMBOL(drm_connector_register); + * @connector: the connector to unregister + * + * Unregister userspace interfaces for a connector. Only call this for +- * connectors which have registered explicitly by calling drm_dev_register(), +- * since connectors are unregistered automatically when drm_dev_unregister() is +- * called. ++ * connectors which have been registered explicitly by calling ++ * drm_connector_register(). + */ + void drm_connector_unregister(struct drm_connector *connector) + { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 29 Jun 2022 11:04:05 +0200 +Subject: [PATCH 1088/1183] drm/connector: Consolidate Connector Initialization + +We're going to add a DRM-managed connector initialization function. +Since we'll need both the with and without the DDC pointer, having a +single function that takes an optional pointer is easier to maintain. + +Let's create a static function that will back both existing variants, +and will be reused by the DRM-managed variant. + +Acked-by: Thomas Zimmermann +Suggested-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/drm_connector.c | 64 +++++++++++++++++---------------- + 1 file changed, 33 insertions(+), 31 deletions(-) + +diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c +index 9f2f04b106e1..491de57f7e53 100644 +--- a/drivers/gpu/drm/drm_connector.c ++++ b/drivers/gpu/drm/drm_connector.c +@@ -203,27 +203,11 @@ void drm_connector_free_work_fn(struct work_struct *work) + } + } + +-/** +- * drm_connector_init - Init a preallocated connector +- * @dev: DRM device +- * @connector: the connector to init +- * @funcs: callbacks for this connector +- * @connector_type: user visible type of the connector +- * +- * Initialises a preallocated connector. Connectors should be +- * subclassed as part of driver connector objects. +- * +- * At driver unload time the driver's &drm_connector_funcs.destroy hook +- * should call drm_connector_cleanup() and free the connector structure. +- * The connector structure should not be allocated with devm_kzalloc(). +- * +- * Returns: +- * Zero on success, error code on failure. +- */ +-int drm_connector_init(struct drm_device *dev, +- struct drm_connector *connector, +- const struct drm_connector_funcs *funcs, +- int connector_type) ++static int __drm_connector_init(struct drm_device *dev, ++ struct drm_connector *connector, ++ const struct drm_connector_funcs *funcs, ++ int connector_type, ++ struct i2c_adapter *ddc) + { + struct drm_mode_config *config = &dev->mode_config; + int ret; +@@ -274,6 +258,8 @@ int drm_connector_init(struct drm_device *dev, + INIT_LIST_HEAD(&connector->probed_modes); + INIT_LIST_HEAD(&connector->modes); + mutex_init(&connector->mutex); ++ /* provide ddc symlink in sysfs */ ++ connector->ddc = ddc; + connector->edid_blob_ptr = NULL; + connector->epoch_counter = 0; + connector->tile_blob_ptr = NULL; +@@ -326,6 +312,31 @@ int drm_connector_init(struct drm_device *dev, + + return ret; + } ++ ++/** ++ * drm_connector_init - Init a preallocated connector ++ * @dev: DRM device ++ * @connector: the connector to init ++ * @funcs: callbacks for this connector ++ * @connector_type: user visible type of the connector ++ * ++ * Initialises a preallocated connector. Connectors should be ++ * subclassed as part of driver connector objects. ++ * ++ * At driver unload time the driver's &drm_connector_funcs.destroy hook ++ * should call drm_connector_cleanup() and free the connector structure. ++ * The connector structure should not be allocated with devm_kzalloc(). ++ * ++ * Returns: ++ * Zero on success, error code on failure. ++ */ ++int drm_connector_init(struct drm_device *dev, ++ struct drm_connector *connector, ++ const struct drm_connector_funcs *funcs, ++ int connector_type) ++{ ++ return __drm_connector_init(dev, connector, funcs, connector_type, NULL); ++} + EXPORT_SYMBOL(drm_connector_init); + + /** +@@ -354,16 +365,7 @@ int drm_connector_init_with_ddc(struct drm_device *dev, + int connector_type, + struct i2c_adapter *ddc) + { +- int ret; +- +- ret = drm_connector_init(dev, connector, funcs, connector_type); +- if (ret) +- return ret; +- +- /* provide ddc symlink in sysfs */ +- connector->ddc = ddc; +- +- return ret; ++ return __drm_connector_init(dev, connector, funcs, connector_type, ddc); + } + EXPORT_SYMBOL(drm_connector_init_with_ddc); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 29 Jun 2022 11:17:10 +0200 +Subject: [PATCH 1089/1183] drm/connector: Check for destroy implementation + +Connectors need to be cleaned up with a call to drm_connector_cleanup() +in their drm_connector_funcs.destroy implementation. + +Let's check for this and complain if there's no such function. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/drm_connector.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c +index 491de57f7e53..ad2a5995642a 100644 +--- a/drivers/gpu/drm/drm_connector.c ++++ b/drivers/gpu/drm/drm_connector.c +@@ -335,6 +335,9 @@ int drm_connector_init(struct drm_device *dev, + const struct drm_connector_funcs *funcs, + int connector_type) + { ++ if (drm_WARN_ON(dev, !(funcs && funcs->destroy))) ++ return -EINVAL; ++ + return __drm_connector_init(dev, connector, funcs, connector_type, NULL); + } + EXPORT_SYMBOL(drm_connector_init); +@@ -365,6 +368,9 @@ int drm_connector_init_with_ddc(struct drm_device *dev, + int connector_type, + struct i2c_adapter *ddc) + { ++ if (drm_WARN_ON(dev, !(funcs && funcs->destroy))) ++ return -EINVAL; ++ + return __drm_connector_init(dev, connector, funcs, connector_type, ddc); + } + EXPORT_SYMBOL(drm_connector_init_with_ddc); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 17 May 2022 15:09:33 +0200 +Subject: [PATCH 1090/1183] drm/connector: Introduce drmm_connector_init + +Unlike other DRM entities, there's no helper to create a DRM-managed +initialisation of a connector. + +Let's create an helper to initialise a connector that would be passed as an +argument, and handle the cleanup through a DRM-managed action. + +Acked-by: Sam Ravnborg +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/drm_connector.c | 60 +++++++++++++++++++++++++++++++++ + include/drm/drm_connector.h | 5 +++ + 2 files changed, 65 insertions(+) + +diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c +index ad2a5995642a..dbd435e526e6 100644 +--- a/drivers/gpu/drm/drm_connector.c ++++ b/drivers/gpu/drm/drm_connector.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -327,6 +328,10 @@ static int __drm_connector_init(struct drm_device *dev, + * should call drm_connector_cleanup() and free the connector structure. + * The connector structure should not be allocated with devm_kzalloc(). + * ++ * Note: consider using drmm_connector_init() instead of ++ * drm_connector_init() to let the DRM managed resource infrastructure ++ * take care of cleanup and deallocation. ++ * + * Returns: + * Zero on success, error code on failure. + */ +@@ -359,6 +364,10 @@ EXPORT_SYMBOL(drm_connector_init); + * + * Ensures that the ddc field of the connector is correctly set. + * ++ * Note: consider using drmm_connector_init() instead of ++ * drm_connector_init_with_ddc() to let the DRM managed resource ++ * infrastructure take care of cleanup and deallocation. ++ * + * Returns: + * Zero on success, error code on failure. + */ +@@ -375,6 +384,57 @@ int drm_connector_init_with_ddc(struct drm_device *dev, + } + EXPORT_SYMBOL(drm_connector_init_with_ddc); + ++static void drm_connector_cleanup_action(struct drm_device *dev, ++ void *ptr) ++{ ++ struct drm_connector *connector = ptr; ++ ++ drm_connector_cleanup(connector); ++} ++ ++/** ++ * drmm_connector_init - Init a preallocated connector ++ * @dev: DRM device ++ * @connector: the connector to init ++ * @funcs: callbacks for this connector ++ * @connector_type: user visible type of the connector ++ * @ddc: optional pointer to the associated ddc adapter ++ * ++ * Initialises a preallocated connector. Connectors should be ++ * subclassed as part of driver connector objects. ++ * ++ * Cleanup is automatically handled with a call to ++ * drm_connector_cleanup() in a DRM-managed action. ++ * ++ * The connector structure should be allocated with drmm_kzalloc(). ++ * ++ * Returns: ++ * Zero on success, error code on failure. ++ */ ++int drmm_connector_init(struct drm_device *dev, ++ struct drm_connector *connector, ++ const struct drm_connector_funcs *funcs, ++ int connector_type, ++ struct i2c_adapter *ddc) ++{ ++ int ret; ++ ++ if (drm_WARN_ON(dev, funcs && funcs->destroy)) ++ return -EINVAL; ++ ++ ret = __drm_connector_init(dev, connector, funcs, connector_type, NULL); ++ if (ret) ++ return ret; ++ ++ ret = drmm_add_action_or_reset(dev, drm_connector_cleanup_action, ++ connector); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++EXPORT_SYMBOL(drmm_connector_init); ++ + /** + * drm_connector_attach_edid_property - attach edid property. + * @connector: the connector +diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h +index 1f43d7c6724a..9df399d9285b 100644 +--- a/include/drm/drm_connector.h ++++ b/include/drm/drm_connector.h +@@ -1579,6 +1579,11 @@ int drm_connector_init_with_ddc(struct drm_device *dev, + const struct drm_connector_funcs *funcs, + int connector_type, + struct i2c_adapter *ddc); ++int drmm_connector_init(struct drm_device *dev, ++ struct drm_connector *connector, ++ const struct drm_connector_funcs *funcs, ++ int connector_type, ++ struct i2c_adapter *ddc); + void drm_connector_attach_edid_property(struct drm_connector *connector); + int drm_connector_register(struct drm_connector *connector); + void drm_connector_unregister(struct drm_connector *connector); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 23 May 2022 16:27:12 +0200 +Subject: [PATCH 1091/1183] drm/bridge: panel: Introduce drmm_panel_bridge_add + +Unlike what can be found for other entities, there's no DRM-managed +function to create a panel_bridge instance from a panel. + +Let's introduce one. + +Acked-by: Sam Ravnborg +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/bridge/panel.c | 39 ++++++++++++++++++++++++++++++++++ + include/drm/drm_bridge.h | 2 ++ + 2 files changed, 41 insertions(+) + +diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c +index 875bf577baae..e1f7ed7f47dc 100644 +--- a/drivers/gpu/drm/bridge/panel.c ++++ b/drivers/gpu/drm/bridge/panel.c +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -322,6 +323,44 @@ struct drm_bridge *devm_drm_panel_bridge_add_typed(struct device *dev, + } + EXPORT_SYMBOL(devm_drm_panel_bridge_add_typed); + ++static void drmm_drm_panel_bridge_release(struct drm_device *drm, void *ptr) ++{ ++ struct drm_bridge *bridge = ptr; ++ ++ drm_panel_bridge_remove(bridge); ++} ++ ++/** ++ * drmm_panel_bridge_add - Creates a DRM-managed &drm_bridge and ++ * &drm_connector that just calls the ++ * appropriate functions from &drm_panel. ++ * ++ * @dev: DRM device to tie the bridge lifetime to ++ * @panel: The drm_panel being wrapped. Must be non-NULL. ++ * ++ * This is the DRM-managed version of drm_panel_bridge_add() which ++ * automatically calls drm_panel_bridge_remove() when @dev is cleaned ++ * up. ++ */ ++struct drm_bridge *drmm_panel_bridge_add(struct drm_device *drm, ++ struct drm_panel *panel) ++{ ++ struct drm_bridge *bridge; ++ int ret; ++ ++ bridge = drm_panel_bridge_add_typed(panel, panel->connector_type); ++ if (IS_ERR(bridge)) ++ return bridge; ++ ++ ret = drmm_add_action_or_reset(drm, drmm_drm_panel_bridge_release, ++ bridge); ++ if (ret) ++ return ERR_PTR(ret); ++ ++ return bridge; ++} ++EXPORT_SYMBOL(drmm_panel_bridge_add); ++ + /** + * drm_panel_bridge_connector - return the connector for the panel bridge + * @bridge: The drm_bridge. +diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h +index 3e4e87069f70..a6cffb443527 100644 +--- a/include/drm/drm_bridge.h ++++ b/include/drm/drm_bridge.h +@@ -919,6 +919,8 @@ struct drm_bridge *devm_drm_panel_bridge_add(struct device *dev, + struct drm_bridge *devm_drm_panel_bridge_add_typed(struct device *dev, + struct drm_panel *panel, + u32 connector_type); ++struct drm_bridge *drmm_panel_bridge_add(struct drm_device *drm, ++ struct drm_panel *panel); + struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge); + #endif + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 23 May 2022 16:38:52 +0200 +Subject: [PATCH 1092/1183] drm/bridge: panel: Introduce drmm_of_get_bridge + +Unlike what can be found for other DRM entities, we don't have a +DRM-managed function equivalent to devm_drm_of_get_bridge(). + +Let's create it. + +Acked-by: Sam Ravnborg +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/bridge/panel.c | 35 ++++++++++++++++++++++++++++++++++ + include/drm/drm_bridge.h | 2 ++ + 2 files changed, 37 insertions(+) + +diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c +index e1f7ed7f47dc..15ec2c505289 100644 +--- a/drivers/gpu/drm/bridge/panel.c ++++ b/drivers/gpu/drm/bridge/panel.c +@@ -414,4 +414,39 @@ struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, + return bridge; + } + EXPORT_SYMBOL(devm_drm_of_get_bridge); ++ ++/** ++ * drmm_of_get_bridge - Return next bridge in the chain ++ * @dev: device to tie the bridge lifetime to ++ * @np: device tree node containing encoder output ports ++ * @port: port in the device tree node ++ * @endpoint: endpoint in the device tree node ++ * ++ * Given a DT node's port and endpoint number, finds the connected node ++ * and returns the associated bridge if any, or creates and returns a ++ * drm panel bridge instance if a panel is connected. ++ * ++ * Returns a drmm managed pointer to the bridge if successful, or an error ++ * pointer otherwise. ++ */ ++struct drm_bridge *drmm_of_get_bridge(struct drm_device *drm, ++ struct device_node *np, ++ u32 port, u32 endpoint) ++{ ++ struct drm_bridge *bridge; ++ struct drm_panel *panel; ++ int ret; ++ ++ ret = drm_of_find_panel_or_bridge(np, port, endpoint, ++ &panel, &bridge); ++ if (ret) ++ return ERR_PTR(ret); ++ ++ if (panel) ++ bridge = drmm_panel_bridge_add(drm, panel); ++ ++ return bridge; ++} ++EXPORT_SYMBOL(drmm_of_get_bridge); ++ + #endif +diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h +index a6cffb443527..317724fbc1d3 100644 +--- a/include/drm/drm_bridge.h ++++ b/include/drm/drm_bridge.h +@@ -927,6 +927,8 @@ struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge); + #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL_BRIDGE) + struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, struct device_node *node, + u32 port, u32 endpoint); ++struct drm_bridge *drmm_of_get_bridge(struct drm_device *drm, struct device_node *node, ++ u32 port, u32 endpoint); + #else + static inline struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, + struct device_node *node, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Fri, 2 Sep 2022 13:37:22 +0200 +Subject: [PATCH 1093/1183] drm/vc4: Add module dependency on hdmi-codec + +The VC4 HDMI controller driver relies on the HDMI codec ASoC driver. In +order to set it up properly, in vc4_hdmi_audio_init(), our HDMI driver +will register a device matching the HDMI codec driver, and then register +an ASoC card using that codec. + +However, if vc4 is compiled as a module, chances are that the hdmi-codec +driver will be too. In such a case, the module loader will have a very +narrow window to load the module between the device registration and the +card registration. + +If it fails to load the module in time, the card registration will fail +with EPROBE_DEFER, and we'll abort the audio initialisation, +unregistering the HDMI codec device in the process. + +The next time the bind callback will be run, it's likely that we end up +missing that window again, effectively preventing vc4 to probe entirely. + +In order to prevent this, we can create a soft dependency of the vc4 +driver on the HDMI codec one so that we're sure the HDMI codec will be +loaded before the VC4 module is, and thus we'll never end up in the +previous situation. + +Fixes: 91e99e113929 ("drm/vc4: hdmi: Register HDMI codec") +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_drv.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 4fe07db6d911..34e8ab7cc1a7 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -502,6 +502,7 @@ module_init(vc4_drm_register); + module_exit(vc4_drm_unregister); + + MODULE_ALIAS("platform:vc4-drm"); ++MODULE_SOFTDEP("pre: snd-soc-hdmi-codec"); + MODULE_DESCRIPTION("Broadcom VC4 DRM Driver"); + MODULE_AUTHOR("Eric Anholt "); + MODULE_LICENSE("GPL v2"); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 9 May 2022 12:33:32 +0200 +Subject: [PATCH 1094/1183] drm/vc4: drv: Call component_unbind_all() + +While we were using the component framework to deal with all the DRM +subdevices, we were not calling component_unbind_all(). + +This leads to none of the subdevices freeing up their resources as part of +their unbind() or device managed hooks. + +Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.") +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_drv.c | 14 ++++++++++++-- + drivers/gpu/drm/vc4/vc4_drv.h | 1 + + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 34e8ab7cc1a7..ada490dc4e82 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -274,6 +274,13 @@ static void vc4_match_add_drivers(struct device *dev, + } + } + ++static void vc4_component_unbind_all(void *ptr) ++{ ++ struct vc4_dev *vc4 = ptr; ++ ++ component_unbind_all(vc4->dev, &vc4->base); ++} ++ + static const struct of_device_id vc4_dma_range_matches[] = { + { .compatible = "brcm,bcm2711-hvs" }, + { .compatible = "brcm,bcm2835-hvs" }, +@@ -330,6 +337,7 @@ static int vc4_drm_bind(struct device *dev) + if (IS_ERR(vc4)) + return PTR_ERR(vc4); + vc4->is_vc5 = is_vc5; ++ vc4->dev = dev; + + drm = &vc4->base; + platform_set_drvdata(pdev, drm); +@@ -380,6 +388,10 @@ static int vc4_drm_bind(struct device *dev) + if (ret) + return ret; + ++ ret = devm_add_action_or_reset(dev, vc4_component_unbind_all, vc4); ++ if (ret) ++ return ret; ++ + if (!vc4->firmware_kms) { + ret = vc4_plane_create_additional_planes(drm); + if (ret) +@@ -404,8 +416,6 @@ static int vc4_drm_bind(struct device *dev) + return 0; + + unbind_all: +- component_unbind_all(dev, drm); +- + return ret; + } + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 4a8940ca91df..0b3d149f2f59 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -76,6 +76,7 @@ struct vc4_perfmon { + + struct vc4_dev { + struct drm_device base; ++ struct device *dev; + + bool is_vc5; + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 16 Jun 2022 13:39:23 +0200 +Subject: [PATCH 1095/1183] drm/vc4: drv: Use drm_dev_unplug + +When our KMS driver is unbound, the device is no longer there but we might +still have users with an opened fd to the KMS device. + +To avoid any issue in such a situation, every device access needs to be +protected by calls to drm_dev_enter() and drm_dev_exit(), and the driver +needs to call drm_dev_unplug(). + +We'll add calls to drm_dev_enter()/drm_dev_exit() in subsequent patches +changing the relevant drivers, but let's start by calling drm_dev_unplug(). + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_drv.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index ada490dc4e82..e094237d5f9a 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -423,8 +423,7 @@ static void vc4_drm_unbind(struct device *dev) + { + struct drm_device *drm = dev_get_drvdata(dev); + +- drm_dev_unregister(drm); +- ++ drm_dev_unplug(drm); + drm_atomic_helper_shutdown(drm); + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 20 Jun 2022 14:05:46 +0200 +Subject: [PATCH 1096/1183] drm/vc4: crtc: Create vblank reporting function + +We'll need that code in the HVS driver, so let's create a shared function +to reuse it. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 23 +++++++++++++++-------- + drivers/gpu/drm/vc4/vc4_drv.h | 1 + + 2 files changed, 16 insertions(+), 8 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index f11b824d1ab5..4c45baeb82ed 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -577,6 +577,20 @@ int vc4_crtc_disable_at_boot(struct drm_crtc *crtc) + return 0; + } + ++void vc4_crtc_send_vblank(struct drm_crtc *crtc) ++{ ++ struct drm_device *dev = crtc->dev; ++ unsigned long flags; ++ ++ if (!crtc->state || !crtc->state->event) ++ return; ++ ++ spin_lock_irqsave(&dev->event_lock, flags); ++ drm_crtc_send_vblank_event(crtc, crtc->state->event); ++ crtc->state->event = NULL; ++ spin_unlock_irqrestore(&dev->event_lock, flags); ++} ++ + static void vc4_crtc_atomic_disable(struct drm_crtc *crtc, + struct drm_atomic_state *state) + { +@@ -600,14 +614,7 @@ static void vc4_crtc_atomic_disable(struct drm_crtc *crtc, + * Make sure we issue a vblank event after disabling the CRTC if + * someone was waiting it. + */ +- if (crtc->state->event) { +- unsigned long flags; +- +- spin_lock_irqsave(&dev->event_lock, flags); +- drm_crtc_send_vblank_event(crtc, crtc->state->event); +- crtc->state->event = NULL; +- spin_unlock_irqrestore(&dev->event_lock, flags); +- } ++ vc4_crtc_send_vblank(crtc); + } + + static void vc4_crtc_atomic_enable(struct drm_crtc *crtc, +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 0b3d149f2f59..138b36bb9487 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -899,6 +899,7 @@ void vc4_crtc_destroy_state(struct drm_crtc *crtc, + struct drm_crtc_state *state); + void vc4_crtc_reset(struct drm_crtc *crtc); + void vc4_crtc_handle_vblank(struct vc4_crtc *crtc); ++void vc4_crtc_send_vblank(struct drm_crtc *crtc); + void vc4_crtc_get_margins(struct drm_crtc_state *state, + unsigned int *left, unsigned int *right, + unsigned int *top, unsigned int *bottom); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 17 May 2022 18:19:19 +0200 +Subject: [PATCH 1097/1183] drm/vc4: hvs: Protect device resources after + removal + +Whenever the device and driver are unbound, the main device and all the +subdevices will be removed by calling their unbind() method. + +However, the DRM device itself will only be freed when the last user will +have closed it. + +It means that there is a time window where the device and its resources +aren't there anymore, but the userspace can still call into our driver. + +Fortunately, the DRM framework provides the drm_dev_enter() and +drm_dev_exit() functions to make sure our underlying device is still there +for the section protected by those calls. Let's add them to the HVS driver. + +Acked-by: Thomas Zimmermann +Reviewed-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hvs.c | 103 +++++++++++++++++++++++++++++++--- + 1 file changed, 96 insertions(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c +index e0d4c86dee34..66d6bc447a15 100644 +--- a/drivers/gpu/drm/vc4/vc4_hvs.c ++++ b/drivers/gpu/drm/vc4/vc4_hvs.c +@@ -25,6 +25,7 @@ + #include + + #include ++#include + #include + + #include "vc4_drv.h" +@@ -66,11 +67,15 @@ static const struct debugfs_reg32 hvs_regs[] = { + + void vc4_hvs_dump_state(struct vc4_hvs *hvs) + { ++ struct drm_device *drm = &hvs->vc4->base; + struct drm_printer p = drm_info_printer(&hvs->pdev->dev); +- int i; ++ int idx, i; + + drm_print_regset32(&p, &hvs->regset); + ++ if (!drm_dev_enter(drm, &idx)) ++ return; ++ + DRM_INFO("HVS ctx:\n"); + for (i = 0; i < 64; i += 4) { + DRM_INFO("0x%08x (%s): 0x%08x 0x%08x 0x%08x 0x%08x\n", +@@ -80,6 +85,8 @@ void vc4_hvs_dump_state(struct vc4_hvs *hvs) + readl((u32 __iomem *)hvs->dlist + i + 2), + readl((u32 __iomem *)hvs->dlist + i + 3)); + } ++ ++ drm_dev_exit(idx); + } + + static int vc4_hvs_debugfs_underrun(struct seq_file *m, void *data) +@@ -254,6 +261,11 @@ static int vc4_hvs_upload_linear_kernel(struct vc4_hvs *hvs, + int ret, i; + u32 __iomem *dst_kernel; + ++ /* ++ * NOTE: We don't need a call to drm_dev_enter()/drm_dev_exit() ++ * here since that function is only called from vc4_hvs_bind(). ++ */ ++ + ret = drm_mm_insert_node(&hvs->dlist_mm, space, VC4_KERNEL_DWORDS); + if (ret) { + DRM_ERROR("Failed to allocate space for filter kernel: %d\n", +@@ -278,10 +290,15 @@ static int vc4_hvs_upload_linear_kernel(struct vc4_hvs *hvs, + static void vc4_hvs_lut_load(struct vc4_hvs *hvs, + struct vc4_crtc *vc4_crtc) + { ++ struct drm_device *drm = &hvs->vc4->base; + struct drm_crtc *crtc = &vc4_crtc->base; + struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state); ++ int idx; + u32 i; + ++ if (!drm_dev_enter(drm, &idx)) ++ return; ++ + /* The LUT memory is laid out with each HVS channel in order, + * each of which takes 256 writes for R, 256 for G, then 256 + * for B. +@@ -296,6 +313,8 @@ static void vc4_hvs_lut_load(struct vc4_hvs *hvs, + HVS_WRITE(SCALER_GAMDATA, vc4_crtc->lut_g[i]); + for (i = 0; i < crtc->gamma_size; i++) + HVS_WRITE(SCALER_GAMDATA, vc4_crtc->lut_b[i]); ++ ++ drm_dev_exit(idx); + } + + static void vc4_hvs_update_gamma_lut(struct vc4_hvs *hvs, +@@ -391,7 +410,12 @@ static void vc5_hvs_update_gamma_lut(struct vc4_hvs *hvs, + + u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo) + { ++ struct drm_device *drm = &hvs->vc4->base; + u8 field = 0; ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return 0; + + switch (fifo) { + case 0: +@@ -408,6 +432,7 @@ u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo) + break; + } + ++ drm_dev_exit(idx); + return field; + } + +@@ -420,6 +445,12 @@ int vc4_hvs_get_fifo_from_output(struct vc4_hvs *hvs, unsigned int output) + if (!vc4->is_vc5) + return output; + ++ /* ++ * NOTE: We should probably use drm_dev_enter()/drm_dev_exit() ++ * here, but this function is only used during the DRM device ++ * initialization, so we should be fine. ++ */ ++ + switch (output) { + case 0: + return 0; +@@ -468,12 +499,17 @@ static int vc4_hvs_init_channel(struct vc4_hvs *hvs, struct drm_crtc *crtc, + struct drm_display_mode *mode, bool oneshot) + { + struct vc4_dev *vc4 = hvs->vc4; ++ struct drm_device *drm = &vc4->base; + struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); + struct vc4_crtc_state *vc4_crtc_state = to_vc4_crtc_state(crtc->state); + unsigned int chan = vc4_crtc_state->assigned_channel; + bool interlace = mode->flags & DRM_MODE_FLAG_INTERLACE; + u32 dispbkgndx; + u32 dispctrl; ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return -ENODEV; + + HVS_WRITE(SCALER_DISPCTRLX(chan), 0); + HVS_WRITE(SCALER_DISPCTRLX(chan), SCALER_DISPCTRLX_RESET); +@@ -523,14 +559,22 @@ static int vc4_hvs_init_channel(struct vc4_hvs *hvs, struct drm_crtc *crtc, + else + vc5_hvs_lut_load(hvs, vc4_crtc); + ++ drm_dev_exit(idx); ++ + return 0; + } + + void vc4_hvs_stop_channel(struct vc4_hvs *hvs, unsigned int chan) + { +- if (HVS_READ(SCALER_DISPCTRLX(chan)) & SCALER_DISPCTRLX_ENABLE) ++ struct drm_device *drm = &hvs->vc4->base; ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) + return; + ++ if (HVS_READ(SCALER_DISPCTRLX(chan)) & SCALER_DISPCTRLX_ENABLE) ++ goto out; ++ + HVS_WRITE(SCALER_DISPCTRLX(chan), + HVS_READ(SCALER_DISPCTRLX(chan)) | SCALER_DISPCTRLX_RESET); + HVS_WRITE(SCALER_DISPCTRLX(chan), +@@ -546,6 +590,9 @@ void vc4_hvs_stop_channel(struct vc4_hvs *hvs, unsigned int chan) + WARN_ON_ONCE((HVS_READ(SCALER_DISPSTATX(chan)) & + (SCALER_DISPSTATX_FULL | SCALER_DISPSTATX_EMPTY)) != + SCALER_DISPSTATX_EMPTY); ++ ++out: ++ drm_dev_exit(idx); + } + + static int vc4_hvs_gamma_check(struct drm_crtc *crtc, +@@ -627,9 +674,15 @@ static void vc4_hvs_install_dlist(struct drm_crtc *crtc) + struct vc4_dev *vc4 = to_vc4_dev(dev); + struct vc4_hvs *hvs = vc4->hvs; + struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state); ++ int idx; ++ ++ if (!drm_dev_enter(dev, &idx)) ++ return; + + HVS_WRITE(SCALER_DISPLISTX(vc4_state->assigned_channel), + vc4_state->mm.start); ++ ++ drm_dev_exit(idx); + } + + static void vc4_hvs_update_dlist(struct drm_crtc *crtc) +@@ -716,9 +769,17 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc, + u32 __iomem *dlist_next = dlist_start; + unsigned int zpos = 0; + bool found = false; ++ int idx; + +- if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED) ++ if (!drm_dev_enter(dev, &idx)) { ++ vc4_crtc_send_vblank(crtc); + return; ++ } ++ ++ if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED) { ++ drm_dev_exit(idx); ++ return; ++ } + + if (debug_dump_regs) { + DRM_INFO("CRTC %d HVS before:\n", drm_crtc_index(crtc)); +@@ -811,28 +872,46 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc, + DRM_INFO("CRTC %d HVS after:\n", drm_crtc_index(crtc)); + vc4_hvs_dump_state(hvs); + } ++ ++ drm_dev_exit(idx); + } + + void vc4_hvs_mask_underrun(struct vc4_hvs *hvs, int channel) + { +- u32 dispctrl = HVS_READ(SCALER_DISPCTRL); ++ struct drm_device *drm = &hvs->vc4->base; ++ u32 dispctrl; ++ int idx; + ++ if (!drm_dev_enter(drm, &idx)) ++ return; ++ ++ dispctrl = HVS_READ(SCALER_DISPCTRL); + dispctrl &= ~(hvs->vc4->is_vc5 ? SCALER5_DISPCTRL_DSPEISLUR(channel) : + SCALER_DISPCTRL_DSPEISLUR(channel)); + + HVS_WRITE(SCALER_DISPCTRL, dispctrl); ++ ++ drm_dev_exit(idx); + } + + void vc4_hvs_unmask_underrun(struct vc4_hvs *hvs, int channel) + { +- u32 dispctrl = HVS_READ(SCALER_DISPCTRL); ++ struct drm_device *drm = &hvs->vc4->base; ++ u32 dispctrl; ++ int idx; + ++ if (!drm_dev_enter(drm, &idx)) ++ return; ++ ++ dispctrl = HVS_READ(SCALER_DISPCTRL); + dispctrl |= (hvs->vc4->is_vc5 ? SCALER5_DISPCTRL_DSPEISLUR(channel) : + SCALER_DISPCTRL_DSPEISLUR(channel)); + + HVS_WRITE(SCALER_DISPSTAT, + SCALER_DISPSTAT_EUFLOW(channel)); + HVS_WRITE(SCALER_DISPCTRL, dispctrl); ++ ++ drm_dev_exit(idx); + } + + static void vc4_hvs_report_underrun(struct drm_device *dev) +@@ -854,6 +933,17 @@ static irqreturn_t vc4_hvs_irq_handler(int irq, void *data) + u32 status; + u32 dspeislur; + ++ /* ++ * NOTE: We don't need to protect the register access using ++ * drm_dev_enter() there because the interrupt handler lifetime ++ * is tied to the device itself, and not to the DRM device. ++ * ++ * So when the device will be gone, one of the first thing we ++ * will be doing will be to unregister the interrupt handler, ++ * and then unregister the DRM device. drm_dev_enter() would ++ * thus always succeed if we are here. ++ */ ++ + status = HVS_READ(SCALER_DISPSTAT); + control = HVS_READ(SCALER_DISPCTRL); + +@@ -888,10 +978,9 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) + u32 dispctrl; + u32 reg, top; + +- hvs = devm_kzalloc(&pdev->dev, sizeof(*hvs), GFP_KERNEL); ++ hvs = drmm_kzalloc(drm, sizeof(*hvs), GFP_KERNEL); + if (!hvs) + return -ENOMEM; +- + hvs->vc4 = vc4; + hvs->pdev = pdev; + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 9 May 2022 13:46:54 +0200 +Subject: [PATCH 1098/1183] drm/vc4: hvs: Remove planes currently allocated + before taking down + +When the HVS driver is unbound, a lot of memory allocations in the LBM and +DLIST RAM are still assigned to planes that are still allocated. + +Thus, we hit a warning when calling drm_mm_takedown() since the memory pool +is not completely free of allocations. + +Let's free all the currently live entries before calling drm_mm_takedown(). + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hvs.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c +index 66d6bc447a15..aa06751f5586 100644 +--- a/drivers/gpu/drm/vc4/vc4_hvs.c ++++ b/drivers/gpu/drm/vc4/vc4_hvs.c +@@ -1202,11 +1202,18 @@ static void vc4_hvs_unbind(struct device *dev, struct device *master, + struct drm_device *drm = dev_get_drvdata(master); + struct vc4_dev *vc4 = to_vc4_dev(drm); + struct vc4_hvs *hvs = vc4->hvs; ++ struct drm_mm_node *node, *next; + + if (drm_mm_node_allocated(&vc4->hvs->mitchell_netravali_filter)) + drm_mm_remove_node(&vc4->hvs->mitchell_netravali_filter); + ++ drm_mm_for_each_node_safe(node, next, &vc4->hvs->dlist_mm) ++ drm_mm_remove_node(node); ++ + drm_mm_takedown(&vc4->hvs->dlist_mm); ++ ++ drm_mm_for_each_node_safe(node, next, &vc4->hvs->lbm_mm) ++ drm_mm_remove_node(node); + drm_mm_takedown(&vc4->hvs->lbm_mm); + + clk_disable_unprepare(hvs->core_clk); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 25 May 2022 11:03:10 +0200 +Subject: [PATCH 1099/1183] drm/vc4: plane: Take possible_crtcs as an argument + +vc4_plane_init() currently initialises the plane with no possible CRTCs, +and will expect the caller to set it up by itself. + +Let's change that logic a bit to follow the syntax of +drm_universal_plane_init() and pass the possible CRTCs bitmask as an +argument to the function instead. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 2 +- + drivers/gpu/drm/vc4/vc4_drv.h | 3 ++- + drivers/gpu/drm/vc4/vc4_plane.c | 15 +++++++-------- + 3 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 4c45baeb82ed..7bdac445da51 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -1273,7 +1273,7 @@ int vc4_crtc_init(struct drm_device *drm, struct vc4_crtc *vc4_crtc, + * requirement of the plane configuration, and reject ones + * that will take too much. + */ +- primary_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_PRIMARY); ++ primary_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_PRIMARY, 0); + if (IS_ERR(primary_plane)) { + dev_err(drm->dev, "failed to construct primary plane\n"); + return PTR_ERR(primary_plane); +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 138b36bb9487..6280475536db 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -1000,7 +1000,8 @@ int vc4_kms_load(struct drm_device *dev); + + /* vc4_plane.c */ + struct drm_plane *vc4_plane_init(struct drm_device *dev, +- enum drm_plane_type type); ++ enum drm_plane_type type, ++ uint32_t possible_crtcs); + int vc4_plane_create_additional_planes(struct drm_device *dev); + u32 vc4_plane_write_dlist(struct drm_plane *plane, u32 __iomem *dlist); + u32 vc4_plane_dlist_size(const struct drm_plane_state *state); +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 5d8dc921bfa7..7381eafc4d6c 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -1655,7 +1655,8 @@ static const struct drm_plane_funcs vc4_plane_funcs = { + }; + + struct drm_plane *vc4_plane_init(struct drm_device *dev, +- enum drm_plane_type type) ++ enum drm_plane_type type, ++ uint32_t possible_crtcs) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); + struct drm_plane *plane = NULL; +@@ -1686,7 +1687,7 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, + } + + plane = &vc4_plane->base; +- ret = drm_universal_plane_init(dev, plane, 0, ++ ret = drm_universal_plane_init(dev, plane, possible_crtcs, + &vc4_plane_funcs, + formats, num_formats, + modifiers, type, NULL); +@@ -1745,14 +1746,12 @@ int vc4_plane_create_additional_planes(struct drm_device *drm) + */ + for (i = 0; i < VC4_NUM_OVERLAY_PLANES; i++) { + struct drm_plane *plane = +- vc4_plane_init(drm, DRM_PLANE_TYPE_OVERLAY); ++ vc4_plane_init(drm, DRM_PLANE_TYPE_OVERLAY, ++ GENMASK(drm->mode_config.num_crtc - 1, 0)); + + if (IS_ERR(plane)) + continue; + +- plane->possible_crtcs = +- GENMASK(drm->mode_config.num_crtc - 1, 0); +- + /* Create zpos property. Max of all the overlays + 1 primary + + * 1 cursor plane on a crtc. + */ +@@ -1765,9 +1764,9 @@ int vc4_plane_create_additional_planes(struct drm_device *drm) + * since the zpos fallback is that planes are rendered by plane + * ID order, and that then puts the cursor on top. + */ +- cursor_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_CURSOR); ++ cursor_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_CURSOR, ++ drm_crtc_mask(crtc)); + if (!IS_ERR(cursor_plane)) { +- cursor_plane->possible_crtcs = drm_crtc_mask(crtc); + crtc->cursor = cursor_plane; + + drm_plane_create_zpos_property(cursor_plane, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 22 Jun 2022 16:15:11 +0200 +Subject: [PATCH 1100/1183] drm/vc4: crtc: Remove manual plane removal on error + +When vc4_crtc_bind() fails after vc4_crtc_init() has been called, we have +a loop undoing the plane creation and calling destroy on each plane +registered and matching the possible_crtcs mask. + +However, this is redundant with what drm_mode_config_cleanup() is doing, so +let's remove it. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 11 +---------- + 1 file changed, 1 insertion(+), 10 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 7bdac445da51..391a68d2ee96 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -1363,7 +1363,7 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data) + IRQF_SHARED, + "vc4 crtc", vc4_crtc); + if (ret) +- goto err_destroy_planes; ++ return ret; + + platform_set_drvdata(pdev, vc4_crtc); + +@@ -1371,15 +1371,6 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data) + &vc4_crtc->regset); + + return 0; +- +-err_destroy_planes: +- list_for_each_entry_safe(destroy_plane, temp, +- &drm->mode_config.plane_list, head) { +- if (destroy_plane->possible_crtcs == drm_crtc_mask(crtc)) +- destroy_plane->funcs->destroy(destroy_plane); +- } +- +- return ret; + } + + static void vc4_crtc_unbind(struct device *dev, struct device *master, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 25 May 2022 11:05:30 +0200 +Subject: [PATCH 1101/1183] drm/vc4: plane: Switch to + drmm_universal_plane_alloc() + +Let's switch to drmm_universal_plane_alloc() for our plane allocation and +initialisation to make the driver a bit simpler. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 1 - + drivers/gpu/drm/vc4/vc4_plane.c | 23 ++++++++--------------- + 2 files changed, 8 insertions(+), 16 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 391a68d2ee96..4ed2dbf251d2 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -1328,7 +1328,6 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data) + const struct vc4_pv_data *pv_data; + struct vc4_crtc *vc4_crtc; + struct drm_crtc *crtc; +- struct drm_plane *destroy_plane, *temp; + int ret; + + vc4_crtc = devm_kzalloc(dev, sizeof(*vc4_crtc), GFP_KERNEL); +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 7381eafc4d6c..2150cee5a405 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -1646,8 +1646,6 @@ static bool vc4_format_mod_supported(struct drm_plane *plane, + static const struct drm_plane_funcs vc4_plane_funcs = { + .update_plane = drm_atomic_helper_update_plane, + .disable_plane = drm_atomic_helper_disable_plane, +- .destroy = drm_plane_cleanup, +- .set_property = NULL, + .reset = vc4_plane_reset, + .atomic_duplicate_state = vc4_plane_duplicate_state, + .atomic_destroy_state = vc4_plane_destroy_state, +@@ -1659,11 +1657,10 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, + uint32_t possible_crtcs) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); +- struct drm_plane *plane = NULL; ++ struct drm_plane *plane; + struct vc4_plane *vc4_plane; + u32 formats[ARRAY_SIZE(hvs_formats)]; + int num_formats = 0; +- int ret = 0; + unsigned i; + static const uint64_t modifiers[] = { + DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED, +@@ -1674,11 +1671,6 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, + DRM_FORMAT_MOD_INVALID + }; + +- vc4_plane = devm_kzalloc(dev->dev, sizeof(*vc4_plane), +- GFP_KERNEL); +- if (!vc4_plane) +- return ERR_PTR(-ENOMEM); +- + for (i = 0; i < ARRAY_SIZE(hvs_formats); i++) { + if (!hvs_formats[i].hvs5_only || vc4->is_vc5) { + formats[num_formats] = hvs_formats[i].drm; +@@ -1686,13 +1678,14 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, + } + } + ++ vc4_plane = drmm_universal_plane_alloc(dev, struct vc4_plane, base, ++ possible_crtcs, ++ &vc4_plane_funcs, ++ formats, num_formats, ++ modifiers, type, NULL); ++ if (IS_ERR(vc4_plane)) ++ return ERR_CAST(vc4_plane); + plane = &vc4_plane->base; +- ret = drm_universal_plane_init(dev, plane, possible_crtcs, +- &vc4_plane_funcs, +- formats, num_formats, +- modifiers, type, NULL); +- if (ret) +- return ERR_PTR(ret); + + if (vc4->is_vc5) + drm_plane_helper_add(plane, &vc5_plane_helper_funcs); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 23 May 2022 15:44:13 +0200 +Subject: [PATCH 1102/1183] drm/vc4: crtc: Move debugfs_name to crtc_data + +All the CRTCs, including the TXP, have a debugfs file and name so we can +consolidate it into vc4_crtc_data. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 18 +++++++++--------- + drivers/gpu/drm/vc4/vc4_drv.h | 4 ++-- + drivers/gpu/drm/vc4/vc4_txp.c | 1 + + 3 files changed, 12 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 4ed2dbf251d2..eb4072b85fd2 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -1113,10 +1113,10 @@ static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = { + + static const struct vc4_pv_data bcm2835_pv0_data = { + .base = { ++ .debugfs_name = "crtc0_regs", + .hvs_available_channels = BIT(0), + .hvs_output = 0, + }, +- .debugfs_name = "crtc0_regs", + .fifo_depth = 64, + .pixels_per_clock = 1, + .encoder_types = { +@@ -1127,10 +1127,10 @@ static const struct vc4_pv_data bcm2835_pv0_data = { + + static const struct vc4_pv_data bcm2835_pv1_data = { + .base = { ++ .debugfs_name = "crtc1_regs", + .hvs_available_channels = BIT(2), + .hvs_output = 2, + }, +- .debugfs_name = "crtc1_regs", + .fifo_depth = 64, + .pixels_per_clock = 1, + .encoder_types = { +@@ -1141,10 +1141,10 @@ static const struct vc4_pv_data bcm2835_pv1_data = { + + static const struct vc4_pv_data bcm2835_pv2_data = { + .base = { ++ .debugfs_name = "crtc2_regs", + .hvs_available_channels = BIT(1), + .hvs_output = 1, + }, +- .debugfs_name = "crtc2_regs", + .fifo_depth = 64, + .pixels_per_clock = 1, + .encoder_types = { +@@ -1155,10 +1155,10 @@ static const struct vc4_pv_data bcm2835_pv2_data = { + + static const struct vc4_pv_data bcm2711_pv0_data = { + .base = { ++ .debugfs_name = "crtc0_regs", + .hvs_available_channels = BIT(0), + .hvs_output = 0, + }, +- .debugfs_name = "crtc0_regs", + .fifo_depth = 64, + .pixels_per_clock = 1, + .encoder_types = { +@@ -1169,10 +1169,10 @@ static const struct vc4_pv_data bcm2711_pv0_data = { + + static const struct vc4_pv_data bcm2711_pv1_data = { + .base = { ++ .debugfs_name = "crtc1_regs", + .hvs_available_channels = BIT(0) | BIT(1) | BIT(2), + .hvs_output = 3, + }, +- .debugfs_name = "crtc1_regs", + .fifo_depth = 64, + .pixels_per_clock = 1, + .encoder_types = { +@@ -1183,10 +1183,10 @@ static const struct vc4_pv_data bcm2711_pv1_data = { + + static const struct vc4_pv_data bcm2711_pv2_data = { + .base = { ++ .debugfs_name = "crtc2_regs", + .hvs_available_channels = BIT(0) | BIT(1) | BIT(2), + .hvs_output = 4, + }, +- .debugfs_name = "crtc2_regs", + .fifo_depth = 256, + .pixels_per_clock = 2, + .encoder_types = { +@@ -1196,10 +1196,10 @@ static const struct vc4_pv_data bcm2711_pv2_data = { + + static const struct vc4_pv_data bcm2711_pv3_data = { + .base = { ++ .debugfs_name = "crtc3_regs", + .hvs_available_channels = BIT(1), + .hvs_output = 1, + }, +- .debugfs_name = "crtc3_regs", + .fifo_depth = 64, + .pixels_per_clock = 1, + .encoder_types = { +@@ -1209,10 +1209,10 @@ static const struct vc4_pv_data bcm2711_pv3_data = { + + static const struct vc4_pv_data bcm2711_pv4_data = { + .base = { ++ .debugfs_name = "crtc4_regs", + .hvs_available_channels = BIT(0) | BIT(1) | BIT(2), + .hvs_output = 5, + }, +- .debugfs_name = "crtc4_regs", + .fifo_depth = 64, + .pixels_per_clock = 2, + .encoder_types = { +@@ -1366,7 +1366,7 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data) + + platform_set_drvdata(pdev, vc4_crtc); + +- vc4_debugfs_add_regset32(drm, pv_data->debugfs_name, ++ vc4_debugfs_add_regset32(drm, pv_data->base.debugfs_name, + &vc4_crtc->regset); + + return 0; +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 6280475536db..154ae48811e1 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -477,6 +477,8 @@ to_vc4_encoder(struct drm_encoder *encoder) + } + + struct vc4_crtc_data { ++ const char *debugfs_name; ++ + /* Bitmask of channels (FIFOs) of the HVS that the output can source from */ + unsigned int hvs_available_channels; + +@@ -494,8 +496,6 @@ struct vc4_pv_data { + u8 pixels_per_clock; + + enum vc4_encoder_type encoder_types[4]; +- const char *debugfs_name; +- + }; + + struct vc5_gamma_entry { +diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c +index 82beb8c159f2..e983ff7c5e13 100644 +--- a/drivers/gpu/drm/vc4/vc4_txp.c ++++ b/drivers/gpu/drm/vc4/vc4_txp.c +@@ -460,6 +460,7 @@ static irqreturn_t vc4_txp_interrupt(int irq, void *data) + } + + static const struct vc4_crtc_data vc4_txp_crtc_data = { ++ .debugfs_name = "txp_regs", + .hvs_available_channels = BIT(2), + .hvs_output = 2, + }; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 23 May 2022 17:11:29 +0200 +Subject: [PATCH 1103/1183] drm/vc4: crtc: Switch to drmm_kzalloc + +Our internal structure that stores the DRM entities structure is allocated +through a device-managed kzalloc. + +This means that this will eventually be freed whenever the device is +removed. In our case, the most likely source of removal is that the main +device is going to be unbound, and component_unbind_all() is being run. + +However, it occurs while the DRM device is still registered, which will +create dangling pointers, eventually resulting in use-after-free. + +Switch to a DRM-managed allocation to keep our structure until the DRM +driver doesn't need it anymore. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index eb4072b85fd2..7e48d401d32a 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -1330,7 +1330,7 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data) + struct drm_crtc *crtc; + int ret; + +- vc4_crtc = devm_kzalloc(dev, sizeof(*vc4_crtc), GFP_KERNEL); ++ vc4_crtc = drmm_kzalloc(drm, sizeof(*vc4_crtc), GFP_KERNEL); + if (!vc4_crtc) + return -ENOMEM; + crtc = &vc4_crtc->base; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 11:05:36 +0200 +Subject: [PATCH 1104/1183] drm/vc4: crtc: Switch to DRM-managed CRTC + initialization + +The current code will call drm_crtc_cleanup() when the device is +unbound. However, by then, there might still be some references held to +that CRTC, including by the userspace that might still have the DRM +device open. + +Let's switch to a DRM-managed initialization to clean up after ourselves +only once the DRM device has been last closed. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 16 ++++++---------- + drivers/gpu/drm/vc4/vc4_drv.h | 1 - + drivers/gpu/drm/vc4/vc4_txp.c | 1 - + 3 files changed, 6 insertions(+), 12 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 7e48d401d32a..5bc7eae9ab06 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -205,11 +205,6 @@ static bool vc4_crtc_get_scanout_position(struct drm_crtc *crtc, + return ret; + } + +-void vc4_crtc_destroy(struct drm_crtc *crtc) +-{ +- drm_crtc_cleanup(crtc); +-} +- + static u32 vc4_get_fifo_full_level(struct vc4_crtc *vc4_crtc, u32 format) + { + const struct vc4_crtc_data *crtc_data = vc4_crtc_to_vc4_crtc_data(vc4_crtc); +@@ -1088,7 +1083,6 @@ void vc4_crtc_reset(struct drm_crtc *crtc) + + static const struct drm_crtc_funcs vc4_crtc_funcs = { + .set_config = drm_atomic_helper_set_config, +- .destroy = vc4_crtc_destroy, + .page_flip = vc4_page_flip, + .set_property = NULL, + .cursor_set = NULL, /* handled by drm_mode_cursor_universal */ +@@ -1266,6 +1260,7 @@ int vc4_crtc_init(struct drm_device *drm, struct vc4_crtc *vc4_crtc, + struct drm_crtc *crtc = &vc4_crtc->base; + struct drm_plane *primary_plane; + unsigned int i; ++ int ret; + + /* For now, we create just the primary and the legacy cursor + * planes. We should be able to stack more planes on easily, +@@ -1280,8 +1275,11 @@ int vc4_crtc_init(struct drm_device *drm, struct vc4_crtc *vc4_crtc, + } + + spin_lock_init(&vc4_crtc->irq_lock); +- drm_crtc_init_with_planes(drm, crtc, primary_plane, NULL, +- crtc_funcs, NULL); ++ ret = drmm_crtc_init_with_planes(drm, crtc, primary_plane, NULL, ++ crtc_funcs, NULL); ++ if (ret) ++ return ret; ++ + drm_crtc_helper_add(crtc, crtc_helper_funcs); + + if (!vc4->is_vc5) { +@@ -1378,8 +1376,6 @@ static void vc4_crtc_unbind(struct device *dev, struct device *master, + struct platform_device *pdev = to_platform_device(dev); + struct vc4_crtc *vc4_crtc = dev_get_drvdata(dev); + +- vc4_crtc_destroy(&vc4_crtc->base); +- + CRTC_WRITE(PV_INTEN, 0); + + platform_set_drvdata(pdev, NULL); +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 154ae48811e1..929cf9b45a5e 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -888,7 +888,6 @@ int vc4_crtc_disable_at_boot(struct drm_crtc *crtc); + int vc4_crtc_init(struct drm_device *drm, struct vc4_crtc *vc4_crtc, + const struct drm_crtc_funcs *crtc_funcs, + const struct drm_crtc_helper_funcs *crtc_helper_funcs); +-void vc4_crtc_destroy(struct drm_crtc *crtc); + int vc4_page_flip(struct drm_crtc *crtc, + struct drm_framebuffer *fb, + struct drm_pending_vblank_event *event, +diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c +index e983ff7c5e13..f306e05ac5b2 100644 +--- a/drivers/gpu/drm/vc4/vc4_txp.c ++++ b/drivers/gpu/drm/vc4/vc4_txp.c +@@ -383,7 +383,6 @@ static void vc4_txp_disable_vblank(struct drm_crtc *crtc) {} + + static const struct drm_crtc_funcs vc4_txp_crtc_funcs = { + .set_config = drm_atomic_helper_set_config, +- .destroy = vc4_crtc_destroy, + .page_flip = vc4_page_flip, + .reset = vc4_crtc_reset, + .atomic_duplicate_state = vc4_crtc_duplicate_state, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 3 Sep 2020 10:01:20 +0200 +Subject: [PATCH 1105/1183] drm/vc4: dpi: Remove vc4_dev dpi pointer + +There's no user for that pointer so let's just get rid of it. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 7 ------- + drivers/gpu/drm/vc4/vc4_drv.h | 1 - + 2 files changed, 8 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index e1ce6d24cbae..c383a2c3f7eb 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -288,7 +288,6 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + { + struct platform_device *pdev = to_platform_device(dev); + struct drm_device *drm = dev_get_drvdata(master); +- struct vc4_dev *vc4 = to_vc4_dev(drm); + struct vc4_dpi *dpi; + struct vc4_dpi_encoder *vc4_dpi_encoder; + int ret; +@@ -347,8 +346,6 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + + dev_set_drvdata(dev, dpi); + +- vc4->dpi = dpi; +- + vc4_debugfs_add_regset32(drm, "dpi_regs", &dpi->regset); + + return 0; +@@ -362,8 +359,6 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + static void vc4_dpi_unbind(struct device *dev, struct device *master, + void *data) + { +- struct drm_device *drm = dev_get_drvdata(master); +- struct vc4_dev *vc4 = to_vc4_dev(drm); + struct vc4_dpi *dpi = dev_get_drvdata(dev); + + drm_of_panel_bridge_remove(dev->of_node, 0, 0); +@@ -371,8 +366,6 @@ static void vc4_dpi_unbind(struct device *dev, struct device *master, + drm_encoder_cleanup(dpi->encoder); + + clk_disable_unprepare(dpi->core_clock); +- +- vc4->dpi = NULL; + } + + static const struct component_ops vc4_dpi_ops = { +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 929cf9b45a5e..c7db33a31cc9 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -87,7 +87,6 @@ struct vc4_dev { + + struct vc4_hvs *hvs; + struct vc4_v3d *v3d; +- struct vc4_dpi *dpi; + struct vc4_vec *vec; + struct vc4_txp *txp; + struct vc4_fkms *fkms; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 11:03:23 +0200 +Subject: [PATCH 1106/1183] drm/vc4: dpi: Embed DRM structures into the private + structure + +The VC4 DPI driver private structure contains only a pointer to the +encoder it implements. This makes the overall structure somewhat +inconsistent with the rest of the driver, and complicates its +initialisation without any apparent gain. + +Let's embed the drm_encoder structure (through the vc4_encoder one) into +struct vc4_dpi to fix both issues. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 49 ++++++++++++----------------------- + 1 file changed, 16 insertions(+), 33 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index c383a2c3f7eb..7ed4b86ef0b8 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -83,9 +83,9 @@ + + /* General DPI hardware state. */ + struct vc4_dpi { +- struct platform_device *pdev; ++ struct vc4_encoder encoder; + +- struct drm_encoder *encoder; ++ struct platform_device *pdev; + + void __iomem *regs; + +@@ -95,21 +95,15 @@ struct vc4_dpi { + struct debugfs_regset32 regset; + }; + +-#define DPI_READ(offset) readl(dpi->regs + (offset)) +-#define DPI_WRITE(offset, val) writel(val, dpi->regs + (offset)) +- +-/* VC4 DPI encoder KMS struct */ +-struct vc4_dpi_encoder { +- struct vc4_encoder base; +- struct vc4_dpi *dpi; +-}; +- +-static inline struct vc4_dpi_encoder * +-to_vc4_dpi_encoder(struct drm_encoder *encoder) ++static inline struct vc4_dpi * ++to_vc4_dpi(struct drm_encoder *encoder) + { +- return container_of(encoder, struct vc4_dpi_encoder, base.base); ++ return container_of(encoder, struct vc4_dpi, encoder.base); + } + ++#define DPI_READ(offset) readl(dpi->regs + (offset)) ++#define DPI_WRITE(offset, val) writel(val, dpi->regs + (offset)) ++ + static const struct debugfs_reg32 dpi_regs[] = { + VC4_REG32(DPI_C), + VC4_REG32(DPI_ID), +@@ -117,8 +111,7 @@ static const struct debugfs_reg32 dpi_regs[] = { + + static void vc4_dpi_encoder_disable(struct drm_encoder *encoder) + { +- struct vc4_dpi_encoder *vc4_encoder = to_vc4_dpi_encoder(encoder); +- struct vc4_dpi *dpi = vc4_encoder->dpi; ++ struct vc4_dpi *dpi = to_vc4_dpi(encoder); + + clk_disable_unprepare(dpi->pixel_clock); + } +@@ -127,8 +120,7 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) + { + struct drm_device *dev = encoder->dev; + struct drm_display_mode *mode = &encoder->crtc->mode; +- struct vc4_dpi_encoder *vc4_encoder = to_vc4_dpi_encoder(encoder); +- struct vc4_dpi *dpi = vc4_encoder->dpi; ++ struct vc4_dpi *dpi = to_vc4_dpi(encoder); + struct drm_connector_list_iter conn_iter; + struct drm_connector *connector = NULL, *connector_scan; + u32 dpi_c = DPI_ENABLE; +@@ -281,7 +273,7 @@ static int vc4_dpi_init_bridge(struct vc4_dpi *dpi) + return PTR_ERR(bridge); + } + +- return drm_bridge_attach(dpi->encoder, bridge, NULL, 0); ++ return drm_bridge_attach(&dpi->encoder.base, bridge, NULL, 0); + } + + static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) +@@ -289,21 +281,12 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + struct platform_device *pdev = to_platform_device(dev); + struct drm_device *drm = dev_get_drvdata(master); + struct vc4_dpi *dpi; +- struct vc4_dpi_encoder *vc4_dpi_encoder; + int ret; + + dpi = devm_kzalloc(dev, sizeof(*dpi), GFP_KERNEL); + if (!dpi) + return -ENOMEM; +- +- vc4_dpi_encoder = devm_kzalloc(dev, sizeof(*vc4_dpi_encoder), +- GFP_KERNEL); +- if (!vc4_dpi_encoder) +- return -ENOMEM; +- vc4_dpi_encoder->base.type = VC4_ENCODER_TYPE_DPI; +- vc4_dpi_encoder->dpi = dpi; +- dpi->encoder = &vc4_dpi_encoder->base.base; +- ++ dpi->encoder.type = VC4_ENCODER_TYPE_DPI; + dpi->pdev = pdev; + dpi->regs = vc4_ioremap_regs(pdev, 0); + if (IS_ERR(dpi->regs)) +@@ -337,8 +320,8 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + if (ret) + DRM_ERROR("Failed to turn on core clock: %d\n", ret); + +- drm_simple_encoder_init(drm, dpi->encoder, DRM_MODE_ENCODER_DPI); +- drm_encoder_helper_add(dpi->encoder, &vc4_dpi_encoder_helper_funcs); ++ drm_simple_encoder_init(drm, &dpi->encoder.base, DRM_MODE_ENCODER_DPI); ++ drm_encoder_helper_add(&dpi->encoder.base, &vc4_dpi_encoder_helper_funcs); + + ret = vc4_dpi_init_bridge(dpi); + if (ret) +@@ -351,7 +334,7 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + return 0; + + err_destroy_encoder: +- drm_encoder_cleanup(dpi->encoder); ++ drm_encoder_cleanup(&dpi->encoder.base); + clk_disable_unprepare(dpi->core_clock); + return ret; + } +@@ -363,7 +346,7 @@ static void vc4_dpi_unbind(struct device *dev, struct device *master, + + drm_of_panel_bridge_remove(dev->of_node, 0, 0); + +- drm_encoder_cleanup(dpi->encoder); ++ drm_encoder_cleanup(&dpi->encoder.base); + + clk_disable_unprepare(dpi->core_clock); + } +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 23 May 2022 17:11:29 +0200 +Subject: [PATCH 1107/1183] drm/vc4: dpi: Switch to drmm_kzalloc + +Our internal structure that stores the DRM entities structure is allocated +through a device-managed kzalloc. + +This means that this will eventually be freed whenever the device is +removed. In our case, the most likely source of removal is that the main +device is going to be unbound, and component_unbind_all() is being run. + +However, it occurs while the DRM device is still registered, which will +create dangling pointers, eventually resulting in use-after-free. + +Switch to a DRM-managed allocation to keep our structure until the DRM +driver doesn't need it anymore. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index 7ed4b86ef0b8..c8e58b1d648b 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -283,9 +283,10 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + struct vc4_dpi *dpi; + int ret; + +- dpi = devm_kzalloc(dev, sizeof(*dpi), GFP_KERNEL); ++ dpi = drmm_kzalloc(drm, sizeof(*dpi), GFP_KERNEL); + if (!dpi) + return -ENOMEM; ++ + dpi->encoder.type = VC4_ENCODER_TYPE_DPI; + dpi->pdev = pdev; + dpi->regs = vc4_ioremap_regs(pdev, 0); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 11:09:16 +0200 +Subject: [PATCH 1108/1183] drm/vc4: dpi: Return an error if we can't enable + our clock + +If we fail to enable the DPI clock, we just ignore the error and moves +forward. Let's return an error instead. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index c8e58b1d648b..fddc41555510 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -309,6 +309,7 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + DRM_ERROR("Failed to get core clock: %d\n", ret); + return ret; + } ++ + dpi->pixel_clock = devm_clk_get(dev, "pixel"); + if (IS_ERR(dpi->pixel_clock)) { + ret = PTR_ERR(dpi->pixel_clock); +@@ -318,8 +319,10 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + } + + ret = clk_prepare_enable(dpi->core_clock); +- if (ret) ++ if (ret) { + DRM_ERROR("Failed to turn on core clock: %d\n", ret); ++ return ret; ++ } + + drm_simple_encoder_init(drm, &dpi->encoder.base, DRM_MODE_ENCODER_DPI); + drm_encoder_helper_add(&dpi->encoder.base, &vc4_dpi_encoder_helper_funcs); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 11:19:22 +0200 +Subject: [PATCH 1109/1183] drm/vc4: dpi: Remove unnecessary + drm_of_panel_bridge_remove call + +Since we have a managed call to create our panel_bridge instance, the call +to drm_of_panel_bridge_remove() at unbind is both redundant and dangerous +since it might lead to a use-after-free. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index fddc41555510..a9affc0e7bf2 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -348,8 +348,6 @@ static void vc4_dpi_unbind(struct device *dev, struct device *master, + { + struct vc4_dpi *dpi = dev_get_drvdata(dev); + +- drm_of_panel_bridge_remove(dev->of_node, 0, 0); +- + drm_encoder_cleanup(&dpi->encoder.base); + + clk_disable_unprepare(dpi->core_clock); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 23 May 2022 17:04:25 +0200 +Subject: [PATCH 1110/1183] drm/vc4: dpi: Add action to disable the clock + +The DPI controller has two clocks called core and pixel, the core clock +being enabled at bind time. + +Adding a device-managed action will make the error path easier, so let's +create one to disable it. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index a9affc0e7bf2..5a6979783b29 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -276,6 +276,13 @@ static int vc4_dpi_init_bridge(struct vc4_dpi *dpi) + return drm_bridge_attach(&dpi->encoder.base, bridge, NULL, 0); + } + ++static void vc4_dpi_disable_clock(void *ptr) ++{ ++ struct vc4_dpi *dpi = ptr; ++ ++ clk_disable_unprepare(dpi->core_clock); ++} ++ + static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + { + struct platform_device *pdev = to_platform_device(dev); +@@ -324,6 +331,10 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + return ret; + } + ++ ret = devm_add_action_or_reset(dev, vc4_dpi_disable_clock, dpi); ++ if (ret) ++ return ret; ++ + drm_simple_encoder_init(drm, &dpi->encoder.base, DRM_MODE_ENCODER_DPI); + drm_encoder_helper_add(&dpi->encoder.base, &vc4_dpi_encoder_helper_funcs); + +@@ -339,7 +350,6 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + + err_destroy_encoder: + drm_encoder_cleanup(&dpi->encoder.base); +- clk_disable_unprepare(dpi->core_clock); + return ret; + } + +@@ -349,8 +359,6 @@ static void vc4_dpi_unbind(struct device *dev, struct device *master, + struct vc4_dpi *dpi = dev_get_drvdata(dev); + + drm_encoder_cleanup(&dpi->encoder.base); +- +- clk_disable_unprepare(dpi->core_clock); + } + + static const struct component_ops vc4_dpi_ops = { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 11:05:36 +0200 +Subject: [PATCH 1111/1183] drm/vc4: dpi: Switch to DRM-managed encoder + initialization + +The current code will call drm_encoder_cleanup() when the device is +unbound. However, by then, there might still be some references held to +that encoder, including by the userspace that might still have the DRM +device open. + +Let's switch to a DRM-managed initialization to clean up after ourselves +only once the DRM device has been last closed. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 23 ++++++++--------------- + 1 file changed, 8 insertions(+), 15 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index 5a6979783b29..9b154bc9d540 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -335,35 +335,28 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + if (ret) + return ret; + +- drm_simple_encoder_init(drm, &dpi->encoder.base, DRM_MODE_ENCODER_DPI); ++ ret = drmm_encoder_init(drm, &dpi->encoder.base, ++ NULL, ++ DRM_MODE_ENCODER_DPI, ++ NULL); ++ if (ret) ++ return ret; ++ + drm_encoder_helper_add(&dpi->encoder.base, &vc4_dpi_encoder_helper_funcs); + + ret = vc4_dpi_init_bridge(dpi); + if (ret) +- goto err_destroy_encoder; ++ return ret; + + dev_set_drvdata(dev, dpi); + + vc4_debugfs_add_regset32(drm, "dpi_regs", &dpi->regset); + + return 0; +- +-err_destroy_encoder: +- drm_encoder_cleanup(&dpi->encoder.base); +- return ret; +-} +- +-static void vc4_dpi_unbind(struct device *dev, struct device *master, +- void *data) +-{ +- struct vc4_dpi *dpi = dev_get_drvdata(dev); +- +- drm_encoder_cleanup(&dpi->encoder.base); + } + + static const struct component_ops vc4_dpi_ops = { + .bind = vc4_dpi_bind, +- .unbind = vc4_dpi_unbind, + }; + + static int vc4_dpi_dev_probe(struct platform_device *pdev) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 16:08:44 +0200 +Subject: [PATCH 1112/1183] drm/vc4: dpi: Switch to drmm_of_get_bridge + +The current code uses a device-managed function to retrieve the next bridge +downstream. + +However, that means that it will be removed at unbind time, where the DRM +device is still very much live and might still have some applications that +still have it open. + +Switch to a DRM-managed variant to clean everything up once the DRM device +has been last closed. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index 9b154bc9d540..c67e2d1b2b46 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -259,10 +259,11 @@ static const struct of_device_id vc4_dpi_dt_match[] = { + */ + static int vc4_dpi_init_bridge(struct vc4_dpi *dpi) + { ++ struct drm_device *drm = dpi->encoder.base.dev; + struct device *dev = &dpi->pdev->dev; + struct drm_bridge *bridge; + +- bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); ++ bridge = drmm_of_get_bridge(drm, dev->of_node, 0, 0); + if (IS_ERR(bridge)) { + /* If nothing was connected in the DT, that's not an + * error. +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 16:26:30 +0200 +Subject: [PATCH 1113/1183] drm/vc4: dpi: Protect device resources + +Our current code now mixes some resources whose lifetime are tied to the +device (clocks, IO mappings, etc.) and some that are tied to the DRM device +(encoder, bridge). + +The device one will be freed at unbind time, but the DRM one will only be +freed when the last user of the DRM device closes its file handle. + +So we end up with a time window during which we can call the encoder hooks, +but we don't have access to the underlying resources and device. + +Let's protect all those sections with drm_dev_enter() and drm_dev_exit() so +that we bail out if we are during that window. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index c67e2d1b2b46..546d36bdacdf 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -13,6 +13,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -111,9 +112,16 @@ static const struct debugfs_reg32 dpi_regs[] = { + + static void vc4_dpi_encoder_disable(struct drm_encoder *encoder) + { ++ struct drm_device *dev = encoder->dev; + struct vc4_dpi *dpi = to_vc4_dpi(encoder); ++ int idx; ++ ++ if (!drm_dev_enter(dev, &idx)) ++ return; + + clk_disable_unprepare(dpi->pixel_clock); ++ ++ drm_dev_exit(idx); + } + + static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) +@@ -124,6 +132,7 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) + struct drm_connector_list_iter conn_iter; + struct drm_connector *connector = NULL, *connector_scan; + u32 dpi_c = DPI_ENABLE; ++ int idx; + int ret; + + /* Look up the connector attached to DPI so we can get the +@@ -223,6 +232,9 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) + dpi_c |= DPI_VSYNC_DISABLE; + } + ++ if (!drm_dev_enter(dev, &idx)) ++ return; ++ + DPI_WRITE(DPI_C, dpi_c); + + ret = clk_set_rate(dpi->pixel_clock, mode->clock * 1000); +@@ -232,6 +244,8 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) + ret = clk_prepare_enable(dpi->pixel_clock); + if (ret) + DRM_ERROR("Failed to set clock rate: %d\n", ret); ++ ++ drm_dev_exit(idx); + } + + static enum drm_mode_status vc4_dpi_encoder_mode_valid(struct drm_encoder *encoder, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 11:03:23 +0200 +Subject: [PATCH 1114/1183] drm/vc4: dsi: Embed DRM structures into the private + structure + +The VC4 DSI driver private structure contains only a pointer to the +encoder it implements. This makes the overall structure somewhat +inconsistent with the rest of the driver, and complicates its +initialisation without any apparent gain. + +Let's embed the drm_encoder structure (through the vc4_encoder one) into +struct vc4_dsi to fix both issues. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dsi.c | 30 +++++++++++++----------------- + 1 file changed, 13 insertions(+), 17 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c +index 820e8ecab52d..ee1f1c688bd5 100644 +--- a/drivers/gpu/drm/vc4/vc4_dsi.c ++++ b/drivers/gpu/drm/vc4/vc4_dsi.c +@@ -549,10 +549,11 @@ struct vc4_dsi_variant { + + /* General DSI hardware state. */ + struct vc4_dsi { ++ struct vc4_encoder encoder; ++ struct mipi_dsi_host dsi_host; ++ + struct platform_device *pdev; + +- struct mipi_dsi_host dsi_host; +- struct drm_encoder *encoder; + struct drm_bridge *out_bridge; + struct drm_bridge bridge; + +@@ -600,6 +601,12 @@ struct vc4_dsi { + + #define host_to_dsi(host) container_of(host, struct vc4_dsi, dsi_host) + ++static inline struct vc4_dsi * ++to_vc4_dsi(struct drm_encoder *encoder) ++{ ++ return container_of(encoder, struct vc4_dsi, encoder.base); ++} ++ + static inline void + dsi_dma_workaround_write(struct vc4_dsi *dsi, u32 offset, u32 val) + { +@@ -644,18 +651,6 @@ dsi_dma_workaround_write(struct vc4_dsi *dsi, u32 offset, u32 val) + DSI_WRITE(dsi->variant->port ? DSI1_##offset : DSI0_##offset, val) + #define DSI_PORT_BIT(bit) (dsi->variant->port ? DSI1_##bit : DSI0_##bit) + +-/* VC4 DSI encoder KMS struct */ +-struct vc4_dsi_encoder { +- struct vc4_encoder base; +- struct vc4_dsi *dsi; +-}; +- +-static inline struct vc4_dsi_encoder * +-to_vc4_dsi_encoder(struct drm_encoder *encoder) +-{ +- return container_of(encoder, struct vc4_dsi_encoder, base.base); +-} +- + static inline struct vc4_dsi * + bridge_to_vc4_dsi(struct drm_bridge *bridge) + { +@@ -1742,9 +1737,9 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + if (ret) + return ret; + +- drm_simple_encoder_init(drm, dsi->encoder, DRM_MODE_ENCODER_DSI); ++ drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_DSI); + +- ret = drm_bridge_attach(dsi->encoder, &dsi->bridge, NULL, 0); ++ ret = drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); + if (ret) { + dev_err(dev, "bridge attach failed: %d\n", ret); + goto err_free_dma; +@@ -1761,10 +1756,11 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master, + void *data) + { + struct vc4_dsi *dsi = dev_get_drvdata(dev); ++ struct drm_encoder *encoder = &dsi->encoder.base; + + pm_runtime_disable(dev); + +- drm_encoder_cleanup(dsi->encoder); ++ drm_encoder_cleanup(encoder); + } + + static const struct component_ops vc4_dsi_ops = { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 11:05:36 +0200 +Subject: [PATCH 1115/1183] drm/vc4: dsi: Switch to DRM-managed encoder + initialization + +The current code will call drm_encoder_cleanup() when the device is +unbound. However, by then, there might still be some references held to +that encoder, including by the userspace that might still have the DRM +device open. + +Let's switch to a DRM-managed initialization to clean up after ourselves +only once the DRM device has been last closed. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dsi.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c +index ee1f1c688bd5..678d7edb1e2a 100644 +--- a/drivers/gpu/drm/vc4/vc4_dsi.c ++++ b/drivers/gpu/drm/vc4/vc4_dsi.c +@@ -1737,7 +1737,12 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + if (ret) + return ret; + +- drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_DSI); ++ ret = drmm_encoder_init(drm, encoder, ++ NULL, ++ DRM_MODE_ENCODER_DSI, ++ NULL); ++ if (ret) ++ return ret; + + ret = drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); + if (ret) { +@@ -1756,11 +1761,8 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master, + void *data) + { + struct vc4_dsi *dsi = dev_get_drvdata(dev); +- struct drm_encoder *encoder = &dsi->encoder.base; + + pm_runtime_disable(dev); +- +- drm_encoder_cleanup(encoder); + } + + static const struct component_ops vc4_dsi_ops = { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 16:08:44 +0200 +Subject: [PATCH 1116/1183] drm/vc4: dsi: Switch to drmm_of_get_bridge + +The current code uses a device-managed function to retrieve the next bridge +downstream. + +However, that means that it will be removed at unbind time, where the DRM +device is still very much live and might still have some applications that +still have it open. + +Switch to a DRM-managed variant to clean everything up once the DRM device +has been last closed. + +Acked-by: Thomas Zimmermann +Reviewed-by: Dave Stevenson +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dsi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c +index 678d7edb1e2a..0b429867e874 100644 +--- a/drivers/gpu/drm/vc4/vc4_dsi.c ++++ b/drivers/gpu/drm/vc4/vc4_dsi.c +@@ -1722,7 +1722,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + return ret; + } + +- dsi->out_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); ++ dsi->out_bridge = drmm_of_get_bridge(drm, dev->of_node, 0, 0); + if (IS_ERR(dsi->out_bridge)) + return PTR_ERR(dsi->out_bridge); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 23 May 2022 15:48:01 +0200 +Subject: [PATCH 1117/1183] drm/vc4: dsi: Fix the driver structure lifetime + +The vc4_dsi structure is currently allocated through a device-managed +allocation. This can lead to use-after-free issues however in the unbinding +path since the DRM entities will stick around, but the underlying structure +has been freed. + +However, we can't just fix it by using a DRM-managed allocation like we did +for the other drivers since the DSI case is a bit more intricate. + +Indeed, the structure will be allocated at probe time, when we don't have a +DRM device yet, to be able to register the DSI bus driver. We will then +reuse it at bind time to register our KMS entities in the framework. + +In order to work around both constraints, we can use a kref to track the +users of the structure (DSI host, and KMS), and then put our structure when +the DSI host will have been unregistered, and through a DRM-managed action +that will execute once we won't need the KMS entities anymore. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dsi.c | 33 ++++++++++++++++++++++++++++++++- + 1 file changed, 32 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c +index 0b429867e874..79be3414664e 100644 +--- a/drivers/gpu/drm/vc4/vc4_dsi.c ++++ b/drivers/gpu/drm/vc4/vc4_dsi.c +@@ -552,6 +552,8 @@ struct vc4_dsi { + struct vc4_encoder encoder; + struct mipi_dsi_host dsi_host; + ++ struct kref kref; ++ + struct platform_device *pdev; + + struct drm_bridge *out_bridge; +@@ -1600,6 +1602,31 @@ static void vc4_dsi_dma_chan_release(void *ptr) + dsi->reg_dma_chan = NULL; + } + ++static void vc4_dsi_release(struct kref *kref) ++{ ++ struct vc4_dsi *dsi = ++ container_of(kref, struct vc4_dsi, kref); ++ ++ kfree(dsi); ++} ++ ++static void vc4_dsi_get(struct vc4_dsi *dsi) ++{ ++ kref_get(&dsi->kref); ++} ++ ++static void vc4_dsi_put(struct vc4_dsi *dsi) ++{ ++ kref_put(&dsi->kref, &vc4_dsi_release); ++} ++ ++static void vc4_dsi_release_action(struct drm_device *drm, void *ptr) ++{ ++ struct vc4_dsi *dsi = ptr; ++ ++ vc4_dsi_put(dsi); ++} ++ + static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + { + struct platform_device *pdev = to_platform_device(dev); +@@ -1775,11 +1802,13 @@ static int vc4_dsi_dev_probe(struct platform_device *pdev) + struct device *dev = &pdev->dev; + struct vc4_dsi *dsi; + +- dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL); ++ dsi = kzalloc(sizeof(*dsi), GFP_KERNEL); + if (!dsi) + return -ENOMEM; + dev_set_drvdata(dev, dsi); + ++ kref_init(&dsi->kref); ++ + dsi->bridge.funcs = &vc4_dsi_bridge_funcs; + dsi->bridge.of_node = dev->of_node; + dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; +@@ -1798,6 +1827,8 @@ static int vc4_dsi_dev_remove(struct platform_device *pdev) + struct vc4_dsi *dsi = dev_get_drvdata(dev); + + mipi_dsi_host_unregister(&dsi->dsi_host); ++ vc4_dsi_put(dsi); ++ + return 0; + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Fri, 10 Jun 2022 10:51:26 +0200 +Subject: [PATCH 1118/1183] drm/vc4: dsi: Switch to devm_pm_runtime_enable + +devm_pm_runtime_enable() simplifies the driver a bit since it will call +pm_runtime_disable() automatically through a device-managed action. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_dsi.c | 15 ++++----------- + 1 file changed, 4 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c +index 79be3414664e..565ee9ba41f3 100644 +--- a/drivers/gpu/drm/vc4/vc4_dsi.c ++++ b/drivers/gpu/drm/vc4/vc4_dsi.c +@@ -1771,6 +1771,10 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + if (ret) + return ret; + ++ ret = devm_pm_runtime_enable(dev); ++ if (ret) ++ return ret; ++ + ret = drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); + if (ret) { + dev_err(dev, "bridge attach failed: %d\n", ret); +@@ -1779,22 +1783,11 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + + vc4_debugfs_add_regset32(drm, dsi->variant->debugfs_name, &dsi->regset); + +- pm_runtime_enable(dev); +- + return 0; + } + +-static void vc4_dsi_unbind(struct device *dev, struct device *master, +- void *data) +-{ +- struct vc4_dsi *dsi = dev_get_drvdata(dev); +- +- pm_runtime_disable(dev); +-} +- + static const struct component_ops vc4_dsi_ops = { + .bind = vc4_dsi_bind, +- .unbind = vc4_dsi_unbind, + }; + + static int vc4_dsi_dev_probe(struct platform_device *pdev) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 23 May 2022 17:11:29 +0200 +Subject: [PATCH 1119/1183] drm/vc4: hdmi: Switch to drmm_kzalloc + +Our internal structure that stores the DRM entities structure is allocated +through a device-managed kzalloc. + +This means that this will eventually be freed whenever the device is +removed. In our case, the most likely source of removal is that the main +device is going to be unbound, and component_unbind_all() is being run. + +However, it occurs while the DRM device is still registered, which will +create dangling pointers, eventually resulting in use-after-free. + +Switch to a DRM-managed allocation to keep our structure until the DRM +driver doesn't need it anymore. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + 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 bfc9e1151965..469d9898dac2 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -3150,9 +3150,10 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + struct device_node *ddc_node; + int ret; + +- vc4_hdmi = devm_kzalloc(dev, sizeof(*vc4_hdmi), GFP_KERNEL); ++ vc4_hdmi = drmm_kzalloc(drm, sizeof(*vc4_hdmi), GFP_KERNEL); + if (!vc4_hdmi) + return -ENOMEM; ++ + mutex_init(&vc4_hdmi->mutex); + spin_lock_init(&vc4_hdmi->hw_lock); + INIT_DELAYED_WORK(&vc4_hdmi->scrambling_work, vc4_hdmi_scrambling_wq); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 22 Jun 2022 16:20:35 +0200 +Subject: [PATCH 1120/1183] drm/vc4: hdmi: Remove call to + drm_connector_unregister() + +drm_connector_unregister() is only to be used for connectors that have been +registered through drm_connector_register() after drm_dev_register() has +been called. This is our case here so let's remove the call. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 12 +++--------- + 1 file changed, 3 insertions(+), 9 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 469d9898dac2..eed6e728376c 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -292,12 +292,6 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + return connector_status_disconnected; + } + +-static void vc4_hdmi_connector_destroy(struct drm_connector *connector) +-{ +- drm_connector_unregister(connector); +- drm_connector_cleanup(connector); +-} +- + static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + { + struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); +@@ -472,7 +466,7 @@ vc4_hdmi_connector_duplicate_state(struct drm_connector *connector) + static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { + .detect = vc4_hdmi_connector_detect, + .fill_modes = drm_helper_probe_single_connector_modes, +- .destroy = vc4_hdmi_connector_destroy, ++ .destroy = drm_connector_cleanup, + .reset = vc4_hdmi_connector_reset, + .atomic_duplicate_state = vc4_hdmi_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, +@@ -3274,7 +3268,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + err_free_hotplug: + vc4_hdmi_hotplug_exit(vc4_hdmi); + err_destroy_conn: +- vc4_hdmi_connector_destroy(&vc4_hdmi->connector); ++ drm_connector_cleanup(&vc4_hdmi->connector); + err_destroy_encoder: + drm_encoder_cleanup(encoder); + pm_runtime_put_sync(dev); +@@ -3318,7 +3312,7 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, + vc4_hdmi_audio_exit(vc4_hdmi); + vc4_hdmi_cec_exit(vc4_hdmi); + vc4_hdmi_hotplug_exit(vc4_hdmi); +- vc4_hdmi_connector_destroy(&vc4_hdmi->connector); ++ drm_connector_cleanup(&vc4_hdmi->connector); + drm_encoder_cleanup(&vc4_hdmi->encoder.base.base); + + pm_runtime_disable(dev); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 11:05:36 +0200 +Subject: [PATCH 1121/1183] drm/vc4: hdmi: Switch to DRM-managed encoder + initialization + +The current code will call drm_encoder_cleanup() when the device is +unbound. However, by then, there might still be some references held to +that encoder, including by the userspace that might still have the DRM +device open. + +Let's switch to a DRM-managed initialization to clean up after ourselves +only once the DRM device has been last closed. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index eed6e728376c..e3c168fca43b 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -3236,12 +3236,18 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + clk_prepare_enable(vc4_hdmi->pixel_bvb_clock); + } + +- drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS); ++ ret = drmm_encoder_init(drm, encoder, ++ NULL, ++ DRM_MODE_ENCODER_TMDS, ++ NULL); ++ if (ret) ++ goto err_put_runtime_pm; ++ + drm_encoder_helper_add(encoder, &vc4_hdmi_encoder_helper_funcs); + + ret = vc4_hdmi_connector_init(drm, vc4_hdmi); + if (ret) +- goto err_destroy_encoder; ++ goto err_put_runtime_pm; + + ret = vc4_hdmi_hotplug_init(vc4_hdmi); + if (ret) +@@ -3269,8 +3275,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + vc4_hdmi_hotplug_exit(vc4_hdmi); + err_destroy_conn: + drm_connector_cleanup(&vc4_hdmi->connector); +-err_destroy_encoder: +- drm_encoder_cleanup(encoder); ++err_put_runtime_pm: + pm_runtime_put_sync(dev); + err_disable_runtime_pm: + pm_runtime_disable(dev); +@@ -3313,7 +3318,6 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, + vc4_hdmi_cec_exit(vc4_hdmi); + vc4_hdmi_hotplug_exit(vc4_hdmi); + drm_connector_cleanup(&vc4_hdmi->connector); +- drm_encoder_cleanup(&vc4_hdmi->encoder.base.base); + + pm_runtime_disable(dev); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 11:05:36 +0200 +Subject: [PATCH 1122/1183] drm/vc4: hdmi: Switch to DRM-managed connector + initialization + +The current code will call drm_connector_unregister() and +drm_connector_cleanup() when the device is unbound. However, by then, there +might still be some references held to that connector, including by the +userspace that might still have the DRM device open. + +Let's switch to a DRM-managed initialization to clean up after ourselves +only once the DRM device has been last closed. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index e3c168fca43b..180e800a9fd7 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -466,7 +466,6 @@ vc4_hdmi_connector_duplicate_state(struct drm_connector *connector) + static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { + .detect = vc4_hdmi_connector_detect, + .fill_modes = drm_helper_probe_single_connector_modes, +- .destroy = drm_connector_cleanup, + .reset = vc4_hdmi_connector_reset, + .atomic_duplicate_state = vc4_hdmi_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, +@@ -512,10 +511,13 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, + struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; + int ret; + +- drm_connector_init_with_ddc(dev, connector, +- &vc4_hdmi_connector_funcs, +- DRM_MODE_CONNECTOR_HDMIA, +- vc4_hdmi->ddc); ++ ret = drmm_connector_init(dev, connector, ++ &vc4_hdmi_connector_funcs, ++ DRM_MODE_CONNECTOR_HDMIA, ++ vc4_hdmi->ddc); ++ if (ret) ++ return ret; ++ + drm_connector_helper_add(connector, &vc4_hdmi_connector_helper_funcs); + + /* +@@ -3251,7 +3253,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + + ret = vc4_hdmi_hotplug_init(vc4_hdmi); + if (ret) +- goto err_destroy_conn; ++ goto err_put_runtime_pm; + + ret = vc4_hdmi_cec_init(vc4_hdmi); + if (ret) +@@ -3273,8 +3275,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + vc4_hdmi_cec_exit(vc4_hdmi); + err_free_hotplug: + vc4_hdmi_hotplug_exit(vc4_hdmi); +-err_destroy_conn: +- drm_connector_cleanup(&vc4_hdmi->connector); + err_put_runtime_pm: + pm_runtime_put_sync(dev); + err_disable_runtime_pm: +@@ -3317,7 +3317,6 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, + vc4_hdmi_audio_exit(vc4_hdmi); + vc4_hdmi_cec_exit(vc4_hdmi); + vc4_hdmi_hotplug_exit(vc4_hdmi); +- drm_connector_cleanup(&vc4_hdmi->connector); + + pm_runtime_disable(dev); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Fri, 13 May 2022 13:57:41 +0200 +Subject: [PATCH 1123/1183] drm/vc4: hdmi: Switch to device-managed ALSA + initialization + +The current code to unregister our ALSA device needs to be undone manually +when we remove the HDMI driver. + +Since ALSA doesn't seem to support any mechanism to defer freeing something +until the last user of the ALSA device is gone, we can either use a +device-managed or a DRM-managed action. + +The consistent way would be to use a DRM-managed one, just like pretty much +any framework-facing structure should be doing. However, ALSA does a lot of +allocation and registration using device-managed calls. Thus, if we're +going that way, by the time the DRM-managed action would run all of those +allocation would have been freed and we would end up with a use-after-free. + +Thus, let's do a device-managed action. It's been tested with KASAN enabled +and doesn't seem to trigger any issue, so it's as good as anything. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 43 ++++++++++++++++++++++++++++------ + 1 file changed, 36 insertions(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 180e800a9fd7..6f6b463767af 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -2279,6 +2279,14 @@ static struct hdmi_codec_pdata vc4_hdmi_codec_pdata = { + .i2s = 1, + }; + ++static void vc4_hdmi_audio_codec_release(void *ptr) ++{ ++ struct vc4_hdmi *vc4_hdmi = ptr; ++ ++ platform_device_unregister(vc4_hdmi->audio.codec_pdev); ++ vc4_hdmi->audio.codec_pdev = NULL; ++} ++ + static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) + { + const struct vc4_hdmi_register *mai_data = +@@ -2320,6 +2328,30 @@ 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; + ++ /* ++ * NOTE: Strictly speaking, we should probably use a DRM-managed ++ * registration there to avoid removing all the audio components ++ * by the time the driver doesn't have any user anymore. ++ * ++ * However, the ASoC core uses a number of devm_kzalloc calls ++ * when registering, even when using non-device-managed ++ * functions (such as in snd_soc_register_component()). ++ * ++ * If we call snd_soc_unregister_component() in a DRM-managed ++ * action, the device-managed actions have already been executed ++ * and thus we would access memory that has been freed. ++ * ++ * Using device-managed hooks here probably leaves us open to a ++ * bunch of issues if userspace still has a handle on the ALSA ++ * device when the device is removed. However, this is mitigated ++ * by the use of drm_dev_enter()/drm_dev_exit() in the audio ++ * path to prevent the access to the device resources if it ++ * isn't there anymore. ++ * ++ * Then, the vc4_hdmi structure is DRM-managed and thus only ++ * freed whenever the last user has closed the DRM device file. ++ * It should thus outlive ALSA in most situations. ++ */ + ret = devm_snd_dmaengine_pcm_register(dev, &pcm_conf, 0); + if (ret) { + dev_err(dev, "Could not register PCM component: %d\n", ret); +@@ -2343,6 +2375,10 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) + } + vc4_hdmi->audio.codec_pdev = codec_pdev; + ++ ret = devm_add_action_or_reset(dev, vc4_hdmi_audio_codec_release, vc4_hdmi); ++ if (ret) ++ return ret; ++ + dai_link->cpus = &vc4_hdmi->audio.cpu; + dai_link->codecs = &vc4_hdmi->audio.codec; + dai_link->platforms = &vc4_hdmi->audio.platform; +@@ -2381,12 +2417,6 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) + + } + +-static void vc4_hdmi_audio_exit(struct vc4_hdmi *vc4_hdmi) +-{ +- platform_device_unregister(vc4_hdmi->audio.codec_pdev); +- vc4_hdmi->audio.codec_pdev = NULL; +-} +- + static irqreturn_t vc4_hdmi_hpd_irq_thread(int irq, void *priv) + { + struct vc4_hdmi *vc4_hdmi = priv; +@@ -3314,7 +3344,6 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, + kfree(vc4_hdmi->hdmi_regset.regs); + kfree(vc4_hdmi->hd_regset.regs); + +- vc4_hdmi_audio_exit(vc4_hdmi); + vc4_hdmi_cec_exit(vc4_hdmi); + vc4_hdmi_hotplug_exit(vc4_hdmi); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Fri, 13 May 2022 13:57:41 +0200 +Subject: [PATCH 1124/1183] drm/vc4: hdmi: Switch to device-managed CEC + initialization + +The current code to unregister our CEC device needs to be undone manually +when we remove the HDMI driver. + +Since the CEC framework will allocate its main structure, and will defer +its deallocation to when the last user will have closed it, we don't really +need to take any particular measure to prevent any use-after-free and can +thus use any managed action. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 94 ++++++++++++++++++---------------- + 1 file changed, 50 insertions(+), 44 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 6f6b463767af..b4629ebec74e 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -2799,6 +2799,14 @@ static const struct cec_adap_ops vc4_hdmi_cec_adap_ops = { + .adap_transmit = vc4_hdmi_cec_adap_transmit, + }; + ++static void vc4_hdmi_cec_release(void *ptr) ++{ ++ struct vc4_hdmi *vc4_hdmi = ptr; ++ ++ cec_unregister_adapter(vc4_hdmi->cec_adap); ++ vc4_hdmi->cec_adap = NULL; ++} ++ + static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) + { + struct cec_connector_info conn_info; +@@ -2824,47 +2832,64 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) + cec_s_conn_info(vc4_hdmi->cec_adap, &conn_info); + + if (vc4_hdmi->variant->external_irq_controller) { +- ret = request_threaded_irq(platform_get_irq_byname(pdev, "cec-rx"), +- vc4_cec_irq_handler_rx_bare, +- vc4_cec_irq_handler_rx_thread, 0, +- "vc4 hdmi cec rx", vc4_hdmi); ++ ret = devm_request_threaded_irq(dev, platform_get_irq_byname(pdev, "cec-rx"), ++ vc4_cec_irq_handler_rx_bare, ++ vc4_cec_irq_handler_rx_thread, 0, ++ "vc4 hdmi cec rx", vc4_hdmi); + if (ret) + goto err_delete_cec_adap; + +- ret = request_threaded_irq(platform_get_irq_byname(pdev, "cec-tx"), +- vc4_cec_irq_handler_tx_bare, +- vc4_cec_irq_handler_tx_thread, 0, +- "vc4 hdmi cec tx", vc4_hdmi); ++ ret = devm_request_threaded_irq(dev, platform_get_irq_byname(pdev, "cec-tx"), ++ vc4_cec_irq_handler_tx_bare, ++ vc4_cec_irq_handler_tx_thread, 0, ++ "vc4 hdmi cec tx", vc4_hdmi); + if (ret) +- goto err_remove_cec_rx_handler; ++ goto err_delete_cec_adap; + } else { + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + HDMI_WRITE(HDMI_CEC_CPU_MASK_SET, 0xffffffff); + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); + +- ret = request_threaded_irq(platform_get_irq(pdev, 0), +- vc4_cec_irq_handler, +- vc4_cec_irq_handler_thread, 0, +- "vc4 hdmi cec", vc4_hdmi); ++ ret = devm_request_threaded_irq(dev, platform_get_irq(pdev, 0), ++ vc4_cec_irq_handler, ++ vc4_cec_irq_handler_thread, 0, ++ "vc4 hdmi cec", vc4_hdmi); + if (ret) + goto err_delete_cec_adap; + } + + ret = cec_register_adapter(vc4_hdmi->cec_adap, &pdev->dev); + if (ret < 0) +- goto err_remove_handlers; +- +- return 0; ++ goto err_delete_cec_adap; + +-err_remove_handlers: +- if (vc4_hdmi->variant->external_irq_controller) +- free_irq(platform_get_irq_byname(pdev, "cec-tx"), vc4_hdmi); +- else +- free_irq(platform_get_irq(pdev, 0), vc4_hdmi); ++ /* ++ * NOTE: Strictly speaking, we should probably use a DRM-managed ++ * registration there to avoid removing the CEC adapter by the ++ * time the DRM driver doesn't have any user anymore. ++ * ++ * However, the CEC framework already cleans up the CEC adapter ++ * only when the last user has closed its file descriptor, so we ++ * don't need to handle it in DRM. ++ * ++ * By the time the device-managed hook is executed, we will give ++ * up our reference to the CEC adapter and therefore don't ++ * really care when it's actually freed. ++ * ++ * There's still a problematic sequence: if we unregister our ++ * CEC adapter, but the userspace keeps a handle on the CEC ++ * adapter but not the DRM device for some reason. In such a ++ * case, our vc4_hdmi structure will be freed, but the ++ * cec_adapter structure will have a dangling pointer to what ++ * used to be our HDMI controller. If we get a CEC call at that ++ * moment, we could end up with a use-after-free. Fortunately, ++ * the CEC framework already handles this too, by calling ++ * cec_is_registered() in cec_ioctl() and cec_poll(). ++ */ ++ ret = devm_add_action_or_reset(dev, vc4_hdmi_cec_release, vc4_hdmi); ++ if (ret) ++ return ret; + +-err_remove_cec_rx_handler: +- if (vc4_hdmi->variant->external_irq_controller) +- free_irq(platform_get_irq_byname(pdev, "cec-rx"), vc4_hdmi); ++ return 0; + + err_delete_cec_adap: + cec_delete_adapter(vc4_hdmi->cec_adap); +@@ -2872,20 +2897,6 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) + return ret; + } + +-static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) +-{ +- struct platform_device *pdev = vc4_hdmi->pdev; +- +- if (vc4_hdmi->variant->external_irq_controller) { +- free_irq(platform_get_irq_byname(pdev, "cec-rx"), vc4_hdmi); +- free_irq(platform_get_irq_byname(pdev, "cec-tx"), vc4_hdmi); +- } else { +- free_irq(platform_get_irq(pdev, 0), vc4_hdmi); +- } +- +- cec_unregister_adapter(vc4_hdmi->cec_adap); +-} +- + static int vc4_hdmi_cec_resume(struct vc4_hdmi *vc4_hdmi) + { + unsigned long flags; +@@ -2914,8 +2925,6 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) + return 0; + } + +-static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) {}; +- + static int vc4_hdmi_cec_resume(struct vc4_hdmi *vc4_hdmi) + { + return 0; +@@ -3291,7 +3300,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + + ret = vc4_hdmi_audio_init(vc4_hdmi); + if (ret) +- goto err_free_cec; ++ goto err_free_hotplug; + + vc4_debugfs_add_file(drm, variant->debugfs_name, + vc4_hdmi_debugfs_regs, +@@ -3301,8 +3310,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + + return 0; + +-err_free_cec: +- vc4_hdmi_cec_exit(vc4_hdmi); + err_free_hotplug: + vc4_hdmi_hotplug_exit(vc4_hdmi); + err_put_runtime_pm: +@@ -3344,7 +3351,6 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, + kfree(vc4_hdmi->hdmi_regset.regs); + kfree(vc4_hdmi->hd_regset.regs); + +- vc4_hdmi_cec_exit(vc4_hdmi); + vc4_hdmi_hotplug_exit(vc4_hdmi); + + pm_runtime_disable(dev); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 17 May 2022 12:38:47 +0200 +Subject: [PATCH 1125/1183] drm/vc4: hdmi: Use a device-managed action for DDC + +The reference to the DDC controller device needs to be put back when we're +done with it. Let's use a device-managed action to simplify the driver. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 22 ++++++++++++++-------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index b4629ebec74e..197449be4c63 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -3175,6 +3175,13 @@ static int vc4_hdmi_runtime_resume(struct device *dev) + return 0; + } + ++static void vc4_hdmi_put_ddc_device(void *ptr) ++{ ++ struct vc4_hdmi *vc4_hdmi = ptr; ++ ++ put_device(&vc4_hdmi->ddc->dev); ++} ++ + static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + { + const struct vc4_hdmi_variant *variant = of_device_get_match_data(dev); +@@ -3230,13 +3237,16 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + return -EPROBE_DEFER; + } + ++ ret = devm_add_action_or_reset(dev, vc4_hdmi_put_ddc_device, vc4_hdmi); ++ if (ret) ++ return ret; ++ + /* Only use the GPIO HPD pin if present in the DT, otherwise + * we'll use the HDMI core's register. + */ + vc4_hdmi->hpd_gpio = devm_gpiod_get_optional(dev, "hpd", GPIOD_IN); + if (IS_ERR(vc4_hdmi->hpd_gpio)) { +- ret = PTR_ERR(vc4_hdmi->hpd_gpio); +- goto err_put_ddc; ++ return PTR_ERR(vc4_hdmi->hpd_gpio); + } + + vc4_hdmi->disable_wifi_frequencies = +@@ -3253,7 +3263,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + */ + ret = clk_set_min_rate(vc4_hdmi->hsm_clock, HSM_MIN_CLOCK_FREQ); + if (ret) +- goto err_put_ddc; ++ return ret; + + pm_runtime_enable(dev); + +@@ -3267,7 +3277,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + + ret = pm_runtime_resume_and_get(dev); + if (ret) +- goto err_disable_runtime_pm; ++ return ret; + + if ((of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi0") || + of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi1")) && +@@ -3316,8 +3326,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + pm_runtime_put_sync(dev); + err_disable_runtime_pm: + pm_runtime_disable(dev); +-err_put_ddc: +- put_device(&vc4_hdmi->ddc->dev); + + return ret; + } +@@ -3354,8 +3362,6 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, + vc4_hdmi_hotplug_exit(vc4_hdmi); + + pm_runtime_disable(dev); +- +- put_device(&vc4_hdmi->ddc->dev); + } + + static const struct component_ops vc4_hdmi_ops = { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 17 May 2022 12:30:40 +0200 +Subject: [PATCH 1126/1183] drm/vc4: hdmi: Switch to DRM-managed kfree to build + regsets + +The current code to build the registers set later exposed in debugfs for +the HDMI controller relies on traditional allocations, that are later +free'd as part of the driver unbind hook. + +Since krealloc doesn't have a DRM-managed equivalent, let's add an action +to free the buffer later on. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 46 +++++++++++++++++++++------------- + drivers/gpu/drm/vc4/vc4_hdmi.h | 3 ++- + 2 files changed, 31 insertions(+), 18 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 197449be4c63..1c6c6de3051e 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -2931,7 +2931,15 @@ static int vc4_hdmi_cec_resume(struct vc4_hdmi *vc4_hdmi) + } + #endif + +-static int vc4_hdmi_build_regset(struct vc4_hdmi *vc4_hdmi, ++static void vc4_hdmi_free_regset(struct drm_device *drm, void *ptr) ++{ ++ struct debugfs_reg32 *regs = ptr; ++ ++ kfree(regs); ++} ++ ++static int vc4_hdmi_build_regset(struct drm_device *drm, ++ struct vc4_hdmi *vc4_hdmi, + struct debugfs_regset32 *regset, + enum vc4_hdmi_regs reg) + { +@@ -2939,6 +2947,7 @@ static int vc4_hdmi_build_regset(struct vc4_hdmi *vc4_hdmi, + struct debugfs_reg32 *regs, *new_regs; + unsigned int count = 0; + unsigned int i; ++ int ret; + + regs = kcalloc(variant->num_registers, sizeof(*regs), + GFP_KERNEL); +@@ -2964,10 +2973,15 @@ static int vc4_hdmi_build_regset(struct vc4_hdmi *vc4_hdmi, + regset->regs = new_regs; + regset->nregs = count; + ++ ret = drmm_add_action_or_reset(drm, vc4_hdmi_free_regset, new_regs); ++ if (ret) ++ return ret; ++ + return 0; + } + +-static int vc4_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) ++static int vc4_hdmi_init_resources(struct drm_device *drm, ++ struct vc4_hdmi *vc4_hdmi) + { + struct platform_device *pdev = vc4_hdmi->pdev; + struct device *dev = &pdev->dev; +@@ -2981,11 +2995,11 @@ static int vc4_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) + if (IS_ERR(vc4_hdmi->hd_regs)) + return PTR_ERR(vc4_hdmi->hd_regs); + +- ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->hd_regset, VC4_HD); ++ ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->hd_regset, VC4_HD); + if (ret) + return ret; + +- ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->hdmi_regset, VC4_HDMI); ++ ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->hdmi_regset, VC4_HDMI); + if (ret) + return ret; + +@@ -3008,7 +3022,8 @@ static int vc4_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) + return 0; + } + +-static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) ++static int vc5_hdmi_init_resources(struct drm_device *drm, ++ struct vc4_hdmi *vc4_hdmi) + { + struct platform_device *pdev = vc4_hdmi->pdev; + struct device *dev = &pdev->dev; +@@ -3110,35 +3125,35 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) + return PTR_ERR(vc4_hdmi->reset); + } + +- ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->hdmi_regset, VC4_HDMI); ++ ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->hdmi_regset, VC4_HDMI); + if (ret) + return ret; + +- ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->hd_regset, VC4_HD); ++ ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->hd_regset, VC4_HD); + if (ret) + return ret; + +- ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->cec_regset, VC5_CEC); ++ ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->cec_regset, VC5_CEC); + if (ret) + return ret; + +- ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->csc_regset, VC5_CSC); ++ ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->csc_regset, VC5_CSC); + if (ret) + return ret; + +- ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->dvp_regset, VC5_DVP); ++ ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->dvp_regset, VC5_DVP); + if (ret) + return ret; + +- ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->phy_regset, VC5_PHY); ++ ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->phy_regset, VC5_PHY); + if (ret) + return ret; + +- ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->ram_regset, VC5_RAM); ++ ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->ram_regset, VC5_RAM); + if (ret) + return ret; + +- ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->rm_regset, VC5_RM); ++ ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->rm_regset, VC5_RM); + if (ret) + return ret; + +@@ -3220,7 +3235,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + if (variant->max_pixel_clock > HDMI_14_MAX_TMDS_CLK) + vc4_hdmi->scdc_enabled = true; + +- ret = variant->init_resources(vc4_hdmi); ++ ret = variant->init_resources(drm, vc4_hdmi); + if (ret) + return ret; + +@@ -3356,9 +3371,6 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, + BUILD_BUG_ON(offsetof(struct vc4_hdmi, audio) != 0); + vc4_hdmi = dev_get_drvdata(dev); + +- kfree(vc4_hdmi->hdmi_regset.regs); +- kfree(vc4_hdmi->hd_regset.regs); +- + vc4_hdmi_hotplug_exit(vc4_hdmi); + + pm_runtime_disable(dev); +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h +index 53dd116b49f0..b83e4194983f 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.h ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.h +@@ -70,7 +70,8 @@ struct vc4_hdmi_variant { + /* Callback to get the resources (memory region, interrupts, + * clocks, etc) for that variant. + */ +- int (*init_resources)(struct vc4_hdmi *vc4_hdmi); ++ int (*init_resources)(struct drm_device *drm, ++ struct vc4_hdmi *vc4_hdmi); + + /* Callback to reset the HDMI block */ + void (*reset)(struct vc4_hdmi *vc4_hdmi); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 17 May 2022 12:32:05 +0200 +Subject: [PATCH 1127/1183] drm/vc4: hdmi: Use devm to register hotplug + interrupts + +Commit 776efe800fed ("drm/vc4: hdmi: Drop devm interrupt handler for +hotplug interrupts") dropped the device-managed interrupt registration +because it was creating bugs and races whenever an interrupt was coming in +while the device was removed. + +However, our latest patches to the HDMI controller driver fix this as well, +so we can use device-managed interrupt handlers again. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 41 +++++++++------------------------- + 1 file changed, 11 insertions(+), 30 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 1c6c6de3051e..9b6ed3ed28b0 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -2439,21 +2439,19 @@ static int vc4_hdmi_hotplug_init(struct vc4_hdmi *vc4_hdmi) + unsigned int hpd_con = platform_get_irq_byname(pdev, "hpd-connected"); + unsigned int hpd_rm = platform_get_irq_byname(pdev, "hpd-removed"); + +- ret = request_threaded_irq(hpd_con, +- NULL, +- vc4_hdmi_hpd_irq_thread, IRQF_ONESHOT, +- "vc4 hdmi hpd connected", vc4_hdmi); ++ ret = devm_request_threaded_irq(&pdev->dev, hpd_con, ++ NULL, ++ vc4_hdmi_hpd_irq_thread, IRQF_ONESHOT, ++ "vc4 hdmi hpd connected", vc4_hdmi); + if (ret) + return ret; + +- ret = request_threaded_irq(hpd_rm, +- NULL, +- vc4_hdmi_hpd_irq_thread, IRQF_ONESHOT, +- "vc4 hdmi hpd disconnected", vc4_hdmi); +- if (ret) { +- free_irq(hpd_con, vc4_hdmi); ++ ret = devm_request_threaded_irq(&pdev->dev, hpd_rm, ++ NULL, ++ vc4_hdmi_hpd_irq_thread, IRQF_ONESHOT, ++ "vc4 hdmi hpd disconnected", vc4_hdmi); ++ if (ret) + return ret; +- } + + connector->polled = DRM_CONNECTOR_POLL_HPD; + } +@@ -2461,16 +2459,6 @@ static int vc4_hdmi_hotplug_init(struct vc4_hdmi *vc4_hdmi) + return 0; + } + +-static void vc4_hdmi_hotplug_exit(struct vc4_hdmi *vc4_hdmi) +-{ +- struct platform_device *pdev = vc4_hdmi->pdev; +- +- if (vc4_hdmi->variant->external_irq_controller) { +- free_irq(platform_get_irq_byname(pdev, "hpd-connected"), vc4_hdmi); +- free_irq(platform_get_irq_byname(pdev, "hpd-removed"), vc4_hdmi); +- } +-} +- + #ifdef CONFIG_DRM_VC4_HDMI_CEC + static irqreturn_t vc4_cec_irq_handler_rx_thread(int irq, void *priv) + { +@@ -3321,11 +3309,11 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + + ret = vc4_hdmi_cec_init(vc4_hdmi); + if (ret) +- goto err_free_hotplug; ++ goto err_put_runtime_pm; + + ret = vc4_hdmi_audio_init(vc4_hdmi); + if (ret) +- goto err_free_hotplug; ++ goto err_put_runtime_pm; + + vc4_debugfs_add_file(drm, variant->debugfs_name, + vc4_hdmi_debugfs_regs, +@@ -3335,8 +3323,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + + return 0; + +-err_free_hotplug: +- vc4_hdmi_hotplug_exit(vc4_hdmi); + err_put_runtime_pm: + pm_runtime_put_sync(dev); + err_disable_runtime_pm: +@@ -3348,8 +3334,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + static void vc4_hdmi_unbind(struct device *dev, struct device *master, + void *data) + { +- struct vc4_hdmi *vc4_hdmi; +- + /* + * ASoC makes it a bit hard to retrieve a pointer to the + * vc4_hdmi structure. Registering the card will overwrite our +@@ -3369,9 +3353,6 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, + */ + BUILD_BUG_ON(offsetof(struct vc4_hdmi_audio, card) != 0); + BUILD_BUG_ON(offsetof(struct vc4_hdmi, audio) != 0); +- vc4_hdmi = dev_get_drvdata(dev); +- +- vc4_hdmi_hotplug_exit(vc4_hdmi); + + pm_runtime_disable(dev); + } +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 17 May 2022 12:38:06 +0200 +Subject: [PATCH 1128/1183] drm/vc4: hdmi: Move audio structure offset checks + +The HDMI driver unbind hook doesn't have any ALSA-related code anymore, so +let's move the ALSA sanity checks and comments we have to some other part +of the driver dedicated to ALSA. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 20 -------------------- + 1 file changed, 20 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 9b6ed3ed28b0..37a1ceb804d7 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -3334,26 +3334,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + static void vc4_hdmi_unbind(struct device *dev, struct device *master, + void *data) + { +- /* +- * ASoC makes it a bit hard to retrieve a pointer to the +- * vc4_hdmi structure. Registering the card will overwrite our +- * device drvdata with a pointer to the snd_soc_card structure, +- * which can then be used to retrieve whatever drvdata we want +- * to associate. +- * +- * However, that doesn't fly in the case where we wouldn't +- * register an ASoC card (because of an old DT that is missing +- * the dmas properties for example), then the card isn't +- * registered and the device drvdata wouldn't be set. +- * +- * We can deal with both cases by making sure a snd_soc_card +- * pointer and a vc4_hdmi structure are pointing to the same +- * memory address, so we can treat them indistinctly without any +- * issue. +- */ +- BUILD_BUG_ON(offsetof(struct vc4_hdmi_audio, card) != 0); +- BUILD_BUG_ON(offsetof(struct vc4_hdmi, audio) != 0); +- + pm_runtime_disable(dev); + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 17 May 2022 18:19:19 +0200 +Subject: [PATCH 1129/1183] drm/vc4: hdmi: Protect device resources after + removal + +Whenever the device and driver are unbound, the main device and all the +subdevices will be removed by calling their unbind() method. + +However, the DRM device itself will only be freed when the last user will +have closed it. + +It means that there is a time window where the device and its resources +aren't there anymore, but the userspace can still call into our driver. + +Fortunately, the DRM framework provides the drm_dev_enter() and +drm_dev_exit() functions to make sure our underlying device is still there +for the section protected by those calls. Let's add them to the HDMI driver. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 309 +++++++++++++++++++++++++++++++-- + 1 file changed, 292 insertions(+), 17 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 37a1ceb804d7..264610e27e23 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -32,6 +32,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -164,7 +165,12 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) + { + struct drm_info_node *node = (struct drm_info_node *)m->private; + struct vc4_hdmi *vc4_hdmi = node->info_ent->data; ++ struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_printer p = drm_seq_file_printer(m); ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return -ENODEV; + + drm_print_regset32(&p, &vc4_hdmi->hdmi_regset); + drm_print_regset32(&p, &vc4_hdmi->hd_regset); +@@ -175,12 +181,23 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused) + drm_print_regset32(&p, &vc4_hdmi->ram_regset); + drm_print_regset32(&p, &vc4_hdmi->rm_regset); + ++ drm_dev_exit(idx); ++ + return 0; + } + + static void vc4_hdmi_reset(struct vc4_hdmi *vc4_hdmi) + { ++ struct drm_device *drm = vc4_hdmi->connector.dev; + unsigned long flags; ++ int idx; ++ ++ /* ++ * We can be called by our bind callback, when the ++ * connector->dev pointer might not be initialised yet. ++ */ ++ if (drm && !drm_dev_enter(drm, &idx)) ++ return; + + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + +@@ -197,11 +214,23 @@ static void vc4_hdmi_reset(struct vc4_hdmi *vc4_hdmi) + HDMI_WRITE(HDMI_SW_RESET_CONTROL, 0); + + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); ++ ++ if (drm) ++ drm_dev_exit(idx); + } + + static void vc5_hdmi_reset(struct vc4_hdmi *vc4_hdmi) + { ++ struct drm_device *drm = vc4_hdmi->connector.dev; + unsigned long flags; ++ int idx; ++ ++ /* ++ * We can be called by our bind callback, when the ++ * connector->dev pointer might not be initialised yet. ++ */ ++ if (drm && !drm_dev_enter(drm, &idx)) ++ return; + + reset_control_reset(vc4_hdmi->reset); + +@@ -213,15 +242,31 @@ static void vc5_hdmi_reset(struct vc4_hdmi *vc4_hdmi) + HDMI_READ(HDMI_CLOCK_STOP) | VC4_DVP_HT_CLOCK_STOP_PIXEL); + + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); ++ ++ if (drm) ++ drm_dev_exit(idx); + } + + #ifdef CONFIG_DRM_VC4_HDMI_CEC + static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) + { +- unsigned long cec_rate = clk_get_rate(vc4_hdmi->cec_clock); ++ struct drm_device *drm = vc4_hdmi->connector.dev; ++ unsigned long cec_rate; + unsigned long flags; + u16 clk_cnt; + u32 value; ++ int idx; ++ ++ /* ++ * This function is called by our runtime_resume implementation ++ * and thus at bind time, when we haven't registered our ++ * connector yet and thus don't have a pointer to the DRM ++ * device. ++ */ ++ if (drm && !drm_dev_enter(drm, &idx)) ++ return; ++ ++ cec_rate = clk_get_rate(vc4_hdmi->cec_clock); + + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + +@@ -237,6 +282,9 @@ static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) + HDMI_WRITE(HDMI_CEC_CNTRL_1, value); + + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); ++ ++ if (drm) ++ drm_dev_exit(idx); + } + #else + static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) {} +@@ -562,25 +610,34 @@ static int vc4_hdmi_stop_packet(struct drm_encoder *encoder, + bool poll) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + u32 packet_id = type - 0x80; + unsigned long flags; ++ int ret = 0; ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return -ENODEV; + + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, + HDMI_READ(HDMI_RAM_PACKET_CONFIG) & ~BIT(packet_id)); + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); + +- if (!poll) +- return 0; ++ if (poll) { ++ ret = wait_for(!(HDMI_READ(HDMI_RAM_PACKET_STATUS) & ++ BIT(packet_id)), 100); ++ } + +- return wait_for(!(HDMI_READ(HDMI_RAM_PACKET_STATUS) & +- BIT(packet_id)), 100); ++ drm_dev_exit(idx); ++ return ret; + } + + static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, + union hdmi_infoframe *frame) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + u32 packet_id = frame->any.type - 0x80; + const struct vc4_hdmi_register *ram_packet_start = + &vc4_hdmi->variant->registers[HDMI_RAM_PACKET_START]; +@@ -593,6 +650,10 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, + unsigned long flags; + ssize_t len, i; + int ret; ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return; + + WARN_ONCE(!(HDMI_READ(HDMI_RAM_PACKET_CONFIG) & + VC4_HDMI_RAM_PACKET_ENABLE), +@@ -600,12 +661,12 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, + + len = hdmi_infoframe_pack(frame, buffer, sizeof(buffer)); + if (len < 0) +- return; ++ goto out; + + 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; ++ goto out; + } + + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); +@@ -641,6 +702,9 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, + BIT(packet_id)), 100); + if (ret) + DRM_ERROR("Failed to wait for infoframe to start: %d\n", ret); ++ ++out: ++ drm_dev_exit(idx); + } + + static void vc4_hdmi_avi_infoframe_colorspace(struct hdmi_avi_infoframe *frame, +@@ -789,8 +853,10 @@ static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder, + static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; + unsigned long flags; ++ int idx; + + lockdep_assert_held(&vc4_hdmi->mutex); + +@@ -802,6 +868,9 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) + vc4_hdmi->output_format)) + return; + ++ if (!drm_dev_enter(drm, &idx)) ++ return; ++ + drm_scdc_set_high_tmds_clock_ratio(vc4_hdmi->ddc, true); + drm_scdc_set_scrambling(vc4_hdmi->ddc, true); + +@@ -810,6 +879,8 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) + VC5_HDMI_SCRAMBLER_CTL_ENABLE); + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); + ++ drm_dev_exit(idx); ++ + vc4_hdmi->scdc_enabled = true; + + queue_delayed_work(system_wq, &vc4_hdmi->scrambling_work, +@@ -819,7 +890,9 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) + static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + unsigned long flags; ++ int idx; + + lockdep_assert_held(&vc4_hdmi->mutex); + +@@ -831,6 +904,9 @@ static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder) + if (delayed_work_pending(&vc4_hdmi->scrambling_work)) + cancel_delayed_work_sync(&vc4_hdmi->scrambling_work); + ++ if (!drm_dev_enter(drm, &idx)) ++ return; ++ + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + HDMI_WRITE(HDMI_SCRAMBLER_CTL, HDMI_READ(HDMI_SCRAMBLER_CTL) & + ~VC5_HDMI_SCRAMBLER_CTL_ENABLE); +@@ -838,6 +914,8 @@ static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder) + + drm_scdc_set_scrambling(vc4_hdmi->ddc, false); + drm_scdc_set_high_tmds_clock_ratio(vc4_hdmi->ddc, false); ++ ++ drm_dev_exit(idx); + } + + static void vc4_hdmi_scrambling_wq(struct work_struct *work) +@@ -860,11 +938,17 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, + struct drm_atomic_state *state) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + unsigned long flags; ++ int idx; + + mutex_lock(&vc4_hdmi->mutex); + + vc4_hdmi->output_enabled = false; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ goto out; ++ + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + + HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0); +@@ -882,6 +966,9 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, + + vc4_hdmi_disable_scrambling(encoder); + ++ drm_dev_exit(idx); ++ ++out: + mutex_unlock(&vc4_hdmi->mutex); + } + +@@ -889,11 +976,16 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, + struct drm_atomic_state *state) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + unsigned long flags; + int ret; ++ int idx; + + mutex_lock(&vc4_hdmi->mutex); + ++ if (!drm_dev_enter(drm, &idx)) ++ goto out; ++ + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + HDMI_WRITE(HDMI_VID_CTL, + HDMI_READ(HDMI_VID_CTL) | VC4_HD_VID_CTL_BLANKPIX); +@@ -909,6 +1001,9 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder, + if (ret < 0) + DRM_ERROR("Failed to release power domain: %d\n", ret); + ++ drm_dev_exit(idx); ++ ++out: + mutex_unlock(&vc4_hdmi->mutex); + } + +@@ -916,8 +1011,13 @@ static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, + struct drm_connector_state *state, + const struct drm_display_mode *mode) + { ++ struct drm_device *drm = vc4_hdmi->connector.dev; + unsigned long flags; + u32 csc_ctl; ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return; + + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + +@@ -952,6 +1052,8 @@ static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, + HDMI_WRITE(HDMI_CSC_CTL, csc_ctl); + + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); ++ ++ drm_dev_exit(idx); + } + + /* +@@ -1103,6 +1205,7 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, + struct drm_connector_state *state, + const struct drm_display_mode *mode) + { ++ struct drm_device *drm = vc4_hdmi->connector.dev; + struct vc4_hdmi_connector_state *vc4_state = + conn_state_to_vc4_hdmi_conn_state(state); + unsigned int lim_range = vc4_hdmi_is_full_range(vc4_hdmi, mode) ? 0 : 1; +@@ -1113,6 +1216,10 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, + u32 csc_chan_ctl = 0; + u32 csc_ctl = VC5_MT_CP_CSC_CTL_ENABLE | VC4_SET_FIELD(VC4_HD_CSC_CTL_MODE_CUSTOM, + VC5_MT_CP_CSC_CTL_MODE); ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return; + + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + +@@ -1180,12 +1287,15 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, + HDMI_WRITE(HDMI_CSC_CTL, csc_ctl); + + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); ++ ++ drm_dev_exit(idx); + } + + static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + struct drm_connector_state *state, + struct drm_display_mode *mode) + { ++ struct drm_device *drm = vc4_hdmi->connector.dev; + bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; + bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; + bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; +@@ -1205,6 +1315,10 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + VC4_HDMI_VERTB_VBP)); + unsigned long flags; + u32 reg; ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return; + + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + +@@ -1237,12 +1351,15 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + HDMI_WRITE(HDMI_MISC_CONTROL, reg); + + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); ++ ++ drm_dev_exit(idx); + } + + static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + struct drm_connector_state *state, + struct drm_display_mode *mode) + { ++ struct drm_device *drm = vc4_hdmi->connector.dev; + const struct vc4_hdmi_connector_state *vc4_state = + conn_state_to_vc4_hdmi_conn_state(state); + bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; +@@ -1267,6 +1384,10 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + unsigned char gcp; + bool gcp_en; + u32 reg; ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return; + + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + +@@ -1343,13 +1464,20 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + HDMI_WRITE(HDMI_CLOCK_STOP, 0); + + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); ++ ++ drm_dev_exit(idx); + } + + static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) + { ++ struct drm_device *drm = vc4_hdmi->connector.dev; + unsigned long flags; + u32 drift; + int ret; ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return; + + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + +@@ -1378,12 +1506,15 @@ static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) + VC4_HDMI_FIFO_CTL_RECENTER_DONE, 1); + WARN_ONCE(ret, "Timeout waiting for " + "VC4_HDMI_FIFO_CTL_RECENTER_DONE"); ++ ++ drm_dev_exit(idx); + } + + static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, + struct drm_atomic_state *state) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_connector *connector = &vc4_hdmi->connector; + struct drm_connector_state *conn_state = + drm_atomic_get_new_connector_state(state, connector); +@@ -1394,9 +1525,13 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, + unsigned long bvb_rate, hsm_rate; + unsigned long flags; + int ret; ++ int idx; + + mutex_lock(&vc4_hdmi->mutex); + ++ if (!drm_dev_enter(drm, &idx)) ++ goto out; ++ + /* + * As stated in RPi's vc4 firmware "HDMI state machine (HSM) clock must + * be faster than pixel clock, infinitesimally faster, tested in +@@ -1417,13 +1552,13 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, + ret = clk_set_min_rate(vc4_hdmi->hsm_clock, hsm_rate); + if (ret) { + DRM_ERROR("Failed to set HSM clock rate: %d\n", ret); +- goto out; ++ goto err_dev_exit; + } + + ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); + if (ret < 0) { + DRM_ERROR("Failed to retain power domain: %d\n", ret); +- goto out; ++ goto err_dev_exit; + } + + ret = clk_set_rate(vc4_hdmi->pixel_clock, pixel_rate); +@@ -1475,6 +1610,8 @@ 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); + ++ drm_dev_exit(idx); ++ + mutex_unlock(&vc4_hdmi->mutex); + + return; +@@ -1483,6 +1620,8 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, + clk_disable_unprepare(vc4_hdmi->pixel_clock); + err_put_runtime_pm: + pm_runtime_put(&vc4_hdmi->pdev->dev); ++err_dev_exit: ++ drm_dev_exit(idx); + out: + mutex_unlock(&vc4_hdmi->mutex); + return; +@@ -1492,14 +1631,19 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, + struct drm_atomic_state *state) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_connector *connector = &vc4_hdmi->connector; + struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; + struct drm_connector_state *conn_state = + drm_atomic_get_new_connector_state(state, connector); + unsigned long flags; ++ int idx; + + mutex_lock(&vc4_hdmi->mutex); + ++ if (!drm_dev_enter(drm, &idx)) ++ return; ++ + if (vc4_hdmi->variant->csc_setup) + vc4_hdmi->variant->csc_setup(vc4_hdmi, conn_state, mode); + +@@ -1507,6 +1651,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); + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); + ++ drm_dev_exit(idx); ++ + mutex_unlock(&vc4_hdmi->mutex); + } + +@@ -1514,15 +1660,20 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, + struct drm_atomic_state *state) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; + struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); + bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; + bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; + unsigned long flags; + int ret; ++ int idx; + + mutex_lock(&vc4_hdmi->mutex); + ++ if (!drm_dev_enter(drm, &idx)) ++ return; ++ + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + + HDMI_WRITE(HDMI_VID_CTL, +@@ -1581,6 +1732,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, + vc4_hdmi_recenter_fifo(vc4_hdmi); + vc4_hdmi_enable_scrambling(encoder); + ++ drm_dev_exit(idx); + mutex_unlock(&vc4_hdmi->mutex); + } + +@@ -1938,13 +2090,20 @@ static u32 vc5_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask) + + static bool vc5_hdmi_hp_detect(struct vc4_hdmi *vc4_hdmi) + { ++ struct drm_device *drm = vc4_hdmi->connector.dev; + unsigned long flags; + u32 hotplug; ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return false; + + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + hotplug = HDMI_READ(HDMI_HOTPLUG); + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); + ++ drm_dev_exit(idx); ++ + return !!(hotplug & VC4_HDMI_HOTPLUG_CONNECTED); + } + +@@ -1952,10 +2111,16 @@ static bool vc5_hdmi_hp_detect(struct vc4_hdmi *vc4_hdmi) + static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi, + unsigned int samplerate) + { +- u32 hsm_clock = clk_get_rate(vc4_hdmi->audio_clock); ++ struct drm_device *drm = vc4_hdmi->connector.dev; ++ u32 hsm_clock; + unsigned long flags; + unsigned long n, m; ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return; + ++ hsm_clock = clk_get_rate(vc4_hdmi->audio_clock); + rational_best_approximation(hsm_clock, samplerate, + VC4_HD_MAI_SMP_N_MASK >> + VC4_HD_MAI_SMP_N_SHIFT, +@@ -1968,6 +2133,8 @@ static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi, + VC4_SET_FIELD(n, VC4_HD_MAI_SMP_N) | + VC4_SET_FIELD(m - 1, VC4_HD_MAI_SMP_M)); + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); ++ ++ drm_dev_exit(idx); + } + + static void vc4_hdmi_set_n_cts(struct vc4_hdmi *vc4_hdmi, unsigned int samplerate) +@@ -2021,13 +2188,21 @@ static bool vc4_hdmi_audio_can_stream(struct vc4_hdmi *vc4_hdmi) + static int vc4_hdmi_audio_startup(struct device *dev, void *data) + { + struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + unsigned long flags; ++ int ret = 0; ++ int idx; + + mutex_lock(&vc4_hdmi->mutex); + ++ if (!drm_dev_enter(drm, &idx)) { ++ ret = -ENODEV; ++ goto out; ++ } ++ + if (!vc4_hdmi_audio_can_stream(vc4_hdmi)) { +- mutex_unlock(&vc4_hdmi->mutex); +- return -ENODEV; ++ ret = -ENODEV; ++ goto out_dev_exit; + } + + vc4_hdmi->audio.streaming = true; +@@ -2044,9 +2219,12 @@ static int vc4_hdmi_audio_startup(struct device *dev, void *data) + if (vc4_hdmi->variant->phy_rng_enable) + vc4_hdmi->variant->phy_rng_enable(vc4_hdmi); + ++out_dev_exit: ++ drm_dev_exit(idx); ++out: + mutex_unlock(&vc4_hdmi->mutex); + +- return 0; ++ return ret; + } + + static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) +@@ -2075,10 +2253,15 @@ static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) + static void vc4_hdmi_audio_shutdown(struct device *dev, void *data) + { + struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + unsigned long flags; ++ int idx; + + mutex_lock(&vc4_hdmi->mutex); + ++ if (!drm_dev_enter(drm, &idx)) ++ goto out; ++ + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + + HDMI_WRITE(HDMI_MAI_CTL, +@@ -2094,6 +2277,9 @@ static void vc4_hdmi_audio_shutdown(struct device *dev, void *data) + vc4_hdmi->audio.streaming = false; + vc4_hdmi_audio_reset(vc4_hdmi); + ++ drm_dev_exit(idx); ++ ++out: + mutex_unlock(&vc4_hdmi->mutex); + } + +@@ -2141,6 +2327,7 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, + struct hdmi_codec_params *params) + { + struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; + unsigned int sample_rate = params->sample_rate; + unsigned int channels = params->channels; +@@ -2149,15 +2336,22 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, + u32 channel_map; + u32 mai_audio_format; + u32 mai_sample_rate; ++ int ret = 0; ++ int idx; + + dev_dbg(dev, "%s: %u Hz, %d bit, %d channels\n", __func__, + sample_rate, params->sample_width, channels); + + mutex_lock(&vc4_hdmi->mutex); + ++ if (!drm_dev_enter(drm, &idx)) { ++ ret = -ENODEV; ++ goto out; ++ } ++ + if (!vc4_hdmi_audio_can_stream(vc4_hdmi)) { +- mutex_unlock(&vc4_hdmi->mutex); +- return -EINVAL; ++ ret = -EINVAL; ++ goto out_dev_exit; + } + + vc4_hdmi_audio_set_mai_clock(vc4_hdmi, sample_rate); +@@ -2215,9 +2409,12 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, + if (vc4_hdmi->output_enabled) + vc4_hdmi_set_audio_infoframe(encoder); + ++out_dev_exit: ++ drm_dev_exit(idx); ++out: + mutex_unlock(&vc4_hdmi->mutex); + +- return 0; ++ return ret; + } + + static const struct snd_soc_component_driver vc4_hdmi_audio_cpu_dai_comp = { +@@ -2532,6 +2729,17 @@ static irqreturn_t vc4_cec_irq_handler_tx_bare_locked(struct vc4_hdmi *vc4_hdmi) + { + u32 cntrl1; + ++ /* ++ * We don't need to protect the register access using ++ * drm_dev_enter() there because the interrupt handler lifetime ++ * is tied to the device itself, and not to the DRM device. ++ * ++ * So when the device will be gone, one of the first thing we ++ * will be doing will be to unregister the interrupt handler, ++ * and then unregister the DRM device. drm_dev_enter() would ++ * thus always succeed if we are here. ++ */ ++ + lockdep_assert_held(&vc4_hdmi->hw_lock); + + cntrl1 = HDMI_READ(HDMI_CEC_CNTRL_1); +@@ -2560,6 +2768,17 @@ static irqreturn_t vc4_cec_irq_handler_rx_bare_locked(struct vc4_hdmi *vc4_hdmi) + + lockdep_assert_held(&vc4_hdmi->hw_lock); + ++ /* ++ * We don't need to protect the register access using ++ * drm_dev_enter() there because the interrupt handler lifetime ++ * is tied to the device itself, and not to the DRM device. ++ * ++ * So when the device will be gone, one of the first thing we ++ * will be doing will be to unregister the interrupt handler, ++ * and then unregister the DRM device. drm_dev_enter() would ++ * thus always succeed if we are here. ++ */ ++ + vc4_hdmi->cec_rx_msg.len = 0; + cntrl1 = HDMI_READ(HDMI_CEC_CNTRL_1); + vc4_cec_read_msg(vc4_hdmi, cntrl1); +@@ -2591,6 +2810,17 @@ static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) + irqreturn_t ret; + u32 cntrl5; + ++ /* ++ * We don't need to protect the register access using ++ * drm_dev_enter() there because the interrupt handler lifetime ++ * is tied to the device itself, and not to the DRM device. ++ * ++ * So when the device will be gone, one of the first thing we ++ * will be doing will be to unregister the interrupt handler, ++ * and then unregister the DRM device. drm_dev_enter() would ++ * thus always succeed if we are here. ++ */ ++ + if (!(stat & VC4_HDMI_CPU_CEC)) + return IRQ_NONE; + +@@ -2611,11 +2841,13 @@ static irqreturn_t vc4_cec_irq_handler(int irq, void *priv) + static int vc4_hdmi_cec_enable(struct cec_adapter *adap) + { + struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + /* clock period in microseconds */ + const u32 usecs = 1000000 / CEC_CLOCK_FREQ; + unsigned long flags; + u32 val; + int ret; ++ int idx; + + /* + * NOTE: This function should really take vc4_hdmi->mutex, but doing so +@@ -2628,9 +2860,19 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) + * keep it in mind if we were to change that assumption. + */ + ++ if (!drm_dev_enter(drm, &idx)) ++ /* ++ * We can't return an error code, because the CEC ++ * framework will emit WARN_ON messages at unbind ++ * otherwise. ++ */ ++ return 0; ++ + ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); +- if (ret) ++ if (ret) { ++ drm_dev_exit(idx); + return ret; ++ } + + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + +@@ -2666,13 +2908,25 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) + + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); + ++ drm_dev_exit(idx); ++ + return 0; + } + + static int vc4_hdmi_cec_disable(struct cec_adapter *adap) + { + struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + unsigned long flags; ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ /* ++ * We can't return an error code, because the CEC ++ * framework will emit WARN_ON messages at unbind ++ * otherwise. ++ */ ++ return 0; + + /* + * NOTE: This function should really take vc4_hdmi->mutex, but doing so +@@ -2697,6 +2951,8 @@ static int vc4_hdmi_cec_disable(struct cec_adapter *adap) + + pm_runtime_put(&vc4_hdmi->pdev->dev); + ++ drm_dev_exit(idx); ++ + return 0; + } + +@@ -2711,7 +2967,9 @@ static int vc4_hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable) + static int vc4_hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr) + { + struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); ++ struct drm_device *drm = vc4_hdmi->connector.dev; + unsigned long flags; ++ int idx; + + /* + * NOTE: This function should really take vc4_hdmi->mutex, but doing so +@@ -2724,12 +2982,22 @@ static int vc4_hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr) + * keep it in mind if we were to change that assumption. + */ + ++ if (!drm_dev_enter(drm, &idx)) ++ /* ++ * We can't return an error code, because the CEC ++ * framework will emit WARN_ON messages at unbind ++ * otherwise. ++ */ ++ return 0; ++ + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + HDMI_WRITE(HDMI_CEC_CNTRL_1, + (HDMI_READ(HDMI_CEC_CNTRL_1) & ~VC4_HDMI_CEC_ADDR_MASK) | + (log_addr & 0xf) << VC4_HDMI_CEC_ADDR_SHIFT); + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); + ++ drm_dev_exit(idx); ++ + return 0; + } + +@@ -2741,6 +3009,7 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, + unsigned long flags; + u32 val; + unsigned int i; ++ int idx; + + /* + * NOTE: This function should really take vc4_hdmi->mutex, but doing so +@@ -2753,8 +3022,12 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, + * keep it in mind if we were to change that assumption. + */ + ++ if (!drm_dev_enter(dev, &idx)) ++ return -ENODEV; ++ + if (msg->len > 16) { + drm_err(dev, "Attempting to transmit too much data (%d)\n", msg->len); ++ drm_dev_exit(idx); + return -ENOMEM; + } + +@@ -2778,6 +3051,8 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, + + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); + ++ drm_dev_exit(idx); ++ + return 0; + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Fri, 10 Jun 2022 10:51:26 +0200 +Subject: [PATCH 1130/1183] drm/vc4: hdmi: Switch to devm_pm_runtime_enable + +devm_pm_runtime_enable() simplifies the driver a bit since it will call +pm_runtime_disable() automatically through a device-managed action. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 11 +++-------- + 1 file changed, 3 insertions(+), 8 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 264610e27e23..6f41b109db8e 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -3543,7 +3543,9 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + if (ret) + return ret; + +- pm_runtime_enable(dev); ++ ret = devm_pm_runtime_enable(dev); ++ if (ret) ++ return ret; + + /* + * We need to have the device powered up at this point to call +@@ -3606,15 +3608,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + return ret; + } + +-static void vc4_hdmi_unbind(struct device *dev, struct device *master, +- void *data) +-{ +- pm_runtime_disable(dev); +-} +- + static const struct component_ops vc4_hdmi_ops = { + .bind = vc4_hdmi_bind, +- .unbind = vc4_hdmi_unbind, + }; + + static int vc4_hdmi_dev_probe(struct platform_device *pdev) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 3 Sep 2020 10:01:20 +0200 +Subject: [PATCH 1131/1183] drm/vc4: txp: Remove vc4_dev txp pointer + +There's no user for that pointer so let's just get rid of it. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_drv.h | 1 - + drivers/gpu/drm/vc4/vc4_txp.c | 6 ------ + 2 files changed, 7 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index c7db33a31cc9..e49c0bc7b920 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -88,7 +88,6 @@ struct vc4_dev { + struct vc4_hvs *hvs; + struct vc4_v3d *v3d; + struct vc4_vec *vec; +- struct vc4_txp *txp; + struct vc4_fkms *fkms; + + struct vc4_hang_state *hang_state; +diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c +index f306e05ac5b2..87c896f482fb 100644 +--- a/drivers/gpu/drm/vc4/vc4_txp.c ++++ b/drivers/gpu/drm/vc4/vc4_txp.c +@@ -468,7 +468,6 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) + { + struct platform_device *pdev = to_platform_device(dev); + struct drm_device *drm = dev_get_drvdata(master); +- struct vc4_dev *vc4 = to_vc4_dev(drm); + struct vc4_crtc *vc4_crtc; + struct vc4_txp *txp; + struct drm_crtc *crtc; +@@ -521,7 +520,6 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) + return ret; + + dev_set_drvdata(dev, txp); +- vc4->txp = txp; + + vc4_debugfs_add_regset32(drm, "txp_regs", &txp->regset); + +@@ -531,13 +529,9 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) + static void vc4_txp_unbind(struct device *dev, struct device *master, + void *data) + { +- struct drm_device *drm = dev_get_drvdata(master); +- struct vc4_dev *vc4 = to_vc4_dev(drm); + struct vc4_txp *txp = dev_get_drvdata(dev); + + vc4_txp_connector_destroy(&txp->connector.base); +- +- vc4->txp = NULL; + } + + static const struct component_ops vc4_txp_ops = { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 23 May 2022 15:44:50 +0200 +Subject: [PATCH 1132/1183] drm/vc4: txp: Remove duplicate regset + +There's already a regset in the vc4_crtc structure so there's no need to +duplicate it in vc4_txp. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_txp.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c +index 87c896f482fb..51ac01838093 100644 +--- a/drivers/gpu/drm/vc4/vc4_txp.c ++++ b/drivers/gpu/drm/vc4/vc4_txp.c +@@ -154,7 +154,6 @@ struct vc4_txp { + struct drm_writeback_connector connector; + + void __iomem *regs; +- struct debugfs_regset32 regset; + }; + + static inline struct vc4_txp *encoder_to_vc4_txp(struct drm_encoder *encoder) +@@ -493,9 +492,9 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) + txp->regs = vc4_ioremap_regs(pdev, 0); + if (IS_ERR(txp->regs)) + return PTR_ERR(txp->regs); +- txp->regset.base = txp->regs; +- txp->regset.regs = txp_regs; +- txp->regset.nregs = ARRAY_SIZE(txp_regs); ++ vc4_crtc->regset.base = txp->regs; ++ vc4_crtc->regset.regs = txp_regs; ++ vc4_crtc->regset.nregs = ARRAY_SIZE(txp_regs); + + drm_connector_helper_add(&txp->connector.base, + &vc4_txp_connector_helper_funcs); +@@ -521,7 +520,7 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) + + dev_set_drvdata(dev, txp); + +- vc4_debugfs_add_regset32(drm, "txp_regs", &txp->regset); ++ vc4_debugfs_add_regset32(drm, "txp_regs", &vc4_crtc->regset); + + return 0; + } +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 23 May 2022 17:11:29 +0200 +Subject: [PATCH 1133/1183] drm/vc4: txp: Switch to drmm_kzalloc + +Our internal structure that stores the DRM entities structure is allocated +through a device-managed kzalloc. + +This means that this will eventually be freed whenever the device is +removed. In our case, the most likely source of removal is that the main +device is going to be unbound, and component_unbind_all() is being run. + +However, it occurs while the DRM device is still registered, which will +create dangling pointers, eventually resulting in use-after-free. + +Switch to a DRM-managed allocation to keep our structure until the DRM +driver doesn't need it anymore. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_txp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c +index 51ac01838093..6a16b2798724 100644 +--- a/drivers/gpu/drm/vc4/vc4_txp.c ++++ b/drivers/gpu/drm/vc4/vc4_txp.c +@@ -477,7 +477,7 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) + if (irq < 0) + return irq; + +- txp = devm_kzalloc(dev, sizeof(*txp), GFP_KERNEL); ++ txp = drmm_kzalloc(drm, sizeof(*txp), GFP_KERNEL); + if (!txp) + return -ENOMEM; + vc4_crtc = &txp->base; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 22 Jun 2022 16:20:35 +0200 +Subject: [PATCH 1134/1183] drm/vc4: txp: Remove call to + drm_connector_unregister() + +drm_connector_unregister() is only to be used for connectors that have been +registered through drm_connector_register() after drm_dev_register() has +been called. This is our case here so let's remove the call. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_txp.c | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c +index 6a16b2798724..7738310377a5 100644 +--- a/drivers/gpu/drm/vc4/vc4_txp.c ++++ b/drivers/gpu/drm/vc4/vc4_txp.c +@@ -335,16 +335,10 @@ vc4_txp_connector_detect(struct drm_connector *connector, bool force) + return connector_status_connected; + } + +-static void vc4_txp_connector_destroy(struct drm_connector *connector) +-{ +- drm_connector_unregister(connector); +- drm_connector_cleanup(connector); +-} +- + static const struct drm_connector_funcs vc4_txp_connector_funcs = { + .detect = vc4_txp_connector_detect, + .fill_modes = drm_helper_probe_single_connector_modes, +- .destroy = vc4_txp_connector_destroy, ++ .destroy = drm_connector_cleanup, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, +@@ -530,7 +524,7 @@ static void vc4_txp_unbind(struct device *dev, struct device *master, + { + struct vc4_txp *txp = dev_get_drvdata(dev); + +- vc4_txp_connector_destroy(&txp->connector.base); ++ drm_connector_cleanup(&txp->connector.base); + } + + static const struct component_ops vc4_txp_ops = { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 16:26:30 +0200 +Subject: [PATCH 1135/1183] drm/vc4: txp: Protect device resources + +Our current code now mixes some resources whose lifetime are tied to the +device (clocks, IO mappings, etc.) and some that are tied to the DRM device +(encoder, bridge). + +The device one will be freed at unbind time, but the DRM one will only be +freed when the last user of the DRM device closes its file handle. + +So we end up with a time window during which we can call the encoder hooks, +but we don't have access to the underlying resources and device. + +Let's protect all those sections with drm_dev_enter() and drm_dev_exit() so +that we bail out if we are during that window. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_txp.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c +index 7738310377a5..1a26d6bf4868 100644 +--- a/drivers/gpu/drm/vc4/vc4_txp.c ++++ b/drivers/gpu/drm/vc4/vc4_txp.c +@@ -15,6 +15,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -274,6 +275,7 @@ static int vc4_txp_connector_atomic_check(struct drm_connector *conn, + static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, + struct drm_atomic_state *state) + { ++ struct drm_device *drm = conn->dev; + struct drm_connector_state *conn_state = drm_atomic_get_new_connector_state(state, + conn); + struct vc4_txp *txp = connector_to_vc4_txp(conn); +@@ -281,6 +283,7 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, + struct drm_display_mode *mode; + struct drm_framebuffer *fb; + u32 ctrl; ++ int idx; + int i; + + if (WARN_ON(!conn_state->writeback_job)) +@@ -310,6 +313,9 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, + */ + ctrl |= TXP_ALPHA_INVERT; + ++ if (!drm_dev_enter(drm, &idx)) ++ return; ++ + gem = drm_fb_cma_get_gem_obj(fb, 0); + TXP_WRITE(TXP_DST_PTR, gem->paddr + fb->offsets[0]); + TXP_WRITE(TXP_DST_PITCH, fb->pitches[0]); +@@ -320,6 +326,8 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn, + TXP_WRITE(TXP_DST_CTRL, ctrl); + + drm_writeback_queue_job(&txp->connector, conn_state); ++ ++ drm_dev_exit(idx); + } + + static const struct drm_connector_helper_funcs vc4_txp_connector_helper_funcs = { +@@ -346,7 +354,12 @@ static const struct drm_connector_funcs vc4_txp_connector_funcs = { + + static void vc4_txp_encoder_disable(struct drm_encoder *encoder) + { ++ struct drm_device *drm = encoder->dev; + struct vc4_txp *txp = encoder_to_vc4_txp(encoder); ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return; + + if (TXP_READ(TXP_DST_CTRL) & TXP_BUSY) { + unsigned long timeout = jiffies + msecs_to_jiffies(1000); +@@ -361,6 +374,8 @@ static void vc4_txp_encoder_disable(struct drm_encoder *encoder) + } + + TXP_WRITE(TXP_DST_CTRL, TXP_POWERDOWN); ++ ++ drm_dev_exit(idx); + } + + static const struct drm_encoder_helper_funcs vc4_txp_encoder_helper_funcs = { +@@ -444,6 +459,16 @@ static irqreturn_t vc4_txp_interrupt(int irq, void *data) + struct vc4_txp *txp = data; + struct vc4_crtc *vc4_crtc = &txp->base; + ++ /* ++ * We don't need to protect the register access using ++ * drm_dev_enter() there because the interrupt handler lifetime ++ * is tied to the device itself, and not to the DRM device. ++ * ++ * So when the device will be gone, one of the first thing we ++ * will be doing will be to unregister the interrupt handler, ++ * and then unregister the DRM device. drm_dev_enter() would ++ * thus always succeed if we are here. ++ */ + TXP_WRITE(TXP_DST_CTRL, TXP_READ(TXP_DST_CTRL) & ~TXP_EI); + vc4_crtc_handle_vblank(vc4_crtc); + drm_writeback_signal_completion(&txp->connector, 0); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 3 Sep 2020 10:01:20 +0200 +Subject: [PATCH 1136/1183] drm/vc4: vec: Remove vc4_dev vec pointer + +There's no user for that pointer so let's just get rid of it. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_drv.h | 1 - + drivers/gpu/drm/vc4/vc4_vec.c | 7 ------- + 2 files changed, 8 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index e49c0bc7b920..eb7f25ab5dca 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -87,7 +87,6 @@ struct vc4_dev { + + struct vc4_hvs *hvs; + struct vc4_v3d *v3d; +- struct vc4_vec *vec; + struct vc4_fkms *fkms; + + struct vc4_hang_state *hang_state; +diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c +index d263fdaa1ee8..08469f587af1 100644 +--- a/drivers/gpu/drm/vc4/vc4_vec.c ++++ b/drivers/gpu/drm/vc4/vc4_vec.c +@@ -721,7 +721,6 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + { + struct platform_device *pdev = to_platform_device(dev); + struct drm_device *drm = dev_get_drvdata(master); +- struct vc4_dev *vc4 = to_vc4_dev(drm); + struct vc4_vec *vec; + struct vc4_vec_encoder *vc4_vec_encoder; + int ret; +@@ -774,8 +773,6 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + + dev_set_drvdata(dev, vec); + +- vc4->vec = vec; +- + vc4_debugfs_add_regset32(drm, "vec_regs", &vec->regset); + + return 0; +@@ -790,15 +787,11 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + static void vc4_vec_unbind(struct device *dev, struct device *master, + void *data) + { +- struct drm_device *drm = dev_get_drvdata(master); +- struct vc4_dev *vc4 = to_vc4_dev(drm); + struct vc4_vec *vec = dev_get_drvdata(dev); + + vc4_vec_connector_destroy(vec->connector); + drm_encoder_cleanup(vec->encoder); + pm_runtime_disable(dev); +- +- vc4->vec = NULL; + } + + static const struct component_ops vc4_vec_ops = { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 11:03:23 +0200 +Subject: [PATCH 1137/1183] drm/vc4: vec: Embed DRM structures into the private + structure + +The VC4 VEC driver private structure contains only a pointer to the +encoder and connector it implements. This makes the overall structure +somewhat inconsistent with the rest of the driver, and complicates its +initialisation without any apparent gain. + +Let's embed the drm_encoder structure (through the vc4_encoder one) and +drm_connector into struct vc4_vec to fix both issues. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_vec.c | 83 +++++++++-------------------------- + 1 file changed, 21 insertions(+), 62 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c +index 08469f587af1..ee4d7c06ee26 100644 +--- a/drivers/gpu/drm/vc4/vc4_vec.c ++++ b/drivers/gpu/drm/vc4/vc4_vec.c +@@ -193,12 +193,12 @@ struct vc4_vec_variant { + + /* General VEC hardware state. */ + struct vc4_vec { ++ struct vc4_encoder encoder; ++ struct drm_connector connector; ++ + struct platform_device *pdev; + const struct vc4_vec_variant *variant; + +- struct drm_encoder *encoder; +- struct drm_connector *connector; +- + void __iomem *regs; + + struct clk *clock; +@@ -209,30 +209,12 @@ struct vc4_vec { + #define VEC_READ(offset) readl(vec->regs + (offset)) + #define VEC_WRITE(offset, val) writel(val, vec->regs + (offset)) + +-/* VC4 VEC encoder KMS struct */ +-struct vc4_vec_encoder { +- struct vc4_encoder base; +- struct vc4_vec *vec; +-}; +- +-static inline struct vc4_vec_encoder * +-to_vc4_vec_encoder(struct drm_encoder *encoder) ++static inline struct vc4_vec * ++encoder_to_vc4_vec(struct drm_encoder *encoder) + { +- return container_of(encoder, struct vc4_vec_encoder, base.base); ++ return container_of(encoder, struct vc4_vec, encoder.base); + } + +-/* VC4 VEC connector KMS struct */ +-struct vc4_vec_connector { +- struct drm_connector base; +- struct vc4_vec *vec; +- +- /* Since the connector is attached to just the one encoder, +- * this is the reference to it so we can do the best_encoder() +- * hook. +- */ +- struct drm_encoder *encoder; +-}; +- + enum vc4_vec_tv_mode_id { + VC4_VEC_TV_MODE_NTSC, + VC4_VEC_TV_MODE_NTSC_J, +@@ -484,22 +466,12 @@ static const struct drm_connector_helper_funcs vc4_vec_connector_helper_funcs = + .atomic_check = vc4_vec_connector_atomic_check, + }; + +-static struct drm_connector *vc4_vec_connector_init(struct drm_device *dev, +- struct vc4_vec *vec) ++static int vc4_vec_connector_init(struct drm_device *dev, struct vc4_vec *vec) + { +- struct drm_connector *connector = NULL; +- struct vc4_vec_connector *vec_connector; +- +- vec_connector = devm_kzalloc(dev->dev, sizeof(*vec_connector), +- GFP_KERNEL); +- if (!vec_connector) +- return ERR_PTR(-ENOMEM); ++ struct drm_connector *connector = &vec->connector; + +- connector = &vec_connector->base; + connector->interlace_allowed = true; + +- vec_connector->encoder = vec->encoder; +- vec_connector->vec = vec; + + drm_connector_init(dev, connector, &vc4_vec_connector_funcs, + DRM_MODE_CONNECTOR_Composite); +@@ -509,15 +481,14 @@ static struct drm_connector *vc4_vec_connector_init(struct drm_device *dev, + dev->mode_config.tv_mode_property, + vc4_vec_get_default_mode(connector)); + +- drm_connector_attach_encoder(connector, vec->encoder); ++ drm_connector_attach_encoder(connector, &vec->encoder.base); + +- return connector; ++ return 0; + } + + static void vc4_vec_encoder_disable(struct drm_encoder *encoder) + { +- struct vc4_vec_encoder *vc4_vec_encoder = to_vc4_vec_encoder(encoder); +- struct vc4_vec *vec = vc4_vec_encoder->vec; ++ struct vc4_vec *vec = encoder_to_vc4_vec(encoder); + int ret; + + VEC_WRITE(VEC_CFG, 0); +@@ -538,9 +509,8 @@ static void vc4_vec_encoder_disable(struct drm_encoder *encoder) + + static void vc4_vec_encoder_enable(struct drm_encoder *encoder) + { +- struct vc4_vec_encoder *vc4_vec_encoder = to_vc4_vec_encoder(encoder); +- struct vc4_vec *vec = vc4_vec_encoder->vec; +- unsigned int tv_mode = vec->connector->state->tv.mode; ++ struct vc4_vec *vec = encoder_to_vc4_vec(encoder); ++ unsigned int tv_mode = vec->connector.state->tv.mode; + int ret; + + ret = pm_runtime_get_sync(&vec->pdev->dev); +@@ -614,7 +584,6 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder) + VEC_WRITE(VEC_CFG, VEC_CFG_VEC_EN); + } + +- + static int vc4_vec_encoder_atomic_check(struct drm_encoder *encoder, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +@@ -722,7 +691,6 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + struct platform_device *pdev = to_platform_device(dev); + struct drm_device *drm = dev_get_drvdata(master); + struct vc4_vec *vec; +- struct vc4_vec_encoder *vc4_vec_encoder; + int ret; + + ret = drm_mode_create_tv_properties(drm, ARRAY_SIZE(tv_mode_names), +@@ -734,14 +702,7 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + if (!vec) + return -ENOMEM; + +- vc4_vec_encoder = devm_kzalloc(dev, sizeof(*vc4_vec_encoder), +- GFP_KERNEL); +- if (!vc4_vec_encoder) +- return -ENOMEM; +- vc4_vec_encoder->base.type = VC4_ENCODER_TYPE_VEC; +- vc4_vec_encoder->vec = vec; +- vec->encoder = &vc4_vec_encoder->base.base; +- ++ vec->encoder.type = VC4_ENCODER_TYPE_VEC; + vec->pdev = pdev; + vec->variant = (const struct vc4_vec_variant *) + of_device_get_match_data(dev); +@@ -762,14 +723,12 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + + pm_runtime_enable(dev); + +- drm_simple_encoder_init(drm, vec->encoder, DRM_MODE_ENCODER_TVDAC); +- drm_encoder_helper_add(vec->encoder, &vc4_vec_encoder_helper_funcs); ++ drm_simple_encoder_init(drm, &vec->encoder.base, DRM_MODE_ENCODER_TVDAC); ++ drm_encoder_helper_add(&vec->encoder.base, &vc4_vec_encoder_helper_funcs); + +- vec->connector = vc4_vec_connector_init(drm, vec); +- if (IS_ERR(vec->connector)) { +- ret = PTR_ERR(vec->connector); ++ ret = vc4_vec_connector_init(drm, vec); ++ if (ret) + goto err_destroy_encoder; +- } + + dev_set_drvdata(dev, vec); + +@@ -778,7 +737,7 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + return 0; + + err_destroy_encoder: +- drm_encoder_cleanup(vec->encoder); ++ drm_encoder_cleanup(&vec->encoder.base); + pm_runtime_disable(dev); + + return ret; +@@ -789,8 +748,8 @@ static void vc4_vec_unbind(struct device *dev, struct device *master, + { + struct vc4_vec *vec = dev_get_drvdata(dev); + +- vc4_vec_connector_destroy(vec->connector); +- drm_encoder_cleanup(vec->encoder); ++ vc4_vec_connector_destroy(&vec->connector); ++ drm_encoder_cleanup(&vec->encoder.base); + pm_runtime_disable(dev); + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 23 May 2022 17:11:29 +0200 +Subject: [PATCH 1138/1183] drm/vc4: vec: Switch to drmm_kzalloc + +Our internal structure that stores the DRM entities structure is allocated +through a device-managed kzalloc. + +This means that this will eventually be freed whenever the device is +removed. In our case, the most likely source of removal is that the main +device is going to be unbound, and component_unbind_all() is being run. + +However, it occurs while the DRM device is still registered, which will +create dangling pointers, eventually resulting in use-after-free. + +Switch to a DRM-managed allocation to keep our structure until the DRM +driver doesn't need it anymore. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_vec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c +index ee4d7c06ee26..7e83369e2ae9 100644 +--- a/drivers/gpu/drm/vc4/vc4_vec.c ++++ b/drivers/gpu/drm/vc4/vc4_vec.c +@@ -698,7 +698,7 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + if (ret) + return ret; + +- vec = devm_kzalloc(dev, sizeof(*vec), GFP_KERNEL); ++ vec = drmm_kzalloc(drm, sizeof(*vec), GFP_KERNEL); + if (!vec) + return -ENOMEM; + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 22 Jun 2022 16:20:35 +0200 +Subject: [PATCH 1139/1183] drm/vc4: vec: Remove call to + drm_connector_unregister() + +drm_connector_unregister() is only to be used for connectors that have been +registered through drm_connector_register() after drm_dev_register() has +been called. This is our case here so let's remove the call. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_vec.c | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c +index 7e83369e2ae9..d256796b57ad 100644 +--- a/drivers/gpu/drm/vc4/vc4_vec.c ++++ b/drivers/gpu/drm/vc4/vc4_vec.c +@@ -387,12 +387,6 @@ vc4_vec_connector_detect(struct drm_connector *connector, bool force) + return connector_status_unknown; + } + +-static void vc4_vec_connector_destroy(struct drm_connector *connector) +-{ +- drm_connector_unregister(connector); +- drm_connector_cleanup(connector); +-} +- + static int vc4_vec_connector_get_modes(struct drm_connector *connector) + { + struct drm_connector_state *state = connector->state; +@@ -455,7 +449,7 @@ static int vc4_vec_connector_atomic_check(struct drm_connector *conn, + static const struct drm_connector_funcs vc4_vec_connector_funcs = { + .detect = vc4_vec_connector_detect, + .fill_modes = drm_helper_probe_single_connector_modes, +- .destroy = vc4_vec_connector_destroy, ++ .destroy = drm_connector_cleanup, + .reset = vc4_vec_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, +@@ -748,7 +742,7 @@ static void vc4_vec_unbind(struct device *dev, struct device *master, + { + struct vc4_vec *vec = dev_get_drvdata(dev); + +- vc4_vec_connector_destroy(&vec->connector); ++ drm_connector_cleanup(&vec->connector); + drm_encoder_cleanup(&vec->encoder.base); + pm_runtime_disable(dev); + } +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 11:05:36 +0200 +Subject: [PATCH 1140/1183] drm/vc4: vec: Switch to DRM-managed encoder + initialization + +The current code will call drm_encoder_cleanup() when the device is +unbound. However, by then, there might still be some references held to +that encoder, including by the userspace that might still have the DRM +device open. + +Let's switch to a DRM-managed initialization to clean up after ourselves +only once the DRM device has been last closed. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_vec.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c +index d256796b57ad..7da879ae77e4 100644 +--- a/drivers/gpu/drm/vc4/vc4_vec.c ++++ b/drivers/gpu/drm/vc4/vc4_vec.c +@@ -717,12 +717,18 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + + pm_runtime_enable(dev); + +- drm_simple_encoder_init(drm, &vec->encoder.base, DRM_MODE_ENCODER_TVDAC); ++ ret = drmm_encoder_init(drm, &vec->encoder.base, ++ NULL, ++ DRM_MODE_ENCODER_TVDAC, ++ NULL); ++ if (ret) ++ goto err_put_runtime_pm; ++ + drm_encoder_helper_add(&vec->encoder.base, &vc4_vec_encoder_helper_funcs); + + ret = vc4_vec_connector_init(drm, vec); + if (ret) +- goto err_destroy_encoder; ++ goto err_put_runtime_pm; + + dev_set_drvdata(dev, vec); + +@@ -730,8 +736,7 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + + return 0; + +-err_destroy_encoder: +- drm_encoder_cleanup(&vec->encoder.base); ++err_put_runtime_pm: + pm_runtime_disable(dev); + + return ret; +@@ -743,7 +748,6 @@ static void vc4_vec_unbind(struct device *dev, struct device *master, + struct vc4_vec *vec = dev_get_drvdata(dev); + + drm_connector_cleanup(&vec->connector); +- drm_encoder_cleanup(&vec->encoder.base); + pm_runtime_disable(dev); + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 11:05:36 +0200 +Subject: [PATCH 1141/1183] drm/vc4: vec: Switch to DRM-managed connector + initialization + +The current code will call drm_connector_unregister() and +drm_connector_cleanup() when the device is unbound. However, by then, there +might still be some references held to that connector, including by the +userspace that might still have the DRM device open. + +Let's switch to a DRM-managed initialization to clean up after ourselves +only once the DRM device has been last closed. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_vec.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c +index 7da879ae77e4..25ff3edb2be3 100644 +--- a/drivers/gpu/drm/vc4/vc4_vec.c ++++ b/drivers/gpu/drm/vc4/vc4_vec.c +@@ -449,7 +449,6 @@ static int vc4_vec_connector_atomic_check(struct drm_connector *conn, + static const struct drm_connector_funcs vc4_vec_connector_funcs = { + .detect = vc4_vec_connector_detect, + .fill_modes = drm_helper_probe_single_connector_modes, +- .destroy = drm_connector_cleanup, + .reset = vc4_vec_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, +@@ -463,12 +462,15 @@ static const struct drm_connector_helper_funcs vc4_vec_connector_helper_funcs = + static int vc4_vec_connector_init(struct drm_device *dev, struct vc4_vec *vec) + { + struct drm_connector *connector = &vec->connector; ++ int ret; + + connector->interlace_allowed = true; + ++ ret = drmm_connector_init(dev, connector, &vc4_vec_connector_funcs, ++ DRM_MODE_CONNECTOR_Composite, NULL); ++ if (ret) ++ return ret; + +- drm_connector_init(dev, connector, &vc4_vec_connector_funcs, +- DRM_MODE_CONNECTOR_Composite); + drm_connector_helper_add(connector, &vc4_vec_connector_helper_funcs); + + drm_object_attach_property(&connector->base, +@@ -745,9 +747,6 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + static void vc4_vec_unbind(struct device *dev, struct device *master, + void *data) + { +- struct vc4_vec *vec = dev_get_drvdata(dev); +- +- drm_connector_cleanup(&vec->connector); + pm_runtime_disable(dev); + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 17 May 2022 18:19:19 +0200 +Subject: [PATCH 1142/1183] drm/vc4: vec: Protect device resources after + removal + +Whenever the device and driver are unbound, the main device and all the +subdevices will be removed by calling their unbind() method. + +However, the DRM device itself will only be freed when the last user will +have closed it. + +It means that there is a time window where the device and its resources +aren't there anymore, but the userspace can still call into our driver. + +Fortunately, the DRM framework provides the drm_dev_enter() and +drm_dev_exit() functions to make sure our underlying device is still there +for the section protected by those calls. Let's add them to the VEC driver. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_vec.c | 35 +++++++++++++++++++++++++++++------ + 1 file changed, 29 insertions(+), 6 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c +index 25ff3edb2be3..31033ba9d728 100644 +--- a/drivers/gpu/drm/vc4/vc4_vec.c ++++ b/drivers/gpu/drm/vc4/vc4_vec.c +@@ -14,6 +14,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -484,8 +485,12 @@ static int vc4_vec_connector_init(struct drm_device *dev, struct vc4_vec *vec) + + static void vc4_vec_encoder_disable(struct drm_encoder *encoder) + { ++ struct drm_device *drm = encoder->dev; + struct vc4_vec *vec = encoder_to_vc4_vec(encoder); +- int ret; ++ int idx, ret; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return; + + VEC_WRITE(VEC_CFG, 0); + VEC_WRITE(VEC_DAC_MISC, +@@ -499,20 +504,30 @@ static void vc4_vec_encoder_disable(struct drm_encoder *encoder) + ret = pm_runtime_put(&vec->pdev->dev); + if (ret < 0) { + DRM_ERROR("Failed to release power domain: %d\n", ret); +- return; ++ goto err_dev_exit; + } ++ ++ drm_dev_exit(idx); ++ return; ++ ++err_dev_exit: ++ drm_dev_exit(idx); + } + + static void vc4_vec_encoder_enable(struct drm_encoder *encoder) + { ++ struct drm_device *drm = encoder->dev; + struct vc4_vec *vec = encoder_to_vc4_vec(encoder); + unsigned int tv_mode = vec->connector.state->tv.mode; +- int ret; ++ int idx, ret; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return; + + ret = pm_runtime_get_sync(&vec->pdev->dev); + if (ret < 0) { + DRM_ERROR("Failed to retain power domain: %d\n", ret); +- return; ++ goto err_dev_exit; + } + + /* +@@ -525,13 +540,13 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder) + ret = clk_set_rate(vec->clock, 108000000); + if (ret) { + DRM_ERROR("Failed to set clock rate: %d\n", ret); +- return; ++ goto err_put_runtime_pm; + } + + ret = clk_prepare_enable(vec->clock); + if (ret) { + DRM_ERROR("Failed to turn on core clock: %d\n", ret); +- return; ++ goto err_put_runtime_pm; + } + + /* Reset the different blocks */ +@@ -578,6 +593,14 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder) + VEC_WRITE(VEC_DAC_MISC, + VEC_DAC_MISC_VID_ACT | VEC_DAC_MISC_DAC_RST_N); + VEC_WRITE(VEC_CFG, VEC_CFG_VEC_EN); ++ ++ drm_dev_exit(idx); ++ return; ++ ++err_put_runtime_pm: ++ pm_runtime_put(&vec->pdev->dev); ++err_dev_exit: ++ drm_dev_exit(idx); + } + + static int vc4_vec_encoder_atomic_check(struct drm_encoder *encoder, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Fri, 10 Jun 2022 10:51:26 +0200 +Subject: [PATCH 1143/1183] drm/vc4: vec: Switch to devm_pm_runtime_enable + +devm_pm_runtime_enable() simplifies the driver a bit since it will call +pm_runtime_disable() automatically through a device-managed action. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_vec.c | 20 +++++--------------- + 1 file changed, 5 insertions(+), 15 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c +index 31033ba9d728..673c67942d20 100644 +--- a/drivers/gpu/drm/vc4/vc4_vec.c ++++ b/drivers/gpu/drm/vc4/vc4_vec.c +@@ -740,42 +740,32 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + return ret; + } + +- pm_runtime_enable(dev); ++ ret = devm_pm_runtime_enable(dev); ++ if (ret) ++ return ret; + + ret = drmm_encoder_init(drm, &vec->encoder.base, + NULL, + DRM_MODE_ENCODER_TVDAC, + NULL); + if (ret) +- goto err_put_runtime_pm; ++ return ret; + + drm_encoder_helper_add(&vec->encoder.base, &vc4_vec_encoder_helper_funcs); + + ret = vc4_vec_connector_init(drm, vec); + if (ret) +- goto err_put_runtime_pm; ++ return ret; + + dev_set_drvdata(dev, vec); + + vc4_debugfs_add_regset32(drm, "vec_regs", &vec->regset); + + return 0; +- +-err_put_runtime_pm: +- pm_runtime_disable(dev); +- +- return ret; +-} +- +-static void vc4_vec_unbind(struct device *dev, struct device *master, +- void *data) +-{ +- pm_runtime_disable(dev); + } + + static const struct component_ops vc4_vec_ops = { + .bind = vc4_vec_bind, +- .unbind = vc4_vec_unbind, + }; + + static int vc4_vec_dev_probe(struct platform_device *pdev) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 11 May 2022 16:26:30 +0200 +Subject: [PATCH 1144/1183] drm/vc4: debugfs: Protect device resources + +Our current code now mixes some resources whose lifetime are tied to the +device (clocks, IO mappings, etc.) and some that are tied to the DRM device +(encoder, bridge). + +The device one will be freed at unbind time, but the DRM one will only be +freed when the last user of the DRM device closes its file handle. + +So we end up with a time window during which we can call the encoder hooks, +but we don't have access to the underlying resources and device. + +Let's protect all those sections with drm_dev_enter() and drm_dev_exit() so +that we bail out if we are during that window. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_debugfs.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_debugfs.c b/drivers/gpu/drm/vc4/vc4_debugfs.c +index 2936a7e333a9..75679cde4a4d 100644 +--- a/drivers/gpu/drm/vc4/vc4_debugfs.c ++++ b/drivers/gpu/drm/vc4/vc4_debugfs.c +@@ -3,6 +3,8 @@ + * Copyright © 2014 Broadcom + */ + ++#include ++ + #include + #include + #include +@@ -41,11 +43,18 @@ vc4_debugfs_init(struct drm_minor *minor) + static int vc4_debugfs_regset32(struct seq_file *m, void *unused) + { + struct drm_info_node *node = (struct drm_info_node *)m->private; ++ struct drm_device *drm = node->minor->dev; + struct debugfs_regset32 *regset = node->info_ent->data; + struct drm_printer p = drm_seq_file_printer(m); ++ int idx; ++ ++ if (!drm_dev_enter(drm, &idx)) ++ return -ENODEV; + + drm_print_regset32(&p, regset); + ++ drm_dev_exit(idx); ++ + return 0; + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 25 May 2022 17:21:41 +0200 +Subject: [PATCH 1145/1183] drm/vc4: debugfs: Return an error on failure + +vc4_debugfs_add_file() can fail, so let's propagate its error code instead +of silencing it. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_debugfs.c | 20 +++++++++++--------- + drivers/gpu/drm/vc4/vc4_drv.h | 30 ++++++++++++++++-------------- + 2 files changed, 27 insertions(+), 23 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_debugfs.c b/drivers/gpu/drm/vc4/vc4_debugfs.c +index 75679cde4a4d..eb7313e53016 100644 +--- a/drivers/gpu/drm/vc4/vc4_debugfs.c ++++ b/drivers/gpu/drm/vc4/vc4_debugfs.c +@@ -67,10 +67,10 @@ static int vc4_debugfs_regset32(struct seq_file *m, void *unused) + * track the request and delay it to be called on each minor during + * vc4_debugfs_init(). + */ +-void vc4_debugfs_add_file(struct drm_device *dev, +- const char *name, +- int (*show)(struct seq_file*, void*), +- void *data) ++int vc4_debugfs_add_file(struct drm_device *dev, ++ const char *name, ++ int (*show)(struct seq_file*, void*), ++ void *data) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); + +@@ -78,18 +78,20 @@ void vc4_debugfs_add_file(struct drm_device *dev, + devm_kzalloc(dev->dev, sizeof(*entry), GFP_KERNEL); + + if (!entry) +- return; ++ return -ENOMEM; + + entry->info.name = name; + entry->info.show = show; + entry->info.data = data; + + list_add(&entry->link, &vc4->debugfs_list); ++ ++ return 0; + } + +-void vc4_debugfs_add_regset32(struct drm_device *drm, +- const char *name, +- struct debugfs_regset32 *regset) ++int vc4_debugfs_add_regset32(struct drm_device *drm, ++ const char *name, ++ struct debugfs_regset32 *regset) + { +- vc4_debugfs_add_file(drm, name, vc4_debugfs_regset32, regset); ++ return vc4_debugfs_add_file(drm, name, vc4_debugfs_regset32, regset); + } +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index eb7f25ab5dca..cafc57f8afea 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -903,25 +903,27 @@ void vc4_crtc_get_margins(struct drm_crtc_state *state, + /* vc4_debugfs.c */ + void vc4_debugfs_init(struct drm_minor *minor); + #ifdef CONFIG_DEBUG_FS +-void vc4_debugfs_add_file(struct drm_device *drm, +- const char *filename, +- int (*show)(struct seq_file*, void*), +- void *data); +-void vc4_debugfs_add_regset32(struct drm_device *drm, +- const char *filename, +- struct debugfs_regset32 *regset); ++int vc4_debugfs_add_file(struct drm_device *drm, ++ const char *filename, ++ int (*show)(struct seq_file*, void*), ++ void *data); ++int vc4_debugfs_add_regset32(struct drm_device *drm, ++ const char *filename, ++ struct debugfs_regset32 *regset); + #else +-static inline void vc4_debugfs_add_file(struct drm_device *drm, +- const char *filename, +- int (*show)(struct seq_file*, void*), +- void *data) ++static inline int vc4_debugfs_add_file(struct drm_device *drm, ++ const char *filename, ++ int (*show)(struct seq_file*, void*), ++ void *data) + { ++ return 0; + } + +-static inline void vc4_debugfs_add_regset32(struct drm_device *drm, +- const char *filename, +- struct debugfs_regset32 *regset) ++static inline int vc4_debugfs_add_regset32(struct drm_device *drm, ++ const char *filename, ++ struct debugfs_regset32 *regset) + { ++ return 0; + } + #endif + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 6 Jun 2022 16:37:53 +0200 +Subject: [PATCH 1146/1183] drm/vc4: debugfs: Simplify debugfs registration + +The vc4 has a custom API to allow components to register a debugfs file +before the DRM driver has been registered and the debugfs_init hook has +been called. + +However, the .late_register hook allows to have the debugfs file creation +deferred after that time already. + +Let's remove our custom code to only register later our debugfs entries as +part of either debugfs_init or after it. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_bo.c | 20 ++++++++++-- + drivers/gpu/drm/vc4/vc4_crtc.c | 19 ++++++++++-- + drivers/gpu/drm/vc4/vc4_debugfs.c | 51 +++++++++++-------------------- + drivers/gpu/drm/vc4/vc4_dpi.c | 21 +++++++++++-- + drivers/gpu/drm/vc4/vc4_drv.h | 12 +++++--- + drivers/gpu/drm/vc4/vc4_dsi.c | 22 +++++++++++-- + drivers/gpu/drm/vc4/vc4_hdmi.c | 26 +++++++++++++--- + drivers/gpu/drm/vc4/vc4_hvs.c | 46 ++++++++++++++++++++++------ + drivers/gpu/drm/vc4/vc4_txp.c | 3 +- + drivers/gpu/drm/vc4/vc4_v3d.c | 25 +++++++++++++-- + drivers/gpu/drm/vc4/vc4_vec.c | 22 +++++++++++-- + 11 files changed, 195 insertions(+), 72 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c +index 90633e15ab92..68311f4e8947 100644 +--- a/drivers/gpu/drm/vc4/vc4_bo.c ++++ b/drivers/gpu/drm/vc4/vc4_bo.c +@@ -990,6 +990,23 @@ int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, + return 0; + } + ++int vc4_bo_debugfs_init(struct drm_minor *minor) ++{ ++ struct drm_device *drm = minor->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ int ret; ++ ++ if (!vc4->v3d) ++ return -ENODEV; ++ ++ ret = vc4_debugfs_add_file(minor, "bo_stats", ++ vc4_bo_stats_debugfs, NULL); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ + static void vc4_bo_cache_destroy(struct drm_device *dev, void *unused); + int vc4_bo_cache_init(struct drm_device *dev) + { +@@ -1014,9 +1031,6 @@ int vc4_bo_cache_init(struct drm_device *dev) + vc4->bo_labels[i].name = bo_type_names[i]; + + mutex_init(&vc4->bo_lock); +- +- vc4_debugfs_add_file(dev, "bo_stats", vc4_bo_stats_debugfs, NULL); +- + INIT_LIST_HEAD(&vc4->bo_cache.time_list); + + INIT_WORK(&vc4->bo_cache.time_work, vc4_bo_cache_time_work); +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 5bc7eae9ab06..fb2e15cc78ef 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -1081,6 +1081,21 @@ void vc4_crtc_reset(struct drm_crtc *crtc) + __drm_atomic_helper_crtc_reset(crtc, &vc4_crtc_state->base); + } + ++int vc4_crtc_late_register(struct drm_crtc *crtc) ++{ ++ struct drm_device *drm = crtc->dev; ++ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); ++ const struct vc4_crtc_data *crtc_data = vc4_crtc_to_vc4_crtc_data(vc4_crtc); ++ int ret; ++ ++ ret = vc4_debugfs_add_regset32(drm->primary, crtc_data->debugfs_name, ++ &vc4_crtc->regset); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ + static const struct drm_crtc_funcs vc4_crtc_funcs = { + .set_config = drm_atomic_helper_set_config, + .page_flip = vc4_page_flip, +@@ -1093,6 +1108,7 @@ static const struct drm_crtc_funcs vc4_crtc_funcs = { + .enable_vblank = vc4_enable_vblank, + .disable_vblank = vc4_disable_vblank, + .get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp, ++ .late_register = vc4_crtc_late_register, + }; + + static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = { +@@ -1364,9 +1380,6 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data) + + platform_set_drvdata(pdev, vc4_crtc); + +- vc4_debugfs_add_regset32(drm, pv_data->base.debugfs_name, +- &vc4_crtc->regset); +- + return 0; + } + +diff --git a/drivers/gpu/drm/vc4/vc4_debugfs.c b/drivers/gpu/drm/vc4/vc4_debugfs.c +index eb7313e53016..19cda4f91a82 100644 +--- a/drivers/gpu/drm/vc4/vc4_debugfs.c ++++ b/drivers/gpu/drm/vc4/vc4_debugfs.c +@@ -14,11 +14,6 @@ + #include "vc4_drv.h" + #include "vc4_regs.h" + +-struct vc4_debugfs_info_entry { +- struct list_head link; +- struct drm_info_list info; +-}; +- + /* + * Called at drm_dev_register() time on each of the minors registered + * by the DRM device, to attach the debugfs files. +@@ -27,16 +22,13 @@ void + vc4_debugfs_init(struct drm_minor *minor) + { + struct vc4_dev *vc4 = to_vc4_dev(minor->dev); +- struct vc4_debugfs_info_entry *entry; ++ struct drm_device *drm = &vc4->base; + +- if (vc4->hvs && !of_device_is_compatible(vc4->hvs->pdev->dev.of_node, +- "brcm,bcm2711-vc5")) +- debugfs_create_bool("hvs_load_tracker", S_IRUGO | S_IWUSR, +- minor->debugfs_root, &vc4->load_tracker_enabled); ++ drm_WARN_ON(drm, vc4_hvs_debugfs_init(minor)); + +- list_for_each_entry(entry, &vc4->debugfs_list, link) { +- drm_debugfs_create_files(&entry->info, 1, +- minor->debugfs_root, minor); ++ if (vc4->v3d) { ++ drm_WARN_ON(drm, vc4_bo_debugfs_init(minor)); ++ drm_WARN_ON(drm, vc4_v3d_debugfs_init(minor)); + } + } + +@@ -58,40 +50,31 @@ static int vc4_debugfs_regset32(struct seq_file *m, void *unused) + return 0; + } + +-/* +- * Registers a debugfs file with a callback function for a vc4 component. +- * +- * This is like drm_debugfs_create_files(), but that can only be +- * called a given DRM minor, while the various VC4 components want to +- * register their debugfs files during the component bind process. We +- * track the request and delay it to be called on each minor during +- * vc4_debugfs_init(). +- */ +-int vc4_debugfs_add_file(struct drm_device *dev, ++int vc4_debugfs_add_file(struct drm_minor *minor, + const char *name, + int (*show)(struct seq_file*, void*), + void *data) + { +- struct vc4_dev *vc4 = to_vc4_dev(dev); +- +- struct vc4_debugfs_info_entry *entry = +- devm_kzalloc(dev->dev, sizeof(*entry), GFP_KERNEL); ++ struct drm_device *dev = minor->dev; ++ struct dentry *root = minor->debugfs_root; ++ struct drm_info_list *file; + +- if (!entry) ++ file = drmm_kzalloc(dev, sizeof(*file), GFP_KERNEL); ++ if (!file) + return -ENOMEM; + +- entry->info.name = name; +- entry->info.show = show; +- entry->info.data = data; ++ file->name = name; ++ file->show = show; ++ file->data = data; + +- list_add(&entry->link, &vc4->debugfs_list); ++ drm_debugfs_create_files(file, 1, root, minor); + + return 0; + } + +-int vc4_debugfs_add_regset32(struct drm_device *drm, ++int vc4_debugfs_add_regset32(struct drm_minor *minor, + const char *name, + struct debugfs_regset32 *regset) + { +- return vc4_debugfs_add_file(drm, name, vc4_debugfs_regset32, regset); ++ return vc4_debugfs_add_file(minor, name, vc4_debugfs_regset32, regset); + } +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index 546d36bdacdf..925b7d4a6b66 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -263,6 +263,23 @@ static const struct drm_encoder_helper_funcs vc4_dpi_encoder_helper_funcs = { + .mode_valid = vc4_dpi_encoder_mode_valid, + }; + ++static int vc4_dpi_late_register(struct drm_encoder *encoder) ++{ ++ struct drm_device *drm = encoder->dev; ++ struct vc4_dpi *dpi = to_vc4_dpi(encoder); ++ int ret; ++ ++ ret = vc4_debugfs_add_regset32(drm->primary, "dpi_regs", &dpi->regset); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ ++static const struct drm_encoder_funcs vc4_dpi_encoder_funcs = { ++ .late_register = vc4_dpi_late_register, ++}; ++ + static const struct of_device_id vc4_dpi_dt_match[] = { + { .compatible = "brcm,bcm2835-dpi", .data = NULL }, + {} +@@ -351,7 +368,7 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + return ret; + + ret = drmm_encoder_init(drm, &dpi->encoder.base, +- NULL, ++ &vc4_dpi_encoder_funcs, + DRM_MODE_ENCODER_DPI, + NULL); + if (ret) +@@ -365,8 +382,6 @@ static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) + + dev_set_drvdata(dev, dpi); + +- vc4_debugfs_add_regset32(drm, "dpi_regs", &dpi->regset); +- + return 0; + } + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index cafc57f8afea..7594ab6ca036 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -878,6 +878,7 @@ int vc4_bo_inc_usecnt(struct vc4_bo *bo); + void vc4_bo_dec_usecnt(struct vc4_bo *bo); + void vc4_bo_add_to_purgeable_pool(struct vc4_bo *bo); + void vc4_bo_remove_from_purgeable_pool(struct vc4_bo *bo); ++int vc4_bo_debugfs_init(struct drm_minor *minor); + + /* vc4_crtc.c */ + extern struct platform_driver vc4_crtc_driver; +@@ -895,6 +896,7 @@ void vc4_crtc_destroy_state(struct drm_crtc *crtc, + struct drm_crtc_state *state); + void vc4_crtc_reset(struct drm_crtc *crtc); + void vc4_crtc_handle_vblank(struct vc4_crtc *crtc); ++int vc4_crtc_late_register(struct drm_crtc *crtc); + void vc4_crtc_send_vblank(struct drm_crtc *crtc); + void vc4_crtc_get_margins(struct drm_crtc_state *state, + unsigned int *left, unsigned int *right, +@@ -903,15 +905,15 @@ void vc4_crtc_get_margins(struct drm_crtc_state *state, + /* vc4_debugfs.c */ + void vc4_debugfs_init(struct drm_minor *minor); + #ifdef CONFIG_DEBUG_FS +-int vc4_debugfs_add_file(struct drm_device *drm, ++int vc4_debugfs_add_file(struct drm_minor *minor, + const char *filename, + int (*show)(struct seq_file*, void*), + void *data); +-int vc4_debugfs_add_regset32(struct drm_device *drm, ++int vc4_debugfs_add_regset32(struct drm_minor *minor, + const char *filename, + struct debugfs_regset32 *regset); + #else +-static inline int vc4_debugfs_add_file(struct drm_device *drm, ++static inline int vc4_debugfs_add_file(struct drm_minor *minor, + const char *filename, + int (*show)(struct seq_file*, void*), + void *data) +@@ -919,7 +921,7 @@ static inline int vc4_debugfs_add_file(struct drm_device *drm, + return 0; + } + +-static inline int vc4_debugfs_add_regset32(struct drm_device *drm, ++static inline int vc4_debugfs_add_regset32(struct drm_minor *minor, + const char *filename, + struct debugfs_regset32 *regset) + { +@@ -992,6 +994,7 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) + void vc4_hvs_dump_state(struct vc4_hvs *hvs); + void vc4_hvs_unmask_underrun(struct vc4_hvs *hvs, int channel); + void vc4_hvs_mask_underrun(struct vc4_hvs *hvs, int channel); ++int vc4_hvs_debugfs_init(struct drm_minor *minor); + + /* vc4_kms.c */ + int vc4_kms_load(struct drm_device *dev); +@@ -1014,6 +1017,7 @@ int vc4_v3d_bin_bo_get(struct vc4_dev *vc4, bool *used); + void vc4_v3d_bin_bo_put(struct vc4_dev *vc4); + int vc4_v3d_pm_get(struct vc4_dev *vc4); + void vc4_v3d_pm_put(struct vc4_dev *vc4); ++int vc4_v3d_debugfs_init(struct drm_minor *minor); + + /* vc4_validate.c */ + int +diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c +index 565ee9ba41f3..a10e96aba197 100644 +--- a/drivers/gpu/drm/vc4/vc4_dsi.c ++++ b/drivers/gpu/drm/vc4/vc4_dsi.c +@@ -1416,6 +1416,24 @@ static const struct drm_bridge_funcs vc4_dsi_bridge_funcs = { + .mode_fixup = vc4_dsi_bridge_mode_fixup, + }; + ++static int vc4_dsi_late_register(struct drm_encoder *encoder) ++{ ++ struct drm_device *drm = encoder->dev; ++ struct vc4_dsi *dsi = to_vc4_dsi(encoder); ++ int ret; ++ ++ ret = vc4_debugfs_add_regset32(drm->primary, dsi->variant->debugfs_name, ++ &dsi->regset); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ ++static const struct drm_encoder_funcs vc4_dsi_encoder_funcs = { ++ .late_register = vc4_dsi_late_register, ++}; ++ + static const struct vc4_dsi_variant bcm2711_dsi1_variant = { + .port = 1, + .debugfs_name = "dsi1_regs", +@@ -1765,7 +1783,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + return ret; + + ret = drmm_encoder_init(drm, encoder, +- NULL, ++ &vc4_dsi_encoder_funcs, + DRM_MODE_ENCODER_DSI, + NULL); + if (ret) +@@ -1781,8 +1799,6 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + goto err_free_dma; + } + +- vc4_debugfs_add_regset32(drm, dsi->variant->debugfs_name, &dsi->regset); +- + return 0; + } + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 6f41b109db8e..da1c5d3f4c91 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -2064,6 +2064,26 @@ static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { + .mode_valid = vc4_hdmi_encoder_mode_valid, + }; + ++static int vc4_hdmi_late_register(struct drm_encoder *encoder) ++{ ++ struct drm_device *drm = encoder->dev; ++ struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); ++ const struct vc4_hdmi_variant *variant = vc4_hdmi->variant; ++ int ret; ++ ++ ret = vc4_debugfs_add_file(drm->primary, variant->debugfs_name, ++ vc4_hdmi_debugfs_regs, ++ vc4_hdmi); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ ++static const struct drm_encoder_funcs vc4_hdmi_encoder_funcs = { ++ .late_register = vc4_hdmi_late_register, ++}; ++ + static u32 vc4_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask) + { + int i; +@@ -3568,7 +3588,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + } + + ret = drmm_encoder_init(drm, encoder, +- NULL, ++ &vc4_hdmi_encoder_funcs, + DRM_MODE_ENCODER_TMDS, + NULL); + if (ret) +@@ -3592,10 +3612,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + if (ret) + goto err_put_runtime_pm; + +- vc4_debugfs_add_file(drm, variant->debugfs_name, +- vc4_hdmi_debugfs_regs, +- vc4_hdmi); +- + pm_runtime_put_sync(dev); + + return 0; +diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c +index aa06751f5586..cc1f81ec56bc 100644 +--- a/drivers/gpu/drm/vc4/vc4_hvs.c ++++ b/drivers/gpu/drm/vc4/vc4_hvs.c +@@ -968,6 +968,43 @@ static irqreturn_t vc4_hvs_irq_handler(int irq, void *data) + return irqret; + } + ++int vc4_hvs_debugfs_init(struct drm_minor *minor) ++{ ++ struct drm_device *drm = minor->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ struct vc4_hvs *hvs = vc4->hvs; ++ int ret; ++ ++ if (!vc4->hvs) ++ return -ENODEV; ++ ++ if (!vc4->is_vc5) ++ debugfs_create_bool("hvs_load_tracker", S_IRUGO | S_IWUSR, ++ minor->debugfs_root, ++ &vc4->load_tracker_enabled); ++ ++ if (vc4->is_vc5) ++ vc4_debugfs_add_file(minor, "hvs_gamma", ++ vc5_hvs_debugfs_gamma, NULL); ++ ++ ret = vc4_debugfs_add_file(minor, "hvs_underrun", ++ vc4_hvs_debugfs_underrun, NULL); ++ if (ret) ++ return ret; ++ ++ ret = vc4_debugfs_add_regset32(minor, "hvs_regs", ++ &hvs->regset); ++ if (ret) ++ return ret; ++ ++ ret = vc4_debugfs_add_file(minor, "hvs_dlists", ++ vc4_hvs_debugfs_dlist, NULL); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ + static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) + { + struct platform_device *pdev = to_platform_device(dev); +@@ -1184,15 +1221,6 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) + if (ret) + return ret; + +- vc4_debugfs_add_regset32(drm, "hvs_regs", &hvs->regset); +- vc4_debugfs_add_file(drm, "hvs_underrun", vc4_hvs_debugfs_underrun, +- NULL); +- vc4_debugfs_add_file(drm, "hvs_dlists", vc4_hvs_debugfs_dlist, +- NULL); +- if (vc4->is_vc5) +- vc4_debugfs_add_file(drm, "hvs_gamma", vc5_hvs_debugfs_gamma, +- NULL); +- + return 0; + } + +diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c +index 1a26d6bf4868..d8121d269131 100644 +--- a/drivers/gpu/drm/vc4/vc4_txp.c ++++ b/drivers/gpu/drm/vc4/vc4_txp.c +@@ -397,6 +397,7 @@ static const struct drm_crtc_funcs vc4_txp_crtc_funcs = { + .atomic_destroy_state = vc4_crtc_destroy_state, + .enable_vblank = vc4_txp_enable_vblank, + .disable_vblank = vc4_txp_disable_vblank, ++ .late_register = vc4_crtc_late_register, + }; + + static int vc4_txp_atomic_check(struct drm_crtc *crtc, +@@ -539,8 +540,6 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) + + dev_set_drvdata(dev, txp); + +- vc4_debugfs_add_regset32(drm, "txp_regs", &vc4_crtc->regset); +- + return 0; + } + +diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c +index cc714dcfe1f2..e7990bed0a96 100644 +--- a/drivers/gpu/drm/vc4/vc4_v3d.c ++++ b/drivers/gpu/drm/vc4/vc4_v3d.c +@@ -401,6 +401,28 @@ static int vc4_v3d_runtime_resume(struct device *dev) + } + #endif + ++int vc4_v3d_debugfs_init(struct drm_minor *minor) ++{ ++ struct drm_device *drm = minor->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ struct vc4_v3d *v3d = vc4->v3d; ++ int ret; ++ ++ if (!vc4->v3d) ++ return -ENODEV; ++ ++ ret = vc4_debugfs_add_file(minor, "v3d_ident", ++ vc4_v3d_debugfs_ident, NULL); ++ if (ret) ++ return ret; ++ ++ ret = vc4_debugfs_add_regset32(minor, "v3d_regs", &v3d->regset); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ + static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + { + struct platform_device *pdev = to_platform_device(dev); +@@ -477,9 +499,6 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + pm_runtime_set_autosuspend_delay(dev, 40); /* a little over 2 frames. */ + pm_runtime_enable(dev); + +- vc4_debugfs_add_file(drm, "v3d_ident", vc4_v3d_debugfs_ident, NULL); +- vc4_debugfs_add_regset32(drm, "v3d_regs", &v3d->regset); +- + return 0; + } + +diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c +index 673c67942d20..d02ed3e1aa3e 100644 +--- a/drivers/gpu/drm/vc4/vc4_vec.c ++++ b/drivers/gpu/drm/vc4/vc4_vec.c +@@ -687,6 +687,24 @@ static const struct drm_encoder_helper_funcs vc4_vec_encoder_helper_funcs = { + .atomic_check = vc4_vec_encoder_atomic_check, + }; + ++static int vc4_vec_late_register(struct drm_encoder *encoder) ++{ ++ struct drm_device *drm = encoder->dev; ++ struct vc4_vec *vec = encoder_to_vc4_vec(encoder); ++ int ret; ++ ++ ret = vc4_debugfs_add_regset32(drm->primary, "vec_regs", ++ &vec->regset); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ ++static const struct drm_encoder_funcs vc4_vec_encoder_funcs = { ++ .late_register = vc4_vec_late_register, ++}; ++ + static const struct vc4_vec_variant bcm2835_vec_variant = { + .dac_config = VEC_DAC_CONFIG_DAC_CTRL(0xc) | + VEC_DAC_CONFIG_DRIVER_CTRL(0xc) | +@@ -745,7 +763,7 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + return ret; + + ret = drmm_encoder_init(drm, &vec->encoder.base, +- NULL, ++ &vc4_vec_encoder_funcs, + DRM_MODE_ENCODER_TVDAC, + NULL); + if (ret) +@@ -759,8 +777,6 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) + + dev_set_drvdata(dev, vec); + +- vc4_debugfs_add_regset32(drm, "vec_regs", &vec->regset); +- + return 0; + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 11 Jul 2022 10:38:25 +0200 +Subject: [PATCH 1147/1183] drm/vc4: hvs: Skip DebugFS Registration for FKMS + +FKMS doesn't have an HVS and it's expected. Return from the debugfs init +function immediately if we're running with fkms. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hvs.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c +index cc1f81ec56bc..98e5637861fc 100644 +--- a/drivers/gpu/drm/vc4/vc4_hvs.c ++++ b/drivers/gpu/drm/vc4/vc4_hvs.c +@@ -975,6 +975,9 @@ int vc4_hvs_debugfs_init(struct drm_minor *minor) + struct vc4_hvs *hvs = vc4->hvs; + int ret; + ++ if (vc4->firmware_kms) ++ return 0; ++ + if (!vc4->hvs) + return -ENODEV; + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 6 Jun 2022 16:40:47 +0200 +Subject: [PATCH 1148/1183] drm/vc4: Switch to drmm_mutex_init + +mutex_init is supposed to be balanced by a call to mutex_destroy that we +were never doing in the vc4 driver. + +Since a DRM-managed mutex_init variant has been introduced, let's just +switch to it. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_bo.c | 15 +++++++++++++-- + drivers/gpu/drm/vc4/vc4_drv.c | 4 +++- + drivers/gpu/drm/vc4/vc4_gem.c | 10 ++++++++-- + drivers/gpu/drm/vc4/vc4_hdmi.c | 5 ++++- + 4 files changed, 28 insertions(+), 6 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c +index 68311f4e8947..719577bafb94 100644 +--- a/drivers/gpu/drm/vc4/vc4_bo.c ++++ b/drivers/gpu/drm/vc4/vc4_bo.c +@@ -394,6 +394,7 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); + struct vc4_bo *bo; ++ int ret; + + if (WARN_ON_ONCE(vc4->is_vc5)) + return ERR_PTR(-ENODEV); +@@ -404,7 +405,11 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size) + + bo->madv = VC4_MADV_WILLNEED; + refcount_set(&bo->usecnt, 0); +- mutex_init(&bo->madv_lock); ++ ++ ret = drmm_mutex_init(dev, &bo->madv_lock); ++ if (ret) ++ return ERR_PTR(ret); ++ + mutex_lock(&vc4->bo_lock); + bo->label = VC4_BO_TYPE_KERNEL; + vc4->bo_labels[VC4_BO_TYPE_KERNEL].num_allocated++; +@@ -1011,6 +1016,7 @@ static void vc4_bo_cache_destroy(struct drm_device *dev, void *unused); + int vc4_bo_cache_init(struct drm_device *dev) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); ++ int ret; + int i; + + if (WARN_ON_ONCE(vc4->is_vc5)) +@@ -1030,7 +1036,12 @@ int vc4_bo_cache_init(struct drm_device *dev) + for (i = 0; i < VC4_BO_TYPE_COUNT; i++) + vc4->bo_labels[i].name = bo_type_names[i]; + +- mutex_init(&vc4->bo_lock); ++ ret = drmm_mutex_init(dev, &vc4->bo_lock); ++ if (ret) { ++ kfree(vc4->bo_labels); ++ return ret; ++ } ++ + INIT_LIST_HEAD(&vc4->bo_cache.time_list); + + INIT_WORK(&vc4->bo_cache.time_work, vc4_bo_cache_time_work); +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index e094237d5f9a..87369110ce0b 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -344,7 +344,9 @@ static int vc4_drm_bind(struct device *dev) + INIT_LIST_HEAD(&vc4->debugfs_list); + + if (!is_vc5) { +- mutex_init(&vc4->bin_bo_lock); ++ ret = drmm_mutex_init(drm, &vc4->bin_bo_lock); ++ if (ret) ++ return ret; + + ret = vc4_bo_cache_init(drm); + if (ret) +diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c +index f8443501edf6..26896b76ed30 100644 +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -1299,6 +1299,7 @@ static void vc4_gem_destroy(struct drm_device *dev, void *unused); + int vc4_gem_init(struct drm_device *dev) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); ++ int ret; + + if (WARN_ON_ONCE(vc4->is_vc5)) + return -ENODEV; +@@ -1316,10 +1317,15 @@ int vc4_gem_init(struct drm_device *dev) + + INIT_WORK(&vc4->job_done_work, vc4_job_done_work); + +- mutex_init(&vc4->power_lock); ++ ret = drmm_mutex_init(dev, &vc4->power_lock); ++ if (ret) ++ return ret; + + INIT_LIST_HEAD(&vc4->purgeable.list); +- mutex_init(&vc4->purgeable.lock); ++ ++ ret = drmm_mutex_init(dev, &vc4->purgeable.lock); ++ if (ret) ++ return ret; + + return drmm_add_action_or_reset(dev, vc4_gem_destroy, NULL); + } +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index da1c5d3f4c91..d36883e2f84a 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -3494,7 +3494,10 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + if (!vc4_hdmi) + return -ENOMEM; + +- mutex_init(&vc4_hdmi->mutex); ++ ret = drmm_mutex_init(drm, &vc4_hdmi->mutex); ++ if (ret) ++ return ret; ++ + spin_lock_init(&vc4_hdmi->hw_lock); + INIT_DELAYED_WORK(&vc4_hdmi->scrambling_work, vc4_hdmi_scrambling_wq); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 6 Jun 2022 16:41:53 +0200 +Subject: [PATCH 1149/1183] drm/vc4: perfmon: Add missing mutex_destroy + +vc4_perfmon_open_file() will instantiate a mutex for that file instance, +but we never call mutex_destroy () in vc4_perfmon_close_file(). + +Let's add that missing call. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_perfmon.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_perfmon.c b/drivers/gpu/drm/vc4/vc4_perfmon.c +index c7f5adb6bcf8..da2d2cee5da2 100644 +--- a/drivers/gpu/drm/vc4/vc4_perfmon.c ++++ b/drivers/gpu/drm/vc4/vc4_perfmon.c +@@ -130,6 +130,7 @@ void vc4_perfmon_close_file(struct vc4_file *vc4file) + idr_for_each(&vc4file->perfmon.idr, vc4_perfmon_idr_del, NULL); + idr_destroy(&vc4file->perfmon.idr); + mutex_unlock(&vc4file->perfmon.lock); ++ mutex_destroy(&vc4file->perfmon.lock); + } + + int vc4_perfmon_create_ioctl(struct drm_device *dev, void *data, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 9 Jun 2022 17:53:30 +0200 +Subject: [PATCH 1150/1183] drm/vc4: v3d: Stop disabling interrupts + +The vc4_irq_disable(), among other things, will call disable_irq() to +complete any in-flight interrupts. + +This requires its counterpart, vc4_irq_enable(), to call enable_irq() which +causes issues addressed in a later patch. + +However, vc4_irq_disable() is called by two callees: vc4_irq_uninstall() +and vc4_v3d_runtime_suspend(). + +vc4_irq_uninstall() also calls free_irq() which already disables the +interrupt line. We thus don't require an explicit disable_irq() for that +call site. + +vc4_v3d_runtime_suspend() doesn't have any other code. However, the rest of +vc4_irq_disable() masks the interrupts coming from the v3d, so explictly +disabling the interrupt line is also redundant. + +The only thing we really care about is thus to make sure we don't have any +handler in-flight, as suggested by the comment. We can thus replace +disable_irq() by synchronize_irq(). + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_irq.c | 2 +- + drivers/gpu/drm/vc4/vc4_v3d.c | 2 -- + 2 files changed, 1 insertion(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_irq.c b/drivers/gpu/drm/vc4/vc4_irq.c +index 6001a7a0e186..73add6a914b1 100644 +--- a/drivers/gpu/drm/vc4/vc4_irq.c ++++ b/drivers/gpu/drm/vc4/vc4_irq.c +@@ -290,7 +290,7 @@ vc4_irq_disable(struct drm_device *dev) + V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS); + + /* Finish any interrupt handler still in flight. */ +- disable_irq(vc4->irq); ++ synchronize_irq(vc4->irq); + + cancel_work_sync(&vc4->overflow_mem_work); + } +diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c +index e7990bed0a96..a2da0db73a5c 100644 +--- a/drivers/gpu/drm/vc4/vc4_v3d.c ++++ b/drivers/gpu/drm/vc4/vc4_v3d.c +@@ -393,8 +393,6 @@ static int vc4_v3d_runtime_resume(struct device *dev) + + vc4_v3d_init_hw(&vc4->base); + +- /* We disabled the IRQ as part of vc4_irq_uninstall in suspend. */ +- enable_irq(vc4->irq); + vc4_irq_enable(&vc4->base); + + return 0; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Fri, 10 Jun 2022 10:00:50 +0200 +Subject: [PATCH 1151/1183] drm/vc4: v3d: Rework the runtime_pm setup + +At bind time, vc4_v3d_bind() will read a register to retrieve the v3d +version and make sure it's a version we're compatible with. + +However, the v3d has an optional clock that is enabled only after the +register read-out and a power domain that wasn't enabled at all in the bind +implementation. This was working fine at boot because both were enabled, +but resulted in the version check failing if we were unbinding and +rebinding the driver because the unbinding would have turned them off. + +The fix isn't as easy as calling pm_runtime_resume_and_get() prior to the +register access to power up the power domain though. + +Indeed, the runtime_resume implementation will enable the clock mentioned +above, call vc4_v3d_init_hw() and then vc4_irq_enable(). + +Prior to the previous patch, vc4_irq_enable() needed to occur after our +call to platform_get_irq() and vc4_irq_install(), since vc4_irq_enable() +used to call enable_irq() and vc4_irq_install() will call request_irq(). + +vc4_irq_install() will also do some register access, so needs the power +domain to be on. So we ended up in a situation where +vc4_v3d_runtime_resume() needed vc4_irq_install() to have been called +before, and vc4_irq_install() needed vc4_v3d_runtime_resume(). + +The previous patch removed the enable_irq() call in vc4_irq_enable() and +thus removed the dependency of vc4_v3d_runtime_resume() on +vc4_irq_install(). + +Thus, we can now rework our bind implementation to call +pm_runtime_resume_and_get() before our register access to make sure the +power domain is on. vc4_v3d_runtime_resume() also takes care of turning the +clock on and calling vc4_v3d_init_hw() so we can remove them from bind. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_v3d.c | 37 +++++++++++++++++++++-------------- + 1 file changed, 22 insertions(+), 15 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c +index a2da0db73a5c..d82c86865079 100644 +--- a/drivers/gpu/drm/vc4/vc4_v3d.c ++++ b/drivers/gpu/drm/vc4/vc4_v3d.c +@@ -463,41 +463,48 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + } + } + ++ ret = platform_get_irq(pdev, 0); ++ if (ret < 0) ++ return ret; ++ vc4->irq = ret; ++ ++ pm_runtime_enable(dev); ++ ++ ret = pm_runtime_resume_and_get(dev); ++ if (ret) ++ goto err_disable_runtime_pm; ++ + if (V3D_READ(V3D_IDENT0) != V3D_EXPECTED_IDENT0) { + DRM_ERROR("V3D_IDENT0 read 0x%08x instead of 0x%08x\n", + V3D_READ(V3D_IDENT0), V3D_EXPECTED_IDENT0); +- return -EINVAL; ++ ret = -EINVAL; ++ goto err_put_runtime_pm; + } + +- ret = clk_prepare_enable(v3d->clk); +- if (ret != 0) +- return ret; +- + /* Reset the binner overflow address/size at setup, to be sure + * we don't reuse an old one. + */ + V3D_WRITE(V3D_BPOA, 0); + V3D_WRITE(V3D_BPOS, 0); + +- vc4_v3d_init_hw(drm); +- +- ret = platform_get_irq(pdev, 0); +- if (ret < 0) +- return ret; +- vc4->irq = ret; +- + ret = vc4_irq_install(drm, vc4->irq); + if (ret) { + DRM_ERROR("Failed to install IRQ handler\n"); +- return ret; ++ goto err_put_runtime_pm; + } + +- pm_runtime_set_active(dev); + pm_runtime_use_autosuspend(dev); + pm_runtime_set_autosuspend_delay(dev, 40); /* a little over 2 frames. */ +- pm_runtime_enable(dev); + + return 0; ++ ++err_put_runtime_pm: ++ pm_runtime_put(dev); ++ ++err_disable_runtime_pm: ++ pm_runtime_disable(dev); ++ ++ return ret; + } + + static void vc4_v3d_unbind(struct device *dev, struct device *master, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Fri, 10 Jun 2022 10:51:26 +0200 +Subject: [PATCH 1152/1183] drm/vc4: v3d: Switch to devm_pm_runtime_enable + +devm_pm_runtime_enable() simplifies the driver a bit since it will call +pm_runtime_disable() automatically through a device-managed action. + +Acked-by: Thomas Zimmermann +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_v3d.c | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c +index d82c86865079..40f04157ea39 100644 +--- a/drivers/gpu/drm/vc4/vc4_v3d.c ++++ b/drivers/gpu/drm/vc4/vc4_v3d.c +@@ -468,11 +468,13 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + return ret; + vc4->irq = ret; + +- pm_runtime_enable(dev); ++ ret = devm_pm_runtime_enable(dev); ++ if (ret) ++ return ret; + + ret = pm_runtime_resume_and_get(dev); + if (ret) +- goto err_disable_runtime_pm; ++ return ret; + + if (V3D_READ(V3D_IDENT0) != V3D_EXPECTED_IDENT0) { + DRM_ERROR("V3D_IDENT0 read 0x%08x instead of 0x%08x\n", +@@ -501,9 +503,6 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + err_put_runtime_pm: + pm_runtime_put(dev); + +-err_disable_runtime_pm: +- pm_runtime_disable(dev); +- + return ret; + } + +@@ -513,8 +512,6 @@ static void vc4_v3d_unbind(struct device *dev, struct device *master, + struct drm_device *drm = dev_get_drvdata(master); + struct vc4_dev *vc4 = to_vc4_dev(drm); + +- pm_runtime_disable(dev); +- + vc4_irq_uninstall(drm); + + /* Disable the binner's overflow memory address, so the next +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 12 Sep 2022 09:37:08 +0100 +Subject: [PATCH 1153/1183] configs: Add NET_XFRM=m + +Enable the net_xfrm module to support using nftables rules with ipsec +matches, + +See: https://github.com/raspberrypi/linux/issues/5171 + +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 d5b4a5d49151..127ef0b8fa9b 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -156,6 +156,7 @@ CONFIG_NFT_REJECT=m + CONFIG_NFT_COMPAT=m + CONFIG_NFT_HASH=m + CONFIG_NFT_FIB_INET=m ++CONFIG_NFT_XFRM=m + CONFIG_NFT_SOCKET=m + CONFIG_NFT_OSF=m + CONFIG_NFT_TPROXY=m +diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig +index 34df1b94ae11..2b44b285914e 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -158,6 +158,7 @@ CONFIG_NFT_REJECT=m + CONFIG_NFT_COMPAT=m + CONFIG_NFT_HASH=m + CONFIG_NFT_FIB_INET=m ++CONFIG_NFT_XFRM=m + CONFIG_NFT_SOCKET=m + CONFIG_NFT_OSF=m + CONFIG_NFT_TPROXY=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index fc3e2c3dac8c..41bb28958d17 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -150,6 +150,7 @@ CONFIG_NFT_REJECT=m + CONFIG_NFT_COMPAT=m + CONFIG_NFT_HASH=m + CONFIG_NFT_FIB_INET=m ++CONFIG_NFT_XFRM=m + CONFIG_NFT_SOCKET=m + CONFIG_NFT_OSF=m + CONFIG_NFT_TPROXY=m +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index b2e7ba8c3275..15a8c455471a 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -160,6 +160,7 @@ CONFIG_NFT_REJECT=m + CONFIG_NFT_COMPAT=m + CONFIG_NFT_HASH=m + CONFIG_NFT_FIB_INET=m ++CONFIG_NFT_XFRM=m + CONFIG_NFT_SOCKET=m + CONFIG_NFT_OSF=m + CONFIG_NFT_TPROXY=m +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index f230ddb4675a..9477b58043cb 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -154,6 +154,7 @@ CONFIG_NFT_REJECT=m + CONFIG_NFT_COMPAT=m + CONFIG_NFT_HASH=m + CONFIG_NFT_FIB_INET=m ++CONFIG_NFT_XFRM=m + CONFIG_NFT_SOCKET=m + CONFIG_NFT_OSF=m + CONFIG_NFT_TPROXY=m +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jonathan Bell +Date: Thu, 8 Sep 2022 15:50:15 +0100 +Subject: [PATCH 1154/1183] usb: xhci: expand mitigations for + VLI_SS_BULK_OUT_BUG quirk + +The VL805 can cause data corruption if a SS Bulk OUT endpoint enters a +flow-control condition and there are TRBs in the transfer ring that are +not an integral size of wMaxPacket and the endpoint is behind one or more +hubs. + +This is frequently the case encountered when FAT32 filesystems are +present on mass-storage devices with cluster sizes of 1 sector, and the +filesystem is being written to with an aggregate of small files. + +The initial implementation of this quirk separated TRBs that didn't +adhere to this limitation into two - the first a multiple of wMaxPacket +and the second the 512-byte remainder - in an attempt to force TD +fragments to align with packet boundaries. This reduced the incidence +rate of data corruption but did not resolve it. + +The fix as recommended by VIA is to disable bursts if this sequence of +TRBs can occur. + +Limit turning off bursts to just USB mass-storage devices by searching +the device's configuration for an interface with a class type of +USB_CLASS_MASS_STORAGE. + +Signed-off-by: Jonathan Bell +--- + drivers/usb/host/xhci-mem.c | 31 ++++++++++++++++++++++++++++++- + 1 file changed, 30 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c +index 6df995c58eac..bbd56084fc5d 100644 +--- a/drivers/usb/host/xhci-mem.c ++++ b/drivers/usb/host/xhci-mem.c +@@ -1437,6 +1437,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, + unsigned int ep_index; + struct xhci_ep_ctx *ep_ctx; + struct xhci_ring *ep_ring; ++ struct usb_interface_cache *intfc; + unsigned int max_packet; + enum xhci_ring_type ring_type; + u32 max_esit_payload; +@@ -1446,6 +1447,8 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, + unsigned int mult; + unsigned int avg_trb_len; + unsigned int err_count = 0; ++ unsigned int is_ums_dev = 0; ++ unsigned int i; + + ep_index = xhci_get_endpoint_index(&ep->desc); + ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); +@@ -1477,9 +1480,35 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, + + mult = xhci_get_endpoint_mult(udev, ep); + max_packet = usb_endpoint_maxp(&ep->desc); +- max_burst = xhci_get_endpoint_max_burst(udev, ep); + avg_trb_len = max_esit_payload; + ++ /* ++ * VL805 errata - Bulk OUT bursts to superspeed mass-storage ++ * devices behind hub ports can cause data corruption with ++ * non-wMaxPacket-multiple transfers. ++ */ ++ for (i = 0; i < udev->config->desc.bNumInterfaces; i++) { ++ intfc = udev->config->intf_cache[i]; ++ /* ++ * Slight hack - look at interface altsetting 0, which ++ * should be the UMS bulk-only interface. If the class ++ * matches, then we disable out bursts for all OUT ++ * endpoints because endpoint assignments may change ++ * between alternate settings. ++ */ ++ if (intfc->altsetting[0].desc.bInterfaceClass == ++ USB_CLASS_MASS_STORAGE) { ++ is_ums_dev = 1; ++ break; ++ } ++ } ++ if (xhci->quirks & XHCI_VLI_SS_BULK_OUT_BUG && ++ usb_endpoint_is_bulk_out(&ep->desc) && is_ums_dev && ++ udev->route) ++ max_burst = 0; ++ else ++ max_burst = xhci_get_endpoint_max_burst(udev, ep); ++ + /* FIXME dig Mult and streams info out of ep companion desc */ + + /* Allow 3 retries for everything but isoc, set CErr = 3 */ +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= +Date: Wed, 20 Apr 2022 13:44:59 +0200 +Subject: [PATCH 1155/1183] drm/vc4: hdmi: Replace drm_detect_hdmi_monitor() + with is_hdmi +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Once EDID is parsed, the monitor HDMI support information is cached in +drm_display_info.is_hdmi by drm_parse_hdmi_vsdb_video(). + +This driver calls drm_detect_hdmi_monitor() to receive the same +information and stores its own cached value in +vc4_hdmi_encoder.hdmi_monitor, which is less efficient. + +Avoid calling drm_detect_hdmi_monitor() and use drm_display_info.is_hdmi +instead. This also allows to remove vc4_hdmi_encoder.hdmi_monitor. + +drm_detect_hdmi_monitor() is called in vc4_hdmi_connector_detect() and +vc4_hdmi_connector_get_modes(). In both cases it is safe to rely on +drm_display_info.is_hdmi as shown by ftrace: + +$ sudo trace-cmd record -p function_graph -l "vc4_hdmi_*" -l "drm_*" + +vc4_hdmi_connector_detect: + + vc4_hdmi_connector_detect() { + drm_get_edid() { + drm_connector_update_edid_property() { + drm_add_display_info() { + drm_reset_display_info(); + drm_for_each_detailed_block.part.0(); + drm_parse_cea_ext() { + drm_find_cea_extension(); + drm_parse_hdmi_vsdb_video(); + /* drm_display_info.is_hdmi is cached here */ + } + } + } + } + /* drm_display_info.is_hdmi is used here */ + } + +vc4_hdmi_connector_get_modes: + + vc4_hdmi_connector_get_modes() { + drm_get_edid() { + drm_connector_update_edid_property() { + drm_add_display_info() { + drm_reset_display_info(); + drm_for_each_detailed_block.part.0(); + drm_parse_cea_ext() { + drm_find_cea_extension(); + drm_parse_hdmi_vsdb_video(); + /* drm_display_info.is_hdmi is cached here */ + } + } + } + } + /* drm_display_info.is_hdmi is used here */ + drm_connector_update_edid_property(); + } + +Signed-off-by: José Expósito +Signed-off-by: Maxime Ripard +Link: https://patchwork.freedesktop.org/patch/msgid/20220420114500.187664-2-jose.exposito89@gmail.com +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 25 +++++++++---------------- + drivers/gpu/drm/vc4/vc4_hdmi.h | 1 - + 2 files changed, 9 insertions(+), 17 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index d36883e2f84a..8f90d41477ea 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -151,13 +151,13 @@ static bool vc4_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode, + static bool vc4_hdmi_is_full_range(struct vc4_hdmi *vc4_hdmi, + const struct drm_display_mode *mode) + { +- struct vc4_hdmi_encoder *vc4_encoder = &vc4_hdmi->encoder; ++ struct drm_display_info *display = &vc4_hdmi->connector.display_info; + + if (vc4_hdmi->broadcast_rgb == VC4_BROADCAST_RGB_LIMITED) + return false; + else if (vc4_hdmi->broadcast_rgb == VC4_BROADCAST_RGB_FULL) + return true; +- return !vc4_encoder->hdmi_monitor || ++ return !display->is_hdmi || + drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_FULL; + } + +@@ -319,10 +319,7 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + + if (edid) { + cec_s_phys_addr_from_edid(vc4_hdmi->cec_adap, edid); +- vc4_hdmi->encoder.hdmi_monitor = drm_detect_hdmi_monitor(edid); + kfree(edid); +- } else { +- vc4_hdmi->encoder.hdmi_monitor = false; + } + } + +@@ -332,8 +329,6 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + return connector_status_connected; + } + +- vc4_hdmi->encoder.hdmi_monitor = false; +- + cec_phys_addr_invalidate(vc4_hdmi->cec_adap); + pm_runtime_put(&vc4_hdmi->pdev->dev); + mutex_unlock(&vc4_hdmi->mutex); +@@ -343,7 +338,6 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + { + struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); +- struct vc4_hdmi_encoder *vc4_encoder = &vc4_hdmi->encoder; + struct vc4_dev *vc4 = to_vc4_dev(connector->dev); + int ret = 0; + struct edid *edid; +@@ -357,8 +351,6 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + goto out; + } + +- vc4_encoder->hdmi_monitor = drm_detect_hdmi_monitor(edid); +- + drm_connector_update_edid_property(connector, edid); + ret = drm_add_edid_modes(connector, edid); + kfree(edid); +@@ -832,13 +824,12 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) + static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder, + struct drm_display_mode *mode) + { +- struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); + struct drm_display_info *display = &vc4_hdmi->connector.display_info; + + lockdep_assert_held(&vc4_hdmi->mutex); + +- if (!vc4_encoder->hdmi_monitor) ++ if (!display->is_hdmi) + return false; + + if (!display->hdmi.scdc.supported || +@@ -1662,7 +1653,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); + struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; +- struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); ++ struct drm_display_info *display = &vc4_hdmi->connector.display_info; + bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; + bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; + unsigned long flags; +@@ -1687,7 +1678,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, + HDMI_WRITE(HDMI_VID_CTL, + HDMI_READ(HDMI_VID_CTL) & ~VC4_HD_VID_CTL_BLANKPIX); + +- if (vc4_encoder->hdmi_monitor) { ++ if (display->is_hdmi) { + HDMI_WRITE(HDMI_SCHEDULER_CONTROL, + HDMI_READ(HDMI_SCHEDULER_CONTROL) | + VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); +@@ -1714,7 +1705,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, + "!VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE\n"); + } + +- if (vc4_encoder->hdmi_monitor) { ++ if (display->is_hdmi) { + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + + WARN_ON(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) & +@@ -2193,13 +2184,15 @@ static inline struct vc4_hdmi *dai_to_hdmi(struct snd_soc_dai *dai) + + static bool vc4_hdmi_audio_can_stream(struct vc4_hdmi *vc4_hdmi) + { ++ struct drm_display_info *display = &vc4_hdmi->connector.display_info; ++ + lockdep_assert_held(&vc4_hdmi->mutex); + + /* + * If the encoder is currently in DVI mode, treat the codec DAI + * as missing. + */ +- if (!vc4_hdmi->encoder.hdmi_monitor) ++ if (!display->is_hdmi) + return false; + + return true; +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h +index b83e4194983f..2d6a0e2c71ab 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.h ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.h +@@ -11,7 +11,6 @@ + /* VC4 HDMI encoder KMS struct */ + struct vc4_hdmi_encoder { + struct vc4_encoder base; +- bool hdmi_monitor; + }; + + static inline struct vc4_hdmi_encoder * +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= +Date: Wed, 20 Apr 2022 13:45:00 +0200 +Subject: [PATCH 1156/1183] drm/vc4: hdmi: Remove vc4_hdmi_encoder +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The vc4_hdmi_encoder struct was used exclusively to cache the value +returned by drm_detect_hdmi_monitor() in order to avoid calling it +multiple times. + +Now that drm_detect_hdmi_monitor() has been replaced with +drm_display_info.is_hdmi, there is no need to have an extra struct. + +Remove vc4_hdmi_encoder. + +Signed-off-by: José Expósito +Signed-off-by: Maxime Ripard +Link: https://patchwork.freedesktop.org/patch/msgid/20220420114500.187664-3-jose.exposito89@gmail.com +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 24 ++++++++++++------------ + drivers/gpu/drm/vc4/vc4_hdmi.h | 16 ++-------------- + 2 files changed, 14 insertions(+), 26 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 8f90d41477ea..3c05c30c5aaf 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -302,7 +302,7 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + + WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); + +- if (force_hotplug & BIT(vc4_hdmi->encoder.base.type - VC4_ENCODER_TYPE_HDMI0)) ++ if (force_hotplug & BIT(vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0)) + connected = true; + else if (vc4_hdmi->hpd_gpio) { + if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) +@@ -323,7 +323,7 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + } + } + +- vc4_hdmi_enable_scrambling(&vc4_hdmi->encoder.base.base); ++ vc4_hdmi_enable_scrambling(&vc4_hdmi->encoder.base); + pm_runtime_put(&vc4_hdmi->pdev->dev); + mutex_unlock(&vc4_hdmi->mutex); + return connector_status_connected; +@@ -548,7 +548,7 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, + struct vc4_hdmi *vc4_hdmi) + { + struct drm_connector *connector = &vc4_hdmi->connector; +- struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; ++ struct drm_encoder *encoder = &vc4_hdmi->encoder.base; + int ret; + + ret = drmm_connector_init(dev, connector, +@@ -2242,7 +2242,7 @@ static int vc4_hdmi_audio_startup(struct device *dev, void *data) + + static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) + { +- struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; ++ struct drm_encoder *encoder = &vc4_hdmi->encoder.base; + struct device *dev = &vc4_hdmi->pdev->dev; + unsigned long flags; + int ret; +@@ -2341,7 +2341,7 @@ static int vc4_hdmi_audio_prepare(struct device *dev, void *data, + { + struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); + struct drm_device *drm = vc4_hdmi->connector.dev; +- struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; ++ struct drm_encoder *encoder = &vc4_hdmi->encoder.base; + unsigned int sample_rate = params->sample_rate; + unsigned int channels = params->channels; + unsigned long flags; +@@ -3495,13 +3495,13 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + INIT_DELAYED_WORK(&vc4_hdmi->scrambling_work, vc4_hdmi_scrambling_wq); + + dev_set_drvdata(dev, vc4_hdmi); +- encoder = &vc4_hdmi->encoder.base.base; +- vc4_hdmi->encoder.base.type = variant->encoder_type; +- vc4_hdmi->encoder.base.pre_crtc_configure = vc4_hdmi_encoder_pre_crtc_configure; +- vc4_hdmi->encoder.base.pre_crtc_enable = vc4_hdmi_encoder_pre_crtc_enable; +- vc4_hdmi->encoder.base.post_crtc_enable = vc4_hdmi_encoder_post_crtc_enable; +- vc4_hdmi->encoder.base.post_crtc_disable = vc4_hdmi_encoder_post_crtc_disable; +- vc4_hdmi->encoder.base.post_crtc_powerdown = vc4_hdmi_encoder_post_crtc_powerdown; ++ encoder = &vc4_hdmi->encoder.base; ++ vc4_hdmi->encoder.type = variant->encoder_type; ++ vc4_hdmi->encoder.pre_crtc_configure = vc4_hdmi_encoder_pre_crtc_configure; ++ vc4_hdmi->encoder.pre_crtc_enable = vc4_hdmi_encoder_pre_crtc_enable; ++ vc4_hdmi->encoder.post_crtc_enable = vc4_hdmi_encoder_post_crtc_enable; ++ vc4_hdmi->encoder.post_crtc_disable = vc4_hdmi_encoder_post_crtc_disable; ++ vc4_hdmi->encoder.post_crtc_powerdown = vc4_hdmi_encoder_post_crtc_powerdown; + vc4_hdmi->pdev = pdev; + vc4_hdmi->variant = variant; + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h +index 2d6a0e2c71ab..9a5c540755ef 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.h ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.h +@@ -8,17 +8,6 @@ + + #include "vc4_drv.h" + +-/* VC4 HDMI encoder KMS struct */ +-struct vc4_hdmi_encoder { +- struct vc4_encoder base; +-}; +- +-static inline struct vc4_hdmi_encoder * +-to_vc4_hdmi_encoder(struct drm_encoder *encoder) +-{ +- return container_of(encoder, struct vc4_hdmi_encoder, base.base); +-} +- + struct vc4_hdmi; + struct vc4_hdmi_register; + struct vc4_hdmi_connector_state; +@@ -135,7 +124,7 @@ struct vc4_hdmi { + struct platform_device *pdev; + const struct vc4_hdmi_variant *variant; + +- struct vc4_hdmi_encoder encoder; ++ struct vc4_encoder encoder; + struct drm_connector connector; + + struct delayed_work scrambling_work; +@@ -258,8 +247,7 @@ connector_to_vc4_hdmi(struct drm_connector *connector) + static inline struct vc4_hdmi * + encoder_to_vc4_hdmi(struct drm_encoder *encoder) + { +- struct vc4_hdmi_encoder *_encoder = to_vc4_hdmi_encoder(encoder); +- ++ struct vc4_encoder *_encoder = to_vc4_encoder(encoder); + return container_of(_encoder, struct vc4_hdmi, encoder); + } + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 18 Nov 2021 09:12:28 +0100 +Subject: [PATCH 1157/1183] drm/vc4: hdmi: Constify drm_display_mode + +We don't modify the drm_display_mode pointer we have in the driver in +most places, so let's make them const. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 16 ++++++++-------- + drivers/gpu/drm/vc4/vc4_hdmi.h | 2 +- + 2 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 3c05c30c5aaf..ca14f9951589 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -357,7 +357,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + + if (!vc4->hvs->vc5_hdmi_enable_scrambling) { + struct drm_device *drm = connector->dev; +- struct drm_display_mode *mode; ++ const struct drm_display_mode *mode; + + list_for_each_entry(mode, &connector->probed_modes, head) { + if (vc4_hdmi_mode_needs_scrambling(mode, 8, VC4_HDMI_OUTPUT_RGB)) { +@@ -822,7 +822,7 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) + } + + static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder, +- struct drm_display_mode *mode) ++ const struct drm_display_mode *mode) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); + struct drm_display_info *display = &vc4_hdmi->connector.display_info; +@@ -845,7 +845,7 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); + struct drm_device *drm = vc4_hdmi->connector.dev; +- struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; ++ const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; + unsigned long flags; + int idx; + +@@ -1284,7 +1284,7 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, + + static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + struct drm_connector_state *state, +- struct drm_display_mode *mode) ++ const struct drm_display_mode *mode) + { + struct drm_device *drm = vc4_hdmi->connector.dev; + bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; +@@ -1348,7 +1348,7 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + + static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, + struct drm_connector_state *state, +- struct drm_display_mode *mode) ++ const struct drm_display_mode *mode) + { + struct drm_device *drm = vc4_hdmi->connector.dev; + const struct vc4_hdmi_connector_state *vc4_state = +@@ -1511,7 +1511,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, + drm_atomic_get_new_connector_state(state, connector); + struct vc4_hdmi_connector_state *vc4_conn_state = + conn_state_to_vc4_hdmi_conn_state(conn_state); +- struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; ++ const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; + unsigned long pixel_rate = vc4_conn_state->pixel_rate; + unsigned long bvb_rate, hsm_rate; + unsigned long flags; +@@ -1624,7 +1624,7 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); + struct drm_device *drm = vc4_hdmi->connector.dev; + struct drm_connector *connector = &vc4_hdmi->connector; +- struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; ++ const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; + struct drm_connector_state *conn_state = + drm_atomic_get_new_connector_state(state, connector); + unsigned long flags; +@@ -1652,7 +1652,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); + struct drm_device *drm = vc4_hdmi->connector.dev; +- struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; ++ const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; + struct drm_display_info *display = &vc4_hdmi->connector.display_info; + bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; + bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h +index 9a5c540755ef..b4492cda109c 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.h ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.h +@@ -72,7 +72,7 @@ struct vc4_hdmi_variant { + /* Callback to configure the video timings in the HDMI block */ + void (*set_timings)(struct vc4_hdmi *vc4_hdmi, + struct drm_connector_state *state, +- struct drm_display_mode *mode); ++ const struct drm_display_mode *mode); + + /* Callback to initialize the PHY according to the connector state */ + void (*phy_init)(struct vc4_hdmi *vc4_hdmi, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 2 Nov 2021 13:35:22 +0100 +Subject: [PATCH 1158/1183] drm/vc4: hdmi: Remove unused argument in + vc4_hdmi_supports_scrambling + +Even though vc4_hdmi_supports_scrambling takes a mode as an argument, it +never uses it. Let's remove it. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index ca14f9951589..f9f6c906fac1 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -821,8 +821,7 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) + vc4_hdmi_set_hdr_infoframe(encoder); + } + +-static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder, +- const struct drm_display_mode *mode) ++static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder) + { + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); + struct drm_display_info *display = &vc4_hdmi->connector.display_info; +@@ -851,7 +850,7 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) + + lockdep_assert_held(&vc4_hdmi->mutex); + +- if (!vc4_hdmi_supports_scrambling(encoder, mode)) ++ if (!vc4_hdmi_supports_scrambling(encoder)) + return; + + if (!vc4_hdmi_mode_needs_scrambling(mode, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 28 Oct 2021 14:59:37 +0200 +Subject: [PATCH 1159/1183] drm/vc4: hdmi: Remove mutex in detect + +We recently introduced a new mutex to protect concurrent execution of +ALSA and KMS hooks, and the concurrent access to some of vc4_hdmi +fields. + +However, using it in the detect hook was creating a reentrency issue +with CEC code. Indeed, calling cec_s_phys_addr_from_edid from detect +might call the CEC adap_enable hook with the lock held, eventually +resulting in a deadlock. + +Since we didn't really need to protect anything at the moment in the CEC +code, the decision was made to ignore the mutex in those CEC hooks, +working around the issue. + +However, we can have the same thing happening if we end up triggering a +mode set from the detect callback, for example using +drm_atomic_helper_connector_hdmi_reset_link(). + +Since we don't really need to protect anything in detect either, let's +just drop the lock in detect, and add it again in CEC. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 88 +++++++++++++--------------------- + drivers/gpu/drm/vc4/vc4_hdmi.h | 10 +--- + 2 files changed, 34 insertions(+), 64 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index f9f6c906fac1..1f4a8699e155 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -298,7 +298,16 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); + bool connected = false; + +- mutex_lock(&vc4_hdmi->mutex); ++ /* ++ * NOTE: This function should really take vc4_hdmi->mutex, but ++ * doing so results in reentrancy issues since ++ * cec_s_phys_addr_from_edid might call .adap_enable, which ++ * leads to that funtion being called with our mutex held. ++ * ++ * Concurrency isn't an issue at the moment since we don't share ++ * any state with any of the other frameworks so we can ignore ++ * the lock for now. ++ */ + + WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); + +@@ -325,13 +334,11 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + + vc4_hdmi_enable_scrambling(&vc4_hdmi->encoder.base); + pm_runtime_put(&vc4_hdmi->pdev->dev); +- mutex_unlock(&vc4_hdmi->mutex); + return connector_status_connected; + } + + cec_phys_addr_invalidate(vc4_hdmi->cec_adap); + pm_runtime_put(&vc4_hdmi->pdev->dev); +- mutex_unlock(&vc4_hdmi->mutex); + return connector_status_disconnected; + } + +@@ -342,14 +349,21 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + int ret = 0; + struct edid *edid; + +- mutex_lock(&vc4_hdmi->mutex); ++ /* ++ * NOTE: This function should really take vc4_hdmi->mutex, but ++ * doing so results in reentrancy issues since ++ * cec_s_phys_addr_from_edid might call .adap_enable, which ++ * leads to that funtion being called with our mutex held. ++ * ++ * Concurrency isn't an issue at the moment since we don't share ++ * any state with any of the other frameworks so we can ignore ++ * the lock for now. ++ */ + + edid = drm_get_edid(connector, vc4_hdmi->ddc); + cec_s_phys_addr_from_edid(vc4_hdmi->cec_adap, edid); +- if (!edid) { +- ret = -ENODEV; +- goto out; +- } ++ if (!edid) ++ return -ENODEV; + + drm_connector_update_edid_property(connector, edid); + ret = drm_add_edid_modes(connector, edid); +@@ -367,9 +381,6 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + } + } + +-out: +- mutex_unlock(&vc4_hdmi->mutex); +- + return ret; + } + +@@ -2861,17 +2872,6 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) + int ret; + int idx; + +- /* +- * NOTE: This function should really take vc4_hdmi->mutex, but doing so +- * results in a reentrancy since cec_s_phys_addr_from_edid() called in +- * .detect or .get_modes might call .adap_enable, which leads to this +- * function being called with that mutex held. +- * +- * Concurrency is not an issue for the moment since we don't share any +- * state with KMS, so we can ignore the lock for now, but we need to +- * keep it in mind if we were to change that assumption. +- */ +- + if (!drm_dev_enter(drm, &idx)) + /* + * We can't return an error code, because the CEC +@@ -2886,6 +2886,8 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) + return ret; + } + ++ mutex_lock(&vc4_hdmi->mutex); ++ + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + + val = HDMI_READ(HDMI_CEC_CNTRL_5); +@@ -2920,6 +2922,7 @@ static int vc4_hdmi_cec_enable(struct cec_adapter *adap) + + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); + ++ mutex_unlock(&vc4_hdmi->mutex); + drm_dev_exit(idx); + + return 0; +@@ -2940,16 +2943,7 @@ static int vc4_hdmi_cec_disable(struct cec_adapter *adap) + */ + return 0; + +- /* +- * NOTE: This function should really take vc4_hdmi->mutex, but doing so +- * results in a reentrancy since cec_s_phys_addr_from_edid() called in +- * .detect or .get_modes might call .adap_enable, which leads to this +- * function being called with that mutex held. +- * +- * Concurrency is not an issue for the moment since we don't share any +- * state with KMS, so we can ignore the lock for now, but we need to +- * keep it in mind if we were to change that assumption. +- */ ++ mutex_lock(&vc4_hdmi->mutex); + + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + +@@ -2961,6 +2955,8 @@ static int vc4_hdmi_cec_disable(struct cec_adapter *adap) + + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); + ++ mutex_unlock(&vc4_hdmi->mutex); ++ + pm_runtime_put(&vc4_hdmi->pdev->dev); + + drm_dev_exit(idx); +@@ -2983,17 +2979,6 @@ static int vc4_hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr) + unsigned long flags; + int idx; + +- /* +- * NOTE: This function should really take vc4_hdmi->mutex, but doing so +- * results in a reentrancy since cec_s_phys_addr_from_edid() called in +- * .detect or .get_modes might call .adap_enable, which leads to this +- * function being called with that mutex held. +- * +- * Concurrency is not an issue for the moment since we don't share any +- * state with KMS, so we can ignore the lock for now, but we need to +- * keep it in mind if we were to change that assumption. +- */ +- + if (!drm_dev_enter(drm, &idx)) + /* + * We can't return an error code, because the CEC +@@ -3002,11 +2987,13 @@ static int vc4_hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr) + */ + return 0; + ++ mutex_lock(&vc4_hdmi->mutex); + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + HDMI_WRITE(HDMI_CEC_CNTRL_1, + (HDMI_READ(HDMI_CEC_CNTRL_1) & ~VC4_HDMI_CEC_ADDR_MASK) | + (log_addr & 0xf) << VC4_HDMI_CEC_ADDR_SHIFT); + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); ++ mutex_unlock(&vc4_hdmi->mutex); + + drm_dev_exit(idx); + +@@ -3023,17 +3010,6 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, + unsigned int i; + int idx; + +- /* +- * NOTE: This function should really take vc4_hdmi->mutex, but doing so +- * results in a reentrancy since cec_s_phys_addr_from_edid() called in +- * .detect or .get_modes might call .adap_enable, which leads to this +- * function being called with that mutex held. +- * +- * Concurrency is not an issue for the moment since we don't share any +- * state with KMS, so we can ignore the lock for now, but we need to +- * keep it in mind if we were to change that assumption. +- */ +- + if (!drm_dev_enter(dev, &idx)) + return -ENODEV; + +@@ -3043,6 +3019,8 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, + return -ENOMEM; + } + ++ mutex_lock(&vc4_hdmi->mutex); ++ + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + + for (i = 0; i < msg->len; i += 4) +@@ -3062,7 +3040,7 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, + HDMI_WRITE(HDMI_CEC_CNTRL_1, val); + + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); +- ++ mutex_unlock(&vc4_hdmi->mutex); + drm_dev_exit(idx); + + return 0; +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h +index b4492cda109c..ecebccad4569 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.h ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.h +@@ -181,15 +181,7 @@ struct vc4_hdmi { + + /** + * @mutex: Mutex protecting the driver access across multiple +- * frameworks (KMS, ALSA). +- * +- * NOTE: While supported, CEC has been left out since +- * cec_s_phys_addr_from_edid() might call .adap_enable and lead to a +- * reentrancy issue between .get_modes (or .detect) and .adap_enable. +- * Since we don't share any state between the CEC hooks and KMS', it's +- * not a big deal. The only trouble might come from updating the CEC +- * clock divider which might be affected by a modeset, but CEC should +- * be resilient to that. ++ * frameworks (KMS, ALSA, CEC). + */ + struct mutex mutex; + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 20 Oct 2021 09:53:30 +0200 +Subject: [PATCH 1160/1183] drm/vc4: hdmi: Simplify the hotplug handling + +Our detect callback has a bunch of operations to perform depending on +the current and last status of the connector, such a setting the CEC +physical address or enabling the scrambling again. + +This is currently dealt with a bunch of if / else statetements that make +it fairly difficult to read and extend. + +Let's move all that logic to a function of its own. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 68 ++++++++++++++++++++++------------ + 1 file changed, 45 insertions(+), 23 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 1f4a8699e155..1afeef6e0590 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -292,17 +292,53 @@ static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) {} + + static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder); + ++static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, ++ enum drm_connector_status status) ++{ ++ struct drm_connector *connector = &vc4_hdmi->connector; ++ struct edid *edid; ++ ++ /* ++ * NOTE: This function should really be called with ++ * vc4_hdmi->mutex held, but doing so results in reentrancy ++ * issues since cec_s_phys_addr_from_edid might call ++ * .adap_enable, which leads to that funtion being called with ++ * our mutex held. ++ * ++ * Concurrency isn't an issue at the moment since we don't share ++ * any state with any of the other frameworks so we can ignore ++ * the lock for now. ++ */ ++ ++ if (status == connector->status) ++ return; ++ ++ if (status == connector_status_disconnected) { ++ cec_phys_addr_invalidate(vc4_hdmi->cec_adap); ++ return; ++ } ++ ++ edid = drm_get_edid(connector, vc4_hdmi->ddc); ++ if (!edid) ++ return; ++ ++ cec_s_phys_addr_from_edid(vc4_hdmi->cec_adap, edid); ++ kfree(edid); ++ ++ vc4_hdmi_enable_scrambling(&vc4_hdmi->encoder.base); ++} ++ + static enum drm_connector_status + vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + { + struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); +- bool connected = false; ++ enum drm_connector_status status = connector_status_disconnected; + + /* + * NOTE: This function should really take vc4_hdmi->mutex, but + * doing so results in reentrancy issues since +- * cec_s_phys_addr_from_edid might call .adap_enable, which +- * leads to that funtion being called with our mutex held. ++ * vc4_hdmi_handle_hotplug() can call into other functions that ++ * would take the mutex while it's held here. + * + * Concurrency isn't an issue at the moment since we don't share + * any state with any of the other frameworks so we can ignore +@@ -312,34 +348,20 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); + + if (force_hotplug & BIT(vc4_hdmi->encoder.type - VC4_ENCODER_TYPE_HDMI0)) +- connected = true; ++ status = connector_status_connected; + else if (vc4_hdmi->hpd_gpio) { + if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) +- connected = true; ++ status = connector_status_connected; + } else { + if (vc4_hdmi->variant->hp_detect && + vc4_hdmi->variant->hp_detect(vc4_hdmi)) +- connected = true; +- } +- +- if (connected) { +- if (connector->status != connector_status_connected) { +- struct edid *edid = drm_get_edid(connector, vc4_hdmi->ddc); +- +- if (edid) { +- cec_s_phys_addr_from_edid(vc4_hdmi->cec_adap, edid); +- kfree(edid); +- } +- } +- +- vc4_hdmi_enable_scrambling(&vc4_hdmi->encoder.base); +- pm_runtime_put(&vc4_hdmi->pdev->dev); +- return connector_status_connected; ++ status = connector_status_connected; + } + +- cec_phys_addr_invalidate(vc4_hdmi->cec_adap); ++ vc4_hdmi_handle_hotplug(vc4_hdmi, status); + pm_runtime_put(&vc4_hdmi->pdev->dev); +- return connector_status_disconnected; ++ ++ return status; + } + + static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Tue, 28 Sep 2021 14:11:37 +0200 +Subject: [PATCH 1161/1183] drm/vc4: hdmi: Switch to detect_ctx + +We'll need the locking context in future patch, so let's convert .detect +to .detect_ctx. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 1afeef6e0590..8fc5bef5c8fa 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -328,8 +328,9 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, + vc4_hdmi_enable_scrambling(&vc4_hdmi->encoder.base); + } + +-static enum drm_connector_status +-vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) ++static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector, ++ struct drm_modeset_acquire_ctx *ctx, ++ bool force) + { + struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); + enum drm_connector_status status = connector_status_disconnected; +@@ -537,7 +538,6 @@ vc4_hdmi_connector_duplicate_state(struct drm_connector *connector) + } + + static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { +- .detect = vc4_hdmi_connector_detect, + .fill_modes = drm_helper_probe_single_connector_modes, + .reset = vc4_hdmi_connector_reset, + .atomic_duplicate_state = vc4_hdmi_connector_duplicate_state, +@@ -547,6 +547,7 @@ static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { + }; + + static const struct drm_connector_helper_funcs vc4_hdmi_connector_helper_funcs = { ++ .detect_ctx = vc4_hdmi_connector_detect_ctx, + .get_modes = vc4_hdmi_connector_get_modes, + .atomic_check = vc4_hdmi_connector_atomic_check, + }; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 13 Jul 2022 16:18:21 +0200 +Subject: [PATCH 1162/1183] drm/vc4: hdmi: Move vc4_hdmi_supports_scrambling() + around + +We'll need it earlier in the driver, so let's move it next to the other +scrambling-related helpers. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 8fc5bef5c8fa..ff05d946ef0b 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -139,6 +139,23 @@ static unsigned long long + vc4_hdmi_encoder_compute_mode_clock(const struct drm_display_mode *mode, + unsigned int bpc, enum vc4_hdmi_output_format fmt); + ++static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder) ++{ ++ struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); ++ struct drm_display_info *display = &vc4_hdmi->connector.display_info; ++ ++ lockdep_assert_held(&vc4_hdmi->mutex); ++ ++ if (!display->is_hdmi) ++ return false; ++ ++ if (!display->hdmi.scdc.supported || ++ !display->hdmi.scdc.scrambling.supported) ++ return false; ++ ++ return true; ++} ++ + static bool vc4_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode, + unsigned int bpc, + enum vc4_hdmi_output_format fmt) +@@ -855,23 +872,6 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) + vc4_hdmi_set_hdr_infoframe(encoder); + } + +-static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder) +-{ +- struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); +- struct drm_display_info *display = &vc4_hdmi->connector.display_info; +- +- lockdep_assert_held(&vc4_hdmi->mutex); +- +- if (!display->is_hdmi) +- return false; +- +- if (!display->hdmi.scdc.supported || +- !display->hdmi.scdc.scrambling.supported) +- return false; +- +- return true; +-} +- + #define SCRAMBLING_POLLING_DELAY_MS 1000 + + static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 28 Oct 2021 15:00:44 +0200 +Subject: [PATCH 1163/1183] drm/vc4: hdmi: Reset link on hotplug + +During a hotplug cycle (such as a TV going out of suspend, or when the +cable is disconnected and reconnected), the expectation is that the same +state used before the disconnection is reused until the next commit. + +However, the HDMI scrambling requires that some flags are set in the +monitor, and those flags are very likely to be reset when the cable has +been disconnected. This will thus result in a blank display, even if the +display pipeline configuration hasn't been modified or is in the exact +same state. + +The solution we've had so far is to enable the scrambling-related bits +again on reconnection, but the HDMI 2.0 specification (Section 6.1.3.1 - +Scrambling Control) requires that the scrambling enable bit is set +before sending any scrambled video signal. Using that solution thus +breaks that expectation. + +The solution used by i915 is to do a full modeset on the connector so +that we disable the video signal, enable the scrambling bit, and enable +the video signal again. + +As such, we took that code and plugged it into vc4. It probably could +have been turned into an helper, but it proved to be difficult for +several reasons: + + * i915 has fairly different structures than simpler KMS drivers such + as vc4, so doing some code that works with both proved to be + difficult; + + * Other simpler drivers could reuse some of it (tegra, dw-hdmi), but + it would still require to move some parameters currently stored in + private structure that are needed to compute whether the scrambling + is needed or not, and then inform the driver that it needs to be + enabled. Some of those parameters are already in core structures + (drm_display_mode, drm_display_info, bpc), but the output format + isnt't. Adding it is fairly challenging since unlike the TMDS char + rate or mode, there's no consensus on what format to pick in + drivers, so it's not possible to write some generic code that can + depend on it. + +For these reasons, we chose to duplicate the code for now, until someone +else really needs it as well, in which case we will be able to convert +it into a generic helper. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 104 ++++++++++++++++++++++++++++++++- + 1 file changed, 101 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index ff05d946ef0b..a8f3d5274fdb 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -307,9 +307,103 @@ static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) + static void vc4_hdmi_cec_update_clk_div(struct vc4_hdmi *vc4_hdmi) {} + #endif + +-static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder); ++static int reset_pipe(struct drm_crtc *crtc, ++ struct drm_modeset_acquire_ctx *ctx) ++{ ++ struct drm_atomic_state *state; ++ struct drm_crtc_state *crtc_state; ++ int ret; ++ ++ state = drm_atomic_state_alloc(crtc->dev); ++ if (!state) ++ return -ENOMEM; ++ ++ state->acquire_ctx = ctx; ++ ++ crtc_state = drm_atomic_get_crtc_state(state, crtc); ++ if (IS_ERR(crtc_state)) { ++ ret = PTR_ERR(crtc_state); ++ goto out; ++ } ++ ++ crtc_state->connectors_changed = true; ++ ++ ret = drm_atomic_commit(state); ++out: ++ drm_atomic_state_put(state); ++ ++ return ret; ++} ++ ++static int vc4_hdmi_reset_link(struct drm_connector *connector, ++ struct drm_modeset_acquire_ctx *ctx) ++{ ++ struct drm_device *drm = connector->dev; ++ struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); ++ struct drm_encoder *encoder = &vc4_hdmi->encoder.base; ++ struct drm_connector_state *conn_state; ++ struct drm_crtc_state *crtc_state; ++ struct drm_crtc *crtc; ++ bool scrambling_needed; ++ u8 config; ++ int ret; ++ ++ if (!connector) ++ return 0; ++ ++ ret = drm_modeset_lock(&drm->mode_config.connection_mutex, ctx); ++ if (ret) ++ return ret; ++ ++ conn_state = connector->state; ++ crtc = conn_state->crtc; ++ if (!crtc) ++ return 0; ++ ++ ret = drm_modeset_lock(&crtc->mutex, ctx); ++ if (ret) ++ return ret; ++ ++ crtc_state = crtc->state; ++ if (!crtc_state->active) ++ return 0; ++ ++ if (!vc4_hdmi_supports_scrambling(encoder)) ++ return 0; ++ ++ scrambling_needed = vc4_hdmi_mode_needs_scrambling(&vc4_hdmi->saved_adjusted_mode, ++ vc4_hdmi->output_bpc, ++ vc4_hdmi->output_format); ++ if (!scrambling_needed) ++ return 0; ++ ++ if (conn_state->commit && ++ !try_wait_for_completion(&conn_state->commit->hw_done)) ++ return 0; ++ ++ ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config); ++ if (ret < 0) { ++ drm_err(drm, "Failed to read TMDS config: %d\n", ret); ++ return 0; ++ } ++ ++ if (!!(config & SCDC_SCRAMBLING_ENABLE) == scrambling_needed) ++ return 0; ++ ++ /* ++ * HDMI 2.0 says that one should not send scrambled data ++ * prior to configuring the sink scrambling, and that ++ * TMDS clock/data transmission should be suspended when ++ * changing the TMDS clock rate in the sink. So let's ++ * just do a full modeset here, even though some sinks ++ * would be perfectly happy if were to just reconfigure ++ * the SCDC settings on the fly. ++ */ ++ return reset_pipe(crtc, ctx); ++} + + static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, ++ struct drm_modeset_acquire_ctx *ctx, + enum drm_connector_status status) + { + struct drm_connector *connector = &vc4_hdmi->connector; +@@ -322,6 +416,10 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, + * .adap_enable, which leads to that funtion being called with + * our mutex held. + * ++ * A similar situation occurs with ++ * drm_atomic_helper_connector_hdmi_reset_link() that will call ++ * into our KMS hooks if the scrambling was enabled. ++ * + * Concurrency isn't an issue at the moment since we don't share + * any state with any of the other frameworks so we can ignore + * the lock for now. +@@ -342,7 +440,7 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, + cec_s_phys_addr_from_edid(vc4_hdmi->cec_adap, edid); + kfree(edid); + +- vc4_hdmi_enable_scrambling(&vc4_hdmi->encoder.base); ++ vc4_hdmi_reset_link(connector, ctx); + } + + static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector, +@@ -376,7 +474,7 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector, + status = connector_status_connected; + } + +- vc4_hdmi_handle_hotplug(vc4_hdmi, status); ++ vc4_hdmi_handle_hotplug(vc4_hdmi, ctx, status); + pm_runtime_put(&vc4_hdmi->pdev->dev); + + return status; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Mon, 27 Sep 2021 18:05:24 +0200 +Subject: [PATCH 1164/1183] drm/scdc: Document hotplug gotchas + +There's some interactions between the SCDC setup and the disconnection / +reconnection of displays. Let's document it and a solution. + +Signed-off-by: Maxime Ripard +--- + drivers/gpu/drm/drm_scdc_helper.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/drivers/gpu/drm/drm_scdc_helper.c b/drivers/gpu/drm/drm_scdc_helper.c +index 48a382464d54..0c098b39cdb9 100644 +--- a/drivers/gpu/drm/drm_scdc_helper.c ++++ b/drivers/gpu/drm/drm_scdc_helper.c +@@ -34,6 +34,19 @@ + * HDMI 2.0 specification. It is a point-to-point protocol that allows the + * HDMI source and HDMI sink to exchange data. The same I2C interface that + * is used to access EDID serves as the transport mechanism for SCDC. ++ * ++ * Note: The SCDC status is going to be lost when the display is ++ * disconnected. This can happen physically when the user disconnects ++ * the cable, but also when a display is switched on (such as waking up ++ * a TV). ++ * ++ * This is further complicated by the fact that, upon a disconnection / ++ * reconnection, KMS won't change the mode on its own. This means that ++ * one can't just rely on setting the SCDC status on enable, but also ++ * has to track the connector status changes using interrupts and ++ * restore the SCDC status. The typical solution for this is to trigger an ++ * empty modeset in drm_connector_helper_funcs.detect_ctx(), like what vc4 does ++ * in vc4_hdmi_reset_link(). + */ + + #define SCDC_I2C_SLAVE_ADDRESS 0x54 +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 21 Sep 2022 14:10:42 +0100 +Subject: [PATCH 1165/1183] media: i2c: imx219: make HBLANK r/w to allow longer + exposures + +The HBLANK control was read-only, and always configured such +that the sensor HTS register was 3448. This limited the maximum +exposure time that could be achieved to around 1.26 secs. + +Make HBLANK read/write so that the line time can be extended, +and thereby allow longer exposures (and slower frame rates). +Retain the overall HTS setting when changing modes rather than +resetting it to a default. + +Signed-off-by: Dave Stevenson +--- + drivers/media/i2c/imx219.c | 47 ++++++++++++++++++++++---------------- + 1 file changed, 27 insertions(+), 20 deletions(-) + +diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c +index 4339ddcb5ebc..185596e47fb6 100644 +--- a/drivers/media/i2c/imx219.c ++++ b/drivers/media/i2c/imx219.c +@@ -63,8 +63,10 @@ + #define IMX219_FLL_STEP 1 + #define IMX219_FLL_DEFAULT 0x0c98 + +-/* HBLANK control - read only */ +-#define IMX219_PPL_DEFAULT 3448 ++/* HBLANK control range */ ++#define IMX219_PPL_MIN 3448 ++#define IMX219_PPL_MAX 0x7ff0 ++#define IMX219_REG_HTS 0x0162 + + /* Exposure control */ + #define IMX219_REG_EXPOSURE 0x015a +@@ -216,8 +218,6 @@ static const struct imx219_reg mode_3280x2464_regs[] = { + {0x4793, 0x10}, + {0x4797, 0x0e}, + {0x479b, 0x0e}, +- {0x0162, 0x0d}, +- {0x0163, 0x78}, + }; + + static const struct imx219_reg mode_1920_1080_regs[] = { +@@ -232,8 +232,6 @@ static const struct imx219_reg mode_1920_1080_regs[] = { + {0x0128, 0x00}, + {0x012a, 0x18}, + {0x012b, 0x00}, +- {0x0162, 0x0d}, +- {0x0163, 0x78}, + {0x0164, 0x02}, + {0x0165, 0xa8}, + {0x0166, 0x0a}, +@@ -330,8 +328,6 @@ static const struct imx219_reg mode_1640_1232_regs[] = { + {0x4793, 0x10}, + {0x4797, 0x0e}, + {0x479b, 0x0e}, +- {0x0162, 0x0d}, +- {0x0163, 0x78}, + }; + + static const struct imx219_reg mode_640_480_regs[] = { +@@ -346,8 +342,6 @@ static const struct imx219_reg mode_640_480_regs[] = { + {0x0128, 0x00}, + {0x012a, 0x18}, + {0x012b, 0x00}, +- {0x0162, 0x0d}, +- {0x0163, 0x78}, + {0x0164, 0x03}, + {0x0165, 0xe8}, + {0x0166, 0x08}, +@@ -800,6 +794,11 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) + (imx219->mode->height + ctrl->val) / + imx219->mode->rate_factor); + break; ++ case V4L2_CID_HBLANK: ++ ret = imx219_write_reg(imx219, IMX219_REG_HTS, ++ IMX219_REG_VALUE_16BIT, ++ imx219->mode->width + ctrl->val); ++ break; + case V4L2_CID_TEST_PATTERN_RED: + ret = imx219_write_reg(imx219, IMX219_REG_TESTP_RED, + IMX219_REG_VALUE_16BIT, ctrl->val); +@@ -1000,6 +999,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, + *framefmt = fmt->format; + } else if (imx219->mode != mode || + imx219->fmt.code != fmt->format.code) { ++ u32 prev_hts = imx219->mode->width + imx219->hblank->val; ++ + imx219->fmt = fmt->format; + imx219->mode = mode; + /* Update limits and set FPS to default */ +@@ -1024,13 +1025,19 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, + imx219->exposure->step, + exposure_def); + /* +- * Currently PPL is fixed to IMX219_PPL_DEFAULT, so +- * hblank depends on mode->width only, and is not +- * changeble in any way other than changing the mode. ++ * Retain PPL setting from previous mode so that the ++ * line time does not change on a mode change. ++ * Limits have to be recomputed as the controls define ++ * the blanking only, so PPL values need to have the ++ * mode width subtracted. + */ +- hblank = IMX219_PPL_DEFAULT - mode->width; +- __v4l2_ctrl_modify_range(imx219->hblank, hblank, hblank, +- 1, hblank); ++ hblank = prev_hts - mode->width; ++ __v4l2_ctrl_modify_range(imx219->hblank, ++ IMX219_PPL_MIN - mode->width, ++ IMX219_PPL_MAX - mode->width, ++ 1, ++ IMX219_PPL_MIN - mode->width); ++ __v4l2_ctrl_s_ctrl(imx219->hblank, hblank); + + /* Scale the pixel rate based on the mode specific factor */ + pixel_rate = +@@ -1412,12 +1419,12 @@ static int imx219_init_controls(struct imx219 *imx219) + V4L2_CID_VBLANK, IMX219_VBLANK_MIN, + IMX219_VTS_MAX - height, 1, + imx219->mode->vts_def - height); +- hblank = IMX219_PPL_DEFAULT - imx219->mode->width; ++ hblank = IMX219_PPL_MIN - imx219->mode->width; + imx219->hblank = v4l2_ctrl_new_std(ctrl_hdlr, &imx219_ctrl_ops, +- V4L2_CID_HBLANK, hblank, hblank, ++ V4L2_CID_HBLANK, hblank, ++ IMX219_PPL_MAX - imx219->mode->width, + 1, hblank); +- if (imx219->hblank) +- imx219->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; ++ + exposure_max = imx219->mode->vts_def - 4; + exposure_def = (exposure_max < IMX219_EXPOSURE_DEFAULT) ? + exposure_max : IMX219_EXPOSURE_DEFAULT; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dom Cobley +Date: Sun, 25 Sep 2022 17:55:44 +0100 +Subject: [PATCH 1166/1183] Revert "Add PHY_ID_BCM54213PE identifier." + +This reverts commit b8e68d153d429de337d173e6bfc295f1d8ba557d. +--- + drivers/net/phy/bcm-phy-ptp.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c +index 08a1824d4a53..ef00d6163061 100644 +--- a/drivers/net/phy/bcm-phy-ptp.c ++++ b/drivers/net/phy/bcm-phy-ptp.c +@@ -915,9 +915,6 @@ struct bcm_ptp_private *bcm_ptp_probe(struct phy_device *phydev) + + switch (BRCM_PHY_MODEL(phydev)) { + case PHY_ID_BCM54210E: +-#ifdef PHY_ID_BCM54213PE +- case PHY_ID_BCM54213PE: +-#endif + break; + default: + return NULL; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Victor Ding <14084856+0dvictor@users.noreply.github.com> +Date: Sun, 25 Sep 2022 14:11:02 +0000 +Subject: [PATCH 1167/1183] ARM: dts: Add dtparams to disable PCIe, HDMI, and + SD card/eMMC + +Under certain situations, it is desired to disable some unused devices. +This patch introduces three parameters allowing disabling PCIe, HDMI, and SD +card (or eMMC on CM4). + +Signed-off-by: Victor Ding +--- + arch/arm/boot/dts/bcm2708-rpi.dtsi | 2 ++ + arch/arm/boot/dts/bcm2711-rpi-ds.dtsi | 4 ++++ + arch/arm/boot/dts/overlays/README | 12 ++++++++++++ + 3 files changed, 18 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi.dtsi b/arch/arm/boot/dts/bcm2708-rpi.dtsi +index e2458b15d64a..69001b05c422 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm2708-rpi.dtsi +@@ -14,8 +14,10 @@ + }; + + __overrides__ { ++ hdmi = <&hdmi>,"status"; + i2c2_iknowwhatimdoing = <&i2c2>,"status"; + i2c2_baudrate = <&i2c2>,"clock-frequency:0"; ++ sd = <&sdhost>,"status"; + sd_poll_once = <&sdhost>,"non-removable?"; + }; + }; +diff --git a/arch/arm/boot/dts/bcm2711-rpi-ds.dtsi b/arch/arm/boot/dts/bcm2711-rpi-ds.dtsi +index 5b18e8f92145..eed443284dd3 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-ds.dtsi ++++ b/arch/arm/boot/dts/bcm2711-rpi-ds.dtsi +@@ -4,6 +4,10 @@ + / { + __overrides__ { + arm_freq; ++ hdmi = <&hdmi0>,"status", ++ <&hdmi1>,"status"; ++ pcie = <&pcie0>,"status"; ++ sd = <&emmc2>,"status"; + }; + + v3dbus: v3dbus { +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index d4a3c32033a6..df3e2992dd6d 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -190,6 +190,9 @@ Params: + to negotiate. Legal values are 10, 100 and + 1000 (default 1000). Pi3B+ only. + ++ hdmi Set to "off" to disable the HDMI interface ++ (default "on") ++ + i2c_arm Set to "on" to enable the ARM's i2c interface + (default "off") + +@@ -217,6 +220,11 @@ Params: + krnbt_baudrate Set the baudrate of the PL011 UART when used + with krnbt=on + ++ pcie Set to "off" to disable the PCIe interface ++ (default "on") ++ (2711 only, but not applicable on CM4S) ++ N.B. USB-A ports on 4B are subsequently disabled ++ + spi Set to "on" to enable the spi interfaces + (default "off") + +@@ -227,6 +235,10 @@ Params: + random Set to "on" to enable the hardware random + number generator (default "on") + ++ sd Set to "off" to disable the SD card (or eMMC on ++ non-lite SKU of CM4). ++ (default "on") ++ + sd_overclock Clock (in MHz) to use when the MMC framework + requests 50MHz + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jonathan Bell +Date: Thu, 22 Sep 2022 14:55:54 +0100 +Subject: [PATCH 1168/1183] usb: xhci: account for num_trbs_free when + invalidating TDs + +If a ring has a number of TDs enqueued past the dequeue pointer, and the +URBs corresponding to these TDs are dequeued, then num_trbs_free isn't +updated to show that these TDs have been converted to no-ops and +effectively "freed". This means that num_trbs_free creeps downwards +until the count is exhausted, which then triggers xhci_ring_expansion() +and effectively leaks memory by infinitely growing the transfer ring. + +This is commonly encounted through the use of a usb-serial port where +the port is repeatedly opened, read, then closed. + +Move the num_trbs_free crediting out of the Set TR Dequeue Pointer +handling and into xhci_invalidate_cancelled_tds(). + +There is a potential for overestimating the actual space on the ring if +the ring is nearly full and TDs are arbitrarily enqueued by a device +driver while it is dequeueing them, but dequeues are usually batched +during device close/shutdown or endpoint error recovery. + +See https://github.com/raspberrypi/linux/issues/5088 + +Signed-off-by: Jonathan Bell +--- + drivers/usb/host/xhci-ring.c | 14 +++----------- + 1 file changed, 3 insertions(+), 11 deletions(-) + +diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c +index 6b4cb26407d5..9651e7b1441c 100644 +--- a/drivers/usb/host/xhci-ring.c ++++ b/drivers/usb/host/xhci-ring.c +@@ -1023,11 +1023,13 @@ static int xhci_invalidate_cancelled_tds(struct xhci_virt_ep *ep) + td->urb->stream_id, td->urb, + cached_td->urb->stream_id, cached_td->urb); + cached_td = td; ++ ring->num_trbs_free += td->num_trbs; + break; + } + } else { + td_to_noop(xhci, ring, td, false); + td->cancel_status = TD_CLEARED; ++ ring->num_trbs_free += td->num_trbs; + } + } + +@@ -1327,10 +1329,7 @@ static void update_ring_for_set_deq_completion(struct xhci_hcd *xhci, + unsigned int ep_index) + { + union xhci_trb *dequeue_temp; +- int num_trbs_free_temp; +- bool revert = false; + +- num_trbs_free_temp = ep_ring->num_trbs_free; + dequeue_temp = ep_ring->dequeue; + + /* If we get two back-to-back stalls, and the first stalled transfer +@@ -1345,8 +1344,6 @@ static void update_ring_for_set_deq_completion(struct xhci_hcd *xhci, + } + + while (ep_ring->dequeue != dev->eps[ep_index].queued_deq_ptr) { +- /* We have more usable TRBs */ +- ep_ring->num_trbs_free++; + ep_ring->dequeue++; + if (trb_is_link(ep_ring->dequeue)) { + if (ep_ring->dequeue == +@@ -1356,15 +1353,10 @@ static void update_ring_for_set_deq_completion(struct xhci_hcd *xhci, + ep_ring->dequeue = ep_ring->deq_seg->trbs; + } + if (ep_ring->dequeue == dequeue_temp) { +- revert = true; ++ xhci_dbg(xhci, "Unable to find new dequeue pointer\n"); + break; + } + } +- +- if (revert) { +- xhci_dbg(xhci, "Unable to find new dequeue pointer\n"); +- ep_ring->num_trbs_free = num_trbs_free_temp; +- } + } + + /* +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 27 Sep 2022 16:04:08 +0100 +Subject: [PATCH 1169/1183] ARM: dts: Don't enable the 8250 UART on CM4S + +CM4S (like CM3, but unlike some CM4) has no Bluetooth, so don't enable +the 8250 support in the kernel. + +See: https://github.com/raspberrypi/linux/issues/5182 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm2711-rpi-cm4s.dts | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4s.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4s.dts +index 03c6a5e29284..2f2d589e178f 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-cm4s.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4s.dts +@@ -7,11 +7,6 @@ + compatible = "raspberrypi,4-compute-module-s", "brcm,bcm2711"; + model = "Raspberry Pi Compute Module 4S"; + +- chosen { +- /* 8250 auxiliary UART instead of pl011 */ +- stdout-path = "serial1:115200n8"; +- }; +- + leds { + led-act { + gpios = <&virtgpio 0 0>; +@@ -159,7 +154,7 @@ + + / { + chosen { +- bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; ++ bootargs = "coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; + }; + + aliases { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 26 Nov 2021 14:02:14 +0000 +Subject: [PATCH 1170/1183] overlays: Add rpi-sense-v2 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 +++ + .../dts/overlays/rpi-sense-v2-overlay.dts | 47 +++++++++++++++++++ + 3 files changed, 54 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/rpi-sense-v2-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 61a5a16af804..c64172e52577 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -197,6 +197,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + rpi-poe.dtbo \ + rpi-poe-plus.dtbo \ + rpi-sense.dtbo \ ++ rpi-sense-v2.dtbo \ + rpi-tv.dtbo \ + rra-digidac1-wm8741-audio.dtbo \ + sainsmart18.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index df3e2992dd6d..31244c93e08c 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -3427,6 +3427,12 @@ Load: dtoverlay=rpi-sense + Params: + + ++Name: rpi-sense-v2 ++Info: Raspberry Pi Sense HAT v2 ++Load: dtoverlay=rpi-sense-v2 ++Params: ++ ++ + Name: rpi-tv + Info: Raspberry Pi TV HAT + Load: dtoverlay=rpi-tv +diff --git a/arch/arm/boot/dts/overlays/rpi-sense-v2-overlay.dts b/arch/arm/boot/dts/overlays/rpi-sense-v2-overlay.dts +new file mode 100644 +index 000000000000..1b86c032259b +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/rpi-sense-v2-overlay.dts +@@ -0,0 +1,47 @@ ++// rpi-sense HAT ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835"; ++ ++ fragment@0 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ rpi-sense@46 { ++ compatible = "rpi,rpi-sense"; ++ reg = <0x46>; ++ keys-int-gpios = <&gpio 23 1>; ++ status = "okay"; ++ }; ++ ++ lsm9ds1-magn@1c { ++ compatible = "st,lsm9ds1-magn"; ++ reg = <0x1c>; ++ status = "okay"; ++ }; ++ ++ lps25h-press@5c { ++ compatible = "st,lps25h-press"; ++ reg = <0x5c>; ++ status = "okay"; ++ }; ++ ++ hts221-humid@5f { ++ compatible = "st,hts221-humid", "st,hts221"; ++ reg = <0x5f>; ++ status = "okay"; ++ }; ++ ++ lsm9ds1-accel@6a { ++ compatible = "st,lsm9ds1-accel"; ++ reg = <0x6a>; ++ status = "okay"; ++ }; ++ }; ++ }; ++}; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Naushir Patuck +Date: Mon, 3 Oct 2022 11:22:07 +0100 +Subject: [PATCH 1171/1183] media: i2c: imx477: Allow dynamic horizontal + blanking control + +Currently, the V4L2_CID_HBLANK control is marked as read-only. Remove this +restriction and allow userland to modify the control if needed. + +Set the maximum limit of the line length to 0xfff0. + +Signed-off-by: Naushir Patuck +--- + drivers/media/i2c/imx477.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/drivers/media/i2c/imx477.c b/drivers/media/i2c/imx477.c +index 53e0656da53d..87816710138e 100644 +--- a/drivers/media/i2c/imx477.c ++++ b/drivers/media/i2c/imx477.c +@@ -54,6 +54,10 @@ MODULE_PARM_DESC(trigger_mode, "Set vsync trigger mode: 1=source, 2=sink"); + #define IMX477_REG_FRAME_LENGTH 0x0340 + #define IMX477_FRAME_LENGTH_MAX 0xffdc + ++/* H_TIMING internal */ ++#define IMX477_REG_LINE_LENGTH 0x0342 ++#define IMX477_LINE_LENGTH_MAX 0xfff0 ++ + /* Long exposure multiplier */ + #define IMX477_LONG_EXP_SHIFT_MAX 7 + #define IMX477_LONG_EXP_SHIFT_REG 0x3100 +@@ -1400,6 +1404,10 @@ static int imx477_set_ctrl(struct v4l2_ctrl *ctrl) + ret = imx477_set_frame_length(imx477, + imx477->mode->height + ctrl->val); + break; ++ case V4L2_CID_HBLANK: ++ ret = imx477_write_reg(imx477, IMX477_REG_LINE_LENGTH, 2, ++ imx477->mode->width + ctrl->val); ++ break; + default: + dev_info(&client->dev, + "ctrl(id:0x%x,val:0x%x) is not handled\n", +@@ -1561,7 +1569,7 @@ unsigned int imx477_get_frame_length(const struct imx477_mode *mode, + + static void imx477_set_framing_limits(struct imx477 *imx477) + { +- unsigned int frm_length_min, frm_length_default, hblank; ++ unsigned int frm_length_min, frm_length_default, hblank_min; + const struct imx477_mode *mode = imx477->mode; + + frm_length_min = imx477_get_frame_length(mode, &mode->timeperframe_min); +@@ -1580,13 +1588,9 @@ static void imx477_set_framing_limits(struct imx477 *imx477) + /* Setting this will adjust the exposure limits as well. */ + __v4l2_ctrl_s_ctrl(imx477->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(imx477->hblank, hblank, hblank, 1, hblank); ++ hblank_min = mode->line_length_pix - mode->width; ++ __v4l2_ctrl_modify_range(imx477->hblank, hblank_min, ++ IMX477_LINE_LENGTH_MAX, 1, hblank_min); + } + + static int imx477_set_pad_format(struct v4l2_subdev *sd, +@@ -2001,10 +2005,6 @@ static int imx477_init_controls(struct imx477 *imx477) + imx477->hblank = v4l2_ctrl_new_std(ctrl_hdlr, &imx477_ctrl_ops, + V4L2_CID_HBLANK, 0, 0xffff, 1, 0); + +- /* HBLANK is read-only for now, but does change with mode. */ +- if (imx477->hblank) +- imx477->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; +- + imx477->exposure = v4l2_ctrl_new_std(ctrl_hdlr, &imx477_ctrl_ops, + V4L2_CID_EXPOSURE, + IMX477_EXPOSURE_MIN, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 3 Oct 2022 14:21:35 +0100 +Subject: [PATCH 1172/1183] vc04_services: bcm2835-codec: Remove redundant + role check + +vidioc_try_encoder_cmd checks the role, but the ioctl is disabled +for any roles in which it is invalid. + +Remove the redundant check. + +Signed-off-by: Dave Stevenson +--- + .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 3 --- + 1 file changed, 3 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 ca063a25ab12..be70be161c2e 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -2463,9 +2463,6 @@ static int vidioc_try_encoder_cmd(struct file *file, void *priv, + { + struct bcm2835_codec_ctx *ctx = file2ctx(file); + +- if (ctx->dev->role != ENCODE && ctx->dev->role != ENCODE_IMAGE) +- return -EINVAL; +- + switch (cmd->cmd) { + case V4L2_ENC_CMD_STOP: + break; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 3 Oct 2022 14:23:15 +0100 +Subject: [PATCH 1173/1183] vc04_services: bcm2835-codec: Allow encoder_cmd on + ISP and deinterlace + +ISP and deinterlace also need a mechanism for passing effectively +an EOS through the pipeline to signal when all buffers have been +processed. + +VIDIOC_ENCODER_CMD does exactly this for encoders, so reuse the same +function for ISP and deinterlace. +(VIDIOC_DECODER_CMD is slightly different in that it also passes +details of when and how to stop, so is not as relevant). + +Signed-off-by: Dave Stevenson +--- + .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 4 ---- + 1 file changed, 4 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 be70be161c2e..ac563d8a3e34 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -3639,8 +3639,6 @@ static int bcm2835_codec_create(struct bcm2835_codec_driver *drv, + video_nr = encode_video_nr; + break; + case ISP: +- 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); +@@ -3649,8 +3647,6 @@ static int bcm2835_codec_create(struct bcm2835_codec_driver *drv, + 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); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 4 Oct 2022 09:52:06 +0100 +Subject: [PATCH 1174/1183] vc04_services: bcm2835-codec: Remove unused + variable + +Signed-off-by: Phil Elwell +--- + .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 2 -- + 1 file changed, 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 ac563d8a3e34..8e44880264dd 100644 +--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c ++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c +@@ -2461,8 +2461,6 @@ static int vidioc_decoder_cmd(struct file *file, void *priv, + static int vidioc_try_encoder_cmd(struct file *file, void *priv, + struct v4l2_encoder_cmd *cmd) + { +- struct bcm2835_codec_ctx *ctx = file2ctx(file); +- + switch (cmd->cmd) { + case V4L2_ENC_CMD_STOP: + break; +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Naushir Patuck +Date: Wed, 5 Oct 2022 09:47:00 +0100 +Subject: [PATCH 1175/1183] media: i2c: imx477: Reset hblank on mode switch + +Reset the hblank control to the minimum value on every mode switch. This is to +account for userland instances that do not yet control hblank, otherwise it +gets set to a non-optimal value. + +Signed-off-by: Naushir Patuck +--- + drivers/media/i2c/imx477.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/media/i2c/imx477.c b/drivers/media/i2c/imx477.c +index 87816710138e..cf7f3c2afdd7 100644 +--- a/drivers/media/i2c/imx477.c ++++ b/drivers/media/i2c/imx477.c +@@ -1591,6 +1591,7 @@ static void imx477_set_framing_limits(struct imx477 *imx477) + hblank_min = mode->line_length_pix - mode->width; + __v4l2_ctrl_modify_range(imx477->hblank, hblank_min, + IMX477_LINE_LENGTH_MAX, 1, hblank_min); ++ __v4l2_ctrl_s_ctrl(imx477->hblank, hblank_min); + } + + static int imx477_set_pad_format(struct v4l2_subdev *sd, +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Naushir Patuck +Date: Wed, 5 Oct 2022 10:52:57 +0100 +Subject: [PATCH 1176/1183] media: i2c: imx477: Do not unconditionally adjust + hblank and vblank limits + +On a mode change, only call imx477_set_framing_limits() to adjust the hblank +and vblank limits if the new mode is different from the existing mode. This +preserves any manual control values the user might have set. + +Signed-off-by: Naushir Patuck +--- + 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 cf7f3c2afdd7..e4cec1c3f9d2 100644 +--- a/drivers/media/i2c/imx477.c ++++ b/drivers/media/i2c/imx477.c +@@ -1627,7 +1627,7 @@ static int imx477_set_pad_format(struct v4l2_subdev *sd, + framefmt = v4l2_subdev_get_try_format(sd, sd_state, + fmt->pad); + *framefmt = fmt->format; +- } else { ++ } else if (imx477->mode != mode) { + imx477->mode = mode; + imx477->fmt_code = fmt->format.code; + imx477_set_framing_limits(imx477); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 7 Oct 2022 10:38:31 +0100 +Subject: [PATCH 1177/1183] nvmem: Use NVMEM_DEVID_AUTO + +It is reasonable to declare multiple nvmem blocks. Unless a unique 'id' +is passed in for each block there may be name clashes. + +Avoid this by using the magic token NVMEM_DEVID_AUTO. + +Fixes: 5a3fa75a4d9cb ("nvmem: Add driver to expose reserved memory as nvmem") + +Signed-off-by: Phil Elwell +--- + drivers/nvmem/rmem.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/nvmem/rmem.c b/drivers/nvmem/rmem.c +index b11c3c974b3d..82554acfc330 100644 +--- a/drivers/nvmem/rmem.c ++++ b/drivers/nvmem/rmem.c +@@ -71,6 +71,7 @@ static int rmem_probe(struct platform_device *pdev) + config.dev = dev; + config.priv = priv; + config.name = "rmem"; ++ config.id = NVMEM_DEVID_AUTO; + config.size = mem->size; + config.reg_read = rmem_read; + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 7 Oct 2022 09:50:42 +0100 +Subject: [PATCH 1178/1183] Bluetooth: btbcm: Allow board-specific firmware + names + +There are some devices available from multiple vendors that report the +same ID. In order to load the appropriate firmware, use the board +name from the FDT as a disambiguating factor, as is done for WLAN +firmwares. + +Signed-off-by: Phil Elwell +--- + drivers/bluetooth/btbcm.c | 30 +++++++++++++++++++++++++++++- + 1 file changed, 29 insertions(+), 1 deletion(-) + +diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c +index a18f289d7346..ee18cfca5d3f 100644 +--- a/drivers/bluetooth/btbcm.c ++++ b/drivers/bluetooth/btbcm.c +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -29,7 +30,7 @@ + #define BDADDR_BCM43341B (&(bdaddr_t) {{0xac, 0x1f, 0x00, 0x1b, 0x34, 0x43}}) + + #define BCM_FW_NAME_LEN 64 +-#define BCM_FW_NAME_COUNT_MAX 2 ++#define BCM_FW_NAME_COUNT_MAX 3 + /* For kmalloc-ing the fw-name array instead of putting it on the stack */ + typedef char bcm_fw_name[BCM_FW_NAME_LEN]; + +@@ -485,6 +486,8 @@ int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done) + struct hci_rp_read_local_version *ver; + const struct bcm_subver_table *bcm_subver_table; + const char *hw_name = NULL; ++ struct device_node *root; ++ char *board_type = NULL; + char postfix[16] = ""; + int fw_name_count = 0; + bcm_fw_name *fw_name; +@@ -550,6 +553,30 @@ int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done) + if (!fw_name) + return -ENOMEM; + ++ root = of_find_node_by_path("/"); ++ if (root) { ++ int i, len; ++ const char *tmp; ++ ++ of_property_read_string_index(root, "compatible", 0, &tmp); ++ ++ /* convert '/'s in the compatible string to '-'s */ ++ len = strlen(tmp) + 1; ++ board_type = kzalloc(len, GFP_KERNEL); ++ strscpy(board_type, tmp, len); ++ for (i = 0; i < board_type[i]; i++) { ++ if (board_type[i] == '/') ++ board_type[i] = '-'; ++ } ++ ++ of_node_put(root); ++ } ++ ++ if (hw_name && board_type && ++ snprintf(fw_name[fw_name_count], BCM_FW_NAME_LEN, ++ "brcm/%s.%s.hcd", hw_name, board_type) < BCM_FW_NAME_LEN) ++ fw_name_count++; ++ + if (hw_name) { + snprintf(fw_name[fw_name_count], BCM_FW_NAME_LEN, + "brcm/%s%s.hcd", hw_name, postfix); +@@ -583,6 +610,7 @@ int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done) + } + + kfree(fw_name); ++ kfree(board_type); + return 0; + } + EXPORT_SYMBOL_GPL(btbcm_initialize); +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 10 Oct 2022 18:43:32 +0100 +Subject: [PATCH 1179/1183] media: i2c: imx290: Correct min HBLANK. + +In the 720p mode the CSI link is run at a lower frequency, and +the minimum HBLANK value has to be increased to avoid generating +more data from the sensor than the link can carry. + +Set the minimum based on the mode. + +Signed-off-by: Dave Stevenson +--- + drivers/media/i2c/imx290.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c +index f7971b972045..656654748c39 100644 +--- a/drivers/media/i2c/imx290.c ++++ b/drivers/media/i2c/imx290.c +@@ -50,7 +50,6 @@ enum imx290_clk_index { + #define IMX290_VMAX_MAX 0x3fff + #define IMX290_HMAX_LOW 0x301c + #define IMX290_HMAX_HIGH 0x301d +-#define IMX290_HMAX_MIN 2200 /* Min of 2200 pixels = 60fps */ + #define IMX290_HMAX_MAX 0xffff + + #define IMX290_EXPOSURE_MIN 1 +@@ -110,7 +109,6 @@ struct imx290 { + struct regmap *regmap; + u8 nlanes; + u8 bpp; +- u16 hmax_min; + + const struct imx290_pixfmt *formats; + +@@ -918,7 +916,7 @@ static int imx290_set_fmt(struct v4l2_subdev *sd, + + if (imx290->hblank) + __v4l2_ctrl_modify_range(imx290->hblank, +- imx290->hmax_min - mode->width, ++ mode->hmax - mode->width, + IMX290_HMAX_MAX - mode->width, + 1, mode->hmax - mode->width); + if (imx290->vblank) +@@ -1298,7 +1296,6 @@ static int imx290_probe(struct i2c_client *client) + ret = -EINVAL; + goto free_err; + } +- imx290->hmax_min = IMX290_HMAX_MIN; + + dev_dbg(dev, "Using %u data lanes\n", imx290->nlanes); + +@@ -1375,7 +1372,7 @@ static int imx290_probe(struct i2c_client *client) + mode = imx290->current_mode; + imx290->hblank = v4l2_ctrl_new_std(&imx290->ctrls, &imx290_ctrl_ops, + V4L2_CID_HBLANK, +- imx290->hmax_min - mode->width, ++ mode->hmax - mode->width, + IMX290_HMAX_MAX - mode->width, 1, + mode->hmax - mode->width); + +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 12 Oct 2022 10:04:31 +0100 +Subject: [PATCH 1180/1183] overlays: i2c-rtc: Add RV3032 support + +See: https://github.com/raspberrypi/linux/issues/5205 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/i2c-rtc-common.dtsi | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-common.dtsi b/arch/arm/boot/dts/overlays/i2c-rtc-common.dtsi +index 5e03764b67b0..94b0243bc328 100644 +--- a/arch/arm/boot/dts/overlays/i2c-rtc-common.dtsi ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-common.dtsi +@@ -283,6 +283,19 @@ + }; + }; + ++ fragment@21 { ++ target = <&i2cbus>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ rv3032: rv3032@51 { ++ compatible = "microcrystal,rv3032"; ++ reg = <0x51>; ++ }; ++ }; ++ }; ++ + + __overrides__ { + abx80x = <0>,"+0"; +@@ -306,6 +319,7 @@ + s35390a = <0>,"+18"; + bq32000 = <0>,"+19"; + rv8803 = <0>,"+20"; ++ rv3032 = <0>,"+21"; + + addr = <&abx80x>, "reg:0", + <&ds1307>, "reg:0", +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 12 Oct 2022 10:05:19 +0100 +Subject: [PATCH 1181/1183] configs: Add RTC_DRV_RV3032=m + +See: https://github.com/raspberrypi/linux/issues/5205 + +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 127ef0b8fa9b..8407dc90f383 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1303,6 +1303,7 @@ CONFIG_RTC_DRV_RX8581=m + CONFIG_RTC_DRV_RX8025=m + CONFIG_RTC_DRV_EM3027=m + CONFIG_RTC_DRV_RV3028=m ++CONFIG_RTC_DRV_RV3032=m + CONFIG_RTC_DRV_RV8803=m + CONFIG_RTC_DRV_SD3078=m + CONFIG_RTC_DRV_M41T93=m +diff --git a/arch/arm/configs/bcm2711_defconfig b/arch/arm/configs/bcm2711_defconfig +index 2b44b285914e..2639d294b004 100644 +--- a/arch/arm/configs/bcm2711_defconfig ++++ b/arch/arm/configs/bcm2711_defconfig +@@ -1326,6 +1326,7 @@ CONFIG_RTC_DRV_RX8581=m + CONFIG_RTC_DRV_RX8025=m + CONFIG_RTC_DRV_EM3027=m + CONFIG_RTC_DRV_RV3028=m ++CONFIG_RTC_DRV_RV3032=m + CONFIG_RTC_DRV_RV8803=m + CONFIG_RTC_DRV_SD3078=m + CONFIG_RTC_DRV_M41T93=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 41bb28958d17..9b74e9d254d2 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1295,6 +1295,7 @@ CONFIG_RTC_DRV_RX8581=m + CONFIG_RTC_DRV_RX8025=m + CONFIG_RTC_DRV_EM3027=m + CONFIG_RTC_DRV_RV3028=m ++CONFIG_RTC_DRV_RV3032=m + CONFIG_RTC_DRV_RV8803=m + CONFIG_RTC_DRV_SD3078=m + CONFIG_RTC_DRV_M41T93=m +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index 15a8c455471a..4c06a60f79dd 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -1336,6 +1336,7 @@ CONFIG_RTC_DRV_RX8581=m + CONFIG_RTC_DRV_RX8025=m + CONFIG_RTC_DRV_EM3027=m + CONFIG_RTC_DRV_RV3028=m ++CONFIG_RTC_DRV_RV3032=m + CONFIG_RTC_DRV_RV8803=m + CONFIG_RTC_DRV_SD3078=m + CONFIG_RTC_DRV_M41T93=m +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index 9477b58043cb..fbcbd19bbd14 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -1239,6 +1239,7 @@ CONFIG_RTC_DRV_RX8581=m + CONFIG_RTC_DRV_RX8025=m + CONFIG_RTC_DRV_EM3027=m + CONFIG_RTC_DRV_RV3028=m ++CONFIG_RTC_DRV_RV3032=m + CONFIG_RTC_DRV_RV8803=m + CONFIG_RTC_DRV_SD3078=m + CONFIG_RTC_DRV_M41T93=m +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tim Gover +Date: Fri, 7 Oct 2022 11:04:27 +0100 +Subject: [PATCH 1182/1183] ARM: dts: Add nvmem node for BCM2711 bootloader + public key + +Make a copy of the bootloader secure-boot public key available to the OS +via an nvmem node. The placement information is populated by the +Raspberry Pi firmware if a public key is present in the BCM2711 +bootloader EEPROM. + +Signed-off-by: Tim Gover +--- + arch/arm/boot/dts/bcm2711-rpi.dtsi | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi.dtsi b/arch/arm/boot/dts/bcm2711-rpi.dtsi +index ca266c5d9f9b..3c0bc92ab39c 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm2711-rpi.dtsi +@@ -15,6 +15,7 @@ + ethernet0 = &genet; + pcie0 = &pcie0; + blconfig = &blconfig; ++ blpubkey = &blpubkey; + }; + }; + +@@ -67,6 +68,18 @@ + no-map; + status = "disabled"; + }; ++ /* ++ * RPi4 will copy the binary public key blob (if present) from the bootloader ++ * into memory for use by the OS. ++ */ ++ blpubkey: nvram@1 { ++ compatible = "raspberrypi,bootloader-public-key", "nvmem-rmem"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ reg = <0x0 0x0 0x0>; ++ no-map; ++ status = "disabled"; ++ }; + }; + + &vchiq { +-- +2.18.4 + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Pablo Greco +Date: Sat, 15 Oct 2022 19:46:30 +0000 +Subject: [PATCH 1183/1183] Sync potential bad rebases with upstream + +--- + drivers/gpu/drm/vc4/Kconfig | 1 - + drivers/gpu/drm/vc4/vc4_drv.c | 4 +- + drivers/gpu/drm/vc4/vc4_dsi.c | 25 +++--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 38 ++++++--- + drivers/gpu/drm/vc4/vc4_plane.c | 13 +-- + drivers/net/usb/smsc95xx.c | 139 +++++++++++++------------------- + 6 files changed, 103 insertions(+), 117 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig +index 4ed07b7cefe3..52a1c309cb4a 100644 +--- a/drivers/gpu/drm/vc4/Kconfig ++++ b/drivers/gpu/drm/vc4/Kconfig +@@ -5,7 +5,6 @@ config DRM_VC4 + depends on DRM + depends on SND && SND_SOC + depends on COMMON_CLK +- depends on PM + select DRM_KMS_HELPER + select DRM_KMS_CMA_HELPER + select DRM_GEM_CMA_HELPER +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 87369110ce0b..bd9ea20c29b0 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -281,9 +281,9 @@ static void vc4_component_unbind_all(void *ptr) + component_unbind_all(vc4->dev, &vc4->base); + } + +-static const struct of_device_id vc4_dma_range_matches[] = { +- { .compatible = "brcm,bcm2711-hvs" }, ++const struct of_device_id vc4_dma_range_matches[] = { + { .compatible = "brcm,bcm2835-hvs" }, ++ { .compatible = "brcm,bcm2711-hvs" }, + { .compatible = "raspberrypi,rpi-firmware-kms" }, + { .compatible = "brcm,bcm2835-v3d" }, + { .compatible = "brcm,cygnus-v3d" }, +diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c +index a10e96aba197..676dc9f4f60c 100644 +--- a/drivers/gpu/drm/vc4/vc4_dsi.c ++++ b/drivers/gpu/drm/vc4/vc4_dsi.c +@@ -1650,20 +1650,23 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + struct platform_device *pdev = to_platform_device(dev); + struct drm_device *drm = dev_get_drvdata(master); + struct vc4_dsi *dsi = dev_get_drvdata(dev); +- struct vc4_dsi_encoder *vc4_dsi_encoder; ++ const struct of_device_id *match; ++ struct drm_encoder *encoder = &dsi->encoder.base; + int ret; + +- dsi->variant = of_device_get_match_data(dev); ++ vc4_dsi_get(dsi); + +- vc4_dsi_encoder = devm_kzalloc(dev, sizeof(*vc4_dsi_encoder), +- GFP_KERNEL); +- if (!vc4_dsi_encoder) +- return -ENOMEM; ++ ret = drmm_add_action_or_reset(drm, vc4_dsi_release_action, dsi); ++ if (ret) ++ return ret; + +- vc4_dsi_encoder->base.type = dsi->variant->port ? +- VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0; +- vc4_dsi_encoder->dsi = dsi; +- dsi->encoder = &vc4_dsi_encoder->base.base; ++ match = of_match_device(vc4_dsi_dt_match, dev); ++ if (!match) ++ return -ENODEV; ++ ++ dsi->variant = match->data; ++ dsi->encoder.type = dsi->variant->port ? ++ VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0; + + dsi->regs = vc4_ioremap_regs(pdev, 0); + if (IS_ERR(dsi->regs)) +@@ -1796,7 +1799,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) + ret = drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); + if (ret) { + dev_err(dev, "bridge attach failed: %d\n", ret); +- goto err_free_dma; ++ return ret; + } + + return 0; +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index a8f3d5274fdb..c52e4d6bbcc3 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -2637,10 +2637,32 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) + struct device *dev = &vc4_hdmi->pdev->dev; + struct platform_device *codec_pdev; + const __be32 *addr; +- int index, len; ++ int index; + int ret; ++ int len; + +- if (!of_find_property(dev->of_node, "dmas", &len) || !len) { ++ /* ++ * ASoC makes it a bit hard to retrieve a pointer to the ++ * vc4_hdmi structure. Registering the card will overwrite our ++ * device drvdata with a pointer to the snd_soc_card structure, ++ * which can then be used to retrieve whatever drvdata we want ++ * to associate. ++ * ++ * However, that doesn't fly in the case where we wouldn't ++ * register an ASoC card (because of an old DT that is missing ++ * the dmas properties for example), then the card isn't ++ * registered and the device drvdata wouldn't be set. ++ * ++ * We can deal with both cases by making sure a snd_soc_card ++ * pointer and a vc4_hdmi structure are pointing to the same ++ * memory address, so we can treat them indistinctly without any ++ * issue. ++ */ ++ BUILD_BUG_ON(offsetof(struct vc4_hdmi_audio, card) != 0); ++ BUILD_BUG_ON(offsetof(struct vc4_hdmi, audio) != 0); ++ ++ if (!of_find_property(dev->of_node, "dmas", &len) || ++ len == 0) { + dev_warn(dev, + "'dmas' DT property is missing or empty, no HDMI audio\n"); + return 0; +@@ -3534,7 +3556,7 @@ static int vc5_hdmi_init_resources(struct drm_device *drm, + return 0; + } + +-static int vc4_hdmi_runtime_suspend(struct device *dev) ++static int __maybe_unused vc4_hdmi_runtime_suspend(struct device *dev) + { + struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); + +@@ -3661,14 +3683,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + if (ret) + return ret; + +- /* +- * We need to have the device powered up at this point to call +- * our reset hook and for the CEC init. +- */ +- ret = pm_runtime_resume_and_get(dev); +- if (ret) +- goto err_disable_runtime_pm; +- + ret = pm_runtime_resume_and_get(dev); + if (ret) + return ret; +@@ -3712,8 +3726,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + + err_put_runtime_pm: + pm_runtime_put_sync(dev); +-err_disable_runtime_pm: +- pm_runtime_disable(dev); + + return ret; + } +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 2150cee5a405..3211fb82dbe2 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -458,15 +458,10 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) + for (i = 0; i < num_planes; i++) + vc4_state->offsets[i] = bo->paddr + fb->offsets[i]; + +- /* +- * We don't support subpixel source positioning for scaling, +- * but fractional coordinates can be generated by clipping +- * so just round for now +- */ +- vc4_state->src_x = DIV_ROUND_CLOSEST(state->src.x1, 1 << 16); +- vc4_state->src_y = DIV_ROUND_CLOSEST(state->src.y1, 1 << 16); +- vc4_state->src_w[0] = DIV_ROUND_CLOSEST(state->src.x2, 1 << 16) - vc4_state->src_x; +- vc4_state->src_h[0] = DIV_ROUND_CLOSEST(state->src.y2, 1 << 16) - vc4_state->src_y; ++ vc4_state->src_x = state->src.x1; ++ vc4_state->src_y = state->src.y1; ++ vc4_state->src_w[0] = state->src.x2 - vc4_state->src_x; ++ vc4_state->src_h[0] = state->src.y2 - vc4_state->src_y; + + vc4_state->crtc_x = state->dst.x1; + vc4_state->crtc_y = state->dst.y1; +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index cedd187bf2d2..7b0d7dc531c0 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -18,8 +18,6 @@ + #include + #include + #include +-#include +-#include + #include + #include + #include "smsc95xx.h" +@@ -54,9 +52,6 @@ + SUSPEND_SUSPEND2 | SUSPEND_SUSPEND3) + #define MAC_ADDR_LEN (6) + +-#define SMSC95XX_NR_IRQS (1) /* raise to 12 for GPIOs */ +-#define PHY_HWIRQ (SMSC95XX_NR_IRQS - 1) +- + struct smsc95xx_priv { + u32 mac_cr; + u32 hash_hi; +@@ -65,12 +60,8 @@ struct smsc95xx_priv { + spinlock_t mac_cr_lock; + u8 features; + u8 suspend_flags; +- struct irq_chip irqchip; +- struct irq_domain *irqdomain; +- struct fwnode_handle *irqfwnode; + struct mii_bus *mdiobus; + struct phy_device *phydev; +- struct task_struct *pm_task; + }; + + static bool turbo_mode = true; +@@ -92,14 +83,13 @@ MODULE_PARM_DESC(macaddr, "MAC address"); + static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, + u32 *data, int in_pm) + { +- struct smsc95xx_priv *pdata = dev->driver_priv; + u32 buf; + int ret; + int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16); + + BUG_ON(!dev); + +- if (current != pdata->pm_task) ++ if (!in_pm) + fn = usbnet_read_cmd; + else + fn = usbnet_read_cmd_nopm; +@@ -123,14 +113,13 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, + static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index, + u32 data, int in_pm) + { +- struct smsc95xx_priv *pdata = dev->driver_priv; + u32 buf; + int ret; + int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16); + + BUG_ON(!dev); + +- if (current != pdata->pm_task) ++ if (!in_pm) + fn = usbnet_write_cmd; + else + fn = usbnet_write_cmd_nopm; +@@ -619,8 +608,6 @@ static void smsc95xx_mac_update_fullduplex(struct usbnet *dev) + + static void smsc95xx_status(struct usbnet *dev, struct urb *urb) + { +- struct smsc95xx_priv *pdata = dev->driver_priv; +- unsigned long flags; + u32 intdata; + + if (urb->actual_length != 4) { +@@ -632,15 +619,11 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) + intdata = get_unaligned_le32(urb->transfer_buffer); + netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata); + +- local_irq_save(flags); +- + if (intdata & INT_ENP_PHY_INT_) +- generic_handle_domain_irq(pdata->irqdomain, PHY_HWIRQ); ++ ; + else + netdev_warn(dev->net, "unexpected interrupt, intdata=0x%08X\n", + intdata); +- +- local_irq_restore(flags); + } + + /* Enable or disable Tx & Rx checksum offload engines */ +@@ -1153,9 +1136,8 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + { + struct smsc95xx_priv *pdata; + bool is_internal_phy; +- char usb_path[64]; +- int ret, phy_irq; + u32 val; ++ int ret; + + printk(KERN_INFO SMSC_CHIPNAME " v" SMSC_DRIVER_VERSION "\n"); + +@@ -1195,38 +1177,10 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + if (ret) + goto free_pdata; + +- /* create irq domain for use by PHY driver and GPIO consumers */ +- usb_make_path(dev->udev, usb_path, sizeof(usb_path)); +- pdata->irqfwnode = irq_domain_alloc_named_fwnode(usb_path); +- if (!pdata->irqfwnode) { +- ret = -ENOMEM; +- goto free_pdata; +- } +- +- pdata->irqdomain = irq_domain_create_linear(pdata->irqfwnode, +- SMSC95XX_NR_IRQS, +- &irq_domain_simple_ops, +- pdata); +- if (!pdata->irqdomain) { +- ret = -ENOMEM; +- goto free_irqfwnode; +- } +- +- phy_irq = irq_create_mapping(pdata->irqdomain, PHY_HWIRQ); +- if (!phy_irq) { +- ret = -ENOENT; +- goto remove_irqdomain; +- } +- +- pdata->irqchip = dummy_irq_chip; +- pdata->irqchip.name = SMSC_CHIPNAME; +- irq_set_chip_and_handler_name(phy_irq, &pdata->irqchip, +- handle_simple_irq, "phy"); +- + pdata->mdiobus = mdiobus_alloc(); + if (!pdata->mdiobus) { + ret = -ENOMEM; +- goto dispose_irq; ++ goto free_pdata; + } + + ret = smsc95xx_read_reg(dev, HW_CFG, &val); +@@ -1259,7 +1213,6 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + goto unregister_mdio; + } + +- pdata->phydev->irq = phy_irq; + pdata->phydev->is_internal = is_internal_phy; + + /* detect device revision as different features may be available */ +@@ -1302,15 +1255,6 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + free_mdio: + mdiobus_free(pdata->mdiobus); + +-dispose_irq: +- irq_dispose_mapping(phy_irq); +- +-remove_irqdomain: +- irq_domain_remove(pdata->irqdomain); +- +-free_irqfwnode: +- irq_domain_free_fwnode(pdata->irqfwnode); +- + free_pdata: + kfree(pdata); + return ret; +@@ -1323,9 +1267,6 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf) + phy_disconnect(dev->net->phydev); + mdiobus_unregister(pdata->mdiobus); + mdiobus_free(pdata->mdiobus); +- irq_dispose_mapping(irq_find_mapping(pdata->irqdomain, PHY_HWIRQ)); +- irq_domain_remove(pdata->irqdomain); +- irq_domain_free_fwnode(pdata->irqfwnode); + netif_dbg(dev, ifdown, dev->net, "free pdata\n"); + kfree(pdata); + } +@@ -1350,6 +1291,29 @@ static u32 smsc_crc(const u8 *buffer, size_t len, int filter) + return crc << ((filter % 2) * 16); + } + ++static int smsc95xx_enable_phy_wakeup_interrupts(struct usbnet *dev, u16 mask) ++{ ++ int ret; ++ ++ netdev_dbg(dev->net, "enabling PHY wakeup interrupts\n"); ++ ++ /* read to clear */ ++ ret = smsc95xx_mdio_read_nopm(dev, PHY_INT_SRC); ++ if (ret < 0) ++ return ret; ++ ++ /* enable interrupt source */ ++ ret = smsc95xx_mdio_read_nopm(dev, PHY_INT_MASK); ++ if (ret < 0) ++ return ret; ++ ++ ret |= mask; ++ ++ smsc95xx_mdio_write_nopm(dev, PHY_INT_MASK, ret); ++ ++ return 0; ++} ++ + static int smsc95xx_link_ok_nopm(struct usbnet *dev) + { + int ret; +@@ -1516,6 +1480,7 @@ static int smsc95xx_enter_suspend3(struct usbnet *dev) + static int smsc95xx_autosuspend(struct usbnet *dev, u32 link_up) + { + struct smsc95xx_priv *pdata = dev->driver_priv; ++ int ret; + + if (!netif_running(dev->net)) { + /* interface is ifconfig down so fully power down hw */ +@@ -1534,10 +1499,27 @@ static int smsc95xx_autosuspend(struct usbnet *dev, u32 link_up) + } + + netdev_dbg(dev->net, "autosuspend entering SUSPEND1\n"); ++ ++ /* enable PHY wakeup events for if cable is attached */ ++ ret = smsc95xx_enable_phy_wakeup_interrupts(dev, ++ PHY_INT_MASK_ANEG_COMP_); ++ if (ret < 0) { ++ netdev_warn(dev->net, "error enabling PHY wakeup ints\n"); ++ return ret; ++ } ++ + netdev_info(dev->net, "entering SUSPEND1 mode\n"); + return smsc95xx_enter_suspend1(dev); + } + ++ /* enable PHY wakeup events so we remote wakeup if cable is pulled */ ++ ret = smsc95xx_enable_phy_wakeup_interrupts(dev, ++ PHY_INT_MASK_LINK_DOWN_); ++ if (ret < 0) { ++ netdev_warn(dev->net, "error enabling PHY wakeup ints\n"); ++ return ret; ++ } ++ + netdev_dbg(dev->net, "autosuspend entering SUSPEND3\n"); + return smsc95xx_enter_suspend3(dev); + } +@@ -1549,12 +1531,9 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) + u32 val, link_up; + int ret; + +- pdata->pm_task = current; +- + ret = usbnet_suspend(intf, message); + if (ret < 0) { + netdev_warn(dev->net, "usbnet_suspend error\n"); +- pdata->pm_task = NULL; + return ret; + } + +@@ -1606,6 +1585,13 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) + } + + if (pdata->wolopts & WAKE_PHY) { ++ ret = smsc95xx_enable_phy_wakeup_interrupts(dev, ++ (PHY_INT_MASK_ANEG_COMP_ | PHY_INT_MASK_LINK_DOWN_)); ++ if (ret < 0) { ++ netdev_warn(dev->net, "error enabling PHY wakeup ints\n"); ++ goto done; ++ } ++ + /* if link is down then configure EDPD and enter SUSPEND1, + * otherwise enter SUSPEND0 below + */ +@@ -1794,7 +1780,6 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) + if (ret && PMSG_IS_AUTO(message)) + usbnet_resume(intf); + +- pdata->pm_task = NULL; + return ret; + } + +@@ -1815,53 +1800,45 @@ static int smsc95xx_resume(struct usb_interface *intf) + /* do this first to ensure it's cleared even in error case */ + pdata->suspend_flags = 0; + +- pdata->pm_task = current; +- + if (suspend_flags & SUSPEND_ALLMODES) { + /* clear wake-up sources */ + ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val); + if (ret < 0) +- goto done; ++ return ret; + + val &= ~(WUCSR_WAKE_EN_ | WUCSR_MPEN_); + + ret = smsc95xx_write_reg_nopm(dev, WUCSR, val); + if (ret < 0) +- goto done; ++ return ret; + + /* clear wake-up status */ + ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); + if (ret < 0) +- goto done; ++ return ret; + + val &= ~PM_CTL_WOL_EN_; + val |= PM_CTL_WUPS_; + + ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); + if (ret < 0) +- goto done; ++ return ret; + } + +- phy_init_hw(pdata->phydev); +- + ret = usbnet_resume(intf); + if (ret < 0) + netdev_warn(dev->net, "usbnet_resume error\n"); + +-done: +- pdata->pm_task = NULL; ++ phy_init_hw(pdata->phydev); + return ret; + } + + static int smsc95xx_reset_resume(struct usb_interface *intf) + { + struct usbnet *dev = usb_get_intfdata(intf); +- struct smsc95xx_priv *pdata = dev->driver_priv; + int ret; + +- pdata->pm_task = current; + ret = smsc95xx_reset(dev); +- pdata->pm_task = NULL; + if (ret < 0) + return ret; + +-- +2.18.4 + diff --git a/SPECS/raspberrypi2.spec b/SPECS/raspberrypi2.spec index de48179..7f04a20 100644 --- a/SPECS/raspberrypi2.spec +++ b/SPECS/raspberrypi2.spec @@ -1,5 +1,5 @@ -%global commit_firmware_long f95b607c72f9f6d4ea27140635f1e55078ef6f74 -%global commit_linux_long a90998a3e549911234f9f707050858b98b71360f +%global commit_firmware_long bfbd42ef2c93eb4c4b688759a9c879423b479448 +%global commit_linux_long ab70db591ba6a3688192e773e967cd5015a693a8 ExclusiveArch: aarch64 armv7hl @@ -32,7 +32,7 @@ ExclusiveArch: aarch64 armv7hl %define extra_version 1 %define kversion 5.15 -%define kfullversion %{kversion}.59 +%define kfullversion %{kversion}.74 Name: raspberrypi2 Version: %{kfullversion} @@ -297,6 +297,9 @@ cp $(ls -1 /boot/config-kernel-*-*|sort -V|tail -1) /boot/config-kernel.inc %doc /boot/LICENCE.broadcom %changelog +* Sat Oct 15 2022 Pablo Greco - 5.15.74 +- Update to version v5.5.74 + * Sun Aug 7 2022 Pablo Greco - 5.15.59 - Update to version v5.15.59