From patchwork Fri Apr 12 15:40:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2436551 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 95F03DFF66 for ; Fri, 12 Apr 2013 15:41:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754631Ab3DLPla (ORCPT ); Fri, 12 Apr 2013 11:41:30 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:49736 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754373Ab3DLPkt (ORCPT ); Fri, 12 Apr 2013 11:40:49 -0400 Received: from axis700.grange (dslb-088-076-023-104.pools.arcor-ip.net [88.76.23.104]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0Lbqzs-1UsHbK3B2K-00jIeT; Fri, 12 Apr 2013 17:40:43 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id A9E9E40BB6; Fri, 12 Apr 2013 17:40:41 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1UQg5h-0004Dc-Eb; Fri, 12 Apr 2013 17:40:41 +0200 From: Guennadi Liakhovetski To: linux-media@vger.kernel.org Cc: Sylwester Nawrocki , Laurent Pinchart , Hans Verkuil , linux-sh@vger.kernel.org, Magnus Damm , Sakari Ailus , Prabhakar Lad Subject: [PATCH v9 09/20] mx2-camera: move interface activation and deactivation to clock callbacks Date: Fri, 12 Apr 2013 17:40:29 +0200 Message-Id: <1365781240-16149-10-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1365781240-16149-1-git-send-email-g.liakhovetski@gmx.de> References: <1365781240-16149-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:Gii8fxcH/PF1ejdC78pO+LxDqeGfECHAPAGfBZotTGK z1JpKwXYXf1Ci8AZ7TQ2YC0G+V91CrW9OIQVfKOTLBAK8QC0g/ P+tyEjRyLYrl+XA3gbsmWGE1PyjTCQA8iUbrLbn0pIcc51jZ2d BrTBwJaJj2+b9VMJvphFiqmdf1DJRDLGvii4Hmag34pMXoL58S 03lC9lHXWq8lHXPFjh+Lk7ok25pvz3kBDGBpNJUM3Ji8j63403 q4z77OdV61TbVrGF/3948XVotSNZ7eJ1p6Cbl+/OKmV+H+F7wh ufF2ccL5cA/8SYgdUdVCi/I3zv0WL80bh20Tw/Cpap9I/Og6zM qocwex21nhEFFxw4n+j9BhUSGOL44USDaT6XTjs/RMzekyGogf jbi27a3CSD2IQ== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org When adding and removing a client, the mx2-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 --- drivers/media/platform/soc_camera/mx2_camera.c | 28 +++++++++++++++-------- 1 files changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c index 772e071..45a0276 100644 --- a/drivers/media/platform/soc_camera/mx2_camera.c +++ b/drivers/media/platform/soc_camera/mx2_camera.c @@ -412,13 +412,26 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev) writel(0, pcdev->base_emma + PRP_CNTL); } +static int mx2_camera_add_device(struct soc_camera_device *icd) +{ + dev_info(icd->parent, "Camera driver attached to camera %d\n", + icd->devnum); + + return 0; +} + +static void mx2_camera_remove_device(struct soc_camera_device *icd) +{ + dev_info(icd->parent, "Camera driver detached from camera %d\n", + icd->devnum); +} + /* * The following two functions absolutely depend on the fact, that * there can be only one camera on mx2 camera sensor interface */ -static int mx2_camera_add_device(struct soc_camera_device *icd) +static int mx2_camera_clock_start(struct soc_camera_host *ici) { - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); struct mx2_camera_dev *pcdev = ici->priv; int ret; u32 csicr1; @@ -439,9 +452,6 @@ static int mx2_camera_add_device(struct soc_camera_device *icd) pcdev->frame_count = 0; - dev_info(icd->parent, "Camera driver attached to camera %d\n", - icd->devnum); - return 0; exit_csi_ahb: @@ -450,14 +460,10 @@ exit_csi_ahb: return ret; } -static void mx2_camera_remove_device(struct soc_camera_device *icd) +static void mx2_camera_clock_stop(struct soc_camera_host *ici) { - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); struct mx2_camera_dev *pcdev = ici->priv; - dev_info(icd->parent, "Camera driver detached from camera %d\n", - icd->devnum); - mx2_camera_deactivate(pcdev); } @@ -1271,6 +1277,8 @@ static struct soc_camera_host_ops mx2_soc_camera_host_ops = { .owner = THIS_MODULE, .add = mx2_camera_add_device, .remove = mx2_camera_remove_device, + .clock_start = mx2_camera_clock_start, + .clock_stop = mx2_camera_clock_stop, .set_fmt = mx2_camera_set_fmt, .set_crop = mx2_camera_set_crop, .get_formats = mx2_camera_get_formats,