Linux Audio

Check our new training course

Loading...
v4.10.11
 1/*
 2    Samsung S5H1411 VSB/QAM demodulator driver
 3
 4    Copyright (C) 2008 Steven Toth <stoth@linuxtv.org>
 5
 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.
10
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
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20*/
21
22#ifndef __S5H1411_H__
23#define __S5H1411_H__
24
 
25#include <linux/dvb/frontend.h>
26
27#define S5H1411_I2C_TOP_ADDR (0x32 >> 1)
28#define S5H1411_I2C_QAM_ADDR (0x34 >> 1)
29
30struct s5h1411_config {
31
32	/* serial/parallel output */
33#define S5H1411_PARALLEL_OUTPUT 0
34#define S5H1411_SERIAL_OUTPUT   1
35	u8 output_mode;
36
37	/* GPIO Setting */
38#define S5H1411_GPIO_OFF 0
39#define S5H1411_GPIO_ON  1
40	u8 gpio;
41
42	/* MPEG signal timing */
43#define S5H1411_MPEGTIMING_CONTINOUS_INVERTING_CLOCK       0
44#define S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK    1
45#define S5H1411_MPEGTIMING_NONCONTINOUS_INVERTING_CLOCK    2
46#define S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK 3
47	u16 mpeg_timing;
48
49	/* IF Freq for QAM and VSB in KHz */
50#define S5H1411_IF_3250  3250
51#define S5H1411_IF_3500  3500
52#define S5H1411_IF_4000  4000
53#define S5H1411_IF_5380  5380
54#define S5H1411_IF_44000 44000
55#define S5H1411_VSB_IF_DEFAULT S5H1411_IF_44000
56#define S5H1411_QAM_IF_DEFAULT S5H1411_IF_44000
57	u16 qam_if;
58	u16 vsb_if;
59
60	/* Spectral Inversion */
61#define S5H1411_INVERSION_OFF 0
62#define S5H1411_INVERSION_ON  1
63	u8 inversion;
64
65	/* Return lock status based on tuner lock, or demod lock */
66#define S5H1411_TUNERLOCKING 0
67#define S5H1411_DEMODLOCKING 1
68	u8 status_mode;
69};
70
71#if IS_REACHABLE(CONFIG_DVB_S5H1411)
72extern struct dvb_frontend *s5h1411_attach(const struct s5h1411_config *config,
73					   struct i2c_adapter *i2c);
74#else
75static inline struct dvb_frontend *s5h1411_attach(
76	const struct s5h1411_config *config,
77	struct i2c_adapter *i2c)
78{
79	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
80	return NULL;
81}
82#endif /* CONFIG_DVB_S5H1411 */
83
84#endif /* __S5H1411_H__ */
v4.6
 1/*
 2    Samsung S5H1411 VSB/QAM demodulator driver
 3
 4    Copyright (C) 2008 Steven Toth <stoth@linuxtv.org>
 5
 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.
10
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
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20*/
21
22#ifndef __S5H1411_H__
23#define __S5H1411_H__
24
25#include <linux/kconfig.h>
26#include <linux/dvb/frontend.h>
27
28#define S5H1411_I2C_TOP_ADDR (0x32 >> 1)
29#define S5H1411_I2C_QAM_ADDR (0x34 >> 1)
30
31struct s5h1411_config {
32
33	/* serial/parallel output */
34#define S5H1411_PARALLEL_OUTPUT 0
35#define S5H1411_SERIAL_OUTPUT   1
36	u8 output_mode;
37
38	/* GPIO Setting */
39#define S5H1411_GPIO_OFF 0
40#define S5H1411_GPIO_ON  1
41	u8 gpio;
42
43	/* MPEG signal timing */
44#define S5H1411_MPEGTIMING_CONTINOUS_INVERTING_CLOCK       0
45#define S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK    1
46#define S5H1411_MPEGTIMING_NONCONTINOUS_INVERTING_CLOCK    2
47#define S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK 3
48	u16 mpeg_timing;
49
50	/* IF Freq for QAM and VSB in KHz */
51#define S5H1411_IF_3250  3250
52#define S5H1411_IF_3500  3500
53#define S5H1411_IF_4000  4000
54#define S5H1411_IF_5380  5380
55#define S5H1411_IF_44000 44000
56#define S5H1411_VSB_IF_DEFAULT S5H1411_IF_44000
57#define S5H1411_QAM_IF_DEFAULT S5H1411_IF_44000
58	u16 qam_if;
59	u16 vsb_if;
60
61	/* Spectral Inversion */
62#define S5H1411_INVERSION_OFF 0
63#define S5H1411_INVERSION_ON  1
64	u8 inversion;
65
66	/* Return lock status based on tuner lock, or demod lock */
67#define S5H1411_TUNERLOCKING 0
68#define S5H1411_DEMODLOCKING 1
69	u8 status_mode;
70};
71
72#if IS_REACHABLE(CONFIG_DVB_S5H1411)
73extern struct dvb_frontend *s5h1411_attach(const struct s5h1411_config *config,
74					   struct i2c_adapter *i2c);
75#else
76static inline struct dvb_frontend *s5h1411_attach(
77	const struct s5h1411_config *config,
78	struct i2c_adapter *i2c)
79{
80	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
81	return NULL;
82}
83#endif /* CONFIG_DVB_S5H1411 */
84
85#endif /* __S5H1411_H__ */