Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 1 | /* |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 17 | #define LOG_TAG "qcom_audio_policy_hal" |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 18 | //#define LOG_NDEBUG 0 |
| 19 | |
| 20 | #include <stdint.h> |
| 21 | |
| 22 | #include <hardware/hardware.h> |
| 23 | #include <system/audio.h> |
| 24 | #include <system/audio_policy.h> |
| 25 | #include <hardware/audio_policy.h> |
| 26 | |
| 27 | #include <hardware_legacy/AudioPolicyInterface.h> |
| 28 | #include <hardware_legacy/AudioSystemLegacy.h> |
| 29 | |
| 30 | #include "AudioPolicyCompatClient.h" |
| 31 | |
| 32 | namespace android_audio_legacy { |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 33 | |
| 34 | extern "C" { |
| 35 | |
| 36 | struct qcom_ap_module { |
| 37 | struct audio_policy_module module; |
| 38 | }; |
| 39 | |
| 40 | struct qcom_ap_device { |
| 41 | struct audio_policy_device device; |
| 42 | }; |
| 43 | |
| 44 | struct qcom_audio_policy { |
| 45 | struct audio_policy policy; |
| 46 | |
| 47 | void *service; |
| 48 | struct audio_policy_service_ops *aps_ops; |
| 49 | AudioPolicyCompatClient *service_client; |
| 50 | AudioPolicyInterface *apm; |
| 51 | }; |
| 52 | |
| 53 | static inline struct qcom_audio_policy * to_qap(struct audio_policy *pol) |
| 54 | { |
| 55 | return reinterpret_cast<struct qcom_audio_policy *>(pol); |
| 56 | } |
| 57 | |
| 58 | static inline const struct qcom_audio_policy * to_cqap(const struct audio_policy *pol) |
| 59 | { |
| 60 | return reinterpret_cast<const struct qcom_audio_policy *>(pol); |
| 61 | } |
| 62 | |
| 63 | |
| 64 | static int ap_set_device_connection_state(struct audio_policy *pol, |
| 65 | audio_devices_t device, |
| 66 | audio_policy_dev_state_t state, |
| 67 | const char *device_address) |
| 68 | { |
| 69 | struct qcom_audio_policy *qap = to_qap(pol); |
| 70 | return qap->apm->setDeviceConnectionState( |
Arne Coucheron | 73554f0 | 2013-03-28 13:01:31 +0100 | [diff] [blame] | 71 | device, |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 72 | (AudioSystem::device_connection_state)state, |
| 73 | device_address); |
| 74 | } |
| 75 | |
| 76 | static audio_policy_dev_state_t ap_get_device_connection_state( |
| 77 | const struct audio_policy *pol, |
| 78 | audio_devices_t device, |
| 79 | const char *device_address) |
| 80 | { |
| 81 | const struct qcom_audio_policy *qap = to_cqap(pol); |
| 82 | return (audio_policy_dev_state_t)qap->apm->getDeviceConnectionState( |
Arne Coucheron | 73554f0 | 2013-03-28 13:01:31 +0100 | [diff] [blame] | 83 | device, |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 84 | device_address); |
| 85 | } |
| 86 | |
| 87 | static void ap_set_phone_state(struct audio_policy *pol, audio_mode_t state) |
| 88 | { |
| 89 | struct qcom_audio_policy *qap = to_qap(pol); |
| 90 | qap->apm->setPhoneState(state); |
| 91 | } |
| 92 | |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 93 | /* indicate a change in ringer mode */ |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 94 | static void ap_set_ringer_mode(struct audio_policy *pol, uint32_t mode, |
| 95 | uint32_t mask) |
| 96 | { |
| 97 | // deprecated, never called |
| 98 | } |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 99 | |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 100 | /* force using a specific device category for the specified usage */ |
| 101 | static void ap_set_force_use(struct audio_policy *pol, |
| 102 | audio_policy_force_use_t usage, |
| 103 | audio_policy_forced_cfg_t config) |
| 104 | { |
| 105 | struct qcom_audio_policy *qap = to_qap(pol); |
| 106 | qap->apm->setForceUse((AudioSystem::force_use)usage, |
| 107 | (AudioSystem::forced_config)config); |
| 108 | } |
| 109 | |
| 110 | /* retreive current device category forced for a given usage */ |
| 111 | static audio_policy_forced_cfg_t ap_get_force_use( |
| 112 | const struct audio_policy *pol, |
| 113 | audio_policy_force_use_t usage) |
| 114 | { |
| 115 | const struct qcom_audio_policy *qap = to_cqap(pol); |
| 116 | return (audio_policy_forced_cfg_t)qap->apm->getForceUse( |
| 117 | (AudioSystem::force_use)usage); |
| 118 | } |
| 119 | |
| 120 | /* if can_mute is true, then audio streams that are marked ENFORCED_AUDIBLE |
| 121 | * can still be muted. */ |
| 122 | static void ap_set_can_mute_enforced_audible(struct audio_policy *pol, |
| 123 | bool can_mute) |
| 124 | { |
| 125 | struct qcom_audio_policy *qap = to_qap(pol); |
| 126 | qap->apm->setSystemProperty("ro.camera.sound.forced", can_mute ? "0" : "1"); |
| 127 | } |
| 128 | |
| 129 | static int ap_init_check(const struct audio_policy *pol) |
| 130 | { |
| 131 | const struct qcom_audio_policy *qap = to_cqap(pol); |
| 132 | return qap->apm->initCheck(); |
| 133 | } |
| 134 | |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 135 | |
| 136 | static audio_io_handle_t ap_get_output(struct audio_policy *pol, |
| 137 | audio_stream_type_t stream, |
| 138 | uint32_t sampling_rate, |
| 139 | audio_format_t format, |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 140 | uint32_t channels, |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 141 | audio_output_flags_t flags) |
| 142 | { |
| 143 | struct qcom_audio_policy *qap = to_qap(pol); |
| 144 | |
| 145 | ALOGV("%s: tid %d", __func__, gettid()); |
| 146 | return qap->apm->getOutput((AudioSystem::stream_type)stream, |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 147 | sampling_rate, format, channels, |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 148 | (AudioSystem::output_flags)flags); |
| 149 | } |
| 150 | |
| 151 | static int ap_start_output(struct audio_policy *pol, audio_io_handle_t output, |
| 152 | audio_stream_type_t stream, int session) |
| 153 | { |
| 154 | struct qcom_audio_policy *qap = to_qap(pol); |
| 155 | return qap->apm->startOutput(output, (AudioSystem::stream_type)stream, |
| 156 | session); |
| 157 | } |
| 158 | |
| 159 | static int ap_stop_output(struct audio_policy *pol, audio_io_handle_t output, |
| 160 | audio_stream_type_t stream, int session) |
| 161 | { |
| 162 | struct qcom_audio_policy *qap = to_qap(pol); |
| 163 | return qap->apm->stopOutput(output, (AudioSystem::stream_type)stream, |
| 164 | session); |
| 165 | } |
| 166 | |
| 167 | static void ap_release_output(struct audio_policy *pol, |
| 168 | audio_io_handle_t output) |
| 169 | { |
| 170 | struct qcom_audio_policy *qap = to_qap(pol); |
| 171 | qap->apm->releaseOutput(output); |
| 172 | } |
| 173 | |
| 174 | static audio_io_handle_t ap_get_input(struct audio_policy *pol, audio_source_t inputSource, |
| 175 | uint32_t sampling_rate, |
| 176 | audio_format_t format, |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 177 | uint32_t channels, |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 178 | audio_in_acoustics_t acoustics) |
| 179 | { |
| 180 | struct qcom_audio_policy *qap = to_qap(pol); |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 181 | return qap->apm->getInput(inputSource, sampling_rate, format, channels, |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 182 | (AudioSystem::audio_in_acoustics)acoustics); |
| 183 | } |
| 184 | |
| 185 | static int ap_start_input(struct audio_policy *pol, audio_io_handle_t input) |
| 186 | { |
| 187 | struct qcom_audio_policy *qap = to_qap(pol); |
| 188 | return qap->apm->startInput(input); |
| 189 | } |
| 190 | |
| 191 | static int ap_stop_input(struct audio_policy *pol, audio_io_handle_t input) |
| 192 | { |
| 193 | struct qcom_audio_policy *qap = to_qap(pol); |
| 194 | return qap->apm->stopInput(input); |
| 195 | } |
| 196 | |
| 197 | static void ap_release_input(struct audio_policy *pol, audio_io_handle_t input) |
| 198 | { |
| 199 | struct qcom_audio_policy *qap = to_qap(pol); |
| 200 | qap->apm->releaseInput(input); |
| 201 | } |
| 202 | |
| 203 | static void ap_init_stream_volume(struct audio_policy *pol, |
| 204 | audio_stream_type_t stream, int index_min, |
| 205 | int index_max) |
| 206 | { |
| 207 | struct qcom_audio_policy *qap = to_qap(pol); |
| 208 | qap->apm->initStreamVolume((AudioSystem::stream_type)stream, index_min, |
| 209 | index_max); |
| 210 | } |
| 211 | |
| 212 | static int ap_set_stream_volume_index(struct audio_policy *pol, |
| 213 | audio_stream_type_t stream, |
| 214 | int index) |
| 215 | { |
| 216 | struct qcom_audio_policy *qap = to_qap(pol); |
| 217 | return qap->apm->setStreamVolumeIndex((AudioSystem::stream_type)stream, |
| 218 | index, |
| 219 | AUDIO_DEVICE_OUT_DEFAULT); |
| 220 | } |
| 221 | |
| 222 | static int ap_get_stream_volume_index(const struct audio_policy *pol, |
| 223 | audio_stream_type_t stream, |
| 224 | int *index) |
| 225 | { |
| 226 | const struct qcom_audio_policy *qap = to_cqap(pol); |
| 227 | return qap->apm->getStreamVolumeIndex((AudioSystem::stream_type)stream, |
| 228 | index, |
| 229 | AUDIO_DEVICE_OUT_DEFAULT); |
| 230 | } |
| 231 | |
| 232 | static uint32_t ap_get_strategy_for_stream(const struct audio_policy *pol, |
| 233 | audio_stream_type_t stream) |
| 234 | { |
| 235 | const struct qcom_audio_policy *qap = to_cqap(pol); |
| 236 | return qap->apm->getStrategyForStream((AudioSystem::stream_type)stream); |
| 237 | } |
| 238 | |
| 239 | static int ap_set_stream_volume_index_for_device(struct audio_policy *pol, |
| 240 | audio_stream_type_t stream, |
| 241 | int index, |
| 242 | audio_devices_t device) |
| 243 | { |
| 244 | const struct qcom_audio_policy *qap = to_cqap(pol); |
| 245 | return qap->apm->setStreamVolumeIndex((AudioSystem::stream_type)stream, |
| 246 | index, |
| 247 | device); |
| 248 | } |
| 249 | |
| 250 | static int ap_get_stream_volume_index_for_device(const struct audio_policy *pol, |
| 251 | audio_stream_type_t stream, |
| 252 | int *index, |
| 253 | audio_devices_t device) |
| 254 | { |
| 255 | const struct qcom_audio_policy *qap = to_cqap(pol); |
| 256 | return qap->apm->getStreamVolumeIndex((AudioSystem::stream_type)stream, |
| 257 | index, |
Arne Coucheron | 73554f0 | 2013-03-28 13:01:31 +0100 | [diff] [blame] | 258 | AUDIO_DEVICE_OUT_DEFAULT); |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | static audio_devices_t ap_get_devices_for_stream(const struct audio_policy *pol, |
| 262 | audio_stream_type_t stream) |
| 263 | { |
| 264 | const struct qcom_audio_policy *qap = to_cqap(pol); |
| 265 | return qap->apm->getDevicesForStream((AudioSystem::stream_type)stream); |
| 266 | } |
| 267 | |
| 268 | static audio_io_handle_t ap_get_output_for_effect(struct audio_policy *pol, |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 269 | const struct effect_descriptor_s *desc) |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 270 | { |
| 271 | struct qcom_audio_policy *qap = to_qap(pol); |
| 272 | return qap->apm->getOutputForEffect(desc); |
| 273 | } |
| 274 | |
| 275 | static int ap_register_effect(struct audio_policy *pol, |
| 276 | const struct effect_descriptor_s *desc, |
| 277 | audio_io_handle_t io, |
| 278 | uint32_t strategy, |
| 279 | int session, |
| 280 | int id) |
| 281 | { |
| 282 | struct qcom_audio_policy *qap = to_qap(pol); |
| 283 | return qap->apm->registerEffect(desc, io, strategy, session, id); |
| 284 | } |
| 285 | |
| 286 | static int ap_unregister_effect(struct audio_policy *pol, int id) |
| 287 | { |
| 288 | struct qcom_audio_policy *qap = to_qap(pol); |
| 289 | return qap->apm->unregisterEffect(id); |
| 290 | } |
| 291 | |
| 292 | static int ap_set_effect_enabled(struct audio_policy *pol, int id, bool enabled) |
| 293 | { |
| 294 | struct qcom_audio_policy *qap = to_qap(pol); |
| 295 | return qap->apm->setEffectEnabled(id, enabled); |
| 296 | } |
| 297 | |
| 298 | static bool ap_is_stream_active(const struct audio_policy *pol, |
| 299 | audio_stream_type_t stream, |
| 300 | uint32_t in_past_ms) |
| 301 | { |
| 302 | const struct qcom_audio_policy *qap = to_cqap(pol); |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 303 | return qap->apm->isStreamActive(stream, in_past_ms); |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 304 | } |
| 305 | |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 306 | static bool ap_is_stream_active_remotely(const struct audio_policy *pol, audio_stream_type_t stream, |
Mike Grissom | 640608b | 2013-08-05 19:49:26 -0700 | [diff] [blame] | 307 | uint32_t in_past_ms) |
| 308 | { |
| 309 | const struct qcom_audio_policy *qap = to_cqap(pol); |
| 310 | return qap->apm->isStreamActiveRemotely((int) stream, in_past_ms); |
| 311 | } |
| 312 | |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 313 | static bool ap_is_source_active(const struct audio_policy *pol, audio_source_t source) |
| 314 | { |
| 315 | const struct qcom_audio_policy *qap = to_cqap(pol); |
| 316 | return qap->apm->isSourceActive(source); |
| 317 | } |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 318 | |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 319 | static int ap_dump(const struct audio_policy *pol, int fd) |
| 320 | { |
| 321 | const struct qcom_audio_policy *qap = to_cqap(pol); |
| 322 | return qap->apm->dump(fd); |
| 323 | } |
| 324 | |
| 325 | static int create_qcom_ap(const struct audio_policy_device *device, |
| 326 | struct audio_policy_service_ops *aps_ops, |
| 327 | void *service, |
| 328 | struct audio_policy **ap) |
| 329 | { |
| 330 | struct qcom_audio_policy *qap; |
| 331 | int ret; |
| 332 | |
| 333 | if (!service || !aps_ops) |
| 334 | return -EINVAL; |
| 335 | |
| 336 | qap = (struct qcom_audio_policy *)calloc(1, sizeof(*qap)); |
| 337 | if (!qap) |
| 338 | return -ENOMEM; |
| 339 | |
| 340 | qap->policy.set_device_connection_state = ap_set_device_connection_state; |
| 341 | qap->policy.get_device_connection_state = ap_get_device_connection_state; |
| 342 | qap->policy.set_phone_state = ap_set_phone_state; |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 343 | qap->policy.set_ringer_mode = ap_set_ringer_mode; |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 344 | qap->policy.set_force_use = ap_set_force_use; |
| 345 | qap->policy.get_force_use = ap_get_force_use; |
| 346 | qap->policy.set_can_mute_enforced_audible = |
| 347 | ap_set_can_mute_enforced_audible; |
| 348 | qap->policy.init_check = ap_init_check; |
| 349 | qap->policy.get_output = ap_get_output; |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 350 | qap->policy.start_output = ap_start_output; |
| 351 | qap->policy.stop_output = ap_stop_output; |
| 352 | qap->policy.release_output = ap_release_output; |
| 353 | qap->policy.get_input = ap_get_input; |
| 354 | qap->policy.start_input = ap_start_input; |
| 355 | qap->policy.stop_input = ap_stop_input; |
| 356 | qap->policy.release_input = ap_release_input; |
| 357 | qap->policy.init_stream_volume = ap_init_stream_volume; |
| 358 | qap->policy.set_stream_volume_index = ap_set_stream_volume_index; |
| 359 | qap->policy.get_stream_volume_index = ap_get_stream_volume_index; |
| 360 | qap->policy.set_stream_volume_index_for_device = ap_set_stream_volume_index_for_device; |
| 361 | qap->policy.get_stream_volume_index_for_device = ap_get_stream_volume_index_for_device; |
| 362 | qap->policy.get_strategy_for_stream = ap_get_strategy_for_stream; |
| 363 | qap->policy.get_devices_for_stream = ap_get_devices_for_stream; |
| 364 | qap->policy.get_output_for_effect = ap_get_output_for_effect; |
| 365 | qap->policy.register_effect = ap_register_effect; |
| 366 | qap->policy.unregister_effect = ap_unregister_effect; |
| 367 | qap->policy.set_effect_enabled = ap_set_effect_enabled; |
| 368 | qap->policy.is_stream_active = ap_is_stream_active; |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 369 | |
Mike Grissom | 640608b | 2013-08-05 19:49:26 -0700 | [diff] [blame] | 370 | qap->policy.is_stream_active_remotely = ap_is_stream_active_remotely; |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 371 | qap->policy.is_source_active = ap_is_source_active; |
| 372 | qap->policy.dump = ap_dump; |
| 373 | |
| 374 | qap->service = service; |
| 375 | qap->aps_ops = aps_ops; |
| 376 | qap->service_client = |
| 377 | new AudioPolicyCompatClient(aps_ops, service); |
| 378 | if (!qap->service_client) { |
| 379 | ret = -ENOMEM; |
| 380 | goto err_new_compat_client; |
| 381 | } |
| 382 | |
| 383 | qap->apm = createAudioPolicyManager(qap->service_client); |
| 384 | if (!qap->apm) { |
| 385 | ret = -ENOMEM; |
| 386 | goto err_create_apm; |
| 387 | } |
| 388 | |
| 389 | *ap = &qap->policy; |
| 390 | return 0; |
| 391 | |
| 392 | err_create_apm: |
| 393 | delete qap->service_client; |
| 394 | err_new_compat_client: |
| 395 | free(qap); |
| 396 | *ap = NULL; |
| 397 | return ret; |
| 398 | } |
| 399 | |
| 400 | static int destroy_qcom_ap(const struct audio_policy_device *ap_dev, |
| 401 | struct audio_policy *ap) |
| 402 | { |
| 403 | struct qcom_audio_policy *qap = to_qap(ap); |
| 404 | |
| 405 | if (!qap) |
| 406 | return 0; |
| 407 | |
| 408 | if (qap->apm) |
| 409 | destroyAudioPolicyManager(qap->apm); |
| 410 | if (qap->service_client) |
| 411 | delete qap->service_client; |
| 412 | free(qap); |
| 413 | return 0; |
| 414 | } |
| 415 | |
| 416 | static int qcom_ap_dev_close(hw_device_t* device) |
| 417 | { |
| 418 | if (device) |
| 419 | free(device); |
| 420 | return 0; |
| 421 | } |
| 422 | |
| 423 | static int qcom_ap_dev_open(const hw_module_t* module, const char* name, |
| 424 | hw_device_t** device) |
| 425 | { |
| 426 | struct qcom_ap_device *dev; |
| 427 | |
| 428 | if (strcmp(name, AUDIO_POLICY_INTERFACE) != 0) |
| 429 | return -EINVAL; |
| 430 | |
| 431 | dev = (struct qcom_ap_device *)calloc(1, sizeof(*dev)); |
| 432 | if (!dev) |
| 433 | return -ENOMEM; |
| 434 | |
| 435 | dev->device.common.tag = HARDWARE_DEVICE_TAG; |
| 436 | dev->device.common.version = 0; |
| 437 | dev->device.common.module = const_cast<hw_module_t*>(module); |
| 438 | dev->device.common.close = qcom_ap_dev_close; |
| 439 | dev->device.create_audio_policy = create_qcom_ap; |
| 440 | dev->device.destroy_audio_policy = destroy_qcom_ap; |
| 441 | |
| 442 | *device = &dev->device.common; |
| 443 | |
| 444 | return 0; |
| 445 | } |
| 446 | |
| 447 | static struct hw_module_methods_t qcom_ap_module_methods = { |
| 448 | open: qcom_ap_dev_open |
| 449 | }; |
| 450 | |
| 451 | struct qcom_ap_module HAL_MODULE_INFO_SYM = { |
| 452 | module: { |
| 453 | common: { |
| 454 | tag: HARDWARE_MODULE_TAG, |
| 455 | version_major: 1, |
| 456 | version_minor: 0, |
| 457 | id: AUDIO_POLICY_HARDWARE_MODULE_ID, |
| 458 | name: "QCOM Audio Policy HAL", |
Mike Grissom | e0f7b47 | 2013-08-08 20:25:51 -0700 | [diff] [blame] | 459 | author: "The Linux Foundation", |
Daniel Hillenbrand | d81f36f | 2013-04-06 18:56:57 +0000 | [diff] [blame] | 460 | methods: &qcom_ap_module_methods, |
| 461 | dso : NULL, |
| 462 | reserved : {0}, |
| 463 | }, |
| 464 | }, |
| 465 | }; |
| 466 | |
| 467 | }; // extern "C" |
| 468 | |
| 469 | }; // namespace android_audio_legacy |