• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/media/video/

Lines Matching refs:mx3_cam

118 	struct mx3_camera_dev	*mx3_cam;
138 struct mx3_camera_dev *mx3_cam = ichannel->client;
142 desc->txd.cookie, mx3_cam->active ? sg_dma_address(&mx3_cam->active->sg) : 0);
144 spin_lock(&mx3_cam->lock);
145 if (mx3_cam->active) {
146 vb = &mx3_cam->active->vb;
155 if (list_empty(&mx3_cam->capture)) {
156 mx3_cam->active = NULL;
157 spin_unlock(&mx3_cam->lock);
166 mx3_cam->active = list_entry(mx3_cam->capture.next,
168 mx3_cam->active->vb.state = VIDEOBUF_ACTIVE;
169 spin_unlock(&mx3_cam->lock);
212 struct mx3_camera_dev *mx3_cam = ici->priv;
219 if (!mx3_cam->idmac_channel[0])
239 struct mx3_camera_dev *mx3_cam = ici->priv;
276 struct idmac_channel *ichan = mx3_cam->idmac_channel[0];
341 * under spinlock_irqsave(&mx3_cam->lock, ...)
348 struct mx3_camera_dev *mx3_cam = ici->priv;
370 list_add_tail(&vb->queue, &mx3_cam->capture);
372 if (!mx3_cam->active) {
373 mx3_cam->active = buf;
379 spin_unlock_irq(&mx3_cam->lock);
385 spin_lock_irq(&mx3_cam->lock);
395 if (mx3_cam->active == buf)
396 mx3_cam->active = NULL;
405 struct mx3_camera_dev *mx3_cam = ici->priv;
412 mx3_cam->active == buf ? " active" : "", sg_dma_address(&buf->sg),
414 spin_lock_irqsave(&mx3_cam->lock, flags);
420 if (mx3_cam->active == buf)
421 mx3_cam->active = NULL;
423 spin_unlock_irqrestore(&mx3_cam->lock, flags);
438 struct mx3_camera_dev *mx3_cam = ici->priv;
441 &mx3_cam->lock,
448 static void mx3_camera_activate(struct mx3_camera_dev *mx3_cam,
455 csi_reg_write(mx3_cam, (640 - 1) | ((480 - 1) << 16), CSI_ACT_FRM_SIZE);
457 conf = csi_reg_read(mx3_cam, CSI_OUT_FRM_CTRL) & 0xffff0000;
458 csi_reg_write(mx3_cam, conf, CSI_OUT_FRM_CTRL);
466 if (mx3_cam->platform_flags & MX3_CAMERA_DATAWIDTH_15)
468 else if (mx3_cam->platform_flags & MX3_CAMERA_DATAWIDTH_10)
470 else if (mx3_cam->platform_flags & MX3_CAMERA_DATAWIDTH_8)
472 else/* if (mx3_cam->platform_flags & MX3_CAMERA_DATAWIDTH_4)*/
475 if (mx3_cam->platform_flags & MX3_CAMERA_CLK_SRC)
477 if (mx3_cam->platform_flags & MX3_CAMERA_EXT_VSYNC)
479 if (mx3_cam->platform_flags & MX3_CAMERA_DP)
481 if (mx3_cam->platform_flags & MX3_CAMERA_PCP)
483 if (mx3_cam->platform_flags & MX3_CAMERA_HSP)
485 if (mx3_cam->platform_flags & MX3_CAMERA_VSP)
489 csi_reg_write(mx3_cam, conf, CSI_SENS_CONF);
491 clk_enable(mx3_cam->clk);
492 rate = clk_round_rate(mx3_cam->clk, mx3_cam->mclk);
495 clk_set_rate(mx3_cam->clk, rate);
502 struct mx3_camera_dev *mx3_cam = ici->priv;
504 if (mx3_cam->icd)
507 mx3_camera_activate(mx3_cam, icd);
509 mx3_cam->icd = icd;
521 struct mx3_camera_dev *mx3_cam = ici->priv;
522 struct idmac_channel **ichan = &mx3_cam->idmac_channel[0];
524 BUG_ON(icd != mx3_cam->icd);
531 clk_disable(mx3_cam->clk);
533 mx3_cam->icd = NULL;
543 struct mx3_camera_dev *mx3_cam = ici->priv;
544 struct idmac_channel *ichan = mx3_cam->idmac_channel[0];
551 static int test_platform_param(struct mx3_camera_dev *mx3_cam,
574 if (mx3_cam->platform_flags & MX3_CAMERA_DATAWIDTH_15)
577 else if (mx3_cam->platform_flags & MX3_CAMERA_DATAWIDTH_10)
580 else if (mx3_cam->platform_flags & MX3_CAMERA_DATAWIDTH_8)
582 else if (mx3_cam->platform_flags & MX3_CAMERA_DATAWIDTH_4)
603 dev_warn(mx3_cam->soc_host.v4l2_dev.dev,
615 struct mx3_camera_dev *mx3_cam = ici->priv;
617 int ret = test_platform_param(mx3_cam, depth, &bus_flags);
643 pdata = rq->mx3_cam->soc_host.v4l2_dev.dev->platform_data;
740 static void configure_geometry(struct mx3_camera_dev *mx3_cam,
748 csi_reg_write(mx3_cam, width_field | (height_field << 16), CSI_SENS_FRM_SIZE);
750 csi_reg_write(mx3_cam, width_field << 16, CSI_FLASH_STROBE_1);
751 csi_reg_write(mx3_cam, (height_field << 16) | 0x22, CSI_FLASH_STROBE_2);
753 csi_reg_write(mx3_cam, width_field | (height_field << 16), CSI_ACT_FRM_SIZE);
756 ctrl = csi_reg_read(mx3_cam, CSI_OUT_FRM_CTRL) & 0xffff0000;
758 csi_reg_write(mx3_cam, ctrl | 0 | (0 << 8), CSI_OUT_FRM_CTRL);
761 static int acquire_dma_channel(struct mx3_camera_dev *mx3_cam)
765 struct idmac_channel **ichan = &mx3_cam->idmac_channel[0];
767 struct dma_chan_request rq = {.mx3_cam = mx3_cam,
774 mx3_cam->active = NULL;
775 list_for_each_entry_safe(vb, _vb, &mx3_cam->capture, queue) {
790 (*ichan)->client = mx3_cam;
812 struct mx3_camera_dev *mx3_cam = ici->priv;
843 ret = acquire_dma_channel(mx3_cam);
848 configure_geometry(mx3_cam, mf.width, mf.height);
864 struct mx3_camera_dev *mx3_cam = ici->priv;
881 ret = acquire_dma_channel(mx3_cam);
891 configure_geometry(mx3_cam, pix->width, pix->height);
1002 struct mx3_camera_dev *mx3_cam = ici->priv;
1016 ret = test_platform_param(mx3_cam, buswidth, &bus_flags);
1042 if (mx3_cam->platform_flags & MX3_CAMERA_HSP)
1050 if (mx3_cam->platform_flags & MX3_CAMERA_VSP)
1058 if (mx3_cam->platform_flags & MX3_CAMERA_DP)
1066 if (mx3_cam->platform_flags & MX3_CAMERA_PCP)
1102 sens_conf = csi_reg_read(mx3_cam, CSI_SENS_CONF) &
1144 csi_reg_write(mx3_cam, sens_conf | dw, CSI_SENS_CONF);
1168 struct mx3_camera_dev *mx3_cam;
1180 mx3_cam = vmalloc(sizeof(*mx3_cam));
1181 if (!mx3_cam) {
1186 memset(mx3_cam, 0, sizeof(*mx3_cam));
1188 mx3_cam->clk = clk_get(&pdev->dev, NULL);
1189 if (IS_ERR(mx3_cam->clk)) {
1190 err = PTR_ERR(mx3_cam->clk);
1194 mx3_cam->pdata = pdev->dev.platform_data;
1195 mx3_cam->platform_flags = mx3_cam->pdata->flags;
1196 if (!(mx3_cam->platform_flags & (MX3_CAMERA_DATAWIDTH_4 |
1205 mx3_cam->platform_flags |= MX3_CAMERA_DATAWIDTH_8;
1208 mx3_cam->mclk = mx3_cam->pdata->mclk_10khz * 10000;
1209 if (!mx3_cam->mclk) {
1213 mx3_cam->mclk = 20000000;
1217 INIT_LIST_HEAD(&mx3_cam->capture);
1218 spin_lock_init(&mx3_cam->lock);
1227 mx3_cam->base = base;
1229 soc_host = &mx3_cam->soc_host;
1232 soc_host->priv = mx3_cam;
1248 clk_put(mx3_cam->clk);
1250 vfree(mx3_cam);
1259 struct mx3_camera_dev *mx3_cam = container_of(soc_host,
1262 clk_put(mx3_cam->clk);
1266 iounmap(mx3_cam->base);
1272 if (WARN_ON(mx3_cam->idmac_channel[0]))
1273 dma_release_channel(&mx3_cam->idmac_channel[0]->dma_chan);
1275 vfree(mx3_cam);