From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Andi Shyti <andi.shyti@kernel.org>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
linux-renesas-soc@vger.kernel.org
Cc: Krzysztof Adamski <krzysztof.adamski@nokia.com>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Kamal Dasu <kamal.dasu@broadcom.com>, Stefan Roese <sr@denx.de>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Gregory CLEMENT <gregory.clement@bootlin.com>,
Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Subject: [PATCH v2 02/10] i2c: axxia: Use i2c_10bit_addr_*_from_msg() helpers
Date: Thu, 13 Feb 2025 16:07:16 +0200 [thread overview]
Message-ID: <20250213141045.2716943-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20250213141045.2716943-1-andriy.shevchenko@linux.intel.com>
Use i2c_10bit_addr_*_from_msg() helpers instead of local copy.
No functional change intended.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/i2c/busses/i2c-axxia.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index 48916cf45ff7..50030256cd85 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -255,11 +255,6 @@ static int i2c_m_rd(const struct i2c_msg *msg)
return (msg->flags & I2C_M_RD) != 0;
}
-static int i2c_m_ten(const struct i2c_msg *msg)
-{
- return (msg->flags & I2C_M_TEN) != 0;
-}
-
static int i2c_m_recv_len(const struct i2c_msg *msg)
{
return (msg->flags & I2C_M_RECV_LEN) != 0;
@@ -439,20 +434,10 @@ static void axxia_i2c_set_addr(struct axxia_i2c_dev *idev, struct i2c_msg *msg)
{
u32 addr_1, addr_2;
- if (i2c_m_ten(msg)) {
- /* 10-bit address
- * addr_1: 5'b11110 | addr[9:8] | (R/nW)
- * addr_2: addr[7:0]
- */
- addr_1 = 0xF0 | ((msg->addr >> 7) & 0x06);
- if (i2c_m_rd(msg))
- addr_1 |= 1; /* Set the R/nW bit of the address */
- addr_2 = msg->addr & 0xFF;
+ if (msg->flags & I2C_M_TEN) {
+ addr_1 = i2c_10bit_addr_hi_from_msg(msg);
+ addr_2 = i2c_10bit_addr_lo_from_msg(msg);
} else {
- /* 7-bit address
- * addr_1: addr[6:0] | (R/nW)
- * addr_2: dont care
- */
addr_1 = i2c_8bit_addr_from_msg(msg);
addr_2 = 0;
}
--
2.45.1.3035.g276e886db78b
next prev parent reply other threads:[~2025-02-13 14:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 14:07 [PATCH v2 00/10] i2c: busses: Introduce and use i2c_10bit_addr_*_from_msg() Andy Shevchenko
2025-02-13 14:07 ` [PATCH v2 01/10] i2c: Introduce i2c_10bit_addr_*_from_msg() helpers Andy Shevchenko
2025-02-13 16:01 ` AngeloGioacchino Del Regno
2025-02-13 14:07 ` Andy Shevchenko [this message]
2025-02-13 14:07 ` [PATCH v2 03/10] i2c: bcm-kona: Use " Andy Shevchenko
2025-02-13 14:07 ` [PATCH v2 04/10] i2c: brcmstb: " Andy Shevchenko
2025-02-13 14:07 ` [PATCH v2 05/10] i2c: eg20t: " Andy Shevchenko
2025-02-13 14:07 ` [PATCH v2 06/10] i2c: kempld: " Andy Shevchenko
2025-02-13 16:15 ` Wolfram Sang
2025-02-13 16:37 ` Andy Shevchenko
2025-02-13 14:07 ` [PATCH v2 07/10] i2c: mt7621: " Andy Shevchenko
2025-02-13 16:01 ` AngeloGioacchino Del Regno
2025-02-13 16:37 ` Andy Shevchenko
2025-02-13 14:07 ` [PATCH v2 08/10] i2c: rzv2m: " Andy Shevchenko
2025-02-13 14:07 ` [PATCH v2 09/10] i2c: ibm_iic: Use i2c_*bit_addr*_from_msg() helpers Andy Shevchenko
2025-02-13 14:07 ` [PATCH v2 10/10] i2c: mv64xxx: " Andy Shevchenko
2025-03-11 1:12 ` [PATCH v2 00/10] i2c: busses: Introduce and use i2c_10bit_addr_*_from_msg() Andi Shyti
2025-03-12 9:32 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250213141045.2716943-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andi.shyti@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=fabrizio.castro.jz@renesas.com \
--cc=florian.fainelli@broadcom.com \
--cc=gregory.clement@bootlin.com \
--cc=kamal.dasu@broadcom.com \
--cc=krzysztof.adamski@nokia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=sr@denx.de \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).