]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: tc358743: Return an appropriate colorspace from tc358743_set_fmt
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Wed, 11 Jun 2025 18:37:16 +0000 (19:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:26:00 +0000 (16:26 +0200)
commit2f402cda9006e15985948fe382b1edba05fcd044
tree73d33fa16a5c52da8db89b980f3a0a80ef069c9a
parent668f52845081decabb8bba016f6c2e427aeb726e
media: tc358743: Return an appropriate colorspace from tc358743_set_fmt

[ Upstream commit 377cc006a364dfdab2f3f221cfad63a9265200b8 ]

When calling tc358743_set_fmt, the code was calling tc358743_get_fmt
to choose a valid format. However that sets the colorspace
based on information read back from the chip, not the colour
format requested.

The result was that if you called try or set format for UYVY
when the current format was RGB3 then you would get told SRGB,
and try RGB3 when current was UYVY and you would get told
SMPTE170M.

The value programmed in the VI_REP register for the colorspace
is always set by this driver, therefore there is no need to read
back the value, and never set to REC709.
Return the colorspace based on the format set/tried instead.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/tc358743.c