aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2009-05-29 11:41:18 -0400
committerMike Frysinger <vapier@gentoo.org>2009-06-12 06:11:55 -0400
commitffc4d8bc4435918d2fd1e840b0bf985e7b56f0d3 (patch)
tree99b49fbfa7bc067c987a4773c4ebb2cf3c89f5fe /arch
parent79df1b69471b5ea4be8285c9dc6ab05cdf5a85d7 (diff)
Blackfin: bf548-ezkit/bf537-stamp: add resources for ADXL345/346
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c44
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c83
2 files changed, 117 insertions, 10 deletions
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index f56289a66ff2..dfb5036f8a6b 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -607,6 +607,43 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = {
607}; 607};
608#endif 608#endif
609 609
610#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
611#include <linux/input.h>
612#include <linux/spi/adxl34x.h>
613static const struct adxl34x_platform_data adxl34x_info = {
614 .x_axis_offset = 0,
615 .y_axis_offset = 0,
616 .z_axis_offset = 0,
617 .tap_threshold = 0x31,
618 .tap_duration = 0x10,
619 .tap_latency = 0x60,
620 .tap_window = 0xF0,
621 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
622 .act_axis_control = 0xFF,
623 .activity_threshold = 5,
624 .inactivity_threshold = 3,
625 .inactivity_time = 4,
626 .free_fall_threshold = 0x7,
627 .free_fall_time = 0x20,
628 .data_rate = 0x8,
629 .data_range = ADXL_FULL_RES,
630
631 .ev_type = EV_ABS,
632 .ev_code_x = ABS_X, /* EV_REL */
633 .ev_code_y = ABS_Y, /* EV_REL */
634 .ev_code_z = ABS_Z, /* EV_REL */
635
636 .ev_code_tap_x = BTN_TOUCH, /* EV_KEY */
637 .ev_code_tap_y = BTN_TOUCH, /* EV_KEY */
638 .ev_code_tap_z = BTN_TOUCH, /* EV_KEY */
639
640/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
641/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
642 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
643 .fifo_mode = ADXL_FIFO_STREAM,
644};
645#endif
646
610#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) 647#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
611static struct bfin5xx_spi_chip spi_ad7879_chip_info = { 648static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
612 .enable_dma = 0, 649 .enable_dma = 0,
@@ -1312,6 +1349,13 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1312 .platform_data = (void *)&adp5520_pdev_data, 1349 .platform_data = (void *)&adp5520_pdev_data,
1313 }, 1350 },
1314#endif 1351#endif
1352#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1353 {
1354 I2C_BOARD_INFO("adxl34x", 0x53),
1355 .irq = IRQ_PG3,
1356 .platform_data = (void *)&adxl34x_info,
1357 },
1358#endif
1315}; 1359};
1316 1360
1317#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 1361#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 2780e4193728..add5a17452ce 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -208,6 +208,43 @@ static struct platform_device bfin_rotary_device = {
208}; 208};
209#endif 209#endif
210 210
211#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
212#include <linux/input.h>
213#include <linux/spi/adxl34x.h>
214static const struct adxl34x_platform_data adxl34x_info = {
215 .x_axis_offset = 0,
216 .y_axis_offset = 0,
217 .z_axis_offset = 0,
218 .tap_threshold = 0x31,
219 .tap_duration = 0x10,
220 .tap_latency = 0x60,
221 .tap_window = 0xF0,
222 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
223 .act_axis_control = 0xFF,
224 .activity_threshold = 5,
225 .inactivity_threshold = 3,
226 .inactivity_time = 4,
227 .free_fall_threshold = 0x7,
228 .free_fall_time = 0x20,
229 .data_rate = 0x8,
230 .data_range = ADXL_FULL_RES,
231
232 .ev_type = EV_ABS,
233 .ev_code_x = ABS_X, /* EV_REL */
234 .ev_code_y = ABS_Y, /* EV_REL */
235 .ev_code_z = ABS_Z, /* EV_REL */
236
237 .ev_code_tap_x = BTN_TOUCH, /* EV_KEY */
238 .ev_code_tap_y = BTN_TOUCH, /* EV_KEY */
239 .ev_code_tap_z = BTN_TOUCH, /* EV_KEY */
240
241/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
242/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
243 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
244 .fifo_mode = ADXL_FIFO_STREAM,
245};
246#endif
247
211#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 248#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
212static struct platform_device rtc_device = { 249static struct platform_device rtc_device = {
213 .name = "rtc-bfin", 250 .name = "rtc-bfin",
@@ -628,6 +665,14 @@ static struct bfin5xx_spi_chip spidev_chip_info = {
628}; 665};
629#endif 666#endif
630 667
668#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
669static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
670 .enable_dma = 0, /* use dma transfer with this chip*/
671 .bits_per_word = 8,
672 .cs_change_per_word = 0,
673};
674#endif
675
631static struct spi_board_info bfin_spi_board_info[] __initdata = { 676static struct spi_board_info bfin_spi_board_info[] __initdata = {
632#if defined(CONFIG_MTD_M25P80) \ 677#if defined(CONFIG_MTD_M25P80) \
633 || defined(CONFIG_MTD_M25P80_MODULE) 678 || defined(CONFIG_MTD_M25P80_MODULE)
@@ -653,15 +698,15 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
653 }, 698 },
654#endif 699#endif
655#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 700#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
656{ 701 {
657 .modalias = "ad7877", 702 .modalias = "ad7877",
658 .platform_data = &bfin_ad7877_ts_info, 703 .platform_data = &bfin_ad7877_ts_info,
659 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */ 704 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
660 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 705 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
661 .bus_num = 0, 706 .bus_num = 0,
662 .chip_select = 2, 707 .chip_select = 2,
663 .controller_data = &spi_ad7877_chip_info, 708 .controller_data = &spi_ad7877_chip_info,
664}, 709 },
665#endif 710#endif
666#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 711#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
667 { 712 {
@@ -672,8 +717,19 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
672 .controller_data = &spidev_chip_info, 717 .controller_data = &spidev_chip_info,
673 }, 718 },
674#endif 719#endif
720#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
721 {
722 .modalias = "adxl34x",
723 .platform_data = &adxl34x_info,
724 .irq = IRQ_PC5,
725 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
726 .bus_num = 1,
727 .chip_select = 2,
728 .controller_data = &spi_adxl34x_chip_info,
729 .mode = SPI_MODE_3,
730 },
731#endif
675}; 732};
676
677#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 733#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
678/* SPI (0) */ 734/* SPI (0) */
679static struct resource bfin_spi0_resource[] = { 735static struct resource bfin_spi0_resource[] = {
@@ -797,6 +853,13 @@ static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
797 .irq = 212, 853 .irq = 212,
798 }, 854 },
799#endif 855#endif
856#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
857 {
858 I2C_BOARD_INFO("adxl34x", 0x53),
859 .irq = IRQ_PC5,
860 .platform_data = (void *)&adxl34x_info,
861 },
862#endif
800}; 863};
801#endif 864#endif
802 865