All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
To: Wolfram Sang <wsa@kernel.org>
Cc: linux-i2c <linux-i2c@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
	Lori Hikichi <lori.hikichi@broadcom.com>,
	Robert Richter <rrichter@marvell.com>,
	Nishka Dasgupta <nishkadg.linux@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 2/2] i2c: iproc: add slave pec support
Date: Fri, 24 Jul 2020 15:07:28 +0530	[thread overview]
Message-ID: <CAHO=5PEeek5EiXk3ZAmXPFRQ4xKF4e3z-pe6Yq9t4iV+7AUJYw@mail.gmail.com> (raw)
In-Reply-To: <20200723202053.GD908@ninjato>

On Fri, Jul 24, 2020 at 1:50 AM Wolfram Sang <wsa@kernel.org> wrote:
>
>
> > +     /* Enable partial slave HW PEC support if requested by the client */
> > +     iproc_i2c->en_s_pec = !!(slave->flags & I2C_CLIENT_PEC);
> > +     if (iproc_i2c->en_s_pec)
> > +             dev_info(iproc_i2c->device, "Enable PEC\n");
>
> Where do you set the I2C_CLIENT_PEC flag for the slave? Is your backend
> code publicly available?

I2C_CLIENT_PEC should be set by backend before calling i2c_slave_register() ie

client->flags |= I2C_CLIENT_PEC;
ret = i2c_slave_register(client, i2c_slave_eeprom_slave_cb);
------
------
------

My backend code is not yet publicly available.

>
> I may need a second thought here, but I am not sure I2C_CLIENT_PEC is
> the right way to enable PEC. Isn't it actually depending on the backend
> if PEC is needed? I.e. is the backend an I2C device or an SMBus device?
>
Yes, it depends on the backend. If backend is SMBUS device and
supports PEC then it should set client->flags |= I2C_CLIENT_PEC,
before calling i2c_slave_register(), so that the slave bus driver will
enable PEC in device.

Best regards,
Rayagonda

WARNING: multiple messages have this Message-ID (diff)
From: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
To: Wolfram Sang <wsa@kernel.org>
Cc: Lori Hikichi <lori.hikichi@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Ray Jui <rjui@broadcom.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Robert Richter <rrichter@marvell.com>,
	BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
	linux-i2c <linux-i2c@vger.kernel.org>,
	Nishka Dasgupta <nishkadg.linux@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 2/2] i2c: iproc: add slave pec support
Date: Fri, 24 Jul 2020 15:07:28 +0530	[thread overview]
Message-ID: <CAHO=5PEeek5EiXk3ZAmXPFRQ4xKF4e3z-pe6Yq9t4iV+7AUJYw@mail.gmail.com> (raw)
In-Reply-To: <20200723202053.GD908@ninjato>

On Fri, Jul 24, 2020 at 1:50 AM Wolfram Sang <wsa@kernel.org> wrote:
>
>
> > +     /* Enable partial slave HW PEC support if requested by the client */
> > +     iproc_i2c->en_s_pec = !!(slave->flags & I2C_CLIENT_PEC);
> > +     if (iproc_i2c->en_s_pec)
> > +             dev_info(iproc_i2c->device, "Enable PEC\n");
>
> Where do you set the I2C_CLIENT_PEC flag for the slave? Is your backend
> code publicly available?

I2C_CLIENT_PEC should be set by backend before calling i2c_slave_register() ie

client->flags |= I2C_CLIENT_PEC;
ret = i2c_slave_register(client, i2c_slave_eeprom_slave_cb);
------
------
------

My backend code is not yet publicly available.

>
> I may need a second thought here, but I am not sure I2C_CLIENT_PEC is
> the right way to enable PEC. Isn't it actually depending on the backend
> if PEC is needed? I.e. is the backend an I2C device or an SMBus device?
>
Yes, it depends on the backend. If backend is SMBUS device and
supports PEC then it should set client->flags |= I2C_CLIENT_PEC,
before calling i2c_slave_register(), so that the slave bus driver will
enable PEC in device.

Best regards,
Rayagonda

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-07-24  9:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17  9:01 [PATCH v2 0/2] add PEC support on slave side Rayagonda Kokatanur
2020-07-17  9:01 ` Rayagonda Kokatanur
2020-07-17  9:01 ` [PATCH v2 1/2] i2c: add PEC error event Rayagonda Kokatanur
2020-07-17  9:01   ` Rayagonda Kokatanur
2020-07-23 20:16   ` Wolfram Sang
2020-07-23 20:16     ` Wolfram Sang
2020-07-24  9:22     ` Rayagonda Kokatanur
2020-07-24  9:22       ` Rayagonda Kokatanur
2020-07-17  9:01 ` [PATCH v2 2/2] i2c: iproc: add slave pec support Rayagonda Kokatanur
2020-07-17  9:01   ` Rayagonda Kokatanur
2020-07-23 20:20   ` Wolfram Sang
2020-07-23 20:20     ` Wolfram Sang
2020-07-24  9:37     ` Rayagonda Kokatanur [this message]
2020-07-24  9:37       ` Rayagonda Kokatanur
2020-07-22 11:07 ` [PATCH v2 0/2] add PEC support on slave side Andy Shevchenko
2020-07-22 11:07   ` 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='CAHO=5PEeek5EiXk3ZAmXPFRQ4xKF4e3z-pe6Yq9t4iV+7AUJYw@mail.gmail.com' \
    --to=rayagonda.kokatanur@broadcom.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lori.hikichi@broadcom.com \
    --cc=nishkadg.linux@gmail.com \
    --cc=rjui@broadcom.com \
    --cc=rrichter@marvell.com \
    --cc=sbranden@broadcom.com \
    --cc=wsa@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.