From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Gehrlein Date: Tue, 08 Jul 2008 10:55:48 +0200 Subject: [U-Boot-Users] [PATCH 07/10] [ARM] TQMA31: adjust voltage regulators in PMIC MC13738 In-Reply-To: <486E6BC6.9020706@gmail.com> References: <20080704144552.12049.55374.stgit@tq-sewsrv-4.tq-net.de> <20080704145011.12049.75795.stgit@tq-sewsrv-4.tq-net.de> <486E6BC6.9020706@gmail.com> Message-ID: <48732B94.9040101@tqs.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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