Skip to contentSkip to conversation

ideapad_laptop: add an event for mic mute hotkey

PATCH Superseded Alex Hung 3 participants 5 messages May 30, 2016 – Jun 8, 2016 x86 platform drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Alex Hung

author
#0 lore raw

PATCH 1/1 ideapad_laptop: add an event for mic mute hotkey

Newer ideapad supports new mic new hotkey, and it is implemented via ACPI interface. This patch conver the mic mute event to a keycode KEY_MICMUTE

---
 drivers/platform/x86/ideapad-laptop.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/ideapad-laptop.c +4 -0
index 4a23fbc..aa87a42 100644
@@ -567,6 +567,7 @@ static void ideapad_sysfs_exit(struct ideapad_private *priv)
 static const struct key_entry ideapad_keymap[] = {
 	{ KE_KEY, 6,  { KEY_SWITCHVIDEOMODE } },
 	{ KE_KEY, 7,  { KEY_CAMERA } },
+	{ KE_KEY, 8,  { KEY_MICMUTE } },
 	{ KE_KEY, 11, { KEY_F16 } },
 	{ KE_KEY, 13, { KEY_WLAN } },
 	{ KE_KEY, 16, { KEY_PROG1 } },
@@ -809,6 +810,9 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
 				break;
 			case 13:
 			case 11:
+			case 8:
+				ideapad_input_report(priv, vpc_bit);
+				break;
 			case 7:
 			case 6:
 				ideapad_input_report(priv, vpc_bit);
Signature · 1 line
2.7.4
#1 lore raw
Quoted 22 lines · Alex Hung

Newer ideapad supports new mic new hotkey, and it is implemented via ACPI interface. This patch conver the mic mute event to a keycode KEY_MICMUTE

---
 drivers/platform/x86/ideapad-laptop.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/ideapad-laptop.c +1 -0
index 4a23fbc..aa87a42 100644
@@ -567,6 +567,7 @@ static void ideapad_sysfs_exit(struct ideapad_private *priv)
 static const struct key_entry ideapad_keymap[] = {
 	{ KE_KEY, 6,  { KEY_SWITCHVIDEOMODE } },
 	{ KE_KEY, 7,  { KEY_CAMERA } },
+	{ KE_KEY, 8,  { KEY_MICMUTE } },
 	{ KE_KEY, 11, { KEY_F16 } },
 	{ KE_KEY, 13, { KEY_WLAN } },
 	{ KE_KEY, 16, { KEY_PROG1 } },

drivers/platform/x86/ideapad-laptop.c static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) · line 813

Quoted 4 lines
drivers/platform/x86/ideapad-laptop.c +1 -0
@@ -809,6 +810,9 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
 				break;
 			case 13:
 			case 11:
+			case 8:

fall through is easier to read

drivers/platform/x86/ideapad-laptop.c static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) · line 815

Quoted 2 lines
drivers/platform/x86/ideapad-laptop.c +2 -0
+				ideapad_input_report(priv, vpc_bit);
+				break;

so above two lines are not necessary.

Quoted 4 lines
drivers/platform/x86/ideapad-laptop.c +0 -0
 			case 7:
 			case 6:
 				ideapad_input_report(priv, vpc_bit);
#2 lore raw
Quoted 30 lines · Ike Panhc
Quoted 22 lines · Alex Hung

Newer ideapad supports new mic new hotkey, and it is implemented via ACPI interface. This patch conver the mic mute event to a keycode KEY_MICMUTE

---
 drivers/platform/x86/ideapad-laptop.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/ideapad-laptop.c +1 -0
index 4a23fbc..aa87a42 100644
@@ -567,6 +567,7 @@ static void ideapad_sysfs_exit(struct ideapad_private *priv)
 static const struct key_entry ideapad_keymap[] = {
 	{ KE_KEY, 6,  { KEY_SWITCHVIDEOMODE } },
 	{ KE_KEY, 7,  { KEY_CAMERA } },
+	{ KE_KEY, 8,  { KEY_MICMUTE } },
 	{ KE_KEY, 11, { KEY_F16 } },
 	{ KE_KEY, 13, { KEY_WLAN } },
 	{ KE_KEY, 16, { KEY_PROG1 } },

drivers/platform/x86/ideapad-laptop.c static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) · line 813

Quoted 4 lines
drivers/platform/x86/ideapad-laptop.c +1 -0
@@ -809,6 +810,9 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
 				break;
 			case 13:
 			case 11:
+			case 8:

fall through is easier to read

Quoted 4 lines

drivers/platform/x86/ideapad-laptop.c static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) · line 815

