diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-06-29 10:45:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-27 16:56:07 -0400 |
commit | 7254026cedd42d75009f8a7f2999045007dd444e (patch) | |
tree | 4167e24da9d71d9cd1402afd485a06cae0c00748 /drivers/media | |
parent | 2d12421dd39e39f9cacd9c7a58359c0f85823343 (diff) |
[media] V4L: pxa-camera: switch to using standard PM hooks
The pxa-camera driver doesn't need soc-camera specific PM callbacks,
switch it to using the standard PM hooks instead.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/pxa_camera.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index 0c1946fa46c2..020de529b955 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c | |||
@@ -1577,9 +1577,9 @@ static int pxa_camera_querycap(struct soc_camera_host *ici, | |||
1577 | return 0; | 1577 | return 0; |
1578 | } | 1578 | } |
1579 | 1579 | ||
1580 | static int pxa_camera_suspend(struct soc_camera_device *icd, pm_message_t state) | 1580 | static int pxa_camera_suspend(struct device *dev) |
1581 | { | 1581 | { |
1582 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 1582 | struct soc_camera_host *ici = to_soc_camera_host(dev); |
1583 | struct pxa_camera_dev *pcdev = ici->priv; | 1583 | struct pxa_camera_dev *pcdev = ici->priv; |
1584 | int i = 0, ret = 0; | 1584 | int i = 0, ret = 0; |
1585 | 1585 | ||
@@ -1590,7 +1590,7 @@ static int pxa_camera_suspend(struct soc_camera_device *icd, pm_message_t state) | |||
1590 | pcdev->save_cicr[i++] = __raw_readl(pcdev->base + CICR4); | 1590 | pcdev->save_cicr[i++] = __raw_readl(pcdev->base + CICR4); |
1591 | 1591 | ||
1592 | if (pcdev->icd) { | 1592 | if (pcdev->icd) { |
1593 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); | 1593 | struct v4l2_subdev *sd = soc_camera_to_subdev(pcdev->icd); |
1594 | ret = v4l2_subdev_call(sd, core, s_power, 0); | 1594 | ret = v4l2_subdev_call(sd, core, s_power, 0); |
1595 | if (ret == -ENOIOCTLCMD) | 1595 | if (ret == -ENOIOCTLCMD) |
1596 | ret = 0; | 1596 | ret = 0; |
@@ -1599,9 +1599,9 @@ static int pxa_camera_suspend(struct soc_camera_device *icd, pm_message_t state) | |||
1599 | return ret; | 1599 | return ret; |
1600 | } | 1600 | } |
1601 | 1601 | ||
1602 | static int pxa_camera_resume(struct soc_camera_device *icd) | 1602 | static int pxa_camera_resume(struct device *dev) |
1603 | { | 1603 | { |
1604 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 1604 | struct soc_camera_host *ici = to_soc_camera_host(dev); |
1605 | struct pxa_camera_dev *pcdev = ici->priv; | 1605 | struct pxa_camera_dev *pcdev = ici->priv; |
1606 | int i = 0, ret = 0; | 1606 | int i = 0, ret = 0; |
1607 | 1607 | ||
@@ -1616,7 +1616,7 @@ static int pxa_camera_resume(struct soc_camera_device *icd) | |||
1616 | __raw_writel(pcdev->save_cicr[i++], pcdev->base + CICR4); | 1616 | __raw_writel(pcdev->save_cicr[i++], pcdev->base + CICR4); |
1617 | 1617 | ||
1618 | if (pcdev->icd) { | 1618 | if (pcdev->icd) { |
1619 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); | 1619 | struct v4l2_subdev *sd = soc_camera_to_subdev(pcdev->icd); |
1620 | ret = v4l2_subdev_call(sd, core, s_power, 1); | 1620 | ret = v4l2_subdev_call(sd, core, s_power, 1); |
1621 | if (ret == -ENOIOCTLCMD) | 1621 | if (ret == -ENOIOCTLCMD) |
1622 | ret = 0; | 1622 | ret = 0; |
@@ -1633,8 +1633,6 @@ static struct soc_camera_host_ops pxa_soc_camera_host_ops = { | |||
1633 | .owner = THIS_MODULE, | 1633 | .owner = THIS_MODULE, |
1634 | .add = pxa_camera_add_device, | 1634 | .add = pxa_camera_add_device, |
1635 | .remove = pxa_camera_remove_device, | 1635 | .remove = pxa_camera_remove_device, |
1636 | .suspend = pxa_camera_suspend, | ||
1637 | .resume = pxa_camera_resume, | ||
1638 | .set_crop = pxa_camera_set_crop, | 1636 | .set_crop = pxa_camera_set_crop, |
1639 | .get_formats = pxa_camera_get_formats, | 1637 | .get_formats = pxa_camera_get_formats, |
1640 | .put_formats = pxa_camera_put_formats, | 1638 | .put_formats = pxa_camera_put_formats, |
@@ -1819,9 +1817,15 @@ static int __devexit pxa_camera_remove(struct platform_device *pdev) | |||
1819 | return 0; | 1817 | return 0; |
1820 | } | 1818 | } |
1821 | 1819 | ||
1820 | static struct dev_pm_ops pxa_camera_pm = { | ||
1821 | .suspend = pxa_camera_suspend, | ||
1822 | .resume = pxa_camera_resume, | ||
1823 | }; | ||
1824 | |||
1822 | static struct platform_driver pxa_camera_driver = { | 1825 | static struct platform_driver pxa_camera_driver = { |
1823 | .driver = { | 1826 | .driver = { |
1824 | .name = PXA_CAM_DRV_NAME, | 1827 | .name = PXA_CAM_DRV_NAME, |
1828 | .pm = &pxa_camera_pm, | ||
1825 | }, | 1829 | }, |
1826 | .probe = pxa_camera_probe, | 1830 | .probe = pxa_camera_probe, |
1827 | .remove = __devexit_p(pxa_camera_remove), | 1831 | .remove = __devexit_p(pxa_camera_remove), |