Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp575743img; Thu, 28 Feb 2019 04:34:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IZKtLNcfkZQUGaSehWn9/+YUD8V/3mO84gdUpK6nMI/HBXR4mOjLkt16MoXmk+5oawYwv6X X-Received: by 2002:a62:3890:: with SMTP id f138mr7365168pfa.148.1551357296268; Thu, 28 Feb 2019 04:34:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551357296; cv=none; d=google.com; s=arc-20160816; b=YN7UMsMtOJJE2omHh2ncPdQYUEsCoJ7X7Be9od9DsPtq1OKkjW2Cba20K1H9F2K+w8 lAooYpa8MMi+SbL2CTS6ef/YO2+yEKTeksYT8jz+A8cg8QkxHsHmAmRR++/qhLoF1F8O Vf8YhETpUl4uHEFjYLSvXI5cNuzKDglPKvbDp2vKThjn5LfIKPxz3H9FJNAe9MI6AuKg WKH+6pzNWMZg5xFJM6ht+Uk6pl8RM6oZYe7K6YqcCvQjYoUkyLWN9/YQG2RV64gci7A1 gkmxNb20hHSTNyDiJyHtauCy5v4tOC4X1OtjpEU4FxWQZZ6d2LLN9+L57QuYvcvbZAqC VJPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UCpcITDh37pB7hTzOvWzBVVS5sQcqpETOzj+ndabSAI=; b=Y+5/nyyQr8GSVsJPe6Y3RaQdPxSuBaqL5t18U0kF0b0JZLzM9bUUCExRJc9pVxU1CH 33RlWW5HmAOAEqW3WUnrY+TXF7MYLMiN2n+i90AVbDvEGkhkdwm3fFsZHykqy2Fet7EU bqEL+06r6SXLDrwrHJj9fPRjXB0vLmthvDOJfLFY6di+W4POpx2hC38lTVNrZ42Ef+4K L36JtZH9z0aTU+tZhs0uMnM/eAQo28K4JEQcbkBXANXGVHLd42XUdpxMfZ0Hfst/R8CM JtiGt9O0WhxBqlENPdyNm3OmISgX7CLY7K60hggD6Qldq6n3U7UOWldcTIOf3jX8FOWN O5/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tDAzVIu7; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z185si17237848pgb.222.2019.02.28.04.34.41; Thu, 28 Feb 2019 04:34:56 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tDAzVIu7; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732556AbfB1MdW (ORCPT + 99 others); Thu, 28 Feb 2019 07:33:22 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:34937 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726534AbfB1MdW (ORCPT ); Thu, 28 Feb 2019 07:33:22 -0500 Received: by mail-qt1-f193.google.com with SMTP id p48so23231630qtk.2 for ; Thu, 28 Feb 2019 04:33:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UCpcITDh37pB7hTzOvWzBVVS5sQcqpETOzj+ndabSAI=; b=tDAzVIu7UPnEItgZdOmZpDqdR14vcPQpq1hQQ+ltLmGXMW4uzgwvJ6Srn8oua14ZIm uqriMOcao0NTyRGv48KhV4ltBJjAd6hd6M3TNsDUjj0XTpvHxW5YCRd/6WDCNxu/BqBj FrgSif8Czyb5kuQCVs12hW5vjqESkTsROafbojk0oRHoGcUnK2cXGw4uBF/8N5fKMrRo aScRaDuhNg6HEpqkjpSTRSw7ga1jkmkRq4/y6MSz48sZBbfH8eOlcAO8Nu3yenifT+SY VucASk1oZb19A6aKs/3IDNQbMqWfIBDVMJfP5Th4zoHQgN2l5aaxbrURBiIlij3i8fcy KsHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UCpcITDh37pB7hTzOvWzBVVS5sQcqpETOzj+ndabSAI=; b=k7dJOtI39T1o2cj93+Byd5HSo1U/4L0xXqjxutujtJEHhmsKqqngyq/mWJwLYY/dUS 8G19vWNQfu2Kn+I0rH7rRu+Y4QVNkn0RUKXUn4NkU0LZil/nkyQqetMUSai0/Jd12taA 9K/zLv7Kj/29kPrkKXwJfSN1AFjnf/mlRhz0i64WOCJk+MoGwCzfuQ1o9JaQNQ5RBhX1 DD/0vc4PO0XcdUP+OxDTbmFhYacWxFQgwPzzXRLyItbFtYJCyvR5HU6JkLtTHdu1vM7N swZtU8jmyYZW1rP7SZ7eRut3uOnpPggxYQOGXJ/Kx8lXkd2R8UMsPOqunm7Ca2BmPXEi xRuw== X-Gm-Message-State: APjAAAVdJM8if3zAZ/poBwisp19MjeZunkGP6OznckSVbzoDpN/Eo1e1 oBQRbHLW79hY2+a54DRZMW8lCgbZPCKzTSNqErw= X-Received: by 2002:a0c:95c9:: with SMTP id t9mr6246378qvt.220.1551357200496; Thu, 28 Feb 2019 04:33:20 -0800 (PST) MIME-Version: 1.0 References: <1550999629-31791-1-git-send-email-rushikesh.s.kadam@intel.com> In-Reply-To: <1550999629-31791-1-git-send-email-rushikesh.s.kadam@intel.com> From: Enric Balletbo Serra Date: Thu, 28 Feb 2019 13:33:09 +0100 Message-ID: Subject: Re: [PATCH] cros_ec: instantiate properly Intel ISH MCU device To: Rushikesh S Kadam Cc: Lee Jones , Benson Leung , Enric Balletbo i Serra , Guenter Roeck , linux-kernel , Gwendal Grignou , Jett Rink , Andy Shevchenko Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Based on the discussion we had, only some few comments. Missatge de Rushikesh S Kadam del dia dg., 24 de febr. 2019 a les 10:15: > > Intel 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 > --- > drivers/mfd/cros_ec_dev.c | 10 ++++++++++ > include/linux/mfd/cros_ec.h | 1 + > include/linux/mfd/cros_ec_commands.h | 2 ++ Better if you use the "mfd: cros_ec:" prefix in the next version so it's clear that this should go through the MFD tree. > 3 files changed, 13 insertions(+) > > diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c > index 2d0fee4..be499b8 100644 > --- a/drivers/mfd/cros_ec_dev.c > +++ b/drivers/mfd/cros_ec_dev.c > @@ -414,6 +414,16 @@ static int ec_device_probe(struct platform_device *pdev) > device_initialize(&ec->class_dev); > cdev_init(&ec->cdev, &fops); > > + /* check whether this is actually a Intel ISH rather than an EC */ "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, "Intel ISH MCU detected.\n"); 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 > 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, Just a note that we will have a trivial conflict to solve with https://lkml.org/lkml/2019/2/27/723 > }; > > #define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32)) > -- > 1.9.1 > Best regards, Enric