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

[media] v4l: omap3isp: Drop platform data support

Platforms using the OMAP3 ISP have all switched to DT, drop platform
data support.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Laurent Pinchart and committed by
Mauro Carvalho Chehab
78c66fbc 27c03975

+34 -161
+1 -1
drivers/media/platform/Kconfig
··· 86 86 config VIDEO_OMAP3 87 87 tristate "OMAP 3 Camera support" 88 88 depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API && ARCH_OMAP3 89 - depends on HAS_DMA 89 + depends on HAS_DMA && OF 90 90 depends on OMAP_IOMMU 91 91 select ARM_DMA_USE_IOMMU 92 92 select VIDEOBUF2_DMA_CONTIG
+20 -113
drivers/media/platform/omap3isp/isp.c
··· 101 101 0x0000, /* csi2a, len 0x0170 */ 102 102 0x0170, /* csiphy2, len 0x000c */ 103 103 }, 104 - .syscon_offset = 0xdc, 105 104 .phy_type = ISP_PHY_TYPE_3430, 106 105 }, 107 106 { ··· 123 124 0x0570, /* csiphy1, len 0x000c */ 124 125 0x05c0, /* csi2c, len 0x0040 (2nd area) */ 125 126 }, 126 - .syscon_offset = 0x2f0, 127 127 .phy_type = ISP_PHY_TYPE_3630, 128 128 }, 129 129 }; ··· 1794 1796 media_device_unregister(&isp->media_dev); 1795 1797 } 1796 1798 1797 - /* 1798 - * isp_register_subdev - Register a sub-device 1799 - * @isp: OMAP3 ISP device 1800 - * @isp_subdev: platform data related to a sub-device 1801 - * 1802 - * Register an I2C sub-device which has not been registered by other 1803 - * means (such as the Device Tree). 1804 - * 1805 - * Return a pointer to the sub-device if it has been successfully 1806 - * registered, or NULL otherwise. 1807 - */ 1808 - static struct v4l2_subdev * 1809 - isp_register_subdev(struct isp_device *isp, 1810 - struct isp_platform_subdev *isp_subdev) 1811 - { 1812 - struct i2c_adapter *adapter; 1813 - struct v4l2_subdev *sd; 1814 - 1815 - if (isp_subdev->board_info == NULL) 1816 - return NULL; 1817 - 1818 - adapter = i2c_get_adapter(isp_subdev->i2c_adapter_id); 1819 - if (adapter == NULL) { 1820 - dev_err(isp->dev, 1821 - "%s: Unable to get I2C adapter %d for device %s\n", 1822 - __func__, isp_subdev->i2c_adapter_id, 1823 - isp_subdev->board_info->type); 1824 - return NULL; 1825 - } 1826 - 1827 - sd = v4l2_i2c_new_subdev_board(&isp->v4l2_dev, adapter, 1828 - isp_subdev->board_info, NULL); 1829 - if (sd == NULL) { 1830 - dev_err(isp->dev, "%s: Unable to register subdev %s\n", 1831 - __func__, isp_subdev->board_info->type); 1832 - return NULL; 1833 - } 1834 - 1835 - return sd; 1836 - } 1837 - 1838 1799 static int isp_link_entity( 1839 1800 struct isp_device *isp, struct media_entity *entity, 1840 1801 enum isp_interface_type interface) ··· 1867 1910 1868 1911 static int isp_register_entities(struct isp_device *isp) 1869 1912 { 1870 - struct isp_platform_data *pdata = isp->pdata; 1871 - struct isp_platform_subdev *isp_subdev; 1872 1913 int ret; 1873 1914 1874 1915 isp->media_dev.dev = isp->dev; ··· 1922 1967 ret = omap3isp_stat_register_entities(&isp->isp_hist, &isp->v4l2_dev); 1923 1968 if (ret < 0) 1924 1969 goto done; 1925 - 1926 - /* 1927 - * Device Tree --- the external sub-devices will be registered 1928 - * later. The same goes for the sub-device node registration. 1929 - */ 1930 - if (isp->dev->of_node) 1931 - return 0; 1932 - 1933 - /* Register external entities */ 1934 - for (isp_subdev = pdata ? pdata->subdevs : NULL; 1935 - isp_subdev && isp_subdev->board_info; isp_subdev++) { 1936 - struct v4l2_subdev *sd; 1937 - 1938 - sd = isp_register_subdev(isp, isp_subdev); 1939 - 1940 - /* 1941 - * No bus information --- this is either a flash or a 1942 - * lens subdev. 1943 - */ 1944 - if (!sd || !isp_subdev->bus) 1945 - continue; 1946 - 1947 - sd->host_priv = isp_subdev->bus; 1948 - 1949 - ret = isp_link_entity(isp, &sd->entity, 1950 - isp_subdev->bus->interface); 1951 - if (ret < 0) 1952 - goto done; 1953 - } 1954 - 1955 - ret = v4l2_device_register_subdev_nodes(&isp->v4l2_dev); 1956 1970 1957 1971 done: 1958 1972 if (ret < 0) ··· 2326 2402 return -ENOMEM; 2327 2403 } 2328 2404 2329 - if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) { 2330 - ret = of_property_read_u32(pdev->dev.of_node, "ti,phy-type", 2331 - &isp->phy_type); 2332 - if (ret) 2333 - return ret; 2405 + ret = of_property_read_u32(pdev->dev.of_node, "ti,phy-type", 2406 + &isp->phy_type); 2407 + if (ret) 2408 + return ret; 2334 2409 2335 - isp->syscon = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, 2336 - "syscon"); 2337 - if (IS_ERR(isp->syscon)) 2338 - return PTR_ERR(isp->syscon); 2410 + isp->syscon = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, 2411 + "syscon"); 2412 + if (IS_ERR(isp->syscon)) 2413 + return PTR_ERR(isp->syscon); 2339 2414 2340 - ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1, 2341 - &isp->syscon_offset); 2342 - if (ret) 2343 - return ret; 2415 + ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1, 2416 + &isp->syscon_offset); 2417 + if (ret) 2418 + return ret; 2344 2419 2345 - ret = isp_of_parse_nodes(&pdev->dev, &isp->notifier); 2346 - if (ret < 0) 2347 - return ret; 2348 - } else { 2349 - isp->pdata = pdev->dev.platform_data; 2350 - isp->syscon = syscon_regmap_lookup_by_pdevname("syscon.0"); 2351 - if (IS_ERR(isp->syscon)) 2352 - return PTR_ERR(isp->syscon); 2353 - dev_warn(&pdev->dev, 2354 - "Platform data support is deprecated! Please move to DT now!\n"); 2355 - } 2420 + ret = isp_of_parse_nodes(&pdev->dev, &isp->notifier); 2421 + if (ret < 0) 2422 + return ret; 2356 2423 2357 2424 isp->autoidle = autoidle; 2358 2425 ··· 2422 2507 goto error_isp; 2423 2508 } 2424 2509 2425 - if (!IS_ENABLED(CONFIG_OF) || !pdev->dev.of_node) { 2426 - isp->syscon_offset = isp_res_maps[m].syscon_offset; 2427 - isp->phy_type = isp_res_maps[m].phy_type; 2428 - } 2429 - 2430 2510 for (i = 1; i < OMAP3_ISP_IOMEM_CSI2A_REGS1; i++) 2431 2511 isp->mmio_base[i] = 2432 2512 isp->mmio_base[0] + isp_res_maps[m].offset[i]; ··· 2465 2555 if (ret < 0) 2466 2556 goto error_modules; 2467 2557 2468 - if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) { 2469 - isp->notifier.bound = isp_subdev_notifier_bound; 2470 - isp->notifier.complete = isp_subdev_notifier_complete; 2558 + isp->notifier.bound = isp_subdev_notifier_bound; 2559 + isp->notifier.complete = isp_subdev_notifier_complete; 2471 2560 2472 - ret = v4l2_async_notifier_register(&isp->v4l2_dev, 2473 - &isp->notifier); 2474 - if (ret) 2475 - goto error_register_entities; 2476 - } 2561 + ret = v4l2_async_notifier_register(&isp->v4l2_dev, &isp->notifier); 2562 + if (ret) 2563 + goto error_register_entities; 2477 2564 2478 2565 isp_core_init(isp, 1); 2479 2566 omap3isp_put(isp);
+1 -6
drivers/media/platform/omap3isp/isp.h
··· 17 17 #ifndef OMAP3_ISP_CORE_H 18 18 #define OMAP3_ISP_CORE_H 19 19 20 - #include <media/omap3isp.h> 21 20 #include <media/v4l2-async.h> 22 21 #include <media/v4l2-device.h> 23 22 #include <linux/clk-provider.h> ··· 26 27 #include <linux/platform_device.h> 27 28 #include <linux/wait.h> 28 29 30 + #include "omap3isp.h" 29 31 #include "ispstat.h" 30 32 #include "ispccdc.h" 31 33 #include "ispreg.h" ··· 101 101 * struct isp_res_mapping - Map ISP io resources to ISP revision. 102 102 * @isp_rev: ISP_REVISION_x_x 103 103 * @offset: register offsets of various ISP sub-blocks 104 - * @syscon_offset: offset of the syscon register for 343x / 3630 105 - * (CONTROL_CSIRXFE / CONTROL_CAMERA_PHY_CTRL, respectively) 106 - * from the syscon base address 107 104 * @phy_type: ISP_PHY_TYPE_{3430,3630} 108 105 */ 109 106 struct isp_res_mapping { 110 107 u32 isp_rev; 111 108 u32 offset[OMAP3_ISP_IOMEM_LAST]; 112 - u32 syscon_offset; 113 109 u32 phy_type; 114 110 }; 115 111 ··· 180 184 u32 revision; 181 185 182 186 /* platform HW resources */ 183 - struct isp_platform_data *pdata; 184 187 unsigned int irq_num; 185 188 186 189 void __iomem *mmio_base[OMAP3_ISP_IOMEM_LAST];
+1 -1
drivers/media/platform/omap3isp/ispcsiphy.h
··· 17 17 #ifndef OMAP3_ISP_CSI_PHY_H 18 18 #define OMAP3_ISP_CSI_PHY_H 19 19 20 - #include <media/omap3isp.h> 20 + #include "omap3isp.h" 21 21 22 22 struct isp_csi2_device; 23 23 struct regulator;
+3 -6
drivers/media/platform/omap3isp/ispvideo.c
··· 1018 1018 1019 1019 pipe->entities = 0; 1020 1020 1021 - if (video->isp->pdata && video->isp->pdata->set_constraints) 1022 - video->isp->pdata->set_constraints(video->isp, true); 1021 + /* TODO: Implement PM QoS */ 1023 1022 pipe->l3_ick = clk_get_rate(video->isp->clock[ISP_CLK_L3_ICK]); 1024 1023 pipe->max_rate = pipe->l3_ick; 1025 1024 ··· 1099 1100 err_check_format: 1100 1101 media_entity_pipeline_stop(&video->video.entity); 1101 1102 err_pipeline_start: 1102 - if (video->isp->pdata && video->isp->pdata->set_constraints) 1103 - video->isp->pdata->set_constraints(video->isp, false); 1103 + /* TODO: Implement PM QoS */ 1104 1104 /* The DMA queue must be emptied here, otherwise CCDC interrupts that 1105 1105 * will get triggered the next time the CCDC is powered up will try to 1106 1106 * access buffers that might have been freed but still present in the ··· 1159 1161 video->queue = NULL; 1160 1162 video->error = false; 1161 1163 1162 - if (video->isp->pdata && video->isp->pdata->set_constraints) 1163 - video->isp->pdata->set_constraints(video->isp, false); 1164 + /* TODO: Implement PM QoS */ 1164 1165 media_entity_pipeline_stop(&video->video.entity); 1165 1166 1166 1167 done:
+8 -34
include/media/omap3isp.h drivers/media/platform/omap3isp/omap3isp.h
··· 1 1 /* 2 2 * omap3isp.h 3 3 * 4 - * TI OMAP3 ISP - Platform data 4 + * TI OMAP3 ISP - Bus Configuration 5 5 * 6 6 * Copyright (C) 2011 Nokia Corporation 7 7 * ··· 16 16 * WITHOUT ANY WARRANTY; without even the implied warranty of 17 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 18 * General Public License for more details. 19 - * 20 - * You should have received a copy of the GNU General Public License 21 - * along with this program; if not, write to the Free Software 22 - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 23 - * 02110-1301 USA 24 19 */ 25 20 26 - #ifndef __MEDIA_OMAP3ISP_H__ 27 - #define __MEDIA_OMAP3ISP_H__ 28 - 29 - struct i2c_board_info; 30 - struct isp_device; 21 + #ifndef __OMAP3ISP_H__ 22 + #define __OMAP3ISP_H__ 31 23 32 24 enum isp_interface_type { 33 25 ISP_INTERFACE_PARALLEL, ··· 29 37 ISP_INTERFACE_CSI2C_PHY1, 30 38 }; 31 39 32 - enum { 33 - ISP_LANE_SHIFT_0 = 0, 34 - ISP_LANE_SHIFT_2 = 1, 35 - ISP_LANE_SHIFT_4 = 2, 36 - ISP_LANE_SHIFT_6 = 3, 37 - }; 38 - 39 40 /** 40 41 * struct isp_parallel_cfg - Parallel interface configuration 41 42 * @data_lane_shift: Data lane shifter 42 - * ISP_LANE_SHIFT_0 - CAMEXT[13:0] -> CAM[13:0] 43 - * ISP_LANE_SHIFT_2 - CAMEXT[13:2] -> CAM[11:0] 44 - * ISP_LANE_SHIFT_4 - CAMEXT[13:4] -> CAM[9:0] 45 - * ISP_LANE_SHIFT_6 - CAMEXT[13:6] -> CAM[7:0] 43 + * 0 - CAMEXT[13:0] -> CAM[13:0] 44 + * 1 - CAMEXT[13:2] -> CAM[11:0] 45 + * 2 - CAMEXT[13:4] -> CAM[9:0] 46 + * 3 - CAMEXT[13:6] -> CAM[7:0] 46 47 * @clk_pol: Pixel clock polarity 47 48 * 0 - Sample on rising edge, 1 - Sample on falling edge 48 49 * @hs_pol: Horizontal synchronization polarity ··· 129 144 } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */ 130 145 }; 131 146 132 - struct isp_platform_subdev { 133 - struct i2c_board_info *board_info; 134 - int i2c_adapter_id; 135 - struct isp_bus_cfg *bus; 136 - }; 137 - 138 - struct isp_platform_data { 139 - struct isp_platform_subdev *subdevs; 140 - void (*set_constraints)(struct isp_device *isp, bool enable); 141 - }; 142 - 143 - #endif /* __MEDIA_OMAP3ISP_H__ */ 147 + #endif /* __OMAP3ISP_H__ */