V4L/DVB (9824): m52790: convert to v4l2_subdev.
[linux-2.6-block.git] / drivers / media / video / msp3400-driver.h
CommitLineData
56fc08ca 1/*
56fc08ca
MCC
2 */
3
49965a80
HV
4#ifndef MSP3400_DRIVER_H
5#define MSP3400_DRIVER_H
1da177e4 6
2474ed44
HV
7#include <media/msp3400.h>
8
1da177e4
LT
9/* ---------------------------------------------------------------------- */
10
53b0a1c6
HV
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
42772574
HV
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
1da177e4
LT
33
34#define SCART_DSP_IN 0
35#define SCART1_OUT 1
36#define SCART2_OUT 2
37
53b0a1c6
HV
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 */
f167cb4e
MCC
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;
53b0a1c6
HV
50
51struct msp_state {
52 int rev1, rev2;
74cab31c 53 int ident;
5af0c8f6
HV
54 u8 has_nicam;
55 u8 has_radio;
56 u8 has_headphones;
57 u8 has_ntsc_jp_d_k3;
0020d3ef
HV
58 u8 has_scart2;
59 u8 has_scart3;
5af0c8f6 60 u8 has_scart4;
0020d3ef 61 u8 has_scart2_out;
5af0c8f6
HV
62 u8 has_scart2_out_volume;
63 u8 has_i2s_conf;
64 u8 has_subwoofer;
65 u8 has_sound_processing;
66 u8 has_virtual_dolby_surround;
67 u8 has_dolby_pro_logic;
de98cdaf 68 u8 force_btsc;
7560d7a4
HV
69
70 int radio;
53b0a1c6 71 int opmode;
5af0c8f6 72 int std;
53b0a1c6 73 int mode;
5af0c8f6 74 v4l2_std_id v4l2_std;
53b0a1c6
HV
75 int nicam_on;
76 int acb;
77 int in_scart;
78 int i2s_mode;
79 int main, second; /* sound carrier */
80 int input;
2474ed44 81 struct v4l2_routing routing;
53b0a1c6
HV
82
83 /* v4l2 */
84 int audmode;
85 int rxsubchans;
86
d312a46e
HV
87 int volume, muted;
88 int balance, loudness;
53b0a1c6 89 int bass, treble;
3bbe5a83 90 int scan_in_progress;
53b0a1c6
HV
91
92 /* thread */
93 struct task_struct *kthread;
94 wait_queue_head_t wq;
0a115373
RD
95 unsigned int restart:1;
96 unsigned int watch_stereo:1;
53b0a1c6
HV
97};
98
53b0a1c6
HV
99/* msp3400-driver.c */
100int msp_write_dem(struct i2c_client *client, int addr, int val);
101int msp_write_dsp(struct i2c_client *client, int addr, int val);
102int msp_read_dem(struct i2c_client *client, int addr);
103int msp_read_dsp(struct i2c_client *client, int addr);
104int msp_reset(struct i2c_client *client);
105void msp_set_scart(struct i2c_client *client, int in, int out);
53b0a1c6 106void msp_set_audio(struct i2c_client *client);
53b0a1c6
HV
107int msp_sleep(struct msp_state *state, int timeout);
108
109/* msp3400-kthreads.c */
5af0c8f6 110const char *msp_standard_std_name(int std);
8a4b275f 111void msp_set_audmode(struct i2c_client *client);
de533ccf 112int msp_detect_stereo(struct i2c_client *client);
53b0a1c6
HV
113int msp3400c_thread(void *data);
114int msp3410d_thread(void *data);
115int msp34xxg_thread(void *data);
8a4b275f
HV
116void msp3400c_set_mode(struct i2c_client *client, int mode);
117void msp3400c_set_carrier(struct i2c_client *client, int cdo1, int cdo2);
53b0a1c6 118
49965a80 119#endif /* MSP3400_DRIVER_H */