Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2612729rdh; Wed, 27 Sep 2023 07:44:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGEbfWWC5zUmPoZEquj+CuFTxnjro+uFBnP03ltFbEyxApekHcxt/MC1du2+rrUQgmI1vI3 X-Received: by 2002:a17:902:f804:b0:1c3:a4f2:7ca3 with SMTP id ix4-20020a170902f80400b001c3a4f27ca3mr1925817plb.66.1695825866639; Wed, 27 Sep 2023 07:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695825866; cv=none; d=google.com; s=arc-20160816; b=0jpNPXY11VXPvGiP1K6JZRgbbGtDLgrfzFELqXQm1wmVOnmvTmMcuc88pgJDP7yh/O +1ye/kJe71rebgDoj927uTHOKFoKmtzfDnlAEFcVtIhQDRMc8nwpt1eYjHJxYXPhPzuc MFV7N2A2y8w1DCq1XwciBWRBqbUj5JAPNhWJ9qOuo6GhD/Br2yy8LJH3bQRtQAODNh5d e9Hup7iq9cs8ydMDWod+Mdx1ZIX2Qso4cPQaK6eaONWXZiqv5qj4yulp+gBfEkoQKeqY kQqD7khVH/1ykr/ot9nBbmixYKhajw6LLf+Sh/Np8rtEIII/5bUvTdtU7rPeANjwWIVw 3B1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=qVfAkzwv7s6SJ5GID4gdrqme1d05OJyLXXoD6QHFoE8=; fh=BZUIVwzNEqphHYtQda9iZnXzBxUbdkCCBKHH+uPGVjQ=; b=KEWVAVcB2NJjNJcCmf8sFqicU30YZ3hrvapfYL5bC4r5gu4t+7DN05Y/HVoMjQbpgK 6eokg3+7FA4eKQ+z+qYv/WpVAll24rwo2gaVSzE4n5EXt6DqTYbzuziEg4rPu/9VXWS6 wGKu4JkY6hpl+dJU/Ar6cb72BL3gH7WOoara/wZ4QCrFbnEp7GUPM+MB/3SGW7EWGHIp iJEH3i8PqevqB9nL4QefqF/aBpH395CYYHBQS58siB0HVh7dG5+98WXZHGT1UZtucekh umncgizK76bXH7UvC/yOWpm3aUzpwmmxi7b66z5AoUaRkQvpXodmQ8CQaiR0SwCseYMh 6/iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=JnSF+Grf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u11-20020a170902e5cb00b001bbbbb61c71si16889542plf.399.2023.09.27.07.44.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 07:44:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=JnSF+Grf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 8EE1B8073219; Wed, 27 Sep 2023 04:16:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231392AbjI0LPz (ORCPT + 99 others); Wed, 27 Sep 2023 07:15:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231372AbjI0LPx (ORCPT ); Wed, 27 Sep 2023 07:15:53 -0400 Received: from mail-vk1-xa35.google.com (mail-vk1-xa35.google.com [IPv6:2607:f8b0:4864:20::a35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 903B3F3 for ; Wed, 27 Sep 2023 04:15:52 -0700 (PDT) Received: by mail-vk1-xa35.google.com with SMTP id 71dfb90a1353d-495d687b138so3887155e0c.3 for ; Wed, 27 Sep 2023 04:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1695813351; x=1696418151; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qVfAkzwv7s6SJ5GID4gdrqme1d05OJyLXXoD6QHFoE8=; b=JnSF+GrfmmRO07uHO1RaW598bSPFK1uwYXWwCpiCQYiOo0gW0F7N5h0qAYPrJ6M/Xc Jt/BP2Z52BYZjsv6oRGuDrE11wu72ykDovpKsFBhOtcSNznOzwX2CNbtt7SWDlp3GjWe OvgdtsH5UPXLxkKIn3GO2s6sE1vj+YATEIEdNST1FRcYv/d/H/eNl+DcRSZpqMD7vdQt 1DAB8BlQvL7NNttkY3uRfia5cFFs8qCHIwnlX2JgjdGhdKp7MfLlN4/DAnhhAZK4NKkA SVO9mqWFon6e/cCjInyuFWCcftEzIbAlzT5xthZztCyHEcVWN6w+ZpnAavMD9ELYKz4v +Jng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695813351; x=1696418151; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qVfAkzwv7s6SJ5GID4gdrqme1d05OJyLXXoD6QHFoE8=; b=VYcRlwA7mHZnIH/ToODLrwU6GEjqZteEBcLKit/74WN4SToaWKYX7jPATIDV6TjOeH Oxip8rvw8IOvFLgtB4SRXa4cO8qynplOsUvKk2lDqWUD/LD5hwWcvbVoDWYpzDCvjdrJ iqvZnCuCyLp3XUW+iMHWg2/19DsD8IA63xY1Y15SOnIkBs7Ja0VmynFncr5oVvi9Rxge /xBtCiEnWQGIoLSE6av4p9VaHq2hm2VupZn/wmplMHe4iiLtKKhISjsCrA4PhxFsbKLa Szdk0rn3haCLIAnbrxEOhMnuHBW8AyHvR6VCHU1rfCVM8AYQWdOJV2dsfymRVkbzK6s1 IHIg== X-Gm-Message-State: AOJu0YyVx1a8aoer9XsO4tJhCTSQYmsvE4ztuMJE9ALkuT84VPbttBrS rAu1rO/LxIoi/eKLw6p+rm6h1VkEOgaEDayZdJBjOA== X-Received: by 2002:a67:fa05:0:b0:44d:3d29:4940 with SMTP id i5-20020a67fa05000000b0044d3d294940mr1020879vsq.35.1695813351573; Wed, 27 Sep 2023 04:15:51 -0700 (PDT) MIME-Version: 1.0 References: <20230926090623.35595-1-brgl@bgdev.pl> In-Reply-To: <20230926090623.35595-1-brgl@bgdev.pl> From: Bartosz Golaszewski Date: Wed, 27 Sep 2023 13:15:40 +0200 Message-ID: Subject: Re: [RFT PATCH] mtd: rawnand: ingenic: move the GPIO quirk to gpiolib-of.c To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Harvey Hunt , Paul Cercueil , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-mips@vger.kernel.org, Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 27 Sep 2023 04:16:29 -0700 (PDT) On Tue, Sep 26, 2023 at 11:06=E2=80=AFAM Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > We have a special place for OF polarity quirks in gpiolib-of.c. Let's > move this over there so that it doesn't pollute the driver. > > Signed-off-by: Bartosz Golaszewski > --- > This is an alternative to the previous patch that instead of replacing > one active-low setter with another, just moves the quirk over to > gpiolib-of.c > > drivers/gpio/gpiolib-of.c | 9 +++++++++ > drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c | 12 ------------ > 2 files changed, 9 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c > index 5515f32cf19b..58c0bbe9d569 100644 > --- a/drivers/gpio/gpiolib-of.c > +++ b/drivers/gpio/gpiolib-of.c > @@ -192,6 +192,15 @@ static void of_gpio_try_fixup_polarity(const struct = device_node *np, > */ > { "himax,hx8357", "gpios-reset", false }, > { "himax,hx8369", "gpios-reset", false }, > + /* > + * The rb-gpios semantics was undocumented and qi,lb60 (a= long with > + * the ingenic driver) got it wrong. The active state enc= odes the > + * NAND ready state, which is high level. Since there's n= o signal > + * inverter on this board, it should be active-high. Let'= s fix that > + * here for older DTs so we can re-use the generic nand_g= pio_waitrdy() > + * helper, and be consistent with what other drivers do. > + */ > + { "qi,lb60", "rb-gpios", true }, > #endif > }; > unsigned int i; > diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c b/drivers/mt= d/nand/raw/ingenic/ingenic_nand_drv.c > index 6748226b8bd1..c816dc137245 100644 > --- a/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c > +++ b/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c > @@ -380,18 +380,6 @@ static int ingenic_nand_init_chip(struct platform_de= vice *pdev, > return ret; > } > > - /* > - * The rb-gpios semantics was undocumented and qi,lb60 (along wit= h > - * the ingenic driver) got it wrong. The active state encodes the > - * NAND ready state, which is high level. Since there's no signal > - * inverter on this board, it should be active-high. Let's fix th= at > - * here for older DTs so we can re-use the generic nand_gpio_wait= rdy() > - * helper, and be consistent with what other drivers do. > - */ > - if (of_machine_is_compatible("qi,lb60") && > - gpiod_is_active_low(nand->busy_gpio)) > - gpiod_toggle_active_low(nand->busy_gpio); > - > nand->wp_gpio =3D devm_gpiod_get_optional(dev, "wp", GPIOD_OUT_LO= W); > > if (IS_ERR(nand->wp_gpio)) { > -- > 2.39.2 > Queued for v6.7. Bartosz