History log of /linux-master/drivers/mfd/intel-lpss-pci.c
Revision Date Author Comments
# 1d8c51ed 21-Dec-2023 Aleksandrs Vinarskis <alex.vinarskis@gmail.com>

mfd: intel-lpss: Introduce QUIRK_CLOCK_DIVIDER_UNITY for XPS 9530

Some devices (eg. Dell XPS 9530, 2023) due to a firmware bug have a
misconfigured clock divider, which should've been 1:1. This introduces
quirk which conditionally re-configures the clock divider to 1:1.

Signed-off-by: Aleksandrs Vinarskis <alex.vinarskis@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231221185142.9224-3-alex.vinarskis@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>


# ac9538f6 21-Dec-2023 Aleksandrs Vinarskis <alex.vinarskis@gmail.com>

mfd: intel-lpss: Switch to generalized quirk table

Introduce generic quirk table, and port existing walkaround for select
Microsoft devices to it. This is a preparation for
QUIRK_CLOCK_DIVIDER_UNITY.

Signed-off-by: Aleksandrs Vinarskis <alex.vinarskis@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231221185142.9224-2-alex.vinarskis@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>


# 0c679fff 30-Nov-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Don't fail probe on success of pci_alloc_irq_vectors()

The pci_alloc_irq_vectors() returns a positive number on success.
Hence we have to filter the negative numbers for error condition.
Update the check accordingly.

Fixes: e6951fb78787 ("mfd: intel-lpss: Use PCI APIs instead of dereferencing")
Reported-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20231130143206.1475831-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>


# fd58bb8c 24-Nov-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Provide Intel LPSS PM ops structure

With the help of EXPORT_NS_GPL_DEV_PM_OPS() and other *_PM_OPS() macros
we may convert PM ops functions to become static. This also takes into
account the PM configuration options such as CONFIG_PM and CONFIG_PM_SLEEP.
This all removes a lot of ugly macros and ifdeffery in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231124200258.3682979-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>


# 24ee97a9 24-Nov-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Move exported symbols to INTEL_LPSS namespace

Avoid unnecessary pollution of the global symbol namespace by
moving library functions in to a specific namespace and import
that into the drivers that make use of the functions.

For more info: https://lwn.net/Articles/760045/

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231124200258.3682979-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>


# a936a917 24-Nov-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Adjust header inclusions

Adjust header inclusions to avoid "proxy" headers and explicitly
include what we are using.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231124200258.3682979-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>


# 9ffe4c10 24-Nov-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Use device_get_match_data()

Use preferred device_get_match_data() instead of acpi_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Introduce a temporary variable in PCI glue driver to be consistent with
ACPI one on the same matter.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231124200258.3682979-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>


# 3b6dba22 24-Nov-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Revert "Add missing check for platform_get_resource"

This reverts commit d918e0d5824495a75d00b879118b098fcab36fdb.

The commit in question does not fix anything and only introduces
a duplication in the code. The main intel_lpss_probe() performs
all necessary checks.

While at it and in order of avoiding similar patches to come, add
a comment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231124200258.3682979-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>


# 6978c7d2 06-Nov-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Use PCI APIs instead of dereferencing

We have a few PCI APIs that may be used instead of direct dereferencing,
Using them will also provide better error codes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231106184052.1166579-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>


# e53b22b1 02-Oct-2023 Jarkko Nikula <jarkko.nikula@linux.intel.com>

mfd: intel-lpss: Add Intel Lunar Lake-M PCI IDs

Add Intel Lunar Lake-M SoC PCI IDs.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Link: https://lore.kernel.org/r/20231002083344.75611-1-jarkko.nikula@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>


# 72d4a168 30-Mar-2023 Jarkko Nikula <jarkko.nikula@linux.intel.com>

mfd: intel-lpss: Add Intel Meteor Lake PCH-S LPSS PCI IDs

Add Intel Meteor Lake PCH-S also called as Meteor Point-S LPSS PCI IDs.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230330132618.4108665-1-jarkko.nikula@linux.intel.com


# fe55d732 02-Jul-2022 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Provide an SSP type to the SPI driver

The SPI driver wants to know the exact type of the controller.
Provide this information to it. This is a complementary part to
the previously updated intel-lpss-acpi.c.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20220702211903.9093-1-andriy.shevchenko@linux.intel.com


# 37e8ba74 28-Jun-2022 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Meteor Lake-P PCI IDs

Add Intel Meteor Lake-P LPSS PCI IDs.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220628223047.34301-1-andriy.shevchenko@linux.intel.com


