2 Driver for Samsung S5H1420 QPSK Demodulator
4 Copyright (C) 2005 Andrew de Quincey <adq_dvb@lidskialf.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <linux/kernel.h>
24 #include <linux/module.h>
25 #include <linux/init.h>
26 #include <linux/string.h>
27 #include <linux/slab.h>
28 #include <linux/delay.h>
29 #include <linux/jiffies.h>
30 #include <asm/div64.h>
32 #include "dvb_frontend.h"
37 #define TONE_FREQ 22000
39 struct s5h1420_state
{
40 struct i2c_adapter
* i2c
;
41 struct dvb_frontend_ops ops
;
42 const struct s5h1420_config
* config
;
43 struct dvb_frontend frontend
;
48 fe_code_rate_t fec_inner
;
52 static u32
s5h1420_getsymbolrate(struct s5h1420_state
* state
);
53 static int s5h1420_get_tune_settings(struct dvb_frontend
* fe
,
54 struct dvb_frontend_tune_settings
* fesettings
);
58 #define dprintk if (debug) printk
60 static int s5h1420_writereg (struct s5h1420_state
* state
, u8 reg
, u8 data
)
62 u8 buf
[] = { reg
, data
};
63 struct i2c_msg msg
= { .addr
= state
->config
->demod_address
, .flags
= 0, .buf
= buf
, .len
= 2 };
66 if ((err
= i2c_transfer (state
->i2c
, &msg
, 1)) != 1) {
67 dprintk ("%s: writereg error (err == %i, reg == 0x%02x, data == 0x%02x)\n", __FUNCTION__
, err
, reg
, data
);
74 static u8
s5h1420_readreg (struct s5h1420_state
* state
, u8 reg
)
79 struct i2c_msg msg1
= { .addr
= state
->config
->demod_address
, .flags
= 0, .buf
= b0
, .len
= 1 };
80 struct i2c_msg msg2
= { .addr
= state
->config
->demod_address
, .flags
= I2C_M_RD
, .buf
= b1
, .len
= 1 };
82 if ((ret
= i2c_transfer (state
->i2c
, &msg1
, 1)) != 1)
85 if ((ret
= i2c_transfer (state
->i2c
, &msg2
, 1)) != 1)
91 static int s5h1420_set_voltage (struct dvb_frontend
* fe
, fe_sec_voltage_t voltage
)
93 struct s5h1420_state
* state
= fe
->demodulator_priv
;
97 s5h1420_writereg(state
, 0x3c,
98 (s5h1420_readreg(state
, 0x3c) & 0xfe) | 0x02);
102 s5h1420_writereg(state
, 0x3c, s5h1420_readreg(state
, 0x3c) | 0x03);
105 case SEC_VOLTAGE_OFF
:
106 s5h1420_writereg(state
, 0x3c, s5h1420_readreg(state
, 0x3c) & 0xfd);
113 static int s5h1420_set_tone (struct dvb_frontend
* fe
, fe_sec_tone_mode_t tone
)
115 struct s5h1420_state
* state
= fe
->demodulator_priv
;
119 s5h1420_writereg(state
, 0x3b,
120 (s5h1420_readreg(state
, 0x3b) & 0x74) | 0x08);
124 s5h1420_writereg(state
, 0x3b,
125 (s5h1420_readreg(state
, 0x3b) & 0x74) | 0x01);
132 static int s5h1420_send_master_cmd (struct dvb_frontend
* fe
,
133 struct dvb_diseqc_master_cmd
* cmd
)
135 struct s5h1420_state
* state
= fe
->demodulator_priv
;
138 unsigned long timeout
;
141 if (cmd
->msg_len
> 8)
144 /* setup for DISEQC */
145 val
= s5h1420_readreg(state
, 0x3b);
146 s5h1420_writereg(state
, 0x3b, 0x02);
149 /* write the DISEQC command bytes */
150 for(i
=0; i
< cmd
->msg_len
; i
++) {
151 s5h1420_writereg(state
, 0x3d + i
, cmd
->msg
[i
]);
154 /* kick off transmission */
155 s5h1420_writereg(state
, 0x3b, s5h1420_readreg(state
, 0x3b) |
156 ((cmd
->msg_len
-1) << 4) | 0x08);
158 /* wait for transmission to complete */
159 timeout
= jiffies
+ ((100*HZ
) / 1000);
160 while(time_before(jiffies
, timeout
)) {
161 if (!(s5h1420_readreg(state
, 0x3b) & 0x08))
166 if (time_after(jiffies
, timeout
))
169 /* restore original settings */
170 s5h1420_writereg(state
, 0x3b, val
);
175 static int s5h1420_recv_slave_reply (struct dvb_frontend
* fe
,
176 struct dvb_diseqc_slave_reply
* reply
)
178 struct s5h1420_state
* state
= fe
->demodulator_priv
;
182 unsigned long timeout
;
185 /* setup for DISEQC recieve */
186 val
= s5h1420_readreg(state
, 0x3b);
187 s5h1420_writereg(state
, 0x3b, 0x82); /* FIXME: guess - do we need to set DIS_RDY(0x08) in receive mode? */
190 /* wait for reception to complete */
191 timeout
= jiffies
+ ((reply
->timeout
*HZ
) / 1000);
192 while(time_before(jiffies
, timeout
)) {
193 if (!(s5h1420_readreg(state
, 0x3b) & 0x80)) /* FIXME: do we test DIS_RDY(0x08) or RCV_EN(0x80)? */
198 if (time_after(jiffies
, timeout
)) {
203 /* check error flag - FIXME: not sure what this does - docs do not describe
204 * beyond "error flag for diseqc receive data :( */
205 if (s5h1420_readreg(state
, 0x49)) {
211 length
= (s5h1420_readreg(state
, 0x3b) & 0x70) >> 4;
212 if (length
> sizeof(reply
->msg
)) {
216 reply
->msg_len
= length
;
219 for(i
=0; i
< length
; i
++) {
220 reply
->msg
[i
] = s5h1420_readreg(state
, 0x3d + i
);
224 /* restore original settings */
225 s5h1420_writereg(state
, 0x3b, val
);
230 static int s5h1420_send_burst (struct dvb_frontend
* fe
, fe_sec_mini_cmd_t minicmd
)
232 struct s5h1420_state
* state
= fe
->demodulator_priv
;
235 unsigned long timeout
;
237 /* setup for tone burst */
238 val
= s5h1420_readreg(state
, 0x3b);
239 s5h1420_writereg(state
, 0x3b, (s5h1420_readreg(state
, 0x3b) & 0x70) | 0x01);
241 /* set value for B position if requested */
242 if (minicmd
== SEC_MINI_B
) {
243 s5h1420_writereg(state
, 0x3b, s5h1420_readreg(state
, 0x3b) | 0x04);
247 /* start transmission */
248 s5h1420_writereg(state
, 0x3b, s5h1420_readreg(state
, 0x3b) | 0x08);
250 /* wait for transmission to complete */
251 timeout
= jiffies
+ ((100*HZ
) / 1000);
252 while(time_before(jiffies
, timeout
)) {
253 if (!(s5h1420_readreg(state
, 0x3b) & 0x08))
258 if (time_after(jiffies
, timeout
))
261 /* restore original settings */
262 s5h1420_writereg(state
, 0x3b, val
);
267 static fe_status_t
s5h1420_get_status_bits(struct s5h1420_state
* state
)
270 fe_status_t status
= 0;
272 val
= s5h1420_readreg(state
, 0x14);
274 status
|= FE_HAS_SIGNAL
;
276 status
|= FE_HAS_CARRIER
;
277 val
= s5h1420_readreg(state
, 0x36);
279 status
|= FE_HAS_VITERBI
;
281 status
|= FE_HAS_SYNC
;
282 if (status
== (FE_HAS_SIGNAL
|FE_HAS_CARRIER
|FE_HAS_VITERBI
|FE_HAS_SYNC
))
283 status
|= FE_HAS_LOCK
;
288 static int s5h1420_read_status(struct dvb_frontend
* fe
, fe_status_t
* status
)
290 struct s5h1420_state
* state
= fe
->demodulator_priv
;
296 /* determine lock state */
297 *status
= s5h1420_get_status_bits(state
);
299 /* fix for FEC 5/6 inversion issue - if it doesn't quite lock, invert
300 the inversion, wait a bit and check again */
301 if (*status
== (FE_HAS_SIGNAL
|FE_HAS_CARRIER
|FE_HAS_VITERBI
)) {
302 val
= s5h1420_readreg(state
, 0x32);
303 if ((val
& 0x07) == 0x03) {
305 s5h1420_writereg(state
, 0x31, 0x13);
307 s5h1420_writereg(state
, 0x31, 0x1b);
309 /* wait a bit then update lock status */
311 *status
= s5h1420_get_status_bits(state
);
315 /* perform post lock setup */
316 if ((*status
& FE_HAS_LOCK
) && (!state
->postlocked
)) {
318 /* calculate the data rate */
319 u32 tmp
= s5h1420_getsymbolrate(state
);
320 switch(s5h1420_readreg(state
, 0x32) & 0x07) {
322 tmp
= (tmp
* 2 * 1) / 2;
326 tmp
= (tmp
* 2 * 2) / 3;
330 tmp
= (tmp
* 2 * 3) / 4;
334 tmp
= (tmp
* 2 * 5) / 6;
338 tmp
= (tmp
* 2 * 6) / 7;
342 tmp
= (tmp
* 2 * 7) / 8;
346 printk("s5h1420: avoided division by 0\n");
349 tmp
= state
->fclk
/ tmp
;
351 /* set the MPEG_CLK_INTL for the calculated data rate */
366 s5h1420_writereg(state
, 0x22, val
);
369 s5h1420_writereg(state
, 0x1f, s5h1420_readreg(state
, 0x1f) | 0x01);
371 /* kicker disable + remove DC offset */
372 s5h1420_writereg(state
, 0x05, s5h1420_readreg(state
, 0x05) & 0x6f);
374 /* post-lock processing has been done! */
375 state
->postlocked
= 1;
381 static int s5h1420_read_ber(struct dvb_frontend
* fe
, u32
* ber
)
383 struct s5h1420_state
* state
= fe
->demodulator_priv
;
385 s5h1420_writereg(state
, 0x46, 0x1d);
388 *ber
= (s5h1420_readreg(state
, 0x48) << 8) | s5h1420_readreg(state
, 0x47);
393 static int s5h1420_read_signal_strength(struct dvb_frontend
* fe
, u16
* strength
)
395 struct s5h1420_state
* state
= fe
->demodulator_priv
;
397 u8 val
= s5h1420_readreg(state
, 0x15);
399 *strength
= (u16
) ((val
<< 8) | val
);
404 static int s5h1420_read_ucblocks(struct dvb_frontend
* fe
, u32
* ucblocks
)
406 struct s5h1420_state
* state
= fe
->demodulator_priv
;
408 s5h1420_writereg(state
, 0x46, 0x1f);
411 *ucblocks
= (s5h1420_readreg(state
, 0x48) << 8) | s5h1420_readreg(state
, 0x47);
416 static void s5h1420_reset(struct s5h1420_state
* state
)
418 s5h1420_writereg (state
, 0x01, 0x08);
419 s5h1420_writereg (state
, 0x01, 0x00);
423 static void s5h1420_setsymbolrate(struct s5h1420_state
* state
,
424 struct dvb_frontend_parameters
*p
)
428 val
= ((u64
) p
->u
.qpsk
.symbol_rate
/ 1000ULL) * (1ULL<<24);
429 if (p
->u
.qpsk
.symbol_rate
<= 21000000) {
432 do_div(val
, (state
->fclk
/ 1000));
434 s5h1420_writereg(state
, 0x09, s5h1420_readreg(state
, 0x09) & 0x7f);
435 s5h1420_writereg(state
, 0x11, val
>> 16);
436 s5h1420_writereg(state
, 0x12, val
>> 8);
437 s5h1420_writereg(state
, 0x13, val
& 0xff);
438 s5h1420_writereg(state
, 0x09, s5h1420_readreg(state
, 0x09) | 0x80);
441 static u32
s5h1420_getsymbolrate(struct s5h1420_state
* state
)
446 if (s5h1420_readreg(state
, 0x05) & 0x2)
449 s5h1420_writereg(state
, 0x06, s5h1420_readreg(state
, 0x06) | 0x08);
450 val
= s5h1420_readreg(state
, 0x11) << 16;
451 val
|= s5h1420_readreg(state
, 0x12) << 8;
452 val
|= s5h1420_readreg(state
, 0x13);
453 s5h1420_writereg(state
, 0x06, s5h1420_readreg(state
, 0x06) & 0xf7);
455 val
*= (state
->fclk
/ 1000ULL);
456 do_div(val
, ((1<<24) * sampling
));
458 return (u32
) (val
* 1000ULL);
461 static void s5h1420_setfreqoffset(struct s5h1420_state
* state
, int freqoffset
)
465 /* remember freqoffset is in kHz, but the chip wants the offset in Hz, so
466 * divide fclk by 1000000 to get the correct value. */
467 val
= -(int) ((freqoffset
* (1<<24)) / (state
->fclk
/ 1000000));
469 s5h1420_writereg(state
, 0x09, s5h1420_readreg(state
, 0x09) & 0xbf);
470 s5h1420_writereg(state
, 0x0e, val
>> 16);
471 s5h1420_writereg(state
, 0x0f, val
>> 8);
472 s5h1420_writereg(state
, 0x10, val
& 0xff);
473 s5h1420_writereg(state
, 0x09, s5h1420_readreg(state
, 0x09) | 0x40);
476 static int s5h1420_getfreqoffset(struct s5h1420_state
* state
)
480 s5h1420_writereg(state
, 0x06, s5h1420_readreg(state
, 0x06) | 0x08);
481 val
= s5h1420_readreg(state
, 0x0e) << 16;
482 val
|= s5h1420_readreg(state
, 0x0f) << 8;
483 val
|= s5h1420_readreg(state
, 0x10);
484 s5h1420_writereg(state
, 0x06, s5h1420_readreg(state
, 0x06) & 0xf7);
489 /* remember freqoffset is in kHz, but the chip wants the offset in Hz, so
490 * divide fclk by 1000000 to get the correct value. */
491 val
= (((-val
) * (state
->fclk
/1000000)) / (1<<24));
496 static void s5h1420_setfec_inversion(struct s5h1420_state
* state
,
497 struct dvb_frontend_parameters
*p
)
501 if (p
->inversion
== INVERSION_OFF
) {
502 inversion
= state
->config
->invert
? 0x08 : 0;
503 } else if (p
->inversion
== INVERSION_ON
) {
504 inversion
= state
->config
->invert
? 0 : 0x08;
507 if ((p
->u
.qpsk
.fec_inner
== FEC_AUTO
) || (p
->inversion
== INVERSION_AUTO
)) {
508 s5h1420_writereg(state
, 0x30, 0x3f);
509 s5h1420_writereg(state
, 0x31, 0x00 | inversion
);
511 switch(p
->u
.qpsk
.fec_inner
) {
513 s5h1420_writereg(state
, 0x30, 0x01);
514 s5h1420_writereg(state
, 0x31, 0x10 | inversion
);
518 s5h1420_writereg(state
, 0x30, 0x02);
519 s5h1420_writereg(state
, 0x31, 0x11 | inversion
);
523 s5h1420_writereg(state
, 0x30, 0x04);
524 s5h1420_writereg(state
, 0x31, 0x12 | inversion
);
528 s5h1420_writereg(state
, 0x30, 0x08);
529 s5h1420_writereg(state
, 0x31, 0x13 | inversion
);
533 s5h1420_writereg(state
, 0x30, 0x10);
534 s5h1420_writereg(state
, 0x31, 0x14 | inversion
);
538 s5h1420_writereg(state
, 0x30, 0x20);
539 s5h1420_writereg(state
, 0x31, 0x15 | inversion
);
548 static fe_code_rate_t
s5h1420_getfec(struct s5h1420_state
* state
)
550 switch(s5h1420_readreg(state
, 0x32) & 0x07) {
573 static fe_spectral_inversion_t
s5h1420_getinversion(struct s5h1420_state
* state
)
575 if (s5h1420_readreg(state
, 0x32) & 0x08)
578 return INVERSION_OFF
;
581 static int s5h1420_set_frontend(struct dvb_frontend
* fe
,
582 struct dvb_frontend_parameters
*p
)
584 struct s5h1420_state
* state
= fe
->demodulator_priv
;
586 struct dvb_frontend_tune_settings fesettings
;
589 /* check if we should do a fast-tune */
590 memcpy(&fesettings
.parameters
, p
, sizeof(struct dvb_frontend_parameters
));
591 s5h1420_get_tune_settings(fe
, &fesettings
);
592 frequency_delta
= p
->frequency
- state
->tunedfreq
;
593 if ((frequency_delta
> -fesettings
.max_drift
) &&
594 (frequency_delta
< fesettings
.max_drift
) &&
595 (frequency_delta
!= 0) &&
596 (state
->fec_inner
== p
->u
.qpsk
.fec_inner
) &&
597 (state
->symbol_rate
== p
->u
.qpsk
.symbol_rate
)) {
599 if (state
->config
->pll_set
) {
600 s5h1420_writereg (state
, 0x02, s5h1420_readreg(state
,0x02) | 1);
601 state
->config
->pll_set(fe
, p
, &tmp
);
602 s5h1420_setfreqoffset(state
, p
->frequency
- tmp
);
607 /* first of all, software reset */
608 s5h1420_reset(state
);
610 /* set s5h1420 fclk PLL according to desired symbol rate */
611 if (p
->u
.qpsk
.symbol_rate
> 28000000) {
612 state
->fclk
= 88000000;
613 s5h1420_writereg(state
, 0x03, 0x50);
614 s5h1420_writereg(state
, 0x04, 0x40);
615 s5h1420_writereg(state
, 0x05, 0xae);
616 } else if (p
->u
.qpsk
.symbol_rate
> 21000000) {
617 state
->fclk
= 59000000;
618 s5h1420_writereg(state
, 0x03, 0x33);
619 s5h1420_writereg(state
, 0x04, 0x40);
620 s5h1420_writereg(state
, 0x05, 0xae);
622 state
->fclk
= 88000000;
623 s5h1420_writereg(state
, 0x03, 0x50);
624 s5h1420_writereg(state
, 0x04, 0x40);
625 s5h1420_writereg(state
, 0x05, 0xac);
628 /* set misc registers */
629 s5h1420_writereg(state
, 0x02, 0x00);
630 s5h1420_writereg(state
, 0x06, 0x00);
631 s5h1420_writereg(state
, 0x07, 0xb0);
632 s5h1420_writereg(state
, 0x0a, 0xe7);
633 s5h1420_writereg(state
, 0x0b, 0x78);
634 s5h1420_writereg(state
, 0x0c, 0x48);
635 s5h1420_writereg(state
, 0x0d, 0x6b);
636 s5h1420_writereg(state
, 0x2e, 0x8e);
637 s5h1420_writereg(state
, 0x35, 0x33);
638 s5h1420_writereg(state
, 0x38, 0x01);
639 s5h1420_writereg(state
, 0x39, 0x7d);
640 s5h1420_writereg(state
, 0x3a, (state
->fclk
+ (TONE_FREQ
* 32) - 1) / (TONE_FREQ
* 32));
641 s5h1420_writereg(state
, 0x3c, 0x00);
642 s5h1420_writereg(state
, 0x45, 0x61);
643 s5h1420_writereg(state
, 0x46, 0x1d);
646 s5h1420_writereg(state
, 0x05, s5h1420_readreg(state
, 0x05) | 1);
649 if (state
->config
->pll_set
) {
650 s5h1420_writereg (state
, 0x02, s5h1420_readreg(state
,0x02) | 1);
651 state
->config
->pll_set(fe
, p
, &tmp
);
652 s5h1420_setfreqoffset(state
, 0);
655 /* set the reset of the parameters */
656 s5h1420_setsymbolrate(state
, p
);
657 s5h1420_setfec_inversion(state
, p
);
659 state
->fec_inner
= p
->u
.qpsk
.fec_inner
;
660 state
->symbol_rate
= p
->u
.qpsk
.symbol_rate
;
661 state
->postlocked
= 0;
662 state
->tunedfreq
= p
->frequency
;
666 static int s5h1420_get_frontend(struct dvb_frontend
* fe
,
667 struct dvb_frontend_parameters
*p
)
669 struct s5h1420_state
* state
= fe
->demodulator_priv
;
671 p
->frequency
= state
->tunedfreq
+ s5h1420_getfreqoffset(state
);
672 p
->inversion
= s5h1420_getinversion(state
);
673 p
->u
.qpsk
.symbol_rate
= s5h1420_getsymbolrate(state
);
674 p
->u
.qpsk
.fec_inner
= s5h1420_getfec(state
);
679 static int s5h1420_get_tune_settings(struct dvb_frontend
* fe
,
680 struct dvb_frontend_tune_settings
* fesettings
)
682 if (fesettings
->parameters
.u
.qpsk
.symbol_rate
> 20000000) {
683 fesettings
->min_delay_ms
= 50;
684 fesettings
->step_size
= 2000;
685 fesettings
->max_drift
= 8000;
686 } else if (fesettings
->parameters
.u
.qpsk
.symbol_rate
> 12000000) {
687 fesettings
->min_delay_ms
= 100;
688 fesettings
->step_size
= 1500;
689 fesettings
->max_drift
= 9000;
690 } else if (fesettings
->parameters
.u
.qpsk
.symbol_rate
> 8000000) {
691 fesettings
->min_delay_ms
= 100;
692 fesettings
->step_size
= 1000;
693 fesettings
->max_drift
= 8000;
694 } else if (fesettings
->parameters
.u
.qpsk
.symbol_rate
> 4000000) {
695 fesettings
->min_delay_ms
= 100;
696 fesettings
->step_size
= 500;
697 fesettings
->max_drift
= 7000;
698 } else if (fesettings
->parameters
.u
.qpsk
.symbol_rate
> 2000000) {
699 fesettings
->min_delay_ms
= 200;
700 fesettings
->step_size
= (fesettings
->parameters
.u
.qpsk
.symbol_rate
/ 8000);
701 fesettings
->max_drift
= 14 * fesettings
->step_size
;
703 fesettings
->min_delay_ms
= 200;
704 fesettings
->step_size
= (fesettings
->parameters
.u
.qpsk
.symbol_rate
/ 8000);
705 fesettings
->max_drift
= 18 * fesettings
->step_size
;
711 static int s5h1420_init (struct dvb_frontend
* fe
)
713 struct s5h1420_state
* state
= fe
->demodulator_priv
;
715 /* disable power down and do reset */
716 s5h1420_writereg(state
, 0x02, 0x10);
718 s5h1420_reset(state
);
721 if (state
->config
->pll_init
) {
722 s5h1420_writereg (state
, 0x02, s5h1420_readreg(state
,0x02) | 1);
723 state
->config
->pll_init(fe
);
724 s5h1420_writereg (state
, 0x02, s5h1420_readreg(state
,0x02) & 0xfe);
730 static int s5h1420_sleep(struct dvb_frontend
* fe
)
732 struct s5h1420_state
* state
= fe
->demodulator_priv
;
734 return s5h1420_writereg(state
, 0x02, 0x12);
737 static void s5h1420_release(struct dvb_frontend
* fe
)
739 struct s5h1420_state
* state
= fe
->demodulator_priv
;
743 static struct dvb_frontend_ops s5h1420_ops
;
745 struct dvb_frontend
* s5h1420_attach(const struct s5h1420_config
* config
,
746 struct i2c_adapter
* i2c
)
748 struct s5h1420_state
* state
= NULL
;
751 /* allocate memory for the internal state */
752 state
= kmalloc(sizeof(struct s5h1420_state
), GFP_KERNEL
);
756 /* setup the state */
757 state
->config
= config
;
759 memcpy(&state
->ops
, &s5h1420_ops
, sizeof(struct dvb_frontend_ops
));
760 state
->postlocked
= 0;
761 state
->fclk
= 88000000;
762 state
->tunedfreq
= 0;
763 state
->fec_inner
= FEC_NONE
;
764 state
->symbol_rate
= 0;
766 /* check if the demod is there + identify it */
767 identity
= s5h1420_readreg(state
, 0x00);
768 if (identity
!= 0x03)
771 /* create dvb_frontend */
772 state
->frontend
.ops
= &state
->ops
;
773 state
->frontend
.demodulator_priv
= state
;
774 return &state
->frontend
;
781 static struct dvb_frontend_ops s5h1420_ops
= {
784 .name
= "Samsung S5H1420 DVB-S",
786 .frequency_min
= 950000,
787 .frequency_max
= 2150000,
788 .frequency_stepsize
= 125, /* kHz for QPSK frontends */
789 .frequency_tolerance
= 29500,
790 .symbol_rate_min
= 1000000,
791 .symbol_rate_max
= 45000000,
792 /* .symbol_rate_tolerance = ???,*/
793 .caps
= FE_CAN_INVERSION_AUTO
|
794 FE_CAN_FEC_1_2
| FE_CAN_FEC_2_3
| FE_CAN_FEC_3_4
|
795 FE_CAN_FEC_5_6
| FE_CAN_FEC_6_7
| FE_CAN_FEC_7_8
| FE_CAN_FEC_AUTO
|
799 .release
= s5h1420_release
,
801 .init
= s5h1420_init
,
802 .sleep
= s5h1420_sleep
,
804 .set_frontend
= s5h1420_set_frontend
,
805 .get_frontend
= s5h1420_get_frontend
,
806 .get_tune_settings
= s5h1420_get_tune_settings
,
808 .read_status
= s5h1420_read_status
,
809 .read_ber
= s5h1420_read_ber
,
810 .read_signal_strength
= s5h1420_read_signal_strength
,
811 .read_ucblocks
= s5h1420_read_ucblocks
,
813 .diseqc_send_master_cmd
= s5h1420_send_master_cmd
,
814 .diseqc_recv_slave_reply
= s5h1420_recv_slave_reply
,
815 .diseqc_send_burst
= s5h1420_send_burst
,
816 .set_tone
= s5h1420_set_tone
,
817 .set_voltage
= s5h1420_set_voltage
,
820 module_param(debug
, int, 0644);
822 MODULE_DESCRIPTION("Samsung S5H1420 DVB-S Demodulator driver");
823 MODULE_AUTHOR("Andrew de Quincey");
824 MODULE_LICENSE("GPL");
826 EXPORT_SYMBOL(s5h1420_attach
);