Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1464052pxv; Fri, 2 Jul 2021 04:35:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdnltfCCObodvKV5OIJZTTCZOQa/r+HKdDWbJfzljr1ENyqY2jGlqAYATc5k156UcspzfJ X-Received: by 2002:a17:906:4787:: with SMTP id cw7mr4773614ejc.160.1625225735524; Fri, 02 Jul 2021 04:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625225735; cv=none; d=google.com; s=arc-20160816; b=naT3n3ltg/T+ZUNh28KbxuF4WsqYsMv9eNRzbE+abGRUdRjK6PNjgPzPgqoACItRoW U6Js7bpavnmSf966aSU78EY5DTmdNV7SjwhlFlqG8k5Ubivn+xOLfM4tWwUQ79QLGsQo zuRmcMsZfPIpqj0Q4kJygwtuiQMTblFXbM+swd9G8lh69I+enDpsUJ0EQBKO9gfdUAg6 GXVdUjvZ2df+1+G9y3jpO+Sh4j73BG1CFy4B+IuZz07Y+h/dI8a6Iww8D8Baq2NM+S2N 5g07433mhtY10mMUqN2JJmjZqwlcgvigEd+Lpd2KzS5gsWv4nafyJJ19I1XB947HKlNz FdTQ== 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=iIW9xe4x4aQCMwRqXHQYOt3TdbEaNx2e5qmhKdjxb0k=; b=m1IUINbkAAAjVzGmuonspQBmmMRCR76jT74sbrVGb4QdVftqrkx9CRyH655+A4fZdC kE9oCwuP6cgqBrY+TuXui0FzyT63l1J99IJbq+rc8NlnQmG9CvBPjbfjClzDa9UUqDtU pK4ybhvNHNvnlonaX81LR9IxODEyNH2kK76wt/jjK7sNr/Lh8QcwaMIqQsETBKV+7LHZ L9h/BiYLiNcgdvK7DXbYDYOj4v9dvN0WhyI+frcD9Nj3ZHkcA8o+96uvAkHZWR0IpP52 NLsY+/lGKfUrVib5EB89PKFKVqp4pzmnYiM8tchQAOYMGYQmlIWTnEugjAF2pV8WOZdj shmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bMrlH+A0; 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 nd17si3147421ejc.732.2021.07.02.04.35.10; Fri, 02 Jul 2021 04:35:35 -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=bMrlH+A0; 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 S231936AbhGBLdo (ORCPT + 99 others); Fri, 2 Jul 2021 07:33:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231145AbhGBLdn (ORCPT ); Fri, 2 Jul 2021 07:33:43 -0400 Received: from mail-ua1-x92e.google.com (mail-ua1-x92e.google.com [IPv6:2607:f8b0:4864:20::92e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB6F9C061762; Fri, 2 Jul 2021 04:31:11 -0700 (PDT) Received: by mail-ua1-x92e.google.com with SMTP id k20so3689374uao.8; Fri, 02 Jul 2021 04:31:11 -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=iIW9xe4x4aQCMwRqXHQYOt3TdbEaNx2e5qmhKdjxb0k=; b=bMrlH+A0Df3/BP+pEo2wMZOGYvjGBmxhg+UBpuVxxXO/iywgkM0xoRAzkw9hU7XG/2 Hur45NL770bDU4iJmMtVUAsyDcBACKQ17v1nAhX5SvZBzH4e15g3s+P9sLjqGapkXQgW tR8/0wAERaU2WGMI2Js6XV957+Ootc8RHNZcm3tqR4//YQ3HfrFerOtXuEo3ZEAhlzzx dMrn03BSZtqZTIk5IsYy/uzYOu0Cvtdhne22tW3dEOlgaA/BWYYbrGNkieL+NQnZw6Om I5NNjn3nKYgLQw8a0jHt5gfr8fnSmnzP9WD2qV0CeWEsmdJQmQb1t0uD7XBn97hlvpy+ +mwQ== 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=iIW9xe4x4aQCMwRqXHQYOt3TdbEaNx2e5qmhKdjxb0k=; b=rb4OrzOG+ac+MQS2a+pXR79EndlqMexgkoBQixZqLDzl14VVEMWm+oDu0g4OF25T5P WN0s8F3eqJuNHzcstAHi1KWB34yKL7fV5EbpuIVGkGIp0VLnFPjyqajiQO9S0AzeubbC LeYKjaoArtXuQaR382bV4/rTMZjj5kFoSDbGRLeP7kHojTx7d0/inrw+dXCu+Hv7xYPC 5STp7bnG6pqad7HjVNp+kI+16400EyVQ8goO/fMq67kkac+GikAK39QD7dWtSHLglBP6 U4bzC4iN6k6pAfo35Od4km6xrMZwtbM+2Pc/Xyzd19FBjrZWvPhtuLmiST2SedOpidew mMAw== X-Gm-Message-State: AOAM530yToeGcDwdKmD5kpEFJXNAGFScwii9uRUlZv0jYAMObuv6BIFH dVsC1VIi0F+nYLcHXgmEqGa6fa6ipo0MeB2ylHY= X-Received: by 2002:ab0:77d0:: with SMTP id y16mr6023131uar.46.1625225470962; Fri, 02 Jul 2021 04:31:10 -0700 (PDT) MIME-Version: 1.0 References: <20210626161819.30508-1-sergio.paracuellos@gmail.com> In-Reply-To: From: Sergio Paracuellos Date: Fri, 2 Jul 2021 13:30:59 +0200 Message-ID: Subject: Re: [PATCH v2] gpio: mt7621: support gpio-line-names property To: Linus Walleij Cc: Andy Shevchenko , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , Matthias Brugger , 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 Hi Linus, On Fri, Jul 2, 2021 at 12:18 PM Linus Walleij wrote: > > On Fri, Jul 2, 2021 at 11:40 AM Sergio Paracuellos > wrote: > > On Fri, Jul 2, 2021 at 11:27 AM Andy Shevchenko > > wrote: > > > > > There are no child nodes, all the stuff is in the same parent node > > > > and, as I said, belongs to the same device but internally uses three > > > > gpiochips. > > > > > > And it can't be split into three children in the overlay? > > > > Original code before this being mainlined was using three children and > > I was told in the review that three children were not allowed: > > > > See https://patchwork.ozlabs.org/project/linux-gpio/patch/1527924610-13135-3-git-send-email-sergio.paracuellos@gmail.com/#1932827 > > Yeah this is one of those unfortunate cases where the DT representation > (or ACPI for that matter) of the device and the Linux internal representation > differs. > > > > Let's assume it can't, then the GPIO library function should be > > > refactored in a way that it takes parameters like base index for the > > > names and tries to satisfy the caller. > > > > Bartosz, Linus, any thoughts on this? > > This would be ideal, is there a reasonably simple way to get to this helper? > > In gpiolib.c devprop_gpiochip_set_names() need to be refactored to > take a base number, devprop_gpiochip_set_names_base() that > function exposed in and then the old function > devprop_gpiochip_set_names() wrapped in the new > one so all old users continue to work without modification. > Sprinkle some kerneldoc on top so we do not make mistakes > in the future. > > This should work I think. > > Any similar drivers (several gpio_chip per FW node) that want to > set line names need to do the same thing. Thanks for the advices. I'll try to make a bit of time to try to handle this in the way you are pointing out here. Best regards, Sergio Paracuellos > > Sorry that you ran into this, I hate it when I'm first at hairy stuff > like this. > > Yours, > Linus Walleij