From patchwork Thu Jan 10 21:21:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 155277 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2373979jaa; Thu, 10 Jan 2019 13:23:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN7yboSvpgsF1rIZR7cIZPFyULfpF1f8r1lmlvSn5viQLpMOlCyTPo4aZledZBN8nc1sZ6+t X-Received: by 2002:a17:902:2f03:: with SMTP id s3mr11699379plb.277.1547155400646; Thu, 10 Jan 2019 13:23:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547155400; cv=none; d=google.com; s=arc-20160816; b=e/TxPyzkVgLfmZvQ6GRKO1aHPIXk4bvdmJRgqEs7mND7vZ0qv0Ftuxin4mk8D8CWl3 0p8cporLBTu61BCjGxueVVq9HzeC1cR17xho7LzgPNnOm3PrkIA0tS21KxuRSNNlsGNU 6T9+ZAmkDc4THztaOyBd+8s3gzqzomM7Akuu/SwSjRr8jIH3MxCZDFuXjb2J66R0jhTY w8AMMyfY6Bd/iaY3D6226BmjCjh6PKa7ARXNP1dlKO7HrtZjezX5CJdfMqXiIzPiosdV Wg4eMMP6sFeKI9T0nTReHJcbQuPqWCM/Fik7/tks/rn1D59Y13xeSnkHSs4iQ2r8ii9a EyvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7ljTuh9wXcpceQd+LeLwlycG8+ReTi1ItqK/TulFhKk=; b=DsN0AMZWYWk9AcNc/IyTPgaTCmWv+oH8RheRIRGoJhvhz1QojmO7HSFJOzPdS7bYhw 5CAJ1DPipeJviB1AqTbuJTPhd3a5y8HQ7nOyoCJ/aLBWKa3+7sqkJUL/BRmkdz2tqUBT t9PzDUZSy3B2U8CYJYR0bM4QDumlU0Y5uvInbhJ86krpzE64cB986Lb5Xi7BDbpMp2U3 hGCGVGNEDWl7ydXfR5JtrP6ztahMrpNoNIZKY4MVzU+D5H4ELIOfXg8rKuv5wFL9ZBK8 G0ztzgGcuPe3r90GadKDJh+hfyaXEUWTWR33RzHQGZBWltrNDanameMewD7/jPSfbKh+ Km1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IM4qTiwO; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si7452098plg.318.2019.01.10.13.23.20; Thu, 10 Jan 2019 13:23:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IM4qTiwO; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728608AbfAJVXU (ORCPT + 5 others); Thu, 10 Jan 2019 16:23:20 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:39479 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727401AbfAJVXT (ORCPT ); Thu, 10 Jan 2019 16:23:19 -0500 Received: by mail-lf1-f68.google.com with SMTP id n18so9363005lfh.6 for ; Thu, 10 Jan 2019 13:23:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7ljTuh9wXcpceQd+LeLwlycG8+ReTi1ItqK/TulFhKk=; b=IM4qTiwOHhUMjK4ci9E0fgOShJF96OVkCNKNXBwUZ6EttKoTGwF3CIWplNgXaiJzY3 4kpFFHRn4w8YvhZEF5OOmYzaYQIXBKR+JrQhYPD46EPI0pfJAGlfor36qmsP3/rLDfeB gm13Io4NBy1+/Y3YqxuAUZnzyIEGlTxU/jiic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7ljTuh9wXcpceQd+LeLwlycG8+ReTi1ItqK/TulFhKk=; b=beWADsGICqlBIooDyPyr/9Ej8DvcefmJSUx7fW1vA0G9m45eoGyqOF4pTNT72b60oK DI01TQ6pc10Mmh0taH/0XVc0o+D7UWDrN6D30OZqAa9EMYLJBAkERkIQJNT59DpKwByn wlm/QhETd9WPnVwOdjoj/TgmUCi48V7zgc36i7s36+forQT+uUhQviqVQYzehykGgRaP zODpyRk6j5uSpAl++Tqjsblwz7N+N+m2IUnIFZ7+DjJDG6BvhvwhynUC3nKeW1pAFcxR AQbUIlqaa9lIRG6R621+bHm9HioCBsTaYAoQ2/YLuVfleIaSdPcjg3X30sFcVl4mZNRt xIWg== X-Gm-Message-State: AJcUukftCDuAhdZGKdodBjswU5t05yHy+DIKHxwURGX6MNJkAIB/anSR DusTpazDvPNkJbjYKMYE25tuoQ== X-Received: by 2002:a19:94d5:: with SMTP id o82mr6374030lfk.155.1547155397689; Thu, 10 Jan 2019 13:23:17 -0800 (PST) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id j18-v6sm15364145ljc.52.2019.01.10.13.23.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Jan 2019 13:23:16 -0800 (PST) From: Linus Walleij To: Mark Brown , linux-spi@vger.kernel.org Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski , linuxarm@huawei.com, Linus Walleij , Janek Kotas Subject: [PATCH] spi: dw: Fix default polarity of native chipselect Date: Thu, 10 Jan 2019 22:21:10 +0100 Message-Id: <20190110212110.11395-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The DW controller also supports platforms specifying native chipselects. When I enforce the use of high CS for drivers opting in for using GPIO descriptors, I inadvertedly switched the driver to also use active high chip select for native chip selects. As it turns out, the DW hardware driving chip selects also thinks it is weird with active low chip selects so all we need to do is remove an inversion in the driver. There are no in-kernel users of this native chip select callback so the breakage only affected out-of-tree code, but let's fix it. Cc: Janek Kotas Reported-by: Janek Kotas Fixes: 9400c41e77b8 ("spi: dw: Convert to use CS GPIO descriptors") Signed-off-by: Linus Walleij --- Janek can you confirm if this solves your problem? --- drivers/spi/spi-dw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.19.2 diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index f54b498001a9..bf4dfdd056f9 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -137,9 +137,8 @@ void dw_spi_set_cs(struct spi_device *spi, bool enable) struct dw_spi *dws = spi_controller_get_devdata(spi->controller); struct chip_data *chip = spi_get_ctldata(spi); - /* Chip select logic is inverted from spi_set_cs() */ if (chip && chip->cs_control) - chip->cs_control(!enable); + chip->cs_control(enable); if (!enable) dw_writel(dws, DW_SPI_SER, BIT(spi->chip_select));