diff mbox

[1/3,v2] ezx: Add camera support for A780 and A910 EZX phones

Message ID 20091106182910.a3b48c41.ospite@studenti.unina.it (mailing list archive)
State RFC
Headers show

Commit Message

Antonio Ospite Nov. 6, 2009, 5:29 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 6952e96..3101bcb 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -881,18 +882,8 @@  static void recalculate_fifo_timeout(struct pxa_camera_dev *pcdev,
 
 static void pxa_camera_activate(struct pxa_camera_dev *pcdev)
 {
-	struct pxacamera_platform_data *pdata = pcdev->pdata;
-	struct device *dev = pcdev->soc_host.v4l2_dev.dev;
 	u32 cicr4 = 0;
 
-	dev_dbg(dev, "Registered platform device at %p data %p\n",
-		pcdev, pdata);
-
-	if (pdata && pdata->init) {
-		dev_dbg(dev, "%s: Init gpios\n", __func__);
-		pdata->init(dev);
-	}
-
 	/* disable all interrupts */
 	__raw_writel(0x3ff, pcdev->base + CICR0);
 
@@ -1651,6 +1644,17 @@  static int __devinit pxa_camera_probe(struct platform_device *pdev)
 	pcdev->res = res;
 
 	pcdev->pdata = pdev->dev.platform_data;
+
+	dev_dbg(&pdev->dev, "Registered platform device at %p data %p\n",
+		pcdev, pcdev->pdata);
+
+	if (pcdev->pdata && pcdev->pdata->init) {
+		dev_dbg(&pdev->dev, "%s: Init gpios\n", __func__);
+		err = pcdev->pdata->init(&pdev->dev);
+		if (err)
+			goto exit_clk;
+	}
+
 	pcdev->platform_flags = pcdev->pdata->flags;
 	if (!(pcdev->platform_flags & (PXA_CAMERA_DATAWIDTH_8 |
 			PXA_CAMERA_DATAWIDTH_9 | PXA_CAMERA_DATAWIDTH_10))) {