From patchwork Wed Oct 27 10:39:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 285352 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9RAdKeC025721 for ; Wed, 27 Oct 2010 10:39:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755162Ab0J0KjT (ORCPT ); Wed, 27 Oct 2010 06:39:19 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44781 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639Ab0J0KjS (ORCPT ); Wed, 27 Oct 2010 06:39:18 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 4D2F18980B; Wed, 27 Oct 2010 12:39:17 +0200 (CEST) Date: Wed, 27 Oct 2010 12:39:17 +0200 Message-ID: From: Takashi Iwai To: Len Brown Cc: linux-acpi@vger.kernel.org Subject: [PATCH] ACPI video: Add video_switch_key option User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Oct 2010 10:39:20 +0000 (UTC) diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 5cd0228..a61162f 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -80,6 +80,8 @@ module_param(brightness_switch_enabled, bool, 0644); */ static int allow_duplicates; module_param(allow_duplicates, bool, 0644); +static int video_switch_key = KEY_SWITCHVIDEOMODE; +module_param(video_switch_key, int, 0644); static int register_count = 0; static int acpi_video_bus_add(struct acpi_device *device); @@ -1511,7 +1513,7 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event) case ACPI_VIDEO_NOTIFY_SWITCH: /* User requested a switch, * most likely via hotkey. */ acpi_bus_generate_proc_event(device, event, 0); - keycode = KEY_SWITCHVIDEOMODE; + keycode = video_switch_key; break; case ACPI_VIDEO_NOTIFY_PROBE: /* User plugged in or removed a video @@ -1519,12 +1521,12 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event) acpi_video_device_enumerate(video); acpi_video_device_rebind(video); acpi_bus_generate_proc_event(device, event, 0); - keycode = KEY_SWITCHVIDEOMODE; + keycode = video_switch_key; break; case ACPI_VIDEO_NOTIFY_CYCLE: /* Cycle Display output hotkey pressed. */ acpi_bus_generate_proc_event(device, event, 0); - keycode = KEY_SWITCHVIDEOMODE; + keycode = video_switch_key; break; case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT: /* Next Display output hotkey pressed. */ acpi_bus_generate_proc_event(device, event, 0); @@ -1736,7 +1738,8 @@ static int acpi_video_bus_add(struct acpi_device *device) input->id.product = 0x06; input->dev.parent = &device->dev; input->evbit[0] = BIT(EV_KEY); - set_bit(KEY_SWITCHVIDEOMODE, input->keybit); + if (video_switch_key && video_switch_key < KEY_CNT) + set_bit(KEY_SWITCHVIDEOMODE, input->keybit); set_bit(KEY_VIDEO_NEXT, input->keybit); set_bit(KEY_VIDEO_PREV, input->keybit); set_bit(KEY_BRIGHTNESS_CYCLE, input->keybit);