diff options
Diffstat (limited to 'drivers/interconnect/qcom/smd-rpm.c')
| -rw-r--r-- | drivers/interconnect/qcom/smd-rpm.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/drivers/interconnect/qcom/smd-rpm.c b/drivers/interconnect/qcom/smd-rpm.c index dc8ff8d133a9..8316c87a2c60 100644 --- a/drivers/interconnect/qcom/smd-rpm.c +++ b/drivers/interconnect/qcom/smd-rpm.c @@ -8,14 +8,13 @@ #include <linux/interconnect-provider.h> #include <linux/module.h> -#include <linux/of.h> -#include <linux/of_platform.h> #include <linux/platform_device.h> #include <linux/soc/qcom/smd-rpm.h> -#include "smd-rpm.h" +#include "icc-rpm.h" #define RPM_KEY_BW 0x00007762 +#define QCOM_RPM_SMD_KEY_RATE 0x007a484b static struct qcom_smd_rpm *icc_smd_rpm; @@ -44,11 +43,29 @@ int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val) } EXPORT_SYMBOL_GPL(qcom_icc_rpm_smd_send); -static int qcom_icc_rpm_smd_remove(struct platform_device *pdev) +int qcom_icc_rpm_set_bus_rate(const struct rpm_clk_resource *clk, int ctx, u32 rate) { - icc_smd_rpm = NULL; + struct clk_smd_rpm_req req = { + .key = cpu_to_le32(QCOM_RPM_SMD_KEY_RATE), + .nbytes = cpu_to_le32(sizeof(u32)), + }; - return 0; + /* Branch clocks are only on/off */ + if (clk->branch) + rate = !!rate; + + req.value = cpu_to_le32(rate); + return qcom_rpm_smd_write(icc_smd_rpm, + ctx, + clk->resource_type, + clk->clock_id, + &req, sizeof(req)); +} +EXPORT_SYMBOL_GPL(qcom_icc_rpm_set_bus_rate); + +static void qcom_icc_rpm_smd_remove(struct platform_device *pdev) +{ + icc_smd_rpm = NULL; } static int qcom_icc_rpm_smd_probe(struct platform_device *pdev) |
