From patchwork Fri May 15 08:20:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 6412711 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 948729F1C1 for ; Fri, 15 May 2015 08:21:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3F0A2026F for ; Fri, 15 May 2015 08:21:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7893200FE for ; Fri, 15 May 2015 08:21:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934836AbbEOIVD (ORCPT ); Fri, 15 May 2015 04:21:03 -0400 Received: from smtp.transmode.se ([31.15.61.139]:51829 "EHLO smtp.transmode.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934716AbbEOIU4 convert rfc822-to-8bit (ORCPT ); Fri, 15 May 2015 04:20:56 -0400 Received: from exch1.transmode.se (exch1.transmode.se [192.168.201.16]) by smtp.transmode.se (Postfix) with ESMTP id 717FE1186FCE; Fri, 15 May 2015 10:20:53 +0200 (CEST) Received: from exch1.transmode.se (192.168.201.16) by exch1.transmode.se (192.168.201.16) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Fri, 15 May 2015 10:20:53 +0200 Received: from exch1.transmode.se ([fe80::90bf:2c1d:c76a:2a46]) by exch1.transmode.se ([fe80::90bf:2c1d:c76a:2a46%17]) with mapi id 15.00.1076.000; Fri, 15 May 2015 10:20:53 +0200 From: Joakim Tjernlund To: "haokexin@gmail.com" CC: "ulf.hansson@linaro.org" , "linux-mmc@vger.kernel.org" Subject: Re: [PATCH] Revert "sdhci-of-esdhc: Support 8BIT bus width." Thread-Topic: [PATCH] Revert "sdhci-of-esdhc: Support 8BIT bus width." Thread-Index: AQHQjtiDk0skaxoGTUaFFEJuz9VsVZ18exAAgAAGMoCAAAUHAIAACpsA Date: Fri, 15 May 2015 08:20:52 +0000 Message-ID: <1431678052.13197.26.camel@transmode.se> References: <1431671349-12759-1-git-send-email-haokexin@gmail.com> <1431673364.13197.10.camel@transmode.se> <1431674695.13197.14.camel@transmode.se> <20150515074254.GP8870@pek-khao-d1.corp.ad.wrs.com> In-Reply-To: <20150515074254.GP8870@pek-khao-d1.corp.ad.wrs.com> Accept-Language: en-US, sv-SE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Evolution 3.17.1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [192.168.200.5] Content-ID: <9E813007FAE6C74E8372E480B0909068@transmode.com> MIME-Version: 1.0 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 On Fri, 2015-05-15 at 15:42 +0800, Kevin Hao wrote: > On Fri, May 15, 2015 at 07:24:55AM +0000, Joakim Tjernlund wrote: > > Ahh, now I see. Drivers are supposed to call sdhci_set_bus_width instead of NULL: > > Instead of reverting this add: > > > > diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c > > index 7a98a22..07b9df2 100644 > > --- a/drivers/mmc/host/sdhci-of-esdhc.c > > +++ b/drivers/mmc/host/sdhci-of-esdhc.c > > @@ -283,6 +283,7 @@ static const struct sdhci_ops sdhci_esdhc_ops = { > > .get_min_clock = esdhc_of_get_min_clock, > > .platform_init = esdhc_of_platform_init, > > .adma_workaround = esdhci_of_adma_workaround, > > + .set_bus_width = sdhci_set_bus_width, > > .reset = esdhc_reset, > > .set_uhs_signaling = sdhci_set_uhs_signaling, > > }; > > > > Should I repost the full "sdhci-of-esdhc: Support 8BIT bus width." with this fix added > > of just the above fix? > > Sorry, this still don't work. What about this then: --- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index 7a98a22..569fce1 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -262,6 +262,24 @@ static void esdhc_of_platform_init(struct sdhci_host *host) host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ; } +static void esdhc_pltfm_set_bus_width(struct sdhci_host *host, int width) +{ + u8 ctrl; + + ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); + if (width == MMC_BUS_WIDTH_8) { + ctrl &= ~SDHCI_CTRL_4BITBUS; + ctrl |= SDHCI_CTRL_8BITBUS; + } else { + ctrl &= ~SDHCI_CTRL_8BITBUS; + if (width == MMC_BUS_WIDTH_4) + ctrl |= SDHCI_CTRL_4BITBUS; + else + ctrl &= ~SDHCI_CTRL_4BITBUS; + } + sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); +} + static void esdhc_reset(struct sdhci_host *host, u8 mask) { sdhci_reset(host, mask); @@ -283,6 +301,7 @@ static const struct sdhci_ops sdhci_esdhc_ops = { .get_min_clock = esdhc_of_get_min_clock, .platform_init = esdhc_of_platform_init, .adma_workaround = esdhci_of_adma_workaround, + .set_bus_width = esdhc_pltfm_set_bus_width, .reset = esdhc_reset, .set_uhs_signaling = sdhci_set_uhs_signaling, };