All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: linux-media@vger.kernel.org, Hin-Tak Leung <htl10@users.sourceforge.net>
Subject: Re: [PATCH 4/4] dvb_frontend: add routine for DTMB parameter validation
Date: Sun, 16 Sep 2012 03:27:05 +0300	[thread overview]
Message-ID: <50551CD9.60700@iki.fi> (raw)
In-Reply-To: <504F9476.2040708@redhat.com>

On 09/11/2012 10:43 PM, Mauro Carvalho Chehab wrote:
> Em 16-08-2012 23:03, Antti Palosaari escreveu:
>> Common routine for use of dvb-core, demodulator and tuner for check
>> given DTMB parameters correctness.
>
> I won't repeat myself on the stuff I commented on patch 1/4.
>
> I dunno much about this standard, nor I have the specs, so, I'm
> assuming that you did the right checks here.

I am not 100% sure for bandwidth. When I did that driver I never got it 
working other than 8 MHz (used modulator allowed to set 5, 6, 7, 8). 
There is mentioned also 6 and 7 MHz in many places over the Net. 8 MHz 
is still surely the only real one and also I suspect it is the only one 
specified too. Like any other terrestrial modulation, hardware still 
could support more freely selectable configuration.

> In any case, as there's just one driver for this standard that doesn't work
> on "AUTO" mode, the only driver that could break here is your driver.

hd29l2 driver you mean is currently forced to AUTO mode and is abusing 
API DVB-T delivery system.

