本文整理汇总了C++中disable_irq函数的典型用法代码示例。如果您正苦于以下问题:C++ disable_irq函数的具体用法?C++ disable_irq怎么用?C++ disable_irq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了disable_irq函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:Av3ng3,项目名称:Lamobo-D1s,代码行数:101,代码来源:battery.c
示例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");
//.........这里部分代码省略.........
开发者ID:free-z4u,项目名称:android_kernel_htc_msm7x30,代码行数:101,代码来源:htc_headset_pmic.c
示例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;
}
开发者ID:AndroPlus-org,项目名称:android_kernel_sony_msm8974ac,代码行数:98,代码来源:msm_csid.c
示例4: arc_disable_irq
static void arc_disable_irq(struct parport *p)
{
disable_irq(p->irq);
}
开发者ID:GunioRobot,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:4,代码来源:parport_arc.c
示例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;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:72,代码来源:wl1251_spi.c
示例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));
}
开发者ID:Zesters,项目名称:Kernel_spicekey,代码行数:92,代码来源:7x27_kybd_fm6.c
示例7: dma_ints_off
static void dma_ints_off(struct NCR_ESP *esp)
{
disable_irq(esp->irq);
}
开发者ID:xricson,项目名称:knoppix,代码行数:4,代码来源:jazz_esp.c
示例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;
}
开发者ID:FennyFatal,项目名称:FF-i777-Rebase,代码行数:101,代码来源:tmu.c
示例9: amiga_disable_irq
static void amiga_disable_irq(struct parport *p)
{
disable_irq(IRQ_AMIGA_CIAA_FLG);
}
开发者ID:chinnyannieb,项目名称:empeg-hijack,代码行数:4,代码来源:parport_amiga.c
示例10: disable_timer
void disable_timer()
{
disable_irq(TIMER_IRQ);
}
开发者ID:raywill,项目名称:maray,代码行数:4,代码来源:timer.c
示例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 */
//.........这里部分代码省略.........
开发者ID:NoelMacwan,项目名称:SXDMesona,代码行数:101,代码来源:fih_headset.c
示例12: wl1251_spi_disable_irq
static void wl1251_spi_disable_irq(struct wl1251 *wl)
{
return disable_irq(wl->irq);
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:4,代码来源:wl1251_spi.c
示例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");
}
开发者ID:GalaxyTab4,项目名称:android_kernel_samsung_matissewifi.bak,代码行数:82,代码来源:wacom_i2c.c
示例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);
}
开发者ID:adyjl,项目名称:DORIMANX_LG_STOCK_LP_KERNEL,代码行数:6,代码来源:lge_earjack_debugger.c
示例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);
}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:6,代码来源:fs_enet-main.c
示例16: build_bad_blk_list
static void build_bad_blk_list(void)
{
UINT32 bank, num_entries, result, vblk_offset;
scan_list_t* scan_list = (scan_list_t*) TEMP_BUF_ADDR;
mem_set_dram(BAD_BLK_BMP_ADDR, NULL, BAD_BLK_BMP_BYTES);
disable_irq();
flash_clear_irq();
for (bank = 0; bank < NUM_BANKS; bank++)
{
SETREG(FCP_CMD, FC_COL_ROW_READ_OUT);
SETREG(FCP_BANK, REAL_BANK(bank));
SETREG(FCP_OPTION, FO_E);
SETREG(FCP_DMA_ADDR, (UINT32) scan_list);
SETREG(FCP_DMA_CNT, SCAN_LIST_SIZE);
SETREG(FCP_COL, 0);
SETREG(FCP_ROW_L(bank), SCAN_LIST_PAGE_OFFSET);
SETREG(FCP_ROW_H(bank), SCAN_LIST_PAGE_OFFSET);
SETREG(FCP_ISSUE, NULL);
while ((GETREG(WR_STAT) & 0x00000001) != 0);
while (BSP_FSM(bank) != BANK_IDLE);
num_entries = NULL;
result = OK;
if (BSP_INTR(bank) & FIRQ_DATA_CORRUPT)
{
result = FAIL;
}
else
{
UINT32 i;
num_entries = read_dram_16(&(scan_list->num_entries));
if (num_entries > SCAN_LIST_ITEMS)
{
result = FAIL;
}
else
{
for (i = 0; i < num_entries; i++)
{
UINT16 entry = read_dram_16(scan_list->list + i);
UINT16 pblk_offset = entry & 0x7FFF;
if (pblk_offset == 0 || pblk_offset >= PBLKS_PER_BANK)
{
#if OPTION_REDUCED_CAPACITY == FALSE
result = FAIL;
#endif
}
else
{
write_dram_16(scan_list->list + i, pblk_offset);
}
}
}
}
if (result == FAIL)
{
num_entries = 0; // We cannot trust this scan list. Perhaps a software bug.
}
else
{
write_dram_16(&(scan_list->num_entries), 0);
}
g_bad_blk_count[bank] = 0;
for (vblk_offset = 1; vblk_offset < VBLKS_PER_BANK; vblk_offset++)
{
BOOL32 bad = FALSE;
#if OPTION_2_PLANE
{
UINT32 pblk_offset;
pblk_offset = vblk_offset * NUM_PLANES;
// fix [email protected] v.1.1.0
if (mem_search_equ_dram(scan_list, sizeof(UINT16), num_entries + 1, pblk_offset) < num_entries + 1)
{
bad = TRUE;
}
pblk_offset = vblk_offset * NUM_PLANES + 1;
// fix [email protected] v.1.1.0
if (mem_search_equ_dram(scan_list, sizeof(UINT16), num_entries + 1, pblk_offset) < num_entries + 1)
{
bad = TRUE;
}
}
#else
//.........这里部分代码省略.........
开发者ID:woojj12,项目名称:ftl_delta,代码行数:101,代码来源:gc_ftl.c
示例17: evtchn_ioctl
static long evtchn_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
int rc;
struct per_user_data *u = file->private_data;
void __user *uarg = (void __user *) arg;
/* Prevent bind from racing with unbind */
mutex_lock(&u->bind_mutex);
switch (cmd) {
case IOCTL_EVTCHN_BIND_VIRQ: {
struct ioctl_evtchn_bind_virq bind;
struct evtchn_bind_virq bind_virq;
rc = -EFAULT;
if (copy_from_user(&bind, uarg, sizeof(bind)))
break;
bind_virq.virq = bind.virq;
bind_virq.vcpu = 0;
rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq,
&bind_virq);
if (rc != 0)
break;
rc = evtchn_bind_to_user(u, bind_virq.port);
if (rc == 0)
rc = bind_virq.port;
break;
}
case IOCTL_EVTCHN_BIND_INTERDOMAIN: {
struct ioctl_evtchn_bind_interdomain bind;
struct evtchn_bind_interdomain bind_interdomain;
rc = -EFAULT;
if (copy_from_user(&bind, uarg, sizeof(bind)))
break;
bind_interdomain.remote_dom = bind.remote_domain;
bind_interdomain.remote_port = bind.remote_port;
rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_interdomain,
&bind_interdomain);
if (rc != 0)
break;
rc = evtchn_bind_to_user(u, bind_interdomain.local_port);
if (rc == 0)
rc = bind_interdomain.local_port;
break;
}
case IOCTL_EVTCHN_BIND_UNBOUND_PORT: {
struct ioctl_evtchn_bind_unbound_port bind;
struct evtchn_alloc_unbound alloc_unbound;
rc = -EFAULT;
if (copy_from_user(&bind, uarg, sizeof(bind)))
break;
alloc_unbound.dom = DOMID_SELF;
alloc_unbound.remote_dom = bind.remote_domain;
rc = HYPERVISOR_event_channel_op(EVTCHNOP_alloc_unbound,
&alloc_unbound);
if (rc != 0)
break;
rc = evtchn_bind_to_user(u, alloc_unbound.port);
if (rc == 0)
rc = alloc_unbound.port;
break;
}
case IOCTL_EVTCHN_UNBIND: {
struct ioctl_evtchn_unbind unbind;
rc = -EFAULT;
if (copy_from_user(&unbind, uarg, sizeof(unbind)))
break;
rc = -EINVAL;
if (unbind.port >= NR_EVENT_CHANNELS)
break;
spin_lock_irq(&port_user_lock);
rc = -ENOTCONN;
if (get_port_user(unbind.port) != u) {
spin_unlock_irq(&port_user_lock);
break;
}
disable_irq(irq_from_evtchn(unbind.port));
spin_unlock_irq(&port_user_lock);
evtchn_unbind_from_user(u, unbind.port);
rc = 0;
//.........这里部分代码省略.........
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:101,代码来源:evtchn.c
示例18: eeti_ts_stop
static void eeti_ts_stop(struct eeti_ts_priv *priv)
{
disable_irq(priv->irq);
cancel_work_sync(&priv->work);
}
开发者ID:1703011,项目名称:asuswrt-merlin,代码行数:5,代码来源:eeti_ts.c
示例19: ads7846_read12_ser
static int ads7846_read12_ser(struct device *dev, unsigned command)
{
struct spi_device *spi = to_spi_device(dev);
struct ads7846 *ts = dev_get_drvdata(dev);
struct ser_req *req = kzalloc(sizeof *req, GFP_KERNEL);
int status;
int use_internal;
if (!req)
return -ENOMEM;
spi_message_init(&req->msg);
/* FIXME boards with ads7846 might use external vref instead ... */
use_internal = (ts->model == 7846);
/* maybe turn on internal vREF, and let it settle */
if (use_internal) {
req->ref_on = REF_ON;
req->xfer[0].tx_buf = &req->ref_on;
req->xfer[0].len = 1;
spi_message_add_tail(&req->xfer[0], &req->msg);
req->xfer[1].rx_buf = &req->scratch;
req->xfer[1].len = 2;
/* for 1uF, settle for 800 usec; no cap, 100 usec. */
req->xfer[1].delay_usecs = ts->vref_delay_usecs;
spi_message_add_tail(&req->xfer[1], &req->msg);
}
/* take sample */
req->command = (u8) command;
req->xfer[2].tx_buf = &req->command;
req->xfer[2].len = 1;
spi_message_add_tail(&req->xfer[2], &req->msg);
req->xfer[3].rx_buf = &req->sample;
req->xfer[3].len = 2;
spi_message_add_tail(&req->xfer[3], &req->msg);
/* REVISIT: take a few more samples, and compare ... */
/* converter in low power mode & enable PENIRQ */
req->ref_off = PWRDOWN;
req->xfer[4].tx_buf = &req->ref_off;
req->xfer[4].len = 1;
spi_message_add_tail(&req->xfer[4], &req->msg);
req->xfer[5].rx_buf = &req->scratch;
req->xfer[5].len = 2;
CS_CHANGE(req->xfer[5]);
spi_message_add_tail(&req->xfer[5], &req->msg);
ts->irq_disabled = 1;
disable_irq(spi->irq);
status = spi_sync(spi, &req->msg);
ts->irq_disabled = 0;
enable_irq(spi->irq);
if (status == 0) {
/* on-wire is a must-ignore bit, a BE12 value, then padding */
status = be16_to_cpu(req->sample);
status = status >> 3;
status &= 0x0fff;
}
开发者ID:AppEngine,项目名称:linux-2.6,代码行数:66,代码来源:ads7846.c
示例20: put_irq_handler
void put_irq_handler(int irq, IrqHandler handler)
{
disable_irq(irq);
irq_table[irq] = handler;
}
开发者ID:benwei,项目名称:simple_os,代码行数:5,代码来源:start.c
注:本文中的disable_irq函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论