Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp187192imm; Tue, 3 Jul 2018 16:49:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL3KCDSixkXrWNxto0IY5FI5Fm59r+IaLhpdO853VbKDr+JvPGLBe/F9AH+hwV9zFSjKzfe X-Received: by 2002:a65:418b:: with SMTP id a11-v6mr27224956pgq.118.1530661745802; Tue, 03 Jul 2018 16:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530661745; cv=none; d=google.com; s=arc-20160816; b=NXXwcF5R1deIAEtG9wXOIYhgVrUaGC7eTOYUNqA1rpkyqGXg46C06tsf9AShzNfaIm dYdrWmjdOZgvZVGr9+B1EGfiqhHCLvzyKUQV+BB/DrvfQnaWzZJAZe+eLwChZdMhTha6 0LULxmFNXSDcFffarTwGYfd6YZk5OhPnefWuFdVjul9T9nZRD4Nvs/JyiyAiGjU5isLC lKs9DkMdnBME0ImsZ7XMhbmbeAyTLwsrCTjSV0aEQg7rPaw+2I04vY09diyZw83tSaUB MsLOU7znkKgqRghVDbxT5gOcE3yE/+s2tGg7tHJ/GFXUs8ydBIyBp4YNqBDXeyFK4jM4 O4bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=/chklxYGnds1v6AD2Nh4VsBa5gEuMWGNfrXOybMzQM0=; b=hrfkEEErMJl4/t63m4MEbteo7LgRB18dWU8U3iULHPwFi9MNSARNz81DemSdmebV2w mn8kkxOa0GTGc7ZMckRlujL+4Gx97P1Nthsi3sRrM1ui30Sy/YPG1wvQ4aYUEkDxqnnN UahtwxHJrH4GLhyRYaWyAEYkCwG3kTXbAm+5qsnAzKxP8Z47JQPoHU4hRYsvv1ss+4mS 7MMpUBKSfpaQ079KLormxsJxO7+4PCim36h34WNs2PQ6apB75JE4p69pu4zLVFCTJ1xn v+L+1kBugd46iC7eAmakhbEPURx22yl4zIC1U8gdE3BvT5OeuAxkuJtIX2Gl2ejAIzSK OaIg== 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e62-v6si2207979pfe.327.2018.07.03.16.48.51; Tue, 03 Jul 2018 16:49:05 -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; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932181AbeGCXr5 (ORCPT + 99 others); Tue, 3 Jul 2018 19:47:57 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:45922 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753675AbeGCXrl (ORCPT ); Tue, 3 Jul 2018 19:47:41 -0400 Received: by mail-pf0-f194.google.com with SMTP id y24-v6so1720321pfe.12 for ; Tue, 03 Jul 2018 16: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=/chklxYGnds1v6AD2Nh4VsBa5gEuMWGNfrXOybMzQM0=; b=narUffdyTN7mcF88Ds9eiaOP1m2dd1RZkN9kd3KCYjcsjrMAzO/qqgfuvkzGImTLw5 Snk4mWmjuJRzlf+GG+pCH3Dm6J2FaVeK+AkP/1dS9nN3YL9eaKna5WQP3FEzqPINaIX4 5MSH2VkrkoE/nE7O0uyogYT3gJeKPFKhcCOFH2+m7WamMMDwBOKezV6TN4qQCVnQf7Uo oafw7jQsba2up7pNRtchS86COV9hCPF3DBZWOOI1fC9ahb7kF+qkNSwnOTlhXfsr/jr+ 1kmjq3bHB/BiDpAOsKslJorsSa8wtTb9T5DiKyEml6eVcom3ovyUtPSDowxhIKGRfh4z WsuA== X-Gm-Message-State: APt69E0R99ZxiNNabFb6uZQ1+4wrnkO337PjVSBZK9W2dgXZFFMMNlAP DCVWshDUFU8SplOX1+evzZojog== X-Received: by 2002:a63:7a43:: with SMTP id j3-v6mr10683080pgn.363.1530661660879; Tue, 03 Jul 2018 16: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 l85-v6sm6608562pfk.79.2018.07.03.16.47.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 16:47:40 -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 , Benson Leung , Olof Johansson , Matthias Kaehlcke Subject: [PATCH v5 12/12] mfd: cros_ec: Add throttler sub-device Date: Tue, 3 Jul 2018 16:47:05 -0700 Message-Id: <20180703234705.227473-13-mka@chromium.org> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-goog In-Reply-To: <20180703234705.227473-1-mka@chromium.org> References: <20180703234705.227473-1-mka@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instantiate the CrOS EC throttler if it is enabled in the kernel configuration. Signed-off-by: Matthias Kaehlcke Reviewed-by: Brian Norris --- Changes in v5: - added 'Reviewed-by: Brian Norris ' tag Changes in v4: - register throttler in cros_ec_dev.c instead of cros_ec.c Changes in v3: - patch added to series --- drivers/mfd/cros_ec_dev.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index eafd06f62a3a..9e56c2793075 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -383,6 +383,22 @@ static void cros_ec_sensors_register(struct cros_ec_dev *ec) kfree(msg); } +static const struct mfd_cell ec_throttler_cells[] = { + { .name = "cros-ec-throttler" } +}; + +static void cros_ec_throttler_register(struct cros_ec_dev *ec) +{ + int ret; + + ret = mfd_add_devices(ec->dev, 0, ec_throttler_cells, + ARRAY_SIZE(ec_throttler_cells), + NULL, 0, NULL); + if (ret) + dev_err(ec->dev, + "failed to add cros-ec-throttler device: %d\n", ret); +} + static int ec_device_probe(struct platform_device *pdev) { int retval = -ENOMEM; @@ -422,6 +438,9 @@ static int ec_device_probe(struct platform_device *pdev) if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE)) cros_ec_sensors_register(ec); + if (IS_ENABLED(CONFIG_CROS_EC_THROTTLER)) + cros_ec_throttler_register(ec); + /* Take control of the lightbar from the EC. */ lb_manual_suspend_ctrl(ec, 1); -- 2.18.0.203.gfac676dfb9-goog