Commit 0aa45fcc authored by José Expósito's avatar José Expósito Committed by Jiri Kosina

HID: magicmouse: set device name when it has been personalized

If the Apple Magic Trackpad 2 has been connected to a Mac, the name
is automatically personalized showing its owner name. For example:
"José Expósito's Trackpad".

When connected through Bluetooth, the personalized name is reported,
however, when connected through USB the generic name is reported.

Set the device name correctly to ensure the same driver settings are
loaded, whether connected via Bluetooth or USB.
Signed-off-by: default avatarJosé Expósito <jose.exposito89@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent b2dcadef
......@@ -535,10 +535,18 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd
__set_bit(REL_HWHEEL_HI_RES, input->relbit);
}
} else if (input->id.product == USB_DEVICE_ID_APPLE_MAGICTRACKPAD2) {
/* setting the device name to ensure the same driver settings
* get loaded, whether connected through bluetooth or USB
/* If the trackpad has been connected to a Mac, the name is
* automatically personalized, e.g., "José Expósito's Trackpad".
* When connected through Bluetooth, the personalized name is
* reported, however, when connected through USB the generic
* name is reported.
* Set the device name to ensure the same driver settings get
* loaded, whether connected through bluetooth or USB.
*/
input->name = "Apple Inc. Magic Trackpad 2";
if (hdev->vendor == BT_VENDOR_ID_APPLE)
input->name = "Apple Inc. Magic Trackpad 2";
else /* USB_VENDOR_ID_APPLE */
input->name = hdev->name;
__clear_bit(EV_MSC, input->evbit);
__clear_bit(BTN_0, input->keybit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment