Possible bug in mxs-regulator

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Possible bug in mxs-regulator

Jump to solution
1,651 Views
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?

Labels (2)
1 Solution
1,327 Views
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!

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

View solution in original post

0 Kudos
Reply
4 Replies
1,327 Views
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 Kudos
Reply
1,327 Views
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 Views
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 Kudos
Reply
1,328 Views
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 Kudos
Reply