#include <linux/debugfs.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/nvmem-consumer.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <linux/mfd/syscon.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/suspend.h>
#include <linux/thermal.h>
#include "../thermal_hwmon.h"
#include "tsens.h"
struct tsens_irq_data { … };
char *qfprom_read(struct device *dev, const char *cname)
{ … }
int tsens_read_calibration(struct tsens_priv *priv, int shift, u32 *p1, u32 *p2, bool backup)
{ … }
int tsens_calibrate_nvmem(struct tsens_priv *priv, int shift)
{ … }
int tsens_calibrate_common(struct tsens_priv *priv)
{ … }
static u32 tsens_read_cell(const struct tsens_single_value *cell, u8 len, u32 *data0, u32 *data1)
{ … }
int tsens_read_calibration_legacy(struct tsens_priv *priv,
const struct tsens_legacy_calibration_format *format,
u32 *p1, u32 *p2,
u32 *cdata0, u32 *cdata1)
{ … }
void compute_intercept_slope(struct tsens_priv *priv, u32 *p1,
u32 *p2, u32 mode)
{ … }
static inline u32 degc_to_code(int degc, const struct tsens_sensor *s)
{ … }
static inline int code_to_degc(u32 adc_code, const struct tsens_sensor *s)
{ … }
static int tsens_hw_to_mC(const struct tsens_sensor *s, int field)
{ … }
static int tsens_mC_to_hw(const struct tsens_sensor *s, int temp)
{ … }
static inline enum tsens_ver tsens_version(struct tsens_priv *priv)
{ … }
static void tsens_set_interrupt_v1(struct tsens_priv *priv, u32 hw_id,
enum tsens_irq_type irq_type, bool enable)
{ … }
static void tsens_set_interrupt_v2(struct tsens_priv *priv, u32 hw_id,
enum tsens_irq_type irq_type, bool enable)
{ … }
static void tsens_set_interrupt(struct tsens_priv *priv, u32 hw_id,
enum tsens_irq_type irq_type, bool enable)
{ … }
static int tsens_threshold_violated(struct tsens_priv *priv, u32 hw_id,
struct tsens_irq_data *d)
{ … }
static int tsens_read_irq_state(struct tsens_priv *priv, u32 hw_id,
const struct tsens_sensor *s,
struct tsens_irq_data *d)
{ … }
static inline u32 masked_irq(u32 hw_id, u32 mask, enum tsens_ver ver)
{ … }
static irqreturn_t tsens_critical_irq_thread(int irq, void *data)
{ … }
static irqreturn_t tsens_irq_thread(int irq, void *data)
{ … }
static irqreturn_t tsens_combined_irq_thread(int irq, void *data)
{ … }
static int tsens_set_trips(struct thermal_zone_device *tz, int low, int high)
{ … }
static int tsens_enable_irq(struct tsens_priv *priv)
{ … }
static void tsens_disable_irq(struct tsens_priv *priv)
{ … }
int get_temp_tsens_valid(const struct tsens_sensor *s, int *temp)
{ … }
int get_temp_common(const struct tsens_sensor *s, int *temp)
{ … }
#ifdef CONFIG_DEBUG_FS
static int dbg_sensors_show(struct seq_file *s, void *data)
{ … }
static int dbg_version_show(struct seq_file *s, void *data)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
DEFINE_SHOW_ATTRIBUTE(…);
static void tsens_debug_init(struct platform_device *pdev)
{ … }
#else
static inline void tsens_debug_init(struct platform_device *pdev) {}
#endif
static const struct regmap_config tsens_config = …;
static const struct regmap_config tsens_srot_config = …;
int __init init_common(struct tsens_priv *priv)
{ … }
static int tsens_get_temp(struct thermal_zone_device *tz, int *temp)
{ … }
static int __maybe_unused tsens_suspend(struct device *dev)
{ … }
static int __maybe_unused tsens_resume(struct device *dev)
{ … }
static SIMPLE_DEV_PM_OPS(tsens_pm_ops, tsens_suspend, tsens_resume);
static const struct of_device_id tsens_table[] = …;
MODULE_DEVICE_TABLE(of, tsens_table);
static const struct thermal_zone_device_ops tsens_of_ops = …;
static int tsens_register_irq(struct tsens_priv *priv, char *irqname,
irq_handler_t thread_fn)
{ … }
#ifdef CONFIG_SUSPEND
static int tsens_reinit(struct tsens_priv *priv)
{ … }
int tsens_resume_common(struct tsens_priv *priv)
{ … }
#endif
static int tsens_register(struct tsens_priv *priv)
{ … }
static int tsens_probe(struct platform_device *pdev)
{ … }
static void tsens_remove(struct platform_device *pdev)
{ … }
static struct platform_driver tsens_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS(…) …;