Lines Matching refs:tegra

268 static void enable_tsensor(struct tegra_soctherm *tegra, unsigned int i)  in enable_tsensor()  argument
270 const struct tegra_tsensor *sensor = &tegra->soc->tsensors[i]; in enable_tsensor()
271 void __iomem *base = tegra->regs + sensor->base; in enable_tsensor()
283 writel(tegra->calib[i], base + SENSOR_CONFIG2); in enable_tsensor()
820 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in soctherm_debug_init() local
829 tegra->debugfs_dir = root; in soctherm_debug_init()
835 debugfs_remove_recursive(tegra->debugfs_dir); in soctherm_debug_init()
836 tegra->debugfs_dir = NULL; in soctherm_debug_init()
845 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in soctherm_clk_enable() local
848 if (!tegra->clock_soctherm || !tegra->clock_tsensor) in soctherm_clk_enable()
851 reset_control_assert(tegra->reset); in soctherm_clk_enable()
854 err = clk_prepare_enable(tegra->clock_soctherm); in soctherm_clk_enable()
856 reset_control_deassert(tegra->reset); in soctherm_clk_enable()
860 err = clk_prepare_enable(tegra->clock_tsensor); in soctherm_clk_enable()
862 clk_disable_unprepare(tegra->clock_soctherm); in soctherm_clk_enable()
863 reset_control_deassert(tegra->reset); in soctherm_clk_enable()
867 clk_disable_unprepare(tegra->clock_tsensor); in soctherm_clk_enable()
868 clk_disable_unprepare(tegra->clock_soctherm); in soctherm_clk_enable()
871 reset_control_deassert(tegra->reset); in soctherm_clk_enable()
1198 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in soctherm_init() local
1199 const struct tegra_tsensor_group **ttgs = tegra->soc->ttgs; in soctherm_init()
1204 for (i = 0; i < tegra->soc->num_tsensors; ++i) in soctherm_init()
1205 enable_tsensor(tegra, i); in soctherm_init()
1208 pdiv = readl(tegra->regs + SENSOR_PDIV); in soctherm_init()
1209 hotspot = readl(tegra->regs + SENSOR_HOTSPOT_OFF); in soctherm_init()
1210 for (i = 0; i < tegra->soc->num_ttgs; ++i) { in soctherm_init()
1220 writel(pdiv, tegra->regs + SENSOR_PDIV); in soctherm_init()
1221 writel(hotspot, tegra->regs + SENSOR_HOTSPOT_OFF); in soctherm_init()
1253 struct tegra_soctherm *tegra; in tegra_soctherm_probe() local
1269 tegra = devm_kzalloc(&pdev->dev, sizeof(*tegra), GFP_KERNEL); in tegra_soctherm_probe()
1270 if (!tegra) in tegra_soctherm_probe()
1273 dev_set_drvdata(&pdev->dev, tegra); in tegra_soctherm_probe()
1275 tegra->soc = soc; in tegra_soctherm_probe()
1279 tegra->regs = devm_ioremap_resource(&pdev->dev, res); in tegra_soctherm_probe()
1280 if (IS_ERR(tegra->regs)) { in tegra_soctherm_probe()
1282 return PTR_ERR(tegra->regs); in tegra_soctherm_probe()
1285 if (!tegra->soc->use_ccroc) { in tegra_soctherm_probe()
1288 tegra->clk_regs = devm_ioremap_resource(&pdev->dev, res); in tegra_soctherm_probe()
1289 if (IS_ERR(tegra->clk_regs)) { in tegra_soctherm_probe()
1291 return PTR_ERR(tegra->clk_regs); in tegra_soctherm_probe()
1296 tegra->ccroc_regs = devm_ioremap_resource(&pdev->dev, res); in tegra_soctherm_probe()
1297 if (IS_ERR(tegra->ccroc_regs)) { in tegra_soctherm_probe()
1299 return PTR_ERR(tegra->ccroc_regs); in tegra_soctherm_probe()
1303 tegra->reset = devm_reset_control_get(&pdev->dev, "soctherm"); in tegra_soctherm_probe()
1304 if (IS_ERR(tegra->reset)) { in tegra_soctherm_probe()
1306 return PTR_ERR(tegra->reset); in tegra_soctherm_probe()
1309 tegra->clock_tsensor = devm_clk_get(&pdev->dev, "tsensor"); in tegra_soctherm_probe()
1310 if (IS_ERR(tegra->clock_tsensor)) { in tegra_soctherm_probe()
1312 return PTR_ERR(tegra->clock_tsensor); in tegra_soctherm_probe()
1315 tegra->clock_soctherm = devm_clk_get(&pdev->dev, "soctherm"); in tegra_soctherm_probe()
1316 if (IS_ERR(tegra->clock_soctherm)) { in tegra_soctherm_probe()
1318 return PTR_ERR(tegra->clock_soctherm); in tegra_soctherm_probe()
1321 tegra->calib = devm_kcalloc(&pdev->dev, in tegra_soctherm_probe()
1324 if (!tegra->calib) in tegra_soctherm_probe()
1336 &tegra->calib[i]); in tegra_soctherm_probe()
1341 tegra->thermctl_tzs = devm_kcalloc(&pdev->dev, in tegra_soctherm_probe()
1344 if (!tegra->thermctl_tzs) in tegra_soctherm_probe()
1363 zone->reg = tegra->regs + soc->ttgs[i]->sensor_temp_offset; in tegra_soctherm_probe()
1366 zone->ts = tegra; in tegra_soctherm_probe()
1379 tegra->thermctl_tzs[soc->ttgs[i]->id] = z; in tegra_soctherm_probe()
1399 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in tegra_soctherm_remove() local
1401 debugfs_remove_recursive(tegra->debugfs_dir); in tegra_soctherm_remove()
1420 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in soctherm_resume() local
1421 struct tegra_soctherm_soc *soc = tegra->soc; in soctherm_resume()
1436 tz = tegra->thermctl_tzs[soc->ttgs[i]->id]; in soctherm_resume()