Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add surface patches #7

Closed
wants to merge 57 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
1f6d7fc
(surface3-oemb) add DMI matches for Surface 3 with broken DMI table
kitakar5525 Oct 18, 2020
183fadd
mwifiex: pcie: add reset_wsid quirk for Surface 3
kitakar5525 Sep 29, 2020
8e7c014
mwifiex: pcie: (OEMB) add quirk for Surface 3 with broken DMI table
kitakar5525 Sep 30, 2020
367e96f
mwifiex: pcie: disable bridge_d3 for Surface gen4+
kitakar5525 Oct 3, 2020
a140a7c
mwifiex: Add quirk resetting the PCI bridge on MS Surface devices
jonas2515 Nov 3, 2020
aca4293
Bluetooth: btusb: Lower passive lescan interval on Marvell 88W8897
jonas2515 Mar 25, 2021
2dd7572
mwifiex: Use non-posted PCI register writes
jonas2515 Nov 10, 2020
4262ffb
ath10k: Add module parameters to override board files
qzed Feb 26, 2021
7a04482
misc: mei: Add missing IPTS device IDs
StollD Jul 30, 2020
735a5ca
misc: Add support for Intel Precise Touch & Stylus
StollD Aug 6, 2020
fe126cb
iommu: ipts: use IOMMU passthrough mode for IPTS
Apr 12, 2022
1a8f2ca
platform/surface: aggregator: Allow is_ssam_device() to be used when …
qzed May 27, 2022
ef4559a
platform/surface: aggregator: Allow devices to be marked as hot-removed
qzed May 27, 2022
d09e2b7
platform/surface: aggregator: Allow notifiers to avoid communication …
qzed May 27, 2022
c82e9dc
platform/surface: aggregator_registry: Use client device wrappers for…
qzed May 27, 2022
b77bd24
power/supply: surface_charger: Use client device wrappers for notifie…
qzed May 27, 2022
e26b20d
power/supply: surface_battery: Use client device wrappers for notifie…
qzed May 27, 2022
c3b4771
HID: surface-hid: Add support for hot-removal
qzed May 27, 2022
07b9166
platform/surface: aggregator: Add comment for KIP subsystem category
qzed May 27, 2022
0cbdaaa
platform/surface: aggregator_registry: Generify subsystem hub functio…
qzed May 27, 2022
c130f15
platform/surface: aggregator_registry: Change device ID for base hub
qzed May 27, 2022
42faa68
platform/surface: aggregator_registry: Add KIP device hub
qzed May 27, 2022
0f711b7
platform/surface: aggregator_registry: Add support for keyboard cover…
qzed May 27, 2022
d452632
platform/surface: aggregator: Reserve more event- and target-categories
qzed Jun 14, 2022
a376715
platform/surface: aggregator: Add helper macros for requests with arg…
qzed Jun 15, 2022
113b951
platform/surface: Add KIP tablet-mode switch
qzed Jun 8, 2021
ecc93af
platform/surface: aggregator_registry: Add support for tablet mode sw…
qzed Oct 27, 2021
cc2e4f7
platform/surface: aggregator_registry: Add support for tablet mode sw…
qzed Jun 16, 2022
423c18c
platform/surface: aggregator: Move device registry helper functions t…
qzed May 20, 2022
a22efa2
platform/surface: aggregator: Move subsystem hub drivers to their own…
qzed May 20, 2022
380d7bc
platform/surface: Update copyright year of various drivers
qzed May 20, 2022
e5606a4
platform/surface: aggregator_registry: Rename HID device nodes based …
qzed Jun 25, 2022
530b53f
platform/surface: aggregator_registry: Rename HID device nodes based …
qzed Jun 25, 2022
6151b75
platform/surface: aggregator_registry: Add HID devices for sensors an…
qzed Jun 25, 2022
3344f25
platform/surface: aggregator_registry: Add support for Surface Laptop…
qzed Jul 8, 2022
22a5e26
i2c: acpi: Implement RawBytes read access
qzed Jul 25, 2020
4156df6
platform/surface: Add driver for Surface Book 1 dGPU switch
qzed Feb 13, 2021
fb7c95b
Input: soc_button_array - support AMD variant Surface devices
nakato Oct 4, 2021
6760ce1
platform/surface: surfacepro3_button: don't load on amd variant
nakato Oct 4, 2021
7dddb8e
hid/multitouch: Turn off Type Cover keyboard backlight when suspending
jonas2515 Nov 5, 2020
aed9ecc
hid/multitouch: Add support for surface pro type cover tablet switch
pjungkamp Feb 25, 2022
eec8c1b
ACPI: battery: Make "not-charging" the default on no charging or full…
tuxedo-wse Apr 27, 2022
828d9aa
platform/surface: gpe: Add support for 13" Intel version of Surface L…
qzed Jul 21, 2022
2ac8fd2
ACPI: delay enumeration of devices with a _DEP pointing to an INT3472…
jwrdegoede Oct 10, 2021
90d505b
iommu: intel-ipu: use IOMMU passthrough mode for Intel IPUs
zouxiaoh Jun 25, 2021
127bdeb
platform/x86: int3472: Enable I2c daisy chain
djrscally Oct 10, 2021
e3ff42d
media: i2c: Add driver for DW9719 VCM
djrscally Oct 28, 2021
2df2272
drivers/media/i2c: Fix DW9719 dependencies
qzed Jul 15, 2022
78885cc
media: entity: Skip non-data links in graph iteration
djrscally Dec 13, 2021
87c3625
media: media.h: Add new media link type
djrscally Dec 13, 2021
44059fe
media: entity: Add link_type_name() helper
djrscally Dec 13, 2021
9d19891
media: entity: Add support for ancillary links
djrscally Dec 13, 2021
7839246
media: v4l2-async: Create links during v4l2_async_match_notify()
djrscally Nov 26, 2021
791d495
media: ipu3-cio2: Move functionality from .complete() to .bound()
djrscally May 4, 2022
4f2a507
media: ipu3-cio2: Re-add .complete() to ipu3-cio2
djrscally Jun 2, 2022
33b9c08
ACPI: Add quirk for Surface Laptop 4 AMD missing irq 7 override
nakato May 29, 2021
f5b997f
ACPI: Add AMD 13" Surface Laptop 4 model to irq 7 override quirk
qzed Jun 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Documentation/driver-api/surface_aggregator/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
.. |SSAM_DEVICE| replace:: :c:func:`SSAM_DEVICE`
.. |ssam_notifier_register| replace:: :c:func:`ssam_notifier_register`
.. |ssam_notifier_unregister| replace:: :c:func:`ssam_notifier_unregister`
.. |ssam_device_notifier_register| replace:: :c:func:`ssam_device_notifier_register`
.. |ssam_device_notifier_unregister| replace:: :c:func:`ssam_device_notifier_unregister`
.. |ssam_request_sync| replace:: :c:func:`ssam_request_sync`
.. |ssam_event_mask| replace:: :c:type:`enum ssam_event_mask <ssam_event_mask>`

