Lines Matching refs:tsc

163 	const struct tegra_tsensor_channel *tsc = thermal_zone_device_priv(tz);  in tegra_tsensor_get_temp()  local
164 const struct tegra_tsensor *ts = tsc->ts; in tegra_tsensor_get_temp()
172 err = readl_relaxed_poll_timeout(tsc->regs + TSENSOR_SENSOR0_STATUS0, val, in tegra_tsensor_get_temp()
177 dev_err_once(ts->dev, "ch%u: counter invalid\n", tsc->id); in tegra_tsensor_get_temp()
181 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_TS_STATUS1); in tegra_tsensor_get_temp()
190 dev_err_once(ts->dev, "ch%u: counter overflow\n", tsc->id); in tegra_tsensor_get_temp()
221 const struct tegra_tsensor_channel *tsc = thermal_zone_device_priv(tz); in tegra_tsensor_set_trips() local
222 const struct tegra_tsensor *ts = tsc->ts; in tegra_tsensor_set_trips()
232 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG1); in tegra_tsensor_set_trips()
237 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG1); in tegra_tsensor_set_trips()
251 const struct tegra_tsensor_channel *tsc = &ts->ch[id]; in tegra_tsensor_handle_channel_interrupt() local
254 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_STATUS0); in tegra_tsensor_handle_channel_interrupt()
255 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_STATUS0); in tegra_tsensor_handle_channel_interrupt()
263 thermal_zone_device_update(tsc->tzd, THERMAL_EVENT_UNSPECIFIED); in tegra_tsensor_handle_channel_interrupt()
283 const struct tegra_tsensor_channel *tsc = &ts->ch[id]; in tegra_tsensor_disable_hw_channel() local
284 struct thermal_zone_device *tzd = tsc->tzd; in tegra_tsensor_disable_hw_channel()
299 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG0); in tegra_tsensor_disable_hw_channel()
301 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG0); in tegra_tsensor_disable_hw_channel()
347 const struct tegra_tsensor_channel *tsc = &ts->ch[id]; in tegra_tsensor_enable_hw_channel() local
348 struct thermal_zone_device *tzd = tsc->tzd; in tegra_tsensor_enable_hw_channel()
353 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG0); in tegra_tsensor_enable_hw_channel()
355 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG0); in tegra_tsensor_enable_hw_channel()
369 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG1); in tegra_tsensor_enable_hw_channel()
372 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG1); in tegra_tsensor_enable_hw_channel()
375 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG2); in tegra_tsensor_enable_hw_channel()
378 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG2); in tegra_tsensor_enable_hw_channel()
394 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG0); in tegra_tsensor_enable_hw_channel()
402 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG0); in tegra_tsensor_enable_hw_channel()
505 struct tegra_tsensor_channel *tsc = &ts->ch[id]; in tegra_tsensor_register_channel() local
508 tsc->ts = ts; in tegra_tsensor_register_channel()
509 tsc->id = id; in tegra_tsensor_register_channel()
510 tsc->regs = ts->regs + 0x40 * (hw_id + 1); in tegra_tsensor_register_channel()
512 tsc->tzd = devm_thermal_of_zone_register(ts->dev, id, tsc, &ops); in tegra_tsensor_register_channel()
513 if (IS_ERR(tsc->tzd)) { in tegra_tsensor_register_channel()
514 if (PTR_ERR(tsc->tzd) != -ENODEV) in tegra_tsensor_register_channel()
515 return dev_err_probe(ts->dev, PTR_ERR(tsc->tzd), in tegra_tsensor_register_channel()
522 tsc->tzd = NULL; in tegra_tsensor_register_channel()
526 devm_thermal_add_hwmon_sysfs(ts->dev, tsc->tzd); in tegra_tsensor_register_channel()