linux/drivers/thermal/broadcom/bcm2835_thermal.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Driver for Broadcom BCM2835 SoC temperature sensor
 *
 * Copyright (C) 2016 Martin Sperl
 */

#include <linux/clk.h>
#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/thermal.h>

#include "../thermal_hwmon.h"

#define BCM2835_TS_TSENSCTL
#define BCM2835_TS_TSENSSTAT

#define BCM2835_TS_TSENSCTL_PRWDW
#define BCM2835_TS_TSENSCTL_RSTB

/*
 * bandgap reference voltage in 6 mV increments
 * 000b = 1178 mV, 001b = 1184 mV, ... 111b = 1220 mV
 */
#define BCM2835_TS_TSENSCTL_CTRL_BITS
#define BCM2835_TS_TSENSCTL_CTRL_SHIFT
#define BCM2835_TS_TSENSCTL_CTRL_MASK
#define BCM2835_TS_TSENSCTL_CTRL_DEFAULT
#define BCM2835_TS_TSENSCTL_EN_INT
#define BCM2835_TS_TSENSCTL_DIRECT
#define BCM2835_TS_TSENSCTL_CLR_INT
#define BCM2835_TS_TSENSCTL_THOLD_SHIFT
#define BCM2835_TS_TSENSCTL_THOLD_BITS
#define BCM2835_TS_TSENSCTL_THOLD_MASK
/*
 * time how long the block to be asserted in reset
 * which based on a clock counter (TSENS clock assumed)
 */
#define BCM2835_TS_TSENSCTL_RSTDELAY_SHIFT
#define BCM2835_TS_TSENSCTL_RSTDELAY_BITS
#define BCM2835_TS_TSENSCTL_REGULEN

#define BCM2835_TS_TSENSSTAT_DATA_BITS
#define BCM2835_TS_TSENSSTAT_DATA_SHIFT
#define BCM2835_TS_TSENSSTAT_DATA_MASK
#define BCM2835_TS_TSENSSTAT_VALID
#define BCM2835_TS_TSENSSTAT_INTERRUPT

struct bcm2835_thermal_data {};

static int bcm2835_thermal_adc2temp(u32 adc, int offset, int slope)
{}

static int bcm2835_thermal_temp2adc(int temp, int offset, int slope)
{}

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

static const struct debugfs_reg32 bcm2835_thermal_regs[] =;

static void bcm2835_thermal_debugfs(struct platform_device *pdev)
{}

static const struct thermal_zone_device_ops bcm2835_thermal_ops =;

/*
 * Note: as per Raspberry Foundation FAQ
 * (https://www.raspberrypi.org/help/faqs/#performanceOperatingTemperature)
 * the recommended temperature range for the SoC -40C to +85C
 * so the trip limit is set to 80C.
 * this applies to all the BCM283X SoC
 */

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

static int bcm2835_thermal_probe(struct platform_device *pdev)
{}

static void bcm2835_thermal_remove(struct platform_device *pdev)
{}

static struct platform_driver bcm2835_thermal_driver =;
module_platform_driver();

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