From patchwork Mon Apr 19 11:24:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12211581 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56146C433ED for ; Mon, 19 Apr 2021 11:27:51 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D4D9D61166 for ; Mon, 19 Apr 2021 11:27:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4D9D61166 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jlNINrsP5oNpp0+Iw5dmdGU/QB19frt6VMX65HweBCg=; b=iza/zDqrLJ2ACVHq0vty/lYOj AbTwbLF61L0RqQDx8S8m2oj5gU2tPeBPByXJvUZHti/fs7GYo4EUm0aFgoqEZSIPTByLFH68iKJY9 SgaWZ7JT50HshaWQWguld+Oqe+spGCU3o4f1q12RL5zAnrGCzveEYN8FcMJcrzofLCSgi4WeRZdNr r3ofpv9ZC8LXtrtpdhmYAO1CK+je3t3+xObqk/3I9hirzKPfVLTjsR2l9Z5haTlZULc5z42Q81IIV p3aroQq5k1ehZQZ5tx3h9hZbc/qgAvVULXP4NOEe/trGwdhaHEn9WrJcGGmMOPh2q9D1KeDDAfBd9 KOqw4T3sA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYS2N-009ljS-J6; Mon, 19 Apr 2021 11:25:56 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYS1j-009lW7-BF for linux-arm-kernel@desiato.infradead.org; Mon, 19 Apr 2021 11:25:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=ShMbHR9FM6yAHoHdk1OQSYEuY76W/WBg6dCuXxgEjKE=; b=Mr1UB097w8hxkESn/suLIte80l wyaIr1lLSG/rTdjyMMSWP9ZApQJntKzPoI1ceFMNiMj697TfNRynBBniMB5x9IfNWI8xxFXBtalNc +e5WXP0DuebOppiQvAJGSFKzwnzq/lA5HWFMqHclKKtIVI+nWHp+MifXPrLBkkrY0uhqU6dHNaadt 1zGUaKcK6cEwsrB6Drw0sKXAiv688vrJVuFykratGmC/zJ+pL2MZknA5i7oaQg17Ths8We2pOx8UJ veqaZ6kl9qSRmTyMo68g0ApGM9Z2pGFeqBkcOjYEBEM9ahCHx+FVhc3WCDgj45eJvjkNcftiOPK/K icqMuDpw==; Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYS1b-00BJ01-I0 for linux-arm-kernel@lists.infradead.org; Mon, 19 Apr 2021 11:25:14 +0000 IronPort-SDR: xcEGJNzzaYtlXKrz4sju+xdKw76UCALWqgtMdmaPA8LjRwp/p7fxKthPjMDbnR67lmJBtsNFEe WPCIT5DHsNZQ== X-IronPort-AV: E=McAfee;i="6200,9189,9958"; a="194867413" X-IronPort-AV: E=Sophos;i="5.82,234,1613462400"; d="scan'208";a="194867413" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2021 04:25:04 -0700 IronPort-SDR: reVk2Wkqo6o5Klxv3OkJlKBRcpNRK76gAEuV9YL/TIWPlSi1jMDGU+CiNDfJraMbZAd631vMnF xWuZyc5U0sRg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,234,1613462400"; d="scan'208";a="613365712" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 19 Apr 2021 04:25:00 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5209D17E; Mon, 19 Apr 2021 14:25:18 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Ulf Hansson , Haibo Chen , Fabio Estevam , Yangbo Lu , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org Cc: Rob Herring , Adrian Hunter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , NXP Linux Team , Mark Brown Subject: [PATCH v1 3/6] mmc: mmc_spi: Set up polling even if voltage-ranges is not present Date: Mon, 19 Apr 2021 14:24:56 +0300 Message-Id: <20210419112459.25241-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210419112459.25241-1-andriy.shevchenko@linux.intel.com> References: <20210419112459.25241-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210419_042507_622810_5479A526 X-CRM114-Status: GOOD ( 15.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When voltage-ranges property is not present the driver assumes that it is 3.3v (3.2v..3.4v). But at the same time it disallows polling. Fix that by dropping the comparison to 0 when no property is provided. While at it, mark voltage-ranges property optional as it was initially. Fixes: 9c43df57910b ("mmc_spi: Add support for OpenFirmware bindings") Signed-off-by: Andy Shevchenko --- Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt | 6 +++--- drivers/mmc/host/of_mmc_spi.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt index 75486cca8054..5e74db69f581 100644 --- a/Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt +++ b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt @@ -5,11 +5,11 @@ by mmc.txt and the properties used by the mmc_spi driver. Required properties: - spi-max-frequency : maximum frequency for this device (Hz). -- voltage-ranges : two cells are required, first cell specifies minimum - slot voltage (mV), second cell specifies maximum slot voltage (mV). - Several ranges could be specified. Optional properties: +- voltage-ranges : two cells are required, first cell specifies minimum + slot voltage (mV), second cell specifies maximum slot voltage (mV). + Several ranges could be specified. If not provided, 3.2v..3.4v is assumed. - gpios : may specify GPIOs in this order: Card-Detect GPIO, Write-Protect GPIO. Note that this does not follow the binding from mmc.txt, for historical reasons. diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c index acd96ea399b8..843ec3db891b 100644 --- a/drivers/mmc/host/of_mmc_spi.c +++ b/drivers/mmc/host/of_mmc_spi.c @@ -66,7 +66,7 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi) if (!oms) return NULL; - if (mmc_of_parse_voltage(mmc, &oms->pdata.ocr_mask) <= 0) + if (mmc_of_parse_voltage(mmc, &oms->pdata.ocr_mask) < 0) goto err_ocr; oms->detect_irq = irq_of_parse_and_map(np, 0);