media: tc358743: Return an appropriate colorspace from tc358743_set_fmt
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Thu, 22 Nov 2018 17:31:06 +0000 (17:31 +0000)
committerpopcornmix <popcornmix@gmail.com>
Mon, 13 May 2019 23:08:10 +0000 (00:08 +0100)
commit597fd239a31503318f9777ba3423e69cc9167839
tree902572b581df98e0d2f10d4a1727cc039bfc8e47
parent8556c79ab523d333cf5894ed2d50a51a048bfb49
media: tc358743: Return an appropriate colorspace from tc358743_set_fmt

When calling tc358743_set_fmt, the code was calling tc358743_get_fmt
to choose a valid format. However that sets the colorspace
based on what was read back from the chip. When you set the format,
then the driver would choose and program the colorspace based
on the format code.

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 into the chip is determined by this driver,
therefore there is no need to read back the value. Return the
colorspace based on the format set/tried instead.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
drivers/media/i2c/tc358743.c