From patchwork Thu Feb 23 11:26:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajendra Nayak X-Patchwork-Id: 6900 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id ECCF223DEE for ; Thu, 23 Feb 2012 11:27:11 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id B4FB0A18941 for ; Thu, 23 Feb 2012 11:27:11 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id z7so1926093iab.11 for ; Thu, 23 Feb 2012 03:27:11 -0800 (PST) Received: from mr.google.com ([10.50.87.201]) by 10.50.87.201 with SMTP id ba9mr1115820igb.30.1329996431574 (num_hops = 1); Thu, 23 Feb 2012 03:27:11 -0800 (PST) Received: by 10.50.87.201 with SMTP id ba9mr960943igb.30.1329996431296; Thu, 23 Feb 2012 03:27:11 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.11.10 with SMTP id r10csp8553ibr; Thu, 23 Feb 2012 03:27:08 -0800 (PST) Received: by 10.236.177.6 with SMTP id c6mr1243217yhm.42.1329996427229; Thu, 23 Feb 2012 03:27:07 -0800 (PST) Received: from bear.ext.ti.com (bear.ext.ti.com. [192.94.94.41]) by mx.google.com with ESMTPS id l67si1154239yhm.25.2012.02.23.03.27.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Feb 2012 03:27:07 -0800 (PST) Received-SPF: pass (google.com: domain of rnayak@ti.com designates 192.94.94.41 as permitted sender) client-ip=192.94.94.41; Authentication-Results: mx.google.com; spf=pass (google.com: domain of rnayak@ti.com designates 192.94.94.41 as permitted sender) smtp.mail=rnayak@ti.com Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q1NBR4Qx001865; Thu, 23 Feb 2012 05:27:05 -0600 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q1NBR3aC027229; Thu, 23 Feb 2012 16:57:03 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Thu, 23 Feb 2012 16:57:03 +0530 Received: from ula0131687.apr.dhcp.ti.com (ula0131687-172024136255.apr.dhcp.ti.com [172.24.136.255]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id q1NBQr76023412; Thu, 23 Feb 2012 16:57:03 +0530 (IST) From: Rajendra Nayak To: , , CC: , , , , , Rajendra Nayak Subject: [PATCH v2 6/6] mmc: omap_hsmmc: Don't expect MMC1 to always have vmmc supply Date: Thu, 23 Feb 2012 16:56:49 +0530 Message-ID: <1329996409-26861-7-git-send-email-rnayak@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1329996409-26861-1-git-send-email-rnayak@ti.com> References: <1329996409-26861-1-git-send-email-rnayak@ti.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkDdQ6Y2fvxGBC6jJy/ZOE579nhr9yMS6glHoGHkl58liG7Jly6lFcb7X6urI/wCgrfHMpR MMC1 is not the only instance that can be used/wired for SD. So remove this assumption from the driver. Now that all the mmc id based usage is removed, get rid of all the DEVID defines and also the 'id' field from the omap_hsmmc_host structure. Signed-off-by: Rajendra Nayak Tested-by: Venkatraman S Tested-by: Balaji T K --- drivers/mmc/host/omap_hsmmc.c | 31 ++----------------------------- 1 files changed, 2 insertions(+), 29 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 17e264b..e3eb9d4 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -106,17 +106,6 @@ #define SOFTRESET (1 << 1) #define RESETDONE (1 << 0) -/* - * FIXME: Most likely all the data using these _DEVID defines should come - * from the platform_data, or implemented in controller and slot specific - * functions. - */ -#define OMAP_MMC1_DEVID 0 -#define OMAP_MMC2_DEVID 1 -#define OMAP_MMC3_DEVID 2 -#define OMAP_MMC4_DEVID 3 -#define OMAP_MMC5_DEVID 4 - #define MMC_AUTOSUSPEND_DELAY 100 #define MMC_TIMEOUT_MS 20 #define OMAP_MMC_MIN_CLOCK 400000 @@ -164,7 +153,6 @@ struct omap_hsmmc_host { void __iomem *base; resource_size_t mapbase; spinlock_t irq_lock; /* Prevent races with irq handler */ - unsigned int id; unsigned int dma_len; unsigned int dma_sg_idx; unsigned char bus_mode; @@ -300,7 +288,6 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on, static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) { struct regulator *reg; - int ret = 0; int ocr_value = 0; mmc_slot(host).set_power = omap_hsmmc_set_power; @@ -308,15 +295,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) reg = regulator_get(host->dev, "vmmc"); if (IS_ERR(reg)) { dev_dbg(host->dev, "vmmc regulator missing\n"); - /* - * HACK: until fixed.c regulator is usable, - * we don't require a main regulator - * for MMC2 or MMC3 - */ - if (host->id == OMAP_MMC1_DEVID) { - ret = PTR_ERR(reg); - goto err; - } } else { host->vcc = reg; ocr_value = mmc_regulator_get_ocrmask(reg); @@ -324,8 +302,8 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) mmc_slot(host).ocr_mask = ocr_value; } else { if (!(mmc_slot(host).ocr_mask & ocr_value)) { - pr_err("MMC%d ocrmask %x is not supported\n", - host->id, mmc_slot(host).ocr_mask); + pr_err("MMC ocrmask %x is not supported\n", + mmc_slot(host).ocr_mask); mmc_slot(host).ocr_mask = 0; return -EINVAL; } @@ -358,10 +336,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) } return 0; - -err: - mmc_slot(host).set_power = NULL; - return ret; } static void omap_hsmmc_reg_put(struct omap_hsmmc_host *host) @@ -1791,7 +1765,6 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) host->dev->dma_mask = &pdata->dma_mask; host->dma_ch = -1; host->irq = irq; - host->id = pdev->id; host->slot_id = 0; host->mapbase = res->start; host->base = ioremap(host->mapbase, SZ_4K);