Possible bug in mxs-regulator

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Possible bug in mxs-regulator

跳至解决方案
1,651 次查看
lategoodbye
Senior Contributor I

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?

标签 (2)
标记 (4)
1 解答
1,327 次查看
igorpadykov
NXP Employee
NXP Employee

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!

-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,327 次查看
chrdcv
Contributor II

Hi Stefan! Thanks for the posting!

Can you explain-me how I can correct the code portion?

Thanks in advance,

Christian

0 项奖励
回复
1,327 次查看
lategoodbye
Senior Contributor I

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

1,327 次查看
chrdcv
Contributor II

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

0 项奖励
回复
1,328 次查看
igorpadykov
NXP Employee
NXP Employee

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!

-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复