# eeb0a442 20-May-2022 Gaggery Tsai <gaggery.tsai@intel.com>

mfd: intel-lpss: Add support for ADL-P i2c6 and i2c7

Added 8086:51d8 and 8086:51d9 to the intel_lpss_pci driver. They are
Intel Alder Lake-P i2c controllers.

Signed-off-by: Gaggery Tsai <gaggery.tsai@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220520193537.26090-1-gaggery.tsai@intel.com


# 8c70bd58 11-Feb-2022 Jarkko Nikula <jarkko.nikula@linux.intel.com>

mfd: intel-lpss: Add Intel Raptor Lake PCH-S PCI IDs

Add Intel Raptor Lake PCH-S LPSS PCI IDs.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220211145055.992179-1-jarkko.nikula@linux.intel.com


# e6b14206 02-Dec-2021 Hans de Goede <hdegoede@redhat.com>

mfd: intel-lpss: Fix I2C4 not being available on the Microsoft Surface Go & Go 2

Many DSDTs for Kaby Lake and Kaby Lake Refresh models contain a
_SB.PCI0.GEXP ACPI Device node describing an I2C attached PCA953x
GPIO expander.

This seems to be something which is copy and pasted from the DSDT
from some reference design since this ACPI Device is present even on
models where no such GPIO expander is used at all, such as on the
Microsoft Surface Go & Go 2.

This ACPI Device is a problem because it contains a SystemMemory
OperationRegion which covers the MMIO for the I2C4 I2C controller. This
causes the MFD cell for the I2C4 controller to not be instantiated due
to a resource conflict, requiring the use of acpi_enforce_resources=lax
to work around this.

I have done an extensive analysis of all the ACPI tables on the
Microsoft Surface Go and the _SB.PCI0.GEXP ACPI Device's methods are
not used by any code in the ACPI tables, neither are any of them
directly called by any Linux kernel code. This is unsurprising since
running i2cdetect on the I2C4 bus shows that there is no GPIO
expander chip present on these devices at all.

This commit adds a PCI subsystem vendor:device table listing PCI devices
where it is known to be safe to ignore resource conflicts with ACPI
declared SystemMemory regions.

This makes the I2C4 bus work out of the box on the Microsoft Surface
Go & Go 2, which is necessary for the cameras on these devices to work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211203115108.89661-1-hdegoede@redhat.com


# 9651cf2c 24-Nov-2021 Orlando Chamberlain <redecorating@protonmail.com>

mfd: intel-lpss-pci: Fix clock speed for 38a8 UART

This device is found in the MacBookPro16,2, and as the MacBookPro16,1 is
from the same generation of MacBooks and has a UART with bxt_uart_info,
it was incorrectly assumed that the MacBookPro16,2's UART would have the
same info.

This led to the wrong clock speed being used, and the Bluetooth
controller exposed by the UART receiving and sending random data, which
was incorrectly assumed to be an issue with the Bluetooth stuff, not an
error with the UART side of things.

Changing the info to spt_uart_info changes the clock speed and makes it
send and receive data correctly.

Fixes: ddb1ada416fd ("mfd: intel-lpss: Add support for MacBookPro16,2 ICL-N UART")
Signed-off-by: Orlando Chamberlain <redecorating@protonmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211124091846.11114-1-redecorating@protonmail.com


# 8b2051a1 22-Nov-2021 Ed Schaller <schallee@darkmist.net>

mfd: intel-lpss: Add Intel Lakefield PCH PCI IDs

Add new IDs of the Intel Lakefield chip to the list of supported
devices.

Signed-off-by: Ed Schaller <schallee@darkmist.net>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211123180114.GA4747@darkmist.net


# ddb1ada4 02-Oct-2021 Orlando Chamberlain <redecorating@protonmail.com>

mfd: intel-lpss: Add support for MacBookPro16,2 ICL-N UART

Added 8086:38a8 to the intel_lpss_pci driver. It is an Intel Ice Lake
PCH-N UART controler present on the MacBookPro16,2.

Signed-off-by: Orlando Chamberlain <redecorating@protonmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211002111449.12674-1-redecorating@protonmail.com


# 9fb3cad0 14-Apr-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Alder Lake-M PCI IDs

Add Intel Alder Lake-M LPSS PCI IDs.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 03152e35 01-Mar-2021 Heikki Krogerus <heikki.krogerus@linux.intel.com>

mfd: intel-lpss: Switch to use the software nodes

