Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 859969b3 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

[media] v4l: Switch from V4L2 OF not V4L2 fwnode API



Switch users of the v4l2_of_ APIs to the more generic v4l2_fwnode_ APIs.
Async OF matching is replaced by fwnode matching and OF matching support
is removed.

Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Benoit Parrot <bparrot@ti.com> # i2c/ov2569.c, am437x/am437x-vpfe.c and ti-vpe/cal.c
Tested-by: Hans Verkuil <hans.verkuil@cisco.com> # Atmel sama5d3 board + ov2640 sensor
Tested-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 048ea05b
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -209,6 +209,7 @@ config VIDEO_ADV7604
	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
	depends on GPIOLIB || COMPILE_TEST
	depends on GPIOLIB || COMPILE_TEST
	select HDMI
	select HDMI
	select V4L2_FWNODE
	---help---
	---help---
	  Support for the Analog Devices ADV7604 video decoder.
	  Support for the Analog Devices ADV7604 video decoder.


@@ -322,6 +323,7 @@ config VIDEO_TC358743
	tristate "Toshiba TC358743 decoder"
	tristate "Toshiba TC358743 decoder"
	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
	select HDMI
	select HDMI
	select V4L2_FWNODE
	---help---
	---help---
	  Support for the Toshiba TC358743 HDMI to MIPI CSI-2 bridge.
	  Support for the Toshiba TC358743 HDMI to MIPI CSI-2 bridge.


@@ -331,6 +333,7 @@ config VIDEO_TC358743
config VIDEO_TVP514X
config VIDEO_TVP514X
	tristate "Texas Instruments TVP514x video decoder"
	tristate "Texas Instruments TVP514x video decoder"
	depends on VIDEO_V4L2 && I2C
	depends on VIDEO_V4L2 && I2C
	select V4L2_FWNODE
	---help---
	---help---
	  This is a Video4Linux2 sensor-level driver for the TI TVP5146/47
	  This is a Video4Linux2 sensor-level driver for the TI TVP5146/47
	  decoder. It is currently working with the TI OMAP3 camera
	  decoder. It is currently working with the TI OMAP3 camera
@@ -342,6 +345,7 @@ config VIDEO_TVP514X
config VIDEO_TVP5150
config VIDEO_TVP5150
	tristate "Texas Instruments TVP5150 video decoder"
	tristate "Texas Instruments TVP5150 video decoder"
	depends on VIDEO_V4L2 && I2C
	depends on VIDEO_V4L2 && I2C
	select V4L2_FWNODE
	---help---
	---help---
	  Support for the Texas Instruments TVP5150 video decoder.
	  Support for the Texas Instruments TVP5150 video decoder.


@@ -351,6 +355,7 @@ config VIDEO_TVP5150
config VIDEO_TVP7002
config VIDEO_TVP7002
	tristate "Texas Instruments TVP7002 video decoder"
	tristate "Texas Instruments TVP7002 video decoder"
	depends on VIDEO_V4L2 && I2C
	depends on VIDEO_V4L2 && I2C
	select V4L2_FWNODE
	---help---
	---help---
	  Support for the Texas Instruments TVP7002 video decoder.
	  Support for the Texas Instruments TVP7002 video decoder.


@@ -532,6 +537,7 @@ config VIDEO_OV2659
	tristate "OmniVision OV2659 sensor support"
	tristate "OmniVision OV2659 sensor support"
	depends on VIDEO_V4L2 && I2C
	depends on VIDEO_V4L2 && I2C
	depends on MEDIA_CAMERA_SUPPORT
	depends on MEDIA_CAMERA_SUPPORT
	select V4L2_FWNODE
	---help---
	---help---
	  This is a Video4Linux2 sensor-level driver for the OmniVision
	  This is a Video4Linux2 sensor-level driver for the OmniVision
	  OV2659 camera.
	  OV2659 camera.
@@ -544,6 +550,7 @@ config VIDEO_OV5645
	depends on OF
	depends on OF
	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
	depends on MEDIA_CAMERA_SUPPORT
	depends on MEDIA_CAMERA_SUPPORT
	select V4L2_FWNODE
	---help---
	---help---
	  This is a Video4Linux2 sensor-level driver for the OmniVision
	  This is a Video4Linux2 sensor-level driver for the OmniVision
	  OV5645 camera.
	  OV5645 camera.
