Example #1
0
int s3cfb_set_gpio(void)
{
	int i, err;

	int val;
	val = readl(S5P64XX_SPC_BASE);
	val &= ~0x3;
	val |= (1 << 0);
	writel(val, S5P64XX_SPC_BASE);

	/* LCD_HSYNC, LCD_VSYNC, LCD_VDEN, LCD_VCLK, VD[23:0] */
	for (i = 0; i < 16; i++)
		s3c_gpio_cfgpin(S5P64XX_GPI(i), S3C_GPIO_SFN(2));

	for (i = 0; i < 12; i++)
		s3c_gpio_cfgpin(S5P64XX_GPJ(i), S3C_GPIO_SFN(2));

#ifndef CONFIG_BACKLIGHT_PWM
	/* backlight ON */
	if (gpio_is_valid(S5P64XX_GPF(15))) {
		err = gpio_request(S5P64XX_GPF(15), "GPF");

		if (err) {
			printk(KERN_ERR "failed to request GPD for "
				"lcd backlight control\n");
			return err;
		}

		gpio_direction_output(S5P64XX_GPF(15), 1);
	}
#endif
	/* module reset */
	if (gpio_is_valid(S5P64XX_GPN(5))) {
		err = gpio_request(S5P64XX_GPN(5), "GPN");

		if (err) {
			printk(KERN_ERR "failed to request GPH0 for "
				"lcd reset control\n");
			return err;
		}

		gpio_direction_output(S5P64XX_GPN(5), 1);
	}

	mdelay(100);

	gpio_set_value(S5P64XX_GPN(5), 0);
	mdelay(10);

	gpio_set_value(S5P64XX_GPN(5), 1);
	mdelay(10);

	gpio_free(S5P64XX_GPN(5));
	gpio_free(S5P64XX_GPF(15));

	return 0;
}
Example #2
0
static int s3c_gpp_to_irq(struct gpio_chip *chip, unsigned offset)
{
	if (offset <= 2)
		return -EINVAL;

	return IRQ_EINT_GROUP(8, offset);
}

static struct s3c_gpio_chip gpio_2bit[] = {
	{
		.base		= S5P64XX_GPF_BASE,
		.config		= &gpio_2bit_cfg_eint11,
		.config_slp	= &gpio_cfg_slp,
		.chip	= {
			.base	= S5P64XX_GPF(0),
			.ngpio	= S5P64XX_GPIO_F_NR,
			.label	= "GPF",
		},
	}, {
		.base		= S5P64XX_GPI_BASE,
		.config		= &gpio_2bit_cfg_noint,
		.config_slp	= &gpio_cfg_slp,
		.chip	= {
			.base	= S5P64XX_GPI(0),
			.ngpio	= S5P64XX_GPIO_I_NR,
			.label	= "GPI",
		},
	}, {
		.base		= S5P64XX_GPJ_BASE,
		.config		= &gpio_2bit_cfg_noint,