mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-21 16:36:47 +07:00
0376148f30
Based on 1 normalized pattern(s): license terms gnu general public license v2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 37 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190528170027.724130665@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
70 lines
2.0 KiB
C
70 lines
2.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) ST-Ericsson 2010 - 2013
|
|
* Author: Martin Persson <martin.persson@stericsson.com>
|
|
* Hongbo Zhang <hongbo.zhang@linaro.com>
|
|
*/
|
|
|
|
#ifndef _ABX500_H
|
|
#define _ABX500_H
|
|
|
|
#define NUM_SENSORS 5
|
|
|
|
struct abx500_temp;
|
|
|
|
/*
|
|
* struct abx500_temp_ops - abx500 chip specific ops
|
|
* @read_sensor: reads gpadc output
|
|
* @irq_handler: irq handler
|
|
* @show_name: hwmon device name
|
|
* @show_label: hwmon attribute label
|
|
* @is_visible: is attribute visible
|
|
*/
|
|
struct abx500_temp_ops {
|
|
int (*read_sensor)(struct abx500_temp *, u8, int *);
|
|
int (*irq_handler)(int, struct abx500_temp *);
|
|
ssize_t (*show_name)(struct device *,
|
|
struct device_attribute *, char *);
|
|
ssize_t (*show_label) (struct device *,
|
|
struct device_attribute *, char *);
|
|
int (*is_visible)(struct attribute *, int);
|
|
};
|
|
|
|
/*
|
|
* struct abx500_temp - representation of temp mon device
|
|
* @pdev: platform device
|
|
* @hwmon_dev: hwmon device
|
|
* @ops: abx500 chip specific ops
|
|
* @gpadc_addr: gpadc channel address
|
|
* @min: sensor temperature min value
|
|
* @max: sensor temperature max value
|
|
* @max_hyst: sensor temperature hysteresis value for max limit
|
|
* @min_alarm: sensor temperature min alarm
|
|
* @max_alarm: sensor temperature max alarm
|
|
* @work: delayed work scheduled to monitor temperature periodically
|
|
* @work_active: True if work is active
|
|
* @lock: mutex
|
|
* @monitored_sensors: number of monitored sensors
|
|
* @plat_data: private usage, usually points to platform specific data
|
|
*/
|
|
struct abx500_temp {
|
|
struct platform_device *pdev;
|
|
struct device *hwmon_dev;
|
|
struct abx500_temp_ops ops;
|
|
u8 gpadc_addr[NUM_SENSORS];
|
|
unsigned long min[NUM_SENSORS];
|
|
unsigned long max[NUM_SENSORS];
|
|
unsigned long max_hyst[NUM_SENSORS];
|
|
bool min_alarm[NUM_SENSORS];
|
|
bool max_alarm[NUM_SENSORS];
|
|
struct delayed_work work;
|
|
bool work_active;
|
|
struct mutex lock;
|
|
int monitored_sensors;
|
|
void *plat_data;
|
|
};
|
|
|
|
int abx500_hwmon_init(struct abx500_temp *data);
|
|
|
|
#endif /* _ABX500_H */
|