aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8994_samsung.h
diff options
context:
space:
mode:
authorUK KIM <w0806.kim@samsung.com>2010-09-13 15:29:02 -0700
committerArve Hjønnevåg <arve@android.com>2011-11-17 17:45:35 -0800
commitc402d8de17cea7573309772ba96319f80aef221f (patch)
tree3ac8d200537d55f926b298b9580e92ef43f97f11 /sound/soc/codecs/wm8994_samsung.h
parent50ac1d2dc5750aef5df94cf641246aa44e475f75 (diff)
downloadkernel_samsung_crespo-c402d8de17cea7573309772ba96319f80aef221f.zip
kernel_samsung_crespo-c402d8de17cea7573309772ba96319f80aef221f.tar.gz
kernel_samsung_crespo-c402d8de17cea7573309772ba96319f80aef221f.tar.bz2
S5PC110: SOUND: added new driver files for google's mainline branch
added wm8994_s5pc110.c wm8994_s5pc110.h instead of wm8994.c and wm8994.h change header name included modify source codes accroding to linux coding style. Signed-off-by: UK KIM <w0806.kim@samsung.com> Change-Id: I8dc8b103db6bc1d12162982c42b3e35377c9aeea
Diffstat (limited to 'sound/soc/codecs/wm8994_samsung.h')
-rwxr-xr-xsound/soc/codecs/wm8994_samsung.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8994_samsung.h b/sound/soc/codecs/wm8994_samsung.h
new file mode 100755
index 0000000..5c285de
--- /dev/null
+++ b/sound/soc/codecs/wm8994_samsung.h
@@ -0,0 +1,119 @@
+/*
+ * wm8994_samsung.h -- WM8994 Soc Audio driver
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _WM8994_SAMSUNG_H
+#define _WM8994_SAMSUNG_H
+
+#include <sound/soc.h>
+#include <linux/mfd/wm8994/wm8994_pdata.h>
+
+extern struct snd_soc_codec_device soc_codec_dev_wm8994;
+
+/* Sources for AIF1/2 SYSCLK - use with set_dai_sysclk() */
+#define WM8994_SYSCLK_MCLK1 1
+#define WM8994_SYSCLK_MCLK2 2
+#define WM8994_SYSCLK_FLL1 3
+#define WM8994_SYSCLK_FLL2 4
+
+#define WM8994_FLL1 1
+#define WM8994_FLL2 2
+
+/* Added belows codes by Samsung Electronics.*/
+
+#include "wm8994_def.h"
+
+extern struct snd_soc_dai wm8994_dai;
+
+#define WM8994_SYSCLK_MCLK 1
+#define WM8994_SYSCLK_FLL 2
+
+#define AUDIO_COMMON_DEBUG 0
+
+/*
+ * Definitions of enum type
+ */
+enum audio_path {
+ OFF, RCV, SPK, HP, BT, SPK_HP,
+ RING_SPK, RING_HP, RING_SPK_HP
+};
+enum mic_path { MAIN, SUB, BT_REC, MIC_OFF};
+enum call_state { DISCONNECT, CONNECT};
+enum power_state { CODEC_OFF, CODEC_ON };
+enum mic_state { MIC_NO_USE, MIC_USE};
+enum ringtone_state { DEACTIVE, ACTIVE};
+enum recognition {REC_OFF, REC_ON};
+
+typedef void (*select_route)(struct snd_soc_codec *);
+typedef void (*select_mic_route)(struct snd_soc_codec *);
+typedef int (*select_clock_control)(struct snd_soc_codec *, int);
+
+
+struct wm8994_setup_data {
+ int i2c_bus;
+ unsigned short i2c_address;
+};
+
+struct wm8994_priv {
+ struct snd_soc_codec codec;
+ int master;
+ int sysclk_source;
+ unsigned int mclk_rate;
+ unsigned int sysclk_rate;
+ unsigned int fs;
+ unsigned int bclk;
+ unsigned int hw_version;
+ enum audio_path cur_path;
+ enum mic_path rec_path;
+ enum call_state call_state;
+ enum power_state power_state;
+ enum mic_state mic_state;
+ enum recognition recognition_active;
+ enum ringtone_state ringtone_active;
+ select_route *universal_playback_path;
+ select_route *universal_voicecall_path;
+ select_mic_route *universal_mic_path;
+ select_clock_control universal_clock_control;
+ bool play_en_dis;
+ bool rec_en_dis;
+ struct wm8994_platform_data *pdata;
+ struct clk *codec_clk;
+};
+
+#if AUDIO_COMMON_DEBUG
+#define DEBUG_LOG(format, ...)\
+ printk(KERN_INFO "[ "SUBJECT " (%s,%d) ] " format "\n", \
+ __func__, __LINE__, ## __VA_ARGS__);
+#else
+#define DEBUG_LOG(format, ...)
+#endif
+
+#define DEBUG_LOG_ERR(format, ...)\
+ printk(KERN_ERR "[ "SUBJECT " (%s,%d) ] " format "\n", \
+ __func__, __LINE__, ## __VA_ARGS__);
+
+/* Definitions of function prototype. */
+inline unsigned int wm8994_read(struct snd_soc_codec *codec, unsigned int reg);
+int wm8994_write(struct snd_soc_codec *codec,
+ unsigned int reg, unsigned int value);
+int wm8994_configure_clock(struct snd_soc_codec *codec, int en);
+void wm8994_disable_playback_path(struct snd_soc_codec *codec,
+ enum audio_path path);
+void wm8994_disable_rec_path(struct snd_soc_codec *codec);
+void wm8994_record_main_mic(struct snd_soc_codec *codec);
+void wm8994_record_headset_mic(struct snd_soc_codec *codec);
+void wm8994_record_bluetooth(struct snd_soc_codec *codec);
+void wm8994_set_playback_receiver(struct snd_soc_codec *codec);
+void wm8994_set_playback_headset(struct snd_soc_codec *codec);
+void wm8994_set_playback_speaker(struct snd_soc_codec *codec);
+void wm8994_set_playback_speaker_headset(struct snd_soc_codec *codec);
+void wm8994_set_voicecall_common_setting(struct snd_soc_codec *codec);
+void wm8994_set_voicecall_receiver(struct snd_soc_codec *codec);
+void wm8994_set_voicecall_headset(struct snd_soc_codec *codec);
+void wm8994_set_voicecall_speaker(struct snd_soc_codec *codec);
+void wm8994_set_voicecall_bluetooth(struct snd_soc_codec *codec);
+#endif