void __init board_tsp_init(void) { int ret = 0; printk("[TSP] board_tsp_init + \n"); ret = gpio_request(CYTTSP4_I2C_IRQ_GPIO, NULL); if(!ret) { gpio_tlmm_config(GPIO_CFG(CYTTSP4_I2C_IRQ_GPIO, 0, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE); } else { printk("gpio CYTTSP4_I2C_IRQ_GPIO request fail!\n"); } i2c_register_board_info(MSM_8930_GSBI3_QUP_I2C_BUS_ID, touch_i2c_devices, ARRAY_SIZE(touch_i2c_devices)); cyttsp4_register_core_device(&cyttsp4_core_info); cyttsp4_register_device(&cyttsp4_mt_info); #if defined(CONFIG_TOUCHSCREEN_CYPRESS_TMA46X_SUPPORT_BUTTON) cyttsp4_register_device(&cyttsp4_btn_info); #endif printk("[TSP] board_tsp_init - \n"); }
void __init board_tsp_init(void) { int ret = 0; printk("[TSP] board_tsp_init\n"); ret = gpio_request(TSP_INT, "cyttsp4_tsp_int"); if(!ret) gpio_direction_input(TSP_INT); else printk("gpio request fail!\n"); if(gpio_request(MFP_PIN_GPIO87, "cyttsp4_tsp_scl")) { printk(KERN_ERR "Request GPIO failed," "gpio: %d \n", TSP_SCL); } if(gpio_request(MFP_PIN_GPIO88, "cyttsp4_tsp_sda")) { printk(KERN_ERR "Request GPIO failed," "gpio: %d \n", TSP_SDA); } if (gpio_request(KEY_LED_GPIO, "key_led_gpio")) { printk(KERN_ERR "Request GPIO failed," "gpio: %d \n", KEY_LED_GPIO); } cyttsp4_register_core_device(&cyttsp4_core_info); cyttsp4_register_device(&cyttsp4_mt_info); cyttsp4_register_device(&cyttsp4_btn_info); }
void __init board_tsp_init(void) { //int gpio; //int rc; printk("[TSP] board_tsp_init\n"); /*turn on NLSX4373*/ #if 0 gpio = NLSX4373_EN_GPIO; rc = gpio_request(gpio, "tsp_nlsx4373"); if (rc < 0) { printk(KERN_ERR "unable to request GPIO pin %d for tsp_nlsx4373\n", gpio); return -1; } gpio_direction_output(gpio, 1); #endif /* rc = gpio_request(CYTTSP4_I2C_IRQ_GPIO, NULL); if (rc < 0) { gpio_free(CYTTSP4_I2C_IRQ_GPIO); rc = gpio_request(CYTTSP4_I2C_IRQ_GPIO,NULL); } if (rc < 0) printk("[TSP] %s: Fail request gpio=%d\n",__func__, CYTTSP4_I2C_IRQ_GPIO); else gpio_direction_input(CYTTSP4_I2C_IRQ_GPIO); cyttsp4_hw_power(0, CYTTSP4_I2C_IRQ_GPIO); cyttsp4_hw_power(1, CYTTSP4_I2C_IRQ_GPIO); *///c.h.hong cyttsp4_hw_power(0, false, 0); msleep(20); /* it can be 10 ~ 20 ms */ cyttsp4_hw_power(1, false, 0); msleep(20); /* it can be 10 ~ 20 ms */ printk(KERN_INFO"[TSP] naples_tsp_init() is called\n"); cyttsp4_register_core_device(&cyttsp4_core_info); cyttsp4_register_device(&cyttsp4_mt_info); cyttsp4_register_device(&cyttsp4_btn_info); }