Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754802AbdC1Ism (ORCPT ); Tue, 28 Mar 2017 04:48:42 -0400 Received: from mga03.intel.com ([134.134.136.65]:54583 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754563AbdC1Isk (ORCPT ); Tue, 28 Mar 2017 04:48:40 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,236,1486454400"; d="scan'208";a="80089091" From: Tan Chin Yew To: Wolfram Sang , Jarkko Nikula , Andy Shevchenko , Mika Westerberg Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V3] Set sda-hold-time based on ACPI *CNT value Date: Tue, 28 Mar 2017 16:48:01 +0800 Message-Id: <1490690882-11623-1-git-send-email-chin.yew.tan@intel.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1008 Lines: 29 For I2c to operate correctly under all speed mode, sda-hold-time need to be perfectly tuned. However, sda-hold-time is precalculated according to circuit parameter which make it platform-specific. In order to get accurate sda-hold-time for all platforms, pretuned sda-hold-time for particular platform is stored in ACPI table and driver to load the sda holding time from ACPI table. This patch read the I2c sda-hold-time from ACPI table and assigned the suitable hold time based on the i2c clock frequency. Tested on Intel Apollo Lake. Changes in V3: - Remove null handling in function dw_i2c_acpi_params. - Add descriptions to commit message. Changes in V2: - The code is realigned according to suggestion. - "case 400000:" is added on top of "default:" for readability. Tan Chin Yew (1): i2c: designware: Get selected speed mode sda-hold-time via ACPI drivers/i2c/busses/i2c-designware-platdrv.c | 31 ++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) -- 1.9.1