difos/target/linux/bcm27xx/patches-6.12/950-0295-media-adv7180-Nasty-hack-to-allow-input-selection.patch
Shiji Yang 30cdc48360 kernel: bump 6.12 to 6.12.31
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.31

Remove upstreamed patches:
  backport-6.12/780-27-v6.15-r8169-don-t-scan-PHY-addresses-0.patch [1]
  backport-6.12/780-33-v6.15-r8169-disable-RTL8126-ZRX-DC-timeout.patch [2]
  bcm27xx/patches-6.12/950-0315-media-i2c-imx219-Correct-the-minimum-vblanking-value.patch [3]
  bcm27xx/patches-6.12/950-0857-drm-v3d-Add-clock-handling.patch [4]
  bcm27xx/patches-6.12/950-0874-PCI-brcmstb-Expand-inbound-window-size-up-to-64GB.patch [5]
  bcm27xx/patches-6.12/950-0877-PCI-brcmstb-Adding-a-softdep-to-MIP-MSI-X-driver.patch [6]
  bcm27xx/patches-6.12/950-0960-media-imx335-Set-vblank-immediately.patch [7]

Manually rebased patches:
  d1/patches-6.12/0009-ASoC-sunxi-sun4i-codec-add-basic-support-for-D1-audi.patch

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=ba59747562c49974cbace989d76b94a8331da442
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=2780aa8394415df0a69e3b908d6dd8c79e1d1bcc
[3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=9a981079097bee6a0583877798de0b240717bdde
[4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=bbd6dc1fb6c56267ad1d58810d92287fcd5b0058
[5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=3ffaa2e999380477774e76680ff4cef247451168
[6] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=12153e3948c596737853c3ec4ff7e4e3f4a9f9a6
[7] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.31&id=8d7e13c31c52690655883dff604238b0760a3644

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18953
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-05-31 17:35:29 +02:00

89 lines
2.4 KiB
Diff

From 46324608d77fc9ba0109c732eab83605c9ee37c5 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
Date: Wed, 31 Oct 2018 15:00:04 +0000
Subject: [PATCH] media: adv7180: Nasty hack to allow input selection.
Whilst the adv7180 driver support s_routing, nothing else
does, and there is a missing lump of framework code to
define the mapping from connectors on a board to the inputs
they represent on the ADV7180.
Add a nasty hack to take a module parameter that is passed in
to s_routing on any call to G_STD, or S_STD (or subdev
g_input_status call).
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
---
drivers/media/i2c/adv7180.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -189,6 +189,10 @@
/* Initial number of frames to skip to avoid possible garbage */
#define ADV7180_NUM_OF_SKIP_FRAMES 2
+static int dbg_input;
+module_param(dbg_input, int, 0644);
+MODULE_PARM_DESC(dbg_input, "Input number (0-31)");
+
struct adv7180_state;
#define ADV7180_FLAG_RESET_POWERED BIT(0)
@@ -408,10 +412,24 @@ out:
return ret;
}
+static void adv7180_check_input(struct v4l2_subdev *sd)
+{
+ struct adv7180_state *state = to_state(sd);
+
+ if (state->input != dbg_input)
+ if (adv7180_s_routing(sd, dbg_input, 0, 0))
+ /* Failed - reset dbg_input */
+ dbg_input = state->input;
+}
+
static int adv7180_g_input_status(struct v4l2_subdev *sd, u32 *status)
{
struct adv7180_state *state = to_state(sd);
- int ret = mutex_lock_interruptible(&state->mutex);
+ int ret;
+
+ adv7180_check_input(sd);
+
+ ret = mutex_lock_interruptible(&state->mutex);
if (ret)
return ret;
@@ -437,7 +455,11 @@ static int adv7180_program_std(struct ad
static int adv7180_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
{
struct adv7180_state *state = to_state(sd);
- int ret = mutex_lock_interruptible(&state->mutex);
+ int ret;
+
+ adv7180_check_input(sd);
+
+ ret = mutex_lock_interruptible(&state->mutex);
if (ret)
return ret;
@@ -459,6 +481,8 @@ static int adv7180_g_std(struct v4l2_sub
{
struct adv7180_state *state = to_state(sd);
+ adv7180_check_input(sd);
+
*norm = state->curr_norm;
return 0;
@@ -900,6 +924,8 @@ static int adv7180_s_stream(struct v4l2_
return 0;
}
+ adv7180_check_input(sd);
+
/* Must wait until querystd released the lock */
ret = mutex_lock_interruptible(&state->mutex);
if (ret)