From patchwork Mon Nov 12 14:12:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 150846 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3191194ljp; Mon, 12 Nov 2018 06:13:13 -0800 (PST) X-Google-Smtp-Source: AJdET5fI1P0kFo7FuSlIcoVZBAUkD8dSWfU5HE1U5i9Nxfe6LJs1qNY6+ofDp44i6ETfJRNQkVNW X-Received: by 2002:a62:3647:: with SMTP id d68-v6mr1088706pfa.66.1542031993039; Mon, 12 Nov 2018 06:13:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542031993; cv=none; d=google.com; s=arc-20160816; b=zpvPzE2mhcEJA9LSxLLfb1u+Dy23Bjaqo8I//85wgEaOB5WhLOml5sQb14dtegqwpr kmBsW6h3Uk19yDSKpdzjstdcFInppJoFudiG/kMOu43o0YDJBvw0/K9yn4aWHaOCCMsI EvPgn+NkpDvz6gxNE1kHvchr0sv4Yck0/gLjYI5GfN8zmv2utvlXn0kRTMiOPjHQblTl uJDyYlk5Qrom2dauw3bCfbiDcZ7UiSdFQFkf34X9w2BggYsjur/RV/aauLTNmnLtKFvh SYKW9afdsP5eQiBnOrERdSyuAyDzv19RCo2S8ZLakfpjnuNRSPW154bHP/x0q0S/Nody q3SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=rt4TJGByCdN0FaMJGDsjlpkv/2YBVgH7VBlG47gGhdM=; b=vU1y3OdOL+IHHundiTXlNa7KSbUtKnHh9VmzdMZfWBIWi8POsuCt6VrEwsoK+6HS1T fNng2u/b6mduVrUZZV9mJEcoy+mR/E77AoVN5mMz7eEP+KykvNMDqAqZXTJb1cOc/hP9 XuYEotOUZW1cLGm2dpaR7gAfg9gWkR4cCkSqXfTBoHgdB1HJBm9/rNPi5luqnROoqrYB HXIJwRNdG5PZ61HJEy7EtrXfC3gltg0Vp25vgLN86v8KHAOSu50FxabSRuZbD//6Mw34 5j4rHLNAfnUDBVXZShKTsJo+EfffM6t2IDKxF3UVcPNJ5xBFnjLtwGOXJHy46ba2B/4+ awDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GtomwXd4; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-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 h68-v6si19277640pfb.142.2018.11.12.06.13.12; Mon, 12 Nov 2018 06:13:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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=GtomwXd4; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-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 S1727842AbeKMAGi (ORCPT + 5 others); Mon, 12 Nov 2018 19:06:38 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:42536 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729800AbeKMAGi (ORCPT ); Mon, 12 Nov 2018 19:06:38 -0500 Received: by mail-lj1-f195.google.com with SMTP id f3-v6so7719361ljk.9 for ; Mon, 12 Nov 2018 06:13:09 -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; bh=rt4TJGByCdN0FaMJGDsjlpkv/2YBVgH7VBlG47gGhdM=; b=GtomwXd4vXNr2uoVrRDiWF59fxXmMKtDDsft+18yFgAIncs+k5w7k/O/m75dyb/oqu Peg3VfHMC2XQrCaH/vEBt6vJ91S8asZfuoizhoJCqtTB0vHo9sz2kQbHF2VF6e/tiFfx 173FzdWbSFpTiav0KCKhmloe10OEhLlzQl0gI= 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; bh=rt4TJGByCdN0FaMJGDsjlpkv/2YBVgH7VBlG47gGhdM=; b=C7/cejqbQhOZNtYvoPuazcVgvP7jFt6ry3gQCHVFTRYdwc7LcED4rq6dr6r3smERuo SM/BbZUopULBkucHSZRsh8ZwgnZe/zao+oMBGFa70rj04dPmmQZQSBN6SG47C1pCpM80 NTXM/7dSEBFAbw0UzFgVfHfdTthm/1UrgmcWzcRTr7uRt+yQOMAYlctQmKLxF59Rw7RB qjD3ploYZb96gZIgk6B2BtseiPJI0x6AsI848Z2frypo7nS+cNhiR9IFqbsoNPGyTgWr 0I069f1wM0a1Z/yCrxcP76UcXn5ElqFLkydZaToFyitJPfnkl4fiyMs6jdeXfFNojs3P FYuA== X-Gm-Message-State: AGRZ1gLc7VjjCjr6/lnL0HOoMKyigNKZFhLb0JAIWHwEL9avSTChDem4 1kU2ZWnnBGVYZ8UvEg0+m+E/jgyrSW778A== X-Received: by 2002:a2e:5654:: with SMTP id k81-v6mr795293ljb.48.1542031988783; Mon, 12 Nov 2018 06:13:08 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id m14-v6sm3056889lji.29.2018.11.12.06.13.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 06:13:07 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Linus Walleij Subject: [PATCH 10/10] mmc: slot-gpio: Delete legacy GPIO handling Date: Mon, 12 Nov 2018 15:12:39 +0100 Message-Id: <20181112141239.19646-11-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181112141239.19646-1-linus.walleij@linaro.org> References: <20181112141239.19646-1-linus.walleij@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org All host drivers are converted to look up GPIO descriptors from device tree, ACPI or machine descriptor tables, so now we can delete the legacy GPIO handling using hardcoded GPIO numbers from the kernel. Signed-off-by: Linus Walleij --- drivers/mmc/core/slot-gpio.c | 81 +---------------------------------- include/linux/mmc/slot-gpio.h | 5 --- 2 files changed, 1 insertion(+), 85 deletions(-) -- 2.17.2 diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c index e5bb86b02373..319ccd93383d 100644 --- a/drivers/mmc/core/slot-gpio.c +++ b/drivers/mmc/core/slot-gpio.c @@ -9,7 +9,6 @@ */ #include -#include #include #include #include @@ -102,36 +101,6 @@ int mmc_gpio_get_cd(struct mmc_host *host) } EXPORT_SYMBOL(mmc_gpio_get_cd); -/** - * mmc_gpio_request_ro - request a gpio for write-protection - * @host: mmc host - * @gpio: gpio number requested - * - * As devm_* managed functions are used in mmc_gpio_request_ro(), client - * drivers do not need to worry about freeing up memory. - * - * Returns zero on success, else an error. - */ -int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio) -{ - struct mmc_gpio *ctx = host->slot.handler_priv; - int ret; - - if (!gpio_is_valid(gpio)) - return -EINVAL; - - ret = devm_gpio_request_one(host->parent, gpio, GPIOF_DIR_IN, - ctx->ro_label); - if (ret < 0) - return ret; - - ctx->override_ro_active_level = true; - ctx->ro_gpio = gpio_to_desc(gpio); - - return 0; -} -EXPORT_SYMBOL(mmc_gpio_request_ro); - void mmc_gpiod_request_cd_irq(struct mmc_host *host) { struct mmc_gpio *ctx = host->slot.handler_priv; @@ -200,50 +169,6 @@ void mmc_gpio_set_cd_isr(struct mmc_host *host, } EXPORT_SYMBOL(mmc_gpio_set_cd_isr); -/** - * mmc_gpio_request_cd - request a gpio for card-detection - * @host: mmc host - * @gpio: gpio number requested - * @debounce: debounce time in microseconds - * - * As devm_* managed functions are used in mmc_gpio_request_cd(), client - * drivers do not need to worry about freeing up memory. - * - * If GPIO debouncing is desired, set the debounce parameter to a non-zero - * value. The caller is responsible for ensuring that the GPIO driver associated - * with the GPIO supports debouncing, otherwise an error will be returned. - * - * Returns zero on success, else an error. - */ -int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio, - unsigned int debounce) -{ - struct mmc_gpio *ctx = host->slot.handler_priv; - int ret; - - ret = devm_gpio_request_one(host->parent, gpio, GPIOF_DIR_IN, - ctx->cd_label); - if (ret < 0) - /* - * don't bother freeing memory. It might still get used by other - * slot functions, in any case it will be freed, when the device - * is destroyed. - */ - return ret; - - if (debounce) { - ret = gpio_set_debounce(gpio, debounce); - if (ret < 0) - return ret; - } - - ctx->override_cd_active_level = true; - ctx->cd_gpio = gpio_to_desc(gpio); - - return 0; -} -EXPORT_SYMBOL(mmc_gpio_request_cd); - /** * mmc_gpiod_request_cd - request a gpio descriptor for card-detection * @host: mmc host @@ -254,8 +179,7 @@ EXPORT_SYMBOL(mmc_gpio_request_cd); * @gpio_invert: will return whether the GPIO line is inverted or not, set * to NULL to ignore * - * Use this function in place of mmc_gpio_request_cd() to use the GPIO - * descriptor API. Note that it must be called prior to mmc_add_host() + * Note that this must be called prior to mmc_add_host() * otherwise the caller must also call mmc_gpiod_request_cd_irq(). * * Returns zero on success, else an error. @@ -306,9 +230,6 @@ EXPORT_SYMBOL(mmc_can_gpio_cd); * @gpio_invert: will return whether the GPIO line is inverted or not, * set to NULL to ignore * - * Use this function in place of mmc_gpio_request_ro() to use the GPIO - * descriptor API. - * * Returns zero on success, else an error. */ int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h index 06607c59c4d0..feebd7aa6f5c 100644 --- a/include/linux/mmc/slot-gpio.h +++ b/include/linux/mmc/slot-gpio.h @@ -17,12 +17,7 @@ struct mmc_host; int mmc_gpio_get_ro(struct mmc_host *host); -int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio); - int mmc_gpio_get_cd(struct mmc_host *host); -int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio, - unsigned int debounce); - int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, unsigned int idx, bool override_active_level, unsigned int debounce, bool *gpio_invert);