linux-stable/drivers/acpi
Srinivas Pandruvada bea2d9868e ACPI: fan: Properly handle fine grain control
When _FIF object specifies support for fine grain control, then fan speed
can be set from 0 to 100% with the recommended minimum "step size" via
_FSL object. Here the control value doesn't need to match any value from
_FPS object.

Currently we have a simple solution implemented which just pick maximum
control value from _FPS to display the actual state, but this is not
optimal when there is a big window between two control values in
_FPS. Also there is no way to set to any speed which doesn't match
control values in _FPS. The system firmware can start the fan at speed
which doesn't match any control value.

To support fine grain control (when supported) via thermal sysfs:
- cooling device max state is not _FPS state count but it will be
100 / _FIF.step_size
Step size can be from 1 to 9.
- cooling device current state is _FST.control / _FIF.step_size
- cooling device set state will set the control value
cdev.curr_state * _FIF.step_size plus any adjustment for 100%.
By the spec, when control value do not sum to 100% because of
_FIF.step_size, OSPM may select an appropriate ending Level increment
to reach 100%.

There is no rounding during calculation. For example if step size
is 6:
thermal sysfs cooling device max_state = 100/6 = 16
So user can set any value from 0-16.

If the system boots with a _FST.control which is not multiples
of step_size, the thermal sysfs cur_state will be based on the
range. For example for step size = 6:
_FST.control	thermal sysfs cur_state
------------------------------------------------
0-5		0
6-11		1
..
..
90-95		15
96-100		16

