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

[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
...@@ -209,6 +209,7 @@ config VIDEO_ADV7604 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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" ...@@ -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.
......
...@@ -33,6 +33,7 @@ ...@@ -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 @@ ...@@ -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); ...@@ -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) ...@@ -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;
......
...@@ -19,6 +19,7 @@ ...@@ -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 @@ ...@@ -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 * ...@@ -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) ...@@ -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);
......
...@@ -42,9 +42,9 @@ ...@@ -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 * ...@@ -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) ...@@ -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) ...@@ -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;
} }
......
...@@ -39,7 +39,7 @@ ...@@ -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 { ...@@ -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, ...@@ -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;
......
...@@ -25,12 +25,13 @@ ...@@ -25,12 +25,13 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_graph.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.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>
#define SENSOR_NAME "ov5647" #define SENSOR_NAME "ov5647"
...@@ -510,7 +511,7 @@ static const struct v4l2_subdev_internal_ops ov5647_subdev_internal_ops = { ...@@ -510,7 +511,7 @@ static const struct v4l2_subdev_internal_ops ov5647_subdev_internal_ops = {
static int ov5647_parse_dt(struct device_node *np) static int ov5647_parse_dt(struct device_node *np)
{ {
struct v4l2_of_endpoint bus_cfg; struct v4l2_fwnode_endpoint bus_cfg;
struct device_node *ep; struct device_node *ep;
int ret; int ret;
...@@ -519,7 +520,7 @@ static int ov5647_parse_dt(struct device_node *np) ...@@ -519,7 +520,7 @@ static int ov5647_parse_dt(struct device_node *np)
if (!ep) if (!ep)
return -EINVAL; return -EINVAL;
ret = v4l2_of_parse_endpoint(ep, &bus_cfg); ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &bus_cfg);
of_node_put(ep); of_node_put(ep);
return ret; return ret;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/media.h> #include <linux/media.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/of_graph.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <linux/sizes.h> #include <linux/sizes.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -35,7 +36,7 @@ ...@@ -35,7 +36,7 @@
#include <media/v4l2-subdev.h> #include <media/v4l2-subdev.h>
#include <media/v4l2-mediabus.h> #include <media/v4l2-mediabus.h>
#include <media/i2c/s5c73m3.h> #include <media/i2c/s5c73m3.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include "s5c73m3.h" #include "s5c73m3.h"
...@@ -1602,7 +1603,7 @@ static int s5c73m3_get_platform_data(struct s5c73m3 *state) ...@@ -1602,7 +1603,7 @@ static int s5c73m3_get_platform_data(struct s5c73m3 *state)
const struct s5c73m3_platform_data *pdata = dev->platform_data; const struct s5c73m3_platform_data *pdata = dev->platform_data;
struct device_node *node = dev->of_node; struct device_node *node = dev->of_node;
struct device_node *node_ep; struct device_node *node_ep;
struct v4l2_of_endpoint ep; struct v4l2_fwnode_endpoint ep;
int ret; int ret;
if (!node) { if (!node) {
...@@ -1639,7 +1640,7 @@ static int s5c73m3_get_platform_data(struct s5c73m3 *state) ...@@ -1639,7 +1640,7 @@ static int s5c73m3_get_platform_data(struct s5c73m3 *state)
return 0; return 0;
} }
ret = v4l2_of_parse_endpoint(node_ep, &ep); ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(node_ep), &ep);
of_node_put(node_ep); of_node_put(node_ep);
if (ret) if (ret)
return ret; return ret;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-subdev.h> #include <media/v4l2-subdev.h>
#include <media/v4l2-mediabus.h> #include <media/v4l2-mediabus.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);
...@@ -1841,7 +1841,7 @@ static int s5k5baf_parse_device_node(struct s5k5baf *state, struct device *dev) ...@@ -1841,7 +1841,7 @@ static int s5k5baf_parse_device_node(struct s5k5baf *state, struct device *dev)
{ {
struct device_node *node = dev->of_node; struct device_node *node = dev->of_node;
struct device_node *node_ep; struct device_node *node_ep;
struct v4l2_of_endpoint ep; struct v4l2_fwnode_endpoint ep;
int ret; int ret;
if (!node) { if (!node) {
...@@ -1868,7 +1868,7 @@ static int s5k5baf_parse_device_node(struct s5k5baf *state, struct device *dev) ...@@ -1868,7 +1868,7 @@ static int s5k5baf_parse_device_node(struct s5k5baf *state, struct device *dev)
return -EINVAL; return -EINVAL;
} }
ret = v4l2_of_parse_endpoint(node_ep, &ep); ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(node_ep), &ep);
of_node_put(node_ep); of_node_put(node_ep);
if (ret) if (ret)
return ret; return ret;
......
...@@ -3,5 +3,6 @@ config VIDEO_SMIAPP ...@@ -3,5 +3,6 @@ config VIDEO_SMIAPP
depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && HAVE_CLK depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && HAVE_CLK
depends on MEDIA_CAMERA_SUPPORT depends on MEDIA_CAMERA_SUPPORT
select VIDEO_SMIAPP_PLL select VIDEO_SMIAPP_PLL
select V4L2_FWNODE
---help--- ---help---
This is a generic driver for SMIA++/SMIA camera modules. This is a generic driver for SMIA++/SMIA camera modules.
...@@ -27,12 +27,13 @@ ...@@ -27,12 +27,13 @@
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smiapp.h> #include <linux/smiapp.h>
#include <linux/v4l2-mediabus.h> #include <linux/v4l2-mediabus.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-of.h>
#include "smiapp.h" #include "smiapp.h"
...@@ -2784,19 +2785,20 @@ static int __maybe_unused smiapp_resume(struct device *dev) ...@@ -2784,19 +2785,20 @@ static int __maybe_unused smiapp_resume(struct device *dev)
static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev) static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev)
{ {
struct smiapp_hwconfig *hwcfg; struct smiapp_hwconfig *hwcfg;
struct v4l2_of_endpoint *bus_cfg; struct v4l2_fwnode_endpoint *bus_cfg;
struct device_node *ep; struct fwnode_handle *ep;
struct fwnode_handle *fwnode = dev_fwnode(dev);
int i; int i;
int rval; int rval;
if (!dev->of_node) if (!fwnode)
return dev->platform_data; return dev->platform_data;
ep = of_graph_get_next_endpoint(dev->of_node, NULL); ep = fwnode_graph_get_next_endpoint(fwnode, NULL);
if (!ep) if (!ep)
return NULL; return NULL;
bus_cfg = v4l2_of_alloc_parse_endpoint(ep); bus_cfg = v4l2_fwnode_endpoint_alloc_parse(ep);
if (IS_ERR(bus_cfg)) if (IS_ERR(bus_cfg))
goto out_err; goto out_err;
...@@ -2817,11 +2819,10 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev) ...@@ -2817,11 +2819,10 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev)
dev_dbg(dev, "lanes %u\n", hwcfg->lanes); dev_dbg(dev, "lanes %u\n", hwcfg->lanes);
/* NVM size is not mandatory */ /* NVM size is not mandatory */
of_property_read_u32(dev->of_node, "nokia,nvm-size", fwnode_property_read_u32(fwnode, "nokia,nvm-size", &hwcfg->nvm_size);
&hwcfg->nvm_size);
rval = of_property_read_u32(dev->of_node, "clock-frequency", rval = fwnode_property_read_u32(fwnode, "clock-frequency",
&hwcfg->ext_clk); &hwcfg->ext_clk);
if (rval) { if (rval) {
dev_warn(dev, "can't get clock-frequency\n"); dev_warn(dev, "can't get clock-frequency\n");
goto out_err; goto out_err;
...@@ -2846,13 +2847,13 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev) ...@@ -2846,13 +2847,13 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev)
dev_dbg(dev, "freq %d: %lld\n", i, hwcfg->op_sys_clock[i]); dev_dbg(dev, "freq %d: %lld\n", i, hwcfg->op_sys_clock[i]);
} }
v4l2_of_free_endpoint(bus_cfg); v4l2_fwnode_endpoint_free(bus_cfg);
of_node_put(ep); fwnode_handle_put(ep);
return hwcfg; return hwcfg;
out_err: out_err:
v4l2_of_free_endpoint(bus_cfg); v4l2_fwnode_endpoint_free(bus_cfg);
of_node_put(ep); fwnode_handle_put(ep);
return NULL; return NULL;
} }
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/of_graph.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/v4l2-dv-timings.h> #include <linux/v4l2-dv-timings.h>
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/v4l2-event.h> #include <media/v4l2-event.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include <media/i2c/tc358743.h> #include <media/i2c/tc358743.h>
#include "tc358743_regs.h" #include "tc358743_regs.h"
...@@ -76,7 +77,7 @@ static const struct v4l2_dv_timings_cap tc358743_timings_cap = { ...@@ -76,7 +77,7 @@ static const struct v4l2_dv_timings_cap tc358743_timings_cap = {
struct tc358743_state { struct tc358743_state {
struct tc358743_platform_data pdata; struct tc358743_platform_data pdata;
struct v4l2_of_bus_mipi_csi2 bus; struct v4l2_fwnode_bus_mipi_csi2 bus;
struct v4l2_subdev sd; struct v4l2_subdev sd;
struct media_pad pad; struct media_pad pad;
struct v4l2_ctrl_handler hdl; struct v4l2_ctrl_handler hdl;
...@@ -1695,7 +1696,7 @@ static void tc358743_gpio_reset(struct tc358743_state *state) ...@@ -1695,7 +1696,7 @@ static void tc358743_gpio_reset(struct tc358743_state *state)
static int tc358743_probe_of(struct tc358743_state *state) static int tc358743_probe_of(struct tc358743_state *state)
{ {
struct device *dev = &state->i2c_client->dev; struct device *dev = &state->i2c_client->dev;
struct v4l2_of_endpoint *endpoint; struct v4l2_fwnode_endpoint *endpoint;
struct device_node *ep; struct device_node *ep;
struct clk *refclk; struct clk *refclk;
u32 bps_pr_lane; u32 bps_pr_lane;
...@@ -1715,7 +1716,7 @@ static int tc358743_probe_of(struct tc358743_state *state) ...@@ -1715,7 +1716,7 @@ static int tc358743_probe_of(struct tc358743_state *state)
return -EINVAL; return -EINVAL;
} }
endpoint = v4l2_of_alloc_parse_endpoint(ep); endpoint = v4l2_fwnode_endpoint_alloc_parse(of_fwnode_handle(ep));
if (IS_ERR(endpoint)) { if (IS_ERR(endpoint)) {
dev_err(dev, "failed to parse endpoint\n"); dev_err(dev, "failed to parse endpoint\n");
return PTR_ERR(endpoint); return PTR_ERR(endpoint);
...@@ -1803,7 +1804,7 @@ static int tc358743_probe_of(struct tc358743_state *state) ...@@ -1803,7 +1804,7 @@ static int tc358743_probe_of(struct tc358743_state *state)
disable_clk: disable_clk:
clk_disable_unprepare(refclk); clk_disable_unprepare(refclk);
free_endpoint: free_endpoint:
v4l2_of_free_endpoint(endpoint); v4l2_fwnode_endpoint_free(endpoint);
return ret; return ret;
} }
#else #else
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-mediabus.h> #include <media/v4l2-mediabus.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/i2c/tvp514x.h> #include <media/i2c/tvp514x.h>
#include <media/media-entity.h> #include <media/media-entity.h>
...@@ -998,7 +998,7 @@ static struct tvp514x_platform_data * ...@@ -998,7 +998,7 @@ static struct tvp514x_platform_data *
tvp514x_get_pdata(struct i2c_client *client) tvp514x_get_pdata(struct i2c_client *client)
{ {
struct tvp514x_platform_data *pdata = NULL; struct tvp514x_platform_data *pdata = NULL;
struct v4l2_of_endpoint bus_cfg; struct v4l2_fwnode_endpoint bus_cfg;
struct device_node *endpoint; struct device_node *endpoint;
unsigned int flags; unsigned int flags;
...@@ -1009,7 +1009,7 @@ tvp514x_get_pdata(struct i2c_client *client) ...@@ -1009,7 +1009,7 @@ tvp514x_get_pdata(struct i2c_client *client)
if (!endpoint) if (!endpoint)
return NULL; return NULL;
if (v4l2_of_parse_endpoint(endpoint, &bus_cfg)) if (v4l2_fwnode_endpoint_parse(of_fwnode_handle(endpoint), &bus_cfg))
goto done; goto done;
pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL); pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
......
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_graph.h>
#include <media/v4l2-async.h> #include <media/v4l2-async.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include <media/v4l2-mc.h> #include <media/v4l2-mc.h>
#include "tvp5150_reg.h" #include "tvp5150_reg.h"
...@@ -1358,7 +1359,7 @@ static int tvp5150_init(struct i2c_client *c) ...@@ -1358,7 +1359,7 @@ static int tvp5150_init(struct i2c_client *c)
static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np) static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
{ {
struct v4l2_of_endpoint bus_cfg; struct v4l2_fwnode_endpoint bus_cfg;
struct device_node *ep; struct device_node *ep;
#ifdef CONFIG_MEDIA_CONTROLLER #ifdef CONFIG_MEDIA_CONTROLLER
struct device_node *connectors, *child; struct device_node *connectors, *child;
...@@ -1373,7 +1374,7 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np) ...@@ -1373,7 +1374,7 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
if (!ep) if (!ep)
return -EINVAL; return -EINVAL;
ret = v4l2_of_parse_endpoint(ep, &bus_cfg); ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &bus_cfg);
if (ret) if (ret)
goto err; goto err;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include "tvp7002_reg.h" #include "tvp7002_reg.h"
...@@ -889,7 +889,7 @@ static const struct v4l2_subdev_ops tvp7002_ops = { ...@@ -889,7 +889,7 @@ static const struct v4l2_subdev_ops tvp7002_ops = {
static struct tvp7002_config * static struct tvp7002_config *
tvp7002_get_pdata(struct i2c_client *client) tvp7002_get_pdata(struct i2c_client *client)
{ {
struct v4l2_of_endpoint bus_cfg; struct v4l2_fwnode_endpoint bus_cfg;
struct tvp7002_config *pdata = NULL; struct tvp7002_config *pdata = NULL;
struct device_node *endpoint; struct device_node *endpoint;
unsigned int flags; unsigned int flags;
...@@ -901,7 +901,7 @@ tvp7002_get_pdata(struct i2c_client *client) ...@@ -901,7 +901,7 @@ tvp7002_get_pdata(struct i2c_client *client)
if (!endpoint) if (!endpoint)
return NULL; return NULL;
if (v4l2_of_parse_endpoint(endpoint, &bus_cfg)) if (v4l2_fwnode_endpoint_parse(of_fwnode_handle(endpoint), &bus_cfg))
goto done; goto done;
pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL); pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
......
...@@ -82,6 +82,7 @@ config VIDEO_OMAP3 ...@@ -82,6 +82,7 @@ config VIDEO_OMAP3
select ARM_DMA_USE_IOMMU select ARM_DMA_USE_IOMMU
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select MFD_SYSCON select MFD_SYSCON
select V4L2_FWNODE
---help--- ---help---
Driver for an OMAP 3 camera controller. Driver for an OMAP 3 camera controller.
...@@ -97,6 +98,7 @@ config VIDEO_PXA27x ...@@ -97,6 +98,7 @@ config VIDEO_PXA27x
depends on PXA27x || COMPILE_TEST depends on PXA27x || COMPILE_TEST
select VIDEOBUF2_DMA_SG select VIDEOBUF2_DMA_SG
select SG_SPLIT select SG_SPLIT
select V4L2_FWNODE
---help--- ---help---
This is a v4l2 driver for the PXA27x Quick Capture Interface This is a v4l2 driver for the PXA27x Quick Capture Interface
...@@ -119,6 +121,7 @@ config VIDEO_STM32_DCMI ...@@ -119,6 +121,7 @@ config VIDEO_STM32_DCMI
depends on VIDEO_V4L2 && OF && HAS_DMA depends on VIDEO_V4L2 && OF && HAS_DMA
depends on ARCH_STM32 || COMPILE_TEST depends on ARCH_STM32 || COMPILE_TEST
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select V4L2_FWNODE
---help--- ---help---
This module makes the STM32 Digital Camera Memory Interface (DCMI) This module makes the STM32 Digital Camera Memory Interface (DCMI)
available as a v4l2 device. available as a v4l2 device.
...@@ -139,6 +142,7 @@ config VIDEO_TI_CAL ...@@ -139,6 +142,7 @@ config VIDEO_TI_CAL
depends on SOC_DRA7XX || COMPILE_TEST depends on SOC_DRA7XX || COMPILE_TEST
depends on HAS_DMA depends on HAS_DMA
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select V4L2_FWNODE
default n default n
---help--- ---help---
Support for the TI CAL (Camera Adaptation Layer) block Support for the TI CAL (Camera Adaptation Layer) block
......
...@@ -3,6 +3,7 @@ config VIDEO_AM437X_VPFE ...@@ -3,6 +3,7 @@ config VIDEO_AM437X_VPFE
depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && HAS_DMA depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && HAS_DMA
depends on SOC_AM43XX || COMPILE_TEST depends on SOC_AM43XX || COMPILE_TEST
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select V4L2_FWNODE
help help
Support for AM437x Video Processing Front End based Video Support for AM437x Video Processing Front End based Video
Capture Driver. Capture Driver.
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_graph.h>
#include <linux/pinctrl/consumer.h> #include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
...@@ -36,7 +37,7 @@ ...@@ -36,7 +37,7 @@
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/v4l2-event.h> #include <media/v4l2-event.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include "am437x-vpfe.h" #include "am437x-vpfe.h"
...@@ -2303,7 +2304,8 @@ vpfe_async_bound(struct v4l2_async_notifier *notifier, ...@@ -2303,7 +2304,8 @@ vpfe_async_bound(struct v4l2_async_notifier *notifier,
vpfe_dbg(1, vpfe, "vpfe_async_bound\n"); vpfe_dbg(1, vpfe, "vpfe_async_bound\n");
for (i = 0; i < ARRAY_SIZE(vpfe->cfg->asd); i++) { for (i = 0; i < ARRAY_SIZE(vpfe->cfg->asd); i++) {
if (vpfe->cfg->asd[i]->match.of.node == asd[i].match.of.node) { if (vpfe->cfg->asd[i]->match.fwnode.fwnode ==
asd[i].match.fwnode.fwnode) {
sdinfo = &vpfe->cfg->sub_devs[i]; sdinfo = &vpfe->cfg->sub_devs[i];
vpfe->sd[i] = subdev; vpfe->sd[i] = subdev;
vpfe->sd[i]->grp_id = sdinfo->grp_id; vpfe->sd[i]->grp_id = sdinfo->grp_id;
...@@ -2419,7 +2421,7 @@ static struct vpfe_config * ...@@ -2419,7 +2421,7 @@ static struct vpfe_config *
vpfe_get_pdata(struct platform_device *pdev) vpfe_get_pdata(struct platform_device *pdev)
{ {
struct device_node *endpoint = NULL; struct device_node *endpoint = NULL;
struct v4l2_of_endpoint bus_cfg; struct v4l2_fwnode_endpoint bus_cfg;
struct vpfe_subdev_info *sdinfo; struct vpfe_subdev_info *sdinfo;
struct vpfe_config *pdata; struct vpfe_config *pdata;
unsigned int flags; unsigned int flags;
...@@ -2463,7 +2465,8 @@ vpfe_get_pdata(struct platform_device *pdev) ...@@ -2463,7 +2465,8 @@ vpfe_get_pdata(struct platform_device *pdev)
sdinfo->vpfe_param.if_type = VPFE_RAW_BAYER; sdinfo->vpfe_param.if_type = VPFE_RAW_BAYER;
} }
err = v4l2_of_parse_endpoint(endpoint, &bus_cfg); err = v4l2_fwnode_endpoint_parse(of_fwnode_handle(endpoint),
&bus_cfg);
if (err) { if (err) {
dev_err(&pdev->dev, "Could not parse the endpoint\n"); dev_err(&pdev->dev, "Could not parse the endpoint\n");
goto done; goto done;
...@@ -2501,8 +2504,8 @@ vpfe_get_pdata(struct platform_device *pdev) ...@@ -2501,8 +2504,8 @@ vpfe_get_pdata(struct platform_device *pdev)
goto done; goto done;
} }
pdata->asd[i]->match_type = V4L2_ASYNC_MATCH_OF; pdata->asd[i]->match_type = V4L2_ASYNC_MATCH_FWNODE;
pdata->asd[i]->match.of.node = rem; pdata->asd[i]->match.fwnode.fwnode = of_fwnode_handle(rem);
of_node_put(rem); of_node_put(rem);
} }
......
...@@ -4,6 +4,7 @@ config VIDEO_ATMEL_ISC ...@@ -4,6 +4,7 @@ config VIDEO_ATMEL_ISC
depends on ARCH_AT91 || COMPILE_TEST depends on ARCH_AT91 || COMPILE_TEST
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select REGMAP_MMIO select REGMAP_MMIO
select V4L2_FWNODE
help help
This module makes the ATMEL Image Sensor Controller available This module makes the ATMEL Image Sensor Controller available
as a v4l2 device. as a v4l2 device.
...@@ -13,6 +14,7 @@ config VIDEO_ATMEL_ISI ...@@ -13,6 +14,7 @@ config VIDEO_ATMEL_ISI
depends on VIDEO_V4L2 && OF && HAS_DMA depends on VIDEO_V4L2 && OF && HAS_DMA
depends on ARCH_AT91 || COMPILE_TEST depends on ARCH_AT91 || COMPILE_TEST
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select V4L2_FWNODE
---help--- ---help---
This module makes the ATMEL Image Sensor Interface available This module makes the ATMEL Image Sensor Interface available
as a v4l2 device. as a v4l2 device.
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/math64.h> #include <linux/math64.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regmap.h> #include <linux/regmap.h>
...@@ -42,7 +43,7 @@ ...@@ -42,7 +43,7 @@
#include <media/v4l2-event.h> #include <media/v4l2-event.h>
#include <media/v4l2-image-sizes.h> #include <media/v4l2-image-sizes.h>
#include <media/v4l2-ioctl.h> #include <media/v4l2-ioctl.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h> #include <media/v4l2-subdev.h>
#include <media/videobuf2-dma-contig.h> #include <media/videobuf2-dma-contig.h>
...@@ -1685,7 +1686,7 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc) ...@@ -1685,7 +1686,7 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
{ {
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
struct device_node *epn = NULL, *rem; struct device_node *epn = NULL, *rem;
struct v4l2_of_endpoint v4l2_epn; struct v4l2_fwnode_endpoint v4l2_epn;
struct isc_subdev_entity *subdev_entity; struct isc_subdev_entity *subdev_entity;
unsigned int flags; unsigned int flags;
int ret; int ret;
...@@ -1704,7 +1705,8 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc) ...@@ -1704,7 +1705,8 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
continue; continue;
} }
ret = v4l2_of_parse_endpoint(epn, &v4l2_epn); ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(epn),
&v4l2_epn);
if (ret) { if (ret) {
of_node_put(rem); of_node_put(rem);
ret = -EINVAL; ret = -EINVAL;
...@@ -1739,8 +1741,9 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc) ...@@ -1739,8 +1741,9 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
if (flags & V4L2_MBUS_PCLK_SAMPLE_FALLING) if (flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)
subdev_entity->pfe_cfg0 |= ISC_PFE_CFG0_PPOL_LOW; subdev_entity->pfe_cfg0 |= ISC_PFE_CFG0_PPOL_LOW;
subdev_entity->asd->match_type = V4L2_ASYNC_MATCH_OF; subdev_entity->asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
subdev_entity->asd->match.of.node = rem; subdev_entity->asd->match.fwnode.fwnode =
of_fwnode_handle(rem);
list_add_tail(&subdev_entity->list, &isc->subdev_entities); list_add_tail(&subdev_entity->list, &isc->subdev_entities);
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -30,7 +31,7 @@ ...@@ -30,7 +31,7 @@
#include <media/v4l2-dev.h> #include <media/v4l2-dev.h>
#include <media/v4l2-ioctl.h> #include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h> #include <media/v4l2-event.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include <media/videobuf2-dma-contig.h> #include <media/videobuf2-dma-contig.h>
#include <media/v4l2-image-sizes.h> #include <media/v4l2-image-sizes.h>
...@@ -801,7 +802,7 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi, ...@@ -801,7 +802,7 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi,
struct platform_device *pdev) struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct v4l2_of_endpoint ep; struct v4l2_fwnode_endpoint ep;
int err; int err;
/* Default settings for ISI */ /* Default settings for ISI */
...@@ -814,7 +815,7 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi, ...@@ -814,7 +815,7 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi,
return -EINVAL; return -EINVAL;
} }
err = v4l2_of_parse_endpoint(np, &ep); err = v4l2_fwnode_endpoint_parse(of_fwnode_handle(np), &ep);
of_node_put(np); of_node_put(np);
if (err) { if (err) {
dev_err(&pdev->dev, "Could not parse the endpoint\n"); dev_err(&pdev->dev, "Could not parse the endpoint\n");
...@@ -1126,8 +1127,8 @@ static int isi_graph_parse(struct atmel_isi *isi, struct device_node *node) ...@@ -1126,8 +1127,8 @@ static int isi_graph_parse(struct atmel_isi *isi, struct device_node *node)
/* Remote node to connect */ /* Remote node to connect */
isi->entity.node = remote; isi->entity.node = remote;
isi->entity.asd.match_type = V4L2_ASYNC_MATCH_OF; isi->entity.asd.match_type = V4L2_ASYNC_MATCH_FWNODE;
isi->entity.asd.match.of.node = remote; isi->entity.asd.match.fwnode.fwnode = of_fwnode_handle(remote);
return 0; return 0;
} }
} }
......
...@@ -4,6 +4,7 @@ config VIDEO_SAMSUNG_EXYNOS4_IS ...@@ -4,6 +4,7 @@ config VIDEO_SAMSUNG_EXYNOS4_IS
depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
depends on ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST depends on ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST
depends on OF && COMMON_CLK depends on OF && COMMON_CLK
select V4L2_FWNODE
help help
Say Y here to enable camera host interface devices for Say Y here to enable camera host interface devices for
Samsung S5P and EXYNOS SoC series. Samsung S5P and EXYNOS SoC series.
...@@ -32,6 +33,7 @@ config VIDEO_S5P_MIPI_CSIS ...@@ -32,6 +33,7 @@ config VIDEO_S5P_MIPI_CSIS
tristate "S5P/EXYNOS MIPI-CSI2 receiver (MIPI-CSIS) driver" tristate "S5P/EXYNOS MIPI-CSI2 receiver (MIPI-CSIS) driver"
depends on REGULATOR depends on REGULATOR
select GENERIC_PHY select GENERIC_PHY
select V4L2_FWNODE
help help
This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC MIPI-CSI2 This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC MIPI-CSI2
receiver (MIPI-CSIS) devices. receiver (MIPI-CSIS) devices.
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <media/v4l2-async.h> #include <media/v4l2-async.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include <media/media-device.h> #include <media/media-device.h>
#include <media/drv-intf/exynos-fimc.h> #include <media/drv-intf/exynos-fimc.h>
...@@ -388,7 +388,7 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd, ...@@ -388,7 +388,7 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd,
{ {
struct fimc_source_info *pd = &fmd->sensor[index].pdata; struct fimc_source_info *pd = &fmd->sensor[index].pdata;
struct device_node *rem, *ep, *np; struct device_node *rem, *ep, *np;
struct v4l2_of_endpoint endpoint; struct v4l2_fwnode_endpoint endpoint;
int ret; int ret;
/* Assume here a port node can have only one endpoint node. */ /* Assume here a port node can have only one endpoint node. */
...@@ -396,7 +396,7 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd, ...@@ -396,7 +396,7 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd,
if (!ep) if (!ep)
return 0; return 0;
ret = v4l2_of_parse_endpoint(ep, &endpoint); ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &endpoint);
if (ret) { if (ret) {
of_node_put(ep); of_node_put(ep);
return ret; return ret;
...@@ -453,8 +453,8 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd, ...@@ -453,8 +453,8 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd,
return -EINVAL; return -EINVAL;
} }
fmd->sensor[index].asd.match_type = V4L2_ASYNC_MATCH_OF; fmd->sensor[index].asd.match_type = V4L2_ASYNC_MATCH_FWNODE;
fmd->sensor[index].asd.match.of.node = rem; fmd->sensor[index].asd.match.fwnode.fwnode = of_fwnode_handle(rem);
fmd->async_subdevs[index] = &fmd->sensor[index].asd; fmd->async_subdevs[index] = &fmd->sensor[index].asd;
fmd->num_sensors++; fmd->num_sensors++;
...@@ -1361,7 +1361,8 @@ static int subdev_notifier_bound(struct v4l2_async_notifier *notifier, ...@@ -1361,7 +1361,8 @@ static int subdev_notifier_bound(struct v4l2_async_notifier *notifier,
/* Find platform data for this sensor subdev */ /* Find platform data for this sensor subdev */
for (i = 0; i < ARRAY_SIZE(fmd->sensor); i++) for (i = 0; i < ARRAY_SIZE(fmd->sensor); i++)
if (fmd->sensor[i].asd.match.of.node == subdev->dev->of_node) if (fmd->sensor[i].asd.match.fwnode.fwnode ==
of_fwnode_handle(subdev->dev->of_node))
si = &fmd->sensor[i]; si = &fmd->sensor[i];
if (si == NULL) if (si == NULL)
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/drv-intf/exynos-fimc.h> #include <media/drv-intf/exynos-fimc.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h> #include <media/v4l2-subdev.h>
#include "mipi-csis.h" #include "mipi-csis.h"
...@@ -718,7 +718,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev, ...@@ -718,7 +718,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
struct csis_state *state) struct csis_state *state)
{ {
struct device_node *node = pdev->dev.of_node; struct device_node *node = pdev->dev.of_node;
struct v4l2_of_endpoint endpoint; struct v4l2_fwnode_endpoint endpoint;
int ret; int ret;
if (of_property_read_u32(node, "clock-frequency", if (of_property_read_u32(node, "clock-frequency",
...@@ -735,7 +735,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev, ...@@ -735,7 +735,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
return -EINVAL; return -EINVAL;
} }
/* Get port node and validate MIPI-CSI channel id. */ /* Get port node and validate MIPI-CSI channel id. */
ret = v4l2_of_parse_endpoint(node, &endpoint); ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(node), &endpoint);
if (ret) if (ret)
goto err; goto err;
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/omap-iommu.h> #include <linux/omap-iommu.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -63,9 +64,9 @@ ...@@ -63,9 +64,9 @@
#include <asm/dma-iommu.h> #include <asm/dma-iommu.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-mc.h> #include <media/v4l2-mc.h>
#include <media/v4l2-of.h>
#include "isp.h" #include "isp.h"
#include "ispreg.h" #include "ispreg.h"
...@@ -2007,20 +2008,20 @@ enum isp_of_phy { ...@@ -2007,20 +2008,20 @@ enum isp_of_phy {
ISP_OF_PHY_CSIPHY2, ISP_OF_PHY_CSIPHY2,
}; };
static int isp_of_parse_node(struct device *dev, struct device_node *node, static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwnode,
struct isp_async_subdev *isd) struct isp_async_subdev *isd)
{ {
struct isp_bus_cfg *buscfg = &isd->bus; struct isp_bus_cfg *buscfg = &isd->bus;
struct v4l2_of_endpoint vep; struct v4l2_fwnode_endpoint vep;
unsigned int i; unsigned int i;
int ret; int ret;
ret = v4l2_of_parse_endpoint(node, &vep); ret = v4l2_fwnode_endpoint_parse(fwnode, &vep);
if (ret) if (ret)
return ret; return ret;
dev_dbg(dev, "parsing endpoint %s, interface %u\n", node->full_name, dev_dbg(dev, "parsing endpoint %s, interface %u\n",
vep.base.port); to_of_node(fwnode)->full_name, vep.base.port);
switch (vep.base.port) { switch (vep.base.port) {
case ISP_OF_PHY_PARALLEL: case ISP_OF_PHY_PARALLEL:
...@@ -2077,18 +2078,18 @@ static int isp_of_parse_node(struct device *dev, struct device_node *node, ...@@ -2077,18 +2078,18 @@ static int isp_of_parse_node(struct device *dev, struct device_node *node,
break; break;
default: default:
dev_warn(dev, "%s: invalid interface %u\n", node->full_name, dev_warn(dev, "%s: invalid interface %u\n",
vep.base.port); to_of_node(fwnode)->full_name, vep.base.port);
break; break;
} }
return 0; return 0;
} }
static int isp_of_parse_nodes(struct device *dev, static int isp_fwnodes_parse(struct device *dev,
struct v4l2_async_notifier *notifier) struct v4l2_async_notifier *notifier)
{ {
struct device_node *node = NULL; struct fwnode_handle *fwnode = NULL;
notifier->subdevs = devm_kcalloc( notifier->subdevs = devm_kcalloc(
dev, ISP_MAX_SUBDEVS, sizeof(*notifier->subdevs), GFP_KERNEL); dev, ISP_MAX_SUBDEVS, sizeof(*notifier->subdevs), GFP_KERNEL);
...@@ -2096,7 +2097,8 @@ static int isp_of_parse_nodes(struct device *dev, ...@@ -2096,7 +2097,8 @@ static int isp_of_parse_nodes(struct device *dev,
return -ENOMEM; return -ENOMEM;
while (notifier->num_subdevs < ISP_MAX_SUBDEVS && while (notifier->num_subdevs < ISP_MAX_SUBDEVS &&
(node = of_graph_get_next_endpoint(dev->of_node, node))) { (fwnode = fwnode_graph_get_next_endpoint(
of_fwnode_handle(dev->of_node), fwnode))) {
struct isp_async_subdev *isd; struct isp_async_subdev *isd;
isd = devm_kzalloc(dev, sizeof(*isd), GFP_KERNEL); isd = devm_kzalloc(dev, sizeof(*isd), GFP_KERNEL);
...@@ -2105,23 +2107,24 @@ static int isp_of_parse_nodes(struct device *dev, ...@@ -2105,23 +2107,24 @@ static int isp_of_parse_nodes(struct device *dev,
notifier->subdevs[notifier->num_subdevs] = &isd->asd; notifier->subdevs[notifier->num_subdevs] = &isd->asd;
if (isp_of_parse_node(dev, node, isd)) if (isp_fwnode_parse(dev, fwnode, isd))
goto error; goto error;
isd->asd.match.of.node = of_graph_get_remote_port_parent(node); isd->asd.match.fwnode.fwnode =
if (!isd->asd.match.of.node) { fwnode_graph_get_remote_port_parent(fwnode);
if (!isd->asd.match.fwnode.fwnode) {
dev_warn(dev, "bad remote port parent\n"); dev_warn(dev, "bad remote port parent\n");
goto error; goto error;
} }
isd->asd.match_type = V4L2_ASYNC_MATCH_OF; isd->asd.match_type = V4L2_ASYNC_MATCH_FWNODE;
notifier->num_subdevs++; notifier->num_subdevs++;
} }
return notifier->num_subdevs; return notifier->num_subdevs;
error: error:
of_node_put(node); fwnode_handle_put(fwnode);
return -EINVAL; return -EINVAL;
} }
...@@ -2192,8 +2195,8 @@ static int isp_probe(struct platform_device *pdev) ...@@ -2192,8 +2195,8 @@ static int isp_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
} }
ret = of_property_read_u32(pdev->dev.of_node, "ti,phy-type", ret = fwnode_property_read_u32(of_fwnode_handle(pdev->dev.of_node),
&isp->phy_type); "ti,phy-type", &isp->phy_type);
if (ret) if (ret)
return ret; return ret;
...@@ -2202,12 +2205,12 @@ static int isp_probe(struct platform_device *pdev) ...@@ -2202,12 +2205,12 @@ static int isp_probe(struct platform_device *pdev)
if (IS_ERR(isp->syscon)) if (IS_ERR(isp->syscon))
return PTR_ERR(isp->syscon); return PTR_ERR(isp->syscon);
ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1, ret = of_property_read_u32_index(pdev->dev.of_node,
&isp->syscon_offset); "syscon", 1, &isp->syscon_offset);
if (ret) if (ret)
return ret; return ret;
ret = isp_of_parse_nodes(&pdev->dev, &isp->notifier); ret = isp_fwnodes_parse(&pdev->dev, &isp->notifier);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/clk.h> #include <linux/clk.h>
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-event.h> #include <media/v4l2-event.h>
#include <media/v4l2-ioctl.h> #include <media/v4l2-ioctl.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include <media/videobuf2-dma-sg.h> #include <media/videobuf2-dma-sg.h>
...@@ -2270,7 +2271,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev, ...@@ -2270,7 +2271,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev,
{ {
u32 mclk_rate; u32 mclk_rate;
struct device_node *remote, *np = dev->of_node; struct device_node *remote, *np = dev->of_node;
struct v4l2_of_endpoint ep; struct v4l2_fwnode_endpoint ep;
int err = of_property_read_u32(np, "clock-frequency", int err = of_property_read_u32(np, "clock-frequency",
&mclk_rate); &mclk_rate);
if (!err) { if (!err) {
...@@ -2284,7 +2285,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev, ...@@ -2284,7 +2285,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev,
return -EINVAL; return -EINVAL;
} }
err = v4l2_of_parse_endpoint(np, &ep); err = v4l2_fwnode_endpoint_parse(of_fwnode_handle(np), &ep);
if (err) { if (err) {
dev_err(dev, "could not parse endpoint\n"); dev_err(dev, "could not parse endpoint\n");
goto out; goto out;
...@@ -2321,10 +2322,10 @@ static int pxa_camera_pdata_from_dt(struct device *dev, ...@@ -2321,10 +2322,10 @@ static int pxa_camera_pdata_from_dt(struct device *dev,
if (ep.bus.parallel.flags & V4L2_MBUS_PCLK_SAMPLE_FALLING) if (ep.bus.parallel.flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)
pcdev->platform_flags |= PXA_CAMERA_PCLK_EN; pcdev->platform_flags |= PXA_CAMERA_PCLK_EN;
asd->match_type = V4L2_ASYNC_MATCH_OF; asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
remote = of_graph_get_remote_port(np); remote = of_graph_get_remote_port(np);
if (remote) { if (remote) {
asd->match.of.node = remote; asd->match.fwnode.fwnode = of_fwnode_handle(remote);
of_node_put(remote); of_node_put(remote);
} else { } else {
dev_notice(dev, "no remote for %s\n", of_node_full_name(np)); dev_notice(dev, "no remote for %s\n", of_node_full_name(np));
......
...@@ -3,6 +3,7 @@ config VIDEO_RCAR_VIN ...@@ -3,6 +3,7 @@ config VIDEO_RCAR_VIN
depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && OF && HAS_DMA && MEDIA_CONTROLLER depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && OF && HAS_DMA && MEDIA_CONTROLLER
depends on ARCH_RENESAS || COMPILE_TEST depends on ARCH_RENESAS || COMPILE_TEST
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select V4L2_FWNODE
---help--- ---help---
Support for Renesas R-Car Video Input (VIN) driver. Support for Renesas R-Car Video Input (VIN) driver.
Supports R-Car Gen2 SoCs. Supports R-Car Gen2 SoCs.
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include "rcar-vin.h" #include "rcar-vin.h"
...@@ -104,7 +104,8 @@ static int rvin_digital_notify_bound(struct v4l2_async_notifier *notifier, ...@@ -104,7 +104,8 @@ static int rvin_digital_notify_bound(struct v4l2_async_notifier *notifier,
v4l2_set_subdev_hostdata(subdev, vin); v4l2_set_subdev_hostdata(subdev, vin);
if (vin->digital.asd.match.of.node == subdev->dev->of_node) { if (vin->digital.asd.match.fwnode.fwnode ==
of_fwnode_handle(subdev->dev->of_node)) {
vin_dbg(vin, "bound digital subdev %s\n", subdev->name); vin_dbg(vin, "bound digital subdev %s\n", subdev->name);
vin->digital.subdev = subdev; vin->digital.subdev = subdev;
return 0; return 0;
...@@ -118,10 +119,10 @@ static int rvin_digitial_parse_v4l2(struct rvin_dev *vin, ...@@ -118,10 +119,10 @@ static int rvin_digitial_parse_v4l2(struct rvin_dev *vin,
struct device_node *ep, struct device_node *ep,
struct v4l2_mbus_config *mbus_cfg) struct v4l2_mbus_config *mbus_cfg)
{ {
struct v4l2_of_endpoint v4l2_ep; struct v4l2_fwnode_endpoint v4l2_ep;
int ret; int ret;
ret = v4l2_of_parse_endpoint(ep, &v4l2_ep); ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &v4l2_ep);
if (ret) { if (ret) {
vin_err(vin, "Could not parse v4l2 endpoint\n"); vin_err(vin, "Could not parse v4l2 endpoint\n");
return -EINVAL; return -EINVAL;
...@@ -151,7 +152,7 @@ static int rvin_digital_graph_parse(struct rvin_dev *vin) ...@@ -151,7 +152,7 @@ static int rvin_digital_graph_parse(struct rvin_dev *vin)
struct device_node *ep, *np; struct device_node *ep, *np;
int ret; int ret;
vin->digital.asd.match.of.node = NULL; vin->digital.asd.match.fwnode.fwnode = NULL;
vin->digital.subdev = NULL; vin->digital.subdev = NULL;
/* /*
...@@ -175,8 +176,8 @@ static int rvin_digital_graph_parse(struct rvin_dev *vin) ...@@ -175,8 +176,8 @@ static int rvin_digital_graph_parse(struct rvin_dev *vin)
if (ret) if (ret)
return ret; return ret;
vin->digital.asd.match.of.node = np; vin->digital.asd.match.fwnode.fwnode = of_fwnode_handle(np);
vin->digital.asd.match_type = V4L2_ASYNC_MATCH_OF; vin->digital.asd.match_type = V4L2_ASYNC_MATCH_FWNODE;
return 0; return 0;
} }
...@@ -190,7 +191,7 @@ static int rvin_digital_graph_init(struct rvin_dev *vin) ...@@ -190,7 +191,7 @@ static int rvin_digital_graph_init(struct rvin_dev *vin)
if (ret) if (ret)
return ret; return ret;
if (!vin->digital.asd.match.of.node) { if (!vin->digital.asd.match.fwnode.fwnode) {
vin_dbg(vin, "No digital subdevice found\n"); vin_dbg(vin, "No digital subdevice found\n");
return -ENODEV; return -ENODEV;
} }
...@@ -203,7 +204,7 @@ static int rvin_digital_graph_init(struct rvin_dev *vin) ...@@ -203,7 +204,7 @@ static int rvin_digital_graph_init(struct rvin_dev *vin)
subdevs[0] = &vin->digital.asd; subdevs[0] = &vin->digital.asd;
vin_dbg(vin, "Found digital subdevice %s\n", vin_dbg(vin, "Found digital subdevice %s\n",
of_node_full_name(subdevs[0]->match.of.node)); of_node_full_name(to_of_node(subdevs[0]->match.fwnode.fwnode)));
vin->notifier.num_subdevs = 1; vin->notifier.num_subdevs = 1;
vin->notifier.subdevs = subdevs; vin->notifier.subdevs = subdevs;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
...@@ -36,7 +37,7 @@ ...@@ -36,7 +37,7 @@
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h> #include <media/v4l2-ioctl.h>
#include <media/v4l2-dev.h> #include <media/v4l2-dev.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include <media/videobuf2-v4l2.h> #include <media/videobuf2-v4l2.h>
/* Default to VGA resolution */ /* Default to VGA resolution */
...@@ -1512,8 +1513,8 @@ static int soc_of_bind(struct soc_camera_host *ici, ...@@ -1512,8 +1513,8 @@ static int soc_of_bind(struct soc_camera_host *ici,
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
info->sasd.asd.match.of.node = remote; info->sasd.asd.match.fwnode.fwnode = of_fwnode_handle(remote);
info->sasd.asd.match_type = V4L2_ASYNC_MATCH_OF; info->sasd.asd.match_type = V4L2_ASYNC_MATCH_FWNODE;
info->subdev = &info->sasd.asd; info->subdev = &info->sasd.asd;
/* Or shall this be managed by the soc-camera device? */ /* Or shall this be managed by the soc-camera device? */
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/reset.h> #include <linux/reset.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
...@@ -29,9 +30,9 @@ ...@@ -29,9 +30,9 @@
#include <media/v4l2-dev.h> #include <media/v4l2-dev.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-ioctl.h> #include <media/v4l2-ioctl.h>
#include <media/v4l2-of.h>
#include <media/videobuf2-dma-contig.h> #include <media/videobuf2-dma-contig.h>
#define DRV_NAME "stm32-dcmi" #define DRV_NAME "stm32-dcmi"
...@@ -139,7 +140,7 @@ struct stm32_dcmi { ...@@ -139,7 +140,7 @@ struct stm32_dcmi {
struct mutex lock; struct mutex lock;
struct vb2_queue queue; struct vb2_queue queue;
struct v4l2_of_bus_parallel bus; struct v4l2_fwnode_bus_parallel bus;
struct completion complete; struct completion complete;
struct clk *mclk; struct clk *mclk;
enum state state; enum state state;
...@@ -1143,8 +1144,8 @@ static int dcmi_graph_parse(struct stm32_dcmi *dcmi, struct device_node *node) ...@@ -1143,8 +1144,8 @@ static int dcmi_graph_parse(struct stm32_dcmi *dcmi, struct device_node *node)
/* Remote node to connect */ /* Remote node to connect */
dcmi->entity.node = remote; dcmi->entity.node = remote;
dcmi->entity.asd.match_type = V4L2_ASYNC_MATCH_OF; dcmi->entity.asd.match_type = V4L2_ASYNC_MATCH_FWNODE;
dcmi->entity.asd.match.of.node = remote; dcmi->entity.asd.match.fwnode.fwnode = of_fwnode_handle(remote);
return 0; return 0;
} }
} }
...@@ -1190,7 +1191,7 @@ static int dcmi_probe(struct platform_device *pdev) ...@@ -1190,7 +1191,7 @@ static int dcmi_probe(struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
const struct of_device_id *match = NULL; const struct of_device_id *match = NULL;
struct v4l2_of_endpoint ep; struct v4l2_fwnode_endpoint ep;
struct stm32_dcmi *dcmi; struct stm32_dcmi *dcmi;
struct vb2_queue *q; struct vb2_queue *q;
struct dma_chan *chan; struct dma_chan *chan;
...@@ -1222,7 +1223,7 @@ static int dcmi_probe(struct platform_device *pdev) ...@@ -1222,7 +1223,7 @@ static int dcmi_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
ret = v4l2_of_parse_endpoint(np, &ep); ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(np), &ep);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Could not parse the endpoint\n"); dev_err(&pdev->dev, "Could not parse the endpoint\n");
of_node_put(np); of_node_put(np);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_graph.h> #include <linux/of_graph.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include <media/v4l2-async.h> #include <media/v4l2-async.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
...@@ -270,7 +270,7 @@ struct cal_ctx { ...@@ -270,7 +270,7 @@ struct cal_ctx {
struct video_device vdev; struct video_device vdev;
struct v4l2_async_notifier notifier; struct v4l2_async_notifier notifier;
struct v4l2_subdev *sensor; struct v4l2_subdev *sensor;
struct v4l2_of_endpoint endpoint; struct v4l2_fwnode_endpoint endpoint;
struct v4l2_async_subdev asd; struct v4l2_async_subdev asd;
struct v4l2_async_subdev *asd_list[1]; struct v4l2_async_subdev *asd_list[1];
...@@ -608,7 +608,8 @@ static void csi2_lane_config(struct cal_ctx *ctx) ...@@ -608,7 +608,8 @@ static void csi2_lane_config(struct cal_ctx *ctx)
u32 val = reg_read(ctx->dev, CAL_CSI2_COMPLEXIO_CFG(ctx->csi2_port)); u32 val = reg_read(ctx->dev, CAL_CSI2_COMPLEXIO_CFG(ctx->csi2_port));
u32 lane_mask = CAL_CSI2_COMPLEXIO_CFG_CLOCK_POSITION_MASK; u32 lane_mask = CAL_CSI2_COMPLEXIO_CFG_CLOCK_POSITION_MASK;
u32 polarity_mask = CAL_CSI2_COMPLEXIO_CFG_CLOCK_POL_MASK; u32 polarity_mask = CAL_CSI2_COMPLEXIO_CFG_CLOCK_POL_MASK;
struct v4l2_of_bus_mipi_csi2 *mipi_csi2 = &ctx->endpoint.bus.mipi_csi2; struct v4l2_fwnode_bus_mipi_csi2 *mipi_csi2 =
&ctx->endpoint.bus.mipi_csi2;
int lane; int lane;
set_field(&val, mipi_csi2->clock_lane + 1, lane_mask); set_field(&val, mipi_csi2->clock_lane + 1, lane_mask);
...@@ -1643,7 +1644,7 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst) ...@@ -1643,7 +1644,7 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
struct platform_device *pdev = ctx->dev->pdev; struct platform_device *pdev = ctx->dev->pdev;
struct device_node *ep_node, *port, *remote_ep, struct device_node *ep_node, *port, *remote_ep,
*sensor_node, *parent; *sensor_node, *parent;
struct v4l2_of_endpoint *endpoint; struct v4l2_fwnode_endpoint *endpoint;
struct v4l2_async_subdev *asd; struct v4l2_async_subdev *asd;
u32 regval = 0; u32 regval = 0;
int ret, index, found_port = 0, lane; int ret, index, found_port = 0, lane;
...@@ -1698,15 +1699,15 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst) ...@@ -1698,15 +1699,15 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
ctx_dbg(3, ctx, "can't get remote parent\n"); ctx_dbg(3, ctx, "can't get remote parent\n");
goto cleanup_exit; goto cleanup_exit;
} }
asd->match_type = V4L2_ASYNC_MATCH_OF; asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
asd->match.of.node = sensor_node; asd->match.fwnode.fwnode = of_fwnode_handle(sensor_node);
remote_ep = of_parse_phandle(ep_node, "remote-endpoint", 0); remote_ep = of_parse_phandle(ep_node, "remote-endpoint", 0);
if (!remote_ep) { if (!remote_ep) {
ctx_dbg(3, ctx, "can't get remote-endpoint\n"); ctx_dbg(3, ctx, "can't get remote-endpoint\n");
goto cleanup_exit; goto cleanup_exit;
} }
v4l2_of_parse_endpoint(remote_ep, endpoint); v4l2_fwnode_endpoint_parse(of_fwnode_handle(remote_ep), endpoint);
if (endpoint->bus_type != V4L2_MBUS_CSI2) { if (endpoint->bus_type != V4L2_MBUS_CSI2) {
ctx_err(ctx, "Port:%d sub-device %s is not a CSI2 device\n", ctx_err(ctx, "Port:%d sub-device %s is not a CSI2 device\n",
......
...@@ -2,6 +2,7 @@ config VIDEO_XILINX ...@@ -2,6 +2,7 @@ config VIDEO_XILINX
tristate "Xilinx Video IP (EXPERIMENTAL)" tristate "Xilinx Video IP (EXPERIMENTAL)"
depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && OF && HAS_DMA depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && OF && HAS_DMA
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select V4L2_FWNODE
---help--- ---help---
Driver for Xilinx Video IP Pipelines Driver for Xilinx Video IP Pipelines
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <media/v4l2-async.h> #include <media/v4l2-async.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-of.h> #include <media/v4l2-fwnode.h>
#include "xilinx-dma.h" #include "xilinx-dma.h"
#include "xilinx-vipp.h" #include "xilinx-vipp.h"
...@@ -74,7 +74,7 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev, ...@@ -74,7 +74,7 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev,
struct media_pad *local_pad; struct media_pad *local_pad;
struct media_pad *remote_pad; struct media_pad *remote_pad;
struct xvip_graph_entity *ent; struct xvip_graph_entity *ent;
struct v4l2_of_link link; struct v4l2_fwnode_link link;
struct device_node *ep = NULL; struct device_node *ep = NULL;
struct device_node *next; struct device_node *next;
int ret = 0; int ret = 0;
...@@ -92,7 +92,7 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev, ...@@ -92,7 +92,7 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev,
dev_dbg(xdev->dev, "processing endpoint %s\n", ep->full_name); dev_dbg(xdev->dev, "processing endpoint %s\n", ep->full_name);
ret = v4l2_of_parse_link(ep, &link); ret = v4l2_fwnode_parse_link(of_fwnode_handle(ep), &link);
if (ret < 0) { if (ret < 0) {
dev_err(xdev->dev, "failed to parse link for %s\n", dev_err(xdev->dev, "failed to parse link for %s\n",
ep->full_name); ep->full_name);
...@@ -103,9 +103,10 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev, ...@@ -103,9 +103,10 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev,
* the link. * the link.
*/ */
if (link.local_port >= local->num_pads) { if (link.local_port >= local->num_pads) {
dev_err(xdev->dev, "invalid port number %u on %s\n", dev_err(xdev->dev, "invalid port number %u for %s\n",
link.local_port, link.local_node->full_name); link.local_port,
v4l2_of_put_link(&link); to_of_node(link.local_node)->full_name);
v4l2_fwnode_put_link(&link);
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
...@@ -114,25 +115,28 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev, ...@@ -114,25 +115,28 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev,
if (local_pad->flags & MEDIA_PAD_FL_SINK) { if (local_pad->flags & MEDIA_PAD_FL_SINK) {
dev_dbg(xdev->dev, "skipping sink port %s:%u\n", dev_dbg(xdev->dev, "skipping sink port %s:%u\n",
link.local_node->full_name, link.local_port); to_of_node(link.local_node)->full_name,
v4l2_of_put_link(&link); link.local_port);
v4l2_fwnode_put_link(&link);
continue; continue;
} }
/* Skip DMA engines, they will be processed separately. */ /* Skip DMA engines, they will be processed separately. */
if (link.remote_node == xdev->dev->of_node) { if (link.remote_node == of_fwnode_handle(xdev->dev->of_node)) {
dev_dbg(xdev->dev, "skipping DMA port %s:%u\n", dev_dbg(xdev->dev, "skipping DMA port %s:%u\n",
link.local_node->full_name, link.local_port); to_of_node(link.local_node)->full_name,
v4l2_of_put_link(&link); link.local_port);
v4l2_fwnode_put_link(&link);
continue; continue;
} }
/* Find the remote entity. */ /* Find the remote entity. */
ent = xvip_graph_find_entity(xdev, link.remote_node); ent = xvip_graph_find_entity(xdev,
to_of_node(link.remote_node));
if (ent == NULL) { if (ent == NULL) {
dev_err(xdev->dev, "no entity found for %s\n", dev_err(xdev->dev, "no entity found for %s\n",
link.remote_node->full_name); to_of_node(link.remote_node)->full_name);
v4l2_of_put_link(&link); v4l2_fwnode_put_link(&link);
ret = -ENODEV; ret = -ENODEV;
break; break;
} }
...@@ -141,15 +145,16 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev, ...@@ -141,15 +145,16 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev,
if (link.remote_port >= remote->num_pads) { if (link.remote_port >= remote->num_pads) {
dev_err(xdev->dev, "invalid port number %u on %s\n", dev_err(xdev->dev, "invalid port number %u on %s\n",
link.remote_port, link.remote_node->full_name); link.remote_port,
v4l2_of_put_link(&link); to_of_node(link.remote_node)->full_name);
v4l2_fwnode_put_link(&link);
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
remote_pad = &remote->pads[link.remote_port]; remote_pad = &remote->pads[link.remote_port];
v4l2_of_put_link(&link); v4l2_fwnode_put_link(&link);
/* Create the media link. */ /* Create the media link. */
dev_dbg(xdev->dev, "creating %s:%u -> %s:%u link\n", dev_dbg(xdev->dev, "creating %s:%u -> %s:%u link\n",
...@@ -194,7 +199,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev) ...@@ -194,7 +199,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
struct media_pad *source_pad; struct media_pad *source_pad;
struct media_pad *sink_pad; struct media_pad *sink_pad;
struct xvip_graph_entity *ent; struct xvip_graph_entity *ent;
struct v4l2_of_link link; struct v4l2_fwnode_link link;
struct device_node *ep = NULL; struct device_node *ep = NULL;
struct device_node *next; struct device_node *next;
struct xvip_dma *dma; struct xvip_dma *dma;
...@@ -213,7 +218,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev) ...@@ -213,7 +218,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
dev_dbg(xdev->dev, "processing endpoint %s\n", ep->full_name); dev_dbg(xdev->dev, "processing endpoint %s\n", ep->full_name);
ret = v4l2_of_parse_link(ep, &link); ret = v4l2_fwnode_parse_link(of_fwnode_handle(ep), &link);
if (ret < 0) { if (ret < 0) {
dev_err(xdev->dev, "failed to parse link for %s\n", dev_err(xdev->dev, "failed to parse link for %s\n",
ep->full_name); ep->full_name);
...@@ -225,7 +230,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev) ...@@ -225,7 +230,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
if (dma == NULL) { if (dma == NULL) {
dev_err(xdev->dev, "no DMA engine found for port %u\n", dev_err(xdev->dev, "no DMA engine found for port %u\n",
link.local_port); link.local_port);
v4l2_of_put_link(&link); v4l2_fwnode_put_link(&link);
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
...@@ -234,19 +239,21 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev) ...@@ -234,19 +239,21 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
dma->video.name); dma->video.name);
/* Find the remote entity. */ /* Find the remote entity. */
ent = xvip_graph_find_entity(xdev, link.remote_node); ent = xvip_graph_find_entity(xdev,
to_of_node(link.remote_node));
if (ent == NULL) { if (ent == NULL) {
dev_err(xdev->dev, "no entity found for %s\n", dev_err(xdev->dev, "no entity found for %s\n",
link.remote_node->full_name); to_of_node(link.remote_node)->full_name);
v4l2_of_put_link(&link); v4l2_fwnode_put_link(&link);
ret = -ENODEV; ret = -ENODEV;
break; break;
} }
if (link.remote_port >= ent->entity->num_pads) { if (link.remote_port >= ent->entity->num_pads) {
dev_err(xdev->dev, "invalid port number %u on %s\n", dev_err(xdev->dev, "invalid port number %u on %s\n",
link.remote_port, link.remote_node->full_name); link.remote_port,
v4l2_of_put_link(&link); to_of_node(link.remote_node)->full_name);
v4l2_fwnode_put_link(&link);
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
...@@ -263,7 +270,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev) ...@@ -263,7 +270,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
sink_pad = &dma->pad; sink_pad = &dma->pad;
} }
v4l2_of_put_link(&link); v4l2_fwnode_put_link(&link);
/* Create the media link. */ /* Create the media link. */
dev_dbg(xdev->dev, "creating %s:%u -> %s:%u link\n", dev_dbg(xdev->dev, "creating %s:%u -> %s:%u link\n",
...@@ -383,8 +390,8 @@ static int xvip_graph_parse_one(struct xvip_composite_device *xdev, ...@@ -383,8 +390,8 @@ static int xvip_graph_parse_one(struct xvip_composite_device *xdev,
} }
entity->node = remote; entity->node = remote;
entity->asd.match_type = V4L2_ASYNC_MATCH_OF; entity->asd.match_type = V4L2_ASYNC_MATCH_FWNODE;
entity->asd.match.of.node = remote; entity->asd.match.fwnode.fwnode = of_fwnode_handle(remote);
list_add_tail(&entity->list, &xdev->entities); list_add_tail(&entity->list, &xdev->entities);
xdev->num_subdevs++; xdev->num_subdevs++;
} }
......
...@@ -41,12 +41,6 @@ static bool match_devname(struct v4l2_subdev *sd, ...@@ -41,12 +41,6 @@ static bool match_devname(struct v4l2_subdev *sd,
return !strcmp(asd->match.device_name.name, dev_name(sd->dev)); return !strcmp(asd->match.device_name.name, dev_name(sd->dev));
} }
static bool match_of(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd)
{
return !of_node_cmp(of_node_full_name(sd->of_node),
of_node_full_name(asd->match.of.node));
}
static bool match_fwnode(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) static bool match_fwnode(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd)
{ {
if (!is_of_node(sd->fwnode) || !is_of_node(asd->match.fwnode.fwnode)) if (!is_of_node(sd->fwnode) || !is_of_node(asd->match.fwnode.fwnode))
...@@ -88,9 +82,6 @@ static struct v4l2_async_subdev *v4l2_async_belongs(struct v4l2_async_notifier * ...@@ -88,9 +82,6 @@ static struct v4l2_async_subdev *v4l2_async_belongs(struct v4l2_async_notifier *
case V4L2_ASYNC_MATCH_I2C: case V4L2_ASYNC_MATCH_I2C:
match = match_i2c; match = match_i2c;
break; break;
case V4L2_ASYNC_MATCH_OF:
match = match_of;
break;
case V4L2_ASYNC_MATCH_FWNODE: case V4L2_ASYNC_MATCH_FWNODE:
match = match_fwnode; match = match_fwnode;
break; break;
...@@ -171,7 +162,6 @@ int v4l2_async_notifier_register(struct v4l2_device *v4l2_dev, ...@@ -171,7 +162,6 @@ int v4l2_async_notifier_register(struct v4l2_device *v4l2_dev,
case V4L2_ASYNC_MATCH_CUSTOM: case V4L2_ASYNC_MATCH_CUSTOM:
case V4L2_ASYNC_MATCH_DEVNAME: case V4L2_ASYNC_MATCH_DEVNAME:
case V4L2_ASYNC_MATCH_I2C: case V4L2_ASYNC_MATCH_I2C:
case V4L2_ASYNC_MATCH_OF:
case V4L2_ASYNC_MATCH_FWNODE: case V4L2_ASYNC_MATCH_FWNODE:
break; break;
default: default:
...@@ -295,8 +285,8 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) ...@@ -295,8 +285,8 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd)
* (struct v4l2_subdev.dev), and async sub-device does not * (struct v4l2_subdev.dev), and async sub-device does not
* exist independently of the device at any point of time. * exist independently of the device at any point of time.
*/ */
if (!sd->of_node && sd->dev) if (!sd->fwnode && sd->dev)
sd->of_node = sd->dev->of_node; sd->fwnode = dev_fwnode(sd->dev);
mutex_lock(&list_lock); mutex_lock(&list_lock);
......
...@@ -31,7 +31,6 @@ struct v4l2_async_notifier; ...@@ -31,7 +31,6 @@ struct v4l2_async_notifier;
* v4l2_async_subdev.match ops * v4l2_async_subdev.match ops
* @V4L2_ASYNC_MATCH_DEVNAME: Match will use the device name * @V4L2_ASYNC_MATCH_DEVNAME: Match will use the device name
* @V4L2_ASYNC_MATCH_I2C: Match will check for I2C adapter ID and address * @V4L2_ASYNC_MATCH_I2C: Match will check for I2C adapter ID and address
* @V4L2_ASYNC_MATCH_OF: Match will use OF node
* @V4L2_ASYNC_MATCH_FWNODE: Match will use firmware node * @V4L2_ASYNC_MATCH_FWNODE: Match will use firmware node
* *
* This enum is used by the asyncrhronous sub-device logic to define the * This enum is used by the asyncrhronous sub-device logic to define the
...@@ -41,7 +40,6 @@ enum v4l2_async_match_type { ...@@ -41,7 +40,6 @@ enum v4l2_async_match_type {
V4L2_ASYNC_MATCH_CUSTOM, V4L2_ASYNC_MATCH_CUSTOM,
V4L2_ASYNC_MATCH_DEVNAME, V4L2_ASYNC_MATCH_DEVNAME,
V4L2_ASYNC_MATCH_I2C, V4L2_ASYNC_MATCH_I2C,
V4L2_ASYNC_MATCH_OF,
V4L2_ASYNC_MATCH_FWNODE, V4L2_ASYNC_MATCH_FWNODE,
}; };
...@@ -56,9 +54,6 @@ enum v4l2_async_match_type { ...@@ -56,9 +54,6 @@ enum v4l2_async_match_type {
struct v4l2_async_subdev { struct v4l2_async_subdev {
enum v4l2_async_match_type match_type; enum v4l2_async_match_type match_type;
union { union {
struct {
const struct device_node *node;
} of;
struct { struct {
struct fwnode_handle *fwnode; struct fwnode_handle *fwnode;
} fwnode; } fwnode;
......
...@@ -787,7 +787,6 @@ struct v4l2_subdev_platform_data { ...@@ -787,7 +787,6 @@ struct v4l2_subdev_platform_data {
* is attached. * is attached.
* @devnode: subdev device node * @devnode: subdev device node
* @dev: pointer to the physical device, if any * @dev: pointer to the physical device, if any
* @of_node: The device_node of the subdev, usually the same as dev->of_node.
* @fwnode: The fwnode_handle of the subdev, usually the same as * @fwnode: The fwnode_handle of the subdev, usually the same as
* either dev->of_node->fwnode or dev->fwnode (whichever is non-NULL). * either dev->of_node->fwnode or dev->fwnode (whichever is non-NULL).
* @async_list: Links this subdev to a global subdev_list or @notifier->done * @async_list: Links this subdev to a global subdev_list or @notifier->done
...@@ -820,7 +819,6 @@ struct v4l2_subdev { ...@@ -820,7 +819,6 @@ struct v4l2_subdev {
void *host_priv; void *host_priv;
struct video_device *devnode; struct video_device *devnode;
struct device *dev; struct device *dev;
struct device_node *of_node;
struct fwnode_handle *fwnode; struct fwnode_handle *fwnode;
struct list_head async_list; struct list_head async_list;
struct v4l2_async_subdev *asd; struct v4l2_async_subdev *asd;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment