diff options
Diffstat (limited to 'include/media/v4l2-common.h')
-rw-r--r-- | include/media/v4l2-common.h | 85 |
1 files changed, 76 insertions, 9 deletions
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_ */ |