Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161255
b: refs/heads/master
c: b833306
h: refs/heads/master
i:
  161253: 539366e
  161251: b63e494
  161247: 1f975a7
v: v3
  • Loading branch information
Marek Vasut authored and Dmitry Torokhov committed Jul 21, 2009
1 parent 47d7834 commit 3846285
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 20 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: b7788c5ff9e7676dc98ca6dce437ae16b79c6726
refs/heads/master: b833306febc7d9b805a89aff29f1e410a64981c4
4 changes: 2 additions & 2 deletions trunk/drivers/input/touchscreen/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ config TOUCHSCREEN_WM97XX_ATMEL
be called atmel-wm97xx.

config TOUCHSCREEN_WM97XX_MAINSTONE
tristate "WM97xx Mainstone accelerated touch"
tristate "WM97xx Mainstone/Palm accelerated touch"
depends on TOUCHSCREEN_WM97XX && ARCH_PXA
help
Say Y here for support for streaming mode with WM97xx touchscreens
on Mainstone systems.
on Mainstone, Palm Tungsten T5, TX and LifeDrive systems.

If unsure, say N.

Expand Down
50 changes: 33 additions & 17 deletions trunk/drivers/input/touchscreen/mainstone-wm97xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
#include <linux/interrupt.h>
#include <linux/wm97xx.h>
#include <linux/io.h>
#include <linux/gpio.h>

#include <mach/regs-ac97.h>

#define VERSION "0.13"
#include <asm/mach-types.h>

struct continuous {
u16 id; /* codec id */
Expand Down Expand Up @@ -62,6 +64,7 @@ static const struct continuous cinfo[] = {
/* continuous speed index */
static int sp_idx;
static u16 last, tries;
static int irq;

/*
* Pen sampling frequency (Hz) in continuous mode.
Expand Down Expand Up @@ -171,7 +174,7 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm)

static int wm97xx_acc_startup(struct wm97xx *wm)
{
int idx = 0;
int idx = 0, ret = 0;

/* check we have a codec */
if (wm->ac97 == NULL)
Expand All @@ -191,18 +194,37 @@ static int wm97xx_acc_startup(struct wm97xx *wm)
"mainstone accelerated touchscreen driver, %d samples/sec\n",
cinfo[sp_idx].speed);

/* IRQ driven touchscreen is used on Palm hardware */
if (machine_is_palmt5() || machine_is_palmtx() || machine_is_palmld()) {
pen_int = 1;
irq = 27;
} else if (machine_is_mainstone() && pen_int)
irq = 4;

if (irq) {
ret = gpio_request(irq, "Touchscreen IRQ");
if (ret)
goto out;

ret = gpio_direction_input(irq);
if (ret) {
gpio_free(irq);
goto out;
}

wm->pen_irq = gpio_to_irq(irq);
set_irq_type(wm->pen_irq, IRQ_TYPE_EDGE_BOTH);
} else /* pen irq not supported */
pen_int = 0;

/* codec specific irq config */
if (pen_int) {
switch (wm->id) {
case WM9705_ID2:
wm->pen_irq = IRQ_GPIO(4);
set_irq_type(IRQ_GPIO(4), IRQ_TYPE_EDGE_BOTH);
break;
case WM9712_ID2:
case WM9713_ID2:
/* enable pen down interrupt */
/* use PEN_DOWN GPIO 13 to assert IRQ on GPIO line 2 */
wm->pen_irq = MAINSTONE_AC97_IRQ;
wm97xx_config_gpio(wm, WM97XX_GPIO_13, WM97XX_GPIO_IN,
WM97XX_GPIO_POL_HIGH,
WM97XX_GPIO_STICKY,
Expand All @@ -220,23 +242,17 @@ static int wm97xx_acc_startup(struct wm97xx *wm)
}
}

return 0;
out:
return ret;
}

static void wm97xx_acc_shutdown(struct wm97xx *wm)
{
/* codec specific deconfig */
if (pen_int) {
switch (wm->id & 0xffff) {
case WM9705_ID2:
wm->pen_irq = 0;
break;
case WM9712_ID2:
case WM9713_ID2:
/* disable interrupt */
wm->pen_irq = 0;
break;
}
if (irq)
gpio_free(irq);
wm->pen_irq = 0;
}
}

Expand Down

0 comments on commit 3846285

Please sign in to comment.