- Update the core device enumeration code to make it more internally consistent and robust and drop the force_remove sysfs attribute that could be used to tell it to ignore errors on device hot-removal which was dangerous in general and no real and still relevant use cases for it could be found (Rafael Wysocki, Michal Hocko). - Make the core device enumeration code use _PXM to associate platform devices created by it with specific NUMA nodes (Shanker Donthineni). - Extend the CPPC library by adding more sysfs entries for performance capabilities to it and making it use the lowest nonlinear performance parameter (Prashanth Prakash). - Make the CPU online more consistent with CPU initialization in the ACPI processor driver (Prashanth Prakash). - Update the AC and battery drivers to help them avoid attaching to devices that cannot be handled by them and update the axp288_charger power supply driver to work correctly on ACPI systems without the INT3496 device (Hans de Goede). - Add an ACPI operation region driver for the Intel CHT Whiskey Cove PMIC and update the xpower operation region driver to work without IIO which isn't really necessary for it to work (Hans de Goede). - Add a new entry for Dell Inspiron 7537 to the _REV quirk blacklist (Kai Heng Feng). - Make the code in the ACPI video driver easier to follow by adding symbols and comments to it (Dmitry Frank). - Update ACPI documentation and drop a function that has no users from the tables-handling code (Cao jin, Baoquan He). -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJZB5h0AAoJEILEb/54YlRx8+EP/j468sN7PEBDXZLF1jsIJK6g IozbOMAAVXBwDrfTOLYSVe3KOUJH0tVdax768tv6Gu94jbUT+nPeSNNDTaWbOpli fi/f6ljSupWzh/TLjIBVAbNuEULcxB6AcMg0fxMRutIQUbr7ie6ioJ1R4UoMRrV8 HFdlsHiHa9uUMSDuwByzjzQX+TRAvseyBvkLxUlMMwJQ3+/+yH2FoGRmjzS0ZLAC lTyzcAasznrGsqlDoFunNegoBFkgnJv5vJ7fVfujQb5irpX51iog6aNehLRt3GwX opRlNjFIYk3XTSTR2QvV/utUrWuPYKJwkCulnlyACoWCmsYGbt115iEWY0YNVV71 tmHRK/TkbYHSg4H/Tgc4i1bMvWM4GOULq3NaltxfQA31O8s++02zL7HxblA763AP 4TmofNDTW3pF7GZ5DxtysXCCURdShj7y8ta4K+A0l4g6iCaTHLzFNlEJp2WSL6xo LFg/VvAHFnF34OlDobKlm8hB53thHGd0UD0dnY4hwiwpsTwlc/e5pxgIpKEkw1/L aO3VxIMtzVG93cno7JM7/6kWy2Qcnk2VqoPFiQPaB60QKfyKjBKCRYVeUVesrHrE 443MoJS3KmsenPSD7ACpW6yKmGP3p+3CKakdvE3C09XNToq98+3W0lsU5NP9ys94 m75frKXPSt9EAUqjsJ0Z =IwcL -----END PGP SIGNATURE----- Merge tag 'acpi-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "These are some device enumeration code changes, updates of the AC and battery drivers to help them avoid attaching to devices that cannot be handled by them, new operation region driver for the Intel CHT Whiskey Cove PMIC, new sysfs entries for CPPC performance capabilities, a new _REV quirk blacklist entry and a couple of assorted minor fixes and cleanups. Specifics: - Update the core device enumeration code to make it more internally consistent and robust and drop the force_remove sysfs attribute that could be used to tell it to ignore errors on device hot-removal which was dangerous in general and no real and still relevant use cases for it could be found (Rafael Wysocki, Michal Hocko). - Make the core device enumeration code use _PXM to associate platform devices created by it with specific NUMA nodes (Shanker Donthineni). - Extend the CPPC library by adding more sysfs entries for performance capabilities to it and making it use the lowest nonlinear performance parameter (Prashanth Prakash). - Make the CPU online more consistent with CPU initialization in the ACPI processor driver (Prashanth Prakash). - Update the AC and battery drivers to help them avoid attaching to devices that cannot be handled by them and update the axp288_charger power supply driver to work correctly on ACPI systems without the INT3496 device (Hans de Goede). - Add an ACPI operation region driver for the Intel CHT Whiskey Cove PMIC and update the xpower operation region driver to work without IIO which isn't really necessary for it to work (Hans de Goede). - Add a new entry for Dell Inspiron 7537 to the _REV quirk blacklist (Kai Heng Feng). - Make the code in the ACPI video driver easier to follow by adding symbols and comments to it (Dmitry Frank). - Update ACPI documentation and drop a function that has no users from the tables-handling code (Cao jin, Baoquan He)" * tag 'acpi-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / PMIC: Stop xpower OPRegion handler relying on IIO ACPI / PMIC: Add opregion driver for Intel CHT Whiskey Cove PMIC ACPI / scan: Avoid enumerating devices more than once ACPI / scan: Apply default enumeration to devices with ACPI drivers power: supply: axp288_charger: Only wait for INT3496 device if present ACPI / AC: Add a blacklist with PMIC ACPI HIDs with a native charger driver ACPI / battery: Add a blacklist with PMIC ACPI HIDs with a native battery driver ACPI / battery: Fix acpi_battery_exit on acpi_battery_init_async errors ACPI / utils: Add new acpi_dev_present helper ACPI / video: add comments about subtle cases ACPI / video: get rid of magic numbers and use enum instead ACPI / doc: linuxized-acpica.txt: fix typos ACPI / blacklist: add _REV quirk for Dell Inspiron 7537 ACPI / tables: Drop acpi_parse_entries() which is not used ACPI / CPPC: add sysfs entries for CPPC perf capabilities ACPI / CPPC: Read lowest nonlinear perf in cppc_get_perf_caps() ACPI / platform: Update platform device NUMA node based on _PXM method ACPI / Processor: Drop setup_max_cpus check from acpi_processor_add() ACPI / scan: Drop support for force_removetirimbino
commit
08be881064
@ -0,0 +1,8 @@ |
||||
What: /sys/firmware/acpi/hotplug/force_remove |
||||
Date: Mar 2017 |
||||
Contact: Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
||||
Description: |
||||
Since the force_remove is inherently broken and dangerous to |
||||
use for some hotplugable resources like memory (because ignoring |
||||
the offline failure might lead to memory corruption and crashes) |
||||
enabling this knob is not safe and thus unsupported. |
@ -0,0 +1,280 @@ |
||||
/*
|
||||
* Intel CHT Whiskey Cove PMIC operation region driver |
||||
* Copyright (C) 2017 Hans de Goede <hdegoede@redhat.com> |
||||
* |
||||
* Based on various non upstream patches to support the CHT Whiskey Cove PMIC: |
||||
* Copyright (C) 2013-2015 Intel Corporation. All rights reserved. |
||||
* |
||||
* This program is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU General Public License version |
||||
* 2 as published by the Free Software Foundation. |
||||
* |
||||
* This program is distributed in the hope that 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. |
||||
*/ |
||||
|
||||
#include <linux/acpi.h> |
||||
#include <linux/init.h> |
||||
#include <linux/mfd/intel_soc_pmic.h> |
||||
#include <linux/platform_device.h> |
||||
#include <linux/regmap.h> |
||||
#include "intel_pmic.h" |
||||
|
||||
#define CHT_WC_V1P05A_CTRL 0x6e3b |
||||
#define CHT_WC_V1P15_CTRL 0x6e3c |
||||
#define CHT_WC_V1P05A_VSEL 0x6e3d |
||||
#define CHT_WC_V1P15_VSEL 0x6e3e |
||||
#define CHT_WC_V1P8A_CTRL 0x6e56 |
||||
#define CHT_WC_V1P8SX_CTRL 0x6e57 |
||||
#define CHT_WC_VDDQ_CTRL 0x6e58 |
||||
#define CHT_WC_V1P2A_CTRL 0x6e59 |
||||
#define CHT_WC_V1P2SX_CTRL 0x6e5a |
||||
#define CHT_WC_V1P8A_VSEL 0x6e5b |
||||
#define CHT_WC_VDDQ_VSEL 0x6e5c |
||||
#define CHT_WC_V2P8SX_CTRL 0x6e5d |
||||
#define CHT_WC_V3P3A_CTRL 0x6e5e |
||||
#define CHT_WC_V3P3SD_CTRL 0x6e5f |
||||
#define CHT_WC_VSDIO_CTRL 0x6e67 |
||||
#define CHT_WC_V3P3A_VSEL 0x6e68 |
||||
#define CHT_WC_VPROG1A_CTRL 0x6e90 |
||||
#define CHT_WC_VPROG1B_CTRL 0x6e91 |
||||
#define CHT_WC_VPROG1F_CTRL 0x6e95 |
||||
#define CHT_WC_VPROG2D_CTRL 0x6e99 |
||||
#define CHT_WC_VPROG3A_CTRL 0x6e9a |
||||
#define CHT_WC_VPROG3B_CTRL 0x6e9b |
||||
#define CHT_WC_VPROG4A_CTRL 0x6e9c |
||||
#define CHT_WC_VPROG4B_CTRL 0x6e9d |
||||
#define CHT_WC_VPROG4C_CTRL 0x6e9e |
||||
#define CHT_WC_VPROG4D_CTRL 0x6e9f |
||||
#define CHT_WC_VPROG5A_CTRL 0x6ea0 |
||||
#define CHT_WC_VPROG5B_CTRL 0x6ea1 |
||||
#define CHT_WC_VPROG6A_CTRL 0x6ea2 |
||||
#define CHT_WC_VPROG6B_CTRL 0x6ea3 |
||||
#define CHT_WC_VPROG1A_VSEL 0x6ec0 |
||||
#define CHT_WC_VPROG1B_VSEL 0x6ec1 |
||||
#define CHT_WC_V1P8SX_VSEL 0x6ec2 |
||||
#define CHT_WC_V1P2SX_VSEL 0x6ec3 |
||||
#define CHT_WC_V1P2A_VSEL 0x6ec4 |
||||
#define CHT_WC_VPROG1F_VSEL 0x6ec5 |
||||
#define CHT_WC_VSDIO_VSEL 0x6ec6 |
||||
#define CHT_WC_V2P8SX_VSEL 0x6ec7 |
||||
#define CHT_WC_V3P3SD_VSEL 0x6ec8 |
||||
#define CHT_WC_VPROG2D_VSEL 0x6ec9 |
||||
#define CHT_WC_VPROG3A_VSEL 0x6eca |
||||
#define CHT_WC_VPROG3B_VSEL 0x6ecb |
||||
#define CHT_WC_VPROG4A_VSEL 0x6ecc |
||||
#define CHT_WC_VPROG4B_VSEL 0x6ecd |
||||
#define CHT_WC_VPROG4C_VSEL 0x6ece |
||||
#define CHT_WC_VPROG4D_VSEL 0x6ecf |
||||
#define CHT_WC_VPROG5A_VSEL 0x6ed0 |
||||
#define CHT_WC_VPROG5B_VSEL 0x6ed1 |
||||
#define CHT_WC_VPROG6A_VSEL 0x6ed2 |
||||
#define CHT_WC_VPROG6B_VSEL 0x6ed3 |
||||
|
||||
/*
|
||||
* Regulator support is based on the non upstream patch: |
||||
* "regulator: whiskey_cove: implements Whiskey Cove pmic VRF support" |
||||
* https://github.com/intel-aero/meta-intel-aero/blob/master/recipes-kernel/linux/linux-yocto/0019-regulator-whiskey_cove-implements-WhiskeyCove-pmic-V.patch
|
||||
*/ |
||||
static struct pmic_table power_table[] = { |
||||
{ |
||||
.address = 0x0, |
||||
.reg = CHT_WC_V1P8A_CTRL, |
||||
.bit = 0x01, |
||||
}, /* V18A */ |
||||
{ |
||||
.address = 0x04, |
||||
.reg = CHT_WC_V1P8SX_CTRL, |
||||
.bit = 0x07, |
||||
}, /* V18X */ |
||||
{ |
||||
.address = 0x08, |
||||
.reg = CHT_WC_VDDQ_CTRL, |
||||
.bit = 0x01, |
||||
}, /* VDDQ */ |
||||
{ |
||||
.address = 0x0c, |
||||
.reg = CHT_WC_V1P2A_CTRL, |
||||
.bit = 0x07, |
||||
}, /* V12A */ |
||||
{ |
||||
.address = 0x10, |
||||
.reg = CHT_WC_V1P2SX_CTRL, |
||||
.bit = 0x07, |
||||
}, /* V12X */ |
||||
{ |
||||
.address = 0x14, |
||||
.reg = CHT_WC_V2P8SX_CTRL, |
||||
.bit = 0x07, |
||||
}, /* V28X */ |
||||
{ |
||||
.address = 0x18, |
||||
.reg = CHT_WC_V3P3A_CTRL, |
||||
.bit = 0x01, |
||||
}, /* V33A */ |
||||
{ |
||||
.address = 0x1c, |
||||
.reg = CHT_WC_V3P3SD_CTRL, |
||||
.bit = 0x07, |
||||
}, /* V3SD */ |
||||
{ |
||||
.address = 0x20, |
||||
.reg = CHT_WC_VSDIO_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VSD */ |
||||
/* {
|
||||
.address = 0x24, |
||||
.reg = ??, |
||||
.bit = ??, |
||||
}, ** VSW2 */ |
||||
/* {
|
||||
.address = 0x28, |
||||
.reg = ??, |
||||
.bit = ??, |
||||
}, ** VSW1 */ |
||||
/* {
|
||||
.address = 0x2c, |
||||
.reg = ??, |
||||
.bit = ??, |
||||
}, ** VUPY */ |
||||
/* {
|
||||
.address = 0x30, |
||||
.reg = ??, |
||||
.bit = ??, |
||||
}, ** VRSO */ |
||||
{ |
||||
.address = 0x34, |
||||
.reg = CHT_WC_VPROG1A_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP1A */ |
||||
{ |
||||
.address = 0x38, |
||||
.reg = CHT_WC_VPROG1B_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP1B */ |
||||
{ |
||||
.address = 0x3c, |
||||
.reg = CHT_WC_VPROG1F_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP1F */ |
||||
{ |
||||
.address = 0x40, |
||||
.reg = CHT_WC_VPROG2D_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP2D */ |
||||
{ |
||||
.address = 0x44, |
||||
.reg = CHT_WC_VPROG3A_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP3A */ |
||||
{ |
||||
.address = 0x48, |
||||
.reg = CHT_WC_VPROG3B_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP3B */ |
||||
{ |
||||
.address = 0x4c, |
||||
.reg = CHT_WC_VPROG4A_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP4A */ |
||||
{ |
||||
.address = 0x50, |
||||
.reg = CHT_WC_VPROG4B_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP4B */ |
||||
{ |
||||
.address = 0x54, |
||||
.reg = CHT_WC_VPROG4C_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP4C */ |
||||
{ |
||||
.address = 0x58, |
||||
.reg = CHT_WC_VPROG4D_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP4D */ |
||||
{ |
||||
.address = 0x5c, |
||||
.reg = CHT_WC_VPROG5A_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP5A */ |
||||
{ |
||||
.address = 0x60, |
||||
.reg = CHT_WC_VPROG5B_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP5B */ |
||||
{ |
||||
.address = 0x64, |
||||
.reg = CHT_WC_VPROG6A_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP6A */ |
||||
{ |
||||
.address = 0x68, |
||||
.reg = CHT_WC_VPROG6B_CTRL, |
||||
.bit = 0x07, |
||||
}, /* VP6B */ |
||||
/* {
|
||||
.address = 0x6c, |
||||
.reg = ??, |
||||
.bit = ??, |
||||
} ** VP7A */ |
||||
}; |
||||
|
||||
static int intel_cht_wc_pmic_get_power(struct regmap *regmap, int reg, |
||||
int bit, u64 *value) |
||||
{ |
||||
int data; |
||||
|
||||
if (regmap_read(regmap, reg, &data)) |
||||
return -EIO; |
||||
|
||||
*value = (data & bit) ? 1 : 0; |
||||
return 0; |
||||
} |
||||
|
||||
static int intel_cht_wc_pmic_update_power(struct regmap *regmap, int reg, |
||||
int bitmask, bool on) |
||||
{ |
||||
return regmap_update_bits(regmap, reg, bitmask, on ? 1 : 0); |
||||
} |
||||
|
||||
/*
|
||||
* The thermal table and ops are empty, we do not support the Thermal opregion |
||||
* (DPTF) due to lacking documentation. |
||||
*/ |
||||
static struct intel_pmic_opregion_data intel_cht_wc_pmic_opregion_data = { |
||||
.get_power = intel_cht_wc_pmic_get_power, |
||||
.update_power = intel_cht_wc_pmic_update_power, |
||||
.power_table = power_table, |
||||
.power_table_count = ARRAY_SIZE(power_table), |
||||
}; |
||||
|
||||
static int intel_cht_wc_pmic_opregion_probe(struct platform_device *pdev) |
||||
{ |
||||
struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent); |
||||
|
||||
return intel_pmic_install_opregion_handler(&pdev->dev, |
||||
ACPI_HANDLE(pdev->dev.parent), |
||||
pmic->regmap, |
||||
&intel_cht_wc_pmic_opregion_data); |
||||
} |
||||
|
||||
static struct platform_device_id cht_wc_opregion_id_table[] = { |
||||
{ .name = "cht_wcove_region" }, |
||||
{}, |
||||
}; |
||||
MODULE_DEVICE_TABLE(platform, cht_wc_opregion_id_table); |
||||
|
||||
static struct platform_driver intel_cht_wc_pmic_opregion_driver = { |
||||
.probe = intel_cht_wc_pmic_opregion_probe, |
||||
.driver = { |
||||
.name = "cht_whiskey_cove_pmic", |
||||
}, |
||||
.id_table = cht_wc_opregion_id_table, |
||||
}; |
||||
module_platform_driver(intel_cht_wc_pmic_opregion_driver); |
||||
|
||||
MODULE_DESCRIPTION("Intel CHT Whiskey Cove PMIC operation region driver"); |
||||
MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>"); |
||||
MODULE_LICENSE("GPL"); |
Loading…
Reference in new issue