From patchwork Tue Sep 28 18:46:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 215662 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8SIrbjI032133 for ; Tue, 28 Sep 2010 18:53:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756860Ab0I1Sxf (ORCPT ); Tue, 28 Sep 2010 14:53:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31444 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755688Ab0I1Sxf (ORCPT ); Tue, 28 Sep 2010 14:53:35 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8SIrWxg001761 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 28 Sep 2010 14:53:32 -0400 Received: from pedra (vpn-224-71.phx2.redhat.com [10.3.224.71]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8SIlB5M025917 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 28 Sep 2010 14:53:30 -0400 Date: Tue, 28 Sep 2010 15:46:58 -0300 From: Mauro Carvalho Chehab To: Srinivasa.Deevi@conexant.com, Palash.Bandyopadhyay@conexant.com, dheitmueller@kernellabs.com, Linux Media Mailing List Subject: [PATCH 07/10] V4L/DVB: cx231xx: Only change gpio direction when needed Message-ID: <20100928154658.35941986@pedra> In-Reply-To: References: Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 28 Sep 2010 18:53:37 +0000 (UTC) diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c index 8e088db..28f77a7 100644 --- a/drivers/media/video/cx231xx/cx231xx-cards.c +++ b/drivers/media/video/cx231xx/cx231xx-cards.c @@ -495,10 +495,11 @@ void cx231xx_pre_card_setup(struct cx231xx *dev) if (dev->board.tuner_gpio) { cx231xx_set_gpio_direction(dev, dev->board.tuner_gpio->bit, 1); cx231xx_set_gpio_value(dev, dev->board.tuner_gpio->bit, 1); + } + if (dev->board.tuner_sif_gpio >= 0) cx231xx_set_gpio_direction(dev, dev->board.tuner_sif_gpio, 1); - /* request some modules if any required */ - } + /* request some modules if any required */ /* set the mode to Analog mode initially */ cx231xx_set_mode(dev, CX231XX_ANALOG_MODE); diff --git a/drivers/media/video/cx231xx/cx231xx.h b/drivers/media/video/cx231xx/cx231xx.h index b4859a0..d079433 100644 --- a/drivers/media/video/cx231xx/cx231xx.h +++ b/drivers/media/video/cx231xx/cx231xx.h @@ -333,9 +333,10 @@ struct cx231xx_board { struct cx231xx_reg_seq *dvb_gpio; struct cx231xx_reg_seq *suspend_gpio; struct cx231xx_reg_seq *tuner_gpio; - u8 tuner_sif_gpio; - u8 tuner_scl_gpio; - u8 tuner_sda_gpio; + /* Negative means don't use it */ + s8 tuner_sif_gpio; + s8 tuner_scl_gpio; + s8 tuner_sda_gpio; /* PIN ctrl */ u32 ctl_pin_status_mask;