From nobody Tue Dec 2 02:06:09 2025 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (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 6CC6927B35F for ; Thu, 20 Nov 2025 14:38:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763649489; cv=none; b=h5PDTOcKSRlIO1hZxPnb5PHEoxPFTbmptxy+dMbu9HTTgrQ5mQ67nwQfqEJ2BcOMZrPmHSKaYmhkoZwIllAt5Tcm8zrNaNba9KwROj8xgaahmHRr3hdWNSlFBX6kKJcSXPp8bULdtsj3yA+k6MoVHUnzNARg9G0DwPxSvsfwrYM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763649489; c=relaxed/simple; bh=1kTUYewu4Qf6eaZM79yswFLJrKWEOAk1UN22HB6JO80=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=llOE184hUQuVf9Xsdg+szVGEKbVsWDMV8xaPpYMHRzIfneXtsTC+MCwaB4LDvSNpMImiC8ep3S+LvbKKuWmCpn1ZAXvR/Eap9eBSsSOPeWWuYqyfNlWbbT9DeDpmbO95Le2/PZrqSWqbZdvfPZZbFVBBQq/cDKEM8PIP++Usdlg= 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=rOVdIQfU; arc=none smtp.client-ip=209.85.218.41 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rOVdIQfU" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-b736ffc531fso149875966b.1 for ; Thu, 20 Nov 2025 06:38:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1763649486; x=1764254286; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=soaPD2TslKdn5T93ESkr8AaM8d+EcG4AUD/8dOpzu/4=; b=rOVdIQfUjs0Jd8Q7n0WdzU5rD8mwbsTebxdFm50afejdxPTcCj0jYHCeqydo07SxUp IflQh5082qsSLGAitlYgqsfi4fv9O73NBwV5hVGaA07+Mv7ts1jPU+e2codBv/h/iGPa /m3OktYugQ6ZnKgVKD9KJKMBxVeUJM7DOH3hUEMGhLgko3lYKzIDxo/qg+W+wK5uf+eh xYxSODwIiyGMCHHQVYDzvdtQmNAmTxAtRohfUV5T+pkPbxYevdlmikSUG4fo/IFYAD3L lRxQ6/PLBEiSNHulsOQI0yJEsrAsgRYBPle+6vgcfa91qeGGR0N0EyyRIh/jde1f7QBn AeBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763649486; x=1764254286; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=soaPD2TslKdn5T93ESkr8AaM8d+EcG4AUD/8dOpzu/4=; b=B4mC0va8dSoi7CFJIn0J7bcfhw3/58rZL8MwrC7okuyIpOcBTulkuzCeYhw0AalzcQ HJBcHPSQsD7+jXS6Sg8i3aQPU1W3Zue7uVDqtE8lwyNL4PaTHkHaTb26i30h8c4NS1Pu AG4lrY/+R/sykINaqFeIvcGJo5JsjUPiMQmvFpFqmCjMApkS5Hgr9oR0EwgIy/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Received: by 2002:a17:906:c104:b0:b76:52d0:aa2e with SMTP id a640c23a62f3a-b76588e825fmr284535366b.40.1763649485689; Thu, 20 Nov 2025 06:38:05 -0800 (PST) Received: from puffmais2.c.googlers.com (180.192.141.34.bc.googleusercontent.com. [34.141.192.180]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b7655050927sm214326566b.71.2025.11.20.06.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Nov 2025 06:38:05 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Thu, 20 Nov 2025 14:38:04 +0000 Subject: [PATCH v2 1/3] mfd: sec: add rtc alarm IRQ as platform device resource Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251120-s5m-alarm-v2-1-cc15f0e32161@linaro.org> References: <20251120-s5m-alarm-v2-0-cc15f0e32161@linaro.org> In-Reply-To: <20251120-s5m-alarm-v2-0-cc15f0e32161@linaro.org> To: Krzysztof Kozlowski , Lee Jones , Alexandre Belloni Cc: Peter Griffin , Tudor Ambarus , Will McVicker , Juan Yescas , Douglas Anderson , kernel-team@android.com, Kaustabh Chakraborty , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-rtc@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.14.2 By adding the RTC alarm IRQ to the MFD cell as a resource, the child driver (rtc) can simply query that IRQ, instead of having a lookup table itself. This change therefore allows the child driver to be simplified with regards to determining the alarm IRQ. Signed-off-by: Andr=C3=A9 Draszik --- drivers/mfd/sec-common.c | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/sec-common.c b/drivers/mfd/sec-common.c index 42d55e70e34c8d7cd68cddaecc88017e259365b4..77370db52a7ba81234136b29f85= 892f4b197f429 100644 --- a/drivers/mfd/sec-common.c +++ b/drivers/mfd/sec-common.c @@ -23,9 +23,13 @@ #include #include "sec-core.h" =20 +static const struct resource s5m8767_rtc_resources[] =3D { + DEFINE_RES_IRQ_NAMED(S5M8767_IRQ_RTCA1, "alarm"), +}; + static const struct mfd_cell s5m8767_devs[] =3D { MFD_CELL_NAME("s5m8767-pmic"), - MFD_CELL_NAME("s5m-rtc"), + MFD_CELL_RES("s5m-rtc", s5m8767_rtc_resources), MFD_CELL_OF("s5m8767-clk", NULL, NULL, 0, 0, "samsung,s5m8767-clk"), }; =20 @@ -33,50 +37,66 @@ static const struct mfd_cell s2dos05_devs[] =3D { MFD_CELL_NAME("s2dos05-regulator"), }; =20 +static const struct resource s2mpg10_rtc_resources[] =3D { + DEFINE_RES_IRQ_NAMED(S2MPG10_IRQ_RTCA0, "alarm"), +}; + static const struct mfd_cell s2mpg10_devs[] =3D { MFD_CELL_NAME("s2mpg10-meter"), MFD_CELL_NAME("s2mpg10-regulator"), - MFD_CELL_NAME("s2mpg10-rtc"), + MFD_CELL_RES("s2mpg10-rtc", s2mpg10_rtc_resources), MFD_CELL_OF("s2mpg10-clk", NULL, NULL, 0, 0, "samsung,s2mpg10-clk"), MFD_CELL_OF("s2mpg10-gpio", NULL, NULL, 0, 0, "samsung,s2mpg10-gpio"), }; =20 +static const struct resource s2mps11_rtc_resources[] =3D { + DEFINE_RES_IRQ_NAMED(S2MPS11_IRQ_RTCA0, "alarm"), +}; + static const struct mfd_cell s2mps11_devs[] =3D { MFD_CELL_NAME("s2mps11-regulator"), - MFD_CELL_NAME("s2mps14-rtc"), + MFD_CELL_RES("s2mps14-rtc", s2mps11_rtc_resources), MFD_CELL_OF("s2mps11-clk", NULL, NULL, 0, 0, "samsung,s2mps11-clk"), }; =20 +static const struct resource s2mps14_rtc_resources[] =3D { + DEFINE_RES_IRQ_NAMED(S2MPS14_IRQ_RTCA0, "alarm"), +}; + static const struct mfd_cell s2mps13_devs[] =3D { MFD_CELL_NAME("s2mps13-regulator"), - MFD_CELL_NAME("s2mps13-rtc"), + MFD_CELL_RES("s2mps13-rtc", s2mps14_rtc_resources), MFD_CELL_OF("s2mps13-clk", NULL, NULL, 0, 0, "samsung,s2mps13-clk"), }; =20 static const struct mfd_cell s2mps14_devs[] =3D { MFD_CELL_NAME("s2mps14-regulator"), - MFD_CELL_NAME("s2mps14-rtc"), + MFD_CELL_RES("s2mps14-rtc", s2mps14_rtc_resources), MFD_CELL_OF("s2mps14-clk", NULL, NULL, 0, 0, "samsung,s2mps14-clk"), }; =20 static const struct mfd_cell s2mps15_devs[] =3D { MFD_CELL_NAME("s2mps15-regulator"), - MFD_CELL_NAME("s2mps15-rtc"), + MFD_CELL_RES("s2mps15-rtc", s2mps14_rtc_resources), MFD_CELL_OF("s2mps13-clk", NULL, NULL, 0, 0, "samsung,s2mps13-clk"), }; =20 static const struct mfd_cell s2mpa01_devs[] =3D { MFD_CELL_NAME("s2mpa01-pmic"), - MFD_CELL_NAME("s2mps14-rtc"), + MFD_CELL_RES("s2mps14-rtc", s2mps14_rtc_resources), }; =20 static const struct mfd_cell s2mpu02_devs[] =3D { MFD_CELL_NAME("s2mpu02-regulator"), }; =20 +static const struct resource s2mpu05_rtc_resources[] =3D { + DEFINE_RES_IRQ_NAMED(S2MPU05_IRQ_RTCA0, "alarm"), +}; + static const struct mfd_cell s2mpu05_devs[] =3D { MFD_CELL_NAME("s2mpu05-regulator"), - MFD_CELL_NAME("s2mps15-rtc"), + MFD_CELL_RES("s2mps15-rtc", s2mpu05_rtc_resources), }; =20 static void sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic) @@ -220,7 +240,7 @@ int sec_pmic_probe(struct device *dev, int device_type,= unsigned int irq, sec_pmic->device_type); } ret =3D devm_mfd_add_devices(sec_pmic->dev, -1, sec_devs, num_sec_devs, - NULL, 0, NULL); + NULL, 0, regmap_irq_get_domain(sec_pmic->irq_data)); if (ret) return ret; =20 --=20 2.52.0.rc1.455.g30608eb744-goog