@@ -555,6 +562,7 @@ config VIDEO_OV5647
	tristate "OmniVision OV5647 sensor support"
	tristate "OmniVision OV5647 sensor support"
	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
	depends on MEDIA_CAMERA_SUPPORT
	depends on MEDIA_CAMERA_SUPPORT
	select V4L2_FWNODE
	---help---
	---help---
	  This is a Video4Linux2 sensor-level driver for the OmniVision
	  This is a Video4Linux2 sensor-level driver for the OmniVision
	  OV5647 camera.
	  OV5647 camera.
@@ -647,6 +655,7 @@ config VIDEO_MT9V032
	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
	depends on MEDIA_CAMERA_SUPPORT
	depends on MEDIA_CAMERA_SUPPORT
	select REGMAP_I2C
	select REGMAP_I2C
	select V4L2_FWNODE
	---help---
	---help---
	  This is a Video4Linux2 sensor-level driver for the Micron
	  This is a Video4Linux2 sensor-level driver for the Micron
	  MT9V032 752x480 CMOS sensor.
	  MT9V032 752x480 CMOS sensor.
@@ -694,6 +703,7 @@ config VIDEO_S5K4ECGX
config VIDEO_S5K5BAF
config VIDEO_S5K5BAF
	tristate "Samsung S5K5BAF sensor support"
	tristate "Samsung S5K5BAF sensor support"
	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
	select V4L2_FWNODE
	---help---
	---help---
	  This is a V4L2 sensor-level driver for Samsung S5K5BAF 2M
	  This is a V4L2 sensor-level driver for Samsung S5K5BAF 2M
	  camera sensor with an embedded SoC image signal processor.
	  camera sensor with an embedded SoC image signal processor.
@@ -704,6 +714,7 @@ source "drivers/media/i2c/et8ek8/Kconfig"
config VIDEO_S5C73M3
config VIDEO_S5C73M3
	tristate "Samsung S5C73M3 sensor support"
	tristate "Samsung S5C73M3 sensor support"
	depends on I2C && SPI && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
	depends on I2C && SPI && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
	select V4L2_FWNODE
	---help---
	---help---
	  This is a V4L2 sensor-level driver for Samsung S5C73M3
	  This is a V4L2 sensor-level driver for Samsung S5C73M3
	  8 Mpixel camera.
	  8 Mpixel camera.
+4 −3
Original line number Original line Diff line number Diff line
@@ -33,6 +33,7 @@
#include <linux/i2c.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/of_graph.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/v4l2-dv-timings.h>
#include <linux/v4l2-dv-timings.h>
#include <linux/videodev2.h>
#include <linux/videodev2.h>
@@ -45,7 +46,7 @@
#include <media/v4l2-device.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-event.h>
#include <media/v4l2-dv-timings.h>
#include <media/v4l2-dv-timings.h>
#include <media/v4l2-of.h>
#include <media/v4l2-fwnode.h>


static int debug;
static int debug;
module_param(debug, int, 0644);
module_param(debug, int, 0644);
@@ -3069,7 +3070,7 @@ MODULE_DEVICE_TABLE(of, adv76xx_of_id);


