Lines Matching refs:nr

27 #define EMC6W201_REG_IN(nr)		(0x20 + (nr))  argument
28 #define EMC6W201_REG_TEMP(nr) (0x26 + (nr)) argument
29 #define EMC6W201_REG_FAN(nr) (0x2C + (nr) * 2) argument
33 #define EMC6W201_REG_IN_LOW(nr) (0x4A + (nr) * 2) argument
34 #define EMC6W201_REG_IN_HIGH(nr) (0x4B + (nr) * 2) argument
35 #define EMC6W201_REG_TEMP_LOW(nr) (0x56 + (nr) * 2) argument
36 #define EMC6W201_REG_TEMP_HIGH(nr) (0x57 + (nr) * 2) argument
37 #define EMC6W201_REG_FAN_MIN(nr) (0x62 + (nr) * 2) argument
126 int nr; in emc6w201_update_device() local
131 for (nr = 0; nr < 6; nr++) { in emc6w201_update_device()
132 data->in[input][nr] = in emc6w201_update_device()
134 EMC6W201_REG_IN(nr)); in emc6w201_update_device()
135 data->in[min][nr] = in emc6w201_update_device()
137 EMC6W201_REG_IN_LOW(nr)); in emc6w201_update_device()
138 data->in[max][nr] = in emc6w201_update_device()
140 EMC6W201_REG_IN_HIGH(nr)); in emc6w201_update_device()
143 for (nr = 0; nr < 6; nr++) { in emc6w201_update_device()
144 data->temp[input][nr] = in emc6w201_update_device()
146 EMC6W201_REG_TEMP(nr)); in emc6w201_update_device()
147 data->temp[min][nr] = in emc6w201_update_device()
149 EMC6W201_REG_TEMP_LOW(nr)); in emc6w201_update_device()
150 data->temp[max][nr] = in emc6w201_update_device()
152 EMC6W201_REG_TEMP_HIGH(nr)); in emc6w201_update_device()
155 for (nr = 0; nr < 5; nr++) { in emc6w201_update_device()
156 data->fan[input][nr] = in emc6w201_update_device()
158 EMC6W201_REG_FAN(nr)); in emc6w201_update_device()
159 data->fan[min][nr] = in emc6w201_update_device()
161 EMC6W201_REG_FAN_MIN(nr)); in emc6w201_update_device()
184 int nr = to_sensor_dev_attr_2(devattr)->nr; in in_show() local
187 (unsigned)data->in[sf][nr] * nominal_mv[nr] / 0xC0); in in_show()
196 int nr = to_sensor_dev_attr_2(devattr)->nr; in in_store() local
205 val = clamp_val(val, 0, 255 * nominal_mv[nr] / 192); in in_store()
206 val = DIV_ROUND_CLOSEST(val * 192, nominal_mv[nr]); in in_store()
207 reg = (sf == min) ? EMC6W201_REG_IN_LOW(nr) in in_store()
208 : EMC6W201_REG_IN_HIGH(nr); in in_store()
211 data->in[sf][nr] = val; in in_store()
212 err = emc6w201_write8(client, reg, data->in[sf][nr]); in in_store()
223 int nr = to_sensor_dev_attr_2(devattr)->nr; in temp_show() local
225 return sprintf(buf, "%d\n", (int)data->temp[sf][nr] * 1000); in temp_show()
235 int nr = to_sensor_dev_attr_2(devattr)->nr; in temp_store() local
246 reg = (sf == min) ? EMC6W201_REG_TEMP_LOW(nr) in temp_store()
247 : EMC6W201_REG_TEMP_HIGH(nr); in temp_store()
250 data->temp[sf][nr] = val; in temp_store()
251 err = emc6w201_write8(client, reg, data->temp[sf][nr]); in temp_store()
262 int nr = to_sensor_dev_attr_2(devattr)->nr; in fan_show() local
265 if (data->fan[sf][nr] == 0 || data->fan[sf][nr] == 0xFFFF) in fan_show()
268 rpm = 5400000U / data->fan[sf][nr]; in fan_show()
279 int nr = to_sensor_dev_attr_2(devattr)->nr; in fan_store() local
295 data->fan[sf][nr] = val; in fan_store()
296 err = emc6w201_write16(client, EMC6W201_REG_FAN_MIN(nr), in fan_store()
297 data->fan[sf][nr]); in fan_store()