Esempio n. 1
0
int sapphire_init_gpio(void)
{
	int i;
	if (!machine_is_sapphire())
		return 0;

	DBG("%d,%d\r\n",SAPPHIRE_INT_START, SAPPHIRE_INT_END);
	DBG("NR_MSM_IRQS=%d, NR_GPIO_IRQS=%d\r\n", NR_MSM_IRQS, NR_GPIO_IRQS);
	for(i = SAPPHIRE_INT_START; i <= SAPPHIRE_INT_END; i++) {
		set_irq_chip(i, &sapphire_gpio_irq_chip);
		set_irq_handler(i, handle_edge_irq);
		set_irq_flags(i, IRQF_VALID);
	}

	register_gpio_chip(&sapphire_gpio_chip);
	register_gpio_chip(&sapphire_h2w_gpio_chip);

	/*setup CPLD INT connecting to SOC's gpio 17 */
	set_irq_type(MSM_GPIO_TO_INT(17), IRQF_TRIGGER_HIGH);
	set_irq_chained_handler(MSM_GPIO_TO_INT(17), sapphire_gpio_irq_handler);
	set_irq_wake(MSM_GPIO_TO_INT(17), 1);

	if(sysdev_class_register(&sapphire_sysdev_class) == 0)
		sysdev_register(&sapphire_irq_device);

	return 0;
}
Esempio n. 2
0
static int __init sapphiremmc_dbg_init(void)
{
	struct dentry *dent;

	if (!machine_is_sapphire())
		return 0;

	dent = debugfs_create_dir("sapphiremmc_dbg", 0);
	if (IS_ERR(dent))
		return PTR_ERR(dent);

	debugfs_create_file("wifi_reset", 0644, dent, NULL,
			    &sapphiremmc_dbg_wifi_reset_fops);
	debugfs_create_file("wifi_cd", 0644, dent, NULL,
			    &sapphiremmc_dbg_wifi_cd_fops);
	debugfs_create_file("wifi_pwr", 0644, dent, NULL,
			    &sapphiremmc_dbg_wifi_pwr_fops);

	debugfs_create_file("sd_pwr", 0644, dent, NULL,
			    &sapphiremmc_dbg_sd_pwr_fops);
	debugfs_create_file("sd_cd", 0644, dent, NULL,
			    &sapphiremmc_dbg_sd_cd_fops);

	return 0;
}
static int __init sapphire_h2w_init(void)
{
	if (!machine_is_sapphire())
		return 0;
	int ret;
	H2W_DBG("");
	ret = platform_driver_register(&sapphire_h2w_driver);
	if (ret)
		return ret;
	return platform_device_register(&sapphire_h2w_device);
}
static int __init sapphire_init_keypad(void)
{
	if (!machine_is_sapphire())
		return 0;

	switch (sapphire_get_hwid()) {
	case 0:
		sapphire_keypad_matrix_info.keymap = sapphire_keymap0;
		break;
	default:
		sapphire_keypad_matrix_info.keymap = sapphire_keymap1;
		break;
	}
	return platform_device_register(&sapphire_keypad_device);
}
Esempio n. 5
0
static int __init sapphire_rfkill_init(void)
{
	if (!machine_is_sapphire())
		return 0;
	return platform_driver_register(&sapphire_rfkill_driver);
}