Lines Matching +full:ao +full:- +full:secure
1 // SPDX-License-Identifier: GPL-2.0+
10 * U = ---------, Uptat = ---------
13 * Temperature = A * ( Uptat + u_efuse / 2^16 )- B
115 pdata->data->calibration_parameters; in amlogic_thermal_code_to_millicelsius()
119 uefuse = pdata->trim_info & TSENSOR_TRIM_SIGN_MASK ? in amlogic_thermal_code_to_millicelsius()
120 ~(pdata->trim_info & TSENSOR_TRIM_TEMP_MASK) + 1 : in amlogic_thermal_code_to_millicelsius()
121 (pdata->trim_info & TSENSOR_TRIM_TEMP_MASK); in amlogic_thermal_code_to_millicelsius()
123 factor = param->n * temp_code; in amlogic_thermal_code_to_millicelsius()
126 Uptat = temp_code * param->m; in amlogic_thermal_code_to_millicelsius()
131 temp = (Uptat + uefuse) * param->A; in amlogic_thermal_code_to_millicelsius()
133 temp = (temp - param->B) * 100; in amlogic_thermal_code_to_millicelsius()
143 regmap_read(pdata->sec_ao_map, pdata->data->u_efuse_off, in amlogic_thermal_initialize()
144 &pdata->trim_info); in amlogic_thermal_initialize()
146 ver = TSENSOR_TRIM_VERSION(pdata->trim_info); in amlogic_thermal_initialize()
149 ret = -EINVAL; in amlogic_thermal_initialize()
150 dev_err(&pdata->pdev->dev, in amlogic_thermal_initialize()
162 ret = clk_prepare_enable(data->clk); in amlogic_thermal_enable()
166 regmap_update_bits(data->regmap, TSENSOR_CFG_REG1, in amlogic_thermal_enable()
174 regmap_update_bits(data->regmap, TSENSOR_CFG_REG1, in amlogic_thermal_disable()
176 clk_disable_unprepare(data->clk); in amlogic_thermal_disable()
187 return -EINVAL; in amlogic_thermal_get_temp()
189 regmap_read(pdata->regmap, TSENSOR_STAT0, &tval); in amlogic_thermal_get_temp()
229 .compatible = "amlogic,g12a-ddr-thermal",
233 .compatible = "amlogic,g12a-cpu-thermal",
243 struct device *dev = &pdev->dev; in amlogic_thermal_probe()
249 return -ENOMEM; in amlogic_thermal_probe()
251 pdata->data = of_device_get_match_data(dev); in amlogic_thermal_probe()
252 pdata->pdev = pdev; in amlogic_thermal_probe()
261 pdata->regmap = devm_regmap_init_mmio(dev, base, in amlogic_thermal_probe()
262 pdata->data->regmap_config); in amlogic_thermal_probe()
263 if (IS_ERR(pdata->regmap)) in amlogic_thermal_probe()
264 return PTR_ERR(pdata->regmap); in amlogic_thermal_probe()
266 pdata->clk = devm_clk_get(dev, NULL); in amlogic_thermal_probe()
267 if (IS_ERR(pdata->clk)) { in amlogic_thermal_probe()
268 if (PTR_ERR(pdata->clk) != -EPROBE_DEFER) in amlogic_thermal_probe()
270 return PTR_ERR(pdata->clk); in amlogic_thermal_probe()
273 pdata->sec_ao_map = syscon_regmap_lookup_by_phandle in amlogic_thermal_probe()
274 (pdev->dev.of_node, "amlogic,ao-secure"); in amlogic_thermal_probe()
275 if (IS_ERR(pdata->sec_ao_map)) { in amlogic_thermal_probe()
277 return PTR_ERR(pdata->sec_ao_map); in amlogic_thermal_probe()
280 pdata->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, in amlogic_thermal_probe()
284 if (IS_ERR(pdata->tzd)) { in amlogic_thermal_probe()
285 ret = PTR_ERR(pdata->tzd); in amlogic_thermal_probe()