コード例 #1
0
static int cyttsp4_init(struct cyttsp4_core_platform_data *pdata,
		int on, struct device *dev)
{
	int irq_gpio = pdata->irq_gpio;
	int rc = 0;
#if 0
	if (on) {
		rc = gpio_request(irq_gpio, NULL);
		if (rc < 0) {
			gpio_free(irq_gpio);
			rc = gpio_request(irq_gpio, NULL);
		}
		if (rc < 0)
  			dev_err(dev, "%s: Fail request gpio=%d\n",
 					__func__, irq_gpio);
		else
			gpio_direction_input(irq_gpio);

		cyttsp4_hw_power(1, false, 0);
	} else {
		cyttsp4_hw_power(0, false, 0);
		gpio_free(irq_gpio);
	}

#else
	if (on)
		cyttsp4_hw_power(1, false, 0);
	else
		cyttsp4_hw_power(0, false, 0);
#endif
	dev_info(dev, "%s: INIT CYTTSP IRQ gpio=%d r=%d\n",
			__func__, irq_gpio, rc);

	return rc;
}
static int cyttsp4_sleep(struct cyttsp4_core_platform_data *pdata,
                         struct device *dev, atomic_t *ignore_irq)
{
    int irq_gpio = pdata->irq_gpio;

#if defined(CONFIG_MACH_CS05)
    return cyttsp4_hw_power(2, true, irq_gpio);
#else
    return cyttsp4_hw_power(0, true, irq_gpio);
#endif
}
static int cyttsp4_xres(struct cyttsp4_core_platform_data *pdata,
                        struct device *dev)
{
    int irq_gpio = pdata->irq_gpio;
    int rc = 0;

    cyttsp4_hw_power(0, true, irq_gpio);

    cyttsp4_hw_power(1, true, irq_gpio);

    return rc;
}
static int cyttsp4_init(struct cyttsp4_core_platform_data *pdata,
                        int on, struct device *dev)
{
    int rc = 0;

    if (on) {
        cyttsp4_hw_power(1, false, 0);
    } else {
        cyttsp4_hw_power(0, false, 0);
    }

    return rc;
}
コード例 #5
0
static int cyttsp4_xres(struct cyttsp4_core_platform_data *pdata,
		struct device *dev)
{
	int irq_gpio = pdata->irq_gpio;
	int rc = 0;

	cyttsp4_hw_power(0, true, irq_gpio);

	/* Delay for 10 msec */
	//msleep(1000);

	cyttsp4_hw_power(1, true, irq_gpio);

	return rc;
}
static int cyttsp4_sleep(struct cyttsp4_core_platform_data *pdata,
                         struct device *dev, atomic_t *ignore_irq)
{
    int irq_gpio = pdata->irq_gpio;

    return cyttsp4_hw_power(0, true, irq_gpio);
}
コード例 #7
0
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);
}