From patchwork Sat Dec 15 23:38:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 153942 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp955863ljp; Sat, 15 Dec 2018 15:46:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/Up9xDkq87R3ols1/bZk6BWgwuOYDzUY5lpJdrvFl+4SHk43I9nLk2JzPagxXc0srtDroRn X-Received: by 2002:a17:902:9305:: with SMTP id bc5mr7843161plb.86.1544917570547; Sat, 15 Dec 2018 15:46:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544917570; cv=none; d=google.com; s=arc-20160816; b=wUXsrC2EAgf7DrvIdDZbOpyBIfjoJxiMZRBPgDYA0mGW1AspVtuZA20+NK/NAXWruo 79/xm4sJ0xtai//htEwXO8kj2E7Q48Q9eEqMygD6XtpC/4AV8SD619bj7kRUwyte6erL 809Zz/5HUsEpa6AMltVnFY0xm6BfISMY3Qa7hXF1Zz3Z78iAfG1lJwv0bzR99dHDKp1h cLzN5otLCrCHW2BjrCNKaBZki/Oelwvj+gXTipIT1coJ9Ip9vOB4BscePE4mW6V3s6kd teiisKG2giraC3eEtVBEbF30o7cavDQkAdnCzN8CMXrQrzk4pWL4nUt1sk5hjx5reB1Z 6g0A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uHetMijksPyCSUIw0pfFByRtDh1ZLhdoLZ37wl+MRTg=; b=eBRgd3vo3sEceI4m58U281jKRxhlDw1JhdUbOmJvhSv8mjaUtR6ySelEZlqxDYxdXh eSeziXFn9MkyL3FkJhT7Ftnbi1jjQJ/W0XFD5KCpDnSJyQQtNRWJuo1L1U1oEJDHt1ft Hb2r0270kGAIOLXXc1juE1LW1wsQnDvlJsu8zQfknuxQ+FkCoKFxXLH1TdjOc5v6tIEX gn6XuKD5hlLgBa9K8Zr99oMqVzskYcqRHJH8BeuiiSD5Gfe9e4OXbhMOGxWxX+wh4PC4 xC4pikUw+reJDKOFIQzooDvsmSq3F2p5odDYsf0GBtqy94CNXnPA15uddy8QgMboBN6J 72Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nq3Oq1Ue; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-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 1si7185999pld.239.2018.12.15.15.46.10; Sat, 15 Dec 2018 15:46:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-spi-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=Nq3Oq1Ue; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-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 S1727558AbeLOXqK (ORCPT + 1 other); Sat, 15 Dec 2018 18:46:10 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:43689 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727340AbeLOXqJ (ORCPT ); Sat, 15 Dec 2018 18:46:09 -0500 Received: by mail-lf1-f67.google.com with SMTP id u18so6879315lff.10 for ; Sat, 15 Dec 2018 15:46:08 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=uHetMijksPyCSUIw0pfFByRtDh1ZLhdoLZ37wl+MRTg=; b=Nq3Oq1UeVYctW+Bqj8cFUQZu2ty1QQ2flasO35K/x9chcsYyScmV7U8DUaV0hn3H9+ BDOpYOo/4XooB90jPTLW2vd/fErc1LmUsloL0oDdxTv6A2Q9Uw7KroI25jVr/xeXg/mH Lgbua95vHv5AKfKK8KVxuecsTXsoZXzDkPH2U= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=uHetMijksPyCSUIw0pfFByRtDh1ZLhdoLZ37wl+MRTg=; b=U3INdMm+Kh6bkslpSVlAncUf0A7xIBOMpDTcz52aKk8cIqntHIUA7Ot+mqaNNc73pV MVLLFO6JU5nKw/Khw+LMK405/OGc8en3dq5salry52XTobClpwULMCMEZEo4pEAzPVxe 1YLdcbx6kVjgdhbs+12iswO3fLpoPpybIIITm726WHyzgkpjX/WaVO9McgXrOsHYT07S Vu6tGZKT8n5YmZuJpa3QOUcnaqhTUdJlNQX8RKD8l3nS/2K5AU8YvWfCq9qmjEFjaiBp I3pLS90oR4OLqNayeDq4pLHzN7VQdQZ0QWmSrTDKBztiNjjsjZ/YqB/JdKlgahaUt924 D38w== X-Gm-Message-State: AA+aEWYj9zC3KRlzJOVe6WVuuy1gdWj9KFymkuQ5U+8WaBg32zWo5XHa GCMgICaXs/LqrdhFd11FcmeI9w== X-Received: by 2002:a19:1f54:: with SMTP id f81mr4330093lff.153.1544917567934; Sat, 15 Dec 2018 15:46:07 -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 v19sm1709880lfe.69.2018.12.15.15.46.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Dec 2018 15:46:06 -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 , Alexander Shiyan Subject: [PATCH 5/7 v1] spi: clps711x: Convert to use CS GPIO descriptors Date: Sun, 16 Dec 2018 00:38:21 +0100 Message-Id: <20181215233823.1042-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181215233823.1042-1-linus.walleij@linaro.org> References: <20181215233823.1042-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org This converts the CLPS711x SPI master driver to use GPIO descriptors for chip select handling. The CLPS711x driver was merely requesting the GPIO and setting the CS line non-asserted so this was a pretty straight-forward conversion. The setup callback goes away. Cc: Alexander Shiyan Cc: Linuxarm Signed-off-by: Linus Walleij --- drivers/spi/spi-clps711x.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) -- 2.19.2 diff --git a/drivers/spi/spi-clps711x.c b/drivers/spi/spi-clps711x.c index 18193df2eba8..8c03c409fc07 100644 --- a/drivers/spi/spi-clps711x.c +++ b/drivers/spi/spi-clps711x.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include @@ -36,25 +36,6 @@ struct spi_clps711x_data { int len; }; -static int spi_clps711x_setup(struct spi_device *spi) -{ - if (!spi->controller_state) { - int ret; - - ret = devm_gpio_request(&spi->master->dev, spi->cs_gpio, - dev_name(&spi->master->dev)); - if (ret) - return ret; - - spi->controller_state = spi; - } - - /* We are expect that SPI-device is not selected */ - gpio_direction_output(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); - - return 0; -} - static int spi_clps711x_prepare_message(struct spi_master *master, struct spi_message *msg) { @@ -125,11 +106,11 @@ static int spi_clps711x_probe(struct platform_device *pdev) if (!master) return -ENOMEM; + master->use_gpio_descriptors = true; master->bus_num = -1; master->mode_bits = SPI_CPHA | SPI_CS_HIGH; master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 8); master->dev.of_node = pdev->dev.of_node; - master->setup = spi_clps711x_setup; master->prepare_message = spi_clps711x_prepare_message; master->transfer_one = spi_clps711x_transfer_one;