Merge "msm: 9615: Add xo voting support" into msm-3.0
This commit is contained in:
committed by
QuIC Gerrit Code Review
commit
9b5df7bd94
@@ -257,6 +257,7 @@ config ARCH_MSM9615
|
||||
select MSM_RPM_REGULATOR
|
||||
select MULTI_IRQ_HANDLER
|
||||
select MSM_PM8X60 if PM
|
||||
select MSM_XO
|
||||
|
||||
config ARCH_MSM8625
|
||||
bool "MSM8625"
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/msm_spi.h>
|
||||
#include <mach/msm_bus_board.h>
|
||||
#include <mach/msm_xo.h>
|
||||
#include "timer.h"
|
||||
#include "devices.h"
|
||||
#include "board-9615.h"
|
||||
@@ -568,6 +569,7 @@ static void __init msm9615_common_init(void)
|
||||
msm9615_i2c_init();
|
||||
regulator_suppress_info_printing();
|
||||
platform_device_register(&msm9615_device_rpm_regulator);
|
||||
msm_xo_init();
|
||||
msm_clock_init(&msm9615_clock_init_data);
|
||||
msm9615_init_buses();
|
||||
msm9615_device_qup_spi_gsbi3.dev.platform_data =
|
||||
|
||||
@@ -115,7 +115,7 @@ late_initcall(msm_xo_debugfs_init);
|
||||
static int msm_xo_update_vote(struct msm_xo *xo)
|
||||
{
|
||||
int ret;
|
||||
unsigned vote, prev_vote = xo->mode;
|
||||
unsigned vote, prev_vote = xo->mode, ctx_set;
|
||||
struct msm_rpm_iv_pair cmd;
|
||||
|
||||
if (xo->votes[MSM_XO_MODE_ON])
|
||||
@@ -141,7 +141,11 @@ static int msm_xo_update_vote(struct msm_xo *xo)
|
||||
} else if (xo == &msm_xo_sources[MSM_XO_CXO]) {
|
||||
cmd.id = MSM_RPM_ID_CXO_CLK;
|
||||
cmd.value = msm_xo_sources[MSM_XO_CXO].mode ? 1 : 0;
|
||||
ret = msm_rpmrs_set_noirq(MSM_RPM_CTX_SET_0, &cmd, 1);
|
||||
if (cpu_is_msm9615())
|
||||
ctx_set = MSM_RPM_CTX_SET_SLEEP;
|
||||
else
|
||||
ctx_set = MSM_RPM_CTX_SET_0;
|
||||
ret = msm_rpmrs_set_noirq(ctx_set, &cmd, 1);
|
||||
} else {
|
||||
cmd.id = MSM_RPM_ID_CXO_BUFFERS;
|
||||
cmd.value = (msm_xo_sources[MSM_XO_TCXO_D0].mode << 0) |
|
||||
@@ -304,12 +308,25 @@ EXPORT_SYMBOL(msm_xo_put);
|
||||
int __init msm_xo_init(void)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
struct msm_rpm_iv_pair cmd[2];
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(msm_xo_sources); i++)
|
||||
INIT_LIST_HEAD(&msm_xo_sources[i].voters);
|
||||
|
||||
if (cpu_is_msm9615()) {
|
||||
cmd[0].id = MSM_RPM_ID_CXO_CLK;
|
||||
cmd[0].value = 1;
|
||||
ret = msm_rpmrs_set(MSM_RPM_CTX_SET_0, cmd, 1);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
cmd[0].id = MSM_RPM_ID_CXO_CLK;
|
||||
cmd[0].value = 0;
|
||||
ret = msm_rpmrs_set(MSM_RPM_CTX_SET_SLEEP, cmd, 1);
|
||||
goto out;
|
||||
}
|
||||
|
||||
cmd[0].id = MSM_RPM_ID_PXO_CLK;
|
||||
cmd[0].value = 1;
|
||||
cmd[1].id = MSM_RPM_ID_CXO_BUFFERS;
|
||||
|
||||
Reference in New Issue
Block a user