ASoC: wcd9310: Enable platform-specific micbias configuration
WCD9310 has four micbiases and each of them can be programmed to get its
power source from one of 3 available cfilters. Each cfilter can be
programmed to different voltage levels. Essentially, on WCD9310, a user
can have up to three different voltage levels to power various analog
microphones and digital microphones. As it is now, micbias voltage level
of WCD9310 is left to default value. Micbias and cfilter mapping is managed
by codec driver. Different board design can have different micbias
arrangement. Micbias configuration of wcd9310 CODEC for 8960 CDP/MTP/FLUID
is properly defined in this patch.
Signed-off-by: Patrick Lai <plai@codeaurora.org>
diff --git a/include/linux/mfd/wcd9310/pdata.h b/include/linux/mfd/wcd9310/pdata.h
index f8f7912..13d52fb 100644
--- a/include/linux/mfd/wcd9310/pdata.h
+++ b/include/linux/mfd/wcd9310/pdata.h
@@ -16,12 +16,42 @@
#include <linux/slimbus/slimbus.h>
+#define TABLA_LDOH_1P95_V 0x0
+#define TABLA_LDOH_2P35_V 0x1
+#define TABLA_LDOH_2P75_V 0x2
+#define TABLA_LDOH_2P85_V 0x3
+
+#define TABLA_CFILT1_SEL 0x0
+#define TABLA_CFILT2_SEL 0x1
+#define TABLA_CFILT3_SEL 0x2
+
+/* Each micbias can be assigned to one of three cfilters
+ * Vbatt_min >= .15V + ldoh_v
+ * ldoh_v >= .15v + cfiltx_mv
+ * If ldoh_v = 1.95 160 mv < cfiltx_mv < 1800 mv
+ * If ldoh_v = 2.35 200 mv < cfiltx_mv < 2200 mv
+ * If ldoh_v = 2.75 240 mv < cfiltx_mv < 2600 mv
+ * If ldoh_v = 2.85 250 mv < cfiltx_mv < 2700 mv
+ */
+
+struct tabla_micbias_setting {
+ u8 ldoh_v;
+ u32 cfilt1_mv; /* in mv */
+ u32 cfilt2_mv; /* in mv */
+ u32 cfilt3_mv; /* in mv */
+ u8 bias1_cfilt_sel;
+ u8 bias2_cfilt_sel;
+ u8 bias3_cfilt_sel;
+ u8 bias4_cfilt_sel;
+};
+
struct tabla_pdata {
int irq;
int irq_base;
int num_irqs;
int reset_gpio;
struct slim_device slimbus_slave_device;
+ struct tabla_micbias_setting micbias;
};
#endif