From patchwork Mon Jan 7 15:51:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 154894 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3630534ljp; Mon, 7 Jan 2019 07:56:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/WETt7EVDRhDNgahkCmnN0rCeu09T3LBSLoSs89K7a9lAl5VulaGzSLSGi+Kl12otBzsNML X-Received: by 2002:a62:4549:: with SMTP id s70mr62871407pfa.233.1546876610758; Mon, 07 Jan 2019 07:56:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546876610; cv=none; d=google.com; s=arc-20160816; b=P9XICdQeE6okOW10ywa5AAtzmwl/zf22E4Tut332GqTAvDEQxW44M1eKp/FQL4JMmu aRbsvheaKZVZgADkGqohkOBPJSi1L3WY5bvkasYPtOCshcbog4LyzP+0SKLHL2+PSuWL 3fcwyHLGBn4ZKncfTAAJemHcodSojAIjkJnCQod4eQkGX0zucSQ6uYcIkLpYrVH0w7gM LsSYhJV5tESBv5o/cey7TwfjHTocMitoINBwVv2kzL1p6GM6mGNFwiu7dFd8SO0Hf2Xq zgscJV6ag+ftPprbDi227F2Mag04OYtwlqkY4KC8loYvqv4O7TuAcUXbAkVVDqzHwT7r 7gzQ== 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=U/f3ju9GAcQU2D9t1vnukcnrS930aDOZrrMHtBThSv0=; b=S948JNE8s4UV3EllaUL4qU/tT7Tmi+jHqovO/WXr4UbHS6CgMuIp/isiSMcC4BDTfY C7pDT0ORS7JPJfYDOh5xW8jy0cwodUKuyhKTNIj6B0bZRQeIa7R7+kanD/qM5BFYANBm oPiXJshtI/7PK4y+wT12zoYf1A6uafPYOmiyjFzU/ZfMWxmfV1qxrzEGNxkBTabFS+xA M418xlLdhO3UDFF2QAGZvb8ESVZAGb/PkxrQR96UtMbERkFwJSLTwlIcFhmvvmjs49y5 mbk6tML4bXJKoKIVQT14NHpVQZ/kHmKib41TTJz9t79H+HL/gasMPIlGFWPZ0siXanu8 IbjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UM1SFyu6; 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 l7si3021110pgk.169.2019.01.07.07.56.50; Mon, 07 Jan 2019 07:56:50 -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=UM1SFyu6; 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 S1727373AbfAGP4u (ORCPT + 1 other); Mon, 7 Jan 2019 10:56:50 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:43310 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727788AbfAGP4u (ORCPT ); Mon, 7 Jan 2019 10:56:50 -0500 Received: by mail-lj1-f194.google.com with SMTP id q2-v6so729767lji.10 for ; Mon, 07 Jan 2019 07:56:48 -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=U/f3ju9GAcQU2D9t1vnukcnrS930aDOZrrMHtBThSv0=; b=UM1SFyu6VOe2ezjzpBKx2/3g5foqiuj7bAQfTVVs0kJrk4kxE8ncStmKououjitABI WRFxaPdPwpboTTWpkTwzKlZYzOyK2UyHXWuPD9S1pZo21S+zFN0W6hsBqimIxxHVlq5a ZGK2a97sSe5eEurZhIJVfN1qSTWeZw0idYB14= 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=U/f3ju9GAcQU2D9t1vnukcnrS930aDOZrrMHtBThSv0=; b=jLbe/jHict7SfAAGZXi/24PCZ+SoTNs/e6NM1qps2rE7d8g/Uj+cLxcXSMOaek3LAs w0irPlOsbenvhRvKYAbXFvZy1VMMmvjtxh7pLAD+5nAck694p45NUmVIYuLcsFvuZAVv 6ShG63V5CcBo43QeQjZX1wxF0/UtMyk6N9PygeTEJ4nSZf8txFLQkqzq0BlTvxmkzNUn TqnTgPQCfCVt6f4WSPAtJHe3auqeEasgzUcqEq0RrOM7GqqUnp/4ywXJr0c0JTaqUgN7 qdkTPRzEHYOy6E3XPZHm6eKQ0d5b+KnYWp8yxee7OPrrriccRcBgdZHRbbS3SA4XRmw8 cNAQ== X-Gm-Message-State: AJcUukdlibePEb26zg79fGiiPLkjJQ154eXLE/T1uEJyfFf27ouUeLE1 9HPgPbyuMjswHLxmGeuVxY7EZA== X-Received: by 2002:a2e:2d11:: with SMTP id t17-v6mr33714989ljt.159.1546876608141; Mon, 07 Jan 2019 07:56:48 -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 t22sm13269164lfb.0.2019.01.07.07.56.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Jan 2019 07:56:47 -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 v2] spi: clps711x: Convert to use CS GPIO descriptors Date: Mon, 7 Jan 2019 16:51:54 +0100 Message-Id: <20190107155156.3738-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190107155156.3738-1-linus.walleij@linaro.org> References: <20190107155156.3738-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 --- ChangeLog v1->v2: - Rebase on v5.0-rc1 --- 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;