#include <mach/iomux.h>
#include <linux/mpu.h>
+#include <linux/regulator/fixed.h>
+#include <linux/mfd/wm8994/pdata.h>
+#include <linux/regulator/machine.h>
+#include "../../../drivers/headset_observe/rk_headset.h"
#if defined(CONFIG_SPIM_RK29)
#include "../../../drivers/spi/rk29_spim.h"
#endif
};
+/*****************************************************************************************
+ * wm8994 codec
+ * author: qjb@rock-chips.com
+ *****************************************************************************************/
+#if defined(CONFIG_MFD_WM8994)
+static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = {
+ REGULATOR_SUPPLY("DBVDD", "0-001a"),
+ REGULATOR_SUPPLY("AVDD2", "0-001a"),
+ REGULATOR_SUPPLY("CPVDD", "0-001a"),
+};
+
+static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = {
+ REGULATOR_SUPPLY("SPKVDD1", "0-001a"),
+ REGULATOR_SUPPLY("SPKVDD2", "0-001a"),
+};
+
+static struct regulator_init_data wm8994_fixed_voltage0_init_data = {
+ .constraints = {
+ .always_on = 1,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage0_supplies),
+ .consumer_supplies = wm8994_fixed_voltage0_supplies,
+};
+
+static struct regulator_init_data wm8994_fixed_voltage1_init_data = {
+ .constraints = {
+ .always_on = 1,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage1_supplies),
+ .consumer_supplies = wm8994_fixed_voltage1_supplies,
+};
+
+static struct fixed_voltage_config wm8994_fixed_voltage0_config = {
+ .supply_name = "VCC_1.8V_PDA",
+ .microvolts = 1800000,
+ .gpio = -EINVAL,
+ .init_data = &wm8994_fixed_voltage0_init_data,
+};
+
+static struct fixed_voltage_config wm8994_fixed_voltage1_config = {
+ .supply_name = "V_BAT",
+ .microvolts = 3700000,
+ .gpio = -EINVAL,
+ .init_data = &wm8994_fixed_voltage1_init_data,
+};
+
+static struct platform_device wm8994_fixed_voltage0 = {
+ .name = "reg-fixed-voltage",
+ .id = 0,
+ .dev = {
+ .platform_data = &wm8994_fixed_voltage0_config,
+ },
+};
+
+static struct platform_device wm8994_fixed_voltage1 = {
+ .name = "reg-fixed-voltage",
+ .id = 1,
+ .dev = {
+ .platform_data = &wm8994_fixed_voltage1_config,
+ },
+};
+
+static struct regulator_consumer_supply wm8994_avdd1_supply =
+ REGULATOR_SUPPLY("AVDD1", "0-001a");
+
+static struct regulator_consumer_supply wm8994_dcvdd_supply =
+ REGULATOR_SUPPLY("DCVDD", "0-001a");
+
+
+
+static struct regulator_init_data wm8994_ldo1_data = {
+ .constraints = {
+ .name = "AVDD1_3.0V",
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &wm8994_avdd1_supply,
+};
+
+static struct regulator_init_data wm8994_ldo2_data = {
+ .constraints = {
+ .name = "DCVDD_1.0V",
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &wm8994_dcvdd_supply,
+};
+
+static struct wm8994_pdata wm8994_platform_data = {
+#if defined (CONFIG_GPIO_WM8994)
+ .gpio_base = WM8994_GPIO_EXPANDER_BASE,
+ //Fill value to initialize the GPIO
+// .gpio_defaults ={},
+ /* configure gpio1 function: 0x0001(Logic level input/output) */
+// .gpio_defaults[0] = 0x0001,
+ /* configure gpio3/4/5/7 function for AIF2 voice */
+ .gpio_defaults[2] = 0x2100,
+ .gpio_defaults[3] = 0x2100,
+ .gpio_defaults[4] = 0xA100,
+// .gpio_defaults[6] = 0x0100,
+ /* configure gpio8/9/10/11 function for AIF3 BT */
+ .gpio_defaults[7] = 0xA100,
+ .gpio_defaults[8] = 0x2100,
+ .gpio_defaults[9] = 0x2100,
+ .gpio_defaults[10] = 0x2100,
+#endif
+
+ .ldo[0] = { RK30_PIN6_PB2, NULL, &wm8994_ldo1_data }, /* XM0FRNB_2 */
+ .ldo[1] = { 0, NULL, &wm8994_ldo2_data },
+
+ .micdet_irq = 0,
+ .irq_base = 0,
+
+ .lineout1_diff = 1,
+// .BB_input_diff = 1,
+};
+#endif
+
+#ifdef CONFIG_RK_HEADSET_DET
+#define HEADSET_GPIO RK29_PIN4_PD2
+struct rk_headset_pdata rk_headset_info = {
+ .Headset_gpio = RK30_PIN6_PA1,
+ .headset_in_type= HEADSET_IN_HIGH,
+ .Hook_gpio = RK30_PIN1_PB2,//Detection Headset--Must be set
+ .hook_key_code = KEY_MEDIA,
+};
+
+struct platform_device rk_device_headset = {
+ .name = "rk_headsetdet",
+ .id = 0,
+ .dev = {
+ .platform_data = &rk_headset_info,
+ }
+};
+#endif
+
/***********************************************************
* rk30 backlight
#ifdef CONFIG_BT
&rk29sdk_rfkill,
#endif
+#ifdef CONFIG_MFD_WM8994
+ &wm8994_fixed_voltage0,
+ &wm8994_fixed_voltage1,
+#endif
+#ifdef CONFIG_RK_HEADSET_DET
+ &rk_device_headset,
+#endif
#ifdef CONFIG_TDSC8800
&rk29_device_tdsc8800
#endif
-
};
// i2c
},
#endif
#endif
+#if defined (CONFIG_SND_SOC_WM8994)
+ {
+ .type = "wm8994",
+ .addr = 0x1a,
+ .flags = 0,
+ #if defined(CONFIG_MFD_WM8994)
+ .platform_data = &wm8994_platform_data,
+ #endif
+ },
+#endif
};
#endif