Пример #1
0
void ps2_end_command(struct ps2dev *ps2dev)
{
	if (i8042_check_port_owner(ps2dev->serio))
		i8042_unlock_chip();

	mutex_unlock(&ps2dev->cmd_mutex);
}
Пример #2
0
static int amilo_a1655_rfkill_set_block(void *data, bool blocked)
{
	u8 param = blocked ? A1655_WIFI_OFF : A1655_WIFI_ON;
	int rc;

	i8042_lock_chip();
	rc = i8042_command(&param, A1655_WIFI_COMMAND);
	i8042_unlock_chip();
	return rc;
}
Пример #3
0
static int samsungq10_bl_set_intensity(struct backlight_device *bd)
{

	int brightness = bd->props.brightness;
	unsigned char c[3] = SAMSUNGQ10_BL_8042_DATA;

	c[2] = (unsigned char)brightness;
	i8042_lock_chip();
	i8042_command(c, (0x30 << 8) | SAMSUNGQ10_BL_8042_CMD);
	i8042_unlock_chip();
	samsungq10_bl_brightness = brightness;

	return 0;
}
Пример #4
0
static void clevo_mail_led_set(struct led_classdev *led_cdev,
				enum led_brightness value)
{
	i8042_lock_chip();

	if (value == LED_OFF)
		i8042_command(NULL, CLEVO_MAIL_LED_OFF);
	else if (value <= LED_HALF)
		i8042_command(NULL, CLEVO_MAIL_LED_BLINK_0_5HZ);
	else
		i8042_command(NULL, CLEVO_MAIL_LED_BLINK_1HZ);

	i8042_unlock_chip();

}
Пример #5
0
static int clevo_mail_led_blink(struct led_classdev *led_cdev,
				unsigned long *delay_on,
				unsigned long *delay_off)
{
	int status = -EINVAL;

	i8042_lock_chip();

	if (*delay_on == 0 /* ms */ && *delay_off == 0 /* ms */) {
		/* Special case: the leds subsystem requested us to
		 * chose one user friendly blinking of the LED, and
		 * start it. Let's blink the led slowly (0.5Hz).
		 */
		*delay_on = 1000; /* ms */
		*delay_off = 1000; /* ms */
		i8042_command(NULL, CLEVO_MAIL_LED_BLINK_0_5HZ);
		status = 0;

	} else if (*delay_on == 500 /* ms */ && *delay_off == 500 /* ms */) {
		/* blink the led with 1Hz */
		i8042_command(NULL, CLEVO_MAIL_LED_BLINK_1HZ);
		status = 0;

	} else if (*delay_on == 1000 /* ms */ && *delay_off == 1000 /* ms */) {
		/* blink the led with 0.5Hz */
		i8042_command(NULL, CLEVO_MAIL_LED_BLINK_0_5HZ);
		status = 0;

	} else {
		printk(KERN_DEBUG KBUILD_MODNAME
		       ": clevo_mail_led_blink(..., %lu, %lu),"
		       " returning -EINVAL (unsupported)\n",
		       *delay_on, *delay_off);
	}

	i8042_unlock_chip();

	return status;
}