16 Sep, 2020

2 commits


18 May, 2020

1 commit

  • On Asus T101HA, we keep receiving those error messages:

    i915 0000:00:02.0: [drm] *ERROR* mipi_exec_pmic failed, error: -95
    intel_soc_pmic_exec_mipi_pmic_seq_element: Not implemented
    intel_soc_pmic_exec_mipi_pmic_seq_element: i2c-addr: 0x5e reg-addr 0x4b value 0x59 mask 0xff

    Because the opregion is missing the I2C address.

    Suggested-by: Hans de Goede
    Signed-off-by: Mauro Carvalho Chehab
    Reviewed-by: Hans de Goede
    Reviewed-by: Mika Westerberg
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Mauro Carvalho Chehab
     

25 Oct, 2019

3 commits

  • We have no docs for the CHT Crystal Cove PMIC. The Asus Zenfone-2 kernel
    code has 2 Crystal Cove regulator drivers, one calls the PMIC a "Crystal
    Cove Plus" PMIC and talks about Cherry Trail, so presuambly that one
    could be used to get register info for the regulators if we need to
    implement regulator support in the future.

    For now the sole purpose of this driver is to make
    intel_soc_pmic_exec_mipi_pmic_seq_element work on devices with a
    CHT Crystal Cove PMIC.

    Specifically this fixes the following MIPI PMIC sequence related errors
    on e.g. an Asus T100HA:

    [ 178.211801] intel_soc_pmic_exec_mipi_pmic_seq_element: No PMIC registered
    [ 178.211897] [drm:intel_dsi_dcs_init_backlight_funcs [i915]] *ERROR* mipi_exec_pmic failed, error: -6

    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     
  • Our current Crystal Cove OpRegion driver is only valid for the
    Crystal Cove PMIC variant found on Bay Trail (BYT) boards,
    Cherry Trail (CHT) based boards use another variant.

    At least the regulator registers are different on CHT and these registers
    are one of the things controlled by the custom PMIC OpRegion.

    Commit 4d9ed62ab142 ("mfd: intel_soc_pmic: Export separate mfd-cell
    configs for BYT and CHT") has disabled the intel_pmic_crc.c code for CHT
    devices by removing the "crystal_cove_pmic" MFD cell on CHT devices.

    This commit renames the intel_pmic_crc.c driver and the cell to be
    prefixed with "byt" to indicate that this code is for BYT devices only.

    This is a preparation patch for adding a separate PMIC OpRegion
    driver for the CHT variant of the Crystal Cove PMIC (sometimes called
    Crystal Cove Plus in Android kernel sources).

    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     
  • For some model PMIC's used on Intel boards we do not know how to
    handle the power or thermal opregions because we have no documentation.

    For example in the intel_pmic_chtwc.c driver thermal_table_count is 0,
    which means that our PMIC_THERMAL_OPREGION_ID handler will always fail
    with AE_BAD_PARAMETER, in this case it is better to simply not register
    the handler at all.

    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

03 Jul, 2019

1 commit


31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    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

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 655 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

18 Feb, 2019

1 commit


09 Jan, 2019

3 commits

  • Most PMIC-s use only a single i2c-address, so after verifying the
    i2c-address matches, we can simply pass the call to regmap_update_bits.

    This commit adds support for this and hooks this up for the xpower AXP288
    PMIC by setting the new pmic_i2c_address field.

    This fixes the following errors on display on / off on a Jumper Ezpad
    mini 3 and an Onda V80 plus tablet, both of which use the AXP288:

    intel_soc_pmic_exec_mipi_pmic_seq_element: Not implemented
    intel_soc_pmic_exec_mipi_pmic_seq_element: i2c-addr: 0x34 reg-addr ...
    [drm:mipi_exec_pmic [i915]] *ERROR* mipi_exec_pmic failed, error: -95

    Instead of these errors on both devices we now correctly turn on / off
    DLDO3 (through direct register manipulation). On the Onda V80 plus this
    fixes an issue with the backlight being brighter around the borders after
    an off / on cycle. This should also help to save some power when the
    display is off.

    Signed-off-by: Hans de Goede
    Reviewed-by: Ville Syrjälä
    Link: https://patchwork.freedesktop.org/patch/msgid/20190107111556.4510-4-hdegoede@redhat.com

    Hans de Goede
     
  • Implement the exec_mipi_pmic_seq_element callback for the CHT Whiskey Cove
    PMIC.

    On some CHT devices this fixes the LCD panel not lighting up when it was
    not initialized by the GOP, because an external monitor was plugged in and
    the GOP initialized only the external monitor.

    Reviewed-by: Mika Westerberg
    Signed-off-by: Hans de Goede
    Link: https://patchwork.freedesktop.org/patch/msgid/20190107111556.4510-3-hdegoede@redhat.com

    Hans de Goede
     
  • DSI LCD panels describe an initialization sequence in the Video BIOS
    Tables using so called MIPI sequences. One possible element in these
    sequences is a PMIC specific element of 15 bytes.

    Although this is not really an ACPI opregion, the ACPI opregion code is the
    closest thing we have. We need to have support for these PMIC specific MIPI
    sequence elements somwhere. Since we already instantiate a special platform
    device for Intel PMICs for the ACPI PMIC OpRegion handler to bind to,
    with PMIC specific implementations of the OpRegion, the handling of MIPI
    sequence PMIC elements fits very well in the ACPI PMIC OpRegion code.

    This commit adds a new intel_soc_pmic_exec_mipi_pmic_seq_element()
    function, which is to be backed by a PMIC specific
    exec_mipi_pmic_seq_element callback. This function will be called by the
    i915 code to execture MIPI sequence PMIC elements.

    Reviewed-by: Mika Westerberg
    Signed-off-by: Hans de Goede
    Link: https://patchwork.freedesktop.org/patch/msgid/20190107111556.4510-2-hdegoede@redhat.com

    Hans de Goede
     

07 Jan, 2019

1 commit

  • The current-source used for the battery temp-sensor (TS) is shared with the
    GPADC. For proper fuel-gauge and charger operation the TS current-source
    needs to be permanently on. But to read the GPADC we need to temporary
    switch the TS current-source to ondemand, so that the GPADC can use it,
    otherwise we will always read an all 0 value.

    The switching from on to on-ondemand is not necessary when the TS
    current-source is off (this happens on devices which do not have a TS).

    Prior to this commit there were 2 issues with our handling of the TS
    current-source switching:

    1) We were writing hardcoded values to the ADC TS pin-ctrl register,
    overwriting various other unrelated bits. Specifically we were overwriting
    the current-source setting for the TS and GPIO0 pins, forcing it to 80ųA
    independent of its original setting. On a Chuwi Vi10 tablet this was
    causing us to get a too high adc value (due to a too high current-source)
    resulting in acpi_lpat_raw_to_temp() returning -ENOENT, resulting in:

    ACPI Error: AE_ERROR, Returned by Handler for [UserDefinedRegion]
    ACPI Error: Method parse/execution failed \_SB.SXP1._TMP, AE_ERROR

    This commit fixes this by using regmap_update_bits to change only the
    relevant bits.

    2) At the end of intel_xpower_pmic_get_raw_temp() we were unconditionally
    enabling the TS current-source even on devices where the TS-pin is not used
    and the current-source thus was off on entry of the function.

    This commit fixes this by checking if the TS current-source is off when
    entering intel_xpower_pmic_get_raw_temp() and if so it is left as is.

    Fixes: 58eefe2f3f53 (ACPI / PMIC: xpower: Do pinswitch ... reading GPADC)
    Signed-off-by: Hans de Goede
    Acked-by: Andy Shevchenko
    Cc: 4.14+ # 4.14+
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

