Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1439307lqj; Tue, 4 Jun 2024 01:14:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUcX/nZgcNuZIV1ssDmOiFINgqRn2wFFg6JgPByMosx99h1ijvTHIo/JmxNmQa1YjniiuQSSy8Y/Ex9RTMYpg2t/lgLNikMF9e0qgnP+Q== X-Google-Smtp-Source: AGHT+IFLe2hWH9FrXVSg5FW+ne/LxSff0L7irmvvaK4M9aQtmKCYQA3GGV2yhrvhC6Kll4QTV3qd X-Received: by 2002:a17:906:fcb5:b0:a68:bd86:bc7c with SMTP id a640c23a62f3a-a68bd86c3b9mr486936366b.14.1717488840776; Tue, 04 Jun 2024 01:14:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717488840; cv=pass; d=google.com; s=arc-20160816; b=NWrnUfT//CCn5ItLgT3GthdozmJJB3dzufbMwbif3NXThSocZVJRx3Spp6M6KTf3JI wsFbmSrW1JussgozkdwOrAVaIT8R8EiP0yLFfqonS1Z1JaH5TZgRCZwx1IL7KiAgRqnq WNqp4Xm36mAYdbFqSNItaKN/OIr99ncU6Klah8WZUyH/zxQzdbuk50d5A3XRAPfJkU1i xucAlYjmUZ8vPoiaHH9chdbfgCTgykqig1W+XiyMAJrTRMK0H75zpZPbIzCx+2zs90Ye 7W0cpnCMH/arE7J60VPPE4aOmt5eBkcFdSj6L9UeL2pt2AWZbEMJ9B6lDw5NUKECc0Jh lfPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/osOaeGzL7NBtD1GUS86QPUM+BgjTKgchC2AVQ2xiQM=; fh=L8QE70jmiLFqKlIP1cDhgZMc68/i9Z+9isALDTBPeKU=; b=EtcCFXVwMySU+wBQhNYymCsrZ8HE/oLrv1fdnSQPYggiajQWDMfRNV8L7wBJfBgRLK xCKbAXPa+jxbN5YxOZjsoahhZfNTF77Xhpk3xWmKTt93M/AfBZqIAJ1OT0uZBgEWDKtb Wl7wFvUdvH7xxbN8cH1Y+cE1oemj/38DCTAo8qKzwjnpDSy9sgnUw0Mj9MaEsmZ9a+AA g/6F3nE4fAhycoZ2XdGktGfO1NbzQxCLqh9QfQXyGMvouPKd1MArUNGIBpkSo+F0+VEd TgVj76s8eqRZenDry2jkTYZX+sMInOShFSbWoMxS1xXuOZLrNV1vG4Yg4wd40mIo9GO/ z5DQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hZVKQr3E; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-200201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200201-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a67e6f02b88si477842966b.50.2024.06.04.01.14.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 01:14:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hZVKQr3E; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-200201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200201-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 458181F255F0 for ; Tue, 4 Jun 2024 07:57:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F13514375C; Tue, 4 Jun 2024 07:56:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hZVKQr3E" Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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 BC3B4143880; Tue, 4 Jun 2024 07:56:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717487771; cv=none; b=Nq92dIK3wGM4JepbfDK1OVAoP5yCIaL57M2j1/XcoCf0wPdJuYpevgMJSPAg2k9bUopGURo7VCKaMgFhXyfVkB0ZKwtlKlWKHdKQSFHiaE/hSROZYJPMbBlnAOo1y7mnjvRylYom+EfwyGRyfPAPkcufx0z8/nARKgDpDwPtNfw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717487771; c=relaxed/simple; bh=Th2X0P0NR+EYfy5Fht2yUCRMhtyLvZfQvaqQZUcH8hU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KcJ6mHwKsHHEJbOwfFE7wE0NxKoC1KnpMqqle/CqHlaQQHJy7Ck7t7SlvklWG9g3vewrcBAOFVo8STfwMwCw0qF/0LQkAPig6q5bywTHhTBFyoSKZLCnDSH9ATBNDhtMcc7tjtj79NLGOwekVrq1Dq/KB85kkSw/6nB6zHqiA+g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hZVKQr3E; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2eaa80cb573so37038751fa.1; Tue, 04 Jun 2024 00:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717487768; x=1718092568; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=/osOaeGzL7NBtD1GUS86QPUM+BgjTKgchC2AVQ2xiQM=; b=hZVKQr3EdJEtzrm5qLr+F/R1G4p4ENvQ5vAkmbmNgLXQkXOhDf8phNbZ1ZYBdKCDi7 IByyIADosbKfjPMpT0r2stJXbNrbqz1axlfwnG5hJJJD5GMCsL2cdAlqbRvBkqL2sPy/ zhJdVf/oazhqDqaorWyb6P0BImzlrRpm5Li4fdiRxz3XS3DCeYCPL9b4PJ12mGCGno9/ Ay0N+l0Ej87+yq6Q4OxLXwjnq2H6QkNUVzO1L04Ijqv1eXn51qehNSnVRiRMYUNhedfD L/ApZfbFv+6zTho0yBIT18uTUI+2Kh8IZvYbBgSS50vVcEYQ12Z6TjOzW9qk2B06DseO u5Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717487768; x=1718092568; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/osOaeGzL7NBtD1GUS86QPUM+BgjTKgchC2AVQ2xiQM=; b=pshD/sMeLtiiQkTqZlP5At1H/dHYtaGiraeTAJunZYCF9mdLtWTI3YRZSSBpO/INei WUo96k6kLd2Dnltb9EoE4JLB+lzGPx1tEZJRfsWF+t0jCc9588umws6yfb/LIX6E5Qp/ 6wn2kJgEN1qN/GSBOdsYABL4pXygrDjyKzkDIoRtJgNWINZPWjKQNZeKo0sC+np59C9N HYtEP/SG57VCV53JFMwsv4ZqYOAdICMGCguxQUHXoP7UIj/1kGDCF/b5VJZPy7zVNfgm Fzq8psTCjBf2Wy8miohQBH14MwiuBlJIifADRrZagdUTI7qSkdufo8oOH/AcGsj/6NEl k2ig== X-Forwarded-Encrypted: i=1; AJvYcCWUijz7rMCQPzQtQ6fBOP9FhYMQ4To3QHGt/nCiAP1RLU8nUt5bkf06597mUynYc1F+lm+YiPpgitMRpQXp6Zl6OSCefdl3nXMFORcXEMYk24RkMpMKxSsMx69SS1mgwRkarAdedLbopue4tcvmAbS7KIIsjDXs7M4y9iJMlDvzLacl78eINOoo X-Gm-Message-State: AOJu0YzRqh+moOaX9yHtPwib1ZyCPomd0nO4O1GZdwtT6OLZlbvL2CyL Wer5EXbaigoGBngFgFIztmzarc+R4w7+Z2pZ59gpx4o+e6fJ5DsyOq7aqg== X-Received: by 2002:a2e:838a:0:b0:2d9:eb66:6d39 with SMTP id 38308e7fff4ca-2ea950f66e8mr77375821fa.19.1717487767746; Tue, 04 Jun 2024 00:56:07 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2eaac556d6fsm7040091fa.87.2024.06.04.00.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 00:56:06 -0700 (PDT) Date: Tue, 4 Jun 2024 10:56:01 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Mark Brown , Greg Kroah-Hartman , "Rafael J. Wysocki" , Matti Vaittinen , Wim Van Sebroeck , Guenter Roeck , Thomas Gleixner , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org Subject: [PATCH v3 08/10] regmap: Allow setting IRQ domain name suffix Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="20CFtLxgAkACyflE" Content-Disposition: inline In-Reply-To: --20CFtLxgAkACyflE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable When multiple IRQ domains are created from the same device-tree node they will get the same name based on the device-tree path. This will cause a naming collision in debugFS when IRQ domain specific entries are created. The regmap-IRQ creates per instance IRQ domains. This will lead to a domain name conflict when a device which provides more than one interrupt line uses the regmap-IRQ. Add support for specifying an IRQ domain name suffix when creating a regmap-IRQ controller. The regmap-IRQ supports both the legacy IRQ domains and the linear IRQ domains. New devices are not expected to be using the legacy domains so support name suffixes only for linear domains and warn if suffix is tried to be added for a legacy domain. Signed-off-by: Matti Vaittinen --- Revision history: v2 =3D> v3: - Drop name suffix support for the legacy domains --- drivers/base/regmap/regmap-irq.c | 15 +++++++++++---- include/linux/regmap.h | 4 ++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-= irq.c index 45fd13ef13fc..79247202aa9d 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c @@ -856,13 +856,20 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *= fwnode, } } =20 - if (irq_base) + if (irq_base) { + if (chip->domain_suffix) + dev_warn(map->dev, + "Can't add name suffix for legacy domain\n"); + d->domain =3D irq_domain_create_legacy(fwnode, chip->num_irqs, irq_base, 0, ®map_domain_ops, d); - else - d->domain =3D irq_domain_create_linear(fwnode, chip->num_irqs, - ®map_domain_ops, d); + } else { + d->domain =3D irq_domain_create_linear_named(fwnode, + chip->num_irqs, ®map_domain_ops, + d, chip->domain_suffix); + } + if (!d->domain) { dev_err(map->dev, "Failed to create IRQ domain\n"); ret =3D -ENOMEM; diff --git a/include/linux/regmap.h b/include/linux/regmap.h index a6bc2980a98b..b0b6cd3afefa 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -1519,6 +1519,9 @@ struct regmap_irq_chip_data; * struct regmap_irq_chip - Description of a generic regmap irq_chip. * * @name: Descriptive name for IRQ controller. + * @domain_suffix: Name suffix to be appended to end of IRQ domain name. N= eeded + * when multiple regmap-IRQ controllers are created from same + * device. * * @main_status: Base main status register address. For chips which have * interrupts arranged in separate sub-irq blocks with own IRQ @@ -1604,6 +1607,7 @@ struct regmap_irq_chip_data; */ struct regmap_irq_chip { const char *name; + const char *domain_suffix; =20 unsigned int main_status; unsigned int num_main_status_bits; --=20 2.45.1 --=20 Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =3D]=20 --20CFtLxgAkACyflE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmZeyJEACgkQeFA3/03a ocXlmQf/RkOGMjcT1T4tnhcYWuQOaMKSft8ieVRng4XJ0jz9ztrAmYCiI/H8UiN9 nzi7yVUiKM4tUoRzQOhsu8jMzUa5NaU1QctW2pFZOgEkNROcOnQVd+m+dDiBU/xo SG/O4XlhZJeB4OdNplG3lDoVcPlm3gCQdu8Y7bz+If+2WNgAwicxYR01nJ67RTfH /vIIfiJyvYsuJ+lcK1JtP6UpOWhuTxfVKV6qL5LUhpC8g/XFaX0Fj3KVZynWBUpE Q5CuENoZnv/mdC/x/K52l47pzwKE5yD7n0Z80P2cyEzpTIK5OZ1NWEh1cL1QTlR3 OGbNE58EwooOKKG0mZ1JZURmcd8CaA== =Mh5C -----END PGP SIGNATURE----- --20CFtLxgAkACyflE--