Lines Matching +full:am654 +full:- +full:vtm
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/
35 -40000, -40000, -40000, -40000, -39800, -39400, -39000, -38600, -38200,
36 -37800, -37400, -37000, -36600, -36200, -35800, -35300, -34700, -34200,
37 -33800, -33400, -33000, -32600, -32200, -31800, -31400, -31000, -30600,
38 -30200, -29800, -29400, -29000, -28600, -28200, -27700, -27100, -26600,
39 -26200, -25800, -25400, -25000, -24600, -24200, -23800, -23400, -23000,
40 -22600, -22200, -21800, -21400, -21000, -20500, -19900, -19400, -19000,
41 -18600, -18200, -17800, -17400, -17000, -16600, -16200, -15800, -15400,
42 -15000, -14600, -14200, -13800, -13400, -13000, -12500, -11900, -11400,
43 -11000, -10600, -10200, -9800, -9400, -9000, -8600, -8200, -7800, -7400,
44 -7000, -6600, -6200, -5800, -5400, -5000, -4500, -3900, -3400, -3000,
45 -2600, -2200, -1800, -1400, -1000, -600, -200, 200, 600, 1000, 1400,
95 int d01 = abs(s0 - s1); in vtm_get_best_value()
96 int d02 = abs(s0 - s2); in vtm_get_best_value()
97 int d12 = abs(s1 - s2); in vtm_get_best_value()
114 bgp = devdata->bgp; in k3_bgp_read_temp()
117 * Errata is applicable for am654 pg 1.0 silicon. There in k3_bgp_read_temp()
118 * is a variation of the order for 8-10 degree centigrade. in k3_bgp_read_temp()
125 s0 = readl(bgp->base + devdata->stat_offset) & in k3_bgp_read_temp()
127 s1 = readl(bgp->base + devdata->stat_offset) & in k3_bgp_read_temp()
129 s2 = readl(bgp->base + devdata->stat_offset) & in k3_bgp_read_temp()
134 return -EINVAL; in k3_bgp_read_temp()
136 *temp = k3_adc_to_temp[dtemp - K3_VTM_ADC_BEGIN_VAL]; in k3_bgp_read_temp()
163 struct device *dev = &pdev->dev; in k3_bandgap_probe()
167 if (ARRAY_SIZE(k3_adc_to_temp) != (K3_VTM_ADC_END_VAL + 1 - in k3_bandgap_probe()
169 return -EINVAL; in k3_bandgap_probe()
171 bgp = devm_kzalloc(&pdev->dev, sizeof(*bgp), GFP_KERNEL); in k3_bandgap_probe()
173 return -ENOMEM; in k3_bandgap_probe()
176 bgp->base = devm_ioremap_resource(dev, res); in k3_bandgap_probe()
177 if (IS_ERR(bgp->base)) in k3_bandgap_probe()
178 return PTR_ERR(bgp->base); in k3_bandgap_probe()
188 /* Get the sensor count in the VTM */ in k3_bandgap_probe()
189 val = readl(bgp->base + K3_VTM_DEVINFO_PWR0_OFFSET); in k3_bandgap_probe()
195 ret = -ENOMEM; in k3_bandgap_probe()
207 val = readl(data[id].bgp->base + data[id].ctrl_offset); in k3_bandgap_probe()
212 writel(val, data[id].bgp->base + data[id].ctrl_offset); in k3_bandgap_probe()
239 pm_runtime_put_sync(&pdev->dev); in k3_bandgap_remove()
240 pm_runtime_disable(&pdev->dev); in k3_bandgap_remove()
245 .compatible = "ti,am654-vtm",
255 .name = "k3-soc-thermal",
264 MODULE_AUTHOR("J Keerthy <j-keerthy@ti.com>");