Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2623358pxv; Sun, 27 Jun 2021 03:54:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQpPre/4E/c+6HAse9l8WGNbE0H0A86FkvQBXeRzroClzZaRQnuujowRUEPgXKpEMsO5hQ X-Received: by 2002:a02:b19b:: with SMTP id t27mr17701059jah.29.1624791285771; Sun, 27 Jun 2021 03:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624791285; cv=none; d=google.com; s=arc-20160816; b=erEtI3z/BFxBmFMisFDgHgn6Pu70yWjgRS4TWhZ7dmM1mWP0MxdOzmFbx+oyKAkECO nXKaScuyEnLPifyjsXpZECaGAgqrOfjVLZR3y356po5MuQQTf8vqti6dbXb+KUvLNH5G 0RFUowh/30BdIim4QvnKoPfAbCR43czeVi0MfptL95qmu4PoLMJ35Wm/P7M2XlSoCRkX HQzUBa0p+B+7B8Tn41a/1fcdrVKFTAeu9kEZi4ePsECsZFmY1GJ21qiBT9lRDa2OxHW0 STZCtfR9n/xAzYVJNzhq1NHQzqwk/wWymTkpvbUG0Esc/cvfjAhCaaU33YnNh8oJBUZi jNSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=odbYzxWNNlBWNEmkbiW2x88ov2VmYu03Mtz+ozyCCyE=; b=wVSANBBdgioZygIlwIMTIbt10eVI5FNrOYm3wk3cVi9mPfr67C0E4TUqQQ+R0YLVu4 IfC+ccqmdKLfxlQyWSFfuatRImEQNOdtPbbV88O/bb67wYF5xHPzlWZ7K6PoOVI9LXpY s4UTDGa5Vhd+dYlHRGTq7c+p6H0RQDrhUQFOT5syyO21e3j+uY+WDhEeLxrgExB4cD61 RrIo9cWf+bfP1/v8B7rY0jv9n4q1fzUlmr0mRKr7ff2cpwr5r+AtlgxXAxIwVHN2P+9X i8IG9WQ3ftEe9mEc3Vl5zN3990MmSLXSehvCUsKYElIUy5F+VHk7QCZ01lFA0AOn1yaJ MRLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QAOImcuf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g25si13458683jan.88.2021.06.27.03.54.34; Sun, 27 Jun 2021 03:54:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QAOImcuf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230103AbhF0KyZ (ORCPT + 99 others); Sun, 27 Jun 2021 06:54:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbhF0KyY (ORCPT ); Sun, 27 Jun 2021 06:54:24 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 044ACC061574; Sun, 27 Jun 2021 03:51:59 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id s14so10294166pfg.0; Sun, 27 Jun 2021 03:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=odbYzxWNNlBWNEmkbiW2x88ov2VmYu03Mtz+ozyCCyE=; b=QAOImcufoxH7Cv+ETatOX2gZNjmDO4AGxCael1lP1WXSnuKkrmLIcGoFbpq/v0krKI MTPwuy4kFYd27HyW+ijbFsiP5oge7Q6OnXIFtz0reBifBjL2rPhxoMpHHdIrcOYxvYOL bvWwVH+GD4BBBOKbjCKbr5h60Tlf0h083YcVg7lc06fBkfAFZYkCK1tgS1daQz3zSqSG 0rREWKjZ20yGEIatZox64sb7bRoBkZYg7zYYHrTPiTVu/yJQpqACnmcurHQqKBpJ6/O7 ptolcdgqMIeIpWBGK5EHDHoSOPHDjn0F94ox1tYTmmnaOQ5N0caVX4AoItxt22wJbVrt 4XxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=odbYzxWNNlBWNEmkbiW2x88ov2VmYu03Mtz+ozyCCyE=; b=UULsKQ2jt6yMDztTWFcR2+G1wiav8IzkURAGmLBF72fFglQ/QawrRFxlHnZkZS6nwl 7BMoUrhZxj5GQTHRkKLU/PAbTPJoioAzYC2Ytdwu0QrdKlI0mkX1aNKJi3MaLs/EU/rA 4QR1dOnIu6EfoajxXHGET8BK815jZhfGBhrSZgPHSTYDZMB7SRTofVacuC4myIKWvfhb w2AzKFUTwUxgx8Jd5XxWs88Jzks9Qq/++TSz9aj5gaUdBRUUmoA8mcSIlHTz7/v68+5y 3dpNKD48/IRHKCFZ05tDx0HukaNOGoulAEW5bR0P4/DfzHDxhnhT+ZainXrGH4ymnmk5 +m9w== X-Gm-Message-State: AOAM532tAZdc6i7f5Gg1PbUpUcqjagf0YoWamVju7zqwGCazB4c91noE 9obdR8xKoxPZIpUkgxgqZxzjW6o2mprw1S0kEaY= X-Received: by 2002:a63:df10:: with SMTP id u16mr18332313pgg.4.1624791118640; Sun, 27 Jun 2021 03:51:58 -0700 (PDT) MIME-Version: 1.0 References: <20210626161819.30508-1-sergio.paracuellos@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Sun, 27 Jun 2021 13:51:22 +0300 Message-ID: Subject: Re: [PATCH v2] gpio: mt7621: support gpio-line-names property To: Sergio Paracuellos Cc: "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , Matthias Brugger , Linus Walleij , John Thomson , Linux Kernel Mailing List , NeilBrown , =?UTF-8?Q?Ren=C3=A9_van_Dorst?= , Nicholas Mc Guire Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 27, 2021 at 12:47 PM Sergio Paracuellos wrote: > On Sun, Jun 27, 2021 at 11:33 AM Andy Shevchenko > wrote: > > > > On Sat, Jun 26, 2021 at 7:18 PM Sergio Paracuellos > > wrote: > > > > > > The default handling of the gpio-line-names property by the > > > gpiolib-of implementation does not work with the multiple > > > gpiochip banks per device structure used by the gpio-mt7621 > > > driver. > > > > > > This commit adds driver level support for the device tree > > > property so that GPIO lines can be assigned friendly names. > > > This driver has three gpiochips with 32 gpios each. Core implementation > > > > implementation > > > > > > > got gpio's repeated along each gpio chip if chip.names is not assigned. > > > To avoid this behaviour driver will set this names as empty or > > > > the driver > > these names > > > > > with desired friendly line names. Consider the following sample with > > > minimal entries for the first chip with this patch changes applied: > > > > The same comment as per v1: > > > > Any idea why it's not a duplicate of > > https://elixir.bootlin.com/linux/v5.13-rc7/C/ident/devprop_gpiochip_set_names, > > and why the latter is not called in your case? > > The core properly calls this function but not in the way expected. > This driver implements three banks of 32 gpios each internally using > one gpiochip per bank, all of them in the same device. So the core > code you are pointing out here duplicates the same names along the > three gpiochips which is not the expected behaviour. So implementing > in this way and setting names at least reserved avoids the core code > to be run and also avoids the duplication getting expected behaviour > for all the banks and each line friendly name. Isn't it the problem of how we supply fwnode in that case? Another possibility is to fix DT (although I'm not sure it's now possible). Have you considered the above? -- With Best Regards, Andy Shevchenko