• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ HS_DBG函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中HS_DBG函数的典型用法代码示例。如果您正苦于以下问题:C++ HS_DBG函数的具体用法?C++ HS_DBG怎么用?C++ HS_DBG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了HS_DBG函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: headset_state_show

static ssize_t headset_state_show(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	int length = 0;
	char *state;

	HS_DBG();

	switch (hi->hs_35mm_type) {
	case HEADSET_UNPLUG:
		state = "headset_unplug";
		break;
	case HEADSET_NO_MIC:
		state = "headset_no_mic";
		break;
	case HEADSET_MIC:
		state = "headset_mic";
		break;
	case HEADSET_METRICO:
		state = "headset_metrico";
		break;
	case HEADSET_UNKNOWN_MIC:
		state = "headset_unknown_mic";
		break;
	case HEADSET_TV_OUT:
		state = "headset_tv_out";
		break;
	case HEADSET_UNSTABLE:
		state = "headset_unstable";
		break;
	case HEADSET_BEATS:
		state = "headset_beats";
		break;
	case HEADSET_BEATS_SOLO:
		state = "headset_beats_solo";
		break;
	case HEADSET_INDICATOR:
		state = "headset_indicator";
		break;
	default:
		state = "error_state";
	}

	length = sprintf(buf, "%s\n", state);

	return length;
}
开发者ID:DACcer,项目名称:android_kernel_htc_msm8960-evita,代码行数:47,代码来源:htc_headset_mgr.c


示例2: irq_init_work_func

static void irq_init_work_func(struct work_struct *work)
{
	HS_DBG();

	if (hi->pdata.hpin_gpio) {
		HS_LOG("Enable detect IRQ");
		set_irq_type(hi->hpin_irq, IRQF_TRIGGER_LOW);
		enable_irq(hi->hpin_irq);
	}

	if (hi->pdata.key_gpio) {
		HS_LOG("Enable button IRQ");
		hi->key_irq_type = IRQF_TRIGGER_LOW;
		set_irq_type(hi->key_irq, hi->key_irq_type);
		enable_irq(hi->key_irq);
	}
}
开发者ID:anticline,项目名称:android_kernel_htc_msm8939,代码行数:17,代码来源:htc_headset_gpio.c


示例3: button_35mm_work_func

static void button_35mm_work_func(struct work_struct *work)
{
	int key;
	struct button_work *works;

	wake_lock_timeout(&hi->hs_wake_lock, HS_WAKE_LOCK_TIMEOUT);

	HS_DBG();

	works = container_of(work, struct button_work, key_work.work);
	hi->key_level_flag = works->key_code;

	if (!hi->is_ext_insert && !hi->h2w_35mm_type) {
		kfree(works);
		HS_LOG("3.5mm headset is plugged out, skip report key event");
		return;
	}

	if (hi->key_level_flag) {
		switch (hi->key_level_flag) {
		case 1:
			HS_LOG("3.5mm RC: Play Pressed");
			key = HS_MGR_KEYCODE_MEDIA;
			break;
		case 2:
			HS_LOG("3.5mm RC: BACKWARD Pressed");
			key = HS_MGR_KEYCODE_BACKWARD;
			break;
		case 3:
			HS_LOG("3.5mm RC: FORWARD Pressed");
			key = HS_MGR_KEYCODE_FORWARD;
			break;
		default:
			HS_LOG("3.5mm RC: WRONG Button Pressed");
			return;
		}
		headset_button_event(1, key);
	} else { /* key release */
		if (atomic_read(&hi->btn_state))
			headset_button_event(0, atomic_read(&hi->btn_state));
		else
			HS_LOG("3.5mm RC: WRONG Button Release");
	}

	kfree(works);
}
开发者ID:AmeriCanAndroid,项目名称:aca-evo3d-omega-htc-35,代码行数:46,代码来源:htc_headset_mgr.c


示例4: switch_send_event

int switch_send_event(unsigned int bit, int on)
{
	unsigned long state;

	HS_DBG();

	mutex_lock(&hi->mutex_lock);
	state = switch_get_state(&hi->sdev_h2w);
	state &= ~(bit);

	if (on)
		state |= bit;

	switch_set_state(&hi->sdev_h2w, state);
	mutex_unlock(&hi->mutex_lock);
	return 0;
}
开发者ID:Dm47021,项目名称:NectarVS_Osiris_Kernel_HTC_Kingdom,代码行数:17,代码来源:htc_headset_mgr.c


