aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pxa_camera.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/pxa_camera.c')
-rw-r--r--drivers/media/video/pxa_camera.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 020de529b955..d07df22a5ec6 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -246,7 +246,7 @@ static int pxa_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
246 if (bytes_per_line < 0) 246 if (bytes_per_line < 0)
247 return bytes_per_line; 247 return bytes_per_line;
248 248
249 dev_dbg(icd->dev.parent, "count=%d, size=%d\n", *count, *size); 249 dev_dbg(icd->parent, "count=%d, size=%d\n", *count, *size);
250 250
251 *size = bytes_per_line * icd->user_height; 251 *size = bytes_per_line * icd->user_height;
252 252
@@ -261,13 +261,13 @@ static int pxa_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
261static void free_buffer(struct videobuf_queue *vq, struct pxa_buffer *buf) 261static void free_buffer(struct videobuf_queue *vq, struct pxa_buffer *buf)
262{ 262{
263 struct soc_camera_device *icd = vq->priv_data; 263 struct soc_camera_device *icd = vq->priv_data;
264 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 264 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
265 struct videobuf_dmabuf *dma = videobuf_to_dma(&buf->vb); 265 struct videobuf_dmabuf *dma = videobuf_to_dma(&buf->vb);
266 int i; 266 int i;
267 267
268 BUG_ON(in_interrupt()); 268 BUG_ON(in_interrupt());
269 269
270 dev_dbg(icd->dev.parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__, 270 dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
271 &buf->vb, buf->vb.baddr, buf->vb.bsize); 271 &buf->vb, buf->vb.baddr, buf->vb.bsize);
272 272
273 /* 273 /*
@@ -428,7 +428,7 @@ static int pxa_videobuf_prepare(struct videobuf_queue *vq,
428 struct videobuf_buffer *vb, enum v4l2_field field) 428 struct videobuf_buffer *vb, enum v4l2_field field)
429{ 429{
430 struct soc_camera_device *icd = vq->priv_data; 430 struct soc_camera_device *icd = vq->priv_data;
431 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 431 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
432 struct pxa_camera_dev *pcdev = ici->priv; 432 struct pxa_camera_dev *pcdev = ici->priv;
433 struct device *dev = pcdev->soc_host.v4l2_dev.dev; 433 struct device *dev = pcdev->soc_host.v4l2_dev.dev;
434 struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb); 434 struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb);
@@ -635,11 +635,11 @@ static void pxa_videobuf_queue(struct videobuf_queue *vq,
635 struct videobuf_buffer *vb) 635 struct videobuf_buffer *vb)
636{ 636{
637 struct soc_camera_device *icd = vq->priv_data; 637 struct soc_camera_device *icd = vq->priv_data;
638 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 638 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
639 struct pxa_camera_dev *pcdev = ici->priv; 639 struct pxa_camera_dev *pcdev = ici->priv;
640 struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb); 640 struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb);
641 641
642 dev_dbg(icd->dev.parent, "%s (vb=0x%p) 0x%08lx %d active=%p\n", 642 dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d active=%p\n",
643 __func__, vb, vb->baddr, vb->bsize, pcdev->active); 643 __func__, vb, vb->baddr, vb->bsize, pcdev->active);
644 644
645 list_add_tail(&vb->queue, &pcdev->capture); 645 list_add_tail(&vb->queue, &pcdev->capture);
@@ -657,7 +657,7 @@ static void pxa_videobuf_release(struct videobuf_queue *vq,
657 struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb); 657 struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb);
658#ifdef DEBUG 658#ifdef DEBUG
659 struct soc_camera_device *icd = vq->priv_data; 659 struct soc_camera_device *icd = vq->priv_data;
660 struct device *dev = icd->dev.parent; 660 struct device *dev = icd->parent;
661 661
662 dev_dbg(dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, 662 dev_dbg(dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
663 vb, vb->baddr, vb->bsize); 663 vb, vb->baddr, vb->bsize);
@@ -842,7 +842,7 @@ static struct videobuf_queue_ops pxa_videobuf_ops = {
842static void pxa_camera_init_videobuf(struct videobuf_queue *q, 842static void pxa_camera_init_videobuf(struct videobuf_queue *q,
843 struct soc_camera_device *icd) 843 struct soc_camera_device *icd)
844{ 844{
845 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 845 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
846 struct pxa_camera_dev *pcdev = ici->priv; 846 struct pxa_camera_dev *pcdev = ici->priv;
847 847
848 /* 848 /*
@@ -971,7 +971,7 @@ static irqreturn_t pxa_camera_irq(int irq, void *data)
971 */ 971 */
972static int pxa_camera_add_device(struct soc_camera_device *icd) 972static int pxa_camera_add_device(struct soc_camera_device *icd)
973{ 973{
974 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 974 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
975 struct pxa_camera_dev *pcdev = ici->priv; 975 struct pxa_camera_dev *pcdev = ici->priv;
976 976
977 if (pcdev->icd) 977 if (pcdev->icd)
@@ -981,7 +981,7 @@ static int pxa_camera_add_device(struct soc_camera_device *icd)
981 981
982 pcdev->icd = icd; 982 pcdev->icd = icd;
983 983
984 dev_info(icd->dev.parent, "PXA Camera driver attached to camera %d\n", 984 dev_info(icd->parent, "PXA Camera driver attached to camera %d\n",
985 icd->devnum); 985 icd->devnum);
986 986
987 return 0; 987 return 0;
@@ -990,12 +990,12 @@ static int pxa_camera_add_device(struct soc_camera_device *icd)
990/* Called with .video_lock held */ 990/* Called with .video_lock held */
991static void pxa_camera_remove_device(struct soc_camera_device *icd) 991static void pxa_camera_remove_device(struct soc_camera_device *icd)
992{ 992{
993 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 993 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
994 struct pxa_camera_dev *pcdev = ici->priv; 994 struct pxa_camera_dev *pcdev = ici->priv;
995 995
996 BUG_ON(icd != pcdev->icd); 996 BUG_ON(icd != pcdev->icd);
997 997
998 dev_info(icd->dev.parent, "PXA Camera driver detached from camera %d\n", 998 dev_info(icd->parent, "PXA Camera driver detached from camera %d\n",
999 icd->devnum); 999 icd->devnum);
1000 1000
1001 /* disable capture, disable interrupts */ 1001 /* disable capture, disable interrupts */
@@ -1056,7 +1056,7 @@ static int test_platform_param(struct pxa_camera_dev *pcdev,
1056static void pxa_camera_setup_cicr(struct soc_camera_device *icd, 1056static void pxa_camera_setup_cicr(struct soc_camera_device *icd,
1057 unsigned long flags, __u32 pixfmt) 1057 unsigned long flags, __u32 pixfmt)
1058{ 1058{
1059 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 1059 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
1060 struct pxa_camera_dev *pcdev = ici->priv; 1060 struct pxa_camera_dev *pcdev = ici->priv;
1061 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 1061 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1062 unsigned long dw, bpp; 1062 unsigned long dw, bpp;
@@ -1151,7 +1151,7 @@ static void pxa_camera_setup_cicr(struct soc_camera_device *icd,
1151 1151
1152static int pxa_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) 1152static int pxa_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt)
1153{ 1153{
1154 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 1154 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
1155 struct pxa_camera_dev *pcdev = ici->priv; 1155 struct pxa_camera_dev *pcdev = ici->priv;
1156 unsigned long bus_flags, camera_flags, common_flags; 1156 unsigned long bus_flags, camera_flags, common_flags;
1157 int ret; 1157 int ret;
@@ -1209,7 +1209,7 @@ static int pxa_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt)
1209static int pxa_camera_try_bus_param(struct soc_camera_device *icd, 1209static int pxa_camera_try_bus_param(struct soc_camera_device *icd,
1210 unsigned char buswidth) 1210 unsigned char buswidth)
1211{ 1211{
1212 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 1212 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
1213 struct pxa_camera_dev *pcdev = ici->priv; 1213 struct pxa_camera_dev *pcdev = ici->priv;
1214 unsigned long bus_flags, camera_flags; 1214 unsigned long bus_flags, camera_flags;
1215 int ret = test_platform_param(pcdev, buswidth, &bus_flags); 1215 int ret = test_platform_param(pcdev, buswidth, &bus_flags);
@@ -1246,7 +1246,7 @@ static int pxa_camera_get_formats(struct soc_camera_device *icd, unsigned int id
1246 struct soc_camera_format_xlate *xlate) 1246 struct soc_camera_format_xlate *xlate)
1247{ 1247{
1248 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 1248 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1249 struct device *dev = icd->dev.parent; 1249 struct device *dev = icd->parent;
1250 int formats = 0, ret; 1250 int formats = 0, ret;
1251 struct pxa_cam *cam; 1251 struct pxa_cam *cam;
1252 enum v4l2_mbus_pixelcode code; 1252 enum v4l2_mbus_pixelcode code;
@@ -1334,9 +1334,9 @@ static int pxa_camera_set_crop(struct soc_camera_device *icd,
1334 struct v4l2_crop *a) 1334 struct v4l2_crop *a)
1335{ 1335{
1336 struct v4l2_rect *rect = &a->c; 1336 struct v4l2_rect *rect = &a->c;
1337 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 1337 struct device *dev = icd->parent;
1338 struct soc_camera_host *ici = to_soc_camera_host(dev);
1338 struct pxa_camera_dev *pcdev = ici->priv; 1339 struct pxa_camera_dev *pcdev = ici->priv;
1339 struct device *dev = icd->dev.parent;
1340 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 1340 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1341 struct soc_camera_sense sense = { 1341 struct soc_camera_sense sense = {
1342 .master_clock = pcdev->mclk, 1342 .master_clock = pcdev->mclk,
@@ -1378,7 +1378,7 @@ static int pxa_camera_set_crop(struct soc_camera_device *icd,
1378 return ret; 1378 return ret;
1379 1379
1380 if (pxa_camera_check_frame(mf.width, mf.height)) { 1380 if (pxa_camera_check_frame(mf.width, mf.height)) {
1381 dev_warn(icd->dev.parent, 1381 dev_warn(icd->parent,
1382 "Inconsistent state. Use S_FMT to repair\n"); 1382 "Inconsistent state. Use S_FMT to repair\n");
1383 return -EINVAL; 1383 return -EINVAL;
1384 } 1384 }
@@ -1405,9 +1405,9 @@ static int pxa_camera_set_crop(struct soc_camera_device *icd,
1405static int pxa_camera_set_fmt(struct soc_camera_device *icd, 1405static int pxa_camera_set_fmt(struct soc_camera_device *icd,
1406 struct v4l2_format *f) 1406 struct v4l2_format *f)
1407{ 1407{
1408 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 1408 struct device *dev = icd->parent;
1409 struct soc_camera_host *ici = to_soc_camera_host(dev);
1409 struct pxa_camera_dev *pcdev = ici->priv; 1410 struct pxa_camera_dev *pcdev = ici->priv;
1410 struct device *dev = icd->dev.parent;
1411 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 1411 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1412 const struct soc_camera_format_xlate *xlate = NULL; 1412 const struct soc_camera_format_xlate *xlate = NULL;
1413 struct soc_camera_sense sense = { 1413 struct soc_camera_sense sense = {
@@ -1484,7 +1484,7 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd,
1484 1484
1485 xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); 1485 xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
1486 if (!xlate) { 1486 if (!xlate) {
1487 dev_warn(icd->dev.parent, "Format %x not found\n", pixfmt); 1487 dev_warn(icd->parent, "Format %x not found\n", pixfmt);
1488 return -EINVAL; 1488 return -EINVAL;
1489 } 1489 }
1490 1490
@@ -1521,7 +1521,7 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd,
1521 break; 1521 break;
1522 default: 1522 default:
1523 /* TODO: support interlaced at least in pass-through mode */ 1523 /* TODO: support interlaced at least in pass-through mode */
1524 dev_err(icd->dev.parent, "Field type %d unsupported.\n", 1524 dev_err(icd->parent, "Field type %d unsupported.\n",
1525 mf.field); 1525 mf.field);
1526 return -EINVAL; 1526 return -EINVAL;
1527 } 1527 }