Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1824934rdh; Tue, 26 Sep 2023 04:59:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHclVAIrySahobl2rYsrd79ha1jlcJMcDb8WgT5q2+ipq/1WMIeiYVcyuNACBBfeGG3AcY2 X-Received: by 2002:a05:6a20:2443:b0:13f:13cb:bc50 with SMTP id t3-20020a056a20244300b0013f13cbbc50mr3741751pzc.25.1695729580478; Tue, 26 Sep 2023 04:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695729580; cv=none; d=google.com; s=arc-20160816; b=Acz2zrtFCYLZ9xrZ4CU/Jbb8V0N0y+OFbeu2YdBWCD477OQGroc/47wRH7sELVrEVl dmbhJx9uGLQ5B41mrG60RgPeZ2gnHAJjnwYz2LTujA+8ZuybSZoLVULXbahY4E5Rw9oa PZETd8K1/EZxsbMr8nVid2KsoXbxAIYGwHbh3cHCIney/U9EA9JWZVdG+X48oqohUNUO OSfYtVXdfOgZaVA6F42kxw6YtwTYUjFhrmnr45ojqwDRe2Ivd+hF+OshjMpWmPe7/8D8 2YlXhHd5b3FAq2gG0i2d61pTwhOdSqHinHaVmya6HPqF84CwchX790aULVZ3n4bicuvA MeJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=JMaSqPPDYz/Bq7BWfBYYniuK3UiW48yPbsJusGZfJnM=; fh=/7SDcB0j8h9j7Eg3mPncMwYlbB397C1SfnccUmxbFJU=; b=xxFM1yyyEHvFwstcN1VMgTRWNY4ZLy4x5oNIbY58Go6UUPULkpTiJ2Ka+uVxTsR6kX cnJa5oEAm6echI+TUeAVqbVVtMXfUmPi2RxHbXSWb1E1uzYcs9KNYyUH+GSnAfImPAi+ ph9Jd964BL1ho0Ji96Ew+jvSjoolhPv3g7pEiQIQUBKvxbu0QvNxLmnahi8pmBi7rbx9 Sy2JoBygaFK4SJAsBgDElMYehqbVYDG808i3r8AeNEDV6+IRDq0uUrDrFPUTxfZgv+i/ xH4yv3spZs8xaIp4YGeduB9VV56zRbyurytFKdnFuwDQ0H7bSwnY9Lap9wVaQmKRGzTz fbIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id k124-20020a636f82000000b0056b0b30d05csi11758145pgc.245.2023.09.26.04.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 04:59:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E222681A7D24; Tue, 26 Sep 2023 04:59:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234141AbjIZL7F (ORCPT + 99 others); Tue, 26 Sep 2023 07:59:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233884AbjIZL7E (ORCPT ); Tue, 26 Sep 2023 07:59:04 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF1C2DE; Tue, 26 Sep 2023 04:58:57 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="467831915" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="467831915" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 04:58:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="922395899" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="922395899" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga005.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 04:58:53 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC0) (envelope-from ) id 1ql6iI-00000000aw9-1RsA; Tue, 26 Sep 2023 14:58:50 +0300 Date: Tue, 26 Sep 2023 14:58:50 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , Harvey Hunt , Paul Cercueil , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-mips@vger.kernel.org, Bartosz Golaszewski Subject: Re: [RFT PATCH] mtd: rawnand: ingenic: move the GPIO quirk to gpiolib-of.c Message-ID: References: <20230926090623.35595-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230926090623.35595-1-brgl@bgdev.pl> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-1.0 required=5.0 tests=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 pete.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 (pete.vger.email [0.0.0.0]); Tue, 26 Sep 2023 04:59:09 -0700 (PDT) On Tue, Sep 26, 2023 at 11:06:23AM +0200, 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 Much better than that in my opinion. Reviewed-by: Andy Shevchenko > 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 (along with > + * 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 that > + * here for older DTs so we can re-use the generic nand_gpio_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/mtd/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_device *pdev, > return ret; > } > > - /* > - * The rb-gpios semantics was undocumented and qi,lb60 (along with > - * 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 that > - * here for older DTs so we can re-use the generic nand_gpio_waitrdy() > - * 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 = devm_gpiod_get_optional(dev, "wp", GPIOD_OUT_LOW); > > if (IS_ERR(nand->wp_gpio)) { > -- > 2.39.2 > -- With Best Regards, Andy Shevchenko