Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * Copyright (C) ST-Ericsson 2010 - 2013
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  * Author: Martin Persson <martin.persson@stericsson.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  *         Hongbo Zhang <hongbo.zhang@linaro.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #ifndef _ABX500_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #define _ABX500_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define NUM_SENSORS 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) struct abx500_temp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)  * struct abx500_temp_ops - abx500 chip specific ops
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)  * @read_sensor: reads gpadc output
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)  * @irq_handler: irq handler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)  * @show_name: hwmon device name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)  * @show_label: hwmon attribute label
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)  * @is_visible: is attribute visible
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct abx500_temp_ops {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 	int (*read_sensor)(struct abx500_temp *, u8, int *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 	int (*irq_handler)(int, struct abx500_temp *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 	ssize_t (*show_name)(struct device *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 			struct device_attribute *, char *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	ssize_t (*show_label) (struct device *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 			struct device_attribute *, char *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	int (*is_visible)(struct attribute *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)  * struct abx500_temp - representation of temp mon device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)  * @pdev: platform device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)  * @hwmon_dev: hwmon device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)  * @ops: abx500 chip specific ops
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)  * @gpadc_addr: gpadc channel address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)  * @min: sensor temperature min value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)  * @max: sensor temperature max value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)  * @max_hyst: sensor temperature hysteresis value for max limit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)  * @min_alarm: sensor temperature min alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)  * @max_alarm: sensor temperature max alarm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)  * @work: delayed work scheduled to monitor temperature periodically
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)  * @work_active: True if work is active
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)  * @lock: mutex
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)  * @monitored_sensors: number of monitored sensors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)  * @plat_data: private usage, usually points to platform specific data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) struct abx500_temp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 	struct platform_device *pdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 	struct device *hwmon_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 	struct abx500_temp_ops ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 	u8 gpadc_addr[NUM_SENSORS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 	unsigned long min[NUM_SENSORS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 	unsigned long max[NUM_SENSORS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 	unsigned long max_hyst[NUM_SENSORS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 	bool min_alarm[NUM_SENSORS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 	bool max_alarm[NUM_SENSORS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 	struct delayed_work work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 	bool work_active;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 	struct mutex lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 	int monitored_sensors;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 	void *plat_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) int abx500_hwmon_init(struct abx500_temp *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) #endif /* _ABX500_H */