All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Kevin Herbert <kph@platinasystems.com>
Cc: Biwen Li <biwen.li@nxp.com>, Aisheng Dong <aisheng.dong@nxp.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Biwen Li (OSS)" <biwen.li@oss.nxp.com>,
	"linux@rempel-privat.de" <linux@rempel-privat.de>,
	Clark Wang <xiaoning.wang@nxp.com>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	Jiafei Pan <jiafei.pan@nxp.com>, Leo Li <leoyang.li@nxp.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	Xiaobo Xie <xiaobo.xie@nxp.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [v10] i2c: imx: support slave mode for imx I2C driver
Date: Sat, 12 Dec 2020 08:11:59 +0100	[thread overview]
Message-ID: <20201212071159.mxylwo3jk725k7kq@pengutronix.de> (raw)
In-Reply-To: <CABP=6zahhQSXwG2MzR+ry9h8MCRqjyS=ysdvF1UYuejZd-0RkQ@mail.gmail.com>

On Fri, Dec 11, 2020 at 09:57:19AM -0800, Kevin Herbert wrote:
> Thanks for the tip. I attempted to see if the register was implemented
> on the i.mx6, and it doesn't appear to be. I'll reach out to my FAE. I
> found the datasheet and the register definitely isn't documented
> there.
> 
> I was thinking of a patch that would keep track of state, and
> synthesize the I2C_SLAVE_STOP on the next interrupt if it was a new
> transaction. Does this seem too hacky to you? What are your thoughts?

I would say, send patches :)
Please provide in to the commit message enough description to understand and
reproduce your issue.
 
> 
> On Wed, Dec 9, 2020 at 6:16 PM Biwen Li <biwen.li@nxp.com> wrote:
> >
> > Hi Kevin,
> >
> >
> >
> > After enabling idle interrupts, the i2c register will generate an idle interrupts(whatever read or write) when i2c bus enter idle status. Then get I2C_SLAVE_STOP event.
> >
> > But don’t have the IBIC register(Maybe it’s a hidden register) in imx. You can query about the AE of imx about this.
> >
> > static void i2c_imx_enable_bus_idle(struct imx_i2c_struct *i2c_imx)
> >
> > {
> >
> >         if (is_vf610_i2c(i2c_imx)) {
> >
> >                 unsigned int temp;
> >
> >
> >
> >                 temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_IBIC);
> >
> >                 temp |= IBIC_BIIE;
> >
> >                 imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_IBIC);
> >
> >         }
> >
> > }
> >
> >
> >
> > Best Regards,
> >
> > Biwen Li
> >
> > From: Kevin Herbert <kph@platinasystems.com>
> > Sent: 2020年12月10日 1:18
> > To: Wolfram Sang <wsa@the-dreams.de>; Kevin Herbert <kph@platinasystems.com>; Biwen Li (OSS) <biwen.li@oss.nxp.com>; Leo Li <leoyang.li@nxp.com>; linux@rempel-privat.de; kernel@pengutronix.de; shawnguo@kernel.org; s.hauer@pengutronix.de; festevam@gmail.com; Aisheng Dong <aisheng.dong@nxp.com>; Clark Wang <xiaoning.wang@nxp.com>; o.rempel@pengutronix.de; linux-i2c@vger.kernel.org; linux-kernel@vger.kernel.org; Jiafei Pan <jiafei.pan@nxp.com>; Xiaobo Xie <xiaobo.xie@nxp.com>; linux-arm-kernel@lists.infradead.org; Biwen Li <biwen.li@nxp.com>
> > Subject: [EXT] Re: [v10] i2c: imx: support slave mode for imx I2C driver
> >
> >
> >
> > Caution: EXT Email
> >
> > Even on an operation like writing a byte, I get I2C_SLAVE_WRITE_REQUESTED followed by I2C_SLAVE_WRITE_RECEIVED, but no I2C_SLAVE_STOP. If I do a I2C write of multiple bytes, I get I2c_SLAVE_WRITE_REQUESTED followed by multiple I2C_SLAVE_WRITE_RECEIVED.
> >
> >
> >
> > Kevin
> >
> >
> >
> > On Wed, Dec 9, 2020 at 9:10 AM Wolfram Sang <wsa@the-dreams.de> wrote:
> >
> > On Wed, Dec 09, 2020 at 09:03:50AM -0800, Kevin Herbert wrote:
> > > What is the protocol for the I2C_SLAVE_STOP event? I am working on my own
> > > backend, and I've only tried it with this i.mx driver, and I do not receive
> > > I2C_SLAVE_STOP at the end of every I2C transaction. It was my expectation
> > > I'd receive this event at the end of every frame. In my testing, I've never
> > > received this event at all.
> > >
> > > Where are the I2C registers on the i.mx documented? My board is an i.mx6sx.
> >
> > Hmm, from a glimpse, it looks the STOP event is only sent after a write
> > and not after a read? Does this match your findings?
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

