linux/drivers/thermal/da9062-thermal.c

// 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.
 */

#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/thermal.h>
#include <linux/workqueue.h>

#include <linux/mfd/da9062/core.h>
#include <linux/mfd/da9062/registers.h>

/* 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
#define DA9062_MAX_POLLING_MS_PERIOD
#define DA9062_MIN_POLLING_MS_PERIOD

#define DA9062_MILLI_CELSIUS(t)

static unsigned int pp_tmp =;

struct da9062_thermal_config {};

struct da9062_thermal {};

static void da9062_thermal_poll_on(struct work_struct *work)
{}

static irqreturn_t da9062_thermal_irq_handler(int irq, void *data)
{}

static int da9062_thermal_get_temp(struct thermal_zone_device *z,
				   int *temp)
{}

static struct thermal_zone_device_ops da9062_thermal_ops =;

static struct thermal_trip trips[] =;

static const struct da9062_thermal_config da9062_config =;

static const struct of_device_id da9062_compatible_reg_id_table[] =;

MODULE_DEVICE_TABLE(of, da9062_compatible_reg_id_table);

static int da9062_thermal_probe(struct platform_device *pdev)
{}

static void da9062_thermal_remove(struct platform_device *pdev)
{}

static struct platform_driver da9062_thermal_driver =;

module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS();