#include <mach/board.h>
#define RK2926_TB_DEFAULT_CONFIG
-
+//#define RK2926_SDK_DEFAULT_CONFIG
+enum {
+ WIFI_NONE = 0,
+ WIFI_USB_NONE = 1<<4,
+ //here: add usb wifi type
+ WIFI_USB_MAX,
+ WIFI_SDIO_NONE = 1<<8,
+ //here: add sdio wifi type
+ WIFI_SDIO_MAX,
+};
+/* android paramter */
+enum {
+ DEF_AP_MDM = -1,
+ DEF_AP_HAS_ALSA = -1,
+ DEF_AP_MULTI_CARD = -1,
+ DEF_AP_DATA_ONLY = -1,
+};
+/**************************** rk2926 top board ******************************/
#if defined(RK2926_TB_DEFAULT_CONFIG)
/* keyboard */
enum{
};
/* wifi */
enum {
- WIFI_NONE = 0,
- WIFI_USB_NONE = 1<<4,
- //here: add usb wifi type
- WIFI_USB_MAX,
- WIFI_SDIO_NONE = 1<<8,
- //here: add sdio wifi type
- WIFI_SDIO_MAX,
+ DEF_WIFI_RST = -1,
+ DEF_WIFI_PWR = -1,
+ DEF_WIFI_TYPE = WIFI_NONE,
+};
+/* rtc */
+enum {
+ DEF_RTC_I2C = 0,
+ DEF_RTC_ADDR = 0x51,
+ DEF_RTC_IRQ = -1,
+};
+/* charge */
+enum {
+ DEF_CHG_ADC = 0,
+ DEF_DC_DET = -1,
+ DEF_BAT_LOW = -1,
+ DEF_CHG_OK = -1,
+ DEF_CHG_SET = -1,
+ DEF_CHG_SEL = -1,
+};
+
+/* global */
+enum {
+ DEF_PWR_ON = 0x000001a2,
+};
+
+/**************************** rk2926 sdk(m713) ******************************/
+#elif defined(RK2926_SDK_DEFAULT_CONFIG)
+/* keyboard */
+enum{
+ DEF_KEY_ADC = 1,
+ DEF_PLAY_KEY = 0x000101a4,
+ DEF_VOLDN_KEY = 512 | (1<<31),
+ DEF_VOLUP_KEY = 1 | (1<<31),
+ DEF_MENU_KEY = 0 | (1<<31),
+ DEF_ESC_KEY = 0 | (1<<31),
+ DEF_HOME_KEY = 0 | (1<<31),
+ DEF_CAM_KEY = 0 | (1<<31),
+};
+/* backlight */
+enum{
+ DEF_BL_PWM = 0,
+ DEF_BL_REF = 0,
+ DEF_BL_MIN = 80,
+ DEF_BL_EN = 0x000001b0,
+};
+/* lcd */
+enum {
+ DEF_LCD_CABC = -1,
+ DEF_LCD_EN = 0x000101b3,
+ DEF_LCD_STD = -1,
+};
+
+#define DEF_LCD_PARAM {SCREEN_RGB, OUT_P666, \
+ 33000000, 15000000, \
+ 30, 10, 800, 210, \
+ 13, 10, 480, 22, \
+ 154, 85, \
+ 1, 0 }
+/* gsensor */
+enum {
+ GS_TYPE_NONE = 0,
+ GS_TYPE_MMA8452,
+ GS_TYPE_MMA7660,
+ GS_TYPE_MAX,
};
+enum {
+ DEF_GS_TYPE = GS_TYPE_MMA7660,
+ DEF_GS_I2C = 1,
+ DEF_GS_ADDR = 0x4c,
+ DEF_GS_IRQ = 0x008001b2,
+ DEF_GS_PWR = -1,
+};
+#define DEF_GS_ORIG {-1, 0, 0, 0, 0, -1, 0, 1, 0}
+/* pwm regulator */
+enum {
+ DEF_REG_PWM = 1,
+};
+/* pmic */
+enum {
+ DEF_PMIC_TYPE = PMIC_TYPE_ACT8931,
+ DEF_PMIC_SLP = 0x000001a1,
+ DEF_PMIC_IRQ = 0x000001b1,
+ DEF_PMIC_I2C = 0,
+ DEF_PMIC_ADDR = 0x5b,
+};
+/* ion */
+enum {
+ DEF_ION_SIZE = 80 * 1024 * 1024,
+};
+/* codec */
+enum {
+ DEF_SPK_CTL = 0x000001a0,
+ DEF_HP_DET = -1,
+};
+/* sdmmc */
+enum {
+ DEF_SD_DET = 0x000102a7,
+};
+/* wifi */
enum {
DEF_WIFI_RST = -1,
DEF_WIFI_PWR = -1,
enum {
DEF_RTC_I2C = 0,
DEF_RTC_ADDR = 0x51,
- DEF_RTC_IRQ = -1,
+ DEF_RTC_IRQ = 0x008001a5,
};
/* charge */
enum {
enum {
DEF_PWR_ON = 0x000001a2,
};
+/**************************** other ******************************/
#else
/* keyboard */
enum{
DEF_SD_DET = -1,
};
/* wifi */
-enum {
- WIFI_NONE = 0,
- WIFI_USB_NONE = 1<<4,
- //here: add usb wifi type
- WIFI_USB_MAX,
- WIFI_SDIO_NONE = 1<<8,
- //here: add sdio wifi type
- WIFI_SDIO_MAX,
-};
-
enum {
DEF_WIFI_RST = -1,
DEF_WIFI_PWR = -1,
#include <linux/slab.h> // to be compatible with linux kernel 3.2.15
#include <linux/gpio.h>
#include <mach/board.h>
+#ifdef CONFIG_RK_CONFIG
+#include <mach/config.h>
+#endif
#include <linux/input/mt.h>
#ifdef SITRONIX_MONITOR_THREAD
//#include <mach/gpio.h>
#endif // SITRONIX_MONITOR_THREAD
+#define TP_MODULE_NAME SITRONIX_I2C_TOUCH_DRV_NAME
+#ifdef CONFIG_RK_CONFIG
+
+enum {
+#ifdef RK2926_SDK_DEFAULT_CONFIG
+ DEF_EN = 1,
+#else
+ DEF_EN = 0,
+#endif
+ DEF_IRQ = 0x008001b0,
+ DEF_RST = 0X000001a3,
+ DEF_I2C = 2,
+ DEF_ADDR = 0x60,
+ DEF_X_MAX = 800,
+ DEF_Y_MAX = 480,
+};
+static int en = DEF_EN;
+module_param(en, int, 0644);
+
+static int irq = DEF_IRQ;
+module_param(irq, int, 0644);
+static int rst =DEF_RST;
+module_param(rst, int, 0644);
+
+static int i2c = DEF_I2C; // i2c channel
+module_param(i2c, int, 0644);
+static int addr = DEF_ADDR; // i2c addr
+module_param(addr, int, 0644);
+static int x_max = DEF_X_MAX;
+module_param(x_max, int, 0644);
+static int y_max = DEF_Y_MAX;
+module_param(y_max, int, 0644);
+
+static int tp_hw_init(void)
+{
+ int ret = 0;
+
+ ret = gpio_request(get_port_config(irq).gpio, "tp_irq");
+ if(ret < 0){
+ printk("%s: gpio_request(irq gpio) failed\n", __func__);
+ return ret;
+ }
+
+ ret = port_output_init(rst, 1, "tp_rst");
+ if(ret < 0){
+ printk("%s: port(rst) output init faild\n", __func__);
+ return ret;
+ }
+ mdelay(10);
+ port_output_off(rst);
+ mdelay(10);
+ port_output_on(rst);
+ msleep(300);
+
+ return 0;
+}
+#include "rk_tp.c"
+#endif
+
+
#define DRIVER_AUTHOR "Sitronix, Inc."
#define DRIVER_NAME "sitronix"
#define DRIVER_DESC "Sitronix I2C touch"
struct ft5x0x_platform_data *pdata;
uint8_t dev_status = 0;
+#ifdef CONFIG_RK_CONFIG
+ struct port_config irq_cfg = get_port_config(irq);
+
+ client->irq = irq_cfg.gpio;
+ tp_hw_init();
+#else
+ if(pdata->init_platform_hw)
+ pdata->init_platform_hw();
+#endif
printk("lr------> %s start ------\n", __FUNCTION__);
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
ret = -ENODEV;
mdelay(SITRONIX_TS_CHANGE_MODE_DELAY);
}
#endif
- if(pdata->init_platform_hw)
- pdata->init_platform_hw();
sitronix_ts_gpts = ts;
ts->max_touches = 5;
input_mt_init_slots(ts->input_dev, ts->max_touches);
-
+#ifdef CONFIG_RK_COFNIG
+ input_set_abs_params(ts->input_dev,ABS_MT_POSITION_X, 0, x_max, 0, 0);
+ input_set_abs_params(ts->input_dev,ABS_MT_POSITION_Y, 0, y_max, 0, 0);
+#else
input_set_abs_params(ts->input_dev,ABS_MT_POSITION_X, 0, 800, 0, 0);
input_set_abs_params(ts->input_dev,ABS_MT_POSITION_Y, 0, 480, 0, 0);
+#endif
input_set_abs_params(ts->input_dev,ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
for (i = 0; i < ARRAY_SIZE(initkey_code); i++) {
ts->suspend_state = 0;
if (client->irq){
-#ifdef SITRONIX_LEVEL_TRIGGERED
+ #ifdef CONFIG_RK_CONFIG
+ ret = request_irq(client->irq, sitronix_ts_irq_handler, irq_cfg.irq.irq_flags | IRQF_DISABLED, client->name, ts);
+ #else
+ #ifdef SITRONIX_LEVEL_TRIGGERED
ret = request_irq(client->irq, sitronix_ts_irq_handler, IRQF_TRIGGER_LOW | IRQF_DISABLED, client->name, ts);
-#else
+ #else
ret = request_irq(client->irq, sitronix_ts_irq_handler, IRQF_TRIGGER_FALLING | IRQF_DISABLED, client->name, ts);
-#endif // SITRONIX_LEVEL_TRIGGERED
+ #endif // SITRONIX_LEVEL_TRIGGERED
+ #endif // CONFIG_RK_CONFIG
if (ret == 0){
sitronix_ts_irq_on = 1;
ts->use_irq = 1;
int result;
int err = 0;
#endif // SITRONIX_FW_UPGRADE_FEATURE
+
+#ifdef CONFIG_RK_CONFIG
+ int ret = tp_board_init();
+
+ if(ret < 0)
+ return ret;
+#endif
printk("Sitronix touch driver %d.%d.%d\n", DRIVER_MAJOR, DRIVER_MINOR, DRIVER_PATCHLEVEL);
printk("Release date: %s\n", DRIVER_DATE);
#ifdef SITRONIX_FW_UPGRADE_FEATURE
}
device_create(sitronix_class, NULL, MKDEV(sitronix_major, 0), NULL, SITRONIX_I2C_TOUCH_DEV_NAME);
#endif // SITRONIX_FW_UPGRADE_FEATURE
+
+
return i2c_add_driver(&sitronix_ts_driver);
}