diff options
author | Frank Schaefer <fschaefer.oss@googlemail.com> | 2013-12-01 16:06:52 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-12-10 13:10:35 -0500 |
commit | f522260993822d82e2c480aa676aa4ca1230d235 (patch) | |
tree | 88e133f503df0b8c1ae8a9f2978b6738cfe98914 /drivers/media/usb/em28xx/em28xx-cards.c | |
parent | 07e4de3004ecedd67c72708d6c0fe69c51317f79 (diff) |
[media] em28xx: extend the support for device buttons
The current code supports only a single snapshot button assigned to
register 0x0c bit 5. But devices may be equipped with multiple buttons
with different functionalities and they can also be assigned to the
various GPI-ports.
Extend the em28xx-input code to handle multiple buttons assigned to different
GPI-ports / register addresses and bits.
Also make easier to extend the code with further button types.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-cards.c')
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-cards.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index a5196697627f..ebb112c17109 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c | |||
@@ -413,6 +413,20 @@ static struct em28xx_reg_seq pctv_520e[] = { | |||
413 | }; | 413 | }; |
414 | 414 | ||
415 | /* | 415 | /* |
416 | * Button definitions | ||
417 | */ | ||
418 | static struct em28xx_button std_snapshot_button[] = { | ||
419 | { | ||
420 | .role = EM28XX_BUTTON_SNAPSHOT, | ||
421 | .reg_r = EM28XX_R0C_USBSUSP, | ||
422 | .reg_clearing = EM28XX_R0C_USBSUSP, | ||
423 | .mask = EM28XX_R0C_USBSUSP_SNAPSHOT, | ||
424 | .inverted = 0, | ||
425 | }, | ||
426 | {-1, 0, 0, 0, 0}, | ||
427 | }; | ||
428 | |||
429 | /* | ||
416 | * Board definitions | 430 | * Board definitions |
417 | */ | 431 | */ |
418 | struct em28xx_board em28xx_boards[] = { | 432 | struct em28xx_board em28xx_boards[] = { |
@@ -1391,7 +1405,7 @@ struct em28xx_board em28xx_boards[] = { | |||
1391 | }, | 1405 | }, |
1392 | [EM2820_BOARD_PROLINK_PLAYTV_USB2] = { | 1406 | [EM2820_BOARD_PROLINK_PLAYTV_USB2] = { |
1393 | .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0", | 1407 | .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0", |
1394 | .has_snapshot_button = 1, | 1408 | .buttons = std_snapshot_button, |
1395 | .tda9887_conf = TDA9887_PRESENT, | 1409 | .tda9887_conf = TDA9887_PRESENT, |
1396 | .tuner_type = TUNER_YMEC_TVF_5533MF, | 1410 | .tuner_type = TUNER_YMEC_TVF_5533MF, |
1397 | .decoder = EM28XX_SAA711X, | 1411 | .decoder = EM28XX_SAA711X, |
@@ -1413,7 +1427,7 @@ struct em28xx_board em28xx_boards[] = { | |||
1413 | }, | 1427 | }, |
1414 | [EM2860_BOARD_SAA711X_REFERENCE_DESIGN] = { | 1428 | [EM2860_BOARD_SAA711X_REFERENCE_DESIGN] = { |
1415 | .name = "EM2860/SAA711X Reference Design", | 1429 | .name = "EM2860/SAA711X Reference Design", |
1416 | .has_snapshot_button = 1, | 1430 | .buttons = std_snapshot_button, |
1417 | .tuner_type = TUNER_ABSENT, | 1431 | .tuner_type = TUNER_ABSENT, |
1418 | .decoder = EM28XX_SAA711X, | 1432 | .decoder = EM28XX_SAA711X, |
1419 | .input = { { | 1433 | .input = { { |
@@ -2841,7 +2855,7 @@ static void request_module_async(struct work_struct *work) | |||
2841 | 2855 | ||
2842 | if (dev->board.has_dvb) | 2856 | if (dev->board.has_dvb) |
2843 | request_module("em28xx-dvb"); | 2857 | request_module("em28xx-dvb"); |
2844 | if (dev->board.has_snapshot_button || | 2858 | if (dev->board.buttons || |
2845 | ((dev->board.ir_codes || dev->board.has_ir_i2c) && !disable_ir)) | 2859 | ((dev->board.ir_codes || dev->board.has_ir_i2c) && !disable_ir)) |
2846 | request_module("em28xx-rc"); | 2860 | request_module("em28xx-rc"); |
2847 | #endif /* CONFIG_MODULES */ | 2861 | #endif /* CONFIG_MODULES */ |