/*
- * drivers/input/touchscreen/xpt2046_ts.c - driver for rk2818 spi xpt2046 device and console
+ * drivers/input/touchscreen/xpt2046_ts.c - driver for rk29 spi xpt2046 device and console
*
- * Copyright (C) 2010 ROCKCHIP, Inc.
+ * Copyright (C) 2011 ROCKCHIP, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
struct spi_transfer xfer[4];
};
-static struct xpt2046_platform_data xpt2046_info = {
- .model = 2046,
- .keep_vref_on = 1,
- .swap_xy = 0,
- .x_min = 0,
- .x_max = 320,
- .y_min = 0,
- .y_max = 480,
- .debounce_max = 7,
- .debounce_rep = DEBOUNCE_REPTIME,
- .debounce_tol = 20,
- .gpio_pendown = RK2818_PIN_PE1,//RK2818_PIN_PE3, //modify by zhao
- .penirq_recheck_delay_usecs = 1,
-
-};
-
//add by zhao
#define LEN_TO_PIX(x) (unsigned int)( 320 * (x) / 47 )
#define KEY1_X 6.3
{KEY1_LEFT, KEY1_RIGHT, KEY_HOME, 0},
{KEY2_LEFT, KEY2_RIGHT, KEY_MENU, 0},
{KEY3_LEFT, KEY3_RIGHT, KEY_BACK, 0},
-{KEY4_LEFT, KEY4_RIGHT, KEY_FIND, 0},
+{KEY4_LEFT, KEY4_RIGHT, KEY_SEARCH, 0},
};
//end by zhao
return err;
}
+ err = gpio_direction_input(pdata->gpio_pendown);
+ if (err) {
+ dev_err(&spi->dev, "failed to switch GPIO to input%d\n",
+ pdata->gpio_pendown);
+ return err;
+ }
+
+ gpio_pull_updown(pdata->gpio_pendown,GPIOPullUp);
+
ts->gpio_pendown = pdata->gpio_pendown;
return 0;
}