WARNING: multiple messages have this Message-ID (diff)
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Kevin Herbert <kph@platinasystems.com>
Cc: Aisheng Dong <aisheng.dong@nxp.com>, Biwen Li <biwen.li@nxp.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Biwen Li \(OSS\)" <biwen.li@oss.nxp.com>,
	"linux@rempel-privat.de" <linux@rempel-privat.de>,
	Clark Wang <xiaoning.wang@nxp.com>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	Jiafei Pan <jiafei.pan@nxp.com>, Leo Li <leoyang.li@nxp.com>,
	"festevam@gmail.com" <festevam@gmail.com>,
	Xiaobo Xie <xiaobo.xie@nxp.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [v10] i2c: imx: support slave mode for imx I2C driver
Date: Sat, 12 Dec 2020 08:11:59 +0100	[thread overview]
Message-ID: <20201212071159.mxylwo3jk725k7kq@pengutronix.de> (raw)
In-Reply-To: <CABP=6zahhQSXwG2MzR+ry9h8MCRqjyS=ysdvF1UYuejZd-0RkQ@mail.gmail.com>

On Fri, Dec 11, 2020 at 09:57:19AM -0800, Kevin Herbert wrote:
> Thanks for the tip. I attempted to see if the register was implemented
> on the i.mx6, and it doesn't appear to be. I'll reach out to my FAE. I
> found the datasheet and the register definitely isn't documented
> there.
> 
> I was thinking of a patch that would keep track of state, and
> synthesize the I2C_SLAVE_STOP on the next interrupt if it was a new
> transaction. Does this seem too hacky to you? What are your thoughts?

I would say, send patches :)
Please provide in to the commit message enough description to understand and
reproduce your issue.
 
