Commit aa523d75 authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Tony Lindgren

SPI: TSC2301: Switch to gpio_request/free calls

Signed-off-by: default avatarJarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 92930e33
...@@ -22,13 +22,10 @@ ...@@ -22,13 +22,10 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/spi/tsc2301.h> #include <linux/spi/tsc2301.h>
#ifdef CONFIG_ARCH_OMAP
#include <mach/gpio.h>
#endif
u16 tsc2301_read_reg(struct tsc2301 *tsc, int reg) u16 tsc2301_read_reg(struct tsc2301 *tsc, int reg)
{ {
struct spi_transfer t[2]; struct spi_transfer t[2];
...@@ -157,14 +154,12 @@ static int __devinit tsc2301_probe(struct spi_device *spi) ...@@ -157,14 +154,12 @@ static int __devinit tsc2301_probe(struct spi_device *spi)
if (pdata->reset_gpio >= 0) { if (pdata->reset_gpio >= 0) {
tsc->reset_gpio = pdata->reset_gpio; tsc->reset_gpio = pdata->reset_gpio;
#ifdef CONFIG_ARCH_OMAP r = gpio_request(tsc->reset_gpio, "TSC2301 reset");
r = omap_request_gpio(tsc->reset_gpio);
if (r < 0) if (r < 0)
goto err1; goto err1;
gpio_direction_output(tsc->reset_gpio, 1); gpio_direction_output(tsc->reset_gpio, 1);
mdelay(1); mdelay(1);
gpio_set_value(tsc->reset_gpio, 0); gpio_set_value(tsc->reset_gpio, 0);
#endif
} else } else
tsc->reset_gpio = -1; tsc->reset_gpio = -1;
...@@ -229,8 +224,10 @@ static int __devexit tsc2301_remove(struct spi_device *spi) ...@@ -229,8 +224,10 @@ static int __devexit tsc2301_remove(struct spi_device *spi)
struct tsc2301 *tsc = dev_get_drvdata(&spi->dev); struct tsc2301 *tsc = dev_get_drvdata(&spi->dev);
tsc2301_mixer_exit(tsc); tsc2301_mixer_exit(tsc);
tsc2301_ts_exit(tsc); tsc2301_ts_exit(tsc);
tsc2301_kp_exit(tsc); tsc2301_kp_exit(tsc);
if (tsc->reset_gpio >= 0)
gpio_free(tsc->reset_gpio);
kfree(tsc); kfree(tsc);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment