diff options
author | Utkarsh Gupta <utkarsh.eminem@gmail.com> | 2014-05-15 17:21:20 +0530 |
---|---|---|
committer | tilaksidduram <tilaksidduram@gmail.com> | 2014-10-30 10:32:58 +0530 |
commit | 1270d0cdbeb01e6c43ca2927718f54336676b11c (patch) | |
tree | 9bd063170959cfa1addb551220aecce2aec33fa3 /audio | |
parent | ba2fcc722d9c9acb5d5bd4931e126eee4277015d (diff) | |
download | device_samsung_n7100-1270d0cdbeb01e6c43ca2927718f54336676b11c.zip device_samsung_n7100-1270d0cdbeb01e6c43ca2927718f54336676b11c.tar.gz device_samsung_n7100-1270d0cdbeb01e6c43ca2927718f54336676b11c.tar.bz2 |
Audio HAL updates
Change-Id: Ie41cade3494dc9d3f8ba886ae1f4977e25b97423
Conflicts:
configs/tiny_hw.xml
Diffstat (limited to 'audio')
-rw-r--r-- | audio/audio_hw.c | 131 |
1 files changed, 71 insertions, 60 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 31aecad..b54ea35 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -587,6 +587,18 @@ static void select_mode(struct m0_audio_device *adev) adev->in_call = 0; ril_set_call_clock_sync(&adev->ril, SOUND_CLOCK_STOP); end_call(adev); + //Force Input Standby + adev->in_device = AUDIO_DEVICE_NONE; + + ALOGD("%s: set voicecall route: voicecall_default_disable", __func__); + set_bigroute_by_array(adev->mixer, voicecall_default_disable, 1); + ALOGD("%s: set voicecall route: default_input_disable", __func__); + set_bigroute_by_array(adev->mixer, default_input_disable, 1); + ALOGD("%s: set voicecall route: headset_input_disable", __func__); + set_bigroute_by_array(adev->mixer, headset_input_disable, 1); + ALOGD("%s: set voicecall route: bt_disable", __func__); + set_bigroute_by_array(adev->mixer, bt_disable, 1); + force_all_standby(adev); ALOGD("%s: set voicecall route: voicecall_default_disable", __func__); @@ -2795,86 +2807,85 @@ static void adev_config_start(void *data, const XML_Char *elem, unsigned int i, j; for (i = 0; attr[i]; i += 2) { - if (strcmp(attr[i], "name") == 0) - name = attr[i + 1]; + if (strcmp(attr[i], "name") == 0) + name = attr[i + 1]; - if (strcmp(attr[i], "val") == 0) - val = attr[i + 1]; + if (strcmp(attr[i], "val") == 0) + val = attr[i + 1]; } if (strcmp(elem, "device") == 0) { - if (!name) { - ALOGE("Unnamed device\n"); - return; - } - - for (i = 0; i < sizeof(dev_names) / sizeof(dev_names[0]); i++) { - if (strcmp(dev_names[i].name, name) == 0) { - ALOGI("Allocating device %s\n", name); - dev_cfg = realloc(s->adev->dev_cfgs, - (s->adev->num_dev_cfgs + 1) - * sizeof(*dev_cfg)); - if (!dev_cfg) { - ALOGE("Unable to allocate dev_cfg\n"); + if (!name) { + ALOGE("Unnamed device\n"); return; } - s->dev = &dev_cfg[s->adev->num_dev_cfgs]; - memset(s->dev, 0, sizeof(*s->dev)); - s->dev->mask = dev_names[i].mask; + for (i = 0; i < sizeof(dev_names) / sizeof(dev_names[0]); i++) { + if (strcmp(dev_names[i].name, name) == 0) { + ALOGI("Allocating device %s\n", name); + dev_cfg = realloc(s->adev->dev_cfgs, + (s->adev->num_dev_cfgs + 1) + * sizeof(*dev_cfg)); + if (!dev_cfg) { + ALOGE("Unable to allocate dev_cfg\n"); + return; + } - s->adev->dev_cfgs = dev_cfg; - s->adev->num_dev_cfgs++; - } - } + s->dev = &dev_cfg[s->adev->num_dev_cfgs]; + memset(s->dev, 0, sizeof(*s->dev)); + s->dev->mask = dev_names[i].mask; + s->adev->dev_cfgs = dev_cfg; + s->adev->num_dev_cfgs++; + } + } } else if (strcmp(elem, "path") == 0) { - if (s->path_len) - ALOGW("Nested paths\n"); - - /* If this a path for a device it must have a role */ - if (s->dev) { - /* Need to refactor a bit... */ - if (strcmp(name, "on") == 0) { - s->on = true; - } else if (strcmp(name, "off") == 0) { - s->on = false; - } else { - ALOGW("Unknown path name %s\n", name); + if (s->path_len) + ALOGW("Nested paths\n"); + + /* If this a path for a device it must have a role */ + if (s->dev) { + /* Need to refactor a bit... */ + if (strcmp(name, "on") == 0) { + s->on = true; + } else if (strcmp(name, "off") == 0) { + s->on = false; + } else { + ALOGW("Unknown path name %s\n", name); + } } - } } else if (strcmp(elem, "ctl") == 0) { - struct route_setting *r; + struct route_setting *r; - if (!name) { - ALOGE("Unnamed control\n"); - return; - } + if (!name) { + ALOGE("Unnamed control\n"); + return; + } - if (!val) { - ALOGE("No value specified for %s\n", name); - return; - } + if (!val) { + ALOGE("No value specified for %s\n", name); + return; + } - ALOGV("Parsing control %s => %s\n", name, val); + ALOGV("Parsing control %s => %s\n", name, val); - r = realloc(s->path, sizeof(*r) * (s->path_len + 1)); - if (!r) { - ALOGE("Out of memory handling %s => %s\n", name, val); - return; - } + r = realloc(s->path, sizeof(*r) * (s->path_len + 1)); + if (!r) { + ALOGE("Out of memory handling %s => %s\n", name, val); + return; + } - r[s->path_len].ctl_name = strdup(name); - r[s->path_len].strval = NULL; + r[s->path_len].ctl_name = strdup(name); + r[s->path_len].strval = NULL; - /* This can be fooled but it'll do */ - r[s->path_len].intval = atoi(val); - if (!r[s->path_len].intval && strcmp(val, "0") != 0) - r[s->path_len].strval = strdup(val); + /* This can be fooled but it'll do */ + r[s->path_len].intval = atoi(val); + if (!r[s->path_len].intval && strcmp(val, "0") != 0) + r[s->path_len].strval = strdup(val); - s->path = r; - s->path_len++; + s->path = r; + s->path_len++; } } |