summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Chen <intervigil@gmail.com>2015-07-03 21:07:13 -0700
committerDan Pasanen <dan.pasanen@gmail.com>2015-10-13 12:21:55 -0700
commit135a6383b72db0df5227f6b12e5c203954e630ab (patch)
tree4c1a2a2285c49a12d49694b6f217fb1aab1613f8
parent1af33456dc9d6e6a1f1318bf7ac5090020e26c1c (diff)
downloadhardware_libhardware-135a6383b72db0df5227f6b12e5c203954e630ab.zip
hardware_libhardware-135a6383b72db0df5227f6b12e5c203954e630ab.tar.gz
hardware_libhardware-135a6383b72db0df5227f6b12e5c203954e630ab.tar.bz2
audio: Notify amplifier HAL of device enable/disable
Change-Id: I34ec900c9850e8ed3edecf2b92e12801bdbd4fe5
-rw-r--r--include/hardware/audio_amplifier.h16
-rw-r--r--modules/audio/audio_amplifier.c14
2 files changed, 30 insertions, 0 deletions
diff --git a/include/hardware/audio_amplifier.h b/include/hardware/audio_amplifier.h
index 075ae77..bb788c2 100644
--- a/include/hardware/audio_amplifier.h
+++ b/include/hardware/audio_amplifier.h
@@ -62,6 +62,22 @@ typedef struct amplifier_device {
int (*set_output_devices)(struct amplifier_device *device, uint32_t devices);
/**
+ * Notify amplifier device of output device enable/disable
+ *
+ * This function should handle only output devices.
+ */
+ int (*enable_output_devices)(struct amplifier_device *device,
+ uint32_t devices, bool enable);
+
+ /**
+ * Notify amplifier device of input device enable/disable
+ *
+ * This function should handle only input devices.
+ */
+ int (*enable_input_devices)(struct amplifier_device *device,
+ uint32_t devices, bool enable);
+
+ /**
* Notify amplifier device about current audio mode
*/
int (*set_mode)(struct amplifier_device *device, audio_mode_t mode);
diff --git a/modules/audio/audio_amplifier.c b/modules/audio/audio_amplifier.c
index b65a82d..05f3641 100644
--- a/modules/audio/audio_amplifier.c
+++ b/modules/audio/audio_amplifier.c
@@ -35,6 +35,18 @@ static int amp_set_output_devices(amplifier_device_t *device, uint32_t devices)
return 0;
}
+static int amp_enable_output_devices(amplifier_device_t *device,
+ uint32_t devices, bool enable)
+{
+ return 0;
+}
+
+static int amp_enable_input_devices(amplifier_device_t *device,
+ uint32_t devices, bool enable)
+{
+ return 0;
+}
+
static int amp_set_mode(amplifier_device_t *device, audio_mode_t mode)
{
return 0;
@@ -95,6 +107,8 @@ static int amp_module_open(const hw_module_t *module, const char *name,
amp_dev->set_input_devices = amp_set_input_devices;
amp_dev->set_output_devices = amp_set_output_devices;
+ amp_dev->enable_output_devices = amp_enable_output_devices;
+ amp_dev->enable_input_devices = amp_enable_input_devices;
amp_dev->set_mode = amp_set_mode;
amp_dev->output_stream_start = amp_output_stream_start;
amp_dev->input_stream_start = amp_input_stream_start;