Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295900
b: refs/heads/master
c: 8d09a1b
h: refs/heads/master
v: v3
  • Loading branch information
Janusz Krzysztofik authored and Tony Lindgren committed Dec 22, 2011
1 parent 9a412b3 commit 463a800
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a218d19f6a91c076c7ed8a7c0082f777248c5394
refs/heads/master: 8d09a1bb3147ddbcf0a9483021ca699c54c54732
10 changes: 0 additions & 10 deletions trunk/arch/arm/mach-omap1/board-ams-delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,6 @@ static struct gpio latch_gpios[] __initconst = {
.flags = GPIOF_OUT_INIT_LOW,
.label = "dockit2",
},
{
.gpio = AMS_DELTA_GPIO_PIN_KEYBRD_PWR,
.flags = GPIOF_OUT_INIT_LOW,
.label = "keybrd_pwr",
},
{
.gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT,
.flags = GPIOF_OUT_INIT_LOW,
.label = "keybrd_dataout",
},
{
.gpio = AMS_DELTA_GPIO_PIN_SCARD_RSTIN,
.flags = GPIOF_OUT_INIT_LOW,
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/arm/plat-omap/include/plat/board-ams-delta.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

#if defined (CONFIG_MACH_AMS_DELTA)

#define AMD_DELTA_LATCH2_KEYBRD_PWR 0x0100
#define AMD_DELTA_LATCH2_KEYBRD_DATA 0x0200
#define AMD_DELTA_LATCH2_SCARD_RSTIN 0x0400
#define AMD_DELTA_LATCH2_SCARD_CMDVCC 0x0800
#define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000
Expand Down
56 changes: 35 additions & 21 deletions trunk/drivers/input/serio/ams_delta_serio.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,40 @@ static irqreturn_t ams_delta_serio_interrupt(int irq, void *dev_id)
static int ams_delta_serio_open(struct serio *serio)
{
/* enable keyboard */
ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR,
AMD_DELTA_LATCH2_KEYBRD_PWR);
gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 1);

return 0;
}

static void ams_delta_serio_close(struct serio *serio)
{
/* disable keyboard */
ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, 0);
gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 0);
}

static struct gpio ams_delta_gpios[] __initconst_or_module = {
{
.gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATA,
.flags = GPIOF_DIR_IN,
.label = "serio-data",
},
{
.gpio = AMS_DELTA_GPIO_PIN_KEYBRD_CLK,
.flags = GPIOF_DIR_IN,
.label = "serio-clock",
},
{
.gpio = AMS_DELTA_GPIO_PIN_KEYBRD_PWR,
.flags = GPIOF_OUT_INIT_LOW,
.label = "serio-power",
},
{
.gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT,
.flags = GPIOF_OUT_INIT_LOW,
.label = "serio-dataout",
},
};

static int __init ams_delta_serio_init(void)
{
int err;
Expand All @@ -123,27 +145,20 @@ static int __init ams_delta_serio_init(void)
strlcpy(ams_delta_serio->phys, "GPIO/serio0",
sizeof(ams_delta_serio->phys));

err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_DATA, "serio-data");
err = gpio_request_array(ams_delta_gpios,
ARRAY_SIZE(ams_delta_gpios));
if (err) {
pr_err("ams_delta_serio: Couldn't request gpio pin for data\n");
pr_err("ams_delta_serio: Couldn't request gpio pins\n");
goto serio;
}
gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_DATA);

err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_CLK, "serio-clock");
if (err) {
pr_err("ams_delta_serio: couldn't request gpio pin for clock\n");
goto gpio_data;
}
gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_CLK);

err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK),
ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING,
"ams-delta-serio", 0);
if (err < 0) {
pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n",
gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK));
goto gpio_clk;
goto gpio;
}
/*
* Since GPIO register handling for keyboard clock pin is performed
Expand All @@ -157,21 +172,20 @@ static int __init ams_delta_serio_init(void)
dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name);

return 0;
gpio_clk:
gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK);
gpio_data:
gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA);
gpio:
gpio_free_array(ams_delta_gpios,
ARRAY_SIZE(ams_delta_gpios));
serio:
kfree(ams_delta_serio);
return err;
}
late_initcall(ams_delta_serio_init);
module_init(ams_delta_serio_init);

static void __exit ams_delta_serio_exit(void)
{
serio_unregister_port(ams_delta_serio);
free_irq(OMAP_GPIO_IRQ(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0);
gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK);
gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA);
gpio_free_array(ams_delta_gpios,
ARRAY_SIZE(ams_delta_gpios));
}
module_exit(ams_delta_serio_exit);

0 comments on commit 463a800

Please sign in to comment.