From patchwork Thu Jun 7 17:57:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9164 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 D5DB623E37 for ; Thu, 7 Jun 2012 17:57:53 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 9752AA183C5 for ; Thu, 7 Jun 2012 17:57:53 +0000 (UTC) Received: by yenq6 with SMTP id q6so698488yen.11 for ; Thu, 07 Jun 2012 10:57:53 -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:x-gm-message-state; bh=5LDTymsGNlSh/S3emyl6fG6NN5SOPMUQjZevZIW951A=; b=hKESv4kQO8tqOU82MDowyVqid+J9CKACR62UkzaqB0j6ZN7hqVw+6vmznN2lv+YubH UFj+J+K4ImXQNY67VMLB3CKwTYCPeV0gXxvAsYsBGjxabizkL0tzM+6LJMVevFFsgRFJ 1saHr7YW1AoyqePk9GXdZcvQY5KTypY70xuwPpbgSpSC7BsgX2w3vCMe8dtWcMZ7PbGQ 43Din5g+/acaOZigsIFuO8hYZZvgworSZrGiH62lCnjMEYRn5UQ1nM5edVlmeNeFRaPs Nwb6RxBoT1N6AoJ2UMIp8bzKcF3f46TwQa3m3c/gSWKZefYE/vPpW2Do3hmV8v37eotz pBsQ== Received: by 10.50.87.227 with SMTP id bb3mr1743880igb.57.1339091872737; Thu, 07 Jun 2012 10:57:52 -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.24.148 with SMTP id v20csp155816ibb; Thu, 7 Jun 2012 10:57:51 -0700 (PDT) Received: by 10.152.105.173 with SMTP id gn13mr3576749lab.20.1339091870609; Thu, 07 Jun 2012 10:57:50 -0700 (PDT) Received: from mail.df.lth.se (mail.df.lth.se. [194.47.250.12]) by mx.google.com with ESMTPS id t10si4191516lat.2.2012.06.07.10.57.49 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 07 Jun 2012 10:57:50 -0700 (PDT) Received-SPF: pass (google.com: domain of triad@df.lth.se designates 194.47.250.12 as permitted sender) client-ip=194.47.250.12; Authentication-Results: mx.google.com; spf=pass (google.com: domain of triad@df.lth.se designates 194.47.250.12 as permitted sender) smtp.mail=triad@df.lth.se Received: from mer.df.lth.se (mer.df.lth.se [194.47.250.37]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPS id 33D6B65D6B; Thu, 7 Jun 2012 19:57:49 +0200 (CEST) Received: from mer.df.lth.se (triad@localhost.localdomain [127.0.0.1]) by mer.df.lth.se (8.14.3/8.14.3/Debian-9.4) with ESMTP id q57Hvmjk026742; Thu, 7 Jun 2012 19:57:48 +0200 Received: (from triad@localhost) by mer.df.lth.se (8.14.3/8.14.3/Submit) id q57Hvm6n026741; Thu, 7 Jun 2012 19:57:48 +0200 From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Cc: arm@kernel.org, Linus Walleij Subject: [PATCH 7/7 v2] ARM: nomadik: register the MMC/SD device Date: Thu, 7 Jun 2012 19:57:44 +0200 Message-Id: <1339091864-26715-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQlxTPsDHLLBuQQM4WgH/gyIN9FPFtbf4SmddfT2W6jGBtJgokFD+zNUI3lm0aKtc2HZqS7d This registers the MMC device for the Nomadik so we can access MMC/SD cards, which is pretty nice. Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Register as an APB device rather than as AHB. --- arch/arm/mach-nomadik/board-nhk8815.c | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index 029a741..1169a12 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,7 @@ #include #include +#include #include #include @@ -186,6 +188,29 @@ static void __init nhk8815_onenand_init(void) #endif } +static struct mmci_platform_data mmcsd_plat_data = { + .ocr_mask = MMC_VDD_29_30, + .f_max = 48000000, + .gpio_wp = -1, + .gpio_cd = 111, /* Or 112 for S8815 */ + .cd_invert = true, + .capabilities = MMC_CAP_MMC_HIGHSPEED | + MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA, +}; + +static int __init nhk8815_mmcsd_init(void) +{ + int ret; + + ret = gpio_request(112, "card detect bias"); + if (ret) + return ret; + gpio_direction_output(112, 0); + amba_apb_device_add(NULL, "mmci", NOMADIK_SDI_BASE, SZ_4K, IRQ_SDMMC, 0, &mmcsd_plat_data, 0x10180180); + return 0; +} +module_init(nhk8815_mmcsd_init); + static struct resource nhk8815_eth_resources[] = { { .name = "smc91x-regs",