diff options
Diffstat (limited to 'drivers/media/video/pxa_camera.c')
-rw-r--r-- | drivers/media/video/pxa_camera.c | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index cf96b2cc4f1c..eb6be5802928 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c | |||
@@ -629,17 +629,6 @@ static void pxa_camera_activate(struct pxa_camera_dev *pcdev) | |||
629 | pdata->init(pcdev->dev); | 629 | pdata->init(pcdev->dev); |
630 | } | 630 | } |
631 | 631 | ||
632 | if (pdata && pdata->power) { | ||
633 | dev_dbg(pcdev->dev, "%s: Power on camera\n", __func__); | ||
634 | pdata->power(pcdev->dev, 1); | ||
635 | } | ||
636 | |||
637 | if (pdata && pdata->reset) { | ||
638 | dev_dbg(pcdev->dev, "%s: Releasing camera reset\n", | ||
639 | __func__); | ||
640 | pdata->reset(pcdev->dev, 1); | ||
641 | } | ||
642 | |||
643 | CICR0 = 0x3FF; /* disable all interrupts */ | 632 | CICR0 = 0x3FF; /* disable all interrupts */ |
644 | 633 | ||
645 | if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN) | 634 | if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN) |
@@ -660,20 +649,7 @@ static void pxa_camera_activate(struct pxa_camera_dev *pcdev) | |||
660 | 649 | ||
661 | static void pxa_camera_deactivate(struct pxa_camera_dev *pcdev) | 650 | static void pxa_camera_deactivate(struct pxa_camera_dev *pcdev) |
662 | { | 651 | { |
663 | struct pxacamera_platform_data *board = pcdev->pdata; | ||
664 | |||
665 | clk_disable(pcdev->clk); | 652 | clk_disable(pcdev->clk); |
666 | |||
667 | if (board && board->reset) { | ||
668 | dev_dbg(pcdev->dev, "%s: Asserting camera reset\n", | ||
669 | __func__); | ||
670 | board->reset(pcdev->dev, 0); | ||
671 | } | ||
672 | |||
673 | if (board && board->power) { | ||
674 | dev_dbg(pcdev->dev, "%s: Power off camera\n", __func__); | ||
675 | board->power(pcdev->dev, 0); | ||
676 | } | ||
677 | } | 653 | } |
678 | 654 | ||
679 | static irqreturn_t pxa_camera_irq(int irq, void *data) | 655 | static irqreturn_t pxa_camera_irq(int irq, void *data) |
@@ -1144,31 +1120,31 @@ static int pxa_camera_probe(struct platform_device *pdev) | |||
1144 | pcdev->dev = &pdev->dev; | 1120 | pcdev->dev = &pdev->dev; |
1145 | 1121 | ||
1146 | /* request dma */ | 1122 | /* request dma */ |
1147 | pcdev->dma_chans[0] = pxa_request_dma("CI_Y", DMA_PRIO_HIGH, | 1123 | err = pxa_request_dma("CI_Y", DMA_PRIO_HIGH, |
1148 | pxa_camera_dma_irq_y, pcdev); | 1124 | pxa_camera_dma_irq_y, pcdev); |
1149 | if (pcdev->dma_chans[0] < 0) { | 1125 | if (err < 0) { |
1150 | dev_err(pcdev->dev, "Can't request DMA for Y\n"); | 1126 | dev_err(pcdev->dev, "Can't request DMA for Y\n"); |
1151 | err = -ENOMEM; | ||
1152 | goto exit_iounmap; | 1127 | goto exit_iounmap; |
1153 | } | 1128 | } |
1129 | pcdev->dma_chans[0] = err; | ||
1154 | dev_dbg(pcdev->dev, "got DMA channel %d\n", pcdev->dma_chans[0]); | 1130 | dev_dbg(pcdev->dev, "got DMA channel %d\n", pcdev->dma_chans[0]); |
1155 | 1131 | ||
1156 | pcdev->dma_chans[1] = pxa_request_dma("CI_U", DMA_PRIO_HIGH, | 1132 | err = pxa_request_dma("CI_U", DMA_PRIO_HIGH, |
1157 | pxa_camera_dma_irq_u, pcdev); | 1133 | pxa_camera_dma_irq_u, pcdev); |
1158 | if (pcdev->dma_chans[1] < 0) { | 1134 | if (err < 0) { |
1159 | dev_err(pcdev->dev, "Can't request DMA for U\n"); | 1135 | dev_err(pcdev->dev, "Can't request DMA for U\n"); |
1160 | err = -ENOMEM; | ||
1161 | goto exit_free_dma_y; | 1136 | goto exit_free_dma_y; |
1162 | } | 1137 | } |
1138 | pcdev->dma_chans[1] = err; | ||
1163 | dev_dbg(pcdev->dev, "got DMA channel (U) %d\n", pcdev->dma_chans[1]); | 1139 | dev_dbg(pcdev->dev, "got DMA channel (U) %d\n", pcdev->dma_chans[1]); |
1164 | 1140 | ||
1165 | pcdev->dma_chans[2] = pxa_request_dma("CI_V", DMA_PRIO_HIGH, | 1141 | err = pxa_request_dma("CI_V", DMA_PRIO_HIGH, |
1166 | pxa_camera_dma_irq_v, pcdev); | 1142 | pxa_camera_dma_irq_v, pcdev); |
1167 | if (pcdev->dma_chans[0] < 0) { | 1143 | if (err < 0) { |
1168 | dev_err(pcdev->dev, "Can't request DMA for V\n"); | 1144 | dev_err(pcdev->dev, "Can't request DMA for V\n"); |
1169 | err = -ENOMEM; | ||
1170 | goto exit_free_dma_u; | 1145 | goto exit_free_dma_u; |
1171 | } | 1146 | } |
1147 | pcdev->dma_chans[2] = err; | ||
1172 | dev_dbg(pcdev->dev, "got DMA channel (V) %d\n", pcdev->dma_chans[2]); | 1148 | dev_dbg(pcdev->dev, "got DMA channel (V) %d\n", pcdev->dma_chans[2]); |
1173 | 1149 | ||
1174 | DRCMR(68) = pcdev->dma_chans[0] | DRCMR_MAPVLD; | 1150 | DRCMR(68) = pcdev->dma_chans[0] | DRCMR_MAPVLD; |