From patchwork Mon Sep 17 18:16:41 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: 11469 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 484F923F9E for ; Mon, 17 Sep 2012 17:56:58 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 57EFB3D08B85 for ; Mon, 17 Sep 2012 17:56:56 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id k11so9550081iea.11 for ; Mon, 17 Sep 2012 10:56:56 -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=PkMwXIeFip+gllxA2BZQxLZKtas0+nugAq7TZuKsw/Riq3m+f1FtwcwhaHO+ei+taX TXZnTCE0ZmFIyfS/K8VIe+Ik1XewT25kv6PvKB3J6lkG6fhkBjNluecRUN3V1Wnyyo2M 1SMuikI1utS1CQK2djjD+K4dmlHYE1rF3MO0Q0j5rRWF5tkFDpCJQn17vzrF6Cby2qiL v8iMy/Sp0ax4kXLGmm+eFm/lYAE13ge8pZIhdw+6pqL8h/hp2Mzp6JOO4mE1qY5WStFr wSWFVeH42KSXyIqopbAmsLzCCVv7x/NXbQZGjf6RwA7WGzQWgPIgYl3s7Ydj5VqGEfjU rmbA== Received: by 10.50.89.164 with SMTP id bp4mr7775248igb.28.1347904616030; Mon, 17 Sep 2012 10:56:56 -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 ex8csp329899igc; Mon, 17 Sep 2012 10:56:55 -0700 (PDT) Received: by 10.68.240.138 with SMTP id wa10mr23436726pbc.145.1347904615287; Mon, 17 Sep 2012 10:56:55 -0700 (PDT) Received: from mailout3.samsung.com (mailout3.samsung.com. [203.254.224.33]) by mx.google.com with ESMTP id pp1si8783071pbc.122.2012.09.17.10.56.54; Mon, 17 Sep 2012 10:56:55 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.33 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.33; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.33 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MAI005339UEK530@mailout3.samsung.com>; Tue, 18 Sep 2012 02:56:54 +0900 (KST) X-AuditID: cbfee61b-b7f2b6d000000f14-fc-5057646616cc Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id D4.6A.03860.66467505; Tue, 18 Sep 2012 02:56:54 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MAI00MTJ9U8PO50@mmp1.samsung.com>; Tue, 18 Sep 2012 02:56:54 +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 v6 7/9] mmc: dw_mmc: prepare functions in dw_mmc-pltfm for reuse Date: Mon, 17 Sep 2012 23:46:41 +0530 Message-id: <1347905803-22742-8-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1347905803-22742-1-git-send-email-thomas.abraham@linaro.org> References: <1347905803-22742-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBJMWRmVeSWpSXmKPExsVy+t9jAd20lPAAgz9bOS2+fD3BZjHl8BcW ByaPO9f2sAUwRnHZpKTmZJalFunbJXBlPGuZwFhwWbri8dOXzA2Mp8S7GDk5JARMJL4232KB sMUkLtxbzwZiCwksYpT4/N28i5ELyG5jkjjbtpIVJMEmYCDxaOE7dhBbRMBJYsncCcwgRcwC jUwSGxfuBOsWFgiQuD2lD6yIRUBVYuLmQ2AbeAU8Je4tesAEsU1JYkPvUTCbU8BLYvr2Q+wQ mz0l9q6YzTKBkXcBI8MqRtHUguSC4qT0XCO94sTc4tK8dL3k/NxNjGD/P5PewbiqweIQowAH oxIPb0JQeIAQa2JZcWXuIUYJDmYlEd7bAkAh3pTEyqrUovz4otKc1OJDjNIcLErivMKfAgOE BNITS1KzU1MLUotgskwcnFINjI6fzHbv2f7lyZPImXeUalOnuj7O2V8VvWVL2ZwTU7iZ9+zk ETrZ9v/LIfejG/fFx8ZdXL110jkRZvaDZxdVbvl2YrNX9u3aw7eDWX/L1T3p38l5PiDOcH3F 2YMFR7aeb51iFulc8OjEd6mN2wzj8pIjvjkvv3v83soUo1Wl/O+NwlM1hS8ETGRUYinOSDTU Yi4qTgQAALPZZvsBAAA= X-Gm-Message-State: ALoCoQlMJhwQD0XpIHLIejdFVlPO8RLEvJGXg43MYG/xKnQzhJ99vcScRER4zfKN9Tlo2JnVROpQ 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_ */