Lines Matching refs:ici

175 static int soc_camera_clock_start(struct soc_camera_host *ici)  in soc_camera_clock_start()  argument
179 if (!ici->ops->clock_start) in soc_camera_clock_start()
182 mutex_lock(&ici->clk_lock); in soc_camera_clock_start()
183 ret = ici->ops->clock_start(ici); in soc_camera_clock_start()
184 mutex_unlock(&ici->clk_lock); in soc_camera_clock_start()
189 static void soc_camera_clock_stop(struct soc_camera_host *ici) in soc_camera_clock_stop() argument
191 if (!ici->ops->clock_stop) in soc_camera_clock_stop()
194 mutex_lock(&ici->clk_lock); in soc_camera_clock_stop()
195 ici->ops->clock_stop(ici); in soc_camera_clock_stop()
196 mutex_unlock(&ici->clk_lock); in soc_camera_clock_stop()
251 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_try_fmt() local
260 !(ici->capabilities & SOCAM_HOST_CAP_STRIDE)) { in soc_camera_try_fmt()
265 ret = ici->ops->try_fmt(icd, f); in soc_camera_try_fmt()
355 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_enum_framesizes() local
357 return ici->ops->enum_framesizes(icd, fsize); in soc_camera_enum_framesizes()
450 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_init_user_formats() local
462 if (!ici->ops->get_formats) in soc_camera_init_user_formats()
474 ret = ici->ops->get_formats(icd, i, NULL); in soc_camera_init_user_formats()
494 if (!ici->ops->get_formats) { in soc_camera_init_user_formats()
502 ret = ici->ops->get_formats(icd, i, in soc_camera_init_user_formats()
522 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_free_user_formats() local
524 if (ici->ops->put_formats) in soc_camera_free_user_formats()
525 ici->ops->put_formats(icd); in soc_camera_free_user_formats()
536 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_set_fmt() local
548 ret = ici->ops->set_fmt(icd, f); in soc_camera_set_fmt()
569 return ici->ops->set_bus_param(icd); in soc_camera_set_fmt()
574 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_add_device() local
577 if (ici->icd) in soc_camera_add_device()
581 ret = soc_camera_clock_start(ici); in soc_camera_add_device()
586 if (ici->ops->add) { in soc_camera_add_device()
587 ret = ici->ops->add(icd); in soc_camera_add_device()
592 ici->icd = icd; in soc_camera_add_device()
598 soc_camera_clock_stop(ici); in soc_camera_add_device()
604 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_remove_device() local
606 if (WARN_ON(icd != ici->icd)) in soc_camera_remove_device()
609 if (ici->ops->remove) in soc_camera_remove_device()
610 ici->ops->remove(icd); in soc_camera_remove_device()
612 soc_camera_clock_stop(ici); in soc_camera_remove_device()
613 ici->icd = NULL; in soc_camera_remove_device()
620 struct soc_camera_host *ici; in soc_camera_open() local
637 ici = to_soc_camera_host(icd->parent); in soc_camera_open()
639 ret = try_module_get(ici->ops->owner) ? 0 : -ENODEV; in soc_camera_open()
653 if (mutex_lock_interruptible(&ici->host_lock)) { in soc_camera_open()
705 ret = ici->ops->init_videobuf2(&icd->vb2_vidq, icd); in soc_camera_open()
710 mutex_unlock(&ici->host_lock); in soc_camera_open()
730 mutex_unlock(&ici->host_lock); in soc_camera_open()
733 module_put(ici->ops->owner); in soc_camera_open()
741 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_close() local
743 mutex_lock(&ici->host_lock); in soc_camera_close()
745 if (ici->ops->init_videobuf2) in soc_camera_close()
759 mutex_unlock(&ici->host_lock); in soc_camera_close()
761 module_put(ici->ops->owner); in soc_camera_close()
772 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_read() local
776 if (ici->ops->init_videobuf2 && icd->vb2_vidq.io_modes & VB2_READ) in soc_camera_read()
788 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_mmap() local
796 if (mutex_lock_interruptible(&ici->host_lock)) in soc_camera_mmap()
799 mutex_unlock(&ici->host_lock); in soc_camera_mmap()
812 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_poll() local
818 mutex_lock(&ici->host_lock); in soc_camera_poll()
819 res = ici->ops->poll(file, pt); in soc_camera_poll()
820 mutex_unlock(&ici->host_lock); in soc_camera_poll()
909 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_querycap() local
913 strlcpy(cap->driver, ici->drv_name, sizeof(cap->driver)); in soc_camera_querycap()
914 return ici->ops->querycap(ici, cap); in soc_camera_querycap()
970 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_g_selection() local
976 return ici->ops->get_selection(icd, s); in soc_camera_g_selection()
983 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_s_selection() local
1009 ici->ops->set_liveselection) in soc_camera_s_selection()
1010 ret = ici->ops->set_liveselection(icd, s); in soc_camera_s_selection()
1012 ret = ici->ops->set_selection(icd, s); in soc_camera_s_selection()
1028 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_g_parm() local
1030 if (ici->ops->get_parm) in soc_camera_g_parm()
1031 return ici->ops->get_parm(icd, a); in soc_camera_g_parm()
1040 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_s_parm() local
1042 if (ici->ops->set_parm) in soc_camera_s_parm()
1043 return ici->ops->set_parm(icd, a); in soc_camera_s_parm()
1048 static int soc_camera_probe(struct soc_camera_host *ici,
1052 static void scan_add_host(struct soc_camera_host *ici) in scan_add_host() argument
1059 if (icd->iface == ici->nr) { in scan_add_host()
1068 icd->parent = ici->v4l2_dev.dev; in scan_add_host()
1071 soc_camera_probe(ici, icd); in scan_add_host()
1084 struct soc_camera_host *ici; in soc_camera_clk_enable() local
1089 ici = to_soc_camera_host(icd->parent); in soc_camera_clk_enable()
1091 if (!try_module_get(ici->ops->owner)) in soc_camera_clk_enable()
1098 return soc_camera_clock_start(ici); in soc_camera_clk_enable()
1104 struct soc_camera_host *ici; in soc_camera_clk_disable() local
1109 ici = to_soc_camera_host(icd->parent); in soc_camera_clk_disable()
1111 soc_camera_clock_stop(ici); in soc_camera_clk_disable()
1113 module_put(ici->ops->owner); in soc_camera_clk_disable()
1230 struct soc_camera_host *ici; in soc_camera_i2c_init() local
1243 ici = to_soc_camera_host(icd->parent); in soc_camera_i2c_init()
1274 subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap, in soc_camera_i2c_init()
1382 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in soc_camera_async_complete() local
1386 ret = soc_camera_probe(ici, icd); in soc_camera_async_complete()
1401 static int scan_async_group(struct soc_camera_host *ici, in scan_async_group() argument
1407 struct soc_camera_desc sdesc = {.host_desc.bus_id = ici->nr,}; in scan_async_group()
1421 dev_err(ici->v4l2_dev.dev, "No I2C data source found!\n"); in scan_async_group()
1426 sasc = devm_kzalloc(ici->v4l2_dev.dev, sizeof(*sasc), GFP_KERNEL); in scan_async_group()
1450 icd->parent = ici->v4l2_dev.dev; in scan_async_group()
1462 ret = v4l2_async_notifier_register(&ici->v4l2_dev, &sasc->notifier); in scan_async_group()
1473 devm_kfree(ici->v4l2_dev.dev, sasc); in scan_async_group()
1474 dev_err(ici->v4l2_dev.dev, "group probe failed: %d\n", ret); in scan_async_group()
1479 static void scan_async_host(struct soc_camera_host *ici) in scan_async_host() argument
1484 for (j = 0, asd = ici->asd; ici->asd_sizes[j]; j++) { in scan_async_host()
1485 scan_async_group(ici, asd, ici->asd_sizes[j]); in scan_async_host()
1486 asd += ici->asd_sizes[j]; in scan_async_host()
1492 #define scan_async_host(ici) do {} while (0) argument
1503 static int soc_of_bind(struct soc_camera_host *ici, in soc_of_bind() argument
1508 struct soc_camera_desc sdesc = {.host_desc.bus_id = ici->nr,}; in soc_of_bind()
1516 info = devm_kzalloc(ici->v4l2_dev.dev, sizeof(struct soc_of_info), in soc_of_bind()
1548 icd->parent = ici->v4l2_dev.dev; in soc_of_bind()
1564 ret = v4l2_async_notifier_register(&ici->v4l2_dev, &sasc->notifier); in soc_of_bind()
1575 devm_kfree(ici->v4l2_dev.dev, info); in soc_of_bind()
1576 dev_err(ici->v4l2_dev.dev, "group probe failed: %d\n", ret); in soc_of_bind()
1581 static void scan_of_host(struct soc_camera_host *ici) in scan_of_host() argument
1583 struct device *dev = ici->v4l2_dev.dev; in scan_of_host()
1601 soc_of_bind(ici, epn, ren->parent); in scan_of_host()
1615 static inline void scan_of_host(struct soc_camera_host *ici) { } in scan_of_host() argument
1619 static int soc_camera_probe(struct soc_camera_host *ici, in soc_camera_probe() argument
1660 ret = soc_camera_clock_start(ici); in soc_camera_probe()
1684 mutex_lock(&ici->host_lock); in soc_camera_probe()
1686 mutex_unlock(&ici->host_lock); in soc_camera_probe()
1700 soc_camera_clock_stop(ici); in soc_camera_probe()
1844 int soc_camera_host_register(struct soc_camera_host *ici) in soc_camera_host_register() argument
1849 if (!ici || !ici->ops || in soc_camera_host_register()
1850 !ici->ops->try_fmt || in soc_camera_host_register()
1851 !ici->ops->set_fmt || in soc_camera_host_register()
1852 !ici->ops->set_bus_param || in soc_camera_host_register()
1853 !ici->ops->querycap || in soc_camera_host_register()
1854 !ici->ops->init_videobuf2 || in soc_camera_host_register()
1855 !ici->ops->poll || in soc_camera_host_register()
1856 !ici->v4l2_dev.dev) in soc_camera_host_register()
1859 if (!ici->ops->set_selection) in soc_camera_host_register()
1860 ici->ops->set_selection = default_s_selection; in soc_camera_host_register()
1861 if (!ici->ops->get_selection) in soc_camera_host_register()
1862 ici->ops->get_selection = default_g_selection; in soc_camera_host_register()
1863 if (!ici->ops->set_parm) in soc_camera_host_register()
1864 ici->ops->set_parm = default_s_parm; in soc_camera_host_register()
1865 if (!ici->ops->get_parm) in soc_camera_host_register()
1866 ici->ops->get_parm = default_g_parm; in soc_camera_host_register()
1867 if (!ici->ops->enum_framesizes) in soc_camera_host_register()
1868 ici->ops->enum_framesizes = default_enum_framesizes; in soc_camera_host_register()
1872 if (ix->nr == ici->nr) { in soc_camera_host_register()
1878 ret = v4l2_device_register(ici->v4l2_dev.dev, &ici->v4l2_dev); in soc_camera_host_register()
1882 list_add_tail(&ici->list, &hosts); in soc_camera_host_register()
1885 mutex_init(&ici->host_lock); in soc_camera_host_register()
1886 mutex_init(&ici->clk_lock); in soc_camera_host_register()
1888 if (ici->v4l2_dev.dev->of_node) in soc_camera_host_register()
1889 scan_of_host(ici); in soc_camera_host_register()
1890 else if (ici->asd_sizes) in soc_camera_host_register()
1896 scan_async_host(ici); in soc_camera_host_register()
1899 scan_add_host(ici); in soc_camera_host_register()
1910 void soc_camera_host_unregister(struct soc_camera_host *ici) in soc_camera_host_unregister() argument
1917 list_del(&ici->list); in soc_camera_host_unregister()
1919 if (icd->iface == ici->nr && icd->sasc) { in soc_camera_host_unregister()
1935 if (icd->iface == ici->nr) in soc_camera_host_unregister()
1940 v4l2_device_unregister(&ici->v4l2_dev); in soc_camera_host_unregister()
2023 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); in video_dev_create() local
2029 strlcpy(vdev->name, ici->drv_name, sizeof(vdev->name)); in video_dev_create()
2031 vdev->v4l2_dev = &ici->v4l2_dev; in video_dev_create()
2036 vdev->lock = &ici->host_lock; in video_dev_create()