Example #1
0
int __init nas100d_pci_init(void)
{
	if (machine_is_nas100d())
		pci_common_init(&nas100d_pci);

	return 0;
}
Example #2
0
static void __exit nas100d_power_exit(void)
{
	if (!(machine_is_nas100d()))
		return;

	free_irq(NAS100D_RB_IRQ, NULL);
}
Example #3
0
static int __init nas100d_gpio_init(void)
{
	if (!machine_is_nas100d())
		return 0;

	/*
	 * The power button on the Iomega NAS100d is on GPIO 14, but
	 * it cannot handle interrupts on that GPIO line.  So we'll
	 * have to poll it with a kernel timer.
	 */

	/* Request the power off GPIO */
	gpio_request(NAS100D_PO_GPIO, "power off");

	/* Make sure that the power button GPIO is set up as an input */
	gpio_request(NAS100D_PB_GPIO, "power button");
	gpio_direction_input(NAS100D_PB_GPIO);

	/* Set the initial value for the power button IRQ handler */
	power_button_countdown = PBUTTON_HOLDDOWN_COUNT;

	mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));

	return 0;
}
Example #4
0
static int __init nas100d_power_init(void)
{
	if (!(machine_is_nas100d()))
		return 0;

	set_irq_type(NAS100D_RB_IRQ, IRQT_LOW);

	if (request_irq(NAS100D_RB_IRQ, &nas100d_reset_handler,
		IRQF_DISABLED, "NAS100D reset button", NULL) < 0) {

		printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
			NAS100D_RB_IRQ);

		return -EIO;
	}

	return 0;
}