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