diff mbox

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

Message ID 20161024023256.23979-2-paul.liu@canonical.com
State New
Headers show

Commit Message

Ying-Chun Liu (PaulLiu) Oct. 24, 2016, 2:32 a.m. UTC
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>

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.

BugLink: https://bugs.launchpad.net/bugs/1635177

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>

(cherry picked from commit c50cdd62dda3f885c1e6ca8b3d5a0851c911ec54)
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@canonical.com>
---
 drivers/mfd/intel-lpss-acpi.c | 18 +++++++++++++++++-
 drivers/mfd/intel-lpss-pci.c  | 32 ++++++++++++++++++++++++--------
 2 files changed, 41 insertions(+), 9 deletions(-)

Comments

Seth Forshee Oct. 28, 2016, 9:30 p.m. UTC | #1

Ying-Chun Liu (PaulLiu) Dec. 16, 2016, 8:19 a.m. UTC | #2
Hi Tim, Seth,

It seems to me that this patch is still not included in the git tree?
Wonders what's up?

Yours,
Paul
Tim Gardner Dec. 16, 2016, 1:55 p.m. UTC | #3
On 12/16/2016 01:19 AM, Paul Liu wrote:
> Hi Tim, Seth,
> 
> It seems to me that this patch is still not included in the git tree?
> Wonders what's up?
> 
> Yours,
> Paul
> 

What bug number is that ?
Anthony Wong Dec. 16, 2016, 2:14 p.m. UTC | #4
On 16 December 2016 at 21:55, Tim Gardner <tim.gardner@canonical.com> wrote:
>
> On 12/16/2016 01:19 AM, Paul Liu wrote:
> > Hi Tim, Seth,
> >
> > It seems to me that this patch is still not included in the git tree?
> > Wonders what's up?
> >
> > Yours,
> > Paul
> >
>
> What bug number is that ?

That is https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1635177

>
>
> --
> Tim Gardner tim.gardner@canonical.com
>
> --
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Tim Gardner Dec. 16, 2016, 2:48 p.m. UTC | #5
Looks like Luis might have missed it. However, this was not a clean
cherry-pick as indicated in the patch. Please have Paul re-submit this
patch in a new thread while making sure the commit log indicates "back
ported" as well as mentioning for which releases this patch should apply.

rtg
Luis Henriques Dec. 19, 2016, 10:10 a.m. UTC | #6
On Fri, Dec 16, 2016 at 07:48:12AM -0700, Tim Gardner wrote:
> Looks like Luis might have missed it. However, this was not a clean
> cherry-pick as indicated in the patch. Please have Paul re-submit this
> patch in a new thread while making sure the commit log indicates "back
> ported" as well as mentioning for which releases this patch should apply.
> 
> rtg
> -- 
> Tim Gardner tim.gardner@canonical.com

Ups!  Yeah, I did missed this patch, sorry..  Please make sure you submit
the new version ASAP if this is required for this SRU cycle.

Cheers,
--
Luís
diff mbox

Patch

diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c
index 5a8d9c7..b673d8f 100644
--- a/drivers/mfd/intel-lpss-acpi.c
+++ b/drivers/mfd/intel-lpss-acpi.c
@@ -60,6 +60,22 @@  static const struct intel_lpss_platform_info bxt_i2c_info = {
 	.pset = &bxt_i2c_pset,
 };
 
