History

mfd: cros_ec: Instantiate properly CrOS ISH MCU device

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'.

Rushikesh S Kadam committed 7 years ago

Commit d4cee951 parent 730080a3 files · +16 −0Browse files

Unified · Split

3 files
  1. drivers/mfd/cros_ec_dev.c +13 −0
  2. include/linux/mfd/cros_ec.h +1 −0
  3. include/linux/mfd/cros_ec_commands.h +2 −0
drivers/mfd/cros_ec_dev.c+13−0
@@ -418,6 +418,19 @@ static int ec_device_probe(struct platform_device *pdev) · 417 unmodified lines
418418 device_initialize(&ec->class_dev);
419419 cdev_init(&ec->cdev, &fops);
420420
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+
421434 /*
422435 * Add the class device
423436 * Link to the character device for creating the /dev entry
include/linux/mfd/cros_ec.h+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424
2525 #define CROS_EC_DEV_NAME "cros_ec"
2626 #define CROS_EC_DEV_PD_NAME "cros_pd"
27+#define CROS_EC_DEV_ISH_NAME "cros_ish"
2728
2829 /*
2930 * The EC is unresponsive for a time after a reboot command. Add a
include/linux/mfd/cros_ec_commands.h+2−0
@@ -856,6 +856,8 @@ enum ec_feature_code { · 855 unmodified lines
856856 EC_FEATURE_RTC = 27,
857857 /* EC supports CEC commands */
858858 EC_FEATURE_CEC = 35,
859+ /* The MCU is an Integrated Sensor Hub */
860+ EC_FEATURE_ISH = 40,
859861 };
860862
861863 #define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t