Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6206262imm; Mon, 23 Jul 2018 13:28:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpffjLfqxYmgtsnsdzpuo59wXLbDNJvpMuGdvXq87VmWKcLKg9BEMLDfIdzg+BmKbl1fKAT4 X-Received: by 2002:a62:d646:: with SMTP id r67-v6mr14809756pfg.130.1532377710039; Mon, 23 Jul 2018 13:28:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532377710; cv=none; d=google.com; s=arc-20160816; b=mbyylo4ab6tZUshPHwb+XSaUNd6/uiur+bzuQ84zpp6lWWd5ViBjm/2b1k8m9qew0R WLLYWjQEwL9NpRScy75wVwWXhN6eAYAy+kKE9b+IO4Oxf8VwJe0ayQockZtfQWeYCV2H Jwc2ipC951rsQegOX2RgvzVqkd4GafquWu5q7Oq7BTS9htBEoudw8qSDpfXL1STWfNXf Y+E3MQS9vXw3Hi7jt8Cd1rEE+N/mCuPaH71E+z6cIfachNtK44cwvSJ5FUOErwsPfw5m VXCn4Zx2Cuy8gGXif9ptTo8AaQinU82x/YMFtEKNOvImRN/y+hvlfj+otbyVGlOQd/JY HUNA== 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=cbone1GRBo/aaxsL1kgK7Fbl/E+VVNIlk+JZqno2af8=; b=PmsoyGlgwiAKVyWaPVphOcUbCwx3FvPyeqZsaZs65XTHZnmqeLsj8TzA2f224BRl1u u+GYDnkrRRMzlcwGaahtaKjPwQa+tDg2LR0FFlZstxj/BzwWXf5myMNw/OiZEFnGx+4s 0qSN824z+DUAaKwRG4CS/7pthCUtecImO9YZN1cFuH9uuXHKXC4KQH7tu36UnKE1jrQa n6CY/GsKSw12FfMcWuw8LU5J/xbuiJvs0fevII8NZNfx+jYbMIJr7GXIS9pYvp9nnCE7 BVTBFFwC3aLznzXz9vNX5oSXLs9O/7z2IWlXkCDcqZfC7lIDxjXj7IMW4oSswkxvyfmX sLPg== 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 u15-v6si9965288pfa.28.2018.07.23.13.28.15; Mon, 23 Jul 2018 13:28:30 -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 S2388351AbeGWVaJ (ORCPT + 99 others); Mon, 23 Jul 2018 17:30:09 -0400 Received: from sauhun.de ([88.99.104.3]:51266 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388201AbeGWV3y (ORCPT ); Mon, 23 Jul 2018 17:29:54 -0400 Received: from localhost (p54B3377D.dip0.t-ipconnect.de [84.179.55.125]) by pokefinder.org (Postfix) with ESMTPSA id 64CC3631A51; Mon, 23 Jul 2018 22:27:00 +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 10/12] i2c: rcar: use core to detect 'no zero length' quirk Date: Mon, 23 Jul 2018 22:26:14 +0200 Message-Id: <20180723202617.15230-11-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-rcar.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 2688520110d1..791a4aa34fdd 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -796,14 +796,8 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap, if (ret < 0) goto out; - for (i = 0; i < num; i++) { - /* This HW can't send STOP after address phase */ - if (msgs[i].len == 0) { - ret = -EOPNOTSUPP; - goto out; - } + for (i = 0; i < num; i++) rcar_i2c_request_dma(priv, msgs + i); - } /* init first message */ priv->msg = msgs; @@ -890,6 +884,10 @@ static const struct i2c_algorithm rcar_i2c_algo = { .unreg_slave = rcar_unreg_slave, }; +static const struct i2c_adapter_quirks rcar_i2c_quirks = { + .flags = I2C_AQ_NO_ZERO_LEN, +}; + static const struct of_device_id rcar_i2c_dt_ids[] = { { .compatible = "renesas,i2c-r8a7778", .data = (void *)I2C_RCAR_GEN1 }, { .compatible = "renesas,i2c-r8a7779", .data = (void *)I2C_RCAR_GEN1 }, @@ -943,6 +941,7 @@ static int rcar_i2c_probe(struct platform_device *pdev) adap->dev.parent = dev; adap->dev.of_node = dev->of_node; adap->bus_recovery_info = &rcar_i2c_bri; + adap->quirks = &rcar_i2c_quirks; i2c_set_adapdata(adap, priv); strlcpy(adap->name, pdev->name, sizeof(adap->name)); -- 2.11.0