Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3937880imm; Mon, 8 Oct 2018 12:00:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV615rC0TewAkoYt2x+5WmAdkvGv7XN13IyAuUoFPz19mJp+OyUc78FG3oFFLhbFIDovWlOYe X-Received: by 2002:a63:2019:: with SMTP id g25-v6mr1704789pgg.235.1539025229003; Mon, 08 Oct 2018 12:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539025228; cv=none; d=google.com; s=arc-20160816; b=k8HdheJaWOUqqGBrr1JSnR0Whka/R2coL7KXtlHHUF49GjEZV/HC9L6pkWwB7jM3s2 O6jv8kuMJwZkt1ZdGXP1PLnCL7jqt1WJpemmN5GCD3mjsRUMbXiyFXYk3sTpxgxEH5jg psfrV2kKnBpop0h4bd45BlISd3RKbvrl9OP+zwczFoGeXp/YNJhqf2LzHeQ+6cH6Knno 9Zu6yMW6jLhR7j/hQ/pF2O1OlMzSb1W81wYMgTTt7c4Eelx8AeC081eIB6M6CAowbeGt B3YwVIki5TL0uYmB3C/48ftc7wWG3I+MAA+X7D8U6lJ9jTiGHaWzI7jUDrcCnN3M9/y4 H7ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nk93StGZnjmw5XPFEDvR90+wyissAHSv5G6+DX+FZSw=; b=Ze+mfsYd605hd2o64F9lLHQUGcrqyvQ+DMcOo0jcHzFA2PwNfOEetZHWpxh4TMu0+o n51e4gYTmoWlqCVHs41rleM3Ndx6JXD5YUynL9yUSxB8LoV7g/FUhJq3BjbDh02ujHgP VOWzOgMHUS+0cL+KcdwHmUKiIpuerF3S1bad/cjJGn6H9z4bCtrUx4JVQO2+a9rTrlTN p4SJ6yyMGN/6Wu1r9ZLU1BqeTxw4GeGpcJHF7hyJpdY5nv0QyZlAm07snuVEFQlmMyTI Pt4HdVxYYgxr+v14CZpc4KuUmCGoD7rLbx+ZnNkrTeCpxFOO+4KcFcwEka72TSBfsEyM L4FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=px0PogMb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19-v6si17670914pga.468.2018.10.08.12.00.13; Mon, 08 Oct 2018 12:00:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=px0PogMb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731880AbeJICCg (ORCPT + 99 others); Mon, 8 Oct 2018 22:02:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:51880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727374AbeJICCf (ORCPT ); Mon, 8 Oct 2018 22:02:35 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 93064204FD; Mon, 8 Oct 2018 18:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024568; bh=GwGmPyQtY0dueyfzY7UrFI6x6yZul61YrnHBjDfBODk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=px0PogMb6QOyWftUz+DJjW+eA8UAhhQTu9NSzgc+l0UCQZLJexjXqko6/95dSAIZI zdmTaZ1LTm6oO82RqwI0KC5ydJANiFeZFpiifKfnVEhFuwOGyTcfNTJvb9T6/ZKkqF FCxTHkK5krsu3bCRozAYEPYz6UAGvwiEIG6fMWNA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean OBrien , Benjamin Tissoires , Jiri Kosina , Sasha Levin Subject: [PATCH 4.18 082/168] HID: add support for Apple Magic Keyboards Date: Mon, 8 Oct 2018 20:31:02 +0200 Message-Id: <20181008175623.180234938@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sean O'Brien [ Upstream commit ee345492437043a79db058a3d4f029ebcb52089a ] USB device Vendor 05ac (Apple) Device 026c (Magic Keyboard with Numeric Keypad) Bluetooth devices Vendor 004c (Apple) Device 0267 (Magic Keyboard) Device 026c (Magic Keyboard with Numeric Keypad) Support already exists for the Magic Keyboard over USB connection. Add support for the Magic Keyboard over Bluetooth connection, and for the Magic Keyboard with Numeric Keypad over Bluetooth and USB connection. Signed-off-by: Sean O'Brien Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/hid/hid-apple.c | 9 ++++++++- drivers/hid/hid-ids.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c @@ -335,7 +335,8 @@ static int apple_input_mapping(struct hi struct hid_field *field, struct hid_usage *usage, unsigned long **bit, int *max) { - if (usage->hid == (HID_UP_CUSTOM | 0x0003)) { + if (usage->hid == (HID_UP_CUSTOM | 0x0003) || + usage->hid == (HID_UP_MSVENDOR | 0x0003)) { /* The fn key on Apple USB keyboards */ set_bit(EV_REP, hi->input->evbit); hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_FN); @@ -472,6 +473,12 @@ static const struct hid_device_id apple_ .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI), .driver_data = APPLE_HAS_FN }, + { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI), + .driver_data = APPLE_HAS_FN }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_ANSI), + .driver_data = APPLE_HAS_FN }, + { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_ANSI), + .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO), --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -88,6 +88,7 @@ #define USB_DEVICE_ID_ANTON_TOUCH_PAD 0x3101 #define USB_VENDOR_ID_APPLE 0x05ac +#define BT_VENDOR_ID_APPLE 0x004c #define USB_DEVICE_ID_APPLE_MIGHTYMOUSE 0x0304 #define USB_DEVICE_ID_APPLE_MAGICMOUSE 0x030d #define USB_DEVICE_ID_APPLE_MAGICTRACKPAD 0x030e @@ -157,6 +158,7 @@ #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO 0x0256 #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_JIS 0x0257 #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI 0x0267 +#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_ANSI 0x026c #define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI 0x0290 #define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO 0x0291 #define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS 0x0292