Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'chrome-platform-for-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux

Pull chrome platform updates from Tzung-Bi Shih:

- Adjust DMI match table for Framework Laptop for improving
maintainabilities for both legacy and new models

- Add .remove driver callback for cros_ec_typec in order to allow the
driver to be rebound

- Use kmemdup_array() for taking care possible overflows

* tag 'chrome-platform-for-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
platform/chrome: chromeos_laptop: Use kmemdup_array
platform/chrome: cros_ec_typec: add remove driver hook
platform/chrome: cros_ec_lpc: switch primary DMI data for Framework Laptop

+40 -13
+3 -4
drivers/platform/chrome/chromeos_laptop.c
··· 749 749 if (!src->num_i2c_peripherals) 750 750 return 0; 751 751 752 - i2c_peripherals = kmemdup(src->i2c_peripherals, 753 - src->num_i2c_peripherals * 754 - sizeof(*src->i2c_peripherals), 755 - GFP_KERNEL); 752 + i2c_peripherals = kmemdup_array(src->i2c_peripherals, 753 + src->num_i2c_peripherals, 754 + sizeof(*i2c_peripherals), GFP_KERNEL); 756 755 if (!i2c_peripherals) 757 756 return -ENOMEM; 758 757
+27 -9
drivers/platform/chrome/cros_ec_lpc.c
··· 631 631 }; 632 632 MODULE_DEVICE_TABLE(acpi, cros_ec_lpc_acpi_device_ids); 633 633 634 - static const struct lpc_driver_data framework_laptop_amd_lpc_driver_data __initconst = { 634 + static const struct lpc_driver_data framework_laptop_npcx_lpc_driver_data __initconst = { 635 635 .quirks = CROS_EC_LPC_QUIRK_REMAP_MEMORY, 636 636 .quirk_mmio_memory_base = 0xE00, 637 637 }; 638 638 639 - static const struct lpc_driver_data framework_laptop_11_lpc_driver_data __initconst = { 639 + static const struct lpc_driver_data framework_laptop_mec_lpc_driver_data __initconst = { 640 640 .quirks = CROS_EC_LPC_QUIRK_ACPI_ID|CROS_EC_LPC_QUIRK_AML_MUTEX, 641 641 .quirk_acpi_id = "PNP0C09", 642 642 .quirk_aml_mutex_name = "ECMT", ··· 696 696 }, 697 697 /* A small number of non-Chromebook/box machines also use the ChromeOS EC */ 698 698 { 699 - /* the Framework Laptop 13 (AMD Ryzen) and 16 (AMD Ryzen) */ 699 + /* Framework Laptop (11th Gen Intel Core) */ 700 700 .matches = { 701 701 DMI_MATCH(DMI_SYS_VENDOR, "Framework"), 702 - DMI_MATCH(DMI_PRODUCT_NAME, "AMD Ryzen"), 703 - DMI_MATCH(DMI_PRODUCT_FAMILY, "Laptop"), 702 + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Laptop"), 704 703 }, 705 - .driver_data = (void *)&framework_laptop_amd_lpc_driver_data, 704 + .driver_data = (void *)&framework_laptop_mec_lpc_driver_data, 706 705 }, 707 706 { 708 - /* the Framework Laptop (Intel 11th, 12th, 13th Generation) */ 707 + /* Framework Laptop (12th Gen Intel Core) */ 709 708 .matches = { 710 709 DMI_MATCH(DMI_SYS_VENDOR, "Framework"), 711 - DMI_MATCH(DMI_PRODUCT_NAME, "Laptop"), 710 + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "12th Gen Intel Core"), 712 711 }, 713 - .driver_data = (void *)&framework_laptop_11_lpc_driver_data, 712 + .driver_data = (void *)&framework_laptop_mec_lpc_driver_data, 713 + }, 714 + { 715 + /* Framework Laptop (13th Gen Intel Core) */ 716 + .matches = { 717 + DMI_MATCH(DMI_SYS_VENDOR, "Framework"), 718 + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "13th Gen Intel Core"), 719 + }, 720 + .driver_data = (void *)&framework_laptop_mec_lpc_driver_data, 721 + }, 722 + { 723 + /* 724 + * All remaining Framework Laptop models (13 AMD Ryzen, 16 AMD 725 + * Ryzen, Intel Core Ultra) 726 + */ 727 + .matches = { 728 + DMI_MATCH(DMI_SYS_VENDOR, "Framework"), 729 + DMI_MATCH(DMI_PRODUCT_FAMILY, "Laptop"), 730 + }, 731 + .driver_data = (void *)&framework_laptop_npcx_lpc_driver_data, 714 732 }, 715 733 { /* sentinel */ } 716 734 };
+10
drivers/platform/chrome/cros_ec_typec.c
··· 1285 1285 return ret; 1286 1286 } 1287 1287 1288 + static void cros_typec_remove(struct platform_device *pdev) 1289 + { 1290 + struct cros_typec_data *typec = platform_get_drvdata(pdev); 1291 + 1292 + cros_usbpd_unregister_notify(&typec->nb); 1293 + cancel_work_sync(&typec->port_work); 1294 + cros_unregister_ports(typec); 1295 + } 1296 + 1288 1297 static int __maybe_unused cros_typec_suspend(struct device *dev) 1289 1298 { 1290 1299 struct cros_typec_data *typec = dev_get_drvdata(dev); ··· 1325 1316 .pm = &cros_typec_pm_ops, 1326 1317 }, 1327 1318 .probe = cros_typec_probe, 1319 + .remove_new = cros_typec_remove, 1328 1320 }; 1329 1321 1330 1322 module_platform_driver(cros_typec_driver);