25 Oct, 2018

1 commit

  • intel_xpower_pmic_update_power() does a read-modify-write of the output
    control register. The i2c-designware code blocks the P-Unit I2C access
    during the read and write by taking the P-Unit's PMIC bus semaphore.
    But between the read and the write that semaphore is released and the
    P-Unit could make changes to the register which we then end up overwriting.

    This commit makes intel_xpower_pmic_update_power() take the semaphore
    itself so that it is held over the entire read-modify-write, avoiding this
    race.

    Signed-off-by: Hans de Goede
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

10 Sep, 2018

2 commits


15 Aug, 2018

1 commit

  • Prior to this commit the CRC PMOP handler only supported the X285 and V18X
    PMOP fields. Leading to errors like these on device using the VBUS field:

    [ 765.766489] ACPI Error: AE_BAD_PARAMETER, Returned by Handler for [UserDefinedRegion] (20180531/evregion-266)
    [ 765.766526] ACPI Error: Method parse/execution failed \_SB.I2C1.BATC._BST, AE_BAD_PARAMETER (20180531/psparse-516)
    [ 765.766586] ACPI Error: AE_BAD_PARAMETER, Evaluating _BST (20180531/battery-577)

    This commit adds support for all known fields to the CRC PMOP OpRegion
    handler, the name and register info in this commit comes from:

    https://github.com/01org/ProductionKernelQuilts/blob/master/uefi/cht-m1stable/patches/0002-ACPI-Adding-support-for-WC-and-CRC-opregion.patch

    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Acked-by: Mika Westerberg
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

