From patchwork Mon Apr 20 13:53:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bert Vermeulen X-Patchwork-Id: 6242351 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A1ECD9F1BE for ; Mon, 20 Apr 2015 13:53:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D25C22041B for ; Mon, 20 Apr 2015 13:53:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EAAC0203F7 for ; Mon, 20 Apr 2015 13:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755090AbbDTNxw (ORCPT ); Mon, 20 Apr 2015 09:53:52 -0400 Received: from kiutl.biot.com ([31.172.244.210]:35004 "EHLO kiutl.biot.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755060AbbDTNxw (ORCPT ); Mon, 20 Apr 2015 09:53:52 -0400 Received: from spamd by kiutl.biot.com with sa-checked (Exim 4.83) (envelope-from ) id 1YkC8z-0001zt-Nq for linux-spi@vger.kernel.org; Mon, 20 Apr 2015 15:53:50 +0200 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from [2a02:578:4a04:2a00::5] (helo=sumner.biot.com) by kiutl.biot.com with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.83) (envelope-from ) id 1YkC8o-0001z3-Jh; Mon, 20 Apr 2015 15:53:38 +0200 Received: from bert by sumner.biot.com with local (Exim 4.82) (envelope-from ) id 1YkC8m-0000Wi-BS; Mon, 20 Apr 2015 15:53:36 +0200 From: Bert Vermeulen To: broonie@kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bert Vermeulen Subject: [PATCH] spi: rb4xx: Fix set_cs logic. Date: Mon, 20 Apr 2015 15:53:25 +0200 Message-Id: <1429538005-1985-1-git-send-email-bert@biot.com> X-Mailer: git-send-email 1.9.1 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As it turns out, the set_cs() enable parameter refers to the logic level on the CS pin, not the state of chip selection. This broke functionality of the LEDs behind the CPLD, or at least delayed the commands until another one came in to toggle CS. Signed-off-by: Bert Vermeulen --- drivers/spi/spi-rb4xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-rb4xx.c b/drivers/spi/spi-rb4xx.c index 9b449d4..50f49f3 100644 --- a/drivers/spi/spi-rb4xx.c +++ b/drivers/spi/spi-rb4xx.c @@ -90,7 +90,7 @@ static void rb4xx_set_cs(struct spi_device *spi, bool enable) * since it's all on the same hardware register. However the * CPLD needs CS deselected after every command. */ - if (!enable) + if (enable) rb4xx_write(rbspi, AR71XX_SPI_REG_IOC, AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1); }