summaryrefslogtreecommitdiff
path: root/drivers/platform/chrome
AgeCommit message (Collapse)AuthorFilesLines
2024-10-03move asm/unaligned.h to linux/unaligned.hAl Viro3-3/+3
asm/unaligned.h is always an include of asm-generic/unaligned.h; might as well move that thing to linux/unaligned.h and include that - there's nothing arch-specific in that header. auto-generated by the following: for i in `git grep -l -w asm/unaligned.h`; do sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i done for i in `git grep -l -w asm-generic/unaligned.h`; do sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i done git mv include/asm-generic/unaligned.h include/linux/unaligned.h git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
2024-09-27[tree-wide] finally take no_llseek outAl Viro4-4/+0
no_llseek had been defined to NULL two years ago, in commit 868941b14441 ("fs: remove no_llseek") To quote that commit, At -rc1 we'll need do a mechanical removal of no_llseek - git grep -l -w no_llseek | grep -v porting.rst | while read i; do sed -i '/\<no_llseek\>/d' $i done would do it. Unfortunately, that hadn't been done. Linus, could you do that now, so that we could finally put that thing to rest? All instances are of the form .llseek = no_llseek, so it's obviously safe. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-08-23platform/chrome: chromeos_laptop: Use kmemdup_arrayYu Jiaoliang1-4/+3
Let the kememdup_array() take care about multiplication and possible overflows. Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com> Link: https://lore.kernel.org/r/20240823024056.3031644-1-yujiaoliang@vivo.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-08-09platform/chrome: cros_ec_typec: add remove driver hookThadeu Lima de Souza Cascardo1-0/+10
This allows the driver to be unbound and bound again. Otherwise, when unbinding the driver, there will be leftover sysfs entries. When rebinding the driver, it also ends up touching freed memory when adding to the notifier chain as the old one was not removed and ends up being traversed. Add a remove_new driver hook, which removes the notifier from the chain and unregisters the typec ports. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com> Link: https://lore.kernel.org/r/20240726181235.920335-1-cascardo@igalia.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-08-07platform/chrome: cros_ec_lpc: switch primary DMI data for Framework LaptopDustin L. Howett1-9/+27
Framework Computer appears to be moving away from the Microchip embedded controller seen in the Framework Laptop 13 with Intel Core 11th, 12th and 13th generation processors. All newer models use a Nuvoton NPCX embedded controller. Changing the default DMI match for Framework's products to match their newer product lines will reduce churn in this part of the cros_ec_lpc driver. The new match tables are: - Microchip EC models - "Laptop" (product, exact match) for the 11th gen. Intel Core - "12th Gen Intel Core" (product, exact match) - "13th Gen Intel Core" (product, exact match) - Nuvoton NPCX models - "Laptop" (product family, partial match) Signed-off-by: Dustin L. Howett <dustin@howett.net> Reviewed-by: Alexandru M Stan <ams@frame.work> Link: https://lore.kernel.org/r/20240806-platform-chrome-cros_ec_lpcs-change-the-default-disposition-of-the-framework-laptop-v1-1-09e0d602b215@howett.net Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-07-30Merge tag 'chrome-platform-fixes-for-v6.11-rc2' of ↵Linus Torvalds1-0/+2
git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome-platform fix from Tzung-Bi Shih: "Fix a race condition that sends multiple host commands at a time" * tag 'chrome-platform-fixes-for-v6.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: cros_ec_proto: Lock device when updating MKBP version
2024-07-30platform/chrome: cros_ec_proto: Lock device when updating MKBP versionPatryk Duda1-0/+2
The cros_ec_get_host_command_version_mask() function requires that the caller must have ec_dev->lock mutex before calling it. This requirement was not met and as a result it was possible that two commands were sent to the device at the same time. The problem was observed while using UART backend which doesn't use any additional locks, unlike SPI backend which locks the controller until response is received. Fixes: f74c7557ed0d ("platform/chrome: cros_ec_proto: Update version on GET_NEXT_EVENT failure") Cc: stable@vger.kernel.org Signed-off-by: Patryk Duda <patrykd@google.com> Link: https://lore.kernel.org/r/20240730104425.607083-1-patrykd@google.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-07-18Merge tag 'mfd-next-6.11' of ↵Linus Torvalds2-3/+39
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Drivers: - ROHM BD96801 Power Management IC - Cirrus Logic CS40L50 Haptic Driver with Waveform Memory - Marvell 88PM886 Power Management IC New Device Support: - Keyboard Backlight to ChromeOS Embedded Controller - LEDs to ChromeOS Embedded Controller - Charge Control to ChromeOS Embedded Controller - HW Monitoring Service to ChromeOS Embedded Controller - AUXADCs to MediaTek MT635{7,8,9} Power Management ICs New Functionality: - Allow Syscon consumers to supply their own Regmaps on registration Fix-ups: - Constify/staticise applicable data structures - Remove superfluous/duplicated/unused sections - Device Tree binding adaptions/conversions/creation - Trivial; spelling, whitespace, coding-style adaptions - Utilise centrally provided helpers and macros to aid simplicity/duplication - Drop i2c_device_id::driver_data where the value is unused - Replace ACPI/DT firmware helpers with agnostic variants - Move over to GPIOD (descriptor-based) APIs - Annotate a bunch of __counted_by() cases - Straighten out some includes Bug Fixes: - Ensure potentially asserted recent lines are deasserted during initialisation - Avoid "<module>.ko is added to multiple modules" warnings - Supply a bunch of MODULE_DESCRIPTIONs to silence modpost warnings - Fix Wvoid-pointer-to-enum-cast warnings" * tag 'mfd-next-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (87 commits) mfd: timberdale: Attach device properties to TSC2007 board info mfd: tmio: Move header to platform_data mfd: tmio: Sanitize comments mfd: tmio: Update include files mmc: tmio/sdhi: Fix includes mfd: tmio: Remove obsolete io accessors mfd: tmio: Remove obsolete platform_data watchdog: bd96801_wdt: Add missing include for FIELD_*() dt-bindings: mfd: syscon: Add APM poweroff mailbox dt-bindings: mfd: syscon: Split and enforce documenting MFD children dt-bindings: mfd: rk817: Merge support for RK809 dt-bindings: mfd: rk817: Fixup clocks and reference dai-common dt-bindings: mfd: syscon: Add TI's opp table compatible mfd: omap-usb-tll: Use struct_size to allocate tll dt-bindings: mfd: Explain lack of child dependency in simple-mfd dt-bindings: mfd: Dual licensing for st,stpmic1 bindings mfd: omap-usb-tll: Annotate struct usbtll_omap with __counted_by mfd: tps6594-core: Remove unneeded semicolon in tps6594_check_crc_mode() mfd: lm3533: Move to new GPIO descriptor-based APIs mfd: tps65912: Use devm helper functions to simplify probe ...
2024-07-01platform/chrome: cros_ec_proto: Introduce cros_ec_get_cmd_versions()Thomas Weißschuh1-0/+35
Retrieving the supported versions of a command is a fairly common operation. Provide a helper for it. If the command is not supported at all the EC returns -EINVAL/EC_RES_INVALID_PARAMS. This error is translated into an empty version mask as that is easier to handle for callers and they don't need to know about the error details. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20240630-cros_ec-charge-control-v5-3-8f649d018c52@weissschuh.net Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-06-14platform/chrome: cros_kbd_led_backlight: allow binding through MFDThomas Weißschuh2-3/+39
The ChromeOS EC used in Framework laptops supports the standard CrOS EC keyboard backlight protocol. However the firmware on these laptops doesn't implement the ACPI ID GOOG0002 that is recognized by cros_kbd_led_backlight and they also don't use device tree. Prepare the existing cros_kbd_led_backlight driver to be probed through the CrOS EC MFD device which works without ACPI or OF support. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20240526-cros_ec-kbd-led-framework-v3-3-ee577415a521@weissschuh.net Signed-off-by: Lee Jones <lee@kernel.org>
2024-06-14platform/chrome: cros_ec_lpc: Handle zero length read/writeBen Walsh1-3/+3
cros_ec_lpc_mec_read_bytes and cros_ec_lpc_mec_write_bytes call cros_ec_lpc_mec_in_range, which checks if addresses are in the MEC address range, and returns -EINVAL if the range given is not sensible. However cros_ec_lpc_mec_in_range was also returning -EINVAL for a zero length range. A zero length range should not be an error condition. cros_ec_lpc_mec_in_range now returns 1 in this case. cros_ec_lpc_io_bytes_mec checks for zero length, and returns immediately without beginning a transfer. Fixes: 68dbac0a58ef ("platform/chrome: cros_ec_lpc: MEC access can return error code") Fixes: 77a714325d09 ("platform/chrome: cros_ec_lpc: Fix error code in cros_ec_lpc_mec_read_bytes()") Signed-off-by: Ben Walsh <ben@jubnut.com> Link: https://lore.kernel.org/r/20240613212542.403-1-ben@jubnut.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-06-13platform/chrome: cros_ec_lpc: Fix error code in cros_ec_lpc_mec_read_bytes()Dan Carpenter1-2/+2
We changed these functions to returning negative error codes, but this first error path was accidentally overlooked. It leads to a Smatch warning: drivers/platform/chrome/cros_ec_lpc.c:181 ec_response_timed_out() error: uninitialized symbol 'data'. Fix this by returning the error code instead of success. Fixes: 68dbac0a58ef ("platform/chrome: cros_ec_lpc: MEC access can return error code") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Guenter Roeck <groeck@chromium.org> Link: https://lore.kernel.org/r/e0b43fb5-ecc8-4fb4-9b76-c06dea8cc4c4@moroto.mountain Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-06-12platform/chrome: cros_ec_debugfs: fix wrong EC message versionTzung-Bi Shih1-0/+1
ec_read_version_supported() uses ec_params_get_cmd_versions_v1 but it wrongly uses message version 0. Fix it. Fixes: e86264595225 ("mfd: cros_ec: add debugfs, console log file") Reviewed-by: Guenter Roeck <groeck@chromium.org> Link: https://lore.kernel.org/r/20240611113110.16955-1-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-06-12platform/chrome: cros_ec_proto: update Kunit test for get_next_data_v3Tzung-Bi Shih1-4/+4
Since commit 106d67398233 ("platform/chrome: cros_ec_proto: Upgrade get_next_event to v3"), (struct cros_ec_device *)->event_data becomes struct ec_response_get_next_event_v3. Update the Kunit test for fixing the following error: > Expected mock->msg.insize == sizeof(union ec_response_get_next_data_v1), but > mock->msg.insize == 18 (0x12) > sizeof(union ec_response_get_next_data_v1) == 16 (0x10) Reviewed-by: Guenter Roeck <groeck@chromium.org> Link: https://lore.kernel.org/r/20240611033113.4154548-1-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-06-11platform/chrome: cros_ec_proto: add missing MODULE_DESCRIPTION() macroJeff Johnson1-0/+1
make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/platform/chrome/cros_kunit_proto_test.o Add the missing invocation of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Link: https://lore.kernel.org/r/20240610-md-drivers-platform-chrome-v1-1-f9c75adcc1ca@quicinc.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-06-06platform/chrome: cros_ec_lpc: Add quirks for Framework LaptopBen Walsh1-0/+7
For Framework Laptops with Microchip EC (MEC), use the ACPI id "PNP0C09" to find the ACPI device, and AML mutex "ECMT" to protect EC memory access. Tested-by: Dustin L. Howett <dustin@howett.net> Signed-off-by: Ben Walsh <ben@jubnut.com> Link: https://lore.kernel.org/r/20240605063351.14836-6-ben@jubnut.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-06-06platform/chrome: cros_ec_lpc: Add a new quirk for AML mutexBen Walsh1-0/+19
Add a new quirk "CROS_EC_LPC_QUIRK_AML_MUTEX" which provides the name of an AML mutex to protect MEC memory access. Tested-by: Dustin L. Howett <dustin@howett.net> Signed-off-by: Ben Walsh <ben@jubnut.com> Link: https://lore.kernel.org/r/20240605063351.14836-5-ben@jubnut.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-06-06platform/chrome: cros_ec_lpc: Add a new quirk for ACPI idBen Walsh1-12/+38
Framework Laptops' ACPI exposes the EC with id "PNP0C09". But "PNP0C09" is part of the ACPI standard; there are lots of computers with EC chips with this id, and most of them don't support the cros_ec protocol. The driver could find the ACPI device by having "PNP0C09" in the acpi_match_table, but this would match devices which don't support the cros_ec protocol. Instead, add a new quirk "CROS_EC_LPC_QUIRK_ACPI_ID" which allows the id to be specified. This quirk is applied after the DMI check shows that the device is supported. Tested-by: Dustin L. Howett <dustin@howett.net> Signed-off-by: Ben Walsh <ben@jubnut.com> Link: https://lore.kernel.org/r/20240605063351.14836-4-ben@jubnut.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-06-06platform/chrome: cros_ec_lpc: MEC access can use an AML mutexBen Walsh2-2/+85
Framework Laptops have ACPI code which accesses the MEC memory. It uses an AML mutex to prevent concurrent access. But the cros_ec_lpc driver was not aware of this mutex. The ACPI code and LPC driver both attempted to talk to the EC at the same time, messing up communication with the EC. Allow the LPC driver MEC code to find and use the AML mutex. Tested-by: Dustin L. Howett <dustin@howett.net> Signed-off-by: Ben Walsh <ben@jubnut.com> Link: https://lore.kernel.org/r/20240605063351.14836-3-ben@jubnut.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-06-06platform/chrome: cros_ec_lpc: MEC access can return error codeBen Walsh4-56/+112
cros_ec_lpc_io_bytes_mec was returning a u8 checksum of all bytes read/written, which didn't leave room to indicate errors. Change this u8 to an int where negative values indicate an error, and non-negative values are the checksum as before. Tested-by: Dustin L. Howett <dustin@howett.net> Signed-off-by: Ben Walsh <ben@jubnut.com> Link: https://lore.kernel.org/r/20240605063351.14836-2-ben@jubnut.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-06-05platform/chrome: cros_ec_proto: Upgrade get_next_event to v3Daisuke Nojiri1-9/+18
Upgrade EC_CMD_GET_NEXT_EVENT to version 3. The max supported version will be v3. So, we speak v3 even if the EC says it supports v4+. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Link: https://lore.kernel.org/r/20240604230837.2878737-1-dnojiri@chromium.org [tzungbi: uint32_t -> u32 per suggested by checkpatch.pl] Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-06-03platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_readmem()Thomas Weißschuh1-0/+27
To read from the EC memory different mechanism are possible. ECs connected via LPC expose their memory via a ->cmd_readmem operation. Other protocols require the usage of EC_CMD_READ_MEMMAP, which on the other hand is not implemented by LPC ECs. Provide a helper that automatically selects the correct mechanism. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20240529-cros_ec-hwmon-v4-1-5cdf0c5db50a@weissschuh.net Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-05-29platform/chrome: cros_ec_debugfs: Make log polling period a parameterRob Barnes1-2/+6
Make EC log polling period a module parameter. This allows the polling period to be set via the kernel command line. Keeping the default at the current 10 second period. The optimal polling period will differ by board. Signed-off-by: Rob Barnes <robbarnes@google.com> Link: https://lore.kernel.org/r/20240507155809.525701-1-robbarnes@google.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-05-27platform/chrome: cros_ec: let cros_ec_suspend() call cros_ec_suspend_*Tzung-Bi Shih1-2/+2
After commit 2fbe479c0024 ("platform/chrome: cros_ec: Handle events during suspend after resume completion"), cros_ec_resume() starts to call cros_ec_resume_early() and cros_ec_resume_complete(). To be neat, let cros_ec_suspend() call cros_ec_suspend_prepare() and cros_ec_suspend_late(). Reviewed-by: Prashant Malani <pmalani@chromium.org> Link: https://lore.kernel.org/r/20240430020924.610724-1-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-05-27platform/chrome: cros_ec_proto: Fix cros_ec_get_host_command_version_mask kdocThomas Weißschuh1-2/+1
Mark the documentation block as kernel doc and drop the documentation of the non-existing parameter "@msg". Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20240524-cros_ec-cmd_versions-v1-2-8a148647d051@weissschuh.net Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-05-27platform/chrome: cros_ec_proto: Fix cros_ec_get_host_event_wake_mask kdocThomas Weißschuh1-2/+1
Mark the documentation block as kernel doc and drop the documentation of the non-existing parameter "@msg". Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20240524-cros_ec-cmd_versions-v1-1-8a148647d051@weissschuh.net Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-05-14Merge tag 'acpi-6.10-rc1' of ↵Linus Torvalds1-1/+0
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "These are ACPICA updates coming from the 20240322 release upstream, an ACPI DPTF driver update adding new platform support for it, some new quirks and some assorted fixes and cleanups. Specifics: - Add EINJ CXL error types to actbl1.h (Ben Cheatham) - Add support for RAS2 table to ACPICA (Shiju Jose) - Fix various spelling mistakes in text files and code comments in ACPICA (Colin Ian King) - Fix spelling and typos in ACPICA (Saket Dumbre) - Modify ACPI_OBJECT_COMMON_HEADER (lijun) - Add RISC-V RINTC affinity structure support to ACPICA (Haibo Xu) - Fix CXL 3.0 structure (RDPAS) in the CEDT table (Hojin Nam) - Add missin increment of registered GPE count to ACPICA (Daniil Tatianin) - Mark new ACPICA release 20240322 (Saket Dumbre) - Add support for the AEST V2 table to ACPICA (Ruidong Tian) - Disable -Wstringop-truncation for some ACPICA code in the kernel to avoid a compiler warning that is not very useful (Arnd Bergmann) - Make the kernel indicate support for several ACPI features that are in fact supported to the platform firmware through _OSC and fix the Generic Initiator Affinity _OSC bit (Armin Wolf) - Make the ACPI core set the owner value for ACPI drivers, drop the owner setting from a number of drivers and eliminate the owner field from struct acpi_driver (Krzysztof Kozlowski) - Rearrange fields in several structures to effectively eliminate computations from container_of() in some cases (Andy Shevchenko) - Do some assorted cleanups of the ACPI device enumeration code (Andy Shevchenko) - Make the ACPI device enumeration code skip devices with _STA values clearly identified by the specification as invalid (Rafael Wysocki) - Rework the handling of the NHLT table to simplify and clarify it and drop some obsolete pieces (Cezary Rojewski) - Add ACPI IRQ override quirks for Asus Vivobook Pro N6506MV, TongFang GXxHRXx and GMxHGxx, and XMG APEX 17 M23 (Guenter Schafranek, Tamim Khan, Christoffer Sandberg) - Add reference to UEFI DSD Guide to the documentation related to the ACPI handling of device properties (Sakari Ailus) - Fix SRAT lookup of CFMWS ranges with numa_fill_memblks(), remove lefover architecture-dependent code from the ACPI NUMA handling code and simplify it on top of that (Robert Richter) - Add a num-cs device property to specify the number of chip selects for Intel Braswell to the ACPI LPSS (Intel SoC) driver and remove a nested CONFIG_PM #ifdef from it (Andy Shevchenko) - Move three x86-specific ACPI files to the x86 directory (Andy Shevchenko) - Mark SMO8810 accel on Dell XPS 15 9550 as always present and add a PNP_UART1_SKIP quirk for Lenovo Blade2 tablets (Hans de Goede) - Move acpi_blacklisted() declaration to asm/acpi.h (Kuppuswamy Sathyanarayanan) - Add Lunar Lake support to the ACPI DPTF driver (Sumeet Pawnikar) - Mark the einj_driver driver's remove callback as __exit because it cannot get unbound via sysfs (Uwe Kleine-König) - Fix a typo in the ACPI documentation regarding the layout of sysfs subdirectory representing the ACPI namespace (John Watts) - Make the ACPI pfrut utility print the update_cap field during capability query (Chen Yu) - Add HAS_IOPORT dependencies to PNP (Niklas Schnelle)" * tag 'acpi-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (72 commits) ACPI/NUMA: Squash acpi_numa_memory_affinity_init() into acpi_parse_memory_affinity() ACPI/NUMA: Squash acpi_numa_slit_init() into acpi_parse_slit() ACPI/NUMA: Remove architecture dependent remainings x86/numa: Fix SRAT lookup of CFMWS ranges with numa_fill_memblks() ACPI: video: Add backlight=native quirk for Lenovo Slim 7 16ARH7 ACPI: scan: Avoid enumerating devices with clearly invalid _STA values ACPI: Move acpi_blacklisted() declaration to asm/acpi.h ACPI: resource: Skip IRQ override on Asus Vivobook Pro N6506MV ACPICA: AEST: Add support for the AEST V2 table ACPI: tools: pfrut: Print the update_cap field during capability query ACPI: property: Add reference to UEFI DSD Guide Documentation: firmware-guide: ACPI: Fix namespace typo PNP: add HAS_IOPORT dependencies ACPI: resource: Do IRQ override on TongFang GXxHRXx and GMxHGxx ACPI: resource: Do IRQ override on GMxBGxx (XMG APEX 17 M23) ACPICA: Update acpixf.h for new ACPICA release 20240322 ACPICA: events/evgpeinit: don't forget to increment registered GPE count ACPICA: Fix CXL 3.0 structure (RDPAS) in the CEDT table ACPICA: SRAT: Add dump and compiler support for RINTC affinity structure ACPICA: SRAT: Add RISC-V RINTC affinity structure ...
2024-05-13Merge branch 'acpi-bus'Rafael J. Wysocki1-1/+0
Merge changes related to _OSC handling and updates eliminating the owner field from struct acpi_driver: - Make the kernel indicate support for several ACPI features that are in fact supported to the platform firmware through _OSC and fix the Generic Initiator Affinity _OSC bit (Armin Wolf). - Make the ACPI core set the owner value for ACPI drivers, drop the owner setting from a number of drivers and eliminate the owner field from struct acpi_driver (Krzysztof Kozlowski). * acpi-bus: (24 commits) ACPI: drop redundant owner from acpi_driver virt: vmgenid: drop owner assignment ptp: vmw: drop owner assignment platform/x86/wireless-hotkey: drop owner assignment platform/x86/toshiba_haps: drop owner assignment platform/x86/toshiba_bluetooth: drop owner assignment platform/x86/toshiba_acpi: drop owner assignment platform/x86/sony-laptop: drop owner assignment platform/x86/lg-laptop: drop owner assignment platform/x86/intel/smartconnect: drop owner assignment platform/x86/intel/rst: drop owner assignment platform/x86/eeepc: drop owner assignment platform/x86/dell: drop owner assignment platform: classmate-laptop: drop owner assignment platform: asus-laptop: drop owner assignment platform/chrome: wilco_ec: drop owner assignment net: fjes: drop owner assignment Input: atlas - drop owner assignment ACPI: store owner from modules with acpi_bus_register_driver() ACPI: bus: Indicate support for IRQ ResourceSource thru _OSC ...
2024-04-30platform/chrome: cros_ec: Handle events during suspend after resume completionKarthikeyan Ramasubramanian1-8/+8
Commit 47ea0ddb1f56 ("platform/chrome: cros_ec_lpc: Separate host command and irq disable") re-ordered the resume sequence. Before that change, cros_ec resume sequence is: 1) Enable IRQ 2) Send resume event 3) Handle events during suspend After commit 47ea0ddb1f56 ("platform/chrome: cros_ec_lpc: Separate host command and irq disable"), cros_ec resume sequence is: 1) Enable IRQ 2) Handle events during suspend 3) Send resume event. This re-ordering leads to delayed handling of any events queued between items 2) and 3) with the updated sequence. Also in certain platforms, EC skips triggering interrupt for certain events eg. mkbp events until the resume event is received. Such events are stuck in the host event queue indefinitely. This change puts back the original order to avoid any delay in handling the pending events. Fixes: 47ea0ddb1f56 ("platform/chrome: cros_ec_lpc: Separate host command and irq disable") Cc: <stable@vger.kernel.org> Cc: Lalith Rajendran <lalithkraj@chromium.org> Cc: <chrome-platform@lists.linux.dev> Signed-off-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Link: https://lore.kernel.org/r/20240429121343.v2.1.If2e0cef959f1f6df9f4d1ab53a97c54aa54208af@changeid Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_ec_lpc: add quirks for the Framework Laptop (AMD)Dustin L. Howett1-1/+15
The original Framework Laptop 13 platform (Intel 11th, 12th, and 13th Generation at this time) uses a Microchip embedded controller in a standard configuration. The newer devices in this product line--Framework Laptop 13 and 16 (AMD Ryzen)--use a NPCX embedded controller. However, they deviate from the configuration of ChromeOS platforms built with the NPCX EC. * The MMIO region for EC memory begins at port 0xE00 rather than the expected 0x900. cros_ec_lpc's quirks system is used to address this issue. Signed-off-by: Dustin L. Howett <dustin@howett.net> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Tested-by: Thomas Weißschuh <linux@weissschuh.net> Tested-by: Mario Limonciello <superm1@gmail.com> Link: https://lore.kernel.org/r/20240403004713.130365-5-dustin@howett.net Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_ec_lpc: add a "quirks" systemDustin L. Howett1-0/+31
Some devices ship a ChromeOS EC in a non-standard configuration. Quirks allow cros_ec_lpc to account for these non-standard configurations. It only supports one quirk right now: - CROS_EC_LPC_QUIRK_REMAP_MEMORY: use a different port I/O base for MMIO to the EC's memory region Signed-off-by: Dustin L. Howett <dustin@howett.net> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Tested-by: Thomas Weißschuh <linux@weissschuh.net> Tested-by: Mario Limonciello <superm1@gmail.com> Link: https://lore.kernel.org/r/20240403004713.130365-4-dustin@howett.net Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_ec_lpc: pass driver_data from DMI to the deviceDustin L. Howett1-2/+7
lpc_driver_data will be stored in drvdata until probe is complete. Signed-off-by: Dustin L. Howett <dustin@howett.net> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Tested-by: Thomas Weißschuh <linux@weissschuh.net> Tested-by: Mario Limonciello <superm1@gmail.com> Link: https://lore.kernel.org/r/20240403004713.130365-3-dustin@howett.net Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_ec_lpc: introduce a priv struct for the lpc deviceDustin L. Howett1-4/+21
lpc_driver_data stores the MMIO port base for EC mapped memory. cros_ec_lpc_readmem uses this port base instead of hardcoding EC_LPC_ADDR_MEMMAP. Signed-off-by: Dustin L. Howett <dustin@howett.net> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Tested-by: Thomas Weißschuh <linux@weissschuh.net> Tested-by: Mario Limonciello <superm1@gmail.com> Link: https://lore.kernel.org/r/20240403004713.130365-2-dustin@howett.net Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: add HAS_IOPORT dependenciesNiklas Schnelle2-0/+2
In a future patch HAS_IOPORT=n will disable inb()/outb() and friends at compile time. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Link: https://lore.kernel.org/r/20240405134151.5560-2-schnelle@linux.ibm.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_hps_i2c: Replace deprecated UNIVERSAL_DEV_PM_OPS()Andy Shevchenko1-2/+2
The UNIVERSAL_DEV_PM_OPS() macro is deprecated. Replace it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240403105502.558351-1-andriy.shevchenko@linux.intel.com Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding ↵Tzung-Bi Shih1-2/+9
fallback match Instead of using fallback driver name match, provide ID table[1] for the primary match. Also shrink the name for fitting to [2]. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 [2]: https://elixir.bootlin.com/linux/v6.8/source/include/linux/mod_devicetable.h#L608 Reviewed-by: Benson Leung <bleung@chromium.org> Link: https://lore.kernel.org/r/20240329075630.2069474-15-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: wilco_ec: core: provide ID table for avoiding fallback matchTzung-Bi Shih1-1/+8
Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Benson Leung <bleung@chromium.org> Link: https://lore.kernel.org/r/20240329075630.2069474-19-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: wilco_ec: event: remove redundant MODULE_ALIASTzung-Bi Shih1-1/+0
There is no platform driver in the file. Remove the redundant MODULE_ALIAS(). Reviewed-by: Benson Leung <bleung@chromium.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240329075630.2069474-18-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: wilco_ec: debugfs: provide ID table for avoiding fallback matchTzung-Bi Shih1-1/+8
Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Benson Leung <bleung@chromium.org> Link: https://lore.kernel.org/r/20240329075630.2069474-17-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: wilco_ec: telemetry: provide ID table for avoiding fallback ↵Tzung-Bi Shih1-1/+8
match Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung <bleung@chromium.org> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20240329075630.2069474-16-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_ec_vbc: provide ID table for avoiding fallback matchTzung-Bi Shih1-1/+8
Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Benson Leung <bleung@chromium.org> Link: https://lore.kernel.org/r/20240329075630.2069474-14-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_ec_lightbar: provide ID table for avoiding fallback matchTzung-Bi Shih1-1/+8
Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Benson Leung <bleung@chromium.org> Link: https://lore.kernel.org/r/20240329075630.2069474-13-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_ec_sysfs: provide ID table for avoiding fallback matchTzung-Bi Shih1-1/+8
Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung <bleung@chromium.org> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20240329075630.2069474-11-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_ec_debugfs: provide ID table for avoiding fallback matchTzung-Bi Shih1-1/+8
Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Benson Leung <bleung@chromium.org> Link: https://lore.kernel.org/r/20240329075630.2069474-10-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_ec_chardev: provide ID table for avoiding fallback matchTzung-Bi Shih1-1/+8
Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung <bleung@chromium.org> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20240329075630.2069474-9-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_usbpd_notify: provide ID table for avoiding fallback matchTzung-Bi Shih1-1/+8
Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung <bleung@chromium.org> Acked-by: Prashant Malani <pmalani@chromium.org> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20240329075630.2069474-8-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_usbpd_logger: provide ID table for avoiding fallback matchTzung-Bi Shih1-1/+8
Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung <bleung@chromium.org> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20240329075630.2069474-7-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_ec_sensorhub: provide ID table for avoiding fallback matchTzung-Bi Shih1-1/+8
Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung <bleung@chromium.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240329075630.2069474-5-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: cros_ec_proto: avoid -Wflex-array-member-not-at-end warningsGustavo A. R. Silva1-42/+30
Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known at compile-time, and refactor the rest of the code, accordingly. So, with these changes, fix the following warning: drivers/platform/chrome/cros_ec_proto_test.c:1547:40: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] drivers/platform/chrome/cros_ec_proto_test.c:1607:40: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] drivers/platform/chrome/cros_ec_proto_test.c:1645:40: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] drivers/platform/chrome/cros_ec_proto_test.c:1668:40: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Link: https://github.com/KSPP/linux/issues/202 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/ZgMaDl/of8YC445S@neat Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2024-04-24platform/chrome: wilco_ec: use sysfs_emit() instead of sprintf()Ai Chao1-1/+1
Follow the advice in Documentation/filesystems/sysfs.rst: show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Ai Chao <aichao@kylinos.cn> Link: https://lore.kernel.org/r/20240314052828.186924-1-aichao@kylinos.cn Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>