From patchwork Thu Sep 20 23:01:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 147166 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp99362ljw; Thu, 20 Sep 2018 16:01:22 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYMhP9WgZU9SHuzHTELeTTZBPky3/12skgRqP9MgJXi2wun25tNJ0Rolb9uBVeebt2tv1t2 X-Received: by 2002:a62:9645:: with SMTP id c66-v6mr43634383pfe.56.1537484482611; Thu, 20 Sep 2018 16:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537484482; cv=none; d=google.com; s=arc-20160816; b=xGMQ9HYw+tjlptnKZEh/VlrP/AVyuQ4P7Q3pllHQg+y4dVC/u+fnzC4ETU6C35MN9m SX3NQHEptmropJAW+3GisIWFwvdqNrxS2Z5LL2CxsW6v/f4NHBN052ThNyuV6VSqI3zR nRWrGnDbY+SLFEW9WmuLl2T1KAYvnsDhZpEtMyR0kToFcTQ+dMDHfjE99ZhU4qB3FClH lu4OIDeRQh3M5XiUHPVkp2rhSqmHcVYsfXSC6oQu0HP/ZRoq/GKfD6mY/n4i48tPVjBj 1h3DRMXIJBwVLAyRScqeuEkrbHT8R1Ey40Zf12b+zFUzhWu6irlZ7BiGUrQdVGwnHAYv aoyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=RiYQT1GCpzWFp66mr25sBQCgJCE7IjIN3bLw6Q/nQA4=; b=yli7CHkcpu1xqzsn2efg1xZ8Kb74pr220jHJH1zIoZ/eTPepLBZwL3f5Iq6VghG83l RyWtu0XsXyzVrIFpIjy81rpt6f4qqJ/9xONmjUNwzLWZvkr4gXTY3QlZqnqSPB0ptk5v FY7bTB3w5PZyeWCRpWKUYnAv+UCwa5Qd1x7gSER8TZU2cROpoV5X3c+hIoozX7FtfX5X TR/NxlgMXu8EkgVA/Pmvb9tH7arjwW1nKcJHfpwpOdV1FvFTYBoD8uzbAi5WGq7Ll+7u oxdYGJYLiFFhprlw3yCNhlmKlwxgaFcLcOX81ZKgoJxKCQerMCISHyDr3yfJHptwWcZ0 ggyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ZggGVd1/"; 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 g9-v6si24356899plo.23.2018.09.20.16.01.22; Thu, 20 Sep 2018 16:01:22 -0700 (PDT) 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="ZggGVd1/"; 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 S1726057AbeIUErL (ORCPT + 5 others); Fri, 21 Sep 2018 00:47:11 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:43054 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbeIUErL (ORCPT ); Fri, 21 Sep 2018 00:47:11 -0400 Received: by mail-pg1-f193.google.com with SMTP id q19-v6so4247456pgn.10 for ; Thu, 20 Sep 2018 16:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=RiYQT1GCpzWFp66mr25sBQCgJCE7IjIN3bLw6Q/nQA4=; b=ZggGVd1/pX53Zsa6QiJ3EjssYa5yf70N6rPisf/SrtHz0AYEM3GrEdzQaEjTe/98Xj l/Y0GhsT7Z/tZVVid+mvC+3XxtIcLpRVkO1HRsIYCXLWHQlQG0H8yksQnRSSn52e5eHm SxM5mMAhhWPN3fLltLSMib0iUV7I6vn5qyKyA= 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; bh=RiYQT1GCpzWFp66mr25sBQCgJCE7IjIN3bLw6Q/nQA4=; b=GDSPCCUGergXyMsPYHBVH1yCycKMEQrRCCfH8jmVJlDA6W2Y1Paq6GCYMVMayHl2xB 3w2Gt3NZ89GSjAHYCCmLCRHRrBRmJ3Brjcf7Tfj/hgPGCZSSyT7fK3aSq+y4L0uMOIWK KOwxAuJmkWb1MIJdY0qzL75gFDnQAQal5YlCLGMWQCobtv3+O48puNDvfsJcC+wuoFBM GPQve9ZjG/LxZQOJ7G0TqborTcXzvBB9Xh64C5kpb6rUPmLabbjUA+ndz1mRj4ypcFsa kCDVu2B/oB+bYgrLldWlhpdnNImXW0ld9qMe3HPEiko3PoYwaRtOGOfufJThB5cKDyUz 2Z4A== X-Gm-Message-State: APzg51BgYQu5Xu4kyiCRedqmbitgzml3M4sroA5CAN8uIzvUScn/CQFZ jUp/JqQuBEcUgdmpxwB2lY9ixrQ5LZw= X-Received: by 2002:a62:586:: with SMTP id 128-v6mr43530720pff.80.1537484480635; Thu, 20 Sep 2018 16:01:20 -0700 (PDT) Received: from localhost.localdomain ([209.121.128.187]) by smtp.gmail.com with ESMTPSA id q26-v6sm43254149pfj.127.2018.09.20.16.01.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 16:01:18 -0700 (PDT) From: Linus Walleij To: Ulf Hansson , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Srinivas Kandagatla Cc: Russell King , Linus Walleij Subject: [PATCH] mmc: mmci: Drop support for pdata GPIO numbers Date: Thu, 20 Sep 2018 16:01:10 -0700 Message-Id: <20180920230110.19927-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org All the machines using the MMCI are passing GPIOs for the card detect and write protect using the device tree or descriptor table (one single case, Integrator/AP IM-PD1). Drop support for passing global GPIO numbers through platform data, noone is using it. Signed-off-by: Linus Walleij --- arch/arm/mach-integrator/integrator_cp.c | 2 -- arch/arm/mach-versatile/versatile_dt.c | 4 --- drivers/mmc/host/mmci.c | 34 +++++------------------- include/linux/amba/mmci.h | 11 ++------ 4 files changed, 8 insertions(+), 43 deletions(-) -- 2.17.1 diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 772a7cf2010e..976ded5c5916 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c @@ -80,8 +80,6 @@ static unsigned int mmc_status(struct device *dev) static struct mmci_platform_data mmc_data = { .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, .status = mmc_status, - .gpio_wp = -1, - .gpio_cd = -1, }; static u64 notrace intcp_read_sched_clock(void) diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c index 3c8d39c12909..e9d60687e416 100644 --- a/arch/arm/mach-versatile/versatile_dt.c +++ b/arch/arm/mach-versatile/versatile_dt.c @@ -89,15 +89,11 @@ unsigned int mmc_status(struct device *dev) static struct mmci_platform_data mmc0_plat_data = { .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, .status = mmc_status, - .gpio_wp = -1, - .gpio_cd = -1, }; static struct mmci_platform_data mmc1_plat_data = { .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, .status = mmc_status, - .gpio_wp = -1, - .gpio_cd = -1, }; /* diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 1841d250e9e2..4b843712dc01 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -28,8 +28,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -1675,13 +1674,6 @@ static int mmci_probe(struct amba_device *dev, else if (plat->ocr_mask) dev_warn(mmc_dev(mmc), "Platform OCR mask is ignored\n"); - /* DT takes precedence over platform data. */ - if (!np) { - if (!plat->cd_invert) - mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH; - mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; - } - /* We support these capabilities. */ mmc->caps |= MMC_CAP_CMD23; @@ -1749,30 +1741,16 @@ static int mmci_probe(struct amba_device *dev, * - not using DT but using a descriptor table, or * - using a table of descriptors ALONGSIDE DT, or * look up these descriptors named "cd" and "wp" right here, fail - * silently of these do not exist and proceed to try platform data + * silently of these do not exist */ if (!np) { ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL); - if (ret < 0) { - if (ret == -EPROBE_DEFER) - goto clk_disable; - else if (gpio_is_valid(plat->gpio_cd)) { - ret = mmc_gpio_request_cd(mmc, plat->gpio_cd, 0); - if (ret) - goto clk_disable; - } - } + if (ret == -EPROBE_DEFER) + goto clk_disable; ret = mmc_gpiod_request_ro(mmc, "wp", 0, false, 0, NULL); - if (ret < 0) { - if (ret == -EPROBE_DEFER) - goto clk_disable; - else if (gpio_is_valid(plat->gpio_wp)) { - ret = mmc_gpio_request_ro(mmc, plat->gpio_wp); - if (ret) - goto clk_disable; - } - } + if (ret == -EPROBE_DEFER) + goto clk_disable; } ret = devm_request_irq(&dev->dev, dev->irq[0], mmci_irq, IRQF_SHARED, diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h index da8357ba11bc..c92ebc39fc1f 100644 --- a/include/linux/amba/mmci.h +++ b/include/linux/amba/mmci.h @@ -18,20 +18,13 @@ * mask into a value to be binary (or set some other custom bits * in MMCIPWR) or:ed and written into the MMCIPWR register of the * block. May also control external power based on the power_mode. - * @status: if no GPIO read function was given to the block in - * gpio_wp (below) this function will be called to determine - * whether a card is present in the MMC slot or not - * @gpio_wp: read this GPIO pin to see if the card is write protected - * @gpio_cd: read this GPIO pin to detect card insertion - * @cd_invert: true if the gpio_cd pin value is active low + * @status: if no GPIO line was given to the block in this function will + * be called to determine whether a card is present in the MMC slot or not */ struct mmci_platform_data { unsigned int ocr_mask; int (*ios_handler)(struct device *, struct mmc_ios *); unsigned int (*status)(struct device *); - int gpio_wp; - int gpio_cd; - bool cd_invert; }; #endif