mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: linux-kernel@vger.kernel.org
Cc: uclinux-dist-devel@blackfin.uclinux.org,
	Michael Hennerich <michael.hennerich@analog.com>
Subject: [PATCH 48/62] Blackfin: bf548-ezkit: add resources for ADXL345/346
Date: Fri,  5 Jun 2009 04:04:57 -0400	[thread overview]
Message-ID: <1244189111-19639-49-git-send-email-vapier@gentoo.org> (raw)
In-Reply-To: <1244189111-19639-1-git-send-email-vapier@gentoo.org>

From: Michael Hennerich <michael.hennerich@analog.com>

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 arch/blackfin/mach-bf548/boards/ezkit.c |   83 +++++++++++++++++++++++++++----
 1 files changed, 73 insertions(+), 10 deletions(-)

diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 2780e41..add5a17 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 = {
 };
 #endif
 
+#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
+#include <linux/input.h>
+#include <linux/spi/adxl34x.h>
+static const struct adxl34x_platform_data adxl34x_info = {
+	.x_axis_offset = 0,
+	.y_axis_offset = 0,
+	.z_axis_offset = 0,
+	.tap_threshold = 0x31,
+	.tap_duration = 0x10,
+	.tap_latency = 0x60,
+	.tap_window = 0xF0,
+	.tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
+	.act_axis_control = 0xFF,
+	.activity_threshold = 5,
+	.inactivity_threshold = 3,
+	.inactivity_time = 4,
+	.free_fall_threshold = 0x7,
+	.free_fall_time = 0x20,
+	.data_rate = 0x8,
+	.data_range = ADXL_FULL_RES,
+
+	.ev_type = EV_ABS,
+	.ev_code_x = ABS_X,		/* EV_REL */
+	.ev_code_y = ABS_Y,		/* EV_REL */
+	.ev_code_z = ABS_Z,		/* EV_REL */
+
+	.ev_code_tap_x = BTN_TOUCH,		/* EV_KEY */
+	.ev_code_tap_y = BTN_TOUCH,		/* EV_KEY */
+	.ev_code_tap_z = BTN_TOUCH,		/* EV_KEY */
+
+/*	.ev_code_ff = KEY_F,*/		/* EV_KEY */
+/*	.ev_code_act_inactivity = KEY_A,*/	/* EV_KEY */
+	.power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
+	.fifo_mode = ADXL_FIFO_STREAM,
+};
+#endif
+
 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
 static struct platform_device rtc_device = {
 	.name = "rtc-bfin",
@@ -628,6 +665,14 @@ static struct bfin5xx_spi_chip spidev_chip_info = {
 };
 #endif
 
+#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
+static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
+	.enable_dma = 0,         /* use dma transfer with this chip*/
+	.bits_per_word = 8,
+	.cs_change_per_word = 0,
+};
+#endif
+
 static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #if defined(CONFIG_MTD_M25P80) \
 	|| defined(CONFIG_MTD_M25P80_MODULE)
@@ -653,15 +698,15 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 	},
 #endif
 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
-{
-	.modalias		= "ad7877",
-	.platform_data		= &bfin_ad7877_ts_info,
-	.irq			= IRQ_PB4,	/* old boards (<=Rev 1.3) use IRQ_PJ11 */
-	.max_speed_hz		= 12500000,     /* max spi clock (SCK) speed in HZ */
-	.bus_num		= 0,
-	.chip_select  		= 2,
-	.controller_data = &spi_ad7877_chip_info,
-},
+	{
+		.modalias		= "ad7877",
+		.platform_data		= &bfin_ad7877_ts_info,
+		.irq			= IRQ_PB4,	/* old boards (<=Rev 1.3) use IRQ_PJ11 */
+		.max_speed_hz		= 12500000,     /* max spi clock (SCK) speed in HZ */
+		.bus_num		= 0,
+		.chip_select  		= 2,
+		.controller_data = &spi_ad7877_chip_info,
+	},
 #endif
 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
 	{
@@ -672,8 +717,19 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 		.controller_data = &spidev_chip_info,
 	},
 #endif
+#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
+	{
+		.modalias		= "adxl34x",
+		.platform_data		= &adxl34x_info,
+		.irq			= IRQ_PC5,
+		.max_speed_hz		= 5000000,     /* max spi clock (SCK) speed in HZ */
+		.bus_num		= 1,
+		.chip_select  		= 2,
+		.controller_data = &spi_adxl34x_chip_info,
+		.mode = SPI_MODE_3,
+	},
+#endif
 };
