From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham 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 54BD0C43215 for ; Wed, 20 Nov 2019 07:46:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 37DF720872 for ; Wed, 20 Nov 2019 07:46:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728027AbfKTHqW (ORCPT ); Wed, 20 Nov 2019 02:46:22 -0500 Received: from mga01.intel.com ([192.55.52.88]:53382 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726406AbfKTHqW (ORCPT ); Wed, 20 Nov 2019 02:46:22 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Nov 2019 23:46:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,221,1571727600"; d="scan'208";a="204745260" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.197]) ([10.237.72.197]) by fmsmga007.fm.intel.com with ESMTP; 19 Nov 2019 23:46:19 -0800 Subject: Re: [PATCH v3 3/3] mmc: sdhci-of-aspeed: add inversion signal presence To: Ivan Mikhaylov Cc: Joel Stanley , Andrew Jeffery , Rob Herring , Mark Rutland , Ulf Hansson , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, openbmc@lists.ozlabs.org References: <20191118104646.3838-1-i.mikhaylov@yadro.com> <20191118104646.3838-4-i.mikhaylov@yadro.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <8b66121d-c322-6e40-5226-9869837e6ce6@intel.com> Date: Wed, 20 Nov 2019 09:45:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191118104646.3838-4-i.mikhaylov@yadro.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/11/19 12:46 PM, Ivan Mikhaylov wrote: > Add read_l callback in sdhci_ops with flipping of SDHCI_CARD_PRESENT > bit in case of inverted card detection signal. > > Signed-off-by: Ivan Mikhaylov Acked-by: Adrian Hunter > > diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c > index 8962f6664381..56912e30c47e 100644 > --- a/drivers/mmc/host/sdhci-of-aspeed.c > +++ b/drivers/mmc/host/sdhci-of-aspeed.c > @@ -111,7 +111,19 @@ static void aspeed_sdhci_set_bus_width(struct sdhci_host *host, int width) > sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); > } > > +static u32 aspeed_sdhci_readl(struct sdhci_host *host, int reg) > +{ > + u32 val = readl(host->ioaddr + reg); > + > + if (unlikely(reg == SDHCI_PRESENT_STATE) && > + (host->mmc->caps2 & MMC_CAP2_CD_ACTIVE_HIGH)) > + val ^= SDHCI_CARD_PRESENT; > + > + return val; > +} > + > static const struct sdhci_ops aspeed_sdhci_ops = { > + .read_l = aspeed_sdhci_readl, > .set_clock = aspeed_sdhci_set_clock, > .get_max_clock = aspeed_sdhci_get_max_clock, > .set_bus_width = aspeed_sdhci_set_bus_width, > From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 4FA6DC432C0 for ; Wed, 20 Nov 2019 07:46:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 22BA820872 for ; Wed, 20 Nov 2019 07:46:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VuEgCLqK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22BA820872 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yg4d7zAzIquywWL7pq4YXeygppiRqt61DSiXfe1DfQw=; b=VuEgCLqKxsuEsH bCD//omBRKsGzTelLtq9xUdokwaeCjJ94/teqeNiXNZ6StiwRhVvVft3lnJC69NWzLnYkiNI2Rdxk 9Nde7SOMMxwuex2w8f7tEQReLrexNJDZj9EOwFdsZrtDFiPR04umNPygfgckyRjj4Ug4882NMY5D0 bJdXVsBBl26f97qz5mccyLLlXAFpNprkrZkvXBNG42/POP1DPSFZMQSnVoOayw0vqGBE/fnYC77dg rfe+wkBWTInvn8GXqxjkWQ4F0nqy4pyJ9vo1ulkHYq/sUZC4NvC0kOrbjlYSdNDWA+uR9xrfhMah6 3+ah11pVCpMws15DGmZA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXKh0-0004nf-MT; Wed, 20 Nov 2019 07:46:26 +0000 Received: from mga09.intel.com ([134.134.136.24]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXKgx-0004mb-1c for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2019 07:46:24 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Nov 2019 23:46:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,221,1571727600"; d="scan'208";a="204745260" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.197]) ([10.237.72.197]) by fmsmga007.fm.intel.com with ESMTP; 19 Nov 2019 23:46:19 -0800 Subject: Re: [PATCH v3 3/3] mmc: sdhci-of-aspeed: add inversion signal presence To: Ivan Mikhaylov References: <20191118104646.3838-1-i.mikhaylov@yadro.com> <20191118104646.3838-4-i.mikhaylov@yadro.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <8b66121d-c322-6e40-5226-9869837e6ce6@intel.com> Date: Wed, 20 Nov 2019 09:45:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191118104646.3838-4-i.mikhaylov@yadro.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191119_234623_124679_A591C522 X-CRM114-Status: GOOD ( 17.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Ulf Hansson , linux-aspeed@lists.ozlabs.org, Andrew Jeffery , openbmc@lists.ozlabs.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Joel Stanley , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 18/11/19 12:46 PM, Ivan Mikhaylov wrote: > Add read_l callback in sdhci_ops with flipping of SDHCI_CARD_PRESENT > bit in case of inverted card detection signal. > > Signed-off-by: Ivan Mikhaylov Acked-by: Adrian Hunter > > diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c > index 8962f6664381..56912e30c47e 100644 > --- a/drivers/mmc/host/sdhci-of-aspeed.c > +++ b/drivers/mmc/host/sdhci-of-aspeed.c > @@ -111,7 +111,19 @@ static void aspeed_sdhci_set_bus_width(struct sdhci_host *host, int width) > sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); > } > > +static u32 aspeed_sdhci_readl(struct sdhci_host *host, int reg) > +{ > + u32 val = readl(host->ioaddr + reg); > + > + if (unlikely(reg == SDHCI_PRESENT_STATE) && > + (host->mmc->caps2 & MMC_CAP2_CD_ACTIVE_HIGH)) > + val ^= SDHCI_CARD_PRESENT; > + > + return val; > +} > + > static const struct sdhci_ops aspeed_sdhci_ops = { > + .read_l = aspeed_sdhci_readl, > .set_clock = aspeed_sdhci_set_clock, > .get_max_clock = aspeed_sdhci_get_max_clock, > .set_bus_width = aspeed_sdhci_set_bus_width, > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel