.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | | - * This program is free software; you can redistribute it and/or modify |
---|
3 | | - * it under the terms of the GNU General Public License version 2 as |
---|
4 | | - * published by the Free Software Foundation. |
---|
5 | | - * |
---|
6 | | - * This program is distributed in the hope that it will be useful, |
---|
7 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
8 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
9 | | - * GNU General Public License for more details. |
---|
10 | 3 | * |
---|
11 | 4 | * Copyright (C) 2012 ARM Limited |
---|
12 | 5 | */ |
---|
.. | .. |
---|
92 | 85 | }; |
---|
93 | 86 | |
---|
94 | 87 | #if !defined(CONFIG_REGULATOR_VEXPRESS) |
---|
95 | | -static DEVICE_ATTR(in1_label, S_IRUGO, vexpress_hwmon_label_show, NULL); |
---|
96 | | -static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, vexpress_hwmon_u32_show, |
---|
97 | | - NULL, 1000); |
---|
| 88 | +static DEVICE_ATTR(in1_label, 0444, vexpress_hwmon_label_show, NULL); |
---|
| 89 | +static SENSOR_DEVICE_ATTR_RO(in1_input, vexpress_hwmon_u32, 1000); |
---|
98 | 90 | static struct attribute *vexpress_hwmon_attrs_volt[] = { |
---|
99 | 91 | &dev_attr_in1_label.attr, |
---|
100 | 92 | &sensor_dev_attr_in1_input.dev_attr.attr, |
---|
.. | .. |
---|
113 | 105 | }; |
---|
114 | 106 | #endif |
---|
115 | 107 | |
---|
116 | | -static DEVICE_ATTR(curr1_label, S_IRUGO, vexpress_hwmon_label_show, NULL); |
---|
117 | | -static SENSOR_DEVICE_ATTR(curr1_input, S_IRUGO, vexpress_hwmon_u32_show, |
---|
118 | | - NULL, 1000); |
---|
| 108 | +static DEVICE_ATTR(curr1_label, 0444, vexpress_hwmon_label_show, NULL); |
---|
| 109 | +static SENSOR_DEVICE_ATTR_RO(curr1_input, vexpress_hwmon_u32, 1000); |
---|
119 | 110 | static struct attribute *vexpress_hwmon_attrs_amp[] = { |
---|
120 | 111 | &dev_attr_curr1_label.attr, |
---|
121 | 112 | &sensor_dev_attr_curr1_input.dev_attr.attr, |
---|
.. | .. |
---|
133 | 124 | }, |
---|
134 | 125 | }; |
---|
135 | 126 | |
---|
136 | | -static DEVICE_ATTR(temp1_label, S_IRUGO, vexpress_hwmon_label_show, NULL); |
---|
137 | | -static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, vexpress_hwmon_u32_show, |
---|
138 | | - NULL, 1000); |
---|
| 127 | +static DEVICE_ATTR(temp1_label, 0444, vexpress_hwmon_label_show, NULL); |
---|
| 128 | +static SENSOR_DEVICE_ATTR_RO(temp1_input, vexpress_hwmon_u32, 1000); |
---|
139 | 129 | static struct attribute *vexpress_hwmon_attrs_temp[] = { |
---|
140 | 130 | &dev_attr_temp1_label.attr, |
---|
141 | 131 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
---|
.. | .. |
---|
153 | 143 | }, |
---|
154 | 144 | }; |
---|
155 | 145 | |
---|
156 | | -static DEVICE_ATTR(power1_label, S_IRUGO, vexpress_hwmon_label_show, NULL); |
---|
157 | | -static SENSOR_DEVICE_ATTR(power1_input, S_IRUGO, vexpress_hwmon_u32_show, |
---|
158 | | - NULL, 1); |
---|
| 146 | +static DEVICE_ATTR(power1_label, 0444, vexpress_hwmon_label_show, NULL); |
---|
| 147 | +static SENSOR_DEVICE_ATTR_RO(power1_input, vexpress_hwmon_u32, 1); |
---|
159 | 148 | static struct attribute *vexpress_hwmon_attrs_power[] = { |
---|
160 | 149 | &dev_attr_power1_label.attr, |
---|
161 | 150 | &sensor_dev_attr_power1_input.dev_attr.attr, |
---|
.. | .. |
---|
173 | 162 | }, |
---|
174 | 163 | }; |
---|
175 | 164 | |
---|
176 | | -static DEVICE_ATTR(energy1_label, S_IRUGO, vexpress_hwmon_label_show, NULL); |
---|
177 | | -static SENSOR_DEVICE_ATTR(energy1_input, S_IRUGO, vexpress_hwmon_u64_show, |
---|
178 | | - NULL, 1); |
---|
| 165 | +static DEVICE_ATTR(energy1_label, 0444, vexpress_hwmon_label_show, NULL); |
---|
| 166 | +static SENSOR_DEVICE_ATTR_RO(energy1_input, vexpress_hwmon_u64, 1); |
---|
179 | 167 | static struct attribute *vexpress_hwmon_attrs_energy[] = { |
---|
180 | 168 | &dev_attr_energy1_label.attr, |
---|
181 | 169 | &sensor_dev_attr_energy1_input.dev_attr.attr, |
---|