From patchwork Fri Feb 15 06:21:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manjunathappa, Prakash" X-Patchwork-Id: 2144541 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by patchwork2.kernel.org (Postfix) with ESMTP id DCD4BDF24C for ; Fri, 15 Feb 2013 06:25:21 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r1F6LOur020559; Fri, 15 Feb 2013 00:21:24 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r1F6LNYp024547; Fri, 15 Feb 2013 00:21:23 -0600 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Fri, 15 Feb 2013 00:21:23 -0600 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r1F6LNsg018818; Fri, 15 Feb 2013 00:21:23 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 3619180627; Fri, 15 Feb 2013 00:21:23 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dbdp20.itg.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by linux.omap.com (Postfix) with ESMTP id 074D680626 for ; Fri, 15 Feb 2013 00:21:20 -0600 (CST) 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 r1F6LI9J009054; Fri, 15 Feb 2013 11:51:18 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Fri, 15 Feb 2013 11:51:18 +0530 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with SMTP id r1F6LH1B017754; Fri, 15 Feb 2013 11:51:17 +0530 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id C51AB158002; Fri, 15 Feb 2013 11:51:16 +0530 (IST) Received: from ubuntu-psp-linux.india.ext.ti.com (ubuntu-psp-linux [192.168.247.46]) by symphony.india.ext.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r1F6LDR03612; Fri, 15 Feb 2013 11:51:14 +0530 (IST) From: "Manjunathappa, Prakash" To: Subject: [PATCH v4 2/5] mmc: davinci_mmc: derive controller IP version from platform_device_id Date: Fri, 15 Feb 2013 11:51:59 +0530 Message-ID: <1360909322-1858-3-git-send-email-prakash.pm@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360909322-1858-1-git-send-email-prakash.pm@ti.com> References: <1360909322-1858-1-git-send-email-prakash.pm@ti.com> MIME-Version: 1.0 CC: , , , , , , , , , X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com Stop getting controller IP version via platform data, instead derive it from platform_device_id table. Signed-off-by: Manjunathappa, Prakash --- Suppose to be v1 but got added later to this series. drivers/mmc/host/davinci_mmc.c | 17 ++++++++++++++++- include/linux/platform_data/mmc-davinci.h | 3 --- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index 27123f8..874dc60 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c @@ -1156,6 +1156,17 @@ static void __init init_mmcsd_host(struct mmc_davinci_host *host) mmc_davinci_reset_ctrl(host, 0); } +static struct platform_device_id davinci_mmc_devtype[] = { + { + .name = "davinci-mmc-dm355", + .driver_data = MMC_CTLR_VERSION_1, + }, { + .name = "davinci-mmc-da830", + .driver_data = MMC_CTLR_VERSION_2, + }, + {}, +}; +MODULE_DEVICE_TABLE(platform, davinci_mmc_devtype); static int __init davinci_mmcsd_probe(struct platform_device *pdev) { @@ -1165,6 +1176,7 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev) struct resource *r, *mem = NULL; int ret = 0, irq = 0; size_t mem_size; + const struct platform_device_id *id_entry; /* REVISIT: when we're fully converted, fail if pdata is NULL */ @@ -1239,7 +1251,9 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev) if (pdata && (pdata->wires == 8)) mmc->caps |= (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA); - host->version = pdata->version; + id_entry = platform_get_device_id(pdev); + if (id_entry) + host->version = id_entry->driver_data; mmc->ops = &mmc_davinci_ops; mmc->f_min = 312500; @@ -1410,6 +1424,7 @@ static struct platform_driver davinci_mmcsd_driver = { .pm = davinci_mmcsd_pm_ops, }, .remove = __exit_p(davinci_mmcsd_remove), + .id_table = davinci_mmc_devtype, }; static int __init davinci_mmcsd_init(void) diff --git a/include/linux/platform_data/mmc-davinci.h b/include/linux/platform_data/mmc-davinci.h index 5ba6b22..9cea4ee 100644 --- a/include/linux/platform_data/mmc-davinci.h +++ b/include/linux/platform_data/mmc-davinci.h @@ -23,9 +23,6 @@ struct davinci_mmc_config { /* any additional host capabilities: OR'd in to mmc->f_caps */ u32 caps; - /* Version of the MMC/SD controller */ - u8 version; - /* Number of sg segments */ u8 nr_sg; };