Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH V2] media: i2c: Kconfig: Ensure a dependency on COMMON_CLK for VIDEO_CAMERA_SENSOR
@ 2025-07-09 10:11 Mehdi Djait
  2025-07-09 10:19 ` Arnd Bergmann
  2025-07-09 20:43 ` Sakari Ailus
  0 siblings, 2 replies; 4+ messages in thread
From: Mehdi Djait @ 2025-07-09 10:11 UTC (permalink / raw)
  To: sakari.ailus, laurent.pinchart
  Cc: jacopo.mondi, hverkuil, kieran.bingham, mchehab, hdegoede, arnd,
	linux-media, linux-kernel, 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_CLK when config VIDEO_CAMERA_SENSOR is
enabled.

Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com>
---
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/20250708161637.227111-1-mehdi.djait@linux.intel.com

 drivers/media/i2c/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index e68202954a8f..98750fa5a7b6 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -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
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] media: i2c: Kconfig: Ensure a dependency on COMMON_CLK for VIDEO_CAMERA_SENSOR
  2025-07-09 10:11 [PATCH V2] media: i2c: Kconfig: Ensure a dependency on COMMON_CLK for VIDEO_CAMERA_SENSOR Mehdi Djait
@ 2025-07-09 10:19 ` Arnd Bergmann
  2025-07-09 20:43 ` Sakari Ailus
  1 sibling, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2025-07-09 10:19 UTC (permalink / raw)
  To: Mehdi Djait, Sakari Ailus, laurent.pinchart
  Cc: Jacopo Mondi, Hans Verkuil, Kieran Bingham, Mauro Carvalho Chehab,
	Hans de Goede, linux-media, linux-kernel

On Wed, Jul 9, 2025, at 12:11, Mehdi Djait wrote:
> 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.
>
> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com>
> ---

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] media: i2c: Kconfig: Ensure a dependency on COMMON_CLK for VIDEO_CAMERA_SENSOR
  2025-07-09 10:11 [PATCH V2] media: i2c: Kconfig: Ensure a dependency on COMMON_CLK for VIDEO_CAMERA_SENSOR Mehdi Djait
  2025-07-09 10:19 ` Arnd Bergmann
@ 2025-07-09 20:43 ` Sakari Ailus
  2025-07-10  6:16   ` Arnd Bergmann
  1 sibling, 1 reply; 4+ messages in thread
From: Sakari Ailus @ 2025-07-09 20:43 UTC (permalink / raw)
  To: Mehdi Djait
  Cc: laurent.pinchart, jacopo.mondi, hverkuil, kieran.bingham, mchehab,
	hdegoede, arnd, linux-media, linux-kernel

Hi Mehdi,

Thanks for the update.

On Wed, Jul 09, 2025 at 12:11:14PM +0200, Mehdi Djait wrote:
> 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.
> 
> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com>
> ---
> 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/20250708161637.227111-1-mehdi.djait@linux.intel.com
> 
>  drivers/media/i2c/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
> index e68202954a8f..98750fa5a7b6 100644
> --- a/drivers/media/i2c/Kconfig
> +++ b/drivers/media/i2c/Kconfig
> @@ -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.

>  	select MEDIA_CONTROLLER
>  	select V4L2_FWNODE
>  	select VIDEO_V4L2_SUBDEV_API

-- 
Regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] media: i2c: Kconfig: Ensure a dependency on COMMON_CLK for VIDEO_CAMERA_SENSOR
  2025-07-09 20:43 ` Sakari Ailus
@ 2025-07-10  6:16   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2025-07-10  6:16 UTC (permalink / raw)
  To: Sakari Ailus, Mehdi Djait
  Cc: laurent.pinchart, Jacopo Mondi, Hans Verkuil, Kieran Bingham,
	Mauro Carvalho Chehab, Hans de Goede, linux-media, linux-kernel

On Wed, Jul 9, 2025, at 22:43, Sakari Ailus wrote:
> On Wed, Jul 09, 2025 at 12:11:14PM +0200, Mehdi Djait wrote:

>> diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
>> index e68202954a8f..98750fa5a7b6 100644
>> --- a/drivers/media/i2c/Kconfig
>> +++ b/drivers/media/i2c/Kconfig
>> @@ -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.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-10  6:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09 10:11 [PATCH V2] media: i2c: Kconfig: Ensure a dependency on COMMON_CLK for VIDEO_CAMERA_SENSOR Mehdi Djait
2025-07-09 10:19 ` Arnd Bergmann
2025-07-09 20:43 ` Sakari Ailus
2025-07-10  6:16   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox