From patchwork Wed Mar 14 14:20:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 7294 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 1B91F23E0C for ; Wed, 14 Mar 2012 14:20:13 +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 D6945A1874A for ; Wed, 14 Mar 2012 14:20:12 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so3236838iag.11 for ; Wed, 14 Mar 2012 07:20:12 -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:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=i+zhFJsSbpRqIURNqSFJXK9vHVmcDoJDaSz3ouUHE9M=; b=dMhBpI9QXAwSVPouOznBvAUITPTx0UNH22VOgHaaAvE8QwtGmdNrGRbNhNHtN+wl53 gSFkKcNS/gK0b85ODj9RGXX+BoSsT3/kttD7UYwvKcMkZ65ay+XBN5PZFzUrmNgvWwvq FgxuF7Cp6D8IAV4F6+ulMSKPGoJuVsi1OkH6r2nBnuwlIQUHQybQHrD4piTXJkuyH4AD vCkgOuDQvd+Wuw+JtJYoX+58T8nNUBFGVruvKGzWNdWnfWd44DaTcVGvY9cTlDGEfeoR wJjImeUtE2QsRj2Txdapk4BEMyQugwVjzxoRkS6Qqn48JXOrsIxfU8wGrmuCQCYvOvzy N7vA== Received: by 10.50.183.137 with SMTP id em9mr11828970igc.58.1331734812574; Wed, 14 Mar 2012 07:20:12 -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.231.53.18 with SMTP id k18csp11182ibg; Wed, 14 Mar 2012 07:20:12 -0700 (PDT) Received: by 10.180.96.228 with SMTP id dv4mr15387661wib.14.1331734811417; Wed, 14 Mar 2012 07:20:11 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id bw9si5713981wib.28.2012.03.14.07.20.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Mar 2012 07:20:11 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by wera13 with SMTP id a13so2289373wer.37 for ; Wed, 14 Mar 2012 07:20:10 -0700 (PDT) Received: by 10.180.97.41 with SMTP id dx9mr17447754wib.9.1331734810868; Wed, 14 Mar 2012 07:20:10 -0700 (PDT) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id d7sm17077247wiz.6.2012.03.14.07.20.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Mar 2012 07:20:09 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org Cc: cjb@laptop.org, arnd@arndb.de, niklas.hernaeus@linaro.org, linux-mmc@vger.kernel.org, Lee Jones Subject: [PATCH 2/5] MMC: mmci: Seperate ARM variants from generic code Date: Wed, 14 Mar 2012 14:20:00 +0000 Message-Id: <1331734803-17954-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1331734803-17954-1-git-send-email-lee.jones@linaro.org> References: <1331734803-17954-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQnpZws6GdI+D0c3498EX5mKedbFvz52Imwe3HJWMCRZPIXZFtP1lDeeotic/pbonNzrIrKp This is a step in the right direction for future Device Tree support. It will allow variant specific attributes to be collected from a Device Tree without overloading the MMCI core. It will also provide additional future variants a cleaner way to add support. Signed-off-by: Lee Jones --- drivers/mmc/host/Makefile | 2 +- drivers/mmc/host/mmci-arm.c | 65 +++++++++++++++++++++++++++++++++++++++++++ drivers/mmc/host/mmci.c | 61 ---------------------------------------- 3 files changed, 66 insertions(+), 62 deletions(-) create mode 100644 drivers/mmc/host/mmci-arm.c diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile index 58e2bdc..0981787 100644 --- a/drivers/mmc/host/Makefile +++ b/drivers/mmc/host/Makefile @@ -2,7 +2,7 @@ # Makefile for MMC/SD host controller drivers # -obj-$(CONFIG_MMC_ARMMMCI) += mmci.o mmci-ux500.o +obj-$(CONFIG_MMC_ARMMMCI) += mmci.o mmci-ux500.o mmci-arm.o obj-$(CONFIG_MMC_PXA) += pxamci.o obj-$(CONFIG_MMC_IMX) += imxmmc.o obj-$(CONFIG_MMC_MXC) += mxcmmc.o diff --git a/drivers/mmc/host/mmci-arm.c b/drivers/mmc/host/mmci-arm.c new file mode 100644 index 0000000..be78060 --- /dev/null +++ b/drivers/mmc/host/mmci-arm.c @@ -0,0 +1,65 @@ +#include +#include + +#include "mmci.h" + +static struct variant_data variant_arm = { + .fifosize = 16 * 4, + .fifohalfsize = 8 * 4, + .datalength_bits = 16, +}; + +static struct variant_data variant_arm_extended_fifo = { + .fifosize = 128 * 4, + .fifohalfsize = 64 * 4, + .datalength_bits = 16, +}; + +static struct amba_id mmci_arm_ids[] = { + { + .id = 0x00041180, + .mask = 0xff0fffff, + .data = &variant_arm, + }, + { + .id = 0x01041180, + .mask = 0xff0fffff, + .data = &variant_arm_extended_fifo, + }, + { + .id = 0x00041181, + .mask = 0x000fffff, + .data = &variant_arm, + }, + { 0, 0 }, +}; + +MODULE_DEVICE_TABLE(amba, mmci_arm_ids); + +static struct amba_driver mmci_arm_driver = { + .drv = { + .name = DRIVER_NAME, + }, + .probe = mmci_probe, + .remove = __devexit_p(mmci_remove), + .suspend = mmci_suspend, + .resume = mmci_resume, + .id_table = mmci_arm_ids, +}; + +static int __init mmci_arm_init(void) +{ + return amba_driver_register(&mmci_arm_driver); +} + +static void __exit mmci_arm_exit(void) +{ + amba_driver_unregister(&mmci_arm_driver); +} + +module_init(mmci_arm_init); +module_exit(mmci_arm_exit); +module_param(fmax, uint, 0444); + +MODULE_DESCRIPTION("ARM PrimeCell PL180/181 Multimedia Card Interface driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index ff44586..23b41a5 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -37,18 +37,6 @@ #include "mmci.h" -static struct variant_data variant_arm = { - .fifosize = 16 * 4, - .fifohalfsize = 8 * 4, - .datalength_bits = 16, -}; - -static struct variant_data variant_arm_extended_fifo = { - .fifosize = 128 * 4, - .fifohalfsize = 64 * 4, - .datalength_bits = 16, -}; - /* * This must be called with host->lock held */ @@ -1412,52 +1400,3 @@ EXPORT_SYMBOL_GPL(mmci_resume); #define mmci_suspend NULL #define mmci_resume NULL #endif - -static struct amba_id mmci_ids[] = { - { - .id = 0x00041180, - .mask = 0xff0fffff, - .data = &variant_arm, - }, - { - .id = 0x01041180, - .mask = 0xff0fffff, - .data = &variant_arm_extended_fifo, - }, - { - .id = 0x00041181, - .mask = 0x000fffff, - .data = &variant_arm, - }, - { 0, 0 }, -}; - -MODULE_DEVICE_TABLE(amba, mmci_ids); - -static struct amba_driver mmci_driver = { - .drv = { - .name = DRIVER_NAME, - }, - .probe = mmci_probe, - .remove = __devexit_p(mmci_remove), - .suspend = mmci_suspend, - .resume = mmci_resume, - .id_table = mmci_ids, -}; - -static int __init mmci_init(void) -{ - return amba_driver_register(&mmci_driver); -} - -static void __exit mmci_exit(void) -{ - amba_driver_unregister(&mmci_driver); -} - -module_init(mmci_init); -module_exit(mmci_exit); -module_param(fmax, uint, 0444); - -MODULE_DESCRIPTION("ARM PrimeCell PL180/181 Multimedia Card Interface driver"); -MODULE_LICENSE("GPL");