Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp964548rdb; Fri, 22 Dec 2023 10:01:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHoYeQpR7cwl4xVCb9JTRNGI0dx0QYbU3zB/e2isy3qrkjudl4XJN1CM+qu+7u97Kh9GVA1 X-Received: by 2002:a05:6a20:769d:b0:195:1086:b2ec with SMTP id k29-20020a056a20769d00b001951086b2ecmr981712pzf.125.1703268115870; Fri, 22 Dec 2023 10:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703268115; cv=none; d=google.com; s=arc-20160816; b=ZwMZhaJIJXdDWc15xL74SgKU/mJsJq43ExESQ/0lPFwOe+x71XVijulsZ/G+GzcJW/ Acn5iKTXhUOaM8IpdpjsgPLITSBThd6nnXKaLb3d02Vh459GJeO6bxkEYy1vSenUWxd0 w6YtFyN+ajVhvNMUt1yJlECbV7OoveufZc4hqyPIBKbEuV+Hc8Nc2EnucxH1/5PSHAs3 JV74U/NBS9JKO9CUTht1bWdHQgfPwbysZpMbMCeXT5KbDKDfdp83P5D3VAXNu0jvyVg8 b9FWfcpQbkDmtPYBZ7H0HPZdrrwVv5PdTK4eto6jLDtzcYECdlVLedtMEx24iTivTl8O 8iCQ== ARC-Message-Signature: i=1; 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=gXO5LLAj4QYxQv9ZV22GFZ8aR0i5IaDWjNJqzoS+Cu0=; fh=072LNsnW/zkq11qD4U6nBn62VfoLG5pYV7mAfczolMo=; b=ouojsBdfpYQYVogG+Ega47fugePjqJdhdUgu/z4Ce9oh2iPQ2myb+uOR3saf5mYxgv 2xP2UYSxwyO1hQKrsI0w6ZmBMVosX9xNt7NuEfS57qk3UkyccqMf24IpF9LVjsRP4bEi EvHTHaXlytVYXFbjUblDK+2qKCemvzDhhu2HNvk0oJsnzLvXocl86IySZiVzIp5f8Quc QXpx5vduH4bpIjKjOtBxAcE2pZQhdMxPy1RJB8d2hFh60vdVOHBPfjm33NC9VevG5oJC t8mrgUetFGZgVoKZUx2Nqe3HPNl8yKT3u8YAasfyp3V5XYcVL6Wgz7xXZLJndfzO4RiV +clQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IWCDRfnG; spf=pass (google.com: domain of linux-kernel+bounces-9991-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9991-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p26-20020aa79e9a000000b006d4d439e6f7si3522860pfq.391.2023.12.22.10.01.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 10:01:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9991-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IWCDRfnG; spf=pass (google.com: domain of linux-kernel+bounces-9991-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9991-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 374DF282E78 for ; Fri, 22 Dec 2023 17:59:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9EE22C195; Fri, 22 Dec 2023 17:59:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IWCDRfnG" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) (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 9C2AD28DDF for ; Fri, 22 Dec 2023 17:59:04 +0000 (UTC) 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-f172.google.com with SMTP id 3f1490d57ef6-db99bad7745so2042001276.0 for ; Fri, 22 Dec 2023 09:59:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703267943; x=1703872743; 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=gXO5LLAj4QYxQv9ZV22GFZ8aR0i5IaDWjNJqzoS+Cu0=; b=IWCDRfnGHAQI/ws9Sv/cnQ4kxPhM8LA+mYyOMnTw6RPTWt0EJ2fHMub6XvTJwEKZK5 4QJt3K73GS2qwgu3NshjdY8h5AKpaHy4owVd+TECP33AWQVRyiQQUD9ibtRy8wEW+10y ZLxFb0WB0bRuiQReYe/M/yxlTiQMOgTGR+gK0o0/y14uTSTMVOi4hkCqYwRftu0uao2h gfDpTWYmDwZgOAcbpj1cTGkjG92lQKlZxWpLkvILBQkSdo7SxA0u5+yfxmC68La9ssud F9sYklpvgMoW/6A6AXEaeJ6NxymLvVxEI/hgW245lM5bbt48b/JG6ZGbbcmhcDyhplXo Dk4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703267943; x=1703872743; 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=gXO5LLAj4QYxQv9ZV22GFZ8aR0i5IaDWjNJqzoS+Cu0=; b=jWsL4kxoiNleQESaQuoZQJO0JKHyxA2Q1OeKqoK/Pe1PLtzq7REzWscEw5M8wbOrVM LHVHfWubCVeKoiX08fi1OOilnPzVtsqQyhRcBLP0Bq39Vq2rJUCNqK9pUlFs8ZtBwRkA rmGXN3/ncfVDVPXKX6WDYPIq74bDeLKKI8xhBanIkSxmS0rMjkDR99Tl6UDFKLU7DV1N Yo2gzBgNwlUChNF1i3aIc9ifuKTTmZfLikBuctI1NXyd2lfc6XKpardck7pytY3Qon8G GaGHPqtdElOis57QpSORxCXT63P9fxNzUyZWYr2Kq2Qx/iia2GJ0M7NIR+NXupEMn9+i XRjw== X-Gm-Message-State: AOJu0YwU1/V9mQMOvdFnXKKeevsHdETUDbNlQRFh0BPar7sHdjNlGyLc gzUSwL+gs0AfDopbkMN8QKIIQOYFB32g8q1pCoJ9j57Mxt0LAQ== X-Received: by 2002:a25:d606:0:b0:dbd:d3a8:74c with SMTP id n6-20020a25d606000000b00dbdd3a8074cmr1266996ybg.48.1703267943739; Fri, 22 Dec 2023 09:59:03 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231221083622.3445726-1-yuklin.soo@starfivetech.com> In-Reply-To: <20231221083622.3445726-1-yuklin.soo@starfivetech.com> From: Linus Walleij Date: Fri, 22 Dec 2023 18:58:53 +0100 Message-ID: Subject: Re: [RFC PATCH 0/6] Add Pinctrl driver for Starfive JH8100 SoC To: Alex Soo Cc: Bartosz Golaszewski , Hal Feng , Ley Foon Tan , Jianlong Huang , Emil Renner Berthing , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Drew Fustini , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, Paul Walmsley , Palmer Dabbelt , Albert Ou Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Alex, thanks for your patch! On Thu, Dec 21, 2023 at 9:36=E2=80=AFAM Alex Soo wrote: > pinctrl: starfive: jh8100: add pinctrl driver for sys_east domain > pinctrl: starfive: jh8100: add pinctrl driver for sys_west domain > pinctrl: starfive: jh8100: add pinctrl driver for sys_gmac domain > pinctrl: starfive: jh8100: add pinctrl driver for AON domain To my eye it looks like a lot of code is duplicated between the four subdri= vers. The pattern from other pin controllers is to create a file with all the com= mon code and then subdrivers for each sub-pincontroller that have their own probe but calls into the library. C.f. drivers/pinctrl/qcom/pinctrl-apq8064.c: static int apq8064_pinctrl_probe(struct platform_device *pdev) { return msm_pinctrl_probe(pdev, &apq8064_pinctrl); } And that function is in drivers/pinctrl/qcom/pinctrl-msm.c and you find great inspiration in the qcom Kconfig and Makefile and drivers/pinctrl/qcom/pinctrl-msm.h that you can copypaste to pull this off. Maybe you should start with a patch that extract the common stuff from the existing jh7100/jh7110 drivers and then reuse that for jh8100? Yours, Linus Walleij