Searched refs:fmd (Results 1 - 4 of 4) sorted by relevance

/linux-4.1.27/drivers/media/platform/exynos4-is/
H A Dmedia-dev.c43 static void __setup_sensor_notification(struct fimc_md *fmd, __setup_sensor_notification() argument
52 if (!src_inf || WARN_ON(fmd == NULL)) __setup_sensor_notification()
56 spin_lock_irqsave(&fmd->slock, flags); __setup_sensor_notification()
58 spin_unlock_irqrestore(&fmd->slock, flags); __setup_sensor_notification()
70 struct fimc_md *fmd = entity_to_fimc_mdev(me); fimc_pipeline_prepare() local
124 __setup_sensor_notification(fmd, sensor, p->subdevs[IDX_FIMC]); fimc_pipeline_prepare()
200 struct fimc_md *fmd = entity_to_fimc_mdev(me); __fimc_pipeline_open() local
216 if (!IS_ERR(fmd->wbclk[CLK_IDX_WB_B]) && p->subdevs[IDX_IS_ISP]) { __fimc_pipeline_open()
217 ret = clk_prepare_enable(fmd->wbclk[CLK_IDX_WB_B]); __fimc_pipeline_open()
226 if (!IS_ERR(fmd->wbclk[CLK_IDX_WB_B]) && p->subdevs[IDX_IS_ISP]) __fimc_pipeline_open()
227 clk_disable_unprepare(fmd->wbclk[CLK_IDX_WB_B]); __fimc_pipeline_open()
242 struct fimc_md *fmd; __fimc_pipeline_close() local
252 fmd = entity_to_fimc_mdev(&sd->entity); __fimc_pipeline_close()
255 if (!IS_ERR(fmd->wbclk[CLK_IDX_WB_B]) && p->subdevs[IDX_IS_ISP]) __fimc_pipeline_close()
256 clk_disable_unprepare(fmd->wbclk[CLK_IDX_WB_B]); __fimc_pipeline_close()
303 struct fimc_md *fmd) fimc_md_pipeline_create()
311 list_add_tail(&p->list, &fmd->pipelines); fimc_md_pipeline_create()
317 static void fimc_md_pipelines_free(struct fimc_md *fmd) fimc_md_pipelines_free() argument
319 while (!list_empty(&fmd->pipelines)) { fimc_md_pipelines_free()
322 p = list_entry(fmd->pipelines.next, typeof(*p), list); fimc_md_pipelines_free()
329 static int fimc_md_parse_port_node(struct fimc_md *fmd, fimc_md_parse_port_node() argument
333 struct fimc_source_info *pd = &fmd->sensor[index].pdata; fimc_md_parse_port_node()
351 v4l2_info(&fmd->v4l2_dev, "Remote device at %s not found\n", fimc_md_parse_port_node()
369 v4l2_err(&fmd->v4l2_dev, "Wrong port id (%u) at node %s\n", fimc_md_parse_port_node()
387 if (WARN_ON(index >= ARRAY_SIZE(fmd->sensor))) fimc_md_parse_port_node()
390 fmd->sensor[index].asd.match_type = V4L2_ASYNC_MATCH_OF; fimc_md_parse_port_node()
391 fmd->sensor[index].asd.match.of.node = rem; fimc_md_parse_port_node()
392 fmd->async_subdevs[index] = &fmd->sensor[index].asd; fimc_md_parse_port_node()
394 fmd->num_sensors++; fimc_md_parse_port_node()
401 static int fimc_md_register_sensor_entities(struct fimc_md *fmd) fimc_md_register_sensor_entities() argument
403 struct device_node *parent = fmd->pdev->dev.of_node; fimc_md_register_sensor_entities()
412 if (!fmd->pmf) fimc_md_register_sensor_entities()
415 ret = pm_runtime_get_sync(fmd->pmf); fimc_md_register_sensor_entities()
419 fmd->num_sensors = 0; fimc_md_register_sensor_entities()
432 ret = fimc_md_parse_port_node(fmd, port, index); for_each_available_child_of_node()
444 ret = fimc_md_parse_port_node(fmd, node, index); for_each_child_of_node()
450 pm_runtime_put(fmd->pmf);
468 static int register_fimc_lite_entity(struct fimc_md *fmd, register_fimc_lite_entity() argument
476 fmd->fimc_lite[fimc_lite->index])) register_fimc_lite_entity()
482 ep = fimc_md_pipeline_create(fmd); register_fimc_lite_entity()
488 ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd); register_fimc_lite_entity()
490 fmd->fimc_lite[fimc_lite->index] = fimc_lite; register_fimc_lite_entity()
492 v4l2_err(&fmd->v4l2_dev, "Failed to register FIMC.LITE%d\n", register_fimc_lite_entity()
497 static int register_fimc_entity(struct fimc_md *fmd, struct fimc_dev *fimc) register_fimc_entity() argument
503 if (WARN_ON(fimc->id >= FIMC_MAX_DEVS || fmd->fimc[fimc->id])) register_fimc_entity()
509 ep = fimc_md_pipeline_create(fmd); register_fimc_entity()
515 ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd); register_fimc_entity()
517 if (!fmd->pmf && fimc->pdev) register_fimc_entity()
518 fmd->pmf = &fimc->pdev->dev; register_fimc_entity()
519 fmd->fimc[fimc->id] = fimc; register_fimc_entity()
520 fimc->vid_cap.user_subdev_api = fmd->user_subdev_api; register_fimc_entity()
522 v4l2_err(&fmd->v4l2_dev, "Failed to register FIMC.%d (%d)\n", register_fimc_entity()
528 static int register_csis_entity(struct fimc_md *fmd, register_csis_entity() argument
540 if (WARN_ON(fmd->csis[id].sd)) register_csis_entity()
544 ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd); register_csis_entity()
546 fmd->csis[id].sd = sd; register_csis_entity()
548 v4l2_err(&fmd->v4l2_dev, register_csis_entity()
553 static int register_fimc_is_entity(struct fimc_md *fmd, struct fimc_is *is) register_fimc_is_entity() argument
560 ep = fimc_md_pipeline_create(fmd); register_fimc_is_entity()
566 ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd); register_fimc_is_entity()
568 v4l2_err(&fmd->v4l2_dev, register_fimc_is_entity()
573 fmd->fimc_is = is; register_fimc_is_entity()
577 static int fimc_md_register_platform_entity(struct fimc_md *fmd, fimc_md_register_platform_entity() argument
596 ret = register_fimc_entity(fmd, drvdata); fimc_md_register_platform_entity()
599 ret = register_fimc_lite_entity(fmd, drvdata); fimc_md_register_platform_entity()
602 ret = register_csis_entity(fmd, pdev, drvdata); fimc_md_register_platform_entity()
605 ret = register_fimc_is_entity(fmd, drvdata); fimc_md_register_platform_entity()
616 dev_info(&fmd->pdev->dev, "deferring %s device registration\n", fimc_md_register_platform_entity()
619 dev_err(&fmd->pdev->dev, "%s device registration failed (%d)\n", fimc_md_register_platform_entity()
625 static int fimc_md_register_platform_entities(struct fimc_md *fmd, fimc_md_register_platform_entities() argument
651 ret = fimc_md_register_platform_entity(fmd, pdev, for_each_available_child_of_node()
661 static void fimc_md_unregister_entities(struct fimc_md *fmd) fimc_md_unregister_entities() argument
666 struct fimc_dev *dev = fmd->fimc[i]; fimc_md_unregister_entities()
671 fmd->fimc[i] = NULL; fimc_md_unregister_entities()
674 struct fimc_lite *dev = fmd->fimc_lite[i]; fimc_md_unregister_entities()
679 fmd->fimc_lite[i] = NULL; fimc_md_unregister_entities()
682 if (fmd->csis[i].sd == NULL) fimc_md_unregister_entities()
684 v4l2_device_unregister_subdev(fmd->csis[i].sd); fimc_md_unregister_entities()
685 fmd->csis[i].sd = NULL; fimc_md_unregister_entities()
688 if (fmd->fimc_is) fimc_md_unregister_entities()
689 v4l2_device_unregister_subdev(&fmd->fimc_is->isp.subdev); fimc_md_unregister_entities()
691 v4l2_info(&fmd->v4l2_dev, "Unregistered all entities\n"); fimc_md_unregister_entities()
696 * @fmd: fimc media device
702 static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, __fimc_md_create_fimc_sink_links() argument
720 if (!fmd->fimc[i]) __fimc_md_create_fimc_sink_links()
726 if (!fmd->fimc[i]->variant->has_cam_if) __fimc_md_create_fimc_sink_links()
731 sink = &fmd->fimc[i]->vid_cap.subdev.entity; __fimc_md_create_fimc_sink_links()
743 v4l2_info(&fmd->v4l2_dev, "created link [%s] %c> [%s]\n", __fimc_md_create_fimc_sink_links()
748 if (!fmd->fimc_lite[i]) __fimc_md_create_fimc_sink_links()
751 sink = &fmd->fimc_lite[i]->subdev.entity; __fimc_md_create_fimc_sink_links()
763 v4l2_info(&fmd->v4l2_dev, "created link [%s] -> [%s]\n", __fimc_md_create_fimc_sink_links()
770 static int __fimc_md_create_flite_source_links(struct fimc_md *fmd) __fimc_md_create_flite_source_links() argument
776 struct fimc_lite *fimc = fmd->fimc_lite[i]; __fimc_md_create_flite_source_links()
789 sink = &fmd->fimc_is->isp.subdev.entity; __fimc_md_create_flite_source_links()
800 static int __fimc_md_create_fimc_is_links(struct fimc_md *fmd) __fimc_md_create_fimc_is_links() argument
802 struct fimc_isp *isp = &fmd->fimc_is->isp; __fimc_md_create_fimc_is_links()
809 if (fmd->fimc[i] == NULL) __fimc_md_create_fimc_is_links()
813 sink = &fmd->fimc[i]->vid_cap.subdev.entity; __fimc_md_create_fimc_is_links()
843 static int fimc_md_create_links(struct fimc_md *fmd) fimc_md_create_links() argument
852 for (i = 0; i < fmd->num_sensors; i++) { fimc_md_create_links()
853 if (fmd->sensor[i].subdev == NULL) fimc_md_create_links()
856 sensor = fmd->sensor[i].subdev; fimc_md_create_links()
869 csis = fmd->csis[pdata->mux_id].sd; fimc_md_create_links()
883 v4l2_info(&fmd->v4l2_dev, "created link [%s] => [%s]\n", fimc_md_create_links()
896 v4l2_err(&fmd->v4l2_dev, "Wrong bus_type: %x\n", fimc_md_create_links()
904 ret = __fimc_md_create_fimc_sink_links(fmd, source, sensor, fimc_md_create_links()
909 if (fmd->csis[i].sd == NULL) fimc_md_create_links()
912 source = &fmd->csis[i].sd->entity; fimc_md_create_links()
917 ret = __fimc_md_create_fimc_sink_links(fmd, source, sensor, fimc_md_create_links()
924 if (!fmd->fimc[i]) fimc_md_create_links()
927 source = &fmd->fimc[i]->vid_cap.subdev.entity; fimc_md_create_links()
928 sink = &fmd->fimc[i]->vid_cap.ve.vdev.entity; fimc_md_create_links()
936 ret = __fimc_md_create_flite_source_links(fmd); fimc_md_create_links()
940 if (fmd->use_isp) fimc_md_create_links()
941 ret = __fimc_md_create_fimc_is_links(fmd); fimc_md_create_links()
949 static void fimc_md_put_clocks(struct fimc_md *fmd) fimc_md_put_clocks() argument
954 if (IS_ERR(fmd->camclk[i].clock)) fimc_md_put_clocks()
956 clk_put(fmd->camclk[i].clock); fimc_md_put_clocks()
957 fmd->camclk[i].clock = ERR_PTR(-EINVAL); fimc_md_put_clocks()
962 if (IS_ERR(fmd->wbclk[i])) fimc_md_put_clocks()
964 clk_put(fmd->wbclk[i]); fimc_md_put_clocks()
965 fmd->wbclk[i] = ERR_PTR(-EINVAL); fimc_md_put_clocks()
969 static int fimc_md_get_clocks(struct fimc_md *fmd) fimc_md_get_clocks() argument
971 struct device *dev = &fmd->pdev->dev; fimc_md_get_clocks()
977 fmd->camclk[i].clock = ERR_PTR(-EINVAL); fimc_md_get_clocks()
988 fmd->camclk[i].clock = clock; fimc_md_get_clocks()
991 fimc_md_put_clocks(fmd); fimc_md_get_clocks()
993 if (!fmd->use_isp) fimc_md_get_clocks()
999 fmd->wbclk[CLK_IDX_WB_A] = ERR_PTR(-EINVAL); fimc_md_get_clocks()
1005 v4l2_err(&fmd->v4l2_dev, "Failed to get clock: %s\n", fimc_md_get_clocks()
1010 fmd->wbclk[i] = clock; fimc_md_get_clocks()
1013 fimc_md_put_clocks(fmd); fimc_md_get_clocks()
1118 struct fimc_md *fmd = platform_get_drvdata(pdev); fimc_md_sysfs_show() local
1120 if (fmd->user_subdev_api) fimc_md_sysfs_show()
1131 struct fimc_md *fmd = platform_get_drvdata(pdev); fimc_md_sysfs_store() local
1142 fmd->user_subdev_api = subdev_api; fimc_md_sysfs_store()
1144 if (fmd->fimc[i]) fimc_md_sysfs_store()
1145 fmd->fimc[i]->vid_cap.user_subdev_api = subdev_api; fimc_md_sysfs_store()
1159 static int fimc_md_get_pinctrl(struct fimc_md *fmd) fimc_md_get_pinctrl() argument
1161 struct device *dev = &fmd->pdev->dev; fimc_md_get_pinctrl()
1162 struct fimc_pinctrl *pctl = &fmd->pinctl; fimc_md_get_pinctrl()
1183 if (camclk->fmd->pmf == NULL) cam_clk_prepare()
1186 ret = pm_runtime_get_sync(camclk->fmd->pmf); cam_clk_prepare()
1194 if (camclk->fmd->pmf == NULL) cam_clk_unprepare()
1197 pm_runtime_put_sync(camclk->fmd->pmf); cam_clk_unprepare()
1205 static void fimc_md_unregister_clk_provider(struct fimc_md *fmd) fimc_md_unregister_clk_provider() argument
1207 struct cam_clk_provider *cp = &fmd->clk_provider; fimc_md_unregister_clk_provider()
1217 static int fimc_md_register_clk_provider(struct fimc_md *fmd) fimc_md_register_clk_provider() argument
1219 struct cam_clk_provider *cp = &fmd->clk_provider; fimc_md_register_clk_provider()
1220 struct device *dev = &fmd->pdev->dev; fimc_md_register_clk_provider()
1233 p_name = __clk_get_name(fmd->camclk[i].clock); fimc_md_register_clk_provider()
1241 camclk->fmd = fmd; fimc_md_register_clk_provider()
1266 fimc_md_unregister_clk_provider(fmd); fimc_md_register_clk_provider()
1274 struct fimc_md *fmd = notifier_to_fimc_md(notifier); subdev_notifier_bound() local
1279 for (i = 0; i < ARRAY_SIZE(fmd->sensor); i++) subdev_notifier_bound()
1280 if (fmd->sensor[i].asd.match.of.node == subdev->dev->of_node) subdev_notifier_bound()
1281 si = &fmd->sensor[i]; subdev_notifier_bound()
1295 v4l2_info(&fmd->v4l2_dev, "Registered sensor subdevice: %s (%d)\n", subdev_notifier_bound()
1296 subdev->name, fmd->num_sensors); subdev_notifier_bound()
1298 fmd->num_sensors++; subdev_notifier_bound()
1305 struct fimc_md *fmd = notifier_to_fimc_md(notifier); subdev_notifier_complete() local
1308 mutex_lock(&fmd->media_dev.graph_mutex); subdev_notifier_complete()
1310 ret = fimc_md_create_links(fmd); subdev_notifier_complete()
1314 ret = v4l2_device_register_subdev_nodes(&fmd->v4l2_dev); subdev_notifier_complete()
1316 mutex_unlock(&fmd->media_dev.graph_mutex); subdev_notifier_complete()
1324 struct fimc_md *fmd; fimc_md_probe() local
1327 fmd = devm_kzalloc(dev, sizeof(*fmd), GFP_KERNEL); fimc_md_probe()
1328 if (!fmd) fimc_md_probe()
1331 spin_lock_init(&fmd->slock); fimc_md_probe()
1332 INIT_LIST_HEAD(&fmd->pipelines); fimc_md_probe()
1333 fmd->pdev = pdev; fimc_md_probe()
1335 strlcpy(fmd->media_dev.model, "SAMSUNG S5P FIMC", fimc_md_probe()
1336 sizeof(fmd->media_dev.model)); fimc_md_probe()
1337 fmd->media_dev.link_notify = fimc_md_link_notify; fimc_md_probe()
1338 fmd->media_dev.dev = dev; fimc_md_probe()
1340 v4l2_dev = &fmd->v4l2_dev; fimc_md_probe()
1341 v4l2_dev->mdev = &fmd->media_dev; fimc_md_probe()
1345 fmd->use_isp = fimc_md_is_isp_available(dev->of_node); fimc_md_probe()
1346 fmd->user_subdev_api = true; fimc_md_probe()
1348 ret = v4l2_device_register(dev, &fmd->v4l2_dev); fimc_md_probe()
1354 ret = media_device_register(&fmd->media_dev); fimc_md_probe()
1360 ret = fimc_md_get_clocks(fmd); fimc_md_probe()
1364 ret = fimc_md_get_pinctrl(fmd); fimc_md_probe()
1371 platform_set_drvdata(pdev, fmd); fimc_md_probe()
1374 mutex_lock(&fmd->media_dev.graph_mutex); fimc_md_probe()
1376 ret = fimc_md_register_platform_entities(fmd, dev->of_node); fimc_md_probe()
1378 mutex_unlock(&fmd->media_dev.graph_mutex); fimc_md_probe()
1382 ret = fimc_md_register_sensor_entities(fmd); fimc_md_probe()
1384 mutex_unlock(&fmd->media_dev.graph_mutex); fimc_md_probe()
1388 mutex_unlock(&fmd->media_dev.graph_mutex); fimc_md_probe()
1398 ret = fimc_md_register_clk_provider(fmd); fimc_md_probe()
1404 if (fmd->num_sensors > 0) { fimc_md_probe()
1405 fmd->subdev_notifier.subdevs = fmd->async_subdevs; fimc_md_probe()
1406 fmd->subdev_notifier.num_subdevs = fmd->num_sensors; fimc_md_probe()
1407 fmd->subdev_notifier.bound = subdev_notifier_bound; fimc_md_probe()
1408 fmd->subdev_notifier.complete = subdev_notifier_complete; fimc_md_probe()
1409 fmd->num_sensors = 0; fimc_md_probe()
1411 ret = v4l2_async_notifier_register(&fmd->v4l2_dev, fimc_md_probe()
1412 &fmd->subdev_notifier); fimc_md_probe()
1420 fimc_md_unregister_clk_provider(fmd); fimc_md_probe()
1424 fimc_md_put_clocks(fmd); fimc_md_probe()
1426 fimc_md_unregister_entities(fmd); fimc_md_probe()
1428 media_device_unregister(&fmd->media_dev); fimc_md_probe()
1430 v4l2_device_unregister(&fmd->v4l2_dev); fimc_md_probe()
1436 struct fimc_md *fmd = platform_get_drvdata(pdev); fimc_md_remove() local
1438 if (!fmd) fimc_md_remove()
1441 fimc_md_unregister_clk_provider(fmd); fimc_md_remove()
1442 v4l2_async_notifier_unregister(&fmd->subdev_notifier); fimc_md_remove()
1444 v4l2_device_unregister(&fmd->v4l2_dev); fimc_md_remove()
1446 fimc_md_unregister_entities(fmd); fimc_md_remove()
1447 fimc_md_pipelines_free(fmd); fimc_md_remove()
1448 media_device_unregister(&fmd->media_dev); fimc_md_remove()
1449 fimc_md_put_clocks(fmd); fimc_md_remove()
302 fimc_md_pipeline_create( struct fimc_md *fmd) fimc_md_pipeline_create() argument
H A Dmedia-dev.h98 struct fimc_md *fmd; member in struct:cam_clk
H A Dfimc-capture.c1454 struct fimc_md *fmd; fimc_sensor_notify() local
1462 fmd = entity_to_fimc_mdev(&sd->entity); fimc_sensor_notify()
1464 spin_lock_irqsave(&fmd->slock, flags); fimc_sensor_notify()
1481 spin_unlock_irqrestore(&fmd->slock, flags); fimc_sensor_notify()
/linux-4.1.27/drivers/gpu/drm/sti/
H A Dsti_hqvdp.c308 struct sti_hqvdp_fmd fmd; member in struct:sti_hqvdp_cmd

Completed in 151 milliseconds