summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2004-03-23 17:56:53 +0000
committerJohannes Stezenbach <devnull@localhost>2004-03-23 17:56:53 +0000
commitc0b11ab2801cc759620e0b81f51a98cd7aa065c0 (patch)
tree138402a42088d8ff75135321cd187b747b4dc27a /linux/drivers/media
parentca11f46a0ae03be4eda64d4d9dbca2f2fc3df537 (diff)
downloadmediapointer-dvb-s2-c0b11ab2801cc759620e0b81f51a98cd7aa065c0.tar.gz
mediapointer-dvb-s2-c0b11ab2801cc759620e0b81f51a98cd7aa065c0.tar.bz2
introduced some symbolic constants for a/v dec cmds
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_av.c44
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_hw.h28
2 files changed, 48 insertions, 24 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110_av.c b/linux/drivers/media/dvb/ttpci/av7110_av.c
index b4fd1cd8f..054e2e90d 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_av.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_av.c
@@ -975,7 +975,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY)
av7110_av_stop(av7110, RP_VIDEO);
else
- vidcom(av7110, 0x000e,
+ vidcom(av7110, VIDEO_CMD_STOP,
av7110->videostate.video_blank ? 0 : 1);
av7110->trickmode = TRICK_NONE;
break;
@@ -984,7 +984,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
av7110->trickmode = TRICK_NONE;
if (av7110->videostate.play_state == VIDEO_FREEZED) {
av7110->videostate.play_state = VIDEO_PLAYING;
- vidcom(av7110, 0x000d, 0);
+ vidcom(av7110, VIDEO_CMD_PLAY, 0);
}
if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY) {
@@ -993,10 +993,10 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
av7110->playing &= ~RP_VIDEO;
}
av7110_av_start_play(av7110, RP_VIDEO);
- vidcom(av7110, 0x000d, 0);
+ vidcom(av7110, VIDEO_CMD_PLAY, 0);
} else {
//av7110_av_stop(av7110, RP_VIDEO);
- vidcom(av7110, 0x000d, 0);
+ vidcom(av7110, VIDEO_CMD_PLAY, 0);
}
av7110->videostate.play_state = VIDEO_PLAYING;
break;
@@ -1006,14 +1006,14 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
if (av7110->playing & RP_VIDEO)
av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Pause, 0);
else
- vidcom(av7110, 0x0102, 1);
+ vidcom(av7110, VIDEO_CMD_FREEZE, 1);
av7110->trickmode = TRICK_FREEZE;
break;
case VIDEO_CONTINUE:
if (av7110->playing & RP_VIDEO)
av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Continue, 0);
- vidcom(av7110, 0x000d, 0);
+ vidcom(av7110, VIDEO_CMD_PLAY, 0);
av7110->videostate.play_state = VIDEO_PLAYING;
av7110->trickmode = TRICK_NONE;
break;
@@ -1094,7 +1094,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,
__Scan_I, 2, AV_PES, 0);
else
- vidcom(av7110, 0x16, arg);
+ vidcom(av7110, VIDEO_CMD_FFWD, arg);
av7110->trickmode = TRICK_FAST;
av7110->videostate.play_state = VIDEO_PLAYING;
break;
@@ -1102,11 +1102,11 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
case VIDEO_SLOWMOTION:
if (av7110->playing&RP_VIDEO) {
av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Slow, 2, 0, 0);
- vidcom(av7110, 0x22, arg);
+ vidcom(av7110, VIDEO_CMD_SLOW, arg);
} else {
- vidcom(av7110, 0x0d, 0);
- vidcom(av7110, 0x0e, 0);
- vidcom(av7110, 0x22, arg);
+ vidcom(av7110, VIDEO_CMD_PLAY, 0);
+ vidcom(av7110, VIDEO_CMD_STOP, 0);
+ vidcom(av7110, VIDEO_CMD_SLOW, arg);
}
av7110->trickmode = TRICK_SLOW;
av7110->videostate.play_state = VIDEO_PLAYING;
@@ -1130,10 +1130,10 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
if (av7110->trickmode == TRICK_SLOW) {
av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,
__Slow, 2, 0, 0);
- vidcom(av7110, 0x22, arg);
+ vidcom(av7110, VIDEO_CMD_SLOW, arg);
}
if (av7110->trickmode == TRICK_FREEZE)
- vidcom(av7110, 0x000e, 1);
+ vidcom(av7110, VIDEO_CMD_STOP, 1);
}
break;
@@ -1167,26 +1167,26 @@ static int dvb_audio_ioctl(struct inode *inode, struct file *file,
if (av7110->audiostate.stream_source == AUDIO_SOURCE_MEMORY)
av7110_av_stop(av7110, RP_AUDIO);
else
- audcom(av7110, 1);
+ audcom(av7110, AUDIO_CMD_MUTE);
av7110->audiostate.play_state = AUDIO_STOPPED;
break;
case AUDIO_PLAY:
if (av7110->audiostate.stream_source == AUDIO_SOURCE_MEMORY)
av7110_av_start_play(av7110, RP_AUDIO);
- audcom(av7110, 2);
+ audcom(av7110, AUDIO_CMD_UNMUTE);
av7110->audiostate.play_state = AUDIO_PLAYING;
break;
case AUDIO_PAUSE:
- audcom(av7110, 1);
+ audcom(av7110, AUDIO_CMD_MUTE);
av7110->audiostate.play_state = AUDIO_PAUSED;
break;
case AUDIO_CONTINUE:
if (av7110->audiostate.play_state == AUDIO_PAUSED) {
av7110->audiostate.play_state = AUDIO_PLAYING;
- audcom(av7110, 0x12);
+ audcom(av7110, AUDIO_CMD_MUTE | AUDIO_CMD_PCM16);
}
break;
@@ -1196,14 +1196,14 @@ static int dvb_audio_ioctl(struct inode *inode, struct file *file,
case AUDIO_SET_MUTE:
{
- audcom(av7110, arg ? 1 : 2);
+ audcom(av7110, arg ? AUDIO_CMD_MUTE : AUDIO_CMD_UNMUTE);
av7110->audiostate.mute_state = (int) arg;
break;
}
case AUDIO_SET_AV_SYNC:
av7110->audiostate.AV_sync_state = (int) arg;
- audcom(av7110, arg ? 0x0f : 0x0e);
+ audcom(av7110, arg ? AUDIO_CMD_SYNC_ON : AUDIO_CMD_SYNC_OFF);
break;
case AUDIO_SET_BYPASS_MODE:
@@ -1215,15 +1215,15 @@ static int dvb_audio_ioctl(struct inode *inode, struct file *file,
switch(av7110->audiostate.channel_select) {
case AUDIO_STEREO:
- audcom(av7110, 0x80);
+ audcom(av7110, AUDIO_CMD_STEREO);
break;
case AUDIO_MONO_LEFT:
- audcom(av7110, 0x100);
+ audcom(av7110, AUDIO_CMD_MONO_L);
break;
case AUDIO_MONO_RIGHT:
- audcom(av7110, 0x200);
+ audcom(av7110, AUDIO_CMD_MONO_R);
break;
default:
diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.h b/linux/drivers/media/dvb/ttpci/av7110_hw.h
index 6dc27e0bd..826ea877b 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_hw.h
+++ b/linux/drivers/media/dvb/ttpci/av7110_hw.h
@@ -200,6 +200,12 @@ enum av7110_rec_play_state {
__Continue
};
+enum av7110_fw_cmd_misc {
+ AV7110_FW_VIDEO_ZOOM = 1,
+ AV7110_FW_VIDEO_COMMAND,
+ AV7110_FW_AUDIO_COMMAND
+};
+
enum av7110_command_type {
COMTYPE_NOCOM,
COMTYPE_PIDFILTER,
@@ -218,6 +224,7 @@ enum av7110_command_type {
COMTYPE_VIDEO,
COMTYPE_AUDIO,
COMTYPE_CI_LL,
+ COMTYPE_MISC = 0x80
};
#define VID_NONE_PREF 0x00 /* No aspect ration processing preferred */
@@ -226,6 +233,23 @@ enum av7110_command_type {
#define VID_VC_AND_PS_PREF 0x03 /* PanScan and vertical Compression if allowed */
#define VID_CENTRE_CUT_PREF 0x05 /* PanScan with zero vector */
+/* MPEG video decoder commands */
+#define VIDEO_CMD_STOP 0x000e
+#define VIDEO_CMD_PLAY 0x000d
+#define VIDEO_CMD_FREEZE 0x0102
+#define VIDEO_CMD_FFWD 0x0016
+#define VIDEO_CMD_SLOW 0x0022
+
+/* MPEG audio decoder commands */
+#define AUDIO_CMD_MUTE 0x0001
+#define AUDIO_CMD_UNMUTE 0x0002
+#define AUDIO_CMD_PCM16 0x0010
+#define AUDIO_CMD_STEREO 0x0080
+#define AUDIO_CMD_MONO_L 0x0100
+#define AUDIO_CMD_MONO_R 0x0200
+#define AUDIO_CMD_SYNC_OFF 0x000e
+#define AUDIO_CMD_SYNC_ON 0x000f
+
/* firmware data interface codes */
#define DATA_NONE 0x00
#define DATA_FSECTION 0x01
@@ -464,14 +488,14 @@ static inline void av7710_set_video_mode(struct av7110 *av7110, int mode)
static int inline vidcom(struct av7110 *av7110, u32 com, u32 arg)
{
- return av7110_fw_cmd(av7110, 0x80, 0x02, 4,
+ return av7110_fw_cmd(av7110, COMTYPE_MISC, AV7110_FW_VIDEO_COMMAND, 4,
(com>>16), (com&0xffff),
(arg>>16), (arg&0xffff));
}
static int inline audcom(struct av7110 *av7110, u32 com)
{
- return av7110_fw_cmd(av7110, 0x80, 0x03, 4,
+ return av7110_fw_cmd(av7110, COMTYPE_MISC, AV7110_FW_AUDIO_COMMAND, 4,
(com>>16), (com&0xffff));
}