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
418 device_initialize(&ec->class_dev);418 device_initialize(&ec->class_dev);
419 cdev_init(&ec->cdev, &fops);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 * Add the class device435 * Add the class device
423 * Link to the character device for creating the /dev entry436 * 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
24 24
25#define CROS_EC_DEV_NAME "cros_ec"25#define CROS_EC_DEV_NAME "cros_ec"
26#define CROS_EC_DEV_PD_NAME "cros_pd"26#define CROS_EC_DEV_PD_NAME "cros_pd"
27#define CROS_EC_DEV_ISH_NAME "cros_ish"
27 28
28/*29/*
29 * The EC is unresponsive for a time after a reboot command. Add a30 * 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
856 EC_FEATURE_RTC = 27,856 EC_FEATURE_RTC = 27,
857 /* EC supports CEC commands */857 /* EC supports CEC commands */
858 EC_FEATURE_CEC = 35,858 EC_FEATURE_CEC = 35,
859 /* The MCU is an Integrated Sensor Hub */
860 EC_FEATURE_ISH = 40,
859};861};
860 862
861#define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32))863#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