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()
1492 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in soctherm_debug_init() local
1497 tegra->debugfs_dir = root; in soctherm_debug_init()
1507 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in soctherm_clk_enable() local
1510 if (!tegra->clock_soctherm || !tegra->clock_tsensor) in soctherm_clk_enable()
1513 reset_control_assert(tegra->reset); in soctherm_clk_enable()
1516 err = clk_prepare_enable(tegra->clock_soctherm); in soctherm_clk_enable()
1518 reset_control_deassert(tegra->reset); in soctherm_clk_enable()
1522 err = clk_prepare_enable(tegra->clock_tsensor); in soctherm_clk_enable()
1524 clk_disable_unprepare(tegra->clock_soctherm); in soctherm_clk_enable()
1525 reset_control_deassert(tegra->reset); in soctherm_clk_enable()
1529 clk_disable_unprepare(tegra->clock_tsensor); in soctherm_clk_enable()
1530 clk_disable_unprepare(tegra->clock_soctherm); in soctherm_clk_enable()
1533 reset_control_deassert(tegra->reset); in soctherm_clk_enable()
2011 struct tegra_soctherm *tegra) in soctherm_interrupts_init() argument
2022 tegra->thermal_irq = platform_get_irq(pdev, 0); in soctherm_interrupts_init()
2023 if (tegra->thermal_irq < 0) { in soctherm_interrupts_init()
2028 tegra->edp_irq = platform_get_irq(pdev, 1); in soctherm_interrupts_init()
2029 if (tegra->edp_irq < 0) { in soctherm_interrupts_init()
2035 tegra->thermal_irq, in soctherm_interrupts_init()
2040 tegra); in soctherm_interrupts_init()
2047 tegra->edp_irq, in soctherm_interrupts_init()
2052 tegra); in soctherm_interrupts_init()
2063 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in soctherm_init() local
2064 const struct tegra_tsensor_group **ttgs = tegra->soc->ttgs; in soctherm_init()
2069 for (i = 0; i < tegra->soc->num_tsensors; ++i) in soctherm_init()
2070 enable_tsensor(tegra, i); in soctherm_init()
2073 pdiv = readl(tegra->regs + SENSOR_PDIV); in soctherm_init()
2074 hotspot = readl(tegra->regs + SENSOR_HOTSPOT_OFF); in soctherm_init()
2075 for (i = 0; i < tegra->soc->num_ttgs; ++i) { in soctherm_init()
2085 writel(pdiv, tegra->regs + SENSOR_PDIV); in soctherm_init()
2086 writel(hotspot, tegra->regs + SENSOR_HOTSPOT_OFF); in soctherm_init()
2118 struct tegra_soctherm *tegra; in tegra_soctherm_probe() local
2133 tegra = devm_kzalloc(&pdev->dev, sizeof(*tegra), GFP_KERNEL); in tegra_soctherm_probe()
2134 if (!tegra) in tegra_soctherm_probe()
2137 mutex_init(&tegra->thermctl_lock); in tegra_soctherm_probe()
2138 dev_set_drvdata(&pdev->dev, tegra); in tegra_soctherm_probe()
2140 tegra->soc = soc; in tegra_soctherm_probe()
2142 tegra->regs = devm_platform_ioremap_resource_byname(pdev, "soctherm-reg"); in tegra_soctherm_probe()
2143 if (IS_ERR(tegra->regs)) { in tegra_soctherm_probe()
2145 return PTR_ERR(tegra->regs); in tegra_soctherm_probe()
2148 if (!tegra->soc->use_ccroc) { in tegra_soctherm_probe()
2149 tegra->clk_regs = devm_platform_ioremap_resource_byname(pdev, "car-reg"); in tegra_soctherm_probe()
2150 if (IS_ERR(tegra->clk_regs)) { in tegra_soctherm_probe()
2152 return PTR_ERR(tegra->clk_regs); in tegra_soctherm_probe()
2155 tegra->ccroc_regs = devm_platform_ioremap_resource_byname(pdev, "ccroc-reg"); in tegra_soctherm_probe()
2156 if (IS_ERR(tegra->ccroc_regs)) { in tegra_soctherm_probe()
2158 return PTR_ERR(tegra->ccroc_regs); in tegra_soctherm_probe()
2162 tegra->reset = devm_reset_control_get(&pdev->dev, "soctherm"); in tegra_soctherm_probe()
2163 if (IS_ERR(tegra->reset)) { in tegra_soctherm_probe()
2165 return PTR_ERR(tegra->reset); in tegra_soctherm_probe()
2168 tegra->clock_tsensor = devm_clk_get(&pdev->dev, "tsensor"); in tegra_soctherm_probe()
2169 if (IS_ERR(tegra->clock_tsensor)) { in tegra_soctherm_probe()
2171 return PTR_ERR(tegra->clock_tsensor); in tegra_soctherm_probe()
2174 tegra->clock_soctherm = devm_clk_get(&pdev->dev, "soctherm"); in tegra_soctherm_probe()
2175 if (IS_ERR(tegra->clock_soctherm)) { in tegra_soctherm_probe()
2177 return PTR_ERR(tegra->clock_soctherm); in tegra_soctherm_probe()
2180 tegra->calib = devm_kcalloc(&pdev->dev, in tegra_soctherm_probe()
2183 if (!tegra->calib) in tegra_soctherm_probe()
2195 &tegra->calib[i]); in tegra_soctherm_probe()
2200 tegra->thermctl_tzs = devm_kcalloc(&pdev->dev, in tegra_soctherm_probe()
2203 if (!tegra->thermctl_tzs) in tegra_soctherm_probe()
2224 zone->reg = tegra->regs + soc->ttgs[i]->sensor_temp_offset; in tegra_soctherm_probe()
2227 zone->ts = tegra; in tegra_soctherm_probe()
2240 tegra->thermctl_tzs[soc->ttgs[i]->id] = z; in tegra_soctherm_probe()
2248 err = soctherm_interrupts_init(pdev, tegra); in tegra_soctherm_probe()
2262 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in tegra_soctherm_remove() local
2264 debugfs_remove_recursive(tegra->debugfs_dir); in tegra_soctherm_remove()
2283 struct tegra_soctherm *tegra = platform_get_drvdata(pdev); in soctherm_resume() local
2284 struct tegra_soctherm_soc *soc = tegra->soc; in soctherm_resume()
2299 tz = tegra->thermctl_tzs[soc->ttgs[i]->id]; in soctherm_resume()