Software node was always created for the device if it was
supplied with additional device properties, so those nodes
might as well be constant.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 9677e6f7 01-Mar-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Constify device property structures

There is no point to have non-constant device properties in this driver.
Thus, constify them for good.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# c7b79a75 26-Oct-2020 Jarkko Nikula <jarkko.nikula@linux.intel.com>

mfd: intel-lpss: Add Intel Alder Lake PCH-S PCI IDs

Add Intel Alder Lake LPSS PCI IDs.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# f7b67321 05-Jan-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Alder Lake PCH-P PCI IDs

Add Intel Alder Lake LPSS PCI IDs.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 5f039fa7 21-Aug-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add device IDs for UART ports for Lakefield

Add PCI IDs for Lakefield to the list of supported UARTs.

Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: "Ravi V. Shankar" <ravi.v.shankar@intel.com>
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# bb7fcad4 25-Jun-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Tiger Lake PCH-H PCI IDs

Intel Tiger Lake PCH-H has the same LPSS than Intel Broxton.
Add the new IDs to the list of supported devices.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 3ea2e4ea 15-Jun-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Emmitsburg PCH PCI IDs

Intel Emmitsburg PCH has the same LPSS than Intel Ice Lake.
Add the new IDs to the list of supported devices.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 9a875245 13-Apr-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Update LPSS UART #2 PCI ID for Jasper Lake

It appears that preliminary documentation has a typo in the ID list,
i.e. LPSS UART #2 had been advertised wrongly.

Fix the driver according to the EDS v0.9.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# d2923aa4 16-Mar-2020 Jarkko Nikula <jarkko.nikula@linux.intel.com>

mfd: intel-lpss: Fix Intel Elkhart Lake LPSS I2C input clock

Intel Elkhart Lake LPSS I2C has 100 MHz input clock instead of 133 MHz
that was our preliminary information. This will result slower I2C bus
clock when driver calculates its timing parameters in case ACPI tables
don't provide them.

Slower I2C bus clock is allowed but let's fix this to match with
reality.

While at it, keep the same default I2C device properties as Intel
Broxton since it is not known do they need any update.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 4e213b45 13-Jan-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Comet Lake PCH-V PCI IDs

Intel Comet Lake PCH-V has the same LPSS than Intel Kaby Lake.
Add the new IDs to the list of supported devices.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 57b89dd2 09-Dec-2019 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Jasper Lake PCI IDs

Intel Jasper Lake has the same LPSS than Intel Ice Lake.
Add the new IDs to the list of supported devices.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# dd047dce 29-Oct-2019 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Comet Lake PCH-H PCI IDs

Intel Comet Lake PCH-H has the same LPSS than Intel Cannon Lake.
Add the new IDs to the list of supported devices.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 3f31bc67 03-Sep-2019 Jarkko Nikula <jarkko.nikula@linux.intel.com>

mfd: intel-lpss: Add default I2C device properties for Gemini Lake

It turned out Intel Gemini Lake doesn't use the same I2C timing
parameters as Broxton.

I got confirmation from the Windows team that Gemini Lake systems should
use updated timing parameters that differ from those used in Broxton
based systems.

Fixes: f80e78aa11ad ("mfd: intel-lpss: Add Intel Gemini Lake PCI IDs")
Tested-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# ec65b560 01-Aug-2019 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Tiger Lake PCI IDs

Intel Tiger Lake has the same LPSS than Intel Broxton.
Add the new IDs to the list of supported devices.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 76380a60 04-Jul-2019 Kai-Heng Feng <kai.heng.feng@canonical.com>

mfd: intel-lpss: Remove D3cold delay

Goodix touchpad may drop its first couple input events when
i2c-designware-platdrv and intel-lpss it connects to took too long to
runtime resume from runtime suspended state.

This issue happens becuase the touchpad has a rather small buffer to
store up to 13 input events, so if the host doesn't read those events in
time (i.e. runtime resume takes too long), events are dropped from the
touchpad's buffer.

The bottleneck is D3cold delay it waits when transitioning from D3cold
to D0, hence remove the delay to make the resume faster. I've tested
some systems with intel-lpss and haven't seen any regression.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202683
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 01e4ecee 21-Jun-2019 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Elkhart Lake PCH PCI IDs

Intel Elkhart Lake has the same LPSS than Intel Broxton.
Add the new IDs to the list of supported devices.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# f88314c1 24-May-2019 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Keep device tables sorted by ID

Easier to find and maintain if the device tables sorted by ID.
Do it here for intel-lpss MFD driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500

