thermal: rockchip: Sync with upstream

Add some comments on rk_tsadcv7_initialize().

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I5fa77880a0fd47a6c18e8e6ed1606ff8e327f0ad
This commit is contained in:
Tao Huang
2022-11-07 17:35:12 +08:00
parent 35ef129870
commit 6f45b03c8e

View File

@@ -948,12 +948,26 @@ static void rk_tsadcv7_initialize(struct regmap *grf, void __iomem *regs,
writel_relaxed(0U & ~TSADCV2_AUTO_TSHUT_POLARITY_HIGH,
regs + TSADCV2_AUTO_CON);
/*
* The general register file will is optional
* and might not be available.
*/
if (!IS_ERR(grf)) {
regmap_write(grf, RK3568_GRF_TSADC_CON, RK3568_GRF_TSADC_TSEN);
/*
* RK3568 TRM, section 18.5. requires a delay no less
* than 10us between the rising edge of tsadc_tsen_en
* and the rising edge of tsadc_ana_reg_0/1/2.
*/
udelay(15);
regmap_write(grf, RK3568_GRF_TSADC_CON, RK3568_GRF_TSADC_ANA_REG0);
regmap_write(grf, RK3568_GRF_TSADC_CON, RK3568_GRF_TSADC_ANA_REG1);
regmap_write(grf, RK3568_GRF_TSADC_CON, RK3568_GRF_TSADC_ANA_REG2);
/*
* RK3568 TRM, section 18.5. requires a delay no less
* than 90us after the rising edge of tsadc_ana_reg_0/1/2.
*/
usleep_range(100, 200);
}
}