media: i2c: Kconfig: Ensure a dependency on COMMON_CLK for VIDEO_CAMERA_SENSOR
PATCH v2 1/1 media: i2c: Kconfig: Ensure a dependency on COMMON_CLK for VIDEO_CAMERA_SENSOR
Both ACPI and DT-based systems are required to obtain the external camera sensor clock using the new devm_v4l2_sensor_clk_get() helper function.
Ensure a dependency on COMMON_CLK when config VIDEO_CAMERA_SENSOR is enabled.
---
v1 -> v2:
Suggested by Arnd Bergmann:
- removed the select statement and replaced it by "depends on COMMON_CLK"
Link v1: https://lore.kernel.org/linux-media/[email protected]
drivers/media/i2c/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/Kconfig +1 -1
@@ -27,7 +27,7 @@ config VIDEO_IR_I2C menuconfig VIDEO_CAMERA_SENSOR bool "Camera sensor devices" - depends on MEDIA_CAMERA_SUPPORT && I2C + depends on MEDIA_CAMERA_SUPPORT && I2C && COMMON_CLK select MEDIA_CONTROLLER select V4L2_FWNODE select VIDEO_V4L2_SUBDEV_API
Signature · 1 line
2.49.0
Quoted 9 lines · Mehdi Djait
Both ACPI and DT-based systems are required to obtain the external camera sensor clock using the new
devm_v4l2_sensor_clk_get()helper function.Ensure a dependency on
COMMON_CLKwhen configVIDEO_CAMERA_SENSORis enabled.Signed-off-by Mehdi Djait <[email protected]>---
Hi Mehdi,
Thanks for the update.
Quoted 24 lines · Mehdi Djait
Both ACPI and DT-based systems are required to obtain the external camera sensor clock using the new
devm_v4l2_sensor_clk_get()helper function.Ensure a dependency on
COMMON_CLKwhen configVIDEO_CAMERA_SENSORis enabled.Signed-off-by Mehdi Djait <[email protected]>---
v1 -> v2:
Suggested by Arnd Bergmann:
- removed the select statement and replaced it by "depends onCOMMON_CLK"Link v1: https://lore.kernel.org/linux-media/[email protected]
drivers/media/i2c/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/i2c/Kconfig +0
-0
drivers/media/i2c/Kconfig config VIDEO_IR_I2C · line 30
Quoted 5 lines
drivers/media/i2c/Kconfig +1
-1@@ -27,7 +27,7 @@ config VIDEO_IR_I2C menuconfig VIDEO_CAMERA_SENSOR bool "Camera sensor devices" - depends on MEDIA_CAMERA_SUPPORT && I2C + depends on MEDIA_CAMERA_SUPPORT && I2C && COMMON_CLK
As of now, this patch makes COMMON_CLK a requirement to use camera sensors. I think you should depend on COMMON_CLK only on ACPI-based platforms as non-CCF clock implementations are still in use and these platforms do not use ACPI.
Quoted 3 lines
drivers/media/i2c/Kconfig +0
-0select MEDIA_CONTROLLER select V4L2_FWNODE select VIDEO_V4L2_SUBDEV_API
Signature · 3 lines
Regards, Sakari Ailus
Quoted 8 lines · Sakari Ailus
Quoted 6 lines · Mehdi Djait
drivers/media/i2c/Kconfig +0
-0@@ -27,7 +27,7 @@ config VIDEO_IR_I2C
Quoted 9 lines
drivers/media/i2c/Kconfig config VIDEO_IR_I2C · line 30
Quoted 4 lines
drivers/media/i2c/Kconfig +1
-1menuconfig VIDEO_CAMERA_SENSOR bool "Camera sensor devices" - depends on MEDIA_CAMERA_SUPPORT && I2C + depends on MEDIA_CAMERA_SUPPORT && I2C && COMMON_CLKAs of now, this patch makes
COMMON_CLKa requirement to use camera sensors. I think you should depend onCOMMON_CLKonly on ACPI-based platforms as non-CCF clock implementations are still in use and these platforms do not use ACPI.
You are right, I mistakenly assumed that none of the HAVE_LEGACY_CLK users supported any camera sensors, but after double-checking I see that there are three camera sensor drivers (mt9t112, ov772x, rj54n1cb0c) that are used on four SH772x (SH-4A) boards.
I could not find any possible use of VIDEO_CAMERA_SENSOR on architectures that don't already mandate COMMON_CLK. There is also no way you'd have the combination of ACPI and HAVE_LEGACY_CLK, so it would be sufficient to check for 'depends on HAVE_CLK', or we could limit it further using 'depends on COMMON_CLK || (SH && ARCH_SHMOBILE)'.
Arnd