Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107904
b: refs/heads/master
c: 3f6ac49
h: refs/heads/master
v: v3
  • Loading branch information
Robert Jarzmik authored and Mauro Carvalho Chehab committed Aug 6, 2008
1 parent 876f998 commit 525d124
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2e521061db61a35dd64ea85a1642f9a9dfde2872
refs/heads/master: 3f6ac497b036533d1a63ba04fdbe710c55e14cda
56 changes: 56 additions & 0 deletions trunk/drivers/media/video/pxa_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ struct pxa_camera_dev {

struct pxa_buffer *active;
struct pxa_dma_desc *sg_tail[3];

u32 save_cicr[5];
};

static const char *pxa_cam_driver_description = "PXA_Camera";
Expand Down Expand Up @@ -997,10 +999,64 @@ static int pxa_camera_querycap(struct soc_camera_host *ici,
return 0;
}

static int pxa_camera_suspend(struct soc_camera_device *icd, pm_message_t state)
{
struct soc_camera_host *ici =
to_soc_camera_host(icd->dev.parent);
struct pxa_camera_dev *pcdev = ici->priv;
int i = 0, ret = 0;

pcdev->save_cicr[i++] = CICR0;
pcdev->save_cicr[i++] = CICR1;
pcdev->save_cicr[i++] = CICR2;
pcdev->save_cicr[i++] = CICR3;
pcdev->save_cicr[i++] = CICR4;

if ((pcdev->icd) && (pcdev->icd->ops->suspend))
ret = pcdev->icd->ops->suspend(pcdev->icd, state);

return ret;
}

static int pxa_camera_resume(struct soc_camera_device *icd)
{
struct soc_camera_host *ici =
to_soc_camera_host(icd->dev.parent);
struct pxa_camera_dev *pcdev = ici->priv;
int i = 0, ret = 0;

DRCMR68 = pcdev->dma_chans[0] | DRCMR_MAPVLD;
DRCMR69 = pcdev->dma_chans[1] | DRCMR_MAPVLD;
DRCMR70 = pcdev->dma_chans[2] | DRCMR_MAPVLD;

CICR0 = pcdev->save_cicr[i++] & ~CICR0_ENB;
CICR1 = pcdev->save_cicr[i++];
CICR2 = pcdev->save_cicr[i++];
CICR3 = pcdev->save_cicr[i++];
CICR4 = pcdev->save_cicr[i++];

if ((pcdev->icd) && (pcdev->icd->ops->resume))
ret = pcdev->icd->ops->resume(pcdev->icd);

/* Restart frame capture if active buffer exists */
if (!ret && pcdev->active) {
/* Reset the FIFOs */
CIFR |= CIFR_RESET_F;
/* Enable End-Of-Frame Interrupt */
CICR0 &= ~CICR0_EOFM;
/* Restart the Capture Interface */
CICR0 |= CICR0_ENB;
}

return ret;
}

static struct soc_camera_host_ops pxa_soc_camera_host_ops = {
.owner = THIS_MODULE,
.add = pxa_camera_add_device,
.remove = pxa_camera_remove_device,
.suspend = pxa_camera_suspend,
.resume = pxa_camera_resume,
.set_fmt_cap = pxa_camera_set_fmt_cap,
.try_fmt_cap = pxa_camera_try_fmt_cap,
.init_videobuf = pxa_camera_init_videobuf,
Expand Down

0 comments on commit 525d124

Please sign in to comment.