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

soc: qcom: pmic_glink: Add support for SOCCP remoteproc channels

System On Chip Control Processor (SOCCP) is a subsystem that can have
battery management firmware running on it to support Type-C/PD and
battery charging. SOCCP does not have multiple PDs and hence PDR is not
supported. So, if the subsystem comes up/down, rpmsg driver would be
probed or removed. Use that for notifying clients of pmic_glink for
PDR events.

Add support for battery management FW running on SOCCP by adding the
"PMIC_RTR_SOCCP_APPS" channel name to the rpmsg_match list and
updating notify_clients logic.

Signed-off-by: Anjelique Melendez <anjelique.melendez@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250919175025.2988948-1-anjelique.melendez@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Anjelique Melendez and committed by
Bjorn Andersson
6773cb33 edd548dc

+8 -1
+8 -1
drivers/soc/qcom/pmic_glink.c
··· 39 39 struct mutex state_lock; 40 40 unsigned int client_state; 41 41 unsigned int pdr_state; 42 + bool pdr_available; 42 43 43 44 /* serializing clients list updates */ 44 45 spinlock_t client_lock; ··· 247 246 return dev_err_probe(&rpdev->dev, -ENODEV, "no pmic_glink device to attach to\n"); 248 247 249 248 dev_set_drvdata(&rpdev->dev, pg); 249 + pg->pdr_available = rpdev->id.driver_data; 250 250 251 251 guard(mutex)(&pg->state_lock); 252 252 pg->ept = rpdev->ept; 253 + if (!pg->pdr_available) 254 + pg->pdr_state = SERVREG_SERVICE_STATE_UP; 253 255 pmic_glink_state_notify_clients(pg); 254 256 255 257 return 0; ··· 269 265 270 266 guard(mutex)(&pg->state_lock); 271 267 pg->ept = NULL; 268 + if (!pg->pdr_available) 269 + pg->pdr_state = SERVREG_SERVICE_STATE_DOWN; 272 270 pmic_glink_state_notify_clients(pg); 273 271 } 274 272 275 273 static const struct rpmsg_device_id pmic_glink_rpmsg_id_match[] = { 276 - { "PMIC_RTR_ADSP_APPS" }, 274 + {.name = "PMIC_RTR_ADSP_APPS", .driver_data = true }, 275 + {.name = "PMIC_RTR_SOCCP_APPS", .driver_data = false }, 277 276 {} 278 277 }; 279 278