From patchwork Sun Jan 6 01:19:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Liu X-Patchwork-Id: 1936791 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id DD004DFB7E for ; Sun, 6 Jan 2013 01:19:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754739Ab3AFBTJ (ORCPT ); Sat, 5 Jan 2013 20:19:09 -0500 Received: from mail-wg0-f45.google.com ([74.125.82.45]:57994 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754609Ab3AFBTI (ORCPT ); Sat, 5 Jan 2013 20:19:08 -0500 Received: by mail-wg0-f45.google.com with SMTP id dq12so8389695wgb.0 for ; Sat, 05 Jan 2013 17:19:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MtLUuqJRDRQU8+yrZdHnFCSEBZqCS6ybOArezU42piI=; b=uDWmaGepttA5BbFLSseOmd4J/1HGAvXjtwne8agBMu8GhLRsuHxB4I9irZYWMqak2A uk81fflfCgUzFmgtJJR+2NwKtlQ78pl6HL3kvfbz9teY3KEHdDbKBXTSKS/hxNwOeHwG IY4tn8yQWk2AXQg2jpYWd7f3/CgQskBMlEgP9bKx5ksAlgZTu0CQ4QslrHmeWuX5zqKR a2VBXZoGioyLZ0gRoEph6obWEJs7Z/vkmu6Qvwt/B21WNmHYlxYaM16XQsM8z3as37sa QGY/HI1zZTCdUdtg+jrSqBP6e4GdYwA4YMVP4i51Hq2NeU5EGDdsEcozGe7BEy8moDFO RNaw== MIME-Version: 1.0 Received: by 10.194.58.175 with SMTP id s15mr89888871wjq.31.1357435147266; Sat, 05 Jan 2013 17:19:07 -0800 (PST) Received: by 10.216.235.221 with HTTP; Sat, 5 Jan 2013 17:19:07 -0800 (PST) In-Reply-To: <25B60CDC2F704E4E9D88FFD52780CB4C08B026B6EC@SC-VEXCH1.marvell.com> References: <25B60CDC2F704E4E9D88FFD52780CB4C08B026B6EC@SC-VEXCH1.marvell.com> Date: Sun, 6 Jan 2013 09:19:07 +0800 Message-ID: Subject: Re: FW: SD card reader stopped working in kernel 3.6: CONFIG_REGULATOR troubles (solved) From: Kevin Liu To: Rainer Kaluscha Cc: linux-mmc@vger.kernel.org Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org > -----Original Message----- > From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-owner@vger.kernel.org] On Behalf Of Rainer Kaluscha > Sent: Sunday, January 06, 2013 12:20 AM > To: linux-mmc@vger.kernel.org > Subject: SD card reader stopped working in kernel 3.6: CONFIG_REGULATOR troubles (solved) > > My SD card reader which worked fine with kernel 3.5 stopped working with kernel > 3.6 and 3.7. It is a "SD Host controller: Ricoh Co Ltd R5C822 > SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)", PCI-ID 0e:06.1 > > I finally noticed messages like "mmc0: Hardware doesn't report any support > voltages." so I tried disabling CONFIG_REGULATOR in kernel config which solved > the issue. > > Maybe this is also of interest to others. Feel free to contact me if you need > more details. > > Can you try below patch? or you can try with latest 3.8 kernel which has integrated the patch. From cec2e216f72c6b5ccdadb60aadbe99821d744503 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Tue, 20 Nov 2012 08:24:32 -0500 Subject: [PATCH] mmc: sdhci: Use regulator min/max voltage range according to spec For regulator vmmc/vmmcq, use voltage range as below 3.3v/3.0v: (2.7v, 3.6v) 1.8v: (1.7v, 1.95v) Original code uses the precise value which may fail in regulator driver if it does NOT support the precise voltage. Signed-off-by: Jialing Fu Signed-off-by: Kevin Liu Tested-by: Marek Szyprowski Signed-off-by: Chris Ball --- drivers/mmc/host/sdhci.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) " failed\n", mmc_hostname(host->mmc)); @@ -1662,7 +1662,7 @@ static int sdhci_do_1_8v_signal_voltage_switch(struct sdhci_host *host, */ if (host->vqmmc) ret = regulator_set_voltage(host->vqmmc, - 1800000, 1800000); + 1700000, 1950000); else ret = 0; @@ -2860,8 +2860,8 @@ int sdhci_add_host(struct sdhci_host *host) } } else { regulator_enable(host->vqmmc); - if (!regulator_is_supported_voltage(host->vqmmc, 1800000, - 1800000)) + if (!regulator_is_supported_voltage(host->vqmmc, 1700000, + 1950000)) caps[1] &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_DDR50); @@ -2925,16 +2925,14 @@ int sdhci_add_host(struct sdhci_host *host) #ifdef CONFIG_REGULATOR if (host->vmmc) { - ret = regulator_is_supported_voltage(host->vmmc, 3300000, - 3300000); + ret = regulator_is_supported_voltage(host->vmmc, 2700000, + 3600000); if ((ret <= 0) || (!(caps[0] & SDHCI_CAN_VDD_330))) caps[0] &= ~SDHCI_CAN_VDD_330; - ret = regulator_is_supported_voltage(host->vmmc, 3000000, - 3000000); if ((ret <= 0) || (!(caps[0] & SDHCI_CAN_VDD_300))) caps[0] &= ~SDHCI_CAN_VDD_300; - ret = regulator_is_supported_voltage(host->vmmc, 1800000, - 1800000); + ret = regulator_is_supported_voltage(host->vmmc, 1700000, + 1950000); if ((ret <= 0) || (!(caps[0] & SDHCI_CAN_VDD_180))) caps[0] &= ~SDHCI_CAN_VDD_180; } diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 2f62fe4..ec3e984 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1618,7 +1618,7 @@ static int sdhci_do_3_3v_signal_voltage_switch(struct sdhci_host *host, sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2); if (host->vqmmc) { - ret = regulator_set_voltage(host->vqmmc, 3300000, 3300000); + ret = regulator_set_voltage(host->vqmmc, 2700000, 3600000); if (ret) { pr_warning("%s: Switching to 3.3V signalling voltage "