static void mxt_gpio_init(void)
{
	/* touch interrupt */
	gpio_request(EXYNOS5410_GPJ0(0), "EXYNOS5410_GPJ0(0)");
	s3c_gpio_cfgpin(EXYNOS5410_GPJ0(0), S3C_GPIO_INPUT);
	s3c_gpio_setpull(EXYNOS5410_GPJ0(0), S3C_GPIO_PULL_NONE);
	s5p_register_gpio_interrupt(EXYNOS5410_GPJ0(0));

	s3c_gpio_setpull(EXYNOS5410_GPB3(1), S3C_GPIO_PULL_NONE);
	s3c_gpio_setpull(EXYNOS5410_GPB3(0), S3C_GPIO_PULL_NONE);
}
static int mxt_power_off(void)
{
	struct regulator *regulator;

	/* disable AVDD */
	regulator = regulator_get(NULL, "tsp_avdd");
	if (IS_ERR(regulator)) {
		printk(KERN_ERR "[TSP] %s: tsp_avdd regulator_get failed\n",
			__func__);
		return -EIO;
	}

	if (regulator_is_enabled(regulator))
		regulator_disable(regulator);
	regulator_put(regulator);

	/* disable DVDD */
	regulator = regulator_get(NULL, "tsp_vdd_3.0v");
	if (IS_ERR(regulator)) {
		printk(KERN_ERR "[TSP] %s: tsp_dvdd regulator_get failed\n",
			__func__);
		return -EIO;
	}

	if (regulator_is_enabled(regulator))
		regulator_disable(regulator);
	regulator_put(regulator);

	/* disable I2C pullup */
	regulator = regulator_get(NULL, "touch_1.8v");
	if (IS_ERR(regulator)) {
		printk(KERN_ERR "[TSP] %s: tsp_vdd regulator_get failed\n",
			__func__);
		return -EIO;
	}

	if (regulator_is_enabled(regulator))
		regulator_disable(regulator);
	regulator_put(regulator);

	/* touch interrupt pin */
	s3c_gpio_cfgpin(EXYNOS5410_GPJ0(0), S3C_GPIO_INPUT);
	s3c_gpio_setpull(EXYNOS5410_GPJ0(0), S3C_GPIO_PULL_NONE);

	printk(KERN_ERR "mxt_power_off is finished\n");

	return 0;
}
void __init synaptics_tsp_init(void)
{
	gpio_request(EXYNOS5410_GPJ0(0), "TSP_INT");
	s3c_gpio_cfgpin(EXYNOS5410_GPJ0(0), S3C_GPIO_SFN(0xf));
	s3c_gpio_setpull(EXYNOS5410_GPJ0(0), S3C_GPIO_PULL_UP);
	s5p_register_gpio_interrupt(EXYNOS5410_GPJ0(0));

	synaptics_i2c_devs0[0].irq = gpio_to_irq(EXYNOS5410_GPJ0(0));

	s3c_i2c0_set_platdata(NULL);
	i2c_register_board_info(0, synaptics_i2c_devs0,
		 ARRAY_SIZE(synaptics_i2c_devs0));

	printk(KERN_ERR "%s touch : %d\n",
		 __func__, synaptics_i2c_devs0[0].irq);
}
Example #4
0
static void dp_lcd_set_power(struct plat_lcd_data *pd,
				unsigned int power)
{
	printk("## %s, %d\n", __func__, __LINE__);

#ifndef CONFIG_BACKLIGHT_PWM
	/* LCD_PWM_IN_2.8V: LCD_B_PWM, GPB2_0 */
	gpio_request(EXYNOS5410_GPB2(0), "GPB2");
#endif

	gpio_request(EXYNOS5410_GPJ0(0), "GPJ0");
	if(power)
		gpio_direction_output(EXYNOS5410_GPJ0(0), 1);

#ifndef CONFIG_BACKLIGHT_PWM
	/* LCD_PWM_IN_2.8V: LCD_B_PWM, GPB2_0 */
	gpio_direction_output(EXYNOS5410_GPB2(0), power);

	gpio_free(EXYNOS5410_GPB2(0));
#endif

	gpio_free(EXYNOS5410_GPJ0(0));
}
void __init atmel_tsp_init(void)
{
	mxt_gpio_init();

	mxt_i2c_devs0[0].irq = gpio_to_irq(EXYNOS5410_GPJ0(0));

	/* Revision_I is applied from H/W revision(1.1).*/
	if (system_rev >= MXT_SUPPORT_REV_S) {
		mxt_data.num_xnode = 28;
		mxt_data.num_ynode = 16;
		mxt_data.firmware_name = MXT_FIRMWARE_NAME_REVISION_I;
		mxt_data.revision = MXT_REVISION_I;
	}
	s3c_i2c0_set_platdata(NULL);
	i2c_register_board_info(0, mxt_i2c_devs0,
			ARRAY_SIZE(mxt_i2c_devs0));

	printk(KERN_ERR "%s touch : %d\n",
		 __func__, mxt_i2c_devs0[0].irq);
}
static bool mxt_read_chg(void)
{
	return gpio_get_value(EXYNOS5410_GPJ0(0));
}
		if (regulator_is_enabled(regulator))
			regulator_force_disable(regulator);
		regulator_put(regulator);
	}

	return 0;
}
#endif