23 Feb, 2018

1 commit


11 Jan, 2018

1 commit


13 Dec, 2017

1 commit

  • platform_device_id are not supposed to change at runtime. All functions
    working with platform_device_id provided by
    work with const platform_device_id. So mark the non-const structs as
    const.

    Signed-off-by: Arvind Yadav
    Acked-by: Mika Westerberg
    Signed-off-by: Rafael J. Wysocki

    Arvind Yadav
     

17 Nov, 2017

1 commit

  • Pull MFD updates from Lee Jones:
    "New drivers:
    - Add support for Cherry Trail Dollar Cove TI PMIC
    - Add support for Add Spreadtrum SC27xx series PMICs

    New device support:
    - Add support Regulator to axp20x

    New functionality:
    - Add DT support; aspeed-scu sc27xx-pmic
    - Add power saving support; rts5249

    Fix-ups:
    - DT clean-up/rework; tps65217, max77693, iproc-cdru, iproc-mhb, tps65218
    - Staticise/constify; stw481x
    - Use new succinct IRQ API; fsl-imx25-tsadc
    - Kconfig fix-ups; MFD_TPS65218
    - Identify SPI method; lpc_ich
    - Use managed resources (devm_*) calls; ssbi
    - Remove unused/obsolete code/documentation; mc13xxx

    Bug fixes:
    - Fix typo in MAINTAINERS
    - Fix error handling; mxs-lradc
    - Clean-up IRQs on .remove; fsl-imx25-tsadc"

    * tag 'mfd-next-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (21 commits)
    dt-bindings: mfd: mc13xxx: Remove obsolete property
    mfd: axp20x: Add axp20x-regulator cell for AXP813
    mfd: Add Spreadtrum SC27xx series PMICs driver
    dt-bindings: mfd: Add Spreadtrum SC27xx PMIC documentation
    mfd: ssbi: Use devm_of_platform_populate()
    mfd: fsl-imx25: Clean up irq settings during removal
    mfd: mxs-lradc: Fix error handling in mxs_lradc_probe()
    mfd: lpc_ich: Avoton/Rangeley uses SPI_BYT method
    mfd: tps65218: Introduce dependency on CONFIG_OF
    mfd: tps65218: Correct the config description
    MAINTAINERS: Fix Dialog search term for watchdog binding file
    mfd: fsl-imx25: Set irq handler and data in one go
    mfd: rts5249: Add support for RTS5250S power saving
    ACPI / PMIC: Add opregion driver for Intel Dollar Cove TI PMIC
    mfd: Add support for Cherry Trail Dollar Cove TI PMIC
    syscon: dt-bindings: Add binding document for iProc MHB block
    syscon: dt-bindings: Add binding doc for Broadcom iProc CDRU
    mfd: max77693: Add muic of_compatible in mfd_cell
    mfd: stw481x: Make three arrays static const, reduces object code size
    mfd: tps65217: Introduce dependency on CONFIG_OF
    ...

    Linus Torvalds
     

13 Nov, 2017

