diff options
author | Ziyan <jaraidaniel@gmail.com> | 2016-01-29 12:07:18 +0100 |
---|---|---|
committer | Andreas Blaesius <skate4life@gmx.de> | 2016-02-22 22:09:02 +0100 |
commit | 2ea956fe4ba6fe76702b021cfb1d39c80bcfc69a (patch) | |
tree | 42083efaee43b7072f946700a785a549f574404d /audio/audio_hw.c | |
parent | f8a12a261d5a7b1d1c6b69c9d3fc3abee95d55bc (diff) | |
download | device_samsung_espressowifi-2ea956fe4ba6fe76702b021cfb1d39c80bcfc69a.zip device_samsung_espressowifi-2ea956fe4ba6fe76702b021cfb1d39c80bcfc69a.tar.gz device_samsung_espressowifi-2ea956fe4ba6fe76702b021cfb1d39c80bcfc69a.tar.bz2 |
audio: select correct audio config at runtime (1/5)
Change-Id: If9732081791ab68f028129c953b518196f31b09c
Diffstat (limited to 'audio/audio_hw.c')
-rw-r--r-- | audio/audio_hw.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c index fff00d7..415cbd1 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -2993,14 +2993,23 @@ static int adev_config_parse(struct espresso_audio_device *adev) struct config_parse_state s; FILE *f; XML_Parser p; - char property[PROPERTY_VALUE_MAX]; + char device[16]; char file[80]; int ret = 0; bool eof = false; int len; - property_get("ro.product.device", property, "tiny_hw"); - snprintf(file, sizeof(file), "/system/etc/sound/%s", property); + f = fopen(DEVICE_VARIANT_SYSFS, "r"); + if (!f) { + ALOGE("Failed to open" DEVICE_VARIANT_SYSFS "\n"); + return -ENODEV; + } + if (fgets(device, 16, f) == NULL) { + ALOGE("Failed to read device variant\n"); + goto out; + } + fclose(f); + snprintf(file, sizeof(file), "/system/etc/sound/%s", device); ALOGV("Reading configuration from %s\n", file); f = fopen(file, "r"); |