From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19E9AC433E1 for ; Mon, 18 May 2020 08:20:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBDFE20674 for ; Mon, 18 May 2020 08:20:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="lzCxMPIm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727779AbgERIUY (ORCPT ); Mon, 18 May 2020 04:20:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726800AbgERIUX (ORCPT ); Mon, 18 May 2020 04:20:23 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79BA8C05BD0B for ; Mon, 18 May 2020 01:20:23 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id f18so8819953lja.13 for ; Mon, 18 May 2020 01:20:23 -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=cWBQhzz5kxNoR9BFp0TP6Ch5JEPPhK+boe7luhQX8WE=; b=lzCxMPImw8Rt7qwkKQvXvs4yHXPUCBcSFgZgVKQ1O//DYIZLFdU0vSKui/Goai4MKT xzGOdXpFC6fBYraQ5/bglOKFm4zvdR+GQlFCVvUpk2HQXfwDAcFh1u70fVOJ6VXLasU+ yjC4ArpFTAt05MznUJpxxFnr4qaGbzevmpirg+pnHZQf3hyxYA50KaYPvFy8M4Ix9Vsw 7CmNiCNqtZExlHmmBkup0WtdyjuF+RwTNb9qxejk1O74cyIWT47Mx0yUrBpBhB0w0N/p 7DpB2eYveOkZ4EyHcs+xZJHU8763ij0ME6GnBRSzZ8iCJ3Xg9989Oe0v34IPE6J4mp6U wGAA== 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=cWBQhzz5kxNoR9BFp0TP6Ch5JEPPhK+boe7luhQX8WE=; b=CQ8daCIQpy/Y3ArC27pccMCsuKfVrwOplaFZNm3Tu6CrtJ4h/F1aISPXXFIk+TPRfs oJMN6KfGDB6tpDqHhGUyCAIsb22XBaFCUy4oNuidnV196qKVEX2irQr/k+Ojy6vSIaDz CtgpFei3dgK3veS0KeB4gY87tOD4Kjmop+AWBPU6x+uV5rLOBWXRkrSaT98OzlL0if0S Zjk66C2Eol6GEx314wW21Ms3Q5bN+h/bg66TxAiDnjeAh2WIeAoF8/Z8tIDbH/ymdOnj grLaY1y2OQ4yK/k714ghabaRrGuZWCLsN63k7o0MLdEOcWvbIGjfPKTox5Ja0MDHEdC+ y5aQ== X-Gm-Message-State: AOAM531nxHFo9wjhvkr7cMtEYc5fBHYmf9naC5p9fi70jv4KJkPk9RS6 K3/eN4Y4OihE+B1HJCAXyxyJ2VewqVpSJhsu/ACuUw== X-Google-Smtp-Source: ABdhPJy23lR0seQjYixD1vitkrbudfUoFZ0cFs0uEBn+vezhL4JCCG9kC3sBTizi/2x2WCOoPPUTf8nffzPSq1nM6JE= X-Received: by 2002:a2e:a209:: with SMTP id h9mr10157090ljm.39.1589790021698; Mon, 18 May 2020 01:20:21 -0700 (PDT) MIME-Version: 1.0 References: <20200511145257.22970-1-geert+renesas@glider.be> <20200511145257.22970-4-geert+renesas@glider.be> In-Reply-To: <20200511145257.22970-4-geert+renesas@glider.be> From: Linus Walleij Date: Mon, 18 May 2020 10:20:10 +0200 Message-ID: Subject: Re: [PATCH v7 3/6] gpiolib: Add support for GPIO lookup by line name To: Geert Uytterhoeven Cc: Bartosz Golaszewski , Jonathan Corbet , Harish Jenny K N , Eugeniu Rosca , Alexander Graf , Peter Maydell , Paolo Bonzini , Phil Reid , Marc Zyngier , Christoffer Dall , Magnus Damm , "open list:GPIO SUBSYSTEM" , Linux Doc Mailing List , Linux-Renesas , "linux-kernel@vger.kernel.org" , QEMU Developers Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 11, 2020 at 4:53 PM Geert Uytterhoeven wrote: > Currently a GPIO lookup table can only refer to a specific GPIO by a > tuple, consisting of a GPIO controller label and a GPIO offset inside > the controller. > > However, a GPIO may also carry a line name, defined by DT or ACPI. > If present, the line name is the most use-centric way to refer to a > GPIO. Hence add support for looking up GPIOs by line name. > Note that there is no guarantee that GPIO line names are globally > unique, so this will use the first match found. > > Implement this by reusing the existing gpiod_lookup infrastructure. > Rename gpiod_lookup.chip_label to gpiod_lookup.key, to make it clear > that this field can have two meanings, and update the kerneldoc and > GPIO_LOOKUP*() macros. > > Signed-off-by: Geert Uytterhoeven > Reviewed-by: Ulrich Hecht > Reviewed-by: Eugeniu Rosca > Tested-by: Eugeniu Rosca > --- > v7: > - Document non-uniqueness of line names, > - Rebase on top of commit a0b66a73785ccc8f ("gpio: Rename variable in This is likely the most controversial patch of this series but since noone seems to be especially upset, I think I just accept this heuristic. It is pretty clearly cut I think, and fits very well with the aggregator use case, which is an important one. Yours, Linus Walleij