diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2013-04-04 08:56:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-06-21 14:44:23 -0400 |
commit | ffebad7948ee0e9c619ae6e87d99437d907fc7e3 (patch) | |
tree | 6db7bcc490936282192fde46ea452aa8c661f2b1 /drivers/media | |
parent | b5dbfe46e40fa3fd9a6dd43f20cc71050fe5ef2d (diff) |
[media] atmel-isi: move interface activation and deactivation to clock callbacks
When adding and removing a client, the atmel-isi camera host 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/atmel-isi.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c index c9e080a57a60..104485632501 100644 --- a/drivers/media/platform/soc_camera/atmel-isi.c +++ b/drivers/media/platform/soc_camera/atmel-isi.c | |||
@@ -745,10 +745,23 @@ static int isi_camera_get_formats(struct soc_camera_device *icd, | |||
745 | return formats; | 745 | return formats; |
746 | } | 746 | } |
747 | 747 | ||
748 | /* Called with .host_lock held */ | ||
749 | static int isi_camera_add_device(struct soc_camera_device *icd) | 748 | static int isi_camera_add_device(struct soc_camera_device *icd) |
750 | { | 749 | { |
751 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); | 750 | dev_dbg(icd->parent, "Atmel ISI Camera driver attached to camera %d\n", |
751 | icd->devnum); | ||
752 | |||
753 | return 0; | ||
754 | } | ||
755 | |||
756 | static void isi_camera_remove_device(struct soc_camera_device *icd) | ||
757 | { | ||
758 | dev_dbg(icd->parent, "Atmel ISI Camera driver detached from camera %d\n", | ||
759 | icd->devnum); | ||
760 | } | ||
761 | |||
762 | /* Called with .host_lock held */ | ||
763 | static int isi_camera_clock_start(struct soc_camera_host *ici) | ||
764 | { | ||
752 | struct atmel_isi *isi = ici->priv; | 765 | struct atmel_isi *isi = ici->priv; |
753 | int ret; | 766 | int ret; |
754 | 767 | ||
@@ -762,21 +775,16 @@ static int isi_camera_add_device(struct soc_camera_device *icd) | |||
762 | return ret; | 775 | return ret; |
763 | } | 776 | } |
764 | 777 | ||
765 | dev_dbg(icd->parent, "Atmel ISI Camera driver attached to camera %d\n", | ||
766 | icd->devnum); | ||
767 | return 0; | 778 | return 0; |
768 | } | 779 | } |
780 | |||
769 | /* Called with .host_lock held */ | 781 | /* Called with .host_lock held */ |
770 | static void isi_camera_remove_device(struct soc_camera_device *icd) | 782 | static void isi_camera_clock_stop(struct soc_camera_host *ici) |
771 | { | 783 | { |
772 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); | ||
773 | struct atmel_isi *isi = ici->priv; | 784 | struct atmel_isi *isi = ici->priv; |
774 | 785 | ||
775 | clk_disable(isi->mck); | 786 | clk_disable(isi->mck); |
776 | clk_disable(isi->pclk); | 787 | clk_disable(isi->pclk); |
777 | |||
778 | dev_dbg(icd->parent, "Atmel ISI Camera driver detached from camera %d\n", | ||
779 | icd->devnum); | ||
780 | } | 788 | } |
781 | 789 | ||
782 | static unsigned int isi_camera_poll(struct file *file, poll_table *pt) | 790 | static unsigned int isi_camera_poll(struct file *file, poll_table *pt) |
@@ -880,6 +888,8 @@ static struct soc_camera_host_ops isi_soc_camera_host_ops = { | |||
880 | .owner = THIS_MODULE, | 888 | .owner = THIS_MODULE, |
881 | .add = isi_camera_add_device, | 889 | .add = isi_camera_add_device, |
882 | .remove = isi_camera_remove_device, | 890 | .remove = isi_camera_remove_device, |
891 | .clock_start = isi_camera_clock_start, | ||
892 | .clock_stop = isi_camera_clock_stop, | ||
883 | .set_fmt = isi_camera_set_fmt, | 893 | .set_fmt = isi_camera_set_fmt, |
884 | .try_fmt = isi_camera_try_fmt, | 894 | .try_fmt = isi_camera_try_fmt, |
885 | .get_formats = isi_camera_get_formats, | 895 | .get_formats = isi_camera_get_formats, |