#define TM1940_ADDR 0x20
#define TM1940_ATTN 130

static struct synaptics_rmi4_platform_data rmi4_platformdata = {
	.irq_type = IRQF_TRIGGER_FALLING,
	.gpio = EXYNOS5410_GPJ0(0),
	.power = synaptics_power,
	.gpio_config = synaptics_gpio_setup,
#ifdef NO_0D_WHILE_2D
	.led_power_on = ts_led_power_on,
	.f1a_button_map = &tm1940_f1a_button_map,
#endif

};

static struct i2c_board_info synaptics_i2c_devs0[] = {
	{
		I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x20),
		.platform_data = &rmi4_platformdata,
	}
};
Example #8
0
static void vienna_audio_gpio_init(void)
{
	int err;

	if (system_rev < 0x2) {
		/* codec spi_mode */
		err = gpio_request(EXYNOS5410_GPB2(1), "CODEC_SPIMODE");
		if (err) {
			pr_err(KERN_ERR "GPIO_CODEC_SPI_MODE GPIO set error!\n");
			return;
		}
		gpio_direction_output(EXYNOS5410_GPB2(1), 1);
		gpio_set_value(EXYNOS5410_GPB2(1), 0); /* codec spi_mode 0, 3 */
		gpio_free(EXYNOS5410_GPB2(1));
	}

	/* Interrupt from codec jack detection */
	err = gpio_request(EXYNOS5410_GPX2(5), "EAR_SEND_END");
	if (err) {
		pr_err(KERN_ERR "EAR_SEND_END GPIO set error!\n");
		return;
	}
	s3c_gpio_setpull(EXYNOS5410_GPX2(5), S3C_GPIO_PULL_NONE);
	s5p_register_gpio_interrupt(EXYNOS5410_GPX2(5));
	gpio_direction_input(EXYNOS5410_GPX2(5));
	s3c_gpio_cfgpin(EXYNOS5410_GPX2(5), S3C_GPIO_SFN(0xf));

#ifdef CONFIG_SND_USE_YMU831_LDODE_GPIO
	err = gpio_request(GPIO_YMU_LDO_EN, "YMU_LDO_EN");
	if (err) {
		pr_err(KERN_ERR "YMU_LDO_EN GPIO set error!\n");
		return;
	}
	gpio_direction_output(GPIO_YMU_LDO_EN, 1);
	gpio_set_value(GPIO_YMU_LDO_EN, 0);
	gpio_free(GPIO_YMU_LDO_EN);
#endif

	/* Main Microphone BIAS */
	err = gpio_request(EXYNOS5410_GPJ1(2), "MICBIAS");
	if (err) {
		pr_err(KERN_ERR "MICBIAS_EN GPIO set error!\n");
		return;
	}
	gpio_direction_output(EXYNOS5410_GPJ1(2), 1);
	gpio_set_value(EXYNOS5410_GPJ1(2), 0);
	gpio_free(EXYNOS5410_GPJ1(2));

	err = gpio_request(EXYNOS5410_GPJ0(1), "SPK_EN");
	if (err) {
		pr_err(KERN_ERR "SPK_EN GPIO set error!\n");
		return;
	}
	gpio_direction_output(EXYNOS5410_GPJ0(1), 1);
	gpio_set_value(EXYNOS5410_GPJ0(1), 1);
	gpio_free(EXYNOS5410_GPJ0(1));

	err = gpio_request(EXYNOS5410_GPK0(7), "LINEOUT_ON");
	if (err) {
		pr_err(KERN_ERR "LINEOUT_ON GPIO set error!\n");
		return;
	}
	gpio_direction_output(EXYNOS5410_GPK0(7), 1);
	gpio_set_value(EXYNOS5410_GPK0(7), 1);
	gpio_free(EXYNOS5410_GPK0(7));
}