From patchwork Sun Aug 26 11:52:05 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: 10956 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 EB6F623EFE for ; Sun, 26 Aug 2012 11:34:28 +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 84A72A18263 for ; Sun, 26 Aug 2012 11:34:05 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id j25so3776090iaf.11 for ; Sun, 26 Aug 2012 04:34:28 -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=MeGJLQjZMVUSjkGbLGJ8r2B7qtS95Z2SiiPIKbREaNE=; b=lAOp3sYD1xvZVoNUEnomTcFTXcZrDhvMQ44lFHuNw+xdIRuKUJXhuuHjo5rWh/lBkE 2r9lc9EUfGgs8oN5sEUl7Jju5NN7d8/hqBrwP7M8PyulNnijqNrgauGqhHLz0/gv/q4B lQl1XAIJBD52/9XAV9umRXq5FB5MYJyNPYHIvqxyGJfCJwEnjedLBnz+FoJ26p+cBtWg x9S45MIACCKZr21Dg/1S5AExhjZj4+Te99NloPeNVB6g5AvTLnBkbbwAuSDrlWFAytyQ zIfqfUw8hs47iBxstIWarNl2vjt70G3IbUltBug0WshxmA+lTieP+HNVkuubp5WvGffR PFvg== Received: by 10.50.87.164 with SMTP id az4mr7115685igb.43.1345980868258; Sun, 26 Aug 2012 04:34:28 -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 ex8csp396432igc; Sun, 26 Aug 2012 04:34:27 -0700 (PDT) Received: by 10.68.136.67 with SMTP id py3mr26181233pbb.156.1345980867697; Sun, 26 Aug 2012 04:34:27 -0700 (PDT) Received: from mailout3.samsung.com (mailout3.samsung.com. [203.254.224.33]) by mx.google.com with ESMTP id vn9si15088955pbc.17.2012.08.26.04.34.27; Sun, 26 Aug 2012 04:34:27 -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 <0M9D004031HCOI10@mailout3.samsung.com>; Sun, 26 Aug 2012 20:34:26 +0900 (KST) X-AuditID: cbfee61b-b7faf6d00000476a-c7-503a09c270d2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 67.E9.18282.2C90A305; Sun, 26 Aug 2012 20:34:26 +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 <0M9D00AQQ1GN7UA0@mmp1.samsung.com>; Sun, 26 Aug 2012 20:34:26 +0900 (KST) From: Thomas Abraham To: linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: 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 v4 7/9] mmc: dw_mmc: prepare functions in dw_mmc-pltfm for reuse Date: Sun, 26 Aug 2012 17:22:05 +0530 Message-id: <1345981927-26359-8-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1345981927-26359-1-git-send-email-thomas.abraham@linaro.org> References: <1345981927-26359-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOJMWRmVeSWpSXmKPExsVy+t9jAd1DnFYBBn8/KVp8+XqCzWLK4S8s Dkwed67tYQtgjOKySUnNySxLLdK3S+DKONT2nLngq3TFjW03GBsYn4h3MXJySAiYSHy8cZgR whaTuHBvPRuILSSwiFHiwrGqLkYuILuNSeL8gaPsIAk2AQOJRwvfgdkiAk4SS+ZOYAYpYhZ4 ySgxc9dMsG5hgQCJDR+3gdksAqoSpz4tASri4OAV8JSYe6UeYpmSxIbeo0wgNqeAl8SNRa3s EIs9JY7P+M44gZF3ASPDKkbR1ILkguKk9FwjveLE3OLSvHS95PzcTYxg7z+T3sG4qsHiEKMA B6MSD69AqWWAEGtiWXFl7iFGCQ5mJRHe7/uBQrwpiZVVqUX58UWlOanFhxilOViUxHn5+wwD hATSE0tSs1NTC1KLYLJMHJxSDYwrgps62z2PWJRP+Wm8+M8ioRMr+HQ+a34V3DPrkNqzw/wn oq7tTeGy/Li23f1Hz6FXThELDdO/yZs8likyPqD/4a3Yn5iDy25vPuDE3pH261HkLY/+SKVJ X794XDzLeutoyeG0bQ6/qi7uW1N3SOnimoyUXpn7olbh5e+Y15c01h22XWrB/36/EktxRqKh FnNRcSIA3BU8tvoBAAA= X-Gm-Message-State: ALoCoQlL23bORBSzjLQkdUiI6mcvO03WQcBdlHwLdUr3Un3hP2Zy7ERRmOg2lGjG6FQyYwzK49VC Platform implementations of dw-mshc controller may choose to extend 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 --- drivers/mmc/host/dw_mmc-pltfm.c | 14 +++++++++++--- drivers/mmc/host/dw_mmc-pltfm.h | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+), 3 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 25c5f11..57df3eb 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 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,8 +52,14 @@ static int dw_mci_pltfm_probe(struct platform_device *pdev) ret = dw_mci_probe(host); return ret; } +EXPORT_SYMBOL_GPL(dw_mci_pltfm_register); + +static int dw_mci_pltfm_probe(struct platform_device *pdev) +{ + return dw_mci_pltfm_register(pdev); +} -static int __exit dw_mci_pltfm_remove(struct platform_device *pdev) +int __exit dw_mci_pltfm_remove(struct platform_device *pdev) { struct dw_mci *host = platform_get_drvdata(pdev); @@ -61,6 +67,7 @@ static int __exit 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..5618608 --- /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 __exit dw_mci_pltfm_remove(struct platform_device *pdev); +extern const struct dev_pm_ops dw_mci_pltfm_pmops; + +#endif /* _DW_MMC_PLTFM_H_ */