From patchwork Thu Nov 12 07:02:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiro TSUKADA X-Patchwork-Id: 59517 X-Patchwork-Delegate: dougsland@redhat.com 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 nAC72Kwu026899 for ; Thu, 12 Nov 2009 07:02:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751144AbZKLHCN (ORCPT ); Thu, 12 Nov 2009 02:02:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750955AbZKLHCN (ORCPT ); Thu, 12 Nov 2009 02:02:13 -0500 Received: from smtp05.mail.tnz.yahoo.co.jp ([203.216.246.68]:35617 "HELO smtp05.mail.tnz.yahoo.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750885AbZKLHCN (ORCPT ); Thu, 12 Nov 2009 02:02:13 -0500 Received: (qmail 60525 invoked by alias); 12 Nov 2009 07:02:16 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=yj20050223; d=yahoo.co.jp; h=Received:X-Apparently-From:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:Content-Transfer-Encoding; b=Z3hDDJ5zNlLOT//0NLZsnfUrv8rsAweqDURmdj8akeVsBE8wCYTD//TRD3adq5T6OaU7RzyGwpEu/knqNHiRzeFbABcs1DXhR1he12v2KiHobrhBDaYz2U/MsgkMqF3z ; Received: from unknown (HELO ribot.localdomain) (tskd2@220.28.115.38 with plain) by smtp05.mail.tnz.yahoo.co.jp with SMTP; 12 Nov 2009 07:02:16 -0000 X-Apparently-From: Message-ID: <4AFBB2F8.2070904@yahoo.co.jp> Date: Thu, 12 Nov 2009 16:02:16 +0900 From: Akihiro TSUKADA User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: Linux Media Mailing List CC: Mauro Carvalho Chehab Subject: [PATCH] dvb-usb-friio: accept center-shifted frequency 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/friio-fe.c b/linux/drivers/media/dvb/dvb-usb/friio-fe.c --- a/linux/drivers/media/dvb/dvb-usb/friio-fe.c +++ b/linux/drivers/media/dvb/dvb-usb/friio-fe.c @@ -134,11 +134,13 @@ static int jdvbt90502_pll_set_freq(struc deb_fe("%s: freq=%d, step=%d\n", __func__, freq, state->frontend.ops.info.frequency_stepsize); /* freq -> oscilator frequency conversion. */ - /* freq: 473,000,000 + n*6,000,000 (no 1/7MHz shift to center freq) */ - /* add 400[1/7 MHZ] = 57.142857MHz. 57MHz for the IF, */ - /* 1/7MHz for center freq shift */ + /* freq: 473,000,000 + n*6,000,000 [+ 142857 (center freq. shift)] */ f = freq / state->frontend.ops.info.frequency_stepsize; - f += 400; + /* add 399[1/7 MHZ] = 57MHz for the IF */ + f += 399; + /* add center frequency shift if necessary */ + if (f % 7 == 0) + f++; pll_freq_cmd[DEMOD_REDIRECT_REG] = JDVBT90502_2ND_I2C_REG; /* 0xFE */ pll_freq_cmd[ADDRESS_BYTE] = state->config.pll_address << 1; pll_freq_cmd[DIVIDER_BYTE1] = (f >> 8) & 0x7F;