本文整理汇总了C++中disable_irq函数的典型用法代码示例。如果您正苦于以下问题:C++ disable_irq函数的具体用法?C++ disable_irq怎么用?C++ disable_irq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了disable_irq函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ak_battery_probe
//.........这里部分代码省略.........
INIT_DELAYED_WORK(&charge_work,bat_charge_work);
INIT_DELAYED_WORK(&discharge_work,bat_discharge_work);
INIT_DELAYED_WORK(&voltage_work,bat_voltage_work);
INIT_DELAYED_WORK(&usbirq_work,bat_usbirq_work);
INIT_DELAYED_WORK(&pdown_work,bat_pdown_work);
INIT_DELAYED_WORK(&resume_work,bat_resume_work);
ret = power_supply_register(&dev->dev, &bat_device.bat_ps);
if (ret != 0)
{
goto cancel_out;
}
ret = power_supply_register(&dev->dev,&bat_device.usb_ps);
if (ret != 0)
{
goto free_bat_ps_out;
}
ret = power_supply_register(&dev->dev,&bat_device.ac_ps);
if (ret != 0)
{
goto free_usb_ps_out;
}
// use for charge full state
if (info->full_gpio.pindata.pin >= 0)
{
info->gpio_init(&info->full_gpio.pindata);
}
if (info->ac_gpio.is_detect_mode == BAT_CHARGE_GPIO_DETECT) {
INIT_DELAYED_WORK(&acirq_work,bat_acirq_work);
// use for ac charge in irq
if (info->ac_gpio.irq >= 0)
{
info->gpio_init(&info->ac_gpio.pindata);
bat_set_int_inverse(info->ac_gpio.pindata.pin);
if (request_irq(info->ac_gpio.irq,akbat_ac_irqhandler,0,"ac_charge",&bat_device))
{
printk(KERN_ERR "%s:Could not allocate IRQ %d\n", __func__,info->ac_gpio.irq);
ret = -EIO;
goto free_ac_ps_out;
}
}
} else if (info->ac_gpio.is_detect_mode == BAT_CHARGE_ADC_DETECT) {
memset(&ac_detect_nb, 0, sizeof(ac_detect_nb));
ac_detect_nb.notifier_call = ac_detect_plugin;
addetect_register_client(&ac_detect_nb);
}
// use for usb charge in irq
if (info->usb_gpio.irq >= 0)
{
info->gpio_init(&info->usb_gpio.pindata);
mdelay(100);
bat_set_int_inverse(info->usb_gpio.pindata.pin);
if (request_irq(info->usb_gpio.irq,akbat_usb_irqhandler,0,"usb_charge",&bat_device))
{
printk(KERN_ERR "%s:Could not allocate IRQ %d\n", __func__,info->usb_gpio.irq);
ret = -EIO;
goto free_acirq_out;
}
}
ak_bat_update(&bat_device);
schedule_delayed_work(&voltage_work,UPDATE_VOLTAGE_DELAY);
register_reboot_notifier(&battery_reboot_nb);
bat_print_battery_info(&bat_device);
printk("AK Battery initialized\n");
return ret;
free_acirq_out:
if (info->ac_gpio.irq > 0)
{
disable_irq(info->ac_gpio.irq);
free_irq(info->ac_gpio.irq, dev);
}
free_ac_ps_out:
power_supply_unregister(&bat_device.ac_ps);
free_usb_ps_out:
power_supply_unregister(&bat_device.usb_ps);
free_bat_ps_out:
power_supply_unregister(&bat_device.bat_ps);
cancel_out:
del_timer_sync(&bat_device.timer);
cancel_delayed_work_sync(&charge_work);
cancel_delayed_work_sync(&discharge_work);
cancel_delayed_work_sync(&voltage_work);
cancel_delayed_work_sync(&usbirq_work);
cancel_delayed_work_sync(&acirq_work);
cancel_delayed_work_sync(&pdown_work);
cancel_delayed_work_sync(&resume_work);
nodata_out:
printk(KERN_ERR "###########%s:ERR out##########\n",__func__);
return ret;
}
示例2: htc_headset_pmic_probe
static int htc_headset_pmic_probe(struct platform_device *pdev)
{
int ret = 0;
struct htc_headset_pmic_platform_data *pdata = pdev->dev.platform_data;
#ifdef HTC_HEADSET_CONFIG_MSM_RPC
uint32_t vers = 0;
#endif
HS_LOG("++++++++++++++++++++");
hi = kzalloc(sizeof(struct htc_35mm_pmic_info), GFP_KERNEL);
if (!hi)
return -ENOMEM;
hi->pdata.driver_flag = pdata->driver_flag;
hi->pdata.hpin_gpio = pdata->hpin_gpio;
hi->pdata.hpin_irq = pdata->hpin_irq;
hi->pdata.key_gpio = pdata->key_gpio;
hi->pdata.key_irq = pdata->key_irq;
hi->pdata.key_enable_gpio = pdata->key_enable_gpio;
hi->pdata.adc_mpp = pdata->adc_mpp;
hi->pdata.adc_amux = pdata->adc_amux;
hi->pdata.hs_controller = pdata->hs_controller;
hi->pdata.hs_switch = pdata->hs_switch;
hi->pdata.adc_mic = pdata->adc_mic;
hi->htc_accessory_class = hs_get_attribute_class();
register_attributes();
if (!hi->pdata.adc_mic)
hi->pdata.adc_mic = HS_DEF_MIC_ADC_16_BIT_MIN;
if (pdata->adc_mic_bias[0] && pdata->adc_mic_bias[1]) {
memcpy(hi->pdata.adc_mic_bias, pdata->adc_mic_bias,
sizeof(hi->pdata.adc_mic_bias));
hi->pdata.adc_mic = hi->pdata.adc_mic_bias[0];
} else {
hi->pdata.adc_mic_bias[0] = hi->pdata.adc_mic;
hi->pdata.adc_mic_bias[1] = HS_DEF_MIC_ADC_16_BIT_MAX;
}
if (pdata->adc_remote[5])
memcpy(hi->pdata.adc_remote, pdata->adc_remote,
sizeof(hi->pdata.adc_remote));
if (pdata->adc_metrico[0] && pdata->adc_metrico[1])
memcpy(hi->pdata.adc_metrico, pdata->adc_metrico,
sizeof(hi->pdata.adc_metrico));
hi->hpin_irq_type = IRQF_TRIGGER_NONE;
hi->hpin_debounce = HS_JIFFIES_ZERO;
hi->key_irq_type = IRQF_TRIGGER_NONE;
wake_lock_init(&hi->hs_wake_lock, WAKE_LOCK_SUSPEND, DRIVER_NAME);
detect_wq = create_workqueue("HS_PMIC_DETECT");
if (detect_wq == NULL) {
ret = -ENOMEM;
HS_ERR("Failed to create detect workqueue");
goto err_create_detect_work_queue;
}
button_wq = create_workqueue("HS_PMIC_BUTTON");
if (button_wq == NULL) {
ret = -ENOMEM;
HS_ERR("Failed to create button workqueue");
goto err_create_button_work_queue;
}
if (hi->pdata.hpin_gpio) {
ret = hs_pmic_request_irq(hi->pdata.hpin_gpio,
&hi->pdata.hpin_irq, detect_irq_handler,
hi->hpin_irq_type, "HS_PMIC_DETECT", 1);
if (ret < 0) {
HS_ERR("Failed to request PMIC HPIN IRQ (0x%X)", ret);
goto err_request_detect_irq;
}
disable_irq(hi->pdata.hpin_irq);
}
if (hi->pdata.key_gpio) {
ret = hs_pmic_request_irq(hi->pdata.key_gpio,
&hi->pdata.key_irq, button_irq_handler,
hi->key_irq_type, "HS_PMIC_BUTTON", 1);
if (ret < 0) {
HS_ERR("Failed to request PMIC button IRQ (0x%X)", ret);
goto err_request_button_irq;
}
disable_irq(hi->pdata.key_irq);
}
#ifdef HTC_HEADSET_CONFIG_MSM_RPC
if (hi->pdata.driver_flag & DRIVER_HS_PMIC_RPC_KEY) {
/* Register ADC RPC client */
endpoint_adc = msm_rpc_connect(HS_RPC_CLIENT_PROG,
HS_RPC_CLIENT_VERS, 0);
if (IS_ERR(endpoint_adc)) {
hi->pdata.driver_flag &= ~DRIVER_HS_PMIC_RPC_KEY;
HS_LOG("Failed to register ADC RPC client");
} else
HS_LOG("Register ADC RPC client successfully");
//.........这里部分代码省略.........
示例3: csid_probe
static int __devinit csid_probe(struct platform_device *pdev)
{
struct csid_device *new_csid_dev;
uint32_t csi_vdd_voltage = 0;
int rc = 0;
new_csid_dev = kzalloc(sizeof(struct csid_device), GFP_KERNEL);
if (!new_csid_dev) {
pr_err("%s: no enough memory\n", __func__);
return -ENOMEM;
}
v4l2_subdev_init(&new_csid_dev->msm_sd.sd, &msm_csid_subdev_ops);
v4l2_set_subdevdata(&new_csid_dev->msm_sd.sd, new_csid_dev);
platform_set_drvdata(pdev, &new_csid_dev->msm_sd.sd);
mutex_init(&new_csid_dev->mutex);
if (pdev->dev.of_node) {
rc = of_property_read_u32((&pdev->dev)->of_node,
"cell-index", &pdev->id);
if (rc < 0) {
pr_err("%s:%d failed to read cell-index\n", __func__,
__LINE__);
goto csid_no_resource;
}
CDBG("%s device id %d\n", __func__, pdev->id);
rc = of_property_read_u32((&pdev->dev)->of_node,
"qcom,csi-vdd-voltage", &csi_vdd_voltage);
if (rc < 0) {
pr_err("%s:%d failed to read qcom,csi-vdd-voltage\n",
__func__, __LINE__);
goto csid_no_resource;
}
CDBG("%s:%d reading mipi_csi_vdd is %d\n", __func__, __LINE__,
csi_vdd_voltage);
csid_vreg_info[0].min_voltage = csi_vdd_voltage;
csid_vreg_info[0].max_voltage = csi_vdd_voltage;
}
new_csid_dev->mem = platform_get_resource_byname(pdev,
IORESOURCE_MEM, "csid");
if (!new_csid_dev->mem) {
pr_err("%s: no mem resource?\n", __func__);
rc = -ENODEV;
goto csid_no_resource;
}
new_csid_dev->irq = platform_get_resource_byname(pdev,
IORESOURCE_IRQ, "csid");
if (!new_csid_dev->irq) {
pr_err("%s: no irq resource?\n", __func__);
rc = -ENODEV;
goto csid_no_resource;
}
new_csid_dev->io = request_mem_region(new_csid_dev->mem->start,
resource_size(new_csid_dev->mem), pdev->name);
if (!new_csid_dev->io) {
pr_err("%s: no valid mem region\n", __func__);
rc = -EBUSY;
goto csid_no_resource;
}
new_csid_dev->pdev = pdev;
new_csid_dev->msm_sd.sd.internal_ops = &msm_csid_internal_ops;
new_csid_dev->msm_sd.sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
snprintf(new_csid_dev->msm_sd.sd.name,
ARRAY_SIZE(new_csid_dev->msm_sd.sd.name), "msm_csid");
media_entity_init(&new_csid_dev->msm_sd.sd.entity, 0, NULL, 0);
new_csid_dev->msm_sd.sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV;
new_csid_dev->msm_sd.sd.entity.group_id = MSM_CAMERA_SUBDEV_CSID;
new_csid_dev->msm_sd.close_seq = MSM_SD_CLOSE_2ND_CATEGORY | 0x5;
msm_sd_register(&new_csid_dev->msm_sd);
rc = request_irq(new_csid_dev->irq->start, msm_csid_irq,
IRQF_TRIGGER_RISING, "csid", new_csid_dev);
if (rc < 0) {
release_mem_region(new_csid_dev->mem->start,
resource_size(new_csid_dev->mem));
pr_err("%s: irq request fail\n", __func__);
rc = -EBUSY;
goto csid_no_resource;
}
disable_irq(new_csid_dev->irq->start);
if (rc < 0) {
release_mem_region(new_csid_dev->mem->start,
resource_size(new_csid_dev->mem));
pr_err("%s Error registering irq ", __func__);
goto csid_no_resource;
}
new_csid_dev->csid_state = CSID_POWER_DOWN;
return 0;
csid_no_resource:
mutex_destroy(&new_csid_dev->mutex);
kfree(new_csid_dev);
return 0;
}
示例4: arc_disable_irq
static void arc_disable_irq(struct parport *p)
{
disable_irq(p->irq);
}
示例5: wl1251_spi_probe
static int __devinit wl1251_spi_probe(struct spi_device *spi)
{
struct wl12xx_platform_data *pdata;
struct ieee80211_hw *hw;
struct wl1251 *wl;
int ret;
pdata = spi->dev.platform_data;
if (!pdata) {
wl1251_error("no platform data");
return -ENODEV;
}
hw = wl1251_alloc_hw();
if (IS_ERR(hw))
return PTR_ERR(hw);
wl = hw->priv;
SET_IEEE80211_DEV(hw, &spi->dev);
dev_set_drvdata(&spi->dev, wl);
wl->if_priv = spi;
wl->if_ops = &wl1251_spi_ops;
/* This is the only SPI value that we need to set here, the rest
* comes from the board-peripherals file */
spi->bits_per_word = 32;
ret = spi_setup(spi);
if (ret < 0) {
wl1251_error("spi_setup failed");
goto out_free;
}
wl->set_power = pdata->set_power;
if (!wl->set_power) {
wl1251_error("set power function missing in platform data");
return -ENODEV;
}
wl->irq = spi->irq;
if (wl->irq < 0) {
wl1251_error("irq missing in platform data");
return -ENODEV;
}
wl->use_eeprom = pdata->use_eeprom;
ret = request_irq(wl->irq, wl1251_irq, 0, DRIVER_NAME, wl);
if (ret < 0) {
wl1251_error("request_irq() failed: %d", ret);
goto out_free;
}
set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
disable_irq(wl->irq);
ret = wl1251_init_ieee80211(wl);
if (ret)
goto out_irq;
return 0;
out_irq:
free_irq(wl->irq, wl);
out_free:
ieee80211_free_hw(hw);
return ret;
}
示例6: Q7x27_kybd_volkey2
static void Q7x27_kybd_volkey2(struct work_struct *work)
{
struct Q7x27_kybd_record *kbdrec= container_of(work, struct Q7x27_kybd_record, kybd_volkey2);
struct input_dev *idev = kbdrec->Q7x27_kybd_idev;
bool debounceDelay = false;
bool voldn_val = (bool)gpio_get_value(kbdrec->voldn_pin);
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++misty
suspend_state_t SuspendState = PM_SUSPEND_ON;//0
//-----------------------------------------------------------------misty
/* FIH, PeterKCTseng, @20090520 { */
/* The active type of input pin */
#if ACTIVE_MODE_ENABLE // Peter, Debug
bool state;
#endif
/* } FIH, PeterKCTseng, @20090520 */
//fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"[Misty]VOL DN <%d>\n", voldn_val);
//printk(KERN_INFO "VOL DN <%d>\n", voldn_val);
disable_irq(MSM_GPIO_TO_INT(kbdrec->voldn_pin));
//+++++++++++++++++++++++++++++++FIH_F0X_misty
if(EnableKeyInt)
{
SuspendState = get_suspend_state();
if(SuspendState == PM_SUSPEND_MEM)
{
if(idev)
{
input_report_key(idev, KEY_VOLUMEDOWN, KBD_IN_KEYPRESS);
//printk(KERN_INFO "FIH: keypress KEY_VOLUMEDOWN\n");
fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: keypress KEY_VOLUMEDOWNP\n");
input_report_key(idev, KEY_VOLUMEDOWN, KBD_IN_KEYRELEASE);
//printk(KERN_INFO "FIH: keyrelease KEY_VOLUMEDOWN\n");
fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: keyrelease KEY_VOLUMEDOWN\n");
input_sync(idev);
}
}
//-------------------------------FIH_F0X_misty
else
{
/* FIH, PeterKCTseng, @20090520 { */
/* The active type of input pin */
#if ACTIVE_MODE_ENABLE // Peter, Debug
state = (kbdrec->active.voldn_pin_actype == ACTIVE_HIGH) ? voldn_val : !voldn_val;
//printk(KERN_INFO "active type= %d \n", state);
#endif
/* } FIH, PeterKCTseng, @20090520 */
if(idev)
{
if (state) {
input_report_key(idev, KEY_VOLUMEDOWN, KBD_IN_KEYPRESS);
//printk(KERN_INFO "FIH: keypress KEY_VOLUMEDOWN\n");
fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: keypress KEY_VOLUMEDOWN\n");
// FIH, WillChen, 2009/08/14 ++
//Press VolumeUp+VolumeDown+End key to force panic and dump log
#ifdef CONFIG_FIH_FXX_FORCEPANIC
VDN_Key = true;
if (VUP_Key && VDN_Key && END_key)
{
printk(KERN_ERR "KPD: Three key panic!!\n");
flag = 1;
wake_up(&wq);
msleep(5000);
panic("Three key panic");
}
#endif
// FIH, WillChen, 2009/08/14 --
} else {
input_report_key(idev, KEY_VOLUMEDOWN, KBD_IN_KEYRELEASE);
//printk(KERN_INFO "FIH: keyrelease KEY_VOLUMEDOWN\n");
fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: keyrelease KEY_VOLUMEDOWN\n");
debounceDelay = true;
// FIH, WillChen, 2009/08/14 ++
//Press VolumeUp+VolumeDown+End key to force panic and dump log
#ifdef CONFIG_FIH_FXX_FORCEPANIC
VDN_Key = false;
#endif
// FIH, WillChen, 2009/08/14 --
}
input_sync(idev);
//printk(KERN_INFO "FIH: keypress KEY_VOLUMEDOWN\n");
fih_printk(Q7x27_kybd_debug_mask, FIH_DEBUG_ZONE_G0,"FIH: keypress KEY_VOLUMEDOWN\n");
}
if (debounceDelay) {
mdelay(KBD_DEBOUNCE_TIME); //Debounce
}
}
}//if(EnableKeyInt)
enable_irq(MSM_GPIO_TO_INT(kbdrec->voldn_pin));
}
示例7: dma_ints_off
static void dma_ints_off(struct NCR_ESP *esp)
{
disable_irq(esp->irq);
}
示例8: exynos4_handler_tmu_state
//.........这里部分代码省略.........
/* 2. cpufreq limitation and uevent */
} else if ((cur_temp >= data->ts.start_2nd_throttle)
&& (trend > 0) && !(check_handle & WARNING_FLAG)) {
if (check_handle & THROTTLE_FLAG) {
exynos_cpufreq_upper_limit_free(DVFS_LOCK_ID_TMU);
check_handle &= ~(THROTTLE_FLAG);
}
exynos_cpufreq_upper_limit(DVFS_LOCK_ID_TMU,
info->cpufreq_level_2nd_throttle);
check_handle |= WARNING_FLAG;
pr_debug("check_handle = %d\n", check_handle);
notify_change_of_tmu_state(info);
pr_info("2nd throttle: cpufreq is limited.\n");
/* 3. change state: 1st-throttling */
} else if ((cur_temp <= data->ts.stop_2nd_throttle)
&& (trend < 0)) {
info->tmu_state = TMU_STATUS_THROTTLED;
pr_info("change state: 2nd throttle->1st throttle, "
"and release cpufreq upper limit.\n");
}
break;
case TMU_STATUS_TRIPPED:
/* 1. call uevent to shut-down */
if ((cur_temp >= data->ts.start_tripping) &&
(trend > 0) && !(check_handle & TRIPPING_FLAG)) {
notify_change_of_tmu_state(info);
pr_info("tripping: on waiting shutdown.\n");
check_handle |= TRIPPING_FLAG;
pr_debug("check_handle = %d\n", check_handle);
/* 2. change state: 2nd-throttling or warning */
} else if ((cur_temp <= data->ts.stop_2nd_throttle)
&& (trend < 0)) {
info->tmu_state = TMU_STATUS_WARNING;
pr_info("change state: trip->2nd throttle, "
"Check! occured only test mode.\n");
}
/* 3. chip protection: kernel panic as SW workaround */
if ((cur_temp >= data->ts.start_emergency) && (trend > 0)) {
panic("Emergency!!!! tripping is not treated!\n");
/* clear to prevent from interfupt by peindig bit */
__raw_writel(INTCLEARALL,
info->tmu_state + EXYNOS4_TMU_INTCLEAR);
enable_irq(info->irq);
mutex_unlock(&tmu_lock);
return;
}
break;
case TMU_STATUS_INIT:
/* sned tmu initial status to platform */
disable_irq(info->irq);
if (cur_temp >= data->ts.start_tripping)
info->tmu_state = TMU_STATUS_TRIPPED;
else if (cur_temp >= data->ts.start_2nd_throttle)
info->tmu_state = TMU_STATUS_WARNING;
else if (cur_temp >= data->ts.start_1st_throttle)
info->tmu_state = TMU_STATUS_THROTTLED;
else if (cur_temp <= data->ts.stop_1st_throttle)
info->tmu_state = TMU_STATUS_NORMAL;
notify_change_of_tmu_state(info);
pr_info("%s: inform to init state to platform.\n", __func__);
break;
default:
pr_warn("Bug: checked tmu_state.\n");
if (cur_temp >= data->ts.start_tripping)
info->tmu_state = TMU_STATUS_TRIPPED;
else
info->tmu_state = TMU_STATUS_WARNING;
break;
} /* end */
/* memory throttling */
if (cur_temp >= data->ts.start_mem_throttle) {
if (!(auto_refresh_changed) && (trend > 0)) {
pr_info("set auto_refresh 1.95us\n");
set_refresh_rate(info->auto_refresh_tq0);
auto_refresh_changed = 1;
}
} else if (cur_temp <= (data->ts.stop_mem_throttle)) {
if ((auto_refresh_changed) && (trend < 0)) {
pr_info("set auto_refresh 3.9us\n");
set_refresh_rate(info->auto_refresh_normal);
auto_refresh_changed = 0;
}
}
info->last_temperature = cur_temp;
/* reschedule the next work */
queue_delayed_work_on(0, tmu_monitor_wq, &info->polling,
info->sampling_rate);
mutex_unlock(&tmu_lock);
return;
}
示例9: amiga_disable_irq
static void amiga_disable_irq(struct parport *p)
{
disable_irq(IRQ_AMIGA_CIAA_FLG);
}
示例10: disable_timer
void disable_timer()
{
disable_irq(TIMER_IRQ);
}
示例11: insert_headset
static void insert_headset(void)
{
#ifdef FEATURE_AUD_HOOK_BTN
unsigned long irq_flags;
#endif
int voltage = 0; /* FIH-SW2-MM-AY-hsed_type-00 */
H2W_DBG("");
input_sync(hi->hs_input);
msleep(100);
#ifdef FEATURE_AUD_HOOK_BTN
/* On some non-standard headset adapters (usually those without a
* button) the btn line is pulled down at the same time as the detect
* line. We can check here by sampling the button line, if it is
* low then it is probably a bad adapter so ignore the button.
* If the button is released then we stop ignoring the button, so that
* the user can recover from the situation where a headset is plugged
* in with button held down.
*/
hi->ignore_btn = 1; /* FIH-SW2-MM-AY-TAP_Tapioca-00746_00 */
if (bn_irq_enable==0) {
/* Enable button irq */
local_irq_save(irq_flags);
enable_irq(hi->irq_btn);
local_irq_restore(irq_flags);
bn_irq_enable=1;
irq_set_irq_wake(hi->irq_btn, 1);
}
#endif
/* FIH-SW2-MM-AY-hsed_type-00 [ */
if (isCTIAheadset) { /* FIH-SW2-MM-AY-hsed_type-03 */
pmic_hsed_enable(PM_HSED_CONTROLLER_0, PM_HSED_ENABLE_ALWAYS);
msleep(130);
proc_comm_get_hsed_voltage(2, &voltage, 0); //it will get the prior value, not the current value. Should not omit.
msleep(70);
proc_comm_get_hsed_voltage(2, &voltage, 0);
H2W_DBG("aud_hs: voltage is %d\n ", voltage);
/* FIH-SW2-MM-AY-hsed_type-01 [ */
if (voltage > 1700) {
//do not change state to issue an UEVENT.
//it is a earphone jack plug.
mHeadphone = false;
hi->ignore_btn = 1;
pmic_hsed_enable(PM_HSED_CONTROLLER_0, PM_HSED_ENABLE_OFF);
/* MM-RC-HEADSET-MULTIBUTTON-DETECT[* */
#ifdef FEATURE_AUD_HOOK_BTN
if (bn_irq_enable) {
local_irq_save(irq_flags);
disable_irq(hi->irq_btn);
local_irq_restore(irq_flags);
bn_irq_enable=0;
irq_set_irq_wake(hi->irq_btn, 0);
}
#endif
/* MM-RC-HEADSET-MULTIBUTTON-DETECT]* */
switch_set_state(&hi->sdev, UNKNOWN_DEVICE); /* FIH-SW2-MM-AY-hsed_type-02 */
} else if (voltage > 700 || voltage < 400) { /* FIH-SW2-MM-AY-hsed_type-01 ] *//* SW-MM-RC-CTIA-TTY* */
if (gpio_get_value(hi->cable_in1) == HS_PLUG_IN) {
if (gpio_get_value(hi->cable_in2) == BTN_STATE_PRESSED) {
switch_set_state(&hi->sdev, NOMIC_HEADSET);
mHeadphone=true;
hi->ignore_btn = 1;
pmic_hsed_enable(PM_HSED_CONTROLLER_0, PM_HSED_ENABLE_OFF);
H2W_DBG("aud_hs:HEADPHONE is plugging\n ");
} else {
switch_set_state(&hi->sdev, HEADSET);
mHeadphone=false;
#ifdef FEATURE_AUD_HOOK_BTN
irq_set_irq_type(hi->irq_btn, IRQF_TRIGGER_BTN_PRESSED);
#endif
msleep(300);
hi->ignore_btn = 0;
H2W_DBG("aud_hs:HEADSET is plugging\n ");
}
}
} else {
mHeadphone = false;
hi->ignore_btn = 1;
pmic_hsed_enable(PM_HSED_CONTROLLER_0, PM_HSED_ENABLE_OFF);
switch_set_state(&hi->sdev, NOT_SUPPORT);
}
H2W_DBG("switch_get_state= %d ",switch_get_state(&hi->sdev));
} else {
/* FIH-SW2-MM-AY-TAP-ControlHSED_BIAS1-01 [ */
pmic_hsed_enable(PM_HSED_CONTROLLER_0, PM_HSED_ENABLE_ALWAYS);
msleep(130); /* FIH-SW2-MM-AY-Tapioca_SS-00467-00 */
/* FIH-SW2-MM-AY-TAP-ControlHSED_BIAS1-01 ] */
if (gpio_get_value(hi->cable_in1) == HS_PLUG_IN) { /* FIH-SW2-MM-AY-TAP_headset_00 */
if (gpio_get_value(hi->cable_in2) == BTN_STATE_PRESSED) { /* FIH-SW2-MM-AY-TAP_headset_00 */
//.........这里部分代码省略.........
示例12: wl1251_spi_disable_irq
static void wl1251_spi_disable_irq(struct wl1251 *wl)
{
return disable_irq(wl->irq);
}
示例13: epen_connection_show
static ssize_t epen_connection_show(struct device *dev,
struct device_attribute *attr,
char *buff)
{
struct wacom_i2c *wac_i2c = dev_get_drvdata(dev);
u8 cmd = 0;
u8 buf[2] = {0,};
int ret = 0, cnt = 10;
disable_irq(wac_i2c->client->irq);
cmd = WACOM_I2C_STOP;
ret = wacom_i2c_send(wac_i2c, &cmd, 1, false);
if (ret <= 0) {
dev_err(&wac_i2c->client->dev,
"%s: failed to send stop command\n",
__func__);
goto grid_check_error;
}
cmd = WACOM_I2C_GRID_CHECK;
ret = wacom_i2c_send(wac_i2c, &cmd, 1, false);
if (ret <= 0) {
dev_err(&wac_i2c->client->dev,
"%s: failed to send stop command\n",
__func__);
goto grid_check_error;
}
cmd = WACOM_STATUS;
do {
msleep(50);
if (1 == wacom_i2c_send(wac_i2c, &cmd, 1, false)) {
if (2 == wacom_i2c_recv(wac_i2c,
buf, 2, false)) {
switch (buf[0]) {
/*
* status value
* 0 : data is not ready
* 1 : PASS
* 2 : Fail (coil function error)
* 3 : Fail (All coil function error)
*/
case 1:
case 2:
case 3:
cnt = 0;
break;
default:
break;
}
}
}
} while (cnt--);
dev_info(&wac_i2c->client->dev,
"%s : status: %x, error code: %x\n",
__func__, buf[0], buf[1]);
grid_check_error:
cmd = WACOM_I2C_STOP;
ret = wacom_i2c_send(wac_i2c, &cmd, 1, false);
if (ret <= 0)
dev_err(&wac_i2c->client->dev,
"%s: failed to send stop command\n",
__func__);
cmd = WACOM_I2C_START;
wacom_i2c_send(wac_i2c, &cmd, 1, false);
if (ret <= 0)
dev_err(&wac_i2c->client->dev,
"%s: failed to send stop command\n",
__func__);
enable_irq(wac_i2c->client->irq);
if ((buf[0] == 0x1) && (buf[1] == 0))
return sprintf(buff, "%s\n", "OK");
else
return sprintf(buff, "%s\n", "NG");
}
示例14: earjack_debugger_shutdown
static void earjack_debugger_shutdown(struct platform_device *pdev)
{
struct earjack_debugger_device *adev = platform_get_drvdata(pdev);
disable_irq(adev->irq);
}
示例15: fs_enet_netpoll
static void fs_enet_netpoll(struct net_device *dev)
{
disable_irq(dev->irq);
fs_enet_interrupt(dev->irq, dev);
enable_irq(dev->irq);
}