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 'tag-chrome-platform-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform

Pull chrome platform updates from Benson Leung:

- Changes for EC_MKBP_EVENT_SENSOR_FIFO handling.

- Also, maintainership changes. Olofj out, Enric balletbo in.

* tag 'tag-chrome-platform-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform:
MAINTAINERS: add maintainers for ChromeOS EC sub-drivers
MAINTAINERS: platform/chrome: Add Enric as a maintainer
MAINTAINERS: platform/chrome: remove myself as maintainer
platform/chrome: don't report EC_MKBP_EVENT_SENSOR_FIFO as wakeup
platform/chrome: straighten out cros_ec_get_{next,host}_event() error codes

+31 -8
+10 -1
MAINTAINERS
··· 3674 3674 3675 3675 CHROME HARDWARE PLATFORM SUPPORT 3676 3676 M: Benson Leung <bleung@chromium.org> 3677 - M: Olof Johansson <olof@lixom.net> 3677 + M: Enric Balletbo i Serra <enric.balletbo@collabora.com> 3678 3678 S: Maintained 3679 3679 T: git git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform.git 3680 3680 F: drivers/platform/chrome/ 3681 + 3682 + CHROMEOS EC SUBDRIVERS 3683 + M: Benson Leung <bleung@chromium.org> 3684 + M: Enric Balletbo i Serra <enric.balletbo@collabora.com> 3685 + R: Guenter Roeck <groeck@chromium.org> 3686 + S: Maintained 3687 + N: cros_ec 3688 + N: cros-ec 3689 + F: drivers/power/supply/cros_usbpd-charger.c 3681 3690 3682 3691 CIRRUS LOGIC AUDIO CODEC DRIVERS 3683 3692 M: Brian Austin <brian.austin@cirrus.com>
+17 -5
drivers/platform/chrome/cros_ec_proto.c
··· 575 575 576 576 int cros_ec_get_next_event(struct cros_ec_device *ec_dev, bool *wake_event) 577 577 { 578 + u8 event_type; 578 579 u32 host_event; 579 580 int ret; 580 581 581 582 if (!ec_dev->mkbp_event_supported) { 582 583 ret = get_keyboard_state_event(ec_dev); 583 - if (ret < 0) 584 + if (ret <= 0) 584 585 return ret; 585 586 586 587 if (wake_event) ··· 591 590 } 592 591 593 592 ret = get_next_event(ec_dev); 594 - if (ret < 0) 593 + if (ret <= 0) 595 594 return ret; 596 595 597 596 if (wake_event) { 597 + event_type = ec_dev->event_data.event_type; 598 598 host_event = cros_ec_get_host_event(ec_dev); 599 599 600 - /* Consider non-host_event as wake event */ 601 - *wake_event = !host_event || 602 - !!(host_event & ec_dev->host_event_wake_mask); 600 + /* 601 + * Sensor events need to be parsed by the sensor sub-device. 602 + * Defer them, and don't report the wakeup here. 603 + */ 604 + if (event_type == EC_MKBP_EVENT_SENSOR_FIFO) 605 + *wake_event = false; 606 + /* Masked host-events should not count as wake events. */ 607 + else if (host_event && 608 + !(host_event & ec_dev->host_event_wake_mask)) 609 + *wake_event = false; 610 + /* Consider all other events as wake events. */ 611 + else 612 + *wake_event = true; 603 613 } 604 614 605 615 return ret;
+4 -2
include/linux/mfd/cros_ec.h
··· 317 317 * @wake_event: Pointer to a bool set to true upon return if the event might be 318 318 * treated as a wake event. Ignored if null. 319 319 * 320 - * Return: 0 on success or negative error code. 320 + * Return: negative error code on errors; 0 for no data; or else number of 321 + * bytes received (i.e., an event was retrieved successfully). Event types are 322 + * written out to @ec_dev->event_data.event_type on success. 321 323 */ 322 324 int cros_ec_get_next_event(struct cros_ec_device *ec_dev, bool *wake_event); 323 325 ··· 331 329 * events raised and call the functions in the ec notifier. This function 332 330 * is a helper to know which events are raised. 333 331 * 334 - * Return: 0 on success or negative error code. 332 + * Return: 0 on error or non-zero bitmask of one or more EC_HOST_EVENT_*. 335 333 */ 336 334 u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev); 337 335