diff options
-rw-r--r-- | arch/blackfin/mach-bf527/boards/ezkit.c | 36 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/include/mach/defBF52x_base.h | 27 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/include/mach/portmux.h | 4 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/boards/ezkit.c | 35 |
4 files changed, 102 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c index 04a8d6da9055..8ee2b744e234 100644 --- a/arch/blackfin/mach-bf527/boards/ezkit.c +++ b/arch/blackfin/mach-bf527/boards/ezkit.c | |||
@@ -853,6 +853,38 @@ static struct platform_device bfin_device_gpiokeys = { | |||
853 | }; | 853 | }; |
854 | #endif | 854 | #endif |
855 | 855 | ||
856 | #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE) | ||
857 | #include <linux/input.h> | ||
858 | #include <asm/bfin_rotary.h> | ||
859 | |||
860 | static struct bfin_rotary_platform_data bfin_rotary_data = { | ||
861 | /*.rotary_up_key = KEY_UP,*/ | ||
862 | /*.rotary_down_key = KEY_DOWN,*/ | ||
863 | .rotary_rel_code = REL_WHEEL, | ||
864 | .rotary_button_key = KEY_ENTER, | ||
865 | .debounce = 10, /* 0..17 */ | ||
866 | .mode = ROT_QUAD_ENC | ROT_DEBE, | ||
867 | }; | ||
868 | |||
869 | static struct resource bfin_rotary_resources[] = { | ||
870 | { | ||
871 | .start = IRQ_CNT, | ||
872 | .end = IRQ_CNT, | ||
873 | .flags = IORESOURCE_IRQ, | ||
874 | }, | ||
875 | }; | ||
876 | |||
877 | static struct platform_device bfin_rotary_device = { | ||
878 | .name = "bfin-rotary", | ||
879 | .id = -1, | ||
880 | .num_resources = ARRAY_SIZE(bfin_rotary_resources), | ||
881 | .resource = bfin_rotary_resources, | ||
882 | .dev = { | ||
883 | .platform_data = &bfin_rotary_data, | ||
884 | }, | ||
885 | }; | ||
886 | #endif | ||
887 | |||
856 | static struct resource bfin_gpios_resources = { | 888 | static struct resource bfin_gpios_resources = { |
857 | .start = 0, | 889 | .start = 0, |
858 | .end = MAX_BLACKFIN_GPIOS - 1, | 890 | .end = MAX_BLACKFIN_GPIOS - 1, |
@@ -969,6 +1001,10 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
969 | &bfin_device_gpiokeys, | 1001 | &bfin_device_gpiokeys, |
970 | #endif | 1002 | #endif |
971 | 1003 | ||
1004 | #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE) | ||
1005 | &bfin_rotary_device, | ||
1006 | #endif | ||
1007 | |||
972 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) | 1008 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
973 | &ezkit_flash_device, | 1009 | &ezkit_flash_device, |
974 | #endif | 1010 | #endif |
diff --git a/arch/blackfin/mach-bf527/include/mach/defBF52x_base.h b/arch/blackfin/mach-bf527/include/mach/defBF52x_base.h index 6ac2ed7026eb..68b55d03fedf 100644 --- a/arch/blackfin/mach-bf527/include/mach/defBF52x_base.h +++ b/arch/blackfin/mach-bf527/include/mach/defBF52x_base.h | |||
@@ -1840,6 +1840,33 @@ | |||
1840 | 1840 | ||
1841 | #define DPRESCALE 0xf /* Load Counter Register */ | 1841 | #define DPRESCALE 0xf /* Load Counter Register */ |
1842 | 1842 | ||
1843 | /* CNT_COMMAND bit field options */ | ||
1844 | |||
1845 | #define W1LCNT_ZERO 0x0001 /* write 1 to load CNT_COUNTER with zero */ | ||
1846 | #define W1LCNT_MIN 0x0004 /* write 1 to load CNT_COUNTER from CNT_MIN */ | ||
1847 | #define W1LCNT_MAX 0x0008 /* write 1 to load CNT_COUNTER from CNT_MAX */ | ||
1848 | |||
1849 | #define W1LMIN_ZERO 0x0010 /* write 1 to load CNT_MIN with zero */ | ||
1850 | #define W1LMIN_CNT 0x0020 /* write 1 to load CNT_MIN from CNT_COUNTER */ | ||
1851 | #define W1LMIN_MAX 0x0080 /* write 1 to load CNT_MIN from CNT_MAX */ | ||
1852 | |||
1853 | #define W1LMAX_ZERO 0x0100 /* write 1 to load CNT_MAX with zero */ | ||
1854 | #define W1LMAX_CNT 0x0200 /* write 1 to load CNT_MAX from CNT_COUNTER */ | ||
1855 | #define W1LMAX_MIN 0x0400 /* write 1 to load CNT_MAX from CNT_MIN */ | ||
1856 | |||
1857 | /* CNT_CONFIG bit field options */ | ||
1858 | |||
1859 | #define CNTMODE_QUADENC 0x0000 /* quadrature encoder mode */ | ||
1860 | #define CNTMODE_BINENC 0x0100 /* binary encoder mode */ | ||
1861 | #define CNTMODE_UDCNT 0x0200 /* up/down counter mode */ | ||
1862 | #define CNTMODE_DIRCNT 0x0400 /* direction counter mode */ | ||
1863 | #define CNTMODE_DIRTMR 0x0500 /* direction timer mode */ | ||
1864 | |||
1865 | #define BNDMODE_COMP 0x0000 /* boundary compare mode */ | ||
1866 | #define BNDMODE_ZERO 0x1000 /* boundary compare and zero mode */ | ||
1867 | #define BNDMODE_CAPT 0x2000 /* boundary capture mode */ | ||
1868 | #define BNDMODE_AEXT 0x3000 /* boundary auto-extend mode */ | ||
1869 | |||
1843 | /* Bit masks for OTP_CONTROL */ | 1870 | /* Bit masks for OTP_CONTROL */ |
1844 | 1871 | ||
1845 | #define FUSE_FADDR 0x1ff /* OTP/Fuse Address */ | 1872 | #define FUSE_FADDR 0x1ff /* OTP/Fuse Address */ |
diff --git a/arch/blackfin/mach-bf527/include/mach/portmux.h b/arch/blackfin/mach-bf527/include/mach/portmux.h index ae4d205bfcf5..7f6da2c386bb 100644 --- a/arch/blackfin/mach-bf527/include/mach/portmux.h +++ b/arch/blackfin/mach-bf527/include/mach/portmux.h | |||
@@ -67,6 +67,10 @@ | |||
67 | #define P_UART1_RX (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(1)) | 67 | #define P_UART1_RX (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(1)) |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | #define P_CNT_CZM (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(3)) | ||
71 | #define P_CNT_CDG (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(3)) | ||
72 | #define P_CNT_CUD (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(3)) | ||
73 | |||
70 | #define P_HWAIT (P_DONTCARE) | 74 | #define P_HWAIT (P_DONTCARE) |
71 | 75 | ||
72 | #define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0)) | 76 | #define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0)) |
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c index 397ddf6b8106..7c08b9f1838a 100644 --- a/arch/blackfin/mach-bf548/boards/ezkit.c +++ b/arch/blackfin/mach-bf548/boards/ezkit.c | |||
@@ -183,6 +183,37 @@ static struct platform_device bf54x_kpad_device = { | |||
183 | }; | 183 | }; |
184 | #endif | 184 | #endif |
185 | 185 | ||
186 | #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE) | ||
187 | #include <asm/bfin_rotary.h> | ||
188 | |||
189 | static struct bfin_rotary_platform_data bfin_rotary_data = { | ||
190 | /*.rotary_up_key = KEY_UP,*/ | ||
191 | /*.rotary_down_key = KEY_DOWN,*/ | ||
192 | .rotary_rel_code = REL_WHEEL, | ||
193 | .rotary_button_key = KEY_ENTER, | ||
194 | .debounce = 10, /* 0..17 */ | ||
195 | .mode = ROT_QUAD_ENC | ROT_DEBE, | ||
196 | }; | ||
197 | |||
198 | static struct resource bfin_rotary_resources[] = { | ||
199 | { | ||
200 | .start = IRQ_CNT, | ||
201 | .end = IRQ_CNT, | ||
202 | .flags = IORESOURCE_IRQ, | ||
203 | }, | ||
204 | }; | ||
205 | |||
206 | static struct platform_device bfin_rotary_device = { | ||
207 | .name = "bfin-rotary", | ||
208 | .id = -1, | ||
209 | .num_resources = ARRAY_SIZE(bfin_rotary_resources), | ||
210 | .resource = bfin_rotary_resources, | ||
211 | .dev = { | ||
212 | .platform_data = &bfin_rotary_data, | ||
213 | }, | ||
214 | }; | ||
215 | #endif | ||
216 | |||
186 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | 217 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
187 | static struct platform_device rtc_device = { | 218 | static struct platform_device rtc_device = { |
188 | .name = "rtc-bfin", | 219 | .name = "rtc-bfin", |
@@ -817,6 +848,10 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
817 | &bf54x_kpad_device, | 848 | &bf54x_kpad_device, |
818 | #endif | 849 | #endif |
819 | 850 | ||
851 | #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE) | ||
852 | &bfin_rotary_device, | ||
853 | #endif | ||
854 | |||
820 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) | 855 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
821 | &i2c_bfin_twi0_device, | 856 | &i2c_bfin_twi0_device, |
822 | #if !defined(CONFIG_BF542) | 857 | #if !defined(CONFIG_BF542) |