1 commit

  • * acpi-pmic:
    ACPI / PMIC: Add TI PMIC TPS68470 operation region driver

    * acpi-apei:
    APEI / ERST: use 64-bit timestamps
    ACPI / APEI: Remove arch_apei_flush_tlb_one()
    arm64: mm: Remove arch_apei_flush_tlb_one()
    ACPI / APEI: Remove ghes_ioremap_area
    ACPI / APEI: Replace ioremap_page_range() with fixmap
    ACPI / APEI: remove the unused dead-code for SEA/NMI notification type
    ACPI / APEI: adjust a local variable type in ghes_ioremap_pfn_irq()

    * acpi-x86:
    ACPI / x86: Extend KIOX000A quirk to cover all affected BIOS versions

    Rafael J. Wysocki
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

13 Oct, 2017

1 commit

  • This patch adds the opregion driver for Dollar Cove TI PMIC on Intel
    Cherry Trail devices. The patch is based on the original work by
    Intel, found at:
    https://github.com/01org/ProductionKernelQuilts
    with many cleanups and rewrites.

    The driver is currently provided only as built-in to follow other
    PMIC opregion drivers convention.

    The re-enumeration of devices at probe is required for fixing the
    issues on HP x2 210 G2. See bug#195689.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=193891
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195689

    Signed-off-by: Takashi Iwai
    Reviewed-by: Mika Westerberg
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Lee Jones

    Takashi Iwai
     

03 Oct, 2017

1 commit

  • The Kabylake platform coreboot (Chrome OS equivalent of
    BIOS) has defined 4 operation regions for the TI TPS68470 PMIC.
    These operation regions are to enable/disable voltage
    regulators, configure voltage regulators, enable/disable
    clocks and to configure clocks.

    This config adds ACPI operation region support for TI TPS68470 PMIC.
    TPS68470 device is an advanced power management unit that powers
    a Compact Camera Module (CCM), generates clocks for image sensors,
    drives a dual LED for flash and incorporates two LED drivers for
    general purpose indicators.

    This driver enables ACPI operation region support to control voltage
    regulators and clocks for the TPS68470 PMIC.

    Signed-off-by: Rajmohan Mani
    Acked-by: Sakari Ailus
    Signed-off-by: Rafael J. Wysocki

    Rajmohan Mani
     

25 Jul, 2017

1 commit

  • Testing has shown that the TS-pin's bias-current needs to be disabled
    when reading the GPIO0 pin in GPADC mode.

    It seems that there is only 1 bias current source and to be able to use it
    for the GPIO0 pin in GPADC mode it must be temporarily turned off for the
    TS pin, but the datasheet does not mention this.

    This commit adds the necessary writes to turn the TS pin BIAS current
    off before and back on after reading the GPADC. This fixes the GPADC
    always returning a reading of 0.

    Signed-off-by: Hans de Goede
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

22 Jun, 2017

1 commit


29 Apr, 2017

1 commit

  • The power table addresses should be contiguous, but there was a hole
    where 0x34 was missing. On most devices this is not a problem as
    addresses above 0x34 are used for the BUC# convertors which are not
    used in the DSDTs I've access to but after the BUC# convertors
    there is a field named GPI1 in the DSTDs, which does get used in some
    cases and ended up turning BUC6 on and off due to the wrong addresses,
    resulting in turning the entire device off (or causing it to reboot).

    Removing the hole in the addresses fixes this, fixing one of my
    Bay Trail tablets turning off while booting the mainline kernel.

    While at it add comments with the field names used in the DSDTs to
    make it easier to compare the register and bits used at each address
    with the datasheet.

    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

20 Apr, 2017

2 commits

  • The intel_pmic_xpower code provides an OPRegion handler, which must be
    available before other drivers using it are loaded, which can only be
    ensured if both the mfd and opregion drivers are built in, which is why
    the Kconfig option for intel_pmic_xpower is a bool.

    The use of IIO is causing trouble for generic distro configs here as
    distros will typically want to build IIO drivers as modules and there
    really is no reason to use IIO here. The reading of the ADC value is a
    single regmap_bulk_read, which is already protected against races by
    the regmap-lock.

    This commit removes the use of IIO, allowing distros to enable the
    driver without needing to built IIO in and also actually simplifies
    the code.

    Signed-off-by: Hans de Goede
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     
  • Add opregion driver for Intel CHT Whiskey Cove PMIC, based on various
    non upstreamed CHT Whiskey Cove PMIC patches. This does not include
    support for the Thermal opregion (DPTF) due to lacking documentation.

    Signed-off-by: Hans de Goede
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Hans de Goede
     

