// SPDX-License-Identifier: GPL-2.0-or-later /* * Thermal device driver for DA9062 and DA9061 * Copyright (C) 2017 Dialog Semiconductor
*/
/* When over-temperature is reached, an interrupt from the device will be * triggered. Following this event the interrupt will be disabled and * periodic transmission of uevents (HOT trip point) should define the * first level of temperature supervision. It is expected that any final * implementation of the thermal driver will include a .notify() function * to implement these uevents to userspace. * * These uevents are intended to indicate non-invasive temperature control * of the system, where the necessary measures for cooling are the * responsibility of the host software. Once the temperature falls again, * the IRQ is re-enabled so the start of a new over-temperature event can * be detected without constant software monitoring.
*/
/* Minimum, maximum and default polling millisecond periods are provided * here as an example. It is expected that any final implementation to also * include a modification of these settings to match the required * application.
*/ #define DA9062_DEFAULT_POLLING_MS_PERIOD 3000 #define DA9062_MAX_POLLING_MS_PERIOD 10000 #define DA9062_MIN_POLLING_MS_PERIOD 1000
/* clear E_TEMP */
ret = regmap_write(thermal->hw->regmap,
DA9062AA_EVENT_B,
DA9062AA_E_TEMP_MASK); if (ret < 0) {
dev_err(thermal->dev, "Cannot clear the TJUNC temperature status\n"); goto err_enable_irq;
}
/* Now read E_TEMP again: it is acting like a status bit. * If over-temperature, then this status will be true. * If not over-temperature, this status will be false.
*/
ret = regmap_read(thermal->hw->regmap,
DA9062AA_EVENT_B,
&val); if (ret < 0) {
dev_err(thermal->dev, "Cannot check the TJUNC temperature status\n"); goto err_enable_irq;
}
/* * pp_tmp is between 1s and 10s, so we can round the jiffies
*/
delay = round_jiffies(msecs_to_jiffies(pp_tmp));
queue_delayed_work(system_freezable_wq, &thermal->work, delay); return;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.