Based on 2 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 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 #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

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

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dd662907 30-Apr-2019 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Comet Lake PCI IDs

Intel Comet Lake has the same LPSS than Intel Cannon Lake.
Add the new IDs to the list of supported devices.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Evan Green <evgreen@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 16b7a09b 24-Jan-2019 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Move linux/pm.h to the local header

We now using a common macro for PM operations in Intel LPSS driver,
and, since that macro relies on the definition and macro from linux/pm.h
header file, it's logical to include it directly in intel-lpss.h.
Otherwise it's a bit fragile and requires a proper ordering
of header inclusion in C files.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# a13c93b3 27-Jun-2018 Mika Westerberg <mika.westerberg@linux.intel.com>

mfd: intel-lpss: Add Ice Lake PCI IDs

Intel Ice Lake has the same LPSS than Intel Cannon Lake. Add the new IDs
to the list of supported devices.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 4e93a658 18-May-2018 Jarkko Nikula <jarkko.nikula@linux.intel.com>

mfd: intel-lpss: Fix Intel Cannon Lake LPSS I2C input clock

Intel Cannon Lake PCH has much higher 216 MHz input clock to LPSS I2C
than Sunrisepoint which uses 120 MHz. Preliminary information was that
both share the same clock rate but actual silicon implements elevated
rate for better support for 3.4 MHz high-speed I2C.

This incorrect input clock rate results too high I2C bus clock in case
ACPI doesn't provide tuned I2C timing parameters since I2C host
controller driver calculates them from input clock rate.

Fix this by using the correct rate. We still share the same 230 ns SDA
hold time value than Sunrisepoint.

Cc: stable@vger.kernel.org
Fixes: b418bbff36dd ("mfd: intel-lpss: Add Intel Cannonlake PCI IDs")
Reported-by: Jian-Hong Pan <jian-hong@endlessm.com>
Reported-by: Chris Chiu <chiu@endlessm.com>
Reported-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Jian-Hong Pan <jian-hong@endlessm.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# e4b91470 19-Aug-2017 Florian R. Hölzlwimmer <git.ich@frhoelzlwimmer.de>

mfd: intel-lpss: Add missing PCI ID for Intel Sunrise Point LPSS devices

This patch adds a missing PCI ID of the Intel Sunrise Point chipset to the Intel LPSS driver.
It fixes a bug causing the touchpad of the Lenovo Yoga 720-15 not to be recognized.
See also bug 1700657 on bugs.launchpad.net.

Many thanks to CoolStar, who found this solution!

Reported-by: CoolStar <coolstarorganization@gmail.com>
Tested-by: Mike Schwartz <mykesx@gmail.com>
Tested-by: Björn Dahlgren <bjodah@gmail.com>
Signed-off-by: Florian R. Hölzlwimmer <git.ich@frhoelzlwimmer.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# b418bbff 15-May-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Cannonlake PCI IDs

Intel Cannonlake PCH has the same LPSS than Intel Kabylake. Add the new IDs
to the list of supported devices.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# f80e78aa 11-Jan-2017 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Add Intel Gemini Lake PCI IDs

Intel Gemini Lake is essentially Broxton with different PCI IDs. Add these
new PCI IDs to the list of supported devices.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 85a9419a 14-Nov-2016 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Try to enable Memory-Write-Invalidate

Enable MWI mechanism if PCI bus master supports it.

It might be potential benefit in some cases. Documentation [1] says that
standard Memory Write might supply more current data than in the CPU modified
cache line and "trashing a line in the cache may trash some data that is more
current that in the memory line". This allows to avoid potential retries and
other performance degradation issues on the bus.

[1] PCI System Architecture, 4th edition, ISBN: 0-201-30974-2, pp.117-119.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 2c8c3416 28-Sep-2016 Jarkko Nikula <jarkko.nikula@linux.intel.com>

mfd: lpss: Fix Intel Kaby Lake PCH-H properties

There are a few issues on Intel Kaby Lake PCH-H properties added by
commit a6a576b78e09 ("mfd: lpss: Add Intel Kaby Lake PCH-H PCI IDs"):

- Input clock of I2C controller on Intel Kaby Lake PCH-H is 120 MHz not
133 MHz. This was probably copy-paste error from Intel Broxton I2C
properties.
- There is no default I2C SDA hold time specified which is used when
ACPI doesn't provide it. I got information from Windows driver team
that Kaby Lake PCH-H can use the same configuration than Intel
Sunrisepoint PCH.
- Common HS-UART properties are not used.

Fix these by reusing the Sunrisepoint properties on Kaby Lake PCH-H.

