diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/compat_ioctl.h | 26 | ||||
| -rw-r--r-- | include/linux/dvb/frontend.h | 10 | ||||
| -rw-r--r-- | include/linux/i2c-id.h | 1 | ||||
| -rw-r--r-- | include/linux/video_decoder.h | 2 | ||||
| -rw-r--r-- | include/linux/videodev2.h | 16 | ||||
| -rw-r--r-- | include/media/audiochip.h | 16 | ||||
| -rw-r--r-- | include/media/saa7146_vv.h | 2 | ||||
| -rw-r--r-- | include/media/tuner.h | 98 | ||||
| -rw-r--r-- | include/media/v4l2-common.h | 85 |
9 files changed, 150 insertions, 106 deletions
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index 119f9d064cc6..339878952f12 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
| @@ -218,32 +218,6 @@ COMPATIBLE_IOCTL(VT_RESIZE) | |||
| 218 | COMPATIBLE_IOCTL(VT_RESIZEX) | 218 | COMPATIBLE_IOCTL(VT_RESIZEX) |
| 219 | COMPATIBLE_IOCTL(VT_LOCKSWITCH) | 219 | COMPATIBLE_IOCTL(VT_LOCKSWITCH) |
| 220 | COMPATIBLE_IOCTL(VT_UNLOCKSWITCH) | 220 | COMPATIBLE_IOCTL(VT_UNLOCKSWITCH) |
| 221 | /* Little v */ | ||
| 222 | /* Little v, the video4linux ioctls (conflict?) */ | ||
| 223 | COMPATIBLE_IOCTL(VIDIOCGCAP) | ||
| 224 | COMPATIBLE_IOCTL(VIDIOCGCHAN) | ||
| 225 | COMPATIBLE_IOCTL(VIDIOCSCHAN) | ||
| 226 | COMPATIBLE_IOCTL(VIDIOCGPICT) | ||
| 227 | COMPATIBLE_IOCTL(VIDIOCSPICT) | ||
| 228 | COMPATIBLE_IOCTL(VIDIOCCAPTURE) | ||
| 229 | COMPATIBLE_IOCTL(VIDIOCKEY) | ||
| 230 | COMPATIBLE_IOCTL(VIDIOCGAUDIO) | ||
| 231 | COMPATIBLE_IOCTL(VIDIOCSAUDIO) | ||
| 232 | COMPATIBLE_IOCTL(VIDIOCSYNC) | ||
| 233 | COMPATIBLE_IOCTL(VIDIOCMCAPTURE) | ||
| 234 | COMPATIBLE_IOCTL(VIDIOCGMBUF) | ||
| 235 | COMPATIBLE_IOCTL(VIDIOCGUNIT) | ||
| 236 | COMPATIBLE_IOCTL(VIDIOCGCAPTURE) | ||
| 237 | COMPATIBLE_IOCTL(VIDIOCSCAPTURE) | ||
| 238 | /* BTTV specific... */ | ||
| 239 | COMPATIBLE_IOCTL(_IOW('v', BASE_VIDIOCPRIVATE+0, char [256])) | ||
| 240 | COMPATIBLE_IOCTL(_IOR('v', BASE_VIDIOCPRIVATE+1, char [256])) | ||
| 241 | COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+2, unsigned int)) | ||
| 242 | COMPATIBLE_IOCTL(_IOW('v' , BASE_VIDIOCPRIVATE+3, char [16])) /* struct bttv_pll_info */ | ||
| 243 | COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+4, int)) | ||
| 244 | COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+5, int)) | ||
| 245 | COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+6, int)) | ||
| 246 | COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+7, int)) | ||
| 247 | /* Little p (/dev/rtc, /dev/envctrl, etc.) */ | 221 | /* Little p (/dev/rtc, /dev/envctrl, etc.) */ |
| 248 | COMPATIBLE_IOCTL(RTC_AIE_ON) | 222 | COMPATIBLE_IOCTL(RTC_AIE_ON) |
| 249 | COMPATIBLE_IOCTL(RTC_AIE_OFF) | 223 | COMPATIBLE_IOCTL(RTC_AIE_OFF) |
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index d41df7047ed7..c8cbd90ba375 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h | |||
| @@ -240,6 +240,15 @@ struct dvb_frontend_event { | |||
| 240 | }; | 240 | }; |
| 241 | 241 | ||
| 242 | 242 | ||
| 243 | /** | ||
| 244 | * When set, this flag will disable any zigzagging or other "normal" tuning | ||
| 245 | * behaviour. Additionally, there will be no automatic monitoring of the lock | ||
| 246 | * status, and hence no frontend events will be generated. If a frontend device | ||
| 247 | * is closed, this flag will be automatically turned off when the device is | ||
| 248 | * reopened read-write. | ||
| 249 | */ | ||
| 250 | #define FE_TUNE_MODE_ONESHOT 0x01 | ||
| 251 | |||
| 243 | 252 | ||
| 244 | #define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info) | 253 | #define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info) |
| 245 | 254 | ||
| @@ -260,6 +269,7 @@ struct dvb_frontend_event { | |||
| 260 | 269 | ||
| 261 | #define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters) | 270 | #define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters) |
| 262 | #define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters) | 271 | #define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters) |
| 272 | #define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */ | ||
| 263 | #define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event) | 273 | #define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event) |
| 264 | 274 | ||
| 265 | #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ | 275 | #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index fb46f8d56999..6ff2d365895f 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
| @@ -103,6 +103,7 @@ | |||
| 103 | #define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */ | 103 | #define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */ |
| 104 | #define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ | 104 | #define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ |
| 105 | #define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ | 105 | #define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ |
| 106 | #define I2C_DRIVERID_TVP5150 76 /* TVP5150 video decoder */ | ||
| 106 | 107 | ||
| 107 | #define I2C_DRIVERID_I2CDEV 900 | 108 | #define I2C_DRIVERID_I2CDEV 900 |
| 108 | #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ | 109 | #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ |
diff --git a/include/linux/video_decoder.h b/include/linux/video_decoder.h index 0e9e48b83e3b..121e26da2c18 100644 --- a/include/linux/video_decoder.h +++ b/include/linux/video_decoder.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef _LINUX_VIDEO_DECODER_H | 1 | #ifndef _LINUX_VIDEO_DECODER_H |
| 2 | #define _LINUX_VIDEO_DECODER_H | 2 | #define _LINUX_VIDEO_DECODER_H |
| 3 | 3 | ||
| 4 | #define HAVE_VIDEO_DECODER 1 | ||
| 5 | |||
| 4 | struct video_decoder_capability { /* this name is too long */ | 6 | struct video_decoder_capability { /* this name is too long */ |
| 5 | __u32 flags; | 7 | __u32 flags; |
| 6 | #define VIDEO_DECODER_PAL 1 /* can decode PAL signal */ | 8 | #define VIDEO_DECODER_PAL 1 /* can decode PAL signal */ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 1cded681eb6d..ce40675324bd 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
| @@ -642,6 +642,12 @@ typedef __u64 v4l2_std_id; | |||
| 642 | #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) | 642 | #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) |
| 643 | #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000) | 643 | #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000) |
| 644 | 644 | ||
| 645 | /* some merged standards */ | ||
| 646 | #define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC) | ||
| 647 | #define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B) | ||
| 648 | #define V4L2_STD_GH (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H) | ||
| 649 | #define V4L2_STD_DK (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK) | ||
| 650 | |||
| 645 | /* some common needed stuff */ | 651 | /* some common needed stuff */ |
| 646 | #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\ | 652 | #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\ |
| 647 | V4L2_STD_PAL_B1 |\ | 653 | V4L2_STD_PAL_B1 |\ |
| @@ -662,7 +668,8 @@ typedef __u64 v4l2_std_id; | |||
| 662 | V4L2_STD_SECAM_G |\ | 668 | V4L2_STD_SECAM_G |\ |
| 663 | V4L2_STD_SECAM_H |\ | 669 | V4L2_STD_SECAM_H |\ |
| 664 | V4L2_STD_SECAM_DK |\ | 670 | V4L2_STD_SECAM_DK |\ |
| 665 | V4L2_STD_SECAM_L) | 671 | V4L2_STD_SECAM_L |\ |
| 672 | V4L2_STD_SECAM_LC) | ||
| 666 | 673 | ||
| 667 | #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ | 674 | #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ |
| 668 | V4L2_STD_PAL_60 |\ | 675 | V4L2_STD_PAL_60 |\ |
| @@ -888,7 +895,6 @@ struct v4l2_audio | |||
| 888 | 895 | ||
| 889 | /* Flags for the 'mode' field */ | 896 | /* Flags for the 'mode' field */ |
| 890 | #define V4L2_AUDMODE_AVL 0x00001 | 897 | #define V4L2_AUDMODE_AVL 0x00001 |
| 891 | #define V4L2_AUDMODE_32BITS 0x00002 | ||
| 892 | 898 | ||
| 893 | struct v4l2_audioout | 899 | struct v4l2_audioout |
| 894 | { | 900 | { |
| @@ -1110,7 +1116,6 @@ int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local); | |||
| 1110 | /* names for fancy debug output */ | 1116 | /* names for fancy debug output */ |
| 1111 | extern char *v4l2_field_names[]; | 1117 | extern char *v4l2_field_names[]; |
| 1112 | extern char *v4l2_type_names[]; | 1118 | extern char *v4l2_type_names[]; |
| 1113 | extern char *v4l2_ioctl_names[]; | ||
| 1114 | 1119 | ||
| 1115 | /* Compatibility layer interface -- v4l1-compat module */ | 1120 | /* Compatibility layer interface -- v4l1-compat module */ |
| 1116 | typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, | 1121 | typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, |
| @@ -1118,6 +1123,11 @@ typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, | |||
| 1118 | int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, | 1123 | int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, |
| 1119 | int cmd, void *arg, v4l2_kioctl driver_ioctl); | 1124 | int cmd, void *arg, v4l2_kioctl driver_ioctl); |
| 1120 | 1125 | ||
| 1126 | /* 32 Bits compatibility layer for 64 bits processors */ | ||
| 1127 | extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, | ||
| 1128 | unsigned long arg); | ||
| 1129 | |||
| 1130 | |||
| 1121 | #endif /* __KERNEL__ */ | 1131 | #endif /* __KERNEL__ */ |
| 1122 | #endif /* __LINUX_VIDEODEV2_H */ | 1132 | #endif /* __LINUX_VIDEODEV2_H */ |
| 1123 | 1133 | ||
diff --git a/include/media/audiochip.h b/include/media/audiochip.h index b7d4b0930408..295d256ee811 100644 --- a/include/media/audiochip.h +++ b/include/media/audiochip.h | |||
| @@ -23,11 +23,6 @@ enum audiochip { | |||
| 23 | 23 | ||
| 24 | /* ---------------------------------------------------------------------- */ | 24 | /* ---------------------------------------------------------------------- */ |
| 25 | 25 | ||
| 26 | /* v4l device was opened in Radio mode */ | ||
| 27 | #define AUDC_SET_RADIO _IO('m',2) | ||
| 28 | /* select from TV,radio,extern,MUTE */ | ||
| 29 | #define AUDC_SET_INPUT _IOW('m',17,int) | ||
| 30 | |||
| 31 | /* audio inputs */ | 26 | /* audio inputs */ |
| 32 | #define AUDIO_TUNER 0x00 | 27 | #define AUDIO_TUNER 0x00 |
| 33 | #define AUDIO_RADIO 0x01 | 28 | #define AUDIO_RADIO 0x01 |
| @@ -40,15 +35,4 @@ enum audiochip { | |||
| 40 | #define AUDIO_MUTE 0x80 | 35 | #define AUDIO_MUTE 0x80 |
| 41 | #define AUDIO_UNMUTE 0x81 | 36 | #define AUDIO_UNMUTE 0x81 |
| 42 | 37 | ||
| 43 | /* all the stuff below is obsolete and just here for reference. I'll | ||
| 44 | * remove it once the driver is tested and works fine. | ||
| 45 | * | ||
| 46 | * Instead creating alot of tiny API's for all kinds of different | ||
| 47 | * chips, we'll just pass throuth the v4l ioctl structs (v4l2 not | ||
| 48 | * yet...). It is a bit less flexible, but most/all used i2c chips | ||
| 49 | * make sense in v4l context only. So I think that's acceptable... | ||
| 50 | */ | ||
| 51 | |||
| 52 | /* misc stuff to pass around config info to i2c chips */ | ||
| 53 | #define AUDC_CONFIG_PINNACLE _IOW('m',32,int) | ||
| 54 | #endif /* AUDIOCHIP_H */ | 38 | #endif /* AUDIOCHIP_H */ |
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h index 16af9299315f..e5e749e984ee 100644 --- a/include/media/saa7146_vv.h +++ b/include/media/saa7146_vv.h | |||
| @@ -178,6 +178,8 @@ struct saa7146_ext_vv | |||
| 178 | 178 | ||
| 179 | struct saa7146_extension_ioctls *ioctls; | 179 | struct saa7146_extension_ioctls *ioctls; |
| 180 | int (*ioctl)(struct saa7146_fh*, unsigned int cmd, void *arg); | 180 | int (*ioctl)(struct saa7146_fh*, unsigned int cmd, void *arg); |
| 181 | |||
| 182 | struct file_operations vbi_fops; | ||
| 181 | }; | 183 | }; |
| 182 | 184 | ||
| 183 | struct saa7146_use_ops { | 185 | struct saa7146_use_ops { |
diff --git a/include/media/tuner.h b/include/media/tuner.h index b37cde606692..7674b121ce8b 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
| @@ -82,9 +82,9 @@ | |||
| 82 | #define TUNER_PHILIPS_FM1236_MK3 43 | 82 | #define TUNER_PHILIPS_FM1236_MK3 43 |
| 83 | 83 | ||
| 84 | #define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ | 84 | #define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ |
| 85 | /* Microtune mergeged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */ | 85 | /* Microtune merged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */ |
| 86 | #define TUNER_MICROTUNE_4049FM5 45 | 86 | #define TUNER_MICROTUNE_4049FM5 45 |
| 87 | #define TUNER_MICROTUNE_4042_FI5 46 | 87 | #define TUNER_PANASONIC_VP27 46 |
| 88 | #define TUNER_LG_NTSC_TAPE 47 | 88 | #define TUNER_LG_NTSC_TAPE 47 |
| 89 | 89 | ||
| 90 | #define TUNER_TNF_8831BGFF 48 | 90 | #define TUNER_TNF_8831BGFF 48 |
| @@ -102,7 +102,7 @@ | |||
| 102 | #define TUNER_YMEC_TVF_8531MF 58 | 102 | #define TUNER_YMEC_TVF_8531MF 58 |
| 103 | #define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */ | 103 | #define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */ |
| 104 | 104 | ||
| 105 | #define TUNER_THOMSON_DTT7611 60 /* DViCO FusionHDTV 3 Gold-T */ | 105 | #define TUNER_THOMSON_DTT761X 60 /* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */ |
| 106 | #define TUNER_TENA_9533_DI 61 | 106 | #define TUNER_TENA_9533_DI 61 |
| 107 | #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ | 107 | #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ |
| 108 | #define TUNER_PHILIPS_FMD1216ME_MK3 63 | 108 | #define TUNER_PHILIPS_FMD1216ME_MK3 63 |
| @@ -115,47 +115,26 @@ | |||
| 115 | #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ | 115 | #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ |
| 116 | #define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ | 116 | #define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ |
| 117 | 117 | ||
| 118 | #define NOTUNER 0 | ||
| 119 | #define PAL 1 /* PAL_BG */ | ||
| 120 | #define PAL_I 2 | ||
| 121 | #define NTSC 3 | ||
| 122 | #define SECAM 4 | ||
| 123 | #define ATSC 5 | ||
| 124 | #define RADIO 6 | ||
| 125 | |||
| 126 | #define NoTuner 0 | ||
| 127 | #define Philips 1 | ||
| 128 | #define TEMIC 2 | ||
| 129 | #define Sony 3 | ||
| 130 | #define Alps 4 | ||
| 131 | #define LGINNOTEK 5 | ||
| 132 | #define SHARP 6 | ||
| 133 | #define Samsung 7 | ||
| 134 | #define Microtune 8 | ||
| 135 | #define HITACHI 9 | ||
| 136 | #define Panasonic 10 | ||
| 137 | #define TCL 11 | ||
| 138 | #define THOMSON 12 | ||
| 139 | |||
| 140 | #define TUNER_SET_TYPE_ADDR _IOW('T',3,int) | ||
| 141 | #define TUNER_SET_STANDBY _IOW('T',4,int) | ||
| 142 | #define TDA9887_SET_CONFIG _IOW('t',5,int) | ||
| 143 | |||
| 144 | /* tv card specific */ | 118 | /* tv card specific */ |
| 145 | # define TDA9887_PRESENT (1<<0) | 119 | #define TDA9887_PRESENT (1<<0) |
| 146 | # define TDA9887_PORT1_INACTIVE (1<<1) | 120 | #define TDA9887_PORT1_INACTIVE (1<<1) |
| 147 | # define TDA9887_PORT2_INACTIVE (1<<2) | 121 | #define TDA9887_PORT2_INACTIVE (1<<2) |
| 148 | # define TDA9887_QSS (1<<3) | 122 | #define TDA9887_QSS (1<<3) |
| 149 | # define TDA9887_INTERCARRIER (1<<4) | 123 | #define TDA9887_INTERCARRIER (1<<4) |
| 150 | # define TDA9887_PORT1_ACTIVE (1<<5) | 124 | #define TDA9887_PORT1_ACTIVE (1<<5) |
| 151 | # define TDA9887_PORT2_ACTIVE (1<<6) | 125 | #define TDA9887_PORT2_ACTIVE (1<<6) |
| 152 | # define TDA9887_INTERCARRIER_NTSC (1<<7) | 126 | #define TDA9887_INTERCARRIER_NTSC (1<<7) |
| 127 | /* Tuner takeover point adjustment, in dB, -16 <= top <= 15 */ | ||
| 128 | #define TDA9887_TOP_MASK (0x3f << 8) | ||
| 129 | #define TDA9887_TOP_SET (1 << 13) | ||
| 130 | #define TDA9887_TOP(top) (TDA9887_TOP_SET | (((16 + (top)) & 0x1f) << 8)) | ||
| 131 | |||
| 153 | /* config options */ | 132 | /* config options */ |
| 154 | # define TDA9887_DEEMPHASIS_MASK (3<<16) | 133 | #define TDA9887_DEEMPHASIS_MASK (3<<16) |
| 155 | # define TDA9887_DEEMPHASIS_NONE (1<<16) | 134 | #define TDA9887_DEEMPHASIS_NONE (1<<16) |
| 156 | # define TDA9887_DEEMPHASIS_50 (2<<16) | 135 | #define TDA9887_DEEMPHASIS_50 (2<<16) |
| 157 | # define TDA9887_DEEMPHASIS_75 (3<<16) | 136 | #define TDA9887_DEEMPHASIS_75 (3<<16) |
| 158 | # define TDA9887_AUTOMUTE (1<<18) | 137 | #define TDA9887_AUTOMUTE (1<<18) |
| 159 | 138 | ||
| 160 | #ifdef __KERNEL__ | 139 | #ifdef __KERNEL__ |
| 161 | 140 | ||
| @@ -167,10 +146,26 @@ enum tuner_mode { | |||
| 167 | T_STANDBY = 1 << 31 | 146 | T_STANDBY = 1 << 31 |
| 168 | }; | 147 | }; |
| 169 | 148 | ||
| 149 | /* Older boards only had a single tuner device. Nowadays multiple tuner | ||
| 150 | devices may be present on a single board. Using TUNER_SET_TYPE_ADDR | ||
| 151 | to pass the tuner_setup structure it is possible to setup each tuner | ||
| 152 | device in turn. | ||
| 153 | |||
| 154 | Since multiple devices may be present it is no longer sufficient to | ||
| 155 | send a command to a single i2c device. Instead you should broadcast | ||
| 156 | the command to all i2c devices. | ||
| 157 | |||
| 158 | By setting the mode_mask correctly you can select which commands are | ||
| 159 | accepted by a specific tuner device. For example, set mode_mask to | ||
| 160 | T_RADIO if the device is a radio-only tuner. That specific tuner will | ||
| 161 | only accept commands when the tuner is in radio mode and ignore them | ||
| 162 | when the tuner is set to TV mode. | ||
| 163 | */ | ||
| 164 | |||
| 170 | struct tuner_setup { | 165 | struct tuner_setup { |
| 171 | unsigned short addr; | 166 | unsigned short addr; /* I2C address */ |
| 172 | unsigned int type; | 167 | unsigned int type; /* Tuner type */ |
| 173 | unsigned int mode_mask; | 168 | unsigned int mode_mask; /* Allowed tuner modes */ |
| 174 | }; | 169 | }; |
| 175 | 170 | ||
| 176 | struct tuner { | 171 | struct tuner { |
| @@ -207,7 +202,6 @@ struct tuner { | |||
| 207 | void (*standby)(struct i2c_client *c); | 202 | void (*standby)(struct i2c_client *c); |
| 208 | }; | 203 | }; |
| 209 | 204 | ||
| 210 | extern unsigned int tuner_debug; | ||
| 211 | extern unsigned const int tuner_count; | 205 | extern unsigned const int tuner_count; |
| 212 | 206 | ||
| 213 | extern int microtune_init(struct i2c_client *c); | 207 | extern int microtune_init(struct i2c_client *c); |
| @@ -219,15 +213,15 @@ extern int tea5767_autodetection(struct i2c_client *c); | |||
| 219 | 213 | ||
| 220 | #define tuner_warn(fmt, arg...) do {\ | 214 | #define tuner_warn(fmt, arg...) do {\ |
| 221 | printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ | 215 | printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
| 222 | t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) | 216 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
| 223 | #define tuner_info(fmt, arg...) do {\ | 217 | #define tuner_info(fmt, arg...) do {\ |
| 224 | printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ | 218 | printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
| 225 | t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) | 219 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
| 226 | #define tuner_dbg(fmt, arg...) do {\ | 220 | #define tuner_dbg(fmt, arg...) do {\ |
| 227 | if (tuner_debug) \ | 221 | extern int debug; \ |
| 228 | printk(KERN_DEBUG "%s %d-%04x: " fmt, \ | 222 | if (debug) \ |
| 229 | t->i2c.driver->driver.name, \ | 223 | printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
| 230 | t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) | 224 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
| 231 | 225 | ||
| 232 | #endif /* __KERNEL__ */ | 226 | #endif /* __KERNEL__ */ |
| 233 | 227 | ||
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index d3fd48157eb8..3cc3132f391e 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
| @@ -26,12 +26,57 @@ | |||
| 26 | #ifndef V4L2_COMMON_H_ | 26 | #ifndef V4L2_COMMON_H_ |
| 27 | #define V4L2_COMMON_H_ | 27 | #define V4L2_COMMON_H_ |
| 28 | 28 | ||
| 29 | /* VIDIOC_INT_AUDIO_CLOCK_FREQ */ | 29 | /* v4l debugging and diagnostics */ |
| 30 | enum v4l2_audio_clock_freq { | 30 | |
| 31 | V4L2_AUDCLK_32_KHZ = 32000, | 31 | /* Common printk constucts for v4l-i2c drivers. These macros create a unique |
| 32 | V4L2_AUDCLK_441_KHZ = 44100, | 32 | prefix consisting of the driver name, the adapter number and the i2c |
| 33 | V4L2_AUDCLK_48_KHZ = 48000, | 33 | address. */ |
| 34 | }; | 34 | #define v4l_printk(level, name, adapter, addr, fmt, arg...) \ |
| 35 | printk(level "%s %d-%04x: " fmt, name, i2c_adapter_id(adapter), addr , ## arg) | ||
| 36 | |||
| 37 | #define v4l_client_printk(level, client, fmt, arg...) \ | ||
| 38 | v4l_printk(level, (client)->driver->driver.name, (client)->adapter, \ | ||
| 39 | (client)->addr, fmt , ## arg) | ||
| 40 | |||
| 41 | #define v4l_err(client, fmt, arg...) \ | ||
| 42 | v4l_client_printk(KERN_ERR, client, fmt , ## arg) | ||
| 43 | |||
| 44 | #define v4l_warn(client, fmt, arg...) \ | ||
| 45 | v4l_client_printk(KERN_WARNING, client, fmt , ## arg) | ||
| 46 | |||
| 47 | #define v4l_info(client, fmt, arg...) \ | ||
| 48 | v4l_client_printk(KERN_INFO, client, fmt , ## arg) | ||
| 49 | |||
| 50 | /* These three macros assume that the debug level is set with a module | ||
| 51 | parameter called 'debug'. */ | ||
| 52 | #define v4l_dbg(level, client, fmt, arg...) \ | ||
| 53 | do { \ | ||
| 54 | extern int debug; \ | ||
| 55 | if (debug >= (level)) \ | ||
| 56 | v4l_client_printk(KERN_DEBUG, client, fmt , ## arg); \ | ||
| 57 | } while (0) | ||
| 58 | |||
| 59 | /* Prints the ioctl in a human-readable format */ | ||
| 60 | extern void v4l_printk_ioctl(unsigned int cmd); | ||
| 61 | |||
| 62 | /* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */ | ||
| 63 | #define v4l_print_ioctl(name, cmd) \ | ||
| 64 | do { \ | ||
| 65 | printk(KERN_DEBUG "%s: ", name); \ | ||
| 66 | v4l_printk_ioctl(cmd); \ | ||
| 67 | } while (0) | ||
| 68 | |||
| 69 | /* Use this macro in I2C drivers where 'client' is the struct i2c_client | ||
| 70 | pointer */ | ||
| 71 | #define v4l_i2c_print_ioctl(client, cmd) \ | ||
| 72 | do { \ | ||
| 73 | v4l_client_printk(KERN_DEBUG, client, ""); \ | ||
| 74 | v4l_printk_ioctl(cmd); \ | ||
| 75 | } while (0) | ||
| 76 | |||
| 77 | /* ------------------------------------------------------------------------- */ | ||
| 78 | |||
| 79 | /* Internal ioctls */ | ||
| 35 | 80 | ||
| 36 | /* VIDIOC_INT_G_REGISTER and VIDIOC_INT_S_REGISTER */ | 81 | /* VIDIOC_INT_G_REGISTER and VIDIOC_INT_S_REGISTER */ |
| 37 | struct v4l2_register { | 82 | struct v4l2_register { |
| @@ -70,6 +115,20 @@ enum v4l2_chip_ident { | |||
| 70 | V4L2_IDENT_CX25843 = 243, | 115 | V4L2_IDENT_CX25843 = 243, |
| 71 | }; | 116 | }; |
| 72 | 117 | ||
| 118 | /* audio ioctls */ | ||
| 119 | /* v4l device was opened in Radio mode */ | ||
| 120 | #define AUDC_SET_RADIO _IO('d',88) | ||
| 121 | /* select from TV,radio,extern,MUTE */ | ||
| 122 | #define AUDC_SET_INPUT _IOW('d',89,int) | ||
| 123 | |||
| 124 | /* tuner ioctls */ | ||
| 125 | /* Sets tuner type and its I2C addr */ | ||
| 126 | #define TUNER_SET_TYPE_ADDR _IOW('d',90,int) | ||
| 127 | /* Puts tuner on powersaving state, disabling it, except for i2c */ | ||
| 128 | #define TUNER_SET_STANDBY _IOW('d',91,int) | ||
| 129 | /* Sets tda9887 specific stuff, like port1, port2 and qss */ | ||
| 130 | #define TDA9887_SET_CONFIG _IOW('d',92,int) | ||
| 131 | |||
| 73 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | 132 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ |
| 74 | #define VIDIOC_INT_S_REGISTER _IOR ('d', 100, struct v4l2_register) | 133 | #define VIDIOC_INT_S_REGISTER _IOR ('d', 100, struct v4l2_register) |
| 75 | #define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register) | 134 | #define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register) |
| @@ -77,10 +136,12 @@ enum v4l2_chip_ident { | |||
| 77 | /* Reset the I2C chip */ | 136 | /* Reset the I2C chip */ |
| 78 | #define VIDIOC_INT_RESET _IO ('d', 102) | 137 | #define VIDIOC_INT_RESET _IO ('d', 102) |
| 79 | 138 | ||
| 80 | /* Set the frequency of the audio clock output. | 139 | /* Set the frequency (in Hz) of the audio clock output. |
| 81 | Used to slave an audio processor to the video decoder, ensuring that audio | 140 | Used to slave an audio processor to the video decoder, ensuring that audio |
| 82 | and video remain synchronized. */ | 141 | and video remain synchronized. |
| 83 | #define VIDIOC_INT_AUDIO_CLOCK_FREQ _IOR ('d', 103, enum v4l2_audio_clock_freq) | 142 | Usual values for the frequency are 48000, 44100 or 32000 Hz. |
| 143 | If the frequency is not supported, then -EINVAL is returned. */ | ||
| 144 | #define VIDIOC_INT_AUDIO_CLOCK_FREQ _IOW ('d', 103, u32) | ||
| 84 | 145 | ||
| 85 | /* Video decoders that support sliced VBI need to implement this ioctl. | 146 | /* Video decoders that support sliced VBI need to implement this ioctl. |
| 86 | Field p of the v4l2_sliced_vbi_line struct is set to the start of the VBI | 147 | Field p of the v4l2_sliced_vbi_line struct is set to the start of the VBI |
| @@ -107,4 +168,10 @@ enum v4l2_chip_ident { | |||
| 107 | be made. */ | 168 | be made. */ |
| 108 | #define VIDIOC_INT_G_CHIP_IDENT _IOR ('d', 107, enum v4l2_chip_ident *) | 169 | #define VIDIOC_INT_G_CHIP_IDENT _IOR ('d', 107, enum v4l2_chip_ident *) |
| 109 | 170 | ||
| 171 | /* Sets I2S speed in bps. This is used to provide a standard way to select I2S | ||
| 172 | clock used by driving digital audio streams at some board designs. | ||
| 173 | Usual values for the frequency are 1024000 and 2048000. | ||
| 174 | If the frequency is not supported, then -EINVAL is returned. */ | ||
| 175 | #define VIDIOC_INT_I2S_CLOCK_FREQ _IOW ('d', 108, u32) | ||
| 176 | |||
| 110 | #endif /* V4L2_COMMON_H_ */ | 177 | #endif /* V4L2_COMMON_H_ */ |
