Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp737515rwd; Thu, 15 Jun 2023 01:04:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ydHUu7HWjYkW5sYVHaY6cumogIG+gQVNhzmUY/bkkK6+N6VYxHPP1XvjAIijcBmt/m5od X-Received: by 2002:aa7:c6cc:0:b0:518:5f8e:53b8 with SMTP id b12-20020aa7c6cc000000b005185f8e53b8mr6096686eds.13.1686816244052; Thu, 15 Jun 2023 01:04:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686816244; cv=none; d=google.com; s=arc-20160816; b=ip+20C4V+HyfYOVzy4ej8/qmzHXEGoV42cY8TE/7nz+r6Ul0OZ+DTEdu3E5JneddRK JFAL3Ee2d99NBVbwosF5X9PHrLqI3RvHhaJjuDL3yFIAIRzL/vlM3VUeC/BZFrjz3Mqc nxP0bALTvW5kqbie23jmcVkrtX83xRCmS8dWtVYoFWISFYg+arysNlc8jFQ1XeAgiqpM b8YlXv5xVOhWOz3wa0INFIwbVlkryuoe26HJqvWyR+wUYX7bjnEA74fuD9P/NEUbLADS S0F3R3jgEsQG/WcCC9NOsv8vzq8kTRjgwn9Wf6dqDPf5GOSmbv6eJ9aMaSuyYQWOHbvL TbBg== 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; bh=Q0SioJJAcKcUNbtQnihdIEqbbLE+HxkXdODZwnT6RkU=; b=Ve/CxzhrlcsYgREWaDUpMQKDaXs2VnsbpRx7GdITf/nS50Ua6tRnMQMC+IjZPaFPxA XkNi7Vta4NE5I3JIV4cPHVYxOZcGBdjIPhza12ruM/0+d3Y+0U0Oc1WpRQaB7rf5Fcv9 Pg+l+bD7vy86AgWck4v0+rdC+gMmJPsHfBHSqCI4JE4hvKuX3xlxSLyp6DwF12/VOeto eT9Nsy06snVMPD3pVjBd6N+GtSFrY0z62+N3+mr3cBuZrvrCCg7DO2nkM0nNWXM1fXYn gBMtB06pKsbDUzuppjW1UIorv4DCz+v1UiMcZ4Z72v+p3nwjdP0MntG5p77i2/t9rjZS jK4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m6-20020a056402050600b0051897d0fb5fsi1728086edv.535.2023.06.15.01.03.40; Thu, 15 Jun 2023 01:04:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244249AbjFOHti convert rfc822-to-8bit (ORCPT + 99 others); Thu, 15 Jun 2023 03:49:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245282AbjFOHtL (ORCPT ); Thu, 15 Jun 2023 03:49:11 -0400 Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E3C630FD; Thu, 15 Jun 2023 00:48:41 -0700 (PDT) Received: by mail-yb1-f182.google.com with SMTP id 3f1490d57ef6-bd729434fa0so1528930276.1; Thu, 15 Jun 2023 00:48:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686815321; x=1689407321; 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=LdjFuszznIUW8xr9SCUVhRejLGTT8nUEiVZj8JgCoLQ=; b=CPvqqvyaCylwhejObkvScfL467ADgaAAcz1DQDkHCrfHBuamcKrZdNH0pG4+WNp7QK mfG6sCA9oGmQ70z33Nf3rQSC2tmo2VbfnGpZ+Qrmbu9bhgrXvZKqicAyAptN9ypjzTB1 vqjJnIK+OxUkzk/6DdyuKUZo1kYXWMxSMgy/9wBfq6P8EMPCxSQmBO6Q9ex3VOV0jprv B/SibivuXIgevuzcOS3g3ra9VkSv2eUz5Zg3ledgxDAi3WDD/YtNgy0a9rRCCbPonWR6 y1KijH/X1KnqWyukp/BoOAY19KSXY5EpkuysLpGtFMAKz2gG9vFCXrlaOe984NsTgR5b lP+w== X-Gm-Message-State: AC+VfDwGkrQ5pEcFkWLSWrrtqVnKXcxExelFBA0wt1hTDYB+YfcNIb43 DcbdhpAHeYh23X/5ZGDcpFY6IPpQ8Hfq/A== X-Received: by 2002:a25:b106:0:b0:bce:f883:e0b2 with SMTP id g6-20020a25b106000000b00bcef883e0b2mr4339177ybj.42.1686815320709; Thu, 15 Jun 2023 00:48:40 -0700 (PDT) Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com. [209.85.219.179]) by smtp.gmail.com with ESMTPSA id d12-20020a25bc4c000000b00ba8c2f3e1a4sm3850077ybk.56.2023.06.15.00.48.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Jun 2023 00:48:40 -0700 (PDT) Received: by mail-yb1-f179.google.com with SMTP id 3f1490d57ef6-bd77424c886so1539610276.0; Thu, 15 Jun 2023 00:48:40 -0700 (PDT) X-Received: by 2002:a25:e086:0:b0:ba8:3613:76a8 with SMTP id x128-20020a25e086000000b00ba8361376a8mr5120255ybg.41.1686815320379; Thu, 15 Jun 2023 00:48:40 -0700 (PDT) MIME-Version: 1.0 References: <20230614231446.3687-1-andriy.shevchenko@linux.intel.com> <20230614231446.3687-4-andriy.shevchenko@linux.intel.com> In-Reply-To: <20230614231446.3687-4-andriy.shevchenko@linux.intel.com> From: Geert Uytterhoeven Date: Thu, 15 Jun 2023 09:48:27 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 3/4] gpio: aggregator: Set up a parser of delay line parameters To: Andy Shevchenko Cc: Bartosz Golaszewski , Alexander Stein , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Linus Walleij , Bartosz Golaszewski , Andy Shevchenko Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On Thu, Jun 15, 2023 at 1:14 AM Andy Shevchenko wrote: > The aggregator mode can also handle properties of the platform, > that do not belong to the GPIO controller itself. One of such > a property is a signal delay line. Set up a parser to support it. > > Signed-off-by: Andy Shevchenko Thanks for your patch! Reviewed-by: Geert Uytterhoeven One suggestion for improvement below... > --- a/drivers/gpio/gpio-aggregator.c > +++ b/drivers/gpio/gpio-aggregator.c > @@ -525,7 +580,9 @@ static int gpio_aggregator_probe(struct platform_device *pdev) > return PTR_ERR(descs[i]); > } > > - fwd = gpiochip_fwd_create(dev, n, descs); > + delay_line = fwnode_device_is_compatible(dev_fwnode(dev), "gpio-delay"); Please do not use explicit checks for compatible values in .probe() methods. Instead, use device_get_match_data() to get the feature flag(s). This will also make it easier to scale to other external components later. > + > + fwd = gpiochip_fwd_create(dev, n, descs, delay_line); > if (IS_ERR(fwd)) > return PTR_ERR(fwd); > > @@ -534,6 +591,15 @@ static int gpio_aggregator_probe(struct platform_device *pdev) > } > > static const struct of_device_id gpio_aggregator_dt_ids[] = { > + /* > + * The GPIO delay provides a way to configure platform specific delays > + * for GPIO ramp-up or ramp-down delays. This can serve the following > + * purposes: > + * - Open-drain output using an RC filter > + */ > + { > + .compatible = "gpio-delay", .data = (void *)FWD_FEATURE_DELAY, > + }, > /* > * Add GPIO-operated devices controlled from userspace below, > * or use "driver_override" in sysfs. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds