hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/mmc/host/dw_mmc-rockchip.c
....@@ -166,7 +166,7 @@
166166 * It's impossible all 4 fixed phase won't be able to work.
167167 */
168168 for (i = 0; i < ARRAY_SIZE(degrees); i++) {
169
- degree = degrees[i] + priv->last_degree;
169
+ degree = degrees[i] + priv->last_degree + 90;
170170 degree = degree % 360;
171171 clk_set_phase(priv->sample_clk, degree);
172172 if (!mmc_send_tuning(mmc, opcode, NULL))
....@@ -174,12 +174,12 @@
174174 }
175175
176176 if (i == ARRAY_SIZE(degrees)) {
177
- dev_warn(host->dev, "All phases bad!");
177
+ dev_warn(host->dev, "V2 All phases bad!");
178178 return -EIO;
179179 }
180180
181181 done:
182
- dev_info(host->dev, "Successfully tuned phase to %d\n", degrees[i]);
182
+ dev_info(host->dev, "Successfully tuned phase to %d\n", degree);
183183 priv->last_degree = degree;
184184 return 0;
185185 }
....@@ -208,8 +208,7 @@
208208 }
209209
210210 if (priv->use_v2_tuning) {
211
- ret = dw_mci_v2_execute_tuning(slot, opcode);
212
- if (!ret)
211
+ if (!dw_mci_v2_execute_tuning(slot, opcode))
213212 return 0;
214213 /* Otherwise we continue using fine tuning */
215214 }
....@@ -448,8 +447,10 @@
448447 if (!pdev->dev.of_node)
449448 return -ENODEV;
450449
451
- if (!device_property_read_bool(&pdev->dev, "non-removable") &&
452
- !device_property_read_bool(&pdev->dev, "cd-gpios"))
450
+ if ((!device_property_read_bool(&pdev->dev, "non-removable") &&
451
+ !device_property_read_bool(&pdev->dev, "cd-gpios")) ||
452
+ (device_property_read_bool(&pdev->dev, "no-sd") &&
453
+ device_property_read_bool(&pdev->dev, "no-mmc")))
453454 use_rpm = false;
454455
455456 match = of_match_node(dw_mci_rockchip_match, pdev->dev.of_node);