示例5: debug_flag_show

static ssize_t debug_flag_show(struct device *dev,
			       struct device_attribute *attr, char *buf)
{
	int flag = hi->debug_flag;
	int adc = -EINVAL;
	int hpin_gpio = -EINVAL;

	HS_DBG();

	if (hs_mgr_notifier.hpin_gpio)
		hpin_gpio = hs_mgr_notifier.hpin_gpio();
	if (hs_mgr_notifier.remote_adc)
		hs_mgr_notifier.remote_adc(&adc);

	return sprintf(buf, "Debug Flag %d, HP_DET %d, ADC %d\n", flag,
		       hpin_gpio, adc);
}
开发者ID:Dm47021,项目名称:NectarVS_Osiris_Kernel_HTC_Kingdom,代码行数:17,代码来源:htc_headset_mgr.c


示例6: headset_button_event

void headset_button_event(int is_press, int type)
{
	HS_DBG();

	if (!hs_hpin_stable()) {
		HS_LOG("The HPIN is unstable, SKIP THE BUTTON EVENT.");
		return;
	}
	if (!get_mic_state()) {
		HS_LOG("IGNORE key %d (Not support MIC)", type);
		return;
	}
	if (!is_press)
		button_released(type);
	else if (!atomic_read(&hi->btn_state))
		button_pressed(type);
}
开发者ID:freak007,项目名称:hox-kernel,代码行数:17,代码来源:htc_headset_mgr.c


示例7: hs_pmic_remote_threshold

static int hs_pmic_remote_threshold(uint32_t adc)
{
	int i = 0;
	int ret = 0;
	uint32_t status;
	struct hs_pmic_rpc_request req;
	struct hs_pmic_rpc_reply rep;

	HS_DBG();

	if (!(hi->pdata.driver_flag & DRIVER_HS_PMIC_DYNAMIC_THRESHOLD))
		return 0;

	req.hs_controller = cpu_to_be32(hi->pdata.hs_controller);
	req.hs_switch = cpu_to_be32(hi->pdata.hs_switch);
	req.current_uA = cpu_to_be32(HS_PMIC_HTC_CURRENT_THRESHOLD);

	for (i = 0; i < ARRAY_SIZE(current_threshold_lut); i++) {
		if (adc >= current_threshold_lut[i].adc_min &&
		    adc <= current_threshold_lut[i].adc_max)
			req.current_uA = cpu_to_be32(current_threshold_lut[i].
						     current_uA);
	}

	ret = msm_rpc_call_reply(endpoint_current,
				 HS_PMIC_RPC_CLIENT_PROC_THRESHOLD,
				 &req, sizeof(req), &rep, sizeof(rep),
				 HS_RPC_TIMEOUT);

	if (ret < 0) {
		HS_ERR("Failed to send remote threshold RPC");
		return 0;
	} else {
		status = be32_to_cpu(rep.status);
		if (status != HS_PMIC_RPC_ERR_SUCCESS) {
			HS_ERR("Failed to set remote threshold");
			return 0;
		}
	}

	HS_LOG("Set remote threshold (%u, %u, %u)", hi->pdata.hs_controller,
	       hi->pdata.hs_switch, be32_to_cpu(req.current_uA));

	return 1;
}
开发者ID:2fast4u88,项目名称:Htc-Merge-FastKernel,代码行数:45,代码来源:htc_headset_pmic.c


示例8: usb_headset_detect

