Update Tinker reboot to resolve breaking MiQi

Patch now uses device tree to determine the board and only run if it's a tinker board.
This commit is contained in:
Tonymac32 2017-07-22 17:01:54 -04:00 committed by GitHub
parent a203ba387a
commit a783738d0b

View File

@ -1,5 +1,5 @@
diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
index 372fb6e..b92a6d2 100644
index 372fb6e..a54c290 100644
--- a/drivers/mmc/host/dw_mmc-rockchip.c
+++ b/drivers/mmc/host/dw_mmc-rockchip.c
@@ -14,10 +14,12 @@
@ -15,7 +15,7 @@ index 372fb6e..b92a6d2 100644
#define RK3288_CLKGEN_DIV 2
@@ -353,6 +355,23 @@ static int dw_mci_rockchip_probe(struct platform_device *pdev)
@@ -353,6 +355,27 @@ static int dw_mci_rockchip_probe(struct platform_device *pdev)
return 0;
}
@ -25,21 +25,25 @@ index 372fb6e..b92a6d2 100644
+ struct mmc_host *mmc = host->cur_slot->mmc;
+ int ret;
+
+ mmc_power_off(mmc);
+ if(of_machine_is_compatible("asus,rk3288-tinker")){
+
+ mdelay(20);
+ mmc_power_off(mmc);
+
+ if (!IS_ERR(mmc->supply.vmmc))
+ ret = regulator_enable(mmc->supply.vmmc);
+ mdelay(20);
+
+ if (!IS_ERR(mmc->supply.vmmc))
+ ret = regulator_enable(mmc->supply.vmmc);
+
+ if (!IS_ERR(mmc->supply.vqmmc))
+ regulator_set_voltage(mmc->supply.vqmmc, 3000000, 3300000);
+ }
+
+ if (!IS_ERR(mmc->supply.vqmmc))
+ regulator_set_voltage(mmc->supply.vqmmc, 3000000, 3300000);
+}
+
static int dw_mci_rockchip_remove(struct platform_device *pdev)
{
pm_runtime_get_sync(&pdev->dev);
@@ -373,6 +392,7 @@ static const struct dev_pm_ops dw_mci_rockchip_dev_pm_ops = {
@@ -373,6 +396,7 @@ static const struct dev_pm_ops dw_mci_rockchip_dev_pm_ops = {
static struct platform_driver dw_mci_rockchip_pltfm_driver = {
.probe = dw_mci_rockchip_probe,
.remove = dw_mci_rockchip_remove,
@ -48,7 +52,7 @@ index 372fb6e..b92a6d2 100644
.name = "dwmmc_rockchip",
.of_match_table = dw_mci_rockchip_match,
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index e45129f..1c133f0 100644
index e45129f..faad52d 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -39,8 +39,10 @@
@ -62,31 +66,38 @@ index e45129f..1c133f0 100644
/* Common flag combinations */
#define DW_MCI_DATA_ERROR_FLAGS (SDMMC_INT_DRTO | SDMMC_INT_DCRC | \
@@ -2686,6 +2688,23 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
@@ -2686,6 +2688,30 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
+struct dw_mci *mSdhost;
+
+void setmmcEmergency() {
+
+ struct mmc_host *mmc = mSdhost->cur_slot->mmc;
+ int ret;
+
+ mmc_power_off(mmc);
+ mdelay(20);
+ if(of_machine_is_compatible("asus,rk3288-tinker")){
+
+ if (!IS_ERR(mmc->supply.vmmc)) {
+ ret = regulator_enable(mmc->supply.vmmc);
+ mmc_power_off(mmc);
+
+ mdelay(20);
+
+ if (!IS_ERR(mmc->supply.vmmc)) {
+ ret = regulator_enable(mmc->supply.vmmc);
+ }
+
+ if (!IS_ERR(mmc->supply.vqmmc))
+ regulator_set_voltage(mmc->supply.vqmmc, 3000000, 3300000);
+ }
+
+ if (!IS_ERR(mmc->supply.vqmmc))
+ regulator_set_voltage(mmc->supply.vqmmc, 3000000, 3300000);
+
+}
+
+EXPORT_SYMBOL(setmmcEmergency);
static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
{
@@ -2717,6 +2736,8 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
@@ -2717,6 +2743,8 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
mmc->f_min = freq[0];
mmc->f_max = freq[1];
}