#include <linux/regulator/rk29-pwm-regulator.h>
#include <linux/regulator/machine.h>
+#include <linux/regulator/act8891.h>
+
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <linux/i2c-gpio.h>
#else
#define SDRAM_SIZE SZ_512M
#endif
-#define PMEM_GPU_SIZE SZ_64M
-#define PMEM_UI_SIZE SZ_32M
+#define PMEM_GPU_SIZE SZ_16M
+#define PMEM_UI_SIZE (48 * SZ_1M) /* 1280x800: 64M 1024x768: 48M ... */
#define PMEM_VPU_SIZE SZ_64M
#define PMEM_SKYPE_SIZE 0
#define PMEM_CAM_SIZE PMEM_CAM_NECESSARY
#define MEM_CAMIPP_BASE (PMEM_CAM_BASE - MEM_CAMIPP_SIZE)
#define MEM_FB_BASE (MEM_CAMIPP_BASE - MEM_FB_SIZE)
#define MEM_FBIPP_BASE (MEM_FB_BASE - MEM_FBIPP_SIZE)
-#define PMEM_SKYPE_BASE (MEM_FBIPP_BASE - PMEM_SKYPE_SIZE)
+#define PMEM_SKYPE_BASE (MEM_FBIPP_BASE - PMEM_SKYPE_SIZE)
#define LINUX_SIZE (PMEM_SKYPE_BASE - RK29_SDRAM_PHYS)
#define PREALLOC_WLAN_SEC_NUM 4
#define TOUCH_SCREEN_STANDBY_VALUE GPIO_HIGH
#define TOUCH_SCREEN_DISPLAY_PIN INVALID_GPIO
#define TOUCH_SCREEN_DISPLAY_VALUE GPIO_HIGH
+
#ifdef CONFIG_FB_RK29
/*****************************************************************************************
* lcd devices
printk(">>>>>> FB_DISPLAY_ON_PIN gpio_request err \n ");
}
}
- else
+ else if (TOUCH_SCREEN_DISPLAY_PIN != INVALID_GPIO)
{
ret = gpio_request(TOUCH_SCREEN_DISPLAY_PIN, NULL);
if(ret != 0)
printk(">>>>>> FB_LCD_STANDBY_PIN gpio_request err \n ");
}
}
- else
+ else if (TOUCH_SCREEN_STANDBY_PIN != INVALID_GPIO)
{
ret = gpio_request(TOUCH_SCREEN_STANDBY_PIN, NULL);
if(ret != 0)
#endif
+#if defined(CONFIG_RK29_GPIO_SUSPEND)
+void key_gpio_pullupdown_enable(void)
+{ gpio_pull_updown(RK29_PIN6_PA0, 0);
+ gpio_pull_updown(RK29_PIN6_PA1, 0);
+ gpio_pull_updown(RK29_PIN6_PA2, 0);
+ gpio_pull_updown(RK29_PIN6_PA3, 0);
+ gpio_pull_updown(RK29_PIN6_PA4, 0);
+ gpio_pull_updown(RK29_PIN6_PA5, 0);
+ gpio_pull_updown(RK29_PIN6_PA6, 0);
+
+}
+void key_gpio_pullupdown_disable(void)
+{
+ gpio_pull_updown(RK29_PIN6_PA0, 1);
+ gpio_pull_updown(RK29_PIN6_PA1, 1);
+ gpio_pull_updown(RK29_PIN6_PA2, 1);
+ gpio_pull_updown(RK29_PIN6_PA3, 1);
+ gpio_pull_updown(RK29_PIN6_PA4, 1);
+ gpio_pull_updown(RK29_PIN6_PA5, 1);
+ gpio_pull_updown(RK29_PIN6_PA6, 1);
+}
+void rk29_setgpio_suspend_board(void)
+{
+
+ key_gpio_pullupdown_enable();
+
+}
+
+void rk29_setgpio_resume_board(void)
+{
+
+ key_gpio_pullupdown_disable();
+
+ }
+#else
+void rk29_setgpio_suspend_board(void)
+{}
+void rk29_setgpio_resume_board(void)
+{}
+#endif
+
#if defined(CONFIG_RK_IRDA) || defined(CONFIG_BU92747GUW_CIR)
#define BU92747GUW_RESET_PIN RK29_PIN3_PD4// INVALID_GPIO //
#define BU92747GUW_RESET_MUX_NAME GPIO3D4_HOSTWRN_NAME//NULL //
.name = "pmem",
.start = PMEM_UI_BASE,
.size = PMEM_UI_SIZE,
- .no_allocator = 0,
+ .no_allocator = 1,
.cached = 1,
};
.platform_data = &vpu_mem_pdata,
},
};
+
+#if PMEM_SKYPE_SIZE > 0
static struct android_pmem_platform_data android_pmem_skype_pdata = {
.name = "pmem_skype",
.start = PMEM_SKYPE_BASE,
.platform_data = &android_pmem_skype_pdata,
},
};
+#endif
+
#ifdef CONFIG_VIDEO_RK29XX_VOUT
static struct platform_device rk29_v4l2_output_devce = {
.name = "rk29_vout",
};
#endif
+/*************************************PMU ACT8891****************************************/
+
+#if defined (CONFIG_REGULATOR_ACT8891)
+ /*dcdc mode*/
+/*act8891 in REGULATOR_MODE_STANDBY mode is said DCDC is in PMF mode is can save power,when in REGULATOR_MODE_NORMAL
+mode is said DCDC is in PWM mode , General default is in REGULATOR_MODE_STANDBY mode*/
+ /*ldo mode */
+/*act8891 in REGULATOR_MODE_STANDBY mode is said LDO is in low power mode is can save power,when in REGULATOR_MODE_NORMAL
+mode is said DCDC is in nomal mode , General default is in REGULATOR_MODE_STANDBY mode*/
+/*set dcdc and ldo voltage by regulator_set_voltage()*/
+static struct act8891 *act8891;
+int act8891_set_init(struct act8891 *act8891)
+{
+ int tmp = 0;
+ struct regulator *act_ldo1,*act_ldo2,*act_ldo3,*act_ldo4;
+ struct regulator *act_dcdc1,*act_dcdc2,*act_dcdc3;
+
+ /*init ldo1*/
+ act_ldo1 = regulator_get(NULL, "act_ldo1");
+ regulator_enable(act_ldo1);
+ regulator_set_voltage(act_ldo1,1800000,1800000);
+ tmp = regulator_get_voltage(act_ldo1);
+ regulator_set_mode(act_ldo1,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_ldo1,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: ldo1 vcc =%d\n",tmp);
+ regulator_put(act_ldo1);
+
+ /*init ldo2*/
+ act_ldo2 = regulator_get(NULL, "act_ldo2");
+ regulator_enable(act_ldo2);
+ regulator_set_voltage(act_ldo2,1200000,1200000);
+ tmp = regulator_get_voltage(act_ldo2);
+ regulator_set_mode(act_ldo2,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_ldo2,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: ldo2 vcc =%d\n",tmp);
+ regulator_put(act_ldo2);
+
+ /*init ldo3*/
+ act_ldo3 = regulator_get(NULL, "act_ldo3");
+ regulator_enable(act_ldo3);
+ regulator_set_voltage(act_ldo3,3300000,3300000);
+ tmp = regulator_get_voltage(act_ldo3);
+ regulator_set_mode(act_ldo3,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_ldo3,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: ldo3 vcc =%d\n",tmp);
+ regulator_put(act_ldo3);
+
+ /*init ldo4*/
+ act_ldo4 = regulator_get(NULL, "act_ldo4");
+ regulator_enable(act_ldo4);
+ regulator_set_voltage(act_ldo4,2500000,2500000);
+ tmp = regulator_get_voltage(act_ldo4);
+ regulator_set_mode(act_ldo4,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_ldo4,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: ldo4 vcc =%d\n",tmp);
+ regulator_put(act_ldo4);
+
+ /*init dcdc1*/
+ act_dcdc1 = regulator_get(NULL, "act_dcdc1");
+ regulator_enable(act_dcdc1);
+ regulator_set_voltage(act_dcdc1,3000000,3000000);
+ tmp = regulator_get_voltage(act_dcdc1);
+ regulator_set_mode(act_dcdc1,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_dcdc1,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: dcdc1 vcc =%d\n",tmp);
+ regulator_put(act_dcdc1);
+
+ /*init dcdc2*/
+ act_dcdc2 = regulator_get(NULL, "act_dcdc2");
+ regulator_enable(act_dcdc2);
+ regulator_set_voltage(act_dcdc2,1500000,1500000);
+ tmp = regulator_get_voltage(act_dcdc2);
+ regulator_set_mode(act_dcdc2,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_dcdc2,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: dcdc2 vcc =%d\n",tmp);
+ regulator_put(act_dcdc2);
+
+ /*init dcdc3*/
+ act_dcdc3 = regulator_get(NULL, "act_dcdc3");
+ regulator_enable(act_dcdc3);
+ regulator_set_voltage(act_dcdc3,1200000,1200000);
+ tmp = regulator_get_voltage(act_dcdc3);
+ regulator_set_mode(act_dcdc3,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_dcdc3,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: dcdc3 vcc =%d\n",tmp);
+ regulator_put(act_dcdc3);
+
+ return(0);
+}
+
+static struct regulator_consumer_supply act8891_ldo1_consumers[] = {
+ {
+ .supply = "act_ldo1",
+ }
+};
+
+static struct regulator_init_data act8891_ldo1_data = {
+ .constraints = {
+ .name = "ACT_LDO1",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_ldo1_consumers),
+ .consumer_supplies = act8891_ldo1_consumers,
+};
+
+/**/
+static struct regulator_consumer_supply act8891_ldo2_consumers[] = {
+ {
+ .supply = "act_ldo2",
+ }
+};
+
+static struct regulator_init_data act8891_ldo2_data = {
+ .constraints = {
+ .name = "ACT_LDO2",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_ldo2_consumers),
+ .consumer_supplies = act8891_ldo2_consumers,
+};
+
+/*ldo3 VCC_NAND WIFI/BT/FM_BCM4325*/
+static struct regulator_consumer_supply act8891_ldo3_consumers[] = {
+ {
+ .supply = "act_ldo3",
+ }
+};
+
+static struct regulator_init_data act8891_ldo3_data = {
+ .constraints = {
+ .name = "ACT_LDO3",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_ldo3_consumers),
+ .consumer_supplies = act8891_ldo3_consumers,
+};
+
+/*ldo4 VCCA CODEC_WM8994*/
+static struct regulator_consumer_supply act8891_ldo4_consumers[] = {
+ {
+ .supply = "act_ldo4",
+ }
+};
+
+static struct regulator_init_data act8891_ldo4_data = {
+ .constraints = {
+ .name = "ACT_LDO4",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_ldo4_consumers),
+ .consumer_supplies = act8891_ldo4_consumers,
+};
+/*buck1 vcc Core*/
+static struct regulator_consumer_supply act8891_dcdc1_consumers[] = {
+ {
+ .supply = "act_dcdc1",
+ }
+};
+
+static struct regulator_init_data act8891_dcdc1_data = {
+ .constraints = {
+ .name = "ACT_DCDC1",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ //.always_on = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_dcdc1_consumers),
+ .consumer_supplies = act8891_dcdc1_consumers
+};
+
+/*buck2 VDDDR MobileDDR VCC*/
+static struct regulator_consumer_supply act8891_dcdc2_consumers[] = {
+ {
+ .supply = "act_dcdc2",
+ }
+};
+
+static struct regulator_init_data act8891_dcdc2_data = {
+ .constraints = {
+ .name = "ACT_DCDC2",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ //.always_on = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_dcdc2_consumers),
+ .consumer_supplies = act8891_dcdc2_consumers
+};
+
+/*buck3 vdd Core*/
+static struct regulator_consumer_supply act8891_dcdc3_consumers[] = {
+ {
+ .supply = "act_dcdc3",
+ }
+};
+
+static struct regulator_init_data act8891_dcdc3_data = {
+ .constraints = {
+ .name = "ACT_DCDC3",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ //.always_on = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_dcdc3_consumers),
+ .consumer_supplies = act8891_dcdc3_consumers
+};
+
+struct act8891_regulator_subdev act8891_regulator_subdev_id[] = {
+ {
+ .id=0,
+ .initdata=&act8891_ldo1_data,
+ },
+
+ {
+ .id=1,
+ .initdata=&act8891_ldo2_data,
+ },
+
+ {
+ .id=2,
+ .initdata=&act8891_ldo3_data,
+ },
+
+ {
+ .id=3,
+ .initdata=&act8891_ldo4_data,
+ },
+
+ {
+ .id=4,
+ .initdata=&act8891_dcdc1_data,
+ },
+
+ {
+ .id=5,
+ .initdata=&act8891_dcdc2_data,
+ },
+ {
+ .id=6,
+ .initdata=&act8891_dcdc3_data,
+ },
+
+};
+
+struct act8891_platform_data act8891_data={
+ .set_init=act8891_set_init,
+ .num_regulators=7,
+ .regulators=act8891_regulator_subdev_id,
+
+};
+#endif
/*****************************************************************************************
* i2c devices
.platform_data = &bq27541_info,
},
#endif
+#if defined (CONFIG_REGULATOR_ACT8891)
+ {
+ .type = "act8891",
+ .addr = 0x5b,
+ .flags = 0,
+ .platform_data=&act8891_data,
+ },
+#endif
+
};
#endif
#endif
+#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
+#define SDMMC0_WRITE_PROTECT_PIN RK29_PIN6_PB0 //According to your own project to set the value of write-protect-pin.
+#endif
+
+
+#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
+#define SDMMC1_WRITE_PROTECT_PIN RK29_PIN6_PB0 //According to your own project to set the value of write-protect-pin.
+#endif
+
/*****************************************************************************************
* SDMMC devices
*****************************************************************************************/
#else
gpio_direction_output(RK29_PIN5_PD5,GPIO_LOW);
#endif
+
+#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
+ gpio_request(SDMMC0_WRITE_PROTECT_PIN,"sdmmc-wp");
+ gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN);
+#endif
+
return 0;
}
#endif
.detect_irq = RK29_PIN2_PA2, // INVALID_GPIO
.enable_sd_wakeup = 0,
+
+#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
+ .write_prt = SDMMC0_WRITE_PROTECT_PIN,
+#else
+ .write_prt = INVALID_GPIO,
+#endif
};
#endif
#ifdef CONFIG_SDMMC1_RK29
rk29_mux_api_set(GPIO1C5_SDMMC1DATA2_NAME, GPIO1H_SDMMC1_DATA2);
rk29_mux_api_set(GPIO1C6_SDMMC1DATA3_NAME, GPIO1H_SDMMC1_DATA3);
//rk29_mux_api_set(GPIO1C0_UART0CTSN_SDMMC1DETECTN_NAME, GPIO1H_SDMMC1_DETECT_N);
+
+#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
+ gpio_request(SDMMC1_WRITE_PROTECT_PIN,"sdio-wp");
+ gpio_direction_input(SDMMC1_WRITE_PROTECT_PIN);
+#endif
return 0;
}
#if 0
.detect_irq = RK29SDK_WIFI_SDIO_CARD_DETECT_N,
#endif
+
+#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
+ .write_prt = SDMMC1_WRITE_PROTECT_PIN,
+#else
+ .write_prt = INVALID_GPIO,
+#endif
+
};
#endif
&rk29_soc_camera_pdrv_1,
&android_pmem_cam_device,
#endif
- &android_pmem_skype_device,
+#if PMEM_SKYPE_SIZE > 0
+ &android_pmem_skype_device,
+#endif
&android_pmem_device,
&rk29_vpu_mem_device,
#ifdef CONFIG_USB20_OTG