Lines Matching refs:tmu
64 struct imx8mm_tmu *tmu = sensor->priv; in imx8mm_tmu_get_temp() local
67 val = readl_relaxed(tmu->base + TRITSR) & TRITSR_TEMP0_VAL_MASK; in imx8mm_tmu_get_temp()
78 struct imx8mm_tmu *tmu = sensor->priv; in imx8mp_tmu_get_temp() local
82 val = readl_relaxed(tmu->base + TRITSR); in imx8mp_tmu_get_temp()
102 struct imx8mm_tmu *tmu = sensor->priv; in tmu_get_temp() local
104 return tmu->socdata->get_temp(data, temp); in tmu_get_temp()
111 static void imx8mm_tmu_enable(struct imx8mm_tmu *tmu, bool enable) in imx8mm_tmu_enable() argument
115 val = readl_relaxed(tmu->base + TER); in imx8mm_tmu_enable()
117 if (tmu->socdata->version == TMU_VER2) in imx8mm_tmu_enable()
119 writel_relaxed(val, tmu->base + TER); in imx8mm_tmu_enable()
122 static void imx8mm_tmu_probe_sel_all(struct imx8mm_tmu *tmu) in imx8mm_tmu_probe_sel_all() argument
126 val = readl_relaxed(tmu->base + TPS); in imx8mm_tmu_probe_sel_all()
128 writel_relaxed(val, tmu->base + TPS); in imx8mm_tmu_probe_sel_all()
134 struct imx8mm_tmu *tmu; in imx8mm_tmu_probe() local
140 tmu = devm_kzalloc(&pdev->dev, struct_size(tmu, sensors, in imx8mm_tmu_probe()
142 if (!tmu) in imx8mm_tmu_probe()
145 tmu->socdata = data; in imx8mm_tmu_probe()
147 tmu->base = devm_platform_ioremap_resource(pdev, 0); in imx8mm_tmu_probe()
148 if (IS_ERR(tmu->base)) in imx8mm_tmu_probe()
149 return PTR_ERR(tmu->base); in imx8mm_tmu_probe()
151 tmu->clk = devm_clk_get(&pdev->dev, NULL); in imx8mm_tmu_probe()
152 if (IS_ERR(tmu->clk)) in imx8mm_tmu_probe()
153 return dev_err_probe(&pdev->dev, PTR_ERR(tmu->clk), in imx8mm_tmu_probe()
156 ret = clk_prepare_enable(tmu->clk); in imx8mm_tmu_probe()
163 imx8mm_tmu_enable(tmu, false); in imx8mm_tmu_probe()
166 tmu->sensors[i].priv = tmu; in imx8mm_tmu_probe()
167 tmu->sensors[i].tzd = in imx8mm_tmu_probe()
169 &tmu->sensors[i], in imx8mm_tmu_probe()
171 if (IS_ERR(tmu->sensors[i].tzd)) { in imx8mm_tmu_probe()
172 ret = PTR_ERR(tmu->sensors[i].tzd); in imx8mm_tmu_probe()
178 tmu->sensors[i].hw_id = i; in imx8mm_tmu_probe()
181 platform_set_drvdata(pdev, tmu); in imx8mm_tmu_probe()
184 if (tmu->socdata->version == TMU_VER2) in imx8mm_tmu_probe()
185 imx8mm_tmu_probe_sel_all(tmu); in imx8mm_tmu_probe()
188 imx8mm_tmu_enable(tmu, true); in imx8mm_tmu_probe()
193 clk_disable_unprepare(tmu->clk); in imx8mm_tmu_probe()
199 struct imx8mm_tmu *tmu = platform_get_drvdata(pdev); in imx8mm_tmu_remove() local
202 imx8mm_tmu_enable(tmu, false); in imx8mm_tmu_remove()
204 clk_disable_unprepare(tmu->clk); in imx8mm_tmu_remove()