void s3c_setup_keypad_cfg_gpio(void)
{
	unsigned int gpio;
	unsigned int end;

	/* gpio setting for KP_COL0 */
	s3c_gpio_cfgpin(S5PV210_GPJ1(5), S3C_GPIO_SFN(3));
	s3c_gpio_setpull(S5PV210_GPJ1(5), S3C_GPIO_PULL_NONE);

	/* gpio setting for KP_COL1 ~ KP_COL7 and KP_ROW0 */
	end = S5PV210_GPJ2(8);
	for (gpio = S5PV210_GPJ2(0); gpio < end; gpio++) {
		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
	}

	/* gpio setting for KP_ROW1 ~ KP_ROW8 */
	end = S5PV210_GPJ3(8);
	for (gpio = S5PV210_GPJ3(0); gpio < end; gpio++) {
		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
	}

	/* gpio setting for KP_ROW9 ~ KP_ROW13 */
	end = S5PV210_GPJ4(5);
	for (gpio = S5PV210_GPJ4(0); gpio < end; gpio++) {
		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
	}
}
static int __init herring_init_touchkey_led(void)
{
	int i;
	int ret = 0;

	if (!machine_is_herring() || system_rev < 0x10)
		return 0;

	for (i = 0; i < ARRAY_SIZE(led_gpios); i++) {
		ret = gpio_request(S5PV210_GPJ3(led_gpios[i]), "touchkey led");
		if (ret) {
			pr_err("Failed to request touchkey led gpio %d\n", i);
			goto err_req;
		}
		s3c_gpio_setpull(S5PV210_GPJ3(led_gpios[i]),
							S3C_GPIO_PULL_NONE);
	}

	herring_touchkey_led_onoff(1);

	register_early_suspend(&early_suspend);

	return 0;

err_req:
	while (--i >= 0)
		gpio_free(S5PV210_GPJ3(led_gpios[i]));
	return ret;
}
Esempio n. 3
0
void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
{
#if 0
	/* Set all the necessary GPH3 pins to special-function 3: KP_ROW[x] */
	s3c_gpio_cfgrange_nopull(S5PV210_GPH3(0), rows, S3C_GPIO_SFN(3));

	/* Set all the necessary GPH2 pins to special-function 3: KP_COL[x] */
	s3c_gpio_cfgrange_nopull(S5PV210_GPH2(0), cols, S3C_GPIO_SFN(3));
#else
	unsigned int gpio;  
	unsigned int end; 

	s3c_gpio_cfgpin(S5PV210_GPJ2(7), S3C_GPIO_SFN(3));  
        s3c_gpio_setpull(S5PV210_GPJ2(7), S3C_GPIO_PULL_UP); 

	end = S5PV210_GPJ3(rows -1);
	for (gpio = S5PV210_GPJ3(0); gpio < end; gpio++)
	{  
		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));  
		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
	}


	
	s3c_gpio_cfgpin(S5PV210_GPJ1(5), S3C_GPIO_SFN(3));  
        s3c_gpio_setpull(S5PV210_GPJ1(5), S3C_GPIO_PULL_NONE); 

	end = S5PV210_GPJ2(cols -1);
	for (gpio = S5PV210_GPJ2(0); gpio < end; gpio++)
	{  
		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));  
		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
	}
