aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mx3_camera.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/mx3_camera.c')
-rw-r--r--drivers/media/video/mx3_camera.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index 9770cb7932ca..2edf77a6256b 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -503,18 +503,19 @@ static int mx3_camera_add_device(struct soc_camera_device *icd)
503 503
504 mx3_camera_activate(mx3_cam, icd); 504 mx3_camera_activate(mx3_cam, icd);
505 ret = icd->ops->init(icd); 505 ret = icd->ops->init(icd);
506 if (ret < 0) { 506 if (ret < 0)
507 clk_disable(mx3_cam->clk);
508 goto einit; 507 goto einit;
509 }
510 508
511 mx3_cam->icd = icd; 509 mx3_cam->icd = icd;
512 510
511 dev_info(&icd->dev, "MX3 Camera driver attached to camera %d\n",
512 icd->devnum);
513
514 return 0;
515
513einit: 516einit:
517 clk_disable(mx3_cam->clk);
514ebusy: 518ebusy:
515 if (!ret)
516 dev_info(&icd->dev, "MX3 Camera driver attached to camera %d\n",
517 icd->devnum);
518 519
519 return ret; 520 return ret;
520} 521}
@@ -947,9 +948,10 @@ static int mx3_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt)
947 camera_flags = icd->ops->query_bus_param(icd); 948 camera_flags = icd->ops->query_bus_param(icd);
948 949
949 common_flags = soc_camera_bus_param_compatible(camera_flags, bus_flags); 950 common_flags = soc_camera_bus_param_compatible(camera_flags, bus_flags);
951 dev_dbg(ici->dev, "Flags cam: 0x%lx host: 0x%lx common: 0x%lx\n",
952 camera_flags, bus_flags, common_flags);
950 if (!common_flags) { 953 if (!common_flags) {
951 dev_dbg(ici->dev, "no common flags: camera %lx, host %lx\n", 954 dev_dbg(ici->dev, "no common flags");
952 camera_flags, bus_flags);
953 return -EINVAL; 955 return -EINVAL;
954 } 956 }
955 957
@@ -1002,8 +1004,11 @@ static int mx3_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt)
1002 SOCAM_DATAWIDTH_4; 1004 SOCAM_DATAWIDTH_4;
1003 1005
1004 ret = icd->ops->set_bus_param(icd, common_flags); 1006 ret = icd->ops->set_bus_param(icd, common_flags);
1005 if (ret < 0) 1007 if (ret < 0) {
1008 dev_dbg(ici->dev, "camera set_bus_param(%lx) returned %d\n",
1009 common_flags, ret);
1006 return ret; 1010 return ret;
1011 }
1007 1012
1008 /* 1013 /*
1009 * So far only gated clock mode is supported. Add a line 1014 * So far only gated clock mode is supported. Add a line
@@ -1127,8 +1132,9 @@ static int __devinit mx3_camera_probe(struct platform_device *pdev)
1127 INIT_LIST_HEAD(&mx3_cam->capture); 1132 INIT_LIST_HEAD(&mx3_cam->capture);
1128 spin_lock_init(&mx3_cam->lock); 1133 spin_lock_init(&mx3_cam->lock);
1129 1134
1130 base = ioremap(res->start, res->end - res->start + 1); 1135 base = ioremap(res->start, resource_size(res));
1131 if (!base) { 1136 if (!base) {
1137 pr_err("Couldn't map %x@%x\n", resource_size(res), res->start);
1132 err = -ENOMEM; 1138 err = -ENOMEM;
1133 goto eioremap; 1139 goto eioremap;
1134 } 1140 }
@@ -1215,3 +1221,4 @@ module_exit(mx3_camera_exit);
1215MODULE_DESCRIPTION("i.MX3x SoC Camera Host driver"); 1221MODULE_DESCRIPTION("i.MX3x SoC Camera Host driver");
1216MODULE_AUTHOR("Guennadi Liakhovetski <lg@denx.de>"); 1222MODULE_AUTHOR("Guennadi Liakhovetski <lg@denx.de>");
1217MODULE_LICENSE("GPL v2"); 1223MODULE_LICENSE("GPL v2");
1224MODULE_ALIAS("platform:" MX3_CAM_DRV_NAME);