static void usb_headset_detect(int type)
{
	int state_h2w = 0;
	int state_usb = 0;

	HS_DBG();

	mutex_lock(&hi->mutex_lock);
	state_h2w = switch_get_state(&hi->sdev_h2w);

	switch (type) {
	case USB_NO_HEADSET:
		hi->usb_headset.type = USB_NO_HEADSET;
		hi->usb_headset.status = STATUS_DISCONNECTED;
		state_h2w &= ~MASK_USB_HEADSET;
		state_usb = GOOGLE_USB_AUDIO_UNPLUG;
		HS_LOG_TIME("Remove USB_HEADSET (state %d, %d)",
			    state_h2w, state_usb);
		break;
	case USB_AUDIO_OUT:
		hi->usb_headset.type = USB_AUDIO_OUT;
		hi->usb_headset.status = STATUS_CONNECTED_ENABLED;
		state_h2w |= BIT_USB_AUDIO_OUT;
		state_usb = GOOGLE_USB_AUDIO_ANLG;
		HS_LOG_TIME("Insert USB_AUDIO_OUT (state %d, %d)",
			    state_h2w, state_usb);
		break;
#ifdef CONFIG_SUPPORT_USB_SPEAKER
       case USB_AUDIO_OUT_DGTL:
	       hi->usb_headset.type = USB_AUDIO_OUT;
               hi->usb_headset.status = STATUS_CONNECTED_ENABLED;
               state_h2w |= BIT_USB_AUDIO_OUT;
               state_usb = GOOGLE_USB_AUDIO_DGTL;
               HS_LOG_TIME("Insert USB_AUDIO_OUT DGTL (state %d, %d)",
	                  state_h2w, state_usb);
	       break;
#endif
	default:
		HS_LOG("Unknown headset type");
	}

	switch_set_state(&hi->sdev_h2w, state_h2w);
	switch_set_state(&hi->sdev_usb_audio, state_usb);
	mutex_unlock(&hi->mutex_lock);
}
开发者ID:Bigtime1267,项目名称:HTC-C525c,代码行数:45,代码来源:htc_headset_mgr.c


示例9: htc_headset_mgr_late_resume

static void htc_headset_mgr_late_resume(struct early_suspend *h)
{
	int state = 0;

	HS_DBG();

	if (hi->quick_boot_status) {
		mutex_lock(&hi->mutex_lock);
		state = switch_get_state(&hi->sdev);
		HS_LOG_TIME("Resend quick boot U-Event (state = %d)",
			    state | BIT_UNDEFINED);
		switch_set_state(&hi->sdev, state | BIT_UNDEFINED);
		HS_LOG_TIME("Resend quick boot U-Event (state = %d)", state);
		switch_set_state(&hi->sdev, state);
		hi->quick_boot_status = 0;
		mutex_unlock(&hi->mutex_lock);
	}
}
开发者ID:freak007,项目名称:hox-kernel,代码行数:18,代码来源:htc_headset_mgr.c


示例10: detect_irq_handler

static irqreturn_t detect_irq_handler(int irq, void *data)
{
	unsigned int irq_mask = IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW;

	hs_notify_hpin_irq();

	HS_DBG();

	if (!(hi->pdata.driver_flag & DRIVER_HS_PMIC_EDGE_IRQ)) {
		hi->hpin_irq_type ^= irq_mask;
		set_irq_type(hi->pdata.hpin_irq, hi->hpin_irq_type);
	}

	wake_lock_timeout(&hi->hs_wake_lock, HS_WAKE_LOCK_TIMEOUT);
	queue_delayed_work(detect_wq, &detect_pmic_work, hi->hpin_debounce);

	return IRQ_HANDLED;
}
开发者ID:free-z4u,项目名称:android_kernel_htc_msm7x30,代码行数:18,代码来源:htc_headset_pmic.c


示例11: hs_gpio_request_irq

static int hs_gpio_request_irq(unsigned int gpio, unsigned int *irq,
			       irq_handler_t handler, unsigned long flags,
			       const char *name, unsigned int wake)
{
	int ret = 0;

	HS_DBG();

	ret = gpio_request(gpio, name);
	if (ret < 0)
		return ret;

	ret = gpio_direction_input(gpio);
	if (ret < 0) {
		gpio_free(gpio);
		return ret;
	}

	if (!(*irq)) {
		ret = gpio_to_irq(gpio);
		if (ret < 0) {
			gpio_free(gpio);
			return ret;
		}
		HS_LOG("gpio_to_irq ret = %d", ret);
		*irq = (unsigned int) ret;
	}

	HS_LOG("[HS] irq=%d", *irq);
	ret = request_irq(*irq, handler, flags, name, NULL);
	if (ret < 0) {
		gpio_free(gpio);
		return ret;
	}

	ret = set_irq_wake(*irq, wake);
	if (ret < 0) {
		free_irq(*irq, 0);
		gpio_free(gpio);
		return ret;
	}

	return 1;
}
开发者ID:anticline,项目名称:android_kernel_htc_msm8939,代码行数:44,代码来源:htc_headset_gpio.c


