diff --git a/drivers/rpmsg/Kconfig b/drivers/rpmsg/Kconfig index 7c2fd2f95951..cdf1a01d3e17 100644 --- a/drivers/rpmsg/Kconfig +++ b/drivers/rpmsg/Kconfig @@ -68,7 +68,7 @@ config RPMSG_VIRTIO select VIRTIO config MSM_RPM_SMD - bool "RPM driver using SMD protocol" + tristate "RPM driver using SMD protocol" help RPM is the dedicated hardware engine for managing shared SoC resources. This config adds driver support for using SMD as a diff --git a/drivers/rpmsg/rpm-smd.c b/drivers/rpmsg/rpm-smd.c index 04f96523c177..e90a7df71b65 100644 --- a/drivers/rpmsg/rpm-smd.c +++ b/drivers/rpmsg/rpm-smd.c @@ -1462,7 +1462,7 @@ static int smd_mask_receive_interrupt(bool mask, if (mask) { irq_chip->irq_mask(irq_data); if (cpumask) - irq_set_affinity(rpm->irq, cpumask); + irq_chip->irq_set_affinity(irq_data, cpumask, true); } else { irq_chip->irq_unmask(irq_data); } @@ -1481,6 +1481,8 @@ int msm_rpm_enter_sleep(bool print, const struct cpumask *cpumask) if (standalone) return 0; + if (probe_status) + return 0; ret = smd_mask_receive_interrupt(true, cpumask); if (!ret) { @@ -1502,6 +1504,9 @@ void msm_rpm_exit_sleep(void) if (standalone) return; + if (probe_status) + return; + smd_mask_receive_interrupt(false, NULL); } EXPORT_SYMBOL(msm_rpm_exit_sleep); @@ -1611,11 +1616,6 @@ fail: return probe_status; } -static void qcom_smd_rpm_remove(struct rpmsg_device *rpdev) -{ - of_platform_depopulate(&rpdev->dev); -} - static struct rpmsg_device_id rpmsg_driver_rpm_id_table[] = { { .name = "rpm_requests" }, { }, @@ -1623,7 +1623,6 @@ static struct rpmsg_device_id rpmsg_driver_rpm_id_table[] = { static struct rpmsg_driver qcom_smd_rpm_driver = { .probe = qcom_smd_rpm_probe, - .remove = qcom_smd_rpm_remove, .callback = qcom_smd_rpm_callback, .id_table = rpmsg_driver_rpm_id_table, .drv = { @@ -1642,4 +1641,11 @@ int __init msm_rpm_driver_init(void) return ret; } + +#ifdef MODULE +module_init(msm_rpm_driver_init); +#else postcore_initcall_sync(msm_rpm_driver_init); +#endif +MODULE_DESCRIPTION("Qualcomm Technologies, Inc. RPM-SMD Driver"); +MODULE_LICENSE("GPL v2"); diff --git a/include/soc/qcom/rpm-smd.h b/include/soc/qcom/rpm-smd.h index d09ad21468e4..a82606f95623 100644 --- a/include/soc/qcom/rpm-smd.h +++ b/include/soc/qcom/rpm-smd.h @@ -25,7 +25,7 @@ struct msm_rpm_kvp { uint32_t length; uint8_t *data; }; -#ifdef CONFIG_MSM_RPM_SMD +#if IS_ENABLED(CONFIG_MSM_RPM_SMD) /** * msm_rpm_request() - Creates a parent element to identify the * resource on the RPM, that stores the KVPs for different fields modified