Changeset 3887


Ignore:
Timestamp:
01/21/08 02:33:31 (5 years ago)
Author:
werner
Message:

Applied glamo-platform-mmc.patch:

  • remove unimplemented S3C MMC voltage scaling API... not used on GTA-01 or -02
  • add two platform APIs for Glamo MMC, to set power and check if IRQ used
  • GTA-specific stuff should now all be in GTA machine specific files
  • UGLY_COUNTERPRODUCTIVE_MAINTAINER_COMMENTS_BE_GONE

Signed-off-by: Andy Green <andy@…>

gta02-core.patch:

  • arch/arm/mach-s3c2440/mach-gta02.c (cfg_pmu_vrail): comment out currenly unused function
  • arch/arm/mach-s3c2440/mach-gta02.c (gta02_mmc_set_power): added GTA02 power handling
  • arch/arm/mach-s3c2440/mach-gta02.c (glamo_irq_is_wired): platform-specific test for whether the interrupt line is operational

smedia-glamo.patch:

  • drivers/mfd/glamo/glamo-core.c (glamo_mmc_resources, glamo_mmc_dev, glamo_mci_def_pdata, glamo_probe): moved and extended MMC resources
  • drivers/mfd/glamo/glamo-core.c (glamo_engine_enable): added "default" to avoid noisy warnings
  • drivers/mfd/glamo/glamo-core.c (glamo_engine_reclock): removed debugging output
  • drivers/mfd/glamo/glamo-core.c (glamo_init_script): plenty of undocumented register changes :-(
  • drivers/mfd/glamo/glamo-core.c (detect_memsize): removed unused function
  • drivers/mfd/glamo/glamo-core.c (glamo_probe): invoke platform-specific test to check whether interrupt is operational
  • "drivers/mfd/glamo/glamo-core.c, drivers/mfd/glamo/glamo-core.h: moved macros defining Glamo memory allocation
  • drivers/mfd/glamo/glamo-core.h (glamo_mci_pdata), include/linux/glamofb.h (struct glamofb_platform_data): added platform data
Location:
branches/src/target/kernel/2.6.24.x/patches
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch

    r3849 r3887  
    33--- /dev/null 
    44+++ linux-2.6.24-rc7/arch/arm/mach-s3c2440/mach-gta02.c 
    5 @@ -0,0 +1,753 @@ 
     5@@ -0,0 +1,821 @@ 
    66+/* 
    77+ * linux/arch/arm/mach-s3c2440/mach-gta02.c 
     
    237237+}; 
    238238+ 
     239+#if 0 /* currently unused */ 
    239240+static void cfg_pmu_vrail(struct pmu_voltage_rail *vrail, char *name, 
    240241+                         unsigned int flags, unsigned int init, 
     
    246247+       vrail->voltage.max = max; 
    247248+} 
     249+#endif 
    248250+ 
    249251+static void mangle_pmu_pdata_by_system_rev(void) 
     
    402404+}; 
    403405+ 
    404 +static void gta02_mmc_set_power(unsigned char power_mode, unsigned short vdd) 
    405 +{ 
    406 +       printk(KERN_DEBUG "mmc_set_power(power_mode=%u, vdd=%u\n", 
    407 +              power_mode, vdd); 
    408 + 
    409 +       switch (system_rev) { 
    410 +       case GTA02v1_SYSTEM_REV: 
    411 +       case GTA02v2_SYSTEM_REV: 
    412 +       case GTA02v3_SYSTEM_REV: 
    413 +       case GTA02v4_SYSTEM_REV: 
    414 +               /* FIXME */ 
    415 +               break; 
    416 +       } 
    417 +} 
    418 + 
    419406+static struct s3c24xx_mci_pdata gta02_mmc_cfg = { 
    420407+       .gpio_detect    = GTA02v1_GPIO_nSD_DETECT, 
    421 +       .set_power      = &gta02_mmc_set_power, 
     408+       .set_power      = NULL, 
    422409+       .ocr_avail      = MMC_VDD_32_33, 
    423410+}; 
     
    576563+       }, 
    577564+}; 
     565+ 
     566+static int glamo_irq_is_wired(void) 
     567+{ 
     568+       int rc; 
     569+       int count = 0; 
     570+ 
     571+       /* 
     572+       * GTA02 S-Media IRQs prior to A5 are broken due to a lack of 
     573+       * a pullup on the INT# line.  Check for the bad behaviour. 
     574+       */ 
     575+       s3c2410_gpio_setpin(S3C2410_GPG4, 0); 
     576+       s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_OUTP); 
     577+       s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_INP); 
     578+       /* 
     579+       * we force it low ourselves for a moment and resume being input. 
     580+       * If there is a pullup, it won't stay low for long.  But if the 
     581+       * level converter is there as on < A5 revision, the weak keeper 
     582+       * on the input of the LC will hold the line low indefinitiely 
     583+       */ 
     584+       do 
     585+               rc = s3c2410_gpio_getpin(S3C2410_GPG4); 
     586+       while ((!rc) && ((count++) < 10)); 
     587+       if (rc) { /* it got pulled back up, it's good */ 
     588+               printk(KERN_INFO "Detected S-Media IRQ# pullup, " 
     589+               "enabling interrupt\n"); 
     590+               return 0; 
     591+       } else  /* Gah we can't work with this level converter */ 
     592+               printk(KERN_WARNING "** Detected bad IRQ# circuit found" 
     593+               " on pre-A5 GTA02: S-Media interrupt disabled **\n"); 
     594+       return -ENODEV; 
     595+} 
     596+ 
     597+ 
     598+static void 
     599+gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd) 
     600+{ 
     601+       int mv = 1650; 
     602+ 
     603+       printk(KERN_DEBUG "mmc_set_power(power_mode=%u, vdd=%u\n", 
     604+              power_mode, vdd); 
     605+ 
     606+       switch (system_rev) { 
     607+       case GTA02v1_SYSTEM_REV: 
     608+       case GTA02v2_SYSTEM_REV: 
     609+               break; 
     610+       case GTA02v3_SYSTEM_REV: 
     611+       case GTA02v4_SYSTEM_REV: 
     612+/*     case GTA02v5_SYSTEM_REV: */ 
     613+               /* depend on pcf50633 driver init */ 
     614+               if (!pcf50633_global) 
     615+                       while (!pcf50633_global) 
     616+                               msleep(10); 
     617+               switch (power_mode) { 
     618+               case MMC_POWER_ON: 
     619+               case MMC_POWER_UP: 
     620+                       /* select and set the voltage */ 
     621+                       if (vdd > 7) { 
     622+                               mv += 300 + 100 * (vdd - 8); 
     623+                               if (mv > 3500) 
     624+                                       mv = 3500; 
     625+                       } 
     626+                       pcf50633_voltage_set(pcf50633_global, 
     627+                                            PCF50633_REGULATOR_HCLDO, mv); 
     628+                       msleep(10); 
     629+                       pcf50633_onoff_set(pcf50633_global, 
     630+                                          PCF50633_REGULATOR_HCLDO, 1); 
     631+                       msleep(1); 
     632+                       break; 
     633+               case MMC_POWER_OFF: 
     634+                       pcf50633_onoff_set(pcf50633_global, 
     635+                                          PCF50633_REGULATOR_HCLDO, 0); 
     636+                       msleep(1); 
     637+                       break; 
     638+               } 
     639+               break; 
     640+       } 
     641+} 
    578642+ 
    579643+/* Smedia Glamo 3362 */ 
     
    607671+       //.spi_info     = &glamo_spi_cfg, 
    608672+       .spigpio_info   = &glamo_spigpio_cfg, 
     673+ 
     674+       /* glamo MMC function platform data */ 
     675+       .glamo_set_mci_power = gta02_glamo_mmc_set_power, 
     676+       .glamo_irq_is_wired = glamo_irq_is_wired, 
    609677+}; 
    610678+ 
  • branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch

    r3862 r3887  
    519519--- /dev/null 
    520520+++ linux-2.6.24-rc7/drivers/mfd/glamo/glamo-core.c 
    521 @@ -0,0 +1,1113 @@ 
     521@@ -0,0 +1,1097 @@ 
    522522+/* Smedia Glamo 336x/337x driver 
    523523+ * 
     
    560560+#include <linux/spinlock.h> 
    561561+#include <linux/glamofb.h> 
     562+#include <linux/mmc/mmc.h> 
     563+#include <linux/mmc/host.h> 
    562564+ 
    563565+#include <asm/io.h> 
     
    571573+#include "glamo-regs.h" 
    572574+#include "glamo-core.h" 
    573 + 
    574 +#ifndef UGLY_HACK_BE_GONE 
    575 +#ifdef CONFIG_MACH_NEO1973_GTA02 
    576 +#include <asm/arch/gpio.h> 
    577 +#include <asm/arch/regs-gpio.h> 
    578 +#include <asm/arch/regs-gpioj.h> 
    579 +#endif 
    580 +#endif /* UGLY_HACK_BE_GONE */ 
    581575+ 
    582576+#define RESSIZE(ressource) (((ressource)->end - (ressource)->start)+1) 
     
    676670+#endif 
    677671+ 
    678 +static struct resource glamo_mmc_resources[] = { 
    679 +       { 
    680 +               /* FIXME: those need to be incremented by parent base */ 
    681 +               .start  = GLAMO_REGOFS_MMC, 
    682 +               .end    = GLAMO_REGOFS_MPROC0 - 1, 
    683 +               .flags  = IORESOURCE_MEM 
    684 +       }, { 
    685 +               .start  = IRQ_GLAMO_MMC, 
    686 +               .end    = IRQ_GLAMO_MMC, 
    687 +               .flags  = IORESOURCE_IRQ, 
    688 +       }, 
    689 +}; 
    690 + 
    691 +static struct platform_device glamo_mmc_dev = { 
    692 +       .name           = "glamo-mmc", 
    693 +       .resource       = glamo_mmc_resources, 
    694 +       .num_resources  = ARRAY_SIZE(glamo_mmc_resources), 
    695 +}; 
    696 + 
    697672+static struct resource glamo_jpeg_resources[] = { 
    698673+       { 
     
    766741+       .name           = "glamo-spi-gpio", 
    767742+}; 
    768 + 
    769 +/* for the time being, we put the on-screen framebuffer into the lowest 
    770 + * VRAM space.  This should make the code easily compatible with the various 
    771 + * 2MB/4MB/8MB variants of the Smedia chips */ 
    772 +#define GLAMO_OFFSET_VRAM      0x800000 
    773 +#define GLAMO_OFFSET_FB        (GLAMO_OFFSET_VRAM) 
    774 + 
    775 +/* we only allocate the minimum possible size for the framebuffer to make 
    776 + * sure we have sufficient memory for other functions of the chip */ 
    777 +/*#define GLAMO_FB_SIZE        (640*480*4)*/   /* == 0x12c000 */ 
    778 +#define GLAMO_FB_SIZE  0x800000 
    779743+ 
    780744+static struct resource glamo_fb_resources[] = { 
     
    798762+       .num_resources  = ARRAY_SIZE(glamo_fb_resources), 
    799763+}; 
     764+ 
     765+static struct resource glamo_mmc_resources[] = { 
     766+       { 
     767+               /* FIXME: those need to be incremented by parent base */ 
     768+               .start  = GLAMO_REGOFS_MMC, 
     769+               .end    = GLAMO_REGOFS_MPROC0 - 1, 
     770+               .flags  = IORESOURCE_MEM 
     771+       }, { 
     772+               .start  = IRQ_GLAMO_MMC, 
     773+               .end    = IRQ_GLAMO_MMC, 
     774+               .flags  = IORESOURCE_IRQ, 
     775+       }, { /* our data buffer for MMC transfers */ 
     776+               .start  = GLAMO_OFFSET_FB + GLAMO_FB_SIZE, 
     777+               .end    = GLAMO_OFFSET_FB + GLAMO_FB_SIZE + 
     778+                                 GLAMO_MMC_BUFFER_SIZE - 1, 
     779+               .flags  = IORESOURCE_MEM 
     780+       }, 
     781+}; 
     782+ 
     783+static struct platform_device glamo_mmc_dev = { 
     784+       .name           = "glamo-mci", 
     785+       .resource       = glamo_mmc_resources, 
     786+       .num_resources  = ARRAY_SIZE(glamo_mmc_resources), 
     787+}; 
     788+ 
     789+struct glamo_mci_pdata glamo_mci_def_pdata = { 
     790+       .gpio_detect            = 0, 
     791+       .glamo_set_mci_power    = NULL, /* filled in from MFD platform data */ 
     792+       .ocr_avail              = MMC_VDD_32_33, 
     793+       .glamo_irq_is_wired     = NULL, /* filled in from MFD platform data */ 
     794+}; 
     795+EXPORT_SYMBOL_GPL(glamo_mci_def_pdata); 
     796+ 
     797+ 
    800798+ 
    801799+static void mangle_mem_resources(struct resource *res, int num_res, 
     
    951949+               break; 
    952950+       /* FIXME: Implementation */ 
     951+       default: 
     952+               break; 
    953953+       } 
    954954+       spin_unlock(&glamo->lock); 
     
    10831083+       if (val) { 
    10841084+               val--; 
    1085 +               printk(KERN_INFO "-------------- engine reclock val = %d\n", val); 
    10861085+               reg_set_bit_mask(glamo, reg, mask, val); 
    10871086+               msleep(5); /* wait some time to stabilize */ 
     
    11261125+       { GLAMO_REG_CLOCK_MMC,          0x1000 }, 
    11271126+       { GLAMO_REG_CLOCK_ISP,          0x1000 }, 
    1128 +       { GLAMO_REG_CLOCK_ISP,          0x2000 }, 
     1127+       { GLAMO_REG_CLOCK_ISP,          0x3000 }, 
    11291128+       { GLAMO_REG_CLOCK_JPEG,         0x1000 }, 
    11301129+       { GLAMO_REG_CLOCK_3D,           0x1000 }, 
    1131 +       { GLAMO_REG_CLOCK_3D,           0x2000 }, 
     1130+       { GLAMO_REG_CLOCK_3D,           0x3000 }, 
    11321131+       { GLAMO_REG_CLOCK_2D,           0x1000 }, 
    1133 +       { GLAMO_REG_CLOCK_2D,           0x2000 }, 
     1132+       { GLAMO_REG_CLOCK_2D,           0x3000 }, 
    11341133+       { GLAMO_REG_CLOCK_RISC1,        0x1000 }, 
    11351134+       { GLAMO_REG_CLOCK_MPEG,         0x3000 }, 
    11361135+       { GLAMO_REG_CLOCK_MPEG,         0x3000 }, 
    1137 +       { GLAMO_REG_CLOCK_MPROC,        0x100f }, 
     1136+       { GLAMO_REG_CLOCK_MPROC,        0x1000 }, 
    11381137+               { 0xfffe, 1 }, 
    11391138+       { GLAMO_REG_CLOCK_HOST,         0x0000 }, 
    11401139+       { GLAMO_REG_CLOCK_MEMORY,       0x0000 }, 
    1141 +       { GLAMO_REG_CLOCK_MEMORY,       0x0000 }, 
    11421140+       { GLAMO_REG_CLOCK_LCD,          0x0000 }, 
    11431141+       { GLAMO_REG_CLOCK_MMC,          0x0000 }, 
    1144 +//     { GLAMO_REG_CLOCK_ISP,          0x0000 }, 
    1145 +//     { GLAMO_REG_CLOCK_ISP,          0x0000 }, 
    1146 +//     { GLAMO_REG_CLOCK_JPEG,         0x0000 }, 
    1147 +//     { GLAMO_REG_CLOCK_3D,           0x0000 }, 
    1148 +//     { GLAMO_REG_CLOCK_3D,           0x0000 }, 
     1142+#if 0 
     1143+/* unused engines must be left in reset to stop MMC block read "blackouts" */ 
     1144+       { GLAMO_REG_CLOCK_ISP,          0x0000 }, 
     1145+       { GLAMO_REG_CLOCK_ISP,          0x0000 }, 
     1146+       { GLAMO_REG_CLOCK_JPEG,         0x0000 }, 
     1147+       { GLAMO_REG_CLOCK_3D,           0x0000 }, 
     1148+       { GLAMO_REG_CLOCK_3D,           0x0000 }, 
    11491149+       { GLAMO_REG_CLOCK_2D,           0x0000 }, 
    11501150+       { GLAMO_REG_CLOCK_2D,           0x0000 }, 
    1151 +//     { GLAMO_REG_CLOCK_RISC1,        0x0000 }, 
    1152 +//     { GLAMO_REG_CLOCK_MPEG,         0x0000 }, 
    1153 +//     { GLAMO_REG_CLOCK_MPEG,         0x0000 }, 
    1154 +       { GLAMO_REG_CLOCK_MPROC,        0x000f }, 
     1151+       { GLAMO_REG_CLOCK_RISC1,        0x0000 }, 
     1152+       { GLAMO_REG_CLOCK_MPEG,         0x0000 }, 
     1153+       { GLAMO_REG_CLOCK_MPEG,         0x0000 }, 
     1154+       { GLAMO_REG_CLOCK_MPROC,        0x0000 }, 
    11551155+               { 0xfffe, 1 }, 
     1156+#endif 
    11561157+       { GLAMO_REG_PLL_GEN1,           0x05db },       /* 48MHz */ 
    11571158+       { GLAMO_REG_PLL_GEN3,           0x09c3 },       /* 80MHz */ 
    1158 +               { 0xfffe, 300 }, 
    1159 +       { GLAMO_REG_IRQ_ENABLE,         0x01ff }, /* all 9 irqs, irq to base */ 
     1159+               { 0xfffe, 30 }, 
     1160+       /* 
     1161+        * b9 of this register MUST be zero to get any interrupts on INT# 
     1162+        * the other set bits enable all the engine interrupt sources 
     1163+        */ 
     1164+       { GLAMO_REG_IRQ_ENABLE,         0x01ff }, 
    11601165+       { GLAMO_REG_CLOCK_GEN6,         0x2000 }, 
    11611166+       { GLAMO_REG_CLOCK_GEN7,         0x0101 }, 
    11621167+       { GLAMO_REG_CLOCK_GEN8,         0x0100 }, 
    11631168+       { GLAMO_REG_CLOCK_HOST,         0x000d }, 
    1164 +       { 0x200,        0x0ef0 }, 
    1165 +       { 0x202,        0x07ff }, 
     1169+       { 0x200,        0x0cf0 /* 0x0ef0 */ }, 
     1170+       { 0x202,        0x0298 /* 0x07ff */ }, 
    11661171+       { 0x212,        0x0000 }, 
    11671172+       { 0x214,        0x4000 }, 
    11681173+       { 0x216,        0xf00e }, 
    1169 +       { GLAMO_REG_MEM_TYPE,           0x0874 }, 
    1170 +       { GLAMO_REG_MEM_GEN,            0xafaf }, 
    1171 +       { GLAMO_REG_MEM_TIMING1,        0x0108 }, 
    1172 +       { GLAMO_REG_MEM_TIMING2,        0x0010 }, 
     1174+       { GLAMO_REG_MEM_TYPE,           0x0874 }, /* 8MB, 16 word pg wr+rd */ 
     1175+       { GLAMO_REG_MEM_GEN,            0xbfbf }, /* 63 grants min + max */ 
     1176+       /* 
     1177+        * the register below originally 0x0108 makes unreliable Glamo MMC 
     1178+        * write operations.  Cranked to 0x05ad to add a wait state, the 
     1179+        * unreliability is not seen after 4GB of write / read testing 
     1180+        */ 
     1181+       { GLAMO_REG_MEM_TIMING1,        0x05ad }, 
     1182+       { GLAMO_REG_MEM_TIMING2,        0x0010 }, /* Taa = 3 MCLK */ 
    11731183+       { GLAMO_REG_MEM_TIMING3,        0x0000 }, 
    1174 +       { GLAMO_REG_MEM_TIMING4,        0x0000 }, 
     1184+       { GLAMO_REG_MEM_TIMING4,        0x0000 }, /* CE1# delay fall/rise */ 
    11751185+       { GLAMO_REG_MEM_TIMING5,        0x0000 }, 
    11761186+       { GLAMO_REG_MEM_TIMING6,        0x0000 }, 
    11771187+       { GLAMO_REG_MEM_TIMING7,        0x0000 }, 
    1178 +       { GLAMO_REG_MEM_TIMING8,        0x1002 }, 
    1179 +       { GLAMO_REG_MEM_TIMING9,        0x6006 }, 
     1188+       { GLAMO_REG_MEM_TIMING8,        0x1000 }, 
     1189+       { GLAMO_REG_MEM_TIMING9,        0x6000 }, 
    11801190+       { GLAMO_REG_MEM_TIMING10,       0x00ff }, 
    1181 +       { GLAMO_REG_MEM_TIMING11,       0x0001 }, 
     1191+       { GLAMO_REG_MEM_TIMING11,       0x0000 }, 
    11821192+       { GLAMO_REG_MEM_POWER1,         0x0020 }, 
    11831193+       { GLAMO_REG_MEM_POWER2,         0x0000 }, 
     
    11871197+               { 0xfffe, 1 }, 
    11881198+       { GLAMO_REG_MEM_DRAM1,          0xe100 }, 
    1189 +       { GLAMO_REG_MEM_DRAM2,          0x01d6 }, 
    1190 +       { GLAMO_REG_CLOCK_MEMORY,       0x000a }, 
    1191 +//     { GLAMO_REG_CLOCK_MEMORY,       0x000b }, 
    1192 +}; 
     1199+       { GLAMO_REG_MEM_DRAM2,          0x0155 }, 
     1200+       { GLAMO_REG_CLOCK_MEMORY,       0x000f }, 
     1201+}; 
     1202+ 
    11931203+ 
    11941204+#if 0 /* MM370 */ 
     
    13031313+} 
    13041314+ 
     1315+#if 0 
    13051316+#define MEMDETECT_RETRY        6 
    13061317+static unsigned int detect_memsize(struct glamo_core *glamo) 
     
    13641375+       return 0; 
    13651376+} 
     1377+#endif 
    13661378+ 
    13671379+/* Find out if we can support this version of the Glamo chip */ 
     
    14101422+{ 
    14111423+       int rc, irq; 
    1412 +       int count = 0; 
    14131424+       struct glamo_core *glamo; 
    14141425+ 
     
    14451456+       platform_device_register(&glamo_core_dev); 
    14461457+#endif 
     1458+       /* only remap the generic, hostbus and memory controller registers */ 
     1459+       glamo->base = ioremap(glamo->mem->start, GLAMO_REGOFS_VIDCAP); 
     1460+       if (!glamo->base) { 
     1461+               dev_err(&pdev->dev, "failed to ioremap() memory region\n"); 
     1462+               goto out_free; 
     1463+       } 
     1464+ 
     1465+       /* bring MCI specific stuff over from our MFD platform data */ 
     1466+       glamo_mci_def_pdata.glamo_set_mci_power = 
     1467+                                       glamo->pdata->glamo_set_mci_power; 
     1468+       glamo_mci_def_pdata.glamo_irq_is_wired = 
     1469+                                       glamo->pdata->glamo_irq_is_wired; 
    14471470+ 
    14481471+       glamo_mmc_dev.dev.parent = &pdev->dev; 
     1472+       /* we need it later to give to the engine enable and disable */ 
     1473+       glamo_mci_def_pdata.pglamo = glamo; 
    14491474+       mangle_mem_resources(glamo_mmc_dev.resource, 
    14501475+                            glamo_mmc_dev.num_resources, glamo->mem); 
     
    14911516+       } 
    14921517+ 
    1493 +       /* only remap the generic, hostbus and memory controller registers */ 
    1494 +       glamo->base = ioremap(glamo->mem->start, GLAMO_REGOFS_VIDCAP); 
    1495 +       if (!glamo->base) { 
    1496 +               dev_err(&pdev->dev, "failed to ioremap() memory region\n"); 
    1497 +               goto out_free; 
    1498 +       } 
    1499 + 
    15001518+       if (!glamo_supported(glamo)) { 
    15011519+               dev_err(&pdev->dev, "This Glamo is not supported\n"); 
     
    15121530+                glamo_pll_rate(glamo, GLAMO_PLL2)); 
    15131531+ 
    1514 +       /* FIXME: do we need to request_irq() it ? */ 
    1515 + 
    1516 +       dev_dbg(&glamo->pdev->dev, "interrupts\n"); 
    15171532+       for (irq = IRQ_GLAMO(0); irq <= IRQ_GLAMO(8); irq++) { 
    15181533+               set_irq_chip(irq, &glamo_irq_chip); 
     
    15211536+       } 
    15221537+ 
    1523 +#ifndef UGLY_HACK_BE_GONE 
    1524 +       /* 
    1525 +       * GTA-02 S-Media IRQs prior to A5 are broken due to a lack of 
    1526 +       * a pullup on the INT# line.  Check for the bad behaviour. 
    1527 +       */ 
    1528 +       s3c2410_gpio_setpin(S3C2410_GPG4, 0); 
    1529 +       s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_OUTP); 
    1530 +       s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_INP); 
    1531 +       /* 
    1532 +       * we force it low ourselves for a moment and resume being input. 
    1533 +       * If there is a pullup, it won't stay low for long.  But if the 
    1534 +       * level converter is there as on < A5 revision, the weak keeper 
    1535 +       * on the input of the LC will hold the line low indefinitiely 
    1536 +       */ 
    1537 +       do { 
    1538 +               rc = s3c2410_gpio_getpin(S3C2410_GPG4); 
    1539 +       } while ((!rc) && ((count++) < 10)); 
    1540 + 
    1541 +       if (rc) { /* it got pulled back up, it's good */ 
    1542 +               dev_info(&glamo->pdev->dev, "Detected S-Media IRQ# pullup, " 
    1543 +               "enabling interrupt\n"); 
     1538+       if (glamo->pdata->glamo_irq_is_wired && 
     1539+           !glamo->pdata->glamo_irq_is_wired()) { 
     1540+               set_irq_chained_handler(glamo->irq, glamo_irq_demux_handler); 
     1541+               set_irq_type(glamo->irq, IRQT_FALLING); 
    15441542+               glamo->irq_works = 1; 
    1545 +       } else { /* Gah we can't work with this level converter */ 
    1546 +               dev_warn(&glamo->pdev->dev, "** Detected bad IRQ# circuit found" 
    1547 +               " on pre-A5 GTA-02: S-Media interrupt disabled **\n"); 
     1543+       } else 
    15481544+               glamo->irq_works = 0; 
    1549 +       } 
    1550 +#endif /* UGLY_HACK_BE_GONE */ 
    1551 + 
    1552 +       if (!glamo->irq || !glamo->irq_works) 
    1553 +               dev_warn(&glamo->pdev->dev, "No IRQ support on this hardware!\n"); 
    1554 +       else { 
    1555 +               dev_dbg(&glamo->pdev->dev, "chained\n"); 
    1556 +               set_irq_chained_handler(glamo->irq, glamo_irq_demux_handler); 
    1557 +               dev_dbg(&glamo->pdev->dev, "type\n"); 
    1558 +               set_irq_type(glamo->irq, IRQT_FALLING); 
    1559 +       } 
    1560 + 
    15611545+       return 0; 
    15621546+ 
     
    25062490--- /dev/null 
    25072491+++ linux-2.6.24-rc7/include/linux/glamofb.h 
    2508 @@ -0,0 +1,34 @@ 
     2492@@ -0,0 +1,39 @@ 
    25092493+#ifndef _LINUX_GLAMOFB_H 
    25102494+#define _LINUX_GLAMOFB_H 
     
    25352519+       struct glamo_spigpio_info *spigpio_info; 
    25362520+       struct glamo_core *glamo; 
     2521+ 
     2522+       /* glamo mmc platform specific info */ 
     2523+       void            (*glamo_set_mci_power)(unsigned char power_mode, 
     2524+                                    unsigned short vdd); 
     2525+       int             (*glamo_irq_is_wired)(void); 
    25372526+}; 
    25382527+ 
     
    25782567--- /dev/null 
    25792568+++ linux-2.6.24-rc7/drivers/mfd/glamo/glamo-core.h 
    2580 @@ -0,0 +1,54 @@ 
     2569@@ -0,0 +1,79 @@ 
    25812570+#ifndef __GLAMO_CORE_H 
    25822571+#define __GLAMO_CORE_H 
    25832572+ 
     2573+/* for the time being, we put the on-screen framebuffer into the lowest 
     2574+ * VRAM space.  This should make the code easily compatible with the various 
     2575+ * 2MB/4MB/8MB variants of the Smedia chips */ 
     2576+#define GLAMO_OFFSET_VRAM      0x800000 
     2577+#define GLAMO_OFFSET_FB        (GLAMO_OFFSET_VRAM) 
     2578+ 
     2579+/* we only allocate the minimum possible size for the framebuffer to make 
     2580+ * sure we have sufficient memory for other functions of the chip */ 
     2581+//#define GLAMO_FB_SIZE        (640*480*4)     /* == 0x12c000 */ 
     2582+#define GLAMO_INTERNAL_RAM_SIZE 0x800000 
     2583+#define GLAMO_MMC_BUFFER_SIZE (64 * 1024) 
     2584+#define GLAMO_FB_SIZE  (GLAMO_INTERNAL_RAM_SIZE - GLAMO_MMC_BUFFER_SIZE) 
     2585+ 
     2586+ 
    25842587+struct glamo_core { 
    25852588+       int irq; 
    2586 +       int irq_works; /* 0 means PCB does not support Glamo IRQ - UGLY HACK */ 
     2589+       int irq_works; /* 0 means PCB does not support Glamo IRQ */ 
    25872590+       struct resource *mem; 
    25882591+       struct resource *mem_core; 
     
    26252628+       __NUM_GLAMO_ENGINES 
    26262629+}; 
     2630+ 
     2631+struct glamo_mci_pdata { 
     2632+       struct glamo_core * pglamo; 
     2633+       unsigned int    gpio_detect; 
     2634+       unsigned int    gpio_wprotect; 
     2635+       unsigned long   ocr_avail; 
     2636+       void            (*glamo_set_mci_power)(unsigned char power_mode, 
     2637+                                    unsigned short vdd); 
     2638+       int             (*glamo_irq_is_wired)(void); 
     2639+}; 
     2640+ 
    26272641+ 
    26282642+int glamo_engine_enable(struct glamo_core *glamo, enum glamo_engine engine); 
Note: See TracChangeset for help on using the changeset viewer.