From patchwork Fri Oct 14 17:54:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 1690120 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=kZhR7KCR; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MpvD42wXbz23jn for ; Sat, 15 Oct 2022 04:54:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230077AbiJNRyl (ORCPT ); Fri, 14 Oct 2022 13:54:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230057AbiJNRyl (ORCPT ); Fri, 14 Oct 2022 13:54:41 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C7726464; Fri, 14 Oct 2022 10:54:38 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id o9-20020a17090a0a0900b0020ad4e758b3so5392976pjo.4; Fri, 14 Oct 2022 10:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=avPRhaqVHvgZmZ8GBsQ+20zIBPkvVr2QT+2++f0G4/A=; b=kZhR7KCRXJWnF12BPar5TJ6Jp7jOQu5oh+cHmvhzLyF05zeCaifFNhGK2RV9jJxsw7 VimZgYTfdukHBQwvv7OanK1IwigLv/d+xhi0TP3zAwnVA6N9Pky4WjZPRXan0Z3MsufV QghtZKG+k2mOjGl0Vg0S/t1x77BZevIUhmuxGLeSWD54IdegSklXCjVAKnkT2Oo/lxWy 2oWrH07lFCfFz6RCEuX6Jkpdeh2zLOt+eRMKV+TxgFflN6h9xcTnhT+iZgpDyxPmGITV pgq28asdkYqtuLzYBAHXMMVsZ9e6VVSZGlgtf3K/gA4Or5CvN8E9zKThvuSlj1BcZEgG QOrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=avPRhaqVHvgZmZ8GBsQ+20zIBPkvVr2QT+2++f0G4/A=; b=tlXApg3FsPBKm8p7ItkyTwX2T1vF4R7JWZTtPpOnZMYcqpvjKT6H8fZT8mYCgvijAP VReRDyBZzgC/xeYF+TBhlpDFSCAoBT9NAvOfWnGvgCkV39uaCs3HpbzB9DYNmNDkIWEe n0UXr+m3NtfyyTRPKDKXyCxVqV3+o+mBaOkuLz5TEFatx42nPhDXI+n/Px0zsAZRB/dr wBP1u7roBeZe9qpzBk5yK/lxNIPd60LJEoWUIc5wpJi5u5aQxQB2Fvnc02H/X0zjf8YH w9yNukL+eXqhTfjsudPnwph7J5MgOSFMGDZMdfrnnflz0MI4I3KSn1DzCjKiIv4bU+Zu wdYA== X-Gm-Message-State: ACrzQf3ksjGajVS6qt2Ro1NqH3CSqkI/xdUQRj3H7ppd9eKkC2GQmCnY CNagtJhDVgiKL7ny8k2uJRI= X-Google-Smtp-Source: AMsMyM5Hzc4Cp+r46/Ag2/jYccuv+/04FsvP087ujnP8b9BZmiBEMZsSts2Cbd5GXI0ayAon/amZ9w== X-Received: by 2002:a17:90b:3c8f:b0:20d:959b:26f4 with SMTP id pv15-20020a17090b3c8f00b0020d959b26f4mr7161668pjb.104.1665770077786; Fri, 14 Oct 2022 10:54:37 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:9d:2:da06:5604:594f:f6af]) by smtp.gmail.com with ESMTPSA id jj19-20020a170903049300b0017f7819732dsm2011780plb.77.2022.10.14.10.54.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 10:54:37 -0700 (PDT) From: Dmitry Torokhov To: Bartosz Golaszewski , Linus Walleij Cc: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Alexander Stein , linux-kernel@vger.kernel.org, Daniel Thompson , Andy Shevchenko , linux-gpio@vger.kernel.org Subject: [PATCH v2 0/9] gpiolib: more quirks to handle legacy names Date: Fri, 14 Oct 2022 10:54:24 -0700 Message-Id: <20221011-gpiolib-quirks-v2-0-73cb7176fd94@gmail.com> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog MIME-Version: 1.0 X-Mailer: b4 0.11.0-dev-5166b X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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-gpio@vger.kernel.org In preparation to converting several drivers to gpiod API, and to keep existing DTS working, this series adds additional quirks to locate gpio lines with legacy names. Additionally the quirk handling has been reworked (once again) to pull all simple renames (ones that do not involve change of indices or other complex manipulations) into a single quirk with a table containing transformations. This should make adding new quirks easier. When using legacy names gpiolib will emit a message to nudge users to update DTSes (when possible). Note that the last patch requires the following change from the OF tree: 88269151be67 ("of: base: make of_device_compatible_match() accept const device node") The change is also available in mainline - it has been merged in 6.1 merge window. Thanks. To: Linus Walleij To: Bartosz Golaszewski Cc: Andy Shevchenko Cc: Alexander Stein Cc: Daniel Thompson Cc: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Reviewed-by: Linus Walleij --- Changes in v2: - fixed 'fsl,imx8mq-fec' & 'fsl,imx8qm-fec' compatibles issue noticed by Alexander Stein - implemented Daniel Thompson's suggestion on tightening configs selecting renaming quirks and added a comment to discourage adding rename quirks without checks for specific compatible(s) - added a polarity quirk for Himax LCDs - collected reviewed-by tags - Link to v1: https://lore.kernel.org/r/20221011-gpiolib-quirks-v1-0-e01d9d3e7b29@gmail.com --- Dmitry Torokhov (9): gpiolib: of: add a quirk for legacy names in Mediatek mt2701-cs42448 gpiolib: of: consolidate simple renames into a single quirk gpiolib: of: tighten selection of gpio renaming quirks gpiolib: of: add quirk for locating reset lines with legacy bindings gpiolib: of: add a quirk for reset line for Marvell NFC controller gpiolib: of: add a quirk for reset line for Cirrus CS42L56 codec gpiolib: of: factor out code overriding gpio line polarity gpiolib: of: add quirk for phy reset polarity for Freescale Ethernet gpiolib: of: add a quirk for reset line polarity for Himax LCDs drivers/gpio/gpiolib-of.c | 344 ++++++++++++++++++++++++++++++---------------- 1 file changed, 222 insertions(+), 122 deletions(-) --- base-commit: cd9fd78f5c11b5e165d9317ef11e613f4aef4dd1 change-id: 20221011-gpiolib-quirks-d452ed31d24e Best regards, Dmitry