aboutsummaryrefslogtreecommitdiff
path: root/drivers/platform/x86/pmc_atom.c
AgeCommit message (Collapse)AuthorFilesLines
2024-03-12platform/x86: pmc_atom: Check state of PMC clocks on s2idleHans de Goede1-0/+11
Extend the s2idle check with checking that none of the PMC clocks is in the forced-on state. If one of the clocks is in forced on state then S0i3 cannot be reached. Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]>
2024-03-12platform/x86: pmc_atom: Check state of PMC managed devices on s2idleJohannes Stezenbach1-0/+68
For the Bay Trail or Cherry Trail SoC to enter the S0i3 power-level at s2idle suspend requires most of the hw-blocks / devices in the SoC to be in D3 when entering s2idle suspend. If some devices are not in D3 then the SoC will stay in a higher power state, consuming much more power from the battery then in S0i3. Use the new acpi_s2idle_dev_ops and acpi_register_lps0_dev() functionality to register a new s2idle check function which checks that all hardware blocks in the South complex (controlled by the PMC) are in a state that allows the SoC to enter S0i3 and prints an error message for any device in D0. Some blocks are not used on lower-featured versions of the SoC and these blocks will always report being in D0 on SoCs were they are not used. A false-positive mask is used to identify these blocks and for blocks in this mask the error is turned into a debug message to avoid false-positive error messages. Note the pmc_atom code is enabled by CONFIG_X86_INTEL_LPSS which already depends on ACPI. Signed-off-by: Johannes Stezenbach <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> [hdegoede: Use acpi_s2idle_dev_ops, ignore fused off blocks, PMIC I2C] Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]>
2022-08-25platform/x86: pmc_atom: Amend comment style and grammarAndy Shevchenko1-11/+8
The style of the comments is not uniform, make it so and fix a few grammar issues. While at it, update Copyright years. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-08-25platform/x86: pmc_atom: Make terminator entry uniformAndy Shevchenko1-11/+10
Make terminator entry uniform by dropping: - trailing commas - anything inside curly braces Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-08-25platform/x86: pmc_atom: Improve quirk message to be less crypticAndy Shevchenko1-1/+1
Not everyone can get what "critclks" means in the message, improve it to make less cryptic. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-08-25platform/x86: pmc_atom: Fix SLP_TYPx bitfield maskAndy Shevchenko1-1/+1
On Intel hardware the SLP_TYPx bitfield occupies bits 10-12 as per ACPI specification (see Table 4.13 "PM1 Control Registers Fixed Hardware Feature Control Bits" for the details). Fix the mask and other related definitions accordingly. Fixes: 93e5eadd1f6e ("x86/platform: New Intel Atom SOC power management controller driver") Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-07-28platform/x86: pmc_atom: Match all Lex BayTrail boards with critclk_systems ↵Hans de Goede1-12/+7
DMI table The critclk_systems[] DMI match table already contains 2 Lex BayTrail boards and patches were just submitted to add 3 more entries for the following models: 3I380NX, 3I380A, 3I380CW. Looking at: https://www.lex.com.tw/products/embedded-ipc-board/ we can see that Lex BayTrail makes many embedded boards with multiple ethernet boards and none of their products are battery powered so we don't need to worry (too much) about power consumption when suspended. Add a new DMI match which simply matches all Lex BayTrail boards and drop the 2 existing board specific quirks. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Reported-by: Michael Schöne <[email protected]> Reported-by: Paul Spooren <[email protected]> Reported-by: Matwey V. Kornilov <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-05-06platform/x86: pmc_atom: dont export pmc_atom_read - no modular usersPaul Gortmaker1-1/+0
There is only one user of pmc_atom_read in tree, and that is in drivers/acpi/acpi_lpss.c -- which can't be anything but built-in. As such there is no point in adding this function to the global symbol list exported to modules. Note that there is no <linux/export.h> include removal since the code was getting that header implicitly. Cc: Andy Shevchenko <[email protected]> Cc: Aubrey Li <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Mark Gross <[email protected]> Cc: [email protected] Signed-off-by: Paul Gortmaker <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-05-06platform/x86: pmc_atom: remove unused pmc_atom_write()Paul Gortmaker1-12/+0
This function isn't used anywhere in the driver or anywhere in tree. So remove it. It can always be re-added if/when a use arises. Cc: Andy Shevchenko <[email protected]> Cc: Aubrey Li <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Mark Gross <[email protected]> Cc: [email protected] Signed-off-by: Paul Gortmaker <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2021-12-23platform/x86: pmc_atom: improve critclk_systems matching for Siemens PCsHenning Schild1-21/+33
Siemens industrial PCs unfortunately can not always be properly identified the way we used to. An earlier commit introduced code that allows proper identification without looking at DMI strings that could differ based on product branding. Switch over to that proper way and revert commits that used to collect the machines based on unstable strings. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Fixes: e8796c6c69d1 ("platform/x86: pmc_atom: Add Siemens CONNECT ...") Fixes: f110d252ae79 ("platform/x86: pmc_atom: Add Siemens SIMATIC ...") Fixes: ad0d315b4d4e ("platform/x86: pmc_atom: Add Siemens SIMATIC ...") Tested-by: Michael Haener <[email protected]> Signed-off-by: Henning Schild <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2021-04-14platform/x86: pmc_atom: Match all Beckhoff Automation baytrail boards with ↵Steffen Dirkwinkel1-26/+2
critclk_systems DMI table pmc_plt_clk* clocks are used for ethernet controllers, so need to stay turned on. This adds the affected board family to critclk_systems DMI table, so the clocks are marked as CLK_CRITICAL and not turned off. This replaces the previously listed boards with a match for the whole device family CBxx63. CBxx63 matches only baytrail devices. There are new affected boards that would otherwise need to be listed. There are unaffected boards in the family, but having the clocks turned on is not an issue. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Steffen Dirkwinkel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2020-02-10platform/x86: pmc_atom: Add Lex 2I385SW to critclk_systems DMI tableGeorg Müller1-0/+8
The Lex 2I385SW board has two Intel I211 ethernet controllers. Without this patch, only the first port is usable. The second port fails to start with the following message: igb: probe of 0000:02:00.0 failed with error -2 Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Tested-by: Georg Müller <[email protected]> Signed-off-by: Georg Müller <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-01-06remove ioremap_nocache and devm_ioremap_nocacheChristoph Hellwig1-1/+1
ioremap has provided non-cached semantics by default since the Linux 2.6 days, so remove the additional ioremap_nocache interface. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2019-12-20platform/x86: pmc_atom: Add Siemens CONNECT X300 to critclk_systems DMI tableMichael Haener1-0/+8
The CONNECT X300 uses the PMC clock for on-board components and gets stuck during boot if the clock is disabled. Therefore, add this device to the critical systems list. Tested on CONNECT X300. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Signed-off-by: Michael Haener <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2019-09-20platform/x86: pmc_atom: Add Siemens SIMATIC IPC277E to critclk_systems DMI tableSrikanth Krishnakar1-0/+7
The SIMATIC IPC277E uses the PMC clock for on-board components and gets stuck during boot if the clock is disabled. Therefore, add this device to the critical systems list. Tested on SIMATIC IPC277E. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Reviewed-by: Jan Kiszka <[email protected]> Cc: Cedric Hombourger <[email protected]> Signed-off-by: Srikanth Krishnakar <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2019-09-07platform/x86: pmc_atom: Add Siemens SIMATIC IPC227E to critclk_systems DMI tableJan Kiszka1-0/+7
The SIMATIC IPC227E uses the PMC clock for on-board components and gets stuck during boot if the clock is disabled. Therefore, add this device to the critical systems list. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Signed-off-by: Jan Kiszka <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2019-07-14Merge tag 'platform-drivers-x86-v5.3-1' of ↵Linus Torvalds1-33/+18
git://git.infradead.org/linux-platform-drivers-x86 Pull x86 platform driver updates from Andy Shevchenko: "Gathered a bunch of x86 platform driver changes. It's rather big, since includes two big refactors and completely new driver: - ASUS WMI driver got a big refactoring in order to support the TUF Gaming laptops. Besides that, the regression with backlight being permanently off on various EeePC laptops has been fixed. - Accelerometer on HP ProBook 450 G0 shows wrong measurements due to X axis being inverted. This has been fixed. - Intel PMC core driver has been extended to be ACPI enumerated if the DSDT provides device with _HID "INT33A1". This allows to convert the driver to be pure platform and support new hardware purely based on ACPI DSDT. - From now on the Intel Speed Select Technology is supported thru a corresponding driver. This driver provides an access to the features of the ISST, such as Performance Profile, Core Power, Base frequency and Turbo Frequency. - Mellanox platform drivers has been refactored and now extended to support more systems, including new coming ones. - The OLPC XO-1.75 platform is now supported. - CB4063 Beckhoff Automation board is using PMC clocks, provided via pmc_atom driver, for ethernet controllers in a way that they can't be managed by the clock driver. The quirk has been extended to cover this case. - Touchscreen on Chuwi Hi10 Plus tablet has been enabled. Meanwhile the information of Chuwi Hi10 Air has been fixed to cover more models based on the same platform. - Xiaomi notebooks have WMI interface enabled. Thus, the driver to support it has been provided. It required some extension of the generic WMI library, which allows to propagate opaque context to the ->probe() of the individual drivers. This release includes debugfs clean up from Greg KH for several drivers that drop return code check and make debugfs absence or failure non-fatal. Also miscellaneous fixes here and there, mostly for Acer WMI and various Intel drivers" * tag 'platform-drivers-x86-v5.3-1' of git://git.infradead.org/linux-platform-drivers-x86: (74 commits) platform/x86: Fix PCENGINES_APU2 Kconfig warning tools/power/x86/intel-speed-select: Add .gitignore file platform/x86: mlx-platform: Fix error handling in mlxplat_init() platform/x86: intel_pmc_core: Attach using APCI HID "INT33A1" platform/x86: intel_pmc_core: transform Pkg C-state residency from TSC ticks into microseconds platform/x86: asus-wmi: Use dev_get_drvdata() Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces platform/x86: mlx-platform: Add more reset cause attributes platform/x86: mlx-platform: Modify DMI matching order platform/x86: mlx-platform: Add regmap structure for the next generation systems platform/x86: mlx-platform: Change API for i2c-mlxcpld driver activation platform/x86: mlx-platform: Move regmap initialization before all drivers activation MAINTAINERS: Update for Intel Speed Select Technology tools/power/x86: A tool to validate Intel Speed Select commands platform/x86: ISST: Restore state on resume platform/x86: ISST: Add Intel Speed Select PUNIT MSR interface platform/x86: ISST: Add Intel Speed Select mailbox interface via MSRs platform/x86: ISST: Add Intel Speed Select mailbox interface via PCI platform/x86: ISST: Add Intel Speed Select mmio interface platform/x86: ISST: Add IOCTL to Translate Linux logical CPU to PUNIT CPU number ...
2019-06-29platform/x86: pmc_atom: Add CB4063 Beckhoff Automation board to ↵Steffen Dirkwinkel1-0/+8
critclk_systems DMI table The CB4063 board uses pmc_plt_clk* clocks for ethernet controllers. This adds it to the critclk_systems DMI table so the clocks are marked as CLK_CRITICAL and not turned off. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Signed-off-by: Steffen Dirkwinkel <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2019-06-17platform/x86: pmc_atom: no need to check return value of debugfs_create ↵Greg Kroah-Hartman1-33/+10
functions When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Darren Hart <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288Thomas Gleixner1-10/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms and conditions of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 263 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Alexios Zavras <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-20platform/x86: pmc_atom: Add several Beckhoff Automation boards to ↵Steffen Dirkwinkel1-0/+24
critclk_systems DMI table There are several Beckhoff Automation industrial PC boards which use pmc_plt_clk* clocks for ethernet controllers. This adds affected boards to critclk_systems DMI table so the clocks are marked as CLK_CRITICAL and not turned off. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Signed-off-by: Steffen Dirkwinkel <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2019-05-20platform/x86: pmc_atom: Add Lex 3I380D industrial PC to critclk_systems DMI ↵Hans de Goede1-0/+9
table The Lex 3I380D industrial PC has 4 ethernet controllers on board which need pmc_plt_clk0 - 3 to function, add it to the critclk_systems DMI table, so that drivers/clk/x86/clk-pmc-atom.c will mark the clocks as CLK_CRITICAL and they will not get turned off. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Reported-and-tested-by: Semyon Verchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2019-04-11platform/x86: pmc_atom: Drop __initconst on dmi tableStephen Boyd1-1/+1
It's used by probe and that isn't an init function. Drop this so that we don't get a section mismatch. Reported-by: kbuild test robot <[email protected]> Cc: David Müller <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Andy Shevchenko <[email protected]> Fixes: 7c2e07130090 ("clk: x86: Add system specific quirk to mark clocks as critical") Signed-off-by: Stephen Boyd <[email protected]>
2019-04-10clk: x86: Add system specific quirk to mark clocks as criticalDavid Müller1-0/+21
Since commit 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL"), the pmc_plt_clocks of the Bay Trail SoC are unconditionally gated off. Unfortunately this will break systems where these clocks are used for external purposes beyond the kernel's knowledge. Fix it by implementing a system specific quirk to mark the necessary pmc_plt_clks as critical. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Signed-off-by: David Müller <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2018-02-07seq_file: Introduce DEFINE_SHOW_ATTRIBUTE() helper macroAndy Shevchenko1-14/+0
The DEFINE_SHOW_ATTRIBUTE() helper macro would be useful for current users, which are many of them, and for new comers to decrease code duplication. Acked-by: Lee Jones <[email protected]> Acked-by: Darren Hart (VMware) <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2017-12-21platform/x86: pmc_atom: introduce DEFINE_SHOW_ATTRIBUTE() macroAndy Shevchenko1-36/+20
This macro deduplicates a lot of similar code in the pmc_atom.c module. Targeting to be moved to seq_file.h eventually. Signed-off-by: Andy Shevchenko <[email protected]>
2017-01-26platform/x86: Enable Atom PMC platform clocksIrina Tirdea1-3/+76
The BayTrail and CherryTrail platforms provide platform clocks through their Power Management Controller (PMC). The SoC supports up to 6 clocks (PMC_PLT_CLK[0..5]) with a frequency of either 19.2 MHz (PLL) or 25 MHz (XTAL) for BayTrail and a frequency of 19.2 MHz (XTAL) for CherryTrail. These clocks are available for general system use, where appropriate. For example, the usage for platform clocks suggested in the datasheet is the following: PLT_CLK[0..2] - Camera PLT_CLK[3] - Audio Codec PLT_CLK[4] - PLT_CLK[5] - COMMs Signed-off-by: Irina Tirdea <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
2017-01-26arch/x86/platform/atom: Move pmc_atom to drivers/platform/x86Irina Tirdea1-0/+459
The pmc_atom driver does not contain any architecture specific code. It only enables the SoC Power Management Controller driver for BayTrail and CherryTrail platforms. Move the pmc_atom driver from arch/x86/platform/atom to drivers/platform/x86. Also clean-up and reorder include files by alphabetical order in pmc_atom.h Signed-off-by: Irina Tirdea <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>