OSDN Git Service

media: i2c: ov5670: Support single-lane operation
authorLuca Weiss <luca@z3ntu.xyz>
Fri, 10 Feb 2023 20:33:18 +0000 (21:33 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 20 Mar 2023 14:54:56 +0000 (15:54 +0100)
commita97b24febd1f3acbd3bebfe7230e679a769efafe
treedde04b6818b82fe7b9a487af419d1afa026c778d
parent4ed6627b0c4d6d6ddf21f0b5ae15ec073cd7d69e
media: i2c: ov5670: Support single-lane operation

Currently the driver always configures the sensor for dual-lane MIPI
output, but it also supports single-lane output. Add support for that by
checking the data-lanes fwnode property how many lanes are used and
configure the necessary registers based on that.

To achieve this we move setting register 0x3018 out of the general reg
sequence so we set it to the correct value. The pixel_rate value also
needs to be adjusted.

[Sakari Ailus: Use div_s64 to divide a 64-bit number]

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/ov5670.c