Skip to contentSkip to conversation

media: i2c: Select V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API for sensors

PATCH In review Sakari Ailus 3 participants 5 messages Jun 29, 2023 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 media: i2c: Select V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API for sensors

Select V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API for all sensor drivers. This also adds the options to drivers that don't specifically need them, these are still seldom used drivers using old APIs. The upside is that these should now all compile --- many drivers have had missing dependencies.

The "menu" is replaced by selectable "menuconfig" to select the needed V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API options.

Also select MEDIA_CONTROLLER which VIDEO_V4L2_SUBDEV_API effectively depends on.

---
since v1:

- Select MEDIA_CONTROLLER, don't depend on it.

 drivers/media/i2c/Kconfig | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/media/i2c/Kconfig +10 -3
index 815c83135021c..c7ffaa79abeb9 100644
@@ -25,8 +25,15 @@ config VIDEO_IR_I2C
 # V4L2 I2C drivers that are related with Camera support
 #
 
-menu "Camera sensor devices"
-	visible if MEDIA_CAMERA_SUPPORT
+menuconfig VIDEO_CAMERA_SENSOR
+	bool "Camera sensor devices"
+	depends on MEDIA_CAMERA_SUPPORT
+	select MEDIA_CONTROLLER
+	select V4L2_FWNODE
+	select VIDEO_V4L2_SUBDEV_API
+	default y
+
+if VIDEO_CAMERA_SENSOR
 
 config VIDEO_APTINA_PLL
 	tristate
@@ -810,7 +817,7 @@ config VIDEO_ST_VGXY61
 source "drivers/media/i2c/ccs/Kconfig"
 source "drivers/media/i2c/et8ek8/Kconfig"
 
-endmenu
+endif
 
 menu "Lens drivers"
 	visible if MEDIA_CAMERA_SUPPORT
Signature · 1 line
2.39.2
Reviewed-by on v2 1/1
#1 lore raw

Hi,

Quoted 5 lines · Sakari Ailus

Select V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API for all sensor drivers. This also adds the options to drivers that don't specifically need them, these are still seldom used drivers using old APIs. The upside is that these should now all compile --- many drivers have had missing dependencies.

Quoted 8 lines

The "menu" is replaced by selectable "menuconfig" to select the needed V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API options.

Also select MEDIA_CONTROLLER which VIDEO_V4L2_SUBDEV_API effectively depends on.

Thanks, patch looks good to me:

Regards,

Hans

Quoted 39 lines

---
since v1:

- Select MEDIA_CONTROLLER, don't depend on it.

 drivers/media/i2c/Kconfig | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/media/i2c/Kconfig +10 -3
index 815c83135021c..c7ffaa79abeb9 100644
@@ -25,8 +25,15 @@ config VIDEO_IR_I2C
 # V4L2 I2C drivers that are related with Camera support
 #
 
-menu "Camera sensor devices"
-	visible if MEDIA_CAMERA_SUPPORT
+menuconfig VIDEO_CAMERA_SENSOR
+	bool "Camera sensor devices"
+	depends on MEDIA_CAMERA_SUPPORT
+	select MEDIA_CONTROLLER
+	select V4L2_FWNODE
+	select VIDEO_V4L2_SUBDEV_API
+	default y
+
+if VIDEO_CAMERA_SENSOR
 
 config VIDEO_APTINA_PLL
 	tristate
@@ -810,7 +817,7 @@ config VIDEO_ST_VGXY61
 source "drivers/media/i2c/ccs/Kconfig"
 source "drivers/media/i2c/et8ek8/Kconfig"
 
-endmenu
+endif
 
 menu "Lens drivers"
 	visible if MEDIA_CAMERA_SUPPORT
#2 lore raw
In reply to Sakari Ailus

Hi Sakari,

Thank you for the patch.

Quoted 30 lines · Sakari Ailus

Select V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API for all sensor drivers. This also adds the options to drivers that don't specifically need them, these are still seldom used drivers using old APIs. The upside is that these should now all compile --- many drivers have had missing dependencies.

The "menu" is replaced by selectable "menuconfig" to select the needed V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API options.

Also select MEDIA_CONTROLLER which VIDEO_V4L2_SUBDEV_API effectively depends on.

---
since v1:

- Select MEDIA_CONTROLLER, don't depend on it.

 drivers/media/i2c/Kconfig | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/media/i2c/Kconfig +0 -1
index 815c83135021c..c7ffaa79abeb9 100644
@@ -25,8 +25,15 @@ config VIDEO_IR_I2C
 # V4L2 I2C drivers that are related with Camera support
 #
 
-menu "Camera sensor devices"

drivers/media/i2c/Kconfig config VIDEO_IR_I2C · line 36

Quoted 10 lines
drivers/media/i2c/Kconfig +9 -1
-	visible if MEDIA_CAMERA_SUPPORT
+menuconfig VIDEO_CAMERA_SENSOR
+	bool "Camera sensor devices"
+	depends on MEDIA_CAMERA_SUPPORT
+	select MEDIA_CONTROLLER
+	select V4L2_FWNODE
+	select VIDEO_V4L2_SUBDEV_API
+	default y
+
+if VIDEO_CAMERA_SENSOR

