Esempio n. 1
0
static void asus_acpi_notify(struct acpi_device *device, u32 event)
{
	struct asus_laptop *asus = acpi_driver_data(device);
	u16 count;

	
	count = asus->event_count[event % 128]++;
	acpi_bus_generate_proc_event(asus->device, event, count);
	acpi_bus_generate_netlink_event(asus->device->pnp.device_class,
					dev_name(&asus->device->dev), event,
					count);

	
	if (event >= ATKD_BR_MIN && event <= ATKD_BR_MAX) {

		
		if (asus->backlight_device != NULL) {
			
			asus_backlight_notify(asus);
		}
		return ;
	}

	
	if (asus->pega_accel_poll && event == 0xEA) {
		kobject_uevent(&asus->pega_accel_poll->input->dev.kobj,
			       KOBJ_CHANGE);
		return ;
	}

	asus_input_notify(asus, event);
}
Esempio n. 2
0
/*
 * ACPI driver
 */
static void asus_acpi_notify(struct acpi_device *device, u32 event)
{
	struct asus_laptop *asus = acpi_driver_data(device);
	u16 count;

	/*
	 * We need to tell the backlight device when the backlight power is
	 * switched
	 */
	if (event == ATKD_LCD_ON)
		lcd_blank(asus, FB_BLANK_UNBLANK);
	else if (event == ATKD_LCD_OFF)
		lcd_blank(asus, FB_BLANK_POWERDOWN);

	/* TODO Find a better way to handle events count. */
	count = asus->event_count[event % 128]++;
	acpi_bus_generate_proc_event(asus->device, event, count);
	acpi_bus_generate_netlink_event(asus->device->pnp.device_class,
					dev_name(&asus->device->dev), event,
					count);

	/* Brightness events are special */
	if (event >= ATKD_BR_MIN && event <= ATKD_BR_MAX) {

		/* Ignore them completely if the acpi video driver is used */
		if (asus->backlight_device != NULL) {
			/* Update the backlight device. */
			asus_backlight_notify(asus);
		}
		return ;
	}
	asus_input_notify(asus, event);
}
Esempio n. 3
0
/*
 * ACPI driver
 */
static void asus_acpi_notify(struct acpi_device *device, u32 event)
{
	struct asus_laptop *asus = acpi_driver_data(device);
	u16 count;

	/* TODO Find a better way to handle events count. */
	count = asus->event_count[event % 128]++;
	acpi_bus_generate_proc_event(asus->device, event, count);
	acpi_bus_generate_netlink_event(asus->device->pnp.device_class,
					dev_name(&asus->device->dev), event,
					count);

	/* Brightness events are special */
	if (event >= ATKD_BR_MIN && event <= ATKD_BR_MAX) {

		/* Ignore them completely if the acpi video driver is used */
		if (asus->backlight_device != NULL) {
			/* Update the backlight device. */
			asus_backlight_notify(asus);
		}
		return ;
	}

	/* Accelerometer "coarse orientation change" event */
	if (asus->pega_accel_poll && event == 0xEA) {
		kobject_uevent(&asus->pega_accel_poll->input->dev.kobj,
			       KOBJ_CHANGE);
		return ;
	}

	asus_input_notify(asus, event);
}