Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp509737ybl; Wed, 14 Aug 2019 01:24:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNQ26Z3SN7vOEJ32Vci8KqonfLn/URduuFBP81MP/Yk1JWDZ7Ma5ZBNMKDuw4eHhTwa5it X-Received: by 2002:a17:902:7782:: with SMTP id o2mr42108248pll.12.1565771043975; Wed, 14 Aug 2019 01:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565771043; cv=none; d=google.com; s=arc-20160816; b=Qbs15C+RkrTRXx9RU61WEFtyKQ6EQYnHebxCmTPKXfkfcXeHP/6cZwy+YozDiVIg/R QtuoQeFwRLOK8gamNlWhZOLDjaSE1gOZH2o31WtZhA1hhxkjuAxB6t7n31nGeKY23mtU IJJIHh1dzgUxZr2u8J0UXNqGmY+v/4aJmF8G1pOus8mm4hi5OdzrwOs9Syc35Az0AKrS 6RodZ0GlrALyaxBF9MvR//rPW4KgegfKi/3W0cSmvsn0LYP373f4zWeaUAPW+gQ4cYi9 /ZVifPMWO4+Okk4s3XBlItGttUMQClZwaHxVL4u8TMHOM1eFVPHPJL8V+K9wVrraucCL By0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vQ2pr3Cls72t2h2tsGZZ35CLiWwC2wgAdBlRAFpgySo=; b=01g8ybsia8NYrmqv5DTw+5pfuGNPv+zYjE/N5o2uIcAywPlTU4ahfPl6QVTWff1z15 8qBLJ6jK7pSp0Te/9yQ/imz/NL8PnHQJYwA58V+4EkMXkrDiXqCgi0MpqECaco0uLa+g LsuzPBrMz8gpKkMSTJ0T9v0+XaMfFKNwOmJuPFG+9dzJtX15Ns0aUQ1H9kD4QmiM/nCY YvTZDsmi97Mm3lq+xlXEqNsjGk6h9Nh9nbkH4rbXwOmJykSQrof1nxMNbZpLs4X47XS4 2qW3mKGtUExsQL9O93gYO2/1xikIQrWZiqg03MPypstEWLOfgYK3Hs9gXqDKOoJQlE69 sDwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=R7Kyn+eq; 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 33si63841769plq.299.2019.08.14.01.23.47; Wed, 14 Aug 2019 01:24:03 -0700 (PDT) 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=R7Kyn+eq; 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 S1727031AbfHNISH (ORCPT + 99 others); Wed, 14 Aug 2019 04:18:07 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42371 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726575AbfHNISG (ORCPT ); Wed, 14 Aug 2019 04:18:06 -0400 Received: by mail-pf1-f193.google.com with SMTP id i30so4423157pfk.9 for ; Wed, 14 Aug 2019 01:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vQ2pr3Cls72t2h2tsGZZ35CLiWwC2wgAdBlRAFpgySo=; b=R7Kyn+equxgntT6XPosUWdGuRy3AD+4jLQsjf6tSHnWD0lLbaHelvOeW5nhL2rJ87p tnXlsuUJW+q2AuzeoilkudENc95XbbKiHsz2pEXn9OPSq7CS+8WC51siM6fL1dXTyMNp gwQ7ALwj2I+COTYxyCGdA1QgusKda1euBkyHY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vQ2pr3Cls72t2h2tsGZZ35CLiWwC2wgAdBlRAFpgySo=; b=USMhCbuUtj/7eY4LEteV6kjVld6dlhZn4dUey4LURtlM5kJIFp6Nh7Zw93rAbZ/38I 4lVkjNIp2kj+BuBlBHy3L3Q9upQTVbs7FeBdGB5J4N72FOJq51eZGiIk7H3W8KLFRYZd dHbHMIOJ6TeaONAOcpcTV4dtp3PBEppG1yBkwkazWJuJLF5aJufZn7MBPpu+un2WBPFZ 4pLKvg3fn68clr1u6Aql6k9G6tkQe9iITZvtqVuB9DlxnowUZ21yQqeR2lHBufAGAcIf wOt7g67gJPwDeqvN+D2VV0TeRebEcQQYvkz+CKxNE4rSs9BzY5uzs3Z4flQjuDcFJxu/ A47g== X-Gm-Message-State: APjAAAWuXo36E/1tPk4Dew4C/MWK4V/9yvjVHLqg9lcnzWKClIdrF0b2 0FNdaKjxfU5DXB46be0JVnfV8YR39Aw= X-Received: by 2002:a65:6284:: with SMTP id f4mr35970405pgv.416.1565770686132; Wed, 14 Aug 2019 01:18:06 -0700 (PDT) Received: from localhost ([2401:fa00:1:10:e122:3674:c42c:2698]) by smtp.gmail.com with ESMTPSA id q126sm74303369pfb.56.2019.08.14.01.18.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Aug 2019 01:18:05 -0700 (PDT) From: Yilun Lin To: LKML Cc: pihsun@chromium.org, Yilun Lin , Enric Balletbo i Serra , Guenter Roeck , Benson Leung Subject: [PATCH] platform/chrome: cros_ec_rpmsg: Add host command AP sleep state support Date: Wed, 14 Aug 2019 16:17:57 +0800 Message-Id: <20190814081757.65056-1-yllin@chromium.org> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add EC host command to inform EC of AP suspend/resume status. Signed-off-by: Yilun Lin --- drivers/platform/chrome/cros_ec_rpmsg.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/platform/chrome/cros_ec_rpmsg.c b/drivers/platform/chrome/cros_ec_rpmsg.c index 5d3fb2abad1d..6f34fe629e2c 100644 --- a/drivers/platform/chrome/cros_ec_rpmsg.c +++ b/drivers/platform/chrome/cros_ec_rpmsg.c @@ -236,6 +236,25 @@ static void cros_ec_rpmsg_remove(struct rpmsg_device *rpdev) cancel_work_sync(&ec_rpmsg->host_event_work); } +#ifdef CONFIG_PM_SLEEP +static int cros_ec_rpmsg_suspend(struct device *dev) +{ + struct cros_ec_device *ec_dev = dev_get_drvdata(dev); + + return cros_ec_suspend(ec_dev); +} + +static int cros_ec_rpmsg_resume(struct device *dev) +{ + struct cros_ec_device *ec_dev = dev_get_drvdata(dev); + + return cros_ec_resume(ec_dev); +} +#endif + +static SIMPLE_DEV_PM_OPS(cros_ec_rpmsg_pm_ops, cros_ec_rpmsg_suspend, + cros_ec_rpmsg_resume); + static const struct of_device_id cros_ec_rpmsg_of_match[] = { { .compatible = "google,cros-ec-rpmsg", }, { } @@ -246,6 +265,7 @@ static struct rpmsg_driver cros_ec_driver_rpmsg = { .drv = { .name = "cros-ec-rpmsg", .of_match_table = cros_ec_rpmsg_of_match, + .pm = &cros_ec_rpmsg_pm_ops, }, .probe = cros_ec_rpmsg_probe, .remove = cros_ec_rpmsg_remove, -- 2.23.0.rc1.153.gdeed80330f-goog