Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] davinci: Switch from V4L2 OF to V4L2 fwnode

The DaVinci VPIF capture driver V4L2 OF support was added after the V4L2
OF framework got removed. Switch VPIF capture driver to V4L2 fwnode.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

authored by

Sakari Ailus and committed by
Mauro Carvalho Chehab
a2d17962 47b586f6

+13 -9
+1
drivers/media/platform/davinci/Kconfig
··· 22 22 depends on HAS_DMA 23 23 depends on I2C 24 24 select VIDEOBUF2_DMA_CONTIG 25 + select V4L2_FWNODE 25 26 help 26 27 Enables Davinci VPIF module used for capture devices. 27 28 This module is used for capture on TI DM6467/DA850/OMAPL138
+12 -9
drivers/media/platform/davinci/vpif_capture.c
··· 18 18 19 19 #include <linux/module.h> 20 20 #include <linux/interrupt.h> 21 + #include <linux/of_graph.h> 21 22 #include <linux/platform_device.h> 22 23 #include <linux/slab.h> 23 24 25 + #include <media/v4l2-fwnode.h> 24 26 #include <media/v4l2-ioctl.h> 25 - #include <media/v4l2-of.h> 26 27 #include <media/i2c/tvp514x.h> 27 28 #include <media/v4l2-mediabus.h> 28 29 ··· 1390 1389 1391 1390 for (i = 0; i < vpif_obj.config->asd_sizes[0]; i++) { 1392 1391 struct v4l2_async_subdev *_asd = vpif_obj.config->asd[i]; 1393 - const struct device_node *node = _asd->match.of.node; 1392 + const struct fwnode_handle *fwnode = _asd->match.fwnode.fwnode; 1394 1393 1395 - if (node == subdev->of_node) { 1394 + if (fwnode == subdev->fwnode) { 1396 1395 vpif_obj.sd[i] = subdev; 1397 1396 vpif_obj.config->chan_config->inputs[i].subdev_name = 1398 - (char *)subdev->of_node->full_name; 1397 + (char *)to_of_node(subdev->fwnode)->full_name; 1399 1398 vpif_dbg(2, debug, 1400 1399 "%s: setting input %d subdev_name = %s\n", 1401 - __func__, i, subdev->of_node->full_name); 1400 + __func__, i, 1401 + to_of_node(subdev->fwnode)->full_name); 1402 1402 return 0; 1403 1403 } 1404 1404 } ··· 1504 1502 vpif_capture_get_pdata(struct platform_device *pdev) 1505 1503 { 1506 1504 struct device_node *endpoint = NULL; 1507 - struct v4l2_of_endpoint bus_cfg; 1505 + struct v4l2_fwnode_endpoint bus_cfg; 1508 1506 struct vpif_capture_config *pdata; 1509 1507 struct vpif_subdev_info *sdinfo; 1510 1508 struct vpif_capture_chan_config *chan; ··· 1551 1549 chan->inputs[i].input.std = V4L2_STD_ALL; 1552 1550 chan->inputs[i].input.capabilities = V4L2_IN_CAP_STD; 1553 1551 1554 - err = v4l2_of_parse_endpoint(endpoint, &bus_cfg); 1552 + err = v4l2_fwnode_endpoint_parse(of_fwnode_handle(endpoint), 1553 + &bus_cfg); 1555 1554 if (err) { 1556 1555 dev_err(&pdev->dev, "Could not parse the endpoint\n"); 1557 1556 goto done; ··· 1587 1584 goto done; 1588 1585 } 1589 1586 1590 - pdata->asd[i]->match_type = V4L2_ASYNC_MATCH_OF; 1591 - pdata->asd[i]->match.of.node = rem; 1587 + pdata->asd[i]->match_type = V4L2_ASYNC_MATCH_FWNODE; 1588 + pdata->asd[i]->match.fwnode.fwnode = of_fwnode_handle(rem); 1592 1589 of_node_put(rem); 1593 1590 } 1594 1591