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 /drivers/media/dvb/dvb-usb/dvb-usb.h | |
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 'drivers/media/dvb/dvb-usb/dvb-usb.h')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb.h | 92 |
1 files changed, 62 insertions, 30 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 4a9f676087bf..34f7b3ba8cc7 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/usb.h> | 14 | #include <linux/usb.h> |
15 | #include <linux/firmware.h> | 15 | #include <linux/firmware.h> |
16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
17 | #include <media/ir-core.h> | ||
17 | 18 | ||
18 | #include "dvb_frontend.h" | 19 | #include "dvb_frontend.h" |
19 | #include "dvb_demux.h" | 20 | #include "dvb_demux.h" |
@@ -74,30 +75,19 @@ struct dvb_usb_device_description { | |||
74 | struct usb_device_id *warm_ids[DVB_USB_ID_MAX_NUM]; | 75 | struct usb_device_id *warm_ids[DVB_USB_ID_MAX_NUM]; |
75 | }; | 76 | }; |
76 | 77 | ||
77 | /** | 78 | static inline u8 rc5_custom(struct ir_scancode *key) |
78 | * struct dvb_usb_rc_key - a remote control key and its input-event | ||
79 | * @custom: the vendor/custom part of the key | ||
80 | * @data: the actual key part | ||
81 | * @event: the input event assigned to key identified by custom and data | ||
82 | */ | ||
83 | struct dvb_usb_rc_key { | ||
84 | u16 scan; | ||
85 | u32 event; | ||
86 | }; | ||
87 | |||
88 | static inline u8 rc5_custom(struct dvb_usb_rc_key *key) | ||
89 | { | 79 | { |
90 | return (key->scan >> 8) & 0xff; | 80 | return (key->scancode >> 8) & 0xff; |
91 | } | 81 | } |
92 | 82 | ||
93 | static inline u8 rc5_data(struct dvb_usb_rc_key *key) | 83 | static inline u8 rc5_data(struct ir_scancode *key) |
94 | { | 84 | { |
95 | return key->scan & 0xff; | 85 | return key->scancode & 0xff; |
96 | } | 86 | } |
97 | 87 | ||
98 | static inline u8 rc5_scan(struct dvb_usb_rc_key *key) | 88 | static inline u8 rc5_scan(struct ir_scancode *key) |
99 | { | 89 | { |
100 | return key->scan & 0xffff; | 90 | return key->scancode & 0xffff; |
101 | } | 91 | } |
102 | 92 | ||
103 | struct dvb_usb_device; | 93 | struct dvb_usb_device; |
@@ -168,6 +158,55 @@ struct dvb_usb_adapter_properties { | |||
168 | }; | 158 | }; |
169 | 159 | ||
170 | /** | 160 | /** |
161 | * struct dvb_rc_legacy - old properties of remote controller | ||
162 | * @rc_key_map: a hard-wired array of struct ir_scancode (NULL to disable | ||
163 | * remote control handling). | ||
164 | * @rc_key_map_size: number of items in @rc_key_map. | ||
165 | * @rc_query: called to query an event event. | ||
166 | * @rc_interval: time in ms between two queries. | ||
167 | */ | ||
168 | struct dvb_rc_legacy { | ||
169 | /* remote control properties */ | ||
170 | #define REMOTE_NO_KEY_PRESSED 0x00 | ||
171 | #define REMOTE_KEY_PRESSED 0x01 | ||
172 | #define REMOTE_KEY_REPEAT 0x02 | ||
173 | struct ir_scancode *rc_key_map; | ||
174 | int rc_key_map_size; | ||
175 | int (*rc_query) (struct dvb_usb_device *, u32 *, int *); | ||
176 | int rc_interval; | ||
177 | }; | ||
178 | |||
179 | /** | ||
180 | * struct dvb_rc properties of remote controller, using rc-core | ||
181 | * @rc_codes: name of rc codes table | ||
182 | * @protocol: type of protocol(s) currently used by the driver | ||
183 | * @rc_query: called to query an event event. | ||
184 | * @rc_interval: time in ms between two queries. | ||
185 | * @rc_props: remote controller properties | ||
186 | * @bulk_mode: device supports bulk mode for RC (disable polling mode) | ||
187 | */ | ||
188 | struct dvb_rc { | ||
189 | char *rc_codes; | ||
190 | u64 protocol; | ||
191 | char *module_name; | ||
192 | int (*rc_query) (struct dvb_usb_device *d); | ||
193 | int rc_interval; | ||
194 | struct ir_dev_props rc_props; | ||
195 | bool bulk_mode; /* uses bulk mode */ | ||
196 | }; | ||
197 | |||
198 | /** | ||
199 | * enum dvb_usb_mode - Specifies if it is using a legacy driver or a new one | ||
200 | * based on rc-core | ||
201 | * This is initialized/used only inside dvb-usb-remote.c. | ||
202 | * It shouldn't be set by the drivers. | ||
203 | */ | ||
204 | enum dvb_usb_mode { | ||
205 | DVB_RC_LEGACY, | ||
206 | DVB_RC_CORE, | ||
207 | }; | ||
208 | |||
209 | /** | ||
171 | * struct dvb_usb_device_properties - properties of a dvb-usb-device | 210 | * struct dvb_usb_device_properties - properties of a dvb-usb-device |
172 | * @usb_ctrl: which USB device-side controller is in use. Needed for firmware | 211 | * @usb_ctrl: which USB device-side controller is in use. Needed for firmware |
173 | * download. | 212 | * download. |
@@ -185,11 +224,7 @@ struct dvb_usb_adapter_properties { | |||
185 | * @identify_state: called to determine the state (cold or warm), when it | 224 | * @identify_state: called to determine the state (cold or warm), when it |
186 | * is not distinguishable by the USB IDs. | 225 | * is not distinguishable by the USB IDs. |
187 | * | 226 | * |
188 | * @rc_key_map: a hard-wired array of struct dvb_usb_rc_key (NULL to disable | 227 | * @rc: remote controller properties |
189 | * remote control handling). | ||
190 | * @rc_key_map_size: number of items in @rc_key_map. | ||
191 | * @rc_query: called to query an event event. | ||
192 | * @rc_interval: time in ms between two queries. | ||
193 | * | 228 | * |
194 | * @i2c_algo: i2c_algorithm if the device has I2CoverUSB. | 229 | * @i2c_algo: i2c_algorithm if the device has I2CoverUSB. |
195 | * | 230 | * |
@@ -233,14 +268,11 @@ struct dvb_usb_device_properties { | |||
233 | int (*identify_state) (struct usb_device *, struct dvb_usb_device_properties *, | 268 | int (*identify_state) (struct usb_device *, struct dvb_usb_device_properties *, |
234 | struct dvb_usb_device_description **, int *); | 269 | struct dvb_usb_device_description **, int *); |
235 | 270 | ||
236 | /* remote control properties */ | 271 | struct { |
237 | #define REMOTE_NO_KEY_PRESSED 0x00 | 272 | enum dvb_usb_mode mode; /* Drivers shouldn't touch on it */ |
238 | #define REMOTE_KEY_PRESSED 0x01 | 273 | struct dvb_rc_legacy legacy; |
239 | #define REMOTE_KEY_REPEAT 0x02 | 274 | struct dvb_rc core; |
240 | struct dvb_usb_rc_key *rc_key_map; | 275 | } rc; |
241 | int rc_key_map_size; | ||
242 | int (*rc_query) (struct dvb_usb_device *, u32 *, int *); | ||
243 | int rc_interval; | ||
244 | 276 | ||
245 | struct i2c_algorithm *i2c_algo; | 277 | struct i2c_algorithm *i2c_algo; |
246 | 278 | ||