linux/drivers/thermal/sun8i_thermal.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Thermal sensor driver for Allwinner SOC
 * Copyright (C) 2019 Yangtao Li
 *
 * Based on the work of Icenowy Zheng <[email protected]>
 * Based on the work of Ondrej Jirman <[email protected]>
 * Based on the work of Josef Gajdusek <[email protected]>
 */

#include <linux/bitmap.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/nvmem-consumer.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/thermal.h>

#include "thermal_hwmon.h"

#define MAX_SENSOR_NUM

#define FT_TEMP_MASK
#define TEMP_CALIB_MASK
#define CALIBRATE_DEFAULT

#define SUN8I_THS_CTRL0
#define SUN8I_THS_CTRL2
#define SUN8I_THS_IC
#define SUN8I_THS_IS
#define SUN8I_THS_MFC
#define SUN8I_THS_TEMP_CALIB
#define SUN8I_THS_TEMP_DATA

#define SUN50I_THS_CTRL0
#define SUN50I_H6_THS_ENABLE
#define SUN50I_H6_THS_PC
#define SUN50I_H6_THS_DIC
#define SUN50I_H6_THS_DIS
#define SUN50I_H6_THS_MFC
#define SUN50I_H6_THS_TEMP_CALIB
#define SUN50I_H6_THS_TEMP_DATA

#define SUN8I_THS_CTRL0_T_ACQ0(x)
#define SUN8I_THS_CTRL2_T_ACQ1(x)
#define SUN8I_THS_DATA_IRQ_STS(x)

#define SUN50I_THS_CTRL0_T_ACQ(x)
#define SUN50I_THS_CTRL0_T_SAMPLE_PER(x)
#define SUN50I_THS_FILTER_EN
#define SUN50I_THS_FILTER_TYPE(x)
#define SUN50I_H6_THS_PC_TEMP_PERIOD(x)
#define SUN50I_H6_THS_DATA_IRQ_STS(x)

struct tsensor {};

struct ths_thermal_chip {};

struct ths_device {};

/* The H616 needs to have a bit 16 in the SRAM control register cleared. */
static const struct reg_field sun8i_ths_sram_reg_field =;

/* Temp Unit: millidegree Celsius */
static int sun8i_ths_calc_temp(struct ths_device *tmdev,
			       int id, int reg)
{}

static int sun50i_h5_calc_temp(struct ths_device *tmdev,
			       int id, int reg)
{}

static int sun8i_ths_get_temp(struct thermal_zone_device *tz, int *temp)
{}

static const struct thermal_zone_device_ops ths_ops =;

static const struct regmap_config config =;

static unsigned long sun8i_h3_irq_ack(struct ths_device *tmdev)
{}

static unsigned long sun50i_h6_irq_ack(struct ths_device *tmdev)
{}

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

static int sun8i_h3_ths_calibrate(struct ths_device *tmdev,
				  u16 *caldata, int callen)
{}

static int sun50i_h6_ths_calibrate(struct ths_device *tmdev,
				   u16 *caldata, int callen)
{}

static int sun8i_ths_calibrate(struct ths_device *tmdev)
{}

static void sun8i_ths_reset_control_assert(void *data)
{}

static struct regmap *sun8i_ths_get_sram_regmap(struct device_node *node)
{}

static int sun8i_ths_resource_init(struct ths_device *tmdev)
{}

static int sun8i_h3_thermal_init(struct ths_device *tmdev)
{}

static int sun50i_h6_thermal_init(struct ths_device *tmdev)
{}

static int sun8i_ths_register(struct ths_device *tmdev)
{}

static int sun8i_ths_probe(struct platform_device *pdev)
{}

static const struct ths_thermal_chip sun8i_a83t_ths =;

static const struct ths_thermal_chip sun8i_h3_ths =;

static const struct ths_thermal_chip sun8i_r40_ths =;

static const struct ths_thermal_chip sun50i_a64_ths =;

static const struct ths_thermal_chip sun50i_a100_ths =;

static const struct ths_thermal_chip sun50i_h5_ths =;

static const struct ths_thermal_chip sun50i_h6_ths =;

static const struct ths_thermal_chip sun20i_d1_ths =;

static const struct ths_thermal_chip sun50i_h616_ths =;

static const struct of_device_id of_ths_match[] =;
MODULE_DEVICE_TABLE(of, of_ths_match);

static struct platform_driver ths_driver =;
module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();