Esempio n. 1
0
static void felica_int_low_work(struct work_struct *data)
{
  int rc = 0;

  lock_felica_wake_lock();
  disable_irq_nosync(gpio_to_irq(GPIO_FELICA_INT));

  usermodehelper_enable();
   
  //#ifdef FEATURE_DEBUG_LOW
  FELICA_DEBUG_MSG("[FELICA_RWS] felica_int_low_work - start \n");
  //#endif

  rc = invoke_felica_apk();

  if(rc)
  {
    FELICA_DEBUG_MSG("[FELICA_RWS] Error - invoke app \n");
    unlock_felica_wake_lock();    	
  }
  
  //#ifdef FEATURE_DEBUG_LOW
  FELICA_DEBUG_MSG("[FELICA_RWS] felica_int_low_work - end \n");
  //#endif

  enable_irq(gpio_to_irq(GPIO_FELICA_INT));
}
Esempio n. 2
0
/*
* Description :
* Input :
* Output :
*/
static int felica_open (struct inode *inode, struct file *fp)
{
  int rc = 0;

  #ifdef FEATURE_DEBUG_LOW
  FELICA_DEBUG_MSG("[FELICA] felica_open() is called \n");
  #endif

  /* Check input parameters */
  if(NULL == fp)
  {
    FELICA_DEBUG_MSG("[FELICA] ERROR - fp \n");
    return -1;
  }

  /* FileInputStream and FileOutPutStream open felica
     Only one case has to be excuted */

  if(UART_STATUS_NOT_OPEN == uart_status)
  {
    uart_status = UART_STATUS_RX;
  }
  else if(UART_STATUS_RX == uart_status)
  {
    #ifdef FEATURE_DEBUG_LOW
    FELICA_DEBUG_MSG("[FELICA] /dev/felica RX is already openned. \n");
    #endif

    uart_status = UART_STATUS_RX_TX;

    return 0;
  }
  else
  {
    #ifdef FEATURE_DEBUG_LOW
    FELICA_DEBUG_MSG("[FELICA] /dev/felica RX/TX are already openned. \n");
    #endif

    return 0;
  }

  rc = felica_uart_open();

  //mdelay(100);

  if(rc)
  {
    FELICA_DEBUG_MSG("[FELICA] ERROR - open_hs_uart \n");
    uart_status = UART_STATUS_NOT_OPEN;
    unlock_felica_wake_lock();
    return rc;
  }

  lock_felica_wake_lock();

  #ifdef FEATURE_DEBUG_LOW
  FELICA_DEBUG_MSG("[FELICA] felica_open - end \n");
  #endif

#ifdef FELICA_FN_DEVICE_TEST
  FELICA_DEBUG_MSG("[FELICA] felica_open - result_open(%d) \n",result_open_uart);
  return result_open_uart;
#else
  return 0;
#endif

}