From: Alexey Minnekhanov <[email protected]> In Linux driver, depending on which GDSC flags are set, a different status register is checked when powering it on/off. And on top of that, a different bit inside that register is tested.
As a first step towards adding behaviour variation, import GDSC flags from Linux driver. Even though only POLL_CFG_GDSCR is the important one here, add all flags in order to make it easier to compare which flags are needed for which GDSC, making the porting process easier. Signed-off-by: Alexey Minnekhanov <[email protected]> Signed-off-by: Luca Weiss <[email protected]> --- drivers/clk/qcom/clock-qcom.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/clk/qcom/clock-qcom.h b/drivers/clk/qcom/clock-qcom.h index 3a4550d8536..6962b0351b4 100644 --- a/drivers/clk/qcom/clock-qcom.h +++ b/drivers/clk/qcom/clock-qcom.h @@ -74,8 +74,28 @@ struct qcom_reset_map { u8 bit; }; +/* Imported from linux: drivers/clk/qcom/gdsc.h L61 */ +enum qcom_gdsc_flags { + VOTABLE = BIT(0), + CLAMP_IO = BIT(1), + HW_CTRL = BIT(2), + SW_RESET = BIT(3), + AON_RESET = BIT(4), + POLL_CFG_GDSCR = BIT(5), + ALWAYS_ON = BIT(6), + RETAIN_FF_ENABLE = BIT(7), + NO_RET_PERIPH = BIT(8), + HW_CTRL_TRIGGER = BIT(9), +}; + +/** + * struct qcom_power_map - Globally Distributed Switch Controller + * @reg: GDSC control register. Linux driver calls this "gdscr" + * @flags: GDSC flags controlling its behaviour + */ struct qcom_power_map { unsigned int reg; + unsigned short flags; }; struct clk; -- 2.55.0