>>
>> Signed-off-by: Antti Palosaari <crope@iki.fi>
>> ---
>>   drivers/media/dvb-core/dvb_frontend.c | 97 +++++++++++++++++++++++++++++++++++
>>   drivers/media/dvb-core/dvb_frontend.h |  1 +
>>   2 files changed, 98 insertions(+)
>>
>> diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
>> index 6a19c87..7c3ba26 100644
>> --- a/drivers/media/dvb-core/dvb_frontend.c
>> +++ b/drivers/media/dvb-core/dvb_frontend.c
>> @@ -2813,6 +2813,103 @@ int dvb_validate_params_dvbc_annex_a(struct dvb_frontend *fe)
>>   }
>>   EXPORT_SYMBOL(dvb_validate_params_dvbc_annex_a);
>>
>> +int dvb_validate_params_dtmb(struct dvb_frontend *fe)
>> +{
>> +	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
>> +
>> +	dev_dbg(fe->dvb->device, "%s:\n", __func__);
>> +
>> +	switch (c->delivery_system) {
>> +	case SYS_DTMB:
>> +		break;
>> +	default:
>> +		dev_dbg(fe->dvb->device, "%s: delivery_system=%d\n", __func__,
>> +				c->delivery_system);
>> +		return -EINVAL;
>> +	}
>> +
>> +	if (c->frequency >= 470000000 && c->frequency <= 862000000) {
>> +		;
>> +	} else {
>> +		dev_dbg(fe->dvb->device, "%s: frequency=%d\n", __func__,
>> +				c->frequency);
>> +		return -EINVAL;
>> +	}
>> +
>> +	switch (c->bandwidth_hz) {
>> +	case 8000000:
>> +		break;
>
> Again, 0 should be accepted, as it means AUTO.

ok

>
>> +	default:
>> +		dev_dbg(fe->dvb->device, "%s: bandwidth_hz=%d\n", __func__,
>> +				c->bandwidth_hz);
>> +		return -EINVAL;
>> +	}
>> +
>> +	switch (c->modulation) {
>> +	case QAM_AUTO:
>> +	case QPSK: /* QAM4 */
>> +	case QAM_16:
>> +	case QAM_32:
>> +	case QAM_64:
>> +	case QAM_4_NR:
>> +		break;
>> +	default:
>> +		dev_dbg(fe->dvb->device, "%s: modulation=%d\n", __func__,
>> +				c->modulation);
>> +		return -EINVAL;
>> +	}
>> +
>> +	switch (c->transmission_mode) {
>> +	case TRANSMISSION_MODE_AUTO:
>> +	case TRANSMISSION_MODE_C1:
>> +	case TRANSMISSION_MODE_C3780:
>> +		break;
>> +	default:
>> +		dev_dbg(fe->dvb->device, "%s: transmission_mode=%d\n", __func__,
>> +				c->transmission_mode);
>> +		return -EINVAL;
>> +	}
>> +
>> +	switch (c->guard_interval) {
>> +	case GUARD_INTERVAL_AUTO:
>> +	case GUARD_INTERVAL_PN420:
>> +	case GUARD_INTERVAL_PN595:
>> +	case GUARD_INTERVAL_PN945:
>> +		break;
>> +	default:
>> +		dev_dbg(fe->dvb->device, "%s: guard_interval=%d\n", __func__,
>> +				c->guard_interval);
>> +		return -EINVAL;
>> +	}
>> +
>> +	/* inner coding LDPC */
>> +	switch (c->fec_inner) {
>> +	case FEC_AUTO:
>> +	case FEC_2_5: /* 0.4 */
>> +	case FEC_3_5: /* 0.6 */
>> +	case FEC_4_5: /* 0.8 */
>> +		break;
>> +	default:
>> +		dev_dbg(fe->dvb->device, "%s: fec_inner=%d\n", __func__,
>> +				c->fec_inner);
>> +		return -EINVAL;
>> +	}
>> +
>> +	switch (c->interleaving) {
>> +	case INTERLEAVING_AUTO:
>> +	case INTERLEAVING_240:
>> +	case INTERLEAVING_720:
>> +		break;
>> +	default:
>> +		dev_dbg(fe->dvb->device, "%s: interleaving=%d\n", __func__,
>> +				c->interleaving);
>> +		return -EINVAL;
>> +	}
>> +
>> +	return 0;
>> +}
>> +EXPORT_SYMBOL(dvb_validate_params_dtmb);
>> +
>>   int dvb_register_frontend(struct dvb_adapter* dvb,
>>   			  struct dvb_frontend* fe)
>>   {
>> diff --git a/drivers/media/dvb-core/dvb_frontend.h b/drivers/media/dvb-core/dvb_frontend.h
>> index e6e6fe1..9499039 100644
>> --- a/drivers/media/dvb-core/dvb_frontend.h
>> +++ b/drivers/media/dvb-core/dvb_frontend.h
>> @@ -428,5 +428,6 @@ extern s32 timeval_usec_diff(struct timeval lasttime, struct timeval curtime);
>>   extern int dvb_validate_params_dvbt(struct dvb_frontend *fe);
>>   extern int dvb_validate_params_dvbt2(struct dvb_frontend *fe);
>>   extern int dvb_validate_params_dvbc_annex_a(struct dvb_frontend *fe);
>> +extern int dvb_validate_params_dtmb(struct dvb_frontend *fe);
>>
>>   #endif
>>
>


-- 
http://palosaari.fi/

      reply	other threads:[~2012-09-16  0:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17  2:03 [PATCH 0/4] dvb_frontend: few DTV validation routines Antti Palosaari
2012-08-17  2:03 ` [PATCH 1/4] dvb_frontend: add routine for DVB-T parameter validation Antti Palosaari
2012-09-11 19:23   ` Mauro Carvalho Chehab
2012-09-15 23:42     ` Antti Palosaari
2012-08-17  2:03 ` [PATCH 2/4] dvb_frontend: add routine for DVB-T2 " Antti Palosaari
2012-09-11 19:33   ` Mauro Carvalho Chehab
2012-09-16  0:05     ` Antti Palosaari
2012-08-17  2:03 ` [PATCH 3/4] dvb_frontend: add routine for DVB-C annex A " Antti Palosaari
2012-09-11 19:40   ` Mauro Carvalho Chehab
2012-09-16  0:14     ` Antti Palosaari
2012-08-17  2:03 ` [PATCH 4/4] dvb_frontend: add routine for DTMB " Antti Palosaari
2012-09-11 19:43   ` Mauro Carvalho Chehab
2012-09-16  0:27     ` Antti Palosaari [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50551CD9.60700@iki.fi \
    --to=crope@iki.fi \
    --cc=htl10@users.sourceforge.net \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.