int mdm_rts_low(void) { unsigned int pin_val = 0; NvOdmServicesGpioHandle h_gpio; NvOdmGpioPinHandle h_uart1_rtspin; printk("%s \n", __func__); h_gpio = NvOdmGpioOpen(); if (!h_gpio) { printk("%s: NvOdmGpioOpen Error\n", __func__); goto error_open_gpio_fail; } h_uart1_rtspin = NvOdmGpioAcquirePinHandle(h_gpio, 'o' - 'a', 3); if (!h_uart1_rtspin) { printk("%s: Couldn't NvOdmGpioAcquirePinHandle pin\n", __func__); goto error_open_gpio_pin_acquire_fail; } NvOdmGpioSetState( h_gpio, h_uart1_rtspin, 0x1); NvOdmGpioConfig( h_gpio, h_uart1_rtspin, NvOdmGpioPinMode_Output); NvOdmGpioGetState( h_gpio, h_uart1_rtspin, &pin_val); printk("ifx_reset_high - [CP RTS]: pin %d\n", pin_val); NvOdmGpioReleasePinHandle(h_gpio, h_uart1_rtspin); NvOdmGpioClose(h_gpio); return 0; error_open_gpio_pin_acquire_fail: NvOdmGpioClose(h_gpio); error_open_gpio_fail: return -ENOSYS; }
static int powerkey_remove(struct platform_device *pdev) { //20100703, [email protected], PMIC reset [START] sysfs_remove_group(&pdev->dev.kobj, &star_pmic_group); sysfs_remove_group(&pdev->dev.kobj, &star_hwsku_group); sysfs_remove_group(&pdev->dev.kobj, &star_reset_group); //20101110, [email protected], Function for Warm-boot //20100703, [email protected], PMIC reset [END] //20100610, [email protected], sleep status gpio for modem [START] #ifdef AP_SUSPEND_STATUS NvOdmGpioReleasePinHandle(s_modemCheck.gpioHandle, s_modemCheck.pinHandle); NvOdmGpioClose(s_modemCheck.gpioHandle); #endif //20100610, [email protected], sleep status gpio for modem [END] input_unregister_device(s_powerkey.inputDev); input_free_device(s_powerkey.inputDev); NvOdmGpioInterruptUnregister(s_powerkey.gpioHandle, s_powerkey.pinHandle, s_powerkey.intHandle); NvOdmGpioReleasePinHandle(s_powerkey.gpioHandle, s_powerkey.pinHandle); NvOdmGpioClose(s_powerkey.gpioHandle); #ifdef POWERKEY_DELAYED_WORKQUEUE wake_lock_destroy(&s_powerkey.wlock); #endif return 0; }
int mdm_reset(void) { unsigned int pin_val = 0; NvOdmServicesGpioHandle h_gpio; NvOdmGpioPinHandle h_gpiopin; NvOdmGpioPinHandle h_uart1_rtspin; printk("%s \n", __func__); h_gpio = NvOdmGpioOpen(); if (!h_gpio) { printk("%s: NvOdmGpioOpen Error\n", __func__); goto error_open_gpio_fail; } h_gpiopin = NvOdmGpioAcquirePinHandle(h_gpio, 'v' - 'a', 0); if (!h_gpiopin) { printk("%s: Couldn't NvOdmGpioAcquirePinHandle pin\n", __func__); goto error_open_gpio_pin_acquire_fail; } h_uart1_rtspin = NvOdmGpioAcquirePinHandle(h_gpio, 'o' - 'a', 3); if (!h_uart1_rtspin) { printk("%s: Couldn't NvOdmGpioAcquirePinHandle pin\n", __func__); goto error_open_gpio_pin_acquire_fail; } NvOdmGpioSetState( h_gpio, h_uart1_rtspin, 0x1); NvOdmGpioConfig( h_gpio, h_uart1_rtspin, NvOdmGpioPinMode_Output); NvOdmGpioGetState( h_gpio, h_uart1_rtspin, &pin_val); printk("ifx_reset_high - [CP RTS]: pin %d\n", pin_val); //reset Communication Processor (GPIO_PV0: high -> 1000ms -> low -> 3000ms -> high) NvOdmGpioSetState( h_gpio, h_gpiopin, 0x1); NvOdmGpioConfig( h_gpio, h_gpiopin, NvOdmGpioPinMode_Output); msleep(1000); NvOdmGpioSetState( h_gpio, h_gpiopin, 0x0); msleep(3000); NvOdmGpioSetState( h_gpio, h_gpiopin, 0x1); NvOdmGpioGetState( h_gpio, h_gpiopin, &pin_val); printk("ifx_reset_high - [CP RESET]: pin %d\n", pin_val); NvOdmGpioReleasePinHandle(h_gpio, h_uart1_rtspin); NvOdmGpioReleasePinHandle(h_gpio, h_gpiopin); NvOdmGpioClose(h_gpio); return 0; error_open_gpio_pin_acquire_fail: NvOdmGpioClose(h_gpio); error_open_gpio_fail: return -ENOSYS; }
static int h2w_switch_remove(struct platform_device *pdev) { struct h2w_switch_dev *hsdev; hsdev = (struct h2w_switch_dev *)platform_get_drvdata(pdev); #ifdef CONFIG_SWITCH_DOCK_H2W #if !TIMER_DEALER NvOdmGpioInterruptUnregister(hsdev->gpio, hsdev->dock_hp_det_pin, hsdev->dock_hp_det_irq); #endif #endif #if !TIMER_DEALER NvOdmGpioInterruptUnregister(hsdev->gpio, hsdev->hp_det_pin, hsdev->hp_det_irq); #endif destroy_workqueue(hsdev->workqueue); switch_dev_unregister(&hsdev->sdev); #ifdef CONFIG_SWITCH_DOCK_H2W NvOdmGpioReleasePinHandle(hsdev->gpio, hsdev->dock_hp_det_pin); #endif NvOdmGpioReleasePinHandle(hsdev->gpio, hsdev->hp_det_pin); NvOdmGpioClose(hsdev->gpio); kfree(hsdev); return 0; }
void Synaptics_OneTouch_Close (NvOdmOneTouchDeviceHandle hDevice) { Synaptics_OneTouch_Device* hTouch = (Synaptics_OneTouch_Device*)hDevice; NVODMTOUCH_PRINTF(("[Touch Driver] Synaptics_OneTouch_Close\n")); if (!hTouch) return; // 20101120 [email protected] power off when Onetouch close #if defined(CONFIG_MACH_STAR_SKT_REV_E) || defined(CONFIG_MACH_STAR_SKT_REV_F) Synaptics_OneTouch_PowerOnOff(&hTouch->OdmOneTouch, NV_FALSE); #endif if (hTouch->hGpio) { if (hTouch->hPin) { if (hTouch->hGpioIntr) NvOdmGpioInterruptUnregister(hTouch->hGpio, hTouch->hPin, hTouch->hGpioIntr); NvOdmGpioReleasePinHandle(hTouch->hGpio, hTouch->hPin); } NvOdmGpioClose(hTouch->hGpio); } if (hTouch->hOdmI2c) NvOdmI2cClose(hTouch->hOdmI2c); NvOdmOsFree(hTouch); }
void NvOdmAccelClose(NvOdmAccelHandle hDevice) { if(NULL != hDevice) { if(NULL != hDevice->SemaphoreForINT && NULL != hDevice->hGpioINT && NULL != hDevice->hPinINT && NULL != hDevice->hGpioInterrupt) { NvOdmGpioInterruptUnregister(hDevice->hGpioINT, hDevice->hPinINT, hDevice->hGpioInterrupt); NvOdmOsSemaphoreDestroy(hDevice->SemaphoreForINT); NvOdmGpioReleasePinHandle(hDevice->hGpioINT, hDevice->hPinINT); NvOdmGpioClose(hDevice->hGpioINT); } NvAccelerometerI2CClose(hDevice->hOdmI2C); // Power off accelermeter NvAccelerometerSetPowerRail(hDevice->hPmu, hDevice->VddId, NV_FALSE); if (hDevice->hPmu) { //NvAccelerometerSetPowerOn(0); NvOdmServicesPmuClose(hDevice->hPmu); } return; } }
static void vib_close( ) { NvU32 RequestedPeriod,ReturnedPeriod; NvU32 DutyCycle; if ( g_vib != NULL ) { NvOdmServicesPmuClose( g_vib->h_vib_pmu ); g_vib->h_vib_pmu = NULL; g_vib->vdd_id = 0; NvOdmGpioReleasePinHandle( g_vib->h_vib_gpio, g_vib->h_vib_gpio_pin ); NvOdmGpioClose( g_vib->h_vib_gpio ); if ( g_vib->hOdmPwm!= NULL ) { RequestedPeriod = 90000; // 49000; DutyCycle = 0x00320000; // 0x00630000; NvOdmPwmConfig( g_vib->hOdmPwm, NvOdmPwmOutputId_PWM3, NvOdmPwmMode_Disable, DutyCycle, &RequestedPeriod, &ReturnedPeriod ); } kfree( g_vib ); g_vib = NULL; } }
void NvOdmGyroAccelClose(NvOdmGyroAccelHandle hDevice) { if (NULL != hDevice) { if (NULL != hDevice->SemaphoreForINT && NULL != hDevice->hGpioINT && NULL != hDevice->hPinINT && NULL != hDevice->hGpioInterrupt) { NvOdmGpioInterruptUnregister(hDevice->hGpioINT, hDevice->hPinINT, hDevice->hGpioInterrupt); NvOdmOsSemaphoreDestroy(hDevice->SemaphoreForINT); NvOdmGpioReleasePinHandle(hDevice->hGpioINT, hDevice->hPinINT); NvOdmGpioClose(hDevice->hGpioINT); } NvGyroAccelI2CClose(hDevice->hOdmI2C); #if 1 printk(" ## MPU3050 : [%s:%d] \n",__FUNCTION__, __LINE__) ; #endif // Power off accelermeter NvGyroAccelSetPowerRail(hDevice->hPmu, hDevice->VddId, NV_FALSE); if (hDevice->hPmu) { //NvGyroAccelSetPowerOn(0); NvOdmServicesPmuClose(hDevice->hPmu); } return; } }
NvOdmUsbUlpiHandle NvOdmUsbUlpiOpen(NvU32 Instance) { NvOdmUsbUlpi*pDevice = NULL; NvU32 ClockInstances[MAX_CLOCKS]; NvU32 ClockFrequencies[MAX_CLOCKS]; NvU32 NumClocks; pDevice = NvOdmOsAlloc(sizeof(NvOdmUsbUlpi)); if(pDevice == NULL) return NULL; if(!NvOdmExternalClockConfig(SMSC3317GUID, NV_FALSE, ClockInstances, ClockFrequencies, &NumClocks)) { NV_DRIVER_TRACE (("ERROR NvOdmUsbUlpiOpen: " "NvOdmExternalClockConfig fail\n")); goto ExitUlpiOdm; } NvOdmOsSleepMS(10); if (!s_hGpio) s_hGpio = NvOdmGpioOpen(); if (!s_hGpio) { NV_DRIVER_TRACE (("ERROR NvOdmUsbUlpiOpen: " "Not able to open gpio handle\n")); goto ExitUlpiOdm; } if (!s_hResetPin) s_hResetPin = NvOdmGpioAcquirePinHandle(s_hGpio, ULPI_RESET_PORT, ULPI_RESET_PIN); if (!s_hResetPin) { NvOdmGpioClose(s_hGpio); s_hGpio = NULL; NV_DRIVER_TRACE (("ERROR NvOdmGpioAcquirePinHandle: " "Not able to Acq pinhandle\n")); goto ExitUlpiOdm; } // Pull high on RESETB ( 22nd pin of smsc3315) // config as out put pin NvOdmGpioConfig(s_hGpio,s_hResetPin, NvOdmGpioPinMode_Output); // Set low to write high on ULPI_RESETB pin NvOdmGpioSetState(s_hGpio, s_hResetPin, 0x01); NvOdmGpioSetState(s_hGpio, s_hResetPin, 0x0); NvOdmOsSleepMS(5); NvOdmGpioSetState(s_hGpio, s_hResetPin, 0x01); pDevice->CurrentGUID = SMSC3317GUID; return pDevice; ExitUlpiOdm: NvOdmOsFree(pDevice); return NULL; }
/* * Connect semaphore with interrupt pins according to your configuration. */ NvBool NvAccelerometerConnectSemaphore(NvOdmAccelHandle hDevice) { NvOdmGpioPinMode mode; NvOdmInterruptHandler callback = (NvOdmInterruptHandler)GpioInterruptHandler; hDevice->hGpioINT = (NvOdmServicesGpioHandle)NvOdmGpioOpen(); if(!(hDevice->hGpioINT)) { //NVODMACCELEROMETER_PRINTF("NvOdm Accelerometer : NvOdmGpioOpen Error \n"); return NV_FALSE; } hDevice->hPinINT = NvOdmGpioAcquirePinHandle(hDevice->hGpioINT, hDevice->GPIOPortINT, hDevice->GPIOPinINT); hDevice->SemaphoreForINT = NvOdmOsSemaphoreCreate(0); if(!(hDevice->SemaphoreForINT)) { //NVODMACCELEROMETER_PRINTF("NvOdm Accelerometer : NvOdmOsSemaphoreCreate Error \n"); NvOdmGpioClose(hDevice->hGpioINT); return NV_FALSE; } mode = NvOdmGpioPinMode_InputInterruptHigh; if (NvOdmGpioInterruptRegister(hDevice->hGpioINT, &hDevice->hGpioInterrupt, hDevice->hPinINT, mode, callback, hDevice, NV_DEBOUNCE_TIME_MS) == NV_FALSE) { return NV_FALSE; } if(!(hDevice->hGpioInterrupt)) { //NVODMACCELEROMETER_PRINTF("NvOdm Accelerometer : NvOdmGpioInterruptRegister Error \n"); NvOdmGpioClose(hDevice->hGpioINT); NvOdmOsSemaphoreDestroy(hDevice->SemaphoreForINT); return NV_FALSE; } return NV_TRUE; }
static NvBool ConnectSemaphore(NvOdmEcompassHandle hDevice) { NvOdmGpioPinMode mode; NvOdmInterruptHandler callback = (NvOdmInterruptHandler)GpioInterruptHandler; hDevice->hGpioINT = (NvOdmServicesGpioHandle)NvOdmGpioOpen(); if (!(hDevice->hGpioINT)) { NVODMECOMPASS_PRINTF(("AKM8975 compass driver: NvOdmGpioOpenError \n")); return NV_FALSE; } hDevice->hPinINT = NvOdmGpioAcquirePinHandle(hDevice->hGpioINT, hDevice->GPIOPortINT, hDevice->GPIOPinINT); hDevice->SemaphoreForINT = NvOdmOsSemaphoreCreate(0); if (!(hDevice->SemaphoreForINT)) { NVODMECOMPASS_PRINTF(( "AKM8975 compass driver: NvOdmOsSemaphoreCreate Error \n")); NvOdmGpioClose(hDevice->hGpioINT); return NV_FALSE; } mode = NvOdmGpioPinMode_InputInterruptHigh; if (NvOdmGpioInterruptRegister(hDevice->hGpioINT, &hDevice->hGpioInterrupt, hDevice->hPinINT, mode, callback, hDevice, NV_DEBOUNCE_TIME_MS) == NV_FALSE) { return NV_FALSE; } if (!(hDevice->hGpioInterrupt)) { NVODMECOMPASS_PRINTF(("AKM8975 compass driver: NvOdm Ecompass NvOdmGpioInterruptRegister Error \n")); NvOdmGpioClose(hDevice->hGpioINT); NvOdmOsSemaphoreDestroy(hDevice->SemaphoreForINT); return NV_FALSE; } return NV_TRUE; }
//101106, [email protected], FOTA update [START] int fota_ebl_download(void) { static NvOdmServicesGpioHandle hCprom = NULL; static NvOdmGpioPinHandle hIFX_Reset = NULL; int ret; if(hCprom == NULL) { hCprom = NvOdmGpioOpen(); if (!hCprom) { lprintk(D_MUIC, "%s: NvOdmGpioOpen Error \n", __func__); goto error_open_gpio_fail; } } if(hIFX_Reset == NULL) { hIFX_Reset = NvOdmGpioAcquirePinHandle(hCprom, 'v' - 'a', 0); if (!hIFX_Reset) { lprintk(D_MUIC, "%s: Couldn't NvOdmGpioAcquirePinHandle pin \n", __func__); goto error_open_gpio_pin_acquire_fail; } } NvOdmGpioConfig(hCprom, hIFX_Reset, NvOdmGpioPinMode_Output); #if defined(CONFIG_MACH_STAR_REV_D) || defined(CONFIG_MACH_STAR_REV_E) NvOdmGpioSetState(s_hMuicHandle.hGpio, s_hMuicHandle.h_USB_VBUS_EN, DISABLE); #endif NvOdmGpioSetState(s_hMuicHandle.hGpio, s_hMuicHandle.h_AP20_UART_SW, 0x0); NvOdmGpioSetState(s_hMuicHandle.hGpio, s_hMuicHandle.h_IFX_UART_SW, 0x0); //change USB path from AP to CP //Set_MAX14526_CP_USB_Mode(); NvOdmOsSleepMS(5000); //change TEST_GPIO state from low to high (GPIO_PV0) NvOdmGpioSetState(hCprom, hIFX_Reset, 0); NvOdmGpioGetState(hCprom, hIFX_Reset, &ret); lprintk(D_MUIC, "%s: hIFX_Reset is %d \n", __func__, ret); NvOdmOsSleepMS(10); NvOdmGpioSetState(hCprom, hIFX_Reset, 1); NvOdmGpioGetState(hCprom, hIFX_Reset, &ret); lprintk(D_MUIC, "%s: hIFX_Reset is %d \n", __func__, ret); return 0; error_open_gpio_pin_acquire_fail: NvOdmGpioClose(hCprom); error_open_gpio_fail: return -ENOSYS; }
NvBool NvGyroAccelConnectSemaphore(NvOdmGyroAccelHandle hDevice) { NvOdmGpioPinMode mode; NvOdmInterruptHandler callback = (NvOdmInterruptHandler)GpioInterruptHandler; printk(" ## MPU3050 : NvGyroAccelConnectSemaphore \n") ; hDevice->hGpioINT = (NvOdmServicesGpioHandle)NvOdmGpioOpen(); if (!(hDevice->hGpioINT)) { printk("## NvOdm GyroAccel : NvOdmGpioOpen Error ## \n"); return NV_FALSE; } hDevice->hPinINT = NvOdmGpioAcquirePinHandle(hDevice->hGpioINT, hDevice->GPIOPortINT, hDevice->GPIOPinINT); hDevice->SemaphoreForINT = NvOdmOsSemaphoreCreate(0); if (!(hDevice->SemaphoreForINT)) { printk("## NvOdm GyroAccel : NvOdmOsSemaphoreCreate Error ## \n"); NvOdmGpioClose(hDevice->hGpioINT); return NV_FALSE; } mode = NvOdmGpioPinMode_InputInterruptHigh; if (NvOdmGpioInterruptRegister(hDevice->hGpioINT, &hDevice->hGpioInterrupt, hDevice->hPinINT, mode, callback, hDevice, NV_DEBOUNCE_TIME_MS) == NV_FALSE) { printk("NvOdm GyroAccel : cannot register interrupt.\n") ; return NV_FALSE; } if (!(hDevice->hGpioInterrupt)) { NvOdmGpioClose(hDevice->hGpioINT); NvOdmOsSemaphoreDestroy(hDevice->SemaphoreForINT); return NV_FALSE; } return NV_TRUE; }
static int __devexit Msensor_remove(struct platform_device *pdev) { //printk("==============>Msensor_remove\r\n"); ms3c_ControlStatus(STATUS_SUSPEND); if( s_hResetGpioPin ) NvOdmGpioReleasePinHandle(s_hGpio, s_hResetGpioPin); if( s_hGpio ) NvOdmGpioClose(s_hGpio); return 0; }
static void Adt7461FreePrivData(ADT7461PrivData* pPrivData) { if (pPrivData) { if (pPrivData->hGpioIntr) { NvOdmGpioInterruptUnregister( pPrivData->hGpio, pPrivData->hGpioPin, pPrivData->hGpioIntr); } NvOdmI2cClose(pPrivData->hOdmI2C); NvOdmGpioReleasePinHandle(pPrivData->hGpio, pPrivData->hGpioPin); NvOdmGpioClose(pPrivData->hGpio); NvOdmServicesPmuClose(pPrivData->hOdmPmuSevice); NvOdmOsFree(pPrivData); } }
static int proximity_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; star_proxi_disable(&s_proximity); sysfs_remove_group(&dev->kobj, &star_proxi_group); input_unregister_device(s_proximity.input_dev); NvOdmGpioInterruptUnregister(s_proximity.proxi_out_gpio, s_proximity.proxi_out_gpio_pin, s_proximity.proxi_out_intr); NvOdmGpioReleasePinHandle(s_proximity.proxi_out_gpio, s_proximity.proxi_out_gpio_pin); NvOdmGpioClose(s_proximity.proxi_out_gpio); NvOdmI2cClose(s_proximity.gen2_i2c); return 0; }
static int headsetdet_remove(struct platform_device *pdev) { lprintk(D_AUDIO, KERN_ERR "##(Headset_det.c)## headsetdet_remove() : headset detection ended..!!\n"); //20100421 [email protected] [LGE] struct headset_switch_data *switch_data = platform_get_drvdata(pdev); //20101125, [email protected], hookkey press is skipped When wakeup from LP1 [START] //wake_lock_destroy(&hook_det_lock); //20101125, [email protected], hookkey press is skipped When wakeup from LP1 [END] if (headset_h_pmu) NvOdmServicesPmuClose(headset_h_pmu); cancel_work_sync(&switch_data->work); cancel_delayed_work_sync(&switch_data->delayed_work); //P990_IFX_GB_PORTING_LGSI_START //FIDO - GB Porting [09/08/2011] - Start #if 1 //defined (STAR_OPERATOR_FIDO) wake_lock_destroy(&headset_wake_lock); //20110425 [email protected] headset wake lock timeout #endif //FIDO - GB Porting [09/08/2011] - End //P990_IFX_GB_PORTING_LGSI_END /*====================== nVidia GPIO Control(S) =======================*/ NvOdmGpioInterruptUnregister(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Headset_Detection, s_hHeadsetHandle.hheadsetInterrupt); NvOdmGpioInterruptUnregister(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Hookkey_Detection, s_hHeadsetHandle.hhookInterrupt); //20100421 [email protected] for Hookkey [LGE] NvOdmGpioReleasePinHandle(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Headset_Detection); NvOdmGpioReleasePinHandle(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Hookkey_Detection); //20100421 [email protected] for Hookkey [LGE] NvOdmGpioClose(s_hHeadsetHandle.hGpio); /*====================== nVidia GPIO Control(E) =======================*/ switch_dev_unregister(&switch_data->sdev); input_unregister_device(switch_data->ip_dev); //20100421 [email protected] for Hookkey [LGE] kfree(switch_data); return 0; }
void ifx_reset_high(void) { unsigned int pin_val = 0; NvOdmServicesGpioHandle h_gpio; NvOdmGpioPinHandle h_gpiopin; printk("%s HIGH\n", __func__); h_gpio = NvOdmGpioOpen(); h_gpiopin = NvOdmGpioAcquirePinHandle(h_gpio, 'v' - 'a', 0); NvOdmGpioConfig( h_gpio, h_gpiopin, NvOdmGpioPinMode_Output); NvOdmGpioSetState( h_gpio, h_gpiopin, 0x1); NvOdmGpioGetState( h_gpio, h_gpiopin, &pin_val); printk("ifx_reset_high - [CP RESET]: pin %d\n", pin_val); NvOdmGpioReleasePinHandle(h_gpio, h_gpiopin); NvOdmGpioClose(h_gpio); }
void NvOdmUsbUlpiClose(NvOdmUsbUlpiHandle hOdmUlpi) { if (hOdmUlpi->hResetPin) { NvOdmGpioSetState(hOdmUlpi->hGpio, hOdmUlpi->hResetPin, 0x0); NvOdmGpioReleasePinHandle(hOdmUlpi->hGpio, hOdmUlpi->hResetPin); hOdmUlpi->hResetPin = NULL; } if (hOdmUlpi->hGpio) { NvOdmGpioClose(hOdmUlpi->hGpio); hOdmUlpi->hGpio = NULL; } if (hOdmUlpi) { NvOdmOsFree(hOdmUlpi); } }
static int h2w_switch_remove(struct platform_device *pdev) { struct h2w_switch_dev *hsdev; hsdev = (struct h2w_switch_dev *)platform_get_drvdata(pdev); NvOdmGpioInterruptUnregister(hsdev->gpio, hsdev->hp_det_pin, hsdev->hp_det_irq); NvOdmGpioReleasePinHandle(hsdev->gpio, hsdev->hp_det_pin); if (hsdev->have_dock_hp) { NvOdmGpioInterruptUnregister(hsdev->gpio, hsdev->dock_hp_det_pin, hsdev->dock_hp_det_irq); NvOdmGpioReleasePinHandle(hsdev->gpio, hsdev->dock_hp_det_pin); } NvOdmGpioClose(hsdev->gpio); destroy_workqueue(hsdev->workqueue); switch_dev_unregister(&hsdev->sdev); kfree(hsdev); return 0; }
void ifx_power_low(void) { unsigned int pin_val = 0; NvOdmServicesGpioHandle h_gpio; NvOdmGpioPinHandle h_gpiopin; printk("%s LOW\n", __func__); h_gpio = NvOdmGpioOpen(); h_gpiopin = NvOdmGpioAcquirePinHandle(h_gpio, 'v' - 'a', 1); NvOdmGpioConfig( h_gpio, h_gpiopin, NvOdmGpioPinMode_Output); NvOdmGpioSetState( h_gpio, h_gpiopin, 0x0); NvOdmGpioGetState( h_gpio, h_gpiopin, &pin_val); printk("ifx_power_low - [CP POWER]: pin %d\n", pin_val); NvOdmGpioReleasePinHandle(h_gpio, h_gpiopin); NvOdmGpioClose(h_gpio); }
void NvOdmUsbUlpiClose(NvOdmUsbUlpiHandle hOdmUlpi) { if (hOdmUlpi) { NvOdmOsFree(hOdmUlpi); } if (s_hResetPin) { NvOdmGpioReleasePinHandle(s_hGpio, s_hResetPin); s_hResetPin = NULL; } if (s_hGpio) { NvOdmGpioClose(s_hGpio); s_hGpio = NULL; } }
void NvOdmSdioClose(NvOdmSdioHandle hOdmSdio) { if (hOdmSdio->pConnectivity->Guid == WLAN_GUID) { // Call Turn off power when close is Called (void)SdioOdmWlanPower(hOdmSdio, NV_FALSE); NvOdmGpioReleasePinHandle(hOdmSdio->hGpio, hOdmSdio->hPwrPin); NvOdmGpioReleasePinHandle(hOdmSdio->hGpio, hOdmSdio->hResetPin); NvOdmGpioClose(hOdmSdio->hGpio); } NvOdmSetPowerOnSdio(hOdmSdio, NV_FALSE); if (hOdmSdio->hPmu != NULL) { NvOdmServicesPmuClose(hOdmSdio->hPmu); } NvOdmOsFree(hOdmSdio); hOdmSdio = NULL; }
static int gps_control_remove(struct platform_device *pdev) { struct gps_control_dev *gps_control; gps_control = (struct gps_control_dev *)platform_get_drvdata(pdev); if (gps_control != NULL) { NvOdmGpioReleasePinHandle(gps_control->gpio_handle, gps_control->pin_handle); gps_control->pin_handle = 0; NvOdmGpioClose(gps_control->gpio_handle); gps_control->gpio_handle = 0; if (gps_control->input_dev) { input_unregister_device(gps_control->input_dev); input_free_device(gps_control->input_dev); gps_control->input_dev = 0; } } return 0; }
void EETI_Close (NvOdmTouchDeviceHandle hDevice) { EETI_TouchDevice* hTouch = (EETI_TouchDevice*)hDevice; if (!hTouch) return; if (hTouch->hGpio) { if (hTouch->hPin) { if (hTouch->hGpioIntr) NvOdmGpioInterruptUnregister(hTouch->hGpio, hTouch->hPin, hTouch->hGpioIntr); NvOdmGpioReleasePinHandle(hTouch->hGpio, hTouch->hPin); } NvOdmGpioClose(hTouch->hGpio); } if (hTouch->hOdmI2c) NvOdmI2cClose(hTouch->hOdmI2c); NvOdmOsFree(hTouch); }
static int muic_remove(struct platform_device *pdev) { NvOdmGpioInterruptUnregister(s_hMuicHandle.hGpio, s_hMuicHandle.h_INT_N_MUIC, s_hMuicHandle.hGpioInterrupt); NvOdmGpioReleasePinHandle(s_hMuicHandle.hGpio, s_hMuicHandle.h_INT_N_MUIC); NvOdmGpioReleasePinHandle(s_hMuicHandle.hGpio, s_hMuicHandle.h_AP20_UART_SW); NvOdmGpioReleasePinHandle(s_hMuicHandle.hGpio, s_hMuicHandle.h_IFX_UART_SW); NvOdmGpioReleasePinHandle(s_hMuicHandle.hGpio, s_hMuicHandle.h_USIF1_SW); #if defined(CONFIG_MACH_STAR_REV_D) || defined(CONFIG_MACH_STAR_REV_E) || defined(CONFIG_MACH_STAR_REV_F) NvOdmGpioReleasePinHandle(s_hMuicHandle.hGpio, s_hMuicHandle.h_USB_VBUS_EN); #endif NvOdmGpioClose(s_hMuicHandle.hGpio); #ifndef _MUIC_GPIO_I2C_ NvOdmI2cClose(s_hMuicHandle.hOdmI2c); #endif wake_lock_destroy(&s_hMuicHandle.wlock); remove_star_muic_proc_file(); return 0; }
static int cpcap_usb_connected_remove(struct platform_device *pdev) { struct cpcap_usb_connected_data *data = platform_get_drvdata(pdev); mdm_ctrl_set_usb_ipc(false); /* Configure CPCAP-AP20 USB Mux to CPCAP */ NvOdmGpioSetState(data->h_gpio, data->h_pin, 0x0); NvOdmGpioReleasePinHandle(data->h_gpio, data->h_pin); NvOdmGpioClose(data->h_gpio); if((data->accy == CPCAP_ACCY_USB) || (data->accy == CPCAP_ACCY_FACTORY)) android_usb_set_connected(0, data->accy); #ifdef CONFIG_USB_TEGRA_OTG tegra_otg_set_mode(2); #endif kfree(data); return 0; }
static int cpcap_usb_connected_remove(struct platform_device *pdev) { /* struct cpcap_usb_connected_data *data = platform_get_drvdata(pdev);*/ struct cpcap_accy_platform_data *pdata = pdev->dev.platform_data; int nr_gpio; #ifdef CONFIG_MDM_CTRL mdm_ctrl_set_usb_ipc(false); #endif #if 0 /* Configure CPCAP-AP20 USB Mux to CPCAP */ NvOdmGpioSetState(data->h_gpio, data->h_pin, 0x0); printk(KERN_INFO "pICS_%s: NvOdmGpioSetState (data->h_gpio, data->h_pin, 0x0)\n",__func__); NvOdmGpioReleasePinHandle(data->h_gpio, data->h_pin); printk(KERN_INFO "pICS_%s: NvOdmGpioReleasePinHandle(data->h_gpio, data->h_pin)\n",__func__); NvOdmGpioClose(data->h_gpio); printk(KERN_INFO "pICS_%s: NvOdmGpioClose(data->h_gpio)\n",__func__); #endif nr_gpio = 174; gpio_set_value(nr_gpio, 0); gpio_free(nr_gpio); /* gpio_data[nr_gpio].val = false; gpio_data[nr_gpio].alloc = false;*/ tegra_gpio_disable(nr_gpio); #ifdef CONFIG_USB_MOT_ANDROID if((pdata->accy == CPCAP_ACCY_USB) || (pdata->accy == CPCAP_ACCY_FACTORY)) android_usb_set_connected(0, pdata->accy); #endif tegra_otg_set_mode(2); /* kfree(data);*/ return 0; }
static int headsetdet_remove(struct platform_device *pdev) { lprintk(D_AUDIO, KERN_ERR "##(Headset_det.c)## headsetdet_remove() : headset detection ended..!!\n"); //20100421 [LGE] struct headset_switch_data *switch_data = platform_get_drvdata(pdev); //20101125, , hookkey press is skipped When wakeup from LP1 [START] //wake_lock_destroy(&hook_det_lock); //20101125, , hookkey press is skipped When wakeup from LP1 [END] if (headset_h_pmu) NvOdmServicesPmuClose(headset_h_pmu); cancel_work_sync(&switch_data->work); cancel_delayed_work_sync(&switch_data->delayed_work); /*====================== nVidia GPIO Control(S) =======================*/ NvOdmGpioInterruptUnregister(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Headset_Detection, s_hHeadsetHandle.hheadsetInterrupt); NvOdmGpioInterruptUnregister(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Hookkey_Detection, s_hHeadsetHandle.hhookInterrupt); //20100421 for Hookkey [LGE] NvOdmGpioReleasePinHandle(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Headset_Detection); NvOdmGpioReleasePinHandle(s_hHeadsetHandle.hGpio, s_hHeadsetHandle.h_Hookkey_Detection); //20100421 for Hookkey [LGE] NvOdmGpioClose(s_hHeadsetHandle.hGpio); /*====================== nVidia GPIO Control(E) =======================*/ switch_dev_unregister(&switch_data->sdev); input_unregister_device(switch_data->ip_dev); //20100421 for Hookkey [LGE] kfree(switch_data); return 0; }
void NvOdmSdioClose(NvOdmSdioHandle hOdmSdio) { const NvOdmPeripheralConnectivity *pConnectivity = NULL; NV_DRIVER_TRACE(("Close SDIO%d", hOdmSdio->Instance)); pConnectivity = hOdmSdio->pConnectivity; if (pConnectivity->Guid == WLAN_GUID) { // Call Turn off power when close is Called (void)SdioOdmWlanSetPowerOn(hOdmSdio, NV_FALSE); //NvOdmGpioReleasePinHandle(hOdmSdio->hGpio, hOdmSdio->hPwrPin); //Sam --- NvOdmGpioReleasePinHandle(hOdmSdio->hGpio, hOdmSdio->hResetPin); NvOdmGpioClose(hOdmSdio->hGpio); } NvOdmSetPowerOnSdio(hOdmSdio, NV_FALSE); if (hOdmSdio->hPmu != NULL) { NvOdmServicesPmuClose(hOdmSdio->hPmu); } NvOdmOsFree(hOdmSdio); hOdmSdio = NULL; }