aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-06-02 15:30:46 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-18 13:24:15 -0400
commit4ce15678926cef4886df46964142fc2520c216cd (patch)
tree6f3b02ff93f688646a2b53f4d9af7157306b7c16 /drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
parentb784e526a8333db57d1b9f385a12553066bdba64 (diff)
V4L/DVB (5777): Dvb-pll digitv dvb-usb: Eliminate last user of dvb_pll_configure
The last user of dvb_pll_configure was the dvb-usb function dvb_usb_tuner_calc_regs(), which was nothing more than a wrapper around dvb_pll_configure(). It's just a copy of the functionality provided by the tuner_ops calc_regs method, and can be deleted. There were two users of dvb_usb_tuner_calc_regs(). One was dvb_usb_tuner_set_params_i2c(), which is converted to use fe->ops.tuner_ops.calc_regs(). The other was the digitv driver. This driver can use one of two demods, mt352 or nxt6000. For the mt352, the driver would set tuner_ops.calc_regs to dvb_usb_tuner_calc_regs(). We can just attach dvb_pll and use the tuner_ops.calc_regs() provided by that module. For the nxt600, the driver would set tuner_ops.set_params to digitv_nxt6000_tuner_set_params. That function would in turn use dvb_usb_tuner_calc_regs(). We convert it to use tuner_ops.calc_regs() instead, and use dvb_pll_attach. The digitv_tuner_attach() needs to know which frontend was attached by digitv_frontend_attach(), since the nxt6000 needs tuner_ops.set_params() to be overridden with digitv_nxt6000_tuner_set_params(). So, to do this a digitv_state that says which frontend was used is added to the dvb_usb_device private state field. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dvb-usb-i2c.c')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-i2c.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c b/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
index 4c80823d8d07..5792951b990e 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
@@ -78,26 +78,6 @@ int dvb_usb_tuner_init_i2c(struct dvb_frontend *fe)
78} 78}
79EXPORT_SYMBOL(dvb_usb_tuner_init_i2c); 79EXPORT_SYMBOL(dvb_usb_tuner_init_i2c);
80 80
81int dvb_usb_tuner_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep, u8 *b, int buf_len)
82{
83 struct dvb_usb_adapter *adap = fe->dvb->priv;
84
85 if (buf_len != 5)
86 return -EINVAL;
87 if (adap->pll_desc == NULL)
88 return 0;
89
90 deb_pll("pll addr: %x, freq: %d %p\n",adap->pll_addr, fep->frequency, adap->pll_desc);
91
92 b[0] = adap->pll_addr;
93 dvb_pll_configure(adap->pll_desc, &b[1], fep);
94
95 deb_pll("pll-buf: %x %x %x %x %x\n",b[0],b[1],b[2],b[3],b[4]);
96
97 return 5;
98}
99EXPORT_SYMBOL(dvb_usb_tuner_calc_regs);
100
101int dvb_usb_tuner_set_params_i2c(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) 81int dvb_usb_tuner_set_params_i2c(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep)
102{ 82{
103 struct dvb_usb_adapter *adap = fe->dvb->priv; 83 struct dvb_usb_adapter *adap = fe->dvb->priv;
@@ -105,7 +85,7 @@ int dvb_usb_tuner_set_params_i2c(struct dvb_frontend *fe, struct dvb_frontend_pa
105 u8 b[5]; 85 u8 b[5];
106 struct i2c_msg msg = { .addr = adap->pll_addr, .flags = 0, .buf = &b[1], .len = 4 }; 86 struct i2c_msg msg = { .addr = adap->pll_addr, .flags = 0, .buf = &b[1], .len = 4 };
107 87
108 dvb_usb_tuner_calc_regs(fe,fep,b,5); 88 fe->ops.tuner_ops.calc_regs(fe, fep, b, sizeof(b));
109 89
110 if (adap->tuner_pass_ctrl) 90 if (adap->tuner_pass_ctrl)
111 adap->tuner_pass_ctrl(fe, 1, adap->pll_addr); 91 adap->tuner_pass_ctrl(fe, 1, adap->pll_addr);