Hi Magnus, Magnus Lilja schrieb: > Hi, > > Jens Gehrlein wrote: >> +static int adjust_voltages (void) >> +{ >> + u32 reg; >> + u32 val; >> + static struct spi_slave *slave = NULL; >> + >> + slave = spi_setup_slave(1, 0, 1000000, >> + SPI_MODE_2 | SPI_CS_HIGH); >> + if (!slave) >> + return -1; >> + >> + if (spi_claim_bus(slave)) >> + return -1; >> + >> + /* Set PMIC arbitration switchers */ >> + val = 0x000020; >> + reg = 0x14000000 | val | 0x80000000; > > It seems like it's time to create a MC13783 header file containing some > helper macros and symbolic names to the 13783's registers so we can write: > reg = MC13783_READ_CMD(MC_REG_FOO); > ... > val = something_symbolic | something_symbolic2; > reg = MC13783_WRITE_CMD(MC_REG_FOO, val); > ... > etc.. > > > Also, I'm pretty sure some other i.MX31 boards could benefit from changing > some voltages in U-boot so perhaps we could have a mc13783-reg.c (-reg as in > regulators) file containing stuff like mc13783_set_regulator(MC_VRFDIG, > VRFDIG_1V8)?
Basically, I agree. But would you accept the current patch for now? The new routines and macros later could be implemented later. Kind regards, Jens ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users