Shouldn't you then remove the MEDIA_CONTROLLER, V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API selection from individual drivers' Kconfig entries ?

Quoted 12 lines
drivers/media/i2c/Kconfig +1 -1
 config VIDEO_APTINA_PLL
 	tristate
@@ -810,7 +817,7 @@ config VIDEO_ST_VGXY61
 source "drivers/media/i2c/ccs/Kconfig"
 source "drivers/media/i2c/et8ek8/Kconfig"
 
-endmenu
+endif
 
 menu "Lens drivers"
 	visible if MEDIA_CAMERA_SUPPORT
Signature · 3 lines
Regards,

Laurent Pinchart
#3 lore raw
Quoted 34 lines · Laurent Pinchart

Hi Sakari,

Thank you for the patch.

Quoted 29 lines · Sakari Ailus

Select V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API for all sensor drivers. This also adds the options to drivers that don't specifically need them, these are still seldom used drivers using old APIs. The upside is that these should now all compile --- many drivers have had missing dependencies.

The "menu" is replaced by selectable "menuconfig" to select the needed V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API options.

Also select MEDIA_CONTROLLER which VIDEO_V4L2_SUBDEV_API effectively depends on.

---
since v1:

- Select MEDIA_CONTROLLER, don't depend on it.

 drivers/media/i2c/Kconfig | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/media/i2c/Kconfig +0 -0
index 815c83135021c..c7ffaa79abeb9 100644
@@ -25,8 +25,15 @@ config VIDEO_IR_I2C
 # V4L2 I2C drivers that are related with Camera support
 #
 
Quoted 15 lines

drivers/media/i2c/Kconfig config VIDEO_IR_I2C · line 36

Quoted 11 lines
drivers/media/i2c/Kconfig +9 -2
-menu "Camera sensor devices"
-	visible if MEDIA_CAMERA_SUPPORT
+menuconfig VIDEO_CAMERA_SENSOR
+	bool "Camera sensor devices"
+	depends on MEDIA_CAMERA_SUPPORT
+	select MEDIA_CONTROLLER
+	select V4L2_FWNODE
+	select VIDEO_V4L2_SUBDEV_API
+	default y
+
+if VIDEO_CAMERA_SENSOR

Shouldn't you then remove the MEDIA_CONTROLLER, V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API selection from individual drivers' Kconfig entries ?

I've read your reply to Hans in v1. I'm fine doing it in a separate patch, but could it be bundled in the same series ?

Quoted 11 lines
Quoted 11 lines
drivers/media/i2c/Kconfig +1 -1
 config VIDEO_APTINA_PLL
 	tristate
@@ -810,7 +817,7 @@ config VIDEO_ST_VGXY61
 source "drivers/media/i2c/ccs/Kconfig"
 source "drivers/media/i2c/et8ek8/Kconfig"
 
-endmenu
+endif
 
 menu "Lens drivers"
 	visible if MEDIA_CAMERA_SUPPORT
Signature · 3 lines
Regards,

Laurent Pinchart
#4 lore raw

Hi Laurent,

Quoted 51 lines · Laurent Pinchart
Quoted 34 lines · Laurent Pinchart

Hi Sakari,

Thank you for the patch.

Quoted 29 lines · Sakari Ailus

Select V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API for all sensor drivers. This also adds the options to drivers that don't specifically need them, these are still seldom used drivers using old APIs. The upside is that these should now all compile --- many drivers have had missing dependencies.

The "menu" is replaced by selectable "menuconfig" to select the needed V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API options.

Also select MEDIA_CONTROLLER which VIDEO_V4L2_SUBDEV_API effectively depends on.

---
since v1:

- Select MEDIA_CONTROLLER, don't depend on it.

 drivers/media/i2c/Kconfig | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/media/i2c/Kconfig +0 -0
index 815c83135021c..c7ffaa79abeb9 100644
@@ -25,8 +25,15 @@ config VIDEO_IR_I2C
 # V4L2 I2C drivers that are related with Camera support
 #
 
Quoted 15 lines

drivers/media/i2c/Kconfig config VIDEO_IR_I2C · line 36

Quoted 11 lines
drivers/media/i2c/Kconfig +9 -2
-menu "Camera sensor devices"
-	visible if MEDIA_CAMERA_SUPPORT
+menuconfig VIDEO_CAMERA_SENSOR
+	bool "Camera sensor devices"
+	depends on MEDIA_CAMERA_SUPPORT
+	select MEDIA_CONTROLLER
+	select V4L2_FWNODE
+	select VIDEO_V4L2_SUBDEV_API
+	default y
+
+if VIDEO_CAMERA_SENSOR

Shouldn't you then remove the MEDIA_CONTROLLER, V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API selection from individual drivers' Kconfig entries ?

Quoted 2 lines

I've read your reply to Hans in v1. I'm fine doing it in a separate patch, but could it be bundled in the same series ?

Sure. I'll add cc to stable --- I have opes it applies to at least most recent stable trees. As this hasn't been reported until now, I wouldn't really worry the earlier ones.

Signature · 1 line
Sakari Ailus