From patchwork Mon Oct 21 09:28:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 3076401 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C221C9F2B8 for ; Mon, 21 Oct 2013 09:28:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A2C692035D for ; Mon, 21 Oct 2013 09:28:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8137020318 for ; Mon, 21 Oct 2013 09:28:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755040Ab3JUJ2h (ORCPT ); Mon, 21 Oct 2013 05:28:37 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:52362 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755094Ab3JUJ2I (ORCPT ); Mon, 21 Oct 2013 05:28:08 -0400 Received: from axis700.grange (dslb-088-076-026-183.pools.arcor-ip.net [88.76.26.183]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0MRNdb-1V9cds0Kjv-00UeN4; Mon, 21 Oct 2013 11:28:07 +0200 Received: by axis700.grange (Postfix, from userid 1000) id BBF5B40BB4; Mon, 21 Oct 2013 11:28:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id B9AA840BB3; Mon, 21 Oct 2013 11:28:06 +0200 (CEST) Date: Mon, 21 Oct 2013 11:28:06 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: Linux Media Mailing List cc: =?ISO-8859-15?Q?Frank_Sch=E4fer?= , Laurent Pinchart , Sylwester Nawrocki Subject: [PATCH/RFC 2/2] V4L2: em28xx: tell the ov2640 driver to balance clock enabling internally In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:ibgrFC/Ni3GgXNQmVNkdcDA/CQPNZH1zHmoPR4d1iWQ nTjOo8bmlQk5NeamD6leHTGWR7lq5f4bzhgYpcEEZNiuK+e9AO awSM6N8X1HnTYhANX2mr326rkWHtnVl4S+pdR+PhBS6zloyxt+ ydftoB90dhtBX1VJ7rC6pk3PbTubl4gg8h+0TrCL1DT2gGzu/z /QVnS1ys0Sq1xFV6WSdl8M4PgiarwmbVGhwE7nztTYPe94Cpil iPzDsp0qGvI4V45Tzto0D8M/HVrBFYUs0zL3WRBsgOL9OviPQ3 8oVPSVAbLEU9Gtj3dhfC9J1RXR1IQa45a5u2PN6dwGhxEqdVMN SemVU3pNs/a4/tAb4UkOUdwTZvo3eeM/tKRPDuRy/VHOs/hSvC geN4I9i8CxDsw== 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.3 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 The em28xx driver only calls subdevices' .s_power() method to power them down, relying on the hardware to wake up automatically, which is usually the case with tuners. This was acceptable with the old .standby() method, but is wrong with .s_power(). Fixing the driver would be difficult due to a broad supported hardware base. Instead this patch makes use of the unbalanced_power soc-camera subdevice flag to tell the ov2640 driver to balance calls to v4l2_clk_enable() and v4l2_clk_disable() internally. Signed-off-by: Guennadi Liakhovetski --- drivers/media/usb/em28xx/em28xx-camera.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index 73cc50a..f30043e 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c @@ -47,6 +47,7 @@ static struct soc_camera_link camlink = { .bus_id = 0, .flags = 0, .module_name = "em28xx", + .unbalanced_power = true, };