diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-30 03:08:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-30 03:08:53 -0400 |
commit | 664a41b8a91bf78a01a751e15175e0008977685a (patch) | |
tree | d9dc15c83400ad2dfb430ff27ae3e7fdc9395856 /include | |
parent | 983236b5741e557451f3ed4ec5ebf1f62a5b2c15 (diff) | |
parent | ee2ce3a0b43d14d792d34cf88e7bc2091096744b (diff) |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (430 commits)
[media] ir-mce_kbd-decoder: include module.h for its facilities
[media] ov5642: include module.h for its facilities
[media] em28xx: Fix DVB-C maxsize for em2884
[media] tda18271c2dd: Fix saw filter configuration for DVB-C @6MHz
[media] v4l: mt9v032: Fix Bayer pattern
[media] V4L: mt9m111: rewrite set_pixfmt
[media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear
[media] V4L: initial driver for ov5642 CMOS sensor
[media] V4L: sh_mobile_ceu_camera: fix Oops when USERPTR mapping fails
[media] V4L: soc-camera: remove soc-camera bus and devices on it
[media] V4L: soc-camera: un-export the soc-camera bus
[media] V4L: sh_mobile_csi2: switch away from using the soc-camera bus notifier
[media] V4L: add media bus configuration subdev operations
[media] V4L: soc-camera: group struct field initialisations together
[media] V4L: soc-camera: remove now unused soc-camera specific PM hooks
[media] V4L: pxa-camera: switch to using standard PM hooks
[media] NetUP Dual DVB-T/C CI RF: force card hardware revision by module param
[media] Don't OOPS if videobuf_dvb_get_frontend return NULL
[media] NetUP Dual DVB-T/C CI RF: load firmware according card revision
[media] omap3isp: Support configurable HS/VS polarities
...
Fix up conflicts:
- arch/arm/mach-omap2/board-rx51-peripherals.c:
cleanup regulator supply definitions in mach-omap2
vs
OMAP3: RX-51: define vdds_csib regulator supply
- drivers/staging/tm6000/tm6000-alsa.c (trivial)
Diffstat (limited to 'include')
26 files changed, 1667 insertions, 85 deletions
diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h index fec66bd24f22..d47bccd604e4 100644 --- a/include/linux/dvb/audio.h +++ b/include/linux/dvb/audio.h | |||
@@ -67,7 +67,7 @@ typedef struct audio_status { | |||
67 | 67 | ||
68 | 68 | ||
69 | typedef | 69 | typedef |
70 | struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */ | 70 | struct audio_karaoke { /* if Vocal1 or Vocal2 are non-zero, they get mixed */ |
71 | int vocal1; /* into left and right t at 70% each */ | 71 | int vocal1; /* into left and right t at 70% each */ |
72 | int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/ | 72 | int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/ |
73 | int melody; /* mixed into the left channel and */ | 73 | int melody; /* mixed into the left channel and */ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 8a4c309d2344..fca24cc50436 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -376,7 +376,16 @@ struct v4l2_pix_format { | |||
376 | #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ | 376 | #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ |
377 | #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ | 377 | #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ |
378 | #define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */ | 378 | #define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */ |
379 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ | 379 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */ |
380 | #define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */ | ||
381 | #define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */ | ||
382 | #define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */ | ||
383 | #define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */ | ||
384 | #define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */ | ||
385 | #define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 ES */ | ||
386 | #define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */ | ||
387 | #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */ | ||
388 | #define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */ | ||
380 | 389 | ||
381 | /* Vendor-specific formats */ | 390 | /* Vendor-specific formats */ |
382 | #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ | 391 | #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ |
@@ -402,6 +411,7 @@ struct v4l2_pix_format { | |||
402 | #define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */ | 411 | #define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */ |
403 | #define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ | 412 | #define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ |
404 | #define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */ | 413 | #define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */ |
414 | #define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */ | ||
405 | 415 | ||
406 | /* | 416 | /* |
407 | * F O R M A T E N U M E R A T I O N | 417 | * F O R M A T E N U M E R A T I O N |
@@ -1026,6 +1036,7 @@ struct v4l2_ext_controls { | |||
1026 | #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ | 1036 | #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ |
1027 | #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ | 1037 | #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ |
1028 | #define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ | 1038 | #define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ |
1039 | #define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */ | ||
1029 | 1040 | ||
1030 | #define V4L2_CTRL_ID_MASK (0x0fffffff) | 1041 | #define V4L2_CTRL_ID_MASK (0x0fffffff) |
1031 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) | 1042 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) |
@@ -1039,6 +1050,7 @@ enum v4l2_ctrl_type { | |||
1039 | V4L2_CTRL_TYPE_INTEGER64 = 5, | 1050 | V4L2_CTRL_TYPE_INTEGER64 = 5, |
1040 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, | 1051 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, |
1041 | V4L2_CTRL_TYPE_STRING = 7, | 1052 | V4L2_CTRL_TYPE_STRING = 7, |
1053 | V4L2_CTRL_TYPE_BITMASK = 8, | ||
1042 | }; | 1054 | }; |
1043 | 1055 | ||
1044 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ | 1056 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ |
@@ -1144,14 +1156,19 @@ enum v4l2_colorfx { | |||
1144 | #define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37) | 1156 | #define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37) |
1145 | #define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38) | 1157 | #define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38) |
1146 | 1158 | ||
1159 | #define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39) | ||
1160 | #define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40) | ||
1161 | |||
1147 | /* last CID + 1 */ | 1162 | /* last CID + 1 */ |
1148 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+39) | 1163 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+41) |
1164 | |||
1165 | /* Minimum number of buffer neede by the device */ | ||
1149 | 1166 | ||
1150 | /* MPEG-class control IDs defined by V4L2 */ | 1167 | /* MPEG-class control IDs defined by V4L2 */ |
1151 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | 1168 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |
1152 | #define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) | 1169 | #define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) |
1153 | 1170 | ||
1154 | /* MPEG streams */ | 1171 | /* MPEG streams, specific to multiplexed streams */ |
1155 | #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0) | 1172 | #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0) |
1156 | enum v4l2_mpeg_stream_type { | 1173 | enum v4l2_mpeg_stream_type { |
1157 | V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */ | 1174 | V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */ |
@@ -1173,7 +1190,7 @@ enum v4l2_mpeg_stream_vbi_fmt { | |||
1173 | V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ | 1190 | V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ |
1174 | }; | 1191 | }; |
1175 | 1192 | ||
1176 | /* MPEG audio */ | 1193 | /* MPEG audio controls specific to multiplexed streams */ |
1177 | #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) | 1194 | #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) |
1178 | enum v4l2_mpeg_audio_sampling_freq { | 1195 | enum v4l2_mpeg_audio_sampling_freq { |
1179 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0, | 1196 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0, |
@@ -1289,7 +1306,7 @@ enum v4l2_mpeg_audio_ac3_bitrate { | |||
1289 | V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18, | 1306 | V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18, |
1290 | }; | 1307 | }; |
1291 | 1308 | ||
1292 | /* MPEG video */ | 1309 | /* MPEG video controls specific to multiplexed streams */ |
1293 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) | 1310 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) |
1294 | enum v4l2_mpeg_video_encoding { | 1311 | enum v4l2_mpeg_video_encoding { |
1295 | V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, | 1312 | V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, |
@@ -1317,6 +1334,141 @@ enum v4l2_mpeg_video_bitrate_mode { | |||
1317 | #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) | 1334 | #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) |
1318 | #define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) | 1335 | #define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) |
1319 | #define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) | 1336 | #define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) |
1337 | #define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212) | ||
1338 | #define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213) | ||
1339 | #define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214) | ||
1340 | #define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215) | ||
1341 | #define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+216) | ||
1342 | enum v4l2_mpeg_video_header_mode { | ||
1343 | V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE = 0, | ||
1344 | V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1, | ||
1345 | |||
1346 | }; | ||
1347 | #define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217) | ||
1348 | #define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218) | ||
1349 | #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219) | ||
1350 | #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220) | ||
1351 | #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221) | ||
1352 | enum v4l2_mpeg_video_multi_slice_mode { | ||
1353 | V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0, | ||
1354 | V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1, | ||
1355 | V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2, | ||
1356 | }; | ||
1357 | #define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222) | ||
1358 | #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300) | ||
1359 | #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301) | ||
1360 | #define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302) | ||
1361 | #define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+303) | ||
1362 | #define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+304) | ||
1363 | #define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+350) | ||
1364 | #define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+351) | ||
1365 | #define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+352) | ||
1366 | #define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+353) | ||
1367 | #define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+354) | ||
1368 | #define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+355) | ||
1369 | #define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+356) | ||
1370 | #define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+357) | ||
1371 | enum v4l2_mpeg_video_h264_entropy_mode { | ||
1372 | V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC = 0, | ||
1373 | V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC = 1, | ||
1374 | }; | ||
1375 | #define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+358) | ||
1376 | #define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+359) | ||
1377 | enum v4l2_mpeg_video_h264_level { | ||
1378 | V4L2_MPEG_VIDEO_H264_LEVEL_1_0 = 0, | ||
1379 | V4L2_MPEG_VIDEO_H264_LEVEL_1B = 1, | ||
1380 | V4L2_MPEG_VIDEO_H264_LEVEL_1_1 = 2, | ||
1381 | V4L2_MPEG_VIDEO_H264_LEVEL_1_2 = 3, | ||
1382 | V4L2_MPEG_VIDEO_H264_LEVEL_1_3 = 4, | ||
1383 | V4L2_MPEG_VIDEO_H264_LEVEL_2_0 = 5, | ||
1384 | V4L2_MPEG_VIDEO_H264_LEVEL_2_1 = 6, | ||
1385 | V4L2_MPEG_VIDEO_H264_LEVEL_2_2 = 7, | ||
1386 | V4L2_MPEG_VIDEO_H264_LEVEL_3_0 = 8, | ||
1387 | V4L2_MPEG_VIDEO_H264_LEVEL_3_1 = 9, | ||
1388 | V4L2_MPEG_VIDEO_H264_LEVEL_3_2 = 10, | ||
1389 | V4L2_MPEG_VIDEO_H264_LEVEL_4_0 = 11, | ||
1390 | V4L2_MPEG_VIDEO_H264_LEVEL_4_1 = 12, | ||
1391 | V4L2_MPEG_VIDEO_H264_LEVEL_4_2 = 13, | ||
1392 | V4L2_MPEG_VIDEO_H264_LEVEL_5_0 = 14, | ||
1393 | V4L2_MPEG_VIDEO_H264_LEVEL_5_1 = 15, | ||
1394 | }; | ||
1395 | #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+360) | ||
1396 | #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+361) | ||
1397 | #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+362) | ||
1398 | enum v4l2_mpeg_video_h264_loop_filter_mode { | ||
1399 | V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED = 0, | ||
1400 | V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED = 1, | ||
1401 | V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2, | ||
1402 | }; | ||
1403 | #define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+363) | ||
1404 | enum v4l2_mpeg_video_h264_profile { | ||
1405 | V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE = 0, | ||
1406 | V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE = 1, | ||
1407 | V4L2_MPEG_VIDEO_H264_PROFILE_MAIN = 2, | ||
1408 | V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED = 3, | ||
1409 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH = 4, | ||
1410 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10 = 5, | ||
1411 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422 = 6, | ||
1412 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE = 7, | ||
1413 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA = 8, | ||
1414 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA = 9, | ||
1415 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA = 10, | ||
1416 | V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA = 11, | ||
1417 | V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE = 12, | ||
1418 | V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH = 13, | ||
1419 | V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA = 14, | ||
1420 | V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH = 15, | ||
1421 | V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH = 16, | ||
1422 | }; | ||
1423 | #define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+364) | ||
1424 | #define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+365) | ||
1425 | #define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+366) | ||
1426 | #define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+367) | ||
1427 | enum v4l2_mpeg_video_h264_vui_sar_idc { | ||
1428 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED = 0, | ||
1429 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 = 1, | ||
1430 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11 = 2, | ||
1431 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11 = 3, | ||
1432 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11 = 4, | ||
1433 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33 = 5, | ||
1434 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11 = 6, | ||
1435 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11 = 7, | ||
1436 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11 = 8, | ||
1437 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33 = 9, | ||
1438 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11 = 10, | ||
1439 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11 = 11, | ||
1440 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33 = 12, | ||
1441 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99 = 13, | ||
1442 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3 = 14, | ||
1443 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2 = 15, | ||
1444 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16, | ||
1445 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17, | ||
1446 | }; | ||
1447 | #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400) | ||
1448 | #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401) | ||
1449 | #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402) | ||
1450 | #define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+403) | ||
1451 | #define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+404) | ||
1452 | #define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+405) | ||
1453 | enum v4l2_mpeg_video_mpeg4_level { | ||
1454 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 = 0, | ||
1455 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B = 1, | ||
1456 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_1 = 2, | ||
1457 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_2 = 3, | ||
1458 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_3 = 4, | ||
1459 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B = 5, | ||
1460 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 = 6, | ||
1461 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 = 7, | ||
1462 | }; | ||
1463 | #define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+406) | ||
1464 | enum v4l2_mpeg_video_mpeg4_profile { | ||
1465 | V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE = 0, | ||
1466 | V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE = 1, | ||
1467 | V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE = 2, | ||
1468 | V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE = 3, | ||
1469 | V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 4, | ||
1470 | }; | ||
1471 | #define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407) | ||
1320 | 1472 | ||
1321 | /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ | 1473 | /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ |
1322 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) | 1474 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) |
@@ -1359,6 +1511,33 @@ enum v4l2_mpeg_cx2341x_video_median_filter_type { | |||
1359 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) | 1511 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) |
1360 | #define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11) | 1512 | #define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11) |
1361 | 1513 | ||
1514 | /* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */ | ||
1515 | #define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100) | ||
1516 | |||
1517 | #define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0) | ||
1518 | #define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1) | ||
1519 | #define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+2) | ||
1520 | enum v4l2_mpeg_mfc51_video_frame_skip_mode { | ||
1521 | V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED = 0, | ||
1522 | V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1, | ||
1523 | V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2, | ||
1524 | }; | ||
1525 | #define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+3) | ||
1526 | enum v4l2_mpeg_mfc51_video_force_frame_type { | ||
1527 | V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED = 0, | ||
1528 | V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME = 1, | ||
1529 | V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED = 2, | ||
1530 | }; | ||
1531 | #define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+4) | ||
1532 | #define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+5) | ||
1533 | #define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+6) | ||
1534 | #define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+7) | ||
1535 | #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+50) | ||
1536 | #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+51) | ||
1537 | #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+52) | ||
1538 | #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53) | ||
1539 | #define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54) | ||
1540 | |||
1362 | /* Camera class control IDs */ | 1541 | /* Camera class control IDs */ |
1363 | #define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900) | 1542 | #define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900) |
1364 | #define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1) | 1543 | #define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1) |
@@ -1427,6 +1606,41 @@ enum v4l2_preemphasis { | |||
1427 | #define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113) | 1606 | #define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113) |
1428 | #define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114) | 1607 | #define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114) |
1429 | 1608 | ||
1609 | /* Flash and privacy (indicator) light controls */ | ||
1610 | #define V4L2_CID_FLASH_CLASS_BASE (V4L2_CTRL_CLASS_FLASH | 0x900) | ||
1611 | #define V4L2_CID_FLASH_CLASS (V4L2_CTRL_CLASS_FLASH | 1) | ||
1612 | |||
1613 | #define V4L2_CID_FLASH_LED_MODE (V4L2_CID_FLASH_CLASS_BASE + 1) | ||
1614 | enum v4l2_flash_led_mode { | ||
1615 | V4L2_FLASH_LED_MODE_NONE, | ||
1616 | V4L2_FLASH_LED_MODE_FLASH, | ||
1617 | V4L2_FLASH_LED_MODE_TORCH, | ||
1618 | }; | ||
1619 | |||
1620 | #define V4L2_CID_FLASH_STROBE_SOURCE (V4L2_CID_FLASH_CLASS_BASE + 2) | ||
1621 | enum v4l2_flash_strobe_source { | ||
1622 | V4L2_FLASH_STROBE_SOURCE_SOFTWARE, | ||
1623 | V4L2_FLASH_STROBE_SOURCE_EXTERNAL, | ||
1624 | }; | ||
1625 | |||
1626 | #define V4L2_CID_FLASH_STROBE (V4L2_CID_FLASH_CLASS_BASE + 3) | ||
1627 | #define V4L2_CID_FLASH_STROBE_STOP (V4L2_CID_FLASH_CLASS_BASE + 4) | ||
1628 | #define V4L2_CID_FLASH_STROBE_STATUS (V4L2_CID_FLASH_CLASS_BASE + 5) | ||
1629 | |||
1630 | #define V4L2_CID_FLASH_TIMEOUT (V4L2_CID_FLASH_CLASS_BASE + 6) | ||
1631 | #define V4L2_CID_FLASH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 7) | ||
1632 | #define V4L2_CID_FLASH_TORCH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 8) | ||
1633 | #define V4L2_CID_FLASH_INDICATOR_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 9) | ||
1634 | |||
1635 | #define V4L2_CID_FLASH_FAULT (V4L2_CID_FLASH_CLASS_BASE + 10) | ||
1636 | #define V4L2_FLASH_FAULT_OVER_VOLTAGE (1 << 0) | ||
1637 | #define V4L2_FLASH_FAULT_TIMEOUT (1 << 1) | ||
1638 | #define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2) | ||
1639 | #define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3) | ||
1640 | |||
1641 | #define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11) | ||
1642 | #define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12) | ||
1643 | |||
1430 | /* | 1644 | /* |
1431 | * T U N I N G | 1645 | * T U N I N G |
1432 | */ | 1646 | */ |
@@ -1791,6 +2005,7 @@ struct v4l2_streamparm { | |||
1791 | #define V4L2_EVENT_ALL 0 | 2005 | #define V4L2_EVENT_ALL 0 |
1792 | #define V4L2_EVENT_VSYNC 1 | 2006 | #define V4L2_EVENT_VSYNC 1 |
1793 | #define V4L2_EVENT_EOS 2 | 2007 | #define V4L2_EVENT_EOS 2 |
2008 | #define V4L2_EVENT_CTRL 3 | ||
1794 | #define V4L2_EVENT_PRIVATE_START 0x08000000 | 2009 | #define V4L2_EVENT_PRIVATE_START 0x08000000 |
1795 | 2010 | ||
1796 | /* Payload for V4L2_EVENT_VSYNC */ | 2011 | /* Payload for V4L2_EVENT_VSYNC */ |
@@ -1799,21 +2014,46 @@ struct v4l2_event_vsync { | |||
1799 | __u8 field; | 2014 | __u8 field; |
1800 | } __attribute__ ((packed)); | 2015 | } __attribute__ ((packed)); |
1801 | 2016 | ||
2017 | /* Payload for V4L2_EVENT_CTRL */ | ||
2018 | #define V4L2_EVENT_CTRL_CH_VALUE (1 << 0) | ||
2019 | #define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1) | ||
2020 | |||
2021 | struct v4l2_event_ctrl { | ||
2022 | __u32 changes; | ||
2023 | __u32 type; | ||
2024 | union { | ||
2025 | __s32 value; | ||
2026 | __s64 value64; | ||
2027 | }; | ||
2028 | __u32 flags; | ||
2029 | __s32 minimum; | ||
2030 | __s32 maximum; | ||
2031 | __s32 step; | ||
2032 | __s32 default_value; | ||
2033 | }; | ||
2034 | |||
1802 | struct v4l2_event { | 2035 | struct v4l2_event { |
1803 | __u32 type; | 2036 | __u32 type; |
1804 | union { | 2037 | union { |
1805 | struct v4l2_event_vsync vsync; | 2038 | struct v4l2_event_vsync vsync; |
2039 | struct v4l2_event_ctrl ctrl; | ||
1806 | __u8 data[64]; | 2040 | __u8 data[64]; |
1807 | } u; | 2041 | } u; |
1808 | __u32 pending; | 2042 | __u32 pending; |
1809 | __u32 sequence; | 2043 | __u32 sequence; |
1810 | struct timespec timestamp; | 2044 | struct timespec timestamp; |
1811 | __u32 reserved[9]; | 2045 | __u32 id; |
2046 | __u32 reserved[8]; | ||
1812 | }; | 2047 | }; |
1813 | 2048 | ||
2049 | #define V4L2_EVENT_SUB_FL_SEND_INITIAL (1 << 0) | ||
2050 | #define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK (1 << 1) | ||
2051 | |||
1814 | struct v4l2_event_subscription { | 2052 | struct v4l2_event_subscription { |
1815 | __u32 type; | 2053 | __u32 type; |
1816 | __u32 reserved[7]; | 2054 | __u32 id; |
2055 | __u32 flags; | ||
2056 | __u32 reserved[5]; | ||
1817 | }; | 2057 | }; |
1818 | 2058 | ||
1819 | /* | 2059 | /* |
diff --git a/include/media/adp1653.h b/include/media/adp1653.h new file mode 100644 index 000000000000..50a1af88aed0 --- /dev/null +++ b/include/media/adp1653.h | |||
@@ -0,0 +1,126 @@ | |||
1 | /* | ||
2 | * include/media/adp1653.h | ||
3 | * | ||
4 | * Copyright (C) 2008--2011 Nokia Corporation | ||
5 | * | ||
6 | * Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> | ||
7 | * | ||
8 | * Contributors: | ||
9 | * Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> | ||
10 | * Tuukka Toivonen <tuukkat76@gmail.com> | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * version 2 as published by the Free Software Foundation. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, but | ||
17 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
19 | * General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
24 | * 02110-1301 USA | ||
25 | * | ||
26 | */ | ||
27 | |||
28 | #ifndef ADP1653_H | ||
29 | #define ADP1653_H | ||
30 | |||
31 | #include <linux/i2c.h> | ||
32 | #include <linux/mutex.h> | ||
33 | #include <linux/videodev2.h> | ||
34 | #include <media/v4l2-ctrls.h> | ||
35 | #include <media/v4l2-subdev.h> | ||
36 | |||
37 | #define ADP1653_NAME "adp1653" | ||
38 | #define ADP1653_I2C_ADDR (0x60 >> 1) | ||
39 | |||
40 | /* Register definitions */ | ||
41 | #define ADP1653_REG_OUT_SEL 0x00 | ||
42 | #define ADP1653_REG_OUT_SEL_HPLED_TORCH_MIN 0x01 | ||
43 | #define ADP1653_REG_OUT_SEL_HPLED_TORCH_MAX 0x0b | ||
44 | #define ADP1653_REG_OUT_SEL_HPLED_FLASH_MIN 0x0c | ||
45 | #define ADP1653_REG_OUT_SEL_HPLED_FLASH_MAX 0x1f | ||
46 | #define ADP1653_REG_OUT_SEL_HPLED_SHIFT 3 | ||
47 | #define ADP1653_REG_OUT_SEL_ILED_MAX 0x07 | ||
48 | #define ADP1653_REG_OUT_SEL_ILED_SHIFT 0 | ||
49 | |||
50 | #define ADP1653_REG_CONFIG 0x01 | ||
51 | #define ADP1653_REG_CONFIG_TMR_CFG (1 << 4) | ||
52 | #define ADP1653_REG_CONFIG_TMR_SET_MAX 0x0f | ||
53 | #define ADP1653_REG_CONFIG_TMR_SET_SHIFT 0 | ||
54 | |||
55 | #define ADP1653_REG_SW_STROBE 0x02 | ||
56 | #define ADP1653_REG_SW_STROBE_SW_STROBE (1 << 0) | ||
57 | |||
58 | #define ADP1653_REG_FAULT 0x03 | ||
59 | #define ADP1653_REG_FAULT_FLT_SCP (1 << 3) | ||
60 | #define ADP1653_REG_FAULT_FLT_OT (1 << 2) | ||
61 | #define ADP1653_REG_FAULT_FLT_TMR (1 << 1) | ||
62 | #define ADP1653_REG_FAULT_FLT_OV (1 << 0) | ||
63 | |||
64 | #define ADP1653_INDICATOR_INTENSITY_MIN 0 | ||
65 | #define ADP1653_INDICATOR_INTENSITY_STEP 2500 | ||
66 | #define ADP1653_INDICATOR_INTENSITY_MAX \ | ||
67 | (ADP1653_REG_OUT_SEL_ILED_MAX * ADP1653_INDICATOR_INTENSITY_STEP) | ||
68 | #define ADP1653_INDICATOR_INTENSITY_uA_TO_REG(a) \ | ||
69 | ((a) / ADP1653_INDICATOR_INTENSITY_STEP) | ||
70 | #define ADP1653_INDICATOR_INTENSITY_REG_TO_uA(a) \ | ||
71 | ((a) * ADP1653_INDICATOR_INTENSITY_STEP) | ||
72 | |||
73 | #define ADP1653_FLASH_INTENSITY_BASE 35 | ||
74 | #define ADP1653_FLASH_INTENSITY_STEP 15 | ||
75 | #define ADP1653_FLASH_INTENSITY_MIN \ | ||
76 | (ADP1653_FLASH_INTENSITY_BASE \ | ||
77 | + ADP1653_REG_OUT_SEL_HPLED_FLASH_MIN * ADP1653_FLASH_INTENSITY_STEP) | ||
78 | #define ADP1653_FLASH_INTENSITY_MAX \ | ||
79 | (ADP1653_FLASH_INTENSITY_MIN + \ | ||
80 | (ADP1653_REG_OUT_SEL_HPLED_FLASH_MAX - \ | ||
81 | ADP1653_REG_OUT_SEL_HPLED_FLASH_MIN + 1) * \ | ||
82 | ADP1653_FLASH_INTENSITY_STEP) | ||
83 | |||
84 | #define ADP1653_FLASH_INTENSITY_mA_TO_REG(a) \ | ||
85 | ((a) < ADP1653_FLASH_INTENSITY_BASE ? 0 : \ | ||
86 | (((a) - ADP1653_FLASH_INTENSITY_BASE) / ADP1653_FLASH_INTENSITY_STEP)) | ||
87 | #define ADP1653_FLASH_INTENSITY_REG_TO_mA(a) \ | ||
88 | ((a) * ADP1653_FLASH_INTENSITY_STEP + ADP1653_FLASH_INTENSITY_BASE) | ||
89 | |||
90 | #define ADP1653_TORCH_INTENSITY_MIN \ | ||
91 | (ADP1653_FLASH_INTENSITY_BASE \ | ||
92 | + ADP1653_REG_OUT_SEL_HPLED_TORCH_MIN * ADP1653_FLASH_INTENSITY_STEP) | ||
93 | #define ADP1653_TORCH_INTENSITY_MAX \ | ||
94 | (ADP1653_TORCH_INTENSITY_MIN + \ | ||
95 | (ADP1653_REG_OUT_SEL_HPLED_TORCH_MAX - \ | ||
96 | ADP1653_REG_OUT_SEL_HPLED_TORCH_MIN + 1) * \ | ||
97 | ADP1653_FLASH_INTENSITY_STEP) | ||
98 | |||
99 | struct adp1653_platform_data { | ||
100 | int (*power)(struct v4l2_subdev *sd, int on); | ||
101 | |||
102 | u32 max_flash_timeout; /* flash light timeout in us */ | ||
103 | u32 max_flash_intensity; /* led intensity, flash mode */ | ||
104 | u32 max_torch_intensity; /* led intensity, torch mode */ | ||
105 | u32 max_indicator_intensity; /* indicator led intensity */ | ||
106 | }; | ||
107 | |||
108 | #define to_adp1653_flash(sd) container_of(sd, struct adp1653_flash, subdev) | ||
109 | |||
110 | struct adp1653_flash { | ||
111 | struct v4l2_subdev subdev; | ||
112 | struct adp1653_platform_data *platform_data; | ||
113 | |||
114 | struct v4l2_ctrl_handler ctrls; | ||
115 | struct v4l2_ctrl *led_mode; | ||
116 | struct v4l2_ctrl *flash_timeout; | ||
117 | struct v4l2_ctrl *flash_intensity; | ||
118 | struct v4l2_ctrl *torch_intensity; | ||
119 | struct v4l2_ctrl *indicator_intensity; | ||
120 | |||
121 | struct mutex power_lock; | ||
122 | int power_count; | ||
123 | int fault; | ||
124 | }; | ||
125 | |||
126 | #endif /* ADP1653_H */ | ||
diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h new file mode 100644 index 000000000000..26cece595121 --- /dev/null +++ b/include/media/atmel-isi.h | |||
@@ -0,0 +1,119 @@ | |||
1 | /* | ||
2 | * Register definitions for the Atmel Image Sensor Interface. | ||
3 | * | ||
4 | * Copyright (C) 2011 Atmel Corporation | ||
5 | * Josh Wu, <josh.wu@atmel.com> | ||
6 | * | ||
7 | * Based on previous work by Lars Haring, <lars.haring@atmel.com> | ||
8 | * and Sedji Gaouaou | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | #ifndef __ATMEL_ISI_H__ | ||
15 | #define __ATMEL_ISI_H__ | ||
16 | |||
17 | #include <linux/types.h> | ||
18 | |||
19 | /* ISI_V2 register offsets */ | ||
20 | #define ISI_CFG1 0x0000 | ||
21 | #define ISI_CFG2 0x0004 | ||
22 | #define ISI_PSIZE 0x0008 | ||
23 | #define ISI_PDECF 0x000c | ||
24 | #define ISI_Y2R_SET0 0x0010 | ||
25 | #define ISI_Y2R_SET1 0x0014 | ||
26 | #define ISI_R2Y_SET0 0x0018 | ||
27 | #define ISI_R2Y_SET1 0x001C | ||
28 | #define ISI_R2Y_SET2 0x0020 | ||
29 | #define ISI_CTRL 0x0024 | ||
30 | #define ISI_STATUS 0x0028 | ||
31 | #define ISI_INTEN 0x002C | ||
32 | #define ISI_INTDIS 0x0030 | ||
33 | #define ISI_INTMASK 0x0034 | ||
34 | #define ISI_DMA_CHER 0x0038 | ||
35 | #define ISI_DMA_CHDR 0x003C | ||
36 | #define ISI_DMA_CHSR 0x0040 | ||
37 | #define ISI_DMA_P_ADDR 0x0044 | ||
38 | #define ISI_DMA_P_CTRL 0x0048 | ||
39 | #define ISI_DMA_P_DSCR 0x004C | ||
40 | #define ISI_DMA_C_ADDR 0x0050 | ||
41 | #define ISI_DMA_C_CTRL 0x0054 | ||
42 | #define ISI_DMA_C_DSCR 0x0058 | ||
43 | |||
44 | /* Bitfields in CFG1 */ | ||
45 | #define ISI_CFG1_HSYNC_POL_ACTIVE_LOW (1 << 2) | ||
46 | #define ISI_CFG1_VSYNC_POL_ACTIVE_LOW (1 << 3) | ||
47 | #define ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING (1 << 4) | ||
48 | #define ISI_CFG1_EMB_SYNC (1 << 6) | ||
49 | #define ISI_CFG1_CRC_SYNC (1 << 7) | ||
50 | /* Constants for FRATE(ISI_V2) */ | ||
51 | #define ISI_CFG1_FRATE_CAPTURE_ALL (0 << 8) | ||
52 | #define ISI_CFG1_FRATE_DIV_2 (1 << 8) | ||
53 | #define ISI_CFG1_FRATE_DIV_3 (2 << 8) | ||
54 | #define ISI_CFG1_FRATE_DIV_4 (3 << 8) | ||
55 | #define ISI_CFG1_FRATE_DIV_5 (4 << 8) | ||
56 | #define ISI_CFG1_FRATE_DIV_6 (5 << 8) | ||
57 | #define ISI_CFG1_FRATE_DIV_7 (6 << 8) | ||
58 | #define ISI_CFG1_FRATE_DIV_8 (7 << 8) | ||
59 | #define ISI_CFG1_DISCR (1 << 11) | ||
60 | #define ISI_CFG1_FULL_MODE (1 << 12) | ||
61 | |||
62 | /* Bitfields in CFG2 */ | ||
63 | #define ISI_CFG2_GRAYSCALE (1 << 13) | ||
64 | /* Constants for YCC_SWAP(ISI_V2) */ | ||
65 | #define ISI_CFG2_YCC_SWAP_DEFAULT (0 << 28) | ||
66 | #define ISI_CFG2_YCC_SWAP_MODE_1 (1 << 28) | ||
67 | #define ISI_CFG2_YCC_SWAP_MODE_2 (2 << 28) | ||
68 | #define ISI_CFG2_YCC_SWAP_MODE_3 (3 << 28) | ||
69 | #define ISI_CFG2_IM_VSIZE_OFFSET 0 | ||
70 | #define ISI_CFG2_IM_HSIZE_OFFSET 16 | ||
71 | #define ISI_CFG2_IM_VSIZE_MASK (0x7FF << ISI_CFG2_IM_VSIZE_OFFSET) | ||
72 | #define ISI_CFG2_IM_HSIZE_MASK (0x7FF << ISI_CFG2_IM_HSIZE_OFFSET) | ||
73 | |||
74 | /* Bitfields in CTRL */ | ||
75 | /* Also using in SR(ISI_V2) */ | ||
76 | #define ISI_CTRL_EN (1 << 0) | ||
77 | #define ISI_CTRL_CDC (1 << 8) | ||
78 | /* Also using in SR/IER/IDR/IMR(ISI_V2) */ | ||
79 | #define ISI_CTRL_DIS (1 << 1) | ||
80 | #define ISI_CTRL_SRST (1 << 2) | ||
81 | |||
82 | /* Bitfields in SR */ | ||
83 | #define ISI_SR_SIP (1 << 19) | ||
84 | /* Also using in SR/IER/IDR/IMR */ | ||
85 | #define ISI_SR_VSYNC (1 << 10) | ||
86 | #define ISI_SR_PXFR_DONE (1 << 16) | ||
87 | #define ISI_SR_CXFR_DONE (1 << 17) | ||
88 | #define ISI_SR_P_OVR (1 << 24) | ||
89 | #define ISI_SR_C_OVR (1 << 25) | ||
90 | #define ISI_SR_CRC_ERR (1 << 26) | ||
91 | #define ISI_SR_FR_OVR (1 << 27) | ||
92 | |||
93 | /* Bitfields in DMA_C_CTRL & in DMA_P_CTRL */ | ||
94 | #define ISI_DMA_CTRL_FETCH (1 << 0) | ||
95 | #define ISI_DMA_CTRL_WB (1 << 1) | ||
96 | #define ISI_DMA_CTRL_IEN (1 << 2) | ||
97 | #define ISI_DMA_CTRL_DONE (1 << 3) | ||
98 | |||
99 | /* Bitfields in DMA_CHSR/CHER/CHDR */ | ||
100 | #define ISI_DMA_CHSR_P_CH (1 << 0) | ||
101 | #define ISI_DMA_CHSR_C_CH (1 << 1) | ||
102 | |||
103 | /* Definition for isi_platform_data */ | ||
104 | #define ISI_DATAWIDTH_8 0x01 | ||
105 | #define ISI_DATAWIDTH_10 0x02 | ||
106 | |||
107 | struct isi_platform_data { | ||
108 | u8 has_emb_sync; | ||
109 | u8 emb_crc_sync; | ||
110 | u8 hsync_act_low; | ||
111 | u8 vsync_act_low; | ||
112 | u8 pclk_act_falling; | ||
113 | u8 isi_full_mode; | ||
114 | u32 data_width_flags; | ||
115 | /* Using for ISI_CFG1 */ | ||
116 | u32 frate; | ||
117 | }; | ||
118 | |||
119 | #endif /* __ATMEL_ISI_H__ */ | ||
diff --git a/include/media/davinci/vpbe.h b/include/media/davinci/vpbe.h new file mode 100644 index 000000000000..8b11fb037980 --- /dev/null +++ b/include/media/davinci/vpbe.h | |||
@@ -0,0 +1,184 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Texas Instruments Inc | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation version 2. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
16 | */ | ||
17 | #ifndef _VPBE_H | ||
18 | #define _VPBE_H | ||
19 | |||
20 | #include <linux/videodev2.h> | ||
21 | #include <linux/i2c.h> | ||
22 | |||
23 | #include <media/v4l2-dev.h> | ||
24 | #include <media/v4l2-ioctl.h> | ||
25 | #include <media/v4l2-device.h> | ||
26 | #include <media/davinci/vpbe_osd.h> | ||
27 | #include <media/davinci/vpbe_venc.h> | ||
28 | #include <media/davinci/vpbe_types.h> | ||
29 | |||
30 | /* OSD configuration info */ | ||
31 | struct osd_config_info { | ||
32 | char module_name[32]; | ||
33 | }; | ||
34 | |||
35 | struct vpbe_output { | ||
36 | struct v4l2_output output; | ||
37 | /* | ||
38 | * If output capabilities include dv_preset, list supported presets | ||
39 | * below | ||
40 | */ | ||
41 | char *subdev_name; | ||
42 | /* | ||
43 | * defualt_mode identifies the default timings set at the venc or | ||
44 | * external encoder. | ||
45 | */ | ||
46 | char *default_mode; | ||
47 | /* | ||
48 | * Fields below are used for supporting multiple modes. For example, | ||
49 | * LCD panel might support different modes and they are listed here. | ||
50 | * Similarly for supporting external encoders, lcd controller port | ||
51 | * requires a set of non-standard timing values to be listed here for | ||
52 | * each supported mode since venc is used in non-standard timing mode | ||
53 | * for interfacing with external encoder similar to configuring lcd | ||
54 | * panel timings | ||
55 | */ | ||
56 | unsigned int num_modes; | ||
57 | struct vpbe_enc_mode_info *modes; | ||
58 | /* | ||
59 | * Bus configuration goes here for external encoders. Some encoders | ||
60 | * may require multiple interface types for each of the output. For | ||
61 | * example, SD modes would use YCC8 where as HD mode would use YCC16. | ||
62 | * Not sure if this is needed on a per mode basis instead of per | ||
63 | * output basis. If per mode is needed, we may have to move this to | ||
64 | * mode_info structure | ||
65 | */ | ||
66 | }; | ||
67 | |||
68 | /* encoder configuration info */ | ||
69 | struct encoder_config_info { | ||
70 | char module_name[32]; | ||
71 | /* Is this an i2c device ? */ | ||
72 | unsigned int is_i2c:1; | ||
73 | /* i2c subdevice board info */ | ||
74 | struct i2c_board_info board_info; | ||
75 | }; | ||
76 | |||
77 | /* structure for defining vpbe display subsystem components */ | ||
78 | struct vpbe_config { | ||
79 | char module_name[32]; | ||
80 | /* i2c bus adapter no */ | ||
81 | int i2c_adapter_id; | ||
82 | struct osd_config_info osd; | ||
83 | struct encoder_config_info venc; | ||
84 | /* external encoder information goes here */ | ||
85 | int num_ext_encoders; | ||
86 | struct encoder_config_info *ext_encoders; | ||
87 | int num_outputs; | ||
88 | /* Order is venc outputs followed by LCD and then external encoders */ | ||
89 | struct vpbe_output *outputs; | ||
90 | }; | ||
91 | |||
92 | struct vpbe_device; | ||
93 | |||
94 | struct vpbe_device_ops { | ||
95 | /* crop cap for the display */ | ||
96 | int (*g_cropcap)(struct vpbe_device *vpbe_dev, | ||
97 | struct v4l2_cropcap *cropcap); | ||
98 | |||
99 | /* Enumerate the outputs */ | ||
100 | int (*enum_outputs)(struct vpbe_device *vpbe_dev, | ||
101 | struct v4l2_output *output); | ||
102 | |||
103 | /* Set output to the given index */ | ||
104 | int (*set_output)(struct vpbe_device *vpbe_dev, | ||
105 | int index); | ||
106 | |||
107 | /* Get current output */ | ||
108 | unsigned int (*get_output)(struct vpbe_device *vpbe_dev); | ||
109 | |||
110 | /* Set DV preset at current output */ | ||
111 | int (*s_dv_preset)(struct vpbe_device *vpbe_dev, | ||
112 | struct v4l2_dv_preset *dv_preset); | ||
113 | |||
114 | /* Get DV presets supported at the output */ | ||
115 | int (*g_dv_preset)(struct vpbe_device *vpbe_dev, | ||
116 | struct v4l2_dv_preset *dv_preset); | ||
117 | |||
118 | /* Enumerate the DV Presets supported at the output */ | ||
119 | int (*enum_dv_presets)(struct vpbe_device *vpbe_dev, | ||
120 | struct v4l2_dv_enum_preset *preset_info); | ||
121 | |||
122 | /* Set std at the output */ | ||
123 | int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id); | ||
124 | |||
125 | /* Get the current std at the output */ | ||
126 | int (*g_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id); | ||
127 | |||
128 | /* initialize the device */ | ||
129 | int (*initialize)(struct device *dev, struct vpbe_device *vpbe_dev); | ||
130 | |||
131 | /* De-initialize the device */ | ||
132 | void (*deinitialize)(struct device *dev, struct vpbe_device *vpbe_dev); | ||
133 | |||
134 | /* Get the current mode info */ | ||
135 | int (*get_mode_info)(struct vpbe_device *vpbe_dev, | ||
136 | struct vpbe_enc_mode_info*); | ||
137 | |||
138 | /* | ||
139 | * Set the current mode in the encoder. Alternate way of setting | ||
140 | * standard or DV preset or custom timings in the encoder | ||
141 | */ | ||
142 | int (*set_mode)(struct vpbe_device *vpbe_dev, | ||
143 | struct vpbe_enc_mode_info*); | ||
144 | /* Power management operations */ | ||
145 | int (*suspend)(struct vpbe_device *vpbe_dev); | ||
146 | int (*resume)(struct vpbe_device *vpbe_dev); | ||
147 | }; | ||
148 | |||
149 | /* struct for vpbe device */ | ||
150 | struct vpbe_device { | ||
151 | /* V4l2 device */ | ||
152 | struct v4l2_device v4l2_dev; | ||
153 | /* vpbe dispay controller cfg */ | ||
154 | struct vpbe_config *cfg; | ||
155 | /* parent device */ | ||
156 | struct device *pdev; | ||
157 | /* external encoder v4l2 sub devices */ | ||
158 | struct v4l2_subdev **encoders; | ||
159 | /* current encoder index */ | ||
160 | int current_sd_index; | ||
161 | struct mutex lock; | ||
162 | /* device initialized */ | ||
163 | int initialized; | ||
164 | /* vpbe dac clock */ | ||
165 | struct clk *dac_clk; | ||
166 | /* osd_device pointer */ | ||
167 | struct osd_state *osd_device; | ||
168 | /* | ||
169 | * fields below are accessed by users of vpbe_device. Not the | ||
170 | * ones above | ||
171 | */ | ||
172 | |||
173 | /* current output */ | ||
174 | int current_out_index; | ||
175 | /* lock used by caller to do atomic operation on vpbe device */ | ||
176 | /* current timings set in the controller */ | ||
177 | struct vpbe_enc_mode_info current_timings; | ||
178 | /* venc sub device */ | ||
179 | struct v4l2_subdev *venc; | ||
180 | /* device operations below */ | ||
181 | struct vpbe_device_ops ops; | ||
182 | }; | ||
183 | |||
184 | #endif | ||
diff --git a/include/media/davinci/vpbe_display.h b/include/media/davinci/vpbe_display.h new file mode 100644 index 000000000000..dbf6b37682cd --- /dev/null +++ b/include/media/davinci/vpbe_display.h | |||
@@ -0,0 +1,147 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License as | ||
6 | * published by the Free Software Foundation version 2. | ||
7 | * | ||
8 | * This program is distributed WITHOUT ANY WARRANTY of any | ||
9 | * kind, whether express or implied; without even the implied warranty | ||
10 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | #ifndef VPBE_DISPLAY_H | ||
14 | #define VPBE_DISPLAY_H | ||
15 | |||
16 | /* Header files */ | ||
17 | #include <linux/videodev2.h> | ||
18 | #include <media/v4l2-common.h> | ||
19 | #include <media/videobuf-dma-contig.h> | ||
20 | #include <media/davinci/vpbe_types.h> | ||
21 | #include <media/davinci/vpbe_osd.h> | ||
22 | #include <media/davinci/vpbe.h> | ||
23 | |||
24 | #define VPBE_DISPLAY_MAX_DEVICES 2 | ||
25 | |||
26 | enum vpbe_display_device_id { | ||
27 | VPBE_DISPLAY_DEVICE_0, | ||
28 | VPBE_DISPLAY_DEVICE_1 | ||
29 | }; | ||
30 | |||
31 | #define VPBE_DISPLAY_DRV_NAME "vpbe-display" | ||
32 | |||
33 | #define VPBE_DISPLAY_MAJOR_RELEASE 1 | ||
34 | #define VPBE_DISPLAY_MINOR_RELEASE 0 | ||
35 | #define VPBE_DISPLAY_BUILD 1 | ||
36 | #define VPBE_DISPLAY_VERSION_CODE ((VPBE_DISPLAY_MAJOR_RELEASE << 16) | \ | ||
37 | (VPBE_DISPLAY_MINOR_RELEASE << 8) | \ | ||
38 | VPBE_DISPLAY_BUILD) | ||
39 | |||
40 | #define VPBE_DISPLAY_VALID_FIELD(field) ((V4L2_FIELD_NONE == field) || \ | ||
41 | (V4L2_FIELD_ANY == field) || (V4L2_FIELD_INTERLACED == field)) | ||
42 | |||
43 | /* Exp ratio numerator and denominator constants */ | ||
44 | #define VPBE_DISPLAY_H_EXP_RATIO_N 9 | ||
45 | #define VPBE_DISPLAY_H_EXP_RATIO_D 8 | ||
46 | #define VPBE_DISPLAY_V_EXP_RATIO_N 6 | ||
47 | #define VPBE_DISPLAY_V_EXP_RATIO_D 5 | ||
48 | |||
49 | /* Zoom multiplication factor */ | ||
50 | #define VPBE_DISPLAY_ZOOM_4X 4 | ||
51 | #define VPBE_DISPLAY_ZOOM_2X 2 | ||
52 | |||
53 | /* Structures */ | ||
54 | struct display_layer_info { | ||
55 | int enable; | ||
56 | /* Layer ID used by Display Manager */ | ||
57 | enum osd_layer id; | ||
58 | struct osd_layer_config config; | ||
59 | enum osd_zoom_factor h_zoom; | ||
60 | enum osd_zoom_factor v_zoom; | ||
61 | enum osd_h_exp_ratio h_exp; | ||
62 | enum osd_v_exp_ratio v_exp; | ||
63 | }; | ||
64 | |||
65 | /* vpbe display object structure */ | ||
66 | struct vpbe_layer { | ||
67 | /* number of buffers in fbuffers */ | ||
68 | unsigned int numbuffers; | ||
69 | /* Pointer to the vpbe_display */ | ||
70 | struct vpbe_display *disp_dev; | ||
71 | /* Pointer pointing to current v4l2_buffer */ | ||
72 | struct videobuf_buffer *cur_frm; | ||
73 | /* Pointer pointing to next v4l2_buffer */ | ||
74 | struct videobuf_buffer *next_frm; | ||
75 | /* videobuf specific parameters | ||
76 | * Buffer queue used in video-buf | ||
77 | */ | ||
78 | struct videobuf_queue buffer_queue; | ||
79 | /* Queue of filled frames */ | ||
80 | struct list_head dma_queue; | ||
81 | /* Used in video-buf */ | ||
82 | spinlock_t irqlock; | ||
83 | /* V4l2 specific parameters */ | ||
84 | /* Identifies video device for this layer */ | ||
85 | struct video_device video_dev; | ||
86 | /* This field keeps track of type of buffer exchange mechanism user | ||
87 | * has selected | ||
88 | */ | ||
89 | enum v4l2_memory memory; | ||
90 | /* Used to keep track of state of the priority */ | ||
91 | struct v4l2_prio_state prio; | ||
92 | /* Used to store pixel format */ | ||
93 | struct v4l2_pix_format pix_fmt; | ||
94 | enum v4l2_field buf_field; | ||
95 | /* Video layer configuration params */ | ||
96 | struct display_layer_info layer_info; | ||
97 | /* vpbe specific parameters | ||
98 | * enable window for display | ||
99 | */ | ||
100 | unsigned char window_enable; | ||
101 | /* number of open instances of the layer */ | ||
102 | unsigned int usrs; | ||
103 | /* number of users performing IO */ | ||
104 | unsigned int io_usrs; | ||
105 | /* Indicates id of the field which is being displayed */ | ||
106 | unsigned int field_id; | ||
107 | /* Indicates whether streaming started */ | ||
108 | unsigned char started; | ||
109 | /* Identifies device object */ | ||
110 | enum vpbe_display_device_id device_id; | ||
111 | /* facilitation of ioctl ops lock by v4l2*/ | ||
112 | struct mutex opslock; | ||
113 | u8 layer_first_int; | ||
114 | }; | ||
115 | |||
116 | /* vpbe device structure */ | ||
117 | struct vpbe_display { | ||
118 | /* layer specific parameters */ | ||
119 | /* lock for isr updates to buf layers*/ | ||
120 | spinlock_t dma_queue_lock; | ||
121 | /* C-Plane offset from start of y-plane */ | ||
122 | unsigned int cbcr_ofst; | ||
123 | struct vpbe_layer *dev[VPBE_DISPLAY_MAX_DEVICES]; | ||
124 | struct vpbe_device *vpbe_dev; | ||
125 | struct osd_state *osd_device; | ||
126 | }; | ||
127 | |||
128 | /* File handle structure */ | ||
129 | struct vpbe_fh { | ||
130 | /* vpbe device structure */ | ||
131 | struct vpbe_display *disp_dev; | ||
132 | /* pointer to layer object for opened device */ | ||
133 | struct vpbe_layer *layer; | ||
134 | /* Indicates whether this file handle is doing IO */ | ||
135 | unsigned char io_allowed; | ||
136 | /* Used to keep track priority of this instance */ | ||
137 | enum v4l2_priority prio; | ||
138 | }; | ||
139 | |||
140 | struct buf_config_params { | ||
141 | unsigned char min_numbuffers; | ||
142 | unsigned char numbuffers[VPBE_DISPLAY_MAX_DEVICES]; | ||
143 | unsigned int min_bufsize[VPBE_DISPLAY_MAX_DEVICES]; | ||
144 | unsigned int layer_bufsize[VPBE_DISPLAY_MAX_DEVICES]; | ||
145 | }; | ||
146 | |||
147 | #endif /* VPBE_DISPLAY_H */ | ||
diff --git a/include/media/davinci/vpbe_osd.h b/include/media/davinci/vpbe_osd.h new file mode 100644 index 000000000000..d7e397a444e6 --- /dev/null +++ b/include/media/davinci/vpbe_osd.h | |||
@@ -0,0 +1,394 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2009 Texas Instruments Inc | ||
3 | * Copyright (C) 2007 MontaVista Software, Inc. | ||
4 | * | ||
5 | * Andy Lowe (alowe@mvista.com), MontaVista Software | ||
6 | * - Initial version | ||
7 | * Murali Karicheri (mkaricheri@gmail.com), Texas Instruments Ltd. | ||
8 | * - ported to sub device interface | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation version 2.. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | ||
24 | #ifndef _OSD_H | ||
25 | #define _OSD_H | ||
26 | |||
27 | #include <media/davinci/vpbe_types.h> | ||
28 | |||
29 | #define VPBE_OSD_SUBDEV_NAME "vpbe-osd" | ||
30 | |||
31 | /** | ||
32 | * enum osd_layer | ||
33 | * @WIN_OSD0: On-Screen Display Window 0 | ||
34 | * @WIN_VID0: Video Window 0 | ||
35 | * @WIN_OSD1: On-Screen Display Window 1 | ||
36 | * @WIN_VID1: Video Window 1 | ||
37 | * | ||
38 | * Description: | ||
39 | * An enumeration of the osd display layers. | ||
40 | */ | ||
41 | enum osd_layer { | ||
42 | WIN_OSD0, | ||
43 | WIN_VID0, | ||
44 | WIN_OSD1, | ||
45 | WIN_VID1, | ||
46 | }; | ||
47 | |||
48 | /** | ||
49 | * enum osd_win_layer | ||
50 | * @OSDWIN_OSD0: On-Screen Display Window 0 | ||
51 | * @OSDWIN_OSD1: On-Screen Display Window 1 | ||
52 | * | ||
53 | * Description: | ||
54 | * An enumeration of the OSD Window layers. | ||
55 | */ | ||
56 | enum osd_win_layer { | ||
57 | OSDWIN_OSD0, | ||
58 | OSDWIN_OSD1, | ||
59 | }; | ||
60 | |||
61 | /** | ||
62 | * enum osd_pix_format | ||
63 | * @PIXFMT_1BPP: 1-bit-per-pixel bitmap | ||
64 | * @PIXFMT_2BPP: 2-bits-per-pixel bitmap | ||
65 | * @PIXFMT_4BPP: 4-bits-per-pixel bitmap | ||
66 | * @PIXFMT_8BPP: 8-bits-per-pixel bitmap | ||
67 | * @PIXFMT_RGB565: 16-bits-per-pixel RGB565 | ||
68 | * @PIXFMT_YCbCrI: YUV 4:2:2 | ||
69 | * @PIXFMT_RGB888: 24-bits-per-pixel RGB888 | ||
70 | * @PIXFMT_YCrCbI: YUV 4:2:2 with chroma swap | ||
71 | * @PIXFMT_NV12: YUV 4:2:0 planar | ||
72 | * @PIXFMT_OSD_ATTR: OSD Attribute Window pixel format (4bpp) | ||
73 | * | ||
74 | * Description: | ||
75 | * An enumeration of the DaVinci pixel formats. | ||
76 | */ | ||
77 | enum osd_pix_format { | ||
78 | PIXFMT_1BPP = 0, | ||
79 | PIXFMT_2BPP, | ||
80 | PIXFMT_4BPP, | ||
81 | PIXFMT_8BPP, | ||
82 | PIXFMT_RGB565, | ||
83 | PIXFMT_YCbCrI, | ||
84 | PIXFMT_RGB888, | ||
85 | PIXFMT_YCrCbI, | ||
86 | PIXFMT_NV12, | ||
87 | PIXFMT_OSD_ATTR, | ||
88 | }; | ||
89 | |||
90 | /** | ||
91 | * enum osd_h_exp_ratio | ||
92 | * @H_EXP_OFF: no expansion (1/1) | ||
93 | * @H_EXP_9_OVER_8: 9/8 expansion ratio | ||
94 | * @H_EXP_3_OVER_2: 3/2 expansion ratio | ||
95 | * | ||
96 | * Description: | ||
97 | * An enumeration of the available horizontal expansion ratios. | ||
98 | */ | ||
99 | enum osd_h_exp_ratio { | ||
100 | H_EXP_OFF, | ||
101 | H_EXP_9_OVER_8, | ||
102 | H_EXP_3_OVER_2, | ||
103 | }; | ||
104 | |||
105 | /** | ||
106 | * enum osd_v_exp_ratio | ||
107 | * @V_EXP_OFF: no expansion (1/1) | ||
108 | * @V_EXP_6_OVER_5: 6/5 expansion ratio | ||
109 | * | ||
110 | * Description: | ||
111 | * An enumeration of the available vertical expansion ratios. | ||
112 | */ | ||
113 | enum osd_v_exp_ratio { | ||
114 | V_EXP_OFF, | ||
115 | V_EXP_6_OVER_5, | ||
116 | }; | ||
117 | |||
118 | /** | ||
119 | * enum osd_zoom_factor | ||
120 | * @ZOOM_X1: no zoom (x1) | ||
121 | * @ZOOM_X2: x2 zoom | ||
122 | * @ZOOM_X4: x4 zoom | ||
123 | * | ||
124 | * Description: | ||
125 | * An enumeration of the available zoom factors. | ||
126 | */ | ||
127 | enum osd_zoom_factor { | ||
128 | ZOOM_X1, | ||
129 | ZOOM_X2, | ||
130 | ZOOM_X4, | ||
131 | }; | ||
132 | |||
133 | /** | ||
134 | * enum osd_clut | ||
135 | * @ROM_CLUT: ROM CLUT | ||
136 | * @RAM_CLUT: RAM CLUT | ||
137 | * | ||
138 | * Description: | ||
139 | * An enumeration of the available Color Lookup Tables (CLUTs). | ||
140 | */ | ||
141 | enum osd_clut { | ||
142 | ROM_CLUT, | ||
143 | RAM_CLUT, | ||
144 | }; | ||
145 | |||
146 | /** | ||
147 | * enum osd_rom_clut | ||
148 | * @ROM_CLUT0: Macintosh CLUT | ||
149 | * @ROM_CLUT1: CLUT from DM270 and prior devices | ||
150 | * | ||
151 | * Description: | ||
152 | * An enumeration of the ROM Color Lookup Table (CLUT) options. | ||
153 | */ | ||
154 | enum osd_rom_clut { | ||
155 | ROM_CLUT0, | ||
156 | ROM_CLUT1, | ||
157 | }; | ||
158 | |||
159 | /** | ||
160 | * enum osd_blending_factor | ||
161 | * @OSD_0_VID_8: OSD pixels are fully transparent | ||
162 | * @OSD_1_VID_7: OSD pixels contribute 1/8, video pixels contribute 7/8 | ||
163 | * @OSD_2_VID_6: OSD pixels contribute 2/8, video pixels contribute 6/8 | ||
164 | * @OSD_3_VID_5: OSD pixels contribute 3/8, video pixels contribute 5/8 | ||
165 | * @OSD_4_VID_4: OSD pixels contribute 4/8, video pixels contribute 4/8 | ||
166 | * @OSD_5_VID_3: OSD pixels contribute 5/8, video pixels contribute 3/8 | ||
167 | * @OSD_6_VID_2: OSD pixels contribute 6/8, video pixels contribute 2/8 | ||
168 | * @OSD_8_VID_0: OSD pixels are fully opaque | ||
169 | * | ||
170 | * Description: | ||
171 | * An enumeration of the DaVinci pixel blending factor options. | ||
172 | */ | ||
173 | enum osd_blending_factor { | ||
174 | OSD_0_VID_8, | ||
175 | OSD_1_VID_7, | ||
176 | OSD_2_VID_6, | ||
177 | OSD_3_VID_5, | ||
178 | OSD_4_VID_4, | ||
179 | OSD_5_VID_3, | ||
180 | OSD_6_VID_2, | ||
181 | OSD_8_VID_0, | ||
182 | }; | ||
183 | |||
184 | /** | ||
185 | * enum osd_blink_interval | ||
186 | * @BLINK_X1: blink interval is 1 vertical refresh cycle | ||
187 | * @BLINK_X2: blink interval is 2 vertical refresh cycles | ||
188 | * @BLINK_X3: blink interval is 3 vertical refresh cycles | ||
189 | * @BLINK_X4: blink interval is 4 vertical refresh cycles | ||
190 | * | ||
191 | * Description: | ||
192 | * An enumeration of the DaVinci pixel blinking interval options. | ||
193 | */ | ||
194 | enum osd_blink_interval { | ||
195 | BLINK_X1, | ||
196 | BLINK_X2, | ||
197 | BLINK_X3, | ||
198 | BLINK_X4, | ||
199 | }; | ||
200 | |||
201 | /** | ||
202 | * enum osd_cursor_h_width | ||
203 | * @H_WIDTH_1: horizontal line width is 1 pixel | ||
204 | * @H_WIDTH_4: horizontal line width is 4 pixels | ||
205 | * @H_WIDTH_8: horizontal line width is 8 pixels | ||
206 | * @H_WIDTH_12: horizontal line width is 12 pixels | ||
207 | * @H_WIDTH_16: horizontal line width is 16 pixels | ||
208 | * @H_WIDTH_20: horizontal line width is 20 pixels | ||
209 | * @H_WIDTH_24: horizontal line width is 24 pixels | ||
210 | * @H_WIDTH_28: horizontal line width is 28 pixels | ||
211 | */ | ||
212 | enum osd_cursor_h_width { | ||
213 | H_WIDTH_1, | ||
214 | H_WIDTH_4, | ||
215 | H_WIDTH_8, | ||
216 | H_WIDTH_12, | ||
217 | H_WIDTH_16, | ||
218 | H_WIDTH_20, | ||
219 | H_WIDTH_24, | ||
220 | H_WIDTH_28, | ||
221 | }; | ||
222 | |||
223 | /** | ||
224 | * enum davinci_cursor_v_width | ||
225 | * @V_WIDTH_1: vertical line width is 1 line | ||
226 | * @V_WIDTH_2: vertical line width is 2 lines | ||
227 | * @V_WIDTH_4: vertical line width is 4 lines | ||
228 | * @V_WIDTH_6: vertical line width is 6 lines | ||
229 | * @V_WIDTH_8: vertical line width is 8 lines | ||
230 | * @V_WIDTH_10: vertical line width is 10 lines | ||
231 | * @V_WIDTH_12: vertical line width is 12 lines | ||
232 | * @V_WIDTH_14: vertical line width is 14 lines | ||
233 | */ | ||
234 | enum osd_cursor_v_width { | ||
235 | V_WIDTH_1, | ||
236 | V_WIDTH_2, | ||
237 | V_WIDTH_4, | ||
238 | V_WIDTH_6, | ||
239 | V_WIDTH_8, | ||
240 | V_WIDTH_10, | ||
241 | V_WIDTH_12, | ||
242 | V_WIDTH_14, | ||
243 | }; | ||
244 | |||
245 | /** | ||
246 | * struct osd_cursor_config | ||
247 | * @xsize: horizontal size in pixels | ||
248 | * @ysize: vertical size in lines | ||
249 | * @xpos: horizontal offset in pixels from the left edge of the display | ||
250 | * @ypos: vertical offset in lines from the top of the display | ||
251 | * @interlaced: Non-zero if the display is interlaced, or zero otherwise | ||
252 | * @h_width: horizontal line width | ||
253 | * @v_width: vertical line width | ||
254 | * @clut: the CLUT selector (ROM or RAM) for the cursor color | ||
255 | * @clut_index: an index into the CLUT for the cursor color | ||
256 | * | ||
257 | * Description: | ||
258 | * A structure describing the configuration parameters of the hardware | ||
259 | * rectangular cursor. | ||
260 | */ | ||
261 | struct osd_cursor_config { | ||
262 | unsigned xsize; | ||
263 | unsigned ysize; | ||
264 | unsigned xpos; | ||
265 | unsigned ypos; | ||
266 | int interlaced; | ||
267 | enum osd_cursor_h_width h_width; | ||
268 | enum osd_cursor_v_width v_width; | ||
269 | enum osd_clut clut; | ||
270 | unsigned char clut_index; | ||
271 | }; | ||
272 | |||
273 | /** | ||
274 | * struct osd_layer_config | ||
275 | * @pixfmt: pixel format | ||
276 | * @line_length: offset in bytes between start of each line in memory | ||
277 | * @xsize: number of horizontal pixels displayed per line | ||
278 | * @ysize: number of lines displayed | ||
279 | * @xpos: horizontal offset in pixels from the left edge of the display | ||
280 | * @ypos: vertical offset in lines from the top of the display | ||
281 | * @interlaced: Non-zero if the display is interlaced, or zero otherwise | ||
282 | * | ||
283 | * Description: | ||
284 | * A structure describing the configuration parameters of an On-Screen Display | ||
285 | * (OSD) or video layer related to how the image is stored in memory. | ||
286 | * @line_length must be a multiple of the cache line size (32 bytes). | ||
287 | */ | ||
288 | struct osd_layer_config { | ||
289 | enum osd_pix_format pixfmt; | ||
290 | unsigned line_length; | ||
291 | unsigned xsize; | ||
292 | unsigned ysize; | ||
293 | unsigned xpos; | ||
294 | unsigned ypos; | ||
295 | int interlaced; | ||
296 | }; | ||
297 | |||
298 | /* parameters that apply on a per-window (OSD or video) basis */ | ||
299 | struct osd_window_state { | ||
300 | int is_allocated; | ||
301 | int is_enabled; | ||
302 | unsigned long fb_base_phys; | ||
303 | enum osd_zoom_factor h_zoom; | ||
304 | enum osd_zoom_factor v_zoom; | ||
305 | struct osd_layer_config lconfig; | ||
306 | }; | ||
307 | |||
308 | /* parameters that apply on a per-OSD-window basis */ | ||
309 | struct osd_osdwin_state { | ||
310 | enum osd_clut clut; | ||
311 | enum osd_blending_factor blend; | ||
312 | int colorkey_blending; | ||
313 | unsigned colorkey; | ||
314 | int rec601_attenuation; | ||
315 | /* index is pixel value */ | ||
316 | unsigned char palette_map[16]; | ||
317 | }; | ||
318 | |||
319 | /* hardware rectangular cursor parameters */ | ||
320 | struct osd_cursor_state { | ||
321 | int is_enabled; | ||
322 | struct osd_cursor_config config; | ||
323 | }; | ||
324 | |||
325 | struct osd_state; | ||
326 | |||
327 | struct vpbe_osd_ops { | ||
328 | int (*initialize)(struct osd_state *sd); | ||
329 | int (*request_layer)(struct osd_state *sd, enum osd_layer layer); | ||
330 | void (*release_layer)(struct osd_state *sd, enum osd_layer layer); | ||
331 | int (*enable_layer)(struct osd_state *sd, enum osd_layer layer, | ||
332 | int otherwin); | ||
333 | void (*disable_layer)(struct osd_state *sd, enum osd_layer layer); | ||
334 | int (*set_layer_config)(struct osd_state *sd, enum osd_layer layer, | ||
335 | struct osd_layer_config *lconfig); | ||
336 | void (*get_layer_config)(struct osd_state *sd, enum osd_layer layer, | ||
337 | struct osd_layer_config *lconfig); | ||
338 | void (*start_layer)(struct osd_state *sd, enum osd_layer layer, | ||
339 | unsigned long fb_base_phys, | ||
340 | unsigned long cbcr_ofst); | ||
341 | void (*set_left_margin)(struct osd_state *sd, u32 val); | ||
342 | void (*set_top_margin)(struct osd_state *sd, u32 val); | ||
343 | void (*set_interpolation_filter)(struct osd_state *sd, int filter); | ||
344 | int (*set_vid_expansion)(struct osd_state *sd, | ||
345 | enum osd_h_exp_ratio h_exp, | ||
346 | enum osd_v_exp_ratio v_exp); | ||
347 | void (*get_vid_expansion)(struct osd_state *sd, | ||
348 | enum osd_h_exp_ratio *h_exp, | ||
349 | enum osd_v_exp_ratio *v_exp); | ||
350 | void (*set_zoom)(struct osd_state *sd, enum osd_layer layer, | ||
351 | enum osd_zoom_factor h_zoom, | ||
352 | enum osd_zoom_factor v_zoom); | ||
353 | }; | ||
354 | |||
355 | struct osd_state { | ||
356 | enum vpbe_version vpbe_type; | ||
357 | spinlock_t lock; | ||
358 | struct device *dev; | ||
359 | dma_addr_t osd_base_phys; | ||
360 | unsigned long osd_base; | ||
361 | unsigned long osd_size; | ||
362 | /* 1-->the isr will toggle the VID0 ping-pong buffer */ | ||
363 | int pingpong; | ||
364 | int interpolation_filter; | ||
365 | int field_inversion; | ||
366 | enum osd_h_exp_ratio osd_h_exp; | ||
367 | enum osd_v_exp_ratio osd_v_exp; | ||
368 | enum osd_h_exp_ratio vid_h_exp; | ||
369 | enum osd_v_exp_ratio vid_v_exp; | ||
370 | enum osd_clut backg_clut; | ||
371 | unsigned backg_clut_index; | ||
372 | enum osd_rom_clut rom_clut; | ||
373 | int is_blinking; | ||
374 | /* attribute window blinking enabled */ | ||
375 | enum osd_blink_interval blink; | ||
376 | /* YCbCrI or YCrCbI */ | ||
377 | enum osd_pix_format yc_pixfmt; | ||
378 | /* columns are Y, Cb, Cr */ | ||
379 | unsigned char clut_ram[256][3]; | ||
380 | struct osd_cursor_state cursor; | ||
381 | /* OSD0, VID0, OSD1, VID1 */ | ||
382 | struct osd_window_state win[4]; | ||
383 | /* OSD0, OSD1 */ | ||
384 | struct osd_osdwin_state osdwin[2]; | ||
385 | /* OSD device Operations */ | ||
386 | struct vpbe_osd_ops ops; | ||
387 | }; | ||
388 | |||
389 | struct osd_platform_data { | ||
390 | enum vpbe_version vpbe_type; | ||
391 | int field_inv_wa_enable; | ||
392 | }; | ||
393 | |||
394 | #endif | ||
diff --git a/include/media/davinci/vpbe_types.h b/include/media/davinci/vpbe_types.h new file mode 100644 index 000000000000..727f55170e41 --- /dev/null +++ b/include/media/davinci/vpbe_types.h | |||
@@ -0,0 +1,91 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Texas Instruments Inc | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation version 2. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
16 | */ | ||
17 | #ifndef _VPBE_TYPES_H | ||
18 | #define _VPBE_TYPES_H | ||
19 | |||
20 | enum vpbe_version { | ||
21 | VPBE_VERSION_1 = 1, | ||
22 | VPBE_VERSION_2, | ||
23 | VPBE_VERSION_3, | ||
24 | }; | ||
25 | |||
26 | /* vpbe_timing_type - Timing types used in vpbe device */ | ||
27 | enum vpbe_enc_timings_type { | ||
28 | VPBE_ENC_STD = 0x1, | ||
29 | VPBE_ENC_DV_PRESET = 0x2, | ||
30 | VPBE_ENC_CUSTOM_TIMINGS = 0x4, | ||
31 | /* Used when set timings through FB device interface */ | ||
32 | VPBE_ENC_TIMINGS_INVALID = 0x8, | ||
33 | }; | ||
34 | |||
35 | union vpbe_timings { | ||
36 | v4l2_std_id std_id; | ||
37 | unsigned int dv_preset; | ||
38 | }; | ||
39 | |||
40 | /* | ||
41 | * struct vpbe_enc_mode_info | ||
42 | * @name: ptr to name string of the standard, "NTSC", "PAL" etc | ||
43 | * @std: standard or non-standard mode. 1 - standard, 0 - nonstandard | ||
44 | * @interlaced: 1 - interlaced, 0 - non interlaced/progressive | ||
45 | * @xres: x or horizontal resolution of the display | ||
46 | * @yres: y or vertical resolution of the display | ||
47 | * @fps: frame per second | ||
48 | * @left_margin: left margin of the display | ||
49 | * @right_margin: right margin of the display | ||
50 | * @upper_margin: upper margin of the display | ||
51 | * @lower_margin: lower margin of the display | ||
52 | * @hsync_len: h-sync length | ||
53 | * @vsync_len: v-sync length | ||
54 | * @flags: bit field: bit usage is documented below | ||
55 | * | ||
56 | * Description: | ||
57 | * Structure holding timing and resolution information of a standard. | ||
58 | * Used by vpbe_device to set required non-standard timing in the | ||
59 | * venc when lcd controller output is connected to a external encoder. | ||
60 | * A table of timings is maintained in vpbe device to set this in | ||
61 | * venc when external encoder is connected to lcd controller output. | ||
62 | * Encoder may provide a g_dv_timings() API to override these values | ||
63 | * as needed. | ||
64 | * | ||
65 | * Notes | ||
66 | * ------ | ||
67 | * if_type should be used only by encoder manager and encoder. | ||
68 | * flags usage | ||
69 | * b0 (LSB) - hsync polarity, 0 - negative, 1 - positive | ||
70 | * b1 - vsync polarity, 0 - negative, 1 - positive | ||
71 | * b2 - field id polarity, 0 - negative, 1 - positive | ||
72 | */ | ||
73 | struct vpbe_enc_mode_info { | ||
74 | unsigned char *name; | ||
75 | enum vpbe_enc_timings_type timings_type; | ||
76 | union vpbe_timings timings; | ||
77 | unsigned int interlaced; | ||
78 | unsigned int xres; | ||
79 | unsigned int yres; | ||
80 | struct v4l2_fract aspect; | ||
81 | struct v4l2_fract fps; | ||
82 | unsigned int left_margin; | ||
83 | unsigned int right_margin; | ||
84 | unsigned int upper_margin; | ||
85 | unsigned int lower_margin; | ||
86 | unsigned int hsync_len; | ||
87 | unsigned int vsync_len; | ||
88 | unsigned int flags; | ||
89 | }; | ||
90 | |||
91 | #endif | ||
diff --git a/include/media/davinci/vpbe_venc.h b/include/media/davinci/vpbe_venc.h new file mode 100644 index 000000000000..426c205831a2 --- /dev/null +++ b/include/media/davinci/vpbe_venc.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Texas Instruments Inc | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation version 2. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
16 | */ | ||
17 | #ifndef _VPBE_VENC_H | ||
18 | #define _VPBE_VENC_H | ||
19 | |||
20 | #include <media/v4l2-subdev.h> | ||
21 | #include <media/davinci/vpbe_types.h> | ||
22 | |||
23 | #define VPBE_VENC_SUBDEV_NAME "vpbe-venc" | ||
24 | |||
25 | /* venc events */ | ||
26 | #define VENC_END_OF_FRAME BIT(0) | ||
27 | #define VENC_FIRST_FIELD BIT(1) | ||
28 | #define VENC_SECOND_FIELD BIT(2) | ||
29 | |||
30 | struct venc_platform_data { | ||
31 | enum vpbe_version venc_type; | ||
32 | int (*setup_clock)(enum vpbe_enc_timings_type type, | ||
33 | unsigned int mode); | ||
34 | /* Number of LCD outputs supported */ | ||
35 | int num_lcd_outputs; | ||
36 | }; | ||
37 | |||
38 | enum venc_ioctls { | ||
39 | VENC_GET_FLD = 1, | ||
40 | }; | ||
41 | |||
42 | /* exported functions */ | ||
43 | struct v4l2_subdev *venc_sub_dev_init(struct v4l2_device *v4l2_dev, | ||
44 | const char *venc_name); | ||
45 | #endif | ||
diff --git a/include/media/mmp-camera.h b/include/media/mmp-camera.h new file mode 100644 index 000000000000..7611963a257f --- /dev/null +++ b/include/media/mmp-camera.h | |||
@@ -0,0 +1,9 @@ | |||
1 | /* | ||
2 | * Information for the Marvell Armada MMP camera | ||
3 | */ | ||
4 | |||
5 | struct mmp_camera_platform_data { | ||
6 | struct platform_device *i2c_device; | ||
7 | int sensor_power_gpio; | ||
8 | int sensor_reset_gpio; | ||
9 | }; | ||
diff --git a/include/media/ov7670.h b/include/media/ov7670.h new file mode 100644 index 000000000000..b133bc123031 --- /dev/null +++ b/include/media/ov7670.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * A V4L2 driver for OmniVision OV7670 cameras. | ||
3 | * | ||
4 | * Copyright 2010 One Laptop Per Child | ||
5 | * | ||
6 | * This file may be distributed under the terms of the GNU General | ||
7 | * Public License, version 2. | ||
8 | */ | ||
9 | |||
10 | #ifndef __OV7670_H | ||
11 | #define __OV7670_H | ||
12 | |||
13 | struct ov7670_config { | ||
14 | int min_width; /* Filter out smaller sizes */ | ||
15 | int min_height; /* Filter out smaller sizes */ | ||
16 | int clock_speed; /* External clock speed (MHz) */ | ||
17 | bool use_smbus; /* Use smbus I/O instead of I2C */ | ||
18 | }; | ||
19 | |||
20 | #endif | ||
diff --git a/include/media/rc-core.h b/include/media/rc-core.h index 60536c74c1ea..b1f19b77ecd4 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h | |||
@@ -117,7 +117,7 @@ struct rc_dev { | |||
117 | int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier); | 117 | int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier); |
118 | int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle); | 118 | int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle); |
119 | int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max); | 119 | int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max); |
120 | int (*tx_ir)(struct rc_dev *dev, int *txbuf, u32 n); | 120 | int (*tx_ir)(struct rc_dev *dev, unsigned *txbuf, unsigned n); |
121 | void (*s_idle)(struct rc_dev *dev, bool enable); | 121 | void (*s_idle)(struct rc_dev *dev, bool enable); |
122 | int (*s_learning_mode)(struct rc_dev *dev, int enable); | 122 | int (*s_learning_mode)(struct rc_dev *dev, int enable); |
123 | int (*s_carrier_report) (struct rc_dev *dev, int enable); | 123 | int (*s_carrier_report) (struct rc_dev *dev, int enable); |
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 4e1409ec2613..17c9759ae77b 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
@@ -18,12 +18,13 @@ | |||
18 | #define RC_TYPE_JVC (1 << 3) /* JVC protocol */ | 18 | #define RC_TYPE_JVC (1 << 3) /* JVC protocol */ |
19 | #define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ | 19 | #define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ |
20 | #define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ | 20 | #define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ |
21 | #define RC_TYPE_MCE_KBD (1 << 29) /* RC6-ish MCE keyboard/mouse */ | ||
21 | #define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ | 22 | #define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ |
22 | #define RC_TYPE_OTHER (1u << 31) | 23 | #define RC_TYPE_OTHER (1u << 31) |
23 | 24 | ||
24 | #define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \ | 25 | #define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \ |
25 | RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \ | 26 | RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \ |
26 | RC_TYPE_RC5_SZ | RC_TYPE_OTHER) | 27 | RC_TYPE_RC5_SZ | RC_TYPE_MCE_KBD | RC_TYPE_OTHER) |
27 | 28 | ||
28 | struct rc_map_table { | 29 | struct rc_map_table { |
29 | u32 scancode; | 30 | u32 scancode; |
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h index 80346a6d28a9..48413b410f15 100644 --- a/include/media/sh_mobile_ceu.h +++ b/include/media/sh_mobile_ceu.h | |||
@@ -7,10 +7,18 @@ | |||
7 | #define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ | 7 | #define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ |
8 | 8 | ||
9 | struct device; | 9 | struct device; |
10 | struct resource; | ||
11 | |||
12 | struct sh_mobile_ceu_companion { | ||
13 | u32 num_resources; | ||
14 | struct resource *resource; | ||
15 | int id; | ||
16 | void *platform_data; | ||
17 | }; | ||
10 | 18 | ||
11 | struct sh_mobile_ceu_info { | 19 | struct sh_mobile_ceu_info { |
12 | unsigned long flags; | 20 | unsigned long flags; |
13 | struct device *csi2_dev; | 21 | struct sh_mobile_ceu_companion *csi2; |
14 | }; | 22 | }; |
15 | 23 | ||
16 | #endif /* __ASM_SH_MOBILE_CEU_H__ */ | 24 | #endif /* __ASM_SH_MOBILE_CEU_H__ */ |
diff --git a/include/media/sh_mobile_csi2.h b/include/media/sh_mobile_csi2.h index 4d2615174461..c586c4f7f16b 100644 --- a/include/media/sh_mobile_csi2.h +++ b/include/media/sh_mobile_csi2.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef SH_MIPI_CSI | 11 | #ifndef SH_MIPI_CSI |
12 | #define SH_MIPI_CSI | 12 | #define SH_MIPI_CSI |
13 | 13 | ||
14 | #include <linux/list.h> | ||
15 | |||
14 | enum sh_csi2_phy { | 16 | enum sh_csi2_phy { |
15 | SH_CSI2_PHY_MAIN, | 17 | SH_CSI2_PHY_MAIN, |
16 | SH_CSI2_PHY_SUB, | 18 | SH_CSI2_PHY_SUB, |
@@ -33,14 +35,14 @@ struct sh_csi2_client_config { | |||
33 | struct platform_device *pdev; /* client platform device */ | 35 | struct platform_device *pdev; /* client platform device */ |
34 | }; | 36 | }; |
35 | 37 | ||
38 | struct v4l2_device; | ||
39 | |||
36 | struct sh_csi2_pdata { | 40 | struct sh_csi2_pdata { |
37 | enum sh_csi2_type type; | 41 | enum sh_csi2_type type; |
38 | unsigned int flags; | 42 | unsigned int flags; |
39 | struct sh_csi2_client_config *clients; | 43 | struct sh_csi2_client_config *clients; |
40 | int num_clients; | 44 | int num_clients; |
45 | struct v4l2_device *v4l2_dev; | ||
41 | }; | 46 | }; |
42 | 47 | ||
43 | struct device; | ||
44 | struct v4l2_device; | ||
45 | |||
46 | #endif | 48 | #endif |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 238bd334fd83..7582952dceae 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -20,14 +20,15 @@ | |||
20 | #include <media/videobuf2-core.h> | 20 | #include <media/videobuf2-core.h> |
21 | #include <media/v4l2-device.h> | 21 | #include <media/v4l2-device.h> |
22 | 22 | ||
23 | extern struct bus_type soc_camera_bus_type; | ||
24 | |||
25 | struct file; | 23 | struct file; |
24 | struct soc_camera_link; | ||
26 | 25 | ||
27 | struct soc_camera_device { | 26 | struct soc_camera_device { |
28 | struct list_head list; | 27 | struct list_head list; /* list of all registered devices */ |
29 | struct device dev; | 28 | struct soc_camera_link *link; |
30 | struct device *pdev; /* Platform device */ | 29 | struct device *pdev; /* Platform device */ |
30 | struct device *parent; /* Camera host device */ | ||
31 | struct device *control; /* E.g., the i2c client */ | ||
31 | s32 user_width; | 32 | s32 user_width; |
32 | s32 user_height; | 33 | s32 user_height; |
33 | u32 bytesperline; /* for padding, zero if unused */ | 34 | u32 bytesperline; /* for padding, zero if unused */ |
@@ -66,8 +67,6 @@ struct soc_camera_host_ops { | |||
66 | struct module *owner; | 67 | struct module *owner; |
67 | int (*add)(struct soc_camera_device *); | 68 | int (*add)(struct soc_camera_device *); |
68 | void (*remove)(struct soc_camera_device *); | 69 | void (*remove)(struct soc_camera_device *); |
69 | int (*suspend)(struct soc_camera_device *, pm_message_t); | ||
70 | int (*resume)(struct soc_camera_device *); | ||
71 | /* | 70 | /* |
72 | * .get_formats() is called for each client device format, but | 71 | * .get_formats() is called for each client device format, but |
73 | * .put_formats() is only called once. Further, if any of the calls to | 72 | * .put_formats() is only called once. Further, if any of the calls to |
@@ -109,12 +108,6 @@ struct soc_camera_host_ops { | |||
109 | #define SOCAM_SENSOR_INVERT_HSYNC (1 << 2) | 108 | #define SOCAM_SENSOR_INVERT_HSYNC (1 << 2) |
110 | #define SOCAM_SENSOR_INVERT_VSYNC (1 << 3) | 109 | #define SOCAM_SENSOR_INVERT_VSYNC (1 << 3) |
111 | #define SOCAM_SENSOR_INVERT_DATA (1 << 4) | 110 | #define SOCAM_SENSOR_INVERT_DATA (1 << 4) |
112 | #define SOCAM_MIPI_1LANE (1 << 5) | ||
113 | #define SOCAM_MIPI_2LANE (1 << 6) | ||
114 | #define SOCAM_MIPI_3LANE (1 << 7) | ||
115 | #define SOCAM_MIPI_4LANE (1 << 8) | ||
116 | #define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \ | ||
117 | SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE) | ||
118 | 111 | ||
119 | struct i2c_board_info; | 112 | struct i2c_board_info; |
120 | struct regulator_bulk_data; | 113 | struct regulator_bulk_data; |
@@ -134,11 +127,11 @@ struct soc_camera_link { | |||
134 | int num_regulators; | 127 | int num_regulators; |
135 | 128 | ||
136 | /* | 129 | /* |
137 | * For non-I2C devices platform platform has to provide methods to | 130 | * For non-I2C devices platform has to provide methods to add a device |
138 | * add a device to the system and to remove | 131 | * to the system and to remove it |
139 | */ | 132 | */ |
140 | int (*add_device)(struct soc_camera_link *, struct device *); | 133 | int (*add_device)(struct soc_camera_device *); |
141 | void (*del_device)(struct soc_camera_link *); | 134 | void (*del_device)(struct soc_camera_device *); |
142 | /* Optional callbacks to power on or off and reset the sensor */ | 135 | /* Optional callbacks to power on or off and reset the sensor */ |
143 | int (*power)(struct device *, int); | 136 | int (*power)(struct device *, int); |
144 | int (*reset)(struct device *); | 137 | int (*reset)(struct device *); |
@@ -152,12 +145,6 @@ struct soc_camera_link { | |||
152 | void (*free_bus)(struct soc_camera_link *); | 145 | void (*free_bus)(struct soc_camera_link *); |
153 | }; | 146 | }; |
154 | 147 | ||
155 | static inline struct soc_camera_device *to_soc_camera_dev( | ||
156 | const struct device *dev) | ||
157 | { | ||
158 | return container_of(dev, struct soc_camera_device, dev); | ||
159 | } | ||
160 | |||
161 | static inline struct soc_camera_host *to_soc_camera_host( | 148 | static inline struct soc_camera_host *to_soc_camera_host( |
162 | const struct device *dev) | 149 | const struct device *dev) |
163 | { | 150 | { |
@@ -169,13 +156,13 @@ static inline struct soc_camera_host *to_soc_camera_host( | |||
169 | static inline struct soc_camera_link *to_soc_camera_link( | 156 | static inline struct soc_camera_link *to_soc_camera_link( |
170 | const struct soc_camera_device *icd) | 157 | const struct soc_camera_device *icd) |
171 | { | 158 | { |
172 | return icd->dev.platform_data; | 159 | return icd->link; |
173 | } | 160 | } |
174 | 161 | ||
175 | static inline struct device *to_soc_camera_control( | 162 | static inline struct device *to_soc_camera_control( |
176 | const struct soc_camera_device *icd) | 163 | const struct soc_camera_device *icd) |
177 | { | 164 | { |
178 | return dev_get_drvdata(&icd->dev); | 165 | return icd->control; |
179 | } | 166 | } |
180 | 167 | ||
181 | static inline struct v4l2_subdev *soc_camera_to_subdev( | 168 | static inline struct v4l2_subdev *soc_camera_to_subdev( |
@@ -207,11 +194,8 @@ struct soc_camera_format_xlate { | |||
207 | }; | 194 | }; |
208 | 195 | ||
209 | struct soc_camera_ops { | 196 | struct soc_camera_ops { |
210 | int (*suspend)(struct soc_camera_device *, pm_message_t state); | ||
211 | int (*resume)(struct soc_camera_device *); | ||
212 | unsigned long (*query_bus_param)(struct soc_camera_device *); | 197 | unsigned long (*query_bus_param)(struct soc_camera_device *); |
213 | int (*set_bus_param)(struct soc_camera_device *, unsigned long); | 198 | int (*set_bus_param)(struct soc_camera_device *, unsigned long); |
214 | int (*enum_input)(struct soc_camera_device *, struct v4l2_input *); | ||
215 | const struct v4l2_queryctrl *controls; | 199 | const struct v4l2_queryctrl *controls; |
216 | int num_controls; | 200 | int num_controls; |
217 | }; | 201 | }; |
@@ -270,6 +254,12 @@ static inline struct v4l2_queryctrl const *soc_camera_find_qctrl( | |||
270 | #define SOCAM_PCLK_SAMPLE_FALLING (1 << 13) | 254 | #define SOCAM_PCLK_SAMPLE_FALLING (1 << 13) |
271 | #define SOCAM_DATA_ACTIVE_HIGH (1 << 14) | 255 | #define SOCAM_DATA_ACTIVE_HIGH (1 << 14) |
272 | #define SOCAM_DATA_ACTIVE_LOW (1 << 15) | 256 | #define SOCAM_DATA_ACTIVE_LOW (1 << 15) |
257 | #define SOCAM_MIPI_1LANE (1 << 16) | ||
258 | #define SOCAM_MIPI_2LANE (1 << 17) | ||
259 | #define SOCAM_MIPI_3LANE (1 << 18) | ||
260 | #define SOCAM_MIPI_4LANE (1 << 19) | ||
261 | #define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \ | ||
262 | SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE) | ||
273 | 263 | ||
274 | #define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \ | 264 | #define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \ |
275 | SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \ | 265 | SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \ |
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h index 6d7a4fd00fc0..74f0fa15ca47 100644 --- a/include/media/soc_camera_platform.h +++ b/include/media/soc_camera_platform.h | |||
@@ -21,7 +21,7 @@ struct soc_camera_platform_info { | |||
21 | unsigned long format_depth; | 21 | unsigned long format_depth; |
22 | struct v4l2_mbus_framefmt format; | 22 | struct v4l2_mbus_framefmt format; |
23 | unsigned long bus_param; | 23 | unsigned long bus_param; |
24 | struct device *dev; | 24 | struct soc_camera_device *icd; |
25 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); | 25 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); |
26 | }; | 26 | }; |
27 | 27 | ||
@@ -30,8 +30,7 @@ static inline void soc_camera_platform_release(struct platform_device **pdev) | |||
30 | *pdev = NULL; | 30 | *pdev = NULL; |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline int soc_camera_platform_add(const struct soc_camera_link *icl, | 33 | static inline int soc_camera_platform_add(struct soc_camera_device *icd, |
34 | struct device *dev, | ||
35 | struct platform_device **pdev, | 34 | struct platform_device **pdev, |
36 | struct soc_camera_link *plink, | 35 | struct soc_camera_link *plink, |
37 | void (*release)(struct device *dev), | 36 | void (*release)(struct device *dev), |
@@ -40,7 +39,7 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl, | |||
40 | struct soc_camera_platform_info *info = plink->priv; | 39 | struct soc_camera_platform_info *info = plink->priv; |
41 | int ret; | 40 | int ret; |
42 | 41 | ||
43 | if (icl != plink) | 42 | if (icd->link != plink) |
44 | return -ENODEV; | 43 | return -ENODEV; |
45 | 44 | ||
46 | if (*pdev) | 45 | if (*pdev) |
@@ -50,7 +49,7 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl, | |||
50 | if (!*pdev) | 49 | if (!*pdev) |
51 | return -ENOMEM; | 50 | return -ENOMEM; |
52 | 51 | ||
53 | info->dev = dev; | 52 | info->icd = icd; |
54 | 53 | ||
55 | (*pdev)->dev.platform_data = info; | 54 | (*pdev)->dev.platform_data = info; |
56 | (*pdev)->dev.release = release; | 55 | (*pdev)->dev.release = release; |
@@ -59,17 +58,17 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl, | |||
59 | if (ret < 0) { | 58 | if (ret < 0) { |
60 | platform_device_put(*pdev); | 59 | platform_device_put(*pdev); |
61 | *pdev = NULL; | 60 | *pdev = NULL; |
62 | info->dev = NULL; | 61 | info->icd = NULL; |
63 | } | 62 | } |
64 | 63 | ||
65 | return ret; | 64 | return ret; |
66 | } | 65 | } |
67 | 66 | ||
68 | static inline void soc_camera_platform_del(const struct soc_camera_link *icl, | 67 | static inline void soc_camera_platform_del(const struct soc_camera_device *icd, |
69 | struct platform_device *pdev, | 68 | struct platform_device *pdev, |
70 | const struct soc_camera_link *plink) | 69 | const struct soc_camera_link *plink) |
71 | { | 70 | { |
72 | if (icl != plink || !pdev) | 71 | if (icd->link != plink || !pdev) |
73 | return; | 72 | return; |
74 | 73 | ||
75 | platform_device_unregister(pdev); | 74 | platform_device_unregister(pdev); |
diff --git a/include/media/timb_radio.h b/include/media/timb_radio.h index a59a84854dc1..a40a6a348d21 100644 --- a/include/media/timb_radio.h +++ b/include/media/timb_radio.h | |||
@@ -23,13 +23,8 @@ | |||
23 | 23 | ||
24 | struct timb_radio_platform_data { | 24 | struct timb_radio_platform_data { |
25 | int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ | 25 | int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ |
26 | struct { | 26 | struct i2c_board_info *tuner; |
27 | struct i2c_board_info *info; | 27 | struct i2c_board_info *dsp; |
28 | } tuner; | ||
29 | struct { | ||
30 | const char *module_name; | ||
31 | struct i2c_board_info *info; | ||
32 | } dsp; | ||
33 | }; | 28 | }; |
34 | 29 | ||
35 | #endif | 30 | #endif |
diff --git a/include/media/tuner.h b/include/media/tuner.h index 963e33471835..89c290b69a5c 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
@@ -127,6 +127,8 @@ | |||
127 | #define TUNER_PHILIPS_FMD1216MEX_MK3 78 | 127 | #define TUNER_PHILIPS_FMD1216MEX_MK3 78 |
128 | #define TUNER_PHILIPS_FM1216MK5 79 | 128 | #define TUNER_PHILIPS_FM1216MK5 79 |
129 | #define TUNER_PHILIPS_FQ1216LME_MK3 80 /* Active loopthrough, no FM */ | 129 | #define TUNER_PHILIPS_FQ1216LME_MK3 80 /* Active loopthrough, no FM */ |
130 | #define TUNER_XC4000 81 /* Xceive Silicon Tuner */ | ||
131 | |||
130 | #define TUNER_PARTSNIC_PTI_5NF05 81 | 132 | #define TUNER_PARTSNIC_PTI_5NF05 81 |
131 | #define TUNER_PHILIPS_CU1216L 82 | 133 | #define TUNER_PHILIPS_CU1216L 82 |
132 | #define TUNER_NXP_TDA18271 83 | 134 | #define TUNER_NXP_TDA18271 83 |
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index b3edb67a8311..63fd9d3db296 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
@@ -76,6 +76,7 @@ enum { | |||
76 | V4L2_IDENT_OV6650 = 258, | 76 | V4L2_IDENT_OV6650 = 258, |
77 | V4L2_IDENT_OV2640 = 259, | 77 | V4L2_IDENT_OV2640 = 259, |
78 | V4L2_IDENT_OV9740 = 260, | 78 | V4L2_IDENT_OV9740 = 260, |
79 | V4L2_IDENT_OV5642 = 261, | ||
79 | 80 | ||
80 | /* module saa7146: reserved range 300-309 */ | 81 | /* module saa7146: reserved range 300-309 */ |
81 | V4L2_IDENT_SAA7146 = 300, | 82 | V4L2_IDENT_SAA7146 = 300, |
@@ -185,8 +186,9 @@ enum { | |||
185 | /* module wm8775: just ident 8775 */ | 186 | /* module wm8775: just ident 8775 */ |
186 | V4L2_IDENT_WM8775 = 8775, | 187 | V4L2_IDENT_WM8775 = 8775, |
187 | 188 | ||
188 | /* module cafe_ccic, just ident 8801 */ | 189 | /* Marvell controllers starting at 8801 */ |
189 | V4L2_IDENT_CAFE = 8801, | 190 | V4L2_IDENT_CAFE = 8801, |
191 | V4L2_IDENT_ARMADA610 = 8802, | ||
190 | 192 | ||
191 | /* AKM AK8813/AK8814 */ | 193 | /* AKM AK8813/AK8814 */ |
192 | V4L2_IDENT_AK8813 = 8813, | 194 | V4L2_IDENT_AK8813 = 8813, |
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 97d063837b61..13fe4d744aba 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
@@ -27,9 +27,12 @@ | |||
27 | 27 | ||
28 | /* forward references */ | 28 | /* forward references */ |
29 | struct v4l2_ctrl_handler; | 29 | struct v4l2_ctrl_handler; |
30 | struct v4l2_ctrl_helper; | ||
30 | struct v4l2_ctrl; | 31 | struct v4l2_ctrl; |
31 | struct video_device; | 32 | struct video_device; |
32 | struct v4l2_subdev; | 33 | struct v4l2_subdev; |
34 | struct v4l2_subscribed_event; | ||
35 | struct v4l2_fh; | ||
33 | 36 | ||
34 | /** struct v4l2_ctrl_ops - The control operations that the driver has to provide. | 37 | /** struct v4l2_ctrl_ops - The control operations that the driver has to provide. |
35 | * @g_volatile_ctrl: Get a new value for this control. Generally only relevant | 38 | * @g_volatile_ctrl: Get a new value for this control. Generally only relevant |
@@ -51,6 +54,7 @@ struct v4l2_ctrl_ops { | |||
51 | 54 | ||
52 | /** struct v4l2_ctrl - The control structure. | 55 | /** struct v4l2_ctrl - The control structure. |
53 | * @node: The list node. | 56 | * @node: The list node. |
57 | * @ev_subs: The list of control event subscriptions. | ||
54 | * @handler: The handler that owns the control. | 58 | * @handler: The handler that owns the control. |
55 | * @cluster: Point to start of cluster array. | 59 | * @cluster: Point to start of cluster array. |
56 | * @ncontrols: Number of controls in cluster array. | 60 | * @ncontrols: Number of controls in cluster array. |
@@ -65,6 +69,15 @@ struct v4l2_ctrl_ops { | |||
65 | * control's current value cannot be cached and needs to be | 69 | * control's current value cannot be cached and needs to be |
66 | * retrieved through the g_volatile_ctrl op. Drivers can set | 70 | * retrieved through the g_volatile_ctrl op. Drivers can set |
67 | * this flag. | 71 | * this flag. |
72 | * @is_auto: If set, then this control selects whether the other cluster | ||
73 | * members are in 'automatic' mode or 'manual' mode. This is | ||
74 | * used for autogain/gain type clusters. Drivers should never | ||
75 | * set this flag directly. | ||
76 | * @manual_mode_value: If the is_auto flag is set, then this is the value | ||
77 | * of the auto control that determines if that control is in | ||
78 | * manual mode. So if the value of the auto control equals this | ||
79 | * value, then the whole cluster is in manual mode. Drivers should | ||
80 | * never set this flag directly. | ||
68 | * @ops: The control ops. | 81 | * @ops: The control ops. |
69 | * @id: The control ID. | 82 | * @id: The control ID. |
70 | * @name: The control name. | 83 | * @name: The control name. |
@@ -97,6 +110,7 @@ struct v4l2_ctrl_ops { | |||
97 | struct v4l2_ctrl { | 110 | struct v4l2_ctrl { |
98 | /* Administrative fields */ | 111 | /* Administrative fields */ |
99 | struct list_head node; | 112 | struct list_head node; |
113 | struct list_head ev_subs; | ||
100 | struct v4l2_ctrl_handler *handler; | 114 | struct v4l2_ctrl_handler *handler; |
101 | struct v4l2_ctrl **cluster; | 115 | struct v4l2_ctrl **cluster; |
102 | unsigned ncontrols; | 116 | unsigned ncontrols; |
@@ -105,6 +119,8 @@ struct v4l2_ctrl { | |||
105 | unsigned int is_new:1; | 119 | unsigned int is_new:1; |
106 | unsigned int is_private:1; | 120 | unsigned int is_private:1; |
107 | unsigned int is_volatile:1; | 121 | unsigned int is_volatile:1; |
122 | unsigned int is_auto:1; | ||
123 | unsigned int manual_mode_value:8; | ||
108 | 124 | ||
109 | const struct v4l2_ctrl_ops *ops; | 125 | const struct v4l2_ctrl_ops *ops; |
110 | u32 id; | 126 | u32 id; |
@@ -134,6 +150,7 @@ struct v4l2_ctrl { | |||
134 | * @node: List node for the sorted list. | 150 | * @node: List node for the sorted list. |
135 | * @next: Single-link list node for the hash. | 151 | * @next: Single-link list node for the hash. |
136 | * @ctrl: The actual control information. | 152 | * @ctrl: The actual control information. |
153 | * @helper: Pointer to helper struct. Used internally in prepare_ext_ctrls(). | ||
137 | * | 154 | * |
138 | * Each control handler has a list of these refs. The list_head is used to | 155 | * Each control handler has a list of these refs. The list_head is used to |
139 | * keep a sorted-by-control-ID list of all controls, while the next pointer | 156 | * keep a sorted-by-control-ID list of all controls, while the next pointer |
@@ -143,6 +160,7 @@ struct v4l2_ctrl_ref { | |||
143 | struct list_head node; | 160 | struct list_head node; |
144 | struct v4l2_ctrl_ref *next; | 161 | struct v4l2_ctrl_ref *next; |
145 | struct v4l2_ctrl *ctrl; | 162 | struct v4l2_ctrl *ctrl; |
163 | struct v4l2_ctrl_helper *helper; | ||
146 | }; | 164 | }; |
147 | 165 | ||
148 | /** struct v4l2_ctrl_handler - The control handler keeps track of all the | 166 | /** struct v4l2_ctrl_handler - The control handler keeps track of all the |
@@ -363,6 +381,40 @@ int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl, | |||
363 | void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls); | 381 | void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls); |
364 | 382 | ||
365 | 383 | ||
384 | /** v4l2_ctrl_auto_cluster() - Mark all controls in the cluster as belonging to | ||
385 | * that cluster and set it up for autofoo/foo-type handling. | ||
386 | * @ncontrols: The number of controls in this cluster. | ||
387 | * @controls: The cluster control array of size @ncontrols. The first control | ||
388 | * must be the 'auto' control (e.g. autogain, autoexposure, etc.) | ||
389 | * @manual_val: The value for the first control in the cluster that equals the | ||
390 | * manual setting. | ||
391 | * @set_volatile: If true, then all controls except the first auto control will | ||
392 | * have is_volatile set to true. If false, then is_volatile will not | ||
393 | * be touched. | ||
394 | * | ||
395 | * Use for control groups where one control selects some automatic feature and | ||
396 | * the other controls are only active whenever the automatic feature is turned | ||
397 | * off (manual mode). Typical examples: autogain vs gain, auto-whitebalance vs | ||
398 | * red and blue balance, etc. | ||
399 | * | ||
400 | * The behavior of such controls is as follows: | ||
401 | * | ||
402 | * When the autofoo control is set to automatic, then any manual controls | ||
403 | * are set to inactive and any reads will call g_volatile_ctrl (if the control | ||
404 | * was marked volatile). | ||
405 | * | ||
406 | * When the autofoo control is set to manual, then any manual controls will | ||
407 | * be marked active, and any reads will just return the current value without | ||
408 | * going through g_volatile_ctrl. | ||
409 | * | ||
410 | * In addition, this function will set the V4L2_CTRL_FLAG_UPDATE flag | ||
411 | * on the autofoo control and V4L2_CTRL_FLAG_INACTIVE on the foo control(s) | ||
412 | * if autofoo is in auto mode. | ||
413 | */ | ||
414 | void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls, | ||
415 | u8 manual_val, bool set_volatile); | ||
416 | |||
417 | |||
366 | /** v4l2_ctrl_find() - Find a control with the given ID. | 418 | /** v4l2_ctrl_find() - Find a control with the given ID. |
367 | * @hdl: The control handler. | 419 | * @hdl: The control handler. |
368 | * @id: The control ID to find. | 420 | * @id: The control ID to find. |
@@ -379,9 +431,9 @@ struct v4l2_ctrl *v4l2_ctrl_find(struct v4l2_ctrl_handler *hdl, u32 id); | |||
379 | * This sets or clears the V4L2_CTRL_FLAG_INACTIVE flag atomically. | 431 | * This sets or clears the V4L2_CTRL_FLAG_INACTIVE flag atomically. |
380 | * Does nothing if @ctrl == NULL. | 432 | * Does nothing if @ctrl == NULL. |
381 | * This will usually be called from within the s_ctrl op. | 433 | * This will usually be called from within the s_ctrl op. |
434 | * The V4L2_EVENT_CTRL event will be generated afterwards. | ||
382 | * | 435 | * |
383 | * This function can be called regardless of whether the control handler | 436 | * This function assumes that the control handler is locked. |
384 | * is locked or not. | ||
385 | */ | 437 | */ |
386 | void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active); | 438 | void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active); |
387 | 439 | ||
@@ -391,11 +443,12 @@ void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active); | |||
391 | * | 443 | * |
392 | * This sets or clears the V4L2_CTRL_FLAG_GRABBED flag atomically. | 444 | * This sets or clears the V4L2_CTRL_FLAG_GRABBED flag atomically. |
393 | * Does nothing if @ctrl == NULL. | 445 | * Does nothing if @ctrl == NULL. |
446 | * The V4L2_EVENT_CTRL event will be generated afterwards. | ||
394 | * This will usually be called when starting or stopping streaming in the | 447 | * This will usually be called when starting or stopping streaming in the |
395 | * driver. | 448 | * driver. |
396 | * | 449 | * |
397 | * This function can be called regardless of whether the control handler | 450 | * This function assumes that the control handler is not locked and will |
398 | * is locked or not. | 451 | * take the lock itself. |
399 | */ | 452 | */ |
400 | void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); | 453 | void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); |
401 | 454 | ||
@@ -440,15 +493,22 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl); | |||
440 | */ | 493 | */ |
441 | int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); | 494 | int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); |
442 | 495 | ||
496 | /* Internal helper functions that deal with control events. */ | ||
497 | void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl, | ||
498 | struct v4l2_subscribed_event *sev); | ||
499 | void v4l2_ctrl_del_event(struct v4l2_ctrl *ctrl, | ||
500 | struct v4l2_subscribed_event *sev); | ||
443 | 501 | ||
444 | /* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */ | 502 | /* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */ |
445 | int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc); | 503 | int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc); |
446 | int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm); | 504 | int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm); |
447 | int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl); | 505 | int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl); |
448 | int v4l2_s_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl); | 506 | int v4l2_s_ctrl(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl, |
507 | struct v4l2_control *ctrl); | ||
449 | int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); | 508 | int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); |
450 | int v4l2_try_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); | 509 | int v4l2_try_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); |
451 | int v4l2_s_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); | 510 | int v4l2_s_ext_ctrls(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl, |
511 | struct v4l2_ext_controls *c); | ||
452 | 512 | ||
453 | /* Helpers for subdevices. If the associated ctrl_handler == NULL then they | 513 | /* Helpers for subdevices. If the associated ctrl_handler == NULL then they |
454 | will all return -EINVAL. */ | 514 | will all return -EINVAL. */ |
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index 3b86177c8cd2..5f14e8895ce2 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h | |||
@@ -29,39 +29,95 @@ | |||
29 | #include <linux/videodev2.h> | 29 | #include <linux/videodev2.h> |
30 | #include <linux/wait.h> | 30 | #include <linux/wait.h> |
31 | 31 | ||
32 | /* | ||
33 | * Overview: | ||
34 | * | ||
35 | * Events are subscribed per-filehandle. An event specification consists of a | ||
36 | * type and is optionally associated with an object identified through the | ||
37 | * 'id' field. So an event is uniquely identified by the (type, id) tuple. | ||
38 | * | ||
39 | * The v4l2-fh struct has a list of subscribed events. The v4l2_subscribed_event | ||
40 | * struct is added to that list, one for every subscribed event. | ||
41 | * | ||
42 | * Each v4l2_subscribed_event struct ends with an array of v4l2_kevent structs. | ||
43 | * This array (ringbuffer, really) is used to store any events raised by the | ||
44 | * driver. The v4l2_kevent struct links into the 'available' list of the | ||
45 | * v4l2_fh struct so VIDIOC_DQEVENT will know which event to dequeue first. | ||
46 | * | ||
47 | * Finally, if the event subscription is associated with a particular object | ||
48 | * such as a V4L2 control, then that object needs to know about that as well | ||
49 | * so that an event can be raised by that object. So the 'node' field can | ||
50 | * be used to link the v4l2_subscribed_event struct into a list of that | ||
51 | * object. | ||
52 | * | ||
53 | * So to summarize: | ||
54 | * | ||
55 | * struct v4l2_fh has two lists: one of the subscribed events, and one of the | ||
56 | * pending events. | ||
57 | * | ||
58 | * struct v4l2_subscribed_event has a ringbuffer of raised (pending) events of | ||
59 | * that particular type. | ||
60 | * | ||
61 | * If struct v4l2_subscribed_event is associated with a specific object, then | ||
62 | * that object will have an internal list of struct v4l2_subscribed_event so | ||
63 | * it knows who subscribed an event to that object. | ||
64 | */ | ||
65 | |||
32 | struct v4l2_fh; | 66 | struct v4l2_fh; |
67 | struct v4l2_subscribed_event; | ||
33 | struct video_device; | 68 | struct video_device; |
34 | 69 | ||
70 | /** struct v4l2_kevent - Internal kernel event struct. | ||
71 | * @list: List node for the v4l2_fh->available list. | ||
72 | * @sev: Pointer to parent v4l2_subscribed_event. | ||
73 | * @event: The event itself. | ||
74 | */ | ||
35 | struct v4l2_kevent { | 75 | struct v4l2_kevent { |
36 | struct list_head list; | 76 | struct list_head list; |
77 | struct v4l2_subscribed_event *sev; | ||
37 | struct v4l2_event event; | 78 | struct v4l2_event event; |
38 | }; | 79 | }; |
39 | 80 | ||
81 | /** struct v4l2_subscribed_event - Internal struct representing a subscribed event. | ||
82 | * @list: List node for the v4l2_fh->subscribed list. | ||
83 | * @type: Event type. | ||
84 | * @id: Associated object ID (e.g. control ID). 0 if there isn't any. | ||
85 | * @flags: Copy of v4l2_event_subscription->flags. | ||
86 | * @fh: Filehandle that subscribed to this event. | ||
87 | * @node: List node that hooks into the object's event list (if there is one). | ||
88 | * @replace: Optional callback that can replace event 'old' with event 'new'. | ||
89 | * @merge: Optional callback that can merge event 'old' into event 'new'. | ||
90 | * @elems: The number of elements in the events array. | ||
91 | * @first: The index of the events containing the oldest available event. | ||
92 | * @in_use: The number of queued events. | ||
93 | * @events: An array of @elems events. | ||
94 | */ | ||
40 | struct v4l2_subscribed_event { | 95 | struct v4l2_subscribed_event { |
41 | struct list_head list; | 96 | struct list_head list; |
42 | u32 type; | 97 | u32 type; |
98 | u32 id; | ||
99 | u32 flags; | ||
100 | struct v4l2_fh *fh; | ||
101 | struct list_head node; | ||
102 | void (*replace)(struct v4l2_event *old, | ||
103 | const struct v4l2_event *new); | ||
104 | void (*merge)(const struct v4l2_event *old, | ||
105 | struct v4l2_event *new); | ||
106 | unsigned elems; | ||
107 | unsigned first; | ||
108 | unsigned in_use; | ||
109 | struct v4l2_kevent events[]; | ||
43 | }; | 110 | }; |
44 | 111 | ||
45 | struct v4l2_events { | ||
46 | wait_queue_head_t wait; | ||
47 | struct list_head subscribed; /* Subscribed events */ | ||
48 | struct list_head free; /* Events ready for use */ | ||
49 | struct list_head available; /* Dequeueable event */ | ||
50 | unsigned int navailable; | ||
51 | unsigned int nallocated; /* Number of allocated events */ | ||
52 | u32 sequence; | ||
53 | }; | ||
54 | |||
55 | int v4l2_event_init(struct v4l2_fh *fh); | ||
56 | int v4l2_event_alloc(struct v4l2_fh *fh, unsigned int n); | ||
57 | void v4l2_event_free(struct v4l2_fh *fh); | ||
58 | int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event, | 112 | int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event, |
59 | int nonblocking); | 113 | int nonblocking); |
60 | void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev); | 114 | void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev); |
115 | void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev); | ||
61 | int v4l2_event_pending(struct v4l2_fh *fh); | 116 | int v4l2_event_pending(struct v4l2_fh *fh); |
62 | int v4l2_event_subscribe(struct v4l2_fh *fh, | 117 | int v4l2_event_subscribe(struct v4l2_fh *fh, |
63 | struct v4l2_event_subscription *sub); | 118 | struct v4l2_event_subscription *sub, unsigned elems); |
64 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, | 119 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, |
65 | struct v4l2_event_subscription *sub); | 120 | struct v4l2_event_subscription *sub); |
121 | void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); | ||
66 | 122 | ||
67 | #endif /* V4L2_EVENT_H */ | 123 | #endif /* V4L2_EVENT_H */ |
diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index 0206aa55be24..52513c225c18 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h | |||
@@ -29,13 +29,20 @@ | |||
29 | #include <linux/list.h> | 29 | #include <linux/list.h> |
30 | 30 | ||
31 | struct video_device; | 31 | struct video_device; |
32 | struct v4l2_events; | 32 | struct v4l2_ctrl_handler; |
33 | 33 | ||
34 | struct v4l2_fh { | 34 | struct v4l2_fh { |
35 | struct list_head list; | 35 | struct list_head list; |
36 | struct video_device *vdev; | 36 | struct video_device *vdev; |
37 | struct v4l2_events *events; /* events, pending and subscribed */ | 37 | struct v4l2_ctrl_handler *ctrl_handler; |
38 | enum v4l2_priority prio; | 38 | enum v4l2_priority prio; |
39 | |||
40 | /* Events */ | ||
41 | wait_queue_head_t wait; | ||
42 | struct list_head subscribed; /* Subscribed events */ | ||
43 | struct list_head available; /* Dequeueable event */ | ||
44 | unsigned int navailable; | ||
45 | u32 sequence; | ||
39 | }; | 46 | }; |
40 | 47 | ||
41 | /* | 48 | /* |
@@ -44,7 +51,7 @@ struct v4l2_fh { | |||
44 | * from driver's v4l2_file_operations->open() handler if the driver | 51 | * from driver's v4l2_file_operations->open() handler if the driver |
45 | * uses v4l2_fh. | 52 | * uses v4l2_fh. |
46 | */ | 53 | */ |
47 | int v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev); | 54 | void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev); |
48 | /* | 55 | /* |
49 | * Add the fh to the list of file handles on a video_device. The file | 56 | * Add the fh to the list of file handles on a video_device. The file |
50 | * handle must be initialised first. | 57 | * handle must be initialised first. |
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 971c7fa29614..6114007c8c74 100644 --- a/include/media/v4l2-mediabus.h +++ b/include/media/v4l2-mediabus.h | |||
@@ -13,6 +13,69 @@ | |||
13 | 13 | ||
14 | #include <linux/v4l2-mediabus.h> | 14 | #include <linux/v4l2-mediabus.h> |
15 | 15 | ||
16 | /* Parallel flags */ | ||
17 | /* | ||
18 | * Can the client run in master or in slave mode. By "Master mode" an operation | ||
19 | * mode is meant, when the client (e.g., a camera sensor) is producing | ||
20 | * horizontal and vertical synchronisation. In "Slave mode" the host is | ||
21 | * providing these signals to the slave. | ||
22 | */ | ||
23 | #define V4L2_MBUS_MASTER (1 << 0) | ||
24 | #define V4L2_MBUS_SLAVE (1 << 1) | ||
25 | /* Which signal polarities it supports */ | ||
26 | /* Note: in BT.656 mode HSYNC and VSYNC are unused */ | ||
27 | #define V4L2_MBUS_HSYNC_ACTIVE_HIGH (1 << 2) | ||
28 | #define V4L2_MBUS_HSYNC_ACTIVE_LOW (1 << 3) | ||
29 | #define V4L2_MBUS_VSYNC_ACTIVE_HIGH (1 << 4) | ||
30 | #define V4L2_MBUS_VSYNC_ACTIVE_LOW (1 << 5) | ||
31 | #define V4L2_MBUS_PCLK_SAMPLE_RISING (1 << 6) | ||
32 | #define V4L2_MBUS_PCLK_SAMPLE_FALLING (1 << 7) | ||
33 | #define V4L2_MBUS_DATA_ACTIVE_HIGH (1 << 8) | ||
34 | #define V4L2_MBUS_DATA_ACTIVE_LOW (1 << 9) | ||
35 | |||
36 | /* Serial flags */ | ||
37 | /* How many lanes the client can use */ | ||
38 | #define V4L2_MBUS_CSI2_1_LANE (1 << 0) | ||
39 | #define V4L2_MBUS_CSI2_2_LANE (1 << 1) | ||
40 | #define V4L2_MBUS_CSI2_3_LANE (1 << 2) | ||
41 | #define V4L2_MBUS_CSI2_4_LANE (1 << 3) | ||
42 | /* On which channels it can send video data */ | ||
43 | #define V4L2_MBUS_CSI2_CHANNEL_0 (1 << 4) | ||
44 | #define V4L2_MBUS_CSI2_CHANNEL_1 (1 << 5) | ||
45 | #define V4L2_MBUS_CSI2_CHANNEL_2 (1 << 6) | ||
46 | #define V4L2_MBUS_CSI2_CHANNEL_3 (1 << 7) | ||
47 | /* Does it support only continuous or also non-continuous clock mode */ | ||
48 | #define V4L2_MBUS_CSI2_CONTINUOUS_CLOCK (1 << 8) | ||
49 | #define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK (1 << 9) | ||
50 | |||
51 | #define V4L2_MBUS_CSI2_LANES (V4L2_MBUS_CSI2_1_LANE | V4L2_MBUS_CSI2_2_LANE | \ | ||
52 | V4L2_MBUS_CSI2_3_LANE | V4L2_MBUS_CSI2_4_LANE) | ||
53 | #define V4L2_MBUS_CSI2_CHANNELS (V4L2_MBUS_CSI2_CHANNEL_0 | V4L2_MBUS_CSI2_CHANNEL_1 | \ | ||
54 | V4L2_MBUS_CSI2_CHANNEL_2 | V4L2_MBUS_CSI2_CHANNEL_3) | ||
55 | |||
56 | /** | ||
57 | * v4l2_mbus_type - media bus type | ||
58 | * @V4L2_MBUS_PARALLEL: parallel interface with hsync and vsync | ||
59 | * @V4L2_MBUS_BT656: parallel interface with embedded synchronisation, can | ||
60 | * also be used for BT.1120 | ||
61 | * @V4L2_MBUS_CSI2: MIPI CSI-2 serial interface | ||
62 | */ | ||
63 | enum v4l2_mbus_type { | ||
64 | V4L2_MBUS_PARALLEL, | ||
65 | V4L2_MBUS_BT656, | ||
66 | V4L2_MBUS_CSI2, | ||
67 | }; | ||
68 | |||
69 | /** | ||
70 | * v4l2_mbus_config - media bus configuration | ||
71 | * @type: in: interface type | ||
72 | * @flags: in / out: configuration flags, depending on @type | ||
73 | */ | ||
74 | struct v4l2_mbus_config { | ||
75 | enum v4l2_mbus_type type; | ||
76 | unsigned int flags; | ||
77 | }; | ||
78 | |||
16 | static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt, | 79 | static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt, |
17 | const struct v4l2_mbus_framefmt *mbus_fmt) | 80 | const struct v4l2_mbus_framefmt *mbus_fmt) |
18 | { | 81 | { |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 2884e3e69cb1..257da1a30f66 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -229,6 +229,12 @@ struct v4l2_subdev_audio_ops { | |||
229 | s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by | 229 | s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by |
230 | video input devices. | 230 | video input devices. |
231 | 231 | ||
232 | g_std_output: get current standard for video OUTPUT devices. This is ignored | ||
233 | by video input devices. | ||
234 | |||
235 | g_tvnorms_output: get v4l2_std_id with all standards supported by video | ||
236 | OUTPUT device. This is ignored by video input devices. | ||
237 | |||
232 | s_crystal_freq: sets the frequency of the crystal used to generate the | 238 | s_crystal_freq: sets the frequency of the crystal used to generate the |
233 | clocks in Hz. An extra flags field allows device specific configuration | 239 | clocks in Hz. An extra flags field allows device specific configuration |
234 | regarding clock frequency dividers, etc. If not used, then set flags | 240 | regarding clock frequency dividers, etc. If not used, then set flags |
@@ -243,6 +249,8 @@ struct v4l2_subdev_audio_ops { | |||
243 | s_dv_preset: set dv (Digital Video) preset in the sub device. Similar to | 249 | s_dv_preset: set dv (Digital Video) preset in the sub device. Similar to |
244 | s_std() | 250 | s_std() |
245 | 251 | ||
252 | g_dv_preset: get current dv (Digital Video) preset in the sub device. | ||
253 | |||
246 | query_dv_preset: query dv preset in the sub device. This is similar to | 254 | query_dv_preset: query dv preset in the sub device. This is similar to |
247 | querystd() | 255 | querystd() |
248 | 256 | ||
@@ -259,12 +267,20 @@ struct v4l2_subdev_audio_ops { | |||
259 | try_mbus_fmt: try to set a pixel format on a video data source | 267 | try_mbus_fmt: try to set a pixel format on a video data source |
260 | 268 | ||
261 | s_mbus_fmt: set a pixel format on a video data source | 269 | s_mbus_fmt: set a pixel format on a video data source |
270 | |||
271 | g_mbus_config: get supported mediabus configurations | ||
272 | |||
273 | s_mbus_config: set a certain mediabus configuration. This operation is added | ||
274 | for compatibility with soc-camera drivers and should not be used by new | ||
275 | software. | ||
262 | */ | 276 | */ |
263 | struct v4l2_subdev_video_ops { | 277 | struct v4l2_subdev_video_ops { |
264 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); | 278 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); |
265 | int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags); | 279 | int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags); |
266 | int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); | 280 | int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); |
281 | int (*g_std_output)(struct v4l2_subdev *sd, v4l2_std_id *std); | ||
267 | int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); | 282 | int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); |
283 | int (*g_tvnorms_output)(struct v4l2_subdev *sd, v4l2_std_id *std); | ||
268 | int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); | 284 | int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); |
269 | int (*s_stream)(struct v4l2_subdev *sd, int enable); | 285 | int (*s_stream)(struct v4l2_subdev *sd, int enable); |
270 | int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc); | 286 | int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc); |
@@ -282,6 +298,8 @@ struct v4l2_subdev_video_ops { | |||
282 | struct v4l2_dv_enum_preset *preset); | 298 | struct v4l2_dv_enum_preset *preset); |
283 | int (*s_dv_preset)(struct v4l2_subdev *sd, | 299 | int (*s_dv_preset)(struct v4l2_subdev *sd, |
284 | struct v4l2_dv_preset *preset); | 300 | struct v4l2_dv_preset *preset); |
301 | int (*g_dv_preset)(struct v4l2_subdev *sd, | ||
302 | struct v4l2_dv_preset *preset); | ||
285 | int (*query_dv_preset)(struct v4l2_subdev *sd, | 303 | int (*query_dv_preset)(struct v4l2_subdev *sd, |
286 | struct v4l2_dv_preset *preset); | 304 | struct v4l2_dv_preset *preset); |
287 | int (*s_dv_timings)(struct v4l2_subdev *sd, | 305 | int (*s_dv_timings)(struct v4l2_subdev *sd, |
@@ -298,6 +316,10 @@ struct v4l2_subdev_video_ops { | |||
298 | struct v4l2_mbus_framefmt *fmt); | 316 | struct v4l2_mbus_framefmt *fmt); |
299 | int (*s_mbus_fmt)(struct v4l2_subdev *sd, | 317 | int (*s_mbus_fmt)(struct v4l2_subdev *sd, |
300 | struct v4l2_mbus_framefmt *fmt); | 318 | struct v4l2_mbus_framefmt *fmt); |
319 | int (*g_mbus_config)(struct v4l2_subdev *sd, | ||
320 | struct v4l2_mbus_config *cfg); | ||
321 | int (*s_mbus_config)(struct v4l2_subdev *sd, | ||
322 | const struct v4l2_mbus_config *cfg); | ||
301 | }; | 323 | }; |
302 | 324 | ||
303 | /* | 325 | /* |
@@ -513,8 +535,6 @@ struct v4l2_subdev { | |||
513 | void *host_priv; | 535 | void *host_priv; |
514 | /* subdev device node */ | 536 | /* subdev device node */ |
515 | struct video_device devnode; | 537 | struct video_device devnode; |
516 | /* number of events to be allocated on open */ | ||
517 | unsigned int nevents; | ||
518 | }; | 538 | }; |
519 | 539 | ||
520 | #define media_entity_to_v4l2_subdev(ent) \ | 540 | #define media_entity_to_v4l2_subdev(ent) \ |
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index d2ea112fc20f..726e94742a5c 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h | |||
@@ -23,8 +23,8 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <linux/videodev2.h> | 25 | #include <linux/videodev2.h> |
26 | #include <media/v4l2-ctrls.h> | ||
26 | #include <media/v4l2-dev.h> | 27 | #include <media/v4l2-dev.h> |
27 | #include <media/v4l2-ioctl.h> | ||
28 | 28 | ||
29 | #define TEA575X_FMIF 10700 | 29 | #define TEA575X_FMIF 10700 |
30 | 30 | ||
@@ -42,18 +42,20 @@ struct snd_tea575x_ops { | |||
42 | }; | 42 | }; |
43 | 43 | ||
44 | struct snd_tea575x { | 44 | struct snd_tea575x { |
45 | struct video_device *vd; /* video device */ | 45 | struct video_device vd; /* video device */ |
46 | bool tea5759; /* 5759 chip is present */ | 46 | bool tea5759; /* 5759 chip is present */ |
47 | bool mute; /* Device is muted? */ | 47 | bool mute; /* Device is muted? */ |
48 | bool stereo; /* receiving stereo */ | 48 | bool stereo; /* receiving stereo */ |
49 | bool tuned; /* tuned to a station */ | 49 | bool tuned; /* tuned to a station */ |
50 | unsigned int val; /* hw value */ | 50 | unsigned int val; /* hw value */ |
51 | unsigned long freq; /* frequency */ | 51 | unsigned long freq; /* frequency */ |
52 | unsigned long in_use; /* set if the device is in use */ | 52 | struct mutex mutex; |
53 | struct snd_tea575x_ops *ops; | 53 | struct snd_tea575x_ops *ops; |
54 | void *private_data; | 54 | void *private_data; |
55 | u8 card[32]; | 55 | u8 card[32]; |
56 | u8 bus_info[32]; | 56 | u8 bus_info[32]; |
57 | struct v4l2_ctrl_handler ctrl_handler; | ||
58 | int (*ext_init)(struct snd_tea575x *tea); | ||
57 | }; | 59 | }; |
58 | 60 | ||
59 | int snd_tea575x_init(struct snd_tea575x *tea); | 61 | int snd_tea575x_init(struct snd_tea575x *tea); |