summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorUtkarshGupta <utkarsh.eminem@gmail.com>2014-02-18 16:13:29 +0530
committertilaksidduram <tilaksidduram@gmail.com>2014-03-03 10:23:14 +0530
commitaf060f3fbcea8dca2f2ef49a52759dec773bfa01 (patch)
treef210d87b0def83e7892a9609c41d0a2f63f13588 /audio
parenta1676c728b0d479541bc48c80fe864c8eb673ec6 (diff)
downloaddevice_samsung_n7100-af060f3fbcea8dca2f2ef49a52759dec773bfa01.zip
device_samsung_n7100-af060f3fbcea8dca2f2ef49a52759dec773bfa01.tar.gz
device_samsung_n7100-af060f3fbcea8dca2f2ef49a52759dec773bfa01.tar.bz2
n7100: audio: hal update
Brought in audio hal from i9300 Change-Id: Ib91a8b9bd41e7cdb83c14ca8de7f35e935337176
Diffstat (limited to 'audio')
-rwxr-xr-xaudio/audio_hw.c32
-rw-r--r--audio/audio_hw.h4
2 files changed, 25 insertions, 11 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index a890b63..50b0014 100755
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -314,7 +314,6 @@ static int set_route_by_array(struct mixer *mixer, struct route_setting *route,
void select_devices(struct m0_audio_device *adev)
{
int i;
-
if (adev->active_out_device == adev->out_device && adev->active_in_device == adev->in_device)
return;
@@ -324,26 +323,30 @@ void select_devices(struct m0_audio_device *adev)
/* Turn on new devices first so we don't glitch due to powerdown... */
for (i = 0; i < adev->num_dev_cfgs; i++)
if ((adev->out_device & adev->dev_cfgs[i].mask) &&
- !(adev->active_out_device & adev->dev_cfgs[i].mask))
+ !(adev->active_out_device & adev->dev_cfgs[i].mask) &&
+ !(adev->dev_cfgs[i].mask & AUDIO_DEVICE_BIT_IN))
set_route_by_array(adev->mixer, adev->dev_cfgs[i].on,
adev->dev_cfgs[i].on_len);
for (i = 0; i < adev->num_dev_cfgs; i++)
if ((adev->in_device & adev->dev_cfgs[i].mask) &&
- !(adev->active_in_device & adev->dev_cfgs[i].mask))
+ !(adev->active_in_device & adev->dev_cfgs[i].mask) &&
+ (adev->dev_cfgs[i].mask & AUDIO_DEVICE_BIT_IN))
set_route_by_array(adev->mixer, adev->dev_cfgs[i].on,
adev->dev_cfgs[i].on_len);
/* ...then disable old ones. */
for (i = 0; i < adev->num_dev_cfgs; i++)
if (!(adev->out_device & adev->dev_cfgs[i].mask) &&
- (adev->active_out_device & adev->dev_cfgs[i].mask))
+ (adev->active_out_device & adev->dev_cfgs[i].mask) &&
+ !(adev->dev_cfgs[i].mask & AUDIO_DEVICE_BIT_IN))
set_route_by_array(adev->mixer, adev->dev_cfgs[i].off,
adev->dev_cfgs[i].off_len);
for (i = 0; i < adev->num_dev_cfgs; i++)
if (!(adev->in_device & adev->dev_cfgs[i].mask) &&
- (adev->active_in_device & adev->dev_cfgs[i].mask))
+ (adev->active_in_device & adev->dev_cfgs[i].mask) &&
+ (adev->dev_cfgs[i].mask & AUDIO_DEVICE_BIT_IN))
set_route_by_array(adev->mixer, adev->dev_cfgs[i].off,
adev->dev_cfgs[i].off_len);
@@ -493,8 +496,9 @@ static void set_incall_device(struct m0_audio_device *adev)
device_type = SOUND_AUDIO_PATH_HANDSET;
break;
case AUDIO_DEVICE_OUT_SPEAKER:
- case AUDIO_DEVICE_OUT_AUX_DIGITAL:
+ case AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET:
case AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET:
+ case AUDIO_DEVICE_OUT_AUX_DIGITAL:
device_type = SOUND_AUDIO_PATH_SPEAKER;
break;
case AUDIO_DEVICE_OUT_WIRED_HEADSET:
@@ -644,6 +648,12 @@ static void select_output_device(struct m0_audio_device *adev)
case AUDIO_DEVICE_OUT_ALL_SCO:
ALOGD("%s: AUDIO_DEVICE_OUT_ALL_SCO", __func__);
break;
+ case AUDIO_DEVICE_OUT_USB_ACCESSORY:
+ ALOGD("%s: AUDIO_DEVICE_OUT_USB_ACCESSORY", __func__);
+ break;
+ case AUDIO_DEVICE_OUT_USB_DEVICE:
+ ALOGD("%s: AUDIO_DEVICE_OUT_USB_DEVICE", __func__);
+ break;
default:
ALOGD("%s: AUDIO_DEVICE_OUT_ALL", __func__);
break;
@@ -721,12 +731,16 @@ static void select_output_device(struct m0_audio_device *adev)
static void select_input_device(struct m0_audio_device *adev)
{
- switch(adev->in_device) {
+ int input_device = AUDIO_DEVICE_BIT_IN | adev->in_device;
+
+ switch(input_device) {
case AUDIO_DEVICE_IN_BUILTIN_MIC:
ALOGD("%s: AUDIO_DEVICE_IN_BUILTIN_MIC", __func__);
break;
case AUDIO_DEVICE_IN_BACK_MIC:
- ALOGD("%s: AUDIO_DEVICE_IN_BACK_MIC", __func__);
+ ALOGD("%s: AUDIO_DEVICE_IN_BACK_MIC | AUDIO_DEVICE_IN_BUILTIN_MIC", __func__);
+ // Force use both mics for video recording
+ adev->in_device = (AUDIO_DEVICE_IN_BACK_MIC | AUDIO_DEVICE_IN_BUILTIN_MIC) & ~AUDIO_DEVICE_BIT_IN;
break;
case AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET:
ALOGD("%s: AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET", __func__);
@@ -2412,7 +2426,6 @@ static int in_remove_audio_effect(const struct audio_stream *stream,
in->preprocessors[in->num_preprocessors].effect_itfe = NULL;
in->preprocessors[in->num_preprocessors].channel_configs = NULL;
-
/* check compatibility between main channel supported and possible auxiliary channels */
in_update_aux_channels(in, NULL);
@@ -2820,6 +2833,7 @@ static const struct {
{ AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET, "analog-dock" },
{ AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET, "digital-dock" },
{ AUDIO_DEVICE_OUT_ALL_SCO, "sco-out" },
+ { AUDIO_DEVICE_OUT_AUX_DIGITAL, "aux-digital" },
{ AUDIO_DEVICE_IN_BUILTIN_MIC, "builtin-mic" },
{ AUDIO_DEVICE_IN_BACK_MIC, "back-mic" },
diff --git a/audio/audio_hw.h b/audio/audio_hw.h
index 3c28d5a..d7d68d9 100644
--- a/audio/audio_hw.h
+++ b/audio/audio_hw.h
@@ -175,9 +175,9 @@ struct route_setting noise_suppression_disable[] = {
struct route_setting headset_input[] = {
{ .ctl_name = "MIXINL IN2L Switch", .intval = 0, },
- { .ctl_name = "MIXINR IN1R Switch", .intval = 0, },
+ { .ctl_name = "MIXINR IN1R Switch", .intval = 0, },
{ .ctl_name = "Headset Mic Switch", .intval = 1, },
- { .ctl_name = "IN1L Volume", .intval = 18, },
+ { .ctl_name = "IN1L Volume", .intval = 28, },
{ .ctl_name = "MIXINL IN1L Switch", .intval = 1, },
{ .ctl_name = "MIXINL IN1L Volume", .intval = 0, },
{ .ctl_name = "AIF1ADC1 HPF Mode", .intval = 1, },