mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-24 06:35:44 +08:00
6e0044bedc
Due to some implementation reasons, ASUS ET2012 All-in-One machines can't report the correct backlight power status, it will always return 1. To track the backlight power status correctly, we have to store the status by ourselves. BTW, by the BIOS design, the backlight power will be turn on/off sequently, no matter what the value of the parameter will be. More over, the brightness adjustment command will turn on the backlight power. Those behaviors will make us fail to track the backlight power status. For example, While we are trying to turn on the backlight power, we will send out the brightness adjustment command and then trying to figure out if we have to turn on the backlight power, then send out the command. But, the real case is that, the backlight power turns on while sending the brightness adjustment command, and then we send out the command to turn on the backlight power, it actually will turn off the backlight power and the backlight power status we recorded becomes wrong. So, we have to seperate these two commands by a if statement. Signed-off-by: AceLan Kao <acelan.kao@canonical.com> Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
74 lines
2.2 KiB
C
74 lines
2.2 KiB
C
/*
|
|
* Asus PC WMI hotkey driver
|
|
*
|
|
* Copyright(C) 2010 Intel Corporation.
|
|
* Copyright(C) 2010-2011 Corentin Chary <corentin.chary@gmail.com>
|
|
*
|
|
* Portions based on wistron_btns.c:
|
|
* Copyright (C) 2005 Miloslav Trmac <mitr@volny.cz>
|
|
* Copyright (C) 2005 Bernhard Rosenkraenzer <bero@arklinux.org>
|
|
* Copyright (C) 2005 Dmitry Torokhov <dtor@mail.ru>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
#ifndef _ASUS_WMI_H_
|
|
#define _ASUS_WMI_H_
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
#define ASUS_WMI_KEY_IGNORE (-1)
|
|
|
|
struct module;
|
|
struct key_entry;
|
|
struct asus_wmi;
|
|
|
|
struct quirk_entry {
|
|
bool hotplug_wireless;
|
|
bool scalar_panel_brightness;
|
|
bool store_backlight_power;
|
|
};
|
|
|
|
struct asus_wmi_driver {
|
|
int wapf;
|
|
int brightness;
|
|
int panel_power;
|
|
|
|
const char *name;
|
|
struct module *owner;
|
|
|
|
const char *event_guid;
|
|
|
|
const struct key_entry *keymap;
|
|
const char *input_name;
|
|
const char *input_phys;
|
|
struct quirk_entry *quirks;
|
|
/* Returns new code, value, and autorelease values in arguments.
|
|
* Return ASUS_WMI_KEY_IGNORE in code if event should be ignored. */
|
|
void (*key_filter) (struct asus_wmi_driver *driver, int *code,
|
|
unsigned int *value, bool *autorelease);
|
|
|
|
int (*probe) (struct platform_device *device);
|
|
void (*detect_quirks) (struct asus_wmi_driver *driver);
|
|
|
|
struct platform_driver platform_driver;
|
|
struct platform_device *platform_device;
|
|
};
|
|
|
|
int asus_wmi_register_driver(struct asus_wmi_driver *driver);
|
|
void asus_wmi_unregister_driver(struct asus_wmi_driver *driver);
|
|
|
|
#endif /* !_ASUS_WMI_H_ */
|