Esempio n. 1
0
static irqreturn_t s3c_keygpio_ok_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	static unsigned int prev_key_status = (1 << 5);
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;

#ifdef CONFIG_CPU_FREQ
	set_dvfs_target_level(LEV_800MHZ);
#endif
	// Beware that we may not obtain exact key up/down status at
	// this point.
	key_status = (readl(S5PV210_GPH3DAT)) & ((1 << 5));

	// If ISR is called and up/down status remains the same, we
	// must have lost one and should report that first with
	// upside/down.
	if (in_sleep) {
		if (key_status == prev_key_status) {
			INPUT_REPORT_KEY(dev, 50, key_status ? 1 : 0);
		}
		in_sleep = 0;
	}

	INPUT_REPORT_KEY(dev, 50, key_status ? 0 : 1);

	if (key_status)
		TSP_forced_release_forOKkey();

	prev_key_status = key_status;
	printk(KERN_DEBUG "s3c_keygpio_ok_isr key_status =%d\n", key_status);

	return IRQ_HANDLED;
}
Esempio n. 2
0
	/*Clear the keypad interrupt status*/
	writel(KEYIFSTSCLR_CLEAR, key_base+S3C_KEYIFSTSCLR);
    
	DPRINTK("s3c_keypad_isr \n");	

	return IRQ_HANDLED;
}
#if 0 /* gpio key use gpio-event.c */
static irqreturn_t s3c_keygpio_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	unsigned int * prev_key_status;
	KEYGPIO_INT_INFO *  int_info = (KEYGPIO_INT_INFO *)dev_id;
	KEYGPIO_INFO *		info = int_info->info;
	struct input_dev *	dev = int_info->dev;

	prev_key_status = &info->prev_key_status;

	// Beware that we may not obtain exact key up/down status at
	// this point.

	key_status = (readl(info->gpio_data) & info->gpio_data_mask);

	// If ISR is called and up/down status remains the same, we
	// must have lost one and should report that first with
	// upside/down.
	if(in_sleep)
	{
		if (key_status == *prev_key_status)
		{
			INPUT_REPORT_KEY(dev, info->keycode, key_status ? 1 : 0);
		}
		in_sleep = 0;
	}

	INPUT_REPORT_KEY(dev, info->keycode, key_status ? 0 : 1);

	*prev_key_status = key_status;

	printk(KERN_DEBUG "s3c_keygpio_isr [%d] key_status =%d\n", int_info->index, key_status);

	return IRQ_HANDLED;
}
Esempio n. 3
0
static irqreturn_t s3c_keygpio_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	static unsigned int prev_key_status = (1 << 6);
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;
	#define KEY_POWER_EVT       116

	// Beware that we may not obtain exact key up/down status at
	// this point.
	key_status = (readl(S5PV210_GPH2DAT)) & (1 << 6);

	// If ISR is called and up/down status remains the same, we
	// must have lost one and should report that first with
	// upside/down.
	if(in_sleep)
	{
	    if (key_status == prev_key_status)
		{
    		INPUT_REPORT_KEY(dev, KEY_POWER_EVT, key_status ? 1 : 0);
		}
		in_sleep = 0;
	}

	INPUT_REPORT_KEY(dev, KEY_POWER_EVT, key_status ? 0 : 1);
   
   	keyled_timer_start(); /* keypad_led */

	prev_key_status = key_status;
	printk(KERN_DEBUG "s3c_keygpio_isr pwr key_status =%d,\n", key_status);

	return IRQ_HANDLED;
}
Esempio n. 4
0
static irqreturn_t s3c_keygpio_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	static unsigned int prev_key_status = (1 << 6);
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;

	// Beware that we may not obtain exact key up/down status at
	// this point.
	key_status = (readl(S5PV210_GPH2DAT)) & (1 << 6);

	// If ISR is called and up/down status remains the same, we
	// must have lost one and should report that first with
	// upside/down.
#if defined(CONFIG_S5PC110_SIDEKICK_BOARD)	
	if(in_sleep)
	{
	if(s3ckeypad_evt_enable_status)		//NAGSM_Android_SEL_Kernel_Aakash_20100319
	{

		if (key_status == prev_key_status)
		{
				if(key_status == ((1 << 6)))
					input_report_key(dev,26,0);
				else
					input_report_key(dev,26,1);	
			}
			in_sleep = 0;
		}
	}
	
	if(key_status == ((1 << 6)))
		input_report_key(dev,26,0);
	else
		input_report_key(dev,26,1);	
