Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp186794imb; Thu, 28 Feb 2019 20:36:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxyACBCwu/nsgsBVoMbYaYMYRtE4ss6kFR3nV4rOKgHW58s+L3QNvSjH8Cc1FJxSFap/aMV X-Received: by 2002:a62:ea10:: with SMTP id t16mr3477701pfh.3.1551414967677; Thu, 28 Feb 2019 20:36:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551414967; cv=none; d=google.com; s=arc-20160816; b=Yv+Qw49oN08LAnxAyDIiOs8eqabrovtHNuTZgEaRByE/cE3Po8OV6LZ/lQ0beAa6zd 1bGsCS5FSEsMu63WIDPnM4qg5R+xtFInZOFI9AOF6HZlHmZghwe8Fa0UA1B8NL7bjX/F 3Dw1ODfJt84v5l9Hdovxgb1J5Fu4nVy88ruOBYrATVYFmAqc6PYjleIVwR+pSPpLqmOj RBEVAVj6vjImzAoR6sebcOf/c4r2K5dpL0j5Gj4tr8uzsWotpDHQ9KraEk/8GLlqYLgg ZijL6oNPx5UDm8JHh33k9unU08W1k/Y4v0PSvt9PYV1ayF9WYXc3GIsBkTcRIMSqnvLC EF+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=mW3HWfzlta+DvNWJgBrf2EzzDvLdttBSiqbZyfPLRyg=; b=L9nf5YZnrU6c/+cO9FAiw1I6r9Pb108ZtAY34rhn8fATJ8lp6scjd9XscI4NuXQd5d IMBnN3s+kANWagXcf7E21rkN7rBRMmfRYE/fyAXqfOBUci81LdUbJDG3siaiGXlBu6qG 9ZIq4r3ZDV0sMjG9dD6kKr++gE4WB1fE5VDreeDUAWaU7VMxD/XDD2m1v57ipDRhyHFw cWt5sHupMa3FdN1EzPoiHWO1vnjBmwL1fBdGTwo27FSvawEa1GTh5/v6yBdKy+SoUHFl coCB1TpX6U75efMXk+/BqzNwydwzz6VHy/GyHwRdOeg49xU8nlG1Kd6ycnso5aeyYvK3 piFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x125si4728482pfd.30.2019.02.28.20.35.50; Thu, 28 Feb 2019 20:36:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727445AbfCAEG4 (ORCPT + 99 others); Thu, 28 Feb 2019 23:06:56 -0500 Received: from mga12.intel.com ([192.55.52.136]:27130 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbfCAEG4 (ORCPT ); Thu, 28 Feb 2019 23:06:56 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2019 20:06:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,425,1544515200"; d="scan'208";a="303469197" Received: from rajeev-desktop.iind.intel.com ([10.223.84.39]) by orsmga005.jf.intel.com with ESMTP; 28 Feb 2019 20:06:53 -0800 From: Rushikesh S Kadam To: lee.jones@linaro.org, bleung@chromium.org, enric.balletbo@collabora.com, groeck@chromium.org Cc: linux-kernel@vger.kernel.org, rushikesh.s.kadam@intel.com, gwendal@google.com, jettrink@chromium.org, andriy.shevchenko@intel.com Subject: [PATCH v2] mfd: cros_ec: instantiate properly CrOS ISH MCU device Date: Fri, 1 Mar 2019 09:36:11 +0530 Message-Id: <1551413171-27290-1-git-send-email-rushikesh.s.kadam@intel.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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'. Signed-off-by: Rushikesh S Kadam --- v2 - Addressed review comments to term the CrOS EC device as a generic Integrated Sensor Hub. v1 - Initial version. drivers/mfd/cros_ec_dev.c | 13 +++++++++++++ include/linux/mfd/cros_ec.h | 1 + include/linux/mfd/cros_ec_commands.h | 2 ++ 3 files changed, 16 insertions(+) diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index 2d0fee4..46963c2 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -415,6 +415,19 @@ static int ec_device_probe(struct platform_device *pdev) cdev_init(&ec->cdev, &fops); /* + * Check whether this is actually an Integrated Sensor Hub (ISH) + * rather than an EC. + */ + if (cros_ec_check_features(ec, EC_FEATURE_ISH)) { + dev_info(dev, "CrOS ISH MCU detected.\n"); + /* + * Help userspace differentiating ECs from ISH MCU, + * regardless of the probing order. + */ + ec_platform->ec_name = CROS_EC_DEV_ISH_NAME; + } + + /* * Add the class device * Link to the character device for creating the /dev entry * in devtmpfs. diff --git a/include/linux/mfd/cros_ec.h b/include/linux/mfd/cros_ec.h index de8b588..00c5765 100644 --- a/include/linux/mfd/cros_ec.h +++ b/include/linux/mfd/cros_ec.h @@ -24,6 +24,7 @@ #define CROS_EC_DEV_NAME "cros_ec" #define CROS_EC_DEV_PD_NAME "cros_pd" +#define CROS_EC_DEV_ISH_NAME "cros_ish" /* * The EC is unresponsive for a time after a reboot command. Add a diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h index fc91082..9276c3c 100644 --- a/include/linux/mfd/cros_ec_commands.h +++ b/include/linux/mfd/cros_ec_commands.h @@ -856,6 +856,8 @@ enum ec_feature_code { EC_FEATURE_RTC = 27, /* EC supports CEC commands */ EC_FEATURE_CEC = 35, + /* The MCU is an Intel Integrated Sensor Hub */ + EC_FEATURE_ISH = 40, }; #define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32)) -- 1.9.1