Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4243819imm; Fri, 18 May 2018 01:39:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo1tOwDV+lpUQHkfpv7hn+76wQ+Lb/ITwfI//zjlwV0ibAWI4kAb7gGFHqBWBOdGbkykRy0 X-Received: by 2002:a65:438b:: with SMTP id m11-v6mr6492113pgp.99.1526632791346; Fri, 18 May 2018 01:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526632791; cv=none; d=google.com; s=arc-20160816; b=M6nDGYqfxAM9C7f0FT/IePZivZUrSErJTv5H/4zsO6M94pqkN+578sk6BF+w+7ALJd LSgUAFM0zuCuvml1+2sSYcHxbQuXiexcwmx5ayNUH0aZpGW5k1pZ5SvVyw5xjz9Akmlf 50QfJs1/DgLStcc/yDi7xO08ADfqQKB9T3fZAsV+kF9hzTA4nCH6BF+nUNccoqkzGSA9 xpX10gol+fGRNmEbB51F9pqm41HW1cL2SFCmOFXKphLxlqUsfso2/KhlSBbSGmFyMhGT 2yfgItUJqR21geEwNqq0zwojd+dq4vPXaOl31qSnOygWNUyffG3e1ezkfuvgcd5sev/o HAzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=THG1zZphd/LXQkEHpFjp0+gFL76VrhuUEeDVNxMQ+0k=; b=NkokszgHyX0tz3OWKz+q8U0VjDPViG+t6qYbd3Z5qwtWK2v170NKLoWo+nIbnGNcfL MkXODpM50c3vSTZngampnCYkrFLIrB5Tt0rygHHOceGaVDTOXOsWjSDXWcYgvbzWVpZr bgDKEhzqzERyO4kHT6EchzntgVyXVr4Pz882hjHYTjv/ceyTwiHNWnJx8Jd7dT2GfKCq p9bZkv65cTERQAPRw/9hksI2u/LeNE5eECbDOLYLTlabondrpDk+DOzHzSkwkfMojRkc eiiJGvwU1360cNqRDTEMo1GprnnJFHCONWvw+4xLOn7S5n2s0jmXL8/OFwFPPUk8o1f0 U0Zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12-v6si5584798pgp.119.2018.05.18.01.39.36; Fri, 18 May 2018 01:39:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753815AbeERIiR (ORCPT + 99 others); Fri, 18 May 2018 04:38:17 -0400 Received: from mga12.intel.com ([192.55.52.136]:46326 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752373AbeERIiO (ORCPT ); Fri, 18 May 2018 04:38:14 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 May 2018 01:38:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,413,1520924400"; d="scan'208";a="200438768" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.77]) by orsmga004.jf.intel.com with ESMTP; 18 May 2018 01:38:10 -0700 From: Jarkko Nikula To: linux-kernel@vger.kernel.org Cc: Lee Jones , Andy Shevchenko , Mika Westerberg , linux-i2c@vger.kernel.org, linux-input@vger.kernel.org, Jian-Hong Pan , Chris Chiu , Daniel Drake , Jarkko Nikula , stable@vger.kernel.org Subject: [PATCH] mfd: intel-lpss: Fix Intel Cannon Lake LPSS I2C input clock Date: Fri, 18 May 2018 11:38:27 +0300 Message-Id: <20180518083827.20626-1-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reported-by: Chris Chiu Reported-by: Daniel Drake Signed-off-by: Jarkko Nikula --- Hi Jian-Hong, Chris and Daniel. Could you test does this fix your touchpad issue? --- drivers/mfd/intel-lpss-pci.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index d1c46de89eb4..d9ae983095c5 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -124,6 +124,11 @@ static const struct intel_lpss_platform_info apl_i2c_info = { .properties = apl_i2c_properties, }; +static const struct intel_lpss_platform_info cnl_i2c_info = { + .clk_rate = 216000000, + .properties = spt_i2c_properties, +}; + static const struct pci_device_id intel_lpss_pci_ids[] = { /* BXT A-Step */ { PCI_VDEVICE(INTEL, 0x0aac), (kernel_ulong_t)&bxt_i2c_info }, @@ -207,13 +212,13 @@ static const struct pci_device_id intel_lpss_pci_ids[] = { { PCI_VDEVICE(INTEL, 0x9daa), (kernel_ulong_t)&spt_info }, { PCI_VDEVICE(INTEL, 0x9dab), (kernel_ulong_t)&spt_info }, { PCI_VDEVICE(INTEL, 0x9dfb), (kernel_ulong_t)&spt_info }, - { PCI_VDEVICE(INTEL, 0x9dc5), (kernel_ulong_t)&spt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x9dc6), (kernel_ulong_t)&spt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x9dc5), (kernel_ulong_t)&cnl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x9dc6), (kernel_ulong_t)&cnl_i2c_info }, { PCI_VDEVICE(INTEL, 0x9dc7), (kernel_ulong_t)&spt_uart_info }, - { PCI_VDEVICE(INTEL, 0x9de8), (kernel_ulong_t)&spt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x9de9), (kernel_ulong_t)&spt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x9dea), (kernel_ulong_t)&spt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x9deb), (kernel_ulong_t)&spt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x9de8), (kernel_ulong_t)&cnl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x9de9), (kernel_ulong_t)&cnl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x9dea), (kernel_ulong_t)&cnl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x9deb), (kernel_ulong_t)&cnl_i2c_info }, /* SPT-H */ { PCI_VDEVICE(INTEL, 0xa127), (kernel_ulong_t)&spt_uart_info }, { PCI_VDEVICE(INTEL, 0xa128), (kernel_ulong_t)&spt_uart_info }, @@ -240,10 +245,10 @@ static const struct pci_device_id intel_lpss_pci_ids[] = { { PCI_VDEVICE(INTEL, 0xa32b), (kernel_ulong_t)&spt_info }, { PCI_VDEVICE(INTEL, 0xa37b), (kernel_ulong_t)&spt_info }, { PCI_VDEVICE(INTEL, 0xa347), (kernel_ulong_t)&spt_uart_info }, - { PCI_VDEVICE(INTEL, 0xa368), (kernel_ulong_t)&spt_i2c_info }, - { PCI_VDEVICE(INTEL, 0xa369), (kernel_ulong_t)&spt_i2c_info }, - { PCI_VDEVICE(INTEL, 0xa36a), (kernel_ulong_t)&spt_i2c_info }, - { PCI_VDEVICE(INTEL, 0xa36b), (kernel_ulong_t)&spt_i2c_info }, + { PCI_VDEVICE(INTEL, 0xa368), (kernel_ulong_t)&cnl_i2c_info }, + { PCI_VDEVICE(INTEL, 0xa369), (kernel_ulong_t)&cnl_i2c_info }, + { PCI_VDEVICE(INTEL, 0xa36a), (kernel_ulong_t)&cnl_i2c_info }, + { PCI_VDEVICE(INTEL, 0xa36b), (kernel_ulong_t)&cnl_i2c_info }, { } }; MODULE_DEVICE_TABLE(pci, intel_lpss_pci_ids); -- 2.17.0