ACPI / Video: blacklist some samsung laptops

On these laptops, the ACPI video is not functional, and very unlikely
to be fixed by the vendor. Note that intel_backlight works for some
of these laptops, and the backlight from samsung-laptop always work.

The good news is that newer laptops have functional ACPI video device
and won't end up growing this list.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
asus-nb-wmi: ignore useless keys

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
eeepc-wmi: add extra keymaps for EP121

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
asus-wmi: on/off bit is not set when reading the value

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
drivers, samsung-laptop: fix initialization of sabi_data in sabi_set_commandb

Fields d0, d1, d2, and d3 are members of an anonymous struct inside an
anonymous union inside struct sabi_data.  Initialization must be done by
wrapping the anonymous union and structs with brackets to avoid a build
error:

drivers/platform/x86/samsung-laptop.c: In function ‘sabi_set_commandb’:
drivers/platform/x86/samsung-laptop.c:433: error: unknown field ‘d0’ specified in initializer
drivers/platform/x86/samsung-laptop.c:433: warning: missing braces around initializer
drivers/platform/x86/samsung-laptop.c:433: warning: (near initialization for ‘in.<anonymous>’)
...

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
drivers, samsung-laptop: fix usage of isalnum

linux/ctype.h is needed for isalnum() to avoid a build error:

drivers/platform/x86/samsung-laptop.c: In function ‘samsung_sabi_diag’:
drivers/platform/x86/samsung-laptop.c:1306: error: implicit declaration of function ‘isalnum’

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
samsung-laptop: cleanup return type: mode_t vs umode_t

This function returns a umode_t (unsigned short) instead of mode_t which
is an unsigned int on some architectures.  Cleaning this up silences a
compile warning:

drivers/platform/x86/samsung-laptop.c:1108:2: warning: initialization
	from incompatible pointer type [enabled by default]

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
asus-wmi: add scalar board brightness adj. support

Some ASUS ET2012E/I All-in-One machines that use a scalar board
to control the brightness, and they only accept brightness up and down
command. So, I introduced a get_scalar_command() function to pass the
command to the scalar board through WMI.

Besides, we have to store the brightness value locally, for we need the
old value to know the brightness value is increasing or decreasing.

BTW, since there is no way to retrieve the actual brightness(it would be
a fixed value), and the max brightness value would be fixed to 1, so we
have to keep passing the brightness up/down command when we reached the
max brightness value or 0.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
asus-wmi: store backlight power status for AIO machine

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>
asus-wmi: move WAPF variable into quirks_entry

Some models work better with different values of wapf, so move the
variable into quriks_entry to make it more easy to give a specific
value to different models.

Based on original patch from AceLan Kao <acelan.kao@canonical.com>

Cc: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
asus-nb-wmi: set panel_power correctly

Even if it's currently unused.

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
eeepc-wmi: refine quirks handling

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
eeepc-wmi: split et2012 specific hacks

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
asus-wmi: don't update power and brightness when using scalar

But we can still do it on other boards, as this might happen
if the backlight driver change when update_bl is called.

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>