Received: by 10.223.185.116 with SMTP id b49csp3581875wrg; Mon, 26 Feb 2018 02:29:49 -0800 (PST) X-Google-Smtp-Source: AH8x2251eQupwoIY5G1SiWRbYSuP7xMj1YlB3s0fmFOzjSj7y3PJocOercL0c4yRldWSxgAG6nJT X-Received: by 2002:a17:902:123:: with SMTP id 32-v6mr10364355plb.278.1519640989046; Mon, 26 Feb 2018 02:29:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519640989; cv=none; d=google.com; s=arc-20160816; b=aafUvFzn51Zgkovq53hEb5KQdZlL0qU00Xni7QAMkr4wH8i0zRoZYeQmQqHb2NmDB8 DI/VUGM/1ZxhWOa0HS+9+9sn3uprDOkCxiA4hB/vBSX7qlp4lpryyiDZGNUcb0oFjeED T0Sx/Y4+bBvmktCjv2VAqjUB8z0MXRcRqW5lyk+O2KE0aFz9LoMH1hJW0cmLCAoryrUr NXesRSplEpVPLAZSfL5mpj02wV+InGZkqQyPj/1auu3ERwK30mpDKFiAaNLE8n/Z9dYG RTxbcmQM9HgjZFBJ+W06kGX1YmEsMiYY+uOaDz5W9VaTY71bVzA2fjgNq6E0E+HoW/SR 22EA== 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=n5GNrRk8L3fakIfKTCrAZJsrQahBgDsNylfuv8a3nJY=; b=fWL+nB7tTCAQCvgH/F5TYI1kWZg4N6g8tJ/8Lyd/m/xqOOOky52tMxCQFt3POiMi0W LHd/rxr6kD1hYc9rBKvPDhm8IcefDqjUFS3E9NzYFBy+c7+Ipig/BRH9SAoANAFFNp7C reGaex+SEEertwg/dFBs1OJNvJLYkekIvij4InwzRJTDMyRBr6AWp18NzMI4j6nOP0q1 Xl2+sM/UPTDn8494Kpz/uj86bbLfX5UGephr/EKhr/m4eX4OGPqlqLN+aSl0yZa7tb4C RkQZhmBofnPlYjOQhfIxFji4cky9R3uidbwiVwG5IyfzsFBz78h2oO8YCOoouq2/MuxT lMOA== 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 n19-v6si6426924plp.808.2018.02.26.02.29.35; Mon, 26 Feb 2018 02:29:49 -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 S1752561AbeBZK2C (ORCPT + 99 others); Mon, 26 Feb 2018 05:28:02 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:48338 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752601AbeBZK0R (ORCPT ); Mon, 26 Feb 2018 05:26:17 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 94E7B260611 From: Enric Balletbo i Serra To: lee.jones@linaro.org Cc: groeck@chromium.org, andy.shevchenko@gmail.com, kernel@collabora.com, gwendal@chromium.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/8] mfd: cros_ec_dev: Register cros-ec-rtc driver as a subdevice. Date: Mon, 26 Feb 2018 11:26:02 +0100 Message-Id: <20180226102606.15093-5-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180226102606.15093-1-enric.balletbo@collabora.com> References: <20180226102606.15093-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 Reviewed-by: Andy Shevchenko --- Changes in v3: - [4/8] Add the Reviewed-by Andy Shevchenko. 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