public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Binbin Zhou <zhoubinbin@loongson.cn>
Cc: Wolfram Sang <wsa@kernel.org>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-i2c@vger.kernel.org, loongarch@lists.linux.dev,
	devicetree@vger.kernel.org, Huacai Chen <chenhuacai@loongson.cn>,
	WANG Xuerui <kernel@xen0n.name>, Arnd Bergmann <arnd@arndb.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Jianmin Lv <lvjianmin@loongson.cn>
Subject: Re: [PATCH V3 4/5] i2c: ls2x: Add driver for Loongson-2K/LS7A I2C controller
Date: Tue, 29 Nov 2022 14:53:09 +0200	[thread overview]
Message-ID: <Y4YAtWgQieDJV1bG@smile.fi.intel.com> (raw)
In-Reply-To: <ada74168-4aef-b73e-ec47-437dfcdcea77@loongson.cn>

On Tue, Nov 29, 2022 at 07:34:58PM +0800, Binbin Zhou wrote:
> 在 2022/11/28 21:24, Andy Shevchenko 写道:
> > On Mon, Nov 28, 2022 at 08:03:40PM +0800, Binbin Zhou wrote:
> > > 在 2022/11/25 18:41, Andy Shevchenko 写道:
> > > > On Fri, Nov 25, 2022 at 04:55:20PM +0800, Binbin Zhou wrote:

...

> > > > > +static int ls2x_i2c_start(struct i2c_adapter *adap, struct i2c_msg *msgs)
> > > > > +{
> > > > > +	struct ls2x_i2c_dev *dev = i2c_get_adapdata(adap);
> > > > > +	unsigned char addr = i2c_8bit_addr_from_msg(msgs);
> > > > > +
> > > > > +	reinit_completion(&dev->cmd_complete);
> > > > > +	addr |= (msgs->flags & I2C_M_RD) ? 1 : 0;
> > > > Why is this needed?
> > > In the ls2x I2C controller, the bit 0 of TXR indicates the read/write status
> > > when transferring the address.
> > Yes, I understand this. I don't understand why do you need this twice.
> 
> Are you saying that the "is_read" variable in ls2x_i2c_xfer_one() already
> indicates the read/write state of data transfer?
> 
> I just didn't think it was necessary to take "is_read" as an argument to
> ls2x_i2c_start() at the time, since we could get it from "msg".

Have you checked what i2c_8bit_addr_from_msg() is doing?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-11-29 12:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25  8:54 [PATCH V3 0/5] i2c: ls2x: Add support for the Loongson-2K/LS7A I2C controller Binbin Zhou
2022-11-25  8:54 ` [PATCH V3 1/5] i2c: gpio: Fix potential unused warning for 'i2c_gpio_dt_ids' Binbin Zhou
2022-11-25 10:21   ` Andy Shevchenko
2022-11-25 10:35   ` Arnd Bergmann
2022-11-25  8:54 ` [PATCH V3 2/5] i2c: gpio: Add support on ACPI-based system Binbin Zhou
2022-11-25 10:23   ` Andy Shevchenko
2022-11-28  1:28     ` Binbin Zhou
2022-11-25  8:54 ` [PATCH V3 3/5] dt-bindings: i2c: add bindings for Loongson LS2X I2C Binbin Zhou
2022-11-27 20:49   ` Krzysztof Kozlowski
2022-11-28 12:24     ` Binbin Zhou
2022-11-28 12:37       ` Krzysztof Kozlowski
2022-11-28 14:15       ` Krzysztof Kozlowski
2022-11-29 13:24         ` Binbin Zhou
2022-11-27 20:50   ` Krzysztof Kozlowski
2022-11-25  8:55 ` [PATCH V3 4/5] i2c: ls2x: Add driver for Loongson-2K/LS7A I2C controller Binbin Zhou
2022-11-25 10:41   ` Andy Shevchenko
2022-11-28 12:03     ` Binbin Zhou
2022-11-28 13:24       ` Andy Shevchenko
2022-11-29 11:34         ` Binbin Zhou
2022-11-29 12:53           ` Andy Shevchenko [this message]
2022-11-29 13:19             ` Binbin Zhou
2022-11-25  8:55 ` [PATCH V3 5/5] LoongArch: Enable LS2X I2C in loongson3_defconfig Binbin Zhou
2022-11-26 22:25 ` [PATCH V3 3/5] dt-bindings: i2c: add bindings for Loongson LS2X I2C Rob Herring

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=Y4YAtWgQieDJV1bG@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=chenhuacai@loongson.cn \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@xen0n.name \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=lvjianmin@loongson.cn \
    --cc=mika.westerberg@linux.intel.com \
    --cc=robh+dt@kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=wsa@kernel.org \
    --cc=zhoubinbin@loongson.cn \
    /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