summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Kelly <c-kelly@ti.com>2010-09-20 13:40:14 -0600
committerChris Kelly <c-kelly@ti.com>2010-09-20 13:40:14 -0600
commit8a36b437403d3d89c297a2cadea22d7b199c3491 (patch)
tree351ad84845cffa18c6fdb142da20d072550ace86
parent621bc21b12d0c4fb2f0f90ebf64b2f34d5233d38 (diff)
downloadalsa_sound-froyo.tar.gz
Allow hw specific modules to implement standbyfroyo
Some hw modules may want to take advantage of standby to power down the codec, so allow modules to implement a standby that will be called if it exists. Change-Id: I2e227715e4c4d82727bb983caf27405d93c01fb8 Signed-off-by: Chris Kelly <c-kelly@ti.com>
-rw-r--r--AudioHardwareALSA.h1
-rw-r--r--AudioStreamOutALSA.cpp7
2 files changed, 7 insertions, 1 deletions
diff --git a/AudioHardwareALSA.h b/AudioHardwareALSA.h
index e08fade..ebe7b9d 100644
--- a/AudioHardwareALSA.h
+++ b/AudioHardwareALSA.h
@@ -60,6 +60,7 @@ struct alsa_device_t {
status_t (*init)(alsa_device_t *, ALSAHandleList &);
status_t (*open)(alsa_handle_t *, uint32_t, int);
status_t (*close)(alsa_handle_t *);
+ status_t (*standby)(alsa_handle_t *);
status_t (*route)(alsa_handle_t *, uint32_t, int);
};
diff --git a/AudioStreamOutALSA.cpp b/AudioStreamOutALSA.cpp
index b295676..1ca87bc 100644
--- a/AudioStreamOutALSA.cpp
+++ b/AudioStreamOutALSA.cpp
@@ -151,7 +151,12 @@ status_t AudioStreamOutALSA::standby()
{
AutoMutex lock(mLock);
- snd_pcm_drain (mHandle->handle);
+ if (mHandle->module->standby)
+ // allow hw specific modules to imlement unique standby
+ // if needed
+ mHandle->module->standby(mHandle);
+ else
+ snd_pcm_drain (mHandle->handle);
if (mPowerLock) {
release_wake_lock ("AudioOutLock");