Beispiel #1
0
static void headset_int_handler(void *dev_id)
{
	lprintk(D_AUDIO, KERN_ERR "##(Headset_det.c)## headset_int_handler()!!\n");

	struct headset_switch_data *switch_data =
		(struct headset_switch_data *)dev_id;
	headset_detecting = 1;
	cancel_delayed_work_sync(&switch_data->hook_delayed_work);
	//schedule_work(&switch_data->work);
	NvOdmGpioGetState(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Headset_Detection, &headset_gpio_status);	
	headset_status = headset_gpio_status;

	if(headset_status == 0)
   	{
        schedule_work(&headset_sw_data->delayed_work);
		  #if defined(STAR_COUNTRY_KR) && !defined(CONFIG_MACH_STAR_SKT_REV_A)  
			headset_Mic_Bias(0);
		  #endif
   	}
	else
	{
	    schedule_delayed_work(&headset_sw_data->delayed_work,	msecs_to_jiffies(type_detection_time));	
//P990_IFX_GB_PORTING_LGSI_START
#if !defined (STAR_OPERATOR_FIDO)
	    wake_lock_timeout(&headset_wake_lock, msecs_to_jiffies(type_detection_time + 50));	 //20111017 [email protected] Problem that no wake up when disconn headset in calling
#endif
//P990_IFX_GB_PORTING_LGSI_END
    }
	NvOdmGpioInterruptDone(s_hHeadsetHandle.hheadsetInterrupt);	//20100420 [email protected] for next interrupt (nVidia Interrupt Spec.) [LGE]
//FIDO - GB Porting [09/08/2011] - Start
#if defined (STAR_OPERATOR_FIDO)
	wake_lock_timeout(&headset_wake_lock, msecs_to_jiffies(1500));		 //20110427 [email protected] headset wake lock timeout
#endif
//FIDO - GB Porting [09/08/2011] - End
}
Beispiel #2
0
static void headset_int_handler(void *dev_id)
{
	lprintk(D_AUDIO, KERN_ERR "##(Headset_det.c)## headset_int_handler()!!\n");

	struct headset_switch_data *switch_data =
		(struct headset_switch_data *)dev_id;
	headset_detecting = 1;
	cancel_delayed_work_sync(&switch_data->hook_delayed_work);
	//schedule_work(&switch_data->work);
	NvOdmGpioGetState(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Headset_Detection, &headset_gpio_status);	
	headset_status = headset_gpio_status;

	if(headset_status == 0)
   	{
        schedule_work(&headset_sw_data->delayed_work);
		  #if defined(STAR_COUNTRY_KR) && !defined(CONFIG_MACH_STAR_SKT_REV_A)  
			headset_Mic_Bias(0);
		  #endif
   	}
	else
	{
	    schedule_delayed_work(&headset_sw_data->delayed_work,	msecs_to_jiffies(type_detection_time));	
    }
	NvOdmGpioInterruptDone(s_hHeadsetHandle.hheadsetInterrupt);	//20100420  for next interrupt (nVidia Interrupt Spec.) [LGE]
}
static void Adt7461Isr(void* arg)
{
    NvU8 Data;
    ADT7461PrivData* pPrivData = (ADT7461PrivData*)arg;
    NvOdmInterruptHandler volatile Callback = pPrivData->Callback;
    void* volatile CallbackArg = pPrivData->CallbackArg;
    const ADT7461RegisterInfo* pReg = NULL;

    if (Callback && CallbackArg)
    {
        Callback(CallbackArg);
    }
#if ADT7461_ALERT_DEBOUNCE
    // New range limits set by callback are not guaranteed to take effect
    // before the next temperature conversion is completed, and interrupt
    // can not be cleared until then. Hence, the debounce delay below.
    NvOdmOsSleepMS(s_Adt7461SampleIntervalsMS[pPrivData->ShadowRate] +
                   s_Adt7461ConversionTimesMS[pPrivData->ShadowRate] + 1);
#endif
    // Read status and ARA to finish clearing interrupt after callback
    pReg = &pPrivData->pDeviceInfo->Status;
    (void)Adt7461ReadReg(pPrivData, pReg, &Data);
    Adt7461ReadAra(pPrivData);

    // Re-enable interrupt
    if (pPrivData->hGpioIntr)
        NvOdmGpioInterruptDone(pPrivData->hGpioIntr);
}
Beispiel #4
0
static void
GpioInterruptHandler(void *arg)
{
	NvOdmGpioPinMode mode;

	NvU32 pinValue = 0;
	NvOdmGyroAccelHandle hDevice =  (NvOdmGyroAccelHandle)arg;
	printk(" ## MPU3050 : 5 \n") ;

	NvOdmGpioGetState(hDevice->hGpioINT, hDevice->hPinINT, &pinValue);

	if (pinValue == 1) {
		mode = NvOdmGpioPinMode_InputInterruptLow;
	} else {
		mode = NvOdmGpioPinMode_InputInterruptHigh;
	}

	NvOdmGpioConfig(hDevice->hGpioINT, hDevice->hPinINT, mode);

	if (pinValue == 1) {
		NvOdmOsSemaphoreSignal(hDevice->SemaphoreForINT);
	}
	NvOdmGpioInterruptDone(hDevice->hGpioInterrupt);

	return;
}
Beispiel #5
0
static void star_proxi_interrupt_handler(void *arg)
{
	//When VOUT terminal changes from H to L, enter the this function --> procedure 3
	s_proximity.MVO++; //Update the MVO value
	if( (s_proximity.MVO & 1) == 0 )
	{
		printk("Even Number INT, MVO = %d\n", s_proximity.MVO);
		s_proximity.MVO = 0;
	}
	else
	{
		printk("Odd Number INT, MVO = %d\n", s_proximity.MVO);
		s_proximity.MVO = 1;
	}

    NvOdmGpioInterruptMask(s_proximity.proxi_out_intr, NV_TRUE); //Procedure 4
	if(s_proximity.MVO == 1)
		star_proxi_write_reg(&s_proximity, 0x02, 0x00 );
	else
		star_proxi_write_reg(&s_proximity, 0x02, 0x20 );
	

	star_proxi_write_reg(&s_proximity, 0x06, 0x18 );

	#if STAR_PROX_DEBUG
	printk("PROX interrupt!!!\n");
	printk("PROX interrupt!!!\n");
	#endif
    schedule_work(&s_proximity.work);
   	NvOdmGpioInterruptMask(s_proximity.proxi_out_intr, NV_FALSE);
    NvOdmGpioInterruptDone(s_proximity.proxi_out_intr);
}
Beispiel #6
0
static void headset_irq_handler(void* arg)
{
    NvU32 states;

    //printk("===============================> headset_irq_handler\n");

    NvOdmGpioGetState(s_hGpio,s_hHeadphoneGpioPin,&states);
    if( !states )
    {     
        gHeadsetInsertStatus = HEADSET_STATUS_REMOVE;
        NvOdmGpioConfig(s_hGpio,s_hHeadphoneGpioPin,NvOdmGpioPinMode_InputInterruptHigh );
    }
    else
    {        
        gHeadsetInsertStatus = HEADSET_STATUS_INSERT;
        NvOdmGpioConfig(s_hGpio,s_hHeadphoneGpioPin,NvOdmGpioPinMode_InputInterruptLow );
    }


	//schedule_work(&switch_data->work);
    if ( g_hDetectEventSema )
        NvOdmOsSemaphoreSignal( g_hDetectEventSema );


    if (s_hGpioIntr_Headphone)
        NvOdmGpioInterruptDone(s_hGpioIntr_Headphone);

	return;
}
Beispiel #7
0
static void muic_interrupt_handler(void* arg)
{
    lprintk(D_MUIC, "%s: MUIC interrupt occured!\n", __func__);
    wake_lock_timeout(&s_hMuicHandle.wlock, HZ/2/*500ms*/);
    lprintk(D_MUIC, "%s: Wake_Lock_Timeout applied!  500msec Start !\n", __func__);  
    schedule_delayed_work(&muic_wq, msecs_to_jiffies(300));
    NvOdmGpioInterruptDone(s_hMuicHandle.hGpioInterrupt);
}
Beispiel #8
0
static void powerkey_interrupt_handler(void* arg)
{
    PowerKeyDevice *powerKeyDevice = (PowerKeyDevice *)arg;
    
    if (pwky_shutdown)
    {
        NvOdmGpioInterruptDone(s_powerkey.intHandle);
        return;
    }
    printk("powerkey_interrupt_handler\n");
#ifdef POWERKEY_DELAYED_WORKQUEUE
    schedule_delayed_work(&powerKeyDevice->work, msecs_to_jiffies(20));
    wake_lock_timeout(&s_powerkey.wlock, msecs_to_jiffies(50));
#else
    schedule_work(&powerKeyDevice->work);
#endif
    NvOdmGpioInterruptDone(s_powerkey.intHandle);
}
NvBool Synaptics_OneTouch_HandleInterrupt(NvOdmOneTouchDeviceHandle hDevice)
{
	Synaptics_OneTouch_Device* hTouch = (Synaptics_OneTouch_Device*)hDevice;

	NVODMTOUCH_PRINTF(("[ONETOUCH] Synaptics_OneTouch_HandleInterrupt\n"));

	NvOdmGpioInterruptDone(hTouch->hGpioIntr);

    return NV_TRUE;
}
static void dock_h2w_switch_irq_isr(void *args)
{
	struct h2w_switch_dev *hsdev;

	logd("dock_h2w_switch_irq_isr\r\n");

	hsdev = (struct h2w_switch_dev *)args;
	queue_work(hsdev->workqueue, &hsdev->work);
	NvOdmGpioInterruptDone(hsdev->dock_hp_det_irq);
}
Beispiel #11
0
NvBool EETI_HandleInterrupt(NvOdmTouchDeviceHandle hDevice) {
    EETI_TouchDevice* hTouch = (EETI_TouchDevice*)hDevice;
    NvU32 pinValue;

    NvOdmGpioGetState(hTouch->hGpio, hTouch->hPin, &pinValue);
    if (!pinValue) {
        //interrupt pin is still LOW, read data until interrupt pin is released.
        return NV_FALSE;
    } else
        NvOdmGpioInterruptDone(hTouch->hGpioIntr);

    return NV_TRUE;
}
Beispiel #12
0
static void headset_hook_int_handler(void *dev_id)
{
    
	//lprintk(D_AUDIO, KERN_ERR "##(Headset_det.c)## headset_hook_int_handler()!! detecting %d headset type %d\n", headset_detecting, headset_type );
    NvOdmGpioGetState(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Hookkey_Detection, &hook_gpio);

    if( block_hook_int ){
		NvOdmGpioInterruptDone(s_hHeadsetHandle.hhookInterrupt);
        return;
	}
	
	struct headset_switch_data	*switch_data =
	    (struct headset_switch_data *)dev_id;

	lprintk(D_AUDIO, KERN_ERR "##(Headset_det.c)## headset_hook_int_handler()!! detecting %d headset type %d\n", headset_detecting, headset_type );
    
	if( (headset_detecting == 1) || (headset_type != STAR_HEADSET)){
		NvOdmGpioInterruptDone(s_hHeadsetHandle.hhookInterrupt);
	}
	else{
		//lprintk(D_AUDIO, KERN_ERR "##(Headset_det.c)## headset_hook_int_handler()!!\n");
		//20101125, [email protected], hookkey press is skipped When wakeup from LP1 [START]
        if(suspend_status){
            schedule_work(&switch_data->hook_delayed_work);
        }else{
        //20101125, [email protected], hookkey press is skipped When wakeup from LP1 [END]
        
            if(hook_gpio){
                schedule_delayed_work(&switch_data->hook_delayed_work,	msecs_to_jiffies(hook_release_time));
            }
            else{
		        schedule_delayed_work(&switch_data->hook_delayed_work,	msecs_to_jiffies(hook_press_time));
            }
        
        }
        NvOdmGpioInterruptDone(s_hHeadsetHandle.hhookInterrupt);	
	}
}
Beispiel #13
0
static void powerkey_interrupt_handler(void* arg)
{
    PowerKeyDevice *powerKeyDevice = (PowerKeyDevice *)arg;
    
    if (pwky_shutdown)
    {
        NvOdmGpioInterruptDone(s_powerkey.intHandle);
        return;
    }
    printk("powerkey_interrupt_handler\n");
//20110324, , LP1 powerkey skip issue [START]
    if(core_lock_on && key_wakeup_ISR==0){
        LP1_key_wake = 1;
    }
//20110324, , LP1 powerkey skip issue [END]
#ifdef POWERKEY_DELAYED_WORKQUEUE
    schedule_delayed_work(&powerKeyDevice->work, msecs_to_jiffies(20));
    wake_lock_timeout(&s_powerkey.wlock, msecs_to_jiffies(50));
#else
    schedule_work(&powerKeyDevice->work);
#endif
    NvOdmGpioInterruptDone(s_powerkey.intHandle);
}
static void GpioInterruptHandler(void *arg)
{
    NvU32 pinValue;
    NvOdmEcompassHandle hDevice =  (NvOdmEcompassHandle)arg;
	
    NvOdmGpioGetState(hDevice->hGpioINT, hDevice->hPinINT, &pinValue);
    if (pinValue == 1)
    {
		NvOdmEcompasspioInterruptMask(hDevice);				/* Daniel 20101122 <<< */
		NvOdmOsSemaphoreSignal(hDevice->SemaphoreForINT);
    }
    NvOdmGpioInterruptDone(hDevice->hGpioInterrupt);
    return;
}
Beispiel #15
0
static void star_hall_intr_handler( void *arg )
{
	NvU32 gpio_status;
	//NvOdmGpioInterruptMask(g_hall->h_hall_intr, NV_TRUE );// NV_FALSE --> enable intr , NV_TRUE --> disable
	NvOdmGpioGetState(g_hall->h_hall_gpio, g_hall->h_hall_gpio_pin, &gpio_status );
	printk("--------------------------------------------------detecting value = %d\n", gpio_status);
	if( gpio_status == 0 )
		{atomic_set( &sensing_hall, 0 );input_report_abs(g_hall->input_device, ABS_HAT2X, 0);input_sync(g_hall->input_device);}
	else if( gpio_status == 1 )
		{atomic_set( &sensing_hall, 1 );input_report_abs(g_hall->input_device, ABS_HAT2X, 1);input_sync(g_hall->input_device);}

	//NvOdmGpioInterruptMask(g_hall->h_hall_intr, NV_FALSE);// NV_FALSE --> enable intr , NV_TRUE --> disable

	/* 2 == CAR */
	switch_set_state(&g_hall->sdev, gpio_status ? 0 : 2);

	NvOdmGpioInterruptDone(g_hall->h_hall_intr);
}
Beispiel #16
0
/* get GPIO_PU3 status and set it into global variable gUsbCurrLimitC */
static void UsbCurLimitGpioInterruptHandler(void *arg)
{
	NvU32 CurrSelectPinState = 0;
	
	

	
	NvOdmGpioGetState(s_hGpio, s_hOvrrCurPin, &CurrSelectPinState);

	NvOsDebugNprintf ("###INterrupt#####\n");
	//gUsbCurrLimitC = ( CurrSelectPinState ) ? 1 : 0;
	gUsbCurrLimitC = CurrSelectPinState;
	
	NvOsDebugNprintf ("CurrSelectPinState = %d\n",CurrSelectPinState);
	NvOsDebugNprintf("======>i=%d, gUsbCurrLimitC=%d\n", i, gUsbCurrLimitC);
	i = i++;
	NvOdmGpioInterruptDone(IntrHandle);
}
static void GpioInterruptHandler(void *arg)
{
    NvU32 pinValue;
    NvU8 ret;
    NvU8 buffer[SENSOR_DATA_SIZE];
    NvU8 i;
    NvOdmEcompassHandle hDevice =  (NvOdmEcompassHandle)arg;
    NvOdmGpioGetState(hDevice->hGpioINT, hDevice->hPinINT, &pinValue);

    if (pinValue == 1)
    {
        ret=ReadReg(hDevice, AK8975_REG_ST1, buffer, SENSOR_DATA_SIZE);
        if (ret<0) {
            NVODMECOMPASS_PRINTF(("AKM8975 compass driver: I2C failed\n"));
            return;
        }
        /* Check ST bit */
        if ((buffer[0] & 0x01) != 0x01)
        {
            NVODMECOMPASS_PRINTF(("AKM8975 akm8975_work_func: ST is not set\n"));
            return;
        }
        /* Check ST2 bit */
        if (((buffer[7]&0x04)==0x04)||((buffer[7]&0x08)==0x08))
        {
            NVODMECOMPASS_PRINTF(("AKM8975 akm8975_work_func: Data is Fail\n"));
            return;
        }
        NvOdmOsMemcpy(ecompass_buffer,buffer,SENSOR_DATA_SIZE);
#if 0
        NVODMECOMPASS_PRINTF(("\n"));
        NVODMECOMPASS_PRINTF((" GPIO handle :\n"));
        for (i=0; i<SENSOR_DATA_SIZE; i++) {
            NVODMECOMPASS_PRINTF((" Reg %d : [%02x]\n",i,ecompass_buffer[i]));
        }
#endif
        NvOdmOsSemaphoreSignal(hDevice->SemaphoreForINT);
    }
    NvOdmGpioInterruptDone(hDevice->hGpioInterrupt);
    return;
}