Expand Down Expand Up @@ -312,7 +314,9 @@ Handling Events
To receive events from the SAM EC, an event notifier must be registered for
the desired event via |ssam_notifier_register|. The notifier must be
unregistered via |ssam_notifier_unregister| once it is not required any
more.
more. For |ssam_device| type clients, the |ssam_device_notifier_register| and
|ssam_device_notifier_unregister| wrappers should be preferred as they properly
handle hot-removal of client devices.

Event notifiers are registered by providing (at minimum) a callback to call
in case an event has been received, the registry specifying how the event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ are:

- An **interface link** is a point-to-point bidirectional control
connection between a Linux Kernel interface and an entity.

- An **ancillary link** is a point-to-point connection denoting that two
entities form a single logical unit. For example this could represent the
fact that a particular camera sensor and lens controller form a single
physical module, meaning this lens controller drives the lens for this
camera sensor.
17 changes: 12 additions & 5 deletions Documentation/userspace-api/media/mediactl/media-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -412,14 +412,21 @@ must be set for every pad.
is set by drivers and is read-only for applications.

* - ``MEDIA_LNK_FL_LINK_TYPE``
- This is a bitmask that defines the type of the link. Currently,
two types of links are supported:
- This is a bitmask that defines the type of the link. The following
link types are currently supported:

.. _MEDIA-LNK-FL-DATA-LINK:

``MEDIA_LNK_FL_DATA_LINK`` if the link is between two pads
``MEDIA_LNK_FL_DATA_LINK`` for links that represent a data connection
between two pads.

