From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 823ACC54E71 for ; Fri, 22 Mar 2024 17:11:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eZXHOutfHLgjpNjlice3rexi3+LNQkTdN1BrB18oZR4=; b=SyUFBCcs11m3Wp twjYDoA1vCvVMr/BfV5PXE8OCgxK4pnc6OigmgXarmT209DBqQdHeQ4YbZTVFh94/SHZtbgpID46V hXbIfRNM5Q6a9zLJBmcmHGqeU0yRAYnBNeOCKxy8u+Xbx7jbt6TnNoUikzEnGaWyU/jSwna5jGV2/ xsHHOka322ys+/1VMjQnQ+pwh+OMiAVsvkF0flCSWUNu66RdVJIZJPCqvPgVXIwIrRIixw1mrksc5 cNAHXP0XZMqEImUmUiCHa8i/IXSRFMMnAkOWpWqGIoa9DSzL+b7qkDGuRB8xwAomphi4ruTzOxh6p iq9MDq45ER0Dy39mALSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rniQJ-000000087JW-1mdO; Fri, 22 Mar 2024 17:11:19 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rniQG-000000087GW-0vcK for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2024 17:11:18 +0000 Received: from [100.64.224.211] (unknown [20.29.225.195]) by linux.microsoft.com (Postfix) with ESMTPSA id 4321E20B74C0; Fri, 22 Mar 2024 10:11:13 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4321E20B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1711127473; bh=A1TVEJpLHHHN82us12nZFBECo9Q2m63RNd7pytTA8vQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=TJH1vFnZkA/hZ797UCRMWR1g35B0Z0Nqvyg4pF7+SezxJKCGxFvqhHqZL5K4LslAJ KwD3RIpaJbGSBlcjj3T3yupxQvjVdBwSFoGjjEeLGK2tlQxdVQR0D5E0bpSDPmieHL nRX3X+evl41FkSyF0+wVPdTDwopmj/fdijND48wM= Message-ID: Date: Fri, 22 Mar 2024 10:11:11 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 53/64] i2c: st: reword according to newest specification To: Wolfram Sang , linux-i2c@vger.kernel.org Cc: Patrice Chotard , Andi Shyti , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240322132619.6389-1-wsa+renesas@sang-engineering.com> <20240322132619.6389-54-wsa+renesas@sang-engineering.com> Content-Language: en-CA From: Easwar Hariharan In-Reply-To: <20240322132619.6389-54-wsa+renesas@sang-engineering.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240322_101116_537688_823AC0A0 X-CRM114-Status: GOOD ( 22.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 3/22/2024 6:25 AM, Wolfram Sang wrote: > Match the wording of this driver wrt. the newest I2C v7, SMBus 3.2, I3C > specifications and replace "master/slave" with more appropriate terms. > They are also more specific because we distinguish now between a remote > entity ("client") and a local one ("target"). > > Signed-off-by: Wolfram Sang > --- > drivers/i2c/busses/i2c-st.c | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c > index ce2333408904..9bd45ae83c0c 100644 > --- a/drivers/i2c/busses/i2c-st.c > +++ b/drivers/i2c/busses/i2c-st.c > @@ -2,7 +2,7 @@ > /* > * Copyright (C) 2013 STMicroelectronics > * > - * I2C master mode controller driver, used in STMicroelectronics devices. > + * I2C host controller driver, used in STMicroelectronics devices. > * > * Author: Maxime Coquelin > */ > @@ -150,7 +150,7 @@ struct st_i2c_timings { > > /** > * struct st_i2c_client - client specific data > - * @addr: 8-bit slave addr, including r/w bit > + * @addr: 8-bit client addr, including r/w bit > * @count: number of bytes to be transfered > * @xfered: number of bytes already transferred > * @buf: data buffer > @@ -647,7 +647,7 @@ static int st_i2c_xfer_msg(struct st_i2c_dev *i2c_dev, struct i2c_msg *msg, > { > struct st_i2c_client *c = &i2c_dev->client; > u32 ctl, i2c, it; > - unsigned long timeout; > + unsigned long time_left; Thanks for doing this. Is the timeout v/s time_left language also due to the specification change? A link to the specification(s) in the commit message would be nice to have > int ret; > > c->addr = i2c_8bit_addr_from_msg(msg); > @@ -667,7 +667,7 @@ static int st_i2c_xfer_msg(struct st_i2c_dev *i2c_dev, struct i2c_msg *msg, > i2c |= SSC_I2C_ACKG; > st_i2c_set_bits(i2c_dev->base + SSC_I2C, i2c); > > - /* Write slave address */ > + /* Write client address */ > st_i2c_write_tx_fifo(i2c_dev, c->addr); > > /* Pre-fill Tx fifo with data in case of write */ > @@ -685,15 +685,12 @@ static int st_i2c_xfer_msg(struct st_i2c_dev *i2c_dev, struct i2c_msg *msg, > st_i2c_set_bits(i2c_dev->base + SSC_I2C, SSC_I2C_STRTG); > } > > - timeout = wait_for_completion_timeout(&i2c_dev->complete, > + time_left = wait_for_completion_timeout(&i2c_dev->complete, > i2c_dev->adap.timeout); > ret = c->result; > > - if (!timeout) { > - dev_err(i2c_dev->dev, "Write to slave 0x%x timed out\n", > - c->addr); > + if (!time_left) > ret = -ETIMEDOUT; > - } Why did we lost the dev_err() here? > > i2c = SSC_I2C_STOPG | SSC_I2C_REPSTRTG; > st_i2c_clr_bits(i2c_dev->base + SSC_I2C, i2c); > @@ -769,7 +766,7 @@ static u32 st_i2c_func(struct i2c_adapter *adap) > } > > static const struct i2c_algorithm st_i2c_algo = { > - .master_xfer = st_i2c_xfer, > + .xfer = st_i2c_xfer, > .functionality = st_i2c_func, > }; > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel