2019-01-29 10:38:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2015-02-27 06:37:48 +01:00
|
|
|
|
2018-10-09 10:56:46 -07:00
|
|
|
|
2023-05-09 23:26:24 +00:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2019-09-02 11:53:05 +02:00
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2023-01-04 01:15:24 +00:00
|
|
|
|
2018-02-22 13:21:17 -08:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
platform/chrome: cros_ec: Match implementation with headers
The 'cros_ec' core driver is the common interface for the cros_ec
transport drivers to do the shared operations to register, unregister,
suspend, resume and handle_event. The interface is provided by including
the header 'include/linux/platform_data/cros_ec_proto.h', however, instead
of have the implementation of these functions in cros_ec_proto.c, it is in
'cros_ec.c', which is a different kernel module. Apart from being a bad
practice, this can induce confusions allowing the users of the cros_ec
protocol to call these functions.
The register, unregister, suspend, resume and handle_event functions
*should* only be called by the different transport drivers (i2c, spi, lpc,
etc.), so make this a bit less confusing by moving these functions from
the public in-kernel space to a private include in platform/chrome, and
then, the interface for cros_ec module and for the cros_ec_proto module is
clean.
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Benson Leung <bleung@chromium.org>
2020-01-22 10:07:01 +01:00
|
|
|
|
2019-06-14 23:43:00 +02:00
|
|
|
|
2018-07-18 18:09:55 +02:00
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2025-01-29 02:13:29 +08:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2017-12-01 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-02 19:47:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 07:33:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 07:33:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-02 19:47:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 07:33:49 +01:00
|
|
|
|
2024-06-05 07:33:50 +01:00
|
|
|
|
|
|
|
|
|
2024-04-02 19:47:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 07:33:49 +01:00
|
|
|
|
2024-06-05 07:33:50 +01:00
|
|
|
|
2024-04-02 19:47:12 -05:00
|
|
|
|
|
|
|
|
|
2024-04-02 19:47:10 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:14 -08:00
|
|
|
|
|
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime
On many boards, communication between the kernel and the Embedded
Controller happens over an LPC bus. In these cases, the kernel config
CONFIG_CROS_EC_LPC is enabled. Some of these LPC boards contain a
Microchip Embedded Controller (MEC) that is different from the regular
EC. On these devices, the same LPC bus is used, but the protocol is
a little different. In these cases, the CONFIG_CROS_EC_LPC_MEC kernel
config is enabled. Currently, the kernel decides at compile-time whether
or not to use the MEC variant, and, when that kernel option is selected
it breaks the other boards. We would like a kind of runtime detection to
avoid this.
This patch adds that detection mechanism by probing the protocol at
runtime, first we assume that a MEC variant is connected, and if the
protocol fails it fallbacks to the regular EC. This adds a bit of
overload because we try to read twice on those LPC boards that doesn't
contain a MEC variant, but is a better solution than having to select the
EC variant at compile-time.
While here also fix the alignment in Kconfig file for this config option
replacing the spaces by tabs.
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Nick Crews <ncrews@chromium.org>
Reviewed-by: Nick Crews <ncrews@chromium.org>
2019-06-14 23:43:01 +02:00
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:14 -08:00
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime
On many boards, communication between the kernel and the Embedded
Controller happens over an LPC bus. In these cases, the kernel config
CONFIG_CROS_EC_LPC is enabled. Some of these LPC boards contain a
Microchip Embedded Controller (MEC) that is different from the regular
EC. On these devices, the same LPC bus is used, but the protocol is
a little different. In these cases, the CONFIG_CROS_EC_LPC_MEC kernel
config is enabled. Currently, the kernel decides at compile-time whether
or not to use the MEC variant, and, when that kernel option is selected
it breaks the other boards. We would like a kind of runtime detection to
avoid this.
This patch adds that detection mechanism by probing the protocol at
runtime, first we assume that a MEC variant is connected, and if the
protocol fails it fallbacks to the regular EC. This adds a bit of
overload because we try to read twice on those LPC boards that doesn't
contain a MEC variant, but is a better solution than having to select the
EC variant at compile-time.
While here also fix the alignment in Kconfig file for this config option
replacing the spaces by tabs.
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Nick Crews <ncrews@chromium.org>
Reviewed-by: Nick Crews <ncrews@chromium.org>
2019-06-14 23:43:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
2019-06-14 23:43:00 +02:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
2019-06-14 23:43:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime
On many boards, communication between the kernel and the Embedded
Controller happens over an LPC bus. In these cases, the kernel config
CONFIG_CROS_EC_LPC is enabled. Some of these LPC boards contain a
Microchip Embedded Controller (MEC) that is different from the regular
EC. On these devices, the same LPC bus is used, but the protocol is
a little different. In these cases, the CONFIG_CROS_EC_LPC_MEC kernel
config is enabled. Currently, the kernel decides at compile-time whether
or not to use the MEC variant, and, when that kernel option is selected
it breaks the other boards. We would like a kind of runtime detection to
avoid this.
This patch adds that detection mechanism by probing the protocol at
runtime, first we assume that a MEC variant is connected, and if the
protocol fails it fallbacks to the regular EC. This adds a bit of
overload because we try to read twice on those LPC boards that doesn't
contain a MEC variant, but is a better solution than having to select the
EC variant at compile-time.
While here also fix the alignment in Kconfig file for this config option
replacing the spaces by tabs.
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Nick Crews <ncrews@chromium.org>
Reviewed-by: Nick Crews <ncrews@chromium.org>
2019-06-14 23:43:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
2019-06-14 23:43:00 +02:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
2019-06-14 23:43:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime
On many boards, communication between the kernel and the Embedded
Controller happens over an LPC bus. In these cases, the kernel config
CONFIG_CROS_EC_LPC is enabled. Some of these LPC boards contain a
Microchip Embedded Controller (MEC) that is different from the regular
EC. On these devices, the same LPC bus is used, but the protocol is
a little different. In these cases, the CONFIG_CROS_EC_LPC_MEC kernel
config is enabled. Currently, the kernel decides at compile-time whether
or not to use the MEC variant, and, when that kernel option is selected
it breaks the other boards. We would like a kind of runtime detection to
avoid this.
This patch adds that detection mechanism by probing the protocol at
runtime, first we assume that a MEC variant is connected, and if the
protocol fails it fallbacks to the regular EC. This adds a bit of
overload because we try to read twice on those LPC boards that doesn't
contain a MEC variant, but is a better solution than having to select the
EC variant at compile-time.
While here also fix the alignment in Kconfig file for this config option
replacing the spaces by tabs.
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Nick Crews <ncrews@chromium.org>
Reviewed-by: Nick Crews <ncrews@chromium.org>
2019-06-14 23:43:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
|
|
|
|
|
2019-06-14 23:43:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-13 16:55:14 +03:00
|
|
|
|
2019-06-14 23:43:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2019-06-14 23:43:00 +02:00
|
|
|
|
|
|
|
|
|
platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime
On many boards, communication between the kernel and the Embedded
Controller happens over an LPC bus. In these cases, the kernel config
CONFIG_CROS_EC_LPC is enabled. Some of these LPC boards contain a
Microchip Embedded Controller (MEC) that is different from the regular
EC. On these devices, the same LPC bus is used, but the protocol is
a little different. In these cases, the CONFIG_CROS_EC_LPC_MEC kernel
config is enabled. Currently, the kernel decides at compile-time whether
or not to use the MEC variant, and, when that kernel option is selected
it breaks the other boards. We would like a kind of runtime detection to
avoid this.
This patch adds that detection mechanism by probing the protocol at
runtime, first we assume that a MEC variant is connected, and if the
protocol fails it fallbacks to the regular EC. This adds a bit of
overload because we try to read twice on those LPC boards that doesn't
contain a MEC variant, but is a better solution than having to select the
EC variant at compile-time.
While here also fix the alignment in Kconfig file for this config option
replacing the spaces by tabs.
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Nick Crews <ncrews@chromium.org>
Reviewed-by: Nick Crews <ncrews@chromium.org>
2019-06-14 23:43:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
|
|
|
|
|
2019-06-14 23:43:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-13 16:55:14 +03:00
|
|
|
|
2019-06-14 23:43:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime
On many boards, communication between the kernel and the Embedded
Controller happens over an LPC bus. In these cases, the kernel config
CONFIG_CROS_EC_LPC is enabled. Some of these LPC boards contain a
Microchip Embedded Controller (MEC) that is different from the regular
EC. On these devices, the same LPC bus is used, but the protocol is
a little different. In these cases, the CONFIG_CROS_EC_LPC_MEC kernel
config is enabled. Currently, the kernel decides at compile-time whether
or not to use the MEC variant, and, when that kernel option is selected
it breaks the other boards. We would like a kind of runtime detection to
avoid this.
This patch adds that detection mechanism by probing the protocol at
runtime, first we assume that a MEC variant is connected, and if the
protocol fails it fallbacks to the regular EC. This adds a bit of
overload because we try to read twice on those LPC boards that doesn't
contain a MEC variant, but is a better solution than having to select the
EC variant at compile-time.
While here also fix the alignment in Kconfig file for this config option
replacing the spaces by tabs.
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Nick Crews <ncrews@chromium.org>
Reviewed-by: Nick Crews <ncrews@chromium.org>
2019-06-14 23:43:01 +02:00
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:14 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-14 23:43:00 +02:00
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-09 13:04:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2015-06-09 13:04:46 +02:00
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2015-06-09 13:04:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-13 12:41:38 +08:00
|
|
|
|
|
|
|
|
|
2015-06-09 13:04:46 +02:00
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
2015-06-09 13:04:46 +02:00
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
2015-06-09 13:04:46 +02:00
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-25 18:17:43 +01:00
|
|
|
|
2015-06-09 13:04:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-09 13:04:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime
On many boards, communication between the kernel and the Embedded
Controller happens over an LPC bus. In these cases, the kernel config
CONFIG_CROS_EC_LPC is enabled. Some of these LPC boards contain a
Microchip Embedded Controller (MEC) that is different from the regular
EC. On these devices, the same LPC bus is used, but the protocol is
a little different. In these cases, the CONFIG_CROS_EC_LPC_MEC kernel
config is enabled. Currently, the kernel decides at compile-time whether
or not to use the MEC variant, and, when that kernel option is selected
it breaks the other boards. We would like a kind of runtime detection to
avoid this.
This patch adds that detection mechanism by probing the protocol at
runtime, first we assume that a MEC variant is connected, and if the
protocol fails it fallbacks to the regular EC. This adds a bit of
overload because we try to read twice on those LPC boards that doesn't
contain a MEC variant, but is a better solution than having to select the
EC variant at compile-time.
While here also fix the alignment in Kconfig file for this config option
replacing the spaces by tabs.
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Nick Crews <ncrews@chromium.org>
Reviewed-by: Nick Crews <ncrews@chromium.org>
2019-06-14 23:43:01 +02:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-09 13:04:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-09 13:04:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-25 18:17:43 +01:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-22 08:27:18 +02:00
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-02 19:47:10 -05:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
|
|
|
|
|
2023-05-09 23:26:24 +00:00
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2019-11-19 13:45:46 +01:00
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2019-11-19 13:45:46 +01:00
|
|
|
|
|
|
|
|
|
2023-01-04 01:15:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-09 23:26:24 +00:00
|
|
|
|
2023-08-02 17:58:48 +00:00
|
|
|
|
2025-02-17 21:39:49 +01:00
|
|
|
|
2023-01-04 01:15:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-18 01:57:59 +00:00
|
|
|
|
2019-11-19 13:45:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-22 13:21:17 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
|
|
|
|
|
2024-06-05 07:33:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:14 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2024-04-02 19:47:10 -05:00
|
|
|
|
2025-01-29 02:13:29 +08:00
|
|
|
|
2023-01-10 14:36:11 -05:00
|
|
|
|
2018-10-09 10:56:46 -07:00
|
|
|
|
2024-04-02 19:47:12 -05:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2024-04-02 19:47:10 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-02 19:47:12 -05:00
|
|
|
|
2025-01-29 02:13:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-02 19:47:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 07:33:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 07:33:50 +01:00
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-02 19:47:12 -05:00
|
|
|
|
2025-01-07 09:45:14 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-14 12:21:22 -08:00
|
|
|
|
2025-01-07 09:45:14 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-02 19:47:12 -05:00
|
|
|
|
2025-01-07 09:45:14 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2025-01-07 09:45:14 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2025-01-07 09:45:14 -08:00
|
|
|
|
|
|
|
|
|
2022-11-01 15:22:06 -07:00
|
|
|
|
2025-01-07 09:45:14 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2024-04-02 19:47:10 -05:00
|
|
|
|
2022-02-17 10:59:30 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime
On many boards, communication between the kernel and the Embedded
Controller happens over an LPC bus. In these cases, the kernel config
CONFIG_CROS_EC_LPC is enabled. Some of these LPC boards contain a
Microchip Embedded Controller (MEC) that is different from the regular
EC. On these devices, the same LPC bus is used, but the protocol is
a little different. In these cases, the CONFIG_CROS_EC_LPC_MEC kernel
config is enabled. Currently, the kernel decides at compile-time whether
or not to use the MEC variant, and, when that kernel option is selected
it breaks the other boards. We would like a kind of runtime detection to
avoid this.
This patch adds that detection mechanism by probing the protocol at
runtime, first we assume that a MEC variant is connected, and if the
protocol fails it fallbacks to the regular EC. This adds a bit of
overload because we try to read twice on those LPC boards that doesn't
contain a MEC variant, but is a better solution than having to select the
EC variant at compile-time.
While here also fix the alignment in Kconfig file for this config option
replacing the spaces by tabs.
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Nick Crews <ncrews@chromium.org>
Reviewed-by: Nick Crews <ncrews@chromium.org>
2019-06-14 23:43:01 +02:00
|
|
|
|
2025-01-07 09:45:13 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 07:33:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
platform/chrome: cros_ec_lpc: Choose Microchip EC at runtime
On many boards, communication between the kernel and the Embedded
Controller happens over an LPC bus. In these cases, the kernel config
CONFIG_CROS_EC_LPC is enabled. Some of these LPC boards contain a
Microchip Embedded Controller (MEC) that is different from the regular
EC. On these devices, the same LPC bus is used, but the protocol is
a little different. In these cases, the CONFIG_CROS_EC_LPC_MEC kernel
config is enabled. Currently, the kernel decides at compile-time whether
or not to use the MEC variant, and, when that kernel option is selected
it breaks the other boards. We would like a kind of runtime detection to
avoid this.
This patch adds that detection mechanism by probing the protocol at
runtime, first we assume that a MEC variant is connected, and if the
protocol fails it fallbacks to the regular EC. This adds a bit of
overload because we try to read twice on those LPC boards that doesn't
contain a MEC variant, but is a better solution than having to select the
EC variant at compile-time.
While here also fix the alignment in Kconfig file for this config option
replacing the spaces by tabs.
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Nick Crews <ncrews@chromium.org>
Reviewed-by: Nick Crews <ncrews@chromium.org>
2019-06-14 23:43:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2022-02-17 10:59:30 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2025-08-28 08:35:57 +00:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-09 13:04:46 +02:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2024-04-02 19:47:10 -05:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2018-10-09 10:56:46 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-29 11:22:54 +01:00
|
|
|
|
2018-10-09 10:56:46 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-27 10:10:17 +02:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2019-09-02 11:53:00 +02:00
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2022-01-23 18:52:00 +01:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2024-08-06 21:54:09 -05:00
|
|
|
|
2024-04-02 19:47:13 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-06 21:54:09 -05:00
|
|
|
|
2024-06-05 07:33:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-29 02:13:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-09-14 11:59:30 +02:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-07 14:56:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-22 08:27:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-01 14:42:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-17 10:59:29 -06:00
|
|
|
|
|
|
|
|
|
2024-08-06 21:54:09 -05:00
|
|
|
|
2024-04-02 19:47:13 -05:00
|
|
|
|
|
|
|
|
|
2024-08-06 21:54:09 -05:00
|
|
|
|
2024-04-02 19:47:13 -05:00
|
|
|
|
2024-08-06 21:54:09 -05:00
|
|
|
|
2024-04-02 19:47:13 -05:00
|
|
|
|
|
|
|
|
|
2024-08-06 21:54:09 -05:00
|
|
|
|
2022-02-17 10:59:29 -06:00
|
|
|
|
|
|
|
|
|
2024-12-24 12:55:58 -06:00
|
|
|
|
2022-02-17 10:59:29 -06:00
|
|
|
|
2024-08-06 21:54:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-24 12:55:58 -06:00
|
|
|
|
2024-08-06 21:54:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-17 10:59:29 -06:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2023-05-15 14:25:52 -06:00
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
|
|
|
|
|
2023-10-27 16:02:22 -05:00
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
|
|
|
|
|
2023-05-15 14:25:52 -06:00
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
|
|
|
|
|
2023-10-27 16:02:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-30 16:49:32 +08:00
|
|
|
|
2023-05-15 14:25:52 -06:00
|
|
|
|
|
|
|
|
|
2023-10-27 16:02:22 -05:00
|
|
|
|
2023-05-15 14:25:52 -06:00
|
|
|
|
2023-10-27 16:02:22 -05:00
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
2017-05-16 17:46:48 +02:00
|
|
|
|
platform/chrome: cros_ec_lpc: Force synchronous probe
This reverts commit bd88b965ae8c ("platform/chrome: cros_ec_lpc: Mark
PROBE_PREFER_ASYNCHRONOUS"), and then some.
It has been reported that there are issues with 'cros-ec-keyb' devices
that are children of this. As noted in the initial patch for its ACPI
support (commit ba0f32141bc5 ("Input: cros_ec_keyb - handle x86
detachable/convertible Chromebooks")), it's possible to probe an ACPI
child device before its parent is probed -- hence the need for
EPROBE_DEFER. Unfortunately, poking your parent's dev_get_drvdata()
isn't safe with asynchronous probe, as there's no locking, and the
ordering is all wrong anyway (drvdata is set before the device is
*really* ready).
Because this parent/child relationship has known issues, let's go the
other direction and force synchronous probe, until we resolve the
issues.
Possible solutions involve adding device links, so we ensure the child
doesn't probe before the parent is done; or perhaps some other larger
refactoring (auxiliary bus?). But that might take a little more effort
and review, as there are many other potential sub-devices of
cros_ec_lpc that could need patching.
Note that we don't have the same problem for non-ACPI cros-ec hosts,
like cros-ec-spi (commit 015e4b05c377 ("platform/chrome: cros_ec_spi:
Set PROBE_PREFER_ASYNCHRONOUS")), because its sub-devices aren't created
until cros_ec_register(), or they don't exist at all (e.g., FPMCU uses).
Fixes: bd88b965ae8c ("platform/chrome: cros_ec_lpc: Mark PROBE_PREFER_ASYNCHRONOUS")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20221111231302.3458191-1-briannorris@chromium.org
2022-11-11 15:13:01 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2024-10-28 09:26:11 +01:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
2017-12-01 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-02 19:47:11 -05:00
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
2025-01-29 02:13:29 +08:00
|
|
|
|
|
|
|
|
|
2018-05-22 16:08:41 -07:00
|
|
|
|
2024-04-02 19:47:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-01 14:42:21 +01:00
|
|
|
|
2024-04-02 19:47:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-01 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-01 14:42:21 +01:00
|
|
|
|
|
|
|
|
|
2015-02-02 12:26:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|