static int adv76xx_parse_dt(struct adv76xx_state *state)
static int adv76xx_parse_dt(struct adv76xx_state *state)
{
{
	struct v4l2_of_endpoint bus_cfg;
	struct v4l2_fwnode_endpoint bus_cfg;
	struct device_node *endpoint;
	struct device_node *endpoint;
	struct device_node *np;
	struct device_node *np;
	unsigned int flags;
	unsigned int flags;
@@ -3083,7 +3084,7 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
	if (!endpoint)
	if (!endpoint)
		return -EINVAL;
		return -EINVAL;


	ret = v4l2_of_parse_endpoint(endpoint, &bus_cfg);
	ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(endpoint), &bus_cfg);
	if (ret) {
	if (ret) {
		of_node_put(endpoint);
		of_node_put(endpoint);
		return ret;
		return ret;
+4 −3
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/log2.h>
#include <linux/log2.h>
#include <linux/mutex.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/regmap.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <linux/videodev2.h>
@@ -28,7 +29,7 @@
#include <media/i2c/mt9v032.h>
#include <media/i2c/mt9v032.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-device.h>
#include <media/v4l2-of.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
#include <media/v4l2-subdev.h>


/* The first four rows are black rows. The active area spans 753x481 pixels. */
/* The first four rows are black rows. The active area spans 753x481 pixels. */
@@ -979,7 +980,7 @@ static struct mt9v032_platform_data *
mt9v032_get_pdata(struct i2c_client *client)
mt9v032_get_pdata(struct i2c_client *client)
{
{
	struct mt9v032_platform_data *pdata = NULL;
	struct mt9v032_platform_data *pdata = NULL;
	struct v4l2_of_endpoint endpoint;
	struct v4l2_fwnode_endpoint endpoint;
	struct device_node *np;
	struct device_node *np;
	struct property *prop;
	struct property *prop;


@@ -990,7 +991,7 @@ mt9v032_get_pdata(struct i2c_client *client)
	if (!np)
	if (!np)
		return NULL;
		return NULL;


	if (v4l2_of_parse_endpoint(np, &endpoint) < 0)
	if (v4l2_fwnode_endpoint_parse(of_fwnode_handle(np), &endpoint) < 0)
		goto done;
		goto done;


	pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
	pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
+4 −4
Original line number Original line Diff line number Diff line
@@ -42,9 +42,9 @@
#include <media/v4l2-ctrls.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-event.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-image-sizes.h>
#include <media/v4l2-image-sizes.h>
#include <media/v4l2-mediabus.h>
#include <media/v4l2-mediabus.h>
#include <media/v4l2-of.h>
#include <media/v4l2-subdev.h>
#include <media/v4l2-subdev.h>


#define DRIVER_NAME "ov2659"
#define DRIVER_NAME "ov2659"
@@ -1347,7 +1347,7 @@ static struct ov2659_platform_data *
ov2659_get_pdata(struct i2c_client *client)
ov2659_get_pdata(struct i2c_client *client)
{
{
	struct ov2659_platform_data *pdata;
	struct ov2659_platform_data *pdata;
	struct v4l2_of_endpoint *bus_cfg;
	struct v4l2_fwnode_endpoint *bus_cfg;
	struct device_node *endpoint;
	struct device_node *endpoint;


	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
@@ -1357,7 +1357,7 @@ ov2659_get_pdata(struct i2c_client *client)
	if (!endpoint)
	if (!endpoint)
		return NULL;
		return NULL;


	bus_cfg = v4l2_of_alloc_parse_endpoint(endpoint);
	bus_cfg = v4l2_fwnode_endpoint_alloc_parse(of_fwnode_handle(endpoint));
	if (IS_ERR(bus_cfg)) {
	if (IS_ERR(bus_cfg)) {
		pdata = NULL;
		pdata = NULL;
		goto done;
		goto done;
@@ -1377,7 +1377,7 @@ ov2659_get_pdata(struct i2c_client *client)
	pdata->link_frequency = bus_cfg->link_frequencies[0];
	pdata->link_frequency = bus_cfg->link_frequencies[0];


done:
done:
	v4l2_of_free_endpoint(bus_cfg);
	v4l2_fwnode_endpoint_free(bus_cfg);
	of_node_put(endpoint);
	of_node_put(endpoint);
	return pdata;
	return pdata;
}
}
+4 −3
Original line number Original line Diff line number Diff line
@@ -39,7 +39,7 @@
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/types.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-of.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
#include <media/v4l2-subdev.h>


#define OV5645_VOLTAGE_ANALOG               2800000
#define OV5645_VOLTAGE_ANALOG               2800000
@@ -87,7 +87,7 @@ struct ov5645 {
	struct device *dev;
	struct device *dev;
	struct v4l2_subdev sd;
	struct v4l2_subdev sd;
	struct media_pad pad;
	struct media_pad pad;
	struct v4l2_of_endpoint ep;
	struct v4l2_fwnode_endpoint ep;
	struct v4l2_mbus_framefmt fmt;
	struct v4l2_mbus_framefmt fmt;
	struct v4l2_rect crop;
	struct v4l2_rect crop;
	struct clk *xclk;
	struct clk *xclk;
@@ -1102,7 +1102,8 @@ static int ov5645_probe(struct i2c_client *client,
		return -EINVAL;
		return -EINVAL;
	}
	}


	ret = v4l2_of_parse_endpoint(endpoint, &ov5645->ep);
	ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(endpoint),
					 &ov5645->ep);
	if (ret < 0) {
	if (ret < 0) {
		dev_err(dev, "parsing endpoint node failed\n");
		dev_err(dev, "parsing endpoint node failed\n");
		return ret;
		return ret;
Loading