diff options
-rw-r--r-- | include/hardware/audio_amplifier.h | 16 | ||||
-rw-r--r-- | modules/audio/audio_amplifier.c | 14 |
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; |