static void vibrator_enable(struct timed_output_dev *dev, int value)
{
	int mode;

	s_Timeout = value;

	if (!s_hOdmVibrate) {
		NvOdmVibOpen(&s_hOdmVibrate);
		if (!s_hOdmVibrate)
			return;
	}

	if (value == 999999999 ) {  /* Continued vibration */
		printk("Continued vibration, echo '0' to stop!\n");
		NvOdmVibStart(s_hOdmVibrate);
	}
	else if (value == 888888888) {	 /* Change vibration mode */
		mode = (PgeaVibModeGet()+1)%2;  /* change to */

		printk("Change vibration mode to %s!\n", mode ? "ER":"PR");
		PgeaVibModeSet(mode);
		NvOdmVibStop(s_hOdmVibrate);
	}
	else if (value > 0) {
		/* printk("Enable vibrator: %d ms\n", value); */
		NvOdmVibStart(s_hOdmVibrate);
		msleep(value);
		NvOdmVibStop(s_hOdmVibrate);
	} else {
		NvOdmVibStop(s_hOdmVibrate);
	}
}
Exemplo n.º 2
0
static void vibrator_enable(struct timed_output_dev *dev, int value)
{
	s_Timeout = value;
	if (!s_hOdmVibrate) {
		NvOdmVibOpen(&s_hOdmVibrate);
		if (!s_hOdmVibrate)
			return;
	}
	if (value) {
		NvOdmVibStart(s_hOdmVibrate);
		msleep(value);
		NvOdmVibStop(s_hOdmVibrate);
	} else {
		NvOdmVibStop(s_hOdmVibrate);
	}
}