From patchwork Tue Jun 11 08:23:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2701131 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 669B740077 for ; Tue, 11 Jun 2013 10:01:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754078Ab3FKKBD (ORCPT ); Tue, 11 Jun 2013 06:01:03 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:53322 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753646Ab3FKKBB (ORCPT ); Tue, 11 Jun 2013 06:01:01 -0400 Received: from axis700.grange (dslb-178-001-148-081.pools.arcor-ip.net [178.1.148.81]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MTvSD-1UvIzE1bqz-00RHwo; Tue, 11 Jun 2013 11:30:38 +0200 Received: from 6a.grange (unknown [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id EB8D740BC5; Tue, 11 Jun 2013 10:24:04 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1UmJs4-0002BO-Da; Tue, 11 Jun 2013 10:24:04 +0200 From: Guennadi Liakhovetski To: linux-media@vger.kernel.org Cc: Laurent Pinchart , Sylwester Nawrocki , Hans Verkuil , linux-sh@vger.kernel.org, Magnus Damm , Sakari Ailus , Prabhakar Lad , Sascha Hauer , Guennadi Liakhovetski Subject: [PATCH v10 05/21] atmel-isi: move interface activation and deactivation to clock callbacks Date: Tue, 11 Jun 2013 10:23:32 +0200 Message-Id: <1370939028-8352-6-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1370939028-8352-1-git-send-email-g.liakhovetski@gmx.de> References: <1370939028-8352-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:SINorBr2UL/7IzDiajZnljxvO/5GLuUXXBX7cj4um8Q QhRUwEgImUeW3Db1bLlZRgysm74BpeoSWM76adAGqw+v8roGqw x1GA72c1mZ3upg3OSUSh4ynIQOnSmQsMpwwTki+ZspSTsyxtsr oRflj515XlQxGwhairH5WAO9KdDl3hQRFD+G2QlGGCXJGrbCxK izq50vQDgP9Q0i28Voem+4PQhq2uCjpHuA3gAqclTjMCSqtF// +0+7anrhT9+RfYi7uRPl+a9Dyj/tN3kLCa+q7KRpo1mG6pOjXu VtOBcX7Z/jCJIZImBjjk73jj3SEqoxjuxTMYxG3iPrghcXdPUA MH4wlkPV9UXjmgX6AV0KdmV1SOEwrZrNA3AAHFTgoitxAM8vs/ KnPAOWGNQT6kw== 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 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 --- 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 c9e080a..1044856 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, return formats; } -/* Called with .host_lock held */ static int isi_camera_add_device(struct soc_camera_device *icd) { - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); + dev_dbg(icd->parent, "Atmel ISI Camera driver attached to camera %d\n", + icd->devnum); + + return 0; +} + +static void isi_camera_remove_device(struct soc_camera_device *icd) +{ + dev_dbg(icd->parent, "Atmel ISI Camera driver detached from camera %d\n", + icd->devnum); +} + +/* Called with .host_lock held */ +static int isi_camera_clock_start(struct soc_camera_host *ici) +{ struct atmel_isi *isi = ici->priv; int ret; @@ -762,21 +775,16 @@ static int isi_camera_add_device(struct soc_camera_device *icd) return ret; } - dev_dbg(icd->parent, "Atmel ISI Camera driver attached to camera %d\n", - icd->devnum); return 0; } + /* Called with .host_lock held */ -static void isi_camera_remove_device(struct soc_camera_device *icd) +static void isi_camera_clock_stop(struct soc_camera_host *ici) { - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); struct atmel_isi *isi = ici->priv; clk_disable(isi->mck); clk_disable(isi->pclk); - - dev_dbg(icd->parent, "Atmel ISI Camera driver detached from camera %d\n", - icd->devnum); } 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 = { .owner = THIS_MODULE, .add = isi_camera_add_device, .remove = isi_camera_remove_device, + .clock_start = isi_camera_clock_start, + .clock_stop = isi_camera_clock_stop, .set_fmt = isi_camera_set_fmt, .try_fmt = isi_camera_try_fmt, .get_formats = isi_camera_get_formats,