From patchwork Mon Oct 4 18:29:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Richter X-Patchwork-Id: 4485 Return-path: Envelope-to: mchehab@pedra Delivery-date: Mon, 04 Oct 2010 15:46:15 -0300 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1P2q3D-0006Q0-GX for mchehab@pedra; Mon, 04 Oct 2010 15:46:15 -0300 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Mon, 04 Oct 2010 15:46:15 -0300 (BRT) Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1P2q1w-0002JH-B4 for mchehab@bombadil.infradead.org; Mon, 04 Oct 2010 18:44:56 +0000 Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1P2psb-0000uu-Il; Mon, 04 Oct 2010 18:35:17 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932184Ab0JDSaV (ORCPT + 1 other); Mon, 4 Oct 2010 14:30:21 -0400 Received: from einhorn.in-berlin.de ([192.109.42.8]:44707 "EHLO einhorn.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932178Ab0JDSaV (ORCPT ); Mon, 4 Oct 2010 14:30:21 -0400 X-Envelope-From: stefanr@s5r6.in-berlin.de Received: from stein ([83.221.231.7]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id o94ITPxR022581; Mon, 4 Oct 2010 20:29:25 +0200 Date: Mon, 4 Oct 2010 20:29:24 +0200 (CEST) From: Stefan Richter Subject: [PATCH update2] V4L/DVB: firedtv: support for PSK8 for S2 devices. To watch HD. To: Mauro Carvalho Chehab cc: Tommy Jonsson , linux-media@vger.kernel.org, linux1394-devel@lists.sourceforge.net In-Reply-To: Message-ID: References: <4C90B4FB.2050401@s5r6.in-berlin.de> MIME-Version: 1.0 Content-Disposition: INLINE X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Date: Sun, 12 Sep 2010 21:03:45 +0200 From: Tommy Jonsson This is the first i have ever developed for linux, cant really wrap my head around how to submit this.. Hope im sending this correctly, diff made with 'hg diff' from latest "hg clone http://linuxtv.org/hg/v4l-dvb" It adds support for tuning with PSK8 modulation, pilot and rolloff with the S2 versions of firedtv. Signed-off-by: Tommy Jonsson Signed-off-by: Stefan Richter (trivial simplification) --- Sorry, missed two space-before-tab. drivers/media/dvb/firewire/firedtv-avc.c | 30 +++++++++++++++++-- drivers/media/dvb/firewire/firedtv-fe.c | 36 ++++++++++++++++++++++- 2 files changed, 60 insertions(+), 6 deletions(-) Index: b/drivers/media/dvb/firewire/firedtv-avc.c =================================================================== --- a/drivers/media/dvb/firewire/firedtv-avc.c +++ b/drivers/media/dvb/firewire/firedtv-avc.c @@ -24,6 +24,8 @@ #include #include +#include + #include "firedtv.h" #define FCP_COMMAND_REGISTER 0xfffff0000b00ULL @@ -368,10 +370,30 @@ static int avc_tuner_tuneqpsk(struct fir c->operand[12] = 0; if (fdtv->type == FIREDTV_DVB_S2) { - c->operand[13] = 0x1; - c->operand[14] = 0xff; - c->operand[15] = 0xff; - + if (fdtv->fe.dtv_property_cache.delivery_system == SYS_DVBS2) { + switch (fdtv->fe.dtv_property_cache.modulation) { + case QAM_16: c->operand[13] = 0x1; break; + case QPSK: c->operand[13] = 0x2; break; + case PSK_8: c->operand[13] = 0x3; break; + default: c->operand[13] = 0x2; break; + } + switch (fdtv->fe.dtv_property_cache.rolloff) { + case ROLLOFF_AUTO: c->operand[14] = 0x2; break; + case ROLLOFF_35: c->operand[14] = 0x2; break; + case ROLLOFF_20: c->operand[14] = 0x0; break; + case ROLLOFF_25: c->operand[14] = 0x1; break; + /* case ROLLOFF_NONE: c->operand[14] = 0xff; break; */ + } + switch (fdtv->fe.dtv_property_cache.pilot) { + case PILOT_AUTO: c->operand[15] = 0x0; break; + case PILOT_OFF: c->operand[15] = 0x0; break; + case PILOT_ON: c->operand[15] = 0x1; break; + } + } else { + c->operand[13] = 0x1; /* auto modulation */ + c->operand[14] = 0xff; /* disable rolloff */ + c->operand[15] = 0xff; /* disable pilot */ + } return 16; } else { return 13; Index: b/drivers/media/dvb/firewire/firedtv-fe.c =================================================================== --- a/drivers/media/dvb/firewire/firedtv-fe.c +++ b/drivers/media/dvb/firewire/firedtv-fe.c @@ -155,6 +155,16 @@ static int fdtv_get_frontend(struct dvb_ return -EOPNOTSUPP; } +static int fdtv_get_property(struct dvb_frontend *fe, struct dtv_property *tvp) +{ + return 0; +} + +static int fdtv_set_property(struct dvb_frontend *fe, struct dtv_property *tvp) +{ + return 0; +} + void fdtv_frontend_init(struct firedtv *fdtv) { struct dvb_frontend_ops *ops = &fdtv->fe.ops; @@ -166,6 +176,9 @@ void fdtv_frontend_init(struct firedtv * ops->set_frontend = fdtv_set_frontend; ops->get_frontend = fdtv_get_frontend; + ops->get_property = fdtv_get_property; + ops->set_property = fdtv_set_property; + ops->read_status = fdtv_read_status; ops->read_ber = fdtv_read_ber; ops->read_signal_strength = fdtv_read_signal_strength; @@ -179,7 +192,6 @@ void fdtv_frontend_init(struct firedtv * switch (fdtv->type) { case FIREDTV_DVB_S: - case FIREDTV_DVB_S2: fi->type = FE_QPSK; fi->frequency_min = 950000; @@ -188,7 +200,7 @@ void fdtv_frontend_init(struct firedtv * fi->symbol_rate_min = 1000000; fi->symbol_rate_max = 40000000; - fi->caps = FE_CAN_INVERSION_AUTO | + fi->caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | @@ -198,6 +210,26 @@ void fdtv_frontend_init(struct firedtv * FE_CAN_QPSK; break; + case FIREDTV_DVB_S2: + fi->type = FE_QPSK; + + fi->frequency_min = 950000; + fi->frequency_max = 2150000; + fi->frequency_stepsize = 125; + fi->symbol_rate_min = 1000000; + fi->symbol_rate_max = 40000000; + + fi->caps = FE_CAN_INVERSION_AUTO | + FE_CAN_FEC_1_2 | + FE_CAN_FEC_2_3 | + FE_CAN_FEC_3_4 | + FE_CAN_FEC_5_6 | + FE_CAN_FEC_7_8 | + FE_CAN_FEC_AUTO | + FE_CAN_QPSK | + FE_CAN_2G_MODULATION; + break; + case FIREDTV_DVB_C: fi->type = FE_QAM;