Lines Matching refs:thermal

11  * implementation of the thermal driver will include a .notify() function
27 #include <linux/thermal.h>
63 struct da9062_thermal *thermal = container_of(work,
71 ret = regmap_write(thermal->hw->regmap,
75 dev_err(thermal->dev,
84 ret = regmap_read(thermal->hw->regmap,
88 dev_err(thermal->dev,
94 mutex_lock(&thermal->lock);
95 thermal->temperature = DA9062_MILLI_CELSIUS(125);
96 mutex_unlock(&thermal->lock);
97 thermal_zone_device_update(thermal->zone,
104 queue_delayed_work(system_freezable_wq, &thermal->work, delay);
108 mutex_lock(&thermal->lock);
109 thermal->temperature = DA9062_MILLI_CELSIUS(0);
110 mutex_unlock(&thermal->lock);
111 thermal_zone_device_update(thermal->zone,
115 enable_irq(thermal->irq);
120 struct da9062_thermal *thermal = data;
122 disable_irq_nosync(thermal->irq);
123 queue_delayed_work(system_freezable_wq, &thermal->work, 0);
131 struct da9062_thermal *thermal = thermal_zone_device_priv(z);
133 mutex_lock(&thermal->lock);
134 *temp = thermal->temperature;
135 mutex_unlock(&thermal->lock);
149 .name = "da9062-thermal",
153 { .compatible = "dlg,da9062-thermal", .data = &da9062_config },
162 struct da9062_thermal *thermal;
185 thermal = devm_kzalloc(&pdev->dev, sizeof(struct da9062_thermal),
187 if (!thermal) {
192 thermal->config = match->data;
193 thermal->hw = chip;
194 thermal->dev = &pdev->dev;
196 INIT_DELAYED_WORK(&thermal->work, da9062_thermal_poll_on);
197 mutex_init(&thermal->lock);
199 thermal->zone = thermal_zone_device_register_with_trips(thermal->config->name,
200 trips, ARRAY_SIZE(trips), 0, thermal,
203 if (IS_ERR(thermal->zone)) {
204 dev_err(&pdev->dev, "Cannot register thermal zone device\n");
205 ret = PTR_ERR(thermal->zone);
208 ret = thermal_zone_device_enable(thermal->zone);
210 dev_err(&pdev->dev, "Cannot enable thermal zone device\n");
221 thermal->irq = ret;
223 ret = request_threaded_irq(thermal->irq, NULL,
226 "THERMAL", thermal);
229 "Failed to request thermal device IRQ.\n");
233 platform_set_drvdata(pdev, thermal);
237 thermal_zone_device_unregister(thermal->zone);
244 struct da9062_thermal *thermal = platform_get_drvdata(pdev);
246 free_irq(thermal->irq, thermal);
247 cancel_delayed_work_sync(&thermal->work);
248 thermal_zone_device_unregister(thermal->zone);
256 .name = "da9062-thermal",
266 MODULE_ALIAS("platform:da9062-thermal");