From patchwork Wed Aug 29 10:48:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 11022 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 A037523EFF for ; Wed, 29 Aug 2012 10:30:33 +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 5A419A191F1 for ; Wed, 29 Aug 2012 10:30:01 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id j25so734260iaf.11 for ; Wed, 29 Aug 2012 03:30:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-gm-message-state; bh=7VasPQH1rWPula+aMTfR6dVv4ZtGy6I3C4DP6RLf//0=; b=cxWq1H16zSbalQqxC7ZoNj0/HU/Zr9dktqw54Aqhdo5bZ5n3S4Q6CeRAHPKCkCDUrx TndfEQwB+VcepOBVl0kYGCgfPlr8FNwi/F9ikHc6HwlH6gTrIuA0A80hbcZyT42OnbGN /HOhX2/zrMX9w/mnD0bOzK+M4kb8dumLsBUlIoHJHWeJesSom6nRv55sD9BV3BGiURkT uFN0VVR+OKb9uzKZ2qKKCCAtKKzsZyB2uvCdyv20GUyzqHdPSQ7NMBCRYJO7wxI7AsTz woa5XKRYdcdiudh4pV/C9THpFD3uVHv04zUBsHq5T/b+w/otWjh5p3ZaYdRgSsTGe0yU 8L/A== Received: by 10.50.45.162 with SMTP id o2mr1113174igm.0.1346236233097; Wed, 29 Aug 2012 03:30:33 -0700 (PDT) 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.50.184.232 with SMTP id ex8csp77442igc; Wed, 29 Aug 2012 03:30:32 -0700 (PDT) Received: by 10.68.225.199 with SMTP id rm7mr3680909pbc.150.1346236232211; Wed, 29 Aug 2012 03:30:32 -0700 (PDT) Received: from mailout4.samsung.com (mailout4.samsung.com. [203.254.224.34]) by mx.google.com with ESMTP id ot8si41677596pbb.309.2012.08.29.03.30.31; Wed, 29 Aug 2012 03:30:32 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.34; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M9I00F4LIHIWE11@mailout4.samsung.com>; Wed, 29 Aug 2012 19:30:31 +0900 (KST) X-AuditID: cbfee61a-b7fc66d0000043b7-b9-503def461977 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 20.60.17335.64FED305; Wed, 29 Aug 2012 19:30:31 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M9I004F3IHPXG70@mmp2.samsung.com>; Wed, 29 Aug 2012 19:30:30 +0900 (KST) From: Thomas Abraham To: linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: will.newton@imgtec.com, cjb@laptop.org, grant.likely@secretlab.ca, rob.herring@calxeda.com, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, girish.shivananjappa@linaro.org, jh80.chung@samsung.com, tgih.jun@samsung.com, patches@linaro.org Subject: [PATCH v5 7/9] mmc: dw_mmc: prepare functions in dw_mmc-pltfm for reuse Date: Wed, 29 Aug 2012 16:18:13 +0530 Message-id: <1346237295-7116-8-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1346237295-7116-1-git-send-email-thomas.abraham@linaro.org> References: <1346237295-7116-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJJMWRmVeSWpSXmKPExsVy+t9jQV3397YBBpP/sVh8+XqCzWLK4S8s Dkwed67tYQtgjOKySUnNySxLLdK3S+DKeNYygbHgsnTF46cvmRsYT4l3MXJySAiYSOy9uYsJ whaTuHBvPVsXIxeHkMB0Ron91zYyQjhtTBIdJx6zgFSxCRhIPFr4jh3EFhFwklgydwIzSBGz QCOTxMaFO9lAEsICARIPDm8EG8sioCrRde0TI4jNK+AhcWzSSRaIdUoSG3qPgtVwCnhKvFt5 BaxXCKjm972VbBMYeRcwMqxiFE0tSC4oTkrPNdQrTswtLs1L10vOz93ECA6AZ1I7GFc2WBxi FOBgVOLhvcBtGyDEmlhWXJl7iFGCg1lJhDf1FVCINyWxsiq1KD++qDQntfgQozQHi5I4L3+f YYCQQHpiSWp2ampBahFMlomDU6qBcT/n3ZO6tw2bWvdN+PvPS5htmeGe3bwvI+yu1J59vu1w kvDeLO9bDO+ffp3DKHqpsFjFPvlQ2ayvgc8Prj24Nupzz7OVi9WiYnekhNy8JP+wtPvzAo1f uzV1eReVeKluEVW9sit555PbuyL3GV8vMNrzZeHbum/Xvf+tiJ1nXsDryvRoesGSD25KLMUZ iYZazEXFiQDYEbTj/AEAAA== X-Gm-Message-State: ALoCoQkeI2l+BO1KtbodqR209abEnFHTZh3tuXA+i+pjv07hJ1jMKs7fLJsLJ8WH5cQ3KFKafFdt Platform implementations of dw-mshc controller may choose to exterd the features of the standard dw-mshc controller such as adding additional clocking options or modifying the bus interface. Support for such implementation specific extensions can be incorporated into dw_mmc-pltfm, but including multiple such platform specific implementations would convolute the existing dw_mmc-pltfm code. Instead, it would be better to create implementation specific platform drivers to support implementation specific features. Such platforms drivers can reuse the existing infrastructure in dw_mmc-pltfm for resource identification and controller registration and provide support for implementation specific features. So, allow the infrastructure in dw_mmc-pltfm to be reused by other implementation specific platform drivers. Signed-off-by: Thomas Abraham Acked-by: Will Newton --- drivers/mmc/host/dw_mmc-pltfm.c | 12 ++++++++++-- drivers/mmc/host/dw_mmc-pltfm.h | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 drivers/mmc/host/dw_mmc-pltfm.h diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c index 7205905..e17da91 100644 --- a/drivers/mmc/host/dw_mmc-pltfm.c +++ b/drivers/mmc/host/dw_mmc-pltfm.c @@ -23,7 +23,7 @@ #include "dw_mmc.h" -static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) +int dw_mci_pltfm_register(struct platform_device *pdev) { struct dw_mci *host; struct resource *regs; @@ -52,6 +52,12 @@ static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) ret = dw_mci_probe(host); return ret; } +EXPORT_SYMBOL_GPL(dw_mci_pltfm_register); + +static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) +{ + return dw_mci_pltfm_register(pdev); +} static int __devexit dw_mci_pltfm_remove(struct platform_device *pdev) { @@ -61,6 +67,7 @@ static int __devexit dw_mci_pltfm_remove(struct platform_device *pdev) dw_mci_remove(host); return 0; } +EXPORT_SYMBOL_GPL(dw_mci_pltfm_remove); #ifdef CONFIG_PM_SLEEP /* @@ -94,7 +101,8 @@ static int dw_mci_pltfm_resume(struct device *dev) #define dw_mci_pltfm_resume NULL #endif /* CONFIG_PM_SLEEP */ -static SIMPLE_DEV_PM_OPS(dw_mci_pltfm_pmops, dw_mci_pltfm_suspend, dw_mci_pltfm_resume); +SIMPLE_DEV_PM_OPS(dw_mci_pltfm_pmops, dw_mci_pltfm_suspend, dw_mci_pltfm_resume); +EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops); static const struct of_device_id dw_mci_pltfm_match[] = { { .compatible = "snps,dw-mshc", }, diff --git a/drivers/mmc/host/dw_mmc-pltfm.h b/drivers/mmc/host/dw_mmc-pltfm.h new file mode 100644 index 0000000..6c065d9 --- /dev/null +++ b/drivers/mmc/host/dw_mmc-pltfm.h @@ -0,0 +1,19 @@ +/* + * Synopsys DesignWare Multimedia Card Interface Platform driver + * + * Copyright (C) 2012, Samsung Electronics Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#ifndef _DW_MMC_PLTFM_H_ +#define _DW_MMC_PLTFM_H_ + +extern int dw_mci_pltfm_register(struct platform_device *pdev); +extern int __devexit dw_mci_pltfm_remove(struct platform_device *pdev); +extern const struct dev_pm_ops dw_mci_pltfm_pmops; + +#endif /* _DW_MMC_PLTFM_H_ */