+static struct property_entry apl_i2c_properties[] = {
+	PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 207),
+	PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171),
+	PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208),
+	{ },
+};
+
+static struct property_set apl_i2c_pset = {
+	.properties = apl_i2c_properties,
+};
+
+static const struct intel_lpss_platform_info apl_i2c_info = {
+	.clk_rate = 133000000,
+	.pset = &apl_i2c_pset,
+};
+
 static const struct acpi_device_id intel_lpss_acpi_ids[] = {
 	/* SPT */
 	{ "INT3446", (kernel_ulong_t)&spt_i2c_info },
@@ -69,7 +85,7 @@  static const struct acpi_device_id intel_lpss_acpi_ids[] = {
 	{ "80860ABC", (kernel_ulong_t)&bxt_info },
 	{ "80860AC2", (kernel_ulong_t)&bxt_info },
 	/* APL */
-	{ "80865AAC", (kernel_ulong_t)&bxt_i2c_info },
+	{ "80865AAC", (kernel_ulong_t)&apl_i2c_info },
 	{ "80865ABC", (kernel_ulong_t)&bxt_info },
 	{ "80865AC2", (kernel_ulong_t)&bxt_info },
 	{ }
diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c
index a2a5545..1f4a8ce 100644
--- a/drivers/mfd/intel-lpss-pci.c
+++ b/drivers/mfd/intel-lpss-pci.c
@@ -123,6 +123,22 @@  static const struct intel_lpss_platform_info bxt_i2c_info = {
 	.pset = &bxt_i2c_pset,
 };
 
+static struct property_entry apl_i2c_properties[] = {
+	PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 207),
+	PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171),
+	PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208),
+	{ },
+};
+
+static struct property_set apl_i2c_pset = {
+	.properties = apl_i2c_properties,
+};
+
+static const struct intel_lpss_platform_info apl_i2c_info = {
+	.clk_rate = 133000000,
+	.pset = &apl_i2c_pset,
+};
+
 static const struct intel_lpss_platform_info kbl_info = {
 	.clk_rate = 120000000,
 };
@@ -154,14 +170,14 @@  static const struct pci_device_id intel_lpss_pci_ids[] = {
 	{ PCI_VDEVICE(INTEL, 0x0ac6), (kernel_ulong_t)&bxt_info },
 	{ PCI_VDEVICE(INTEL, 0x0aee), (kernel_ulong_t)&bxt_uart_info },
 	/* APL */
-	{ PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&bxt_i2c_info },
-	{ PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&bxt_i2c_info },
-	{ PCI_VDEVICE(INTEL, 0x5ab0), (kernel_ulong_t)&bxt_i2c_info },
-	{ PCI_VDEVICE(INTEL, 0x5ab2), (kernel_ulong_t)&bxt_i2c_info },
-	{ PCI_VDEVICE(INTEL, 0x5ab4), (kernel_ulong_t)&bxt_i2c_info },
-	{ PCI_VDEVICE(INTEL, 0x5ab6), (kernel_ulong_t)&bxt_i2c_info },
-	{ PCI_VDEVICE(INTEL, 0x5ab8), (kernel_ulong_t)&bxt_i2c_info },
-	{ PCI_VDEVICE(INTEL, 0x5aba), (kernel_ulong_t)&bxt_i2c_info },
+	{ PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&apl_i2c_info },
+	{ PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&apl_i2c_info },
+	{ PCI_VDEVICE(INTEL, 0x5ab0), (kernel_ulong_t)&apl_i2c_info },
+	{ PCI_VDEVICE(INTEL, 0x5ab2), (kernel_ulong_t)&apl_i2c_info },
+	{ PCI_VDEVICE(INTEL, 0x5ab4), (kernel_ulong_t)&apl_i2c_info },
+	{ PCI_VDEVICE(INTEL, 0x5ab6), (kernel_ulong_t)&apl_i2c_info },
+	{ PCI_VDEVICE(INTEL, 0x5ab8), (kernel_ulong_t)&apl_i2c_info },
+	{ PCI_VDEVICE(INTEL, 0x5aba), (kernel_ulong_t)&apl_i2c_info },
 	{ PCI_VDEVICE(INTEL, 0x5abc), (kernel_ulong_t)&bxt_uart_info },
 	{ PCI_VDEVICE(INTEL, 0x5abe), (kernel_ulong_t)&bxt_uart_info },
 	{ PCI_VDEVICE(INTEL, 0x5ac0), (kernel_ulong_t)&bxt_uart_info },