diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 13:38:08 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 13:38:08 -0400 |
| commit | f63b759c44b0561c76a67894c734157df3313b42 (patch) | |
| tree | 4e9638f6c1aa5c0faa62ad4213282cc7cb39772a /include | |
| parent | 4a35cee066df1b1958e25e71595b3845d06b192e (diff) | |
| parent | 844a9e93d7fcd910cd94f6eb262e2cc43cacbe56 (diff) | |
Merge branch 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (243 commits)
V4L/DVB: sms: Convert IR support to use the Remote Controller core
V4L/DVB: sms: properly initialize IR phys and IR name
V4L/DVB: standardize names at rc-dib0700 tables
V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
V4L/DVB: dib0700: Fix RC protocol logic to properly handle NEC/NECx and RC-5
V4L/DVB: dib0700: properly implement IR change_protocol
V4L/DVB: dib0700: break keytable into NEC and RC-5 variants
V4L/DVB: dib0700: avoid bad repeat
V4L/DVB: Port dib0700 to rc-core
V4L/DVB: Add a keymap file with dib0700 table
V4L/DVB: dvb-usb: add support for rc-core mode
V4L/DVB: dvb-usb: prepare drivers for using rc-core
V4L/DVB: dvb-usb: get rid of struct dvb_usb_rc_key
V4L/DVB: rj54n1cb0c: fix a comment in the driver
V4L/DVB: V4L2: sh_vou: VOU does support the full PAL resolution too
V4L/DVB: V4L2: sh_mobile_camera_ceu: add support for CSI2
V4L/DVB: V4L2: soc-camera: add a MIPI CSI-2 driver for SH-Mobile platforms
V4L/DVB: V4L2: soc-camera: export soc-camera bus type for notifications
V4L/DVB: V4L2: mediabus: add 12-bit Bayer and YUV420 pixel formats
V4L/DVB: mediabus: fix ambiguous pixel code names
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/dvb/frontend.h | 1 | ||||
| -rw-r--r-- | include/linux/dvb/version.h | 2 | ||||
| -rw-r--r-- | include/linux/usb/video.h | 404 | ||||
| -rw-r--r-- | include/media/ir-core.h | 8 | ||||
| -rw-r--r-- | include/media/ir-kbd-i2c.h | 2 | ||||
| -rw-r--r-- | include/media/lirc.h | 165 | ||||
| -rw-r--r-- | include/media/lirc_dev.h | 225 | ||||
| -rw-r--r-- | include/media/rc-map.h | 10 | ||||
| -rw-r--r-- | include/media/sh_mobile_ceu.h | 3 | ||||
| -rw-r--r-- | include/media/sh_mobile_csi2.h | 46 | ||||
| -rw-r--r-- | include/media/soc_camera.h | 3 | ||||
| -rw-r--r-- | include/media/v4l2-mediabus.h | 13 | ||||
| -rw-r--r-- | include/media/videobuf-core.h | 6 | ||||
| -rw-r--r-- | include/media/videobuf-dma-sg.h | 39 | ||||
| -rw-r--r-- | include/media/videobuf-vmalloc.h | 2 |
15 files changed, 891 insertions, 38 deletions
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index b6cb5425cde3..493a2bf85f62 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h | |||
| @@ -62,6 +62,7 @@ typedef enum fe_caps { | |||
| 62 | FE_CAN_8VSB = 0x200000, | 62 | FE_CAN_8VSB = 0x200000, |
| 63 | FE_CAN_16VSB = 0x400000, | 63 | FE_CAN_16VSB = 0x400000, |
| 64 | FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */ | 64 | FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */ |
| 65 | FE_CAN_TURBO_FEC = 0x8000000, /* frontend supports "turbo fec modulation" */ | ||
| 65 | FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */ | 66 | FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */ |
| 66 | FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */ | 67 | FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */ |
| 67 | FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */ | 68 | FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */ |
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h index 540b0583d9fb..5a7546c12688 100644 --- a/include/linux/dvb/version.h +++ b/include/linux/dvb/version.h | |||
| @@ -24,6 +24,6 @@ | |||
| 24 | #define _DVBVERSION_H_ | 24 | #define _DVBVERSION_H_ |
| 25 | 25 | ||
| 26 | #define DVB_API_VERSION 5 | 26 | #define DVB_API_VERSION 5 |
| 27 | #define DVB_API_VERSION_MINOR 1 | 27 | #define DVB_API_VERSION_MINOR 2 |
| 28 | 28 | ||
| 29 | #endif /*_DVBVERSION_H_*/ | 29 | #endif /*_DVBVERSION_H_*/ |
diff --git a/include/linux/usb/video.h b/include/linux/usb/video.h index be436d9ee479..3b3b95e01f71 100644 --- a/include/linux/usb/video.h +++ b/include/linux/usb/video.h | |||
| @@ -160,5 +160,409 @@ | |||
| 160 | #define UVC_STATUS_TYPE_CONTROL 1 | 160 | #define UVC_STATUS_TYPE_CONTROL 1 |
| 161 | #define UVC_STATUS_TYPE_STREAMING 2 | 161 | #define UVC_STATUS_TYPE_STREAMING 2 |
| 162 | 162 | ||
| 163 | /* 2.4.3.3. Payload Header Information */ | ||
| 164 | #define UVC_STREAM_EOH (1 << 7) | ||
| 165 | #define UVC_STREAM_ERR (1 << 6) | ||
| 166 | #define UVC_STREAM_STI (1 << 5) | ||
| 167 | #define UVC_STREAM_RES (1 << 4) | ||
| 168 | #define UVC_STREAM_SCR (1 << 3) | ||
| 169 | #define UVC_STREAM_PTS (1 << 2) | ||
| 170 | #define UVC_STREAM_EOF (1 << 1) | ||
| 171 | #define UVC_STREAM_FID (1 << 0) | ||
| 172 | |||
| 173 | /* 4.1.2. Control Capabilities */ | ||
| 174 | #define UVC_CONTROL_CAP_GET (1 << 0) | ||
| 175 | #define UVC_CONTROL_CAP_SET (1 << 1) | ||
| 176 | #define UVC_CONTROL_CAP_DISABLED (1 << 2) | ||
| 177 | #define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3) | ||
| 178 | #define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4) | ||
| 179 | |||
| 180 | /* ------------------------------------------------------------------------ | ||
| 181 | * UVC structures | ||
| 182 | */ | ||
| 183 | |||
| 184 | /* All UVC descriptors have these 3 fields at the beginning */ | ||
| 185 | struct uvc_descriptor_header { | ||
| 186 | __u8 bLength; | ||
| 187 | __u8 bDescriptorType; | ||
| 188 | __u8 bDescriptorSubType; | ||
| 189 | } __attribute__((packed)); | ||
| 190 | |||
| 191 | /* 3.7.2. Video Control Interface Header Descriptor */ | ||
| 192 | struct uvc_header_descriptor { | ||
| 193 | __u8 bLength; | ||
| 194 | __u8 bDescriptorType; | ||
| 195 | __u8 bDescriptorSubType; | ||
| 196 | __u16 bcdUVC; | ||
| 197 | __u16 wTotalLength; | ||
| 198 | __u32 dwClockFrequency; | ||
| 199 | __u8 bInCollection; | ||
| 200 | __u8 baInterfaceNr[]; | ||
| 201 | } __attribute__((__packed__)); | ||
| 202 | |||
| 203 | #define UVC_DT_HEADER_SIZE(n) (12+(n)) | ||
| 204 | |||
| 205 | #define UVC_HEADER_DESCRIPTOR(n) \ | ||
| 206 | uvc_header_descriptor_##n | ||
| 207 | |||
| 208 | #define DECLARE_UVC_HEADER_DESCRIPTOR(n) \ | ||
| 209 | struct UVC_HEADER_DESCRIPTOR(n) { \ | ||
| 210 | __u8 bLength; \ | ||
| 211 | __u8 bDescriptorType; \ | ||
| 212 | __u8 bDescriptorSubType; \ | ||
| 213 | __u16 bcdUVC; \ | ||
| 214 | __u16 wTotalLength; \ | ||
| 215 | __u32 dwClockFrequency; \ | ||
| 216 | __u8 bInCollection; \ | ||
| 217 | __u8 baInterfaceNr[n]; \ | ||
| 218 | } __attribute__ ((packed)) | ||
| 219 | |||
| 220 | /* 3.7.2.1. Input Terminal Descriptor */ | ||
| 221 | struct uvc_input_terminal_descriptor { | ||
| 222 | __u8 bLength; | ||
| 223 | __u8 bDescriptorType; | ||
| 224 | __u8 bDescriptorSubType; | ||
| 225 | __u8 bTerminalID; | ||
| 226 | __u16 wTerminalType; | ||
| 227 | __u8 bAssocTerminal; | ||
| 228 | __u8 iTerminal; | ||
| 229 | } __attribute__((__packed__)); | ||
| 230 | |||
| 231 | #define UVC_DT_INPUT_TERMINAL_SIZE 8 | ||
| 232 | |||
| 233 | /* 3.7.2.2. Output Terminal Descriptor */ | ||
| 234 | struct uvc_output_terminal_descriptor { | ||
| 235 | __u8 bLength; | ||
| 236 | __u8 bDescriptorType; | ||
| 237 | __u8 bDescriptorSubType; | ||
| 238 | __u8 bTerminalID; | ||
| 239 | __u16 wTerminalType; | ||
| 240 | __u8 bAssocTerminal; | ||
| 241 | __u8 bSourceID; | ||
| 242 | __u8 iTerminal; | ||
| 243 | } __attribute__((__packed__)); | ||
| 244 | |||
| 245 | #define UVC_DT_OUTPUT_TERMINAL_SIZE 9 | ||
| 246 | |||
| 247 | /* 3.7.2.3. Camera Terminal Descriptor */ | ||
| 248 | struct uvc_camera_terminal_descriptor { | ||
| 249 | __u8 bLength; | ||
| 250 | __u8 bDescriptorType; | ||
| 251 | __u8 bDescriptorSubType; | ||
| 252 | __u8 bTerminalID; | ||
| 253 | __u16 wTerminalType; | ||
| 254 | __u8 bAssocTerminal; | ||
| 255 | __u8 iTerminal; | ||
| 256 | __u16 wObjectiveFocalLengthMin; | ||
| 257 | __u16 wObjectiveFocalLengthMax; | ||
| 258 | __u16 wOcularFocalLength; | ||
| 259 | __u8 bControlSize; | ||
| 260 | __u8 bmControls[3]; | ||
| 261 | } __attribute__((__packed__)); | ||
| 262 | |||
| 263 | #define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15+(n)) | ||
| 264 | |||
| 265 | /* 3.7.2.4. Selector Unit Descriptor */ | ||
| 266 | struct uvc_selector_unit_descriptor { | ||
| 267 | __u8 bLength; | ||
| 268 | __u8 bDescriptorType; | ||
| 269 | __u8 bDescriptorSubType; | ||
| 270 | __u8 bUnitID; | ||
| 271 | __u8 bNrInPins; | ||
| 272 | __u8 baSourceID[0]; | ||
| 273 | __u8 iSelector; | ||
| 274 | } __attribute__((__packed__)); | ||
| 275 | |||
| 276 | #define UVC_DT_SELECTOR_UNIT_SIZE(n) (6+(n)) | ||
| 277 | |||
| 278 | #define UVC_SELECTOR_UNIT_DESCRIPTOR(n) \ | ||
| 279 | uvc_selector_unit_descriptor_##n | ||
| 280 | |||
| 281 | #define DECLARE_UVC_SELECTOR_UNIT_DESCRIPTOR(n) \ | ||
| 282 | struct UVC_SELECTOR_UNIT_DESCRIPTOR(n) { \ | ||
| 283 | __u8 bLength; \ | ||
| 284 | __u8 bDescriptorType; \ | ||
| 285 | __u8 bDescriptorSubType; \ | ||
| 286 | __u8 bUnitID; \ | ||
| 287 | __u8 bNrInPins; \ | ||
| 288 | __u8 baSourceID[n]; \ | ||
| 289 | __u8 iSelector; \ | ||
| 290 | } __attribute__ ((packed)) | ||
| 291 | |||
| 292 | /* 3.7.2.5. Processing Unit Descriptor */ | ||
| 293 | struct uvc_processing_unit_descriptor { | ||
| 294 | __u8 bLength; | ||
| 295 | __u8 bDescriptorType; | ||
| 296 | __u8 bDescriptorSubType; | ||
| 297 | __u8 bUnitID; | ||
| 298 | __u8 bSourceID; | ||
| 299 | __u16 wMaxMultiplier; | ||
| 300 | __u8 bControlSize; | ||
| 301 | __u8 bmControls[2]; | ||
| 302 | __u8 iProcessing; | ||
| 303 | } __attribute__((__packed__)); | ||
| 304 | |||
| 305 | #define UVC_DT_PROCESSING_UNIT_SIZE(n) (9+(n)) | ||
| 306 | |||
| 307 | /* 3.7.2.6. Extension Unit Descriptor */ | ||
| 308 | struct uvc_extension_unit_descriptor { | ||
| 309 | __u8 bLength; | ||
| 310 | __u8 bDescriptorType; | ||
| 311 | __u8 bDescriptorSubType; | ||
| 312 | __u8 bUnitID; | ||
| 313 | __u8 guidExtensionCode[16]; | ||
| 314 | __u8 bNumControls; | ||
| 315 | __u8 bNrInPins; | ||
| 316 | __u8 baSourceID[0]; | ||
| 317 | __u8 bControlSize; | ||
| 318 | __u8 bmControls[0]; | ||
| 319 | __u8 iExtension; | ||
| 320 | } __attribute__((__packed__)); | ||
| 321 | |||
| 322 | #define UVC_DT_EXTENSION_UNIT_SIZE(p, n) (24+(p)+(n)) | ||
| 323 | |||
| 324 | #define UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \ | ||
| 325 | uvc_extension_unit_descriptor_##p_##n | ||
| 326 | |||
| 327 | #define DECLARE_UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \ | ||
| 328 | struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) { \ | ||
| 329 | __u8 bLength; \ | ||
| 330 | __u8 bDescriptorType; \ | ||
| 331 | __u8 bDescriptorSubType; \ | ||
| 332 | __u8 bUnitID; \ | ||
| 333 | __u8 guidExtensionCode[16]; \ | ||
| 334 | __u8 bNumControls; \ | ||
| 335 | __u8 bNrInPins; \ | ||
| 336 | __u8 baSourceID[p]; \ | ||
| 337 | __u8 bControlSize; \ | ||
| 338 | __u8 bmControls[n]; \ | ||
| 339 | __u8 iExtension; \ | ||
| 340 | } __attribute__ ((packed)) | ||
| 341 | |||
| 342 | /* 3.8.2.2. Video Control Interrupt Endpoint Descriptor */ | ||
| 343 | struct uvc_control_endpoint_descriptor { | ||
| 344 | __u8 bLength; | ||
| 345 | __u8 bDescriptorType; | ||
| 346 | __u8 bDescriptorSubType; | ||
| 347 | __u16 wMaxTransferSize; | ||
| 348 | } __attribute__((__packed__)); | ||
| 349 | |||
| 350 | #define UVC_DT_CONTROL_ENDPOINT_SIZE 5 | ||
| 351 | |||
| 352 | /* 3.9.2.1. Input Header Descriptor */ | ||
| 353 | struct uvc_input_header_descriptor { | ||
| 354 | __u8 bLength; | ||
| 355 | __u8 bDescriptorType; | ||
| 356 | __u8 bDescriptorSubType; | ||
| 357 | __u8 bNumFormats; | ||
| 358 | __u16 wTotalLength; | ||
| 359 | __u8 bEndpointAddress; | ||
| 360 | __u8 bmInfo; | ||
| 361 | __u8 bTerminalLink; | ||
| 362 | __u8 bStillCaptureMethod; | ||
| 363 | __u8 bTriggerSupport; | ||
| 364 | __u8 bTriggerUsage; | ||
| 365 | __u8 bControlSize; | ||
| 366 | __u8 bmaControls[]; | ||
| 367 | } __attribute__((__packed__)); | ||
| 368 | |||
| 369 | #define UVC_DT_INPUT_HEADER_SIZE(n, p) (13+(n*p)) | ||
| 370 | |||
| 371 | #define UVC_INPUT_HEADER_DESCRIPTOR(n, p) \ | ||
| 372 | uvc_input_header_descriptor_##n_##p | ||
| 373 | |||
| 374 | #define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p) \ | ||
| 375 | struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { \ | ||
| 376 | __u8 bLength; \ | ||
| 377 | __u8 bDescriptorType; \ | ||
| 378 | __u8 bDescriptorSubType; \ | ||
| 379 | __u8 bNumFormats; \ | ||
| 380 | __u16 wTotalLength; \ | ||
| 381 | __u8 bEndpointAddress; \ | ||
| 382 | __u8 bmInfo; \ | ||
| 383 | __u8 bTerminalLink; \ | ||
| 384 | __u8 bStillCaptureMethod; \ | ||
| 385 | __u8 bTriggerSupport; \ | ||
| 386 | __u8 bTriggerUsage; \ | ||
| 387 | __u8 bControlSize; \ | ||
| 388 | __u8 bmaControls[p][n]; \ | ||
| 389 | } __attribute__ ((packed)) | ||
| 390 | |||
| 391 | /* 3.9.2.2. Output Header Descriptor */ | ||
| 392 | struct uvc_output_header_descriptor { | ||
| 393 | __u8 bLength; | ||
| 394 | __u8 bDescriptorType; | ||
| 395 | __u8 bDescriptorSubType; | ||
| 396 | __u8 bNumFormats; | ||
| 397 | __u16 wTotalLength; | ||
| 398 | __u8 bEndpointAddress; | ||
| 399 | __u8 bTerminalLink; | ||
| 400 | __u8 bControlSize; | ||
| 401 | __u8 bmaControls[]; | ||
| 402 | } __attribute__((__packed__)); | ||
| 403 | |||
| 404 | #define UVC_DT_OUTPUT_HEADER_SIZE(n, p) (9+(n*p)) | ||
| 405 | |||
| 406 | #define UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \ | ||
| 407 | uvc_output_header_descriptor_##n_##p | ||
| 408 | |||
| 409 | #define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \ | ||
| 410 | struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { \ | ||
| 411 | __u8 bLength; \ | ||
| 412 | __u8 bDescriptorType; \ | ||
| 413 | __u8 bDescriptorSubType; \ | ||
| 414 | __u8 bNumFormats; \ | ||
| 415 | __u16 wTotalLength; \ | ||
| 416 | __u8 bEndpointAddress; \ | ||
| 417 | __u8 bTerminalLink; \ | ||
| 418 | __u8 bControlSize; \ | ||
| 419 | __u8 bmaControls[p][n]; \ | ||
| 420 | } __attribute__ ((packed)) | ||
| 421 | |||
| 422 | /* 3.9.2.6. Color matching descriptor */ | ||
| 423 | struct uvc_color_matching_descriptor { | ||
| 424 | __u8 bLength; | ||
| 425 | __u8 bDescriptorType; | ||
| 426 | __u8 bDescriptorSubType; | ||
| 427 | __u8 bColorPrimaries; | ||
| 428 | __u8 bTransferCharacteristics; | ||
| 429 | __u8 bMatrixCoefficients; | ||
| 430 | } __attribute__((__packed__)); | ||
| 431 | |||
| 432 | #define UVC_DT_COLOR_MATCHING_SIZE 6 | ||
| 433 | |||
| 434 | /* 4.3.1.1. Video Probe and Commit Controls */ | ||
| 435 | struct uvc_streaming_control { | ||
| 436 | __u16 bmHint; | ||
| 437 | __u8 bFormatIndex; | ||
| 438 | __u8 bFrameIndex; | ||
| 439 | __u32 dwFrameInterval; | ||
| 440 | __u16 wKeyFrameRate; | ||
| 441 | __u16 wPFrameRate; | ||
| 442 | __u16 wCompQuality; | ||
| 443 | __u16 wCompWindowSize; | ||
| 444 | __u16 wDelay; | ||
| 445 | __u32 dwMaxVideoFrameSize; | ||
| 446 | __u32 dwMaxPayloadTransferSize; | ||
| 447 | __u32 dwClockFrequency; | ||
| 448 | __u8 bmFramingInfo; | ||
| 449 | __u8 bPreferedVersion; | ||
| 450 | __u8 bMinVersion; | ||
| 451 | __u8 bMaxVersion; | ||
| 452 | } __attribute__((__packed__)); | ||
| 453 | |||
| 454 | /* Uncompressed Payload - 3.1.1. Uncompressed Video Format Descriptor */ | ||
| 455 | struct uvc_format_uncompressed { | ||
| 456 | __u8 bLength; | ||
| 457 | __u8 bDescriptorType; | ||
| 458 | __u8 bDescriptorSubType; | ||
| 459 | __u8 bFormatIndex; | ||
| 460 | __u8 bNumFrameDescriptors; | ||
| 461 | __u8 guidFormat[16]; | ||
| 462 | __u8 bBitsPerPixel; | ||
| 463 | __u8 bDefaultFrameIndex; | ||
| 464 | __u8 bAspectRatioX; | ||
| 465 | __u8 bAspectRatioY; | ||
| 466 | __u8 bmInterfaceFlags; | ||
| 467 | __u8 bCopyProtect; | ||
| 468 | } __attribute__((__packed__)); | ||
| 469 | |||
| 470 | #define UVC_DT_FORMAT_UNCOMPRESSED_SIZE 27 | ||
| 471 | |||
| 472 | /* Uncompressed Payload - 3.1.2. Uncompressed Video Frame Descriptor */ | ||
| 473 | struct uvc_frame_uncompressed { | ||
| 474 | __u8 bLength; | ||
| 475 | __u8 bDescriptorType; | ||
| 476 | __u8 bDescriptorSubType; | ||
| 477 | __u8 bFrameIndex; | ||
| 478 | __u8 bmCapabilities; | ||
| 479 | __u16 wWidth; | ||
| 480 | __u16 wHeight; | ||
| 481 | __u32 dwMinBitRate; | ||
| 482 | __u32 dwMaxBitRate; | ||
| 483 | __u32 dwMaxVideoFrameBufferSize; | ||
| 484 | __u32 dwDefaultFrameInterval; | ||
| 485 | __u8 bFrameIntervalType; | ||
| 486 | __u32 dwFrameInterval[]; | ||
| 487 | } __attribute__((__packed__)); | ||
| 488 | |||
| 489 | #define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26+4*(n)) | ||
| 490 | |||
| 491 | #define UVC_FRAME_UNCOMPRESSED(n) \ | ||
| 492 | uvc_frame_uncompressed_##n | ||
| 493 | |||
| 494 | #define DECLARE_UVC_FRAME_UNCOMPRESSED(n) \ | ||
| 495 | struct UVC_FRAME_UNCOMPRESSED(n) { \ | ||
| 496 | __u8 bLength; \ | ||
| 497 | __u8 bDescriptorType; \ | ||
| 498 | __u8 bDescriptorSubType; \ | ||
| 499 | __u8 bFrameIndex; \ | ||
| 500 | __u8 bmCapabilities; \ | ||
| 501 | __u16 wWidth; \ | ||
| 502 | __u16 wHeight; \ | ||
| 503 | __u32 dwMinBitRate; \ | ||
| 504 | __u32 dwMaxBitRate; \ | ||
| 505 | __u32 dwMaxVideoFrameBufferSize; \ | ||
| 506 | __u32 dwDefaultFrameInterval; \ | ||
| 507 | __u8 bFrameIntervalType; \ | ||
| 508 | __u32 dwFrameInterval[n]; \ | ||
| 509 | } __attribute__ ((packed)) | ||
| 510 | |||
| 511 | /* MJPEG Payload - 3.1.1. MJPEG Video Format Descriptor */ | ||
| 512 | struct uvc_format_mjpeg { | ||
| 513 | __u8 bLength; | ||
| 514 | __u8 bDescriptorType; | ||
| 515 | __u8 bDescriptorSubType; | ||
| 516 | __u8 bFormatIndex; | ||
| 517 | __u8 bNumFrameDescriptors; | ||
| 518 | __u8 bmFlags; | ||
| 519 | __u8 bDefaultFrameIndex; | ||
| 520 | __u8 bAspectRatioX; | ||
| 521 | __u8 bAspectRatioY; | ||
| 522 | __u8 bmInterfaceFlags; | ||
| 523 | __u8 bCopyProtect; | ||
| 524 | } __attribute__((__packed__)); | ||
| 525 | |||
| 526 | #define UVC_DT_FORMAT_MJPEG_SIZE 11 | ||
| 527 | |||
| 528 | /* MJPEG Payload - 3.1.2. MJPEG Video Frame Descriptor */ | ||
| 529 | struct uvc_frame_mjpeg { | ||
| 530 | __u8 bLength; | ||
| 531 | __u8 bDescriptorType; | ||
| 532 | __u8 bDescriptorSubType; | ||
| 533 | __u8 bFrameIndex; | ||
| 534 | __u8 bmCapabilities; | ||
| 535 | __u16 wWidth; | ||
| 536 | __u16 wHeight; | ||
| 537 | __u32 dwMinBitRate; | ||
| 538 | __u32 dwMaxBitRate; | ||
| 539 | __u32 dwMaxVideoFrameBufferSize; | ||
| 540 | __u32 dwDefaultFrameInterval; | ||
| 541 | __u8 bFrameIntervalType; | ||
| 542 | __u32 dwFrameInterval[]; | ||
| 543 | } __attribute__((__packed__)); | ||
| 544 | |||
| 545 | #define UVC_DT_FRAME_MJPEG_SIZE(n) (26+4*(n)) | ||
| 546 | |||
| 547 | #define UVC_FRAME_MJPEG(n) \ | ||
| 548 | uvc_frame_mjpeg_##n | ||
| 549 | |||
| 550 | #define DECLARE_UVC_FRAME_MJPEG(n) \ | ||
| 551 | struct UVC_FRAME_MJPEG(n) { \ | ||
| 552 | __u8 bLength; \ | ||
| 553 | __u8 bDescriptorType; \ | ||
| 554 | __u8 bDescriptorSubType; \ | ||
| 555 | __u8 bFrameIndex; \ | ||
| 556 | __u8 bmCapabilities; \ | ||
| 557 | __u16 wWidth; \ | ||
| 558 | __u16 wHeight; \ | ||
| 559 | __u32 dwMinBitRate; \ | ||
| 560 | __u32 dwMaxBitRate; \ | ||
| 561 | __u32 dwMaxVideoFrameBufferSize; \ | ||
| 562 | __u32 dwDefaultFrameInterval; \ | ||
| 563 | __u8 bFrameIntervalType; \ | ||
| 564 | __u32 dwFrameInterval[n]; \ | ||
| 565 | } __attribute__ ((packed)) | ||
| 566 | |||
| 163 | #endif /* __LINUX_USB_VIDEO_H */ | 567 | #endif /* __LINUX_USB_VIDEO_H */ |
| 164 | 568 | ||
diff --git a/include/media/ir-core.h b/include/media/ir-core.h index ad1303f20e00..513e60dd1010 100644 --- a/include/media/ir-core.h +++ b/include/media/ir-core.h | |||
| @@ -47,15 +47,21 @@ enum rc_driver_type { | |||
| 47 | * is opened. | 47 | * is opened. |
| 48 | * @close: callback to allow drivers to disable polling/irq when IR input device | 48 | * @close: callback to allow drivers to disable polling/irq when IR input device |
| 49 | * is opened. | 49 | * is opened. |
| 50 | * @s_tx_mask: set transmitter mask (for devices with multiple tx outputs) | ||
| 51 | * @s_tx_carrier: set transmit carrier frequency | ||
| 52 | * @tx_ir: transmit IR | ||
| 50 | */ | 53 | */ |
| 51 | struct ir_dev_props { | 54 | struct ir_dev_props { |
| 52 | enum rc_driver_type driver_type; | 55 | enum rc_driver_type driver_type; |
| 53 | unsigned long allowed_protos; | 56 | unsigned long allowed_protos; |
| 54 | u32 scanmask; | 57 | u32 scanmask; |
| 55 | void *priv; | 58 | void *priv; |
| 56 | int (*change_protocol)(void *priv, u64 ir_type); | 59 | int (*change_protocol)(void *priv, u64 ir_type); |
| 57 | int (*open)(void *priv); | 60 | int (*open)(void *priv); |
| 58 | void (*close)(void *priv); | 61 | void (*close)(void *priv); |
| 62 | int (*s_tx_mask)(void *priv, u32 mask); | ||
| 63 | int (*s_tx_carrier)(void *priv, u32 carrier); | ||
| 64 | int (*tx_ir)(void *priv, int *txbuf, u32 n); | ||
| 59 | }; | 65 | }; |
| 60 | 66 | ||
| 61 | struct ir_input_dev { | 67 | struct ir_input_dev { |
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h index 0506e45c9a4f..5e96d7a430be 100644 --- a/include/media/ir-kbd-i2c.h +++ b/include/media/ir-kbd-i2c.h | |||
| @@ -11,7 +11,7 @@ struct IR_i2c { | |||
| 11 | struct i2c_client *c; | 11 | struct i2c_client *c; |
| 12 | struct input_dev *input; | 12 | struct input_dev *input; |
| 13 | struct ir_input_state ir; | 13 | struct ir_input_state ir; |
| 14 | 14 | u64 ir_type; | |
| 15 | /* Used to avoid fast repeating */ | 15 | /* Used to avoid fast repeating */ |
| 16 | unsigned char old; | 16 | unsigned char old; |
| 17 | 17 | ||
diff --git a/include/media/lirc.h b/include/media/lirc.h new file mode 100644 index 000000000000..42c467c50519 --- /dev/null +++ b/include/media/lirc.h | |||
| @@ -0,0 +1,165 @@ | |||
| 1 | /* | ||
| 2 | * lirc.h - linux infrared remote control header file | ||
| 3 | * last modified 2010/07/13 by Jarod Wilson | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef _LINUX_LIRC_H | ||
| 7 | #define _LINUX_LIRC_H | ||
| 8 | |||
| 9 | #include <linux/types.h> | ||
| 10 | #include <linux/ioctl.h> | ||
| 11 | |||
| 12 | #define PULSE_BIT 0x01000000 | ||
| 13 | #define PULSE_MASK 0x00FFFFFF | ||
| 14 | |||
| 15 | #define LIRC_MODE2_SPACE 0x00000000 | ||
| 16 | #define LIRC_MODE2_PULSE 0x01000000 | ||
| 17 | #define LIRC_MODE2_FREQUENCY 0x02000000 | ||
| 18 | #define LIRC_MODE2_TIMEOUT 0x03000000 | ||
| 19 | |||
| 20 | #define LIRC_VALUE_MASK 0x00FFFFFF | ||
| 21 | #define LIRC_MODE2_MASK 0xFF000000 | ||
| 22 | |||
| 23 | #define LIRC_SPACE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_SPACE) | ||
| 24 | #define LIRC_PULSE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_PULSE) | ||
| 25 | #define LIRC_FREQUENCY(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY) | ||
| 26 | #define LIRC_TIMEOUT(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_TIMEOUT) | ||
| 27 | |||
| 28 | #define LIRC_VALUE(val) ((val)&LIRC_VALUE_MASK) | ||
| 29 | #define LIRC_MODE2(val) ((val)&LIRC_MODE2_MASK) | ||
| 30 | |||
| 31 | #define LIRC_IS_SPACE(val) (LIRC_MODE2(val) == LIRC_MODE2_SPACE) | ||
| 32 | #define LIRC_IS_PULSE(val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE) | ||
| 33 | #define LIRC_IS_FREQUENCY(val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY) | ||
| 34 | #define LIRC_IS_TIMEOUT(val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT) | ||
| 35 | |||
| 36 | /* used heavily by lirc userspace */ | ||
| 37 | #define lirc_t int | ||
| 38 | |||
| 39 | /*** lirc compatible hardware features ***/ | ||
| 40 | |||
| 41 | #define LIRC_MODE2SEND(x) (x) | ||
| 42 | #define LIRC_SEND2MODE(x) (x) | ||
| 43 | #define LIRC_MODE2REC(x) ((x) << 16) | ||
| 44 | #define LIRC_REC2MODE(x) ((x) >> 16) | ||
| 45 | |||
| 46 | #define LIRC_MODE_RAW 0x00000001 | ||
| 47 | #define LIRC_MODE_PULSE 0x00000002 | ||
| 48 | #define LIRC_MODE_MODE2 0x00000004 | ||
| 49 | #define LIRC_MODE_LIRCCODE 0x00000010 | ||
| 50 | |||
| 51 | |||
| 52 | #define LIRC_CAN_SEND_RAW LIRC_MODE2SEND(LIRC_MODE_RAW) | ||
| 53 | #define LIRC_CAN_SEND_PULSE LIRC_MODE2SEND(LIRC_MODE_PULSE) | ||
| 54 | #define LIRC_CAN_SEND_MODE2 LIRC_MODE2SEND(LIRC_MODE_MODE2) | ||
| 55 | #define LIRC_CAN_SEND_LIRCCODE LIRC_MODE2SEND(LIRC_MODE_LIRCCODE) | ||
| 56 | |||
| 57 | #define LIRC_CAN_SEND_MASK 0x0000003f | ||
| 58 | |||
| 59 | #define LIRC_CAN_SET_SEND_CARRIER 0x00000100 | ||
| 60 | #define LIRC_CAN_SET_SEND_DUTY_CYCLE 0x00000200 | ||
| 61 | #define LIRC_CAN_SET_TRANSMITTER_MASK 0x00000400 | ||
| 62 | |||
| 63 | #define LIRC_CAN_REC_RAW LIRC_MODE2REC(LIRC_MODE_RAW) | ||
| 64 | #define LIRC_CAN_REC_PULSE LIRC_MODE2REC(LIRC_MODE_PULSE) | ||
| 65 | #define LIRC_CAN_REC_MODE2 LIRC_MODE2REC(LIRC_MODE_MODE2) | ||
| 66 | #define LIRC_CAN_REC_LIRCCODE LIRC_MODE2REC(LIRC_MODE_LIRCCODE) | ||
| 67 | |||
| 68 | #define LIRC_CAN_REC_MASK LIRC_MODE2REC(LIRC_CAN_SEND_MASK) | ||
| 69 | |||
| 70 | #define LIRC_CAN_SET_REC_CARRIER (LIRC_CAN_SET_SEND_CARRIER << 16) | ||
| 71 | #define LIRC_CAN_SET_REC_DUTY_CYCLE (LIRC_CAN_SET_SEND_DUTY_CYCLE << 16) | ||
| 72 | |||
| 73 | #define LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE 0x40000000 | ||
| 74 | #define LIRC_CAN_SET_REC_CARRIER_RANGE 0x80000000 | ||
| 75 | #define LIRC_CAN_GET_REC_RESOLUTION 0x20000000 | ||
| 76 | #define LIRC_CAN_SET_REC_TIMEOUT 0x10000000 | ||
| 77 | #define LIRC_CAN_SET_REC_FILTER 0x08000000 | ||
| 78 | |||
| 79 | #define LIRC_CAN_MEASURE_CARRIER 0x02000000 | ||
| 80 | |||
| 81 | #define LIRC_CAN_SEND(x) ((x)&LIRC_CAN_SEND_MASK) | ||
| 82 | #define LIRC_CAN_REC(x) ((x)&LIRC_CAN_REC_MASK) | ||
| 83 | |||
| 84 | #define LIRC_CAN_NOTIFY_DECODE 0x01000000 | ||
| 85 | |||
| 86 | /*** IOCTL commands for lirc driver ***/ | ||
| 87 | |||
| 88 | #define LIRC_GET_FEATURES _IOR('i', 0x00000000, __u32) | ||
| 89 | |||
| 90 | #define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, __u32) | ||
| 91 | #define LIRC_GET_REC_MODE _IOR('i', 0x00000002, __u32) | ||
| 92 | #define LIRC_GET_SEND_CARRIER _IOR('i', 0x00000003, __u32) | ||
| 93 | #define LIRC_GET_REC_CARRIER _IOR('i', 0x00000004, __u32) | ||
| 94 | #define LIRC_GET_SEND_DUTY_CYCLE _IOR('i', 0x00000005, __u32) | ||
| 95 | #define LIRC_GET_REC_DUTY_CYCLE _IOR('i', 0x00000006, __u32) | ||
| 96 | #define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, __u32) | ||
| 97 | |||
| 98 | #define LIRC_GET_MIN_TIMEOUT _IOR('i', 0x00000008, __u32) | ||
| 99 | #define LIRC_GET_MAX_TIMEOUT _IOR('i', 0x00000009, __u32) | ||
| 100 | |||
| 101 | #define LIRC_GET_MIN_FILTER_PULSE _IOR('i', 0x0000000a, __u32) | ||
| 102 | #define LIRC_GET_MAX_FILTER_PULSE _IOR('i', 0x0000000b, __u32) | ||
| 103 | #define LIRC_GET_MIN_FILTER_SPACE _IOR('i', 0x0000000c, __u32) | ||
| 104 | #define LIRC_GET_MAX_FILTER_SPACE _IOR('i', 0x0000000d, __u32) | ||
| 105 | |||
| 106 | /* code length in bits, currently only for LIRC_MODE_LIRCCODE */ | ||
| 107 | #define LIRC_GET_LENGTH _IOR('i', 0x0000000f, __u32) | ||
| 108 | |||
| 109 | #define LIRC_SET_SEND_MODE _IOW('i', 0x00000011, __u32) | ||
| 110 | #define LIRC_SET_REC_MODE _IOW('i', 0x00000012, __u32) | ||
| 111 | /* Note: these can reset the according pulse_width */ | ||
| 112 | #define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, __u32) | ||
| 113 | #define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, __u32) | ||
| 114 | #define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, __u32) | ||
| 115 | #define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, __u32) | ||
| 116 | #define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, __u32) | ||
| 117 | |||
| 118 | /* | ||
| 119 | * when a timeout != 0 is set the driver will send a | ||
| 120 | * LIRC_MODE2_TIMEOUT data packet, otherwise LIRC_MODE2_TIMEOUT is | ||
| 121 | * never sent, timeout is disabled by default | ||
| 122 | */ | ||
| 123 | #define LIRC_SET_REC_TIMEOUT _IOW('i', 0x00000018, __u32) | ||
| 124 | |||
| 125 | /* 1 enables, 0 disables timeout reports in MODE2 */ | ||
| 126 | #define LIRC_SET_REC_TIMEOUT_REPORTS _IOW('i', 0x00000019, __u32) | ||
| 127 | |||
| 128 | /* | ||
| 129 | * pulses shorter than this are filtered out by hardware (software | ||
| 130 | * emulation in lirc_dev?) | ||
| 131 | */ | ||
| 132 | #define LIRC_SET_REC_FILTER_PULSE _IOW('i', 0x0000001a, __u32) | ||
| 133 | /* | ||
| 134 | * spaces shorter than this are filtered out by hardware (software | ||
| 135 | * emulation in lirc_dev?) | ||
| 136 | */ | ||
| 137 | #define LIRC_SET_REC_FILTER_SPACE _IOW('i', 0x0000001b, __u32) | ||
| 138 | /* | ||
| 139 | * if filter cannot be set independantly for pulse/space, this should | ||
| 140 | * be used | ||
| 141 | */ | ||
| 142 | #define LIRC_SET_REC_FILTER _IOW('i', 0x0000001c, __u32) | ||
| 143 | |||
| 144 | /* | ||
| 145 | * if enabled from the next key press on the driver will send | ||
| 146 | * LIRC_MODE2_FREQUENCY packets | ||
| 147 | */ | ||
| 148 | #define LIRC_SET_MEASURE_CARRIER_MODE _IOW('i', 0x0000001d, __u32) | ||
| 149 | |||
| 150 | /* | ||
| 151 | * to set a range use | ||
| 152 | * LIRC_SET_REC_DUTY_CYCLE_RANGE/LIRC_SET_REC_CARRIER_RANGE with the | ||
| 153 | * lower bound first and later | ||
| 154 | * LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER with the upper bound | ||
| 155 | */ | ||
| 156 | |||
| 157 | #define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, __u32) | ||
| 158 | #define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, __u32) | ||
| 159 | |||
| 160 | #define LIRC_NOTIFY_DECODE _IO('i', 0x00000020) | ||
| 161 | |||
| 162 | #define LIRC_SETUP_START _IO('i', 0x00000021) | ||
| 163 | #define LIRC_SETUP_END _IO('i', 0x00000022) | ||
| 164 | |||
| 165 | #endif | ||
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h new file mode 100644 index 000000000000..b1f60663cb39 --- /dev/null +++ b/include/media/lirc_dev.h | |||
| @@ -0,0 +1,225 @@ | |||
| 1 | /* | ||
| 2 | * LIRC base driver | ||
| 3 | * | ||
| 4 | * by Artur Lipowski <alipowski@interia.pl> | ||
| 5 | * This code is licensed under GNU GPL | ||
| 6 | * | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _LINUX_LIRC_DEV_H | ||
| 10 | #define _LINUX_LIRC_DEV_H | ||
| 11 | |||
| 12 | #define MAX_IRCTL_DEVICES 4 | ||
| 13 | #define BUFLEN 16 | ||
| 14 | |||
| 15 | #define mod(n, div) ((n) % (div)) | ||
| 16 | |||
| 17 | #include <linux/slab.h> | ||
| 18 | #include <linux/fs.h> | ||
| 19 | #include <linux/ioctl.h> | ||
| 20 | #include <linux/poll.h> | ||
| 21 | #include <linux/kfifo.h> | ||
| 22 | #include <media/lirc.h> | ||
| 23 | |||
| 24 | struct lirc_buffer { | ||
| 25 | wait_queue_head_t wait_poll; | ||
| 26 | spinlock_t fifo_lock; | ||
| 27 | unsigned int chunk_size; | ||
| 28 | unsigned int size; /* in chunks */ | ||
| 29 | /* Using chunks instead of bytes pretends to simplify boundary checking | ||
| 30 | * And should allow for some performance fine tunning later */ | ||
| 31 | struct kfifo fifo; | ||
| 32 | u8 fifo_initialized; | ||
| 33 | }; | ||
| 34 | |||
| 35 | static inline void lirc_buffer_clear(struct lirc_buffer *buf) | ||
| 36 | { | ||
| 37 | unsigned long flags; | ||
| 38 | |||
| 39 | if (buf->fifo_initialized) { | ||
| 40 | spin_lock_irqsave(&buf->fifo_lock, flags); | ||
| 41 | kfifo_reset(&buf->fifo); | ||
| 42 | spin_unlock_irqrestore(&buf->fifo_lock, flags); | ||
| 43 | } else | ||
| 44 | WARN(1, "calling %s on an uninitialized lirc_buffer\n", | ||
| 45 | __func__); | ||
| 46 | } | ||
| 47 | |||
| 48 | static inline int lirc_buffer_init(struct lirc_buffer *buf, | ||
| 49 | unsigned int chunk_size, | ||
| 50 | unsigned int size) | ||
| 51 | { | ||
| 52 | int ret; | ||
| 53 | |||
| 54 | init_waitqueue_head(&buf->wait_poll); | ||
| 55 | spin_lock_init(&buf->fifo_lock); | ||
| 56 | buf->chunk_size = chunk_size; | ||
| 57 | buf->size = size; | ||
| 58 | ret = kfifo_alloc(&buf->fifo, size * chunk_size, GFP_KERNEL); | ||
| 59 | if (ret == 0) | ||
| 60 | buf->fifo_initialized = 1; | ||
| 61 | |||
| 62 | return ret; | ||
| 63 | } | ||
| 64 | |||
| 65 | static inline void lirc_buffer_free(struct lirc_buffer *buf) | ||
| 66 | { | ||
| 67 | if (buf->fifo_initialized) { | ||
| 68 | kfifo_free(&buf->fifo); | ||
| 69 | buf->fifo_initialized = 0; | ||
| 70 | } else | ||
| 71 | WARN(1, "calling %s on an uninitialized lirc_buffer\n", | ||
| 72 | __func__); | ||
| 73 | } | ||
| 74 | |||
| 75 | static inline int lirc_buffer_len(struct lirc_buffer *buf) | ||
| 76 | { | ||
| 77 | int len; | ||
| 78 | unsigned long flags; | ||
| 79 | |||
| 80 | spin_lock_irqsave(&buf->fifo_lock, flags); | ||
| 81 | len = kfifo_len(&buf->fifo); | ||
| 82 | spin_unlock_irqrestore(&buf->fifo_lock, flags); | ||
| 83 | |||
| 84 | return len; | ||
| 85 | } | ||
| 86 | |||
| 87 | static inline int lirc_buffer_full(struct lirc_buffer *buf) | ||
| 88 | { | ||
| 89 | return lirc_buffer_len(buf) == buf->size * buf->chunk_size; | ||
| 90 | } | ||
| 91 | |||
| 92 | static inline int lirc_buffer_empty(struct lirc_buffer *buf) | ||
| 93 | { | ||
| 94 | return !lirc_buffer_len(buf); | ||
| 95 | } | ||
| 96 | |||
| 97 | static inline int lirc_buffer_available(struct lirc_buffer *buf) | ||
| 98 | { | ||
| 99 | return buf->size - (lirc_buffer_len(buf) / buf->chunk_size); | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline unsigned int lirc_buffer_read(struct lirc_buffer *buf, | ||
| 103 | unsigned char *dest) | ||
| 104 | { | ||
| 105 | unsigned int ret = 0; | ||
| 106 | |||
| 107 | if (lirc_buffer_len(buf) >= buf->chunk_size) | ||
| 108 | ret = kfifo_out_locked(&buf->fifo, dest, buf->chunk_size, | ||
| 109 | &buf->fifo_lock); | ||
| 110 | return ret; | ||
| 111 | |||
| 112 | } | ||
| 113 | |||
| 114 | static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, | ||
| 115 | unsigned char *orig) | ||
| 116 | { | ||
| 117 | unsigned int ret; | ||
| 118 | |||
| 119 | ret = kfifo_in_locked(&buf->fifo, orig, buf->chunk_size, | ||
| 120 | &buf->fifo_lock); | ||
| 121 | |||
| 122 | return ret; | ||
| 123 | } | ||
| 124 | |||
| 125 | struct lirc_driver { | ||
| 126 | char name[40]; | ||
| 127 | int minor; | ||
| 128 | unsigned long code_length; | ||
| 129 | unsigned int buffer_size; /* in chunks holding one code each */ | ||
| 130 | int sample_rate; | ||
| 131 | unsigned long features; | ||
| 132 | |||
| 133 | unsigned int chunk_size; | ||
| 134 | |||
| 135 | void *data; | ||
| 136 | int min_timeout; | ||
| 137 | int max_timeout; | ||
| 138 | int (*add_to_buf) (void *data, struct lirc_buffer *buf); | ||
| 139 | struct lirc_buffer *rbuf; | ||
| 140 | int (*set_use_inc) (void *data); | ||
| 141 | void (*set_use_dec) (void *data); | ||
| 142 | struct file_operations *fops; | ||
| 143 | struct device *dev; | ||
| 144 | struct module *owner; | ||
| 145 | }; | ||
| 146 | |||
| 147 | /* name: | ||
| 148 | * this string will be used for logs | ||
| 149 | * | ||
| 150 | * minor: | ||
| 151 | * indicates minor device (/dev/lirc) number for registered driver | ||
| 152 | * if caller fills it with negative value, then the first free minor | ||
| 153 | * number will be used (if available) | ||
| 154 | * | ||
| 155 | * code_length: | ||
| 156 | * length of the remote control key code expressed in bits | ||
| 157 | * | ||
| 158 | * sample_rate: | ||
| 159 | * | ||
| 160 | * data: | ||
| 161 | * it may point to any driver data and this pointer will be passed to | ||
| 162 | * all callback functions | ||
| 163 | * | ||
| 164 | * add_to_buf: | ||
| 165 | * add_to_buf will be called after specified period of the time or | ||
| 166 | * triggered by the external event, this behavior depends on value of | ||
| 167 | * the sample_rate this function will be called in user context. This | ||
| 168 | * routine should return 0 if data was added to the buffer and | ||
| 169 | * -ENODATA if none was available. This should add some number of bits | ||
| 170 | * evenly divisible by code_length to the buffer | ||
| 171 | * | ||
| 172 | * rbuf: | ||
| 173 | * if not NULL, it will be used as a read buffer, you will have to | ||
| 174 | * write to the buffer by other means, like irq's (see also | ||
| 175 | * lirc_serial.c). | ||
| 176 | * | ||
| 177 | * set_use_inc: | ||
| 178 | * set_use_inc will be called after device is opened | ||
| 179 | * | ||
| 180 | * set_use_dec: | ||
| 181 | * set_use_dec will be called after device is closed | ||
| 182 | * | ||
| 183 | * fops: | ||
| 184 | * file_operations for drivers which don't fit the current driver model. | ||
| 185 | * | ||
| 186 | * Some ioctl's can be directly handled by lirc_dev if the driver's | ||
| 187 | * ioctl function is NULL or if it returns -ENOIOCTLCMD (see also | ||
| 188 | * lirc_serial.c). | ||
| 189 | * | ||
| 190 | * owner: | ||
| 191 | * the module owning this struct | ||
| 192 | * | ||
| 193 | */ | ||
| 194 | |||
| 195 | |||
| 196 | /* following functions can be called ONLY from user context | ||
| 197 | * | ||
| 198 | * returns negative value on error or minor number | ||
| 199 | * of the registered device if success | ||
| 200 | * contents of the structure pointed by p is copied | ||
| 201 | */ | ||
| 202 | extern int lirc_register_driver(struct lirc_driver *d); | ||
| 203 | |||
| 204 | /* returns negative value on error or 0 if success | ||
| 205 | */ | ||
| 206 | extern int lirc_unregister_driver(int minor); | ||
| 207 | |||
| 208 | /* Returns the private data stored in the lirc_driver | ||
| 209 | * associated with the given device file pointer. | ||
| 210 | */ | ||
| 211 | void *lirc_get_pdata(struct file *file); | ||
| 212 | |||
| 213 | /* default file operations | ||
| 214 | * used by drivers if they override only some operations | ||
| 215 | */ | ||
| 216 | int lirc_dev_fop_open(struct inode *inode, struct file *file); | ||
| 217 | int lirc_dev_fop_close(struct inode *inode, struct file *file); | ||
| 218 | unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); | ||
| 219 | long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | ||
| 220 | ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length, | ||
| 221 | loff_t *ppos); | ||
| 222 | ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length, | ||
| 223 | loff_t *ppos); | ||
| 224 | |||
| 225 | #endif | ||
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index c78e99a435b6..9569d0863f8b 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
| @@ -17,8 +17,13 @@ | |||
| 17 | #define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ | 17 | #define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ |
| 18 | #define IR_TYPE_JVC (1 << 3) /* JVC protocol */ | 18 | #define IR_TYPE_JVC (1 << 3) /* JVC protocol */ |
| 19 | #define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ | 19 | #define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ |
| 20 | #define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ | ||
| 20 | #define IR_TYPE_OTHER (1u << 31) | 21 | #define IR_TYPE_OTHER (1u << 31) |
| 21 | 22 | ||
| 23 | #define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \ | ||
| 24 | IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \ | ||
| 25 | IR_TYPE_OTHER) | ||
| 26 | |||
| 22 | struct ir_scancode { | 27 | struct ir_scancode { |
| 23 | u32 scancode; | 28 | u32 scancode; |
| 24 | u32 keycode; | 29 | u32 keycode; |
| @@ -64,6 +69,8 @@ void rc_map_init(void); | |||
| 64 | #define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old" | 69 | #define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old" |
| 65 | #define RC_MAP_CINERGY_1400 "rc-cinergy-1400" | 70 | #define RC_MAP_CINERGY_1400 "rc-cinergy-1400" |
| 66 | #define RC_MAP_CINERGY "rc-cinergy" | 71 | #define RC_MAP_CINERGY "rc-cinergy" |
| 72 | #define RC_MAP_DIB0700_NEC_TABLE "rc-dib0700-nec" | ||
| 73 | #define RC_MAP_DIB0700_RC5_TABLE "rc-dib0700-rc5" | ||
| 67 | #define RC_MAP_DM1105_NEC "rc-dm1105-nec" | 74 | #define RC_MAP_DM1105_NEC "rc-dm1105-nec" |
| 68 | #define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro" | 75 | #define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro" |
| 69 | #define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t" | 76 | #define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t" |
| @@ -87,6 +94,7 @@ void rc_map_init(void); | |||
| 87 | #define RC_MAP_KAIOMY "rc-kaiomy" | 94 | #define RC_MAP_KAIOMY "rc-kaiomy" |
| 88 | #define RC_MAP_KWORLD_315U "rc-kworld-315u" | 95 | #define RC_MAP_KWORLD_315U "rc-kworld-315u" |
| 89 | #define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog" | 96 | #define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog" |
| 97 | #define RC_MAP_LIRC "rc-lirc" | ||
| 90 | #define RC_MAP_MANLI "rc-manli" | 98 | #define RC_MAP_MANLI "rc-manli" |
| 91 | #define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" | 99 | #define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" |
| 92 | #define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere" | 100 | #define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere" |
| @@ -107,6 +115,7 @@ void rc_map_init(void); | |||
| 107 | #define RC_MAP_PV951 "rc-pv951" | 115 | #define RC_MAP_PV951 "rc-pv951" |
| 108 | #define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new" | 116 | #define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new" |
| 109 | #define RC_MAP_RC5_TV "rc-rc5-tv" | 117 | #define RC_MAP_RC5_TV "rc-rc5-tv" |
| 118 | #define RC_MAP_RC6_MCE "rc-rc6-mce" | ||
| 110 | #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" | 119 | #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" |
| 111 | #define RC_MAP_TBS_NEC "rc-tbs-nec" | 120 | #define RC_MAP_TBS_NEC "rc-tbs-nec" |
| 112 | #define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs" | 121 | #define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs" |
| @@ -116,6 +125,7 @@ void rc_map_init(void); | |||
| 116 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" | 125 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" |
| 117 | #define RC_MAP_WINFAST "rc-winfast" | 126 | #define RC_MAP_WINFAST "rc-winfast" |
| 118 | #define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe" | 127 | #define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe" |
| 128 | |||
| 119 | /* | 129 | /* |
| 120 | * Please, do not just append newer Remote Controller names at the end. | 130 | * Please, do not just append newer Remote Controller names at the end. |
| 121 | * The names should be ordered in alphabetical order | 131 | * The names should be ordered in alphabetical order |
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h index b67747836878..80346a6d28a9 100644 --- a/include/media/sh_mobile_ceu.h +++ b/include/media/sh_mobile_ceu.h | |||
| @@ -6,8 +6,11 @@ | |||
| 6 | #define SH_CEU_FLAG_HSYNC_LOW (1 << 2) /* default High if possible */ | 6 | #define SH_CEU_FLAG_HSYNC_LOW (1 << 2) /* default High if possible */ |
| 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; | ||
| 10 | |||
| 9 | struct sh_mobile_ceu_info { | 11 | struct sh_mobile_ceu_info { |
| 10 | unsigned long flags; | 12 | unsigned long flags; |
| 13 | struct device *csi2_dev; | ||
| 11 | }; | 14 | }; |
| 12 | 15 | ||
| 13 | #endif /* __ASM_SH_MOBILE_CEU_H__ */ | 16 | #endif /* __ASM_SH_MOBILE_CEU_H__ */ |
diff --git a/include/media/sh_mobile_csi2.h b/include/media/sh_mobile_csi2.h new file mode 100644 index 000000000000..4d2615174461 --- /dev/null +++ b/include/media/sh_mobile_csi2.h | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | /* | ||
| 2 | * Driver header for the SH-Mobile MIPI CSI-2 unit | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef SH_MIPI_CSI | ||
| 12 | #define SH_MIPI_CSI | ||
| 13 | |||
| 14 | enum sh_csi2_phy { | ||
| 15 | SH_CSI2_PHY_MAIN, | ||
| 16 | SH_CSI2_PHY_SUB, | ||
| 17 | }; | ||
| 18 | |||
| 19 | enum sh_csi2_type { | ||
| 20 | SH_CSI2C, | ||
| 21 | SH_CSI2I, | ||
| 22 | }; | ||
| 23 | |||
| 24 | #define SH_CSI2_CRC (1 << 0) | ||
| 25 | #define SH_CSI2_ECC (1 << 1) | ||
| 26 | |||
| 27 | struct platform_device; | ||
| 28 | |||
| 29 | struct sh_csi2_client_config { | ||
| 30 | enum sh_csi2_phy phy; | ||
| 31 | unsigned char lanes; /* bitmask[3:0] */ | ||
| 32 | unsigned char channel; /* 0..3 */ | ||
| 33 | struct platform_device *pdev; /* client platform device */ | ||
| 34 | }; | ||
| 35 | |||
| 36 | struct sh_csi2_pdata { | ||
| 37 | enum sh_csi2_type type; | ||
| 38 | unsigned int flags; | ||
| 39 | struct sh_csi2_client_config *clients; | ||
| 40 | int num_clients; | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct device; | ||
| 44 | struct v4l2_device; | ||
| 45 | |||
| 46 | #endif | ||
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index b8289c2f609b..2ce957301f77 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
| @@ -12,12 +12,15 @@ | |||
| 12 | #ifndef SOC_CAMERA_H | 12 | #ifndef SOC_CAMERA_H |
| 13 | #define SOC_CAMERA_H | 13 | #define SOC_CAMERA_H |
| 14 | 14 | ||
| 15 | #include <linux/device.h> | ||
| 15 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
| 16 | #include <linux/pm.h> | 17 | #include <linux/pm.h> |
| 17 | #include <linux/videodev2.h> | 18 | #include <linux/videodev2.h> |
| 18 | #include <media/videobuf-core.h> | 19 | #include <media/videobuf-core.h> |
| 19 | #include <media/v4l2-device.h> | 20 | #include <media/v4l2-device.h> |
| 20 | 21 | ||
| 22 | extern struct bus_type soc_camera_bus_type; | ||
| 23 | |||
| 21 | struct soc_camera_device { | 24 | struct soc_camera_device { |
| 22 | struct list_head list; | 25 | struct list_head list; |
| 23 | struct device dev; | 26 | struct device dev; |
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 865cda7cd611..f0cf2e7def06 100644 --- a/include/media/v4l2-mediabus.h +++ b/include/media/v4l2-mediabus.h | |||
| @@ -24,10 +24,10 @@ | |||
| 24 | */ | 24 | */ |
| 25 | enum v4l2_mbus_pixelcode { | 25 | enum v4l2_mbus_pixelcode { |
| 26 | V4L2_MBUS_FMT_FIXED = 1, | 26 | V4L2_MBUS_FMT_FIXED = 1, |
| 27 | V4L2_MBUS_FMT_YUYV8_2X8_LE, | 27 | V4L2_MBUS_FMT_YUYV8_2X8, |
| 28 | V4L2_MBUS_FMT_YVYU8_2X8_LE, | 28 | V4L2_MBUS_FMT_YVYU8_2X8, |
| 29 | V4L2_MBUS_FMT_YUYV8_2X8_BE, | 29 | V4L2_MBUS_FMT_UYVY8_2X8, |
| 30 | V4L2_MBUS_FMT_YVYU8_2X8_BE, | 30 | V4L2_MBUS_FMT_VYUY8_2X8, |
| 31 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, | 31 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, |
| 32 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, | 32 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, |
| 33 | V4L2_MBUS_FMT_RGB565_2X8_LE, | 33 | V4L2_MBUS_FMT_RGB565_2X8_LE, |
| @@ -41,6 +41,11 @@ enum v4l2_mbus_pixelcode { | |||
| 41 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, | 41 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, |
| 42 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, | 42 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, |
| 43 | V4L2_MBUS_FMT_SGRBG8_1X8, | 43 | V4L2_MBUS_FMT_SGRBG8_1X8, |
| 44 | V4L2_MBUS_FMT_SBGGR12_1X12, | ||
| 45 | V4L2_MBUS_FMT_YUYV8_1_5X8, | ||
| 46 | V4L2_MBUS_FMT_YVYU8_1_5X8, | ||
| 47 | V4L2_MBUS_FMT_UYVY8_1_5X8, | ||
| 48 | V4L2_MBUS_FMT_VYUY8_1_5X8, | ||
| 44 | }; | 49 | }; |
| 45 | 50 | ||
| 46 | /** | 51 | /** |
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h index f91a736c133d..f2c41cebf453 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h | |||
| @@ -54,8 +54,6 @@ struct videobuf_queue; | |||
| 54 | 54 | ||
| 55 | struct videobuf_mapping { | 55 | struct videobuf_mapping { |
| 56 | unsigned int count; | 56 | unsigned int count; |
| 57 | unsigned long start; | ||
| 58 | unsigned long end; | ||
| 59 | struct videobuf_queue *q; | 57 | struct videobuf_queue *q; |
| 60 | }; | 58 | }; |
| 61 | 59 | ||
| @@ -127,7 +125,7 @@ struct videobuf_queue_ops { | |||
| 127 | struct videobuf_qtype_ops { | 125 | struct videobuf_qtype_ops { |
| 128 | u32 magic; | 126 | u32 magic; |
| 129 | 127 | ||
| 130 | struct videobuf_buffer *(*alloc)(size_t size); | 128 | struct videobuf_buffer *(*alloc_vb)(size_t size); |
| 131 | void *(*vaddr) (struct videobuf_buffer *buf); | 129 | void *(*vaddr) (struct videobuf_buffer *buf); |
| 132 | int (*iolock) (struct videobuf_queue *q, | 130 | int (*iolock) (struct videobuf_queue *q, |
| 133 | struct videobuf_buffer *vb, | 131 | struct videobuf_buffer *vb, |
| @@ -173,7 +171,7 @@ int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); | |||
| 173 | int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb, | 171 | int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb, |
| 174 | struct v4l2_framebuffer *fbuf); | 172 | struct v4l2_framebuffer *fbuf); |
| 175 | 173 | ||
| 176 | struct videobuf_buffer *videobuf_alloc(struct videobuf_queue *q); | 174 | struct videobuf_buffer *videobuf_alloc_vb(struct videobuf_queue *q); |
| 177 | 175 | ||
| 178 | /* Used on videobuf-dvb */ | 176 | /* Used on videobuf-dvb */ |
| 179 | void *videobuf_queue_to_vaddr(struct videobuf_queue *q, | 177 | void *videobuf_queue_to_vaddr(struct videobuf_queue *q, |
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h index a195f3b9c00a..97e07f46a0fa 100644 --- a/include/media/videobuf-dma-sg.h +++ b/include/media/videobuf-dma-sg.h | |||
| @@ -25,23 +25,6 @@ | |||
| 25 | /* --------------------------------------------------------------------- */ | 25 | /* --------------------------------------------------------------------- */ |
| 26 | 26 | ||
| 27 | /* | 27 | /* |
| 28 | * Return a scatterlist for some page-aligned vmalloc()'ed memory | ||
| 29 | * block (NULL on errors). Memory for the scatterlist is allocated | ||
| 30 | * using kmalloc. The caller must free the memory. | ||
| 31 | */ | ||
| 32 | struct scatterlist *videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages); | ||
| 33 | |||
| 34 | /* | ||
| 35 | * Return a scatterlist for a an array of userpages (NULL on errors). | ||
| 36 | * Memory for the scatterlist is allocated using kmalloc. The caller | ||
| 37 | * must free the memory. | ||
| 38 | */ | ||
| 39 | struct scatterlist *videobuf_pages_to_sg(struct page **pages, int nr_pages, | ||
| 40 | int offset); | ||
| 41 | |||
| 42 | /* --------------------------------------------------------------------- */ | ||
| 43 | |||
| 44 | /* | ||
| 45 | * A small set of helper functions to manage buffers (both userland | 28 | * A small set of helper functions to manage buffers (both userland |
| 46 | * and kernel) for DMA. | 29 | * and kernel) for DMA. |
| 47 | * | 30 | * |
| @@ -68,7 +51,7 @@ struct videobuf_dmabuf { | |||
| 68 | struct page **pages; | 51 | struct page **pages; |
| 69 | 52 | ||
| 70 | /* for kernel buffers */ | 53 | /* for kernel buffers */ |
| 71 | void *vmalloc; | 54 | void *vaddr; |
| 72 | 55 | ||
| 73 | /* for overlay buffers (pci-pci dma) */ | 56 | /* for overlay buffers (pci-pci dma) */ |
| 74 | dma_addr_t bus_addr; | 57 | dma_addr_t bus_addr; |
| @@ -87,6 +70,16 @@ struct videobuf_dma_sg_memory { | |||
| 87 | struct videobuf_dmabuf dma; | 70 | struct videobuf_dmabuf dma; |
| 88 | }; | 71 | }; |
| 89 | 72 | ||
| 73 | /* | ||
| 74 | * Scatter-gather DMA buffer API. | ||
| 75 | * | ||
| 76 | * These functions provide a simple way to create a page list and a | ||
| 77 | * scatter-gather list from a kernel, userspace of physical address and map the | ||
| 78 | * memory for DMA operation. | ||
| 79 | * | ||
| 80 | * Despite the name, this is totally unrelated to videobuf, except that | ||
| 81 | * videobuf-dma-sg uses the same API internally. | ||
| 82 | */ | ||
| 90 | void videobuf_dma_init(struct videobuf_dmabuf *dma); | 83 | void videobuf_dma_init(struct videobuf_dmabuf *dma); |
| 91 | int videobuf_dma_init_user(struct videobuf_dmabuf *dma, int direction, | 84 | int videobuf_dma_init_user(struct videobuf_dmabuf *dma, int direction, |
| 92 | unsigned long data, unsigned long size); | 85 | unsigned long data, unsigned long size); |
| @@ -96,8 +89,8 @@ int videobuf_dma_init_overlay(struct videobuf_dmabuf *dma, int direction, | |||
| 96 | dma_addr_t addr, int nr_pages); | 89 | dma_addr_t addr, int nr_pages); |
| 97 | int videobuf_dma_free(struct videobuf_dmabuf *dma); | 90 | int videobuf_dma_free(struct videobuf_dmabuf *dma); |
| 98 | 91 | ||
| 99 | int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma); | 92 | int videobuf_dma_map(struct device *dev, struct videobuf_dmabuf *dma); |
| 100 | int videobuf_dma_unmap(struct videobuf_queue *q, struct videobuf_dmabuf *dma); | 93 | int videobuf_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma); |
| 101 | struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf); | 94 | struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf); |
| 102 | 95 | ||
| 103 | void *videobuf_sg_alloc(size_t size); | 96 | void *videobuf_sg_alloc(size_t size); |
| @@ -111,11 +104,5 @@ void videobuf_queue_sg_init(struct videobuf_queue *q, | |||
| 111 | unsigned int msize, | 104 | unsigned int msize, |
| 112 | void *priv); | 105 | void *priv); |
| 113 | 106 | ||
| 114 | /*FIXME: these variants are used only on *-alsa code, where videobuf is | ||
| 115 | * used without queue | ||
| 116 | */ | ||
| 117 | int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma); | ||
| 118 | int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma); | ||
| 119 | |||
| 120 | #endif /* _VIDEOBUF_DMA_SG_H */ | 107 | #endif /* _VIDEOBUF_DMA_SG_H */ |
| 121 | 108 | ||
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h index 851eb1a2ff2a..e19403c18dae 100644 --- a/include/media/videobuf-vmalloc.h +++ b/include/media/videobuf-vmalloc.h | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | struct videobuf_vmalloc_memory { | 22 | struct videobuf_vmalloc_memory { |
| 23 | u32 magic; | 23 | u32 magic; |
| 24 | 24 | ||
| 25 | void *vmalloc; | 25 | void *vaddr; |
| 26 | 26 | ||
| 27 | /* remap_vmalloc_range seems to need to run | 27 | /* remap_vmalloc_range seems to need to run |
| 28 | * after mmap() on some cases */ | 28 | * after mmap() on some cases */ |
