All of lore.kernel.org
 help / color / mirror / Atom feed
From: NISHIMOTO Hiroki <nishimoto.hiroki@renesas.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] sh: mach-ecovec24: Add motion sensor driver support
Date: Thu, 14 Jan 2010 09:53:09 +0000	[thread overview]
Message-ID: <4B4EE985.3090908@renesas.com> (raw)

This patch adds support for lis3lv02d motion sensor driver
that use i2c interface to the Ecovec board.

I tested the driver with 'evtest' which is available
from a below link.
http://beagleboard.googlecode.com/files/evtest.c

Signed-off-by: NISHIMOTO Hiroki <nishimoto.hiroki@renesas.com>
---
arch/sh/boards/mach-ecovec24/setup.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/sh/boards/mach-ecovec24/setup.c
b/arch/sh/boards/mach-ecovec24/setup.c
index 6a8861b..2ea2df5 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -19,6 +19,7 @@
#include <linux/usb/r8a66597.h>
#include <linux/i2c.h>
#include <linux/i2c/tsc2007.h>
+#include <linux/lis3lv02d.h>
#include <linux/spi/spi.h>
#include <linux/spi/sh_msiof.h>
#include <linux/spi/mmc_spi.h>
@@ -349,10 +350,15 @@ static struct i2c_board_info i2c0_devices[] = {
},
};

+#define IRQ1 33
static struct i2c_board_info i2c1_devices[] = {
{
I2C_BOARD_INFO("r2025sd", 0x32),
},
+ {
+ I2C_BOARD_INFO("lis3lv02d", 0x1c),
+ .irq = IRQ1,
+ },
};

/* KEYSC */
@@ -1115,6 +1121,10 @@ static int __init arch_setup(void)
gpio_direction_output(GPIO_PTU0, 0);
mdelay(20);

+ /* enable motion sensor */
+ gpio_request(GPIO_FN_INTC_IRQ1, NULL);
+ gpio_direction_input(GPIO_FN_INTC_IRQ1);
+
/* enable I2C device */
i2c_register_board_info(0, i2c0_devices,
ARRAY_SIZE(i2c0_devices));
-- 
1.6.3.3



             reply	other threads:[~2010-01-14  9:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-14  9:53 NISHIMOTO Hiroki [this message]
2010-01-14 23:29 ` [PATCH] sh: mach-ecovec24: Add motion sensor driver support Paul Mundt

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=4B4EE985.3090908@renesas.com \
    --to=nishimoto.hiroki@renesas.com \
    --cc=linux-sh@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.