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

[media] exynos4-is: Remove support for non-dt platforms

All platforms supported by this driver are going to get device tree
support in this kernel release so remove code that would have been
actually not used any more.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

authored by

Sylwester Nawrocki and committed by
Mauro Carvalho Chehab
49b2f4c5 4073f942

+50 -427
-30
Documentation/video4linux/fimc.txt
··· 140 140 or retrieve the information from /dev/media? with help of the media-ctl tool: 141 141 # media-ctl -p 142 142 143 - 6. Platform support 144 - =================== 145 - 146 - The machine code (arch/arm/plat-samsung and arch/arm/mach-*) must select 147 - following options: 148 - 149 - CONFIG_S5P_DEV_FIMC0 mandatory 150 - CONFIG_S5P_DEV_FIMC1 \ 151 - CONFIG_S5P_DEV_FIMC2 | optional 152 - CONFIG_S5P_DEV_FIMC3 | 153 - CONFIG_S5P_SETUP_FIMC / 154 - CONFIG_S5P_DEV_CSIS0 \ optional for MIPI-CSI interface 155 - CONFIG_S5P_DEV_CSIS1 / 156 - 157 - Except that, relevant s5p_device_fimc? should be registered in the machine code 158 - in addition to a "s5p-fimc-md" platform device to which the media device driver 159 - is bound. The "s5p-fimc-md" device instance is required even if only mem-to-mem 160 - operation is used. 161 - 162 - The description of sensor(s) attached to FIMC/MIPI-CSIS camera inputs should be 163 - passed as the "s5p-fimc-md" device platform_data. The platform data structure 164 - is defined in file include/media/s5p_fimc.h. 165 - 166 143 7. Build 167 144 ======== 168 - 169 - This driver depends on following config options: 170 - PLAT_S5P, 171 - PM_RUNTIME, 172 - I2C, 173 - REGULATOR, 174 - VIDEO_V4L2_SUBDEV_API, 175 145 176 146 If the driver is built as a loadable kernel module (CONFIG_VIDEO_SAMSUNG_S5P_FIMC=m) 177 147 two modules are created (in addition to the core v4l2 modules): s5p-fimc.ko and
-1
MAINTAINERS
··· 7654 7654 Q: https://patchwork.linuxtv.org/project/linux-media/list/ 7655 7655 S: Supported 7656 7656 F: drivers/media/platform/exynos4-is/ 7657 - F: include/media/s5p_fimc.h 7658 7657 7659 7658 SAMSUNG S3C24XX/S3C64XX SOC SERIES CAMIF DRIVER 7660 7659 M: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
+2 -1
drivers/media/platform/exynos4-is/Kconfig
··· 3 3 bool "Samsung S5P/EXYNOS4 SoC series Camera Subsystem driver" 4 4 depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API 5 5 depends on (PLAT_S5P || ARCH_EXYNOS) 6 + depends on OF && COMMON_CLK 6 7 help 7 8 Say Y here to enable camera host interface devices for 8 9 Samsung S5P and EXYNOS SoC series. ··· 18 17 depends on I2C 19 18 select VIDEOBUF2_DMA_CONTIG 20 19 select V4L2_MEM2MEM_DEV 21 - select MFD_SYSCON if OF 20 + select MFD_SYSCON 22 21 select VIDEO_EXYNOS4_IS_COMMON 23 22 help 24 23 This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC camera host
+1 -1
drivers/media/platform/exynos4-is/common.c
··· 10 10 */ 11 11 12 12 #include <linux/module.h> 13 - #include <media/s5p_fimc.h> 13 + #include <media/exynos-fimc.h> 14 14 #include "common.h" 15 15 16 16 /* Called with the media graph mutex held or entity->stream_count > 0. */
+1 -1
drivers/media/platform/exynos4-is/fimc-core.h
··· 27 27 #include <media/v4l2-device.h> 28 28 #include <media/v4l2-mem2mem.h> 29 29 #include <media/v4l2-mediabus.h> 30 - #include <media/s5p_fimc.h> 30 + #include <media/exynos-fimc.h> 31 31 32 32 #define dbg(fmt, args...) \ 33 33 pr_debug("%s:%d: " fmt "\n", __func__, __LINE__, ##args)
+1 -1
drivers/media/platform/exynos4-is/fimc-isp-video.c
··· 30 30 #include <media/v4l2-ioctl.h> 31 31 #include <media/videobuf2-core.h> 32 32 #include <media/videobuf2-dma-contig.h> 33 - #include <media/s5p_fimc.h> 33 + #include <media/exynos-fimc.h> 34 34 35 35 #include "common.h" 36 36 #include "media-dev.h"
+1 -1
drivers/media/platform/exynos4-is/fimc-isp.h
··· 24 24 #include <media/videobuf2-core.h> 25 25 #include <media/v4l2-device.h> 26 26 #include <media/v4l2-mediabus.h> 27 - #include <media/s5p_fimc.h> 27 + #include <media/exynos-fimc.h> 28 28 29 29 extern int fimc_isp_debug; 30 30
+1 -1
drivers/media/platform/exynos4-is/fimc-lite-reg.c
··· 12 12 #include <linux/bitops.h> 13 13 #include <linux/delay.h> 14 14 #include <linux/io.h> 15 - #include <media/s5p_fimc.h> 15 + #include <media/exynos-fimc.h> 16 16 17 17 #include "fimc-lite-reg.h" 18 18 #include "fimc-lite.h"
+1 -1
drivers/media/platform/exynos4-is/fimc-lite.c
··· 30 30 #include <media/v4l2-mem2mem.h> 31 31 #include <media/videobuf2-core.h> 32 32 #include <media/videobuf2-dma-contig.h> 33 - #include <media/s5p_fimc.h> 33 + #include <media/exynos-fimc.h> 34 34 35 35 #include "common.h" 36 36 #include "fimc-core.h"
+1 -1
drivers/media/platform/exynos4-is/fimc-lite.h
··· 23 23 #include <media/v4l2-ctrls.h> 24 24 #include <media/v4l2-device.h> 25 25 #include <media/v4l2-mediabus.h> 26 - #include <media/s5p_fimc.h> 26 + #include <media/exynos-fimc.h> 27 27 28 28 #define FIMC_LITE_DRV_NAME "exynos-fimc-lite" 29 29 #define FLITE_CLK_NAME "flite"
+1 -1
drivers/media/platform/exynos4-is/fimc-reg.c
··· 13 13 #include <linux/io.h> 14 14 #include <linux/regmap.h> 15 15 16 - #include <media/s5p_fimc.h> 16 + #include <media/exynos-fimc.h> 17 17 #include "media-dev.h" 18 18 19 19 #include "fimc-reg.h"
+32 -297
drivers/media/platform/exynos4-is/media-dev.c
··· 31 31 #include <media/v4l2-ctrls.h> 32 32 #include <media/v4l2-of.h> 33 33 #include <media/media-device.h> 34 - #include <media/s5p_fimc.h> 34 + #include <media/exynos-fimc.h> 35 35 36 36 #include "media-dev.h" 37 37 #include "fimc-core.h" 38 38 #include "fimc-is.h" 39 39 #include "fimc-lite.h" 40 40 #include "mipi-csis.h" 41 - 42 - static int __fimc_md_set_camclk(struct fimc_md *fmd, 43 - struct fimc_source_info *si, 44 - bool on); 45 41 46 42 /* Set up image sensor subdev -> FIMC capture node notifications. */ 47 43 static void __setup_sensor_notification(struct fimc_md *fmd, ··· 219 223 return ret; 220 224 } 221 225 222 - ret = fimc_md_set_camclk(sd, true); 223 - if (ret < 0) 224 - goto err_wbclk; 225 - 226 226 ret = fimc_pipeline_s_power(p, 1); 227 227 if (!ret) 228 228 return 0; 229 229 230 - fimc_md_set_camclk(sd, false); 231 - 232 - err_wbclk: 233 230 if (!IS_ERR(fmd->wbclk[CLK_IDX_WB_B]) && p->subdevs[IDX_IS_ISP]) 234 231 clk_disable_unprepare(fmd->wbclk[CLK_IDX_WB_B]); 235 232 ··· 248 259 } 249 260 250 261 ret = fimc_pipeline_s_power(p, 0); 251 - fimc_md_set_camclk(sd, false); 252 262 253 263 fmd = entity_to_fimc_mdev(&sd->entity); 254 264 ··· 325 337 } 326 338 } 327 339 328 - /* 329 - * Sensor subdevice helper functions 330 - */ 331 - static struct v4l2_subdev *fimc_md_register_sensor(struct fimc_md *fmd, 332 - struct fimc_source_info *si) 333 - { 334 - struct i2c_adapter *adapter; 335 - struct v4l2_subdev *sd = NULL; 336 - 337 - if (!si || !fmd) 338 - return NULL; 339 - /* 340 - * If FIMC bus type is not Writeback FIFO assume it is same 341 - * as sensor_bus_type. 342 - */ 343 - si->fimc_bus_type = si->sensor_bus_type; 344 - 345 - adapter = i2c_get_adapter(si->i2c_bus_num); 346 - if (!adapter) { 347 - v4l2_warn(&fmd->v4l2_dev, 348 - "Failed to get I2C adapter %d, deferring probe\n", 349 - si->i2c_bus_num); 350 - return ERR_PTR(-EPROBE_DEFER); 351 - } 352 - sd = v4l2_i2c_new_subdev_board(&fmd->v4l2_dev, adapter, 353 - si->board_info, NULL); 354 - if (IS_ERR_OR_NULL(sd)) { 355 - i2c_put_adapter(adapter); 356 - v4l2_warn(&fmd->v4l2_dev, 357 - "Failed to acquire subdev %s, deferring probe\n", 358 - si->board_info->type); 359 - return ERR_PTR(-EPROBE_DEFER); 360 - } 361 - v4l2_set_subdev_hostdata(sd, si); 362 - sd->grp_id = GRP_ID_SENSOR; 363 - 364 - v4l2_info(&fmd->v4l2_dev, "Registered sensor subdevice %s\n", 365 - sd->name); 366 - return sd; 367 - } 368 - 369 - static void fimc_md_unregister_sensor(struct v4l2_subdev *sd) 370 - { 371 - struct i2c_client *client = v4l2_get_subdevdata(sd); 372 - struct i2c_adapter *adapter; 373 - 374 - if (!client || client->dev.of_node) 375 - return; 376 - 377 - v4l2_device_unregister_subdev(sd); 378 - 379 - adapter = client->adapter; 380 - i2c_unregister_device(client); 381 - if (adapter) 382 - i2c_put_adapter(adapter); 383 - } 384 - 385 - #ifdef CONFIG_OF 386 340 /* Parse port node and register as a sub-device any sensor specified there. */ 387 341 static int fimc_md_parse_port_node(struct fimc_md *fmd, 388 342 struct device_node *port, 389 343 unsigned int index) 390 344 { 345 + struct fimc_source_info *pd = &fmd->sensor[index].pdata; 391 346 struct device_node *rem, *ep, *np; 392 - struct fimc_source_info *pd; 393 347 struct v4l2_of_endpoint endpoint; 394 - u32 val; 395 - 396 - pd = &fmd->sensor[index].pdata; 397 348 398 349 /* Assume here a port node can have only one endpoint node. */ 399 350 ep = of_get_next_child(port, NULL); ··· 351 424 v4l2_info(&fmd->v4l2_dev, "Remote device at %s not found\n", 352 425 ep->full_name); 353 426 return 0; 354 - } 355 - if (!of_property_read_u32(rem, "samsung,camclk-out", &val)) 356 - pd->clk_id = val; 357 - 358 - if (!of_property_read_u32(rem, "clock-frequency", &val)) 359 - pd->clk_frequency = val; 360 - else 361 - pd->clk_frequency = DEFAULT_SENSOR_CLK_FREQ; 362 - 363 - if (pd->clk_frequency == 0) { 364 - v4l2_err(&fmd->v4l2_dev, "Wrong clock frequency at node %s\n", 365 - rem->full_name); 366 - of_node_put(rem); 367 - return -EINVAL; 368 427 } 369 428 370 429 if (fimc_input_is_parallel(endpoint.base.port)) { ··· 398 485 } 399 486 400 487 /* Register all SoC external sub-devices */ 401 - static int fimc_md_of_sensors_register(struct fimc_md *fmd, 402 - struct device_node *np) 488 + static int fimc_md_register_sensor_entities(struct fimc_md *fmd) 403 489 { 404 490 struct device_node *parent = fmd->pdev->dev.of_node; 405 491 struct device_node *node, *ports; 406 492 int index = 0; 407 493 int ret; 494 + 495 + /* 496 + * Runtime resume one of the FIMC entities to make sure 497 + * the sclk_cam clocks are not globally disabled. 498 + */ 499 + if (!fmd->pmf) 500 + return -ENXIO; 501 + 502 + ret = pm_runtime_get_sync(fmd->pmf); 503 + if (ret < 0) 504 + return ret; 505 + 506 + fmd->num_sensors = 0; 408 507 409 508 /* Attach sensors linked to MIPI CSI-2 receivers */ 410 509 for_each_available_child_of_node(parent, node) { ··· 431 506 432 507 ret = fimc_md_parse_port_node(fmd, port, index); 433 508 if (ret < 0) 434 - return ret; 509 + goto rpm_put; 435 510 index++; 436 511 } 437 512 438 513 /* Attach sensors listed in the parallel-ports node */ 439 514 ports = of_get_child_by_name(parent, "parallel-ports"); 440 515 if (!ports) 441 - return 0; 516 + goto rpm_put; 442 517 443 518 for_each_child_of_node(ports, node) { 444 519 ret = fimc_md_parse_port_node(fmd, node, index); ··· 446 521 break; 447 522 index++; 448 523 } 449 - 450 - return 0; 524 + rpm_put: 525 + pm_runtime_put(fmd->pmf); 526 + return ret; 451 527 } 452 528 453 529 static int __of_get_csis_id(struct device_node *np) ··· 461 535 of_property_read_u32(np, "reg", &reg); 462 536 return reg - FIMC_INPUT_MIPI_CSI2_0; 463 537 } 464 - #else 465 - #define fimc_md_of_sensors_register(fmd, np) (-ENOSYS) 466 - #define __of_get_csis_id(np) (-ENOSYS) 467 - #endif 468 - 469 - static int fimc_md_register_sensor_entities(struct fimc_md *fmd) 470 - { 471 - struct s5p_platform_fimc *pdata = fmd->pdev->dev.platform_data; 472 - struct device_node *of_node = fmd->pdev->dev.of_node; 473 - int num_clients = 0; 474 - int ret, i; 475 - 476 - /* 477 - * Runtime resume one of the FIMC entities to make sure 478 - * the sclk_cam clocks are not globally disabled. 479 - */ 480 - if (!fmd->pmf) 481 - return -ENXIO; 482 - 483 - ret = pm_runtime_get_sync(fmd->pmf); 484 - if (ret < 0) 485 - return ret; 486 - 487 - if (of_node) { 488 - fmd->num_sensors = 0; 489 - ret = fimc_md_of_sensors_register(fmd, of_node); 490 - } else if (pdata) { 491 - WARN_ON(pdata->num_clients > ARRAY_SIZE(fmd->sensor)); 492 - num_clients = min_t(u32, pdata->num_clients, 493 - ARRAY_SIZE(fmd->sensor)); 494 - fmd->num_sensors = num_clients; 495 - 496 - for (i = 0; i < num_clients; i++) { 497 - struct fimc_sensor_info *si = &fmd->sensor[i]; 498 - struct v4l2_subdev *sd; 499 - 500 - si->pdata = pdata->source_info[i]; 501 - ret = __fimc_md_set_camclk(fmd, &si->pdata, true); 502 - if (ret) 503 - break; 504 - sd = fimc_md_register_sensor(fmd, &si->pdata); 505 - ret = __fimc_md_set_camclk(fmd, &si->pdata, false); 506 - 507 - if (IS_ERR(sd)) { 508 - si->subdev = NULL; 509 - ret = PTR_ERR(sd); 510 - break; 511 - } 512 - si->subdev = sd; 513 - if (ret) 514 - break; 515 - } 516 - } 517 - 518 - pm_runtime_put(fmd->pmf); 519 - return ret; 520 - } 521 538 522 539 /* 523 540 * MIPI-CSIS, FIMC and FIMC-LITE platform devices registration. 524 541 */ 525 - 526 542 static int register_fimc_lite_entity(struct fimc_md *fmd, 527 543 struct fimc_lite *fimc_lite) 528 544 { ··· 621 753 return ret; 622 754 } 623 755 624 - static int fimc_md_pdev_match(struct device *dev, void *data) 625 - { 626 - struct platform_device *pdev = to_platform_device(dev); 627 - int plat_entity = -1; 628 - int ret; 629 - char *p; 630 - 631 - if (!get_device(dev)) 632 - return -ENODEV; 633 - 634 - if (!strcmp(pdev->name, CSIS_DRIVER_NAME)) { 635 - plat_entity = IDX_CSIS; 636 - } else { 637 - p = strstr(pdev->name, "fimc"); 638 - if (p && *(p + 4) == 0) 639 - plat_entity = IDX_FIMC; 640 - } 641 - 642 - if (plat_entity >= 0) 643 - ret = fimc_md_register_platform_entity(data, pdev, 644 - plat_entity); 645 - put_device(dev); 646 - return 0; 647 - } 648 - 649 756 /* Register FIMC, FIMC-LITE and CSIS media entities */ 650 - #ifdef CONFIG_OF 651 - static int fimc_md_register_of_platform_entities(struct fimc_md *fmd, 652 - struct device_node *parent) 757 + static int fimc_md_register_platform_entities(struct fimc_md *fmd, 758 + struct device_node *parent) 653 759 { 654 760 struct device_node *node; 655 761 int ret = 0; ··· 657 815 658 816 return ret; 659 817 } 660 - #else 661 - #define fimc_md_register_of_platform_entities(fmd, node) (-ENOSYS) 662 - #endif 663 818 664 819 static void fimc_md_unregister_entities(struct fimc_md *fmd) 665 820 { ··· 683 844 continue; 684 845 v4l2_device_unregister_subdev(fmd->csis[i].sd); 685 846 fmd->csis[i].sd = NULL; 686 - } 687 - if (fmd->pdev->dev.of_node == NULL) { 688 - for (i = 0; i < fmd->num_sensors; i++) { 689 - if (fmd->sensor[i].subdev == NULL) 690 - continue; 691 - fimc_md_unregister_sensor(fmd->sensor[i].subdev); 692 - fmd->sensor[i].subdev = NULL; 693 - } 694 847 } 695 848 696 849 if (fmd->fimc_is) ··· 968 1137 969 1138 static int fimc_md_get_clocks(struct fimc_md *fmd) 970 1139 { 971 - struct device *dev = NULL; 1140 + struct device *dev = &fmd->pdev->dev; 972 1141 char clk_name[32]; 973 1142 struct clk *clock; 974 1143 int i, ret = 0; ··· 976 1145 for (i = 0; i < FIMC_MAX_CAMCLKS; i++) 977 1146 fmd->camclk[i].clock = ERR_PTR(-EINVAL); 978 1147 979 - if (fmd->pdev->dev.of_node) 980 - dev = &fmd->pdev->dev; 981 - 982 1148 for (i = 0; i < FIMC_MAX_CAMCLKS; i++) { 983 1149 snprintf(clk_name, sizeof(clk_name), "sclk_cam%u", i); 984 1150 clock = clk_get(dev, clk_name); 985 1151 986 1152 if (IS_ERR(clock)) { 987 - dev_err(&fmd->pdev->dev, "Failed to get clock: %s\n", 988 - clk_name); 1153 + dev_err(dev, "Failed to get clock: %s\n", clk_name); 989 1154 ret = PTR_ERR(clock); 990 1155 break; 991 1156 } ··· 1013 1186 fimc_md_put_clocks(fmd); 1014 1187 1015 1188 return ret; 1016 - } 1017 - 1018 - static int __fimc_md_set_camclk(struct fimc_md *fmd, 1019 - struct fimc_source_info *si, 1020 - bool on) 1021 - { 1022 - struct fimc_camclk_info *camclk; 1023 - int ret = 0; 1024 - 1025 - /* 1026 - * When device tree is used the sensor drivers are supposed to 1027 - * control the clock themselves. This whole function will be 1028 - * removed once S5PV210 platform is converted to the device tree. 1029 - */ 1030 - if (fmd->pdev->dev.of_node) 1031 - return 0; 1032 - 1033 - if (WARN_ON(si->clk_id >= FIMC_MAX_CAMCLKS) || !fmd || !fmd->pmf) 1034 - return -EINVAL; 1035 - 1036 - camclk = &fmd->camclk[si->clk_id]; 1037 - 1038 - dbg("camclk %d, f: %lu, use_count: %d, on: %d", 1039 - si->clk_id, si->clk_frequency, camclk->use_count, on); 1040 - 1041 - if (on) { 1042 - if (camclk->use_count > 0 && 1043 - camclk->frequency != si->clk_frequency) 1044 - return -EINVAL; 1045 - 1046 - if (camclk->use_count++ == 0) { 1047 - clk_set_rate(camclk->clock, si->clk_frequency); 1048 - camclk->frequency = si->clk_frequency; 1049 - ret = pm_runtime_get_sync(fmd->pmf); 1050 - if (ret < 0) 1051 - return ret; 1052 - ret = clk_prepare_enable(camclk->clock); 1053 - dbg("Enabled camclk %d: f: %lu", si->clk_id, 1054 - clk_get_rate(camclk->clock)); 1055 - } 1056 - return ret; 1057 - } 1058 - 1059 - if (WARN_ON(camclk->use_count == 0)) 1060 - return 0; 1061 - 1062 - if (--camclk->use_count == 0) { 1063 - clk_disable_unprepare(camclk->clock); 1064 - pm_runtime_put(fmd->pmf); 1065 - dbg("Disabled camclk %d", si->clk_id); 1066 - } 1067 - return ret; 1068 - } 1069 - 1070 - /** 1071 - * fimc_md_set_camclk - peripheral sensor clock setup 1072 - * @sd: sensor subdev to configure sclk_cam clock for 1073 - * @on: 1 to enable or 0 to disable the clock 1074 - * 1075 - * There are 2 separate clock outputs available in the SoC for external 1076 - * image processors. These clocks are shared between all registered FIMC 1077 - * devices to which sensors can be attached, either directly or through 1078 - * the MIPI CSI receiver. The clock is allowed here to be used by 1079 - * multiple sensors concurrently if they use same frequency. 1080 - * This function should only be called when the graph mutex is held. 1081 - */ 1082 - int fimc_md_set_camclk(struct v4l2_subdev *sd, bool on) 1083 - { 1084 - struct fimc_source_info *si = v4l2_get_subdev_hostdata(sd); 1085 - struct fimc_md *fmd = entity_to_fimc_mdev(&sd->entity); 1086 - 1087 - /* 1088 - * If there is a clock provider registered the sensors will 1089 - * handle their clock themselves, no need to control it on 1090 - * the host interface side. 1091 - */ 1092 - if (fmd->clk_provider.num_clocks > 0) 1093 - return 0; 1094 - 1095 - return __fimc_md_set_camclk(fmd, si, on); 1096 1189 } 1097 1190 1098 1191 static int __fimc_md_modify_pipeline(struct media_entity *entity, bool enable) ··· 1173 1426 return 0; 1174 1427 } 1175 1428 1176 - #ifdef CONFIG_OF 1177 1429 static int cam_clk_prepare(struct clk_hw *hw) 1178 1430 { 1179 1431 struct cam_clk *camclk = to_cam_clk(hw); ··· 1264 1518 fimc_md_unregister_clk_provider(fmd); 1265 1519 return ret; 1266 1520 } 1267 - #else 1268 - #define fimc_md_register_clk_provider(fmd) (0) 1269 - #define fimc_md_unregister_clk_provider(fmd) 1270 - #endif 1271 1521 1272 1522 static int subdev_notifier_bound(struct v4l2_async_notifier *notifier, 1273 1523 struct v4l2_subdev *subdev, ··· 1327 1585 return -ENOMEM; 1328 1586 1329 1587 spin_lock_init(&fmd->slock); 1330 - fmd->pdev = pdev; 1331 1588 INIT_LIST_HEAD(&fmd->pipelines); 1589 + fmd->pdev = pdev; 1332 1590 1333 1591 strlcpy(fmd->media_dev.model, "SAMSUNG S5P FIMC", 1334 1592 sizeof(fmd->media_dev.model)); ··· 1341 1599 strlcpy(v4l2_dev->name, "s5p-fimc-md", sizeof(v4l2_dev->name)); 1342 1600 1343 1601 fmd->use_isp = fimc_md_is_isp_available(dev->of_node); 1602 + fmd->user_subdev_api = true; 1344 1603 1345 1604 ret = v4l2_device_register(dev, &fmd->v4l2_dev); 1346 1605 if (ret < 0) { ··· 1359 1616 if (ret) 1360 1617 goto err_md; 1361 1618 1362 - fmd->user_subdev_api = (dev->of_node != NULL); 1363 - 1364 1619 ret = fimc_md_get_pinctrl(fmd); 1365 1620 if (ret < 0) { 1366 1621 if (ret != EPROBE_DEFER) ··· 1371 1630 /* Protect the media graph while we're registering entities */ 1372 1631 mutex_lock(&fmd->media_dev.graph_mutex); 1373 1632 1374 - if (dev->of_node) 1375 - ret = fimc_md_register_of_platform_entities(fmd, dev->of_node); 1376 - else 1377 - ret = bus_for_each_dev(&platform_bus_type, NULL, fmd, 1378 - fimc_md_pdev_match); 1633 + ret = fimc_md_register_platform_entities(fmd, dev->of_node); 1379 1634 if (ret) { 1380 1635 mutex_unlock(&fmd->media_dev.graph_mutex); 1381 1636 goto err_clk; 1382 1637 } 1383 1638 1384 - if (dev->platform_data || dev->of_node) { 1385 - ret = fimc_md_register_sensor_entities(fmd); 1386 - if (ret) { 1387 - mutex_unlock(&fmd->media_dev.graph_mutex); 1388 - goto err_m_ent; 1389 - } 1639 + ret = fimc_md_register_sensor_entities(fmd); 1640 + if (ret) { 1641 + mutex_unlock(&fmd->media_dev.graph_mutex); 1642 + goto err_m_ent; 1390 1643 } 1391 1644 1392 1645 mutex_unlock(&fmd->media_dev.graph_mutex);
+1 -5
drivers/media/platform/exynos4-is/media-dev.h
··· 19 19 #include <media/media-entity.h> 20 20 #include <media/v4l2-device.h> 21 21 #include <media/v4l2-subdev.h> 22 - #include <media/s5p_fimc.h> 22 + #include <media/exynos-fimc.h> 23 23 24 24 #include "fimc-core.h" 25 25 #include "fimc-lite.h" ··· 94 94 }; 95 95 96 96 struct cam_clk { 97 - #ifdef CONFIG_COMMON_CLK 98 97 struct clk_hw hw; 99 - #endif 100 98 struct fimc_md *fmd; 101 99 }; 102 100 #define to_cam_clk(_hw) container_of(_hw, struct cam_clk, hw) ··· 142 144 143 145 struct cam_clk_provider { 144 146 struct clk *clks[FIMC_MAX_CAMCLKS]; 145 - #ifdef CONFIG_COMMON_CLK 146 147 struct clk_onecell_data clk_data; 147 - #endif 148 148 struct device_node *of_node; 149 149 struct cam_clk camclk[FIMC_MAX_CAMCLKS]; 150 150 int num_clocks;
+7 -36
drivers/media/platform/exynos4-is/mipi-csis.c
··· 22 22 #include <linux/of.h> 23 23 #include <linux/of_graph.h> 24 24 #include <linux/phy/phy.h> 25 - #include <linux/platform_data/mipi-csis.h> 26 25 #include <linux/platform_device.h> 27 26 #include <linux/pm_runtime.h> 28 27 #include <linux/regulator/consumer.h> 29 28 #include <linux/slab.h> 30 29 #include <linux/spinlock.h> 31 30 #include <linux/videodev2.h> 32 - #include <media/s5p_fimc.h> 31 + #include <media/exynos-fimc.h> 33 32 #include <media/v4l2-of.h> 34 33 #include <media/v4l2-subdev.h> 35 34 ··· 729 730 return IRQ_HANDLED; 730 731 } 731 732 732 - static int s5pcsis_get_platform_data(struct platform_device *pdev, 733 - struct csis_state *state) 734 - { 735 - struct s5p_platform_mipi_csis *pdata = pdev->dev.platform_data; 736 - 737 - if (pdata == NULL) { 738 - dev_err(&pdev->dev, "Platform data not specified\n"); 739 - return -EINVAL; 740 - } 741 - 742 - state->clk_frequency = pdata->clk_rate; 743 - state->num_lanes = pdata->lanes; 744 - state->hs_settle = pdata->hs_settle; 745 - state->index = max(0, pdev->id); 746 - state->max_num_lanes = state->index ? CSIS1_MAX_LANES : 747 - CSIS0_MAX_LANES; 748 - return 0; 749 - } 750 - 751 - #ifdef CONFIG_OF 752 733 static int s5pcsis_parse_dt(struct platform_device *pdev, 753 734 struct csis_state *state) 754 735 { ··· 766 787 767 788 return 0; 768 789 } 769 - #else 770 - #define s5pcsis_parse_dt(pdev, state) (-ENOSYS) 771 - #endif 772 790 773 791 static int s5pcsis_pm_resume(struct device *dev, bool runtime); 774 792 static const struct of_device_id s5pcsis_of_match[]; ··· 788 812 spin_lock_init(&state->slock); 789 813 state->pdev = pdev; 790 814 791 - if (dev->of_node) { 792 - of_id = of_match_node(s5pcsis_of_match, dev->of_node); 793 - if (WARN_ON(of_id == NULL)) 794 - return -EINVAL; 815 + of_id = of_match_node(s5pcsis_of_match, dev->of_node); 816 + if (WARN_ON(of_id == NULL)) 817 + return -EINVAL; 795 818 796 - drv_data = of_id->data; 797 - state->interrupt_mask = drv_data->interrupt_mask; 819 + drv_data = of_id->data; 820 + state->interrupt_mask = drv_data->interrupt_mask; 798 821 799 - ret = s5pcsis_parse_dt(pdev, state); 800 - } else { 801 - ret = s5pcsis_get_platform_data(pdev, state); 802 - } 803 - 822 + ret = s5pcsis_parse_dt(pdev, state); 804 823 if (ret < 0) 805 824 return ret; 806 825
-28
include/linux/platform_data/mipi-csis.h
··· 1 - /* 2 - * Copyright (C) 2010 - 2012 Samsung Electronics Co., Ltd. 3 - * 4 - * Samsung S5P/Exynos SoC series MIPI CSIS device support 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License version 2 as 8 - * published by the Free Software Foundation. 9 - */ 10 - 11 - #ifndef __PLAT_SAMSUNG_MIPI_CSIS_H_ 12 - #define __PLAT_SAMSUNG_MIPI_CSIS_H_ __FILE__ 13 - 14 - /** 15 - * struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver 16 - * @clk_rate: bus clock frequency 17 - * @wclk_source: CSI wrapper clock selection: 0 - bus clock, 1 - ext. SCLK_CAM 18 - * @lanes: number of data lanes used 19 - * @hs_settle: HS-RX settle time 20 - */ 21 - struct s5p_platform_mipi_csis { 22 - unsigned long clk_rate; 23 - u8 wclk_source; 24 - u8 lanes; 25 - u8 hs_settle; 26 - }; 27 - 28 - #endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */
-21
include/media/s5p_fimc.h include/media/exynos-fimc.h
··· 61 61 #define GRP_ID_FLITE (1 << 13) 62 62 #define GRP_ID_FIMC_IS (1 << 14) 63 63 64 - struct i2c_board_info; 65 - 66 64 /** 67 65 * struct fimc_source_info - video source description required for the host 68 66 * interface configuration 69 67 * 70 - * @board_info: pointer to I2C subdevice's board info 71 - * @clk_frequency: frequency of the clock the host interface provides to sensor 72 68 * @fimc_bus_type: FIMC camera input type 73 69 * @sensor_bus_type: image sensor bus type, MIPI, ITU-R BT.601 etc. 74 70 * @flags: the parallel sensor bus flags defining signals polarity (V4L2_MBUS_*) 75 - * @i2c_bus_num: i2c control bus id the sensor is attached to 76 71 * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU) 77 - * @clk_id: index of the SoC peripheral clock for sensors 78 72 */ 79 73 struct fimc_source_info { 80 - struct i2c_board_info *board_info; 81 - unsigned long clk_frequency; 82 74 enum fimc_bus_type fimc_bus_type; 83 75 enum fimc_bus_type sensor_bus_type; 84 76 u16 flags; 85 - u16 i2c_bus_num; 86 77 u16 mux_id; 87 - u8 clk_id; 88 - }; 89 - 90 - /** 91 - * struct s5p_platform_fimc - camera host interface platform data 92 - * 93 - * @source_info: properties of an image source for the host interface setup 94 - * @num_clients: the number of attached image sources 95 - */ 96 - struct s5p_platform_fimc { 97 - struct fimc_source_info *source_info; 98 - int num_clients; 99 78 }; 100 79 101 80 /*