#endif
}
Esempio n. 4
0
static void __init mini210_wifi_init(void)
{
	/* WIFI 0 (builtin): block power --> PDn --> RESETn */
	gpio_request(S5PV210_GPJ3(5), "GPJ3_5");
	gpio_direction_output(S5PV210_GPJ3(5), 1);
	udelay(10);
	gpio_free(S5PV210_GPJ3(5));

	gpio_request(S5PV210_GPJ3(7), "GPJ3_7");
	gpio_direction_output(S5PV210_GPJ3(7), 1);
	udelay(10);
	gpio_free(S5PV210_GPJ3(7));

	gpio_request(S5PV210_GPJ3(6), "GPJ3_6");
	gpio_direction_output(S5PV210_GPJ3(6), 1);
	gpio_free(S5PV210_GPJ3(6));

	/* WIFI 1 (external): PDn --> RESETn */
	gpio_request(S5PV210_GPJ4(1), "GPJ4_1");
	gpio_direction_output(S5PV210_GPJ4(1), 1);
	udelay(50);
	gpio_free(S5PV210_GPJ4(1));

	gpio_request(S5PV210_GPJ4(3), "GPJ4_3");
	gpio_direction_output(S5PV210_GPJ4(3), 0);
	udelay(100);
	gpio_set_value(S5PV210_GPJ4(3), 1);
	gpio_free(S5PV210_GPJ4(3));
}
Esempio n. 5
0
static int __init aries_init_touchkey_led(void)
{
	int i;
	int ret = 0;
	u32 gpio;

    down(&i2c_sem);

	if (!machine_is_aries() || !aries_is_tft_dev())
		return 0;

	for (i = 0; i < ARRAY_SIZE(led_gpios); i++) {
		gpio = S5PV210_GPJ3(led_gpios[i]);
		ret = gpio_request(gpio, "touchkey led");
		if (ret) {
			pr_err("Failed to request touchkey led gpio %d\n", i);
			goto err_req;
		}
        s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
        s3c_gpio_slp_cfgpin(gpio, S3C_GPIO_SLP_PREV);
        s3c_gpio_slp_setpull_updown(gpio, S3C_GPIO_PULL_NONE);
	}

	aries_touchkey_led_onoff(1);

	register_early_suspend(&early_suspend);

#ifdef CONFIG_BLD
  register_bld_implementation(&aries_touchkey_bld);
#endif


	if (misc_register(&bl_led_device))
		printk("%s misc_register(%s) failed\n", __FUNCTION__, bl_led_device.name);
	else {
		if (sysfs_create_group(&bl_led_device.this_device->kobj, &bl_led_group) < 0)
            pr_err("failed to create sysfs group for device %s\n", bl_led_device.name);
	}

    /* Initialize wake locks */
    wake_lock_init(&sBlinkWakeLock, WAKE_LOCK_SUSPEND, "blink_wake");

    setup_timer(&blink_timer, blink_timer_callback, 0);

    up(&i2c_sem);
	return 0;

err_req:
	while (--i >= 0)
		gpio_free(S5PV210_GPJ3(led_gpios[i]));
    up(&i2c_sem);
	return ret;
}
static void herring_touchkey_led_onoff(int onoff)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(led_gpios); i++)
		gpio_direction_output(S5PV210_GPJ3(led_gpios[i]), !!onoff);
}
static int __init herring_init_touchkey_led(void)
{
	int i;
	int ret = 0;
	u32 gpio;

	if (!machine_is_herring() || !herring_is_tft_dev())
		return 0;

	for (i = 0; i < ARRAY_SIZE(led_gpios); i++) {
		gpio = S5PV210_GPJ3(led_gpios[i]);
		ret = gpio_request(gpio, "touchkey led");
		if (ret) {
			pr_err("Failed to request touchkey led gpio %d\n", i);
			goto err_req;
		}
		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
		s3c_gpio_slp_cfgpin(gpio, S3C_GPIO_SLP_PREV);
		s3c_gpio_slp_setpull_updown(gpio, S3C_GPIO_PULL_NONE);
	}

	herring_touchkey_led_onoff(1);

	register_early_suspend(&early_suspend);

#ifdef CONFIG_GENERIC_BLN
	register_bln_implementation(&herring_touchkey_bln);
#endif

#ifdef CONFIG_BLD
	register_bld_implementation(&herring_touchkey_bld);
#endif

	return 0;

err_req:
	while (--i >= 0)
		gpio_free(S5PV210_GPJ3(led_gpios[i]));
	return ret;
}
void s5pv210_ide_setup_gpio(void)
{
	/* CF_Add[0 - 2], CF_IORDY, CF_INTRQ, CF_DMARQ, CF_DMARST, CF_DMACK */
	s5pv210_ide_cfg_gpios(S5PV210_GPJ0(0), 8);

	/* CF_Data[0 - 7] */
	s5pv210_ide_cfg_gpios(S5PV210_GPJ2(0), 8);

	/* CF_Data[8 - 15] */
	s5pv210_ide_cfg_gpios(S5PV210_GPJ3(0), 8);

	/* CF_CS0, CF_CS1, CF_IORD, CF_IOWR */
	s5pv210_ide_cfg_gpios(S5PV210_GPJ4(0), 4);
}
void s5pv210_ide_setup_gpio(void)
{
	/*                                                                  */
	s5pv210_ide_cfg_gpios(S5PV210_GPJ0(0), 8);

	/*                */
	s5pv210_ide_cfg_gpios(S5PV210_GPJ2(0), 8);

	/*                 */
	s5pv210_ide_cfg_gpios(S5PV210_GPJ3(0), 8);

	/*                                  */
	s5pv210_ide_cfg_gpios(S5PV210_GPJ4(0), 4);
}
Esempio n. 10
0
			.ngpio	= S5PV210_GPIO_J1_NR,
			.label	= "GPJ1",
		},
	}, {
		.base	= S5PV210_GPJ2_BASE,
		.config	= &gpio_cfg,
		.chip	= {
			.base	= S5PV210_GPJ2(0),
			.ngpio	= S5PV210_GPIO_J2_NR,
			.label	= "GPJ2",
		},
	}, {
		.base	= S5PV210_GPJ3_BASE,
		.config	= &gpio_cfg,
		.chip	= {
			.base	= S5PV210_GPJ3(0),
			.ngpio	= S5PV210_GPIO_J3_NR,
			.label	= "GPJ3",
		},
	}, {
		.base	= S5PV210_GPJ4_BASE,
		.config	= &gpio_cfg,
		.chip	= {
			.base	= S5PV210_GPJ4(0),
			.ngpio	= S5PV210_GPIO_J4_NR,
			.label	= "GPJ4",
		},
	}, {
		.base	= S5PV210_MP01_BASE,
		.config	= &gpio_cfg_noint,
		.chip	= {
Esempio n. 11
0
File: led.c Progetto: cwyy/kernel
#include <mach/map.h>
#include <mach/regs-mem.h>
#include <mach/regs-gpio.h>
#include <mach/gpio-bank.h>
#include <plat/s5pv210.h>
#include <plat/gpio-cfg.h>
#include <mach/gpio-bank-b.h>

#define LED_ON	0
#define LED_OFF 1

static unsigned long led_table [] = {
	S5PV210_GPJ4(2),	
	S5PV210_GPJ4(1),
	S5PV210_GPJ4(0),
	S5PV210_GPJ3(7),
};

static unsigned long led_cfg_table [] = {
	S3C_GPIO_OUTPUT,
	S3C_GPIO_OUTPUT,
	S3C_GPIO_OUTPUT,
	S3C_GPIO_OUTPUT,
};

static int led_open(struct inode *inode, struct file *file)
{
	int i;
	for(i = 0; i < 4; i++)
	{
		s3c_gpio_cfgpin(led_table[i], led_cfg_table[i]);
Esempio n. 12
0
/*
 * ftn for video
 */
static int s5p_tv_v_open(struct file *file)
{
	int ret = 0,err;

	mutex_lock(mutex_for_fo);

	if (s5ptv_status.tvout_output_enable) {
		BASEPRINTK("tvout drv. already used !!\n");
		ret =  -EBUSY;
		goto drv_used;
	}

#ifdef CONFIG_CPU_S5PV210
#ifdef CONFIG_PM_PWR_GATING 
	if((s5ptv_status.hpd_status) && !(s5ptv_status.suspend_status))
	{
		BASEPRINTK("tv is turned on\n");
#endif
#if 0
#ifdef CONFIG_CPU_FREQ
#ifdef CONFIG_CPU_MAX_FREQ_1GHZ // 2010.3.9.
		if((s5ptv_status.hpd_status))
			s5pc110_lock_dvfs_high_level(DVFS_LOCK_TOKEN_4, 3);    
#else
		if((s5ptv_status.hpd_status))
			s5pc110_lock_dvfs_high_level(DVFS_LOCK_TOKEN_4, 2);
#endif
#endif
#endif

#if defined(CONFIG_S5PC110_SIDEKICK_BOARD)	
	err = gpio_request(S5PV210_GPJ3(1),"EAR_SEL");
	udelay(50);
	gpio_direction_output(S5PV210_GPJ3(1),0);
	gpio_set_value(S5PV210_GPJ3(1),0);
	udelay(50);
#elif defined(CONFIG_S5PC110_DEMPSEY_BOARD)
//there is no connected pin
#else
	err = gpio_request(S5PV210_GPJ4(4),"TV_EN");
	udelay(50);
	gpio_direction_output(S5PV210_GPJ4(4),1);
	gpio_set_value(S5PV210_GPJ4(4),1);
	udelay(50);

	err = gpio_request(S5PV210_GPJ2(6),"EAR_SEL");
	udelay(50);
	gpio_direction_output(S5PV210_GPJ2(6),0);
	gpio_set_value(S5PV210_GPJ2(6),0);
	udelay(50);
#endif
	
		s5p_tv_clk_gate( true );
		tv_phy_power( true );
#ifdef CONFIG_PM_PWR_GATING
	}
	else
		BASEPRINTK("tv is off\n");
#endif
#endif
	_s5p_tv_if_init_param();

	s5p_tv_v4l2_init_param();

	mutex_unlock(mutex_for_fo);

	/* c110 test */	//s5ptv_status.hpd_status = true;

  printk("\n\nTV open success\n\n");

#ifdef I2C_BASE
	mutex_lock(mutex_for_i2c);
	/* for ddc(hdcp port) */
	if(s5ptv_status.hpd_status) {
		if (i2c_add_driver(&hdcp_i2c_driver)) 
			BASEPRINTK("HDCP port add failed\n");
		hdcp_i2c_drv_state = true;
	} else 
		hdcp_i2c_drv_state = false;

	mutex_unlock(mutex_for_i2c);
	/* for i2c probing */
	udelay(100);
#endif

	return 0;

drv_used:
	mutex_unlock(mutex_for_fo);
	return ret;
}
Esempio n. 13
0
#include <mach/map.h>

#include <plat/devs.h>
#include <plat/fimc.h>
#include <plat/csis.h>
#include <plat/media.h>
#include <plat/jpeg.h>
#include <mach/media.h>
#include <mach/adc.h>

#ifdef CONFIG_LEDS_GPIO
static struct gpio_led gpio_leds[] = {
#if 1
	  {
                 .name   = "led_blue",
                 .gpio   = S5PV210_GPJ3(0),
                 .active_low = 0,
                 .default_state = LEDS_GPIO_DEFSTATE_OFF,
         },
         {
                 .name   = "led_yellow",
                 .gpio   = S5PV210_GPJ3(1),
                 .active_low = 0,
                 .default_state = LEDS_GPIO_DEFSTATE_OFF,
         },
         {
                  .name   = "led_green",
                  .gpio   = S5PV210_GPJ3(2),
                  .active_low = 0,
                  .default_state = LEDS_GPIO_DEFSTATE_ON,
          },
Esempio n. 14
0
#ifdef CONFIG_KEYBOARD_MANGO
static struct mango_keys_button mango_gpio_keys_table[] = {
	{
		.code			= KEY_BACK,
		.gpio			= S5PV210_GPH0(1),
		.active_low		= 1,
		.desc			= "GPH0",
		.type			= EV_KEY,
		.wakeup			= 1,
//		.debounce_interval	= 5,
		.irq			= IRQ_EINT1,
		.config			= (0xf << 4),
		.pull			= S3C_GPIO_PULL_NONE,
		.active_low		= 1,
		.led_gpio		= S5PV210_GPJ3(7),
		.led_desc		= "GPJ3",
		.led_config		= (0x1 << (4 * 7)),
		.led_active_low		= 1,
	},
	{
		.code			= KEY_MENU,
		.gpio			= S5PV210_GPH0(2),
		.active_low		= 1,
		.desc			= "GPH0",
		.type			= EV_KEY,
		.wakeup			= 1,
//		.debounce_interval	= 5,
		.irq			= IRQ_EINT2,
		.config			= (0xf<<8),
		.pull			= S3C_GPIO_PULL_NONE,