From patchwork Sat Nov 28 11:36:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wong X-Patchwork-Id: 63476 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nASBaaH6020530 for ; Sat, 28 Nov 2009 11:36:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753837AbZK1Lg3 (ORCPT ); Sat, 28 Nov 2009 06:36:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753840AbZK1Lg3 (ORCPT ); Sat, 28 Nov 2009 06:36:29 -0500 Received: from mail-px0-f173.google.com ([209.85.216.173]:63239 "EHLO mail-px0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753735AbZK1Lg2 (ORCPT ); Sat, 28 Nov 2009 06:36:28 -0500 Received: by mail-px0-f173.google.com with SMTP id 3so1633943pxi.22 for ; Sat, 28 Nov 2009 03:36:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type; bh=M+Ou1xGonkWXF0HfIUjHQa9bhf9AOPloB97x26Phw/4=; b=sLFM4nlobgMDAV4jzR077iHI4GJJTmXJy4/+pJ7F+zITyk6m+AhAONVOFjSKQC1is7 ypsWLz6AL8I7glMgqxp0bb/E3u//o79iiloFBk6XBZ6SOjjp5iiKPt7ktbgPDBYoUWHA o41EzGFUXhPl+E6a9Pf5fRXMOtsE87+SCMqwI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type; b=nWuOgzMCfyX7jUtygyFfGjnBXkttYKbcAV6onuP1hLk1cALOYmF+ZwesDO5YEKBKtv SUgVlKhwnaMhzvhXTKmncyWocFfXdw51zSgmyRQ802Fs3eJpzHJdLskJzKKlZFrb1UuB JRbKzs19GrM6naYi6n8/w/hn7/adt7ieKyzVg= Received: by 10.114.236.11 with SMTP id j11mr3673990wah.168.1259408194861; Sat, 28 Nov 2009 03:36:34 -0800 (PST) Received: from ?192.168.0.3? (n219073044176.netvigator.com [219.73.44.176]) by mx.google.com with ESMTPS id 22sm1823578pxi.6.2009.11.28.03.36.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 28 Nov 2009 03:36:34 -0800 (PST) Message-ID: <4B110B3F.6020409@gmail.com> Date: Sat, 28 Nov 2009 19:36:31 +0800 From: "David T. L. Wong" User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Mauro Carvalho Chehab CC: v4l-dvb Subject: [PATCH] atbm8830: use AGC setting from config Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/linux/drivers/media/dvb/dvb-usb/cxusb.c b/linux/drivers/media/dvb/dvb-usb/cxusb.c --- a/linux/drivers/media/dvb/dvb-usb/cxusb.c +++ b/linux/drivers/media/dvb/dvb-usb/cxusb.c @@ -1187,6 +1187,9 @@ .osc_clk_freq = 30400, /* in kHz */ .if_freq = 0, /* zero IF */ .zif_swap_iq = 1, + .agc_min = 0x2E, + .agc_max = 0x90, + .agc_hold_loop = 0, }; static int cxusb_mygica_d689_frontend_attach(struct dvb_usb_adapter *adap) diff --git a/linux/drivers/media/dvb/frontends/atbm8830.c b/linux/drivers/media/dvb/frontends/atbm8830.c --- a/linux/drivers/media/dvb/frontends/atbm8830.c +++ b/linux/drivers/media/dvb/frontends/atbm8830.c @@ -164,6 +164,10 @@ static int set_agc_config(struct atbm_state *priv, u8 min, u8 max, u8 hold_loop) { + /* no effect if both min and max are zero */ + if (!min && !max) + return 0; + atbm8830_write_reg(priv, REG_AGC_MIN, min); atbm8830_write_reg(priv, REG_AGC_MAX, max); atbm8830_write_reg(priv, REG_AGC_HOLD_LOOP, hold_loop); @@ -227,11 +231,9 @@ /*Set IF frequency*/ set_if_freq(priv, cfg->if_freq); -#if 0 /*Set AGC Config*/ set_agc_config(priv, cfg->agc_min, cfg->agc_max, cfg->agc_hold_loop); -#endif /*Set static channel mode*/ set_static_channel_mode(priv); diff --git a/linux/drivers/media/video/cx23885/cx23885-dvb.c b/linux/drivers/media/video/cx23885/cx23885-dvb.c --- a/linux/drivers/media/video/cx23885/cx23885-dvb.c +++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c @@ -555,6 +555,9 @@ .osc_clk_freq = 30400, /* in kHz */ .if_freq = 0, /* zero IF */ .zif_swap_iq = 1, + .agc_min = 0x2E, + .agc_max = 0xFF, + .agc_hold_loop = 0, }; static struct max2165_config mygic_x8558pro_max2165_cfg1 = { @@ -571,6 +574,9 @@ .osc_clk_freq = 30400, /* in kHz */ .if_freq = 0, /* zero IF */ .zif_swap_iq = 1, + .agc_min = 0x2E, + .agc_max = 0xFF, + .agc_hold_loop = 0, }; static struct max2165_config mygic_x8558pro_max2165_cfg2 = {