asoc: codecs: Add parent child relation for bolero and tanggu
In bolero and tanggu combination, make bolero parent of tanggu.
Bolero and tanggu can communicate mutually using notifier and
plat_data callback APIs.
Change-Id: Iecd119df7f0ad1ba225c0427f3f42f217146b092
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
diff --git a/asoc/codecs/bolero/internal.h b/asoc/codecs/bolero/internal.h
index 2979ee0..9e8a74c 100644
--- a/asoc/codecs/bolero/internal.h
+++ b/asoc/codecs/bolero/internal.h
@@ -15,6 +15,13 @@
#include "bolero-cdc-registers.h"
+#define BOLERO_CDC_CHILD_DEVICES_MAX 5
+
+/* from bolero to WCD events */
+enum {
+ BOLERO_WCD_EVT_TX_CH_HOLD_CLEAR = 1,
+};
+
enum {
REG_NO_ACCESS,
RD_REG,
@@ -22,6 +29,21 @@
RD_WR_REG
};
+/* from WCD to bolero events */
+enum {
+ WCD_BOLERO_EVT_RX_MUTE = 1, /* for RX mute/unmute */
+ WCD_BOLERO_EVT_IMPED_TRUE, /* for imped true */
+ WCD_BOLERO_EVT_IMPED_FALSE, /* for imped false */
+};
+
+struct wcd_ctrl_platform_data {
+ void *handle;
+ int (*update_wcd_event)(void *handle, u16 event, u32 data);
+ int (*register_notifier)(void *handle,
+ struct notifier_block *nblock,
+ bool enable);
+};
+
struct bolero_priv {
struct device *dev;
struct snd_soc_codec *codec;
@@ -34,7 +56,7 @@
struct snd_soc_dai_driver *bolero_dais;
u16 num_dais;
u16 num_macros_registered;
- u16 child_num;
+ u16 num_macros;
u16 current_mclk_mux_macro[MAX_MACRO];
struct work_struct bolero_add_child_devices_work;
u32 version;
@@ -47,6 +69,12 @@
u16 macro_id, u16 reg, u8 *val);
int (*write_dev)(struct bolero_priv *priv,
u16 macro_id, u16 reg, u8 val);
+ struct platform_device *pdev_child_devices
+ [BOLERO_CDC_CHILD_DEVICES_MAX];
+ u16 child_count;
+ struct wcd_ctrl_platform_data plat_data;
+ struct device *wcd_dev;
+ struct blocking_notifier_head notifier;
};
struct regmap *bolero_regmap_init(struct device *dev,