static void sa1111_start_hc(struct sa1111_dev *dev) { unsigned int usb_rst = 0; printk(KERN_DEBUG __FILE__ ": starting SA-1111 OHCI USB Controller\n"); #ifdef CONFIG_SA1100_BADGE4 if (machine_is_badge4()) { badge4_set_5V(BADGE4_5V_USB, 1); } #endif if (machine_is_xp860() || machine_has_neponset() || machine_is_pfs168() || machine_is_badge4()) usb_rst = USB_RESET_PWRSENSELOW | USB_RESET_PWRCTRLLOW; /* * Configure the power sense and control lines. Place the USB * host controller in reset. */ sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET, dev->mapbase + SA1111_USB_RESET); /* * Now, carefully enable the USB clock, and take * the USB host controller out of reset. */ sa1111_enable_device(dev); udelay(11); sa1111_writel(usb_rst, dev->mapbase + SA1111_USB_RESET); }
static int ps2_open(struct serio *io) { struct ps2if *ps2if = io->port_data; int ret; sa1111_enable_device(ps2if->dev); ret = request_irq(ps2if->dev->irq[0], ps2_rxint, 0, SA1111_DRIVER_NAME(ps2if->dev), ps2if); if (ret) { printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n", ps2if->dev->irq[0], ret); return ret; } ret = request_irq(ps2if->dev->irq[1], ps2_txint, 0, SA1111_DRIVER_NAME(ps2if->dev), ps2if); if (ret) { printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n", ps2if->dev->irq[1], ret); free_irq(ps2if->dev->irq[0], ps2if); return ret; } ps2if->open = 1; enable_irq_wake(ps2if->dev->irq[0]); sa1111_writel(PS2CR_ENA, ps2if->base + SA1111_PS2CR); return 0; }
static void sa1111_start_hc(struct sa1111_dev *dev) { unsigned int usb_rst = 0; printk(KERN_DEBUG __FILE__ ": starting SA-1111 OHCI USB Controller\n"); #ifdef CONFIG_SA1100_BADGE4 if (machine_is_badge4()) { badge4_set_5V(BADGE4_5V_USB, 1); } #endif if (machine_is_xp860() || machine_has_neponset() || machine_is_pfs168() || machine_is_badge4()) usb_rst = USB_RESET_PWRSENSELOW | USB_RESET_PWRCTRLLOW; sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET, dev->mapbase + SA1111_USB_RESET); sa1111_enable_device(dev); udelay(11); sa1111_writel(usb_rst, dev->mapbase + SA1111_USB_RESET); }
static int sa1111_start_hc(struct sa1111_dev *dev) { unsigned int usb_rst = 0; int ret; dev_dbg(&dev->dev, "starting SA-1111 OHCI USB Controller\n"); if (machine_is_xp860() || machine_has_neponset() || machine_is_pfs168() || machine_is_badge4()) usb_rst = USB_RESET_PWRSENSELOW | USB_RESET_PWRCTRLLOW; /* * Configure the power sense and control lines. Place the USB * host controller in reset. */ sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET, dev->mapbase + USB_RESET); /* * Now, carefully enable the USB clock, and take * the USB host controller out of reset. */ ret = sa1111_enable_device(dev); if (ret == 0) { udelay(11); sa1111_writel(usb_rst, dev->mapbase + USB_RESET); } return ret; }
static int pcmcia_probe(struct sa1111_dev *dev) { void __iomem *base; int ret; ret = sa1111_enable_device(dev); if (ret) return ret; dev_set_drvdata(&dev->dev, NULL); if (!request_mem_region(dev->res.start, 512, SA1111_DRIVER_NAME(dev))) { sa1111_disable_device(dev); return -EBUSY; } base = dev->mapbase; /* * Initialise the suspend state. */ writel_relaxed(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + PCSSR); writel_relaxed(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR); ret = -ENODEV; #ifdef CONFIG_SA1100_BADGE4 if (machine_is_badge4()) ret = pcmcia_badge4_init(dev); #endif #ifdef CONFIG_SA1100_JORNADA720 if (machine_is_jornada720()) ret = pcmcia_jornada720_init(dev); #endif #ifdef CONFIG_ARCH_LUBBOCK if (machine_is_lubbock()) ret = pcmcia_lubbock_init(dev); #endif #ifdef CONFIG_ASSABET_NEPONSET if (machine_is_assabet()) ret = pcmcia_neponset_init(dev); #endif if (ret) { release_mem_region(dev->res.start, 512); sa1111_disable_device(dev); } return ret; }
static int __init adsbitsy_init(void) { int ret; if (!machine_is_adsbitsy()) return -ENODEV; /* * Ensure that the memory bus request/grant signals are setup, * and the grant is held in its inactive state */ sa1110_mb_disable(); /* * Reset SA1111 */ GPCR |= GPIO_GPIO26; udelay(1000); GPSR |= GPIO_GPIO26; /* * Probe for SA1111. */ ret = platform_add_devices(devices, ARRAY_SIZE(devices)); if (ret < 0) return ret; /* * Enable PWM control for LCD */ sa1111_enable_device(SKPCR_PWMCLKEN); SKPWM0 = 0x7F; // VEE SKPEN0 = 1; SKPWM1 = 0x01; // Backlight SKPEN1 = 1; return 0; }
static int pcmcia_probe(struct sa1111_dev *dev) { void __iomem *base; int ret; ret = sa1111_enable_device(dev); if (ret) return ret; dev_set_drvdata(&dev->dev, NULL); if (!request_mem_region(dev->res.start, 512, SA1111_DRIVER_NAME(dev))) { sa1111_disable_device(dev); return -EBUSY; } base = dev->mapbase; /* * Initialise the suspend state. */ sa1111_writel(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + PCSSR); sa1111_writel(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR); #ifdef CONFIG_SA1100_BADGE4 pcmcia_badge4_init(&dev->dev); #endif #ifdef CONFIG_SA1100_JORNADA720 pcmcia_jornada720_init(&dev->dev); #endif #ifdef CONFIG_ARCH_LUBBOCK pcmcia_lubbock_init(dev); #endif #ifdef CONFIG_ASSABET_NEPONSET pcmcia_neponset_init(dev); #endif return 0; }
/* * Add one device to this driver. */ static int __devinit ps2_probe(struct sa1111_dev *dev) { struct ps2if *ps2if; struct serio *serio; int ret; ps2if = kzalloc(sizeof(struct ps2if), GFP_KERNEL); serio = kzalloc(sizeof(struct serio), GFP_KERNEL); if (!ps2if || !serio) { ret = -ENOMEM; goto free; } serio->id.type = SERIO_8042; serio->write = ps2_write; serio->open = ps2_open; serio->close = ps2_close; strlcpy(serio->name, dev_name(&dev->dev), sizeof(serio->name)); strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys)); serio->port_data = ps2if; serio->dev.parent = &dev->dev; ps2if->io = serio; ps2if->dev = dev; sa1111_set_drvdata(dev, ps2if); spin_lock_init(&ps2if->lock); /* * Request the physical region for this PS2 port. */ if (!request_mem_region(dev->res.start, dev->res.end - dev->res.start + 1, SA1111_DRIVER_NAME(dev))) { ret = -EBUSY; goto free; } /* * Our parent device has already mapped the region. */ ps2if->base = dev->mapbase; sa1111_enable_device(ps2if->dev); /* Incoming clock is 8MHz */ sa1111_writel(0, ps2if->base + SA1111_PS2CLKDIV); sa1111_writel(127, ps2if->base + SA1111_PS2PRECNT); /* * Flush any pending input. */ ps2_clear_input(ps2if); /* * Test the keyboard interface. */ ret = ps2_test(ps2if); if (ret) goto out; /* * Flush any pending input. */ ps2_clear_input(ps2if); sa1111_disable_device(ps2if->dev); serio_register_port(ps2if->io); return 0; out: sa1111_disable_device(ps2if->dev); release_mem_region(dev->res.start, resource_size(&dev->res)); free: sa1111_set_drvdata(dev, NULL); kfree(ps2if); kfree(serio); return ret; }