Lines Matching refs:thermal

63 	struct da9062_thermal *thermal = container_of(work,  in da9062_thermal_poll_on()  local
71 ret = regmap_write(thermal->hw->regmap, in da9062_thermal_poll_on()
75 dev_err(thermal->dev, in da9062_thermal_poll_on()
84 ret = regmap_read(thermal->hw->regmap, in da9062_thermal_poll_on()
88 dev_err(thermal->dev, in da9062_thermal_poll_on()
94 mutex_lock(&thermal->lock); in da9062_thermal_poll_on()
95 thermal->temperature = DA9062_MILLI_CELSIUS(125); in da9062_thermal_poll_on()
96 mutex_unlock(&thermal->lock); in da9062_thermal_poll_on()
97 thermal_zone_device_update(thermal->zone, in da9062_thermal_poll_on()
104 queue_delayed_work(system_freezable_wq, &thermal->work, delay); in da9062_thermal_poll_on()
108 mutex_lock(&thermal->lock); in da9062_thermal_poll_on()
109 thermal->temperature = DA9062_MILLI_CELSIUS(0); in da9062_thermal_poll_on()
110 mutex_unlock(&thermal->lock); in da9062_thermal_poll_on()
111 thermal_zone_device_update(thermal->zone, in da9062_thermal_poll_on()
115 enable_irq(thermal->irq); in da9062_thermal_poll_on()
120 struct da9062_thermal *thermal = data; in da9062_thermal_irq_handler() local
122 disable_irq_nosync(thermal->irq); in da9062_thermal_irq_handler()
123 queue_delayed_work(system_freezable_wq, &thermal->work, 0); in da9062_thermal_irq_handler()
131 struct da9062_thermal *thermal = thermal_zone_device_priv(z); in da9062_thermal_get_temp() local
133 mutex_lock(&thermal->lock); in da9062_thermal_get_temp()
134 *temp = thermal->temperature; in da9062_thermal_get_temp()
135 mutex_unlock(&thermal->lock); in da9062_thermal_get_temp()
162 struct da9062_thermal *thermal; in da9062_thermal_probe() local
185 thermal = devm_kzalloc(&pdev->dev, sizeof(struct da9062_thermal), in da9062_thermal_probe()
187 if (!thermal) { in da9062_thermal_probe()
192 thermal->config = match->data; in da9062_thermal_probe()
193 thermal->hw = chip; in da9062_thermal_probe()
194 thermal->dev = &pdev->dev; in da9062_thermal_probe()
196 INIT_DELAYED_WORK(&thermal->work, da9062_thermal_poll_on); in da9062_thermal_probe()
197 mutex_init(&thermal->lock); in da9062_thermal_probe()
199 thermal->zone = thermal_zone_device_register_with_trips(thermal->config->name, in da9062_thermal_probe()
200 trips, ARRAY_SIZE(trips), 0, thermal, in da9062_thermal_probe()
203 if (IS_ERR(thermal->zone)) { in da9062_thermal_probe()
205 ret = PTR_ERR(thermal->zone); in da9062_thermal_probe()
208 ret = thermal_zone_device_enable(thermal->zone); in da9062_thermal_probe()
221 thermal->irq = ret; in da9062_thermal_probe()
223 ret = request_threaded_irq(thermal->irq, NULL, in da9062_thermal_probe()
226 "THERMAL", thermal); in da9062_thermal_probe()
233 platform_set_drvdata(pdev, thermal); in da9062_thermal_probe()
237 thermal_zone_device_unregister(thermal->zone); in da9062_thermal_probe()
244 struct da9062_thermal *thermal = platform_get_drvdata(pdev); in da9062_thermal_remove() local
246 free_irq(thermal->irq, thermal); in da9062_thermal_remove()
247 cancel_delayed_work_sync(&thermal->work); in da9062_thermal_remove()
248 thermal_zone_device_unregister(thermal->zone); in da9062_thermal_remove()