Lines Matching refs:tegra
261 static int enable_tsensor(struct tegra_soctherm *tegra, in enable_tsensor() argument
265 void __iomem *base = tegra->regs + sensor->base; in enable_tsensor()
344 struct tegra_soctherm *tegra; in tegra_soctherm_probe() local
353 tegra = devm_kzalloc(&pdev->dev, sizeof(*tegra), GFP_KERNEL); in tegra_soctherm_probe()
354 if (!tegra) in tegra_soctherm_probe()
358 tegra->regs = devm_ioremap_resource(&pdev->dev, res); in tegra_soctherm_probe()
359 if (IS_ERR(tegra->regs)) in tegra_soctherm_probe()
360 return PTR_ERR(tegra->regs); in tegra_soctherm_probe()
362 tegra->reset = devm_reset_control_get(&pdev->dev, "soctherm"); in tegra_soctherm_probe()
363 if (IS_ERR(tegra->reset)) { in tegra_soctherm_probe()
365 return PTR_ERR(tegra->reset); in tegra_soctherm_probe()
368 tegra->clock_tsensor = devm_clk_get(&pdev->dev, "tsensor"); in tegra_soctherm_probe()
369 if (IS_ERR(tegra->clock_tsensor)) { in tegra_soctherm_probe()
371 return PTR_ERR(tegra->clock_tsensor); in tegra_soctherm_probe()
374 tegra->clock_soctherm = devm_clk_get(&pdev->dev, "soctherm"); in tegra_soctherm_probe()
375 if (IS_ERR(tegra->clock_soctherm)) { in tegra_soctherm_probe()
377 return PTR_ERR(tegra->clock_soctherm); in tegra_soctherm_probe()
380 reset_control_assert(tegra->reset); in tegra_soctherm_probe()
382 err = clk_prepare_enable(tegra->clock_soctherm); in tegra_soctherm_probe()
386 err = clk_prepare_enable(tegra->clock_tsensor); in tegra_soctherm_probe()
388 clk_disable_unprepare(tegra->clock_soctherm); in tegra_soctherm_probe()
392 reset_control_deassert(tegra->reset); in tegra_soctherm_probe()
401 err = enable_tsensor(tegra, tsensors + i, &shared_calib); in tegra_soctherm_probe()
406 writel(SENSOR_PDIV_T124, tegra->regs + SENSOR_PDIV); in tegra_soctherm_probe()
407 writel(SENSOR_HOTSPOT_OFF_T124, tegra->regs + SENSOR_HOTSPOT_OFF); in tegra_soctherm_probe()
411 for (i = 0; i < ARRAY_SIZE(tegra->thermctl_tzs); ++i) { in tegra_soctherm_probe()
419 zone->reg = tegra->regs + t124_thermctl_temp_zones[i].offset; in tegra_soctherm_probe()
431 tegra->thermctl_tzs[i] = tz; in tegra_soctherm_probe()
439 tegra->thermctl_tzs[i]); in tegra_soctherm_probe()
442 clk_disable_unprepare(tegra->clock_tsensor); in tegra_soctherm_probe()
443 clk_disable_unprepare(tegra->clock_soctherm); in tegra_soctherm_probe()
450 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in tegra_soctherm_remove() local
453 for (i = 0; i < ARRAY_SIZE(tegra->thermctl_tzs); ++i) { in tegra_soctherm_remove()
455 tegra->thermctl_tzs[i]); in tegra_soctherm_remove()
458 clk_disable_unprepare(tegra->clock_tsensor); in tegra_soctherm_remove()
459 clk_disable_unprepare(tegra->clock_soctherm); in tegra_soctherm_remove()