Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[pandora-kernel.git] / arch / arm / mach-orion5x / ts78xx-setup.c
index 89682e1..8554707 100644 (file)
@@ -200,7 +200,7 @@ static void ts78xx_ts_nand_write_buf(struct mtd_info *mtd,
        int sz;
 
        if (off) {
-               sz = min(4 - off, len);
+               sz = min_t(int, 4 - off, len);
                writesb(io_base, buf, sz);
                buf += sz;
                len -= sz;
@@ -227,7 +227,7 @@ static void ts78xx_ts_nand_read_buf(struct mtd_info *mtd,
        int sz;
 
        if (off) {
-               sz = min(4 - off, len);
+               sz = min_t(int, 4 - off, len);
                readsb(io_base, buf, sz);
                buf += sz;
                len -= sz;
@@ -390,14 +390,29 @@ static void ts78xx_fpga_supports(void)
        case TS7800_REV_3:
        case TS7800_REV_4:
        case TS7800_REV_5:
+       case TS7800_REV_6:
+       case TS7800_REV_7:
+       case TS7800_REV_8:
+       case TS7800_REV_9:
                ts78xx_fpga.supports.ts_rtc.present = 1;
                ts78xx_fpga.supports.ts_nand.present = 1;
                ts78xx_fpga.supports.ts_rng.present = 1;
                break;
        default:
-               ts78xx_fpga.supports.ts_rtc.present = 0;
-               ts78xx_fpga.supports.ts_nand.present = 0;
-               ts78xx_fpga.supports.ts_rng.present = 0;
+               /* enable devices if magic matches */
+               switch ((ts78xx_fpga.id >> 8) & 0xffffff) {
+               case TS7800_FPGA_MAGIC:
+                       printk(KERN_WARNING "TS-7800 FPGA: unrecognized revision 0x%.2x\n",
+                                       ts78xx_fpga.id & 0xff);
+                       ts78xx_fpga.supports.ts_rtc.present = 1;
+                       ts78xx_fpga.supports.ts_nand.present = 1;
+                       ts78xx_fpga.supports.ts_rng.present = 1;
+                       break;
+               default:
+                       ts78xx_fpga.supports.ts_rtc.present = 0;
+                       ts78xx_fpga.supports.ts_nand.present = 0;
+                       ts78xx_fpga.supports.ts_rng.present = 0;
+               }
        }
 }
 
@@ -609,6 +624,7 @@ MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC")
        .boot_params    = 0x00000100,
        .init_machine   = ts78xx_init,
        .map_io         = ts78xx_map_io,
+       .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
        .timer          = &orion5x_timer,
 MACHINE_END