From patchwork Mon Jun 11 14:22:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 927683 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 414Fb43hZCz9s2t for ; Tue, 12 Jun 2018 00:22:24 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934327AbeFKOWU (ORCPT ); Mon, 11 Jun 2018 10:22:20 -0400 Received: from mga09.intel.com ([134.134.136.24]:38338 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933467AbeFKOWR (ORCPT ); Mon, 11 Jun 2018 10:22:17 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jun 2018 07:22:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,502,1520924400"; d="scan'208";a="56410349" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.71]) by FMSMGA003.fm.intel.com with ESMTP; 11 Jun 2018 07:22:14 -0700 From: Jarkko Nikula To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Andy Shevchenko , Mika Westerberg , Jarkko Nikula Subject: [PATCH v3 0/8] i2c: designware: Improve debug prints Date: Mon, 11 Jun 2018 17:22:40 +0300 Message-Id: <20180611142248.10798-1-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Motivation here is to improve debug prints and while doing so to remove some duplication and separate timing parameter validation from actual register writes as this parameter validation and/or calculation is needed to do only during probe. Currently debug code prints SCL timing parameters whenever HW is reinitialized but doesn't print importand SDA hold time nor actual bus speed the controller is going to operate. v3: - Fail always if i2c_dw_acquire_lock() returns an error. - Keep include statement order - Remove redundant "ret = 0; " assignment from i2c_dw_set_sda_hold() v2: - SDA hold time configuration moved from "Separate timing parameter setting from HW initalization" patch to a new patch as well as i2c_dw_clk_rate() cleanup. - New patch replacing ___constant_swab32() with swab32(). - Added Andys review by tags to patches 1-2. Jarkko Nikula (8): i2c: designware: Remove needless variable from i2c_dw_init_slave() i2c: designware: Move register access detection to common code i2c: designware: Don't use internal ___constant_swab32 i2c: designware: Call i2c_dw_clk_rate() only once in i2c_dw_init_master() i2c: designware: Move SDA hold time configuration to common code i2c: designware: Separate timing parameter setting from HW initalization i2c: designware: Add debug print for SDA hold time value i2c: designware: Add debug print for bus speed drivers/i2c/busses/i2c-designware-common.c | 75 ++++++++ drivers/i2c/busses/i2c-designware-core.h | 2 + drivers/i2c/busses/i2c-designware-master.c | 190 ++++++++++++--------- drivers/i2c/busses/i2c-designware-slave.c | 46 +---- 4 files changed, 195 insertions(+), 118 deletions(-) Reviewed-by: Andy Shevchenko