Skip to content

Commit

Permalink
sh: Add KEYSC support for EcoVec24
Browse files Browse the repository at this point in the history
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Kuninori Morimoto authored and Paul Mundt committed Sep 15, 2009
1 parent 1f85d38 commit e9103e7
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions arch/sh/boards/mach-ecovec24/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
#include <linux/delay.h>
#include <linux/usb/r8a66597.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <video/sh_mobile_lcdc.h>
#include <media/sh_mobile_ceu.h>
#include <asm/heartbeat.h>
#include <asm/sh_eth.h>
#include <asm/sh_keysc.h>
#include <cpu/sh7724.h>

/*
Expand Down Expand Up @@ -332,6 +334,46 @@ static struct i2c_board_info i2c1_devices[] = {
},
};

/* KEYSC */
static struct sh_keysc_info keysc_info = {
.mode = SH_KEYSC_MODE_1,
.scan_timing = 3,
.delay = 50,
.kycr2_delay = 100,
.keycodes = { KEY_1, 0, 0, 0, 0,
KEY_2, 0, 0, 0, 0,
KEY_3, 0, 0, 0, 0,
KEY_4, 0, 0, 0, 0,
KEY_5, 0, 0, 0, 0,
KEY_6, 0, 0, 0, 0, },
};

static struct resource keysc_resources[] = {
[0] = {
.name = "KEYSC",
.start = 0x044b0000,
.end = 0x044b000f,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 79,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device keysc_device = {
.name = "sh_keysc",
.id = 0, /* keysc0 clock */
.num_resources = ARRAY_SIZE(keysc_resources),
.resource = keysc_resources,
.dev = {
.platform_data = &keysc_info,
},
.archdata = {
.hwblk_id = HWBLK_KEYSC,
},
};

static struct platform_device *ecovec_devices[] __initdata = {
&heartbeat_device,
&nor_flash_device,
Expand All @@ -341,6 +383,7 @@ static struct platform_device *ecovec_devices[] __initdata = {
&lcdc_device,
&ceu0_device,
&ceu1_device,
&keysc_device,
};

#define EEPROM_ADDR 0x50
Expand Down Expand Up @@ -584,6 +627,15 @@ static int __init arch_setup(void)
gpio_request(GPIO_FN_VIO1_CLK, NULL);
platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20);

/* enable KEYSC */
gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
gpio_request(GPIO_FN_KEYOUT4_IN6, NULL);
gpio_request(GPIO_FN_KEYOUT3, NULL);
gpio_request(GPIO_FN_KEYOUT2, NULL);
gpio_request(GPIO_FN_KEYOUT1, NULL);
gpio_request(GPIO_FN_KEYOUT0, NULL);
gpio_request(GPIO_FN_KEYIN0, NULL);

/* enable I2C device */
i2c_register_board_info(1, i2c1_devices,
ARRAY_SIZE(i2c1_devices));
Expand Down

0 comments on commit e9103e7

Please sign in to comment.