*** linux-c750/arch/arm/mach-pxa/sharpsl_power.c	2003-06-18 17:09:04.000000000 +0900
--- linux-c750_patch_work/arch/arm/mach-pxa/sharpsl_power.c	2003-08-04 21:04:16.000000000 +0900
***************
*** 1290,1299 ****
  
  	// daemonize();
  	strcpy(current->comm, "off_thread");
! 	sigfillset(&current->blocked);
! 
  	while(1) {
! 		interruptible_sleep_on(&wq_off);
  		DPRINTK("start off sequence ! \n");
  
  #if !defined(CONFIG_ARCH_PXA_SHEPHERD)
--- 1290,1299 ----
  
  	// daemonize();
  	strcpy(current->comm, "off_thread");
! /*	sigfillset(&current->blocked);
!  */
  	while(1) {
! 		sleep_on(&wq_off);
  		DPRINTK("start off sequence ! \n");
  
  #if !defined(CONFIG_ARCH_PXA_SHEPHERD)
***************
*** 1303,1326 ****
  		handle_scancode(SLKEY_OFF|KBDOWN , 1);
  		mdelay(10);
  		handle_scancode(SLKEY_OFF|KBUP   , 0);
! 
! #if !defined(CONFIG_ARCH_PXA_SHEPHERD)
! 		// wait off signal
! 		// if can not recieve off siganl , so force off.
! 		time_cnt = jiffies;
! 		while(1) {
! 		  if ( ( jiffies - time_cnt )  > 500 ) break;
! 		  schedule();
! 		}
! 
  		// maybe apps is dead, so we have to restart.
  		pm_do_suspend();
! 		sharpsl_restart();
! #endif
  	}
  	return 0;
  }
  
  #if defined(CONFIG_ARCH_PXA_SHEPHERD)
  static struct timer_list bat_switch_timer;
  
--- 1303,1365 ----
  		handle_scancode(SLKEY_OFF|KBDOWN , 1);
  		mdelay(10);
  		handle_scancode(SLKEY_OFF|KBUP   , 0);
! /*
!  * #if !defined(CONFIG_ARCH_PXA_SHEPHERD)
!  *		// wait off signal
!  *		// if can not recieve off siganl , so force off.
!  *		time_cnt = jiffies;
!  *		while(1) {
!  *		  if ( ( jiffies - time_cnt )  > 500 ) break;
!  *		  schedule();
!  *		}
!  */
  		// maybe apps is dead, so we have to restart.
  		pm_do_suspend();
! 
! /*		sharpsl_restart(); 
!  * #endif
!  */
  	}
  	return 0;
  }
  
+ 
+ 
+ void slc700_key_suspend(void)
+ {
+ 	apm_wakeup_src_mask = 0;
+ 	sharpsl_chg_freq == 0x0241;
+ 	cpu_xscale_sl_change_speed_241_without_lcd();
+ 	printk("CCCR = 0x0241\n");
+ 
+ 	wake_up(&wq_off);
+ }
+ 
+ EXPORT_SYMBOL(slc700_key_suspend);
+ 
+ 
+ void slc700_key_changefreq(void)
+ {
+ 	sharpsl_chg_freq = ( sharpsl_chg_freq == 0x0161 ) ? 0x0241 : 0x0161; 
+ 
+ 	if ( sharpsl_chg_freq == 0x0241 ) {
+ 
+ 		cpu_xscale_sl_change_speed_241_without_lcd();
+ 
+ 	} else if ( sharpsl_chg_freq == 0x0161 ) {
+ 
+ 		cpu_xscale_sl_change_speed_161();
+ 
+ 	}
+ 
+ 	printk("CCCR = %x\n",sharpsl_chg_freq);
+ 
+ }
+ 
+ EXPORT_SYMBOL(slc700_key_changefreq);
+ 
+ 
+ 
  #if defined(CONFIG_ARCH_PXA_SHEPHERD)
  static struct timer_list bat_switch_timer;
  
*** linux-c750/drivers/char/keyboard.c	2002-12-18 19:27:58.000000000 +0900
--- linux-c750_patch_work/drivers/char/keyboard.c	2003-08-04 22:10:29.000000000 +0900
***************
*** 117,122 ****
--- 117,123 ----
  static struct tty_struct **ttytab;
  static struct kbd_struct * kbd = kbd_table;
  static struct tty_struct * tty;
+ static int scancode2;
  
  static void kbd_processkeycode(unsigned char scancode, char up_flag, int autorepeat);
  void compute_shiftstate(void);
***************
*** 224,229 ****
--- 225,253 ----
  
  void handle_scancode(unsigned char scancode, int down)
  {
+ 
+ 	/* SL-C700 side power 0x6d  */ 
+ 	if ( ( scancode == 0x6d ) && ( down == 0x01 ) ){ 
+ 
+ 		printk("power button\n");
+ 		slc700_key_suspend();
+ 
+ 	/* SL-C700 home key 0x28 menu key 0x1d */
+ 	} else if ( ( scancode == 0x1d ) && ( scancode2 == 0x28 ) ){
+ 
+ 		printk("Change Freq\n");
+ 		slc700_key_changefreq();
+ 
+ 	} else {
+ 
+ 		scancode2 = scancode;
+ 		handle_scancode_main ( scancode, down );
+ 
+ 	}
+ }
+ 
+ void handle_scancode_main(unsigned char scancode, int down)
+ {
  	unsigned char keycode;
  	char up_flag = down ? 0 : 0200;
  	char raw_mode;
