diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-12-05 18:46:03 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-12-06 14:58:57 -0500 |
commit | f924e1e989b0bdaf6472668400d67a2142cb6b60 (patch) | |
tree | 7da7eb703e6c302c50bcc383f32bb576f474c595 /drivers/ssb/driver_chipcommon.c | |
parent | a4855f39d4eb3f550ca5f4aac79bd999da42dc54 (diff) | |
download | op-kernel-dev-f924e1e989b0bdaf6472668400d67a2142cb6b60.zip op-kernel-dev-f924e1e989b0bdaf6472668400d67a2142cb6b60.tar.gz |
ssb: get alp clock from devices with PMU
If there is a PMU in the device, get the alp clock from that part and
do not assume 20000000.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb/driver_chipcommon.c')
-rw-r--r-- | drivers/ssb/driver_chipcommon.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/ssb/driver_chipcommon.c b/drivers/ssb/driver_chipcommon.c index e9d2ca1..603b630 100644 --- a/drivers/ssb/driver_chipcommon.c +++ b/drivers/ssb/driver_chipcommon.c @@ -280,6 +280,14 @@ static void calc_fast_powerup_delay(struct ssb_chipcommon *cc) cc->fast_pwrup_delay = tmp; } +static u32 ssb_chipco_alp_clock(struct ssb_chipcommon *cc) +{ + if (cc->capabilities & SSB_CHIPCO_CAP_PMU) + return ssb_pmu_get_alp_clock(cc); + + return 20000000; +} + void ssb_chipcommon_init(struct ssb_chipcommon *cc) { if (!cc->dev) @@ -473,12 +481,7 @@ int ssb_chipco_serial_init(struct ssb_chipcommon *cc, chipco_read32(cc, SSB_CHIPCO_CORECTL) | SSB_CHIPCO_CORECTL_UARTCLK0); } else if ((ccrev >= 11) && (ccrev != 15)) { - /* Fixed ALP clock */ - baud_base = 20000000; - if (cc->capabilities & SSB_CHIPCO_CAP_PMU) { - /* FIXME: baud_base is different for devices with a PMU */ - SSB_WARN_ON(1); - } + baud_base = ssb_chipco_alp_clock(cc); div = 1; if (ccrev >= 21) { /* Turn off UART clock before switching clocksource. */ |