linux/drivers/thermal/broadcom/brcmstb_thermal.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Broadcom STB AVS TMON thermal sensor driver
 *
 * Copyright (c) 2015-2017 Broadcom
 */

#define DRV_NAME

#define pr_fmt(fmt)

#include <linux/bitops.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/irqreturn.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/thermal.h>

#define AVS_TMON_STATUS
 #define AVS_TMON_STATUS_valid_msk
 #define AVS_TMON_STATUS_data_msk
 #define AVS_TMON_STATUS_data_shift

#define AVS_TMON_EN_OVERTEMP_RESET
 #define AVS_TMON_EN_OVERTEMP_RESET_msk

#define AVS_TMON_RESET_THRESH
 #define AVS_TMON_RESET_THRESH_msk
 #define AVS_TMON_RESET_THRESH_shift

#define AVS_TMON_INT_IDLE_TIME

#define AVS_TMON_EN_TEMP_INT_SRCS
 #define AVS_TMON_EN_TEMP_INT_SRCS_high
 #define AVS_TMON_EN_TEMP_INT_SRCS_low

#define AVS_TMON_INT_THRESH
 #define AVS_TMON_INT_THRESH_high_msk
 #define AVS_TMON_INT_THRESH_high_shift
 #define AVS_TMON_INT_THRESH_low_msk
 #define AVS_TMON_INT_THRESH_low_shift

#define AVS_TMON_TEMP_INT_CODE
#define AVS_TMON_TP_TEST_ENABLE

/* Default coefficients */
#define AVS_TMON_TEMP_SLOPE
#define AVS_TMON_TEMP_OFFSET

/* HW related temperature constants */
#define AVS_TMON_TEMP_MAX
#define AVS_TMON_TEMP_MIN
#define AVS_TMON_TEMP_MASK

enum avs_tmon_trip_type {};

struct avs_tmon_trip {};

static struct avs_tmon_trip avs_tmon_trips[] =;

struct brcmstb_thermal_params {};

struct brcmstb_thermal_priv {};

/* Convert a HW code to a temperature reading (millidegree celsius) */
static inline int avs_tmon_code_to_temp(struct brcmstb_thermal_priv *priv,
					u32 code)
{}

/*
 * Convert a temperature value (millidegree celsius) to a HW code
 *
 * @temp: temperature to convert
 * @low: if true, round toward the low side
 */
static inline u32 avs_tmon_temp_to_code(struct brcmstb_thermal_priv *priv,
					int temp, bool low)
{}

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

static void avs_tmon_trip_enable(struct brcmstb_thermal_priv *priv,
				 enum avs_tmon_trip_type type, int en)
{}

static int avs_tmon_get_trip_temp(struct brcmstb_thermal_priv *priv,
				  enum avs_tmon_trip_type type)
{}

static void avs_tmon_set_trip_temp(struct brcmstb_thermal_priv *priv,
				   enum avs_tmon_trip_type type,
				   int temp)
{}

static int avs_tmon_get_intr_temp(struct brcmstb_thermal_priv *priv)
{}

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

static int brcmstb_set_trips(struct thermal_zone_device *tz, int low, int high)
{}

static const struct thermal_zone_device_ops brcmstb_16nm_of_ops =;

static const struct brcmstb_thermal_params brcmstb_16nm_params =;

static const struct thermal_zone_device_ops brcmstb_28nm_of_ops =;

static const struct brcmstb_thermal_params brcmstb_28nm_params =;

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

static int brcmstb_thermal_probe(struct platform_device *pdev)
{}

static struct platform_driver brcmstb_thermal_driver =;
module_platform_driver();

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