#else	
	if(in_sleep)
	{
		if(s3ckeypad_evt_enable_status)		//NAGSM_Android_SEL_Kernel_Aakash_20100319
		{
			if (key_status == prev_key_status)
			{
			INPUT_REPORT_KEY(dev, 26, key_status ? 1 : 0);
		}
		in_sleep = 0;
	}
}
	
	INPUT_REPORT_KEY(dev, 26, key_status ? 0 : 1);
#endif

	prev_key_status = key_status;
	printk("s3c_keygpio_isr pwr key_status =%d\n", key_status);

	return IRQ_HANDLED;
}
Esempio n. 5
0
static irqreturn_t s3c_keygpio_ok_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	static unsigned int prev_key_status = (1 << 5);
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;

	#ifdef CONFIG_CPU_FREQ
	set_dvfs_target_level(LEV_800MHZ);
	#endif
	// Beware that we may not obtain exact key up/down status at
	// this point.
#if defined(CONFIG_HAWK_VER_B1_REAL_ADDED_FEATURE) //NAGSM_Android_HQ_KERNEL_CLEE_20100908 : Setup Hawk Real Board Rev 0.1
	key_status = (readl(S5PV210_GPH3DAT)) & ((1 << 0));
#else
	key_status = (readl(S5PV210_GPH3DAT)) & ((1 << 5));
#endif

	// If ISR is called and up/down status remains the same, we
	// must have lost one and should report that first with
	// upside/down.
	if(s3ckeypad_evt_enable_status)		//NAGSM_Android_SEL_Kernel_Aakash_20100319
	{	

	if(in_sleep)
	{
		if (key_status == prev_key_status)
		{
#ifdef CONFIG_S5PC110_FLEMING_BOARD
			INPUT_REPORT_KEY(dev, 28, key_status ? 1 : 0);
#else
			INPUT_REPORT_KEY(dev, 50, key_status ? 1 : 0);
#endif
		}
		in_sleep = 0;
	}
#ifdef CONFIG_S5PC110_FLEMING_BOARD
	INPUT_REPORT_KEY(dev, 28, key_status ? 0 : 1);
#else
	INPUT_REPORT_KEY(dev, 50, key_status ? 0 : 1);
#endif
}
	if(key_status)
		TSP_forced_release_forOKkey();
	
	prev_key_status = key_status;
        printk(KERN_DEBUG "s3c_keygpio_ok_isr key_status =%d\n", key_status);
        
        return IRQ_HANDLED;
}
Esempio n. 6
0
static irqreturn_t s3c_keygpio_keysense_isr(int irq, void *dev_id)
{
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;

	#define KEY_POWER_EVT       116

	//Report Pressed key event
	INPUT_REPORT_KEY(dev, KEY_POWER_EVT,  1);
	// If ISR is called when wny any key is pressed while Target is call and in sleep mode.
	
	//Report released key event
    	INPUT_REPORT_KEY(dev, KEY_POWER_EVT,  0);

	#if defined(CONFIG_MACH_CHIEF) && !defined(CONFIG_MACH_TREBON)
   	keyled_timer_start(); /* keypad_led */
	#endif

	return IRQ_HANDLED;
}
Esempio n. 7
0
//EINT26
static irqreturn_t s3c_keygpio_vol_up26_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;

	key_status = (readl(S5PV210_GPH3DAT)) & ((1 << 2));
	
	INPUT_REPORT_KEY(dev, 42, key_status ? 0 : 1);

       printk(KERN_DEBUG "s3c_keygpio_vol_up26_isr key_status =%d,\n", key_status);
       
        return IRQ_HANDLED;
}
Esempio n. 8
0
static irqreturn_t s3c_keygpio_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	static unsigned int prev_key_status = (1 << 6);
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;

	// Beware that we may not obtain exact key up/down status at
	// this point.
#if defined(CONFIG_HAWK_VER_B1_REAL_ADDED_FEATURE) //NAGSM_Android_HQ_KERNEL_CLEE_20100908 : Setup Hawk Real Board Rev 0.1
	key_status = (readl(S5PV210_GPH3DAT)) & (1 << 7); //key_status = (readl(S5PC11X_GPH2DAT)) & (1 << 6);
#else
	key_status = (readl(S5PV210_GPH2DAT)) & (1 << 6);
