Lines Matching +full:ecx +full:- +full:1000
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * dell-smm-hwmon.c -- Linux driver for accessing the SMM BIOS on Dell laptops.
9 * Copyright (C) 2013, 2014 Guenter Roeck <linux@roeck-us.net>
26 #include <linux/hwmon-sysfs.h>
123 unsigned int ecx __packed;
143 int eax = regs->eax; in i8k_smm_func()
146 int ebx = regs->ebx; in i8k_smm_func()
155 return -EBUSY; in i8k_smm_func()
162 "movl 8(%%rax),%%ecx\n\t" in i8k_smm_func()
171 "movl %%ecx,8(%%rax)\n\t" in i8k_smm_func()
182 : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); in i8k_smm_func()
188 "movl 8(%%eax),%%ecx\n\t" in i8k_smm_func()
197 "movl %%ecx,8(%%eax)\n\t" in i8k_smm_func()
208 : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); in i8k_smm_func()
210 if (rc != 0 || (regs->eax & 0xffff) == 0xffff || regs->eax == eax) in i8k_smm_func()
211 rc = -EINVAL; in i8k_smm_func()
218 (rc ? 0xffff : regs->eax & 0xffff), duration); in i8k_smm_func()
246 return -EINVAL; in i8k_get_fan_status()
260 return -EINVAL; in i8k_get_fan_speed()
274 return -EINVAL; in _i8k_get_fan_type()
299 return -EINVAL; in i8k_get_fan_nominal_speed()
313 return -EINVAL; in i8k_enable_fan_auto_mode()
327 return -EINVAL; in i8k_set_fan()
364 # 1003655138 00000099 00003a80 <--- 0x99 = 153 degrees in i8k_get_temp()
372 * Return -ENODATA for all invalid temperatures. in i8k_get_temp()
380 return -ENODATA; in i8k_get_temp()
394 return regs.eax == 1145651527 && regs.edx == 1145392204 ? 0 : -1; in i8k_get_dell_signature()
451 return -EINVAL; in i8k_ioctl_unlocked()
457 return -EINVAL; in i8k_ioctl_unlocked()
465 return -EPERM; in i8k_ioctl_unlocked()
485 return -EFAULT; in i8k_ioctl_unlocked()
492 return -EFAULT; in i8k_ioctl_unlocked()
499 return -EPERM; in i8k_ioctl_unlocked()
502 return -EFAULT; in i8k_ioctl_unlocked()
505 return -EFAULT; in i8k_ioctl_unlocked()
511 return -EINVAL; in i8k_ioctl_unlocked()
520 return -EFAULT; in i8k_ioctl_unlocked()
525 return -EFAULT; in i8k_ioctl_unlocked()
530 return -EFAULT; in i8k_ioctl_unlocked()
566 ac_power = -1; in i8k_proc_show()
585 (restricted && !capable(CAP_SYS_ADMIN)) ? "-1" : bios_machineid, in i8k_proc_show()
645 int index = to_sensor_dev_attr(devattr)->index; in i8k_hwmon_temp_label_show()
652 type = ARRAY_SIZE(labels) - 1; in i8k_hwmon_temp_label_show()
660 int index = to_sensor_dev_attr(devattr)->index; in i8k_hwmon_temp_show()
666 return sprintf(buf, "%d\n", temp * 1000); in i8k_hwmon_temp_show()
681 int index = to_sensor_dev_attr(devattr)->index; in i8k_hwmon_fan_label_show()
695 type = (ARRAY_SIZE(labels) - 1); in i8k_hwmon_fan_label_show()
703 int index = to_sensor_dev_attr(devattr)->index; in i8k_hwmon_fan_show()
715 int index = to_sensor_dev_attr(devattr)->index; in i8k_hwmon_pwm_show()
720 return -EIO; in i8k_hwmon_pwm_show()
728 int index = to_sensor_dev_attr(attr)->index; in i8k_hwmon_pwm_store()
741 return err < 0 ? -EIO : count; in i8k_hwmon_pwm_store()
753 return -ENODEV; in i8k_hwmon_pwm_enable_store()
764 return -EINVAL; in i8k_hwmon_pwm_enable_store()
890 return attr->mode; in i8k_is_visible()
1222 return -ENODEV; in i8k_probe()
1255 return -ENODEV; in i8k_probe()
1263 if (id && id->driver_data) { in i8k_probe()
1264 const struct i8k_config_data *conf = id->driver_data; in i8k_probe()
1265 if (!fan_mult && conf->fan_mult) in i8k_probe()
1266 fan_mult = conf->fan_mult; in i8k_probe()
1267 if (!fan_max && conf->fan_max) in i8k_probe()
1268 fan_max = conf->fan_max; in i8k_probe()
1275 if (fan_control && fan_control->driver_data) { in i8k_probe()
1276 const struct i8k_fan_control_data *data = fan_control->driver_data; in i8k_probe()
1278 manual_fan = data->manual_fan; in i8k_probe()
1279 auto_fan = data->auto_fan; in i8k_probe()
1310 return -ENODEV; in i8k_init()