Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1254806

[PATCH 4.1 29/46] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.1 29/46] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348
Date 2015-10-23 20:10 +0200
Message-ID <qmOWU-DI-61@gated-at.bofh.it> (permalink)
References <qmONc-d5-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.1-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mika Westerberg <mika.westerberg@linux.intel.com>

commit 56d4b8a24cef5d66f0d10ac778a520d3c2c68a48 upstream.

ACPI SSCN/FMCN methods were originally added because then the platform can
provide the most accurate HCNT/LCNT values to the driver. However, this
seems not to be true for Dell Inspiron 7348 where using these causes the
touchpad to fail in boot:

  i2c_hid i2c-DLL0675:00: failed to retrieve report from device.
  i2c_designware INT3433:00: i2c_dw_handle_tx_abort: lost arbitration
  i2c_hid i2c-DLL0675:00: failed to retrieve report from device.
  i2c_designware INT3433:00: controller timed out

The values received from ACPI are (in fast mode):

  HCNT: 72
  LCNT: 160

this translates to following timings (input clock is 100MHz on Broadwell):

  tHIGH: 720 ns (spec min 600 ns)
  tLOW: 1600 ns (spec min 1300 ns)
  Bus period: 2920 ns (assuming 300 ns tf and tr)
  Bus speed: 342.5 kHz

Both tHIGH and tLOW are within the I2C specification.

The calculated values when ACPI parameters are not used are (in fast mode):

  HCNT: 87
  LCNT: 159

which translates to:

  tHIGH: 870 ns (spec min 600 ns)
  tLOW: 1590 ns (spec min 1300 ns)
  Bus period 3060 ns (assuming 300 ns tf and tr)
  Bus speed 326.8 kHz

These values are also within the I2C specification.

Since both ACPI and calculated values meet the I2C specification timing
requirements it is hard to say why the touchpad does not function properly
with the ACPI values except that the bus speed is higher in this case (but
still well below the max 400kHz).

Solve this by adding DMI quirk to the driver that disables using ACPI
parameters on this particulare machine.

Reported-by: Pavel Roskin <plroskin@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Pavel Roskin <plroskin@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/i2c/busses/i2c-designware-platdrv.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -24,6 +24,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/delay.h>
+#include <linux/dmi.h>
 #include <linux/i2c.h>
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
@@ -51,6 +52,22 @@ static u32 i2c_dw_get_clk_rate_khz(struc
 }
 
 #ifdef CONFIG_ACPI
+/*
+ * The HCNT/LCNT information coming from ACPI should be the most accurate
+ * for given platform. However, some systems get it wrong. On such systems
+ * we get better results by calculating those based on the input clock.
+ */
+static const struct dmi_system_id dw_i2c_no_acpi_params[] = {
+	{
+		.ident = "Dell Inspiron 7348",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7348"),
+		},
+	},
+	{ }
+};
+
 static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],
 			       u16 *hcnt, u16 *lcnt, u32 *sda_hold)
 {
@@ -58,6 +75,9 @@ static void dw_i2c_acpi_params(struct pl
 	acpi_handle handle = ACPI_HANDLE(&pdev->dev);
 	union acpi_object *obj;
 
+	if (dmi_check_system(dw_i2c_no_acpi_params))
+		return;
+
 	if (ACPI_FAILURE(acpi_evaluate_object(handle, method, NULL, &buf)))
 		return;
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.1 00/46] 4.1.12-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 05/46] inet: fix races in reqsk_queue_hash_req() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 06/46] net: add pfmemalloc check in sk_add_backlog() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 04/46] skbuff: Fix skb checksum partial check. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 02/46] l2tp: protect tunnel->del_work by ref_count Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 16/46] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 30/46] i2c: designware-platdrv: enable RuntimePM before registering to the core Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 29/46] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 34/46] drm/radeon: attach tile property to mst connector Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 17/46] net/unix: fix logic about sk_peek_offset Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 32/46] drm/nouveau/fbcon: take runpm reference when userspace has an open fd Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 09/46] bpf: fix panic in SO_GET_FILTER with native ebpf programs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 27/46] i2c: rcar: enable RuntimePM before registering to the core Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 31/46] workqueue: make sure delayed work run in local cpu Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
  [PATCH 4.1 39/46] sched/preempt: Fix cond_resched_lock() and cond_resched_softirq() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-23 20:10 +0200
    Re: [PATCH 4.1 39/46] sched/preempt: Fix cond_resched_lock() and  cond_resched_softirq() Thomas Backlund <backlund.thomas@gmail.com> - 2015-10-23 22:20 +0200
      Re: [PATCH 4.1 39/46] sched/preempt: Fix cond_resched_lock() and  cond_resched_softirq() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-24 01:30 +0200
  Re: [PATCH 4.1 00/46] 4.1.12-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2015-10-23 22:40 +0200
    Re: [PATCH 4.1 00/46] 4.1.12-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-24 01:30 +0200
      Re: [PATCH 4.1 00/46] 4.1.12-stable review Guenter Roeck <linux@roeck-us.net> - 2015-10-24 03:20 +0200
  Re: [PATCH 4.1 00/46] 4.1.12-stable review Guenter Roeck <linux@roeck-us.net> - 2015-10-24 05:20 +0200
    Re: [PATCH 4.1 00/46] 4.1.12-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-24 15:30 +0200

csiph-web