.. _MEDIA-LNK-FL-INTERFACE-LINK:

``MEDIA_LNK_FL_INTERFACE_LINK`` if the link is between an
interface and an entity
``MEDIA_LNK_FL_INTERFACE_LINK`` for links that associate an entity to its
interface.

.. _MEDIA-LNK-FL-ANCILLARY-LINK:

``MEDIA_LNK_FL_ANCILLARY_LINK`` for links that represent a physical
relationship between two entities. The link may or may not be ummutable, so
applications must not assume either case.
19 changes: 19 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6002,6 +6002,13 @@ T: git git://linuxtv.org/media_tree.git
F: Documentation/devicetree/bindings/media/i2c/dongwoon,dw9714.txt
F: drivers/media/i2c/dw9714.c

DONGWOON DW9719 LENS VOICE COIL DRIVER
M: Daniel Scally <djrscally@gmail.com>
L: linux-media@vger.kernel.org
S: Maintained
T: git git://linuxtv.org/media_tree.git
F: drivers/media/i2c/dw9719.c

DONGWOON DW9768 LENS VOICE COIL DRIVER
M: Dongchun Zhu <dongchun.zhu@mediatek.com>
L: linux-media@vger.kernel.org
Expand Down Expand Up @@ -13030,6 +13037,12 @@ F: drivers/scsi/smartpqi/smartpqi*.[ch]
F: include/linux/cciss*.h
F: include/uapi/linux/cciss*.h

MICROSOFT SURFACE AGGREGATOR TABLET-MODE SWITCH
M: Maximilian Luz <luzmaximilian@gmail.com>
L: platform-driver-x86@vger.kernel.org
S: Maintained
F: drivers/platform/surface/surface_aggregator_tablet_switch.c

MICROSOFT SURFACE BATTERY AND AC DRIVERS
M: Maximilian Luz <luzmaximilian@gmail.com>
L: linux-pm@vger.kernel.org
Expand Down Expand Up @@ -13101,6 +13114,12 @@ F: include/linux/surface_acpi_notify.h
F: include/linux/surface_aggregator/
F: include/uapi/linux/surface_aggregator/

MICROSOFT SURFACE SYSTEM AGGREGATOR HUB DRIVER
M: Maximilian Luz <luzmaximilian@gmail.com>
L: platform-driver-x86@vger.kernel.org
S: Maintained
F: drivers/platform/surface/surface_aggregator_hub.c

MICROTEK X6 SCANNER
M: Oliver Neukum <oliver@neukum.org>
S: Maintained
Expand Down
24 changes: 24 additions & 0 deletions arch/x86/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/efi-bgrt.h>
#include <linux/serial_core.h>
#include <linux/pgtable.h>
#include <linux/dmi.h>

#include <asm/e820/api.h>
#include <asm/irqdomain.h>
Expand Down Expand Up @@ -1152,6 +1153,24 @@ static void __init mp_config_acpi_legacy_irqs(void)
}
}

static const struct dmi_system_id surface_quirk[] __initconst = {
{
.ident = "Microsoft Surface Laptop 4 (AMD 15\")",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
DMI_MATCH(DMI_PRODUCT_SKU, "Surface_Laptop_4_1952:1953")
},
},
{
.ident = "Microsoft Surface Laptop 4 (AMD 13\")",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
DMI_MATCH(DMI_PRODUCT_SKU, "Surface_Laptop_4_1958:1959")
},
},
{}
};

/*
* Parse IOAPIC related entries in MADT
* returns 0 on success, < 0 on error
Expand Down Expand Up @@ -1207,6 +1226,11 @@ static int __init acpi_parse_madt_ioapic_entries(void)
acpi_sci_ioapic_setup(acpi_gbl_FADT.sci_interrupt, 0, 0,
acpi_gbl_FADT.sci_interrupt);

if (dmi_check_system(surface_quirk)) {
pr_warn("Surface hack: Override irq 7\n");
mp_override_legacy_irq(7, 3, 3, 7);
}

/* Fill in identity legacy mappings where no override */
mp_config_acpi_legacy_irqs();

