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
113 pdata->data->calibration_parameters; in amlogic_thermal_code_to_millicelsius()
117 uefuse = pdata->trim_info & TSENSOR_TRIM_SIGN_MASK ? in amlogic_thermal_code_to_millicelsius()
118 ~(pdata->trim_info & TSENSOR_TRIM_TEMP_MASK) + 1 : in amlogic_thermal_code_to_millicelsius()
119 (pdata->trim_info & TSENSOR_TRIM_TEMP_MASK); in amlogic_thermal_code_to_millicelsius()
121 factor = param->n * temp_code; in amlogic_thermal_code_to_millicelsius()
124 Uptat = temp_code * param->m; in amlogic_thermal_code_to_millicelsius()
129 temp = (Uptat + uefuse) * param->A; in amlogic_thermal_code_to_millicelsius()
131 temp = (temp - param->B) * 100; in amlogic_thermal_code_to_millicelsius()
141 regmap_read(pdata->sec_ao_map, pdata->data->u_efuse_off, in amlogic_thermal_initialize()
142 &pdata->trim_info); in amlogic_thermal_initialize()
144 ver = TSENSOR_TRIM_VERSION(pdata->trim_info); in amlogic_thermal_initialize()
147 ret = -EINVAL; in amlogic_thermal_initialize()
148 dev_err(&pdata->pdev->dev, in amlogic_thermal_initialize()
160 ret = clk_prepare_enable(data->clk); in amlogic_thermal_enable()
164 regmap_update_bits(data->regmap, TSENSOR_CFG_REG1, in amlogic_thermal_enable()
172 regmap_update_bits(data->regmap, TSENSOR_CFG_REG1, in amlogic_thermal_disable()
174 clk_disable_unprepare(data->clk); in amlogic_thermal_disable()
183 return -EINVAL; in amlogic_thermal_get_temp()
185 regmap_read(pdata->regmap, TSENSOR_STAT0, &tval); in amlogic_thermal_get_temp()
225 .compatible = "amlogic,g12a-ddr-thermal",
229 .compatible = "amlogic,g12a-cpu-thermal",
239 struct device *dev = &pdev->dev; in amlogic_thermal_probe()
245 return -ENOMEM; in amlogic_thermal_probe()
247 pdata->data = of_device_get_match_data(dev); in amlogic_thermal_probe()
248 pdata->pdev = pdev; in amlogic_thermal_probe()
255 pdata->regmap = devm_regmap_init_mmio(dev, base, in amlogic_thermal_probe()
256 pdata->data->regmap_config); in amlogic_thermal_probe()
257 if (IS_ERR(pdata->regmap)) in amlogic_thermal_probe()
258 return PTR_ERR(pdata->regmap); in amlogic_thermal_probe()
260 pdata->clk = devm_clk_get(dev, NULL); in amlogic_thermal_probe()
261 if (IS_ERR(pdata->clk)) in amlogic_thermal_probe()
262 return dev_err_probe(dev, PTR_ERR(pdata->clk), "failed to get clock\n"); in amlogic_thermal_probe()
264 pdata->sec_ao_map = syscon_regmap_lookup_by_phandle in amlogic_thermal_probe()
265 (pdev->dev.of_node, "amlogic,ao-secure"); in amlogic_thermal_probe()
266 if (IS_ERR(pdata->sec_ao_map)) { in amlogic_thermal_probe()
268 return PTR_ERR(pdata->sec_ao_map); in amlogic_thermal_probe()
271 pdata->tzd = devm_thermal_of_zone_register(&pdev->dev, in amlogic_thermal_probe()
275 if (IS_ERR(pdata->tzd)) { in amlogic_thermal_probe()
276 ret = PTR_ERR(pdata->tzd); in amlogic_thermal_probe()
281 devm_thermal_add_hwmon_sysfs(&pdev->dev, pdata->tzd); in amlogic_thermal_probe()