Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mfd: sec: Add rtc alarm IRQ as platform device resource

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é Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260113-s5m-alarm-v3-1-855a19db1277@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

André Draszik and committed by
Lee Jones
153ae5c5 8f0b4cce

+29 -9
+29 -9
drivers/mfd/sec-common.c
··· 23 23 #include <linux/regmap.h> 24 24 #include "sec-core.h" 25 25 26 + static const struct resource s5m8767_rtc_resources[] = { 27 + DEFINE_RES_IRQ_NAMED(S5M8767_IRQ_RTCA1, "alarm"), 28 + }; 29 + 26 30 static const struct mfd_cell s5m8767_devs[] = { 27 31 MFD_CELL_NAME("s5m8767-pmic"), 28 - MFD_CELL_NAME("s5m-rtc"), 32 + MFD_CELL_RES("s5m-rtc", s5m8767_rtc_resources), 29 33 MFD_CELL_OF("s5m8767-clk", NULL, NULL, 0, 0, "samsung,s5m8767-clk"), 30 34 }; 31 35 ··· 37 33 MFD_CELL_NAME("s2dos05-regulator"), 38 34 }; 39 35 36 + static const struct resource s2mpg10_rtc_resources[] = { 37 + DEFINE_RES_IRQ_NAMED(S2MPG10_IRQ_RTCA0, "alarm"), 38 + }; 39 + 40 40 static const struct mfd_cell s2mpg10_devs[] = { 41 41 MFD_CELL_NAME("s2mpg10-meter"), 42 42 MFD_CELL_NAME("s2mpg10-regulator"), 43 - MFD_CELL_NAME("s2mpg10-rtc"), 43 + MFD_CELL_RES("s2mpg10-rtc", s2mpg10_rtc_resources), 44 44 MFD_CELL_OF("s2mpg10-clk", NULL, NULL, 0, 0, "samsung,s2mpg10-clk"), 45 45 MFD_CELL_OF("s2mpg10-gpio", NULL, NULL, 0, 0, "samsung,s2mpg10-gpio"), 46 46 }; 47 47 48 + static const struct resource s2mps11_rtc_resources[] = { 49 + DEFINE_RES_IRQ_NAMED(S2MPS11_IRQ_RTCA0, "alarm"), 50 + }; 51 + 48 52 static const struct mfd_cell s2mps11_devs[] = { 49 53 MFD_CELL_NAME("s2mps11-regulator"), 50 - MFD_CELL_NAME("s2mps14-rtc"), 54 + MFD_CELL_RES("s2mps14-rtc", s2mps11_rtc_resources), 51 55 MFD_CELL_OF("s2mps11-clk", NULL, NULL, 0, 0, "samsung,s2mps11-clk"), 56 + }; 57 + 58 + static const struct resource s2mps14_rtc_resources[] = { 59 + DEFINE_RES_IRQ_NAMED(S2MPS14_IRQ_RTCA0, "alarm"), 52 60 }; 53 61 54 62 static const struct mfd_cell s2mps13_devs[] = { 55 63 MFD_CELL_NAME("s2mps13-regulator"), 56 - MFD_CELL_NAME("s2mps13-rtc"), 64 + MFD_CELL_RES("s2mps13-rtc", s2mps14_rtc_resources), 57 65 MFD_CELL_OF("s2mps13-clk", NULL, NULL, 0, 0, "samsung,s2mps13-clk"), 58 66 }; 59 67 60 68 static const struct mfd_cell s2mps14_devs[] = { 61 69 MFD_CELL_NAME("s2mps14-regulator"), 62 - MFD_CELL_NAME("s2mps14-rtc"), 70 + MFD_CELL_RES("s2mps14-rtc", s2mps14_rtc_resources), 63 71 MFD_CELL_OF("s2mps14-clk", NULL, NULL, 0, 0, "samsung,s2mps14-clk"), 64 72 }; 65 73 66 74 static const struct mfd_cell s2mps15_devs[] = { 67 75 MFD_CELL_NAME("s2mps15-regulator"), 68 - MFD_CELL_NAME("s2mps15-rtc"), 76 + MFD_CELL_RES("s2mps15-rtc", s2mps14_rtc_resources), 69 77 MFD_CELL_OF("s2mps13-clk", NULL, NULL, 0, 0, "samsung,s2mps13-clk"), 70 78 }; 71 79 72 80 static const struct mfd_cell s2mpa01_devs[] = { 73 81 MFD_CELL_NAME("s2mpa01-pmic"), 74 - MFD_CELL_NAME("s2mps14-rtc"), 82 + MFD_CELL_RES("s2mps14-rtc", s2mps14_rtc_resources), 75 83 }; 76 84 77 85 static const struct mfd_cell s2mpu02_devs[] = { 78 86 MFD_CELL_NAME("s2mpu02-regulator"), 79 87 }; 80 88 89 + static const struct resource s2mpu05_rtc_resources[] = { 90 + DEFINE_RES_IRQ_NAMED(S2MPU05_IRQ_RTCA0, "alarm"), 91 + }; 92 + 81 93 static const struct mfd_cell s2mpu05_devs[] = { 82 94 MFD_CELL_NAME("s2mpu05-regulator"), 83 - MFD_CELL_NAME("s2mps15-rtc"), 95 + MFD_CELL_RES("s2mps15-rtc", s2mpu05_rtc_resources), 84 96 }; 85 97 86 98 static void sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic) ··· 240 220 sec_pmic->device_type); 241 221 } 242 222 ret = devm_mfd_add_devices(sec_pmic->dev, -1, sec_devs, num_sec_devs, 243 - NULL, 0, NULL); 223 + NULL, 0, regmap_irq_get_domain(sec_pmic->irq_data)); 244 224 if (ret) 245 225 return ret; 246 226