From patchwork Sun Dec 2 08:43:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 152656 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5558330ljp; Sun, 2 Dec 2018 00:46:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/VlD8yA9yFzSzg0hsztWVt9zxrFQ9J5hM5IB1+Xn3Pm0If5Uo6UX9RdGiqmjpwcWxVhU9vO X-Received: by 2002:a63:680a:: with SMTP id d10mr9883924pgc.396.1543740419126; Sun, 02 Dec 2018 00:46:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543740419; cv=none; d=google.com; s=arc-20160816; b=LhtgcwIW6buEVdSBh7EhoTzWA1O46cqI9PgBOvTNdnx6MdzaeoDzIeItQaPhgIQke/ yJ35CNaTEFNz79K6LHd5iw+P3qhG8VgrTon279ohTvFmCZqVvEEVe+wFqydSWmF07JEv 1ZwQnZ9zMexeFjzcAW0RK8YPqN+GWlVRPrEq1rfQqXSBEy03fGfoEBh4CMG85tQOAwbz 9uSEmTdmsVeWlrdPXCdsfiohbhpcrAyv15DY886fKVI1coYbfXB5Ukp2/AbW9OJcO68G h1m85Y0Gtb1p8Uo6KC9UhCoFtGuMlQ7aJuxnMzdJrOp5AC1ev60IN11qGkN1VT+jUac6 NRyA== 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=T2oK5awB6S0yrcwMPcutj2ghgGKU3l4IxYoOz7JIWyc=; b=TOIMURJjiX6jTLKHz5SiSGhzjZ6hugnzQIB1nedAI1o1KRcVok3AzI224XoOL9+acz aGKLPvNdvBpbo2/1IrX1QpiwEiq3lceFn+aCZqUyIuxU8Go1mWomKJcqQ5F5DFUyam5E ARm3yEDKT/QtWyGBTd5ONajJbLwwgmykuowjC6jl0vqhvc0j3IUkx+EuV5i2oh3OGley J55ROlP2J76MG+oMZXv3Yi3b852lQa26YbvSVOJ1jXY+V14Y/Dh0CVIRuEX+umU5Bu1B 00t1fpV//P3m9mA+neDSP6DIXEkh3xbLju9D9HEXJRNee6mWjHfJqZV/jOpkTlaamcW9 6/dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EGL2MbMt; 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 28si9351748pgz.593.2018.12.02.00.46.58; Sun, 02 Dec 2018 00:46:59 -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=EGL2MbMt; 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 S1725771AbeLBIrA (ORCPT + 5 others); Sun, 2 Dec 2018 03:47:00 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:43155 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbeLBIrA (ORCPT ); Sun, 2 Dec 2018 03:47:00 -0500 Received: by mail-lj1-f194.google.com with SMTP id 83-v6so8591004ljf.10 for ; Sun, 02 Dec 2018 00:46:56 -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=T2oK5awB6S0yrcwMPcutj2ghgGKU3l4IxYoOz7JIWyc=; b=EGL2MbMtQJnpLPBxfvoDxg6Hy5DIIy23/T0xCWD8FX40nMtGtTI9MDCdwiUl7uURtM BiBFSUQJzE55d4gN4j+ouioqOMEPGGlGdWLGKNt6UdWwgsOHrdd+KpsBOHc69JM42QAp 9vT9xmHxyFZXQEOfLj9R60FgqYW5dnDG9uQf0= 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=T2oK5awB6S0yrcwMPcutj2ghgGKU3l4IxYoOz7JIWyc=; b=eexyTNORzU416ld/1Wc1t6XUMvu3wLnVw3k84uhUyNqJU36c0QfLVczqRLpvA4TX2W yYLrp7UNgGKV+RBEk/ihkMbJXVzkEYdwXvrtk4rxcmVgF27lXBhkU1arOhqKyjenWiE5 UYHLLGxxWAu4KNrhy4k3R0fbB3iss5sTcLq7rnikz5HpKBgylmUmS0IHimA2y0v+9o7C 9DXH32tQLDTm5/DuUJd5J8o0/eVBRdIfwapfkDkoiXSBe2pkZ83XRHfxl6xWj936JX4y qFjkJ/LGQe7I6cTFUOvlP0p5cy9i6dldh7g6Jo0CbRYEVvtSj+wph99kb4FA3UilJVEm DHVw== X-Gm-Message-State: AA+aEWaGrymWCplxlDhJ+A/7UsE/e+o2cDUWy64LgjbHPg54mfUUtcgj 9c/f2CpuJFKebHYEpA8f81ZMVPyz3KeR9w== X-Received: by 2002:a2e:9bc3:: with SMTP id w3-v6mr4292120ljj.70.1543740410826; Sun, 02 Dec 2018 00:46:50 -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 z7-v6sm1772719lji.42.2018.12.02.00.46.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Dec 2018 00:46:49 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Linus Walleij , Daniel Mack , Robert Jarzmik , Bartosz Golaszewski , Andrea Adami Subject: [PATCH 09/11 v4] mmc: pxamci: Delete platform data handling of CD and WP Date: Sun, 2 Dec 2018 09:43:26 +0100 Message-Id: <20181202084328.25546-10-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181202084328.25546-1-linus.walleij@linaro.org> References: <20181202084328.25546-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org This deletes the code dealing with handling card detect and write protect passed in as platform data and makes the host rely on just GPIO descriptors. The card read only inversion flag has to be kept around for now, as the core cannot handle the inversion flags on the descriptors yet. Since we can now rely on the descriptors to have the right polarity, we set the "override_active_level" to false in mmc_gpiod_request_cd() and mmc_gpiod_request_ro(). Cc: Daniel Mack Cc: Robert Jarzmik Cc: Bartosz Golaszewski Cc: Andrea Adami Signed-off-by: Linus Walleij --- ChangeLog v3->v4: - Rebase on the other changes. ChangeLog v1->v3: - Split out as separate patch at Robert's request. --- drivers/mmc/host/pxamci.c | 19 ------------------- include/linux/platform_data/mmc-pxamci.h | 2 -- 2 files changed, 21 deletions(-) -- 2.19.1 Acked-by: Robert Jarzmik diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c index 5f06c7902306..a8b6c14f2687 100644 --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c @@ -730,8 +730,6 @@ static int pxamci_probe(struct platform_device *pdev) } if (host->pdata) { - int gpio_cd = host->pdata->gpio_card_detect; - int gpio_ro = host->pdata->gpio_card_ro; int gpio_power = host->pdata->gpio_power; host->detect_delay_ms = host->pdata->detect_delay_ms; @@ -755,29 +753,12 @@ static int pxamci_probe(struct platform_device *pdev) dev_err(dev, "Failed requesting gpio_cd\n"); goto out; } - if (ret == -ENOENT && gpio_is_valid(gpio_cd)) { - ret = mmc_gpio_request_cd(mmc, gpio_cd, 0); - if (ret) { - dev_err(dev, "Failed requesting gpio_cd %d\n", - gpio_cd); - } - } ret = mmc_gpiod_request_ro(mmc, "wp", 0, false, 0, NULL); if (ret && ret != -ENOENT) { dev_err(dev, "Failed requesting gpio_ro\n"); goto out; } - /* Try platform data instead */ - if (ret == -ENOENT && gpio_is_valid(gpio_ro)) { - ret = mmc_gpio_request_ro(mmc, gpio_ro); - if (ret) { - dev_err(dev, - "Failed requesting gpio_ro %d\n", - gpio_ro); - goto out; - } - } if (!ret) { host->use_ro_gpio = true; mmc->caps2 |= host->pdata->gpio_card_ro_invert ? diff --git a/include/linux/platform_data/mmc-pxamci.h b/include/linux/platform_data/mmc-pxamci.h index 752f97c62ef2..db6c247d42d1 100644 --- a/include/linux/platform_data/mmc-pxamci.h +++ b/include/linux/platform_data/mmc-pxamci.h @@ -15,8 +15,6 @@ struct pxamci_platform_data { int (*get_ro)(struct device *); int (*setpower)(struct device *, unsigned int); void (*exit)(struct device *, void *); - int gpio_card_detect; /* gpio detecting card insertion */ - int gpio_card_ro; /* gpio detecting read only toggle */ bool gpio_card_ro_invert; /* gpio ro is inverted */ int gpio_power; /* gpio powering up MMC bus */ bool gpio_power_invert; /* gpio power is inverted */