mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
net: dsa: Add support for reporting switch chip temperatures
Some switches provide chip temperature data. Add support for reporting it through the hwmon subsystem. Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
2716777b4f
commit
51579c3f1a
3 changed files with 158 additions and 0 deletions
|
|
@ -139,6 +139,14 @@ struct dsa_switch {
|
|||
*/
|
||||
struct device *master_dev;
|
||||
|
||||
#ifdef CONFIG_NET_DSA_HWMON
|
||||
/*
|
||||
* Hardware monitoring information
|
||||
*/
|
||||
char hwmon_name[IFNAMSIZ + 8];
|
||||
struct device *hwmon_dev;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Slave mii_bus and devices for the individual ports.
|
||||
*/
|
||||
|
|
@ -242,6 +250,14 @@ struct dsa_switch_driver {
|
|||
struct ethtool_eee *e);
|
||||
int (*get_eee)(struct dsa_switch *ds, int port,
|
||||
struct ethtool_eee *e);
|
||||
|
||||
#ifdef CONFIG_NET_DSA_HWMON
|
||||
/* Hardware monitoring */
|
||||
int (*get_temp)(struct dsa_switch *ds, int *temp);
|
||||
int (*get_temp_limit)(struct dsa_switch *ds, int *temp);
|
||||
int (*set_temp_limit)(struct dsa_switch *ds, int temp);
|
||||
int (*get_temp_alarm)(struct dsa_switch *ds, bool *alarm);
|
||||
#endif
|
||||
};
|
||||
|
||||
void register_switch_driver(struct dsa_switch_driver *type);
|
||||
|
|
|
|||
Loading…
Reference in a new issue