Quoted 2 lines
drivers/platform/x86/ideapad-laptop.c +2 -0
+				ideapad_input_report(priv, vpc_bit);
+				break;

so above two lines are not necessary.

Are you happy with the changes otherwise Ike?

Quoted 5 lines

drivers/platform/x86/ideapad-laptop.c static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) · line 818

Quoted 5 lines
drivers/platform/x86/ideapad-laptop.c +0 -0
 			case 7:
 			case 6:
 				ideapad_input_report(priv, vpc_bit);

Thanks,

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
#3 lore raw
Quoted 39 lines · Darren Hart
Quoted 30 lines · Ike Panhc
Quoted 22 lines · Alex Hung

Newer ideapad supports new mic new hotkey, and it is implemented via ACPI interface. This patch conver the mic mute event to a keycode KEY_MICMUTE

---
 drivers/platform/x86/ideapad-laptop.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/ideapad-laptop.c +1 -0
index 4a23fbc..aa87a42 100644
@@ -567,6 +567,7 @@ static void ideapad_sysfs_exit(struct ideapad_private *priv)
 static const struct key_entry ideapad_keymap[] = {
 	{ KE_KEY, 6,  { KEY_SWITCHVIDEOMODE } },
 	{ KE_KEY, 7,  { KEY_CAMERA } },
+	{ KE_KEY, 8,  { KEY_MICMUTE } },
 	{ KE_KEY, 11, { KEY_F16 } },
 	{ KE_KEY, 13, { KEY_WLAN } },
 	{ KE_KEY, 16, { KEY_PROG1 } },

drivers/platform/x86/ideapad-laptop.c static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) · line 813

Quoted 4 lines
drivers/platform/x86/ideapad-laptop.c +1 -0
@@ -809,6 +810,9 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
 				break;
 			case 13:
 			case 11:
+			case 8:

fall through is easier to read

Quoted 4 lines

drivers/platform/x86/ideapad-laptop.c static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) · line 815

Quoted 2 lines
drivers/platform/x86/ideapad-laptop.c +2 -0
+				ideapad_input_report(priv, vpc_bit);
+				break;

so above two lines are not necessary.

Are you happy with the changes otherwise Ike?

Quoted 1 line
Quoted 7 lines
Quoted 4 lines

drivers/platform/x86/ideapad-laptop.c static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) · line 818

Quoted 4 lines
drivers/platform/x86/ideapad-laptop.c +0 -0
 			case 7:
 			case 6:
 				ideapad_input_report(priv, vpc_bit);

Thanks,

Yes. Looks good to me.

#4 lore raw
Quoted 45 lines · Ike Panhc
Quoted 44 lines · Darren Hart
Quoted 30 lines · Ike Panhc
Quoted 22 lines · Alex Hung

Newer ideapad supports new mic new hotkey, and it is implemented via ACPI interface. This patch conver the mic mute event to a keycode KEY_MICMUTE

---
 drivers/platform/x86/ideapad-laptop.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/ideapad-laptop.c +1 -0
index 4a23fbc..aa87a42 100644
@@ -567,6 +567,7 @@ static void ideapad_sysfs_exit(struct ideapad_private *priv)
 static const struct key_entry ideapad_keymap[] = {
 	{ KE_KEY, 6,  { KEY_SWITCHVIDEOMODE } },
 	{ KE_KEY, 7,  { KEY_CAMERA } },
+	{ KE_KEY, 8,  { KEY_MICMUTE } },
 	{ KE_KEY, 11, { KEY_F16 } },
 	{ KE_KEY, 13, { KEY_WLAN } },
 	{ KE_KEY, 16, { KEY_PROG1 } },

drivers/platform/x86/ideapad-laptop.c static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) · line 813

Quoted 4 lines
drivers/platform/x86/ideapad-laptop.c +1 -0
@@ -809,6 +810,9 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
 				break;
 			case 13:
 			case 11:
+			case 8:

fall through is easier to read

Quoted 4 lines

drivers/platform/x86/ideapad-laptop.c static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) · line 815

Quoted 2 lines
drivers/platform/x86/ideapad-laptop.c +2 -0
+				ideapad_input_report(priv, vpc_bit);
+				break;

so above two lines are not necessary.

Are you happy with the changes otherwise Ike?

Quoted 5 lines
Quoted 5 lines
drivers/platform/x86/ideapad-laptop.c +0 -0
 			case 7:
 			case 6:
 				ideapad_input_report(priv, vpc_bit);
Quoted 5 lines
Quoted 2 lines

Thanks,

Yes. Looks good to me.

Thanks Ike, in the future, please provide an explicit Acked, Reviewed, or Tested-by so I can accurately record your level of review. I've added your Acked-by here.

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center