aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/platform/x86/dell-laptop.c
diff options
context:
space:
mode:
authorDarren Hart <dvhart@infradead.org>2017-03-29 12:19:42 -0700
committerDarren Hart (VMware) <dvhart@infradead.org>2017-04-13 10:14:09 -0700
commit674b5d58366e3f319520a89785c292a60aacb702 (patch)
treec3ffbc0c7b14aa56c22802a000acbfb42e5f8d1e /drivers/platform/x86/dell-laptop.c
parentplatform/x86: silead_dmi: Add entry for Insyde 7W tablets (diff)
parentplatform/x86: dell-wmi-led: fix coding style issues (diff)
downloadwireguard-linux-674b5d58366e3f319520a89785c292a60aacb702.tar.xz
wireguard-linux-674b5d58366e3f319520a89785c292a60aacb702.zip
Merge branch 'linux-leds/dell-laptop-changes-for-4.12'
Merge branch 'dell-laptop-changes-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git to avoid linux-next merge conflict with dell-laptop.c. Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'drivers/platform/x86/dell-laptop.c')
-rw-r--r--drivers/platform/x86/dell-laptop.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 1cd258b790e8..47fe6264cadf 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -29,6 +29,7 @@
#include <linux/mm.h>
#include <linux/i8042.h>
#include <linux/debugfs.h>
+#include <linux/dell-led.h>
#include <linux/seq_file.h>
#include <acpi/video.h>
#include "dell-rbtn.h"
@@ -42,6 +43,8 @@
#define KBD_LED_AUTO_50_TOKEN 0x02EB
#define KBD_LED_AUTO_75_TOKEN 0x02EC
#define KBD_LED_AUTO_100_TOKEN 0x02F6
+#define GLOBAL_MIC_MUTE_ENABLE 0x0364
+#define GLOBAL_MIC_MUTE_DISABLE 0x0365
struct quirk_entry {
u8 touchpad_led;
@@ -2046,6 +2049,31 @@ static struct notifier_block dell_laptop_notifier = {
.notifier_call = dell_laptop_notifier_call,
};
+int dell_micmute_led_set(int state)
+{
+ struct calling_interface_buffer *buffer;
+ struct calling_interface_token *token;
+
+ if (state == 0)
+ token = dell_smbios_find_token(GLOBAL_MIC_MUTE_DISABLE);
+ else if (state == 1)
+ token = dell_smbios_find_token(GLOBAL_MIC_MUTE_ENABLE);
+ else
+ return -EINVAL;
+
+ if (!token)
+ return -ENODEV;
+
+ buffer = dell_smbios_get_buffer();
+ buffer->input[0] = token->location;
+ buffer->input[1] = token->value;
+ dell_smbios_send_request(1, 0);
+ dell_smbios_release_buffer();
+
+ return state;
+}
+EXPORT_SYMBOL_GPL(dell_micmute_led_set);
+
static int __init dell_init(void)
{
struct calling_interface_buffer *buffer;