Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166402
b: refs/heads/master
c: 8b468c0
h: refs/heads/master
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Sep 20, 2009
1 parent 0fa542f commit 4a12057
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d922e3b84dc4923fc67901580a3c166006fba7a
refs/heads/master: 8b468c0c85f41c4c55227c17271b4187d8911fb0
48 changes: 48 additions & 0 deletions trunk/drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2014,6 +2014,9 @@ static u16 *hotkey_keycode_map;

static struct attribute_set *hotkey_dev_attributes;

static void tpacpi_driver_event(const unsigned int hkey_event);
static void hotkey_driver_event(const unsigned int scancode);

/* HKEY.MHKG() return bits */
#define TP_HOTKEY_TABLET_MASK (1 << 3)

Expand Down Expand Up @@ -2168,6 +2171,35 @@ static int hotkey_user_mask_set(const u32 mask)
return rc;
}

/*
* Sets the driver hotkey mask.
*
* Can be called even if the hotkey subdriver is inactive
*/
static int tpacpi_hotkey_driver_mask_set(const u32 mask)
{
int rc;

/* Do the right thing if hotkey_init has not been called yet */
if (!tp_features.hotkey) {
hotkey_driver_mask = mask;
return 0;
}

mutex_lock(&hotkey_mutex);

HOTKEY_CONFIG_CRITICAL_START
hotkey_driver_mask = mask;
hotkey_source_mask |= (mask & ~hotkey_all_mask);
HOTKEY_CONFIG_CRITICAL_END

rc = hotkey_mask_set((hotkey_acpi_mask | hotkey_driver_mask) &
~hotkey_source_mask);
mutex_unlock(&hotkey_mutex);

return rc;
}

static int hotkey_status_get(int *status)
{
if (!acpi_evalf(hkey_handle, status, "DHKC", "d"))
Expand Down Expand Up @@ -2227,6 +2259,7 @@ static void tpacpi_input_send_key(const unsigned int scancode)
/* Do NOT call without validating scancode first */
static void tpacpi_input_send_key_masked(const unsigned int scancode)
{
hotkey_driver_event(scancode);
if (hotkey_user_mask & (1 << scancode))
tpacpi_input_send_key(scancode);
}
Expand Down Expand Up @@ -7625,6 +7658,21 @@ static struct ibm_struct fan_driver_data = {
****************************************************************************
****************************************************************************/

/*
* HKEY event callout for other subdrivers go here
* (yes, it is ugly, but it is quick, safe, and gets the job done
*/
static void tpacpi_driver_event(const unsigned int hkey_event)
{
}



static void hotkey_driver_event(const unsigned int scancode)
{
tpacpi_driver_event(0x1001 + scancode);
}

/* sysfs name ---------------------------------------------------------- */
static ssize_t thinkpad_acpi_pdev_name_show(struct device *dev,
struct device_attribute *attr,
Expand Down

0 comments on commit 4a12057

Please sign in to comment.