drivers: rpm-smd: Add support to make rpm-smd as module
Add support to make rpm-smd as module driver. Change-Id: Iddc66bd58ddc1b4c821768c7e368d620ab964322 Signed-off-by: Raghavendra Kakarla <rkakarla@codeaurora.org>
This commit is contained in:
parent
a6ae9f824c
commit
25ca211627
@ -68,7 +68,7 @@ config RPMSG_VIRTIO
|
|||||||
select VIRTIO
|
select VIRTIO
|
||||||
|
|
||||||
config MSM_RPM_SMD
|
config MSM_RPM_SMD
|
||||||
bool "RPM driver using SMD protocol"
|
tristate "RPM driver using SMD protocol"
|
||||||
help
|
help
|
||||||
RPM is the dedicated hardware engine for managing shared SoC
|
RPM is the dedicated hardware engine for managing shared SoC
|
||||||
resources. This config adds driver support for using SMD as a
|
resources. This config adds driver support for using SMD as a
|
||||||
|
@ -1462,7 +1462,7 @@ static int smd_mask_receive_interrupt(bool mask,
|
|||||||
if (mask) {
|
if (mask) {
|
||||||
irq_chip->irq_mask(irq_data);
|
irq_chip->irq_mask(irq_data);
|
||||||
if (cpumask)
|
if (cpumask)
|
||||||
irq_set_affinity(rpm->irq, cpumask);
|
irq_chip->irq_set_affinity(irq_data, cpumask, true);
|
||||||
} else {
|
} else {
|
||||||
irq_chip->irq_unmask(irq_data);
|
irq_chip->irq_unmask(irq_data);
|
||||||
}
|
}
|
||||||
@ -1481,6 +1481,8 @@ int msm_rpm_enter_sleep(bool print, const struct cpumask *cpumask)
|
|||||||
if (standalone)
|
if (standalone)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (probe_status)
|
||||||
|
return 0;
|
||||||
|
|
||||||
ret = smd_mask_receive_interrupt(true, cpumask);
|
ret = smd_mask_receive_interrupt(true, cpumask);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
@ -1502,6 +1504,9 @@ void msm_rpm_exit_sleep(void)
|
|||||||
if (standalone)
|
if (standalone)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (probe_status)
|
||||||
|
return;
|
||||||
|
|
||||||
smd_mask_receive_interrupt(false, NULL);
|
smd_mask_receive_interrupt(false, NULL);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(msm_rpm_exit_sleep);
|
EXPORT_SYMBOL(msm_rpm_exit_sleep);
|
||||||
@ -1611,11 +1616,6 @@ fail:
|
|||||||
return probe_status;
|
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[] = {
|
static struct rpmsg_device_id rpmsg_driver_rpm_id_table[] = {
|
||||||
{ .name = "rpm_requests" },
|
{ .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 = {
|
static struct rpmsg_driver qcom_smd_rpm_driver = {
|
||||||
.probe = qcom_smd_rpm_probe,
|
.probe = qcom_smd_rpm_probe,
|
||||||
.remove = qcom_smd_rpm_remove,
|
|
||||||
.callback = qcom_smd_rpm_callback,
|
.callback = qcom_smd_rpm_callback,
|
||||||
.id_table = rpmsg_driver_rpm_id_table,
|
.id_table = rpmsg_driver_rpm_id_table,
|
||||||
.drv = {
|
.drv = {
|
||||||
@ -1642,4 +1641,11 @@ int __init msm_rpm_driver_init(void)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MODULE
|
||||||
|
module_init(msm_rpm_driver_init);
|
||||||
|
#else
|
||||||
postcore_initcall_sync(msm_rpm_driver_init);
|
postcore_initcall_sync(msm_rpm_driver_init);
|
||||||
|
#endif
|
||||||
|
MODULE_DESCRIPTION("Qualcomm Technologies, Inc. RPM-SMD Driver");
|
||||||
|
MODULE_LICENSE("GPL v2");
|
||||||
|
@ -25,7 +25,7 @@ struct msm_rpm_kvp {
|
|||||||
uint32_t length;
|
uint32_t length;
|
||||||
uint8_t *data;
|
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
|
* msm_rpm_request() - Creates a parent element to identify the
|
||||||
* resource on the RPM, that stores the KVPs for different fields modified
|
* resource on the RPM, that stores the KVPs for different fields modified
|
||||||
|
Loading…
Reference in New Issue
Block a user