-
 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
 /* SPI (0) */
 static struct resource bfin_spi0_resource[] = {
@@ -797,6 +853,13 @@ static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
 		.irq = 212,
 	},
 #endif
+#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
+	{
+		I2C_BOARD_INFO("adxl34x", 0x53),
+		.irq = IRQ_PC5,
+		.platform_data = (void *)&adxl34x_info,
+	},
+#endif
 };
 #endif
 
-- 
1.6.3.1


  parent reply	other threads:[~2009-06-05  8:22 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05  8:04 [PATCH 00/62] Blackfin arch updates for 2.6.31 Mike Frysinger
2009-06-05  8:04 ` [PATCH 01/62] Blackfin: add comment for anomaly 05000171 to init code Mike Frysinger
2009-06-05  8:04 ` [PATCH 02/62] Blackfin: add some help text to the EBIU_AMBCTL settings Mike Frysinger
2009-06-05  8:04 ` [PATCH 03/62] Blackfin: bf527-ezkit: add support for mmc-spi Mike Frysinger
2009-06-05  8:04 ` [PATCH 04/62] Blackfin: Allow bf548 ATAPI to be routed to GPIO Mike Frysinger
2009-06-05  8:04 ` [PATCH 05/62] Blackfin: allow scheduler functions to be placed into L1 Mike Frysinger
2009-06-05  8:04 ` [PATCH 06/62] Blackfin: fix link failure due to CONFIG_EXCEPTION_L1_SCRATCH Mike Frysinger
2009-06-05  8:04 ` [PATCH 07/62] Blackfin: fix data cache flushing when doing icache flushing Mike Frysinger
2009-06-05  8:04 ` [PATCH 08/62] Blackfin: fix bug found by traps test case 21 Mike Frysinger
2009-06-05  8:04 ` [PATCH 09/62] Blackfin: fix parentheses balance and convert some tab/space mixing Mike Frysinger
2009-06-05  8:04 ` [PATCH 10/62] Blackfin: fix warnings with I/O port macros Mike Frysinger
2009-06-05  8:04 ` [PATCH 11/62] Blackfin: merge Philippe's recent ipipe patch Mike Frysinger
2009-06-05  8:04 ` [PATCH 12/62] Blackfin: fix up PATA resource handling in bf537-stamp Mike Frysinger
2009-06-05  8:04 ` [PATCH 13/62] Blackfin: pull updated anomaly lists from toolchain Mike Frysinger
2009-06-05  8:04 ` [PATCH 14/62] Blackfin: do not error if GPIO IRQ is requested already as GPIO Mike Frysinger
2009-06-05  8:04 ` [PATCH 15/62] Blackfin: set bf51x/bf52x to 0.0 rev by default and bf54x to 0.2 Mike Frysinger
2009-06-05  8:04 ` [PATCH 16/62] Blackfin: simplify the do_flush macro Mike Frysinger
2009-06-05  8:04 ` [PATCH 17/62] Blackfin: update defconfigs Mike Frysinger
2009-06-05  8:04 ` [PATCH 18/62] Blackfin: simplify BF561 coreb driver greatly Mike Frysinger
2009-06-05  8:04 ` [PATCH 19/62] Blackfin: fix detection of cached L2 SRAM Mike Frysinger
2009-06-05  8:04 ` [PATCH 20/62] Blackfin: add MDMA defines to make cross-variant coding easier Mike Frysinger
2009-06-05  8:04 ` [PATCH 21/62] Blackfin: fix early L1 relocation crash Mike Frysinger
2009-06-05  8:04 ` [PATCH 22/62] Blackfin: document anomaly 05000234 workaround Mike Frysinger
2009-06-05  8:04 ` [PATCH 23/62] Blackfin: annotate anomaly 05000119 in core DMA code Mike Frysinger
2009-06-05  8:04 ` [PATCH 24/62] Blackfin: punt useless GPIO init call Mike Frysinger
2009-06-05  8:04 ` [PATCH 25/62] Blackfin: work around anomaly 05000287 Mike Frysinger
2009-06-05  8:04 ` [PATCH 26/62] Blackfin: delete unused sys_getpagesize() function Mike Frysinger
2009-06-05  8:04 ` [PATCH 27/62] Blackfin: workaround anomaly 05000227 Mike Frysinger
2009-06-05  8:04 ` [PATCH 28/62] Blackfin: do not append newlines to panic() messages Mike Frysinger
2009-06-05  8:04 ` [PATCH 29/62] Blackfin: detect anomaly 05000274 Mike Frysinger
2009-06-05  8:04 ` [PATCH 30/62] Blackfin: BF518F-EZBRD: handle required portmuxing of async pins Mike Frysinger
2009-06-05  8:04 ` [PATCH 31/62] Blackfin: annotate anomaly 05000120 Mike Frysinger
2009-06-05  8:04 ` [PATCH 32/62] Blackfin: add support for gptimer0 as a tick source Mike Frysinger
2009-06-05  8:04 ` [PATCH 33/62] Blackfin: add workaround for anomaly 05000287 Mike Frysinger
2009-06-05  8:04 ` [PATCH 34/62] Blackfin: make sure MPU CPLB for first 1k is marked as valid Mike Frysinger
2009-06-05  8:04 ` [PATCH 35/62] Blackfin: rename some Blackfin drivers Mike Frysinger
2009-06-05  8:04 ` [PATCH 36/62] Blackfin: work around anomaly 05000220 Mike Frysinger
2009-06-05  8:04 ` [PATCH 37/62] Blackfin: add note about anomaly 05000242 being worked around Mike Frysinger
2009-06-05  8:04 ` [PATCH 38/62] Blackfin: make deferred hardware errors more exact Mike Frysinger
2009-06-05  8:04 ` [PATCH 39/62] Blackfin: make sure stack is accessible before dumping it Mike Frysinger
2009-06-05  8:04 ` [PATCH 40/62] Blackfin: add workaround for anomaly 05000461 Mike Frysinger
2009-06-05  8:04 ` [PATCH 41/62] Blackfin: include system/processor info in dump messages Mike Frysinger
2009-06-05  8:04 ` [PATCH 42/62] Blackfin: update gptimers API Mike Frysinger
2009-06-05  8:04 ` [PATCH 43/62] Blackfin: drop unused reserve_pda() function Mike Frysinger
2009-06-05  8:04 ` [PATCH 44/62] Blackfin: merge sram init functions Mike Frysinger
2009-06-05  8:04 ` [PATCH 45/62] Blackfin: fix handling of initial L1 reservation Mike Frysinger
2009-06-05  8:04 ` [PATCH 46/62] Blackfin: fix command line corruption with DEBUG_DOUBLEFAULT Mike Frysinger
2009-06-05  8:04 ` [PATCH 47/62] Blackfin: override default uClinux MTD addr/size Mike Frysinger
2009-06-05  8:04 ` Mike Frysinger [this message]
2009-06-05  8:04 ` [PATCH 49/62] Blackfin: convert SMP to only use generic time framework Mike Frysinger
2009-06-05  8:04 ` [PATCH 50/62] Blackfin: add SSYNC to set_dma_sg() for descriptor fetching Mike Frysinger
2009-06-05  8:05 ` [PATCH 51/62] Blackfin: check SIC defines rather than variant names Mike Frysinger
2009-06-05  8:05 ` [PATCH 52/62] Blackfin: rename Blackfin relocs according to the toolchain Mike Frysinger
2009-06-05  8:05 ` [PATCH 53/62] Blackfin: document the lsl variants of the L1 allocator Mike Frysinger
2009-06-05  8:05 ` [PATCH 54/62] Blackfin: convert early_printk EVT init to a loop Mike Frysinger
2009-06-05  8:05 ` [PATCH 55/62] Blackfin: add missing access_ok() checks to user functions Mike Frysinger
2009-06-05  8:05 ` [PATCH 56/62] Blackfin: punt duplicated search_exception_table() prototype Mike Frysinger
2009-06-05  8:05 ` [PATCH 57/62] Blackfin: push access_ok() L1 attribute down Mike Frysinger
2009-06-05  8:05 ` [PATCH 58/62] Blackfin: kgdb: fix up error return values Mike Frysinger
2009-06-05  8:05 ` [PATCH 59/62] Blackfin: fix length checking in kgdb_ebin2mem Mike Frysinger
2009-06-05  8:05 ` [PATCH 60/62] Blackfin: export the last exception cause via debugfs Mike Frysinger
2009-06-05  8:05 ` [PATCH 61/62] Blackfin: fix unused warnings after nommu update Mike Frysinger
2009-06-05  8:05 ` [PATCH 62/62] Blackfin: fix sparseirq/kstat_irqs fallout Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1244189111-19639-49-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®