From: Anssi Hannula <anssi.hannula@gmail.com>
To: Andreas Oberritter <obi@linuxtv.org>
Cc: linux-dvb@linuxtv.org
Subject: Re: [linux-dvb] [multiproto patch] add support for using multiproto drivers with old api
Date: Fri, 23 May 2008 18:38:11 +0300 [thread overview]
Message-ID: <4836E4E3.70405@gmail.com> (raw)
In-Reply-To: <4836E28B.5000405@linuxtv.org>
[-- Attachment #1: Type: text/plain, Size: 531 bytes --]
Andreas Oberritter wrote:
> Hello Anssi,
>
> Anssi Hannula wrote:
>> The attached adds support for using multiproto drivers with the old api.
>
> there seems to be a needlessly duplicated line in your patch:
>
> + /* set delivery system to the default old-API one */
> + if (fe->ops.set_delsys) {
> + switch(fe->ops.info.type) {
> + case FE_QPSK:
> + fe->ops.set_delsys(fe, DVBFE_DELSYS_DVBS);
> + fe->ops.set_delsys(fe, DVBFE_DELSYS_DVBS);
Strange, the latter one should be 'break;'.
Attached again.
--
Anssi Hannula
[-- Attachment #2: multiproto-support-old-api.diff --]
[-- Type: text/x-patch, Size: 4371 bytes --]
From: Anssi Hannula <anssi.hannula@gmail.com>
multiproto: add support for using multiproto drivers with old api
Allow using multiproto drivers with the old API. Multiproto drivers
will provide one frontend type over the old API. For STB0899 this is
FE_QPSK. olddrv_to_newapi() and newapi_to_olddrv() are renamed to
oldapi_to_newapi() and newapi_to_oldapi(), respectively.
Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
---
diff -r 6fdfb2b22241 -r 5dc544760be6 linux/drivers/media/dvb/dvb-core/dvb_frontend.c
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c Fri May 23 17:17:02 2008 +0300
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c Fri May 23 17:25:59 2008 +0300
@@ -354,7 +354,7 @@
return 0;
}
-int newapi_to_olddrv(struct dvbfe_params *params,
+int newapi_to_oldapi(struct dvbfe_params *params,
struct dvb_frontend_parameters *p,
enum dvbfe_delsys delsys)
{
@@ -466,7 +466,7 @@
return 0;
}
-int olddrv_to_newapi(struct dvb_frontend *fe,
+int oldapi_to_newapi(struct dvb_frontend *fe,
struct dvbfe_params *params,
struct dvb_frontend_parameters *p,
enum fe_type fe_type)
@@ -1649,6 +1649,9 @@
memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings));
memcpy(&fetunesettings.parameters, parg, sizeof (struct dvb_frontend_parameters));
+ /* Request the search algorithm to search */
+ fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN;
+
/* force auto frequency inversion if requested */
if (dvb_force_auto_inversion) {
fepriv->parameters.inversion = INVERSION_AUTO;
@@ -1697,6 +1700,27 @@
if (dvb_override_tune_delay > 0)
fepriv->min_delay = (dvb_override_tune_delay * HZ) / 1000;
+ if (oldapi_to_newapi(fe, &fepriv->fe_params, &fepriv->parameters, fe->ops.info.type) == -EINVAL)
+ printk("%s: ERROR !!! Converting Old parameters --> New parameters\n", __func__);
+
+ /* set delivery system to the default old-API one */
+ if (fe->ops.set_delsys) {
+ switch(fe->ops.info.type) {
+ case FE_QPSK:
+ fe->ops.set_delsys(fe, DVBFE_DELSYS_DVBS);
+ break;
+ case FE_QAM:
+ fe->ops.set_delsys(fe, DVBFE_DELSYS_DVBC);
+ break;
+ case FE_OFDM:
+ fe->ops.set_delsys(fe, DVBFE_DELSYS_DVBT);
+ break;
+ case FE_ATSC:
+ fe->ops.set_delsys(fe, DVBFE_DELSYS_ATSC);
+ break;
+ }
+ }
+
fepriv->state = FESTATE_RETUNE;
dvb_frontend_wakeup(fe);
dvb_frontend_add_event(fe, 0);
@@ -1720,6 +1744,13 @@
if (fe->ops.get_frontend) {
memcpy (parg, &fepriv->parameters, sizeof (struct dvb_frontend_parameters));
err = fe->ops.get_frontend(fe, (struct dvb_frontend_parameters*) parg);
+ } else if (fe->ops.get_params) {
+ err = fe->ops.get_params(fe, &fepriv->fe_params);
+ if (!err) {
+ if (newapi_to_oldapi(&fepriv->fe_params, &fepriv->parameters, fepriv->delsys) == -EINVAL)
+ printk("%s: ERROR !!! Converting New parameters --> Old parameters\n", __func__);
+ memcpy(parg, &fepriv->parameters, sizeof (struct dvb_frontend_parameters));
+ }
}
break;
@@ -1751,7 +1782,7 @@
(delsys & DVBFE_DELSYS_DVBT) ||
(delsys & DVBFE_DELSYS_ATSC)) {
- if (newapi_to_olddrv(&fepriv->fe_params, &fepriv->parameters, fepriv->delsys) == -EINVAL)
+ if (newapi_to_oldapi(&fepriv->fe_params, &fepriv->parameters, fepriv->delsys) == -EINVAL)
printk("%s: ERROR !!! Converting New parameters --> Old parameters\n", __func__);
}
/* Request the search algorithm to search */
@@ -1841,7 +1872,7 @@
} else if (fe->ops.get_frontend) {
err = fe->ops.get_frontend(fe, &fepriv->parameters);
if (!err) {
- if (olddrv_to_newapi(fe, &fepriv->fe_params, &fepriv->parameters, fe->ops.info.type) == -EINVAL)
+ if (oldapi_to_newapi(fe, &fepriv->fe_params, &fepriv->parameters, fe->ops.info.type) == -EINVAL)
printk("%s: ERROR !!! Converting Old parameters --> New parameters\n", __func__);
memcpy(parg, &fepriv->fe_params, sizeof (struct dvbfe_params));
}
diff -r 6fdfb2b22241 -r 5dc544760be6 linux/drivers/media/dvb/frontends/stb0899_drv.c
--- a/linux/drivers/media/dvb/frontends/stb0899_drv.c Fri May 23 17:17:02 2008 +0300
+++ b/linux/drivers/media/dvb/frontends/stb0899_drv.c Fri May 23 17:25:59 2008 +0300
@@ -2036,6 +2036,7 @@
.info = {
.name = "STB0899 Multistandard",
+ .type = FE_QPSK, /* with old API */
},
.release = stb0899_release,
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
next prev parent reply other threads:[~2008-05-23 15:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-23 14:59 [linux-dvb] [multiproto patch] add support for using multiproto drivers with old api Anssi Hannula
2008-05-23 15:28 ` Andreas Oberritter
2008-05-23 15:38 ` Anssi Hannula [this message]
2008-05-23 16:36 ` Faruk A
2008-05-23 16:58 ` Goga777
2008-05-23 17:33 ` Faruk A
2008-05-24 8:37 ` ChaosMedia > WebDev
[not found] <mailman.1.1219312801.18695.linux-dvb@linuxtv.org>
2008-08-21 14:31 ` Stefan Ellenberger
2008-09-07 6:18 ` Manu Abraham
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=4836E4E3.70405@gmail.com \
--to=anssi.hannula@gmail.com \
--cc=linux-dvb@linuxtv.org \
--cc=obi@linuxtv.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox