diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-17 20:37:31 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:09:40 -0400 |
commit | ee6e3a865a469c78daa93a1e6cdbaca3a102f9c8 (patch) | |
tree | 43de64b3158e8ca9d4d1f580a985478b30d106fe /drivers/media/video/em28xx/em28xx.h | |
parent | acaa4b609fbab25e09459cd8e842e292b27f5ecb (diff) |
V4L/DVB (7595): Improve generic support for setting gpio values
em28xx based devices with xc3028 may require some specific gpio values.
This patch adds a generic handling for such values.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx.h')
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index 96a56faeb77b..00d2f62142e3 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -218,6 +218,21 @@ enum em28xx_decoder { | |||
218 | EM28XX_SAA7114 | 218 | EM28XX_SAA7114 |
219 | }; | 219 | }; |
220 | 220 | ||
221 | #define MAX_GPIO 2 | ||
222 | struct gpio_ctl { | ||
223 | /* Register to be set */ | ||
224 | unsigned char reg; | ||
225 | /* Initial/final value */ | ||
226 | unsigned char val; | ||
227 | /* reset value - if set, it will do: | ||
228 | val1 - val2 - val1 | ||
229 | */ | ||
230 | unsigned char rst; | ||
231 | /* Sleep times | ||
232 | */ | ||
233 | unsigned int t1, t2, t3; | ||
234 | }; | ||
235 | |||
221 | struct em28xx_board { | 236 | struct em28xx_board { |
222 | char *name; | 237 | char *name; |
223 | int vchannels; | 238 | int vchannels; |
@@ -233,7 +248,8 @@ struct em28xx_board { | |||
233 | unsigned int max_range_640_480:1; | 248 | unsigned int max_range_640_480:1; |
234 | unsigned int has_dvb:1; | 249 | unsigned int has_dvb:1; |
235 | 250 | ||
236 | unsigned int analog_gpio; | 251 | struct gpio_ctl analog_gpio[MAX_GPIO]; |
252 | struct gpio_ctl digital_gpio[MAX_GPIO]; | ||
237 | 253 | ||
238 | enum em28xx_decoder decoder; | 254 | enum em28xx_decoder decoder; |
239 | 255 | ||
@@ -293,7 +309,6 @@ struct em28xx { | |||
293 | char name[30]; /* name (including minor) of the device */ | 309 | char name[30]; /* name (including minor) of the device */ |
294 | int model; /* index in the device_data struct */ | 310 | int model; /* index in the device_data struct */ |
295 | int devno; /* marks the number of this device */ | 311 | int devno; /* marks the number of this device */ |
296 | unsigned int analog_gpio; | ||
297 | unsigned int is_em2800:1; | 312 | unsigned int is_em2800:1; |
298 | unsigned int has_msp34xx:1; | 313 | unsigned int has_msp34xx:1; |
299 | unsigned int has_tda9887:1; | 314 | unsigned int has_tda9887:1; |
@@ -303,6 +318,9 @@ struct em28xx { | |||
303 | unsigned int max_range_640_480:1; | 318 | unsigned int max_range_640_480:1; |
304 | unsigned int has_dvb:1; | 319 | unsigned int has_dvb:1; |
305 | 320 | ||
321 | struct gpio_ctl (*analog_gpio)[MAX_GPIO]; | ||
322 | struct gpio_ctl (*digital_gpio)[MAX_GPIO]; | ||
323 | |||
306 | int video_inputs; /* number of video inputs */ | 324 | int video_inputs; /* number of video inputs */ |
307 | struct list_head devlist; | 325 | struct list_head devlist; |
308 | 326 | ||
@@ -443,6 +461,7 @@ extern struct em28xx_board em28xx_boards[]; | |||
443 | extern struct usb_device_id em28xx_id_table[]; | 461 | extern struct usb_device_id em28xx_id_table[]; |
444 | extern const unsigned int em28xx_bcount; | 462 | extern const unsigned int em28xx_bcount; |
445 | void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir); | 463 | void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir); |
464 | int em28xx_tuner_callback(void *ptr, int command, int arg); | ||
446 | 465 | ||
447 | /* Provided by em28xx-input.c */ | 466 | /* Provided by em28xx-input.c */ |
448 | /* TODO: Check if the standard get_key handlers on ir-common can be used */ | 467 | /* TODO: Check if the standard get_key handlers on ir-common can be used */ |