Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2994701rwb; Thu, 29 Sep 2022 19:01:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7d7l61ASZy2SFkDoxTHcINT/9NjgL11KW5JEx1j0HD77ZLCZBunqIJUwUTn3sIRov8KMI7 X-Received: by 2002:aa7:c3d7:0:b0:457:e335:20a9 with SMTP id l23-20020aa7c3d7000000b00457e33520a9mr5885138edr.423.1664503309038; Thu, 29 Sep 2022 19:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664503309; cv=none; d=google.com; s=arc-20160816; b=Iqm8gjLBI1xvIPproAVQXxrCMCkHRAqFMazF/EhJaeWETo4nSGqrvpmdHz+ZfHRbg5 BZL8nItqESOtHUx6Xs45/ro4ENgJ7GvEREEoprNZOQf7NVR67kvIkkhJiC2M94EOiun5 Qrlz1UK9BVCdIe/QDS2exUpcW99a9LYWy58BVX7zBrcu3zMmtylQk40zxQ+rbonScqJg DOgioSE+C/O13+Lxb+QJTI18V+0l4FaO/WLUSBJ7QH5AQ2q9D3Z6SLvyWpWzictos+3N kJkkS+1U/txESO9h4WTdKKM5xzDpoUU85TiHAnsqxM+9PkhMdhQ39VLl3TKbSElmyW5c lgcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=A7Rz5gWl6HkAQFs5NV8LSn1oUW1ytTIkEVuzEL7/esk=; b=hAPM0xgyOiFnxFYan0Jrbvarc7ZJ4Mh8ShafvkIYH8WTq45xbblb6MQkT5isKcq54L n7dmvD4vNzf/H2CCP20V8zW78sRCKM8/oRLBlJTA4x9JOOojJo9lk556LohJJISRJ1PZ xMoW+mJ/46K+QSKzPw1acga++IxehXOghOJJHW9QL5R+y/yPMtCJT2LFF9zSx+Oet435 wpgMKQ5ekLh0mKvukjjkDZw5RYG+51ZNG255TeOG2VT4sNqLFvg6lMUUf+H3DCqEG39I DLGpian/ZHaNQuUMKnbzpH37PKAJWBKlQHEN36NTNNrj9q5k448zx6ktxME6up0ah4JO Qn/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j6-20020a17090686c600b0078223ff2756si645705ejy.244.2022.09.29.19.01.22; Thu, 29 Sep 2022 19:01:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbiI3BvS (ORCPT + 99 others); Thu, 29 Sep 2022 21:51:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbiI3BvQ (ORCPT ); Thu, 29 Sep 2022 21:51:16 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB1BCF1905; Thu, 29 Sep 2022 18:51:15 -0700 (PDT) Received: from dggpeml500021.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MdtPr0J57z1P6rt; Fri, 30 Sep 2022 09:46:56 +0800 (CST) Received: from localhost.localdomain (10.157.217.52) by dggpeml500021.china.huawei.com (7.185.36.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 30 Sep 2022 09:51:13 +0800 From: Tao Lan To: , CC: taolan Subject: [PATCH] i2c-hix5hd2: Add I2C_M_STOP flag support for i2c-hix5hd2 driver. Date: Fri, 30 Sep 2022 01:45:07 +0000 Message-ID: <20220930014507.5612-1-taolan@huawei.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.157.217.52] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500021.china.huawei.com (7.185.36.21) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: taolan For compatibility, some devices need to work with controller between messages using a stop. Signed-off-by: taolan --- drivers/i2c/busses/i2c-hix5hd2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-hix5hd2.c b/drivers/i2c/busses/i2c-hix5hd2.c index 61ae58f57047..e5042e34ecc7 100644 --- a/drivers/i2c/busses/i2c-hix5hd2.c +++ b/drivers/i2c/busses/i2c-hix5hd2.c @@ -360,7 +360,11 @@ static int hix5hd2_i2c_xfer(struct i2c_adapter *adap, pm_runtime_get_sync(priv->dev); for (i = 0; i < num; i++, msgs++) { - stop = (i == num - 1); + if ((i == num - 1) || (msgs->flags & I2C_M_STOP)) + stop = 1; + else + stop = 0; + ret = hix5hd2_i2c_xfer_msg(priv, msgs, stop); if (ret < 0) goto out; -- 2.22.0