While setting the _FST.control, the compensation will be at
the last step for cur_state = 16, which will set the _FST.control
to 100.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2022-02-25 20:49:29 +01:00
..
acpica ACPICA: Fixed a couple of warnings under MSVC 2021-12-27 17:01:28 +01:00
apei x86/sgx: Add check for SGX pages to ghes_do_memory_failure() 2021-11-15 11:13:16 -08:00
arm64 ACPI/IORT: Check node revision for PMCG resources 2022-02-09 18:16:22 +00:00
dptf ACPI: DPTF: Support Raptor Lake 2022-01-17 19:45:38 +01:00
nfit ACPI: NFIT: Import GUID before use 2021-12-18 08:12:40 -08:00
numa cxl for 5.17 2022-01-12 15:57:59 -08:00
pmic ACPI: PMIC: xpower: Fix _TMP ACPI errors 2021-12-08 15:34:57 +01:00
x86 ACPI: PM: Revert "Only mark EC GPE for wakeup on Intel systems" 2022-02-07 21:02:31 +01:00
ac.c ACPI / x86: Introduce an acpi_quirk_skip_acpi_ac_and_battery() helper 2022-01-04 15:40:48 +01:00
acpi_adxl.c
acpi_amba.c ACPI: AMBA: Fix resource name in /proc/iomem 2021-06-30 20:01:10 +02:00
acpi_apd.c More ACPI updates for 5.17-rc1 2022-01-18 08:51:51 +02:00
acpi_cmos_rtc.c ACPI: cmos_rtc: Using pr_fmt() and remove PREFIX 2021-06-07 15:36:45 +02:00
acpi_configfs.c ACPI: configfs: Make get_header() to return error pointer 2021-07-16 19:20:28 +02:00
acpi_dbg.c
acpi_extlog.c
acpi_fpdt.c ACPI: tables: FPDT: Do not print FW_BUG message if record types are reserved 2021-08-25 20:01:07 +02:00
acpi_ipmi.c ACPI: ipmi: Remove address space handler in error path 2021-05-24 16:27:34 +02:00
acpi_lpat.c
acpi_lpit.c
acpi_lpss.c Merge branches 'acpi-glue', 'acpi-pnp', 'acpi-processor' and 'acpi-soc' 2021-11-02 18:36:40 +01:00
acpi_memhotplug.c ACPI: memhotplug: use a single static memory group for a single memory device 2021-09-08 11:50:23 -07:00
acpi_pad.c ACPI: processor: Replace deprecated CPU-hotplug functions 2021-08-04 20:25:54 +02:00
acpi_pcc.c ACPI: PCC: pcc_ctx can be static 2022-01-12 19:40:31 +01:00
acpi_platform.c
acpi_pnp.c ACPI: PNP: remove duplicated BRI0A49 and BDP3336 entries 2021-09-24 18:12:15 +02:00
acpi_processor.c ACPI: processor: Replace deprecated CPU-hotplug functions 2021-08-04 20:25:54 +02:00
acpi_tad.c
acpi_video.c ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device() 2021-12-17 18:45:51 +01:00
acpi_watchdog.c
battery.c Merge branches 'acpi-tables', 'acpi-numa', 'acpi-sysfs', 'acpi-cppc', 'acpi-thermal' and 'acpi-battery' 2022-01-10 17:22:15 +01:00
bgrt.c ACPI: bgrt: Use sysfs_emit 2021-06-23 19:27:50 +02:00
blacklist.c ACPI: blacklist: Unify the message printing 2021-06-07 15:36:45 +02:00
bus.c USB/Thunderbolt changes for 5.17-rc1 2022-01-12 11:27:57 -08:00
button.c ACPI: button: Add DMI quirk for Lenovo Yoga 9 (14INTL5) 2021-08-25 19:57:01 +02:00
container.c
cppc_acpi.c ACPI: CPPC: Drop redundant local variable from cpc_read() 2022-01-17 19:38:55 +01:00
custom_method.c ACPI: custom_method: fix a possible memory leak 2021-04-28 19:17:54 +02:00
debugfs.c
device_pm.c ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device() 2021-12-17 18:45:51 +01:00
device_sysfs.c ACPI: sysfs: use default_groups in kobj_type 2021-12-28 19:15:41 +01:00
dock.c ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device() 2021-12-17 18:45:51 +01:00
ec.c ACPI: PM: s2idle: Cancel wakeup before dispatching EC GPE 2022-02-07 21:02:31 +01:00
ec_sys.c ACPI: EC: Mark the ec_sys write_support param as module_param_hw() 2021-12-01 20:19:30 +01:00
event.c Merge branches 'acpi-ec', 'acpi-apei', 'acpi-soc' and 'acpi-misc' 2021-06-29 15:51:25 +02:00
evged.c
fan.h ACPI: fan: Properly handle fine grain control 2022-02-25 20:49:29 +01:00
fan_attr.c ACPI: fan: Separate file for attributes creation 2022-02-25 20:49:29 +01:00
fan_core.c ACPI: fan: Properly handle fine grain control 2022-02-25 20:49:29 +01:00
glue.c Revert "ACPI: scan: Release PM resources blocked by unused objects" 2021-11-17 17:05:41 +01:00
hed.c ACPI: HED: Drop unused ACPI_MODULE_NAME() definition 2021-03-08 16:51:48 +01:00
internal.h ACPI: scan: Change acpi_scan_init() return value type to void 2022-01-12 15:58:49 +01:00
ioapic.c
irq.c ACPI: irq: Prevent unregistering of GIC SGIs 2021-04-23 18:00:52 +01:00
Kconfig ACPI: require CRC32 to build 2022-01-31 20:16:28 +01:00
Makefile ACPI: fan: Separate file for attributes creation 2022-02-25 20:49:29 +01:00
nvs.c Merge branches 'acpi-ec', 'acpi-apei', 'acpi-soc' and 'acpi-misc' 2021-06-29 15:51:25 +02:00
osi.c
osl.c Revert "ACPI: Add memory semantics to acpi_os_map_memory()" 2021-09-23 20:39:36 +02:00
pci_irq.c ACPI: PCI: IRQ: Consolidate printing diagnostic messages 2021-03-08 16:51:08 +01:00
pci_link.c ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device() 2021-12-17 18:45:51 +01:00
pci_mcfg.c PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata 2021-04-16 11:34:17 -05:00
pci_root.c Merge branches 'acpi-scan', 'acpi-pm', 'acpi-power' and 'acpi-pci' 2022-01-10 16:48:27 +01:00
pci_slot.c
pfr_telemetry.c ACPI: pfr_telemetry: Fix info leak in pfrt_log_ioctl() 2022-01-10 16:36:45 +01:00
pfr_update.c ACPI: pfr_update: Fix return value check in pfru_write() 2022-01-06 18:53:31 +01:00
platform_profile.c ACPI: platform-profile: call sysfs_notify() from platform_profile_store() 2021-08-16 18:32:02 +02:00
power.c Merge branches 'acpi-scan', 'acpi-pm', 'acpi-power' and 'acpi-pci' 2022-01-10 16:48:27 +01:00
pptt.c topology: Represent clusters of CPUs within a die 2021-10-15 11:25:15 +02:00
prmt.c ACPI: PRM: Handle memory allocation and memory remap failure 2021-10-26 15:29:07 +02:00
proc.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
processor_core.c
processor_driver.c ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device() 2021-12-17 18:45:51 +01:00
processor_idle.c ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40 2022-02-16 18:17:16 +01:00
processor_pdc.c ACPI: processor: Get rid of ACPICA message printing 2021-03-08 16:51:19 +01:00
processor_perflib.c ACPI: processor_perflib: Cleanup print messages 2021-06-07 15:36:46 +02:00
processor_thermal.c ACPI: processor: thermal: avoid cpufreq_get_policy() 2021-12-30 19:39:34 +01:00
processor_throttling.c Merge branches 'acpi-dptf' and 'acpi-messages' 2021-06-29 15:50:37 +02:00
property.c Merge branches 'acpi-scan', 'acpi-pm', 'acpi-power' and 'acpi-pci' 2022-01-10 16:48:27 +01:00
reboot.c ACPI: reboot: Unify the message printing 2021-06-07 15:36:46 +02:00
resource.c ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device() 2021-12-17 18:45:51 +01:00
sbs.c ACPI: sbs: Unify the message printing 2021-06-07 15:36:46 +02:00
sbshc.c Merge branches 'acpi-ec', 'acpi-apei', 'acpi-soc' and 'acpi-misc' 2021-06-29 15:51:25 +02:00
sbshc.h
scan.c More ACPI updates for 5.17-rc1 2022-01-18 08:51:51 +02:00
sleep.c PM: s2idle: ACPI: Fix wakeup interrupts handling 2022-02-07 21:02:31 +01:00
sleep.h Revert "Revert "ACPI: scan: Turn off unused power resources during initialization"" 2021-05-10 14:02:17 +02:00
spcr.c ACPI: SPCR: check if table->serial_port.access_width is too wide 2022-01-11 16:39:14 +01:00
sysfs.c ACPI: sysfs: use default_groups in kobj_type 2021-12-28 19:15:41 +01:00
tables.c ACPI: tables: Quiet ACPI table not found warning 2022-02-15 20:03:16 +01:00
thermal.c Merge branches 'acpi-tables', 'acpi-numa', 'acpi-sysfs', 'acpi-cppc', 'acpi-thermal' and 'acpi-battery' 2022-01-10 17:22:15 +01:00
tiny-power-button.c
utils.c ACPI: utils: Fix reference counting in for_each_acpi_dev_match() 2021-07-19 16:22:01 +02:00
video_detect.c ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device() 2021-12-17 18:45:51 +01:00
viot.c ACPI: Add driver for the VIOT table 2021-06-25 15:02:43 +02:00
wakeup.c