summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/clkctrl-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-08-31 01:24:51 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2012-08-31 01:24:51 +0200
commit3a1ba755c6ea003141410facb62af04ccfb7252f (patch)
tree87e282a90a9634622c651f0225738dd4b454cbdb /firmware/target/arm/imx233/clkctrl-imx233.c
parentee2135943757a7104e4e47af4a563639790afab4 (diff)
downloadrockbox-3a1ba755c6ea003141410facb62af04ccfb7252f.tar.gz
rockbox-3a1ba755c6ea003141410facb62af04ccfb7252f.tar.bz2
rockbox-3a1ba755c6ea003141410facb62af04ccfb7252f.zip
imx233: fix auto slow divisor
The divisor must be set only when auto-slow is disabled. Change-Id: I31ed94f43a7c9deb80275dc73f8e3c78463b54c0
Diffstat (limited to 'firmware/target/arm/imx233/clkctrl-imx233.c')
-rw-r--r--firmware/target/arm/imx233/clkctrl-imx233.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/target/arm/imx233/clkctrl-imx233.c b/firmware/target/arm/imx233/clkctrl-imx233.c
index 7b4869c749..ccccaae59d 100644
--- a/firmware/target/arm/imx233/clkctrl-imx233.c
+++ b/firmware/target/arm/imx233/clkctrl-imx233.c
@@ -225,8 +225,11 @@ bool imx233_clkctrl_is_usb_pll_enabled(void)
void imx233_clkctrl_set_auto_slow_divisor(enum imx233_as_div_t div)
{
- __REG_CLR(HW_CLKCTRL_HBUS) = HW_CLKCTRL_HBUS__SLOW_DIV_BM;
- __REG_SET(HW_CLKCTRL_HBUS) = div;
+ /* the SLOW_DIV must only be set when auto-slow is disabled */
+ bool old_status = imx233_clkctrl_is_auto_slow_enabled();
+ imx233_clkctrl_enable_auto_slow(false);
+ __FIELD_SET(HW_CLKCTRL_HBUS, SLOW_DIV, div);
+ imx233_clkctrl_enable_auto_slow(old_status);
}
enum imx233_as_div_t imx233_clkctrl_get_auto_slow_divisor(void)