#include <linux/rfkill-rk.h>
#include <linux/sensor-dev.h>
#include <linux/mfd/tps65910.h>
+#include <linux/regulator/act8931.h>
#include <linux/regulator/rk29-pwm-regulator.h>
#if defined(CONFIG_HDMI_RK30)
#include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h"
#include "board-rk2928-a720-camera.c"
#include "board-rk2928-a720-key.c"
+int __sramdata g_pmic_type = 0;
+#define PMIC_TYPE_TPS65910 2
+#define PMIC_TYPE_ACT8931 3
+
#ifdef CONFIG_THREE_FB_BUFFER
#define RK30_FB0_MEM_SIZE 12*SZ_1M
#else
printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
return -1;
}
- gpio_direction_output(PWM_GPIO, GPIO_LOW);
+ #if defined(CONFIG_MFD_TPS65910)
+ if(g_pmic_type == PMIC_TYPE_TPS65910)
+ {
+ gpio_direction_output(PWM_GPIO, GPIO_LOW);
+ }
+ #endif
+ #if defined(CONFIG_REGULATOR_ACT8931)
+ if(g_pmic_type == PMIC_TYPE_ACT8931)
+ {
+ gpio_direction_output(PWM_GPIO, GPIO_HIGH);
+ }
+ #endif
#ifdef LCD_DISP_ON_PIN
gpio_direction_output(BL_EN_PIN, 0);
gpio_set_value(BL_EN_PIN, !BL_EN_VALUE);
}
static int rk_fb_io_disable(void)
{
+
+ #if defined(CONFIG_REGULATOR_ACT8931)
+ if(g_pmic_type == PMIC_TYPE_ACT8931)
+ {
+ struct regulator *ldo;
+ ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd
+ regulator_disable(ldo);
+ regulator_put(ldo);
+ udelay(100);
+ }
+ #endif
gpio_set_value(LCD_EN, !LCD_EN_VALUE);
return 0;
}
static int rk_fb_io_enable(void)
{
+ #if defined(CONFIG_REGULATOR_ACT8931)
+ if(g_pmic_type == PMIC_TYPE_ACT8931)
+ {
+ struct regulator *ldo;
+ ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd
+ regulator_enable(ldo);
+ regulator_put(ldo);
+ udelay(100);
+ msleep(300); // wait for powering on LED circuit
+ }
+ #endif
+
gpio_set_value(LCD_EN, LCD_EN_VALUE);
return 0;
}
{
printk(KERN_ERR "rk2928_pm_power_off start...\n");
- #if defined(CONFIG_MFD_TPS65910)
+ #if defined(CONFIG_MFD_TPS65910)
+ if(g_pmic_type == PMIC_TYPE_TPS65910)
+ {
tps65910_device_shutdown();//tps65910 shutdown
+ }
#endif
gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
{
gpio_request(POWER_ON_PIN, "poweronpin");
gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
- gpio_free(POWER_ON_PIN);
-
+
pm_power_off = rk2928_pm_power_off;
rk30_i2c_register_board_info();
#include <mach/gpio.h>
#include <mach/iomux.h>
-#define gpio_readl(offset) readl_relaxed(RK2928_GPIO3_BASE + offset)
-#define gpio_writel(v, offset) do { writel_relaxed(v, RK2928_GPIO3_BASE + offset); dsb(); } while (0)
-
-#define GPIO_SWPORTA_DR 0x0000
-#define GPIO_SWPORTA_DDR 0x0004
-
-#define GPIO3_D2_OUTPUT (1<<26)
-#define GPIO3_D2_OUTPUT_HIGH (1<<26)
-#define GPIO3_D2_OUTPUT_LOW (~(1<<26))
-
#ifdef CONFIG_REGULATOR_ACT8931
-#define PMU_POWER_SLEEP RK2928_PIN3_PD2
+
extern int platform_device_register(struct platform_device *pdev);
int act8931_pre_init(struct act8931 *act8931){
-
- int val = 0;
- int i = 0;
- int err = -1;
printk("%s,line=%d\n", __func__,__LINE__);
struct regulator *ldo;
printk("%s,line=%d\n", __func__,__LINE__);
+ g_pmic_type = PMIC_TYPE_ACT8931;
+ printk("%s:g_pmic_type=%d\n",__func__,g_pmic_type);
+
#ifdef CONFIG_RK30_PWM_REGULATOR
platform_device_register(&pwm_regulator_device[0]);
#endif