Received: by 10.223.185.116 with SMTP id b49csp807629wrg; Fri, 23 Feb 2018 07:07:58 -0800 (PST) X-Google-Smtp-Source: AH8x2258yOAngcPxtR+5ZE4UZ7XuCjwNZod/+k5RGyWrYMF+myKa0XaZgtHNypr5THm3ZnztsU1H X-Received: by 10.99.45.194 with SMTP id t185mr379458pgt.267.1519398478719; Fri, 23 Feb 2018 07:07:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519398478; cv=none; d=google.com; s=arc-20160816; b=pd84MxXdFMgcL++nMCCpibySnpNhMBroK8IUBnohjeFs7vCRvexqvpW/qB9CKX6FoB +NCVPR+VjAVcQ/Q6qjxaB6L0NewldOHWvyIWTynoCVLuSuiXL7stTRn+tpSCCikBaN0C jjwzylIOKQcRrMz+H38cbnvnIaYjK6pgazv0Baf5P0guYRKa6XTOyvpMw+Su2qyb04qd NIMBInYHy8SDnfONp3DfgunPJA038XHl10ovMdxut7XT2WRMerhQnAcNrGgnqWBd7Nd8 K+pNbn7lOzetFL1fMnzQjZPy+IDwVCpFpsx4Lyil8LAvupUqyMhGa24z5FBmy1vtnp9p aiDg== 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=1Rbu5YuoFICxy+oRtz2fiMyGb2qIn8+SuHfaCEwoZWA=; b=yyZml4mcUsZZWe7zUrDZOxqEq+KYDrYZoYKBf+uLBxt+ORldzOGEcA+VfQ8kJs8BTY QBWdtL4WqG2lH8iM/3aYqV2lZHzqG5tGiWlrIbeqEpPloWEieMYt82bFshwdKgPZxFAY zqE8DWD4/itqPJKkz//9uctKDwUkfATGI+W8L2Pgb+3AqxrzEZhA76D1BO4q2HLv1nke vhEDSfid1EvN0QVm7UH5IjrkHnnpO/uzq7OWjNzgIEkoXQLxcO1BmnLL7+LxeYAiaKAH SzUv0GEEIBVGFd+mEG6SGzWdfUg9eK/n9jknXiHn6Fg2rg/xIyEehihYX/85qhDW79Mx h5ZQ== 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=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j24si1603292pga.711.2018.02.23.07.07.44; Fri, 23 Feb 2018 07:07:58 -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; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751818AbeBWPG2 (ORCPT + 99 others); Fri, 23 Feb 2018 10:06:28 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:37276 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751661AbeBWPGS (ORCPT ); Fri, 23 Feb 2018 10:06:18 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 8B6312733B1 From: Enric Balletbo i Serra To: lee.jones@linaro.org Cc: groeck@chromium.org, gwendal@chromium.org, kernel@collabora.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/8] mfd: cros_ec_dev: Register cros-ec-rtc driver as a subdevice. Date: Fri, 23 Feb 2018 16:06:01 +0100 Message-Id: <20180223150605.10417-5-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180223150605.10417-1-enric.balletbo@collabora.com> References: <20180223150605.10417-1-enric.balletbo@collabora.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check whether this EC instance has RTC host command support and instatiate the RTC driver as a subdevice in such case. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Gwendal Grignou --- Changes in v2: - [4/8] Add the Reviewed-by Gwendal. drivers/mfd/cros_ec_dev.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index f98e5beffca6..33fe1b439ee2 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -389,6 +389,10 @@ static void cros_ec_sensors_register(struct cros_ec_dev *ec) kfree(msg); } +static const struct mfd_cell cros_ec_rtc_cell = { + .name = "cros-ec-rtc", +}; + static int ec_device_probe(struct platform_device *pdev) { int retval = -ENOMEM; @@ -437,6 +441,16 @@ static int ec_device_probe(struct platform_device *pdev) if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE)) cros_ec_sensors_register(ec); + /* check whether this EC instance has RTC host command support */ + if (cros_ec_check_features(ec, EC_FEATURE_RTC)) { + retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO, + &cros_ec_rtc_cell, 1, NULL, 0, NULL); + if (retval) + dev_err(ec->dev, + "failed to add cros-ec-rtc device: %d\n", + retval); + } + /* Take control of the lightbar from the EC. */ lb_manual_suspend_ctrl(ec, 1); -- 2.16.1