@@ -108,6 +108,12 @@
#define twl_has_mmc() false
#endif
+#if defined(CONFIG_SND_SOC_TWL6030) || defined(CONFIG_SND_SOC_TWL6030_MODULE)
+#define twl_has_codec() true
+#else
+#define twl_has_codec() false
+#endif
+
#if defined(CONFIG_TWL4030_USB) || defined(CONFIG_TWL4030_USB_MODULE)
#define twl_has_usb() true
#else
@@ -190,6 +196,7 @@
#define BCI_SUB_CHIP_ID SUB_CHIP_ID1
#define GPIO_SUB_CHIP_ID 0 /* NOT SUPPORTED IN TWL6030 */
#define KEYPAD_SUB_CHIP_ID 0 /* ADDED FOR COMPILATION ONLY */
+#define CODEC_SUB_CHIP_ID SUB_CHIP_ID3
/* subchip/slave 0 0x48 - POWER */
#define TWL6030_BASEADD_RTC 0x0000
@@ -632,6 +639,14 @@ add_children(struct twl_platform_data *pdata, unsigned long features)
if (IS_ERR(child))
return PTR_ERR(child);
}
+
+ if (twl_has_codec()) {
+ child = add_child(CODEC_SUB_CHIP_ID, "twl6030_codec",
+ pdata->codec, sizeof(*pdata->codec), false,
+ 0, 0);
+ if (IS_ERR(child))
+ return PTR_ERR(child);
+ }
#endif
if (twl_has_usb() && pdata->usb) {
@@ -472,6 +472,12 @@ struct twl_usb_data {
enum twl_usb_mode usb_mode;
};
+struct twl_codec_data {
+ /* twl6030 */
+ int audpwron_gpio; /* audio power-on gpio */
+ int naudint_irq; /* audio interrupt */
+};
+
struct twl_platform_data {
unsigned irq_base, irq_end;
struct twl_bci_platform_data *bci;
@@ -479,6 +485,7 @@ struct twl_platform_data {
struct twl_madc_platform_data *madc;
struct twl_keypad_data *keypad;
struct twl_usb_data *usb;
+ struct twl_codec_data *codec;
/* LDO regulators common to TWL4030/TWL6030 */
struct regulator_init_data *vdac;