Commit 53b0a1c6 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (3275): Split msp3400.c into msp3400-driver.c and msp3400-kthreads.c


- Split msp3400.c into msp3400-driver.c and msp3400-kthreads.c.
- Removed experimental DFPREG ioctls. If this is really needed one
day then it should be implemented using VIDIOC_G/S_REGISTER.
- Added missing BALANCE control info for VIDIOC_QUERYCTRL.
- Still more cleanup, clarified some kernel messages.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
parent e93fa17e
......@@ -10,6 +10,8 @@ zr36067-objs := zoran_procfs.o zoran_device.o \
zoran_driver.o zoran_card.o
tuner-objs := tuner-core.o tuner-simple.o mt20xx.o tda8290.o tea5767.o
msp3400-objs := msp3400-driver.o msp3400-kthreads.o
obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o v4l1-compat.o compat_ioctl32.o
obj-$(CONFIG_VIDEO_BT848) += bttv.o msp3400.o tvaudio.o \
......
......@@ -6,22 +6,62 @@
/* ---------------------------------------------------------------------- */
struct msp_dfpreg {
int reg;
int value;
};
#define msp_err(fmt, arg...) \
printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \
i2c_adapter_id(client->adapter), client->addr , ## arg)
#define msp_warn(fmt, arg...) \
printk(KERN_WARNING "%s %d-%04x: " fmt, client->driver->driver.name, \
i2c_adapter_id(client->adapter), client->addr , ## arg)
#define msp_info(fmt, arg...) \
printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \
i2c_adapter_id(client->adapter), client->addr , ## arg)
/* level 1 debug. */
#define msp_dbg1(fmt, arg...) \
do { \
if (debug) \
printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->driver.name, \
i2c_adapter_id(client->adapter), client->addr , ## arg); \
} while (0)
/* level 2 debug. */
#define msp_dbg2(fmt, arg...) \
do { \
if (debug >= 2) \
printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \
i2c_adapter_id(client->adapter), client->addr , ## arg); \
} while (0)
/* level 3 debug. Use with care. */
#define msp_dbg3(fmt, arg...) \
do { \
if (debug >= 16) \
printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \
i2c_adapter_id(client->adapter), client->addr , ## arg); \
} while (0)
struct msp_matrix {
int input;
int output;
};
#define MSP_SET_DFPREG _IOW('m',15,struct msp_dfpreg)
#define MSP_GET_DFPREG _IOW('m',16,struct msp_dfpreg)
/* ioctl for MSP_SET_MATRIX will have to be registered */
#define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix)
/* This macro is allowed for *constants* only, gcc must calculate it
at compile time. Remember -- no floats in kernel mode */
#define MSP_CARRIER(freq) ((int)((float)(freq / 18.432) * (1 << 24)))
#define MSP_MODE_AM_DETECT 0
#define MSP_MODE_FM_RADIO 2
#define MSP_MODE_FM_TERRA 3
#define MSP_MODE_FM_SAT 4
#define MSP_MODE_FM_NICAM1 5
#define MSP_MODE_FM_NICAM2 6
#define MSP_MODE_AM_NICAM 7
#define MSP_MODE_BTSC 8
#define MSP_MODE_EXTERN 9
#define SCART_MASK 0
#define SCART_IN1 1
#define SCART_IN2 2
......@@ -36,4 +76,77 @@ struct msp_matrix {
#define SCART1_OUT 1
#define SCART2_OUT 2
#define OPMODE_AUTO -1
#define OPMODE_MANUAL 0
#define OPMODE_AUTODETECT 1 /* use autodetect (>= msp3410 only) */
#define OPMODE_AUTOSELECT 2 /* use autodetect & autoselect (>= msp34xxG) */
/* module parameters */
extern int debug;
extern int once;
extern int amsound;
extern int standard;
extern int dolby;
extern int stereo_threshold;
struct msp_state {
int rev1, rev2;
int opmode;
int mode;
int norm;
int stereo;
int nicam_on;
int acb;
int in_scart;
int i2s_mode;
int main, second; /* sound carrier */
int input;
int source; /* see msp34xxg_set_source */
/* v4l2 */
int audmode;
int rxsubchans;
int muted;
int volume, balance;
int bass, treble;
/* thread */
struct task_struct *kthread;
wait_queue_head_t wq;
int restart:1;
int watch_stereo:1;
};
#define VIDEO_MODE_RADIO 16 /* norm magic for radio mode */
#define HAVE_NICAM(state) (((state->rev2 >> 8) & 0xff) != 0)
#define HAVE_RADIO(state) ((state->rev1 & 0x0f) >= 'G'-'@')
/* msp3400-driver.c */
int msp_write_dem(struct i2c_client *client, int addr, int val);
int msp_write_dsp(struct i2c_client *client, int addr, int val);
int msp_read_dem(struct i2c_client *client, int addr);
int msp_read_dsp(struct i2c_client *client, int addr);
int msp_reset(struct i2c_client *client);
void msp_set_scart(struct i2c_client *client, int in, int out);
void msp_set_mute(struct i2c_client *client);
void msp_set_audio(struct i2c_client *client);
int msp_modus(struct i2c_client *client, int norm);
int msp_standard(int norm);
int msp_sleep(struct msp_state *state, int timeout);
/* msp3400-kthreads.c */
const char *msp_standard_mode_name(int mode);
void msp3400c_setcarrier(struct i2c_client *client, int cdo1, int cdo2);
void msp3400c_setmode(struct i2c_client *client, int type);
void msp3400c_setstereo(struct i2c_client *client, int mode);
int autodetect_stereo(struct i2c_client *client);
int msp3400c_thread(void *data);
int msp3410d_thread(void *data);
int msp34xxg_thread(void *data);
void msp34xxg_detect_stereo(struct i2c_client *client);
void msp34xxg_set_audmode(struct i2c_client *client, int audmode);
#endif /* MSP3400_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment