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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32635C433EF for ; Tue, 26 Jul 2022 08:16:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238216AbiGZIQC (ORCPT ); Tue, 26 Jul 2022 04:16:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238169AbiGZIQC (ORCPT ); Tue, 26 Jul 2022 04:16:02 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F349BC19 for ; Tue, 26 Jul 2022 01:16:01 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id z23so24539911eju.8 for ; Tue, 26 Jul 2022 01:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LfDVOeVPpLdHT2UTIoTpJbVfDnCLIY30JY2E/XjBeXE=; b=KsvCNhP4Vza3VqVa7IFBh7DU+gq7K4cHBURlx3TZCfRIo6Y367qP3Dcm23hO9L6C4V gyyeS5FsD4PtEPiKLbho9Y0bUTCUXwUFat5LZywaEGWyrbb5Yl5DptxDobsgpCmprgOW bdxf3iNJg90eKT7/OrxijP1H0ZvfzkaZoSyaDTATwOeA3Y8KUwfXvQgOvBPRGPXrBdwm C2YVKWHTB3N2GDpkwqLBotIrM8iFkKZsG2Fh3usvNGmpj6qMOUDhQ1p0t+5w0/Ak+WZq qT/Fs0MY6BdfZZPBYPBZ6nvVNFLXLLA8WFDeDxxtyB06/IMipcW8DQTE+gtjhelpDJoK 1JcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LfDVOeVPpLdHT2UTIoTpJbVfDnCLIY30JY2E/XjBeXE=; b=xeyT3yaSPk23UBlNidIxhw5jDVA6tO9UThP/QC7MS8KyeUI00Fr8poj2+7qeF0U0wY x7Bu5qVUTd83edMzPmU4UgZOrX1ZZ3FTC1sZEl7LehIWBw2wgevoQ4B3lhHkiJaXdT7K t/DibYgbDwoUb5VCaz5EGlK+yTu7HE7hshdcvfa1fp8Qp3ton1p3T/uF7EcDgpAASLIC 787H1OvovGjLBS+QhE+8nAFUXOSNhi3GppsllWx80SEyhHdG2FooIeuLzFtgEyCVMA+Q fn+119oQ6PodfLn8JDesvyVdqQdlxjfZlMlsGjNG0xgTPRG2Ig+MAOb5IflPOlcHyyC6 TE7g== X-Gm-Message-State: AJIora+hAwjqjqRmYOaM0IT1syA61YJAD6znlUuec8ZOwdjwACOP9csl IfYEfeOErPnZldMmrrghgRBPhjO8LxGC+T6y3XC0ww== X-Google-Smtp-Source: AGRyM1tnQh9BnxgMXhrFEFIWCHi3Zn3tb4QrRBZVb590UOS+owL32oQf0zKizc2q1qQbJ6ZoSaMFEtZbIkoDgfRIfks= X-Received: by 2002:a17:907:1ddd:b0:72b:49ff:d39e with SMTP id og29-20020a1709071ddd00b0072b49ffd39emr13038034ejc.500.1658823359635; Tue, 26 Jul 2022 01:15:59 -0700 (PDT) MIME-Version: 1.0 References: <20220724224943.294057-1-marex@denx.de> <20220724224943.294057-2-marex@denx.de> In-Reply-To: <20220724224943.294057-2-marex@denx.de> From: Linus Walleij Date: Tue, 26 Jul 2022 10:15:48 +0200 Message-ID: Subject: Re: [PATCH v4 2/2] gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode To: Marek Vasut , Hans Verkuil Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski , Loic Poulain , Marc Zyngier , NXP Linux Team , Peng Fan , Shawn Guo Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Mon, Jul 25, 2022 at 12:50 AM Marek Vasut wrote: > Always configure GPIO pins which are used as interrupt source as INPUTs. > In case the default pin configuration is OUTPUT, or the prior stage does > configure the pins as OUTPUT, then Linux will not reconfigure the pin as > INPUT and no interrupts are received. > > Always configure interrupt source GPIO pin as input to fix the above case. > > Fixes: 07bd1a6cc7cbb ("MXC arch: Add gpio support for the whole platform") > Signed-off-by: Marek Vasut > Cc: Bartosz Golaszewski > Cc: Linus Walleij > Cc: Loic Poulain > Cc: Marc Zyngier > Cc: NXP Linux Team > Cc: Peng Fan > Cc: Shawn Guo > --- > V2: Actually update and clear bits in GDIR register > V3: Rebase on top of new patch 1/2, expand CC list, add Fixes tag > V4: No change I understand what you are trying to achieve, and it makes sense. There's is just this one generic GPIO-based driver that makes me a little bit nervous here. Consider: drivers/media/cec/platform/cec-gpio/cec-gpio.c Look what the driver is doing with the gpiod_* operations on it's cec->cec_gpio. A certain GPIO pin is switched back and forth between input and output and in input mode, it is used to generate interrupts as well. Will this still work fine with the MXC driver after this change? At least it will be set to input mode twice, but I suppose that is fine, it's not your fault that the frameworks are orthogonal. Yours, Linus Walleij