示例12: set_35mm_hw_state

static void set_35mm_hw_state(int state)
{
	HS_DBG();

	if (hi->mic_bias_state != state && hs_mgr_notifier.mic_bias_enable) {
		hs_mgr_notifier.mic_bias_enable(state);
		hi->mic_bias_state = state;
		if (state) /* Wait for MIC bias stable */
			msleep(HS_DELAY_MIC_BIAS);
	}

	hs_set_mic_select(state);

	if (hs_mgr_notifier.key_enable)
		hs_mgr_notifier.key_enable(state);

	if (hs_mgr_notifier.key_int_enable)
		hs_mgr_notifier.key_int_enable(state);
}
开发者ID:AmeriCanAndroid,项目名称:aca-evo3d-omega-htc-35,代码行数:19,代码来源:htc_headset_mgr.c


示例13: hs_gpio_request_output

static int hs_gpio_request_output(unsigned int gpio, const char *name, int value)
{
	int ret = 0;

	HS_DBG();

	ret = gpio_request(gpio, name);
	if (ret < 0)
		HS_LOG("GPIO Already Requested");

	ret = gpio_direction_output(gpio, value);
	if (ret < 0) {
		HS_ERR("gpio_direction_output(gpio);");
		gpio_free(gpio);
		return ret;
	}

	return 1;
}
开发者ID:anticline,项目名称:android_kernel_htc_msm8939,代码行数:19,代码来源:htc_headset_gpio.c


示例14: hs_8x60_remote_adc

static int hs_8x60_remote_adc(int *adc)
{
	int ret = 0;

	HS_DBG();

	ret = pm8058_htc_config_mpp_and_adc_read(adc, 1, CHANNEL_ADC_HDSET,
						 hi->pdata.adc_mpp,
						 hi->pdata.adc_amux);
	if (ret) {
		*adc = -1;
		HS_LOG("Failed to read remote ADC");
		return 0;
	}

	HS_LOG("Remote ADC %d (0x%X)", *adc, *adc);

	return 1;
}
开发者ID:LeeDroid-,项目名称:Shooter-2.6.35-MR,代码行数:19,代码来源:htc_headset_8x60.c


示例15: debug_work_func

static void debug_work_func(struct work_struct *work)
{
	int flag = 0;
	int adc = -EINVAL;
	int hpin_gpio = -EINVAL;

	HS_DBG();

	while (hi->debug_flag & DEBUG_FLAG_ADC) {
		flag = hi->debug_flag;
		if (hs_mgr_notifier.hpin_gpio)
			hpin_gpio = hs_mgr_notifier.hpin_gpio();
		if (hs_mgr_notifier.remote_adc)
			hs_mgr_notifier.remote_adc(&adc);
		HS_LOG("Debug Flag %d, HP_DET %d, ADC %d", flag,
		       hpin_gpio, adc);
		msleep(HS_DELAY_SEC);
	}
}
开发者ID:Dm47021,项目名称:NectarVS_Osiris_Kernel_HTC_Kingdom,代码行数:19,代码来源:htc_headset_mgr.c


示例16: hs_notify_key_event