Expand Down
24 changes: 1 addition & 23 deletions drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ static bool battery_driver_registered;
static int battery_bix_broken_package;
static int battery_notification_delay_ms;
static int battery_ac_is_broken;
static int battery_quirk_notcharging;
static unsigned int cache_time = 1000;
module_param(cache_time, uint, 0644);
MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
Expand Down Expand Up @@ -216,10 +215,8 @@ static int acpi_battery_get_property(struct power_supply *psy,
val->intval = POWER_SUPPLY_STATUS_CHARGING;
else if (acpi_battery_is_charged(battery))
val->intval = POWER_SUPPLY_STATUS_FULL;
else if (battery_quirk_notcharging)
val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
else
val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
break;
case POWER_SUPPLY_PROP_PRESENT:
val->intval = acpi_battery_present(battery);
Expand Down Expand Up @@ -1105,12 +1102,6 @@ battery_ac_is_broken_quirk(const struct dmi_system_id *d)
return 0;
}

static int __init battery_quirk_not_charging(const struct dmi_system_id *d)
{
battery_quirk_notcharging = 1;
return 0;
}

static const struct dmi_system_id bat_dmi_table[] __initconst = {
{
/* NEC LZ750/LS */
Expand Down Expand Up @@ -1139,19 +1130,6 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
DMI_MATCH(DMI_BIOS_DATE, "08/22/2014"),
},
},
{
/*
* On Lenovo ThinkPads the BIOS specification defines
* a state when the bits for charging and discharging
* are both set to 0. That state is "Not Charging".
*/
.callback = battery_quirk_not_charging,
.ident = "Lenovo ThinkPad",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad"),
},
},
{
/* Microsoft Surface Go 3 */
.callback = battery_notification_delay_quirk,
Expand Down
3 changes: 3 additions & 0 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,9 @@ static acpi_status acpi_bus_check_add_2(acpi_handle handle, u32 lvl_not_used,

static void acpi_default_enumeration(struct acpi_device *device)
{
if (!acpi_dev_ready_for_enumeration(device))
return;

/*
* Do not enumerate devices with enumeration_by_parent flag set as
* they will be enumerated by their respective parents.
Expand Down
15 changes: 15 additions & 0 deletions drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ static struct usb_driver btusb_driver;
#define BTUSB_INTEL_BROKEN_SHUTDOWN_LED BIT(24)
#define BTUSB_INTEL_BROKEN_INITIAL_NCMD BIT(25)
#define BTUSB_INTEL_NO_WBS_SUPPORT BIT(26)
#define BTUSB_LOWER_LESCAN_INTERVAL BIT(27)

static const struct usb_device_id btusb_table[] = {
/* Generic Bluetooth USB device */
Expand Down Expand Up @@ -377,6 +378,7 @@ static const struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x1286, 0x2044), .driver_info = BTUSB_MARVELL },
{ USB_DEVICE(0x1286, 0x2046), .driver_info = BTUSB_MARVELL },
{ USB_DEVICE(0x1286, 0x204e), .driver_info = BTUSB_MARVELL },
{ USB_DEVICE(0x1286, 0x204c), .driver_info = BTUSB_LOWER_LESCAN_INTERVAL },

/* Intel Bluetooth devices */
{ USB_DEVICE(0x8087, 0x0025), .driver_info = BTUSB_INTEL_COMBINED },
Expand Down Expand Up @@ -3790,6 +3792,19 @@ static int btusb_probe(struct usb_interface *intf,
if (id->driver_info & BTUSB_MARVELL)
hdev->set_bdaddr = btusb_set_bdaddr_marvell;

/* The Marvell 88W8897 combined wifi and bluetooth card is known for
* very bad bt+wifi coexisting performance.
*
* Decrease the passive BT Low Energy scan interval a bit
* (0x0190 * 0.625 msec = 250 msec) and make the scan window shorter
* (0x000a * 0,625 msec = 6.25 msec). This allows for significantly
* higher wifi throughput while passively scanning for BT LE devices.
*/
if (id->driver_info & BTUSB_LOWER_LESCAN_INTERVAL) {
hdev->le_scan_interval = 0x0190;
hdev->le_scan_window = 0x000a;
}

if (IS_ENABLED(CONFIG_BT_HCIBTUSB_MTK) &&
(id->driver_info & BTUSB_MEDIATEK)) {
hdev->setup = btusb_mtk_setup;
Expand Down
Loading