diff options
| author | Hans de Goede <hansg@kernel.org> | 2025-10-14 20:40:14 +0300 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2026-03-04 15:21:41 +0300 |
| commit | b9c3b0a1363669ee9ffcc3e34412281b3ea1810d (patch) | |
| tree | bb7bcbadc6edad27d71c315fa6dbe11b7728a120 /drivers/media/i2c | |
| parent | b32a74bdc0a675cd02a81c96e924cc48f76dc176 (diff) | |
| download | linux-b9c3b0a1363669ee9ffcc3e34412281b3ea1810d.tar.xz | |
media: i2c: ov01a10: Fix test-pattern disabling
[ Upstream commit 409fb57c1b3deada4b8e153eb6344afb3c2dfb9c ]
When the test-pattern control gets set to 0 (Disabled) 0 should be written
to the test-pattern register, rather then doing nothing.
Fixes: 0827b58dabff ("media: i2c: add ov01a10 image sensor driver")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hansg@kernel.org>
Tested-by: Mehdi Djait <mehdi.djait@linux.intel.com> # Dell XPS 9315
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/media/i2c')
| -rw-r--r-- | drivers/media/i2c/ov01a10.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/media/i2c/ov01a10.c b/drivers/media/i2c/ov01a10.c index 835c2d2ff514..bb353e7d4806 100644 --- a/drivers/media/i2c/ov01a10.c +++ b/drivers/media/i2c/ov01a10.c @@ -250,9 +250,8 @@ static const struct ov01a10_reg sensor_1280x800_setting[] = { static const char * const ov01a10_test_pattern_menu[] = { "Disabled", "Color Bar", - "Top-Bottom Darker Color Bar", - "Right-Left Darker Color Bar", - "Color Bar type 4", + "Left-Right Darker Color Bar", + "Bottom-Top Darker Color Bar", }; static const s64 link_freq_menu_items[] = { @@ -407,10 +406,8 @@ static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain) static int ov01a10_test_pattern(struct ov01a10 *ov01a10, u32 pattern) { - if (!pattern) - return 0; - - pattern = (pattern - 1) | OV01A10_TEST_PATTERN_ENABLE; + if (pattern) + pattern |= OV01A10_TEST_PATTERN_ENABLE; return ov01a10_write_reg(ov01a10, OV01A10_REG_TEST_PATTERN, 1, pattern); } |
