#define PRESS_LEV_HIGH 0
static struct rk29_keys_button key_button[] = {
-#if 0
{
.desc = "menu",
.code = EV_MENU,
- .gpio = RK30_PIN6_PA0,
+ .gpio = RK30_PIN0_PD0,
.active_low = PRESS_LEV_LOW,
},
{
.desc = "vol+",
.code = KEY_VOLUMEUP,
- .gpio = RK30_PIN6_PA1,
+ .gpio = RK30_PIN4_PC4,
.active_low = PRESS_LEV_LOW,
},
-#endif
{
.desc = "vol-",
.code = KEY_VOLUMEDOWN,
.gpio = RK30_PIN4_PC5,
.active_low = PRESS_LEV_LOW,
},
-#if 0
{
.desc = "home",
.code = KEY_HOME,
- .gpio = RK30_PIN6_PA3,
+ .gpio = RK30_PIN0_PD2,
.active_low = PRESS_LEV_LOW,
},
{
.desc = "search",
.code = KEY_SEARCH,
- .gpio = RK30_PIN6_PA4,
+ .gpio = RK30_PIN0_PD1,
.active_low = PRESS_LEV_LOW,
},
{
.desc = "esc",
.code = KEY_BACK,
- .gpio = RK30_PIN6_PA5,
+ .gpio = RK30_PIN0_PD3,
.active_low = PRESS_LEV_LOW,
},
- {
- .desc = "sensor",
- .code = KEY_CAMERA,
- .gpio = RK30_PIN6_PA6,
- .active_low = PRESS_LEV_LOW,
- },
-#endif
+#if 0
{
.desc = "play",
.code = KEY_POWER,
//.code_long_press = EV_ENCALL,
.wakeup = 1,
},
-#if 1
- {
- .desc = "vol+",
- .code = KEY_VOLUMEUP,
- .adc_value = 1,
- .gpio = INVALID_GPIO,
- .active_low = PRESS_LEV_LOW,
- },
-#if 0
- {
- .desc = "vol-",
- .code = KEY_VOLUMEUP,
- .adc_value = 249,
- .gpio = INVALID_GPIO,
- .active_low = PRESS_LEV_LOW,
- },
#endif
- {
- .desc = "menu",
- .code = EV_MENU,
- .adc_value = 155,
- .gpio = INVALID_GPIO,
- .active_low = PRESS_LEV_LOW,
- },
- {
- .desc = "home",
- .code = KEY_HOME,
- .adc_value = 630,
- .gpio = INVALID_GPIO,
- .active_low = PRESS_LEV_LOW,
- },
- {
- .desc = "esc",
- .code = KEY_BACK,
- .adc_value = 386,
- .gpio = INVALID_GPIO,
- .active_low = PRESS_LEV_LOW,
- },
{
.desc = "camera",
.code = KEY_CAMERA,
- .adc_value = 827,
- .gpio = INVALID_GPIO,
+ .gpio = RK30_PIN0_PD4,
.active_low = PRESS_LEV_LOW,
},
-#endif
};
struct rk29_keys_platform_data rk29_keys_pdata = {
.buttons = key_button,
regulator_put(ldo);
udelay(100);
#endif
+
+//discrete dcdc device
+#ifdef CONFIG_RK30_PWM_REGULATOR
+ dcdc = regulator_get(NULL, "vdd_core"); // vdd_log
+ regulator_set_voltage(dcdc, 1200000, 1200000);
+ regulator_enable(dcdc);
+ printk("%s set vdd_core=%dmV end\n", __func__, regulator_get_voltage(dcdc));
+ regulator_put(dcdc);
+ udelay(100);
+
+ dcdc = regulator_get(NULL, "vdd_cpu"); // vdd_arm
+ regulator_set_voltage(dcdc, 1200000, 1200000);
+ regulator_enable(dcdc);
+ printk("%s set vdd_cpu=%dmV end\n", __func__, regulator_get_voltage(dcdc));
+ regulator_put(dcdc);
+ udelay(100);
+#endif
printk("wm831x_post_init end");
return 0;
}
#include <linux/mfd/wm8994/pdata.h>
#include <linux/regulator/machine.h>
#include "../../../drivers/headset_observe/rk_headset.h"
+#include <linux/regulator/rk29-pwm-regulator.h>
#if defined(CONFIG_SPIM_RK29)
#include "../../../drivers/spi/rk29_spim.h"
};
#endif
+#if CONFIG_RK30_PWM_REGULATOR
+static struct regulator_consumer_supply pwm_dcdc1_consumers[] = {
+ {
+ .supply = "vdd_core",
+ }
+};
+
+static struct regulator_consumer_supply pwm_dcdc2_consumers[] = {
+ {
+ .supply = "vdd_cpu",
+ }
+};
+
+struct regulator_init_data pwm_regulator_init_dcdc[2] =
+{
+ {
+ .constraints = {
+ .name = "PWM_DCDC1",
+ .min_uV = 600000,
+ .max_uV = 1800000, //0.6-1.8V
+ .apply_uV = true,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(pwm_dcdc1_consumers),
+ .consumer_supplies = pwm_dcdc1_consumers,
+ },
+ {
+ .constraints = {
+ .name = "PWM_DCDC2",
+ .min_uV = 600000,
+ .max_uV = 1800000, //0.6-1.8V
+ .apply_uV = true,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(pwm_dcdc2_consumers),
+ .consumer_supplies = pwm_dcdc2_consumers,
+ },
+};
+
+static struct pwm_platform_data pwm_regulator_info[2] = {
+ {
+ .pwm_id = 0,
+ .pwm_gpio = RK30_PIN0_PA3,
+ .pwm_iomux_name = GPIO0A3_PWM0_NAME,
+ .pwm_iomux_pwm = GPIO0A_PWM0,
+ .pwm_iomux_gpio = GPIO0A_GPIO0A3,
+ .pwm_voltage = 1100000,
+ .init_data = &pwm_regulator_init_dcdc[0],
+ },
+ {
+ .pwm_id = 2,
+ .pwm_gpio = RK30_PIN0_PD6,
+ .pwm_iomux_name = GPIO0D6_PWM2_NAME,
+ .pwm_iomux_pwm = GPIO0D_PWM2,
+ .pwm_iomux_gpio = GPIO0D_GPIO0D6,
+ .pwm_voltage = 1100000,
+ .init_data = &pwm_regulator_init_dcdc[1],
+ },
+
+};
+
+
+struct platform_device pwm_regulator_device[2] = {
+ {
+ .name = "pwm-voltage-regulator",
+ .id = 0,
+ .dev = {
+ .platform_data = &pwm_regulator_info[0],
+ }
+ },
+ {
+ .name = "pwm-voltage-regulator",
+ .id = 1,
+ .dev = {
+ .platform_data = &pwm_regulator_info[1],
+ }
+ },
+
+};
+
+
+#endif
/***********************************************************
* rk30 backlight
static struct platform_device *devices[] __initdata = {
+#ifdef CONFIG_RK30_PWM_REGULATOR
+ &pwm_regulator_device[0],
+ &pwm_regulator_device[1],
+#endif
#ifdef CONFIG_BACKLIGHT_RK29_BL
&rk29_device_backlight,
#endif
&rk_device_headset,
#endif
#ifdef CONFIG_TDSC8800
- &rk29_device_tdsc8800
+ &rk29_device_tdsc8800,
#endif
+
};
// i2c