16 Jul, 2016

1 commit

  • The Kconfig currently controlling compilation of these files are:

    drivers/acpi/Kconfig:menuconfig PMIC_OPREGION
    drivers/acpi/Kconfig: bool "PMIC (Power Management Integrated Circuit) operation region support"

    drivers/acpi/Kconfig:config BXT_WC_PMIC_OPREGION
    drivers/acpi/Kconfig: bool "ACPI operation region support for BXT WhiskeyCove PMIC"

    drivers/acpi/Kconfig:config XPOWER_PMIC_OPREGION
    drivers/acpi/Kconfig: bool "ACPI operation region support for XPower AXP288 PMIC"

    ...meaning they currently are not being built as a module by anyone.

    Lets remove the couple traces of modular infrastructure use, so that
    when reading the code there is no doubt it is builtin-only.

    We delete the MODULE_LICENSE tag etc. since all that information
    is already contained at the top of the file in the comments.

    One file was using module_init. Since module_init translates to
    device_initcall in the non-modular case, the init ordering remains
    unchanged with this commit.

    In one case we replace the module.h with export.h since that file
    is exporting some symbols, but does not use __init. The other two
    are using __init and so module.h gets replaced with init.h there.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: Rafael J. Wysocki

    Paul Gortmaker
     

27 Jun, 2016

2 commits


24 Jun, 2016

2 commits

  • This patch adds operation region driver for Intel BXT WhiskeyCove
    PMIC. The register mapping is done as per the BXT WC data sheet.

    Signed-off-by: Ajay Thomas
    Signed-off-by: Bin Gao
    Reviewed-by: Aaron Lu
    Signed-off-by: Rafael J. Wysocki

    Bin Gao
     
  • Issue description: On some pmics, the policy enable for thermal alerts
    refers to different bit fields of the same registers, whereas on other
    pmics, the policy enable refers to the same bit field on different
    registers. Previous implementation did not provide the flexibility for
    supporting the first approach.

    Solution: Modified the policy enable function to take bit field as well.
    The use of bit field is left to the pmic specific opregion driver.

    Signed-off-by: Yegnesh Iyer
    Signed-off-by: Bin Gao
    Reviewed-by: Aaron Lu
    Signed-off-by: Rafael J. Wysocki

    Bin Gao
     

10 Mar, 2016

1 commit

  • The Kconfig currently controlling compilation of this code is:

    drivers/acpi/Kconfig:config CRC_PMIC_OPREGION
    drivers/acpi/Kconfig: bool "ACPI operation region support for CrystalCove PMIC"

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the couple modular references, so that when reading
    the driver there is no doubt it is builtin-only.

    Since module_init translates to device_initcall in the non-modular
    case, the init ordering remains unchanged with this commit.

    We also delete the MODULE_LICENSE tag etc. since all that information
    is already contained at the top of the file in the comments.

    Signed-off-by: Paul Gortmaker
    Acked-by: Aaron Lu
    Signed-off-by: Rafael J. Wysocki

    Paul Gortmaker
     

27 Mar, 2015

1 commit


29 Jan, 2015

1 commit


27 Nov, 2014

2 commits

  • The same virtual GPIO strategy is also used for the AXP288 PMIC in that
    various control methods that are used to do power rail handling and
    sensor reading/setting will touch GPIO fields defined under the PMIC
    device. The GPIO fileds are only defined by the ACPI code while the
    actual hardware doesn't really have a GPIO controller, but to make those
    control method execution succeed, we have to install a GPIO handler for
    the PMIC device handle. Since we do not need the virtual GPIO strategy,
    we can simply do nothing in that handler.

    Signed-off-by: Aaron Lu
    Signed-off-by: Rafael J. Wysocki

    Aaron Lu
     
  • The Baytrail-T-CR platform firmware has defined two customized operation
    regions for PMIC chip Dollar Cove XPower - one is for power resource
    handling and one is for thermal just like the CrystalCove one. This patch
    adds support for them on top of the common PMIC opregion region code.

    Signed-off-by: Aaron Lu
    Acked-by: Lee Jones for the MFD part
    Signed-off-by: Rafael J. Wysocki

    Aaron Lu