Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3993744ybi; Tue, 18 Jun 2019 09:51:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzp2VdvnD8S7hLCQE5g3VEkUWmNXtvEV/o0Hcd6hd88Ogxqo1RT3InEnzyRWoSLAC+ebDTY X-Received: by 2002:a17:902:2bcb:: with SMTP id l69mr7636093plb.155.1560876685319; Tue, 18 Jun 2019 09:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560876685; cv=none; d=google.com; s=arc-20160816; b=FCgQRmNUlcyD+gDlWqyMskUXlW97I2poTugQ1r670MLNw6qXZUeEl17UxkUsLtcMk9 KfE50YNHMdWrQZgVTGtgQ4R5oLuvkDrSBR6GGrDqJYmgNcKwDrlRTOmukgqwgTNAqAJa BlZ/1juDH5H4plMfbXZyTiW1qqX6IN1Jy7S0TngZQbN9bkzsPBCeyLWmVrgVxk9JMRlu Nl+2DS16UthUdYx5AYHoF6qCh0m0/5WkYn4LkmyOO9sQe5BmBHDbkZHNdZXOR+umbxZH PGcTtgBS2oHft4FnKKTHrrlAg1s5WB8GwFWHw7EFDPnJa3iXDybiTLgJ8zLBfYFJT0Bl 53RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=5ewJKPP9x+yjrdVa+IF7R1TIqyJxyuRq4n8ATlmTSi8=; b=WwsZ91tTXsVqZ3x7k7lVMaHGCLrus2aikHXGnED0Gi612Kez7wX1S9yyFY3jsXLLdN koWtbb9ZaHgToAoqvWv1F9Lz/ehd+lo0sdLdVvg0+nzMovLWzejoNIWOFwDOLpyYfT8C QW1PU7Ef6+idPOFRkTIviGJHCTKX/NnuGLyMvFnKacevOK53WuJXFDkkJ7NAWpR3ay1G qh4JxX9GFPFH7bSvt3so4JtuhgVT4tCc46eN6LLwP3iPH5aF35S1pu2Tm/bFQqFl+QcJ GYkFRVy5gvl+IOyLAzNnak7rPVamd1nEqyzuPEferCVks+LkifEwJFsMfxkuC8Q95VVI YQhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=oLXgwoYJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si2899275pli.144.2019.06.18.09.51.09; Tue, 18 Jun 2019 09:51:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=oLXgwoYJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730102AbfFRQus (ORCPT + 99 others); Tue, 18 Jun 2019 12:50:48 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:7884 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729327AbfFRQus (ORCPT ); Tue, 18 Jun 2019 12:50:48 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 18 Jun 2019 09:50:46 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 18 Jun 2019 09:50:45 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 18 Jun 2019 09:50:45 -0700 Received: from [10.2.168.217] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 18 Jun 2019 16:50:42 +0000 Subject: Re: [PATCH V3 02/17] pinctrl: tegra: add suspend and resume support To: Stephen Warren , Dmitry Osipenko CC: , , , , , , , , , , , , , , , , , , , , , References: <1560843991-24123-1-git-send-email-skomatineni@nvidia.com> <1560843991-24123-3-git-send-email-skomatineni@nvidia.com> <7706a287-44b7-3ad6-37ff-47e97172a798@gmail.com> From: Sowjanya Komatineni Message-ID: Date: Tue, 18 Jun 2019 09:50:43 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL104.nvidia.com (172.18.146.11) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1560876646; bh=5ewJKPP9x+yjrdVa+IF7R1TIqyJxyuRq4n8ATlmTSi8=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Transfer-Encoding: Content-Language; b=oLXgwoYJsuaKPA+P5LeW5/e81zxqAoyQVYEKM/myVLbwzYNRQukxcYGG6Ydohv2hz aPpBNb8iAHRVg9Rc+rrtwi8qasw1FXgrJDCDAIlsgPE3nYjahbaKH9IUElaDuUdmok vfXv9Fz0FM6nhVuJ20fOoZquNmCMm2qirXnm3Mx+ThR9L4VpsLJn0Fl7sVl2/eN1t4 +GDfH5FMAaOWxHgD/Tb3l5T0XzmHOlEFOvDZCNO3FXBLVBAXzTi4bdlSJlrEkNjQmu EELGsx3xxevMd3oUXHgO/rvxuyY6KHFFQZy0QVeTTNtWouPa5jIEG0+RwB1/hng/C+ SoQw6VJNLK5Zw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/18/19 8:41 AM, Stephen Warren wrote: > On 6/18/19 3:30 AM, Dmitry Osipenko wrote: >> 18.06.2019 12:22, Dmitry Osipenko =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>> 18.06.2019 10:46, Sowjanya Komatineni =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>>> This patch adds suspend and resume support for Tegra pinctrl driver >>>> and registers them to syscore so the pinmux settings are restored >>>> before the devices resume. >>>> >>>> Signed-off-by: Sowjanya Komatineni >>>> --- >>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra.c=C2=A0=C2=A0=C2=A0 | 62=20 >>>> ++++++++++++++++++++++++++++++++ >>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra.h=C2=A0=C2=A0=C2=A0 |=C2=A0= 5 +++ >>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra114.c |=C2=A0 1 + >>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra124.c |=C2=A0 1 + >>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra20.c=C2=A0 |=C2=A0 1 + >>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra210.c | 13 +++++++ >>>> =C2=A0 drivers/pinctrl/tegra/pinctrl-tegra30.c=C2=A0 |=C2=A0 1 + >>>> =C2=A0 7 files changed, 84 insertions(+) >>>> >>>> diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c=20 >>>> b/drivers/pinctrl/tegra/pinctrl-tegra.c >>>> index 34596b246578..ceced30d8bd1 100644 >>>> --- a/drivers/pinctrl/tegra/pinctrl-tegra.c >>>> +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c >>>> @@ -20,11 +20,16 @@ >>>> =C2=A0 #include >>>> =C2=A0 #include >>>> =C2=A0 #include >>>> +#include >>>> =C2=A0 =C2=A0 #include "../core.h" >>>> =C2=A0 #include "../pinctrl-utils.h" >>>> =C2=A0 #include "pinctrl-tegra.h" >>>> =C2=A0 +#define EMMC2_PAD_CFGPADCTRL_0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x1c8 >>>> +#define EMMC4_PAD_CFGPADCTRL_0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 0x1e0 >>>> +#define EMMC_DPD_PARKING=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (0x1fff << 14) >>>> + >>>> =C2=A0 static inline u32 pmx_readl(struct tegra_pmx *pmx, u32 bank, u3= 2=20 >>>> reg) >>>> =C2=A0 { >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return readl(pmx->regs[bank] + reg); >>>> @@ -619,6 +624,48 @@ static void=20 >>>> tegra_pinctrl_clear_parked_bits(struct tegra_pmx *pmx) >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 pmx_writel(pmx, val, g->mux_bank, g->mux_reg); >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>>> + >>>> +=C2=A0=C2=A0=C2=A0 if (pmx->soc->has_park_padcfg) { >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 val =3D pmx_readl(pmx, 0, = EMMC2_PAD_CFGPADCTRL_0); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 val &=3D ~EMMC_DPD_PARKING= ; >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pmx_writel(pmx, val, 0, EM= MC2_PAD_CFGPADCTRL_0); >>>> + >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 val =3D pmx_readl(pmx, 0, = EMMC4_PAD_CFGPADCTRL_0); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 val &=3D ~EMMC_DPD_PARKING= ; >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pmx_writel(pmx, val, 0, EM= MC4_PAD_CFGPADCTRL_0); >>>> +=C2=A0=C2=A0=C2=A0 } >>>> +} >>> >>> Is there any reason why parked_bit can't be changed to=20 >>> parked_bitmask like I was >>> asking in a comment to v2? >>> >>> I suppose that it's more preferable to keep pinctrl-tegra.c=20 >>> platform-agnostic for >>> consistency when possible, hence adding platform specifics here=20 >>> should be discouraged. >>> And then the parked_bitmask will also result in a proper hardware=20 >>> description in the code. >>> >> >> I'm now also vaguely recalling that Stephen Warren had some kind of a=20 >> "code generator" >> for the pinctrl drivers. So I guess all those tables were=20 >> auto-generated initially. >> >> Stephen, maybe you could adjust the generator to take into account=20 >> the bitmask (of >> course if that's a part of the generated code) and then re-gen it all=20 >> for Sowjanya? > > https://github.com/NVIDIA/tegra-pinmux-scripts holds the scripts that=20 > generate tegra-pinctrlNNN.c. See soc-to-kernel-pinctrl-driver.py.=20 > IIRC, tegra-pinctrl.c (the core file) isn't auto-generated. Sowjanya=20 > is welcome to send a patch to that repo if the code needs to be updated. Hi Dmitry, Just want to be clear on my understanding of your request. "change parked_bit to parked_bitmask" are you requested to change=20 parked_bit of PINGROUP and DRV_PINGROUP to use bitmask value rather than=20 bit position inorder to have parked bit configuration for EMMC PADs as=20 well to happen by masking rather than checking for existence of parked_bit? Trying to understand the reason/benefit for changing parked_bit to=20 parked_bitmask. thanks Sowjanya