本文整理汇总了C++中HS_LOG函数的典型用法代码示例。如果您正苦于以下问题:C++ HS_LOG函数的具体用法?C++ HS_LOG怎么用?C++ HS_LOG使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HS_LOG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
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);
}
示例2: headset_ext_detect
void headset_ext_detect(int type)
{
HS_DBG();
switch (type) {
case H2W_NO_HEADSET:
/* Release Key */
case H2W_HEADSET:
case H2W_35MM_HEADSET:
case H2W_REMOTE_CONTROL:
case H2W_USB_CRADLE:
case H2W_UART_DEBUG:
case H2W_TVOUT:
break;
case USB_NO_HEADSET:
/* Release Key */
case USB_AUDIO_OUT:
#ifdef CONFIG_SUPPORT_USB_SPEAKER
case USB_AUDIO_OUT_DGTL:
#endif
usb_headset_detect(type);
break;
default:
HS_LOG("Unknown headset type");
}
}
示例3: headset_notifier_update
static void headset_notifier_update(int id)
{
if (!hi) {
HS_LOG("HS_MGR driver is not ready");
return;
}
switch (id) {
case HEADSET_REG_HPIN_GPIO:
break;
case HEADSET_REG_REMOTE_ADC:
update_mic_status(HS_DEF_MIC_DETECT_COUNT);
break;
case HEADSET_REG_REMOTE_KEYCODE:
case HEADSET_REG_RPC_KEY:
break;
case HEADSET_REG_MIC_STATUS:
update_mic_status(HS_DEF_MIC_DETECT_COUNT);
break;
case HEADSET_REG_MIC_BIAS:
case HEADSET_REG_MIC_SELECT:
case HEADSET_REG_KEY_INT_ENABLE:
case HEADSET_REG_KEY_ENABLE:
case HEADSET_REG_INDICATOR_ENABLE:
break;
default:
break;
}
}
示例4: get_fs
static struct file *openFile(char *path,int flag,int mode)
{
mm_segment_t old_fs;
old_fs = get_fs();
set_fs(KERNEL_DS);
fp=filp_open(path, flag, mode);
set_fs(old_fs);
if(IS_ERR(fp))
HS_LOG("File Open Error:%s",path);
if(!fp->f_op)
HS_LOG("File Operation Method Error!!");
if (fp) return fp;
else return NULL;
}
示例5: hs_notify_key_event
int hs_notify_key_event(int key_code)
{
struct button_work *work;
HS_DBG();
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 (!hs_hpin_stable()) {
HS_LOG("The HPIN is unstable, SKIP THE BUTTON EVENT.");
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;
}
示例6: onewire_init_work_func
static void onewire_init_work_func(struct work_struct *work)
{
HS_LOG("Open %s", hi->pdata.onewire_tty_dev);
fp = openFile(hi->pdata.onewire_tty_dev,O_CREAT|O_RDWR|O_NONBLOCK,0666);
if (fp != NULL) {
if (!fp->private_data)
HS_LOG("No private data");
else {
HS_LOG("Private data exist");
closeFile(fp);
return;
}
} else
HS_LOG("%s, openFile is NULL pointer\n", __func__);
closeFile(fp);
}
示例7: headset_notifier_register
int headset_notifier_register(struct headset_notifier *notifier)
{
if (!notifier->func) {
HS_LOG("NULL register function");
return 0;
}
switch (notifier->id) {
case HEADSET_REG_HPIN_GPIO:
HS_LOG("Register HPIN_GPIO notifier");
hs_mgr_notifier.hpin_gpio = notifier->func;
break;
case HEADSET_REG_REMOTE_ADC:
HS_LOG("Register REMOTE_ADC notifier");
hs_mgr_notifier.remote_adc = notifier->func;
break;
case HEADSET_REG_RPC_KEY:
HS_LOG("Register RPC_KEY notifier");
hs_mgr_notifier.rpc_key = notifier->func;
break;
case HEADSET_REG_MIC_STATUS:
HS_LOG("Register MIC_STATUS notifier");
hs_mgr_notifier.mic_status = notifier->func;
break;
case HEADSET_REG_MIC_BIAS:
HS_LOG("Register MIC_BIAS notifier");
hs_mgr_notifier.mic_bias_enable = notifier->func;
break;
case HEADSET_REG_MIC_SELECT:
HS_LOG("Register MIC_SELECT notifier");
hs_mgr_notifier.mic_select = notifier->func;
break;
case HEADSET_REG_KEY_INT_ENABLE:
HS_LOG("Register KEY_INT_ENABLE notifier");
hs_mgr_notifier.key_int_enable = notifier->func;
break;
case HEADSET_REG_KEY_ENABLE:
HS_LOG("Register KEY_ENABLE notifier");
hs_mgr_notifier.key_enable = notifier->func;
break;
default:
HS_LOG("Unknown register ID");
return 0;
}
return 1;
}
示例8: hs_1wire_deinit
static void hs_1wire_deinit(void)
{
char all_zero = 0xaa;
if (fp) {
if (hi->pdata.tx_level_shift_en)
gpio_set_value_cansleep(hi->pdata.tx_level_shift_en, 0);
hr_msleep(20);
writeFile(fp, &all_zero, 1);
HS_LOG("Write 0xaa to unblock");
hr_msleep(10);
HS_LOG("close file");
closeFile(fp);
fp = NULL;
if (hi->pdata.tx_level_shift_en)
gpio_set_value_cansleep(hi->pdata.tx_level_shift_en, 1);
}
}
示例9: 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);
}
示例10: 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);
}
}
示例11: headset_1wire_parse_dt
static int headset_1wire_parse_dt(struct htc_hs_1wire_data *wire)
{
int i,ret = 0;
const char *ttyname;
u32 remoteadc[6] = {0};
struct device_node *dt = wire->dev->of_node;
HS_LOG("%s", __func__);
wire->pdata->tx_level_shift_en = of_get_named_gpio(dt, "hs_1wire,tx_level_shift_en", 0);
if (gpio_is_valid(wire->pdata->tx_level_shift_en)) {
HS_LOG("tx_lv_en:%d", wire->pdata->tx_level_shift_en);
} else
HS_LOG("tx_lv_en parser err");
ret = of_property_read_u32_array(dt, "hs_1wire,one_wire_remote", remoteadc, 6);
if (ret < 0) {
HS_LOG("remote parser failure");
} else {
for (i = 0; i < ARRAY_SIZE(remoteadc); i++) {
wire->pdata->one_wire_remote[i] = (char)remoteadc[i];
}
HS_LOG("remote: %#x %#x %#x", remoteadc[0], remoteadc[1],
remoteadc[2]);
}
ret = of_property_read_string(dt, "hs_1wire,onewire_tty_dev", &ttyname);
if (ret < 0) {
HS_LOG("tty_dev string parser failue");
} else {
snprintf(wire->pdata->onewire_tty_dev, 15, "/dev/%s", ttyname);
HS_LOG("tty=%s", wire->pdata->onewire_tty_dev);
}
return 0;
}
示例12: hs_read_aid
static int hs_read_aid(void)
{
char in_buf[10];
int read_count, i;
read_count = readFile(fp, in_buf, 10);
HS_LOG("[1wire]read_count = %d", read_count);
if (read_count > 0) {
for (i = 0; i < read_count; i++) {
HS_LOG("[1wire]in_buf[%d] = 0x%x", i, in_buf[i]);
if ((in_buf[i] & 0xF0) == 0x80 && in_buf[i] > 0x80) {
hi->aid = in_buf[i];
return 0;
}
}
}
return -1;
}
示例13: 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;
}
示例14: hs_gpio_uart_set
static void hs_gpio_uart_set(int value)
{
value = !!value;
if (value != headset_uart_enable) {
headset_uart_enable = value;
HS_LOG("%s headset uart", value? "enable": "disable");
gpio_set_value(hi->pdata.uart_gpio, value);
}
}
示例15: mutex_lock
static struct file *openFile(char *path,int flag,int mode)
{
mm_segment_t old_fs;
mutex_lock(&hi->mutex_lock);
old_fs = get_fs();
set_fs(KERNEL_DS);
HS_LOG("Open: fp count = %d", ++fp_count);
fp=filp_open(path, flag, mode);
set_fs(old_fs);
if (!fp)
return NULL;
if(IS_ERR(fp))
HS_LOG("File Open Error:%s",path);
if(!fp->f_op)
HS_LOG("File Operation Method Error!!");
return fp;
}