Lines Matching refs:thermal
11 * implementation of the thermal driver will include a .notify() function
27 #include <linux/thermal.h>
61 struct da9062_thermal *thermal = container_of(work,
69 ret = regmap_write(thermal->hw->regmap,
73 dev_err(thermal->dev,
82 ret = regmap_read(thermal->hw->regmap,
86 dev_err(thermal->dev,
92 mutex_lock(&thermal->lock);
93 thermal->temperature = DA9062_MILLI_CELSIUS(125);
94 mutex_unlock(&thermal->lock);
95 thermal_zone_device_update(thermal->zone,
98 delay = msecs_to_jiffies(thermal->zone->passive_delay);
99 queue_delayed_work(system_freezable_wq, &thermal->work, delay);
103 mutex_lock(&thermal->lock);
104 thermal->temperature = DA9062_MILLI_CELSIUS(0);
105 mutex_unlock(&thermal->lock);
106 thermal_zone_device_update(thermal->zone,
110 enable_irq(thermal->irq);
115 struct da9062_thermal *thermal = data;
117 disable_irq_nosync(thermal->irq);
118 queue_delayed_work(system_freezable_wq, &thermal->work, 0);
127 struct da9062_thermal *thermal = z->devdata;
134 dev_err(thermal->dev,
146 struct da9062_thermal *thermal = z->devdata;
153 dev_err(thermal->dev,
164 struct da9062_thermal *thermal = z->devdata;
166 mutex_lock(&thermal->lock);
167 *temp = thermal->temperature;
168 mutex_unlock(&thermal->lock);
180 .name = "da9062-thermal",
184 { .compatible = "dlg,da9062-thermal", .data = &da9062_config },
193 struct da9062_thermal *thermal;
217 thermal = devm_kzalloc(&pdev->dev, sizeof(struct da9062_thermal),
219 if (!thermal) {
224 thermal->config = match->data;
225 thermal->hw = chip;
226 thermal->dev = &pdev->dev;
228 INIT_DELAYED_WORK(&thermal->work, da9062_thermal_poll_on);
229 mutex_init(&thermal->lock);
231 thermal->zone = thermal_zone_device_register(thermal->config->name,
232 1, 0, thermal,
235 if (IS_ERR(thermal->zone)) {
236 dev_err(&pdev->dev, "Cannot register thermal zone device\n");
237 ret = PTR_ERR(thermal->zone);
240 ret = thermal_zone_device_enable(thermal->zone);
242 dev_err(&pdev->dev, "Cannot enable thermal zone device\n");
248 thermal->zone->passive_delay);
255 thermal->irq = ret;
257 ret = request_threaded_irq(thermal->irq, NULL,
260 "THERMAL", thermal);
263 "Failed to request thermal device IRQ.\n");
267 platform_set_drvdata(pdev, thermal);
271 thermal_zone_device_unregister(thermal->zone);
278 struct da9062_thermal *thermal = platform_get_drvdata(pdev);
280 free_irq(thermal->irq, thermal);
281 cancel_delayed_work_sync(&thermal->work);
282 thermal_zone_device_unregister(thermal->zone);
290 .name = "da9062-thermal",
300 MODULE_ALIAS("platform:da9062-thermal");