public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jaswinder Singh Rajput <jaswinder@kernel.org>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net
Subject: Re: [PATCH 5/6] thinkpad-acpi: add internal hotkey event API
Date: Sat, 26 Sep 2009 14:29:30 +0530	[thread overview]
Message-ID: <1253955570.3897.4.camel@ht.satnam> (raw)
In-Reply-To: <1253466567-4285-6-git-send-email-hmh@hmh.eng.br>

Hello,

On Sun, 2009-09-20 at 14:09 -0300, Henrique de Moraes Holschuh wrote:
> Add an internal API to the driver, to allow subdrivers to request and
> receive HKEY 0x1000 events.  This API will be used by the backlight
> (brightness up/down) and upcoming ALSA mixer (volume up/down/mute)
> subdrivers.
> 
> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> ---
>  drivers/platform/x86/thinkpad_acpi.c |   48 ++++++++++++++++++++++++++++++++++
>  1 files changed, 48 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 50aa4c1..ffd584c 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -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)
>  
> @@ -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)


  CC [M]  drivers/platform/x86/thinkpad_acpi.o
drivers/platform/x86/thinkpad_acpi.c:2225: warning: ‘tpacpi_hotkey_driver_mask_set’ defined but not used

Thanks,
--
JSR

> +{
> +	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"))
> @@ -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);
>  }
> @@ -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,

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2009-09-26  9:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-20 17:09 [GIT PATCH] thinkpad-acpi patches for the merge window (second set) Henrique de Moraes Holschuh
2009-09-20 17:09 ` [PATCH 1/6] thinkpad-acpi: don't leave ERR_PTR() pointers around Henrique de Moraes Holschuh
2009-09-20 17:09 ` [PATCH 2/6] thinkpad-acpi: remove uneeded tp_features.hotkey tests in hotkey_exit Henrique de Moraes Holschuh
2009-09-20 17:09 ` [PATCH 3/6] thinkpad-acpi: drop HKEY event 0x5010 Henrique de Moraes Holschuh
2009-09-20 17:09 ` [PATCH 4/6] thinkpad-acpi: hotkey event driver update Henrique de Moraes Holschuh
2009-09-20 17:09 ` [PATCH 5/6] thinkpad-acpi: add internal hotkey event API Henrique de Moraes Holschuh
2009-09-21 19:09   ` Len Brown
2010-03-10 20:33     ` Henrique de Moraes Holschuh
2009-09-26  8:59   ` Jaswinder Singh Rajput [this message]
2009-09-26 13:48     ` Henrique de Moraes Holschuh
2009-09-20 17:09 ` [PATCH 6/6] thinkpad-acpi: name event constants Henrique de Moraes Holschuh
2009-09-26 23:58 ` [GIT PATCH] thinkpad-acpi patches for the merge window (second set) Henrique de Moraes Holschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1253955570.3897.4.camel@ht.satnam \
    --to=jaswinder@kernel.org \
    --cc=hmh@hmh.eng.br \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox