i.MX31/Gigabeat S: Just a little paranoid change to switcher write to active regulators method, to keep things localized a bit more from global data pool, for safety's sake. It's going to Mars afterall.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25801 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2010-05-04 10:37:06 +00:00
parent 931e06de64
commit 5edcb11f44

View file

@ -423,6 +423,7 @@ static void dptc_int(unsigned long pmcr0)
{
const union dvfs_dptc_voltage_table_entry *entry;
uint32_t sw1a, sw1advs, sw1bdvs, sw1bstby;
uint32_t switchers0, switchers1;
int wp = dptc_wp;
@ -464,10 +465,12 @@ static void dptc_int(unsigned long pmcr0)
sw1bdvs = check_regulator_setting(entry->sw1bdvs);
sw1bstby = check_regulator_setting(entry->sw1bstby);
dptc_regs_buf[0] = dptc_reg_shadows[0] |
switchers0 = dptc_reg_shadows[0] & ~(MC13783_SW1A | MC13783_SW1ADVS);
dptc_regs_buf[0] = switchers0 |
sw1a << MC13783_SW1A_POS | /* SW1A */
sw1advs << MC13783_SW1ADVS_POS; /* SW1ADVS */
dptc_regs_buf[1] = dptc_reg_shadows[1] |
switchers1 = dptc_reg_shadows[1] & ~(MC13783_SW1BDVS | MC13783_SW1BSTBY);
dptc_regs_buf[1] = switchers1 |
sw1bdvs << MC13783_SW1BDVS_POS | /* SW1BDVS */
sw1bstby << MC13783_SW1BSTBY_POS; /* SW1BSTBY */
@ -503,10 +506,6 @@ static void dptc_init(void)
/* Shadow the regulator registers */
mc13783_read_regs(dptc_pmic_regs, dptc_reg_shadows, 2);
/* Pre-mask the fields we change */
dptc_reg_shadows[0] &= ~(MC13783_SW1A | MC13783_SW1ADVS);
dptc_reg_shadows[1] &= ~(MC13783_SW1BDVS | MC13783_SW1BSTBY);
/* Set default, safe working point. */
dptc_new_wp(DPTC_WP_DEFAULT);