mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
add suspend/resume function(rk29_sdmmc.c), 2)add kernel config -- Allow unsafe resume(rk29_sdk_defconfig), 3)modify 'sd card reset error'(board-rk29sdk.c)
This commit is contained in:
@@ -1490,7 +1490,7 @@ CONFIG_DWC_CONN_EN=y
|
||||
CONFIG_DWC_OTG=y
|
||||
CONFIG_MMC=y
|
||||
# CONFIG_MMC_DEBUG is not set
|
||||
# CONFIG_MMC_UNSAFE_RESUME is not set
|
||||
CONFIG_MMC_UNSAFE_RESUME=y
|
||||
CONFIG_MMC_EMBEDDED_SDIO=y
|
||||
# CONFIG_MMC_PARANOID_SD_INIT is not set
|
||||
|
||||
|
||||
@@ -1151,9 +1151,13 @@ static int rk29_sdmmc0_cfg_gpio(void)
|
||||
rk29_mux_api_set(GPIO2A2_SDMMC0DETECTN_NAME, GPIO2L_SDMMC0_DETECT_N);
|
||||
rk29_mux_api_set(GPIO5D5_SDMMC0PWREN_NAME, GPIO5H_GPIO5D5); ///GPIO5H_SDMMC0_PWR_EN); ///GPIO5H_GPIO5D5);
|
||||
gpio_request(RK29_PIN5_PD5,"sdmmc");
|
||||
#if 0
|
||||
gpio_set_value(RK29_PIN5_PD5,GPIO_HIGH);
|
||||
mdelay(100);
|
||||
gpio_set_value(RK29_PIN5_PD5,GPIO_LOW);
|
||||
#else
|
||||
gpio_direction_output(RK29_PIN5_PD5,GPIO_LOW);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1542,26 +1542,34 @@ static int __exit rk29_sdmmc_remove(struct platform_device *pdev)
|
||||
kfree(host);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rk29_sdmmc_suspend(struct platform_device *pdev, pm_message_t state)
|
||||
{
|
||||
int ret = 0;
|
||||
#ifdef CONFIG_PM
|
||||
struct rk29_sdmmc *host = platform_get_drvdata(pdev);
|
||||
|
||||
printk("Enter rk29_sdmmc_suspend\n");
|
||||
if(host->mmc)
|
||||
ret = mmc_suspend_host(host->mmc, state);
|
||||
rk29_sdmmc_write(host->regs, SDMMC_CLKENA, 0);
|
||||
clk_disable(host->clk);
|
||||
#endif
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int rk29_sdmmc_resume(struct platform_device *pdev)
|
||||
{
|
||||
int ret = 0;
|
||||
#ifdef CONFIG_PM
|
||||
struct rk29_sdmmc *host = platform_get_drvdata(pdev);
|
||||
clk_enable(host->clk);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
printk("Exit rk29_sdmmc_suspend\n");
|
||||
clk_enable(host->clk);
|
||||
if(host->mmc)
|
||||
ret = mmc_resume_host(host->mmc);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
static struct platform_driver rk29_sdmmc_driver = {
|
||||
.suspend = rk29_sdmmc_suspend,
|
||||
.resume = rk29_sdmmc_resume,
|
||||
|
||||
Reference in New Issue
Block a user