From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-i2c@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Andy Gross <andy.gross@linaro.org>,
David Brown <david.brown@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 06/12] i2c: qup: use core to detect 'no zero length' quirk
Date: Mon, 23 Jul 2018 22:26:10 +0200 [thread overview]
Message-ID: <20180723202617.15230-7-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20180723202617.15230-1-wsa+renesas@sang-engineering.com>
And don't reimplement in the driver.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Only build tested.
drivers/i2c/busses/i2c-qup.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index c86c3ae1318f..e09cd0775ae9 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -1088,11 +1088,6 @@ static int qup_i2c_xfer(struct i2c_adapter *adap,
writel(I2C_MINI_CORE | I2C_N_VAL, qup->base + QUP_CONFIG);
for (idx = 0; idx < num; idx++) {
- if (msgs[idx].len == 0) {
- ret = -EINVAL;
- goto out;
- }
-
if (qup_i2c_poll_state_i2c_master(qup)) {
ret = -EIO;
goto out;
@@ -1520,9 +1515,6 @@ qup_i2c_determine_mode_v2(struct qup_i2c_dev *qup,
/* All i2c_msgs should be transferred using either dma or cpu */
for (idx = 0; idx < num; idx++) {
- if (msgs[idx].len == 0)
- return -EINVAL;
-
if (msgs[idx].flags & I2C_M_RD)
max_rx_len = max_t(unsigned int, max_rx_len,
msgs[idx].len);
@@ -1636,9 +1628,14 @@ static const struct i2c_algorithm qup_i2c_algo_v2 = {
* which limits the possible read to 256 (QUP_READ_LIMIT) bytes.
*/
static const struct i2c_adapter_quirks qup_i2c_quirks = {
+ .flags = I2C_AQ_NO_ZERO_LEN,
.max_read_len = QUP_READ_LIMIT,
};
+static const struct i2c_adapter_quirks qup_i2c_quirks_v2 = {
+ .flags = I2C_AQ_NO_ZERO_LEN,
+};
+
static void qup_i2c_enable_clocks(struct qup_i2c_dev *qup)
{
clk_prepare_enable(qup->clk);
@@ -1701,6 +1698,7 @@ static int qup_i2c_probe(struct platform_device *pdev)
is_qup_v1 = true;
} else {
qup->adap.algo = &qup_i2c_algo_v2;
+ qup->adap.quirks = &qup_i2c_quirks_v2;
is_qup_v1 = false;
if (acpi_match_device(qup_i2c_acpi_match, qup->dev))
goto nodma;
--
2.11.0
next prev parent reply other threads:[~2018-07-23 20:27 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-23 20:26 [PATCH 00/12] i2c: quirks: add zero length checks and update drivers Wolfram Sang
2018-07-23 20:26 ` [PATCH 01/12] i2c: quirks: add zero length checks Wolfram Sang
2018-07-23 20:44 ` Niklas Söderlund
2018-07-23 21:05 ` Wolfram Sang
2018-08-04 21:26 ` Wolfram Sang
2018-07-23 20:26 ` [PATCH 02/12] i2c: designware-master: use core to detect 'no zero length' quirk Wolfram Sang
2018-08-02 14:00 ` Jarkko Nikula
2018-08-04 21:26 ` Wolfram Sang
2018-07-23 20:26 ` [PATCH 03/12] i2c: mxs: " Wolfram Sang
2018-08-04 21:27 ` Wolfram Sang
2018-07-23 20:26 ` [PATCH 04/12] i2c: omap: " Wolfram Sang
2018-10-05 12:24 ` Wolfram Sang
2018-10-05 14:11 ` Grygorii Strashko
2018-10-05 14:30 ` Tony Lindgren
2018-10-05 16:07 ` Wolfram Sang
2018-07-23 20:26 ` [PATCH 05/12] i2c: pmcmsp: " Wolfram Sang
2018-08-04 21:27 ` Wolfram Sang
2018-07-23 20:26 ` Wolfram Sang [this message]
2018-10-05 12:24 ` [PATCH 06/12] i2c: qup: " Wolfram Sang
2018-10-05 14:23 ` Andy Gross
2018-10-05 16:07 ` Wolfram Sang
2018-07-23 20:26 ` [PATCH 07/12] i2c: stu300: " Wolfram Sang
2018-07-25 20:52 ` Linus Walleij
2018-08-04 21:27 ` Wolfram Sang
2018-07-23 20:26 ` [PATCH 08/12] i2c: tegra: " Wolfram Sang
2018-10-05 12:24 ` Wolfram Sang
2018-10-05 13:52 ` Jon Hunter
2018-10-05 16:08 ` Wolfram Sang
2018-07-23 20:26 ` [PATCH 09/12] i2c: zx2967: " Wolfram Sang
2018-10-05 12:24 ` Wolfram Sang
2018-10-05 13:04 ` Shawn Guo
2018-10-05 16:08 ` Wolfram Sang
2018-07-23 20:26 ` [PATCH 10/12] i2c: rcar: " Wolfram Sang
2018-07-23 20:46 ` Niklas Söderlund
2018-08-04 21:27 ` Wolfram Sang
2018-07-23 20:26 ` [PATCH 11/12] i2c: xlr: " Wolfram Sang
2018-08-04 21:27 ` Wolfram Sang
2018-07-23 20:26 ` [PATCH 12/12] i2c: sh_mobile: use core to detect 'no zero length read' quirk Wolfram Sang
2018-07-23 20:54 ` Niklas Söderlund
2018-08-04 21:27 ` Wolfram Sang
2018-07-23 20:47 ` [PATCH 00/12] i2c: quirks: add zero length checks and update drivers Andy Shevchenko
2018-08-04 21:26 ` Wolfram Sang
2018-08-04 21:23 ` Wolfram Sang
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=20180723202617.15230-7-wsa+renesas@sang-engineering.com \
--to=wsa+renesas@sang-engineering.com \
--cc=andy.gross@linaro.org \
--cc=david.brown@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-soc@vger.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 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).