From patchwork Sun May 23 18:29:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Ringel X-Patchwork-Id: 101755 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4NIVHSQ016415 for ; Sun, 23 May 2010 18:31:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754966Ab0EWSbQ (ORCPT ); Sun, 23 May 2010 14:31:16 -0400 Received: from mail-in-16.arcor-online.net ([151.189.21.56]:51786 "EHLO mail-in-16.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754939Ab0EWSbO (ORCPT ); Sun, 23 May 2010 14:31:14 -0400 Received: from mail-in-15-z2.arcor-online.net (mail-in-15-z2.arcor-online.net [151.189.8.32]) by mx.arcor.de (Postfix) with ESMTP id 4566284BB; Sun, 23 May 2010 20:31:13 +0200 (CEST) Received: from mail-in-17.arcor-online.net (mail-in-17.arcor-online.net [151.189.21.57]) by mail-in-15-z2.arcor-online.net (Postfix) with ESMTP id 33D0833E3A5; Sun, 23 May 2010 20:31:13 +0200 (CEST) Received: from localhost.localdomain (unknown [188.106.95.190]) (Authenticated sender: stefan.ringel@arcor.de) by mail-in-17.arcor-online.net (Postfix) with ESMTPA id A8AA5CBEEF; Sun, 23 May 2010 20:31:12 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-17.arcor-online.net A8AA5CBEEF DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1274639473; bh=Q7dph6k/ahOHudqDe4RH0OB/wjS69kgKn2Oogam4Scc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=igHam5njEIbuE27gACkn/Hj50iFSvRRBXFfB9Ar2o3cFNbAz+HhnsokV3gBf7ENdK Fngt28btsRG9mQY77AZXct8lvmbN8scXdl+3+9oEUKl1Tf1JunvK5h1anoGrcq2zO8 w9efIBzfGJwB1wD6KVwDH20e3KjYNrO23BupRQAQ= From: stefan.ringel@arcor.de To: linux-media@vger.kernel.org Cc: mchehab@redhat.com, d.belimov@gmail.com, Stefan Ringel Subject: [PATCH 2/5] tm6000: add power led off Date: Sun, 23 May 2010 20:29:25 +0200 Message-Id: <1274639366-2613-2-git-send-email-stefan.ringel@arcor.de> X-Mailer: git-send-email 1.7.0.3 In-Reply-To: <1274639366-2613-1-git-send-email-stefan.ringel@arcor.de> References: <1274639366-2613-1-git-send-email-stefan.ringel@arcor.de> 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 (demeter.kernel.org [140.211.167.41]); Sun, 23 May 2010 18:31:17 +0000 (UTC) diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c index 33b134b..553ebe4 100644 --- a/drivers/staging/tm6000/tm6000-cards.c +++ b/drivers/staging/tm6000/tm6000-cards.c @@ -925,6 +925,25 @@ static void tm6000_usb_disconnect(struct usb_interface *interface) } #endif + if (dev->gpio.power_led) { + switch (dev->model) { + case TM6010_BOARD_HAUPPAUGE_900H: + case TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE: + case TM6010_BOARD_TWINHAN_TU501: + /* Power led off */ + tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, + dev->gpio.power_led, 0x01); + msleep(15); + break; + case TM6010_BOARD_BEHOLD_WANDER: + case TM6010_BOARD_BEHOLD_VOYAGER: + /* Power led off */ + tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, + dev->gpio.power_led, 0x00); + msleep(15); + break; + } + } tm6000_v4l2_unregister(dev); tm6000_i2c_unregister(dev); diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c index 1259ae5..624c276 100644 --- a/drivers/staging/tm6000/tm6000-core.c +++ b/drivers/staging/tm6000/tm6000-core.c @@ -323,6 +323,12 @@ int tm6000_init_analog_mode (struct tm6000_core *dev) tm6000_set_standard (dev, &dev->norm); tm6000_set_audio_bitrate (dev,48000); + /* switch dvb led off */ + if (dev->gpio.dvb_led) { + tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, + dev->gpio.dvb_led, 0x01); + } + return 0; } @@ -375,6 +381,13 @@ int tm6000_init_digital_mode (struct tm6000_core *dev) tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00); msleep(100); } + + /* switch dvb led on */ + if (dev->gpio.dvb_led) { + tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, + dev->gpio.dvb_led, 0x00); + } + return 0; }