> 
> On Wed, Dec 9, 2020 at 6:16 PM Biwen Li <biwen.li@nxp.com> wrote:
> >
> > Hi Kevin,
> >
> >
> >
> > After enabling idle interrupts, the i2c register will generate an idle interrupts(whatever read or write) when i2c bus enter idle status. Then get I2C_SLAVE_STOP event.
> >
> > But don’t have the IBIC register(Maybe it’s a hidden register) in imx. You can query about the AE of imx about this.
> >
> > static void i2c_imx_enable_bus_idle(struct imx_i2c_struct *i2c_imx)
> >
> > {
> >
> >         if (is_vf610_i2c(i2c_imx)) {
> >
> >                 unsigned int temp;
> >
> >
> >
> >                 temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_IBIC);
> >
> >                 temp |= IBIC_BIIE;
> >
> >                 imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_IBIC);
> >
> >         }
> >
> > }
> >
> >
> >
> > Best Regards,
> >
> > Biwen Li
> >
> > From: Kevin Herbert <kph@platinasystems.com>
> > Sent: 2020年12月10日 1:18
> > To: Wolfram Sang <wsa@the-dreams.de>; Kevin Herbert <kph@platinasystems.com>; Biwen Li (OSS) <biwen.li@oss.nxp.com>; Leo Li <leoyang.li@nxp.com>; linux@rempel-privat.de; kernel@pengutronix.de; shawnguo@kernel.org; s.hauer@pengutronix.de; festevam@gmail.com; Aisheng Dong <aisheng.dong@nxp.com>; Clark Wang <xiaoning.wang@nxp.com>; o.rempel@pengutronix.de; linux-i2c@vger.kernel.org; linux-kernel@vger.kernel.org; Jiafei Pan <jiafei.pan@nxp.com>; Xiaobo Xie <xiaobo.xie@nxp.com>; linux-arm-kernel@lists.infradead.org; Biwen Li <biwen.li@nxp.com>
> > Subject: [EXT] Re: [v10] i2c: imx: support slave mode for imx I2C driver
> >
> >
> >
> > Caution: EXT Email
> >
> > Even on an operation like writing a byte, I get I2C_SLAVE_WRITE_REQUESTED followed by I2C_SLAVE_WRITE_RECEIVED, but no I2C_SLAVE_STOP. If I do a I2C write of multiple bytes, I get I2c_SLAVE_WRITE_REQUESTED followed by multiple I2C_SLAVE_WRITE_RECEIVED.
> >
> >
> >
> > Kevin
> >
> >
> >
> > On Wed, Dec 9, 2020 at 9:10 AM Wolfram Sang <wsa@the-dreams.de> wrote:
> >
> > On Wed, Dec 09, 2020 at 09:03:50AM -0800, Kevin Herbert wrote:
> > > What is the protocol for the I2C_SLAVE_STOP event? I am working on my own
> > > backend, and I've only tried it with this i.mx driver, and I do not receive
> > > I2C_SLAVE_STOP at the end of every I2C transaction. It was my expectation
> > > I'd receive this event at the end of every frame. In my testing, I've never
> > > received this event at all.
> > >
> > > Where are the I2C registers on the i.mx documented? My board is an i.mx6sx.
> >
> > Hmm, from a glimpse, it looks the STOP event is only sent after a write
> > and not after a read? Does this match your findings?
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

  reply	other threads:[~2020-12-12 10:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11 11:32 [v10] i2c: imx: support slave mode for imx I2C driver Biwen Li
2020-11-11 11:32 ` Biwen Li
2020-11-13 13:59 ` Oleksij Rempel
2020-11-13 13:59   ` Oleksij Rempel
2020-11-30  5:26   ` Biwen Li (OSS)
2020-11-30  5:26     ` Biwen Li (OSS)
2020-12-02 15:10 ` Wolfram Sang
2020-12-02 15:10   ` Wolfram Sang
     [not found]   ` <CABP=6zZcmsFUVwUaAH7f2-RqFHz71GLDnSfLreUo5GA3Y58HYA@mail.gmail.com>
2020-12-09 17:09     ` Wolfram Sang
2020-12-09 17:09       ` Wolfram Sang
     [not found]       ` <CABP=6zbKxu7ruGRi59k8+JbX5UB9jfP=C76-Pd4Q39Mc0yOTrA@mail.gmail.com>
     [not found]         ` <DB6PR0401MB2438F3FF50B601295BBE7F378FCB0@DB6PR0401MB2438.eurprd04.prod.outlook.com>
2020-12-11 17:57           ` [EXT] " Kevin Herbert
2020-12-11 17:57             ` Kevin Herbert
2020-12-12  7:11             ` Oleksij Rempel [this message]
2020-12-12  7:11               ` Oleksij Rempel

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=20201212071159.mxylwo3jk725k7kq@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=aisheng.dong@nxp.com \
    --cc=biwen.li@nxp.com \
    --cc=biwen.li@oss.nxp.com \
    --cc=festevam@gmail.com \
    --cc=jiafei.pan@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=kph@platinasystems.com \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rempel-privat.de \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=wsa@the-dreams.de \
    --cc=xiaobo.xie@nxp.com \
    --cc=xiaoning.wang@nxp.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 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.