From: wsa@the-dreams.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/4] i2c: tegra: implement slave mode
Date: Fri, 3 Apr 2015 21:46:26 +0200 [thread overview]
Message-ID: <20150403194626.GB2016@katana> (raw)
In-Reply-To: <1427745615-5428-2-git-send-email-danindrey@mail.ru>
> +static void tegra_i2c_slave_write(struct tegra_i2c_dev *i2c_dev, u32 val)
> +{
> + i2c_writel(i2c_dev, val, I2C_SL_RCVD);
> +
> + /*
> + * TODO: A correct fix needs to be found for this.
> + *
> + * We experience less incomplete messages with this delay than without
> + * it, but we don't know why. Help is appreciated.
> + */
Uh oh. So I assume this is another reason for staging?
> + if (!i2c_dev->slave || !i2c_dev->slave->slave_cb)
> + return -EINVAL;
The core checks for slave_cb being valid.
> + i2c_slave_event(i2c_dev->slave, I2C_SLAVE_STOP, &dummy);
You could use value here, too, or?
> + if (!tegra_i2c_slave_isr(irq, i2c_dev))
> + return IRQ_HANDLED;
Minor nit: I'd prefer == 0 here, since it reads "if not slave_isr return
handled".
> + if (slave->addr > 0x7F)
> + addr2 = (slave->addr >> 7) | I2C_SL_ADDR2_TEN_BIT_MODE;
Nope. There are 10 bit encodings of addresses 0x000-0x07f, too. So, you
need to check for the flag (slave->flags & I2C_CLIENT_TEN).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150403/560a4959/attachment.sig>
next prev parent reply other threads:[~2015-04-03 19:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-30 20:00 [PATCH v2 0/4] arm: tegra: implement NVEC driver using tegra i2c Andrey Danin
2015-03-30 20:00 ` [PATCH v2 1/4] i2c: tegra: implement slave mode Andrey Danin
2015-04-03 19:46 ` Wolfram Sang [this message]
2015-07-20 9:50 ` Wolfram Sang
2015-03-30 20:00 ` [PATCH v2 2/4] staging/nvec: reimplement on top of tegra i2c driver Andrey Danin
2015-04-03 19:57 ` Wolfram Sang
2015-03-30 20:00 ` [PATCH v2 3/4] staging/nvec: remove old code Andrey Danin
2015-03-30 20:00 ` [PATCH v2 4/4] dt: paz00: define nvec as child of i2c bus Andrey Danin
2015-04-03 19:46 ` [PATCH v2 0/4] arm: tegra: implement NVEC driver using tegra i2c Wolfram Sang
2015-04-07 11:37 ` [PATCH v2 0/4] arm: tegra: implement NVEC driver using tegrai2c Marc Dietrich
2015-04-10 21:35 ` Wolfram Sang
[not found] ` <20150505105513.GA1841@katana>
2015-05-05 20:07 ` How to encode being an I2C slave in DT? Stephen Warren
2015-05-06 16:17 ` Wolfram Sang
2015-05-06 17:01 ` Stephen Warren
2015-05-19 0:37 ` Rob Herring
2015-05-19 6:16 ` Wolfram Sang
2015-07-16 9:03 ` Andrey Danin
2015-07-16 18:14 ` Wolfram Sang
2015-05-06 6:59 ` Uwe Kleine-König
2015-05-06 7:53 ` Marc Dietrich
2015-05-06 8:09 ` Uwe Kleine-König
2015-05-06 15:57 ` Stephen Warren
2015-05-06 17:47 ` Uwe Kleine-König
2015-05-06 18:35 ` Stephen Warren
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=20150403194626.GB2016@katana \
--to=wsa@the-dreams.de \
--cc=linux-arm-kernel@lists.infradead.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 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).