Lines Matching +full:temp +full:- +full:sensor
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 1999 - 2018 Intel Corporation. */
24 ixgbe_attr->sensor->location); in ixgbe_hwmon_show_location()
35 /* reset the temp field */ in ixgbe_hwmon_show_temp()
36 ixgbe_attr->hw->mac.ops.get_thermal_sensor_data(ixgbe_attr->hw); in ixgbe_hwmon_show_temp()
38 value = ixgbe_attr->sensor->temp; in ixgbe_hwmon_show_temp()
52 unsigned int value = ixgbe_attr->sensor->caution_thresh; in ixgbe_hwmon_show_cautionthresh()
66 unsigned int value = ixgbe_attr->sensor->max_op_thresh; in ixgbe_hwmon_show_maxopthresh()
75 * ixgbe_add_hwmon_attr - Create hwmon attr table for a hwmon sysfs file.
77 * @offset: offset in the eeprom sensor data table
78 * @type: type of sensor data to display
90 n_attr = adapter->ixgbe_hwmon_buff->n_hwmon; in ixgbe_add_hwmon_attr()
91 ixgbe_attr = &adapter->ixgbe_hwmon_buff->hwmon_list[n_attr]; in ixgbe_add_hwmon_attr()
95 ixgbe_attr->dev_attr.show = ixgbe_hwmon_show_location; in ixgbe_add_hwmon_attr()
96 snprintf(ixgbe_attr->name, sizeof(ixgbe_attr->name), in ixgbe_add_hwmon_attr()
97 "temp%u_label", offset + 1); in ixgbe_add_hwmon_attr()
100 ixgbe_attr->dev_attr.show = ixgbe_hwmon_show_temp; in ixgbe_add_hwmon_attr()
101 snprintf(ixgbe_attr->name, sizeof(ixgbe_attr->name), in ixgbe_add_hwmon_attr()
102 "temp%u_input", offset + 1); in ixgbe_add_hwmon_attr()
105 ixgbe_attr->dev_attr.show = ixgbe_hwmon_show_cautionthresh; in ixgbe_add_hwmon_attr()
106 snprintf(ixgbe_attr->name, sizeof(ixgbe_attr->name), in ixgbe_add_hwmon_attr()
107 "temp%u_max", offset + 1); in ixgbe_add_hwmon_attr()
110 ixgbe_attr->dev_attr.show = ixgbe_hwmon_show_maxopthresh; in ixgbe_add_hwmon_attr()
111 snprintf(ixgbe_attr->name, sizeof(ixgbe_attr->name), in ixgbe_add_hwmon_attr()
112 "temp%u_crit", offset + 1); in ixgbe_add_hwmon_attr()
115 rc = -EPERM; in ixgbe_add_hwmon_attr()
120 ixgbe_attr->sensor = in ixgbe_add_hwmon_attr()
121 &adapter->hw.mac.thermal_sensor_data.sensor[offset]; in ixgbe_add_hwmon_attr()
122 ixgbe_attr->hw = &adapter->hw; in ixgbe_add_hwmon_attr()
123 ixgbe_attr->dev_attr.store = NULL; in ixgbe_add_hwmon_attr()
124 ixgbe_attr->dev_attr.attr.mode = 0444; in ixgbe_add_hwmon_attr()
125 ixgbe_attr->dev_attr.attr.name = ixgbe_attr->name; in ixgbe_add_hwmon_attr()
126 sysfs_attr_init(&ixgbe_attr->dev_attr.attr); in ixgbe_add_hwmon_attr()
128 adapter->ixgbe_hwmon_buff->attrs[n_attr] = &ixgbe_attr->dev_attr.attr; in ixgbe_add_hwmon_attr()
130 ++adapter->ixgbe_hwmon_buff->n_hwmon; in ixgbe_add_hwmon_attr()
154 if (adapter->hw.mac.ops.init_thermal_sensor_thresh == NULL) { in ixgbe_sysfs_init()
159 if (adapter->hw.mac.ops.init_thermal_sensor_thresh(&adapter->hw)) in ixgbe_sysfs_init()
162 ixgbe_hwmon = devm_kzalloc(&adapter->pdev->dev, sizeof(*ixgbe_hwmon), in ixgbe_sysfs_init()
165 rc = -ENOMEM; in ixgbe_sysfs_init()
168 adapter->ixgbe_hwmon_buff = ixgbe_hwmon; in ixgbe_sysfs_init()
175 if (adapter->hw.mac.thermal_sensor_data.sensor[i].location == 0) in ixgbe_sysfs_init()
193 ixgbe_hwmon->groups[0] = &ixgbe_hwmon->group; in ixgbe_sysfs_init()
194 ixgbe_hwmon->group.attrs = ixgbe_hwmon->attrs; in ixgbe_sysfs_init()
196 hwmon_dev = devm_hwmon_device_register_with_groups(&adapter->pdev->dev, in ixgbe_sysfs_init()
199 ixgbe_hwmon->groups); in ixgbe_sysfs_init()