Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp552031imm; Tue, 15 May 2018 05:49:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqt0O2GBNfCD4qJcembvGGR6cnYQRS2wRr3hmgrIIRQlyhnAK+MAgy/ToK3nWB+xMGspvcD X-Received: by 2002:a17:902:7d87:: with SMTP id a7-v6mr14837099plm.264.1526388576743; Tue, 15 May 2018 05:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526388576; cv=none; d=google.com; s=arc-20160816; b=ttY1OZ2YvRjURaivDN56c9dDUCvs8XbU3hM5V8Admm2Xwdaa4VdBMnaVNhzAbzJB+g Spkuk+4d+OhHW8Z61mCaBsBcg/h3/O7/CaKd4prWCtkHx8TIWPpNC1PuL8Ngg05yfAnk IRWWP+H31aTqNw80jGIJkhyWHIfz1O7YNExX4FKavK/+7fuO0W4dDc6bzuMjM38mhGH4 Fqhq/DslZFjuzgwm3FkdiFTX9eKWbSyVoKY7xXTGlaxqP3YJpH9C9hs/toKyecuDL0ru ibJ5jEpOuoD7UxfgatZXVik2DW8WpOmyddbAz1Gdxmti2VxkeRj9CEycL0yTshQlW+YS rqqA== 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:dkim-signature:arc-authentication-results; bh=xizymeUQv2zFuDadw6RIkGdli2r9wJ31+bXoDEpPHZ0=; b=OEebw4ZyVMDaC7+h2QKJFcUYOAYDivABfaEKUzh1pUbkGOzoO4BuxzpkaEvboVxWig cQ/3Pg+zmOu/+RO2DSsgm2Jdj5F8ZvvXIS+ilz/+XDofxx0kmmvytRlEjfbS/gY7xQr1 4KQg0/uozHRk5umX+YKX96Alkl5XJGR3W3K1nYEQYu8995+lMjs84QJ9chDE3pjP7Zpv qx2hgETS/7slvn0OJ/T8k4huHMFDjBFCLH+J6wyjayAftaIohPBftW267/1wOtZvM9Va jc26RaTbqyJypFd3IntAqmnN77hANTNVc5j4BuGIZ/usGZXpFIqgvs2e6B7WsP6Y4vOb 9bMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=yI0z7hD8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si631103plh.488.2018.05.15.05.49.23; Tue, 15 May 2018 05:49:36 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=yI0z7hD8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753511AbeEOMrh (ORCPT + 99 others); Tue, 15 May 2018 08:47:37 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:40450 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753500AbeEOMra (ORCPT ); Tue, 15 May 2018 08:47:30 -0400 Received: by mail-qk0-f194.google.com with SMTP id s83-v6so7655569qke.7 for ; Tue, 15 May 2018 05:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xizymeUQv2zFuDadw6RIkGdli2r9wJ31+bXoDEpPHZ0=; b=yI0z7hD81acOlHliaYaRuHsST6iVwtzldErtjkIZKgNMI5Ntl9SwrxoxUXUtn6edfK kxnms8OflnJejqPEv335ytvQRWAyeIm6ySDD1ewfAOb3Elp38KetFFwYh7ETXvtXecRf JfNc1xN5xlqWcJDWL6uY8gc9X6UrW8Rcni4XPmCKXbnUNWJsC3Hzx8bHwe7y1o/PyusJ uUM0pehayBJGH30NmGeFGt2+dFzKaaoasNeMV55VBNMeR+vOkQS9855WC00vwiQ4a1ah X46PVX7APhvfSFU9tT+tw1a96IkL68dbQHxJG5AJ3bDxMXd5drpF2jGMSyIq53Lj3sti JjJg== 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=xizymeUQv2zFuDadw6RIkGdli2r9wJ31+bXoDEpPHZ0=; b=Ya0N2OHALV+aKZbSNAAWpGfux7bsTbod2kLhfviD1W1+LjpSMrgLhYc9YwFA663YQa GmkuIup6gZbm0kJxbZ4JzMNW+TlLmBCD2F88X9xModhJAAmvgJ3zpo6sjKAmzyZxTlW1 ohc1JFd3CMJzAaM4sKAWZr5TNK0e7znmFpRb8AZP5SkTgSu4M+Mt+K7udOCTEOJxb0j+ kdgA1eo/MkkaGNVAVEhjs2vOQcVZ3UG5AumUtSMCQPm4V68GXFPrJIsO95vUgtJBtQ0H waovQg/ZbdiwrOYMUiGbd+GJeLNYrjG4+LRXAIc3H4EfOwdp/S1XwutpzeuaIYqZN7JB Oy2A== X-Gm-Message-State: ALKqPwfsVGLfs3RqEcc2SqOXnzPcvUU86xvHnrKhrwQARihqgoMkCYe2 mHeDhLtYhk0fkTrDDITVQyhg9Q== X-Received: by 2002:a37:2b69:: with SMTP id r102-v6mr12644618qkh.26.1526388449297; Tue, 15 May 2018 05:47:29 -0700 (PDT) Received: from localhost.localdomain ([2620:0:1043:fd00:748b:2433:2688:e1f]) by smtp.gmail.com with ESMTPSA id d88-v6sm9725530qkj.25.2018.05.15.05.47.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 May 2018 05:47:28 -0700 (PDT) From: Neil Armstrong To: airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.com Cc: Neil Armstrong , sadolfsson@google.com, felixe@google.com, bleung@google.com, darekm@google.com, marcheu@chromium.org, fparent@baylibre.com, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] mfd: cros_ec_dev: Add CEC sub-device registration Date: Tue, 15 May 2018 14:47:00 +0200 Message-Id: <1526388421-18808-5-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526388421-18808-1-git-send-email-narmstrong@baylibre.com> References: <1526388421-18808-1-git-send-email-narmstrong@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The EC can expose a CEC bus, thus add the cros-ec-cec MFD sub-device when the CEC feature bit is present. Signed-off-by: Neil Armstrong --- drivers/mfd/cros_ec_dev.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index eafd06f..57064ec 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -383,6 +383,18 @@ static void cros_ec_sensors_register(struct cros_ec_dev *ec) kfree(msg); } +static void cros_ec_cec_register(struct cros_ec_dev *ec) +{ + int ret; + struct mfd_cell cec_cell = { + .name = "cros-ec-cec", + }; + + ret = mfd_add_devices(ec->dev, 0, &cec_cell, 1, NULL, 0, NULL); + if (ret) + dev_err(ec->dev, "failed to add EC CEC\n"); +} + static int ec_device_probe(struct platform_device *pdev) { int retval = -ENOMEM; @@ -422,6 +434,10 @@ 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 handles CEC. */ + if (cros_ec_check_features(ec, EC_FEATURE_CEC)) + cros_ec_cec_register(ec); + /* Take control of the lightbar from the EC. */ lb_manual_suspend_ctrl(ec, 1); -- 2.7.4