Skip to content

Commit 7a6226d

Browse files
spandruvadarafaeljw
authored andcommitted
ACPI: DPTF: Add new PCH FIVR methods
Some additional information is required for updating PCH FIVR values upon WiFi channel changes. New attributes added to the existing sysfs: fivr_switching_freq_mhz : Get the FIVR switching control frequency. Uses ACPI method GFCS. fivr_switching_fault_status: Read the FIVR switching frequency control fault status. Uses ACPI method GFFS. ssc_clock_info : Presents SSC (spread spectrum clock) information for EMI (Electro magnetic interference) control. Use ACPI method GEMI (refer to the description of GEMI method below). GFFS This ACPI method is used to read the FIVR switching frequency control fault status. Bits Description [0:0] Fault status when set to 1 [31:1] Reserved GFCS This ACPI method is used to read the FIVR switching control frequency. Bits Description [11:0] Actual Frequency = value * XTAL_FREQ / 128 [31:12] Reserved GEMI This ACPI method is used to read the programmed register value for EMI (Electro magnetic interference) control. Bits Description [7:0] Sets clock spectrum spread percentage: 0x00=0.2% , 0x3F=10% 1 LSB = 0.1% increase in spread (for settings 0x01 thru 0x1C) 1 LSB = 0.2% increase in spread (for settings 0x1E thru 0x3F) [8] When set to 1, enables spread spectrum clock [9] 0: Triangle mode. FFC frequency walks around the Fcenter in a linear fashion 1: Random walk mode. FFC frequency changes randomly within the SSC (Spread spectrum clock) range [10] 0: No white noise. 1: Add white noise to spread waveform [11] When 1, future writes are ignored. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent c500bee commit 7a6226d

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

Documentation/ABI/testing/sysfs-platform-dptf

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,43 @@ Contact: [email protected]
111111
Description:
112112
(RW) The PCH FIVR (Fully Integrated Voltage Regulator) switching frequency in MHz,
113113
when FIVR clock is 38.4MHz.
114+
115+
What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/fivr_switching_freq_mhz
116+
Date: September, 2021
117+
KernelVersion: v5.15
118+
119+
Description:
120+
(RO) Get the FIVR switching control frequency in MHz.
121+
122+
What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/fivr_switching_fault_status
123+
Date: September, 2021
124+
KernelVersion: v5.15
125+
126+
Description:
127+
(RO) Read the FIVR switching frequency control fault status.
128+
129+
What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/ssc_clock_info
130+
Date: September, 2021
131+
KernelVersion: v5.15
132+
133+
Description:
134+
(RO) Presents SSC (spread spectrum clock) information for EMI
135+
(Electro magnetic interference) control. This is a bit mask.
136+
Bits Description
137+
[7:0] Sets clock spectrum spread percentage:
138+
0x00=0.2% , 0x3F=10%
139+
1 LSB = 0.1% increase in spread (for
140+
settings 0x01 thru 0x1C)
141+
1 LSB = 0.2% increase in spread (for
142+
settings 0x1E thru 0x3F)
143+
[8] When set to 1, enables spread
144+
spectrum clock
145+
[9] 0: Triangle mode. FFC frequency
146+
walks around the Fcenter in a linear
147+
fashion
148+
1: Random walk mode. FFC frequency
149+
changes randomly within the SSC
150+
(Spread spectrum clock) range
151+
[10] 0: No white noise. 1: Add white noise
152+
to spread waveform
153+
[11] When 1, future writes are ignored.

drivers/acpi/dptf/dptf_pch_fivr.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,24 @@ static ssize_t name##_store(struct device *dev,\
9090

9191
PCH_FIVR_SHOW(freq_mhz_low_clock, GFC0)
9292
PCH_FIVR_SHOW(freq_mhz_high_clock, GFC1)
93+
PCH_FIVR_SHOW(ssc_clock_info, GEMI)
94+
PCH_FIVR_SHOW(fivr_switching_freq_mhz, GFCS)
95+
PCH_FIVR_SHOW(fivr_switching_fault_status, GFFS)
9396
PCH_FIVR_STORE(freq_mhz_low_clock, RFC0)
9497
PCH_FIVR_STORE(freq_mhz_high_clock, RFC1)
9598

9699
static DEVICE_ATTR_RW(freq_mhz_low_clock);
97100
static DEVICE_ATTR_RW(freq_mhz_high_clock);
101+
static DEVICE_ATTR_RO(ssc_clock_info);
102+
static DEVICE_ATTR_RO(fivr_switching_freq_mhz);
103+
static DEVICE_ATTR_RO(fivr_switching_fault_status);
98104

99105
static struct attribute *fivr_attrs[] = {
100106
&dev_attr_freq_mhz_low_clock.attr,
101107
&dev_attr_freq_mhz_high_clock.attr,
108+
&dev_attr_ssc_clock_info.attr,
109+
&dev_attr_fivr_switching_freq_mhz.attr,
110+
&dev_attr_fivr_switching_fault_status.attr,
102111
NULL
103112
};
104113

0 commit comments

Comments
 (0)