void __init lasi_led_init(unsigned long lasi_hpa) { unsigned long datareg; switch (CPU_HVERSION) { /* Gecko machines have only one single LED, which can be permanently turned on by writing a zero into the power control register. */ case 0x600: /* Gecko (712/60) */ case 0x601: /* Gecko (712/80) */ case 0x602: /* Gecko (712/100) */ case 0x603: /* Anole 64 (743/64) */ case 0x604: /* Anole 100 (743/100) */ case 0x605: /* Gecko (712/120) */ datareg = lasi_hpa + 0x0000C000; gsc_writeb(0, datareg); return; /* no need to register the LED interrupt-function */ /* Mirage and Electra machines need special offsets */ case 0x60A: /* Mirage Jr (715/64) */ case 0x60B: /* Mirage 100 */ case 0x60C: /* Mirage 100+ */ case 0x60D: /* Electra 100 */ case 0x60E: /* Electra 120 */ datareg = lasi_hpa - 0x00020000; break; default: datareg = lasi_hpa + 0x0000C000; break; } register_led_driver(DISPLAY_MODEL_LASI, LED_CMD_REG_NONE, datareg); }
static void __init lasi_led_init(unsigned long lasi_hpa) { unsigned long datareg; switch (CPU_HVERSION) { case 0x600: case 0x601: case 0x602: case 0x603: case 0x604: case 0x605: datareg = lasi_hpa + 0x0000C000; gsc_writeb(0, datareg); return; case 0x60A: case 0x60B: case 0x60C: case 0x60D: case 0x60E: datareg = lasi_hpa - 0x00020000; break; default: datareg = lasi_hpa + 0x0000C000; break; } register_led_driver(DISPLAY_MODEL_LASI, LED_CMD_REG_NONE, datareg); }
int __init asp_init_chip(struct parisc_device *dev) { struct busdevice *asp; struct gsc_irq gsc_irq; int irq, ret; asp = kmalloc(sizeof(struct busdevice), GFP_KERNEL); if(!asp) return -ENOMEM; asp->version = gsc_readb(dev->hpa + ASP_VER_OFFSET) & 0xf; asp->name = (asp->version == 1) ? "Asp" : "Cutoff"; asp->hpa = ASP_INTERRUPT_ADDR; printk(KERN_INFO "%s version %d at 0x%lx found.\n", asp->name, asp->version, dev->hpa); /* the IRQ ASP should use */ ret = -EBUSY; irq = gsc_claim_irq(&gsc_irq, ASP_GSC_IRQ); if (irq < 0) { printk(KERN_ERR "%s(): cannot get GSC irq\n", __FUNCTION__); goto out; } ret = request_irq(gsc_irq.irq, busdev_barked, 0, "asp", asp); if (ret < 0) goto out; /* Save this for debugging later */ asp->parent_irq = gsc_irq.irq; asp->eim = ((u32) gsc_irq.txn_addr) | gsc_irq.txn_data; /* Program VIPER to interrupt on the ASP irq */ gsc_writel((1 << (31 - ASP_GSC_IRQ)),VIPER_INT_WORD); /* Done init'ing, register this driver */ ret = gsc_common_irqsetup(dev, asp); if (ret) goto out; fixup_child_irqs(dev, asp->busdev_region->data.irqbase, asp_choose_irq); /* Mongoose is a sibling of Asp, not a child... */ fixup_child_irqs(dev->parent, asp->busdev_region->data.irqbase, asp_choose_irq); /* initialize the chassis LEDs */ #ifdef CONFIG_CHASSIS_LCD_LED register_led_driver(DISPLAY_MODEL_OLD_ASP, LED_CMD_REG_NONE, (char *)ASP_LED_ADDR); #endif return 0; out: kfree(asp); return ret; }
static int __init asp_init_chip(struct parisc_device *dev) { struct gsc_irq gsc_irq; int ret; asp.version = gsc_readb(dev->hpa.start + ASP_VER_OFFSET) & 0xf; asp.name = (asp.version == 1) ? "Asp" : "Cutoff"; asp.hpa = ASP_INTERRUPT_ADDR; #ifdef CONFIG_DEBUG_PRINTK printk(KERN_INFO "%s version %d at 0x%lx found.\n", asp.name, asp.version, (unsigned long)dev->hpa.start); #else ; #endif /* the IRQ ASP should use */ ret = -EBUSY; dev->irq = gsc_claim_irq(&gsc_irq, ASP_GSC_IRQ); if (dev->irq < 0) { printk(KERN_ERR "%s(): cannot get GSC irq\n", __func__); goto out; } asp.eim = ((u32) gsc_irq.txn_addr) | gsc_irq.txn_data; ret = request_irq(gsc_irq.irq, gsc_asic_intr, 0, "asp", &asp); if (ret < 0) goto out; /* Program VIPER to interrupt on the ASP irq */ gsc_writel((1 << (31 - ASP_GSC_IRQ)),VIPER_INT_WORD); /* Done init'ing, register this driver */ ret = gsc_common_setup(dev, &asp); if (ret) goto out; gsc_fixup_irqs(dev, &asp, asp_choose_irq); /* Mongoose is a sibling of Asp, not a child... */ gsc_fixup_irqs(parisc_parent(dev), &asp, asp_choose_irq); /* initialize the chassis LEDs */ #ifdef CONFIG_CHASSIS_LCD_LED register_led_driver(DISPLAY_MODEL_OLD_ASP, LED_CMD_REG_NONE, ASP_LED_ADDR); #endif out: return ret; }
static int __init asp_init_chip(struct parisc_device *dev) { struct gsc_irq gsc_irq; int ret; asp.version = gsc_readb(dev->hpa.start + ASP_VER_OFFSET) & 0xf; asp.name = (asp.version == 1) ? "Asp" : "Cutoff"; asp.hpa = ASP_INTERRUPT_ADDR; printk(KERN_INFO "%s version %d at 0x%lx found.\n", asp.name, asp.version, (unsigned long)dev->hpa.start); ret = -EBUSY; dev->irq = gsc_claim_irq(&gsc_irq, ASP_GSC_IRQ); if (dev->irq < 0) { printk(KERN_ERR "%s(): cannot get GSC irq\n", __func__); goto out; } asp.eim = ((u32) gsc_irq.txn_addr) | gsc_irq.txn_data; ret = request_irq(gsc_irq.irq, gsc_asic_intr, 0, "asp", &asp); if (ret < 0) goto out; gsc_writel((1 << (31 - ASP_GSC_IRQ)),VIPER_INT_WORD); ret = gsc_common_setup(dev, &asp); if (ret) goto out; gsc_fixup_irqs(dev, &asp, asp_choose_irq); gsc_fixup_irqs(parisc_parent(dev), &asp, asp_choose_irq); #ifdef CONFIG_CHASSIS_LCD_LED register_led_driver(DISPLAY_MODEL_OLD_ASP, LED_CMD_REG_NONE, ASP_LED_ADDR); #endif out: return ret; }