Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp366460rbe; Thu, 29 Feb 2024 01:42:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVCljIC9pGBXhYJuhcUTzHyx2tXECvakN7eFy3LOcUHn/myI64XZQwT/BjxUKYiqT4054wXdthGxYZgh9/Qp3tZTGa4KdiKqXb7M0rQgQ== X-Google-Smtp-Source: AGHT+IHdTvkaWMANz1+kxdi7Ro5xZHIk2OfXIKrvD2Vu4o495lLlOt7Q45Cptvw+nYMygPIr/kI5 X-Received: by 2002:a05:6602:4913:b0:7c7:da5e:3a62 with SMTP id ef19-20020a056602491300b007c7da5e3a62mr1953193iob.13.1709199775784; Thu, 29 Feb 2024 01:42:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709199775; cv=pass; d=google.com; s=arc-20160816; b=047j5ZKYPIb0gutBaCc2fEpT8WVVl98BIsOq4FwqzKzbUmAI5koQRVahDUTxUVfXCY GdktUCEIwxKBlDR9vNZd+QXqutSNdGg3xnA3hceJQK75J7Dw6nlXzyJEu91vNF6cIe+l dOwZukvM0k22wBpPV/tTbgiKKvX0OEAjmz7myLKT6MuQjhc1o0+tibP0tBcNJ04DSFGW OvmhH7LD5gJOEcla/WMPg2pD0k5FPlrZpT0CaMM/clRXZWZ7xa18dfYBatlYOxBTXbLV vMqAaX3ZUiynez9cmOnRnA3L8DNENLlN0sUquEsv9c2m9CQNV1zICSUPMLUxGJxVs0ml 8zsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=TA5XDR0sixwyfoYxqxJ3AVyk4Nya6rVcdVMTi766fKQ=; fh=Nl56tb5dtJAslQhdw8rnJXPSWpjWsJcvn7q0nP/L0es=; b=q0/C9pJsaoQ+YH/ZkZS8kSseYBXQdafNe2GW2mb+IVsofbjoGl9voMgbkzB1+ZGvoe H8ay+Ie3bX+dZrnt6AFRPdBA1ScGegOD7RBQX0TKPAwkqA+pYUzCjrDQonpoZXtBlLLL DXpHg/jIDZlWIxk1b75bkYj/RGoRUp271EWDgwDGcL85ikf91mAhNgciluWo8cwxlCz9 A8qrLuWOEb0/8JffZy2oary8hS9rybsJq6dMVArGx8fh4IrvAPlIPLl0o1mc6DgVUMW2 zU3oSAN2Ucpe3Ujpdpdn7K1N4G2qA4Amn9X0Hd8jdnvFv5pkK2jbNeM2Gv1QqZKY6hn9 O7zQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nFkqfJvQ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-86434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86434-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id v13-20020a63480d000000b005dc4328dc23si1037593pga.780.2024.02.29.01.42.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 01:42:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nFkqfJvQ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-86434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86434-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B9209B21D4C for ; Thu, 29 Feb 2024 09:33:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6EB7E5D906; Thu, 29 Feb 2024 09:33:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nFkqfJvQ" Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1158F5D8FA for ; Thu, 29 Feb 2024 09:33:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709199196; cv=none; b=tfW9p5ionUnuo4L9ng3WDEzxaHzC8XzUQIZNGWQNCFpOqjujHcEICOOwqV2JOQdOcn1vDGdYy1Hcrpa8pI/1/TsZI2S9n6Mi8cCV2m0XbjpvWclS2C1BG4XuRK/R9i7NlTpE7kBxA7bCgQY/blpxAXQZGHU7F2l8+dfqpFYQlWg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709199196; c=relaxed/simple; bh=TA5XDR0sixwyfoYxqxJ3AVyk4Nya6rVcdVMTi766fKQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=fr1sVAt40k4xDkdbjLU5T0tRzdrB9Unsp+sXH+MUsIvbbxkZAIaI6x7vkwiXz/weuSRvj8e+WduqBAKo02KyOz+E6MWvfoaoWIF+7yblD8rPuAd9lyzYcrsvVHpvKxxuV/4p47eWeeZ6geanvF4MxEUCk3eblLFkDqkOti+lUYk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=nFkqfJvQ; arc=none smtp.client-ip=209.85.219.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f178.google.com with SMTP id 3f1490d57ef6-dcd9e34430cso745925276.1 for ; Thu, 29 Feb 2024 01:33:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709199194; x=1709803994; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TA5XDR0sixwyfoYxqxJ3AVyk4Nya6rVcdVMTi766fKQ=; b=nFkqfJvQwFs+cxOrekeldas6aoDkkenIwcmU6e7vjZu9qZ/Xt01YdsdMlX5PJE+wF1 FKC9RHavdw7abnQhAQF9nF9cqLj5LuKrhCLGBUIluqeXWrIPqbeiV8COJ6eQHfaYiJi/ /e5g+q92Iz1j5AxoHXRfXlsxBlWEfqZEmNzwJiC4b21+9Egwx7i//D7rwHH8Fo12lING HqlUsg7fIMUIHrpFhUCOgvnpRmlk/jurq5+XvQwktDfwnOkBTfeoKVMO4YHE25s/vYW/ OYub1WhyeV8XYVG/vewgNd7EHn55TihvNMg5TTXL2FXq9/ekgqnNJw4Ube2x15649p0K HPuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709199194; x=1709803994; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TA5XDR0sixwyfoYxqxJ3AVyk4Nya6rVcdVMTi766fKQ=; b=s4jtKkdb+BUS8Rwv6yvnkKC4MBZyH8h2/gicRNHM71f6dxZ2tdSTuBl8XcmeArbGZj FvfF9AjsJpJT2AFUW6kX9klxS9Aym+WEkTPt+DDkYFeUtNiKOs4SE8KKX06ToFScwPv9 hk9wSmdHdSpkv7f9K+LVdEZpXdP/sPK4d/qiWUPatYcIqOOnRHFagVBNe8eMDGcsRb1T PawOoFUbAq2odzPL2tCbolIcO5ICt/9tw58mkgKTC2FB1AgUAf94bCM7/wRI7M1yhvRB 9H78Utcj3hid86sd1aakuHXNgyF7v3AXwQVDFumjMNITr4f7Fz3guQLJ5Uf7rnVtzj4z dKyg== X-Forwarded-Encrypted: i=1; AJvYcCXwssk9Oln9ywb92Ti1icr+J8zb50IXraP5xa4x9b0DBN8imFnZQupo/qpbWHv5KB0ifVn+WMjSWj6DsM2HOeYFIWNUJGikjXwE1XMK X-Gm-Message-State: AOJu0YxWSfZqVJ98HH2iNSNIGK6tn8f+dFQ6bqwfLdPPJ1hHsL4/eN0w pyD+ihnYbd95rDWhLLfs5G+8W0n0XpdsmWMOnfGr9wZl4nW+UsnPF+XU+G3FrkGfZlrWdEMWEZz JsJ25WskcH8c77DfDYq9KCbkV7R25O/WqkBXeJQ== X-Received: by 2002:a5b:f05:0:b0:dcd:aee6:fa9 with SMTP id x5-20020a5b0f05000000b00dcdaee60fa9mr1802025ybr.53.1709199194095; Thu, 29 Feb 2024 01:33:14 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240228-mbly-gpio-v2-0-3ba757474006@bootlin.com> <20240228-mbly-gpio-v2-19-3ba757474006@bootlin.com> In-Reply-To: <20240228-mbly-gpio-v2-19-3ba757474006@bootlin.com> From: Linus Walleij Date: Thu, 29 Feb 2024 10:33:03 +0100 Message-ID: Subject: Re: [PATCH v2 19/30] gpio: nomadik: request dynamic ID allocation To: =?UTF-8?B?VGjDqW8gTGVicnVu?= Cc: Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Thomas Bogendoerfer , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, Gregory CLEMENT , Vladimir Kondratiev , Thomas Petazzoni , Tawfik Bayouk Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 28, 2024 at 12:28=E2=80=AFPM Th=C3=A9o Lebrun wrote: > Move away from statically allocated GPIO IDs. Switch to dynamic ID > allocation. Static IDs are deprecated because they cause issues when > multiple GPIO controllers are to be found on the same platform. > > Add a bit of complexity to do pin number -> GPIO chip + offset. > Previously, bank number and offsets were retrieved using division and > remainder (bank size being constant 32). Now, to get the pin number > matching a bank base, we must know the sum of ngpios of previous banks. > This is done in find_nmk_gpio_from_pin() which also exposes the offset > inside the bank. > > Also remove the assumption that bank sizes are constant. Instead of > using NMK_GPIO_PER_CHIP as bank size, use nmk_gpio_chips[i]->ngpio. > > Signed-off-by: Th=C3=A9o Lebrun Patch applied! Yours, Linus Walleij