[U-Boot-Users] [PATCH 07/10] [ARM] TQMA31: adjust voltage regulators in PMIC MC13738

Magnus Lilja
2008-07-09T16:01:14Z

Hi Jens,

On Tue, Jul 8, 2008 at 10:55 AM, Jens Gehrlein <sew_s@tqs.de> wrote:
> 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.

I don't think it's up to me to ACK or NAK this, but I can accept the
current patch.

Regards, Magnus Lilja