aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/msp3400.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/msp3400.h')
-rw-r--r--drivers/media/video/msp3400.h102
1 files changed, 94 insertions, 8 deletions
diff --git a/drivers/media/video/msp3400.h b/drivers/media/video/msp3400.h
index 2d9ff40f0b09..8a05cf500a8c 100644
--- a/drivers/media/video/msp3400.h
+++ b/drivers/media/video/msp3400.h
@@ -6,22 +6,28 @@
6 6
7/* ---------------------------------------------------------------------- */ 7/* ---------------------------------------------------------------------- */
8 8
9struct msp_dfpreg {
10 int reg;
11 int value;
12};
13
14struct msp_matrix { 9struct msp_matrix {
15 int input; 10 int input;
16 int output; 11 int output;
17}; 12};
18 13
19#define MSP_SET_DFPREG _IOW('m',15,struct msp_dfpreg)
20#define MSP_GET_DFPREG _IOW('m',16,struct msp_dfpreg)
21
22/* ioctl for MSP_SET_MATRIX will have to be registered */ 14/* ioctl for MSP_SET_MATRIX will have to be registered */
23#define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix) 15#define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix)
24 16
17/* This macro is allowed for *constants* only, gcc must calculate it
18 at compile time. Remember -- no floats in kernel mode */
19#define MSP_CARRIER(freq) ((int)((float)(freq / 18.432) * (1 << 24)))
20
21#define MSP_MODE_AM_DETECT 0
22#define MSP_MODE_FM_RADIO 2
23#define MSP_MODE_FM_TERRA 3
24#define MSP_MODE_FM_SAT 4
25#define MSP_MODE_FM_NICAM1 5
26#define MSP_MODE_FM_NICAM2 6
27#define MSP_MODE_AM_NICAM 7
28#define MSP_MODE_BTSC 8
29#define MSP_MODE_EXTERN 9
30
25#define SCART_MASK 0 31#define SCART_MASK 0
26#define SCART_IN1 1 32#define SCART_IN1 1
27#define SCART_IN2 2 33#define SCART_IN2 2
@@ -36,4 +42,84 @@ struct msp_matrix {
36#define SCART1_OUT 1 42#define SCART1_OUT 1
37#define SCART2_OUT 2 43#define SCART2_OUT 2
38 44
45#define OPMODE_AUTO -1
46#define OPMODE_MANUAL 0
47#define OPMODE_AUTODETECT 1 /* use autodetect (>= msp3410 only) */
48#define OPMODE_AUTOSELECT 2 /* use autodetect & autoselect (>= msp34xxG) */
49
50/* module parameters */
51extern int debug;
52extern int once;
53extern int amsound;
54extern int standard;
55extern int dolby;
56extern int stereo_threshold;
57
58struct msp_state {
59 int rev1, rev2;
60 u8 has_nicam;
61 u8 has_radio;
62 u8 has_headphones;
63 u8 has_ntsc_jp_d_k3;
64 u8 has_scart4;
65 u8 has_scart23_in_scart2_out;
66 u8 has_scart2_out_volume;
67 u8 has_i2s_conf;
68 u8 has_subwoofer;
69 u8 has_sound_processing;
70 u8 has_virtual_dolby_surround;
71 u8 has_dolby_pro_logic;
72
73 int radio;
74 int opmode;
75 int std;
76 int mode;
77 v4l2_std_id v4l2_std;
78 int nicam_on;
79 int acb;
80 int in_scart;
81 int i2s_mode;
82 int main, second; /* sound carrier */
83 int input;
84 int source; /* see msp34xxg_set_source */
85
86 /* v4l2 */
87 int audmode;
88 int rxsubchans;
89
90 int volume, muted;
91 int balance, loudness;
92 int bass, treble;
93
94 /* thread */
95 struct task_struct *kthread;
96 wait_queue_head_t wq;
97 int restart:1;
98 int watch_stereo:1;
99};
100
101/* msp3400-driver.c */
102int msp_write_dem(struct i2c_client *client, int addr, int val);
103int msp_write_dsp(struct i2c_client *client, int addr, int val);
104int msp_read_dem(struct i2c_client *client, int addr);
105int msp_read_dsp(struct i2c_client *client, int addr);
106int msp_reset(struct i2c_client *client);
107void msp_set_scart(struct i2c_client *client, int in, int out);
108void msp_set_mute(struct i2c_client *client);
109void msp_set_audio(struct i2c_client *client);
110int msp_modus(struct i2c_client *client);
111int msp_sleep(struct msp_state *state, int timeout);
112
113/* msp3400-kthreads.c */
114const char *msp_standard_std_name(int std);
115void msp3400c_setcarrier(struct i2c_client *client, int cdo1, int cdo2);
116void msp3400c_setmode(struct i2c_client *client, int type);
117void msp3400c_setstereo(struct i2c_client *client, int mode);
118int autodetect_stereo(struct i2c_client *client);
119int msp3400c_thread(void *data);
120int msp3410d_thread(void *data);
121int msp34xxg_thread(void *data);
122void msp34xxg_detect_stereo(struct i2c_client *client);
123void msp34xxg_set_audmode(struct i2c_client *client, int audmode);
124
39#endif /* MSP3400_H */ 125#endif /* MSP3400_H */