Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1656164ybe; Tue, 3 Sep 2019 01:21:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxc8xDKf92dvS+GoJ2gKicxoSgaRdJZuS4SJ7ORDigLlGiYwCbjVVz4spvUm88nYJPhPTzB X-Received: by 2002:a63:1b66:: with SMTP id b38mr29193690pgm.54.1567498892185; Tue, 03 Sep 2019 01:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567498892; cv=none; d=google.com; s=arc-20160816; b=nAXmAMHLHssKHybFCXNBi1wr6q+vxBmfmpBm3qRDjjxQJSU2xkKPbtbNrzy/nkgrD2 RwZPVu06HR68kPebxV71VABXzTPPQt2T52JcgedBl9NHWCI/Tql5GVpfq2a3cfiyImcv OuA77kkFR5d+/5B6/hNk8tcGgO0FaJ7iX7XbH3wwwe9E0gteuebJoFHR3RIco8sYTO7w x5x8KPbeOwFz1GwACrcZv0u6HjGQjZ8AuQ6G4M2pwKjSAbk4tTikQgXcFJ8OVYhR9Y6s 7WNl+SEWDWW6PsUg6rPrJMx+YjBByfTkcQnQQTaLwSOWS7T9aNIcy/5WQPBK8VSkO0sc 64PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=7QXMKo+NVWbznk/CTiSjCym5rTT2fbgUIaAhwYYNi/U=; b=fhoEMySJfd04R+79XijnDW8Cf7bmlfpsy6YJB8f4K8e9VGNw4IZ5h6EgqGbwoZEAoM 7Z5CeWJqtcxoFQeUdIF7NSXrze3u5oosfoOMJWMa2KZCGnUsGRIQv7Ib+UWaTrwLDCD/ sIjVbpTZzdRYURi380Z1mf82xABGC1FH7uFbt5FL9QrgW0Ni8I/DBXuFlFbND2aZRCFr 4qQaakZhn3JvPby+PDKAq4sN3khdJtFfvNDiVdtLQUqQeGpru+Q8tPOG5GdwwE8nNvs0 TDFXybOTZXsYSy0KKvK6u4hnyevxOYLOsF69JdbWmk4koZkp0abiCWekPxq4HxHWXv1e zdlA== 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 u69si10836090pgc.298.2019.09.03.01.21.16; Tue, 03 Sep 2019 01:21:32 -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 S1727700AbfICITD (ORCPT + 99 others); Tue, 3 Sep 2019 04:19:03 -0400 Received: from mga14.intel.com ([192.55.52.115]:51418 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726946AbfICITC (ORCPT ); Tue, 3 Sep 2019 04:19:02 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2019 01:19:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,462,1559545200"; d="scan'208";a="198721560" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 03 Sep 2019 01:18:59 -0700 Received: by lahna (sSMTP sendmail emulation); Tue, 03 Sep 2019 11:18:58 +0300 Date: Tue, 3 Sep 2019 11:18:58 +0300 From: Mika Westerberg To: Chris Chiu Cc: Andy Shevchenko , lee.jones@linaro.org, Linux Kernel , Linux Upstreaming Team , Jarkko Nikula Subject: Re: Tweak I2C SDA hold time on GemniLake to make touchpad work Message-ID: <20190903081858.GA2691@lahna.fi.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Jarkko On Tue, Sep 03, 2019 at 04:10:27PM +0800, Chris Chiu wrote: > Hi, > > We're working on the acer Gemnilake laptop TravelMate B118-M for > touchpad not working issue. The touchpad fails to bring up and the > i2c-hid ouput the message as follows > [ 8.317293] i2c_hid i2c-ELAN0502:00: hid_descr_cmd failed > We tried on latest linux kernel 5.3.0-rc6 and it reports the same. > > We then look into I2C signal level measurement to find out why. > The following is the signal output from LA for the SCL/SDA. > https://imgur.com/sKcpvdo > The SCL frequency is ~400kHz from the SCL period, but the SDA > transition is quite weird. Per the I2C spec, the data on the SDA line > must be stable during the high period of the clock. The HIGH or LOW > state of the data line can only change when the clock signal on the > SCL line is LOW. The SDA period span across 2 SCL high, I think > that's the reason why the I2C read the wrong data and fail to initialize. > > Thus, we treak the SDA hold time by the following modification. > > --- a/drivers/mfd/intel-lpss-pci.c > +++ b/drivers/mfd/intel-lpss-pci.c > @@ -97,7 +97,8 @@ static const struct intel_lpss_platform_info bxt_uart_info = { > }; > > static struct property_entry bxt_i2c_properties[] = { > - PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 42), > + PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 230), > PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171), > PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208), > { }, > > The reason why I choose sda hold time is by the Table 10 of > https://www.nxp.com/docs/en/user-guide/UM10204.pdf, the device > must provide a hold time at lease 300ns and and 42 here is relatively > too small. The signal measurement result for the same pin on Windows > is as follows. > https://imgur.com/BtKUIZB > Comparing to the same result running Linux > https://imgur.com/N4fPTYN > > After applying the sda hold time tweak patch above, the touchpad can > be correctly initialized and work. The LA signal is shown as down below. > https://imgur.com/B3PmnIp > > The chart which has yellow mark is the tweak version, the red marks > the original version. > > I need suggestions about whether if the hold time is the value I can tweak? > Or I should modify sda falling time? Please help if any better idea. > > Thanks