mirror of https://github.com/torvalds/linux.git
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>
This commit is contained in:
parent
edd548dc64
commit
6773cb33e7
|
|
@ -39,6 +39,7 @@ struct pmic_glink {
|
||||||
struct mutex state_lock;
|
struct mutex state_lock;
|
||||||
unsigned int client_state;
|
unsigned int client_state;
|
||||||
unsigned int pdr_state;
|
unsigned int pdr_state;
|
||||||
|
bool pdr_available;
|
||||||
|
|
||||||
/* serializing clients list updates */
|
/* serializing clients list updates */
|
||||||
spinlock_t client_lock;
|
spinlock_t client_lock;
|
||||||
|
|
@ -246,9 +247,12 @@ static int pmic_glink_rpmsg_probe(struct rpmsg_device *rpdev)
|
||||||
return dev_err_probe(&rpdev->dev, -ENODEV, "no pmic_glink device to attach to\n");
|
return dev_err_probe(&rpdev->dev, -ENODEV, "no pmic_glink device to attach to\n");
|
||||||
|
|
||||||
dev_set_drvdata(&rpdev->dev, pg);
|
dev_set_drvdata(&rpdev->dev, pg);
|
||||||
|
pg->pdr_available = rpdev->id.driver_data;
|
||||||
|
|
||||||
guard(mutex)(&pg->state_lock);
|
guard(mutex)(&pg->state_lock);
|
||||||
pg->ept = rpdev->ept;
|
pg->ept = rpdev->ept;
|
||||||
|
if (!pg->pdr_available)
|
||||||
|
pg->pdr_state = SERVREG_SERVICE_STATE_UP;
|
||||||
pmic_glink_state_notify_clients(pg);
|
pmic_glink_state_notify_clients(pg);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -265,11 +269,14 @@ static void pmic_glink_rpmsg_remove(struct rpmsg_device *rpdev)
|
||||||
|
|
||||||
guard(mutex)(&pg->state_lock);
|
guard(mutex)(&pg->state_lock);
|
||||||
pg->ept = NULL;
|
pg->ept = NULL;
|
||||||
|
if (!pg->pdr_available)
|
||||||
|
pg->pdr_state = SERVREG_SERVICE_STATE_DOWN;
|
||||||
pmic_glink_state_notify_clients(pg);
|
pmic_glink_state_notify_clients(pg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct rpmsg_device_id pmic_glink_rpmsg_id_match[] = {
|
static const struct rpmsg_device_id pmic_glink_rpmsg_id_match[] = {
|
||||||
{ "PMIC_RTR_ADSP_APPS" },
|
{.name = "PMIC_RTR_ADSP_APPS", .driver_data = true },
|
||||||
|
{.name = "PMIC_RTR_SOCCP_APPS", .driver_data = false },
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue