All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: linux-spi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Axel Lin <axel.lin@ingics.com>
Subject: [PATCH] spi: sc18is602: Don't be that restrictive with the maximum transfer speed
Date: Sun, 16 Mar 2014 18:47:50 -0700	[thread overview]
Message-ID: <1395020870-18107-1-git-send-email-linux@roeck-us.net> (raw)

Commit 09e99bca8 (spi: sc18is602: Convert to let spi core validate
transfer speed) made the maximum transfer speed much more restrictive
than before. The transfer speed used to be adjusted to 1/4 of the chip
clock rate if a higher transfer speed was requested. Now such transfers are
simply rejected. With default settings, this causes, for example, a transfer
request at 2 mbps to be rejected because the maximum speed with the default
chip clock is 1.843 mbps.

This is unnecessarily restrictive and causes unnecessary failures. Loosen
the limit to accept transfers up to 50% of the clock rate and adjust
the speed as needed when setting up the actualt transfer.

Cc: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
This patch applies to the tip of linux-next.

 drivers/spi/spi-sc18is602.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-sc18is602.c b/drivers/spi/spi-sc18is602.c
index 237f2e7..f0e55aa 100644
--- a/drivers/spi/spi-sc18is602.c
+++ b/drivers/spi/spi-sc18is602.c
@@ -297,7 +297,7 @@ static int sc18is602_probe(struct i2c_client *client,
 	master->transfer_one_message = sc18is602_transfer_one;
 	master->dev.of_node = np;
 	master->min_speed_hz = hw->freq / 128;
-	master->max_speed_hz = hw->freq / 4;
+	master->max_speed_hz = hw->freq / 2;
 
 	error = devm_spi_register_master(dev, master);
 	if (error)
-- 
1.7.9.7


WARNING: multiple messages have this Message-ID
From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
To: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>,
	Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH] spi: sc18is602: Don't be that restrictive with the maximum transfer speed
Date: Sun, 16 Mar 2014 18:47:50 -0700	[thread overview]
Message-ID: <1395020870-18107-1-git-send-email-linux@roeck-us.net> (raw)

Commit 09e99bca8 (spi: sc18is602: Convert to let spi core validate
transfer speed) made the maximum transfer speed much more restrictive
than before. The transfer speed used to be adjusted to 1/4 of the chip
clock rate if a higher transfer speed was requested. Now such transfers are
simply rejected. With default settings, this causes, for example, a transfer
request at 2 mbps to be rejected because the maximum speed with the default
chip clock is 1.843 mbps.

This is unnecessarily restrictive and causes unnecessary failures. Loosen
the limit to accept transfers up to 50% of the clock rate and adjust
the speed as needed when setting up the actualt transfer.

Cc: Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
---
This patch applies to the tip of linux-next.

 drivers/spi/spi-sc18is602.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-sc18is602.c b/drivers/spi/spi-sc18is602.c
index 237f2e7..f0e55aa 100644
--- a/drivers/spi/spi-sc18is602.c
+++ b/drivers/spi/spi-sc18is602.c
@@ -297,7 +297,7 @@ static int sc18is602_probe(struct i2c_client *client,
 	master->transfer_one_message = sc18is602_transfer_one;
 	master->dev.of_node = np;
 	master->min_speed_hz = hw->freq / 128;
-	master->max_speed_hz = hw->freq / 4;
+	master->max_speed_hz = hw->freq / 2;
 
 	error = devm_spi_register_master(dev, master);
 	if (error)
-- 
1.7.9.7

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2014-03-17  1:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17  1:47 Guenter Roeck [this message]
2014-03-17  1:47 ` Guenter Roeck
2014-03-17  2:07 ` Axel Lin
2014-03-17  2:07   ` Axel Lin
2014-03-17  3:53   ` Guenter Roeck
2014-03-17  3:53     ` Guenter Roeck
2014-03-17 11:27     ` Mark Brown
2014-03-17 11:27       ` Mark Brown
2014-03-17 11:52 ` Mark Brown
2014-03-17 11:52   ` Mark Brown
2014-03-17 13:25   ` Guenter Roeck
2014-03-17 13:25     ` Guenter Roeck

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=1395020870-18107-1-git-send-email-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --subject='Re: [PATCH] spi: sc18is602: Don'\''t be that restrictive with the maximum transfer speed' \
    /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

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.