Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2650552imm; Thu, 16 Aug 2018 13:09:20 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw+ZeRQP5/Yse6x4/h22+ULtEGEQTWT1fhXYOJpcjlPD2BQAtF4JpBdzYG/xg+hxfJoWipU X-Received: by 2002:a62:fd06:: with SMTP id p6-v6mr33053132pfh.167.1534450160144; Thu, 16 Aug 2018 13:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534450160; cv=none; d=google.com; s=arc-20160816; b=tyDD2tsVLSjOl6SDHE3W19HOYL/n6xJpyTde/0h7r8MYR7aPWA45BoHMpzkfDi0Ajr nxfW8MtaaDbov3LYcnkfxRmgXt549d8Kh7NdEgY0K/38j/FgWMaF7Sh9su65d3YIzqS8 +KUHsZwc5jHBswdLGFsD/sE0HmkDHyV3sy/J4PkMS4tTMgUCgKoS6fMHdHxZ3vrBGFHN 9DlGAQiFsMUFgbiqnWNCRKW58v2SQf5CkgFjCILtXb+TzbZjqjGnl0MynB0ACs2ddm0y oeyy2v7R8Ucujz+IGfmnpq0bw9iw/4wiLCWzOQJf/G+VVdjdzT5muz3s9LWlcvl6F0po GiqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=TKFhrCZAISo/nb50FJthb7MLa2uEO7xUM+Q3exqfqjI=; b=j2MfQ5lW8Q3zhzD9Ftx1pKQUKYFCFd6IJ+N9Y331r61fRnLP2ZFkFG68SaAtikSwkJ D+zdX+Y9syhbyVu16GKJU1X/XOWhXzWEn4wrTFrdu37PKlXNmNwrl4FfvNN+BdiRtNnc dxDQEVjHhAobkUjM9l3k6bKHnv8WWO7AnoLHmoHB0w55qWWlSKGEnzIHg3aQC63GWvyM buxMyJPhE5OytX0g3apkHhMFV27RoEfilYpMxYjCSEelsBXJu+sp5J5QrGTsz3dpdEcJ lNcAy0JdbrJWMh6DLtqB7EZaNjpIu9TGZjqOlhNyWi6I2QX+ALY/bQPenROExUEZ7SVF xNsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Si8y/WYT"; 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=REJECT sp=REJECT dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r10-v6si234657pli.248.2018.08.16.13.09.04; Thu, 16 Aug 2018 13:09:20 -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=@chromium.org header.s=google header.b="Si8y/WYT"; 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=REJECT sp=REJECT dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726011AbeHPXHS (ORCPT + 99 others); Thu, 16 Aug 2018 19:07:18 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36286 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbeHPXHR (ORCPT ); Thu, 16 Aug 2018 19:07:17 -0400 Received: by mail-pf1-f195.google.com with SMTP id b11-v6so2500016pfo.3 for ; Thu, 16 Aug 2018 13:06:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TKFhrCZAISo/nb50FJthb7MLa2uEO7xUM+Q3exqfqjI=; b=Si8y/WYTkuBLam4XhCR2KZH+Wff+781dI6FG01GYN95UezkQqWtpXqLbphrrSlulA+ Fx4qP5u3TywVX8tQ6Ubwz7U8tE95aJliKyhyECTAwJbL7CGlm8eAU6C1UczgwdtxT9Rf TIfRMfYAEX4m3TYoVcjPWWlNzOLiZkFVj3EjI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TKFhrCZAISo/nb50FJthb7MLa2uEO7xUM+Q3exqfqjI=; b=oXnfIaKZ6qz0BEw6IqG38ho7Xi4M9QodzZs6+sAk/4WngRmmKW7Hk99jRS4mh1BjLn m1yDrkhvk+65Y2lcfHsIjQymB8ub9fq3bFMIB5e6WtrJlWx7qzA4UC+DBr3RvrvNkL1p bJZI8WZoOUpnbUY1kRUGjNnIa5t1cHIqy3h+px2dwMaMNJAW5O8Vpim9cqpfxFI2KFpt HuWWKPJRX6iHucQQZ2sKWSYHivN9UL8QD4steUOO2NpTC9/xBjbAvj7r97FsUCnFQhhG ic8tCoQ7yYBcTKqUH6iXiMEZK8y7XSLYZi6NuR0RI1dwzykkDdteUFJGkvMHmzybtXr2 8Zeg== X-Gm-Message-State: AOUpUlH+NLFOd3Z0JSKHeHqpAVz9K0+7KWkphTIgJQ0WCxZrFPemL0MB V+xpnXpa+4ucboiDUYCg3If3aw== X-Received: by 2002:a63:e647:: with SMTP id p7-v6mr29855537pgj.218.1534450009796; Thu, 16 Aug 2018 13:06:49 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:7e28:b9f3:6afc:5326]) by smtp.gmail.com with ESMTPSA id v6-v6sm234958pfa.28.2018.08.16.13.06.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Aug 2018 13:06:49 -0700 (PDT) From: Stephen Boyd To: Linus Walleij Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bjorn Andersson , Doug Anderson Subject: [PATCH v3 0/3] pinctrl: msm interrupt and muxing fixes Date: Thu, 16 Aug 2018 13:06:45 -0700 Message-Id: <20180816200648.90458-1-swboyd@chromium.org> X-Mailer: git-send-email 2.18.0.865.gffc8e1a3cd6-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Here's a collection of pinctrl fixes for the qcom driver that make things a little smoother for DT writers while also fixing a problem seen with level triggered interrupts. The first patch fixes an issue where we always see one extra level triggered interrupt when the interrupt triggers. The second and third patches make things nice for DT writers so they don't have to explicitly mux out pins as 'GPIO' function and as 'input' instead of output so that interrupts work properly and also makes sure that a gpio is muxed out properly to 'GPIO' function when a gpio is requested by gpiod_request() and friends. The discussion never really completed on the previous thread so I'm just resending these patches to restart the conversation. In the cases where a driver needs to do both pinctrl muxing for some non-gpio function and also GPIO control they'll need to explicitly mux the pins at the right time. If we force them to mux the pins into the function mode after requesting the GPIO at boot then we'll be better off because it will force the code to mux out the function or GPIO explicitly all the time. We will have a case in the near future where the UART driver will want to mux the RX pin into GPIO mode so it can get a wakeup interrupt during suspend path and then swizzle the pin back into QUP/UART mode when the wakeup interrupt isn't necessary anymore. In this case, I imagine the driver will request the pin as an interrupt during probe, that will convert the GPIO into an irq and mux it out as a GPIO function input pin, disable that IRQ because it's only needed at suspend time, and then need to explicitly mux the device into "UART" mode before finishing driver probe. Then when it goes into suspend, it will need to remux the pin as a GPIO function input pin, enable the irq, and wait for wakeup. On resume, it will disable the irq and remux the pin as "UART" mode. Changes from v2: * Better comment in patch#1 to describe this stuff * Squashed the raw status bit part into the same write in mask path based on suggestion from Doug Andersson Changes from v1: * Squashed the raw status bit part into the same write in unmask path based on suggestion from Doug Andersson Cc: Bjorn Andersson Cc: Doug Anderson Stephen Boyd (3): pinctrl: msm: Really mask level interrupts to prevent latching pinctrl: msm: Mux out gpio function with gpio_request() pinctrl: msm: Configure interrupts as input and gpio mode drivers/pinctrl/qcom/pinctrl-msm.c | 77 ++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) -- Sent by a computer through tubes