freemyipod r581 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r580‎ | r581 | r582 >
Date:21:51, 9 February 2011
Author:theseven
Status:new
Tags:
Comment:
emCORE: Do some undervolting. Please complain if this breaks something. The LCD types I don't have access to have been set to insanely low voltages to make people owning them speak up. This will most likely manifest itself as very poor LCD contrast.
Modified paths:
  • /emcore/trunk/target/ipodnano3g/lcd.c (modified) (history)
  • /emcore/trunk/target/ipodnano3g/pmu.c (modified) (history)

Diff [purge]

Index: emcore/trunk/target/ipodnano3g/pmu.c
@@ -52,6 +52,8 @@
5353 void pmu_init()
5454 {
5555 mutex_init(&pmumutex);
 56+ pmu_write(0x1e, 0x0e); // Vcore @ 0.975V
 57+ pmu_write(0x22, 0x22); // Vmem @ 1.475V
5658 }
5759
5860 int pmu_read_adc(unsigned int adc)
Index: emcore/trunk/target/ipodnano3g/lcd.c
@@ -41,20 +41,6 @@
4242 static bool lcd_in_irq IDATA_ATTR;
4343
4444
45 -void lcd_init()
46 -{
47 - mutex_init(&lcd_mutex);
48 - wakeup_init(&lcd_wakeup);
49 - lcd_in_irq = false;
50 - lcd_dma_busy = true;
51 - clockgate_dma(0, 4, true);
52 - if (!(DMAC0C4CONFIG & 1))
53 - {
54 - lcd_dma_busy = false;
55 - clockgate_dma(0, 4, false);
56 - }
57 -}
58 -
5945 int lcd_get_width()
6046 {
6147 return LCD_WIDTH;
@@ -95,6 +81,31 @@
9682 return (PDAT6 & 0x30) >> 4;
9783 }
9884
 85+void lcd_init()
 86+{
 87+ mutex_init(&lcd_mutex);
 88+ wakeup_init(&lcd_wakeup);
 89+ lcd_in_irq = false;
 90+ lcd_dma_busy = true;
 91+ clockgate_dma(0, 4, true);
 92+ if (!(DMAC0C4CONFIG & 1))
 93+ {
 94+ lcd_dma_busy = false;
 95+ clockgate_dma(0, 4, false);
 96+ }
 97+ switch (lcd_detect())
 98+ {
 99+ case 1:
 100+ pmu_write(0x31, 0x0e); // Vlcd @ 2.400V
 101+ break;
 102+ case 2:
 103+ pmu_write(0x31, 0x12); // Vlcd @ 2.700V
 104+ break;
 105+ default:
 106+ pmu_write(0x31, 0x0b); // Vlcd @ 2.000V
 107+ }
 108+}
 109+
99110 bool displaylcd_busy() ICODE_ATTR;
100111 bool displaylcd_busy()
101112 {