ASoC: msm: Moving the gpio request and free in probe and exit.
Move the request and free of gpio lines while enabling the
level shifter to the probe and the exit of the cs8427 chip.
Mark the prtd pointer as null in the capture close.
Change-Id: I59d583dce314ffc3ad1eb032c53da8580b65d001
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8064.c b/arch/arm/mach-msm/board-8064.c
index c6bcb6b..3a1965a 100644
--- a/arch/arm/mach-msm/board-8064.c
+++ b/arch/arm/mach-msm/board-8064.c
@@ -1257,29 +1257,20 @@
* clock is running at 100KHz and voltage levels are at 3.3
* and 5 volts
*/
-static int enable_100KHz_ls(int enable)
+static int enable_100KHz_ls(int enable, int gpio)
{
- int ret = 0;
- if (enable) {
- ret = gpio_request(SX150X_GPIO(1, 10),
- "cs8427_100KHZ_ENABLE");
- if (ret) {
- pr_err("%s: Failed to request gpio %d\n", __func__,
- SX150X_GPIO(1, 10));
- return ret;
- }
- gpio_direction_output(SX150X_GPIO(1, 10), 1);
- } else {
- gpio_direction_output(SX150X_GPIO(1, 10), 0);
- gpio_free(SX150X_GPIO(1, 10));
- }
- return ret;
+ if (enable)
+ gpio_direction_output(gpio, 1);
+ else
+ gpio_direction_output(gpio, 0);
+ return 0;
}
static struct cs8427_platform_data cs8427_i2c_platform_data = {
.irq = SX150X_GPIO(1, 4),
.reset_gpio = SX150X_GPIO(1, 6),
.enable = enable_100KHz_ls,
+ .ls_gpio = SX150X_GPIO(1, 10),
};
static struct i2c_board_info cs8427_device_info[] __initdata = {