#endif	
	// If ISR is called and up/down status remains the same, we
	// must have lost one and should report that first with
	// upside/down.
	if(in_sleep)
	{
	if(s3ckeypad_evt_enable_status)		//NAGSM_Android_SEL_Kernel_Aakash_20100319
	{

		if (key_status == prev_key_status)
		{
			INPUT_REPORT_KEY(dev, 26, key_status ? 1 : 0);
		}
		in_sleep = 0;
	}
}
	
	INPUT_REPORT_KEY(dev, 26, key_status ? 0 : 1);

	prev_key_status = key_status;
	printk(KERN_DEBUG "s3c_keygpio_isr pwr key_status =%d\n", key_status);

	return IRQ_HANDLED;
}
Esempio n. 9
0
static irqreturn_t s3c_keygpio_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	static unsigned int prev_key_status= 0;
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;

	// Beware that we may not obtain exact key up/down status at
	// this point.
	key_status = gpio_get_value(GPIO_nPOWER);

	// If ISR is called and up/down status remains the same, we
	// must have lost one and should report that first with
	// upside/down.
	if (in_sleep) {
		if (key_status == prev_key_status) {
#ifdef PHONE_B7610
			INPUT_REPORT_KEY(dev, KEY_POWER, key_status ? 1 : 0); 
#else
			INPUT_REPORT_KEY(dev, 26, key_status ? 1 : 0); 
#endif
		}
		in_sleep = 0;
	}

#ifdef PHONE_B7610
	INPUT_REPORT_KEY(dev, KEY_POWER, key_status ? 0 : 1); 
#else
	INPUT_REPORT_KEY(dev, 26, key_status ? 0 : 1); 
#endif

	prev_key_status = key_status;
	//printk(KERN_DEBUG "s3c_keygpio_isr pwr key_status =%d\n", key_status);

	return IRQ_HANDLED;
}
Esempio n. 10
0
static irqreturn_t s3c_keygpio_vol_down_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;

	key_status = (readl(S5PV210_GPH3DAT)) & (1 << 1);
	
	if(s3ckeypad_evt_enable_status)		//NAGSM_Android_SEL_Kernel_Aakash_20100319
	{	

	INPUT_REPORT_KEY(dev, 58, key_status ? 0 : 1);
	}
	printk(KERN_DEBUG "s3c_keygpio_vol_down_isr key_status =%d,\n", key_status);

        return IRQ_HANDLED;
}
Esempio n. 11
0
static irqreturn_t s3c_keygpio_vol_up_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;

	//we cannot check HWREV 0xb and 0xc, we check 2 hw key
	key_status = (readl(S5PV210_GPH3DAT)) & ((1 << 3));
	
	INPUT_REPORT_KEY(dev, 42, key_status ? 0 : 1);

	if(s3ckeypad_evt_enable_status)		//NAGSM_Android_SEL_Kernel_Aakash_20100319
	{
	if(key_status == ((1 << 3)))
		input_report_key(dev,42,0);
	else
		input_report_key(dev,42,1);
	}									//NAGSM_Android_SEL_Kernel_Aakash_20100319
       printk(KERN_DEBUG "s3c_keygpio_vol_up_isr key_status =%d,\n", key_status);
       
        return IRQ_HANDLED;
}
Esempio n. 12
0
static irqreturn_t s3c_keygpio_vol_up_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;

#if defined(CONFIG_S5PC110_SIDEKICK_BOARD)
		//we cannot check HWREV 0xb and 0xc, we check 2 hw key
		key_status = (readl(S5PV210_GPH2DAT)) & ((1 << 0));
		
		//INPUT_REPORT_KEY(dev, 42, key_status ? 0 : 1);

		if(s3ckeypad_evt_enable_status)		//NAGSM_Android_SEL_Kernel_Aakash_20100319
		{
			if(key_status == ((1 << 0)))
			input_report_key(dev,42,0);
		else
			input_report_key(dev,42,1);
		}	
#else
	//we cannot check HWREV 0xb and 0xc, we check 2 hw key
	key_status = (readl(S5PV210_GPH1DAT)) & ((1 << 0));
	
	INPUT_REPORT_KEY(dev, 42, key_status ? 0 : 1);

	if(s3ckeypad_evt_enable_status)		//NAGSM_Android_SEL_Kernel_Aakash_20100319
	{
		if(key_status == ((1 << 0)))
		input_report_key(dev,42,0);
	else
		input_report_key(dev,42,1);
	}									//NAGSM_Android_SEL_Kernel_Aakash_20100319
