diff options
author | Svante Olofsson <svante@agentum.com> | 2005-09-09 16:02:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:57:41 -0400 |
commit | 115eea4e91049a42d81e5284cbb0f50acab6eb39 (patch) | |
tree | 9972a46642aa5cf67d2e11896f07a93d365f5bc0 /drivers/media | |
parent | 47dc3d688d04f06d8ef90a06c48930906fbc4a8c (diff) |
[PATCH] dvb: usb: digitv: support for nxt6000 demod
Add support for the NXT6000-based digitv-box. Add .get_tune_settings callback
for the NXT6000 to have a min_tune_delay of 500ms.
Signed-off-by: Svante Olofsson <svante@agentum.com>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/dvb-usb/digitv.c | 40 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/nxt6000.c | 9 |
2 files changed, 33 insertions, 16 deletions
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index 24d2bc6ca97b..74545f82eff1 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -111,31 +111,28 @@ static int digitv_mt352_demod_init(struct dvb_frontend *fe) | |||
111 | } | 111 | } |
112 | 112 | ||
113 | static struct mt352_config digitv_mt352_config = { | 113 | static struct mt352_config digitv_mt352_config = { |
114 | .demod_address = 0x0, /* ignored by the digitv anyway */ | ||
115 | .demod_init = digitv_mt352_demod_init, | 114 | .demod_init = digitv_mt352_demod_init, |
116 | .pll_set = dvb_usb_pll_set, | 115 | .pll_set = dvb_usb_pll_set, |
117 | }; | 116 | }; |
118 | 117 | ||
119 | static struct nxt6000_config digitv_nxt6000_config = { | 118 | static int digitv_nxt6000_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) |
120 | .demod_address = 0x0, /* ignored by the digitv anyway */ | 119 | { |
121 | .clock_inversion = 0x0, | 120 | struct dvb_usb_device *d = fe->dvb->priv; |
121 | u8 b[5]; | ||
122 | dvb_usb_pll_set(fe,fep,b); | ||
123 | return digitv_ctrl_msg(d,USB_WRITE_TUNER,0,&b[1],4,NULL,0); | ||
124 | } | ||
122 | 125 | ||
123 | .pll_init = NULL, | 126 | static struct nxt6000_config digitv_nxt6000_config = { |
124 | .pll_set = NULL, | 127 | .clock_inversion = 1, |
128 | .pll_set = digitv_nxt6000_pll_set, | ||
125 | }; | 129 | }; |
126 | 130 | ||
127 | static int digitv_frontend_attach(struct dvb_usb_device *d) | 131 | static int digitv_frontend_attach(struct dvb_usb_device *d) |
128 | { | 132 | { |
129 | if ((d->fe = mt352_attach(&digitv_mt352_config, &d->i2c_adap)) != NULL) | 133 | if ((d->fe = mt352_attach(&digitv_mt352_config, &d->i2c_adap)) != NULL || |
134 | (d->fe = nxt6000_attach(&digitv_nxt6000_config, &d->i2c_adap)) != NULL) | ||
130 | return 0; | 135 | return 0; |
131 | if ((d->fe = nxt6000_attach(&digitv_nxt6000_config, &d->i2c_adap)) != NULL) { | ||
132 | |||
133 | warn("nxt6000 support is not done yet, in fact you are one of the first " | ||
134 | "person who wants to use this device in Linux. Please report to " | ||
135 | "linux-dvb@linuxtv.org"); | ||
136 | |||
137 | return 0; | ||
138 | } | ||
139 | return -EIO; | 136 | return -EIO; |
140 | } | 137 | } |
141 | 138 | ||
@@ -173,7 +170,18 @@ static struct dvb_usb_properties digitv_properties; | |||
173 | static int digitv_probe(struct usb_interface *intf, | 170 | static int digitv_probe(struct usb_interface *intf, |
174 | const struct usb_device_id *id) | 171 | const struct usb_device_id *id) |
175 | { | 172 | { |
176 | return dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,NULL); | 173 | struct dvb_usb_device *d; |
174 | int ret; | ||
175 | if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d)) == 0) { | ||
176 | u8 b[4] = { 0 }; | ||
177 | |||
178 | b[0] = 1; | ||
179 | digitv_ctrl_msg(d,USB_WRITE_REMOTE_TYPE,0,b,4,NULL,0); | ||
180 | |||
181 | b[0] = 0; | ||
182 | digitv_ctrl_msg(d,USB_WRITE_REMOTE,0,b,4,NULL,0); | ||
183 | } | ||
184 | return ret; | ||
177 | } | 185 | } |
178 | 186 | ||
179 | static struct usb_device_id digitv_table [] = { | 187 | static struct usb_device_id digitv_table [] = { |
diff --git a/drivers/media/dvb/frontends/nxt6000.c b/drivers/media/dvb/frontends/nxt6000.c index 966de9853d18..88a57b791112 100644 --- a/drivers/media/dvb/frontends/nxt6000.c +++ b/drivers/media/dvb/frontends/nxt6000.c | |||
@@ -482,6 +482,7 @@ static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
482 | if ((result = nxt6000_set_inversion(state, param->inversion)) < 0) | 482 | if ((result = nxt6000_set_inversion(state, param->inversion)) < 0) |
483 | return result; | 483 | return result; |
484 | 484 | ||
485 | msleep(500); | ||
485 | return 0; | 486 | return 0; |
486 | } | 487 | } |
487 | 488 | ||
@@ -525,6 +526,12 @@ static int nxt6000_read_signal_strength(struct dvb_frontend* fe, u16* signal_str | |||
525 | return 0; | 526 | return 0; |
526 | } | 527 | } |
527 | 528 | ||
529 | static int nxt6000_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune) | ||
530 | { | ||
531 | tune->min_delay_ms = 500; | ||
532 | return 0; | ||
533 | } | ||
534 | |||
528 | static struct dvb_frontend_ops nxt6000_ops; | 535 | static struct dvb_frontend_ops nxt6000_ops; |
529 | 536 | ||
530 | struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config, | 537 | struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config, |
@@ -578,6 +585,8 @@ static struct dvb_frontend_ops nxt6000_ops = { | |||
578 | 585 | ||
579 | .init = nxt6000_init, | 586 | .init = nxt6000_init, |
580 | 587 | ||
588 | .get_tune_settings = nxt6000_fe_get_tune_settings, | ||
589 | |||
581 | .set_frontend = nxt6000_set_frontend, | 590 | .set_frontend = nxt6000_set_frontend, |
582 | 591 | ||
583 | .read_status = nxt6000_read_status, | 592 | .read_status = nxt6000_read_status, |