diff options
Diffstat (limited to 'drivers/media/platform/pxa_camera.c')
-rw-r--r-- | drivers/media/platform/pxa_camera.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c index c12209c701d3..929006f65cc7 100644 --- a/drivers/media/platform/pxa_camera.c +++ b/drivers/media/platform/pxa_camera.c @@ -2125,17 +2125,22 @@ static int pxa_camera_sensor_bound(struct v4l2_async_notifier *notifier, pix->bytesperline, pix->height); pix->pixelformat = pcdev->current_fmt->host_fmt->fourcc; v4l2_fill_mbus_format(mf, pix, pcdev->current_fmt->code); - err = sensor_call(pcdev, pad, set_fmt, NULL, &format); + + err = sensor_call(pcdev, core, s_power, 1); if (err) goto out; + err = sensor_call(pcdev, pad, set_fmt, NULL, &format); + if (err) + goto out_sensor_poweroff; + v4l2_fill_pix_format(pix, mf); pr_info("%s(): colorspace=0x%x pixfmt=0x%x\n", __func__, pix->colorspace, pix->pixelformat); err = pxa_camera_init_videobuf2(pcdev); if (err) - goto out; + goto out_sensor_poweroff; err = video_register_device(&pcdev->vdev, VFL_TYPE_GRABBER, -1); if (err) { @@ -2146,6 +2151,9 @@ static int pxa_camera_sensor_bound(struct v4l2_async_notifier *notifier, "PXA Camera driver attached to camera %s\n", subdev->name); } + +out_sensor_poweroff: + err = sensor_call(pcdev, core, s_power, 0); out: mutex_unlock(&pcdev->mlock); return err; @@ -2347,8 +2355,7 @@ static int pxa_camera_probe(struct platform_device *pdev) * Platform hasn't set available data widths. This is bad. * Warn and use a default. */ - dev_warn(&pdev->dev, "WARNING! Platform hasn't set available " - "data widths, using default 10 bit\n"); + dev_warn(&pdev->dev, "WARNING! Platform hasn't set available data widths, using default 10 bit\n"); pcdev->platform_flags |= PXA_CAMERA_DATAWIDTH_10; } if (pcdev->platform_flags & PXA_CAMERA_DATAWIDTH_8) @@ -2359,8 +2366,7 @@ static int pxa_camera_probe(struct platform_device *pdev) pcdev->width_flags |= 1 << 9; if (!pcdev->mclk) { dev_warn(&pdev->dev, - "mclk == 0! Please, fix your platform data. " - "Using default 20MHz\n"); + "mclk == 0! Please, fix your platform data. Using default 20MHz\n"); pcdev->mclk = 20000000; } |