obj-y += timer.o io.o devices.o iomux.o clock.o rk29-pl330.o dma.o gpio.o ddr.o sram.o memcpy_dma.o reset.o
obj-y += tests.o memtester.o
obj-y += early_printk.o
+obj-y += pm-gpio.o
ifndef CONFIG_DEBUG_LL
obj-y += ../kernel/debug.o
endif
dcdc = regulator_get(NULL, "dcdc3"); // 1th IO
regulator_set_voltage(dcdc,3000000,3000000);
+ regulator_set_suspend_voltage(dcdc, 3000000);
regulator_enable(dcdc);
printk("%s set dcdc3=%dmV end\n", __FUNCTION__, regulator_get_voltage(dcdc));
regulator_put(dcdc);
ldo = regulator_get(NULL, "ldo10"); // 1th modem IO
regulator_set_voltage(ldo,3000000,3000000);
+ regulator_set_suspend_voltage(ldo,3000000);
regulator_enable(ldo);
printk("%s set ldo10=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
dcdc = regulator_get(NULL, "dcdc2"); // 2th CORE
regulator_set_voltage(dcdc,1300000,1300000);
+ regulator_set_suspend_voltage(dcdc,1000000);
regulator_enable(dcdc);
printk("%s set dcdc2=%dmV end\n", __FUNCTION__, regulator_get_voltage(dcdc));
regulator_put(dcdc);
dcdc = regulator_get(NULL, "dcdc1"); // 3th ddr
regulator_set_voltage(dcdc,1800000,1800000);
+ regulator_set_suspend_voltage(dcdc,1800000);
regulator_enable(dcdc);
printk("%s set dcdc1=%dmV end\n", __FUNCTION__, regulator_get_voltage(dcdc));
regulator_put(dcdc);
ldo = regulator_get(NULL, "ldo1"); // 3th nand
regulator_set_voltage(ldo,1800000,1800000);
+ regulator_set_suspend_voltage(ldo,1800000);
regulator_enable(ldo);
printk("%s set ldo1=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo4"); // 4th usb
regulator_set_voltage(ldo,2500000,2500000);
+ regulator_set_suspend_voltage(ldo,2500000);
regulator_enable(ldo);
printk("%s set ldo4=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo7"); // 5th usb
regulator_set_voltage(ldo,3300000,3300000);
+ regulator_set_suspend_voltage(ldo,3300000);
regulator_enable(ldo);
printk("%s set ldo7=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
udelay(100);
dcdc = regulator_get(NULL, "dcdc4"); // backlight
- regulator_set_voltage(dcdc,20000000,20000000);
+ regulator_set_voltage(dcdc,20000000,20000000);
+ regulator_set_suspend_voltage(dcdc, 20000000);
regulator_enable(dcdc);
printk("%s set dcdc4=%dmV end\n", __FUNCTION__, regulator_get_voltage(dcdc));
regulator_put(dcdc);
ldo = regulator_get(NULL, "ldo2"); //lcd
regulator_set_voltage(ldo,3000000,3000000);
+ regulator_set_suspend_voltage(ldo,3000000);
regulator_enable(ldo);
printk("%s set ldo2=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo3"); //sram
regulator_set_voltage(ldo,1800000,1800000);
+ regulator_set_suspend_voltage(ldo,1800000);
regulator_enable(ldo);
printk("%s set ldo3=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo5"); //tf
regulator_set_voltage(ldo,3000000,3000000);
+ regulator_set_suspend_voltage(ldo,3000000);
regulator_enable(ldo);
printk("%s set ldo5=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo6"); //camera
regulator_set_voltage(ldo,1800000,1800000);
+ regulator_set_suspend_voltage(ldo,1800000);
regulator_enable(ldo);
printk("%s set ldo6=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo8"); //tp
regulator_set_voltage(ldo,3000000,3000000);
+ regulator_set_suspend_voltage(ldo,3000000);
regulator_enable(ldo);
printk("%s set ldo8=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo9"); //cmmb
regulator_set_voltage(ldo,3000000,3000000);
+ regulator_set_suspend_voltage(ldo,3000000);
regulator_enable(ldo);
printk("%s set ldo9=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
dcdc = regulator_get(NULL, "dcdc3"); // 1th IO
regulator_set_voltage(dcdc,3000000,3000000);
+ regulator_set_suspend_voltage(dcdc, 3000000);
regulator_enable(dcdc);
printk("%s set dcdc3=%dmV end\n", __FUNCTION__, regulator_get_voltage(dcdc));
regulator_put(dcdc);
ldo = regulator_get(NULL, "ldo10"); // 1th modem IO
regulator_set_voltage(ldo,3000000,3000000);
+ regulator_set_suspend_voltage(ldo,3000000);
regulator_enable(ldo);
printk("%s set ldo10=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
dcdc = regulator_get(NULL, "dcdc2"); // 2th CORE
regulator_set_voltage(dcdc,1300000,1300000);
+ regulator_set_suspend_voltage(dcdc,1000000);
regulator_enable(dcdc);
printk("%s set dcdc2=%dmV end\n", __FUNCTION__, regulator_get_voltage(dcdc));
regulator_put(dcdc);
dcdc = regulator_get(NULL, "dcdc1"); // 3th ddr
regulator_set_voltage(dcdc,1800000,1800000);
+ regulator_set_suspend_voltage(ldo, 1800000);
regulator_enable(dcdc);
printk("%s set dcdc1=%dmV end\n", __FUNCTION__, regulator_get_voltage(dcdc));
regulator_put(dcdc);
ldo = regulator_get(NULL, "ldo1"); // 3th nand
regulator_set_voltage(ldo,1800000,1800000);
+ regulator_set_suspend_voltage(ldo,1800000);
regulator_enable(ldo);
printk("%s set ldo1=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo4"); // 4th usb
regulator_set_voltage(ldo,2500000,2500000);
+ regulator_set_suspend_voltage(ldo,2500000);
regulator_enable(ldo);
printk("%s set ldo4=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo7"); // 5th usb
regulator_set_voltage(ldo,3300000,3300000);
+ regulator_set_suspend_voltage(ldo,3300000);
regulator_enable(ldo);
printk("%s set ldo7=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
udelay(100);
dcdc = regulator_get(NULL, "dcdc4"); // backlight
- regulator_set_voltage(dcdc,20000000,20000000);
+ regulator_set_voltage(dcdc,20000000,20000000);
+ regulator_set_suspend_voltage(dcdc, 20000000);
regulator_enable(dcdc);
printk("%s set dcdc4=%dmV end\n", __FUNCTION__, regulator_get_voltage(dcdc));
regulator_put(dcdc);
ldo = regulator_get(NULL, "ldo2"); //lcd
regulator_set_voltage(ldo,3000000,3000000);
+ regulator_set_suspend_voltage(ldo,3000000);
regulator_enable(ldo);
printk("%s set ldo2=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo3"); //sram
regulator_set_voltage(ldo,1800000,1800000);
+ regulator_set_suspend_voltage(ldo,1800000);
regulator_enable(ldo);
printk("%s set ldo3=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo5"); //tf
regulator_set_voltage(ldo,3000000,3000000);
+ regulator_set_suspend_voltage(ldo,3000000);
regulator_enable(ldo);
printk("%s set ldo5=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo6"); //camera
regulator_set_voltage(ldo,1800000,1800000);
+ regulator_set_suspend_voltage(ldo,1800000);
regulator_enable(ldo);
printk("%s set ldo6=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo8"); //cmmb
regulator_set_voltage(ldo,1200000,1200000);
+ regulator_set_suspend_voltage(ldo,1200000);
regulator_enable(ldo);
printk("%s set ldo8=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
ldo = regulator_get(NULL, "ldo9"); //cmmb
regulator_set_voltage(ldo,3000000,3000000);
+ regulator_set_suspend_voltage(ldo,3000000);
regulator_enable(ldo);
printk("%s set ldo9=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo));
regulator_put(ldo);
{}
#endif
+void __sramfunc pm_spi_gpio_suspend(void);
+void __sramfunc pm_spi_gpio_resume(void);
static void __sramfunc rk29_sram_suspend(void)
{
u32 clksel0;
printch('6');
vol=rk29_suspend_voltage_set(1000000);
+ pm_spi_gpio_suspend();
+
+
printch('7');
clksel0 = cru_readl(CRU_CLKSEL0_CON);
/* set arm clk 24MHz/32 = 750KHz */
/* resume arm clk */
cru_writel(clksel0, CRU_CLKSEL0_CON);
printch('7');
-
+
+ pm_spi_gpio_resume();
rk29_suspend_voltage_resume(vol);
unsigned int __sramfunc rk29_suspend_voltage_set(unsigned int vol)
{
-#if 1 //test
+#if 0 //test
unsigned short addr_4003=0x4003,addr_405d=0x405d,
addr_4059=0x4059,addr_405e=0x405e,addr_4063=0x4063;
unsigned short data_4003,data_405d,
return ret;
}
EXPORT_SYMBOL_GPL(regulator_set_voltage);
+int regulator_set_suspend_voltage(struct regulator *regulator, int uV)
+{
+ struct regulator_dev *rdev = regulator->rdev;
+ int ret = 0;
+
+ if (rdev->desc->ops->set_suspend_voltage && uV > 0) {
+ ret = rdev->desc->ops->set_suspend_voltage(rdev, uV);
+ if (ret < 0) {
+ printk(KERN_ERR "%s: failed to set voltage\n",
+ __func__);
+ return ret;
+ }
+ }
+ return ret;
+}
+EXPORT_SYMBOL_GPL(regulator_set_suspend_voltage);
static int _regulator_get_voltage(struct regulator_dev *rdev)
{
/* sanity check */
int regulator_is_supported_voltage(struct regulator *regulator,
int min_uV, int max_uV);
int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV);
+
+int regulator_set_suspend_voltage(struct regulator *regulator, int uV);
+
int regulator_get_voltage(struct regulator *regulator);
int regulator_set_current_limit(struct regulator *regulator,
int min_uA, int max_uA);
int min_uV, int max_uV)
{
return 0;
+}
+static int regulator_set_suspend_voltage(struct regulator *regulator, int uV)
+{
+
+
+
}
static inline int regulator_get_voltage(struct regulator *regulator)