Ejemplo n.º 1
0
static int s3c_irda_startup(struct s3c_irda *si)
{
        int ret;
        
        DBG("%s\r\n", __FUNCTION__);

        /* Ensure that the ports for this device are setup correctly */
#if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
        s3c_gpio_setpull(S3C64XX_GPB(2), S3C_GPIO_PULL_UP);
        s3c_gpio_setpull(S3C64XX_GPB(3), S3C_GPIO_PULL_UP);
#elif defined(CONFIG_CPU_S5PC100)
        s3c_gpio_setpull(S5PC1XX_GPA1(2), S3C_GPIO_PULL_UP);
        s3c_gpio_setpull(S5PC1XX_GPA1(3), S3C_GPIO_PULL_UP);
#endif

        ret = s3c_irda_sir_init(si);
        if(ret) {
                printk("Irda Startup failed\r\n");
                return ret;
        }

        ret = s3c_irda_set_speed(si, si->speed = 9600);
        if(ret) 
                s3c_irda_sir_stop(si);

        return ret;
}
Ejemplo n.º 2
0
int s3cfb_backlight_on(struct platform_device *pdev)
{
#if !defined(CONFIG_HAVE_PWM)
	int err;

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

	gpio_direction_output(S5PC1XX_GPD(0), 1);
	gpio_free(S5PC1XX_GPA1(3));

	err = gpio_request(S5PC1XX_GPD(0), "GPA1");
	if (err) {
		printk(KERN_ERR "failed to request GPA1 for "
			"lcd backlight control\n");
		return err;
	}

	gpio_direction_output(S5PC1XX_GPA1(3), 1);
	gpio_free(S5PC1XX_GPA1(3));
#endif
	return 0;
}
Ejemplo n.º 3
0
static void  s3c_irda_gpio_conf(void)
{
#if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
	s3c_gpio_cfgpin(S3C64XX_GPB(2), S3C64XX_GPB2_UART_RXD3);
	s3c_gpio_cfgpin(S3C64XX_GPB(3), S3C64XX_GPB3_UART_TXD3);
#elif defined(CONFIG_CPU_S5PC100)
	s3c_gpio_cfgpin(S5PC1XX_GPA1(2), S5PC1XX_GPA1_2_UART_3_RXD);
	s3c_gpio_cfgpin(S5PC1XX_GPA1(3), S5PC1XX_GPA1_3_UART_3_TXD);
#endif
}
Ejemplo n.º 4
0
static int gpio_configure(void) {
	int ret;

	printk("%s()\n", __func__);
	ret = gpio_request(S5PC1XX_GPH1(1), "GPH1");
	if (ret) {
		printk("%s: gpio(GPH1(2) request error: %d\n", __func__, ret);
	}
	else {
		s3c_gpio_cfgpin(S5PC1XX_GPH1(1), S5PC1XX_GPH1_2_WAKEUP_INT_10);
		s3c_gpio_setpull(S5PC1XX_GPH1(1), S3C_GPIO_PULL_NONE);
	}
	
	ret = gpio_request(S5PC1XX_GPH3(7), "GPH3");
	if (ret) {
		printk("%s: gpio(GPH3(7) request error: %d\n", __func__, ret);
	}
	else {
		s3c_gpio_cfgpin(S5PC1XX_GPH3(7), S5PC1XX_GPH3_7_WAKEUP_INT_31);
		s3c_gpio_setpull(S5PC1XX_GPH3(7), S3C_GPIO_PULL_NONE);
	}

	ret = gpio_request(S5PC1XX_GPG1(0), "GPG1");
	if (ret) {
		printk("%s: gpio(GPG1(0) request error: %d\n", __func__, ret);
	}
	else {
		s3c_gpio_cfgpin(S5PC1XX_GPG1(0), S5PC1XX_GPG1_0_GPIO_INT12_0);
		s3c_gpio_setpull(S5PC1XX_GPG1(0), S3C_GPIO_PULL_NONE);
	}
	
	ret = gpio_request(S5PC1XX_GPA1(1), "GPA1");
	if (ret) {
		printk("%s: gpio(GPA1(1) request error: %d\n", __func__, ret);
	}
	else {
		s3c_gpio_cfgpin(S5PC1XX_GPA1(1), S5PC1XX_GPA1_1_GPIO_INT1_1);
		s3c_gpio_setpull(S5PC1XX_GPA1(1), S3C_GPIO_PULL_NONE);
	}

	ret = gpio_request(S5PC1XX_GPA1(0), "GPA1");
	if (ret) {
		printk("%s: gpio(GPA1(0) request error: %d\n", __func__, ret);
	}
	else {
		s3c_gpio_cfgpin(S5PC1XX_GPA1(0), S5PC1XX_GPA1_0_GPIO_INT1_0);
		s3c_gpio_setpull(S5PC1XX_GPA1(0), S3C_GPIO_PULL_NONE);
	}

	ret = gpio_request(S5PC1XX_GPB(0), "GPB0");
	if (ret) {
		printk("%s: gpio(GPB0(0) request error: %d\n", __func__, ret);
	}
	else {
		s3c_gpio_cfgpin(S5PC1XX_GPB(0), S5PC1XX_GPB0_GPIO_INT2_0);
		s3c_gpio_setpull(S5PC1XX_GPB(0), S3C_GPIO_PULL_NONE);
	}

	return 0;
}