#endif
	
       printk("s3c_keygpio_vol_up_isr key_status =%d,\n", key_status);
       
        return IRQ_HANDLED;
}
Esempio n. 13
0
static irqreturn_t s3c_keygpio_vol_down_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;

	key_status = (readl(S5PV210_GPH1DAT)) & (1 << 6);
	
	if(s3ckeypad_evt_enable_status)		//NAGSM_Android_SEL_Kernel_Aakash_20100319
	{	
#if defined(CONFIG_S5PC110_SIDEKICK_BOARD)	
		if(key_status == ((1 << 6)))
			input_report_key(dev,58,0);
		else
			input_report_key(dev,58,1);	
#else		
	INPUT_REPORT_KEY(dev, 58, key_status ? 0 : 1);
#endif
	}
	printk("s3c_keygpio_vol_down_isr key_status =%d,\n", key_status);

        return IRQ_HANDLED;
}
Esempio n. 14
0
static irqreturn_t s3c_keygpio_ok_isr(int irq, void *dev_id)
{
	unsigned int key_status;
	static unsigned int prev_key_status = (1 << 5);
	struct s3c_keypad *pdata = (struct s3c_keypad *)dev_id;
	struct input_dev *dev = pdata->dev;

	#ifdef CONFIG_CPU_FREQ
	set_dvfs_target_level(LEV_800MHZ);
	#endif
	// Beware that we may not obtain exact key up/down status at
	// this point.
#if defined(CONFIG_S5PC110_SIDEKICK_BOARD)

	key_status = (readl(S5PV210_GPH3DAT)) & ((1 << 7));
	// If ISR is called and up/down status remains the same, we
	// must have lost one and should report that first with
	// upside/down.
#if 0
	if(key_status == 0){
		if(prev_key_status != 0){
		last_okkey_jiffies = jiffies;
		}
		prev_key_status = key_status;
		is_ok_key_pressed = 1;
		//printk("s3c_keygpio_ok_isr key_status =%d, but not send it.\n", key_status);
		return IRQ_HANDLED;
	}

	if((jiffies - last_okkey_jiffies) < (HZ/100)){
		prev_key_status = key_status;
	        printk("s3c_keygpio_ok_isr key_status =%d, but ignored.\n", key_status);
	        
	        return IRQ_HANDLED;
	}else{
		input_report_key(dev,50,1);
		is_ok_key_pressed = 0;
		printk("s3c_keygpio_ok_isr key_status =%d\n", prev_key_status);
	}
#endif
	if(s3ckeypad_evt_enable_status)		//NAGSM_Android_SEL_Kernel_Aakash_20100319
	{	
		if(in_sleep)
		{
			if (key_status == prev_key_status)
			{
				if(key_status == ((1 << 7)))
					input_report_key(dev,50,0);
				else
					input_report_key(dev,50,1);	
			}
			in_sleep = 0;
		}
		if(key_status == ((1 << 7)))
			input_report_key(dev,50,0);
		else
			input_report_key(dev,50,1);	
	}

#else

	key_status = (readl(S5PV210_GPH3DAT)) & ((1 << 5));

	// If ISR is called and up/down status remains the same, we
	// must have lost one and should report that first with
	// upside/down.
	if(s3ckeypad_evt_enable_status)		//NAGSM_Android_SEL_Kernel_Aakash_20100319
	{	
	if(in_sleep)
	{
		if (key_status == prev_key_status)
		{
#ifdef CONFIG_S5PC110_FLEMING_BOARD
			INPUT_REPORT_KEY(dev, 28, key_status ? 1 : 0);
#else
			INPUT_REPORT_KEY(dev, 50, key_status ? 1 : 0);
#endif
		}
		in_sleep = 0;
	}
#ifdef CONFIG_S5PC110_FLEMING_BOARD
	INPUT_REPORT_KEY(dev, 28, key_status ? 0 : 1);
#else
	INPUT_REPORT_KEY(dev, 50, key_status ? 0 : 1);
#endif
}

#endif	

	if(key_status)
		TSP_forced_release_forOKkey();
	
	prev_key_status = key_status;
        printk("s3c_keygpio_ok_isr key_status =%d\n", key_status);
        
        return IRQ_HANDLED;
}