Skip to content

Commit 0df50dc

Browse files
GseoCPatrice Chotard
authored andcommitted
video: stm32: ltdc: add remove ops for RIF semaphores
When the driver is removed, we need to release the layers' RIF semaphores so that the resources can be acquired by other entities, if needed. Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Change-Id: Idd8862817c16b7b4590818671f01df112efa3923 Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/457633 Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com> Reviewed-by: Gatien CHEVALLIER <gatien.chevallier@st.com> Tested-by: Gatien CHEVALLIER <gatien.chevallier@st.com> ACI: CITOOLS <MDG-smet-aci-reviews@list.st.com> Domain-Review: Patrice CHOTARD <patrice.chotard@foss.st.com> ACI: CIBUILD <MDG-smet-aci-builds@list.st.com>
1 parent 3a55af3 commit 0df50dc

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

drivers/video/stm32/stm32_ltdc.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ struct stm32_ltdc_priv {
5151
u32 hw_version;
5252
struct udevice *bridge;
5353
struct udevice *panel;
54+
struct ofnode_phandle_args args_cmn;
55+
struct ofnode_phandle_args args_l1l2;
5456
};
5557

5658
/* Layer register offsets */
@@ -824,9 +826,6 @@ static int stm32_ltdc_probe(struct udevice *dev)
824826

825827
if (IS_ENABLED(CONFIG_STM32MP25X) || IS_ENABLED(CONFIG_STM32MP23X) ||
826828
IS_ENABLED(CONFIG_STM32MP21X)) {
827-
struct ofnode_phandle_args args_cmn;
828-
struct ofnode_phandle_args args_l1l2;
829-
830829
node = dev_ofnode(dev);
831830

832831
idx = ofnode_stringlist_search(node, "access-controller-names", "cmn");
@@ -835,7 +834,7 @@ static int stm32_ltdc_probe(struct udevice *dev)
835834

836835
ret = ofnode_parse_phandle_with_args(node, "access-controllers",
837836
"#access-controller-cells",
838-
0, idx, &args_cmn);
837+
0, idx, &priv->args_cmn);
839838
if (ret < 0) {
840839
dev_err(dev, "Can not get access-controllers to common registers\n");
841840
return ret;
@@ -855,7 +854,7 @@ static int stm32_ltdc_probe(struct udevice *dev)
855854

856855
ret = ofnode_parse_phandle_with_args(node, "access-controllers",
857856
"#access-controller-cells",
858-
0, idx, &args_l1l2);
857+
0, idx, &priv->args_l1l2);
859858
if (ret < 0) {
860859
dev_err(dev, "Can not get access-controllers to l1l2 registers\n");
861860
return ret;
@@ -1118,5 +1117,7 @@ U_BOOT_DRIVER(stm32_ltdc) = {
11181117
.of_match = stm32_ltdc_ids,
11191118
.probe = stm32_ltdc_probe,
11201119
.bind = stm32_ltdc_bind,
1121-
.priv_auto = sizeof(struct stm32_ltdc_priv),
1120+
.priv_auto = sizeof(struct stm32_ltdc_priv),
1121+
.flags = DM_FLAG_OS_PREPARE,
1122+
.remove = stm32_ltdc_remove,
11221123
};

0 commit comments

Comments
 (0)