From patchwork Thu Jun 14 19:47:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10465175 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4DFA4600D0 for ; Thu, 14 Jun 2018 19:48:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E98B28C24 for ; Thu, 14 Jun 2018 19:48:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3328828C2B; Thu, 14 Jun 2018 19:48:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E73F728C24 for ; Thu, 14 Jun 2018 19:48:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936161AbeFNTro (ORCPT ); Thu, 14 Jun 2018 15:47:44 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:46149 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755483AbeFNTrl (ORCPT ); Thu, 14 Jun 2018 15:47:41 -0400 Received: by mail-pf0-f196.google.com with SMTP id q1-v6so3726774pff.13 for ; Thu, 14 Jun 2018 12:47:41 -0700 (PDT) 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:in-reply-to :references; bh=ISSRmyPKSuWq5QIFIhUcq3+8ewVbfHJKL6pkhC1ofXA=; b=WS0b2Ql+AyB+gVYKZwYLxBDz7xmM2uvvsf7dDeEcBRYpn0TZkksH8QGDmA2B9rulfE O16EKy5FDoD0D/BQEHm4jAIAFSNLgxz/RS3fCe6bKY9P7hoMtzhl82TbtaQWRQ8+MDHu Z+OfOsJUc7o2gkWalYstvIKzKGyGg6oBg4hMrmOSh9BuVixIVnzLQ7E5rexKb8oJXN23 tIV7DPamyUdr8e0u0HKmWApawMftou3xtVOuHMUCo7mIpy3sWpjyEC9mZklioR+wsDx0 a3cgyQ9LaYNxF3oPU2iwGlVIHmb0lndAcilKn0QF60Xl02yBPzZjuZxssJrktX6QXJ/f h8FA== X-Gm-Message-State: APt69E0X19oMlY7Bm4FK/kjPvOw58JNOZ9jjyZjDhUurxVIidw6YIUgL kA7LeerPkBueNqe8upvalwcg3w== X-Google-Smtp-Source: ADUXVKI3RMMXVRzx3owzez8g7UoAwzZPgLF0G50JszOadvJd3/X/daibZYA1HLVrSVCTxQuaaW4xwA== X-Received: by 2002:a63:7741:: with SMTP id s62-v6mr3509544pgc.103.1529005660393; Thu, 14 Jun 2018 12:47:40 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id s28-v6sm9955506pfg.89.2018.06.14.12.47.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 12:47:39 -0700 (PDT) From: Matthias Kaehlcke To: MyungJoo Ham Cc: Kyungmin Park , Chanwoo Choi , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Brian Norris , Douglas Anderson , Enric Balletbo i Serra , "Rafael J . Wysocki" , Viresh Kumar , Lee Jones , Matthias Kaehlcke Subject: [PATCH v3 12/12] mfd: cros_ec: Add throttler sub-device Date: Thu, 14 Jun 2018 12:47:12 -0700 Message-Id: <20180614194712.102134-13-mka@chromium.org> X-Mailer: git-send-email 2.18.0.rc1.242.g61856ae69a-goog In-Reply-To: <20180614194712.102134-1-mka@chromium.org> References: <20180614194712.102134-1-mka@chromium.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instantiate the CrOS EC throttler if it is enabled in the kernel configuration. Signed-off-by: Matthias Kaehlcke --- Changes in v3: - patch added to series drivers/mfd/cros_ec.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c index 36156a41499c..5f52b6e2c21a 100644 --- a/drivers/mfd/cros_ec.c +++ b/drivers/mfd/cros_ec.c @@ -91,6 +91,10 @@ static int cros_ec_sleep_event(struct cros_ec_device *ec_dev, u8 sleep_event) return cros_ec_cmd_xfer(ec_dev, &buf.msg); } +static const struct mfd_cell ec_throttler_cell = { + .name = "cros-ec-throttler", +}; + int cros_ec_register(struct cros_ec_device *ec_dev) { struct device *dev = ec_dev->dev; @@ -153,6 +157,18 @@ int cros_ec_register(struct cros_ec_device *ec_dev) } } + if (IS_ENABLED(CONFIG_CROS_EC_THROTTLER)) { + err = mfd_add_devices(ec_dev->dev, PLATFORM_DEVID_AUTO, + &ec_throttler_cell, 1, NULL, ec_dev->irq, + NULL); + if (err) { + dev_err(dev, + "Failed to register throttler subdevice %d\n", + err); + return err; + } + } + if (IS_ENABLED(CONFIG_OF) && dev->of_node) { err = devm_of_platform_populate(dev); if (err) {