Ejemplo n.º 1
0
void s3c_sdhci_set_platdata(void)
{
#if defined(CONFIG_S3C_DEV_HSMMC)
	s3c_sdhci0_set_platdata(&hsmmc0_platdata);
#endif

#if defined(CONFIG_S3C_DEV_HSMMC1)
	if(machine_is_aries()) {
		hsmmc1_platdata.built_in = 1;
	}
	s3c_sdhci1_set_platdata(&hsmmc1_platdata);
#endif

#if defined(CONFIG_S3C_DEV_HSMMC2)
	if (machine_is_herring()) {
		hsmmc2_platdata.ext_cd = IRQ_EINT(28);
		hsmmc2_platdata.cfg_ext_cd = universal_sdhci2_cfg_ext_cd;
		hsmmc2_platdata.detect_ext_cd = universal_sdhci2_detect_ext_cd;
	}
        if (machine_is_aries()) {
		hsmmc2_platdata.ext_cd = IRQ_EINT(28);
		hsmmc2_platdata.cfg_ext_cd = universal_sdhci2_cfg_ext_cd;
		hsmmc2_platdata.detect_ext_cd = universal_sdhci2_detect_ext_cd;
	}

	s3c_sdhci2_set_platdata(&hsmmc2_platdata);
#endif
#if defined(CONFIG_S3C_DEV_HSMMC3)
	if (machine_is_herring())
		hsmmc3_platdata.built_in = 1;
	s3c_sdhci3_set_platdata(&hsmmc3_platdata);
        if (machine_is_aries())
		hsmmc3_platdata.built_in = 1;
	s3c_sdhci3_set_platdata(&hsmmc3_platdata);
#endif
};
Ejemplo n.º 2
0
static int __init bt_lpm_init(void)
{
	int ret;

	if (!machine_is_aries() && !machine_is_atlas())
		return 0;

	ret = gpio_request(GPIO_BT_WAKE, "gpio_bt_wake");
	if (ret) {
		printk(KERN_ERR "Failed to request gpio_bt_wake control\n");
		return 0;
	}

	gpio_direction_output(GPIO_BT_WAKE, GPIO_LEVEL_LOW);

	hrtimer_init(&bt_lpm.bt_lpm_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
	bt_lpm.bt_lpm_delay = ktime_set(1, 0);	/* 1 sec */
	bt_lpm.bt_lpm_timer.function = bt_enter_lpm;
	return 0;
}
static int __init aries_init_vibrator(void)
{
	int ret = 0;

#ifdef CONFIG_MACH_ARIES
	if (!machine_is_aries())
		return 0;
#endif
	hrtimer_init(&vibdata.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
	vibdata.timer.function = aries_vibrator_timer_func;
	INIT_WORK(&vibdata.work, aries_vibrator_work);

	ret = gpio_request(GPIO_VIBTONE_EN1, "vibrator-en");
	if (ret < 0)
		return ret;

	s3c_gpio_cfgpin(GPIO_VIBTONE_PWM, GPD0_TOUT_1);

	vibdata.pwm_dev = pwm_request(1, "vibrator-pwm");
	if (IS_ERR(vibdata.pwm_dev)) {
		ret = PTR_ERR(vibdata.pwm_dev);
		goto err_pwm_req;
	}

	wake_lock_init(&vibdata.wklock, WAKE_LOCK_SUSPEND, "vibrator");
	mutex_init(&vibdata.lock);

	ret = timed_output_dev_register(&to_dev);
	if (ret < 0)
		goto err_to_dev_reg;

	return 0;

err_to_dev_reg:
	mutex_destroy(&vibdata.lock);
	wake_lock_destroy(&vibdata.wklock);
	pwm_free(vibdata.pwm_dev);
err_pwm_req:
	gpio_free(GPIO_VIBTONE_EN1);
	return ret;
}
void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
{
	unsigned int gpio;

	switch (width) {
	/* Channel 0 supports 4 and 8-bit bus width */
	case 8:
		/* Set all the necessary GPIO function and pull up/down */
		for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) {
			s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
			s3c_gpio_set_drvstrength(gpio, DRVSTR);
		}

	case 0:
	case 1:
	case 4:
		/* Set all the necessary GPIO function and pull up/down */
		for (gpio = S5PV210_GPG0(0); gpio <= S5PV210_GPG0(6); gpio++) {
			if (gpio != S5PV210_GPG0(2)) {
				s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
				s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
			}
			s3c_gpio_set_drvstrength(gpio, DRVSTR);
		}
		break;
	default:
		printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width);
	}

	if (machine_is_herring()) {
		s3c_gpio_cfgpin(S5PV210_GPJ2(7), S3C_GPIO_OUTPUT);
		s3c_gpio_setpull(S5PV210_GPJ2(7), S3C_GPIO_PULL_NONE);
		gpio_set_value(S5PV210_GPJ2(7), 1);
	}
        if (machine_is_aries()) {
		s3c_gpio_cfgpin(S5PV210_GPJ2(7), S3C_GPIO_OUTPUT);
		s3c_gpio_setpull(S5PV210_GPJ2(7), S3C_GPIO_PULL_NONE);
		gpio_set_value(S5PV210_GPJ2(7), 1);
	}
}