@@ -107,7 +107,7 @@ static int gdsc_poll_status(struct gdsc *sc, enum gdsc_status status)
do {
if (gdsc_check_status(sc, status))
return 0;
- } while (ktime_us_delta(ktime_get(), start) < TIMEOUT_US);
+ } while (ktime_us_delta(ktime_get(), start) < sc->poll_timeout);
if (gdsc_check_status(sc, status))
return 0;
@@ -454,6 +454,9 @@ static int gdsc_init(struct gdsc *sc)
if (ret)
goto err_disable_supply;
+ if (!sc->poll_timeout)
+ sc->poll_timeout = 500;
+
return 0;
err_disable_supply:
@@ -36,6 +36,7 @@ struct gdsc {
struct generic_pm_domain *parent;
struct regmap *regmap;
unsigned int gdscr;
+ unsigned int poll_timeout;
unsigned int collapse_ctrl;
unsigned int collapse_mask;
unsigned int gds_hw_ctrl;