From patchwork Mon Mar 17 01:47:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 3840811 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BF6B39F369 for ; Mon, 17 Mar 2014 01:48:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4941201EC for ; Mon, 17 Mar 2014 01:48:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BDC8201DD for ; Mon, 17 Mar 2014 01:48:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932137AbaCQBsC (ORCPT ); Sun, 16 Mar 2014 21:48:02 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:36631 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932070AbaCQBsB (ORCPT ); Sun, 16 Mar 2014 21:48:01 -0400 Received: by mail-pa0-f48.google.com with SMTP id hz1so5047479pad.7 for ; Sun, 16 Mar 2014 18:48:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=xJmyVyqpWNv7o1ngwwpBBNcKhzDCXYDfVHJ5C5aGQmw=; b=E2NZvgeMtzXg8Qm16D+XhnsCrwXpsIkGW2fkHRITQFdE6KJPjUIwBqzjLPGFPdCRgm gsW3mL3OgM5rwFZdGkF6eNy31SlHB4LxPIKck7lrW4CEqion1TRRckIRetOowiAANbag /Ci7JotOKz1Ceq572KT4ysvlMG2na7cWft7GdGJBRxxF3kgu4NnFufW3Ga7Gn6mYTuVd 2xjny7ghvjibghukNutd4XsawBKNsx0rOozsLUsMmPPrV/b1ApzUK9n/yppbxNPmoT9R JyllFGlxVa8CLzeDmcLU0lvzDZrCrtqMXgmwMNEAmrfXpJKHUqSl4Z59mMPARL2lJBBV Xpnw== X-Received: by 10.68.106.130 with SMTP id gu2mr22641154pbb.59.1395020880729; Sun, 16 Mar 2014 18:48:00 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id vf7sm38245160pbc.5.2014.03.16.18.47.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 16 Mar 2014 18:48:00 -0700 (PDT) From: Guenter Roeck To: linux-spi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Mark Brown , Guenter Roeck , Axel Lin Subject: [PATCH] spi: sc18is602: Don't be that restrictive with the maximum transfer speed Date: Sun, 16 Mar 2014 18:47:50 -0700 Message-Id: <1395020870-18107-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.7.9.7 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Guenter Roeck --- 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)