Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp450946ybt; Mon, 6 Jul 2020 13:25:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQtxbvlHby45cOgJzuQhyndaqT0Ubiv38e7qKh8JwWN7WkTAgkNzaf5HRuVxz//2Vn4St1 X-Received: by 2002:aa7:d802:: with SMTP id v2mr50118249edq.77.1594067135070; Mon, 06 Jul 2020 13:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594067135; cv=none; d=google.com; s=arc-20160816; b=jqJcsYX7YRCi7j9iSnDdzgsvoTkM1BTqls/zuBuQS7tM0gqxJN0NUQoFmvHm70Qhl7 8k9sJO3Yii8Ppfb+RH9lTH26mUxj4rIqOcpFogFGNeS0TrXVEAF406HEfDPPqKy6u+jE EAbj2YN7RsI9PXn6Hs6Xc3xAEEEyzgo+2dSEruk6om9S16YcgCcqs/uLEruWlgurx2gj fwPc08qXdzFmuUNkJMeDpqI1QNbqpKwDg6/WKtXsUJQK1aXAWOm/LxJc3Xl74eZnuaNk mh5jER1RGCxEtHU0t4EYBz6ekvOhlQvmdk0YbxrtOve+Zr9XKqHghSBVEMUy2dapNgJn VyoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DGql7KgjF3RRgjYDtLO8zSCx9KVGEva8Jd1iGMAKsuA=; b=U9cjZMlMEyoAGQ3sP+BIXx/xGteHonZLUD0DoclIVGNLWNIESr0QWo7WvelB0p/HDf V1G/hmp6nt9lp++I7HrM3iCCRiGPpT1dFqc3E2nuFrPY0exeXdJcp+x/1wpZkBce6DB2 XQEyO4wtSPscMChNGr2mUDM5B4OdthSDnb/1R8vQ0egWGC5noadWvhFSVyibOmGa/rOU IMSagfg2Bq1Doa8vndpvohVzvcJ92zFFitijUv9ciVxFZU4jA/V1YHE74QGv+e1WtGlP YAcdIIXnHjBfb+wVmTDOOp/kTbR43mPl62YlriiNU+t37ZVgjRozNrrku7dNMBR8yzMN lBjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XFn63Oot; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si14064181edq.340.2020.07.06.13.25.11; Mon, 06 Jul 2020 13:25:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XFn63Oot; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbgGFUYf (ORCPT + 99 others); Mon, 6 Jul 2020 16:24:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbgGFUYe (ORCPT ); Mon, 6 Jul 2020 16:24:34 -0400 Received: from mail-ua1-x943.google.com (mail-ua1-x943.google.com [IPv6:2607:f8b0:4864:20::943]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6366AC061755 for ; Mon, 6 Jul 2020 13:24:33 -0700 (PDT) Received: by mail-ua1-x943.google.com with SMTP id u6so9739390uau.8 for ; Mon, 06 Jul 2020 13:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DGql7KgjF3RRgjYDtLO8zSCx9KVGEva8Jd1iGMAKsuA=; b=XFn63Oot/wsEytB33U8ac66WHBUC15SLm8s9frUm+6TLATnElKo+THw+QkWGAtRjNC l3EfWubMzIa7XPYcMMYE+kaDG42fw4t3ZUcI2q/FAymaNfvCndJrMwKZzoL0RlgTOmy0 rCHuNo3gjO+BTa9HzlNpm9WAQ9oWNcS8MlAvM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DGql7KgjF3RRgjYDtLO8zSCx9KVGEva8Jd1iGMAKsuA=; b=GlhyXE7J4oxVT+vsENFP3XoTJjIt1YCTc7aowXbi0pMhXK9sMXz76XMgo61Qfz0eXv QutSuPXeHyZc66igcKZiOsVavFR9cSWH26MnuDtmXMptLMLibJ5Tn4hYh68Xiijqb9/0 /nypkeomHDOuC6JWYOt8kNK5oskhUjxqObDdNmnWDXbUTZ9b82ALbwEb3FMKcwKApCAs 7NY9M94JRNc1O1+zVibrDh/5T8UoNNMskC+XCaV66X0dERV4qDMusuwRfGjhxg60sklT DssZ8j0wEXNhaV8tRC8btBdh/J5DzQaYtD1wmO+Ma8d/SQLs+X0YZST1sVcE4fnRZX0v 9pnA== X-Gm-Message-State: AOAM531mpZZJJi1elkFR3XlDTLUG0iIUvDQideB9u2PzEpG2/AqIkEv4 RQGdgeCXrSWsLCgON8eba0Ozs9I7YdE= X-Received: by 2002:a9f:2338:: with SMTP id 53mr34317615uae.129.1594067072306; Mon, 06 Jul 2020 13:24:32 -0700 (PDT) Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com. [209.85.217.41]) by smtp.gmail.com with ESMTPSA id t2sm4758712vka.28.2020.07.06.13.24.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jul 2020 13:24:31 -0700 (PDT) Received: by mail-vs1-f41.google.com with SMTP id 64so15063231vsl.3 for ; Mon, 06 Jul 2020 13:24:31 -0700 (PDT) X-Received: by 2002:a05:6102:94:: with SMTP id t20mr22923661vsp.106.1594067070957; Mon, 06 Jul 2020 13:24:30 -0700 (PDT) MIME-Version: 1.0 References: <1593762506-32680-1-git-send-email-rnayak@codeaurora.org> In-Reply-To: <1593762506-32680-1-git-send-email-rnayak@codeaurora.org> From: Doug Anderson Date: Mon, 6 Jul 2020 13:24:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] pinctrl: qcom: sc7180: Make gpio28 non wakeup capable for google,lazor To: Rajendra Nayak Cc: Bjorn Andersson , LinusW , Andy Gross , linux-arm-msm , "open list:GPIO SUBSYSTEM" , LKML , Maulik Shah , Lina Iyer Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, Jul 3, 2020 at 12:49 AM Rajendra Nayak wrote: > > The PDC irqchip driver currently does not handle dual-edge interrupts, > and we have google,lazor board with sc7180 designed to configure gpio28 > as a dual-edge interrupt. This interrupt is however not expected to be > wakeup capable on this board, so an easy way to fix this, seems to be to > make this gpio non wakeup capable and let TLMM handle it (which is capable > of handling dual-edge irqs) > > To be able to do so only on this board, so other boards designed with > this SoC can continue to use gpio28 as a wakeup capable one, make a > copy of msm_gpio_wakeirq_map for lazor and remove gpio28 from the > list. > > Reported-by: Jimmy Cheng-Yi Chiang > Signed-off-by: Rajendra Nayak > --- > drivers/pinctrl/qcom/pinctrl-sc7180.c | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/qcom/pinctrl-sc7180.c b/drivers/pinctrl/qcom/pinctrl-sc7180.c > index 1b6465a..0668933 100644 > --- a/drivers/pinctrl/qcom/pinctrl-sc7180.c > +++ b/drivers/pinctrl/qcom/pinctrl-sc7180.c > @@ -1135,7 +1135,24 @@ static const struct msm_gpio_wakeirq_map sc7180_pdc_map[] = { > {117, 114}, {118, 119}, > }; > > -static const struct msm_pinctrl_soc_data sc7180_pinctrl = { > +/* Dropped gpio28 from the map for the google,lazor board */ > +static const struct msm_gpio_wakeirq_map sc7180_lazor_pdc_map[] = { > + {0, 40}, {3, 50}, {4, 42}, {5, 70}, {6, 41}, {9, 35}, > + {10, 80}, {11, 51}, {16, 20}, {21, 55}, {22, 90}, {23, 21}, > + {24, 61}, {26, 52}, {30, 100}, {31, 33}, {32, 81}, > + {33, 62}, {34, 43}, {36, 91}, {37, 53}, {38, 63}, {39, 72}, > + {41, 101}, {42, 7}, {43, 34}, {45, 73}, {47, 82}, {49, 17}, > + {52, 109}, {53, 102}, {55, 92}, {56, 56}, {57, 57}, {58, 83}, > + {59, 37}, {62, 110}, {63, 111}, {64, 74}, {65, 44}, {66, 93}, > + {67, 58}, {68, 112}, {69, 32}, {70, 54}, {72, 59}, {73, 64}, > + {74, 71}, {78, 31}, {82, 30}, {85, 103}, {86, 38}, {87, 39}, > + {88, 45}, {89, 46}, {90, 47}, {91, 48}, {92, 60}, {93, 49}, > + {94, 84}, {95, 94}, {98, 65}, {101, 66}, {104, 67}, {109, 104}, > + {110, 68}, {113, 69}, {114, 113}, {115, 108}, {116, 121}, > + {117, 114}, {118, 119}, > +}; > + > +static struct msm_pinctrl_soc_data sc7180_pinctrl = { > .pins = sc7180_pins, > .npins = ARRAY_SIZE(sc7180_pins), > .functions = sc7180_functions, > @@ -1151,6 +1168,10 @@ static const struct msm_pinctrl_soc_data sc7180_pinctrl = { > > static int sc7180_pinctrl_probe(struct platform_device *pdev) > { > + if (of_machine_is_compatible("google,lazor")) { > + sc7180_pinctrl.wakeirq_map = sc7180_lazor_pdc_map; > + sc7180_pinctrl.nwakeirq_map = ARRAY_SIZE(sc7180_lazor_pdc_map); > + } As much as I want patches landed and things working, the above just doesn't feel like a viable solution. I guess it could work as a short term hack but it's going to become untenable pretty quickly. As we have more variants of this we're going to have to just keep piling more machines in here, right? ...this is also already broken for us because not all boards will have the "google,lazor" compatible. From the current Chrome OS here are the compatibles for various revs/SKUs compatible = "google,lazor-rev0", "qcom,sc7180"; compatible = "google,lazor-rev0-sku0", "qcom,sc7180"; compatible = "google,lazor", "qcom,sc7180"; compatible = "google,lazor-sku0", "qcom,sc7180"; compatible = "google,lazor-rev2", "qcom,sc7180"; ...so of the 5 boards you'll only match one of them. Maybe I'm jumping into a situation again where I'm ignorant since I haven't followed all the prior conversation, but is it really that hard to just add dual edge support to the PDC irqchip driver? ...or maybe it's just easier to change the pinctrl driver to emulate dual edge itself and that can work around the problem in the PDC? There seem to be a few samples you could copy from: $ git log --oneline --no-merges --grep=emulate drivers/pinctrl/ 3221f40b7631 pinctrl: mediatek: emulate GPIO interrupt on both-edges 5a92750133ff pinctrl: rockchip: emulate both edge triggered interrupts ...and if you look at those two commits they refer to other examples. The mediatek one says: > This follows an example of drivers/gpio/gpio-mxc.c. ...and the Rockchip one says: > implement a solution similar to pinctrl-coh901 That means you have at least 4 samples to look at? -Doug