mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-18 10:56:14 +00:00
V4L/DVB (3893): Convert calls from _pllbuf() to _calc_reg()
Johannes Stezenbach suggested this change - definite improvement. Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
b12faeffb1
commit
bd4956b8ec
@ -147,7 +147,7 @@ static int thomson_dtt7579_demod_init(struct dvb_frontend* fe)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int thomson_dtt7579_tuner_pllbuf(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf, int buf_len)
|
static int thomson_dtt7579_tuner_calc_regs(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf, int buf_len)
|
||||||
{
|
{
|
||||||
u32 div;
|
u32 div;
|
||||||
unsigned char bs = 0;
|
unsigned char bs = 0;
|
||||||
@ -341,7 +341,7 @@ static int advbt771_samsung_tdtc9251dh0_demod_init(struct dvb_frontend* fe)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int advbt771_samsung_tdtc9251dh0_tuner_pllbuf(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf, int buf_len)
|
static int advbt771_samsung_tdtc9251dh0_tuner_calc_regs(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf, int buf_len)
|
||||||
{
|
{
|
||||||
u32 div;
|
u32 div;
|
||||||
unsigned char bs = 0;
|
unsigned char bs = 0;
|
||||||
@ -512,7 +512,7 @@ static int digitv_alps_tded4_demod_init(struct dvb_frontend* fe)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int digitv_alps_tded4_tuner_pllbuf(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf, int buf_len)
|
static int digitv_alps_tded4_tuner_calc_regs(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf, int buf_len)
|
||||||
{
|
{
|
||||||
u32 div;
|
u32 div;
|
||||||
struct dvb_ofdm_parameters *op = ¶ms->u.ofdm;
|
struct dvb_ofdm_parameters *op = ¶ms->u.ofdm;
|
||||||
@ -607,7 +607,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
|
|||||||
card->i2c_adapter);
|
card->i2c_adapter);
|
||||||
|
|
||||||
if (card->fe != NULL) {
|
if (card->fe != NULL) {
|
||||||
card->fe->ops->tuner_ops.pllbuf = thomson_dtt7579_tuner_pllbuf;
|
card->fe->ops->tuner_ops.calc_regs = thomson_dtt7579_tuner_calc_regs;
|
||||||
card->fe->ops->info.frequency_min = 174000000;
|
card->fe->ops->info.frequency_min = 174000000;
|
||||||
card->fe->ops->info.frequency_max = 862000000;
|
card->fe->ops->info.frequency_max = 862000000;
|
||||||
}
|
}
|
||||||
@ -642,7 +642,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
|
|||||||
card->fe = mt352_attach(&digitv_alps_tded4_config, card->i2c_adapter);
|
card->fe = mt352_attach(&digitv_alps_tded4_config, card->i2c_adapter);
|
||||||
|
|
||||||
if (card->fe != NULL) {
|
if (card->fe != NULL) {
|
||||||
card->fe->ops->tuner_ops.pllbuf = digitv_alps_tded4_tuner_pllbuf;
|
card->fe->ops->tuner_ops.calc_regs = digitv_alps_tded4_tuner_calc_regs;
|
||||||
dprintk ("dvb_bt8xx: an mt352 was detected on your digitv card\n");
|
dprintk ("dvb_bt8xx: an mt352 was detected on your digitv card\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -657,7 +657,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
|
|||||||
case BTTV_BOARD_AVDVBT_771:
|
case BTTV_BOARD_AVDVBT_771:
|
||||||
card->fe = mt352_attach(&advbt771_samsung_tdtc9251dh0_config, card->i2c_adapter);
|
card->fe = mt352_attach(&advbt771_samsung_tdtc9251dh0_config, card->i2c_adapter);
|
||||||
if (card->fe != NULL) {
|
if (card->fe != NULL) {
|
||||||
card->fe->ops->tuner_ops.pllbuf = advbt771_samsung_tdtc9251dh0_tuner_pllbuf;
|
card->fe->ops->tuner_ops.calc_regs = advbt771_samsung_tdtc9251dh0_tuner_calc_regs;
|
||||||
card->fe->ops->info.frequency_min = 174000000;
|
card->fe->ops->info.frequency_min = 174000000;
|
||||||
card->fe->ops->info.frequency_max = 862000000;
|
card->fe->ops->info.frequency_max = 862000000;
|
||||||
}
|
}
|
||||||
|
@ -423,7 +423,7 @@ static int cxusb_mt352_frontend_attach(struct dvb_usb_device *d)
|
|||||||
cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
|
cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
|
||||||
|
|
||||||
if ((d->fe = mt352_attach(&cxusb_mt352_config, &d->i2c_adap)) != NULL) {
|
if ((d->fe = mt352_attach(&cxusb_mt352_config, &d->i2c_adap)) != NULL) {
|
||||||
d->fe->ops->tuner_ops.pllbuf = dvb_usb_tuner_pllbuf;
|
d->fe->ops->tuner_ops.calc_regs = dvb_usb_tuner_calc_regs;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,7 +438,7 @@ static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d)
|
|||||||
cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
|
cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
|
||||||
|
|
||||||
if ((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL) {
|
if ((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL) {
|
||||||
d->fe->ops->tuner_ops.pllbuf = dvb_usb_tuner_pllbuf;
|
d->fe->ops->tuner_ops.calc_regs = dvb_usb_tuner_calc_regs;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ static int digitv_nxt6000_tuner_set_params(struct dvb_frontend *fe, struct dvb_f
|
|||||||
{
|
{
|
||||||
struct dvb_usb_device *d = fe->dvb->priv;
|
struct dvb_usb_device *d = fe->dvb->priv;
|
||||||
u8 b[5];
|
u8 b[5];
|
||||||
dvb_usb_tuner_pllbuf(fe,fep,b, 5);
|
dvb_usb_tuner_calc_regs(fe,fep,b, 5);
|
||||||
return digitv_ctrl_msg(d,USB_WRITE_TUNER,0,&b[1],4,NULL,0);
|
return digitv_ctrl_msg(d,USB_WRITE_TUNER,0,&b[1],4,NULL,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ static struct nxt6000_config digitv_nxt6000_config = {
|
|||||||
static int digitv_frontend_attach(struct dvb_usb_device *d)
|
static int digitv_frontend_attach(struct dvb_usb_device *d)
|
||||||
{
|
{
|
||||||
if ((d->fe = mt352_attach(&digitv_mt352_config, &d->i2c_adap)) != NULL) {
|
if ((d->fe = mt352_attach(&digitv_mt352_config, &d->i2c_adap)) != NULL) {
|
||||||
d->fe->ops->tuner_ops.pllbuf = dvb_usb_tuner_pllbuf;
|
d->fe->ops->tuner_ops.calc_regs = dvb_usb_tuner_calc_regs;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ((d->fe = nxt6000_attach(&digitv_nxt6000_config, &d->i2c_adap)) != NULL) {
|
if ((d->fe = nxt6000_attach(&digitv_nxt6000_config, &d->i2c_adap)) != NULL) {
|
||||||
|
@ -331,7 +331,7 @@ extern int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *, u8[], u32 *, int
|
|||||||
|
|
||||||
/* commonly used pll init and set functions */
|
/* commonly used pll init and set functions */
|
||||||
extern int dvb_usb_tuner_init_i2c(struct dvb_frontend *);
|
extern int dvb_usb_tuner_init_i2c(struct dvb_frontend *);
|
||||||
extern int dvb_usb_tuner_pllbuf(struct dvb_frontend *, struct dvb_frontend_parameters *, u8 *buf, int buf_len);
|
extern int dvb_usb_tuner_calc_regs(struct dvb_frontend *, struct dvb_frontend_parameters *, u8 *buf, int buf_len);
|
||||||
extern int dvb_usb_tuner_set_params_i2c(struct dvb_frontend *, struct dvb_frontend_parameters *);
|
extern int dvb_usb_tuner_set_params_i2c(struct dvb_frontend *, struct dvb_frontend_parameters *);
|
||||||
|
|
||||||
/* commonly used firmware download types and function */
|
/* commonly used firmware download types and function */
|
||||||
|
@ -57,7 +57,7 @@ static int umt_mt352_frontend_attach(struct dvb_usb_device *d)
|
|||||||
memset(&umt_config,0,sizeof(struct mt352_config));
|
memset(&umt_config,0,sizeof(struct mt352_config));
|
||||||
umt_config.demod_init = umt_mt352_demod_init;
|
umt_config.demod_init = umt_mt352_demod_init;
|
||||||
umt_config.demod_address = 0xf;
|
umt_config.demod_address = 0xf;
|
||||||
d->fe->ops->tuner_ops.pllbuf = dvb_usb_tuner_pllbuf;
|
d->fe->ops->tuner_ops.calc_regs = dvb_usb_tuner_calc_regs;
|
||||||
|
|
||||||
d->fe = mt352_attach(&umt_config, &d->i2c_adap);
|
d->fe = mt352_attach(&umt_config, &d->i2c_adap);
|
||||||
|
|
||||||
|
@ -555,7 +555,7 @@ static int dvb_pll_set_params(struct dvb_frontend *fe, struct dvb_frontend_param
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dvb_pll_pllbuf(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8 *buf, int buf_len)
|
static int dvb_pll_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8 *buf, int buf_len)
|
||||||
{
|
{
|
||||||
struct dvb_pll_priv *priv = fe->tuner_priv;
|
struct dvb_pll_priv *priv = fe->tuner_priv;
|
||||||
int result;
|
int result;
|
||||||
@ -606,7 +606,7 @@ static struct dvb_tuner_ops dvb_pll_tuner_ops = {
|
|||||||
.release = dvb_pll_release,
|
.release = dvb_pll_release,
|
||||||
.sleep = dvb_pll_sleep,
|
.sleep = dvb_pll_sleep,
|
||||||
.set_params = dvb_pll_set_params,
|
.set_params = dvb_pll_set_params,
|
||||||
.pllbuf = dvb_pll_pllbuf,
|
.calc_regs = dvb_pll_calc_regs,
|
||||||
.get_frequency = dvb_pll_get_frequency,
|
.get_frequency = dvb_pll_get_frequency,
|
||||||
.get_bandwidth = dvb_pll_get_bandwidth,
|
.get_bandwidth = dvb_pll_get_bandwidth,
|
||||||
};
|
};
|
||||||
|
@ -302,8 +302,8 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
|
|||||||
// retrieve the pllbuf - we do this even if there is no
|
// retrieve the pllbuf - we do this even if there is no
|
||||||
// secondary tuner simply so we have a record of what was sent for
|
// secondary tuner simply so we have a record of what was sent for
|
||||||
// debugging.
|
// debugging.
|
||||||
if (fe->ops->tuner_ops.pllbuf) {
|
if (fe->ops->tuner_ops.calc_regs) {
|
||||||
fe->ops->tuner_ops.pllbuf(fe, param, buf+8, 5);
|
fe->ops->tuner_ops.calc_regs(fe, param, buf+8, 5);
|
||||||
buf[8] <<= 1;
|
buf[8] <<= 1;
|
||||||
mt352_write(fe, buf, sizeof(buf));
|
mt352_write(fe, buf, sizeof(buf));
|
||||||
}
|
}
|
||||||
|
@ -548,8 +548,8 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get tuning information */
|
/* get tuning information */
|
||||||
if (fe->ops->tuner_ops.pllbuf) {
|
if (fe->ops->tuner_ops.calc_regs) {
|
||||||
fe->ops->tuner_ops.pllbuf(fe, p, buf, 5);
|
fe->ops->tuner_ops.calc_regs(fe, p, buf, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set additional params */
|
/* set additional params */
|
||||||
|
@ -153,8 +153,8 @@ static int zl10353_set_parameters(struct dvb_frontend *fe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if pllbuf is defined, retrieve the settings
|
// if pllbuf is defined, retrieve the settings
|
||||||
if (fe->ops->tuner_ops.pllbuf) {
|
if (fe->ops->tuner_ops.calc_regs) {
|
||||||
fe->ops->tuner_ops.pllbuf(fe, param, pllbuf+1, 5);
|
fe->ops->tuner_ops.calc_regs(fe, param, pllbuf+1, 5);
|
||||||
pllbuf[1] <<= 1;
|
pllbuf[1] <<= 1;
|
||||||
} else {
|
} else {
|
||||||
// fake pllbuf settings
|
// fake pllbuf settings
|
||||||
|
@ -132,7 +132,7 @@ static int mt352_aver777_init(struct dvb_frontend* fe)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mt352_pinnacle_tuner_pllbuf(struct dvb_frontend* fe,
|
static int mt352_pinnacle_tuner_calc_regs(struct dvb_frontend* fe,
|
||||||
struct dvb_frontend_parameters* params,
|
struct dvb_frontend_parameters* params,
|
||||||
u8* pllbuf, int buf_len)
|
u8* pllbuf, int buf_len)
|
||||||
{
|
{
|
||||||
@ -167,7 +167,7 @@ static int mt352_pinnacle_tuner_pllbuf(struct dvb_frontend* fe,
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mt352_aver777_tuner_pllbuf(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8* pllbuf, int buf_len)
|
static int mt352_aver777_tuner_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8* pllbuf, int buf_len)
|
||||||
{
|
{
|
||||||
if (buf_len < 5)
|
if (buf_len < 5)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -1020,14 +1020,14 @@ static int dvb_init(struct saa7134_dev *dev)
|
|||||||
printk("%s: pinnacle 300i dvb setup\n",dev->name);
|
printk("%s: pinnacle 300i dvb setup\n",dev->name);
|
||||||
dev->dvb.frontend = mt352_attach(&pinnacle_300i,
|
dev->dvb.frontend = mt352_attach(&pinnacle_300i,
|
||||||
&dev->i2c_adap);
|
&dev->i2c_adap);
|
||||||
dev->dvb.frontend->ops->tuner_ops.pllbuf = mt352_pinnacle_tuner_pllbuf;
|
dev->dvb.frontend->ops->tuner_ops.calc_regs = mt352_pinnacle_tuner_calc_regs;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SAA7134_BOARD_AVERMEDIA_777:
|
case SAA7134_BOARD_AVERMEDIA_777:
|
||||||
printk("%s: avertv 777 dvb setup\n",dev->name);
|
printk("%s: avertv 777 dvb setup\n",dev->name);
|
||||||
dev->dvb.frontend = mt352_attach(&avermedia_777,
|
dev->dvb.frontend = mt352_attach(&avermedia_777,
|
||||||
&dev->i2c_adap);
|
&dev->i2c_adap);
|
||||||
dev->dvb.frontend->ops->tuner_ops.pllbuf = mt352_aver777_tuner_pllbuf;
|
dev->dvb.frontend->ops->tuner_ops.calc_regs = mt352_aver777_tuner_calc_regs;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_TDA1004X
|
#ifdef HAVE_TDA1004X
|
||||||
|
Loading…
x
Reference in New Issue
Block a user