本文整理汇总了C++中HS_DBG函数的典型用法代码示例。如果您正苦于以下问题:C++ HS_DBG函数的具体用法?C++ HS_DBG怎么用?C++ HS_DBG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HS_DBG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
}