Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp459767ybt; Mon, 6 Jul 2020 13:41:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzovO9cjbEHD9OBlmASe8G3GpHly+NgJi8nodw4DcvtEU8oy6v9HxLzjTre7U5fUPJcxwHg X-Received: by 2002:a17:906:c53:: with SMTP id t19mr47069155ejf.143.1594068098392; Mon, 06 Jul 2020 13:41:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594068098; cv=none; d=google.com; s=arc-20160816; b=bsfzdWZp0UnSgjBE7zIn5la6DSilLBv8lPh56xp/P7GClVS0IzsLawcZ4TssjmZGLw m4VJtBypPFcOHOsQ06ux5K9nOsROEprKoRw7umg9mg3BRx21WU01dVrrXSyVAJkVxEwK LrUTMLfes+JQGdoih3XDhpyxuswLqdW06enSCGcwtWvFC73l+jS6wOTxMgi6QmPRuwwT ElN+S0VJ5nr6yRDQcTkk/5622B28c6e/s7pzU+nuiMsXyqUoc5UfL/RnTDXffYoBWNkI qrTM19BvQpz8NigXtz/QTQhSvbzLV4Nr/i6wfbh/xeO97Ii11WhlmZJn3u9KCgO5C9SD j4OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=bhIhP55Tu8Q9PiXx14eLZ+yc9Jxsauj5ShBXbtr2VAI=; b=E5P5GGGnV8l5HHk8ENAeSc1cEv41IujxD4mScCUYG7u9LZTOh0dxoJTOfJzSSpLYNN KkIP3k0X6qJO7NnSKj9Dl0k7trlwcRiwEncYo2v7xpkK4KXto5kDuwVEEhfcskq4yDuG FstasaXRUzANhJKxBXT4x0qfTajm2uCYRXGUQUnDGBm2GjgPvidTDrcIupfZ/46Ax1Oa aDEPDBxSaXpzb5bVJBho0de4FqtFNF98zcgxKimtCX8tx2mbvYbNa23B2fTLJwkOGvTP 8Gf09UYWQmj/1S4CRdhYX8KdFjDhUDvpSn/i4C9TiFk9vpeJkcE9HQg32AbCn46R6caS AqUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ijmf96Hm; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d22si13976832edq.274.2020.07.06.13.41.15; Mon, 06 Jul 2020 13:41:38 -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=@linaro.org header.s=google header.b=Ijmf96Hm; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726478AbgGFUk1 (ORCPT + 99 others); Mon, 6 Jul 2020 16:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbgGFUk0 (ORCPT ); Mon, 6 Jul 2020 16:40:26 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BB21C061794 for ; Mon, 6 Jul 2020 13:40:26 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id t11so12580846pfq.11 for ; Mon, 06 Jul 2020 13:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bhIhP55Tu8Q9PiXx14eLZ+yc9Jxsauj5ShBXbtr2VAI=; b=Ijmf96HmIoLKBFfHTlBhRzI1pblLyav3TgWTbgcpvJ5mkn38Tv2JxSTB4hVrBMHv8i UngrDn5pg72d5iUytnAkebr4zUKq9KVNJDq0orWcWIjrdmqkCBN3v/RN7ICNKf6157aI fBtqfeQfq35aRCkYmL+QWEEaRudS7WHWmwFqoSue2WHuzcm4ietGMmI8Kv/b+z4soG87 zy4Vuy3haj1h6FIxpWu1KulZ3y3FuGFfTJ2sLRfq+6piUTwrtS/hI4cfz+4v3w91dPF3 gODeeZH2ELyCGJ59cfoWCeuTopr4YzqJLbGF2wCqp2+Yi1qCCLe4b9ABCi7BbPkhwTL/ WzNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bhIhP55Tu8Q9PiXx14eLZ+yc9Jxsauj5ShBXbtr2VAI=; b=rp/XhnsofALRiamsMe549N8uw5kdUvQ/u/KJGy2Mlt4YdevYg0Eh19d+lQgDFObKa0 ae0wgb6sXPUy58fUwpNVW9KFGh1Vowd1mst9B657Z1j3Lb34cNHaM1JPz6bK9Dtmt6dZ /12ff3GY5+9PEkXSI9gquxdCP+v11k9Rjo5IJd+STTIEWWr+VOQIKkgScFf9WH+WY3q5 kVI0JUGLlcb3gbWFFE3T0RNcoMSK8UUJynqC0WgCtmvBnrxaGwXd0dfKafY4JHcCylPj NqlFJSovPOsggOCTaklSABDajzhc5mqNsUurxz8F4PLS5Q+ZQQTxSQN+wwu0AfvglbRF Q9JQ== X-Gm-Message-State: AOAM533fNACNTFWW5y75c/vdN+BN2m8OO08a6gR+F5rxsychZILzUH7T efTBRhu0JDIcOON2/wVZuIJyBA== X-Received: by 2002:a62:2641:: with SMTP id m62mr16919890pfm.263.1594068025834; Mon, 06 Jul 2020 13:40:25 -0700 (PDT) Received: from builder.lan (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id 21sm20117865pfu.124.2020.07.06.13.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2020 13:40:25 -0700 (PDT) Date: Mon, 6 Jul 2020 13:38:05 -0700 From: Bjorn Andersson To: Doug Anderson Cc: Rajendra Nayak , LinusW , Andy Gross , linux-arm-msm , "open list:GPIO SUBSYSTEM" , LKML , Maulik Shah , Lina Iyer Subject: Re: [PATCH v2] pinctrl: qcom: sc7180: Make gpio28 non wakeup capable for google,lazor Message-ID: <20200706203805.GS388985@builder.lan> References: <1593762506-32680-1-git-send-email-rnayak@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 06 Jul 13:24 PDT 2020, Doug Anderson wrote: > 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. I second that. > 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 > pinctrl-msm already supports emulating dual edge, but my understanding was that the problem lies in that somehow this emulation would have to be tied to or affect the PDC driver? Regards, Bjorn > ...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