From patchwork Mon May 9 19:53:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Ringel X-Patchwork-Id: 770732 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p49JsYF7021288 for ; Mon, 9 May 2011 19:54:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754610Ab1EITya (ORCPT ); Mon, 9 May 2011 15:54:30 -0400 Received: from mail-in-06.arcor-online.net ([151.189.21.46]:43720 "EHLO mail-in-06.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751726Ab1EITyP (ORCPT ); Mon, 9 May 2011 15:54:15 -0400 Received: from mail-in-01-z2.arcor-online.net (mail-in-01-z2.arcor-online.net [151.189.8.13]) by mx.arcor.de (Postfix) with ESMTP id ED00010C153; Mon, 9 May 2011 21:54:13 +0200 (CEST) Received: from mail-in-14.arcor-online.net (mail-in-14.arcor-online.net [151.189.21.54]) by mail-in-01-z2.arcor-online.net (Postfix) with ESMTP id DF5D315B543; Mon, 9 May 2011 21:54:13 +0200 (CEST) Received: from localhost.localdomain (dslb-178-000-053-073.pools.arcor-ip.net [178.0.53.73]) (Authenticated sender: stefan.ringel@arcor.de) by mail-in-14.arcor-online.net (Postfix) with ESMTPA id 863D59C600; Mon, 9 May 2011 21:54:13 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-14.arcor-online.net 863D59C600 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1304970853; bh=kYIJevGkuvSR/Owrcqg0+x4ipf54aXKfy67/UkQTIqs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=mFSyOXMux7H3vKE+0nxCysj+e3CggB7is9mOo3eF6r8Hmww3v35hSYekYgtR/fEDM 1CXBq6wNaP23LLwQDoFJdp92AUr11SkNXk9NmVc5U5ddcc3SpMmkkPheuBOc9zIEaH XeUmns1a/i9+vU3y2FOHzGWx1S+xO2Qx9UrVad0A= From: stefan.ringel@arcor.de To: linux-media@vger.kernel.org Cc: mchehab@redhat.com, d.belimov@gmail.com, Stefan Ringel Subject: [PATCH 10/16] tm6000: move from tm6000_set_reg to tm6000_set_reg_mask Date: Mon, 9 May 2011 21:53:58 +0200 Message-Id: <1304970844-20955-10-git-send-email-stefan.ringel@arcor.de> X-Mailer: git-send-email 1.7.4.2 In-Reply-To: <1304970844-20955-1-git-send-email-stefan.ringel@arcor.de> References: <1304970844-20955-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.6 (demeter2.kernel.org [140.211.167.43]); Mon, 09 May 2011 19:54:34 +0000 (UTC) From: Stefan Ringel move from tm6000_set_reg to tm6000_set_reg_mask Signed-off-by: Stefan Ringel --- drivers/staging/tm6000/tm6000-core.c | 26 ++++++++++---------------- 1 files changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c index 259cf80..1ac8409 100644 --- a/drivers/staging/tm6000/tm6000-core.c +++ b/drivers/staging/tm6000/tm6000-core.c @@ -268,19 +268,18 @@ int tm6000_init_analog_mode(struct tm6000_core *dev) struct v4l2_frequency f; if (dev->dev_type == TM6010) { - /* Enable video */ - + /* Enable video and audio */ tm6000_set_reg_mask(dev, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, 0x60, 0x60); + /* Disable TS input */ tm6000_set_reg_mask(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x00, 0x40); - tm6000_set_reg(dev, TM6010_REQ08_RF1_AADC_POWER_DOWN, 0xfc); - } else { /* Enables soft reset */ tm6000_set_reg(dev, TM6010_REQ07_R3F_RESET, 0x01); if (dev->scaler) + /* Disable Hfilter and Enable TS Drop err */ tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x20); else /* Enable Hfilter and disable TS Drop err */ tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x80); @@ -343,21 +342,16 @@ int tm6000_init_analog_mode(struct tm6000_core *dev) int tm6000_init_digital_mode(struct tm6000_core *dev) { if (dev->dev_type == TM6010) { - int val; - u8 buf[2]; - - /* digital init */ - val = tm6000_get_reg(dev, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, 0); - val &= ~0x60; - tm6000_set_reg(dev, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, val); - val = tm6000_get_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0); - val |= 0x40; - tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, val); + /* Disable video and audio */ + tm6000_set_reg_mask(dev, TM6010_REQ07_RCC_ACTIVE_VIDEO_IF, + 0x00, 0x60); + /* Enable TS input */ + tm6000_set_reg_mask(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, + 0x40, 0x40); + /* all power down, but not the digital data port */ tm6000_set_reg(dev, TM6010_REQ07_RFE_POWER_DOWN, 0x28); tm6000_set_reg(dev, TM6010_REQ08_RE2_POWER_DOWN_CTRL1, 0xfc); tm6000_set_reg(dev, TM6010_REQ08_RE6_POWER_DOWN_CTRL2, 0xff); - tm6000_read_write_usb(dev, 0xc0, 0x0e, 0x00c2, 0x0008, buf, 2); - printk(KERN_INFO"buf %#x %#x\n", buf[0], buf[1]); } else { tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x08); tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x00);