From patchwork Fri Jun 14 19:08:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2723081 Return-Path: X-Original-To: patchwork-linux-sh@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 30EC1C0AB1 for ; Fri, 14 Jun 2013 19:08:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4EFF320368 for ; Fri, 14 Jun 2013 19:08:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E8E420367 for ; Fri, 14 Jun 2013 19:08:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753285Ab3FNTIx (ORCPT ); Fri, 14 Jun 2013 15:08:53 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:54972 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752931Ab3FNTIw (ORCPT ); Fri, 14 Jun 2013 15:08:52 -0400 Received: from axis700.grange (dslb-188-109-039-013.pools.arcor-ip.net [188.109.39.13]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MHri9-1UmBut0HBV-004Ewh; Fri, 14 Jun 2013 21:08:46 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 8D64B40BB6; Fri, 14 Jun 2013 21:08:45 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1UnZMb-0003wd-92; 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 03/21] pxa-camera: move interface activation and deactivation to clock callbacks Date: Fri, 14 Jun 2013 21:08:13 +0200 Message-Id: <1371236911-15131-4-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:9enmtFnBFwjX4jMR78RCFzjgN4aQm4EUpnYB4moBLwT aJGvCLkhxSqP4pZPMxglel1ZW/m0c6U7xu5U0kWbzyo//7o2Ub YGb6DgLLJ6o9rYm2QM+YJ5cWmkkegn3s6xe/dLy/VPEdvvEGGq QYUjSCYHnC7W/2vN0qqfq0RQJY5U19dOmppElRySUtES9PK3fE 7fCHs0/TciKTo17p5HV5WDpDxHGkSII5VN19a2BgJKbfqSzNoA MbUWJAMTqKBXjdWbgH9KerkCzxe1BkI0UU0N33alP0XJw+iS9z UKLS0gnk+DFETbgB8PsBFQGpg8QsDtY4pWOPCbdlHjY1pZgmYK u1Iimoce7QWt4p13cSOri+erNRVIsuNVNxf5GRxG/c+Lkx2BsL 0VqIb7hli8KPg== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@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=ham 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 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 --- drivers/media/platform/soc_camera/pxa_camera.c | 28 +++++++++++++++-------- 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 686edf7..d4df305 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) return IRQ_HANDLED; } +static int pxa_camera_add_device(struct soc_camera_device *icd) +{ + dev_info(icd->parent, "PXA Camera driver attached to camera %d\n", + icd->devnum); + + return 0; +} + +static void pxa_camera_remove_device(struct soc_camera_device *icd) +{ + dev_info(icd->parent, "PXA 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 PXA quick capture interface * Called with .host_lock held */ -static int pxa_camera_add_device(struct soc_camera_device *icd) +static int pxa_camera_clock_start(struct soc_camera_host *ici) { - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); struct pxa_camera_dev *pcdev = ici->priv; pxa_camera_activate(pcdev); - dev_info(icd->parent, "PXA Camera driver attached to camera %d\n", - icd->devnum); - return 0; } /* Called with .host_lock held */ -static void pxa_camera_remove_device(struct soc_camera_device *icd) +static void pxa_camera_clock_stop(struct soc_camera_host *ici) { - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); struct pxa_camera_dev *pcdev = ici->priv; - dev_info(icd->parent, "PXA Camera driver detached from camera %d\n", - icd->devnum); - /* disable capture, disable interrupts */ __raw_writel(0x3ff, pcdev->base + CICR0); @@ -1630,6 +1636,8 @@ static struct soc_camera_host_ops pxa_soc_camera_host_ops = { .owner = THIS_MODULE, .add = pxa_camera_add_device, .remove = pxa_camera_remove_device, + .clock_start = pxa_camera_clock_start, + .clock_stop = pxa_camera_clock_stop, .set_crop = pxa_camera_set_crop, .get_formats = pxa_camera_get_formats, .put_formats = pxa_camera_put_formats,