Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227185
b: refs/heads/master
c: cd8ab00
h: refs/heads/master
i:
  227183: 559cb75
v: v3
  • Loading branch information
Tony SIM authored and Paul Mundt committed Dec 13, 2010
1 parent 3ba969f commit 13e98d3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 80f1dc7cc9341b160beb9c833edc1cd131f45a7f
refs/heads/master: cd8ab0041d131e8e210c4b5ded7257da50473dcb
38 changes: 38 additions & 0 deletions trunk/arch/arm/mach-shmobile/board-mackerel.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/mtd/physmap.h>
#include <linux/smsc911x.h>
#include <linux/sh_intc.h>
#include <linux/tca6416_keypad.h>
#include <linux/usb/r8a66597.h>

#include <video/sh_mobile_lcdc.h>
Expand Down Expand Up @@ -413,11 +414,44 @@ static struct platform_device *mackerel_devices[] __initdata = {
&fsi_ak4643_device,
};

/* Keypad Initialization */
#define KEYPAD_BUTTON(ev_type, ev_code, act_low) \
{ \
.type = ev_type, \
.code = ev_code, \
.active_low = act_low, \
}

#define KEYPAD_BUTTON_LOW(event_code) KEYPAD_BUTTON(EV_KEY, event_code, 1)

static struct tca6416_button mackerel_gpio_keys[] = {
KEYPAD_BUTTON_LOW(KEY_HOME),
KEYPAD_BUTTON_LOW(KEY_MENU),
KEYPAD_BUTTON_LOW(KEY_BACK),
KEYPAD_BUTTON_LOW(KEY_POWER),
};

static struct tca6416_keys_platform_data mackerel_tca6416_keys_info = {
.buttons = mackerel_gpio_keys,
.nbuttons = ARRAY_SIZE(mackerel_gpio_keys),
.rep = 1,
.use_polling = 0,
.pinmask = 0x000F,
};

/* I2C */
#define IRQ9 evt2irq(0x0320)

static struct i2c_board_info i2c0_devices[] = {
{
I2C_BOARD_INFO("ak4643", 0x13),
},
/* Keypad */
{
I2C_BOARD_INFO("tca6408-keys", 0x20),
.platform_data = &mackerel_tca6416_keys_info,
.irq = IRQ9,
},
};

#define IRQ21 evt2irq(0x32a0)
Expand Down Expand Up @@ -525,6 +559,10 @@ static void __init mackerel_init(void)

intc_set_priority(IRQ_FSI, 3); /* irq priority FSI(3) > SMSC911X(2) */

/* enable Keypad */
gpio_request(GPIO_FN_IRQ9_42, NULL);
set_irq_type(IRQ9, IRQ_TYPE_LEVEL_HIGH);

/* enable Accelerometer */
gpio_request(GPIO_FN_IRQ21, NULL);
set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH);
Expand Down

0 comments on commit 13e98d3

Please sign in to comment.