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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 25627C433DF for ; Fri, 16 Oct 2020 07:25:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 7380D2073A for ; Fri, 16 Oct 2020 07:25:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="zmw/n187"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=intel.onmicrosoft.com header.i=@intel.onmicrosoft.com header.b="L4fXlFrj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7380D2073A 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+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ARqRzfsvB1Kjn/kluh9N0WWHDJ4UvyURmGVv5fQKtyQ=; b=zmw/n187t8Kn+JyeVFKn1dEtS Ifl2PHxZJcsJh3pQV0rC5KugFjAgP81/mit3WmjpABJFzEd8LPGuGOTucUUi8u3ajJf9Mb8dq0DoR JZov/hdXXlwHD8Gqc6cgCB1xpeEaqkdbiJ+xDeLNC9VQH3cWZFMWzRBtxfb5QRFrefNdZuoWnrYhH lkyQZ1jkJy3hQAFfSdfbavDlbAgzNzQowOk4C3X7xj7OQyTlri6zIc7nPa7ALQiAaShr20MBM0YR+ 1MrKd2iQty2MavoT+exApAzNwxWCBjBp8foZWw6jk7uH7MP1vS/HMDZ4OJGNrD3VWaZ0QK3Bk83C8 zrMZqtTUQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kTK5K-0004qn-SX; Fri, 16 Oct 2020 07:23:30 +0000 Received: from mga02.intel.com ([134.134.136.20]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kTK5H-0004q2-Iy for linux-arm-kernel@lists.infradead.org; Fri, 16 Oct 2020 07:23:29 +0000 IronPort-SDR: cx6D1v/a/H6aD1j7GtClcw63qNOwJO/AVvRaw4Bre4s/g9OSfnlKR+f+aE2US44zj3AOsAtc8/ 2qAya8C+kaeQ== X-IronPort-AV: E=McAfee;i="6000,8403,9775"; a="153468780" X-IronPort-AV: E=Sophos;i="5.77,382,1596524400"; d="scan'208";a="153468780" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2020 00:23:23 -0700 IronPort-SDR: 211yJdxSTKfKXcAoV78aLfRShfMDyia2+9Y1EaVVBzYRfbHKT74xAs30ifBZ8c6b2M0s0TfsPU RH5qunld8Qrw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,382,1596524400"; d="scan'208";a="521081514" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by fmsmga006.fm.intel.com with ESMTP; 16 Oct 2020 00:23:23 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 16 Oct 2020 00:23:22 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 16 Oct 2020 00:23:22 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 16 Oct 2020 00:23:22 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.102) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Fri, 16 Oct 2020 00:23:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nxf6XqYjaB2a6dtrREpMn3X0uw+yT6Z47Wk4ZM/gKnm7En1dMvOpM21VN6dz22DS/dmkL9yHkd8bGzvVnr1FzMUwfNrBUV0k3PKPk3xOyshL2Sx5cewgMi4Bjd4v8/wFx8LWdDoacD3BeTvPt8ugcr8kzFJHZu6ASSBbL/koLttpIFuw7nXniBo5tbzW39xLPYn0rtdq0uJKxQ903WwMaF0VnxGKzx7rIBTDZs4MhDRs6SneUN5w7ZBQ83ZRaeER1l3LvKHOwWnRPMWL6kXz64ollPuNJKhcTBOUgystno09qXtFtPMIyUafie8D0qaC5YRPvzGHeB9VeCksQbYn8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MADrkyGi8PnbqZs/vbZFfSF/nfcEOZwrVvlyAJpqisE=; b=LBA3QrMnMPx/0zU8vD4izpyaPLryuS5Zmoq5TECvmt6Wg8S5BlsAfiGH6TGTFM6i0q9cl7E3iqyn/x6Ebm8bMxzUK+4V/oVm5BologxE5xZCULaSB3PDn0dh1uSgw1lb69+ts5AzNwNsFLh61HOdDpOOLqEfqBkrYEgC91WI3u1b48YxKN/+taQ2zSDvKYyo02D3J87qzG8CAsf1ERuU+SJB5WdwkZDtECs6YI3tsU5hetPcwZ4lAiNg8NMnZY/FO2Sg2XlYH9OFq7fZsqhdrzWfZcq5248yw64UN1ykKeMMHHkNHSB/oHb6ac+KdcCeJ8pzPpLqioSblk2Jgl40Iw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MADrkyGi8PnbqZs/vbZFfSF/nfcEOZwrVvlyAJpqisE=; b=L4fXlFrj4RCivzbkAm2QheHKKWE8qCbeoSz2RqJCHp4wWV7E+jjjUzLrYxoXDEbkAtCAeN/Km4YzzswZhvP4DruGiPEQhK8aJvcw+vfWbehxSMLGIxfHEEuDXmsYXFpnsXPbIWZh9pBdvC3PkSPaMWecI/jDcCFd8nNe9E2lFpQ= Received: from DM6PR11MB2876.namprd11.prod.outlook.com (2603:10b6:5:c1::16) by DM6PR11MB2620.namprd11.prod.outlook.com (2603:10b6:5:c8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Fri, 16 Oct 2020 07:23:17 +0000 Received: from DM6PR11MB2876.namprd11.prod.outlook.com ([fe80::c85a:d98e:fbf3:9f8c]) by DM6PR11MB2876.namprd11.prod.outlook.com ([fe80::c85a:d98e:fbf3:9f8c%5]) with mapi id 15.20.3477.025; Fri, 16 Oct 2020 07:23:17 +0000 From: "Zulkifli, Muhammad Husaini" To: Ulf Hansson Subject: RE: [PATCH v4 4/4] mmc: sdhci-of-arasan: Enable UHS-1 support for Keem Bay SOC Thread-Topic: [PATCH v4 4/4] mmc: sdhci-of-arasan: Enable UHS-1 support for Keem Bay SOC Thread-Index: AQHWnRiQsJ+XebQSo0uGE+XglmG5+KmNcEsAgAAYHQCAAEouAIAAIK+wgADlJYCAALSokIAFsh6AgASfdwA= Date: Fri, 16 Oct 2020 07:23:17 +0000 Message-ID: References: <20201008020936.19894-1-muhammad.husaini.zulkifli@intel.com> <20201008020936.19894-5-muhammad.husaini.zulkifli@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.222] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a364d1dd-a782-4daa-0129-08d871a45a6f x-ms-traffictypediagnostic: DM6PR11MB2620: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WIoaQHhMyjYU0Go/RaPg8AIKuuliecxGz8ZfiHKUq7pt7xbnGP3ustiIhwpk5LoMMyPU1aveYeV+gEyQMtnAG9Sr70gJnHEdqrVEBZunc2hsm13XHV7xEpJkmqLRZobDxe4xEztkGnt33rUuoxzSeRrIwLOYFP+VWyyvRPXeBw57JPWYjdIjsQ863Ku1NCodmNdw3NCurhh8DzlBMyQ5sqz/P8DZGBmhfduqAZ4uQupisaHgKqGWMaTWiTi6xH/+9oUYkEUftupwRjW2/V/xNAd2FJpElyaihaB/4twBO82sHK1sU9P3zRHaqSsIB6yAYjYgK8f5il4PqC0qRbHgdA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB2876.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(376002)(396003)(346002)(366004)(39860400002)(30864003)(5660300002)(33656002)(52536014)(186003)(83380400001)(6916009)(7696005)(6506007)(478600001)(2906002)(76116006)(55016002)(9686003)(316002)(54906003)(4326008)(86362001)(8676002)(66556008)(66446008)(66946007)(66476007)(71200400001)(64756008)(8936002)(26005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: he8bo6juDyBwd6FYRVNVO53em52YnC9PaeU1Q48Dhz1VfmoCicNuNJTquUUBgFk/axD5sxQhttSYuj+MgWV3UghCG3gWfLVxyDUhFrFIbccrjmkxgrSw66mO6wprC1wYG8ZocP/tzN5KqeXAHYtccfm3fbz1CQhrPl4c5JxkHL2QY0CF2fJmM0oI50Qo12UymP+z5ZjEdMGBZ+06nk076EqKY7u0WUk7bdRZs5217M0UwjuisiIq43uNlruKvgMmcf7bYWYCsQv6DomUMaBWRcvUwbffHh9wvJmbQWaUaDathkUf03csogGHUPmWOIShCMJr61rVqWq0c9RhE70rhJvcmnBoqd7xw6FmYanJuMePAVk5ocRXeoFRjsaFL4YAe6e/Vc7DWBK6GBtoJFZvAF9OEO8kAHsOa8j6xF9GxEHCTFGyfUoC1xFXbt+/fcWpaaeK1/l0dIhiryH7NezR/u0d1yqRHGlRHjrt0QPkfEGNbkZ6IVk3JqNXPkDb63VGDuwsejfIdgI/eDaNxOVJu3lcmMrwvjh6DyHBvcxF3usD6x9v71hsHhfeUZlWBnxB+HzrxOnEbxevR6sdkxPFYCnPsAev28b/f57dzLcFQ1GlR57/sylijNYLGFCM2wiMqV6KlS3ybxa4UP9Mhx1c/g== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB2876.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a364d1dd-a782-4daa-0129-08d871a45a6f X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Oct 2020 07:23:17.6935 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 3SYb2wAOTNa1Wr7Z8C/hLFdEvqXYSDvESNx2MblbYAFRUi+dbH0m+2pomk1ldp47n7gV7r0Wwwj5PezdqEQ8bTfXC+a7WXkXUix6LyidlkdEHCcH1lO5FVslfITVrbta X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2620 X-OriginatorOrg: intel.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201016_032327_871280_A954292C X-CRM114-Status: GOOD ( 17.28 ) 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: "Shevchenko, Andriy" , Arnd Bergmann , "Raja Subramanian, Lakshmi Bai" , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , "Hunter, Adrian" , "Wan Mohamad, Wan Ahmad Zainie" , Michal Simek , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Ulf, >-----Original Message----- >From: Ulf Hansson >Sent: Tuesday, October 13, 2020 4:42 PM >To: Zulkifli, Muhammad Husaini >Cc: Hunter, Adrian ; Michal Simek >; Shevchenko, Andriy >; linux-mmc@vger.kernel.org; Linux ARM >; Linux Kernel Mailing List kernel@vger.kernel.org>; Raja Subramanian, Lakshmi Bai >; Wan Mohamad, Wan Ahmad >Zainie ; Arnd Bergmann > >Subject: Re: [PATCH v4 4/4] mmc: sdhci-of-arasan: Enable UHS-1 support for >Keem Bay SOC > >On Fri, 9 Oct 2020 at 19:50, Zulkifli, Muhammad Husaini > wrote: >> >> Hi, >> >> >-----Original Message----- >> >From: Ulf Hansson >> >Sent: Friday, October 9, 2020 2:56 PM >> >To: Zulkifli, Muhammad Husaini >> >Cc: Hunter, Adrian ; Michal Simek >> >; Shevchenko, Andriy >> >; linux-mmc@vger.kernel.org; Linux ARM >> >; Linux Kernel Mailing List >> >; Raja Subramanian, Lakshmi Bai >> >; Wan Mohamad, Wan Ahmad >> >Zainie ; Arnd Bergmann >> > >> >Subject: Re: [PATCH v4 4/4] mmc: sdhci-of-arasan: Enable UHS-1 >> >support for Keem Bay SOC >> > >> >On Thu, 8 Oct 2020 at 19:21, Zulkifli, Muhammad Husaini >> > wrote: >> >> >> >> Hi, >> >> >> >> >-----Original Message----- >> >> >From: Ulf Hansson >> >> >Sent: Thursday, October 8, 2020 11:19 PM >> >> >To: Zulkifli, Muhammad Husaini >> >> > >> >> >Cc: Hunter, Adrian ; Michal Simek >> >> >; Shevchenko, Andriy >> >> >; linux-mmc@vger.kernel.org; Linux >> >> >ARM ; Linux Kernel Mailing >> >> >List >> >> >; Raja Subramanian, Lakshmi Bai >> >> >; Wan Mohamad, Wan >Ahmad >> >> >Zainie ; Arnd Bergmann >> >> > >> >> >Subject: Re: [PATCH v4 4/4] mmc: sdhci-of-arasan: Enable UHS-1 >> >> >support for Keem Bay SOC >> >> > >> >> >On Thu, 8 Oct 2020 at 12:54, Zulkifli, Muhammad Husaini >> >> > wrote: >> >> >> >> >> >> Hi, >> >> >> >> >> >> >-----Original Message----- >> >> >> >From: Ulf Hansson >> >> >> >Sent: Thursday, October 8, 2020 5:28 PM >> >> >> >To: Zulkifli, Muhammad Husaini >> >> >> > >> >> >> >Cc: Hunter, Adrian ; Michal Simek >> >> >> >; Shevchenko, Andriy >> >> >> >; linux-mmc@vger.kernel.org; Linux >> >> >> >ARM ; Linux Kernel >> >> >> >Mailing List >> >> >> >; Raja Subramanian, Lakshmi Bai >> >> >> >; Wan Mohamad, Wan >> >Ahmad >> >> >> >Zainie ; Arnd >Bergmann >> >> >> > >> >> >> >Subject: Re: [PATCH v4 4/4] mmc: sdhci-of-arasan: Enable UHS-1 >> >> >> >support for Keem Bay SOC >> >> >> > >> >> >> >On Thu, 8 Oct 2020 at 04:12, >> >> >> > >> >> >wrote: >> >> >> >> >> >> >> >> From: Muhammad Husaini Zulkifli >> >> >> >> >> >> >> >> >> >> >> >> Voltage switching sequence is needed to support UHS-1 interface. >> >> >> >> There are 2 places to control the voltage. >> >> >> >> 1) By setting the AON register using firmware driver calling >> >> >> >> system-level platform management layer (SMC) to set the register. >> >> >> >> 2) By controlling the GPIO expander value to drive either >> >> >> >> 1.8V or 3.3V for power mux input. >> >> >> >> >> >> >> >> Signed-off-by: Muhammad Husaini Zulkifli >> >> >> >> >> >> >> >> Reviewed-by: Andy Shevchenko >> >> >> >> Reviewed-by: Adrian Hunter >> >> >> >> --- >> >> >> >> drivers/mmc/host/sdhci-of-arasan.c | 126 >> >> >> >> +++++++++++++++++++++++++++++ >> >> >> >> 1 file changed, 126 insertions(+) >> >> >> >> >> >> >> >> diff --git a/drivers/mmc/host/sdhci-of-arasan.c >> >> >> >> b/drivers/mmc/host/sdhci-of-arasan.c >> >> >> >> index 46aea6516133..ea2467b0073d 100644 >> >> >> >> --- a/drivers/mmc/host/sdhci-of-arasan.c >> >> >> >> +++ b/drivers/mmc/host/sdhci-of-arasan.c >> >> >> >> @@ -16,6 +16,7 @@ >> >> >> >> */ >> >> >> >> >> >> >> >> #include >> >> >> >> +#include >> >> >> >> #include #include >> >> >> >> #include @@ -23,6 +24,7 @@ #include >> >> >> >> #include #include >> >> >> >> >> >> >> >> +#include >> >> >> >> >> >> >> >> #include "cqhci.h" >> >> >> >> #include "sdhci-pltfm.h" >> >> >> >> @@ -136,6 +138,7 @@ struct sdhci_arasan_clk_data { >> >> >> >> * @soc_ctl_base: Pointer to regmap for syscon for soc_ctl >registers. >> >> >> >> * @soc_ctl_map: Map to get offsets into soc_ctl registers. >> >> >> >> * @quirks: Arasan deviations from spec. >> >> >> >> + * @uhs_gpio: Pointer to the uhs gpio. >> >> >> >> */ >> >> >> >> struct sdhci_arasan_data { >> >> >> >> struct sdhci_host *host; @@ -150,6 +153,7 @@ struct >> >> >> >> sdhci_arasan_data { >> >> >> >> struct regmap *soc_ctl_base; >> >> >> >> const struct sdhci_arasan_soc_ctl_map *soc_ctl_map; >> >> >> >> unsigned int quirks; >> >> >> >> + struct gpio_desc *uhs_gpio; >> >> >> >> >> >> >> >> /* Controller does not have CD wired and will not function >> >> >> >> normally without >> >> >> >*/ >> >> >> >> #define SDHCI_ARASAN_QUIRK_FORCE_CDTEST BIT(0) >> >> >> >> @@ -361,6 +365,112 @@ static int >> >> >> >> sdhci_arasan_voltage_switch(struct >> >> >> >mmc_host *mmc, >> >> >> >> return -EINVAL; >> >> >> >> } >> >> >> >> >> >> >> >> +static int sdhci_arasan_keembay_voltage_switch(struct >> >> >> >> +mmc_host >> >> >*mmc, >> >> >> >> + struct mmc_ios *ios) { >> >> >> >> + struct sdhci_host *host = mmc_priv(mmc); >> >> >> >> + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); >> >> >> >> + struct sdhci_arasan_data *sdhci_arasan = >> >> >sdhci_pltfm_priv(pltfm_host); >> >> >> >> + u16 ctrl_2, clk; >> >> >> >> + int ret; >> >> >> >> + >> >> >> >> + switch (ios->signal_voltage) { >> >> >> >> + case MMC_SIGNAL_VOLTAGE_180: >> >> >> >> + clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL); >> >> >> >> + clk &= ~SDHCI_CLOCK_CARD_EN; >> >> >> >> + sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); >> >> >> >> + >> >> >> >> + clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL); >> >> >> >> + if (clk & SDHCI_CLOCK_CARD_EN) >> >> >> >> + return -EAGAIN; >> >> >> >> + >> >> >> >> + sdhci_writeb(host, SDHCI_POWER_ON | >SDHCI_POWER_180, >> >> >> >> + SDHCI_POWER_CONTROL); >> >> >> >> + >> >> >> >> + /* >> >> >> >> + * Set VDDIO_B voltage to Low for 1.8V >> >> >> >> + * which is controlling by GPIO Expander. >> >> >> >> + */ >> >> >> >> + >> >> >> >> + gpiod_set_value_cansleep(sdhci_arasan->uhs_gpio, >> >> >> >> + 0); >> >> >> >> + >> >> >> >> + /* >> >> >> >> + * This is like a final gatekeeper. Need to >> >> >> >> + ensure changed >> >> >voltage >> >> >> >> + * is settled before and after turn on this bit. >> >> >> >> + */ >> >> >> >> + usleep_range(1000, 1100); >> >> >> >> + >> >> >> >> + ret = >> >> >keembay_sd_voltage_selection(KEEMBAY_SET_1V8_VOLT); >> >> >> >> + if (ret) >> >> >> >> + return ret; >> >> >> >> + >> >> >> >> + usleep_range(1000, 1100); >> >> >> > >> >> >> >No, sorry, but I don't like this. >> >> >> > >> >> >> >This looks like a GPIO regulator with an extension of using the >> >> >> >keembay_sd_voltage_selection() thingy. I think you can model >> >> >> >these things behind a regulator and hook it up as a vqmmc >> >> >> >supply in DT instead. BTW, this is the common way we deal with >> >> >> >these things for mmc >> >> >host drivers. >> >> >> >> >> >> The SDcard for Keem Bay SOC does not have its own voltage regulator. >> >> >> There are 2 places to control the voltage. >> >> >> 1) By setting the AON register calling system-level platform >> >> >> management >> >> >layer (SMC) >> >> >> to set the I/O pads voltage for particular GPIOs line for clk,data and >cmd. >> >> >> The reason why I use this keembay_sd_voltage_selection() via >> >> >> smccc >> >> >interface it because during voltage switching >> >> >> I need to access to AON register. On a secure system, we >> >> >> could not >> >> >directly access to AON register due to some security concern from >> >> >driver side, thus >> >> >> cannot exposed any register or address. >> >> >> 2) By controlling the GPIO expander value to drive either 1.8V >> >> >> or 3.3V for >> >> >power mux input. >> >> > >> >> >I see, thanks for clarifying. >> >> > >> >> >To me, it sounds like the best fit is to implement a pinctrl (to >> >> >manage the I/O >> >> >pads) and a GPIO regulator. >> >> > >> >> Even with pinctrl, i still need to use the >> >> keembay_sd_voltage_selection() >> >thingy for AON register. >> > >> >Yes, I am fine by that. >> > >> >Although, as it's really a pinctrl, it deserves to be modelled like >> >that. Not as a soc specific hack in a mmc host driver. >> > >> >> Plus, the GPIO pin that control the sd-voltage is in GPIO Expander >> >> not using >> >Keembay SOC GPIO Pin. >> >> The best option is using the gpio consumer function to toggle the pin. >> > >> >As I said, please no. >> > >> >The common way to model this is as a GPIO regulator. In this way, you >> >can even rely on existing mmc DT bindings. All you have to do is to >> >hook up a vqmmc supply to the mmc node. >> > >> >To be clear, as long as there are no arguments for why a pinctrl and >> >GPIO regulator can't be used - I am not going to pick up the patches. >> As I mentioned The SDcard does not have its own voltage regulator. >> It only uses the voltage rails on the mux input. >> >> There are 2 things need to be configured before getting the output voltage: >> >> 1) V_VDDIO_B : >> Supplied voltage applied to I/O Rail which is controlled from the Always on >domain using specific bits in AON_CFG1 register. >> This is where we set for V_VDDIO_B using the >keembay_sd_voltage_selection() to set either 1.8v or 3.3v depending on the bit >value. >> IMHO, we do not pinctrl to do this. >> >> 2) V_VDDIO_B_MAIN: >> The output V_VDDIO_B_MAIN (OUT1) will be either V_3P3_MAIN (IN1) or >> V_1P8_MAIN (IN2), depending on the state of GPIO expander Pin value. There >is a POWER MUX involving here. >> IMHO, we do not need any gpio regulator/regulator api hook up for this. >> Most important thing, there is no regulator ic at all. >> We still need to manually control and toggle the pin value. >> >> The final IO voltage is set by V_VDDIO_B (= V_VDDIO_B_MAIN after passing >through voltage sense resistor). >> >> Hope this will clarify. > >I think I get it, thanks. > >Again, I haven't seen any reasons for why this can't be modelled as a pinctrl and >a gpio-regulator. So, please convert it to that. For gpio-regulator, I believe I could not use the current gpio-regulator.c framework as there is no consumer API for me to change the state of gpio pin during voltage switching. Do I need to create a specific gpio-regulator driver under drivers/regulator for keem bay? > >Kind regards >Uffe _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel