Michael Hennerich | 4832958 | 2009-07-22 21:51:34 -0700 | [diff] [blame] | 1 | /* |
| 2 | * board initialization should put one of these structures into platform_data |
| 3 | * and place the bfin-rotary onto platform_bus named "bfin-rotary". |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 4 | * |
| 5 | * Copyright 2008 Analog Devices Inc. |
| 6 | * |
| 7 | * Licensed under the GPL-2 or later. |
Michael Hennerich | 4832958 | 2009-07-22 21:51:34 -0700 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef _BFIN_ROTARY_H |
| 11 | #define _BFIN_ROTARY_H |
| 12 | |
| 13 | /* mode bitmasks */ |
| 14 | #define ROT_QUAD_ENC CNTMODE_QUADENC /* quadrature/grey code encoder mode */ |
| 15 | #define ROT_BIN_ENC CNTMODE_BINENC /* binary encoder mode */ |
| 16 | #define ROT_UD_CNT CNTMODE_UDCNT /* rotary counter mode */ |
| 17 | #define ROT_DIR_CNT CNTMODE_DIRCNT /* direction counter mode */ |
| 18 | |
| 19 | #define ROT_DEBE DEBE /* Debounce Enable */ |
| 20 | |
| 21 | #define ROT_CDGINV CDGINV /* CDG Pin Polarity Invert */ |
| 22 | #define ROT_CUDINV CUDINV /* CUD Pin Polarity Invert */ |
| 23 | #define ROT_CZMINV CZMINV /* CZM Pin Polarity Invert */ |
| 24 | |
| 25 | struct bfin_rotary_platform_data { |
| 26 | /* set rotary UP KEY_### or BTN_### in case you prefer |
| 27 | * bfin-rotary to send EV_KEY otherwise set 0 |
| 28 | */ |
| 29 | unsigned int rotary_up_key; |
| 30 | /* set rotary DOWN KEY_### or BTN_### in case you prefer |
| 31 | * bfin-rotary to send EV_KEY otherwise set 0 |
| 32 | */ |
| 33 | unsigned int rotary_down_key; |
| 34 | /* set rotary BUTTON KEY_### or BTN_### */ |
| 35 | unsigned int rotary_button_key; |
| 36 | /* set rotary Relative Axis REL_### in case you prefer |
| 37 | * bfin-rotary to send EV_REL otherwise set 0 |
| 38 | */ |
| 39 | unsigned int rotary_rel_code; |
| 40 | unsigned short debounce; /* 0..17 */ |
| 41 | unsigned short mode; |
| 42 | }; |
| 43 | #endif |