• Home
  • Raw
  • Download

Lines Matching full:tmu

20 #define TER			0x0	/* TMU enable */
22 #define TRITSR 0x20 /* TMU immediate temp */
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()
71 * ERR051272: TMU: Bit 31 of registers TMU_TSCR/TMU_TRITSR/TMU_TRATSR invalid in imx8mm_tmu_get_temp()
84 struct imx8mm_tmu *tmu = sensor->priv; in imx8mp_tmu_get_temp() local
88 val = readl_relaxed(tmu->base + TRITSR); in imx8mp_tmu_get_temp()
108 struct imx8mm_tmu *tmu = sensor->priv; in tmu_get_temp() local
110 return tmu->socdata->get_temp(data, temp); in tmu_get_temp()
117 static void imx8mm_tmu_enable(struct imx8mm_tmu *tmu, bool enable) in imx8mm_tmu_enable() argument
121 val = readl_relaxed(tmu->base + TER); in imx8mm_tmu_enable()
123 if (tmu->socdata->version == TMU_VER2) in imx8mm_tmu_enable()
125 writel_relaxed(val, tmu->base + TER); in imx8mm_tmu_enable()
128 static void imx8mm_tmu_probe_sel_all(struct imx8mm_tmu *tmu) in imx8mm_tmu_probe_sel_all() argument
132 val = readl_relaxed(tmu->base + TPS); in imx8mm_tmu_probe_sel_all()
134 writel_relaxed(val, tmu->base + TPS); in imx8mm_tmu_probe_sel_all()
140 struct imx8mm_tmu *tmu; in imx8mm_tmu_probe() local
146 tmu = devm_kzalloc(&pdev->dev, struct_size(tmu, sensors, in imx8mm_tmu_probe()
148 if (!tmu) in imx8mm_tmu_probe()
151 tmu->socdata = data; in imx8mm_tmu_probe()
153 tmu->base = devm_platform_ioremap_resource(pdev, 0); in imx8mm_tmu_probe()
154 if (IS_ERR(tmu->base)) in imx8mm_tmu_probe()
155 return PTR_ERR(tmu->base); in imx8mm_tmu_probe()
157 tmu->clk = devm_clk_get(&pdev->dev, NULL); in imx8mm_tmu_probe()
158 if (IS_ERR(tmu->clk)) in imx8mm_tmu_probe()
159 return dev_err_probe(&pdev->dev, PTR_ERR(tmu->clk), in imx8mm_tmu_probe()
160 "failed to get tmu clock\n"); in imx8mm_tmu_probe()
162 ret = clk_prepare_enable(tmu->clk); in imx8mm_tmu_probe()
164 dev_err(&pdev->dev, "failed to enable tmu clock: %d\n", ret); in imx8mm_tmu_probe()
169 imx8mm_tmu_enable(tmu, false); in imx8mm_tmu_probe()
172 tmu->sensors[i].priv = tmu; in imx8mm_tmu_probe()
173 tmu->sensors[i].tzd = in imx8mm_tmu_probe()
175 &tmu->sensors[i], in imx8mm_tmu_probe()
177 if (IS_ERR(tmu->sensors[i].tzd)) { in imx8mm_tmu_probe()
181 return PTR_ERR(tmu->sensors[i].tzd); in imx8mm_tmu_probe()
183 tmu->sensors[i].hw_id = i; in imx8mm_tmu_probe()
186 platform_set_drvdata(pdev, tmu); in imx8mm_tmu_probe()
188 /* enable all the probes for V2 TMU */ in imx8mm_tmu_probe()
189 if (tmu->socdata->version == TMU_VER2) in imx8mm_tmu_probe()
190 imx8mm_tmu_probe_sel_all(tmu); in imx8mm_tmu_probe()
193 imx8mm_tmu_enable(tmu, true); in imx8mm_tmu_probe()
200 struct imx8mm_tmu *tmu = platform_get_drvdata(pdev); in imx8mm_tmu_remove() local
202 /* disable TMU */ in imx8mm_tmu_remove()
203 imx8mm_tmu_enable(tmu, false); in imx8mm_tmu_remove()
205 clk_disable_unprepare(tmu->clk); in imx8mm_tmu_remove()
224 { .compatible = "fsl,imx8mm-tmu", .data = &imx8mm_tmu_data, },
225 { .compatible = "fsl,imx8mp-tmu", .data = &imx8mp_tmu_data, },