Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp580169imb; Fri, 1 Mar 2019 08:21:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxD+E5GX28JqZPtROUHYsp0G2yT8Zh5SRZ59+a/X7j0etc6FTBvnySvTg651bcYIWhYz3q8 X-Received: by 2002:a17:902:e486:: with SMTP id cj6mr6238064plb.86.1551457283207; Fri, 01 Mar 2019 08:21:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551457283; cv=none; d=google.com; s=arc-20160816; b=KEZDubaVrDpJHLP6fuBI3lCrNJb6z58z6q02ha35RU6369PAXdfKxo+uQ6IuRMgZfK D1/+yA5L6/06upbUQry+g4YdTehR4TOX9spR0b2kKbHeUsixIY7RXayPgWqbc6N4uhkM ACNF4Tzhp/1GhOkwvs3vOSQoH39ws9dXmp5rOwWBvzvVSQO2Pt9LLj/c/2B22uG20zMA Fb88PHc6yEowRxy2gX/O7EZWExWaFXUVXB5nMxxxm9RfXYzBsolCBAJ1RcRPz9vbVzRz GgZFbI55oQXSt4SEuP0+W5YIxBcCKtJEkTiUO9HaQUNYdFkGmi18mnn6sz6brQPUkt4M M9lw== 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=NyNvvLOrq4bS1vRrEN+IwY+NXTZUKqr6H8s9M2rYM1w=; b=ZXUY4ZFQnV0bYcmhLLalzTmPAjqKAHtuKPoVKsPFUWl8PAiXjAVfPuVuHcLtIy+XMx bycZiE18mQ68EK6v6Eo9JuNKHjpORgyYEVvv5ZLnFSQIWElv/5paT6MQXtnFq+FRgmPF 7Dpd7b/Brra0Ab0D1aL1muSSspFbG6otnqC0hlTKnU3BVVHBTj7K1c/AkZAUQPdIhs58 dE46AYjwJ7Uqlzz1nXHVZsUODhnYSvxcwVJ4xTu8jhzr2rUdbPs3c03r75pEfl7wM1St peHIyqUta/dfjeXxRjawK3tOu7+I4twSnkp1fEPMUu5NFIfFnAgwZ4Bvhfb+NQLGtDbw zk3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=i3avGKMK; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j22si21718389pgg.463.2019.03.01.08.21.06; Fri, 01 Mar 2019 08:21:23 -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=@chromium.org header.s=google header.b=i3avGKMK; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389069AbfCAQT4 (ORCPT + 99 others); Fri, 1 Mar 2019 11:19:56 -0500 Received: from mail-yw1-f65.google.com ([209.85.161.65]:33147 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725966AbfCAQT4 (ORCPT ); Fri, 1 Mar 2019 11:19:56 -0500 Received: by mail-yw1-f65.google.com with SMTP id i204so11926779ywb.0 for ; Fri, 01 Mar 2019 08:19:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NyNvvLOrq4bS1vRrEN+IwY+NXTZUKqr6H8s9M2rYM1w=; b=i3avGKMKHqknwPf9BJCu69IfL9tZ0qg18zrtDFNbU3sJ4U9HItflZczodCiyCmob8K ir2dsep8yveNFNdcvsYSDogB5xEY/tM5Wu8ep1pB9BqjkqI3zAvgsHnsr7JKTZ/JqWKa UKQPUAYz5ZIVAlFIuDFn9kfdNsFQ7zXQUjrQ8= 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=NyNvvLOrq4bS1vRrEN+IwY+NXTZUKqr6H8s9M2rYM1w=; b=iOYbjEalJdgFUtN4wl2YcZjLVQ4Ut4tXEnPI7yYTT1mLkUlR2hQSWobfpMOsN1Hhrv Z/BY/M698NUl+4amot6+rZ5XFPsDNYamjbOTo1kPpYZRAJV3eFCSxjb4TzdpMolgYLHy 3poPh6NAdYQYEM3LtG9Wn0QDmbs1hSObsrzJOG2WzjUJH+4++YjuQrI7h9s2bwNILo8k hw0AVUMNOd3tONHVD7+y9BHwWkNSePuOMxSCc2FumlDxArgzTLbMYwA9P1TMx58ZU7XI VWp+fFwNWNGTj3Cg+1w33oZeNQ6oGzcI/mZKZ4aEPbgN6WS5UI9u+S9Egqyu5z7BKRyK +K5Q== X-Gm-Message-State: APjAAAVSYxv6lf2HRgaSsags5qVsVgMIKRMJM+RRVljYgRTVRZp21BG+ k6qu6NrR8njZFS5fWXN3AFTKOCoa2J6g05uDPYZ4kA== X-Received: by 2002:a25:c184:: with SMTP id r126mr4630890ybf.441.1551457195114; Fri, 01 Mar 2019 08:19:55 -0800 (PST) MIME-Version: 1.0 References: <1551428454-596-1-git-send-email-rushikesh.s.kadam@intel.com> <18369e10-4611-2237-d58c-e6526dc74544@collabora.com> In-Reply-To: <18369e10-4611-2237-d58c-e6526dc74544@collabora.com> From: Gwendal Grignou Date: Fri, 1 Mar 2019 08:19:43 -0800 Message-ID: Subject: Re: [PATCH v3] mfd: cros_ec: instantiate properly CrOS ISH MCU device To: Enric Balletbo i Serra Cc: Rushikesh S Kadam , Lee Jones , Benson Leung , Guenter Roeck , Linux Kernel , Jett Rink , andriy.shevchenko@intel.com 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 On Fri, Mar 1, 2019 at 1:50 AM Enric Balletbo i Serra wrote: > > Hi Rushikesh, > > On 1/3/19 9:20, Rushikesh S Kadam wrote: > > 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 > > --- > > v3 > > - Dropped "Intel" in commments in cros_ec header file. CrOS EC ISH > > device is a generic ISH. This was missed earlier. > > 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..43bee4f 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 Integrated Sensor Hub */ > > + EC_FEATURE_ISH = 40, > > }; > > > > #define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32)) > > > > Acked-by: Enric Balletbo i Serra Reviewed-by: Gwendal Grignou >