Ejemplo n.º 1
0
static ssize_t keypad_brightness_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
{
    int value;
  
	
    sscanf(buf, "%d", &value);

#ifndef CONFIG_MACH_CHIEF
    if (value)
        keypad_led_control(1);
    else
        keypad_led_control(0);

	printk(KERN_DEBUG "[%s] brightness : %d \n", __FUNCTION__, value);
#else
        if(value == 1)
        {
           keypad_led_onoff(1);
        }
        else if(value == 2)
        {
           keypad_led_onoff(0);
        }
#endif 

   return size;
}
Ejemplo n.º 2
0
static ssize_t keypad_brightness_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
{
    int value;  

    sscanf(buf, "%d", &value);

#if !defined(CONFIG_MACH_CHIEF) 
    if (value)
          keypad_led_control(1);          
	     
    else 
          keypad_led_control(0);
	     
	printk(KERN_DEBUG "[%s]: brightness : %d \n", __FUNCTION__, value);
	
/*[Tikal_MPCS]: Keypad LED is controlled by gpio
 * and timer is implemented in powermanagerservice.java for 1.5s
*/
#elif defined(CONFIG_TIKAL_MPCS) || defined(CONFIG_MACH_TREBON)
	if (value)
	    keypad_led_onoff(1);		 
		
   	else
	    keypad_led_onoff(0);
	
	printk(KERN_DEBUG "[%s]: brightness : %d \n", __FUNCTION__, value);

#else
	if(value == 1)
      	{
	     	keypad_led_onoff(1);			
         	mod_timer(&keyled_timer,keyled_timer.expires);
      	}
     	else if(value == 2)
      	{
	     	keypad_led_onoff(0);
		del_timer_sync(&keyled_timer);			
      	}
	  
	 printk(KERN_DEBUG "[%s] : brightness : %d \n", __FUNCTION__, value);
	
#endif 

   return size;
}