summaryrefslogtreecommitdiffstats
path: root/audio/audio_hw.h
diff options
context:
space:
mode:
authorDaniel Hillenbrand <daniel.hillenbrand@codeworkx.de>2012-07-22 15:24:24 +0200
committerDaniel Hillenbrand <daniel.hillenbrand@codeworkx.de>2012-07-22 15:24:24 +0200
commitd30210153d8f19a0ca825b33f2282b9ae071c6ec (patch)
tree36c5d3485edbdcc6788ae0e1f7306d0f9885b686 /audio/audio_hw.h
parent44378b730efd28a958ac35e3d294e1c04472ff79 (diff)
downloaddevice_samsung_i9300-d30210153d8f19a0ca825b33f2282b9ae071c6ec.zip
device_samsung_i9300-d30210153d8f19a0ca825b33f2282b9ae071c6ec.tar.gz
device_samsung_i9300-d30210153d8f19a0ca825b33f2282b9ae071c6ec.tar.bz2
jellybeaned
Diffstat (limited to 'audio/audio_hw.h')
-rw-r--r--audio/audio_hw.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/audio/audio_hw.h b/audio/audio_hw.h
index e264c4a..3cd62db 100644
--- a/audio/audio_hw.h
+++ b/audio/audio_hw.h
@@ -3,6 +3,7 @@
* Copyright (C) 2012 Wolfson Microelectronics plc
* Copyright (C) 2012 The CyanogenMod Project
* Daniel Hillenbrand <codeworkx@cyanogenmod.com>
+ * Guillaume "XpLoDWilD" Lesniak <xplodgui@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,12 +26,28 @@
#define PORT_BT 2
#define PORT_CAPTURE 3
+#define PCM_WRITE pcm_write
+
#define PLAYBACK_PERIOD_SIZE 880
#define PLAYBACK_PERIOD_COUNT 8
+#define PLAYBACK_SHORT_PERIOD_COUNT 2
#define CAPTURE_PERIOD_SIZE 1056
#define CAPTURE_PERIOD_COUNT 2
+#define SHORT_PERIOD_SIZE 192
+
+//
+// deep buffer
+//
+/* screen on */
+#define DEEP_BUFFER_SHORT_PERIOD_SIZE 1056
+#define PLAYBACK_DEEP_BUFFER_SHORT_PERIOD_COUNT 4
+/* screen off */
+#define DEEP_BUFFER_LONG_PERIOD_SIZE 880
+#define PLAYBACK_DEEP_BUFFER_LONG_PERIOD_COUNT 8
+
+
/* minimum sleep time in out_write() when write threshold is not reached */
#define MIN_WRITE_SLEEP_US 5000
@@ -38,6 +55,8 @@
#define RESAMPLER_BUFFER_SIZE (4 * RESAMPLER_BUFFER_FRAMES)
#define DEFAULT_OUT_SAMPLING_RATE 44100
+#define MM_LOW_POWER_SAMPLING_RATE 44100
+#define MM_FULL_POWER_SAMPLING_RATE 44100
#define DEFAULT_IN_SAMPLING_RATE 44100
/* sampling rate when using VX port for narrow band */
@@ -49,6 +68,35 @@
#define PRODUCT_DEVICE_PROPERTY "ro.product.device"
#define PRODUCT_NAME_PROPERTY "ro.product.name"
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
+#define STRING_TO_ENUM(string) { #string, string }
+
+struct string_to_enum {
+ const char *name;
+ uint32_t value;
+};
+
+const struct string_to_enum out_channels_name_to_enum_table[] = {
+ STRING_TO_ENUM(AUDIO_CHANNEL_OUT_STEREO),
+ STRING_TO_ENUM(AUDIO_CHANNEL_OUT_5POINT1),
+ STRING_TO_ENUM(AUDIO_CHANNEL_OUT_7POINT1),
+};
+
+enum pcm_type {
+ PCM_NORMAL = 0,
+ PCM_SPDIF,
+ PCM_HDMI,
+ PCM_TOTAL,
+};
+
+enum output_type {
+ OUTPUT_DEEP_BUF, // deep PCM buffers output stream
+ OUTPUT_LOW_LATENCY, // low latency output stream
+ OUTPUT_HDMI,
+ OUTPUT_TOTAL
+};
+
enum tty_modes {
TTY_MODE_OFF,
TTY_MODE_VCO,