From: 张晴 Date: Thu, 21 Jul 2011 10:04:52 +0000 (-0700) Subject: a22 and 29phonesdk:sey VCC25 0V when in sleep,29phonesdk:set key gpio pullup/down... X-Git-Tag: firefly_0821_release~10096 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c6f99f9fc0bbd1f017e99c8e1a4ceb68995e6740;p=firefly-linux-kernel-4.4.55.git a22 and 29phonesdk:sey VCC25 0V when in sleep,29phonesdk:set key gpio pullup/down disable --- diff --git a/arch/arm/mach-rk29/board-rk29-a22.c b/arch/arm/mach-rk29/board-rk29-a22.c index 7e54d167a04f..50b20aa10593 100755 --- a/arch/arm/mach-rk29/board-rk29-a22.c +++ b/arch/arm/mach-rk29/board-rk29-a22.c @@ -688,7 +688,7 @@ int wm831x_post_init(struct wm831x *parm) ldo = regulator_get(NULL, "ldo4"); // 4th usb regulator_set_voltage(ldo,2500000,2500000); - regulator_set_suspend_voltage(ldo,2500000); + regulator_set_suspend_voltage(ldo,0000000); regulator_enable(ldo); printk("%s set ldo4=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo)); regulator_put(ldo); diff --git a/arch/arm/mach-rk29/board-rk29-phonesdk.c b/arch/arm/mach-rk29/board-rk29-phonesdk.c index c8ac6b9cd238..833eceb8957c 100755 --- a/arch/arm/mach-rk29/board-rk29-phonesdk.c +++ b/arch/arm/mach-rk29/board-rk29-phonesdk.c @@ -747,7 +747,7 @@ int wm831x_post_init(struct wm831x *parm) ldo = regulator_get(NULL, "ldo4"); // 4th usb regulator_set_voltage(ldo,2500000,2500000); - regulator_set_suspend_voltage(ldo,2500000); + regulator_set_suspend_voltage(ldo,0000000); regulator_enable(ldo); printk("%s set ldo4=%dmV end\n", __FUNCTION__, regulator_get_voltage(ldo)); regulator_put(ldo); diff --git a/arch/arm/mach-rk29/spi_sram.c b/arch/arm/mach-rk29/spi_sram.c index 70808204c44b..64246c8ec03c 100755 --- a/arch/arm/mach-rk29/spi_sram.c +++ b/arch/arm/mach-rk29/spi_sram.c @@ -1,3 +1,4 @@ +/***************************************spi **************************************************/ #include #include #include @@ -6,12 +7,18 @@ #include #include + + +#if defined(CONFIG_RK29_SPI_INSRAM) + #define SPI_KHZ (1000) #define SPI_MHZ (1000*1000) #define GPLL_SPEED (24*SPI_MHZ) #define SPI_SR_SPEED (2*SPI_MHZ) + #if defined(CONFIG_MACH_RK29_A22)||defined(CONFIG_MACH_RK29_PHONESDK) + #define SRAM_SPI_CH 1 #define SRAM_SPI_CS 1 #define SRAM_SPI_DATA_BYTE 2 @@ -28,45 +35,6 @@ #define SRAM_SPI_SR_DIV (GPLL_SPEED/SPI_SR_SPEED-1) // #define SRAM_SPI_DIV (SPI_SR_SPEED/SPI_SPEED) - - - -#define GRF_GPIO0_DIR 0x000 -#define GRF_GPIO1_DIR 0x004 -#define GRF_GPIO2_DIR 0x008 -#define GRF_GPIO3_DIR 0x00c -#define GRF_GPIO4_DIR 0x010 -#define GRF_GPIO5_DIR 0x014 - - -#define GRF_GPIO0_DO 0x018 -#define GRF_GPIO1_DO 0x01c -#define GRF_GPIO2_DO 0x020 -#define GRF_GPIO3_DO 0x024 -#define GRF_GPIO4_DO 0x028 -#define GRF_GPIO5_DO 0x02c - -#define GRF_GPIO0_EN 0x030 -#define GRF_GPIO1_EN 0x034 -#define GRF_GPIO2_EN 0x038 -#define GRF_GPIO3_EN 0x03c -#define GRF_GPIO4_EN 0x040 -#define GRF_GPIO5_EN 0x044 - - -#define GRF_GPIO0L_IOMUX 0x048 -#define GRF_GPIO0H_IOMUX 0x04c -#define GRF_GPIO1L_IOMUX 0x050 -#define GRF_GPIO1H_IOMUX 0x054 -#define GRF_GPIO2L_IOMUX 0x058 -#define GRF_GPIO2H_IOMUX 0x05c -#define GRF_GPIO3L_IOMUX 0x060 -#define GRF_GPIO3H_IOMUX 0x064 -#define GRF_GPIO4L_IOMUX 0x068 -#define GRF_GPIO4H_IOMUX 0x06c -#define GRF_GPIO5L_IOMUX 0x070 -#define GRF_GPIO5H_IOMUX 0x074 - //#include #define SPIM_ENR 0x0008 @@ -75,7 +43,10 @@ #define SPIM_BAUDR 0x0010 #define SPIM_TXFTLR 0x0014 #define SPIM_RXFLR 0x0020 - +#define cs1 1 +#define cs0 0 +#define spi1 1 +#define spi0 0 #define SPIM_SR 0x0024 #define SPIM_IMR 0x002c @@ -114,138 +85,42 @@ SPI_BAUDR, SPI_SER, DATE_END, }; - -/*unsigned int __sramdata spibase; -unsigned int __sramdata sram_spi_cs; -u32 __sramdata spi_base[2]={RK29_SPI0_BASE,RK29_SPI1_BASE};*/ -static u32 __sramdata spi_data[DATE_END]={}; -#define sram_spi_dis() spi_writel(spi_readl(SPIM_ENR)&~(0x1<<0),SPIM_ENR) -#define sram_spi_en() spi_writel(spi_readl(SPIM_ENR)|(0x1<<0),SPIM_ENR) -#define sram_spi_cs_dis() spi_writel(spi_readl(SPIM_SER)&~0x3,SPIM_SER) -#define sram_spi_cs_en() spi_writel((spi_readl(SPIM_SER)&~0x3)|(0x1<