From nobody Fri Dec 19 07:30:16 2025 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 E39E013C679 for ; Mon, 1 Jul 2024 10:58:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719831534; cv=none; b=tLPd7+Qto2uAR2PJKjKWcOoFz+TCwj3BGfphTYGV7Irbt0PjPi/4TRiq9aelM/Q/savk5Ui/I3fVqUocyAwrtu6cEkOM248mFyzr9jSnzBZ2v2GTjVui3oweIs08pEB+nTQEGA8hatStdIC3dMd3MI8rKdYQgvtca1okZncR7F8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719831534; c=relaxed/simple; bh=dnRR8Ke9gbskhhTVdHZ/lOzHqbz+7GKyKUBXw5dpyUU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bVoda+nnRLdZ5rQDuKR6XjCQ0difRiK0NfFPM0WUByDnL5nKtRkGUJF3VwnEiNvqDqy0FmSBL3dxmLMq/WhSZCCUAaBZ682QcycOr/obNmpQzy3GadytYSaaeziSTVQpomKzJbqYiZLhp+tna1fWu5dc7qnEgIup4V/mHVje0sw= 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=Zwgth53k; arc=none smtp.client-ip=209.85.167.47 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zwgth53k" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-52cdea1387eso2929478e87.0 for ; Mon, 01 Jul 2024 03:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719831531; x=1720436331; 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=ptyreQLSX0yPf7BXkeYPAjY9DgJ+90etUBU9efm0tMY=; b=Zwgth53klQ5Iec/SAgnx9Shm7JVbOoIWMTx13RnG7QKd/XVITtPFYmRRuO0B23tT6g IaWT+M3Fwi8/1cV/U3WeMTl1ojT+45V0kR1eeH8S3BDnDj5GelQWVPjFK0CpvN5aQwRT 56I5Qf7sMjPxPtNwOUtEVybY299gz12sM3tmLao8E5F1ixK4Zy9XxjWyVC5CiqJ03qRR HNzy424JDCZrbfW7wxC6z7TvD/a2+L83mhcXyT4o+von9ttzZMSnqFrVJtbcYzUUhWXB MBJ4CkfNgeVMaskWySb1VpYBaa6sLo0ef1F1lr8qInvLqe5YDLgdTjhOL0u5aGjxIDYr xD1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719831531; x=1720436331; 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=ptyreQLSX0yPf7BXkeYPAjY9DgJ+90etUBU9efm0tMY=; b=VC8GMVFDNKmHz5GUsMqrdCUggdQ09Oc2bY3kiW0fnOutMMoUI12IFnXSlOu7QWlQqm Clycd2oykUbJki1qFV9Xw6j20u++GT9yQwnPZs37aBzJJKnG9pTQFxZiL+IUz4zsdlkn yGCpBe8QYssiiCD4WuC2OnmxIXs8NHX51gwfjhLde4zvaj+fs5K2mwxKD16j3Pi3hk2Q R2xlUf8HV1ni0poXFcmFhd/g5dJeU0GRgN9R4l6Bb4cCu/PH7422kodjtAjOeUUsPxII WQK2mxaWpw1or8FKFVpAmtTcykaqwt3mJLUmxeSP5s72t89/T/b8OsqIpydfLH7neQTW Jp9w== X-Forwarded-Encrypted: i=1; AJvYcCWfOCrRbaeAEyF38h0oB/+2hmp1/h2wV1KrFdyomBugL1DEgx1en/kx969KXAf8RZNfTPfBmbo27uek0DrTXcH90TnMDz8c8G2xfU7B X-Gm-Message-State: AOJu0YxYFS5rT7YOhGi95IAtV84O0mdU/NCQpsMuqu09DUozyysHStpX GNj7xO1vrXj+QXlVF+bqa7Fv3mUL2tJ4ARkxXhRr6Uhx87g1m3Nd X-Google-Smtp-Source: AGHT+IEWC7DEvddMe6UeLnm48/2XjXvPTK6S6SpidMqoDxSvSpq18/iqujsy3wM12Fr/f6qtBVdEng== X-Received: by 2002:a05:6512:1384:b0:52c:86d6:e8d7 with SMTP id 2adb3069b0e04-52e8264733dmr4074657e87.13.1719831528324; Mon, 01 Jul 2024 03:58:48 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52e7ab0ba73sm1347132e87.47.2024.07.01.03.58.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 03:58:47 -0700 (PDT) Date: Mon, 1 Jul 2024 13:58:43 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Mark Brown , Greg Kroah-Hartman , "Rafael J. Wysocki" , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] irqdomain: Allow giving name suffix for domain Message-ID: <4f037bdc2804116d674bdbeba09169ca9ea7ce4b.1719830185.git.mazziesaccount@gmail.com> 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="ReDjjF9hu6x6o9ha" Content-Disposition: inline In-Reply-To: --ReDjjF9hu6x6o9ha Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Devices can provide multiple interrupt lines. One reason for this is that a device has multiple subfunctions, each providing its own interrupt line. Another reason is that a device can be designed to be used (also) on a system where some of the interrupts can be routed to another processor. A line often further acts as a demultiplex for specific interrupts and has it's respective set of interrupt (status, mask, ack, ...) registers. Regmap supports the handling of these registers and demultiplexing interrupts, but interrupt domain code ends up assigning the same name for the per interrupt line domains. This will cause a naming collision in the debugFS code and can also lead to confusion, as /proc/interrupts would show two separate interrupts with the same domain name and hardware interrupt number. Instead of adding a workaround in regmap or driver code, allow giving a name suffix for the domain name when the domain is created. Add a name_suffix field in the irq_domain_info structure and make the irq_domain_instantiate() to use this suffix if it is given when a domain is created. Signed-off-by: Matti Vaittinen --- include/linux/irqdomain.h | 3 +++ kernel/irq/irqdomain.c | 36 +++++++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 02cd486ac354..77ead0d41ccd 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -274,6 +274,8 @@ struct irq_domain_chip_generic_info; * @direct_max: Maximum value of direct maps; * Use ~0 for no limit; 0 for no direct mapping * @bus_token: Domain bus token + * @name_suffix: Optional name suffix to avoid collisions when multiple + * domains are added using same fwnode * @ops: Domain operation callbacks * @host_data: Controller private data pointer * @dgc_info: Geneneric chip information structure pointer used to @@ -290,6 +292,7 @@ struct irq_domain_info { irq_hw_number_t hwirq_max; int direct_max; enum irq_domain_bus_token bus_token; + const char *name_suffix; const struct irq_domain_ops *ops; void *host_data; #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 91eaf6bfcbf0..41348a325a94 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -129,13 +129,25 @@ void irq_domain_free_fwnode(struct fwnode_handle *fwn= ode) EXPORT_SYMBOL_GPL(irq_domain_free_fwnode); =20 static int irq_domain_set_name(struct irq_domain *domain, - const struct fwnode_handle *fwnode, - enum irq_domain_bus_token bus_token) + const struct irq_domain_info *info) { + const struct fwnode_handle *fwnode =3D info->fwnode; + enum irq_domain_bus_token bus_token =3D info->bus_token; static atomic_t unknown_domains; struct irqchip_fwid *fwid; =20 if (is_fwnode_irqchip(fwnode)) { + /* + * The name_suffix is only intended to be used to avoid a name + * collison, when multiple domains are created for a single + * device and the name is picked using a real device node. + * (Typical use-case is regmap-IRQ controllers for devices + * providing more than one physical IRQ.) There should be no + * need to use name_suffix with irqchip-fwnode. + */ + if (info->name_suffix) + return NULL; + fwid =3D container_of(fwnode, struct irqchip_fwid, fwnode); =20 switch (fwid->type) { @@ -164,17 +176,23 @@ static int irq_domain_set_name(struct irq_domain *dom= ain, is_software_node(fwnode)) { char *name; =20 + if (info->name_suffix) + name =3D bus_token ? + kasprintf(GFP_KERNEL, "%pfw-%s-%d", fwnode, + info->name_suffix, bus_token) : + kasprintf(GFP_KERNEL, "%pfw-%s", fwnode, info->name_suffix); + else + name =3D bus_token ? + kasprintf(GFP_KERNEL, "%pfw-%d", fwnode, bus_token) : + kasprintf(GFP_KERNEL, "%pfw", fwnode); + if (!name) + return -ENOMEM; + /* * fwnode paths contain '/', which debugfs is legitimately * unhappy about. Replace them with ':', which does * the trick and is not as offensive as '\'... */ - name =3D bus_token ? - kasprintf(GFP_KERNEL, "%pfw-%d", fwnode, bus_token) : - kasprintf(GFP_KERNEL, "%pfw", fwnode); - if (!name) - return -ENOMEM; - domain->name =3D strreplace(name, '/', ':'); domain->flags |=3D IRQ_DOMAIN_NAME_ALLOCATED; } @@ -211,7 +229,7 @@ static struct irq_domain *__irq_domain_create(const str= uct irq_domain_info *info if (!domain) return ERR_PTR(-ENOMEM); =20 - err =3D irq_domain_set_name(domain, info->fwnode, info->bus_token); + err =3D irq_domain_set_name(domain, info); if (err) { kfree(domain); return ERR_PTR(err); --=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 --ReDjjF9hu6x6o9ha Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmaCi+MACgkQeFA3/03a ocWpZQf9E2nH9PjsSycD9W2dC74FvSwhYli1wmyD5mPowH3c2Ddq9zUdV3E8Bd9W SvH1NpUmMyTiUQvgI2SnBWjfgtcifP/AHqhpJYGmAmjAGNoOSAshb5ll90ifRJbc mIWf+FrCq5kcemmYME5oSbqrLEpTHkm/iEySuThwLetrpHq/xAAofc6pcHB2Suml NARh6qz2RrOqq/wpHRRSIuVGlYkRuqimgXVKGjIMiZNZb6u06bHl+P8n+6tl++f0 o6PiPmHaGvt/qNicamkv3YUIWuU9ivyNpiy0XG8ALrK1YsG1hJd0MXLfKQpGn7tN wiqaFvIunmX5rwH1iS/j54l0o/wt+g== =c36j -----END PGP SIGNATURE----- --ReDjjF9hu6x6o9ha-- From nobody Fri Dec 19 07:30:16 2025 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 2A9B012E1EE for ; Mon, 1 Jul 2024 10:59:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719831551; cv=none; b=QA5h78OGQ1h9xdqyV3hbRoYNK4CmVMskYHTImcE9+Nh3Y1oZUjxkzdf0CluColRHTBZwJ96zCqk1HqRoBqAbqAwUS0cnqwJoBvOG2xfBzaY11gVtvMhAfqOwHmKvHV2TI3JzrfbB9lkTJ64KKoQ9AXPDR5kA6tBXiLm6YRQXbXU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719831551; c=relaxed/simple; bh=AJWcK4W5ftFClyEqrpF7wXS0A2KWp5gtMzvOoNTIUo0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nlBSbKc2P1bWGX8M9JMWxStg3Gb6ZjGA8WU7aF2PQphYNj719xmgbCmvjf6Jf92YzhFQlQkOQVnBZO1iE1krkzf4AOJ+xQ9IMjxjMG6MmfPgEMciWbUCZJ40bSwxjip6hSZw36dUDrRzB05Ke3hUnTQyFjgnptCJxhoy9sqMNgU= 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=WQFp5aCB; arc=none smtp.client-ip=209.85.167.43 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WQFp5aCB" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-52caebc6137so2146750e87.0 for ; Mon, 01 Jul 2024 03:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719831548; x=1720436348; 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=Bfz0TMyxF38ATYWwYTXTKghaOOuHe//IkuNlNyFlQD0=; b=WQFp5aCB7F307MTgv5yPyWe5XbADsV1rqfgzuxJgVPwGVhm//1lhocGtXWnen93X5c Sh1X6Tkoop7np/BqnTl37rZlAA/6yZWkQdbngyV+uPxiPaN+oPMWePd9nRQ7CL+vuU+v EUSI8w/SQjSXWkYeSs54Gv0AsimavI0mk9OCkBRMK2u31EnBRqTjE9VRUOrO57eKUrSo 8LGHMVr/Kw4ng+Hb9aohQyX9nJdhrRssU05zrhDiQcVlPHzfoeAf4ZT8Uo1SB8cRJUjk yO+3RLZL+9BHET1Ufk+nd5hqDHbnXPzo699FIbcLhQVs3X0YvPDjqUHQ/SU7Eo+LOKDl mDmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719831548; x=1720436348; 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=Bfz0TMyxF38ATYWwYTXTKghaOOuHe//IkuNlNyFlQD0=; b=nhf7hRRH9vmB6rOxSk47clyeL1d25Gxn04VSGfyPAYjTYg2vAp4/Ph3Y/KC2xG5OSV pugUpDGOrUKGou3N0GkPaALBFtu28SeeDzKAe3YlHCNkJYKmfU4R2k6JVIDvsnat+90H e44gMH/XGfPO1KMaV4rvtDf8qySs6qEYRa6pIhmpNcBRbSvNUU9xUEHuT7s9PSOXv0c+ IbkpDoDNwqcH2tJeuKQVlNQzR0k/9GWj3+QvrWTCvcFGHlijHHo9+UXwCcOAkUpkyGAb 8A4nMYY3zsP79gCjEtY0ckuSdA2LAOiZj22HntEBT8alHrweFUgqQknt1r+TgVgLmhZ/ Sw1A== X-Forwarded-Encrypted: i=1; AJvYcCVwsnbh2e+QrV0xstL6SgnJnkpv1/7ZenuuvqGYLeYsQwc+XFXcMCYz/cjXd9iMWVaeQbYG18j4ISdCJUjGbU/ZgqR9MLx33YJHszec X-Gm-Message-State: AOJu0YwWYBI+YdoCAH6Zy0/xsar3D06WH3vYbIxOQfiBbnHk1WBQ+S1N QLAZCvRsWiYL94NowTAp+//8pG8I+KC8Om1qcoY1s4VIIpyIxLX0 X-Google-Smtp-Source: AGHT+IF1cwiUcE4xI0T58ne4n3Jz49ASBrKtuddougzSFc9FHgked6Uxz2R/OJM97myZ7+VDWY8DDg== X-Received: by 2002:a05:6512:15a3:b0:52c:8fd7:2252 with SMTP id 2adb3069b0e04-52e826467aemr3757246e87.11.1719831547868; Mon, 01 Jul 2024 03:59:07 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52e7ab2eaf0sm1376011e87.195.2024.07.01.03.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 03:59:07 -0700 (PDT) Date: Mon, 1 Jul 2024 13:59:03 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Mark Brown , Greg Kroah-Hartman , "Rafael J. Wysocki" , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] 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="/NLf3SfcsRCvWQp9" Content-Disposition: inline In-Reply-To: --/NLf3SfcsRCvWQp9 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Matti Vaittinen Suggested-by: Thomas Gleixner --- A change worth mentioning is that this patch changes the error code returned by IRQ domain generation code to be propagated to the caller. Earlier all IRQ domain creation failutes were returning the -ENOMEM. Please let me know if you assume this will cause problems. This patch was originally part of the series adding support for the ROHM BD96801 PMIC. Basic support was already merged while this one was postponed until the name-suffix support was added to IRQ-domain code. Hence the non linear version history. Finally, there is a comment: "Should really dispose of the domain but..." in the regmap-IRQ creation code. Any insight what the "but..." refers to would be appreciated as there would be an option to for example use the devm_ variant of the irq_domain_instantiate(). Revision history: v1 of the new series: - use the new irq_domain_instantiate(). v2 =3D> v3 (old series): - Drop name suffix support for the legacy domains --- drivers/base/regmap/regmap-irq.c | 39 +++++++++++++++++++++++--------- include/linux/regmap.h | 4 ++++ 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-= irq.c index 45fd13ef13fc..43bde9744ea6 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c @@ -608,6 +608,32 @@ int regmap_irq_set_type_config_simple(unsigned int **b= uf, unsigned int type, } EXPORT_SYMBOL_GPL(regmap_irq_set_type_config_simple); =20 +static int regmap_irq_create_domain(struct fwnode_handle *fwnode, int irq_= base, + const struct regmap_irq_chip *chip, + struct regmap_irq_chip_data *d) +{ + struct irq_domain_info info =3D { + .fwnode =3D fwnode, + .size =3D irq_base + chip->num_irqs, + .hwirq_max =3D irq_base + chip->num_irqs, + .ops =3D ®map_domain_ops, + .host_data =3D d, + .name_suffix =3D chip->domain_suffix, + }; + + d->domain =3D irq_domain_instantiate(&info); + if (IS_ERR(d->domain)) { + dev_err(d->map->dev, "Failed to create IRQ domain\n"); + return PTR_ERR(d->domain); + } + + if (irq_base) + irq_domain_associate_many(d->domain, irq_base, 0, chip->num_irqs); + + return 0; +} + + /** * regmap_add_irq_chip_fwnode() - Use standard regmap IRQ controller handl= ing * @@ -856,18 +882,9 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *f= wnode, } } =20 - if (irq_base) - 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); - if (!d->domain) { - dev_err(map->dev, "Failed to create IRQ domain\n"); - ret =3D -ENOMEM; + ret =3D regmap_irq_create_domain(fwnode, irq_base, chip, d); + if (ret) goto err_alloc; - } =20 ret =3D request_threaded_irq(irq, NULL, regmap_irq_thread, irq_flags | IRQF_ONESHOT, 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 --/NLf3SfcsRCvWQp9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmaCi/cACgkQeFA3/03a ocVnuwf/feJKv0mVSdQxsPqGS568JdeGPoSYf3GehkmXMUucSbanziUA2gGvPwku B9Aa+srjqR5xMYyobuk8W5iLr6ieK7j6VyYb9TpVqIjy5LPruXO2Qdh1tCB+QGSC 4N3QWMtrfBlyapALoNh5uLC3AZcOokXXYSmcwvoUnh8n4jHU8hJ+2K88JHeGJULX 4pJ+UnJ6vUdmfG4t0XO6rq3qvzZsoelTuj4rzWXM+dmL6YfviVWXLBacqX5nKA8r UmFp9I97t9gGyyiP6FosznEnLUV5y4i8bNMGBWZAE7mDoR+OPP60tLhlk516hVpM cWIWFRDz1xN1mgRwU6oPasSEycymAg== =KZdn -----END PGP SIGNATURE----- --/NLf3SfcsRCvWQp9--