Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1133642lqp; Fri, 22 Mar 2024 06:39:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXVMOQBom2kXsahP7HOU4DZf1eSU6quS/NUygfVokL4cFLa7RXnrPDbOqkH+bmkjWYbkUdLpTejB8P5yZfmdJsXNXDYz/3jAxip5hJmWQ== X-Google-Smtp-Source: AGHT+IEHOQ07sqsysQNGuL1wxyIwykOiC1eOvJMoKq9dYZ7BVgDwsZwnzMmofdPyuIyryZarFWvJ X-Received: by 2002:ad4:56e4:0:b0:696:7522:f67e with SMTP id cr4-20020ad456e4000000b006967522f67emr86769qvb.11.1711114751270; Fri, 22 Mar 2024 06:39:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711114751; cv=pass; d=google.com; s=arc-20160816; b=UynnrRLw8Kpt5WPqSWLeR9sa8dbPrDvrT9O5JVQ9k2armSo+gAqI/rBHIuiC0Gey2U A0Iqs5HRejoudjJ6LJRu5KRf7ZAc6V4NcDLfPnJFvrvIpmf8aNaJSXHEmRY3ftmFyOqL anYIpny23ZK2uhAZ75Udk0ndkq9uwSnX1q2Phov6NDowb4MOcQdIGatN2J+VGQqBLHs0 +ix/hpAS7C7tai3ZZmfvwO4/tz1ooE89dP6eR2BNYSSI9EIV7M+lP5BMif9rqf3vfKDD rfMb53ZfWdRDHOR3geXLiB+lDg3LMXNvTkNLoXzmjbwbDyzT8+nxG2964QTKA+wCAYOM efTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=q9awUK66ih3cxClf+OK6PD+a5C0mloAeIXzXtRewe0s=; fh=QU1EoIhIci84RJaMyW5ioQE3InGtWf//AimTQF2X2U0=; b=U2ZG+B50uPQrJ+tkz6jS385aUnfqZtUH+TfQl0aQwe0Rgl9cFIYecsSxDXr1q6NxgB OioeANbKmnE52hsavzjQVSqewo6Vs56pFhPTcsBqmEF9BdfilAUae5nvO4E4JihvykAg fgRQFMNVgKBwTwaf1VmMOmXzJMFGeChEnOw3xF1LEMaIErXT0PGU0aTx8VkFf7ja8Re3 xJjayFejLiHDemv1H56/pHGsmVSWbwh/ffhEXg7rp+YqraSs9U8UMK9j1Glei9vGqHzL Wu4NVO81HYCfcudXwO5Bsng+Enuna5178JOeNfm9/5eBFkHzMuhYfJ2EluO5PQ6IwLvu l/kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=WXjSqLKr; arc=pass (i=1 spf=pass spfdomain=sang-engineering.com dkim=pass dkdomain=sang-engineering.com); spf=pass (google.com: domain of linux-kernel+bounces-111531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111531-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id kl20-20020a056214519400b0068fc839406csi2005000qvb.378.2024.03.22.06.39.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 06:39:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=WXjSqLKr; arc=pass (i=1 spf=pass spfdomain=sang-engineering.com dkim=pass dkdomain=sang-engineering.com); spf=pass (google.com: domain of linux-kernel+bounces-111531-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111531-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8E49E1C220CE for ; Fri, 22 Mar 2024 13:38:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F011E664B2; Fri, 22 Mar 2024 13:27:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="WXjSqLKr" Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 016026312D for ; Fri, 22 Mar 2024 13:27:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.117.254.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711114047; cv=none; b=Kp4DuUoqBXX+TYtFQGVGFfNCCJdlMQJsMGF5XEvjY2GIfJahmZoHFYufMJzMi+FzzS9mbwRBT8UTJNLsoecakRTwfSUpFor7ZEbVtXuqmNMei63une2xwJuBnDYQIOrjNGg+0ebMJ0qPdfoiIbz7aP9+moExggg2b9Va7GPSgLM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711114047; c=relaxed/simple; bh=Vnl7xgaAkjx+04bzp8e0wepchmi5dvt8Fv1N7l11klg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BQUHAFtYwJgmA3geFrA5Z2SKLxs2fe61fsjIqeBZeSyeTJFHIWAhpSg6+jZDY/BBxDwNn11ohtmh7V7ateFeo6oVFYq73+uGqaGk/zHHkQG/yYJ3w47g5ITN6UJtK5S5E0r5VBzdvb2WetDDwdiRFbRDbIaM+QU80sAJv++bKD0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com; spf=pass smtp.mailfrom=sang-engineering.com; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b=WXjSqLKr; arc=none smtp.client-ip=194.117.254.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sang-engineering.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=k1; bh=q9awUK66ih3cxClf+OK6PD+a5C0mloAeIXzXtRewe0s=; b=WXjSqL KrBBsD1jGigAfGAL+K4qkhUyPMVxqmUNq+ABWOAYICUcC/yz7dGMFFTbEHGwjuQC ul49r+QkL8I8OJZLIIJ/s/VWr8PtA7dYORzVfmKv/YdEq3cu4VS+gqVYGLFeOFgB R0KK1ufbVJhh5UNICcd1LCCtGKfNZHCyZK/axqPlXdKF+VC4xlNvfH/J86nuD3Ut eNJmFKbMTEeCPW4pw7+7MmLhYmiZr4mFnk4VoPMbMpixRnv/JNYvkuRV2gqb/G4r jBJEp+wvuHL9/CXABQu4L8T70zUjJPkdm2Ra4ewakHivIbPPfZLlsQu8Ae5FwApt 3afwCr5rpMG2G0rg== Received: (qmail 3871926 invoked from network); 22 Mar 2024 14:27:05 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 22 Mar 2024 14:27:05 +0100 X-UD-Smtp-Session: l3s3148p1@HMKfxz8UPpRehhtF From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Patrice Chotard , Andi Shyti , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 53/64] i2c: st: reword according to newest specification Date: Fri, 22 Mar 2024 14:25:46 +0100 Message-ID: <20240322132619.6389-54-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322132619.6389-1-wsa+renesas@sang-engineering.com> References: <20240322132619.6389-1-wsa+renesas@sang-engineering.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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; 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; - } 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, }; -- 2.43.0