From patchwork Tue Oct 3 14:50:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 14872 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2139259vqb; Tue, 3 Oct 2023 07:52:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBomJLwduEhvzPZUcRuyS+GoFBVKkbD1CPy0VxIOdRA3AjwiCLWgZRfqKRkiC1icUtSXi1 X-Received: by 2002:a17:902:ed54:b0:1c6:2d13:5b79 with SMTP id y20-20020a170902ed5400b001c62d135b79mr14406829plb.47.1696344733638; Tue, 03 Oct 2023 07:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696344733; cv=none; d=google.com; s=arc-20160816; b=FSUdMPSxIuxAxyViBtiCKKz4dQ4MZ0QwSP9JcfFgUcowolEatY5W/qjO4CGCJ5mOL8 DMS9f1Gv/2grTzICtQM4EKgaHaL1TdSZ5BLjS9GxH63wEj9yOWMv1nugR5yUZjbi+VGz vZ3s5+xdV9QyIHe0G9jInkkmNCqzALRWipN9hpGRqBk/65ki6Tl89IAQPd6vEUkHagIp pmL+JITwZGvbnElNUKMbeQYNLCoemjA266O6AnXbJ1z9iQ8fp8TS7cTAtCaa8zVGYQeu fce8OSOa7QQAd77QXUm4P39xu0ZvQ4UWAv/x2cFU4mIzUNHS+6kHwKd/BzHdPJawfYPS OaPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=o/W8eJ+0Pcb//fcKPN1AN7H3u5QuqVTPS8j+U5FCs0E=; fh=sFZAJ5ezbypTez9WcxrfVuMim2Eh6JACjzNsyeVATp8=; b=HUtC0kCi2Q2ZChDflTYxEmvglZzbAHQ7dmeCKAuTzlwK8BJadBIcfMQkGt8sUSEoKZ 9QC/sHLtDwc7S2rdc2fRhMvmfgKJWT3+aoQAqDlNxf3YNH1HTVpDhBKpLf/tL+W3n9nN rbXSKqJA/4pGgQ63efneRRUZdQH0wM9ZXd9t/TM7r+Sw33MRiD51x1gXah7Y7Ab6EsOO y4LAMfBdh+sxZwS/ZEJEX7JZHzFvfvzA3cKABTzP77hKZIq6Ot7G6IsexPiF1UbSh30w OsgYO6OV04lz/su69teL+lFTNGtXsi6iY8AMpw9ifOkYqr+DkYmYycP1zwqbQx9B7B3L b8XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=xTgdsRPK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id k2-20020a170902d58200b001c5db1e47c3si1596440plh.553.2023.10.03.07.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 07:52:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=xTgdsRPK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 58EB58135CC8; Tue, 3 Oct 2023 07:52:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240165AbjJCOva (ORCPT + 17 others); Tue, 3 Oct 2023 10:51:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240171AbjJCOv0 (ORCPT ); Tue, 3 Oct 2023 10:51:26 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CC9EA1 for ; Tue, 3 Oct 2023 07:51:23 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-406589e5765so10043045e9.0 for ; Tue, 03 Oct 2023 07:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1696344682; x=1696949482; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=o/W8eJ+0Pcb//fcKPN1AN7H3u5QuqVTPS8j+U5FCs0E=; b=xTgdsRPKiUj1fZecW5rG+L9OGQjI0oZMeV+jiKBC3Wz0ncQXoEJ6E3bFtOTWkawFxi hdfSZTBcDqfbc/tmNsMN/eqnOZ+TlvjBAwB4GlZ3GnGQlHdsHiqip5V8QgQ8GRpTcaEB QyLFO7e11Q0K3yQ2j3jaxcxGGOex4uHtbCme4d/67wrid4e1yaZgr3s7qY6k317a/MsT IpptLibe76ZjD3jsnZmS8PGIJ0Mfwml2Dkz8+sunvYkp9Bwq8fMjlRX5wkyTb+f+oLbC ijqpT00400SwtBrSrA5+Q9cGhEdxDjrE9zO0Zhh9enrRgBtL3B6mMAVFey6z/OVOTYpj XZ3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696344682; x=1696949482; 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=o/W8eJ+0Pcb//fcKPN1AN7H3u5QuqVTPS8j+U5FCs0E=; b=ShRaHfd7LopPcKNCu1vw2ig6N9yf7HZS7tfJQrg5LWQGgXTi4zKEU6nPntcVVNoFKS 6fcE1ECQfCWap7KGYRX+o/HgorPUp5ExoOjbHB6rSRiAHzEEEr6sk04C7xNjunzAkALT l0I23W1A0xN0Bftzv0Ujtv4ovaaLbC9NXH0JZ7Z+4E1d3KOFkYwJfXq09SqGMGgYpBxy YL8rIEHzDGih5whQHH8r7W35rJPmPmg8nPRO4Mo0sDEFVmKYJQq9EN/27tr/q89x8V8u zkukg5I0HHIN0tPLw/4i/bpMt+E8WEyPv8dSTSKgFoRayUCK9iPLYrKi2qdYa8LmNg1+ WUzQ== X-Gm-Message-State: AOJu0YzsdfBn2ezdRdbwWltL1/d12iWdOOiT8g87bXnU7hqIlbKcAv75 1xYjr+isNL2Xoo9DGedEMHPG2w== X-Received: by 2002:a05:600c:28f:b0:402:bcac:5773 with SMTP id 15-20020a05600c028f00b00402bcac5773mr13873968wmk.38.1696344681738; Tue, 03 Oct 2023 07:51:21 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:1f2d:3479:a5de:fa35]) by smtp.gmail.com with ESMTPSA id c15-20020a05600c0acf00b003fe29f6b61bsm1462773wmr.46.2023.10.03.07.51.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 07:51:21 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Andy Shevchenko Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 00/36] pinctrl: don't use GPIOLIB global numberspace in helpers Date: Tue, 3 Oct 2023 16:50:38 +0200 Message-Id: <20231003145114.21637-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 03 Oct 2023 07:52:03 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778746375099706697 X-GMAIL-MSGID: 1778746375099706697 From: Bartosz Golaszewski We have a set of pinctrl helpers for GPIOLIB drivers that take a number from the global GPIO numberspace as argument. We are trying to get rid of this global numbering. Let's rework these helpers to use the recommended gpio_chip + controller-relative offset instead. This work is split into phases: first let's introduce the new variants of the helpers. Next: let's convert all users one-by-one for easier review. Finally let's remove the old helpers and rename the new variants to take the place of the old ones. Bartosz Golaszewski (36): pinctrl: remove unneeded extern specifiers from consumer.h pinctrl: provide new GPIO-to-pinctrl glue helpers gpiolib: generic: use new pinctrl GPIO helpers gpio: cdev: use pinctrl_gpio_can_use_line_new() gpio: rcar: use new pinctrl GPIO helpers gpio: tegra: use new pinctrl GPIO helpers gpio: em: use new pinctrl GPIO helpers gpio: aspeed: use new pinctrl GPIO helpers gpio: mvebu: use new pinctrl GPIO helpers gpio: pxa: use new pinctrl GPIO helpers gpio: rockchip: use new pinctrl GPIO helpers gpio: vf610: use new pinctrl GPIO helpers pinctrl: nuvoton: use new pinctrl GPIO helpers pinctrl: renesas: use new pinctrl GPIO helpers pinctrl: bcm: use new pinctrl GPIO helpers pinctrl: stm32: use new pinctrl GPIO helpers pinctrl: spear: use new pinctrl GPIO helpers pinctrl: starfive: use new pinctrl GPIO helpers pinctrl: ocelot: use new pinctrl GPIO helpers pinctrl: rk805: use new pinctrl GPIO helpers pinctrl: cirrus: use new pinctrl GPIO helpers pinctrl: mediatek: use new pinctrl GPIO helpers pinctrl: axp209: use new pinctrl GPIO helpers pinctrl: vt8500: use new pinctrl GPIO helpers pinctrl: cy8c95x0: use new pinctrl GPIO helpers pinctrl: as3722: use new pinctrl GPIO helpers pinctrl: ingenic: use new pinctrl GPIO helpers pinctrl: intel: use new pinctrl GPIO helpers pinctrl: st: use new pinctrl GPIO helpers pinctrl: remove old GPIO helpers treewide: rename pinctrl_gpio_can_use_line_new() treewide: rename pinctrl_gpio_request_new() treewide: rename pinctrl_gpio_free_new() treewide: rename pinctrl_gpio_direction_input_new() treewide: rename pinctrl_gpio_direction_output_new() treewide: rename pinctrl_gpio_set_config_new() drivers/gpio/gpio-aspeed.c | 6 +- drivers/gpio/gpio-em.c | 4 +- drivers/gpio/gpio-mvebu.c | 4 +- drivers/gpio/gpio-pxa.c | 4 +- drivers/gpio/gpio-rcar.c | 4 +- drivers/gpio/gpio-rockchip.c | 4 +- drivers/gpio/gpio-tegra.c | 8 +- drivers/gpio/gpio-vf610.c | 4 +- drivers/gpio/gpiolib-cdev.c | 3 +- drivers/gpio/gpiolib.c | 6 +- drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 6 +- drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 4 +- drivers/pinctrl/cirrus/pinctrl-lochnagar.c | 2 +- drivers/pinctrl/core.c | 182 +++++++++--------- drivers/pinctrl/intel/pinctrl-cherryview.c | 4 +- drivers/pinctrl/intel/pinctrl-intel.c | 4 +- drivers/pinctrl/intel/pinctrl-lynxpoint.c | 4 +- drivers/pinctrl/mediatek/pinctrl-moore.c | 4 +- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 +- drivers/pinctrl/mediatek/pinctrl-paris.c | 4 +- drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 8 +- drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 8 +- drivers/pinctrl/pinctrl-as3722.c | 4 +- drivers/pinctrl/pinctrl-axp209.c | 2 +- drivers/pinctrl/pinctrl-cy8c95x0.c | 4 +- drivers/pinctrl/pinctrl-ingenic.c | 11 +- drivers/pinctrl/pinctrl-ocelot.c | 4 +- drivers/pinctrl/pinctrl-rk805.c | 4 +- drivers/pinctrl/pinctrl-st.c | 4 +- drivers/pinctrl/renesas/gpio.c | 8 +- drivers/pinctrl/renesas/pinctrl-rzg2l.c | 4 +- drivers/pinctrl/renesas/pinctrl-rzv2m.c | 4 +- drivers/pinctrl/spear/pinctrl-plgpio.c | 8 +- .../starfive/pinctrl-starfive-jh7100.c | 4 +- .../starfive/pinctrl-starfive-jh7110.c | 4 +- drivers/pinctrl/stm32/pinctrl-stm32.c | 8 +- drivers/pinctrl/vt8500/pinctrl-wmt.c | 4 +- include/linux/pinctrl/consumer.h | 57 +++--- 38 files changed, 210 insertions(+), 205 deletions(-) Reviewed-by: Linus Walleij