From patchwork Tue Jun 11 08:23:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2700991 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 A60D5DF23A for ; Tue, 11 Jun 2013 09:58:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753403Ab3FKJ6I (ORCPT ); Tue, 11 Jun 2013 05:58:08 -0400 Received: from moutng.kundenserver.de ([212.227.126.187]:61261 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752857Ab3FKJ6G (ORCPT ); Tue, 11 Jun 2013 05:58:06 -0400 Received: from axis700.grange (dslb-178-001-148-081.pools.arcor-ip.net [178.1.148.81]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MBG3l-1Ucffl1BGX-00Aq3B; Tue, 11 Jun 2013 11:27:57 +0200 Received: from 6a.grange (unknown [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 9E9EF40BB5; Tue, 11 Jun 2013 10:24:04 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1UmJs4-0002BI-9Q; 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 03/21] pxa-camera: move interface activation and deactivation to clock callbacks Date: Tue, 11 Jun 2013 10:23:30 +0200 Message-Id: <1370939028-8352-4-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:ck1etcIJsW5fBZ3jGcFVdTbPJKu+7uOs+CvnvGNdhN6 1qBAOLoqfkdPX+KMBmQ5a+dD6ORHFjMP4qYg7Kg6GwPHt6fE+z nTnpkeUUrKYr7K8LOw3gOItK6nciP0ilKf5HurTE6qKSjP1byN Fhce9egW8xyjww1llzPBcooou+KugPvFMfisdsHJjJQYeeot5g gQYMxRYTjqhEUCFBAVUaA3PkRIETmtPVXwXVqywOFEiNYwRUKe 1OZEEBIXaSXITkm1Zv/wEfJlX4uM7CqEpeETdBPStpm/iCExaO HuIjVn63no+tGwi7MLLnzAg5YJjrzcZUJ74sPDb5weNhYsYcZh wd3O53lLlMfp1DxKnZEgjnFv4EcqewFq54KsLgs4wG2Q92zxpg Nt5KS9di5++pg== 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 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,