static int __init
s3c6410_leds_init(void)
{
	if (machine_is_smdk6410())
		leds_event = smdk6410_leds_event;
	else
		return -1;

	if (machine_is_smdk6410())
	{
		/*GPN12~15 used for LED*/
		/*Set GPN12~15 to output mode */
		gpio_direction_output(S3C_GPN12);
		if(gpio_get_pin(S3C_GPN12) == 0)
		{
			printk(KERN_WARNING "LED: can't set GPN12 output mode\n");
		}

		gpio_direction_output(S3C_GPN13);
		if(gpio_get_pin(S3C_GPN13) == 0)
		{
			printk(KERN_WARNING "LED: can't set GPN13 output mode\n");
		}

		gpio_direction_output(S3C_GPN14);
		if(gpio_get_pin(S3C_GPN14) == 0)
		{
			printk(KERN_WARNING "LED: can't set GPN14 output mode\n");
		}

		gpio_direction_output(S3C_GPN15);
		if(gpio_get_pin(S3C_GPN15) == 0)
		{
			printk(KERN_WARNING "LED: can't set GPN15 output mode\n");
		}

	}

	/* Get irqs */
	set_irq_type(IRQ_EINT9, IRQT_FALLING);
	gpio_pullup(S3C_GPN9, 0x0);
	if (request_irq(IRQ_EINT9, eint9_switch, SA_TRIGGER_FALLING, "EINT9", NULL)) {
		printk(KERN_ERR "leds.c: Could not allocate EINT9 !\n");
		return -EIO;
	}


	leds_event(led_start);
	return 0;
}
Exemple #2
0
static int __init smdk_audio_init(void)
{
	int ret;
	char *str;

	if (machine_is_smdkc100()
			|| machine_is_smdkv210() || machine_is_smdkc110()) {
		smdk.num_links = 3;
		/* Secondary is at offset SAMSUNG_I2S_SECOFF from Primary */
		str = (char *)smdk_dai[SEC_PLAYBACK].cpu_dai_name;
		str[strlen(str) - 1] = '0' + SAMSUNG_I2S_SECOFF;
	} else if (machine_is_smdk6410()) {
		str = (char *)smdk_dai[PRI_PLAYBACK].cpu_dai_name;
		str[strlen(str) - 1] = '2';
		str = (char *)smdk_dai[PRI_CAPTURE].cpu_dai_name;
		str[strlen(str) - 1] = '2';
	}

	smdk_snd_device = platform_device_alloc("soc-audio", -1);
	if (!smdk_snd_device)
		return -ENOMEM;

	platform_set_drvdata(smdk_snd_device, &smdk);
	ret = platform_device_add(smdk_snd_device);

	if (ret)
		platform_device_put(smdk_snd_device);

	return ret;
}
Exemple #3
0
static int __init smdk_audio_init(void)
{
	int ret;
	char *str;

//ToDO:	Need to do further implementation
#if 0
	if (machine_is_smdkc100()
			|| machine_is_smdkv210() || machine_is_smdkc110()) {
	if(1){
		smdk.num_links = 3;
		/* Secondary is at offset SAMSUNG_I2S_SECOFF from Primary */
		str = (char *)smdk_dai[SEC_PLAYBACK].cpu_dai_name;
		str[strlen(str) - 1] = '0' + SAMSUNG_I2S_SECOFF;
	} else if (machine_is_smdk6410()) {
		str = (char *)smdk_dai[PRI_PLAYBACK].cpu_dai_name;
		str[strlen(str) - 1] = '2';
		str = (char *)smdk_dai[PRI_CAPTURE].cpu_dai_name;
		str[strlen(str) - 1] = '2';
	}
#endif
	smdk_snd_device = platform_device_alloc("soc-audio", -1);
	if (!smdk_snd_device)
		return -ENOMEM;

	platform_set_drvdata(smdk_snd_device, &smdk);
	ret = platform_device_add(smdk_snd_device);

	if (ret){
		platform_device_put(smdk_snd_device);
	}

	return ret;
}
module_init(smdk_audio_init);

static void __exit smdk_audio_exit(void)
{
	platform_device_unregister(smdk_snd_device);
}