From 7cfd418a9bce7d092b671c0ea42520f68f6b6df1 Mon Sep 17 00:00:00 2001 From: Rob Purchase Date: Sun, 11 Oct 2009 21:12:06 +0000 Subject: D2: Reduce binsize a bit by using arrays for the PMU initialisation. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23120 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/pcf50606.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'firmware/drivers/pcf50606.c') diff --git a/firmware/drivers/pcf50606.c b/firmware/drivers/pcf50606.c index 4ef747fe80..d44718c58b 100644 --- a/firmware/drivers/pcf50606.c +++ b/firmware/drivers/pcf50606.c @@ -54,15 +54,21 @@ int pcf50606_read_multiple(int address, unsigned char* buf, int count) void pcf50606_init(void) { #ifdef COWON_D2 - /* Set outputs as per OF - further investigation required. */ - pcf50606_write(PCF5060X_DCDEC1, 0xe4); - pcf50606_write(PCF5060X_IOREGC, 0xf5); - pcf50606_write(PCF5060X_D1REGC1, 0xf5); - pcf50606_write(PCF5060X_D2REGC1, 0xe9); - pcf50606_write(PCF5060X_D3REGC1, 0xf8); /* WM8985 3.3v */ - pcf50606_write(PCF5060X_DCUDC1, 0xe7); - pcf50606_write(PCF5060X_LPREGC1, 0x0); - pcf50606_write(PCF5060X_LPREGC2, 0x2); + /* Set outputs as per OF - further investigation required. */ + static const char init_data[] = + {PCF5060X_DCDEC1, 0xe4, + PCF5060X_IOREGC, 0xf5, + PCF5060X_D1REGC1, 0xf5, + PCF5060X_D2REGC1, 0xe9, + PCF5060X_D3REGC1, 0xf8, /* WM8985 3.3v */ + PCF5060X_DCUDC1, 0xe7, + PCF5060X_LPREGC1, 0x0, + PCF5060X_LPREGC2, 0x2, + 0}; + + const char* ptr; + for (ptr = init_data; *ptr != 0; ptr += 2) + pcf50606_write(ptr[0], ptr[1]); #endif } -- cgit v1.2.3