Still need to find a solution to tsc2301-core.c....
Signed-off-by: Klaus Pedersen <klaus.k.pedersen@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
#define N800_BLIZZARD_POWERDOWN_GPIO 15
#define N800_STI_GPIO 62
#define N800_KEYB_IRQ_GPIO 109
+#define N800_DAV_IRQ_GPIO 103
+#define N800_TSC2301_RESET_GPIO 118
void __init nokia_n800_init_irq(void)
{
};
static struct tsc2301_platform_data tsc2301_config = {
- .reset_gpio = 118,
- .dav_gpio = 103,
+ .reset_gpio = N800_TSC2301_RESET_GPIO,
.keymap = {
-1, /* Event for bit 0 */
KEY_UP, /* Event for bit 1 (up) */
static void tsc2301_dev_init(void)
{
+ int r;
int gpio = N800_KEYB_IRQ_GPIO;
- if (omap_request_gpio(gpio) < 0) {
- printk(KERN_ERR "can't get KBIRQ GPIO\n");
- return;
+ r = gpio_request(gpio, "tsc2301 KBD IRQ");
+ if (r >= 0) {
+ gpio_direction_input(gpio);
+ tsc2301_config.keyb_int = OMAP_GPIO_IRQ(gpio);
+ } else {
+ printk(KERN_ERR "unable to get KBD GPIO");
+ }
+
+ gpio = N800_DAV_IRQ_GPIO;
+ r = gpio_request(gpio, "tsc2301 DAV IRQ");
+ if (r >= 0) {
+ gpio_direction_input(gpio);
+ tsc2301_config.dav_int = OMAP_GPIO_IRQ(gpio);
+ } else {
+ printk(KERN_ERR "unable to get DAV GPIO");
}
- omap_set_gpio_direction(gpio, 1);
- tsc2301_config.keyb_int = OMAP_GPIO_IRQ(gpio);
}
static struct omap2_mcspi_device_config tsc2301_mcspi_config = {
#include <linux/delay.h>
#include <linux/spi/spi.h>
-#ifdef CONFIG_ARCH_OMAP
-#include <asm/arch/gpio.h>
-#endif
-
#include <linux/spi/tsc2301.h>
#define TSC2301_KEYBOARD_PRODUCT_ID 0x0051
#include <linux/delay.h>
#include <linux/spi/spi.h>
-#ifdef CONFIG_ARCH_OMAP
-#include <asm/arch/gpio.h>
-#endif
-
#include <linux/spi/tsc2301.h>
/**
u8 disable_depth;
int hw_flags;
-
- s16 dav_gpio;
int irq;
};
{
struct tsc2301_ts *ts;
struct input_dev *idev;
- int dav_gpio, r;
+ int r;
int x_max, y_max;
int x_fudge, y_fudge, p_fudge;
- if (pdata->dav_gpio < 0) {
- dev_err(&tsc->spi->dev, "need DAV GPIO");
+ if (pdata->dav_int <= 0) {
+ dev_err(&tsc->spi->dev, "need DAV IRQ");
return -EINVAL;
}
- dav_gpio = pdata->dav_gpio;
ts = kzalloc(sizeof(*ts), GFP_KERNEL);
if (ts == NULL)
return -ENOMEM;
tsc->ts = ts;
- ts->dav_gpio = dav_gpio;
-#ifdef CONFIG_ARCH_OMAP
- r = omap_request_gpio(dav_gpio);
- if (r < 0) {
- dev_err(&tsc->spi->dev, "unable to get DAV GPIO");
- goto err1;
- }
- omap_set_gpio_direction(dav_gpio, 1);
- ts->irq = OMAP_GPIO_IRQ(dav_gpio);
-#endif
+ ts->irq = pdata->dav_int;
+
init_timer(&ts->penup_timer);
setup_timer(&ts->penup_timer, tsc2301_ts_timer_handler,
(unsigned long)tsc);
tsc2301_ts_stop_scan(tsc);
input_free_device(idev);
err2:
-#ifdef CONFIG_ARCH_OMAP
- omap_free_gpio(dav_gpio);
-#endif
-err1:
kfree(ts);
return r;
}
free_irq(ts->irq, tsc);
input_unregister_device(ts->idev);
-#ifdef CONFIG_ARCH_OMAP
- omap_free_gpio(ts->dav_gpio);
-#endif
kfree(ts);
}
MODULE_AUTHOR("Jarkko Oikarinen <jarkko.oikarinen@nokia.com>");
/*
* Touchscreen
*/
- s16 dav_gpio;
+ s16 dav_int;
u16 ts_x_plate_ohm;
u32 ts_stab_time; /* voltage settling time */
u8 ts_hw_avg; /* HW assiseted averaging. Can be