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>
30 #include "dvb_frontend.h"
35 #define TONE_FREQ 22000
37 struct s5h1420_state
{
38 struct i2c_adapter
* i2c
;
39 struct dvb_frontend_ops ops
;
40 const struct s5h1420_config
* config
;
41 struct dvb_frontend frontend
;
46 fe_code_rate_t fec_inner
;
50 static u32
s5h1420_getsymbolrate(struct s5h1420_state
* state
);
51 static int s5h1420_get_tune_settings(struct dvb_frontend
* fe
,
52 struct dvb_frontend_tune_settings
* fesettings
);
56 #define dprintk if (debug) printk
58 static int s5h1420_writereg (struct s5h1420_state
* state
, u8 reg
, u8 data
)
60 u8 buf
[] = { reg
, data
};
61 struct i2c_msg msg
= { .addr
= state
->config
->demod_address
, .flags
= 0, .buf
= buf
, .len
= 2 };
64 if ((err
= i2c_transfer (state
->i2c
, &msg
, 1)) != 1) {
65 dprintk ("%s: writereg error (err == %i, reg == 0x%02x, data == 0x%02x)\n", __FUNCTION__
, err
, reg
, data
);
72 static u8
s5h1420_readreg (struct s5h1420_state
* state
, u8 reg
)
77 struct i2c_msg msg1
= { .addr
= state
->config
->demod_address
, .flags
= 0, .buf
= b0
, .len
= 1 };
78 struct i2c_msg msg2
= { .addr
= state
->config
->demod_address
, .flags
= I2C_M_RD
, .buf
= b1
, .len
= 1 };
80 if ((ret
= i2c_transfer (state
->i2c
, &msg1
, 1)) != 1)
83 if ((ret
= i2c_transfer (state
->i2c
, &msg2
, 1)) != 1)
89 static int s5h1420_set_voltage (struct dvb_frontend
* fe
, fe_sec_voltage_t voltage
)
91 struct s5h1420_state
* state
= fe
->demodulator_priv
;
95 s5h1420_writereg(state
, 0x3c,
96 (s5h1420_readreg(state
, 0x3c) & 0xfe) | 0x02);
100 s5h1420_writereg(state
, 0x3c, s5h1420_readreg(state
, 0x3c) | 0x03);
103 case SEC_VOLTAGE_OFF
:
104 s5h1420_writereg(state
, 0x3c, s5h1420_readreg(state
, 0x3c) & 0xfd);
111 static int s5h1420_set_tone (struct dvb_frontend
* fe
, fe_sec_tone_mode_t tone
)
113 struct s5h1420_state
* state
= fe
->demodulator_priv
;
117 s5h1420_writereg(state
, 0x3b,
118 (s5h1420_readreg(state
, 0x3b) & 0x74) | 0x08);
122 s5h1420_writereg(state
, 0x3b,
123 (s5h1420_readreg(state
, 0x3b) & 0x74) | 0x01);
130 static int s5h1420_send_master_cmd (struct dvb_frontend
* fe
,
131 struct dvb_diseqc_master_cmd
* cmd
)
133 struct s5h1420_state
* state
= fe
->demodulator_priv
;
136 unsigned long timeout
;
139 if (cmd
->msg_len
> 8)
142 /* setup for DISEQC */
143 val
= s5h1420_readreg(state
, 0x3b);
144 s5h1420_writereg(state
, 0x3b, 0x02);
147 /* write the DISEQC command bytes */
148 for(i
=0; i
< cmd
->msg_len
; i
++) {
149 s5h1420_writereg(state
, 0x3d + i
, cmd
->msg
[i
]);
152 /* kick off transmission */
153 s5h1420_writereg(state
, 0x3b, s5h1420_readreg(state
, 0x3b) |
154 ((cmd
->msg_len
-1) << 4) | 0x08);
156 /* wait for transmission to complete */
157 timeout
= jiffies
+ ((100*HZ
) / 1000);
158 while(time_before(jiffies
, timeout
)) {
159 if (!(s5h1420_readreg(state
, 0x3b) & 0x08))
164 if (time_after(jiffies
, timeout
))
167 /* restore original settings */
168 s5h1420_writereg(state
, 0x3b, val
);
173 static int s5h1420_recv_slave_reply (struct dvb_frontend
* fe
,
174 struct dvb_diseqc_slave_reply
* reply
)
176 struct s5h1420_state
* state
= fe
->demodulator_priv
;
180 unsigned long timeout
;
183 /* setup for DISEQC recieve */
184 val
= s5h1420_readreg(state
, 0x3b);
185 s5h1420_writereg(state
, 0x3b, 0x82); /* FIXME: guess - do we need to set DIS_RDY(0x08) in receive mode? */
188 /* wait for reception to complete */
189 timeout
= jiffies
+ ((reply
->timeout
*HZ
) / 1000);
190 while(time_before(jiffies
, timeout
)) {
191 if (!(s5h1420_readreg(state
, 0x3b) & 0x80)) /* FIXME: do we test DIS_RDY(0x08) or RCV_EN(0x80)? */
196 if (time_after(jiffies
, timeout
)) {
201 /* check error flag - FIXME: not sure what this does - docs do not describe
202 * beyond "error flag for diseqc receive data :( */
203 if (s5h1420_readreg(state
, 0x49)) {
209 length
= (s5h1420_readreg(state
, 0x3b) & 0x70) >> 4;
210 if (length
> sizeof(reply
->msg
)) {
214 reply
->msg_len
= length
;
217 for(i
=0; i
< length
; i
++) {
218 reply
->msg
[i
] = s5h1420_readreg(state
, 0x3d + i
);
222 /* restore original settings */
223 s5h1420_writereg(state
, 0x3b, val
);
228 static int s5h1420_send_burst (struct dvb_frontend
* fe
, fe_sec_mini_cmd_t minicmd
)
230 struct s5h1420_state
* state
= fe
->demodulator_priv
;
233 unsigned long timeout
;
235 /* setup for tone burst */
236 val
= s5h1420_readreg(state
, 0x3b);
237 s5h1420_writereg(state
, 0x3b, (s5h1420_readreg(state
, 0x3b) & 0x70) | 0x01);
239 /* set value for B position if requested */
240 if (minicmd
== SEC_MINI_B
) {
241 s5h1420_writereg(state
, 0x3b, s5h1420_readreg(state
, 0x3b) | 0x04);
245 /* start transmission */
246 s5h1420_writereg(state
, 0x3b, s5h1420_readreg(state
, 0x3b) | 0x08);
248 /* wait for transmission to complete */
249 timeout
= jiffies
+ ((100*HZ
) / 1000);
250 while(time_before(jiffies
, timeout
)) {
251 if (!(s5h1420_readreg(state
, 0x3b) & 0x08))
256 if (time_after(jiffies
, timeout
))
259 /* restore original settings */
260 s5h1420_writereg(state
, 0x3b, val
);
265 static fe_status_t
s5h1420_get_status_bits(struct s5h1420_state
* state
)
268 fe_status_t status
= 0;
270 val
= s5h1420_readreg(state
, 0x14);
272 status
|= FE_HAS_SIGNAL
;
274 status
|= FE_HAS_CARRIER
;
275 val
= s5h1420_readreg(state
, 0x36);
277 status
|= FE_HAS_VITERBI
;
279 status
|= FE_HAS_SYNC
;
280 if (status
== (FE_HAS_SIGNAL
|FE_HAS_CARRIER
|FE_HAS_VITERBI
|FE_HAS_SYNC
))
281 status
|= FE_HAS_LOCK
;
286 static int s5h1420_read_status(struct dvb_frontend
* fe
, fe_status_t
* status
)
288 struct s5h1420_state
* state
= fe
->demodulator_priv
;
294 /* determine lock state */
295 *status
= s5h1420_get_status_bits(state
);
297 /* fix for FEC 5/6 inversion issue - if it doesn't quite lock, invert
298 the inversion, wait a bit and check again */
299 if (*status
== (FE_HAS_SIGNAL
|FE_HAS_CARRIER
|FE_HAS_VITERBI
)) {
300 val
= s5h1420_readreg(state
, 0x32);
301 if ((val
& 0x07) == 0x03) {
303 s5h1420_writereg(state
, 0x31, 0x13);
305 s5h1420_writereg(state
, 0x31, 0x1b);
307 /* wait a bit then update lock status */
309 *status
= s5h1420_get_status_bits(state
);
313 /* perform post lock setup */
314 if ((*status
& FE_HAS_LOCK
) && (!state
->postlocked
)) {
316 /* calculate the data rate */
317 u32 tmp
= s5h1420_getsymbolrate(state
);
318 switch(s5h1420_readreg(state
, 0x32) & 0x07) {
320 tmp
= (tmp
* 2 * 1) / 2;
324 tmp
= (tmp
* 2 * 2) / 3;
328 tmp
= (tmp
* 2 * 3) / 4;
332 tmp
= (tmp
* 2 * 5) / 6;
336 tmp
= (tmp
* 2 * 6) / 7;
340 tmp
= (tmp
* 2 * 7) / 8;
344 printk("s5h1420: avoided division by 0\n");
347 tmp
= state
->fclk
/ tmp
;
349 /* set the MPEG_CLK_INTL for the calculated data rate */
364 s5h1420_writereg(state
, 0x22, val
);
367 s5h1420_writereg(state
, 0x1f, s5h1420_readreg(state
, 0x1f) | 0x01);
369 /* kicker disable + remove DC offset */
370 s5h1420_writereg(state
, 0x05, s5h1420_readreg(state
, 0x05) & 0x6f);
372 /* post-lock processing has been done! */
373 state
->postlocked
= 1;
379 static int s5h1420_read_ber(struct dvb_frontend
* fe
, u32
* ber
)
381 struct s5h1420_state
* state
= fe
->demodulator_priv
;
383 s5h1420_writereg(state
, 0x46, 0x1d);
386 *ber
= (s5h1420_readreg(state
, 0x48) << 8) | s5h1420_readreg(state
, 0x47);
391 static int s5h1420_read_signal_strength(struct dvb_frontend
* fe
, u16
* strength
)
393 struct s5h1420_state
* state
= fe
->demodulator_priv
;
395 u8 val
= s5h1420_readreg(state
, 0x15);
397 *strength
= (u16
) ((val
<< 8) | val
);
402 static int s5h1420_read_ucblocks(struct dvb_frontend
* fe
, u32
* ucblocks
)
404 struct s5h1420_state
* state
= fe
->demodulator_priv
;
406 s5h1420_writereg(state
, 0x46, 0x1f);
409 *ucblocks
= (s5h1420_readreg(state
, 0x48) << 8) | s5h1420_readreg(state
, 0x47);
414 static void s5h1420_reset(struct s5h1420_state
* state
)
416 s5h1420_writereg (state
, 0x01, 0x08);
417 s5h1420_writereg (state
, 0x01, 0x00);
421 static void s5h1420_setsymbolrate(struct s5h1420_state
* state
,
422 struct dvb_frontend_parameters
*p
)
426 val
= ((u64
) p
->u
.qpsk
.symbol_rate
/ 1000ULL) * (1ULL<<24);
427 if (p
->u
.qpsk
.symbol_rate
<= 21000000) {
430 do_div(val
, (state
->fclk
/ 1000));
432 s5h1420_writereg(state
, 0x09, s5h1420_readreg(state
, 0x09) & 0x7f);
433 s5h1420_writereg(state
, 0x11, val
>> 16);
434 s5h1420_writereg(state
, 0x12, val
>> 8);
435 s5h1420_writereg(state
, 0x13, val
& 0xff);
436 s5h1420_writereg(state
, 0x09, s5h1420_readreg(state
, 0x09) | 0x80);
439 static u32
s5h1420_getsymbolrate(struct s5h1420_state
* state
)
444 if (s5h1420_readreg(state
, 0x05) & 0x2)
447 s5h1420_writereg(state
, 0x06, s5h1420_readreg(state
, 0x06) | 0x08);
448 val
= s5h1420_readreg(state
, 0x11) << 16;
449 val
|= s5h1420_readreg(state
, 0x12) << 8;
450 val
|= s5h1420_readreg(state
, 0x13);
451 s5h1420_writereg(state
, 0x06, s5h1420_readreg(state
, 0x06) & 0xf7);
453 val
*= (state
->fclk
/ 1000ULL);
454 do_div(val
, ((1<<24) * sampling
));
456 return (u32
) (val
* 1000ULL);
459 static void s5h1420_setfreqoffset(struct s5h1420_state
* state
, int freqoffset
)
463 /* remember freqoffset is in kHz, but the chip wants the offset in Hz, so
464 * divide fclk by 1000000 to get the correct value. */
465 val
= -(int) ((freqoffset
* (1<<24)) / (state
->fclk
/ 1000000));
467 s5h1420_writereg(state
, 0x09, s5h1420_readreg(state
, 0x09) & 0xbf);
468 s5h1420_writereg(state
, 0x0e, val
>> 16);
469 s5h1420_writereg(state
, 0x0f, val
>> 8);
470 s5h1420_writereg(state
, 0x10, val
& 0xff);
471 s5h1420_writereg(state
, 0x09, s5h1420_readreg(state
, 0x09) | 0x40);
474 static int s5h1420_getfreqoffset(struct s5h1420_state
* state
)
478 s5h1420_writereg(state
, 0x06, s5h1420_readreg(state
, 0x06) | 0x08);
479 val
= s5h1420_readreg(state
, 0x0e) << 16;
480 val
|= s5h1420_readreg(state
, 0x0f) << 8;
481 val
|= s5h1420_readreg(state
, 0x10);
482 s5h1420_writereg(state
, 0x06, s5h1420_readreg(state
, 0x06) & 0xf7);
487 /* remember freqoffset is in kHz, but the chip wants the offset in Hz, so
488 * divide fclk by 1000000 to get the correct value. */
489 val
= (((-val
) * (state
->fclk
/1000000)) / (1<<24));
494 static void s5h1420_setfec_inversion(struct s5h1420_state
* state
,
495 struct dvb_frontend_parameters
*p
)
499 if (p
->inversion
== INVERSION_OFF
) {
500 inversion
= state
->config
->invert
? 0x08 : 0;
501 } else if (p
->inversion
== INVERSION_ON
) {
502 inversion
= state
->config
->invert
? 0 : 0x08;
505 if ((p
->u
.qpsk
.fec_inner
== FEC_AUTO
) || (p
->inversion
== INVERSION_AUTO
)) {
506 s5h1420_writereg(state
, 0x30, 0x3f);
507 s5h1420_writereg(state
, 0x31, 0x00 | inversion
);
509 switch(p
->u
.qpsk
.fec_inner
) {
511 s5h1420_writereg(state
, 0x30, 0x01);
512 s5h1420_writereg(state
, 0x31, 0x10 | inversion
);
516 s5h1420_writereg(state
, 0x30, 0x02);
517 s5h1420_writereg(state
, 0x31, 0x11 | inversion
);
521 s5h1420_writereg(state
, 0x30, 0x04);
522 s5h1420_writereg(state
, 0x31, 0x12 | inversion
);
526 s5h1420_writereg(state
, 0x30, 0x08);
527 s5h1420_writereg(state
, 0x31, 0x13 | inversion
);
531 s5h1420_writereg(state
, 0x30, 0x10);
532 s5h1420_writereg(state
, 0x31, 0x14 | inversion
);
536 s5h1420_writereg(state
, 0x30, 0x20);
537 s5h1420_writereg(state
, 0x31, 0x15 | inversion
);
546 static fe_code_rate_t
s5h1420_getfec(struct s5h1420_state
* state
)
548 switch(s5h1420_readreg(state
, 0x32) & 0x07) {
571 static fe_spectral_inversion_t
s5h1420_getinversion(struct s5h1420_state
* state
)
573 if (s5h1420_readreg(state
, 0x32) & 0x08)
576 return INVERSION_OFF
;
579 static int s5h1420_set_frontend(struct dvb_frontend
* fe
,
580 struct dvb_frontend_parameters
*p
)
582 struct s5h1420_state
* state
= fe
->demodulator_priv
;
584 struct dvb_frontend_tune_settings fesettings
;
587 /* check if we should do a fast-tune */
588 memcpy(&fesettings
.parameters
, p
, sizeof(struct dvb_frontend_parameters
));
589 s5h1420_get_tune_settings(fe
, &fesettings
);
590 frequency_delta
= p
->frequency
- state
->tunedfreq
;
591 if ((frequency_delta
> -fesettings
.max_drift
) &&
592 (frequency_delta
< fesettings
.max_drift
) &&
593 (frequency_delta
!= 0) &&
594 (state
->fec_inner
== p
->u
.qpsk
.fec_inner
) &&
595 (state
->symbol_rate
== p
->u
.qpsk
.symbol_rate
)) {
597 if (state
->config
->pll_set
) {
598 s5h1420_writereg (state
, 0x02, s5h1420_readreg(state
,0x02) | 1);
599 state
->config
->pll_set(fe
, p
, &tmp
);
600 s5h1420_setfreqoffset(state
, p
->frequency
- tmp
);
605 /* first of all, software reset */
606 s5h1420_reset(state
);
608 /* set s5h1420 fclk PLL according to desired symbol rate */
609 if (p
->u
.qpsk
.symbol_rate
> 28000000) {
610 state
->fclk
= 88000000;
611 s5h1420_writereg(state
, 0x03, 0x50);
612 s5h1420_writereg(state
, 0x04, 0x40);
613 s5h1420_writereg(state
, 0x05, 0xae);
614 } else if (p
->u
.qpsk
.symbol_rate
> 21000000) {
615 state
->fclk
= 59000000;
616 s5h1420_writereg(state
, 0x03, 0x33);
617 s5h1420_writereg(state
, 0x04, 0x40);
618 s5h1420_writereg(state
, 0x05, 0xae);
620 state
->fclk
= 88000000;
621 s5h1420_writereg(state
, 0x03, 0x50);
622 s5h1420_writereg(state
, 0x04, 0x40);
623 s5h1420_writereg(state
, 0x05, 0xac);
626 /* set misc registers */
627 s5h1420_writereg(state
, 0x02, 0x00);
628 s5h1420_writereg(state
, 0x06, 0x00);
629 s5h1420_writereg(state
, 0x07, 0xb0);
630 s5h1420_writereg(state
, 0x0a, 0xe7);
631 s5h1420_writereg(state
, 0x0b, 0x78);
632 s5h1420_writereg(state
, 0x0c, 0x48);
633 s5h1420_writereg(state
, 0x0d, 0x6b);
634 s5h1420_writereg(state
, 0x2e, 0x8e);
635 s5h1420_writereg(state
, 0x35, 0x33);
636 s5h1420_writereg(state
, 0x38, 0x01);
637 s5h1420_writereg(state
, 0x39, 0x7d);
638 s5h1420_writereg(state
, 0x3a, (state
->fclk
+ (TONE_FREQ
* 32) - 1) / (TONE_FREQ
* 32));
639 s5h1420_writereg(state
, 0x3c, 0x00);
640 s5h1420_writereg(state
, 0x45, 0x61);
641 s5h1420_writereg(state
, 0x46, 0x1d);
644 s5h1420_writereg(state
, 0x05, s5h1420_readreg(state
, 0x05) | 1);
647 if (state
->config
->pll_set
) {
648 s5h1420_writereg (state
, 0x02, s5h1420_readreg(state
,0x02) | 1);
649 state
->config
->pll_set(fe
, p
, &tmp
);
650 s5h1420_setfreqoffset(state
, 0);
653 /* set the reset of the parameters */
654 s5h1420_setsymbolrate(state
, p
);
655 s5h1420_setfec_inversion(state
, p
);
657 state
->fec_inner
= p
->u
.qpsk
.fec_inner
;
658 state
->symbol_rate
= p
->u
.qpsk
.symbol_rate
;
659 state
->postlocked
= 0;
660 state
->tunedfreq
= p
->frequency
;
664 static int s5h1420_get_frontend(struct dvb_frontend
* fe
,
665 struct dvb_frontend_parameters
*p
)
667 struct s5h1420_state
* state
= fe
->demodulator_priv
;
669 p
->frequency
= state
->tunedfreq
+ s5h1420_getfreqoffset(state
);
670 p
->inversion
= s5h1420_getinversion(state
);
671 p
->u
.qpsk
.symbol_rate
= s5h1420_getsymbolrate(state
);
672 p
->u
.qpsk
.fec_inner
= s5h1420_getfec(state
);
677 static int s5h1420_get_tune_settings(struct dvb_frontend
* fe
,
678 struct dvb_frontend_tune_settings
* fesettings
)
680 if (fesettings
->parameters
.u
.qpsk
.symbol_rate
> 20000000) {
681 fesettings
->min_delay_ms
= 50;
682 fesettings
->step_size
= 2000;
683 fesettings
->max_drift
= 8000;
684 } else if (fesettings
->parameters
.u
.qpsk
.symbol_rate
> 12000000) {
685 fesettings
->min_delay_ms
= 100;
686 fesettings
->step_size
= 1500;
687 fesettings
->max_drift
= 9000;
688 } else if (fesettings
->parameters
.u
.qpsk
.symbol_rate
> 8000000) {
689 fesettings
->min_delay_ms
= 100;
690 fesettings
->step_size
= 1000;
691 fesettings
->max_drift
= 8000;
692 } else if (fesettings
->parameters
.u
.qpsk
.symbol_rate
> 4000000) {
693 fesettings
->min_delay_ms
= 100;
694 fesettings
->step_size
= 500;
695 fesettings
->max_drift
= 7000;
696 } else if (fesettings
->parameters
.u
.qpsk
.symbol_rate
> 2000000) {
697 fesettings
->min_delay_ms
= 200;
698 fesettings
->step_size
= (fesettings
->parameters
.u
.qpsk
.symbol_rate
/ 8000);
699 fesettings
->max_drift
= 14 * fesettings
->step_size
;
701 fesettings
->min_delay_ms
= 200;
702 fesettings
->step_size
= (fesettings
->parameters
.u
.qpsk
.symbol_rate
/ 8000);
703 fesettings
->max_drift
= 18 * fesettings
->step_size
;
709 static int s5h1420_init (struct dvb_frontend
* fe
)
711 struct s5h1420_state
* state
= fe
->demodulator_priv
;
713 /* disable power down and do reset */
714 s5h1420_writereg(state
, 0x02, 0x10);
716 s5h1420_reset(state
);
719 if (state
->config
->pll_init
) {
720 s5h1420_writereg (state
, 0x02, s5h1420_readreg(state
,0x02) | 1);
721 state
->config
->pll_init(fe
);
722 s5h1420_writereg (state
, 0x02, s5h1420_readreg(state
,0x02) & 0xfe);
728 static int s5h1420_sleep(struct dvb_frontend
* fe
)
730 struct s5h1420_state
* state
= fe
->demodulator_priv
;
732 return s5h1420_writereg(state
, 0x02, 0x12);
735 static void s5h1420_release(struct dvb_frontend
* fe
)
737 struct s5h1420_state
* state
= fe
->demodulator_priv
;
741 static struct dvb_frontend_ops s5h1420_ops
;
743 struct dvb_frontend
* s5h1420_attach(const struct s5h1420_config
* config
,
744 struct i2c_adapter
* i2c
)
746 struct s5h1420_state
* state
= NULL
;
749 /* allocate memory for the internal state */
750 state
= kmalloc(sizeof(struct s5h1420_state
), GFP_KERNEL
);
754 /* setup the state */
755 state
->config
= config
;
757 memcpy(&state
->ops
, &s5h1420_ops
, sizeof(struct dvb_frontend_ops
));
758 state
->postlocked
= 0;
759 state
->fclk
= 88000000;
760 state
->tunedfreq
= 0;
761 state
->fec_inner
= FEC_NONE
;
762 state
->symbol_rate
= 0;
764 /* check if the demod is there + identify it */
765 identity
= s5h1420_readreg(state
, 0x00);
766 if (identity
!= 0x03)
769 /* create dvb_frontend */
770 state
->frontend
.ops
= &state
->ops
;
771 state
->frontend
.demodulator_priv
= state
;
772 return &state
->frontend
;
779 static struct dvb_frontend_ops s5h1420_ops
= {
782 .name
= "Samsung S5H1420 DVB-S",
784 .frequency_min
= 950000,
785 .frequency_max
= 2150000,
786 .frequency_stepsize
= 125, /* kHz for QPSK frontends */
787 .frequency_tolerance
= 29500,
788 .symbol_rate_min
= 1000000,
789 .symbol_rate_max
= 45000000,
790 /* .symbol_rate_tolerance = ???,*/
791 .caps
= FE_CAN_INVERSION_AUTO
|
792 FE_CAN_FEC_1_2
| FE_CAN_FEC_2_3
| FE_CAN_FEC_3_4
|
793 FE_CAN_FEC_5_6
| FE_CAN_FEC_6_7
| FE_CAN_FEC_7_8
| FE_CAN_FEC_AUTO
|
797 .release
= s5h1420_release
,
799 .init
= s5h1420_init
,
800 .sleep
= s5h1420_sleep
,
802 .set_frontend
= s5h1420_set_frontend
,
803 .get_frontend
= s5h1420_get_frontend
,
804 .get_tune_settings
= s5h1420_get_tune_settings
,
806 .read_status
= s5h1420_read_status
,
807 .read_ber
= s5h1420_read_ber
,
808 .read_signal_strength
= s5h1420_read_signal_strength
,
809 .read_ucblocks
= s5h1420_read_ucblocks
,
811 .diseqc_send_master_cmd
= s5h1420_send_master_cmd
,
812 .diseqc_recv_slave_reply
= s5h1420_recv_slave_reply
,
813 .diseqc_send_burst
= s5h1420_send_burst
,
814 .set_tone
= s5h1420_set_tone
,
815 .set_voltage
= s5h1420_set_voltage
,
818 module_param(debug
, int, 0644);
820 MODULE_DESCRIPTION("Samsung S5H1420 DVB-S Demodulator driver");
821 MODULE_AUTHOR("Andrew de Quincey");
822 MODULE_LICENSE("GPL");
824 EXPORT_SYMBOL(s5h1420_attach
);