I think i've found a bug in the current mxs-regulator implementation ( imx_2.6.35_maintain ).
In the file root/arch/arm/mach-mx28/power.c the mode handling is only correct for vddio. The current implementation uses bit 17 for all regulators (vddio, vdda, vddd) to get and set regulator mode. But that's wrong, according to the reference manual DISABLE_STEPPING is different for each regulator.
static int set_mode(struct mxs_regulator *sreg, int mode) { int ret = 0; u32 val; switch (mode) { case REGULATOR_MODE_FAST: val = __raw_readl(sreg->rdata->control_reg); __raw_writel(val | (1 << 17), sreg->rdata->control_reg); break; case REGULATOR_MODE_NORMAL: val = __raw_readl(sreg->rdata->control_reg); __raw_writel(val & ~(1<<17), sreg->rdata->control_reg); break; default: ret = -EINVAL; break; } return ret; } static int get_mode(struct mxs_regulator *sreg) { u32 val = __raw_readl(sreg->rdata->control_reg) & (1 << 17); return val ? REGULATOR_MODE_FAST : REGULATOR_MODE_NORMAL; }
Can anyone confirm?
解決済! 解決策の投稿を見る。
Hi Stefan
yes your finding is true, i.MX28 DISABLE_STEPPING bit
has different position for regulators.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Stefan! Thanks for the posting!
Can you explain-me how I can correct the code portion?
Thanks in advance,
Christian
Hi Christian,
for sure. Currently i'm porting the mxs-regulator for mainline. Here is the bugfix for my porting:
https://github.com/lategoodbye/mxs-regulator/commit/19ec59c871afd7666e40b4bd2209b7ede7ebf1d1
May be, you can adapt it.
Stefan
Thanks Stefan! I will try patches my files and see what happens!
Could you please see my post about troubles into the IMX287 PMU? https://community.freescale.com/thread/331410
Thanks in advance,
Christian
Hi Stefan
yes your finding is true, i.MX28 DISABLE_STEPPING bit
has different position for regulators.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------