From patchwork Fri Jun 14 19:08:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2723131 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6CEEBC0AB2 for ; Fri, 14 Jun 2013 19:09:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 79CA420368 for ; Fri, 14 Jun 2013 19:09:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86C0B2036A for ; Fri, 14 Jun 2013 19:09:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753497Ab3FNTI7 (ORCPT ); Fri, 14 Jun 2013 15:08:59 -0400 Received: from moutng.kundenserver.de ([212.227.126.187]:61027 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752931Ab3FNTI6 (ORCPT ); Fri, 14 Jun 2013 15:08:58 -0400 Received: from axis700.grange (dslb-188-109-039-013.pools.arcor-ip.net [188.109.39.13]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0LyUFS-1UJNLk10nW-015Ezb; Fri, 14 Jun 2013 21:08:47 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id A0CD440BB8; Fri, 14 Jun 2013 21:08:45 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1UnZMb-0003wj-EC; Fri, 14 Jun 2013 21:08:45 +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 v11 05/21] atmel-isi: move interface activation and deactivation to clock callbacks Date: Fri, 14 Jun 2013 21:08:15 +0200 Message-Id: <1371236911-15131-6-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1371236911-15131-1-git-send-email-g.liakhovetski@gmx.de> References: <1371236911-15131-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:h+3k0SzyQ6gBLWl+qrgQVcWKcBK5b2UGl/rjC5alb0L mcVdMVfs/wkCijW6c6Tn8L9VkPDpb0HhB+Mn7qgbl+2RAW6Pj9 c26v4qzM5uKM79tBNVMqU831Hl+3hR1v/by6KtIX+IrZpHzQWS TQkczLjim1b0pZimVbf2NQt6GmsxzR4/pavBlikD65V36tkhhk Oyjrr5XgYflodXjGFRUDWk0W6SydTsZVdv+ISO8F5LOCu+26Ce dnpNFuj+5DmSE1TJdo+ybQbcJA2L9nvo185GGfds6xFbun1hyW jd8lne3oJKxBsVwdjoRA2Krr5Lk1Gyd6rwfmomkZdgrsNqCS11 CvSMppFi4B9XutZ1eM2Va0LDUNmXa82MS1F0wE9LI4rtJQcJ9d 7g9lp6hRhLQjg== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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,