From patchwork Thu Nov 14 10:32:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 3181741 Return-Path: X-Original-To: patchwork-linux-mmc@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 1AD1E9F3A0 for ; Thu, 14 Nov 2013 10:32:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EFC5120969 for ; Thu, 14 Nov 2013 10:32:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4DAA420974 for ; Thu, 14 Nov 2013 10:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753253Ab3KNKc1 (ORCPT ); Thu, 14 Nov 2013 05:32:27 -0500 Received: from mail-pb0-f44.google.com ([209.85.160.44]:46239 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752978Ab3KNKc1 (ORCPT ); Thu, 14 Nov 2013 05:32:27 -0500 Received: by mail-pb0-f44.google.com with SMTP id rp16so1842704pbb.17 for ; Thu, 14 Nov 2013 02:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:to:cc:in-reply-to:references:from:subject :mime-version:content-type; bh=0m8I7pHmjPJ5weIpSPsFaM9UV2bfhdqP7LHLWTWfQNA=; b=GVdHMayej4HimogefkNOfuJltB2XacNDtChGC97f5BuGA62Zsd2+WkSn1R2Hce2W3O S0HBL46n+R6D0Av66PWqEvJtKzemFrVJ/QyMx0CpakhyvM+nvlRECv8Mi0gfoLJzYHiD vPyN7oVvP5dWbxq18XcK3LyJBZgwae4ED+tzkNbPpoS9HruOp57jbMWQiVChCzJKTf8I IjL3EAs+ub+OYfN3TOLWBYDF1YWZwL3KSOP8GyGegp7SJjGe5V8kDeO6cbV4kse5uCPy DJ5rwgpS8FOCJbe9RGA/R5A8EsZNW1dpjr8mbk8Ylebkj/Yagk68mhdMQmzr/OeperFn GpMQ== X-Received: by 10.68.130.72 with SMTP id oc8mr669887pbb.200.1384425146233; Thu, 14 Nov 2013 02:32:26 -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 8sm4770642pbv.0.2013.11.14.02.32.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 14 Nov 2013 02:32:25 -0800 (PST) Date: Thu, 14 Nov 2013 02:32:25 -0800 (PST) Message-ID: <87y54rxoi3.wl%kuninori.morimoto.gx@renesas.com> To: Chris Ball Cc: Simon , Laurent , Magnus , Linux-SH , Kuninori Morimoto , linux-mmc@vger.kernel.org In-Reply-To: <8761rvz37d.wl%kuninori.morimoto.gx@renesas.com> References: <87li0rz3to.wl%kuninori.morimoto.gx@renesas.com> <8761rvz37d.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 13/17] mmc: SDHI: updata sh_mobile_sdhi_of_data for r8a7778 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 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 9c8bd37..6e58077 100644 --- a/arch/arm/boot/dts/r8a7778-bockw-reference.dts +++ b/arch/arm/boot/dts/r8a7778-bockw-reference.dts @@ -16,6 +16,7 @@ /dts-v1/; /include/ "r8a7778.dtsi" +#include / { model = "bockw"; @@ -83,7 +84,7 @@ sdhi0_pins: sd0 { renesas,groups = "sdhi0_data4", "sdhi0_ctrl", - "sdhi0_cd", "sdhi0_wp"; + "sdhi0_cd"; renesas,function = "sdhi0"; }; }; @@ -95,4 +96,5 @@ vmmc-supply = <&fixedregulator3v3>; bus-width = <4>; status = "okay"; + wp-gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>; }; diff --git a/arch/arm/boot/dts/r8a7778.dtsi b/arch/arm/boot/dts/r8a7778.dtsi index 698809f..bfb7030 100644 --- a/arch/arm/boot/dts/r8a7778.dtsi +++ b/arch/arm/boot/dts/r8a7778.dtsi @@ -170,8 +170,6 @@ reg = <0xffe4c000 0x100>; interrupt-parent = <&gic>; interrupts = <0 87 4>; - cap-sd-highspeed; - cap-sdio-irq; status = "disabled"; }; @@ -180,8 +178,6 @@ reg = <0xffe4d000 0x100>; interrupt-parent = <&gic>; interrupts = <0 88 4>; - cap-sd-highspeed; - cap-sdio-irq; status = "disabled"; }; @@ -190,8 +186,6 @@ reg = <0xffe4f000 0x100>; interrupt-parent = <&gic>; interrupts = <0 86 4>; - 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 1a3bd0b..dc97027 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 */