Fixes: a6a576b78e09 ("mfd: lpss: Add Intel Kaby Lake PCH-H PCI IDs")
Reported-by: Xiang A Wang <xiang.a.wang@intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# c50cdd62 12-Sep-2016 Jarkko Nikula <jarkko.nikula@linux.intel.com>

mfd: intel-lpss: Add default I2C device properties for Apollo Lake

Default I2C device properties for Intel Broxton, especially SDA hold time
may not be enough on Intel Apollo Lake. These properties are used in case
we don't get timing parameters from ACPI.

The default SDA hold time for Broxton may fail with arbitration lost errors
on Apollo Lake:

i2c_designware i2c_designware.1: i2c_dw_handle_tx_abort: lost arbitration

Fix this by using different default device properties on Apollo Lake than
Broxton.

Reported-by: Paul Liu <paul.liu@canonical.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=156181
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 77fc5ff6 04-Jul-2016 Mika Westerberg <mika.westerberg@linux.intel.com>

mfd: lpss: Add Intel Kaby Lake PCH-H PCI IDs

Intel Kaby Lake PCH-H has the same LPSS than Intel Sunrisepoint. Add the new
IDs to the list of supported devices.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# f4d05266 29-Mar-2016 Heikki Krogerus <heikki.krogerus@linux.intel.com>

device property: don't bother the drivers with struct property_set

Since device_add_property_set() now always takes a copy of
the property_set, and also since the fwnode type is always
hard coded to be FWNODE_PDATA, there is no need for the
drivers to deliver the entire struct property_set. The
function can just create the instance of it on its own and
bind the properties from the drivers to it on the spot.

This renames device_add_property_set() to
device_add_properties(). The function now takes struct
property_entry as its parameter instead of struct
property_set.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 0343b2f4 26-Jan-2016 Mika Westerberg <mika.westerberg@linux.intel.com>

mfd: intel-lpss: Pass I2C configuration via properties on BXT

I2C host controller need to be configured properly in order to meet I2C
timings specified in the I2C protocol specification. Some Intel Broxton
based machines do not have this information in the ACPI namespace (or the
boot firmware does not support ACPI at all) so we use build-in device
properties instead.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 023269cc 14-Jan-2016 Huiquan Zhong <huiquan.zhong@intel.com>

mfd: lpss: Add PCI IDs for Intel Broxton B-Step platform

Add PCI IDs for Intel Broxton B-Step platform, which have same
LPSS devices with A-Step.

Signed-off-by: Huiquan Zhong <huiquan.zhong@intel.com>
Signed-off-by: Qipeng Zha <qipeng.zha@intel.com>
cked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# ec14c539 30-Nov-2015 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: intel-lpss: Pass HSUART configuration via properties

The HS-UART host controller driver needs to know certain properties like
width of the register set if it cannot get that information from ACPI or
DT. In order to support non-ACPI systems we pass this information to the
driver via device properties.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 028af594 30-Nov-2015 Mika Westerberg <mika.westerberg@linux.intel.com>

mfd: intel-lpss: Pass SDA hold time to I2C host controller driver

Intel Skylake the LPSS I2C pad circuit has internal delays that require
programming non-zero SDA hold time for the I2C host controller. If this is
not done communication to slave devices may fail with arbitration lost
errors like the one seen below taken from Lenovo Yoga 900:

i2c_hid i2c-SYNA2B29:00: Fetching the HID descriptor
i2c_hid i2c-SYNA2B29:00: __i2c_hid_command: cmd=20 00
i2c_designware i2c_designware.1: i2c_dw_handle_tx_abort: lost arbitration

To fix this we follow what the Windows driver is doing and pass the default
SDA hold time of 230 ns to all Intel Skylake host controllers. This still
allows the platform to override these values by passing special ACPI
methods SSCN and FMCN.

Reported-by: Kevin Fenzi <kevin@scrye.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# ff0a04a6 20-Oct-2015 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: lpss: Add Intel Broxton PCI IDs

Intel Broxton has the same LPSS block than Intel Sunrisepoint so add
Broxton PCI IDs to the list.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 4b45efe8 27-Jul-2015 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

mfd: Add support for Intel Sunrisepoint LPSS devices

The new coming Intel platforms such as Skylake will contain Sunrisepoint PCH.
The main difference to the previous platforms is that the LPSS devices are
compound devices where usually main (SPI, HSUART, or I2C) and DMA IPs are
present.

This patch brings the driver for such devices found on Sunrisepoint PCH.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>