Integrated Sensor Hub (ISH) is also a MCU running EC having feature bit EC_FEATURE_ISH. Instantiate it as a special CrOS EC device with device name 'cros_ish'.
Unified · Split
| @@ -418,6 +418,19 @@ static int ec_device_probe(struct platform_device *pdev) · 417 unmodified lines | ||
| 418 | 418 | device_initialize(&ec->class_dev); |
| 419 | 419 | cdev_init(&ec->cdev, &fops); |
| 420 | 420 | |
| 421 | + /* | |
| 422 | + * Check whether this is actually an Integrated Sensor Hub (ISH) | |
| 423 | + * rather than an EC. | |
| 424 | + */ | |
| 425 | + if (cros_ec_check_features(ec, EC_FEATURE_ISH)) { | |
| 426 | + dev_info(dev, "CrOS ISH MCU detected.\n"); | |
| 427 | + /* | |
| 428 | + * Help userspace differentiating ECs from ISH MCU, | |
| 429 | + * regardless of the probing order. | |
| 430 | + */ | |
| 431 | + ec_platform->ec_name = CROS_EC_DEV_ISH_NAME; | |
| 432 | + } | |
| 433 | + | |
| 421 | 434 | /* |
| 422 | 435 | * Add the class device |
| 423 | 436 | * Link to the character device for creating the /dev entry |
| @@ -24,6 +24,7 @@ · 23 unmodified lines | ||
| 24 | 24 | |
| 25 | 25 | #define CROS_EC_DEV_NAME "cros_ec" |
| 26 | 26 | #define CROS_EC_DEV_PD_NAME "cros_pd" |
| 27 | +#define CROS_EC_DEV_ISH_NAME "cros_ish" | |
| 27 | 28 | |
| 28 | 29 | /* |
| 29 | 30 | * The EC is unresponsive for a time after a reboot command. Add a |
| @@ -856,6 +856,8 @@ enum ec_feature_code { · 855 unmodified lines | ||
| 856 | 856 | EC_FEATURE_RTC = 27, |
| 857 | 857 | /* EC supports CEC commands */ |
| 858 | 858 | EC_FEATURE_CEC = 35, |
| 859 | + /* The MCU is an Integrated Sensor Hub */ | |
| 860 | + EC_FEATURE_ISH = 40, | |
| 859 | 861 | }; |
| 860 | 862 | |
| 861 | 863 | #define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32)) |