summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2012-10-26 19:03:28 +0200
committerPaul Kocialkowski <contact@paulk.fr>2012-10-26 19:03:28 +0200
commit5f903f20d812bfbec535d9432ce8f4d357097e58 (patch)
tree24dd00f72c867438adccbdd4f98b973dfa193937
parentf6e1b0eae63dfd937213e0b0fdb01f106621421c (diff)
downloadhardware_tinyalsa-audio-5f903f20d812bfbec535d9432ce8f4d357097e58.zip
hardware_tinyalsa-audio-5f903f20d812bfbec535d9432ce8f4d357097e58.tar.gz
hardware_tinyalsa-audio-5f903f20d812bfbec535d9432ce8f4d357097e58.tar.bz2
Yamaha-MC1N2-Audio: Follow API changes
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--audio_hw.c15
-rw-r--r--audio_in.c3
-rw-r--r--audio_out.c3
3 files changed, 17 insertions, 4 deletions
diff --git a/audio_hw.c b/audio_hw.c
index 7dee074..b0bda46 100644
--- a/audio_hw.c
+++ b/audio_hw.c
@@ -117,6 +117,7 @@ static int audio_hw_set_master_volume(struct audio_hw_device *dev, float volume)
static int audio_hw_set_mode(struct audio_hw_device *dev, int mode)
{
struct tinyalsa_audio_device *device;
+ int rc;
LOGD("%s(%p, %d)", __func__, dev, mode);
@@ -131,8 +132,22 @@ static int audio_hw_set_mode(struct audio_hw_device *dev, int mode)
if(device->stream_out != NULL)
tinyalsa_mixer_set_device(device->mixer, device->stream_out->device_current);
+
+#ifdef YAMAHA_MC1N2_AUDIO
+ rc = yamaha_mc1n2_audio_modem_start(device->mc1n2_pdata);
+ if(rc < 0) {
+ LOGE("Failed to set Yamaha-MC1N2-Audio route");
+ }
+#endif
} else if(device->mode == AUDIO_MODE_IN_CALL) {
tinyalsa_mixer_set_modem_state(device->mixer, 0);
+
+#ifdef YAMAHA_MC1N2_AUDIO
+ rc = yamaha_mc1n2_audio_modem_stop(device->mc1n2_pdata);
+ if(rc < 0) {
+ LOGE("Failed to set Yamaha-MC1N2-Audio route");
+ }
+#endif
}
device->mode = mode;
diff --git a/audio_in.c b/audio_in.c
index 29cda6e..c89947e 100644
--- a/audio_in.c
+++ b/audio_in.c
@@ -102,8 +102,7 @@ int audio_in_set_route(struct tinyalsa_audio_stream_in *stream_in,
tinyalsa_mixer_set_device(stream_in->device->mixer, stream_in->device_current);
#ifdef YAMAHA_MC1N2_AUDIO
- yamaha_mc1n2_audio_set_route(stream_in->device->mc1n2_pdata, device,
- stream_in->device->mode);
+ yamaha_mc1n2_audio_set_route(stream_in->device->mc1n2_pdata, device);
#endif
return 0;
diff --git a/audio_out.c b/audio_out.c
index a347eaa..969c8f6 100644
--- a/audio_out.c
+++ b/audio_out.c
@@ -105,8 +105,7 @@ int audio_out_set_route(struct tinyalsa_audio_stream_out *stream_out,
tinyalsa_mixer_set_device(stream_out->device->mixer, stream_out->device_current);
#ifdef YAMAHA_MC1N2_AUDIO
- yamaha_mc1n2_audio_set_route(stream_out->device->mc1n2_pdata, device,
- stream_out->device->mode);
+ yamaha_mc1n2_audio_set_route(stream_out->device->mc1n2_pdata, device);
#endif
return 0;