Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6206112imm; Mon, 23 Jul 2018 13:28:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe30lXbuS9vRRq4aIiY1fLJ9Y6ahFVHxhuUjDmxQ6VjzqyeN+UfJcKhDa6XoOTH0qMP9ZJi X-Received: by 2002:a63:ad07:: with SMTP id g7-v6mr13391428pgf.19.1532377699385; Mon, 23 Jul 2018 13:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532377699; cv=none; d=google.com; s=arc-20160816; b=YEs1YwGnTTkeL86TGeMSakLHVFhTUIWMeKBf1EAz3ShTonmDXMyd3F4KbkUXV6BNxr MBgY5sD0eI5WBaK9BilJX/1yMkLacbxUiY/WOphKXK6PXZAvLbbv0OhfWoIdaWNtMNC1 rO+jFyAyOijFJspwuvRTkGwRxXrZvsHT8V5725TbAvyyEho/YuUZMUXNSQd/lkpg5l/Q laYtBQlcFmkN+8gKaoeBPrDLxEHE6PVYluoZe1OahKxixUoT56MIcqg42qGuJ2GliNb4 o8NnYONndwCr2ajRGOth+H/iqzb12RLBSaTIsXV33xBKLuUTCE7nWEABQPsVXwo36Cor tHFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=TbgegKwXkApoxMyZi0fEd9V8P2DmgduWZ2Ge0nfbohQ=; b=Vus6yYqaFnxKKqjHlVPbi5lFP/pG8LCyOekTybnkxaKft+OuwBA4+xJfauD/kKFx7T 1+alCSQyuEzDRW+ugK514VcMcB/Gbq+SGfGXeBdsTRu+JYsICgK4gcq7wmUYzsxqIz08 iik9F/jwpjD93kzqXygicramiXkJFIfQUl7cLDSD8lGPUIGbB8r0ywe11wIRk8bB8P4H 0hkeFufzVRVht0Bfn8AaIA8VDb92vGpho5CQJyzaiY8KR5I1ayozYhl82VJWoWX98OSc 1ccZaUiDR+uWXbNIEi3TOk3JgR5OFPBFEApnnhsatbpK4EkVptgVLlLOdawkO5ZcOyZc /WjQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si8659945plw.519.2018.07.23.13.28.04; Mon, 23 Jul 2018 13:28:19 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388338AbeGWVaB (ORCPT + 99 others); Mon, 23 Jul 2018 17:30:01 -0400 Received: from sauhun.de ([88.99.104.3]:51256 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388149AbeGWV34 (ORCPT ); Mon, 23 Jul 2018 17:29:56 -0400 Received: from localhost (p54B3377D.dip0.t-ipconnect.de [84.179.55.125]) by pokefinder.org (Postfix) with ESMTPSA id 6B120631A54; Mon, 23 Jul 2018 22:27:02 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang , linux-kernel@vger.kernel.org Subject: [PATCH 12/12] i2c: sh_mobile: use core to detect 'no zero length read' quirk Date: Mon, 23 Jul 2018 22:26:16 +0200 Message-Id: <20180723202617.15230-13-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180723202617.15230-1-wsa+renesas@sang-engineering.com> References: <20180723202617.15230-1-wsa+renesas@sang-engineering.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org And don't reimplement in the driver. Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-sh_mobile.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index 5fda4188a9e5..9c7f6f8ceb22 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c @@ -613,11 +613,6 @@ static void sh_mobile_i2c_xfer_dma(struct sh_mobile_i2c_data *pd) static int start_ch(struct sh_mobile_i2c_data *pd, struct i2c_msg *usr_msg, bool do_init) { - if (usr_msg->len == 0 && (usr_msg->flags & I2C_M_RD)) { - dev_err(pd->dev, "Unsupported zero length i2c read\n"); - return -EOPNOTSUPP; - } - if (do_init) { /* Initialize channel registers */ iic_wr(pd, ICCR, ICCR_SCP); @@ -758,6 +753,10 @@ static const struct i2c_algorithm sh_mobile_i2c_algorithm = { .master_xfer = sh_mobile_i2c_xfer, }; +static const struct i2c_adapter_quirks sh_mobile_i2c_quirks = { + .flags = I2C_AQ_NO_ZERO_LEN_READ, +}; + /* * r8a7740 chip has lasting errata on I2C I/O pad reset. * this is work-around for it. @@ -925,6 +924,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) adap->owner = THIS_MODULE; adap->algo = &sh_mobile_i2c_algorithm; + adap->quirks = &sh_mobile_i2c_quirks; adap->dev.parent = &dev->dev; adap->retries = 5; adap->nr = dev->id; -- 2.11.0