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); }
static int __init cyttsp4_debug_init(void) { int rc = 0; int i, j; /* Check for invalid or duplicate core_ids */ for (i = 0; i < num_core_ids; i++) { if (!strlen(core_ids[i])) { pr_err("%s: core_id %d is empty\n", __func__, i+1); return -EINVAL; } for (j = i+1; j < num_core_ids; j++) if (!strcmp(core_ids[i], core_ids[j])) { pr_err("%s: core_ids %d and %d are same\n", __func__, i+1, j+1); return -EINVAL; } } for (i = 0; i < num_core_ids; i++) { cyttsp4_debug_infos[i].name = cyttsp4_debug_name; cyttsp4_debug_infos[i].core_id = core_ids[i]; cyttsp4_debug_infos[i].platform_data = &_cyttsp4_debug_platform_data; pr_info("%s: Registering debug device for core_id: %s\n", __func__, cyttsp4_debug_infos[i].core_id); rc = cyttsp4_register_device(&cyttsp4_debug_infos[i]); if (rc < 0) { pr_err("%s: Error, failed registering device\n", __func__); goto fail_unregister_devices; } } rc = cyttsp4_register_driver(&cyttsp4_debug_driver); if (rc) { pr_err("%s: Error, failed registering driver\n", __func__); goto fail_unregister_devices; } pr_info("%s: Cypress TTSP Debug (Built %s) rc=%d\n", __func__, CY_DRIVER_DATE, rc); return 0; fail_unregister_devices: for (i--; i <= 0; i--) { cyttsp4_unregister_device(cyttsp4_debug_infos[i].name, cyttsp4_debug_infos[i].core_id); pr_info("%s: Unregistering device access device for core_id: %s\n", __func__, cyttsp4_debug_infos[i].core_id); } return rc; }
static int __init cyttsp4_debug_init(void) { int rc1; int rc2; rc1 = cyttsp4_register_device(&cyttsp4_debug_device); if (rc1) return -ENODEV; rc2 = cyttsp4_register_driver(&cyttsp4_debug_driver); if (rc2) { cyttsp4_unregister_device(&cyttsp4_debug_device); return -ENODEV; } pr_info("%s: %s (Built %s @ %s),rc1=%d rc2=%d\n", __func__, "Cypress TTSP Debug", __DATE__, __TIME__, rc1, rc2); return 0; }