diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-04 12:50:07 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-04 12:50:07 -0400 |
| commit | 3c83e61e67256e0bb08c46cc2db43b58fd617251 (patch) | |
| tree | 0233e1e04e6449c60b01ff5dea8bea85bcf22f08 /include | |
| parent | 4a4389abdd9822fdf3cc2ac6ed87eb811fd43acc (diff) | |
| parent | a83b93a7480441a47856dc9104bea970e84cda87 (diff) | |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab:
"The main set of series of patches for media subsystem, including:
- document RC sysfs class
- added an API to setup scancode to allow waking up systems using the
Remote Controller
- add API for SDR devices. Drivers are still on staging
- some API improvements for getting EDID data from media
inputs/outputs
- new DVB frontend driver for drx-j (ATSC)
- one driver (it913x/it9137) got removed, in favor of an improvement
on another driver (af9035)
- added a skeleton V4L2 PCI driver at documentation
- added a dual flash driver (lm3646)
- added a new IR driver (img-ir)
- added an IR scancode decoder for the Sharp protocol
- some improvements at the usbtv driver, to allow its core to be
reused.
- added a new SDR driver (rtl2832u_sdr)
- added a new tuner driver (msi001)
- several improvements at em28xx driver to fix PM support, device
removal and to split the V4L2 specific bits into a separate
sub-driver
- one driver got converted to videobuf2 (s2255drv)
- the e4000 tuner driver now follows an improved binding model
- some fixes at V4L2 compat32 code
- several fixes and enhancements at videobuf2 code
- some cleanups at V4L2 API documentation
- usual driver enhancements, new board additions and misc fixups"
[ NOTE! This merge effective drops commit 4329b93b283c ("of: Reduce
indentation in of_graph_get_next_endpoint").
The of_graph_get_next_endpoint() function was moved and renamed by
commit fd9fdb78a9bf ("[media] of: move graph helpers from
drivers/media/v4l2-core to drivers/of"). It was originally called
v4l2_of_get_next_endpoint() and lived in the file
drivers/media/v4l2-core/v4l2-of.c.
In that original location, it was then fixed to support empty port
nodes by commit b9db140c1e46 ("[media] v4l: of: Support empty port
nodes"), and that commit clashes badly with the dropped "Reduce
intendation" commit. I had to choose one or the other, and decided
that the "Support empty port nodes" commit was more important ]
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (426 commits)
[media] em28xx-dvb: fix PCTV 461e tuner I2C binding
Revert "[media] em28xx-dvb: fix PCTV 461e tuner I2C binding"
[media] em28xx: fix PCTV 290e LNA oops
[media] em28xx-dvb: fix PCTV 461e tuner I2C binding
[media] m88ds3103: fix bug on .set_tone()
[media] saa7134: fix WARN_ON during resume
[media] v4l2-dv-timings: add module name, description, license
[media] videodev2.h: add parenthesis around macro arguments
[media] saa6752hs: depends on CRC32
[media] si4713: fix Kconfig dependencies
[media] Sensoray 2255 uses videobuf2
[media] adv7180: free an interrupt on failure paths in init_device()
[media] e4000: make VIDEO_V4L2 dependency optional
[media] af9033: Don't export functions for the hardware filter
[media] af9035: use af9033 PID filters
[media] af9033: implement PID filter
[media] rtl2832_sdr: do not use dynamic stack allocation
[media] e4000: fix 32-bit build error
[media] em28xx-audio: make sure audio is unmuted on open()
[media] DocBook media: v4l2_format_sdr was renamed to v4l2_sdr_format
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/media/adv7842.h | 3 | ||||
| -rw-r--r-- | include/media/lm3646.h | 87 | ||||
| -rw-r--r-- | include/media/rc-core.h | 80 | ||||
| -rw-r--r-- | include/media/rc-map.h | 6 | ||||
| -rw-r--r-- | include/media/v4l2-dev.h | 3 | ||||
| -rw-r--r-- | include/media/v4l2-ioctl.h | 10 | ||||
| -rw-r--r-- | include/media/v4l2-subdev.h | 9 | ||||
| -rw-r--r-- | include/media/videobuf2-core.h | 117 | ||||
| -rw-r--r-- | include/trace/events/v4l2.h | 1 | ||||
| -rw-r--r-- | include/uapi/linux/v4l2-common.h | 8 | ||||
| -rw-r--r-- | include/uapi/linux/v4l2-controls.h | 19 | ||||
| -rw-r--r-- | include/uapi/linux/v4l2-dv-timings.h | 17 | ||||
| -rw-r--r-- | include/uapi/linux/v4l2-subdev.h | 14 | ||||
| -rw-r--r-- | include/uapi/linux/videodev2.h | 74 |
14 files changed, 380 insertions, 68 deletions
diff --git a/include/media/adv7842.h b/include/media/adv7842.h index 39322091e8b0..924cbb8d004a 100644 --- a/include/media/adv7842.h +++ b/include/media/adv7842.h | |||
| @@ -220,6 +220,9 @@ struct adv7842_platform_data { | |||
| 220 | unsigned sdp_free_run_cbar_en:1; | 220 | unsigned sdp_free_run_cbar_en:1; |
| 221 | unsigned sdp_free_run_force:1; | 221 | unsigned sdp_free_run_force:1; |
| 222 | 222 | ||
| 223 | /* HPA manual (0) or auto (1), affects HDMI register 0x69 */ | ||
| 224 | unsigned hpa_auto:1; | ||
| 225 | |||
| 223 | struct adv7842_sdp_csc_coeff sdp_csc_coeff; | 226 | struct adv7842_sdp_csc_coeff sdp_csc_coeff; |
| 224 | 227 | ||
| 225 | struct adv7842_sdp_io_sync_adjustment sdp_io_sync_625; | 228 | struct adv7842_sdp_io_sync_adjustment sdp_io_sync_625; |
diff --git a/include/media/lm3646.h b/include/media/lm3646.h new file mode 100644 index 000000000000..c6acf5a1d640 --- /dev/null +++ b/include/media/lm3646.h | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | /* | ||
| 2 | * include/media/lm3646.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 Texas Instruments | ||
| 5 | * | ||
| 6 | * Contact: Daniel Jeong <gshark.jeong@gmail.com> | ||
| 7 | * Ldd-Mlp <ldd-mlp@list.ti.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or | ||
| 10 | * modify it under the terms of the GNU General Public License | ||
| 11 | * version 2 as published by the Free Software Foundation. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __LM3646_H__ | ||
| 15 | #define __LM3646_H__ | ||
| 16 | |||
| 17 | #include <media/v4l2-subdev.h> | ||
| 18 | |||
| 19 | #define LM3646_NAME "lm3646" | ||
| 20 | #define LM3646_I2C_ADDR_REV1 (0x67) | ||
| 21 | #define LM3646_I2C_ADDR_REV0 (0x63) | ||
| 22 | |||
| 23 | /* TOTAL FLASH Brightness Max | ||
| 24 | * min 93350uA, step 93750uA, max 1499600uA | ||
| 25 | */ | ||
| 26 | #define LM3646_TOTAL_FLASH_BRT_MIN 93350 | ||
| 27 | #define LM3646_TOTAL_FLASH_BRT_STEP 93750 | ||
| 28 | #define LM3646_TOTAL_FLASH_BRT_MAX 1499600 | ||
| 29 | #define LM3646_TOTAL_FLASH_BRT_uA_TO_REG(a) \ | ||
| 30 | ((a) < LM3646_TOTAL_FLASH_BRT_MIN ? 0 : \ | ||
| 31 | ((((a) - LM3646_TOTAL_FLASH_BRT_MIN) / LM3646_TOTAL_FLASH_BRT_STEP))) | ||
| 32 | |||
| 33 | /* TOTAL TORCH Brightness Max | ||
| 34 | * min 23040uA, step 23430uA, max 187100uA | ||
| 35 | */ | ||
| 36 | #define LM3646_TOTAL_TORCH_BRT_MIN 23040 | ||
| 37 | #define LM3646_TOTAL_TORCH_BRT_STEP 23430 | ||
| 38 | #define LM3646_TOTAL_TORCH_BRT_MAX 187100 | ||
| 39 | #define LM3646_TOTAL_TORCH_BRT_uA_TO_REG(a) \ | ||
| 40 | ((a) < LM3646_TOTAL_TORCH_BRT_MIN ? 0 : \ | ||
| 41 | ((((a) - LM3646_TOTAL_TORCH_BRT_MIN) / LM3646_TOTAL_TORCH_BRT_STEP))) | ||
| 42 | |||
| 43 | /* LED1 FLASH Brightness | ||
| 44 | * min 23040uA, step 11718uA, max 1499600uA | ||
| 45 | */ | ||
| 46 | #define LM3646_LED1_FLASH_BRT_MIN 23040 | ||
| 47 | #define LM3646_LED1_FLASH_BRT_STEP 11718 | ||
| 48 | #define LM3646_LED1_FLASH_BRT_MAX 1499600 | ||
| 49 | #define LM3646_LED1_FLASH_BRT_uA_TO_REG(a) \ | ||
| 50 | ((a) <= LM3646_LED1_FLASH_BRT_MIN ? 0 : \ | ||
| 51 | ((((a) - LM3646_LED1_FLASH_BRT_MIN) / LM3646_LED1_FLASH_BRT_STEP))+1) | ||
| 52 | |||
| 53 | /* LED1 TORCH Brightness | ||
| 54 | * min 2530uA, step 1460uA, max 187100uA | ||
| 55 | */ | ||
| 56 | #define LM3646_LED1_TORCH_BRT_MIN 2530 | ||
| 57 | #define LM3646_LED1_TORCH_BRT_STEP 1460 | ||
| 58 | #define LM3646_LED1_TORCH_BRT_MAX 187100 | ||
| 59 | #define LM3646_LED1_TORCH_BRT_uA_TO_REG(a) \ | ||
| 60 | ((a) <= LM3646_LED1_TORCH_BRT_MIN ? 0 : \ | ||
| 61 | ((((a) - LM3646_LED1_TORCH_BRT_MIN) / LM3646_LED1_TORCH_BRT_STEP))+1) | ||
| 62 | |||
| 63 | /* FLASH TIMEOUT DURATION | ||
| 64 | * min 50ms, step 50ms, max 400ms | ||
| 65 | */ | ||
| 66 | #define LM3646_FLASH_TOUT_MIN 50 | ||
| 67 | #define LM3646_FLASH_TOUT_STEP 50 | ||
| 68 | #define LM3646_FLASH_TOUT_MAX 400 | ||
| 69 | #define LM3646_FLASH_TOUT_ms_TO_REG(a) \ | ||
| 70 | ((a) <= LM3646_FLASH_TOUT_MIN ? 0 : \ | ||
| 71 | (((a) - LM3646_FLASH_TOUT_MIN) / LM3646_FLASH_TOUT_STEP)) | ||
| 72 | |||
| 73 | /* struct lm3646_platform_data | ||
| 74 | * | ||
| 75 | * @flash_timeout: flash timeout | ||
| 76 | * @led1_flash_brt: led1 flash mode brightness, uA | ||
| 77 | * @led1_torch_brt: led1 torch mode brightness, uA | ||
| 78 | */ | ||
| 79 | struct lm3646_platform_data { | ||
| 80 | |||
| 81 | u32 flash_timeout; | ||
| 82 | |||
| 83 | u32 led1_flash_brt; | ||
| 84 | u32 led1_torch_brt; | ||
| 85 | }; | ||
| 86 | |||
| 87 | #endif /* __LM3646_H__ */ | ||
diff --git a/include/media/rc-core.h b/include/media/rc-core.h index 2f6f1f78d958..0b9f890ce431 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Remote Controller core header | 2 | * Remote Controller core header |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2009-2010 by Mauro Carvalho Chehab <mchehab@redhat.com> | 4 | * Copyright (C) 2009-2010 by Mauro Carvalho Chehab |
| 5 | * | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
| @@ -35,6 +35,29 @@ enum rc_driver_type { | |||
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * struct rc_scancode_filter - Filter scan codes. | ||
| 39 | * @data: Scancode data to match. | ||
| 40 | * @mask: Mask of bits of scancode to compare. | ||
| 41 | */ | ||
| 42 | struct rc_scancode_filter { | ||
| 43 | u32 data; | ||
| 44 | u32 mask; | ||
| 45 | }; | ||
| 46 | |||
| 47 | /** | ||
| 48 | * enum rc_filter_type - Filter type constants. | ||
| 49 | * @RC_FILTER_NORMAL: Filter for normal operation. | ||
| 50 | * @RC_FILTER_WAKEUP: Filter for waking from suspend. | ||
| 51 | * @RC_FILTER_MAX: Number of filter types. | ||
| 52 | */ | ||
| 53 | enum rc_filter_type { | ||
| 54 | RC_FILTER_NORMAL = 0, | ||
| 55 | RC_FILTER_WAKEUP, | ||
| 56 | |||
| 57 | RC_FILTER_MAX | ||
| 58 | }; | ||
| 59 | |||
| 60 | /** | ||
| 38 | * struct rc_dev - represents a remote control device | 61 | * struct rc_dev - represents a remote control device |
| 39 | * @dev: driver model's view of this device | 62 | * @dev: driver model's view of this device |
| 40 | * @input_name: name of the input child device | 63 | * @input_name: name of the input child device |
| @@ -50,8 +73,10 @@ enum rc_driver_type { | |||
| 50 | * @input_dev: the input child device used to communicate events to userspace | 73 | * @input_dev: the input child device used to communicate events to userspace |
| 51 | * @driver_type: specifies if protocol decoding is done in hardware or software | 74 | * @driver_type: specifies if protocol decoding is done in hardware or software |
| 52 | * @idle: used to keep track of RX state | 75 | * @idle: used to keep track of RX state |
| 53 | * @allowed_protos: bitmask with the supported RC_BIT_* protocols | 76 | * @allowed_protocols: bitmask with the supported RC_BIT_* protocols for each |
| 54 | * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols | 77 | * filter type |
| 78 | * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols for each | ||
| 79 | * filter type | ||
| 55 | * @scanmask: some hardware decoders are not capable of providing the full | 80 | * @scanmask: some hardware decoders are not capable of providing the full |
| 56 | * scancode to the application. As this is a hardware limit, we can't do | 81 | * scancode to the application. As this is a hardware limit, we can't do |
| 57 | * anything with it. Yet, as the same keycode table can be used with other | 82 | * anything with it. Yet, as the same keycode table can be used with other |
| @@ -70,7 +95,10 @@ enum rc_driver_type { | |||
| 70 | * @max_timeout: maximum timeout supported by device | 95 | * @max_timeout: maximum timeout supported by device |
| 71 | * @rx_resolution : resolution (in ns) of input sampler | 96 | * @rx_resolution : resolution (in ns) of input sampler |
| 72 | * @tx_resolution: resolution (in ns) of output sampler | 97 | * @tx_resolution: resolution (in ns) of output sampler |
| 98 | * @scancode_filters: scancode filters (indexed by enum rc_filter_type) | ||
| 73 | * @change_protocol: allow changing the protocol used on hardware decoders | 99 | * @change_protocol: allow changing the protocol used on hardware decoders |
| 100 | * @change_wakeup_protocol: allow changing the protocol used for wakeup | ||
| 101 | * filtering | ||
| 74 | * @open: callback to allow drivers to enable polling/irq when IR input device | 102 | * @open: callback to allow drivers to enable polling/irq when IR input device |
| 75 | * is opened. | 103 | * is opened. |
| 76 | * @close: callback to allow drivers to disable polling/irq when IR input device | 104 | * @close: callback to allow drivers to disable polling/irq when IR input device |
| @@ -84,6 +112,7 @@ enum rc_driver_type { | |||
| 84 | * device doesn't interrupt host until it sees IR pulses | 112 | * device doesn't interrupt host until it sees IR pulses |
| 85 | * @s_learning_mode: enable wide band receiver used for learning | 113 | * @s_learning_mode: enable wide band receiver used for learning |
| 86 | * @s_carrier_report: enable carrier reports | 114 | * @s_carrier_report: enable carrier reports |
| 115 | * @s_filter: set the scancode filter of a given type | ||
| 87 | */ | 116 | */ |
| 88 | struct rc_dev { | 117 | struct rc_dev { |
| 89 | struct device dev; | 118 | struct device dev; |
| @@ -99,8 +128,8 @@ struct rc_dev { | |||
| 99 | struct input_dev *input_dev; | 128 | struct input_dev *input_dev; |
| 100 | enum rc_driver_type driver_type; | 129 | enum rc_driver_type driver_type; |
| 101 | bool idle; | 130 | bool idle; |
| 102 | u64 allowed_protos; | 131 | u64 allowed_protocols[RC_FILTER_MAX]; |
| 103 | u64 enabled_protocols; | 132 | u64 enabled_protocols[RC_FILTER_MAX]; |
| 104 | u32 users; | 133 | u32 users; |
| 105 | u32 scanmask; | 134 | u32 scanmask; |
| 106 | void *priv; | 135 | void *priv; |
| @@ -116,7 +145,9 @@ struct rc_dev { | |||
| 116 | u32 max_timeout; | 145 | u32 max_timeout; |
| 117 | u32 rx_resolution; | 146 | u32 rx_resolution; |
| 118 | u32 tx_resolution; | 147 | u32 tx_resolution; |
| 148 | struct rc_scancode_filter scancode_filters[RC_FILTER_MAX]; | ||
| 119 | int (*change_protocol)(struct rc_dev *dev, u64 *rc_type); | 149 | int (*change_protocol)(struct rc_dev *dev, u64 *rc_type); |
| 150 | int (*change_wakeup_protocol)(struct rc_dev *dev, u64 *rc_type); | ||
| 120 | int (*open)(struct rc_dev *dev); | 151 | int (*open)(struct rc_dev *dev); |
| 121 | void (*close)(struct rc_dev *dev); | 152 | void (*close)(struct rc_dev *dev); |
| 122 | int (*s_tx_mask)(struct rc_dev *dev, u32 mask); | 153 | int (*s_tx_mask)(struct rc_dev *dev, u32 mask); |
| @@ -127,10 +158,49 @@ struct rc_dev { | |||
| 127 | void (*s_idle)(struct rc_dev *dev, bool enable); | 158 | void (*s_idle)(struct rc_dev *dev, bool enable); |
| 128 | int (*s_learning_mode)(struct rc_dev *dev, int enable); | 159 | int (*s_learning_mode)(struct rc_dev *dev, int enable); |
| 129 | int (*s_carrier_report) (struct rc_dev *dev, int enable); | 160 | int (*s_carrier_report) (struct rc_dev *dev, int enable); |
| 161 | int (*s_filter)(struct rc_dev *dev, | ||
| 162 | enum rc_filter_type type, | ||
| 163 | struct rc_scancode_filter *filter); | ||
| 130 | }; | 164 | }; |
| 131 | 165 | ||
| 132 | #define to_rc_dev(d) container_of(d, struct rc_dev, dev) | 166 | #define to_rc_dev(d) container_of(d, struct rc_dev, dev) |
| 133 | 167 | ||
| 168 | static inline bool rc_protocols_allowed(struct rc_dev *rdev, u64 protos) | ||
| 169 | { | ||
| 170 | return rdev->allowed_protocols[RC_FILTER_NORMAL] & protos; | ||
| 171 | } | ||
| 172 | |||
| 173 | /* should be called prior to registration or with mutex held */ | ||
| 174 | static inline void rc_set_allowed_protocols(struct rc_dev *rdev, u64 protos) | ||
| 175 | { | ||
| 176 | rdev->allowed_protocols[RC_FILTER_NORMAL] = protos; | ||
| 177 | } | ||
| 178 | |||
| 179 | static inline bool rc_protocols_enabled(struct rc_dev *rdev, u64 protos) | ||
| 180 | { | ||
| 181 | return rdev->enabled_protocols[RC_FILTER_NORMAL] & protos; | ||
| 182 | } | ||
| 183 | |||
| 184 | /* should be called prior to registration or with mutex held */ | ||
| 185 | static inline void rc_set_enabled_protocols(struct rc_dev *rdev, u64 protos) | ||
| 186 | { | ||
| 187 | rdev->enabled_protocols[RC_FILTER_NORMAL] = protos; | ||
| 188 | } | ||
| 189 | |||
| 190 | /* should be called prior to registration or with mutex held */ | ||
| 191 | static inline void rc_set_allowed_wakeup_protocols(struct rc_dev *rdev, | ||
| 192 | u64 protos) | ||
| 193 | { | ||
| 194 | rdev->allowed_protocols[RC_FILTER_WAKEUP] = protos; | ||
| 195 | } | ||
| 196 | |||
| 197 | /* should be called prior to registration or with mutex held */ | ||
| 198 | static inline void rc_set_enabled_wakeup_protocols(struct rc_dev *rdev, | ||
| 199 | u64 protos) | ||
| 200 | { | ||
| 201 | rdev->enabled_protocols[RC_FILTER_WAKEUP] = protos; | ||
| 202 | } | ||
| 203 | |||
| 134 | /* | 204 | /* |
| 135 | * From rc-main.c | 205 | * From rc-main.c |
| 136 | * Those functions can be used on any type of Remote Controller. They | 206 | * Those functions can be used on any type of Remote Controller. They |
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index a20ed97d7d8a..e5aa2409c0ea 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * rc-map.h - define RC map names used by RC drivers | 2 | * rc-map.h - define RC map names used by RC drivers |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com> | 4 | * Copyright (c) 2010 by Mauro Carvalho Chehab |
| 5 | * | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
| @@ -30,6 +30,7 @@ enum rc_type { | |||
| 30 | RC_TYPE_RC6_6A_24 = 15, /* Philips RC6-6A-24 protocol */ | 30 | RC_TYPE_RC6_6A_24 = 15, /* Philips RC6-6A-24 protocol */ |
| 31 | RC_TYPE_RC6_6A_32 = 16, /* Philips RC6-6A-32 protocol */ | 31 | RC_TYPE_RC6_6A_32 = 16, /* Philips RC6-6A-32 protocol */ |
| 32 | RC_TYPE_RC6_MCE = 17, /* MCE (Philips RC6-6A-32 subtype) protocol */ | 32 | RC_TYPE_RC6_MCE = 17, /* MCE (Philips RC6-6A-32 subtype) protocol */ |
| 33 | RC_TYPE_SHARP = 18, /* Sharp protocol */ | ||
| 33 | }; | 34 | }; |
| 34 | 35 | ||
| 35 | #define RC_BIT_NONE 0 | 36 | #define RC_BIT_NONE 0 |
| @@ -51,6 +52,7 @@ enum rc_type { | |||
| 51 | #define RC_BIT_RC6_6A_24 (1 << RC_TYPE_RC6_6A_24) | 52 | #define RC_BIT_RC6_6A_24 (1 << RC_TYPE_RC6_6A_24) |
| 52 | #define RC_BIT_RC6_6A_32 (1 << RC_TYPE_RC6_6A_32) | 53 | #define RC_BIT_RC6_6A_32 (1 << RC_TYPE_RC6_6A_32) |
| 53 | #define RC_BIT_RC6_MCE (1 << RC_TYPE_RC6_MCE) | 54 | #define RC_BIT_RC6_MCE (1 << RC_TYPE_RC6_MCE) |
| 55 | #define RC_BIT_SHARP (1 << RC_TYPE_SHARP) | ||
| 54 | 56 | ||
| 55 | #define RC_BIT_ALL (RC_BIT_UNKNOWN | RC_BIT_OTHER | RC_BIT_LIRC | \ | 57 | #define RC_BIT_ALL (RC_BIT_UNKNOWN | RC_BIT_OTHER | RC_BIT_LIRC | \ |
| 56 | RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ | \ | 58 | RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ | \ |
| @@ -58,7 +60,7 @@ enum rc_type { | |||
| 58 | RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20 | \ | 60 | RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20 | \ |
| 59 | RC_BIT_NEC | RC_BIT_SANYO | RC_BIT_MCE_KBD | \ | 61 | RC_BIT_NEC | RC_BIT_SANYO | RC_BIT_MCE_KBD | \ |
| 60 | RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | \ | 62 | RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | \ |
| 61 | RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE) | 63 | RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE | RC_BIT_SHARP) |
| 62 | 64 | ||
| 63 | struct rc_map_table { | 65 | struct rc_map_table { |
| 64 | u32 scancode; | 66 | u32 scancode; |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index c768c9f8abc2..eec6e460f649 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
| @@ -24,7 +24,8 @@ | |||
| 24 | #define VFL_TYPE_VBI 1 | 24 | #define VFL_TYPE_VBI 1 |
| 25 | #define VFL_TYPE_RADIO 2 | 25 | #define VFL_TYPE_RADIO 2 |
| 26 | #define VFL_TYPE_SUBDEV 3 | 26 | #define VFL_TYPE_SUBDEV 3 |
| 27 | #define VFL_TYPE_MAX 4 | 27 | #define VFL_TYPE_SDR 4 |
| 28 | #define VFL_TYPE_MAX 5 | ||
| 28 | 29 | ||
| 29 | /* Is this a receiver, transmitter or mem-to-mem? */ | 30 | /* Is this a receiver, transmitter or mem-to-mem? */ |
| 30 | /* Ignored for VFL_TYPE_SUBDEV. */ | 31 | /* Ignored for VFL_TYPE_SUBDEV. */ |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index e0b74a430b3a..50cf7c110a70 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
| @@ -40,6 +40,8 @@ struct v4l2_ioctl_ops { | |||
| 40 | struct v4l2_fmtdesc *f); | 40 | struct v4l2_fmtdesc *f); |
| 41 | int (*vidioc_enum_fmt_vid_out_mplane)(struct file *file, void *fh, | 41 | int (*vidioc_enum_fmt_vid_out_mplane)(struct file *file, void *fh, |
| 42 | struct v4l2_fmtdesc *f); | 42 | struct v4l2_fmtdesc *f); |
| 43 | int (*vidioc_enum_fmt_sdr_cap) (struct file *file, void *fh, | ||
| 44 | struct v4l2_fmtdesc *f); | ||
| 43 | 45 | ||
| 44 | /* VIDIOC_G_FMT handlers */ | 46 | /* VIDIOC_G_FMT handlers */ |
| 45 | int (*vidioc_g_fmt_vid_cap) (struct file *file, void *fh, | 47 | int (*vidioc_g_fmt_vid_cap) (struct file *file, void *fh, |
| @@ -62,6 +64,8 @@ struct v4l2_ioctl_ops { | |||
| 62 | struct v4l2_format *f); | 64 | struct v4l2_format *f); |
| 63 | int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh, | 65 | int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh, |
| 64 | struct v4l2_format *f); | 66 | struct v4l2_format *f); |
| 67 | int (*vidioc_g_fmt_sdr_cap) (struct file *file, void *fh, | ||
| 68 | struct v4l2_format *f); | ||
| 65 | 69 | ||
| 66 | /* VIDIOC_S_FMT handlers */ | 70 | /* VIDIOC_S_FMT handlers */ |
| 67 | int (*vidioc_s_fmt_vid_cap) (struct file *file, void *fh, | 71 | int (*vidioc_s_fmt_vid_cap) (struct file *file, void *fh, |
| @@ -84,6 +88,8 @@ struct v4l2_ioctl_ops { | |||
| 84 | struct v4l2_format *f); | 88 | struct v4l2_format *f); |
| 85 | int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *fh, | 89 | int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *fh, |
| 86 | struct v4l2_format *f); | 90 | struct v4l2_format *f); |
| 91 | int (*vidioc_s_fmt_sdr_cap) (struct file *file, void *fh, | ||
| 92 | struct v4l2_format *f); | ||
| 87 | 93 | ||
| 88 | /* VIDIOC_TRY_FMT handlers */ | 94 | /* VIDIOC_TRY_FMT handlers */ |
| 89 | int (*vidioc_try_fmt_vid_cap) (struct file *file, void *fh, | 95 | int (*vidioc_try_fmt_vid_cap) (struct file *file, void *fh, |
| @@ -106,6 +112,8 @@ struct v4l2_ioctl_ops { | |||
| 106 | struct v4l2_format *f); | 112 | struct v4l2_format *f); |
| 107 | int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *fh, | 113 | int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *fh, |
| 108 | struct v4l2_format *f); | 114 | struct v4l2_format *f); |
| 115 | int (*vidioc_try_fmt_sdr_cap) (struct file *file, void *fh, | ||
| 116 | struct v4l2_format *f); | ||
| 109 | 117 | ||
| 110 | /* Buffer handlers */ | 118 | /* Buffer handlers */ |
| 111 | int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b); | 119 | int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b); |
| @@ -265,6 +273,8 @@ struct v4l2_ioctl_ops { | |||
| 265 | struct v4l2_enum_dv_timings *timings); | 273 | struct v4l2_enum_dv_timings *timings); |
| 266 | int (*vidioc_dv_timings_cap) (struct file *file, void *fh, | 274 | int (*vidioc_dv_timings_cap) (struct file *file, void *fh, |
| 267 | struct v4l2_dv_timings_cap *cap); | 275 | struct v4l2_dv_timings_cap *cap); |
| 276 | int (*vidioc_g_edid) (struct file *file, void *fh, struct v4l2_edid *edid); | ||
| 277 | int (*vidioc_s_edid) (struct file *file, void *fh, struct v4l2_edid *edid); | ||
| 268 | 278 | ||
| 269 | int (*vidioc_subscribe_event) (struct v4l2_fh *fh, | 279 | int (*vidioc_subscribe_event) (struct v4l2_fh *fh, |
| 270 | const struct v4l2_event_subscription *sub); | 280 | const struct v4l2_event_subscription *sub); |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index d67210a37ef3..28f4d8c3cf7d 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
| @@ -162,6 +162,10 @@ struct v4l2_subdev_core_ops { | |||
| 162 | int (*g_std)(struct v4l2_subdev *sd, v4l2_std_id *norm); | 162 | int (*g_std)(struct v4l2_subdev *sd, v4l2_std_id *norm); |
| 163 | int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm); | 163 | int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm); |
| 164 | long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); | 164 | long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); |
| 165 | #ifdef CONFIG_COMPAT | ||
| 166 | long (*compat_ioctl32)(struct v4l2_subdev *sd, unsigned int cmd, | ||
| 167 | unsigned long arg); | ||
| 168 | #endif | ||
| 165 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 169 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
| 166 | int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); | 170 | int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); |
| 167 | int (*s_register)(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg); | 171 | int (*s_register)(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg); |
| @@ -192,6 +196,7 @@ struct v4l2_subdev_tuner_ops { | |||
| 192 | int (*s_radio)(struct v4l2_subdev *sd); | 196 | int (*s_radio)(struct v4l2_subdev *sd); |
| 193 | int (*s_frequency)(struct v4l2_subdev *sd, const struct v4l2_frequency *freq); | 197 | int (*s_frequency)(struct v4l2_subdev *sd, const struct v4l2_frequency *freq); |
| 194 | int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); | 198 | int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); |
| 199 | int (*enum_freq_bands)(struct v4l2_subdev *sd, struct v4l2_frequency_band *band); | ||
| 195 | int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt); | 200 | int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt); |
| 196 | int (*s_tuner)(struct v4l2_subdev *sd, const struct v4l2_tuner *vt); | 201 | int (*s_tuner)(struct v4l2_subdev *sd, const struct v4l2_tuner *vt); |
| 197 | int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm); | 202 | int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm); |
| @@ -503,8 +508,8 @@ struct v4l2_subdev_pad_ops { | |||
| 503 | struct v4l2_subdev_selection *sel); | 508 | struct v4l2_subdev_selection *sel); |
| 504 | int (*set_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | 509 | int (*set_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, |
| 505 | struct v4l2_subdev_selection *sel); | 510 | struct v4l2_subdev_selection *sel); |
| 506 | int (*get_edid)(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid); | 511 | int (*get_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid); |
| 507 | int (*set_edid)(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid); | 512 | int (*set_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid); |
| 508 | #ifdef CONFIG_MEDIA_CONTROLLER | 513 | #ifdef CONFIG_MEDIA_CONTROLLER |
| 509 | int (*link_validate)(struct v4l2_subdev *sd, struct media_link *link, | 514 | int (*link_validate)(struct v4l2_subdev *sd, struct media_link *link, |
| 510 | struct v4l2_subdev_format *source_fmt, | 515 | struct v4l2_subdev_format *source_fmt, |
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index bef53ce555d2..af4621109726 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
| @@ -34,49 +34,49 @@ struct vb2_fileio_data; | |||
| 34 | * usually will result in the allocator freeing the buffer (if | 34 | * usually will result in the allocator freeing the buffer (if |
| 35 | * no other users of this buffer are present); the buf_priv | 35 | * no other users of this buffer are present); the buf_priv |
| 36 | * argument is the allocator private per-buffer structure | 36 | * argument is the allocator private per-buffer structure |
| 37 | * previously returned from the alloc callback | 37 | * previously returned from the alloc callback. |
| 38 | * @get_userptr: acquire userspace memory for a hardware operation; used for | 38 | * @get_userptr: acquire userspace memory for a hardware operation; used for |
| 39 | * USERPTR memory types; vaddr is the address passed to the | 39 | * USERPTR memory types; vaddr is the address passed to the |
| 40 | * videobuf layer when queuing a video buffer of USERPTR type; | 40 | * videobuf layer when queuing a video buffer of USERPTR type; |
| 41 | * should return an allocator private per-buffer structure | 41 | * should return an allocator private per-buffer structure |
| 42 | * associated with the buffer on success, NULL on failure; | 42 | * associated with the buffer on success, NULL on failure; |
| 43 | * the returned private structure will then be passed as buf_priv | 43 | * the returned private structure will then be passed as buf_priv |
| 44 | * argument to other ops in this structure | 44 | * argument to other ops in this structure. |
| 45 | * @put_userptr: inform the allocator that a USERPTR buffer will no longer | 45 | * @put_userptr: inform the allocator that a USERPTR buffer will no longer |
| 46 | * be used | 46 | * be used. |
| 47 | * @attach_dmabuf: attach a shared struct dma_buf for a hardware operation; | 47 | * @attach_dmabuf: attach a shared struct dma_buf for a hardware operation; |
| 48 | * used for DMABUF memory types; alloc_ctx is the alloc context | 48 | * used for DMABUF memory types; alloc_ctx is the alloc context |
| 49 | * dbuf is the shared dma_buf; returns NULL on failure; | 49 | * dbuf is the shared dma_buf; returns NULL on failure; |
| 50 | * allocator private per-buffer structure on success; | 50 | * allocator private per-buffer structure on success; |
| 51 | * this needs to be used for further accesses to the buffer | 51 | * this needs to be used for further accesses to the buffer. |
| 52 | * @detach_dmabuf: inform the exporter of the buffer that the current DMABUF | 52 | * @detach_dmabuf: inform the exporter of the buffer that the current DMABUF |
| 53 | * buffer is no longer used; the buf_priv argument is the | 53 | * buffer is no longer used; the buf_priv argument is the |
| 54 | * allocator private per-buffer structure previously returned | 54 | * allocator private per-buffer structure previously returned |
| 55 | * from the attach_dmabuf callback | 55 | * from the attach_dmabuf callback. |
| 56 | * @map_dmabuf: request for access to the dmabuf from allocator; the allocator | 56 | * @map_dmabuf: request for access to the dmabuf from allocator; the allocator |
| 57 | * of dmabuf is informed that this driver is going to use the | 57 | * of dmabuf is informed that this driver is going to use the |
| 58 | * dmabuf | 58 | * dmabuf. |
| 59 | * @unmap_dmabuf: releases access control to the dmabuf - allocator is notified | 59 | * @unmap_dmabuf: releases access control to the dmabuf - allocator is notified |
| 60 | * that this driver is done using the dmabuf for now | 60 | * that this driver is done using the dmabuf for now. |
| 61 | * @prepare: called every time the buffer is passed from userspace to the | 61 | * @prepare: called every time the buffer is passed from userspace to the |
| 62 | * driver, useful for cache synchronisation, optional | 62 | * driver, useful for cache synchronisation, optional. |
| 63 | * @finish: called every time the buffer is passed back from the driver | 63 | * @finish: called every time the buffer is passed back from the driver |
| 64 | * to the userspace, also optional | 64 | * to the userspace, also optional. |
| 65 | * @vaddr: return a kernel virtual address to a given memory buffer | 65 | * @vaddr: return a kernel virtual address to a given memory buffer |
| 66 | * associated with the passed private structure or NULL if no | 66 | * associated with the passed private structure or NULL if no |
| 67 | * such mapping exists | 67 | * such mapping exists. |
| 68 | * @cookie: return allocator specific cookie for a given memory buffer | 68 | * @cookie: return allocator specific cookie for a given memory buffer |
| 69 | * associated with the passed private structure or NULL if not | 69 | * associated with the passed private structure or NULL if not |
| 70 | * available | 70 | * available. |
| 71 | * @num_users: return the current number of users of a memory buffer; | 71 | * @num_users: return the current number of users of a memory buffer; |
| 72 | * return 1 if the videobuf layer (or actually the driver using | 72 | * return 1 if the videobuf layer (or actually the driver using |
| 73 | * it) is the only user | 73 | * it) is the only user. |
| 74 | * @mmap: setup a userspace mapping for a given memory buffer under | 74 | * @mmap: setup a userspace mapping for a given memory buffer under |
| 75 | * the provided virtual memory region | 75 | * the provided virtual memory region. |
| 76 | * | 76 | * |
| 77 | * Required ops for USERPTR types: get_userptr, put_userptr. | 77 | * Required ops for USERPTR types: get_userptr, put_userptr. |
| 78 | * Required ops for MMAP types: alloc, put, num_users, mmap. | 78 | * Required ops for MMAP types: alloc, put, num_users, mmap. |
| 79 | * Required ops for read/write access types: alloc, put, num_users, vaddr | 79 | * Required ops for read/write access types: alloc, put, num_users, vaddr. |
| 80 | * Required ops for DMABUF types: attach_dmabuf, detach_dmabuf, map_dmabuf, | 80 | * Required ops for DMABUF types: attach_dmabuf, detach_dmabuf, map_dmabuf, |
| 81 | * unmap_dmabuf. | 81 | * unmap_dmabuf. |
| 82 | */ | 82 | */ |
| @@ -203,6 +203,37 @@ struct vb2_buffer { | |||
| 203 | struct list_head done_entry; | 203 | struct list_head done_entry; |
| 204 | 204 | ||
| 205 | struct vb2_plane planes[VIDEO_MAX_PLANES]; | 205 | struct vb2_plane planes[VIDEO_MAX_PLANES]; |
| 206 | |||
| 207 | #ifdef CONFIG_VIDEO_ADV_DEBUG | ||
| 208 | /* | ||
| 209 | * Counters for how often these buffer-related ops are | ||
| 210 | * called. Used to check for unbalanced ops. | ||
| 211 | */ | ||
| 212 | u32 cnt_mem_alloc; | ||
| 213 | u32 cnt_mem_put; | ||
| 214 | u32 cnt_mem_get_dmabuf; | ||
| 215 | u32 cnt_mem_get_userptr; | ||
| 216 | u32 cnt_mem_put_userptr; | ||
| 217 | u32 cnt_mem_prepare; | ||
| 218 | u32 cnt_mem_finish; | ||
| 219 | u32 cnt_mem_attach_dmabuf; | ||
| 220 | u32 cnt_mem_detach_dmabuf; | ||
| 221 | u32 cnt_mem_map_dmabuf; | ||
| 222 | u32 cnt_mem_unmap_dmabuf; | ||
| 223 | u32 cnt_mem_vaddr; | ||
| 224 | u32 cnt_mem_cookie; | ||
| 225 | u32 cnt_mem_num_users; | ||
| 226 | u32 cnt_mem_mmap; | ||
| 227 | |||
| 228 | u32 cnt_buf_init; | ||
| 229 | u32 cnt_buf_prepare; | ||
| 230 | u32 cnt_buf_finish; | ||
| 231 | u32 cnt_buf_cleanup; | ||
| 232 | u32 cnt_buf_queue; | ||
| 233 | |||
| 234 | /* This counts the number of calls to vb2_buffer_done() */ | ||
| 235 | u32 cnt_buf_done; | ||
| 236 | #endif | ||
| 206 | }; | 237 | }; |
| 207 | 238 | ||
| 208 | /** | 239 | /** |
| @@ -227,27 +258,35 @@ struct vb2_buffer { | |||
| 227 | * @wait_prepare: release any locks taken while calling vb2 functions; | 258 | * @wait_prepare: release any locks taken while calling vb2 functions; |
| 228 | * it is called before an ioctl needs to wait for a new | 259 | * it is called before an ioctl needs to wait for a new |
| 229 | * buffer to arrive; required to avoid a deadlock in | 260 | * buffer to arrive; required to avoid a deadlock in |
| 230 | * blocking access type | 261 | * blocking access type. |
| 231 | * @wait_finish: reacquire all locks released in the previous callback; | 262 | * @wait_finish: reacquire all locks released in the previous callback; |
| 232 | * required to continue operation after sleeping while | 263 | * required to continue operation after sleeping while |
| 233 | * waiting for a new buffer to arrive | 264 | * waiting for a new buffer to arrive. |
| 234 | * @buf_init: called once after allocating a buffer (in MMAP case) | 265 | * @buf_init: called once after allocating a buffer (in MMAP case) |
| 235 | * or after acquiring a new USERPTR buffer; drivers may | 266 | * or after acquiring a new USERPTR buffer; drivers may |
| 236 | * perform additional buffer-related initialization; | 267 | * perform additional buffer-related initialization; |
| 237 | * initialization failure (return != 0) will prevent | 268 | * initialization failure (return != 0) will prevent |
| 238 | * queue setup from completing successfully; optional | 269 | * queue setup from completing successfully; optional. |
| 239 | * @buf_prepare: called every time the buffer is queued from userspace | 270 | * @buf_prepare: called every time the buffer is queued from userspace |
| 240 | * and from the VIDIOC_PREPARE_BUF ioctl; drivers may | 271 | * and from the VIDIOC_PREPARE_BUF ioctl; drivers may |
| 241 | * perform any initialization required before each hardware | 272 | * perform any initialization required before each hardware |
| 242 | * operation in this callback; drivers that support | 273 | * operation in this callback; drivers that support |
| 243 | * VIDIOC_CREATE_BUFS must also validate the buffer size; | 274 | * VIDIOC_CREATE_BUFS must also validate the buffer size; |
| 244 | * if an error is returned, the buffer will not be queued | 275 | * if an error is returned, the buffer will not be queued |
| 245 | * in driver; optional | 276 | * in driver; optional. |
| 246 | * @buf_finish: called before every dequeue of the buffer back to | 277 | * @buf_finish: called before every dequeue of the buffer back to |
| 247 | * userspace; drivers may perform any operations required | 278 | * userspace; drivers may perform any operations required |
| 248 | * before userspace accesses the buffer; optional | 279 | * before userspace accesses the buffer; optional. The |
| 280 | * buffer state can be one of the following: DONE and | ||
| 281 | * ERROR occur while streaming is in progress, and the | ||
| 282 | * PREPARED state occurs when the queue has been canceled | ||
| 283 | * and all pending buffers are being returned to their | ||
| 284 | * default DEQUEUED state. Typically you only have to do | ||
| 285 | * something if the state is VB2_BUF_STATE_DONE, since in | ||
| 286 | * all other cases the buffer contents will be ignored | ||
| 287 | * anyway. | ||
| 249 | * @buf_cleanup: called once before the buffer is freed; drivers may | 288 | * @buf_cleanup: called once before the buffer is freed; drivers may |
| 250 | * perform any additional cleanup; optional | 289 | * perform any additional cleanup; optional. |
| 251 | * @start_streaming: called once to enter 'streaming' state; the driver may | 290 | * @start_streaming: called once to enter 'streaming' state; the driver may |
| 252 | * receive buffers with @buf_queue callback before | 291 | * receive buffers with @buf_queue callback before |
| 253 | * @start_streaming is called; the driver gets the number | 292 | * @start_streaming is called; the driver gets the number |
| @@ -268,7 +307,7 @@ struct vb2_buffer { | |||
| 268 | * the buffer back by calling vb2_buffer_done() function; | 307 | * the buffer back by calling vb2_buffer_done() function; |
| 269 | * it is allways called after calling STREAMON ioctl; | 308 | * it is allways called after calling STREAMON ioctl; |
| 270 | * might be called before start_streaming callback if user | 309 | * might be called before start_streaming callback if user |
| 271 | * pre-queued buffers before calling STREAMON | 310 | * pre-queued buffers before calling STREAMON. |
| 272 | */ | 311 | */ |
| 273 | struct vb2_ops { | 312 | struct vb2_ops { |
| 274 | int (*queue_setup)(struct vb2_queue *q, const struct v4l2_format *fmt, | 313 | int (*queue_setup)(struct vb2_queue *q, const struct v4l2_format *fmt, |
| @@ -280,7 +319,7 @@ struct vb2_ops { | |||
| 280 | 319 | ||
| 281 | int (*buf_init)(struct vb2_buffer *vb); | 320 | int (*buf_init)(struct vb2_buffer *vb); |
| 282 | int (*buf_prepare)(struct vb2_buffer *vb); | 321 | int (*buf_prepare)(struct vb2_buffer *vb); |
| 283 | int (*buf_finish)(struct vb2_buffer *vb); | 322 | void (*buf_finish)(struct vb2_buffer *vb); |
| 284 | void (*buf_cleanup)(struct vb2_buffer *vb); | 323 | void (*buf_cleanup)(struct vb2_buffer *vb); |
| 285 | 324 | ||
| 286 | int (*start_streaming)(struct vb2_queue *q, unsigned int count); | 325 | int (*start_streaming)(struct vb2_queue *q, unsigned int count); |
| @@ -312,23 +351,29 @@ struct v4l2_fh; | |||
| 312 | * @buf_struct_size: size of the driver-specific buffer structure; | 351 | * @buf_struct_size: size of the driver-specific buffer structure; |
| 313 | * "0" indicates the driver doesn't want to use a custom buffer | 352 | * "0" indicates the driver doesn't want to use a custom buffer |
| 314 | * structure type, so sizeof(struct vb2_buffer) will is used | 353 | * structure type, so sizeof(struct vb2_buffer) will is used |
| 354 | * @timestamp_flags: Timestamp flags; V4L2_BUF_FLAGS_TIMESTAMP_* and | ||
| 355 | * V4L2_BUF_FLAGS_TSTAMP_SRC_* | ||
| 315 | * @gfp_flags: additional gfp flags used when allocating the buffers. | 356 | * @gfp_flags: additional gfp flags used when allocating the buffers. |
| 316 | * Typically this is 0, but it may be e.g. GFP_DMA or __GFP_DMA32 | 357 | * Typically this is 0, but it may be e.g. GFP_DMA or __GFP_DMA32 |
| 317 | * to force the buffer allocation to a specific memory zone. | 358 | * to force the buffer allocation to a specific memory zone. |
| 359 | * @min_buffers_needed: the minimum number of buffers needed before | ||
| 360 | * start_streaming() can be called. Used when a DMA engine | ||
| 361 | * cannot be started unless at least this number of buffers | ||
| 362 | * have been queued into the driver. | ||
| 318 | * | 363 | * |
| 319 | * @memory: current memory type used | 364 | * @memory: current memory type used |
| 320 | * @bufs: videobuf buffer structures | 365 | * @bufs: videobuf buffer structures |
| 321 | * @num_buffers: number of allocated/used buffers | 366 | * @num_buffers: number of allocated/used buffers |
| 322 | * @queued_list: list of buffers currently queued from userspace | 367 | * @queued_list: list of buffers currently queued from userspace |
| 323 | * @queued_count: number of buffers owned by the driver | 368 | * @queued_count: number of buffers queued and ready for streaming. |
| 369 | * @owned_by_drv_count: number of buffers owned by the driver | ||
| 324 | * @done_list: list of buffers ready to be dequeued to userspace | 370 | * @done_list: list of buffers ready to be dequeued to userspace |
| 325 | * @done_lock: lock to protect done_list list | 371 | * @done_lock: lock to protect done_list list |
| 326 | * @done_wq: waitqueue for processes waiting for buffers ready to be dequeued | 372 | * @done_wq: waitqueue for processes waiting for buffers ready to be dequeued |
| 327 | * @alloc_ctx: memory type/allocator-specific contexts for each plane | 373 | * @alloc_ctx: memory type/allocator-specific contexts for each plane |
| 328 | * @streaming: current streaming state | 374 | * @streaming: current streaming state |
| 329 | * @retry_start_streaming: start_streaming() was called, but there were not enough | 375 | * @start_streaming_called: start_streaming() was called successfully and we |
| 330 | * buffers queued. If set, then retry calling start_streaming when | 376 | * started streaming. |
| 331 | * queuing a new buffer. | ||
| 332 | * @fileio: file io emulator internal data, used only if emulator is active | 377 | * @fileio: file io emulator internal data, used only if emulator is active |
| 333 | */ | 378 | */ |
| 334 | struct vb2_queue { | 379 | struct vb2_queue { |
| @@ -342,8 +387,9 @@ struct vb2_queue { | |||
| 342 | const struct vb2_mem_ops *mem_ops; | 387 | const struct vb2_mem_ops *mem_ops; |
| 343 | void *drv_priv; | 388 | void *drv_priv; |
| 344 | unsigned int buf_struct_size; | 389 | unsigned int buf_struct_size; |
| 345 | u32 timestamp_type; | 390 | u32 timestamp_flags; |
| 346 | gfp_t gfp_flags; | 391 | gfp_t gfp_flags; |
| 392 | u32 min_buffers_needed; | ||
| 347 | 393 | ||
| 348 | /* private: internal use only */ | 394 | /* private: internal use only */ |
| 349 | enum v4l2_memory memory; | 395 | enum v4l2_memory memory; |
| @@ -351,8 +397,9 @@ struct vb2_queue { | |||
| 351 | unsigned int num_buffers; | 397 | unsigned int num_buffers; |
| 352 | 398 | ||
| 353 | struct list_head queued_list; | 399 | struct list_head queued_list; |
| 400 | unsigned int queued_count; | ||
| 354 | 401 | ||
| 355 | atomic_t queued_count; | 402 | atomic_t owned_by_drv_count; |
| 356 | struct list_head done_list; | 403 | struct list_head done_list; |
| 357 | spinlock_t done_lock; | 404 | spinlock_t done_lock; |
| 358 | wait_queue_head_t done_wq; | 405 | wait_queue_head_t done_wq; |
| @@ -361,9 +408,21 @@ struct vb2_queue { | |||
| 361 | unsigned int plane_sizes[VIDEO_MAX_PLANES]; | 408 | unsigned int plane_sizes[VIDEO_MAX_PLANES]; |
| 362 | 409 | ||
| 363 | unsigned int streaming:1; | 410 | unsigned int streaming:1; |
| 364 | unsigned int retry_start_streaming:1; | 411 | unsigned int start_streaming_called:1; |
| 365 | 412 | ||
| 366 | struct vb2_fileio_data *fileio; | 413 | struct vb2_fileio_data *fileio; |
| 414 | |||
| 415 | #ifdef CONFIG_VIDEO_ADV_DEBUG | ||
| 416 | /* | ||
| 417 | * Counters for how often these queue-related ops are | ||
| 418 | * called. Used to check for unbalanced ops. | ||
| 419 | */ | ||
| 420 | u32 cnt_queue_setup; | ||
| 421 | u32 cnt_wait_prepare; | ||
| 422 | u32 cnt_wait_finish; | ||
| 423 | u32 cnt_start_streaming; | ||
| 424 | u32 cnt_stop_streaming; | ||
| 425 | #endif | ||
| 367 | }; | 426 | }; |
| 368 | 427 | ||
| 369 | void *vb2_plane_vaddr(struct vb2_buffer *vb, unsigned int plane_no); | 428 | void *vb2_plane_vaddr(struct vb2_buffer *vb, unsigned int plane_no); |
diff --git a/include/trace/events/v4l2.h b/include/trace/events/v4l2.h index ef94ecad1c94..b9bb1f204693 100644 --- a/include/trace/events/v4l2.h +++ b/include/trace/events/v4l2.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | { V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY, "VIDEO_OUTPUT_OVERLAY" },\ | 18 | { V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY, "VIDEO_OUTPUT_OVERLAY" },\ |
| 19 | { V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, "VIDEO_CAPTURE_MPLANE" },\ | 19 | { V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, "VIDEO_CAPTURE_MPLANE" },\ |
| 20 | { V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, "VIDEO_OUTPUT_MPLANE" }, \ | 20 | { V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, "VIDEO_OUTPUT_MPLANE" }, \ |
| 21 | { V4L2_BUF_TYPE_SDR_CAPTURE, "SDR_CAPTURE" }, \ | ||
| 21 | { V4L2_BUF_TYPE_PRIVATE, "PRIVATE" }) | 22 | { V4L2_BUF_TYPE_PRIVATE, "PRIVATE" }) |
| 22 | 23 | ||
| 23 | #define show_field(field) \ | 24 | #define show_field(field) \ |
diff --git a/include/uapi/linux/v4l2-common.h b/include/uapi/linux/v4l2-common.h index 4f0667e010dd..270db8914c01 100644 --- a/include/uapi/linux/v4l2-common.h +++ b/include/uapi/linux/v4l2-common.h | |||
| @@ -68,4 +68,12 @@ | |||
| 68 | #define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE | 68 | #define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE |
| 69 | #define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG | 69 | #define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG |
| 70 | 70 | ||
| 71 | struct v4l2_edid { | ||
| 72 | __u32 pad; | ||
| 73 | __u32 start_block; | ||
| 74 | __u32 blocks; | ||
| 75 | __u32 reserved[5]; | ||
| 76 | __u8 __user *edid; | ||
| 77 | }; | ||
| 78 | |||
| 71 | #endif /* __V4L2_COMMON__ */ | 79 | #endif /* __V4L2_COMMON__ */ |
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 2cbe605bbe04..2ac5597f3ee1 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | #define V4L2_CTRL_CLASS_IMAGE_PROC 0x009f0000 /* Image processing controls */ | 60 | #define V4L2_CTRL_CLASS_IMAGE_PROC 0x009f0000 /* Image processing controls */ |
| 61 | #define V4L2_CTRL_CLASS_DV 0x00a00000 /* Digital Video controls */ | 61 | #define V4L2_CTRL_CLASS_DV 0x00a00000 /* Digital Video controls */ |
| 62 | #define V4L2_CTRL_CLASS_FM_RX 0x00a10000 /* FM Receiver controls */ | 62 | #define V4L2_CTRL_CLASS_FM_RX 0x00a10000 /* FM Receiver controls */ |
| 63 | #define V4L2_CTRL_CLASS_RF_TUNER 0x00a20000 /* RF tuner controls */ | ||
| 63 | 64 | ||
| 64 | /* User-class control IDs */ | 65 | /* User-class control IDs */ |
| 65 | 66 | ||
| @@ -376,6 +377,8 @@ enum v4l2_mpeg_video_multi_slice_mode { | |||
| 376 | #define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224) | 377 | #define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224) |
| 377 | #define V4L2_CID_MPEG_VIDEO_VBV_DELAY (V4L2_CID_MPEG_BASE+225) | 378 | #define V4L2_CID_MPEG_VIDEO_VBV_DELAY (V4L2_CID_MPEG_BASE+225) |
| 378 | #define V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER (V4L2_CID_MPEG_BASE+226) | 379 | #define V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER (V4L2_CID_MPEG_BASE+226) |
| 380 | #define V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE (V4L2_CID_MPEG_BASE+227) | ||
| 381 | #define V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (V4L2_CID_MPEG_BASE+228) | ||
| 379 | 382 | ||
| 380 | #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300) | 383 | #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300) |
| 381 | #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301) | 384 | #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301) |
| @@ -812,6 +815,9 @@ enum v4l2_flash_strobe_source { | |||
| 812 | #define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3) | 815 | #define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3) |
| 813 | #define V4L2_FLASH_FAULT_OVER_CURRENT (1 << 4) | 816 | #define V4L2_FLASH_FAULT_OVER_CURRENT (1 << 4) |
| 814 | #define V4L2_FLASH_FAULT_INDICATOR (1 << 5) | 817 | #define V4L2_FLASH_FAULT_INDICATOR (1 << 5) |
| 818 | #define V4L2_FLASH_FAULT_UNDER_VOLTAGE (1 << 6) | ||
| 819 | #define V4L2_FLASH_FAULT_INPUT_VOLTAGE (1 << 7) | ||
| 820 | #define V4L2_FLASH_FAULT_LED_OVER_TEMPERATURE (1 << 8) | ||
| 815 | 821 | ||
| 816 | #define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11) | 822 | #define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11) |
| 817 | #define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12) | 823 | #define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12) |
| @@ -895,4 +901,17 @@ enum v4l2_deemphasis { | |||
| 895 | 901 | ||
| 896 | #define V4L2_CID_RDS_RECEPTION (V4L2_CID_FM_RX_CLASS_BASE + 2) | 902 | #define V4L2_CID_RDS_RECEPTION (V4L2_CID_FM_RX_CLASS_BASE + 2) |
| 897 | 903 | ||
| 904 | #define V4L2_CID_RF_TUNER_CLASS_BASE (V4L2_CTRL_CLASS_RF_TUNER | 0x900) | ||
| 905 | #define V4L2_CID_RF_TUNER_CLASS (V4L2_CTRL_CLASS_RF_TUNER | 1) | ||
| 906 | |||
| 907 | #define V4L2_CID_RF_TUNER_BANDWIDTH_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 11) | ||
| 908 | #define V4L2_CID_RF_TUNER_BANDWIDTH (V4L2_CID_RF_TUNER_CLASS_BASE + 12) | ||
| 909 | #define V4L2_CID_RF_TUNER_LNA_GAIN_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 41) | ||
| 910 | #define V4L2_CID_RF_TUNER_LNA_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 42) | ||
| 911 | #define V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 51) | ||
| 912 | #define V4L2_CID_RF_TUNER_MIXER_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 52) | ||
| 913 | #define V4L2_CID_RF_TUNER_IF_GAIN_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 61) | ||
| 914 | #define V4L2_CID_RF_TUNER_IF_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 62) | ||
| 915 | #define V4L2_CID_RF_TUNER_PLL_LOCK (V4L2_CID_RF_TUNER_CLASS_BASE + 91) | ||
| 916 | |||
| 898 | #endif | 917 | #endif |
diff --git a/include/uapi/linux/v4l2-dv-timings.h b/include/uapi/linux/v4l2-dv-timings.h index be709fe29552..b6a5fe00a470 100644 --- a/include/uapi/linux/v4l2-dv-timings.h +++ b/include/uapi/linux/v4l2-dv-timings.h | |||
| @@ -823,4 +823,21 @@ | |||
| 823 | V4L2_DV_FL_REDUCED_BLANKING) \ | 823 | V4L2_DV_FL_REDUCED_BLANKING) \ |
| 824 | } | 824 | } |
| 825 | 825 | ||
| 826 | /* 4K resolutions */ | ||
| 827 | #define V4L2_DV_BT_DMT_4096X2160P60_RB { \ | ||
| 828 | .type = V4L2_DV_BT_656_1120, \ | ||
| 829 | V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, \ | ||
| 830 | 556744000, 8, 32, 40, 48, 8, 6, 0, 0, 0, \ | ||
| 831 | V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \ | ||
| 832 | V4L2_DV_FL_REDUCED_BLANKING) \ | ||
| 833 | } | ||
| 834 | |||
| 835 | #define V4L2_DV_BT_DMT_4096X2160P59_94_RB { \ | ||
| 836 | .type = V4L2_DV_BT_656_1120, \ | ||
| 837 | V4L2_INIT_BT_TIMINGS(4096, 2160, 0, V4L2_DV_HSYNC_POS_POL, \ | ||
| 838 | 556188000, 8, 32, 40, 48, 8, 6, 0, 0, 0, \ | ||
| 839 | V4L2_DV_BT_STD_DMT | V4L2_DV_BT_STD_CVT, \ | ||
| 840 | V4L2_DV_FL_REDUCED_BLANKING) \ | ||
| 841 | } | ||
| 842 | |||
| 826 | #endif | 843 | #endif |
diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h index a33c4daadce3..87e05159f637 100644 --- a/include/uapi/linux/v4l2-subdev.h +++ b/include/uapi/linux/v4l2-subdev.h | |||
| @@ -148,13 +148,8 @@ struct v4l2_subdev_selection { | |||
| 148 | __u32 reserved[8]; | 148 | __u32 reserved[8]; |
| 149 | }; | 149 | }; |
| 150 | 150 | ||
| 151 | struct v4l2_subdev_edid { | 151 | /* Backwards compatibility define --- to be removed */ |
| 152 | __u32 pad; | 152 | #define v4l2_subdev_edid v4l2_edid |
| 153 | __u32 start_block; | ||
| 154 | __u32 blocks; | ||
| 155 | __u32 reserved[5]; | ||
| 156 | __u8 __user *edid; | ||
| 157 | }; | ||
| 158 | 153 | ||
| 159 | #define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format) | 154 | #define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format) |
| 160 | #define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format) | 155 | #define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format) |
| @@ -174,7 +169,8 @@ struct v4l2_subdev_edid { | |||
| 174 | _IOWR('V', 61, struct v4l2_subdev_selection) | 169 | _IOWR('V', 61, struct v4l2_subdev_selection) |
| 175 | #define VIDIOC_SUBDEV_S_SELECTION \ | 170 | #define VIDIOC_SUBDEV_S_SELECTION \ |
| 176 | _IOWR('V', 62, struct v4l2_subdev_selection) | 171 | _IOWR('V', 62, struct v4l2_subdev_selection) |
| 177 | #define VIDIOC_SUBDEV_G_EDID _IOWR('V', 40, struct v4l2_subdev_edid) | 172 | /* These two G/S_EDID ioctls are identical to the ioctls in videodev2.h */ |
| 178 | #define VIDIOC_SUBDEV_S_EDID _IOWR('V', 41, struct v4l2_subdev_edid) | 173 | #define VIDIOC_SUBDEV_G_EDID _IOWR('V', 40, struct v4l2_edid) |
| 174 | #define VIDIOC_SUBDEV_S_EDID _IOWR('V', 41, struct v4l2_edid) | ||
| 179 | 175 | ||
| 180 | #endif | 176 | #endif |
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 6ae7bbe988cc..ea468ee8fe21 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h | |||
| @@ -139,6 +139,7 @@ enum v4l2_buf_type { | |||
| 139 | #endif | 139 | #endif |
| 140 | V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9, | 140 | V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9, |
| 141 | V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10, | 141 | V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10, |
| 142 | V4L2_BUF_TYPE_SDR_CAPTURE = 11, | ||
| 142 | /* Deprecated, do not use */ | 143 | /* Deprecated, do not use */ |
| 143 | V4L2_BUF_TYPE_PRIVATE = 0x80, | 144 | V4L2_BUF_TYPE_PRIVATE = 0x80, |
| 144 | }; | 145 | }; |
| @@ -159,6 +160,8 @@ enum v4l2_tuner_type { | |||
| 159 | V4L2_TUNER_RADIO = 1, | 160 | V4L2_TUNER_RADIO = 1, |
| 160 | V4L2_TUNER_ANALOG_TV = 2, | 161 | V4L2_TUNER_ANALOG_TV = 2, |
| 161 | V4L2_TUNER_DIGITAL_TV = 3, | 162 | V4L2_TUNER_DIGITAL_TV = 3, |
| 163 | V4L2_TUNER_ADC = 4, | ||
| 164 | V4L2_TUNER_RF = 5, | ||
| 162 | }; | 165 | }; |
| 163 | 166 | ||
| 164 | enum v4l2_memory { | 167 | enum v4l2_memory { |
| @@ -264,6 +267,8 @@ struct v4l2_capability { | |||
| 264 | #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ | 267 | #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ |
| 265 | #define V4L2_CAP_MODULATOR 0x00080000 /* has a modulator */ | 268 | #define V4L2_CAP_MODULATOR 0x00080000 /* has a modulator */ |
| 266 | 269 | ||
| 270 | #define V4L2_CAP_SDR_CAPTURE 0x00100000 /* Is a SDR capture device */ | ||
| 271 | |||
| 267 | #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ | 272 | #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ |
| 268 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ | 273 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ |
| 269 | #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ | 274 | #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ |
| @@ -431,6 +436,10 @@ struct v4l2_pix_format { | |||
| 431 | #define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */ | 436 | #define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */ |
| 432 | #define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */ | 437 | #define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */ |
| 433 | 438 | ||
| 439 | /* SDR formats - used only for Software Defined Radio devices */ | ||
| 440 | #define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */ | ||
| 441 | #define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */ | ||
| 442 | |||
| 434 | /* | 443 | /* |
| 435 | * F O R M A T E N U M E R A T I O N | 444 | * F O R M A T E N U M E R A T I O N |
| 436 | */ | 445 | */ |
| @@ -669,24 +678,36 @@ struct v4l2_buffer { | |||
| 669 | }; | 678 | }; |
| 670 | 679 | ||
| 671 | /* Flags for 'flags' field */ | 680 | /* Flags for 'flags' field */ |
| 672 | #define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */ | 681 | /* Buffer is mapped (flag) */ |
| 673 | #define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */ | 682 | #define V4L2_BUF_FLAG_MAPPED 0x00000001 |
| 674 | #define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */ | 683 | /* Buffer is queued for processing */ |
| 675 | #define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */ | 684 | #define V4L2_BUF_FLAG_QUEUED 0x00000002 |
| 676 | #define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */ | 685 | /* Buffer is ready */ |
| 677 | #define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */ | 686 | #define V4L2_BUF_FLAG_DONE 0x00000004 |
| 687 | /* Image is a keyframe (I-frame) */ | ||
| 688 | #define V4L2_BUF_FLAG_KEYFRAME 0x00000008 | ||
| 689 | /* Image is a P-frame */ | ||
| 690 | #define V4L2_BUF_FLAG_PFRAME 0x00000010 | ||
| 691 | /* Image is a B-frame */ | ||
| 692 | #define V4L2_BUF_FLAG_BFRAME 0x00000020 | ||
| 678 | /* Buffer is ready, but the data contained within is corrupted. */ | 693 | /* Buffer is ready, but the data contained within is corrupted. */ |
| 679 | #define V4L2_BUF_FLAG_ERROR 0x0040 | 694 | #define V4L2_BUF_FLAG_ERROR 0x00000040 |
| 680 | #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ | 695 | /* timecode field is valid */ |
| 681 | #define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */ | 696 | #define V4L2_BUF_FLAG_TIMECODE 0x00000100 |
| 697 | /* Buffer is prepared for queuing */ | ||
| 698 | #define V4L2_BUF_FLAG_PREPARED 0x00000400 | ||
| 682 | /* Cache handling flags */ | 699 | /* Cache handling flags */ |
| 683 | #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 | 700 | #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x00000800 |
| 684 | #define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000 | 701 | #define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x00001000 |
| 685 | /* Timestamp type */ | 702 | /* Timestamp type */ |
| 686 | #define V4L2_BUF_FLAG_TIMESTAMP_MASK 0xe000 | 703 | #define V4L2_BUF_FLAG_TIMESTAMP_MASK 0x0000e000 |
| 687 | #define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN 0x0000 | 704 | #define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN 0x00000000 |
| 688 | #define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x2000 | 705 | #define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x00002000 |
| 689 | #define V4L2_BUF_FLAG_TIMESTAMP_COPY 0x4000 | 706 | #define V4L2_BUF_FLAG_TIMESTAMP_COPY 0x00004000 |
| 707 | /* Timestamp sources. */ | ||
| 708 | #define V4L2_BUF_FLAG_TSTAMP_SRC_MASK 0x00070000 | ||
| 709 | #define V4L2_BUF_FLAG_TSTAMP_SRC_EOF 0x00000000 | ||
| 710 | #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000 | ||
| 690 | 711 | ||
| 691 | /** | 712 | /** |
| 692 | * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor | 713 | * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor |
| @@ -1059,14 +1080,14 @@ struct v4l2_bt_timings { | |||
| 1059 | 1080 | ||
| 1060 | /* A few useful defines to calculate the total blanking and frame sizes */ | 1081 | /* A few useful defines to calculate the total blanking and frame sizes */ |
| 1061 | #define V4L2_DV_BT_BLANKING_WIDTH(bt) \ | 1082 | #define V4L2_DV_BT_BLANKING_WIDTH(bt) \ |
| 1062 | (bt->hfrontporch + bt->hsync + bt->hbackporch) | 1083 | ((bt)->hfrontporch + (bt)->hsync + (bt)->hbackporch) |
| 1063 | #define V4L2_DV_BT_FRAME_WIDTH(bt) \ | 1084 | #define V4L2_DV_BT_FRAME_WIDTH(bt) \ |
| 1064 | (bt->width + V4L2_DV_BT_BLANKING_WIDTH(bt)) | 1085 | ((bt)->width + V4L2_DV_BT_BLANKING_WIDTH(bt)) |
| 1065 | #define V4L2_DV_BT_BLANKING_HEIGHT(bt) \ | 1086 | #define V4L2_DV_BT_BLANKING_HEIGHT(bt) \ |
| 1066 | (bt->vfrontporch + bt->vsync + bt->vbackporch + \ | 1087 | ((bt)->vfrontporch + (bt)->vsync + (bt)->vbackporch + \ |
| 1067 | bt->il_vfrontporch + bt->il_vsync + bt->il_vbackporch) | 1088 | (bt)->il_vfrontporch + (bt)->il_vsync + (bt)->il_vbackporch) |
| 1068 | #define V4L2_DV_BT_FRAME_HEIGHT(bt) \ | 1089 | #define V4L2_DV_BT_FRAME_HEIGHT(bt) \ |
| 1069 | (bt->height + V4L2_DV_BT_BLANKING_HEIGHT(bt)) | 1090 | ((bt)->height + V4L2_DV_BT_BLANKING_HEIGHT(bt)) |
| 1070 | 1091 | ||
| 1071 | /** struct v4l2_dv_timings - DV timings | 1092 | /** struct v4l2_dv_timings - DV timings |
| 1072 | * @type: the type of the timings | 1093 | * @type: the type of the timings |
| @@ -1339,6 +1360,7 @@ struct v4l2_modulator { | |||
| 1339 | #define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200 | 1360 | #define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200 |
| 1340 | #define V4L2_TUNER_CAP_FREQ_BANDS 0x0400 | 1361 | #define V4L2_TUNER_CAP_FREQ_BANDS 0x0400 |
| 1341 | #define V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800 | 1362 | #define V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800 |
| 1363 | #define V4L2_TUNER_CAP_1HZ 0x1000 | ||
| 1342 | 1364 | ||
| 1343 | /* Flags for the 'rxsubchans' field */ | 1365 | /* Flags for the 'rxsubchans' field */ |
| 1344 | #define V4L2_TUNER_SUB_MONO 0x0001 | 1366 | #define V4L2_TUNER_SUB_MONO 0x0001 |
| @@ -1692,6 +1714,15 @@ struct v4l2_pix_format_mplane { | |||
| 1692 | } __attribute__ ((packed)); | 1714 | } __attribute__ ((packed)); |
| 1693 | 1715 | ||
| 1694 | /** | 1716 | /** |
| 1717 | * struct v4l2_sdr_format - SDR format definition | ||
| 1718 | * @pixelformat: little endian four character code (fourcc) | ||
| 1719 | */ | ||
| 1720 | struct v4l2_sdr_format { | ||
| 1721 | __u32 pixelformat; | ||
| 1722 | __u8 reserved[28]; | ||
| 1723 | } __attribute__ ((packed)); | ||
| 1724 | |||
| 1725 | /** | ||
| 1695 | * struct v4l2_format - stream data format | 1726 | * struct v4l2_format - stream data format |
| 1696 | * @type: enum v4l2_buf_type; type of the data stream | 1727 | * @type: enum v4l2_buf_type; type of the data stream |
| 1697 | * @pix: definition of an image format | 1728 | * @pix: definition of an image format |
| @@ -1709,6 +1740,7 @@ struct v4l2_format { | |||
| 1709 | struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ | 1740 | struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ |
| 1710 | struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ | 1741 | struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ |
| 1711 | struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ | 1742 | struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ |
| 1743 | struct v4l2_sdr_format sdr; /* V4L2_BUF_TYPE_SDR_CAPTURE */ | ||
| 1712 | __u8 raw_data[200]; /* user-defined */ | 1744 | __u8 raw_data[200]; /* user-defined */ |
| 1713 | } fmt; | 1745 | } fmt; |
| 1714 | }; | 1746 | }; |
| @@ -1885,6 +1917,8 @@ struct v4l2_create_buffers { | |||
| 1885 | #define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu) | 1917 | #define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu) |
| 1886 | #define VIDIOC_G_INPUT _IOR('V', 38, int) | 1918 | #define VIDIOC_G_INPUT _IOR('V', 38, int) |
| 1887 | #define VIDIOC_S_INPUT _IOWR('V', 39, int) | 1919 | #define VIDIOC_S_INPUT _IOWR('V', 39, int) |
| 1920 | #define VIDIOC_G_EDID _IOWR('V', 40, struct v4l2_edid) | ||
| 1921 | #define VIDIOC_S_EDID _IOWR('V', 41, struct v4l2_edid) | ||
| 1888 | #define VIDIOC_G_OUTPUT _IOR('V', 46, int) | 1922 | #define VIDIOC_G_OUTPUT _IOR('V', 46, int) |
| 1889 | #define VIDIOC_S_OUTPUT _IOWR('V', 47, int) | 1923 | #define VIDIOC_S_OUTPUT _IOWR('V', 47, int) |
| 1890 | #define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output) | 1924 | #define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output) |
