aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-04-04 07:56:00 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-21 14:36:21 -0400
commit39b553dbb4a75debf814a261e58f09347eef337f (patch)
tree70687337535bf04ebf650fbe4227f28ee89d0650 /drivers/media
parenteb569cf9db804e6ba34b3a1812415e59d5e43d1a (diff)
[media] pxa-camera: move interface activation and deactivation to clock callbacks
When adding and removing a client, the pxa-camera driver only activates and deactivates its camera interface respectively, which doesn't include any client-specific actions. Move this functionality into .clock_start() and .clock_stop() callbacks. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/soc_camera/pxa_camera.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c
index 686edf7c016c..d4df305fcc18 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -955,33 +955,39 @@ static irqreturn_t pxa_camera_irq(int irq, void *data)
955 return IRQ_HANDLED; 955 return IRQ_HANDLED;
956} 956}
957 957
958static int pxa_camera_add_device(struct soc_camera_device *icd)
959{
960 dev_info(icd->parent, "PXA Camera driver attached to camera %d\n",
961 icd->devnum);
962
963 return 0;
964}
965
966static void pxa_camera_remove_device(struct soc_camera_device *icd)
967{
968 dev_info(icd->parent, "PXA Camera driver detached from camera %d\n",
969 icd->devnum);
970}
971
958/* 972/*
959 * The following two functions absolutely depend on the fact, that 973 * The following two functions absolutely depend on the fact, that
960 * there can be only one camera on PXA quick capture interface 974 * there can be only one camera on PXA quick capture interface
961 * Called with .host_lock held 975 * Called with .host_lock held
962 */ 976 */
963static int pxa_camera_add_device(struct soc_camera_device *icd) 977static int pxa_camera_clock_start(struct soc_camera_host *ici)
964{ 978{
965 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
966 struct pxa_camera_dev *pcdev = ici->priv; 979 struct pxa_camera_dev *pcdev = ici->priv;
967 980
968 pxa_camera_activate(pcdev); 981 pxa_camera_activate(pcdev);
969 982
970 dev_info(icd->parent, "PXA Camera driver attached to camera %d\n",
971 icd->devnum);
972
973 return 0; 983 return 0;
974} 984}
975 985
976/* Called with .host_lock held */ 986/* Called with .host_lock held */
977static void pxa_camera_remove_device(struct soc_camera_device *icd) 987static void pxa_camera_clock_stop(struct soc_camera_host *ici)
978{ 988{
979 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
980 struct pxa_camera_dev *pcdev = ici->priv; 989 struct pxa_camera_dev *pcdev = ici->priv;
981 990
982 dev_info(icd->parent, "PXA Camera driver detached from camera %d\n",
983 icd->devnum);
984
985 /* disable capture, disable interrupts */ 991 /* disable capture, disable interrupts */
986 __raw_writel(0x3ff, pcdev->base + CICR0); 992 __raw_writel(0x3ff, pcdev->base + CICR0);
987 993
@@ -1630,6 +1636,8 @@ static struct soc_camera_host_ops pxa_soc_camera_host_ops = {
1630 .owner = THIS_MODULE, 1636 .owner = THIS_MODULE,
1631 .add = pxa_camera_add_device, 1637 .add = pxa_camera_add_device,
1632 .remove = pxa_camera_remove_device, 1638 .remove = pxa_camera_remove_device,
1639 .clock_start = pxa_camera_clock_start,
1640 .clock_stop = pxa_camera_clock_stop,
1633 .set_crop = pxa_camera_set_crop, 1641 .set_crop = pxa_camera_set_crop,
1634 .get_formats = pxa_camera_get_formats, 1642 .get_formats = pxa_camera_get_formats,
1635 .put_formats = pxa_camera_put_formats, 1643 .put_formats = pxa_camera_put_formats,