Lines Matching full:tsc
164 const struct tegra_tsensor_channel *tsc = data; in tegra_tsensor_get_temp() local
165 const struct tegra_tsensor *ts = tsc->ts; in tegra_tsensor_get_temp()
173 err = readl_relaxed_poll_timeout(tsc->regs + TSENSOR_SENSOR0_STATUS0, val, in tegra_tsensor_get_temp()
178 dev_err_once(ts->dev, "ch%u: counter invalid\n", tsc->id); in tegra_tsensor_get_temp()
182 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_TS_STATUS1); in tegra_tsensor_get_temp()
191 dev_err_once(ts->dev, "ch%u: counter overflow\n", tsc->id); in tegra_tsensor_get_temp()
222 const struct tegra_tsensor_channel *tsc = data; in tegra_tsensor_set_trips() local
223 const struct tegra_tsensor *ts = tsc->ts; in tegra_tsensor_set_trips()
233 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG1); in tegra_tsensor_set_trips()
238 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG1); in tegra_tsensor_set_trips()
252 const struct tegra_tsensor_channel *tsc = &ts->ch[id]; in tegra_tsensor_handle_channel_interrupt() local
255 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_STATUS0); in tegra_tsensor_handle_channel_interrupt()
256 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_STATUS0); in tegra_tsensor_handle_channel_interrupt()
264 thermal_zone_device_update(tsc->tzd, THERMAL_EVENT_UNSPECIFIED); in tegra_tsensor_handle_channel_interrupt()
284 const struct tegra_tsensor_channel *tsc = &ts->ch[id]; in tegra_tsensor_disable_hw_channel() local
285 struct thermal_zone_device *tzd = tsc->tzd; in tegra_tsensor_disable_hw_channel()
300 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG0); in tegra_tsensor_disable_hw_channel()
302 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG0); in tegra_tsensor_disable_hw_channel()
349 const struct tegra_tsensor_channel *tsc = &ts->ch[id]; in tegra_tsensor_enable_hw_channel() local
350 struct thermal_zone_device *tzd = tsc->tzd; in tegra_tsensor_enable_hw_channel()
355 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG0); in tegra_tsensor_enable_hw_channel()
357 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG0); in tegra_tsensor_enable_hw_channel()
374 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG1); in tegra_tsensor_enable_hw_channel()
377 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG1); in tegra_tsensor_enable_hw_channel()
380 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG2); in tegra_tsensor_enable_hw_channel()
383 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG2); in tegra_tsensor_enable_hw_channel()
399 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG0); in tegra_tsensor_enable_hw_channel()
407 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG0); in tegra_tsensor_enable_hw_channel()
512 struct tegra_tsensor_channel *tsc = &ts->ch[id]; in tegra_tsensor_register_channel() local
515 tsc->ts = ts; in tegra_tsensor_register_channel()
516 tsc->id = id; in tegra_tsensor_register_channel()
517 tsc->regs = ts->regs + 0x40 * (hw_id + 1); in tegra_tsensor_register_channel()
519 tsc->tzd = devm_thermal_zone_of_sensor_register(ts->dev, id, tsc, &ops); in tegra_tsensor_register_channel()
520 if (IS_ERR(tsc->tzd)) { in tegra_tsensor_register_channel()
521 if (PTR_ERR(tsc->tzd) != -ENODEV) in tegra_tsensor_register_channel()
522 return dev_err_probe(ts->dev, PTR_ERR(tsc->tzd), in tegra_tsensor_register_channel()
529 tsc->tzd = NULL; in tegra_tsensor_register_channel()
533 if (devm_thermal_add_hwmon_sysfs(tsc->tzd)) in tegra_tsensor_register_channel()