From patchwork Mon Dec 16 04:49:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 3351931 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 76B549F32E for ; Mon, 16 Dec 2013 04:49:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A51320379 for ; Mon, 16 Dec 2013 04:49:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 848C42034D for ; Mon, 16 Dec 2013 04:49:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752511Ab3LPEtt (ORCPT ); Sun, 15 Dec 2013 23:49:49 -0500 Received: from mail-pd0-f170.google.com ([209.85.192.170]:39752 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752240Ab3LPEts (ORCPT ); Sun, 15 Dec 2013 23:49:48 -0500 Received: by mail-pd0-f170.google.com with SMTP id g10so4858835pdj.1 for ; Sun, 15 Dec 2013 20:49:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:to:cc:in-reply-to:references:from:subject :user-agent:mime-version:content-type; bh=fcwee964qXkcjq5tso4CmJOBzraOLfh7RFuG+Q0z8Tw=; b=EjfO+5USRnamZmxQIaS2H9VN2bXdsa1ZlXy1LyE8GTtAcwvqduSxxyV9OIV5dETYka ZgwFVKEONVcb+31zgQgvlnEBl12Rfkon5mu+afPCMDEMooJyZYtHgDOEhneKbLcxMaeB oox/lzg2UZMlJYA5lectVwXHHLyQWm1wAeOllRFKvOP7ML9veIlO9JTEBdP3BVCf3D7b oz2G8UEfuWKibsTE59XMan24+Ng2sugqPO1+YgsYwQab9YqLdKjqgiOflD7Ik5iMAQUY W1nTn1l6IoDjxpOIExLLToIo3WIXkw4n2nrVUnwpLWiOYt1wL0/yjZ8M+oNhdQCPnnvO xOLQ== X-Received: by 10.68.129.99 with SMTP id nv3mr18023888pbb.40.1387169388229; Sun, 15 Dec 2013 20:49:48 -0800 (PST) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id de1sm22912787pbc.7.2013.12.15.20.49.45 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 15 Dec 2013 20:49:47 -0800 (PST) Date: Sun, 15 Dec 2013 20:49:47 -0800 (PST) Message-ID: <877gb51jtk.wl%kuninori.morimoto.gx@gmail.com> To: Simon Cc: Ben Dooks , Magnus , linux-sh@vger.kernel.org, Kuninori Morimoto In-Reply-To: <87a9g11jxt.wl%kuninori.morimoto.gx@gmail.com> References: <87a9g11jxt.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto Subject: [PATCH 2/6][RFC] mmc: SDHI: updata sh_mobile_sdhi_of_data for r8a7778 User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto This patch updates r8a7778 DT data to have SoC specific settings. Latest Renesas Chip has some SDHI channels and the WP pin availability depends on its channel or HW implementation. Thus, this patch disables it as default, but we can use wp-gpios property to enable it. Signed-off-by: Kuninori Morimoto --- arch/arm/boot/dts/r8a7778-bockw-reference.dts | 4 +++- arch/arm/boot/dts/r8a7778.dtsi | 6 ------ drivers/mmc/host/sh_mobile_sdhi.c | 9 ++++++++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/arch/arm/boot/dts/r8a7778-bockw-reference.dts b/arch/arm/boot/dts/r8a7778-bockw-reference.dts index bb62c7a..06cda19 100644 --- a/arch/arm/boot/dts/r8a7778-bockw-reference.dts +++ b/arch/arm/boot/dts/r8a7778-bockw-reference.dts @@ -17,6 +17,7 @@ /dts-v1/; #include "r8a7778.dtsi" #include +#include / { model = "bockw"; @@ -84,7 +85,7 @@ sdhi0_pins: sd0 { renesas,groups = "sdhi0_data4", "sdhi0_ctrl", - "sdhi0_cd", "sdhi0_wp"; + "sdhi0_cd"; renesas,function = "sdhi0"; }; @@ -101,6 +102,7 @@ vmmc-supply = <&fixedregulator3v3>; bus-width = <4>; status = "okay"; + wp-gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>; }; &hspi0 { diff --git a/arch/arm/boot/dts/r8a7778.dtsi b/arch/arm/boot/dts/r8a7778.dtsi index ddb3bd7..c309430 100644 --- a/arch/arm/boot/dts/r8a7778.dtsi +++ b/arch/arm/boot/dts/r8a7778.dtsi @@ -178,8 +178,6 @@ reg = <0xffe4c000 0x100>; interrupt-parent = <&gic>; interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>; - cap-sd-highspeed; - cap-sdio-irq; status = "disabled"; }; @@ -188,8 +186,6 @@ reg = <0xffe4d000 0x100>; interrupt-parent = <&gic>; interrupts = <0 88 IRQ_TYPE_LEVEL_HIGH>; - cap-sd-highspeed; - cap-sdio-irq; status = "disabled"; }; @@ -198,8 +194,6 @@ reg = <0xffe4f000 0x100>; interrupt-parent = <&gic>; interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>; - cap-sd-highspeed; - cap-sdio-irq; status = "disabled"; }; diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index 8901acd..6442286 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -37,6 +37,7 @@ struct sh_mobile_sdhi_of_data { unsigned long tmio_flags; + unsigned long capabilities; }; static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = { @@ -45,13 +46,18 @@ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = { }, }; +static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = { + .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, + .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, +}; + static const struct of_device_id sh_mobile_sdhi_of_match[] = { { .compatible = "renesas,sdhi-shmobile" }, { .compatible = "renesas,sdhi-sh7372" }, { .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], }, { .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], }, { .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], }, - { .compatible = "renesas,sdhi-r8a7778", .data = &sh_mobile_sdhi_of_cfg[0], }, + { .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, }, { .compatible = "renesas,sdhi-r8a7779", .data = &sh_mobile_sdhi_of_cfg[0], }, { .compatible = "renesas,sdhi-r8a7790", .data = &sh_mobile_sdhi_of_cfg[0], }, {}, @@ -212,6 +218,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) if (of_id && of_id->data) { const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags; + mmc_data->capabilities |= of_data->capabilities; } /* SD control register space size is 0x100, 0x200 for bus_shift=1 */