aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/msp3400-driver.h
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-03-19 06:45:38 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-03-24 14:26:57 -0500
commit49965a80a4c4f5cbe15fb3bb1f8f8b0ec4ef02bc (patch)
treeaaf7409eb7c44da7527b08d63bdab87e34471fce /drivers/media/video/msp3400-driver.h
parentde533ccf8dd51f38ef3c1751f9eb5ad3f2fcfad9 (diff)
V4L/DVB (3581): Add new media/msp3400.h header containing the routing macros
Moved msp3400.h to msp3400-driver.h. Created media/msp3400.h with the new routing defines and lots of comments. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/msp3400-driver.h')
-rw-r--r--drivers/media/video/msp3400-driver.h113
1 files changed, 113 insertions, 0 deletions
diff --git a/drivers/media/video/msp3400-driver.h b/drivers/media/video/msp3400-driver.h
new file mode 100644
index 000000000000..04821ebfe04a
--- /dev/null
+++ b/drivers/media/video/msp3400-driver.h
@@ -0,0 +1,113 @@
1/*
2 */
3
4#ifndef MSP3400_DRIVER_H
5#define MSP3400_DRIVER_H
6
7/* ---------------------------------------------------------------------- */
8
9/* This macro is allowed for *constants* only, gcc must calculate it
10 at compile time. Remember -- no floats in kernel mode */
11#define MSP_CARRIER(freq) ((int)((float)(freq / 18.432) * (1 << 24)))
12
13#define MSP_MODE_AM_DETECT 0
14#define MSP_MODE_FM_RADIO 2
15#define MSP_MODE_FM_TERRA 3
16#define MSP_MODE_FM_SAT 4
17#define MSP_MODE_FM_NICAM1 5
18#define MSP_MODE_FM_NICAM2 6
19#define MSP_MODE_AM_NICAM 7
20#define MSP_MODE_BTSC 8
21#define MSP_MODE_EXTERN 9
22
23#define SCART_IN1 0
24#define SCART_IN2 1
25#define SCART_IN3 2
26#define SCART_IN4 3
27#define SCART_IN1_DA 4
28#define SCART_IN2_DA 5
29#define SCART_MONO 6
30#define SCART_MUTE 7
31
32#define SCART_DSP_IN 0
33#define SCART1_OUT 1
34#define SCART2_OUT 2
35
36#define OPMODE_AUTO -1
37#define OPMODE_MANUAL 0
38#define OPMODE_AUTODETECT 1 /* use autodetect (>= msp3410 only) */
39#define OPMODE_AUTOSELECT 2 /* use autodetect & autoselect (>= msp34xxG) */
40
41/* module parameters */
42extern int msp_debug;
43extern int msp_once;
44extern int msp_amsound;
45extern int msp_standard;
46extern int msp_dolby;
47extern int msp_stereo_thresh;
48
49struct msp_state {
50 int rev1, rev2;
51 u8 has_nicam;
52 u8 has_radio;
53 u8 has_headphones;
54 u8 has_ntsc_jp_d_k3;
55 u8 has_scart4;
56 u8 has_scart23_in_scart2_out;
57 u8 has_scart2_out_volume;
58 u8 has_i2s_conf;
59 u8 has_subwoofer;
60 u8 has_sound_processing;
61 u8 has_virtual_dolby_surround;
62 u8 has_dolby_pro_logic;
63
64 int radio;
65 int opmode;
66 int std;
67 int mode;
68 v4l2_std_id v4l2_std;
69 int nicam_on;
70 int acb;
71 int in_scart;
72 int i2s_mode;
73 int main, second; /* sound carrier */
74 int input;
75 int source; /* see msp34xxg_set_source */
76
77 /* v4l2 */
78 int audmode;
79 int rxsubchans;
80
81 int volume, muted;
82 int balance, loudness;
83 int bass, treble;
84
85 /* thread */
86 struct task_struct *kthread;
87 wait_queue_head_t wq;
88 int restart:1;
89 int watch_stereo:1;
90};
91
92/* msp3400-driver.c */
93int msp_write_dem(struct i2c_client *client, int addr, int val);
94int msp_write_dsp(struct i2c_client *client, int addr, int val);
95int msp_read_dem(struct i2c_client *client, int addr);
96int msp_read_dsp(struct i2c_client *client, int addr);
97int msp_reset(struct i2c_client *client);
98void msp_set_scart(struct i2c_client *client, int in, int out);
99void msp_set_mute(struct i2c_client *client);
100void msp_set_audio(struct i2c_client *client);
101int msp_sleep(struct msp_state *state, int timeout);
102
103/* msp3400-kthreads.c */
104const char *msp_standard_std_name(int std);
105void msp_set_audmode(struct i2c_client *client);
106int msp_detect_stereo(struct i2c_client *client);
107int msp3400c_thread(void *data);
108int msp3410d_thread(void *data);
109int msp34xxg_thread(void *data);
110void msp3400c_set_mode(struct i2c_client *client, int mode);
111void msp3400c_set_carrier(struct i2c_client *client, int cdo1, int cdo2);
112
113#endif /* MSP3400_DRIVER_H */