Lines Matching +full:temp +full:- +full:sensor

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2007 - 2018 Intel Corporation. */
30 igb_attr->sensor->location); in igb_hwmon_show_location()
41 /* reset the temp field */ in igb_hwmon_show_temp()
42 igb_attr->hw->mac.ops.get_thermal_sensor_data(igb_attr->hw); in igb_hwmon_show_temp()
44 value = igb_attr->sensor->temp; in igb_hwmon_show_temp()
58 unsigned int value = igb_attr->sensor->caution_thresh; in igb_hwmon_show_cautionthresh()
72 unsigned int value = igb_attr->sensor->max_op_thresh; in igb_hwmon_show_maxopthresh()
80 /* igb_add_hwmon_attr - Create hwmon attr table for a hwmon sysfs file.
82 * @ offset: offset in the eeprom sensor data table
83 * @ type: type of sensor data to display
96 n_attr = adapter->igb_hwmon_buff->n_hwmon; in igb_add_hwmon_attr()
97 igb_attr = &adapter->igb_hwmon_buff->hwmon_list[n_attr]; in igb_add_hwmon_attr()
101 igb_attr->dev_attr.show = igb_hwmon_show_location; in igb_add_hwmon_attr()
102 snprintf(igb_attr->name, sizeof(igb_attr->name), in igb_add_hwmon_attr()
103 "temp%u_label", offset + 1); in igb_add_hwmon_attr()
106 igb_attr->dev_attr.show = igb_hwmon_show_temp; in igb_add_hwmon_attr()
107 snprintf(igb_attr->name, sizeof(igb_attr->name), in igb_add_hwmon_attr()
108 "temp%u_input", offset + 1); in igb_add_hwmon_attr()
111 igb_attr->dev_attr.show = igb_hwmon_show_cautionthresh; in igb_add_hwmon_attr()
112 snprintf(igb_attr->name, sizeof(igb_attr->name), in igb_add_hwmon_attr()
113 "temp%u_max", offset + 1); in igb_add_hwmon_attr()
116 igb_attr->dev_attr.show = igb_hwmon_show_maxopthresh; in igb_add_hwmon_attr()
117 snprintf(igb_attr->name, sizeof(igb_attr->name), in igb_add_hwmon_attr()
118 "temp%u_crit", offset + 1); in igb_add_hwmon_attr()
121 rc = -EPERM; in igb_add_hwmon_attr()
126 igb_attr->sensor = in igb_add_hwmon_attr()
127 &adapter->hw.mac.thermal_sensor_data.sensor[offset]; in igb_add_hwmon_attr()
128 igb_attr->hw = &adapter->hw; in igb_add_hwmon_attr()
129 igb_attr->dev_attr.store = NULL; in igb_add_hwmon_attr()
130 igb_attr->dev_attr.attr.mode = 0444; in igb_add_hwmon_attr()
131 igb_attr->dev_attr.attr.name = igb_attr->name; in igb_add_hwmon_attr()
132 sysfs_attr_init(&igb_attr->dev_attr.attr); in igb_add_hwmon_attr()
134 adapter->igb_hwmon_buff->attrs[n_attr] = &igb_attr->dev_attr.attr; in igb_add_hwmon_attr()
136 ++adapter->igb_hwmon_buff->n_hwmon; in igb_add_hwmon_attr()
161 if (adapter->hw.mac.ops.init_thermal_sensor_thresh == NULL) in igb_sysfs_init()
165 rc = (adapter->hw.mac.ops.init_thermal_sensor_thresh(&adapter->hw)); in igb_sysfs_init()
169 igb_hwmon = devm_kzalloc(&adapter->pdev->dev, sizeof(*igb_hwmon), in igb_sysfs_init()
172 rc = -ENOMEM; in igb_sysfs_init()
175 adapter->igb_hwmon_buff = igb_hwmon; in igb_sysfs_init()
182 if (adapter->hw.mac.thermal_sensor_data.sensor[i].location == 0) in igb_sysfs_init()
201 client = i2c_new_client_device(&adapter->i2c_adap, &i350_sensor_info); in igb_sysfs_init()
203 dev_info(&adapter->pdev->dev, in igb_sysfs_init()
208 adapter->i2c_client = client; in igb_sysfs_init()
210 igb_hwmon->groups[0] = &igb_hwmon->group; in igb_sysfs_init()
211 igb_hwmon->group.attrs = igb_hwmon->attrs; in igb_sysfs_init()
213 hwmon_dev = devm_hwmon_device_register_with_groups(&adapter->pdev->dev, in igb_sysfs_init()
214 client->name, in igb_sysfs_init()
216 igb_hwmon->groups); in igb_sysfs_init()