Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1418235pxv; Fri, 2 Jul 2021 03:23:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0V71of+8doZyKjI/s2o/XBuctuteVJbxfqgsyODVMSp1S9hFr8ANn+K0QGm7bDkHPK4K7 X-Received: by 2002:a05:6402:2815:: with SMTP id h21mr5972777ede.150.1625221417454; Fri, 02 Jul 2021 03:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625221417; cv=none; d=google.com; s=arc-20160816; b=U1TEDLbUs3/BrcdULa1+YpgIg6AnS72NNVAlKQ7j/1+/0wwaIZ6l/XnQysiX8E+W+y dPyc8mHdXtRsowWbb1Y/045bobpSoOercWHjwm+ttLgAGB7UiqZUcftujHq00nk2NVdH tZDmu/UvLR3GoZfGbhJW3Nv4EkzF4pRy2dbQyRfajZGW7+lbyqU5d+vo4Oei+x4a9lLy hP07tFQhbUJU9hxlDTceUVYNMZVoUargL4q/67St+qjKNoNEUQCCk0l6qFffRI146YOx RHRPINL+c3u86DkkhiVCqfHZ67qvtWJ63rgH1GxIIFB7VjyQ9ob8tBLXKYE5lhHV6sSh +hkA== 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=dyD/pAf7kMsskV0+zA8WGcmiKArOOY/L95px7mtP6FU=; b=VSWq95sCu5/GUODsjN1NFbXTPn56sMJVir1JQPgnn/fr95KTa9kzZ1PzEvJXEPfgtt Rl2ETBYNlAV6GRKv6jhn9pHDBd9DCKv5fYMqAxBREWY+O8iKpHd3paU8K4x9bjHrcg2G 8R1L5I03kya2lw1yA0mk7nx2WRBa6139Wy53EVqJbHzxrOcCxCMzqmpHtujgkecfAGOt w2Z1PtcAMx1D/b1xKnpNk7830tGTGM8QF7XT53SSJTmQcn04ouYNsRZn+wt23LTjPgtG ha7FKPtJhDvJ2951WeOMR0/K2mqxqXe8Vp8b7jOpNG+XRFG12N1FD9tNfx4bwqnyV1L0 PL4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AhBwhdH7; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si2418041eds.153.2021.07.02.03.23.14; Fri, 02 Jul 2021 03:23:37 -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=@linaro.org header.s=google header.b=AhBwhdH7; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231816AbhGBKVQ (ORCPT + 99 others); Fri, 2 Jul 2021 06:21:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231912AbhGBKVJ (ORCPT ); Fri, 2 Jul 2021 06:21:09 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8089C0613E2 for ; Fri, 2 Jul 2021 03:18:25 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id f13so12598503ljp.10 for ; Fri, 02 Jul 2021 03:18:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dyD/pAf7kMsskV0+zA8WGcmiKArOOY/L95px7mtP6FU=; b=AhBwhdH7CNdLp1cE+ZhUB0DHi6mDv6VbpKXfLf4JvzWmmfYm/TI+2bw7U+LgyXu1wc 6awmzYWKIb3DjOoRxYQM8VcvYywiy0Q7RHU01UIqTMSY+ygRMPsoxgsOnJOtOXdShstX 1zZBqkrB6qvf3qcm9nd7kYWhU0mArnuU/g/C/ZcM2tn4Oy6w4ikH50YCjHM9jegKoC8I mp2vL2Jb7fVnKo98AOjEuf/VLymjk1spwwIxn+wOCy8xCwooYzBHtOUh+GKs7fkMDMLx HhdtZl2yQo8xkywXWNG66ckluOxJfxItb3exIXQXgsnEWRqQUu/KhQXqPNui7nhKKt/g FDPA== 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=dyD/pAf7kMsskV0+zA8WGcmiKArOOY/L95px7mtP6FU=; b=pxImRUg2ZeysRjISI9Syj43fInMzrvPKcmwG1yfd81fJqXG/eV2wQ8Ls2CQer/Ndvy tVV3+2KprzZEfzVBjDcUqdqQbs2pgO/oBtJNdmgFWP0//rNa5bSz3ZRTA5vxXBVqpaqp 0I0OcpCGDihYziXXYjOa4I/ZAKLMsKix5BASVGzFV2dgZYiK7qYH19sshcYklbnLFUW3 nfEny7vIJtoTunfi/33asB7EAjQGEOE7nfLD8KDRHCLw3OCpmfbAO1iBQhJ/cAVq9g1x Us/UdLsg+JNVNhG4UUJxbBld+gWCYaSazuaSmGFVfQ1y+qMMEUJXnU7KrN+fGO+5/fRF op/Q== X-Gm-Message-State: AOAM530fewKWt3HHMnFrJ5IZVH4qcYIBJvjTs7+5crQCrcVPACyn5SCs Pb2A2O9o84CpBn2PdYFPqGTalw4UdkRyYZjV5Oeqog== X-Received: by 2002:a2e:9d15:: with SMTP id t21mr3274629lji.200.1625221103869; Fri, 02 Jul 2021 03:18:23 -0700 (PDT) MIME-Version: 1.0 References: <20210626161819.30508-1-sergio.paracuellos@gmail.com> In-Reply-To: From: Linus Walleij Date: Fri, 2 Jul 2021 12:18:12 +0200 Message-ID: Subject: Re: [PATCH v2] gpio: mt7621: support gpio-line-names property To: Sergio Paracuellos 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 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. Sorry that you ran into this, I hate it when I'm first at hairy stuff like this. Yours, Linus Walleij