int hs_notify_key_event(int key_code)
{
	struct button_work *work;

	HS_DBG();

	if (hi->hs_35mm_type == HEADSET_INDICATOR) {
		HS_LOG("Not support remote control");
		return 1;
	}

	if (hi->hs_35mm_type == HEADSET_UNKNOWN_MIC ||
	    hi->hs_35mm_type == HEADSET_NO_MIC ||
	    hi->h2w_35mm_type == HEADSET_NO_MIC)
		update_mic_status(HS_DEF_MIC_DETECT_COUNT);
	else if (hi->hs_35mm_type == HEADSET_UNSTABLE)
		update_mic_status(0);
	else if (!hs_hpin_stable()) {
		HS_LOG("IGNORE key %d (Unstable HPIN)", key_code);
		return 1;
	} else if (hi->hs_35mm_type == HEADSET_UNPLUG && hi->is_ext_insert == 1) {
		HS_LOG("MIC status is changed from float, re-polling to decide accessory type");
		update_mic_status(HS_DEF_MIC_DETECT_COUNT);
		return 1;
	} else if (hi->hs_35mm_type == HEADSET_UNPLUG && hi->is_ext_insert == 1) {
		HS_LOG("MIC status is changed from float, re-polling to decide accessory type");
		update_mic_status(HS_DEF_MIC_DETECT_COUNT);
		return 1;
	} else {
		work = kzalloc(sizeof(struct button_work), GFP_KERNEL);
		if (!work) {
			HS_ERR("Failed to allocate button memory");
			return 1;
		}
		work->key_code = key_code;
		INIT_DELAYED_WORK(&work->key_work, button_35mm_work_func);
		queue_delayed_work(button_wq, &work->key_work,
				   HS_JIFFIES_BUTTON);
	}

	return 1;
}
开发者ID:Bigtime1267,项目名称:HTC-C525c,代码行数:42,代码来源:htc_headset_mgr.c


示例17: headset_button_event

void headset_button_event(int is_press, int type)
{
	HS_DBG();

	if (hi->hs_35mm_type == HEADSET_UNPLUG &&
	    hi->h2w_35mm_type == HEADSET_UNPLUG) {
		HS_LOG("IGNORE key %d (HEADSET_UNPLUG)", type);
		return;
	}

	if (!hs_hpin_stable()) {
		HS_LOG("IGNORE key %d (Unstable HPIN)", type);
		return;
	}

	if (!is_press)
		button_released(type);
	else if (!atomic_read(&hi->btn_state))
		button_pressed(type);
}
开发者ID:DooMLoRD,项目名称:HTC-Flyer-HC-Kernel,代码行数:20,代码来源:htc_headset_mgr.c


示例18: enable_metrico_headset

static void enable_metrico_headset(int enable)
{
	HS_DBG();

	if (enable && !hi->metrico_status) {
#if 0
		enable_mos_test(1);
#endif
		hi->metrico_status = 1;
		HS_LOG("Enable metrico headset");
	}

	if (!enable && hi->metrico_status) {
#if 0
		enable_mos_test(0);
#endif
		hi->metrico_status = 0;
		HS_LOG("Disable metrico headset");
	}
}
开发者ID:Dm47021,项目名称:NectarVS_Osiris_Kernel_HTC_Kingdom,代码行数:20,代码来源:htc_headset_mgr.c


示例19: fm_flag_show

static ssize_t fm_flag_show(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	char *s = buf;
	char *show_str = "disable";;

	HS_DBG();

	mutex_lock(&hi->mutex_lock);
	if (hi->fm_flag == 0)
		show_str = "disable";
	if (hi->fm_flag == 1)
		show_str = "fm_headset";
	if (hi->fm_flag == 2)
		show_str = "fm_speaker";

	s += sprintf(s, "%s\n", show_str);
	mutex_unlock(&hi->mutex_lock);
	return (s - buf);
}
开发者ID:freak007,项目名称:hox-kernel,代码行数:20,代码来源:htc_headset_mgr.c


示例20: hs_notify_plug_event

int hs_notify_plug_event(int insert)
{
	HS_DBG("Headset status %d", insert);

	mutex_lock(&hi->mutex_lock);
	hi->is_ext_insert = insert;
	mutex_unlock(&hi->mutex_lock);

	cancel_delayed_work_sync(&mic_detect_work);
	cancel_delayed_work_sync(&insert_detect_work);
	cancel_delayed_work_sync(&remove_detect_work);

	if (hi->is_ext_insert)
		queue_delayed_work(detect_wq, &insert_detect_work,
				   HS_JIFFIES_INSERT);
	else
		queue_delayed_work(detect_wq, &remove_detect_work,
				   HS_JIFFIES_REMOVE);

	return 1;
}
开发者ID:AmeriCanAndroid,项目名称:aca-evo3d-omega-htc-35,代码行数:21,代码来源:htc_headset_mgr.c



注:本文中的HS_DBG函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ HTList_addObject函数代码示例发布时间:2022-05-30
下一篇:
C++ HSL_DEV_ID_CHECK函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap