On Sat, Aug 30, 2008 at 08:16:12PM +0300, Felipe Balbi wrote:
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/input.h>
> +#include <linux/interrupt.h>
> +#include <linux/delay.h>
> +#include <linux/spi/spi.h>
> +
> +#ifdef CONFIG_ARCH_OMAP
> +#include <mach/gpio.h>
> +#endif
#include <linux/gpio.h> ?
If this driver depends on having gpio, shouldn't that be reflected in the
Kconfig entry? ...
> +static int __devinit tsc2005_ts_init(struct tsc2005 *ts,
> + struct tsc2005_platform_data *pdata)
> +{
> + struct input_dev *idev;
> + int dav_gpio, r;
> + int x_max, y_max;
> + int x_fudge, y_fudge, p_fudge;
> +
> + if (pdata->dav_gpio < 0) {
> + dev_err(&ts->spi->dev, "need DAV GPIO");
> + return -EINVAL;
> + }
> + dav_gpio = pdata->dav_gpio;
> + ts->dav_gpio = dav_gpio;
> + dev_dbg(&ts->spi->dev, "TSC2005: DAV GPIO = %d\n", dav_gpio);
> +
> +#ifdef CONFIG_ARCH_OMAP
> + r = omap_request_gpio(dav_gpio);
> + if (r < 0) {
> + dev_err(&ts->spi->dev, "unable to get DAV GPIO");
> + goto err1;
> + }
> + omap_set_gpio_direction(dav_gpio, 1);
> + ts->irq = OMAP_GPIO_IRQ(dav_gpio);
In fact, this driver requires ARCH_OMAP to set ts->irq, otherwise
it's uninitialized.
> + dev_dbg(&ts->spi->dev, "TSC2005: DAV IRQ = %d\n", ts->irq);
> +#endif
Can this be converted to the generic gpio stuff?
> + init_timer(&ts->penup_timer);
> + setup_timer(&ts->penup_timer, tsc2005_ts_penup_timer_handler,
> + (unsigned long)ts);
setup_timer() does init_timer() so the first line is redundant.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html