From patchwork Mon Jul 23 20:26:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10540883 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 902C717FD for ; Mon, 23 Jul 2018 20:27:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E74F1FF66 for ; Mon, 23 Jul 2018 20:27:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 720E1205AD; Mon, 23 Jul 2018 20:27:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SUSPICIOUS_RECIPS autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2AC401FF66 for ; Mon, 23 Jul 2018 20:27:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=e54+Q3FgGrFTkK/deS64gBVFamJRkv+IE4AeLGVXmTo=; b=Qv9 32g068RHu5la1Lp4wwJpwizt+sAKVq5KwzP1bL6jcX/Z6JUu0hizWQgixCT+vGmfS6odw9qftwQz2 dA1iH+xiAi4d4JyIYx93XSEje9WtFgOeCZPDOUl/otokEafLtK/nRX9f2wurdSBqtkrwUfEMjJ70a 76oNOBvfEPlUy0s/YVylal/TSWfNaTWSLBZjDwZYCg2VXpJ3RREWZR+xGiNRenpyn9vw/Ctr4qYyn HKGVfzxzPrj5QtJwxEFvenc0Xlyhi9bwC93ZXCjGvjFdqXnXDiKmJ481Nb5MQ4D9uh/ELEJH7nnvI aL4yZ0rZhGaU5ywqJ1yWrFYOOe9CWyw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhhQl-0008LP-RG; Mon, 23 Jul 2018 20:27:43 +0000 Received: from sauhun.de ([88.99.104.3] helo=pokefinder.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhhQB-0007hf-R0 for linux-arm-kernel@lists.infradead.org; Mon, 23 Jul 2018 20:27:09 +0000 Received: from localhost (p54B3377D.dip0.t-ipconnect.de [84.179.55.125]) by pokefinder.org (Postfix) with ESMTPSA id 15639631A49; Mon, 23 Jul 2018 22:26:52 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Subject: [PATCH 00/12] i2c: quirks: add zero length checks and update drivers Date: Mon, 23 Jul 2018 22:26:04 +0200 Message-Id: <20180723202617.15230-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180723_132708_016237_0E2B027E X-CRM114-Status: UNSURE ( 8.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Wolfram Sang , linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, linux-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP I had this idea for quite some time on my todo list but a soon to be implemented refactoring in the i2c-rcar driver now finally made me do it. Add a 'can't do 0 length messages' quirk to the quirk infrastructure for and remove the manual handling from the drivers. This makes the quirk much more visible. (Quite some prominent vendors in that list) We also have a centralized place to handle updates to the quirk detection if that is ever needed. I have tested this with the i2c-rcar and i2c-sh_mobile driver on a Renesas SalvatorXS board equipped with M3-N (r8a77965). A git branch can be found here: git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/quirk-no-zero-len Looking forward to comments, reviews, tests... Thanks, Wolfram Wolfram Sang (12): i2c: quirks: add zero length checks i2c: designware-master: use core to detect 'no zero length' quirk i2c: mxs: use core to detect 'no zero length' quirk i2c: omap: use core to detect 'no zero length' quirk i2c: pmcmsp: use core to detect 'no zero length' quirk i2c: qup: use core to detect 'no zero length' quirk i2c: stu300: use core to detect 'no zero length' quirk i2c: tegra: use core to detect 'no zero length' quirk i2c: zx2967: use core to detect 'no zero length' quirk i2c: rcar: use core to detect 'no zero length' quirk i2c: xlr: use core to detect 'no zero length' quirk i2c: sh_mobile: use core to detect 'no zero length read' quirk drivers/i2c/busses/i2c-designware-master.c | 12 +++++------- drivers/i2c/busses/i2c-mxs.c | 8 +++++--- drivers/i2c/busses/i2c-omap.c | 8 +++++--- drivers/i2c/busses/i2c-pmcmsp.c | 17 +---------------- drivers/i2c/busses/i2c-qup.c | 14 ++++++-------- drivers/i2c/busses/i2c-rcar.c | 13 ++++++------- drivers/i2c/busses/i2c-sh_mobile.c | 10 +++++----- drivers/i2c/busses/i2c-stu300.c | 12 ++++++------ drivers/i2c/busses/i2c-tegra.c | 4 +--- drivers/i2c/busses/i2c-xlr.c | 11 +++++------ drivers/i2c/busses/i2c-zx2967.c | 8 +++++--- drivers/i2c/i2c-core-base.c | 6 ++++++ include/linux/i2c.h | 4 ++++ 13 files changed, 60 insertions(+), 67 deletions(-) Reviewed-by: Andy Shevchenko