Lines Matching refs:tegra

385 static void enable_tsensor(struct tegra_soctherm *tegra, unsigned int i)  in enable_tsensor()  argument
387 const struct tegra_tsensor *sensor = &tegra->soc->tsensors[i]; in enable_tsensor()
388 void __iomem *base = tegra->regs + sensor->base; in enable_tsensor()
400 writel(tegra->calib[i], base + SENSOR_CONFIG2); in enable_tsensor()
1454 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in soctherm_debug_init() local
1459 tegra->debugfs_dir = root; in soctherm_debug_init()
1469 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in soctherm_clk_enable() local
1472 if (!tegra->clock_soctherm || !tegra->clock_tsensor) in soctherm_clk_enable()
1475 reset_control_assert(tegra->reset); in soctherm_clk_enable()
1478 err = clk_prepare_enable(tegra->clock_soctherm); in soctherm_clk_enable()
1480 reset_control_deassert(tegra->reset); in soctherm_clk_enable()
1484 err = clk_prepare_enable(tegra->clock_tsensor); in soctherm_clk_enable()
1486 clk_disable_unprepare(tegra->clock_soctherm); in soctherm_clk_enable()
1487 reset_control_deassert(tegra->reset); in soctherm_clk_enable()
1491 clk_disable_unprepare(tegra->clock_tsensor); in soctherm_clk_enable()
1492 clk_disable_unprepare(tegra->clock_soctherm); in soctherm_clk_enable()
1495 reset_control_deassert(tegra->reset); in soctherm_clk_enable()
1973 struct tegra_soctherm *tegra) in soctherm_interrupts_init() argument
1984 tegra->thermal_irq = platform_get_irq(pdev, 0); in soctherm_interrupts_init()
1985 if (tegra->thermal_irq < 0) { in soctherm_interrupts_init()
1990 tegra->edp_irq = platform_get_irq(pdev, 1); in soctherm_interrupts_init()
1991 if (tegra->edp_irq < 0) { in soctherm_interrupts_init()
1997 tegra->thermal_irq, in soctherm_interrupts_init()
2002 tegra); in soctherm_interrupts_init()
2009 tegra->edp_irq, in soctherm_interrupts_init()
2014 tegra); in soctherm_interrupts_init()
2025 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in soctherm_init() local
2026 const struct tegra_tsensor_group **ttgs = tegra->soc->ttgs; in soctherm_init()
2031 for (i = 0; i < tegra->soc->num_tsensors; ++i) in soctherm_init()
2032 enable_tsensor(tegra, i); in soctherm_init()
2035 pdiv = readl(tegra->regs + SENSOR_PDIV); in soctherm_init()
2036 hotspot = readl(tegra->regs + SENSOR_HOTSPOT_OFF); in soctherm_init()
2037 for (i = 0; i < tegra->soc->num_ttgs; ++i) { in soctherm_init()
2047 writel(pdiv, tegra->regs + SENSOR_PDIV); in soctherm_init()
2048 writel(hotspot, tegra->regs + SENSOR_HOTSPOT_OFF); in soctherm_init()
2080 struct tegra_soctherm *tegra; in tegra_soctherm_probe() local
2095 tegra = devm_kzalloc(&pdev->dev, sizeof(*tegra), GFP_KERNEL); in tegra_soctherm_probe()
2096 if (!tegra) in tegra_soctherm_probe()
2099 mutex_init(&tegra->thermctl_lock); in tegra_soctherm_probe()
2100 dev_set_drvdata(&pdev->dev, tegra); in tegra_soctherm_probe()
2102 tegra->soc = soc; in tegra_soctherm_probe()
2104 tegra->regs = devm_platform_ioremap_resource_byname(pdev, "soctherm-reg"); in tegra_soctherm_probe()
2105 if (IS_ERR(tegra->regs)) { in tegra_soctherm_probe()
2107 return PTR_ERR(tegra->regs); in tegra_soctherm_probe()
2110 if (!tegra->soc->use_ccroc) { in tegra_soctherm_probe()
2111 tegra->clk_regs = devm_platform_ioremap_resource_byname(pdev, "car-reg"); in tegra_soctherm_probe()
2112 if (IS_ERR(tegra->clk_regs)) { in tegra_soctherm_probe()
2114 return PTR_ERR(tegra->clk_regs); in tegra_soctherm_probe()
2117 tegra->ccroc_regs = devm_platform_ioremap_resource_byname(pdev, "ccroc-reg"); in tegra_soctherm_probe()
2118 if (IS_ERR(tegra->ccroc_regs)) { in tegra_soctherm_probe()
2120 return PTR_ERR(tegra->ccroc_regs); in tegra_soctherm_probe()
2124 tegra->reset = devm_reset_control_get(&pdev->dev, "soctherm"); in tegra_soctherm_probe()
2125 if (IS_ERR(tegra->reset)) { in tegra_soctherm_probe()
2127 return PTR_ERR(tegra->reset); in tegra_soctherm_probe()
2130 tegra->clock_tsensor = devm_clk_get(&pdev->dev, "tsensor"); in tegra_soctherm_probe()
2131 if (IS_ERR(tegra->clock_tsensor)) { in tegra_soctherm_probe()
2133 return PTR_ERR(tegra->clock_tsensor); in tegra_soctherm_probe()
2136 tegra->clock_soctherm = devm_clk_get(&pdev->dev, "soctherm"); in tegra_soctherm_probe()
2137 if (IS_ERR(tegra->clock_soctherm)) { in tegra_soctherm_probe()
2139 return PTR_ERR(tegra->clock_soctherm); in tegra_soctherm_probe()
2142 tegra->calib = devm_kcalloc(&pdev->dev, in tegra_soctherm_probe()
2145 if (!tegra->calib) in tegra_soctherm_probe()
2157 &tegra->calib[i]); in tegra_soctherm_probe()
2162 tegra->thermctl_tzs = devm_kcalloc(&pdev->dev, in tegra_soctherm_probe()
2165 if (!tegra->thermctl_tzs) in tegra_soctherm_probe()
2186 zone->reg = tegra->regs + soc->ttgs[i]->sensor_temp_offset; in tegra_soctherm_probe()
2189 zone->ts = tegra; in tegra_soctherm_probe()
2202 tegra->thermctl_tzs[soc->ttgs[i]->id] = z; in tegra_soctherm_probe()
2210 err = soctherm_interrupts_init(pdev, tegra); in tegra_soctherm_probe()
2224 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in tegra_soctherm_remove() local
2226 debugfs_remove_recursive(tegra->debugfs_dir); in tegra_soctherm_remove()
2245 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in soctherm_resume() local
2246 struct tegra_soctherm_soc *soc = tegra->soc; in soctherm_resume()
2261 tz = tegra->thermctl_tzs[soc->ttgs[i]->id]; in soctherm_resume()