From patchwork Thu May 24 08:55:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10424685 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 4606060327 for ; Thu, 24 May 2018 12:24:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EB8929298 for ; Thu, 24 May 2018 12:24:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 239412932C; Thu, 24 May 2018 12:24:52 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B1CD729298 for ; Thu, 24 May 2018 12:24:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F35856E719; Thu, 24 May 2018 12:16:05 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1918E89D64 for ; Thu, 24 May 2018 08:55:15 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id u12-v6so1594540wrn.8 for ; Thu, 24 May 2018 01:55:15 -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=zJSNYnlPAAyAhFc+i4T3g8zcQjGcB27fQWh/R9b/eIc=; b=Ta7P6CapYLoYBS+junb9rBFbasQot8S8Kc1IhS4UoNb8PhHfCcgdwfNEyOjbjn58je liG2k0OVEMWMgXX2XIsv63Dk258MySaFaSnOspOAx9IAFUiEWwnp0p7rU0GC2rBS0GQJ rkX0RfdRXRGEImaTgAkEpEDAyatefk3zFJLoYUogl20jb7BLX5mLQsgP2zLNz8SMmm0x FiXhQPmjzGRYIeMLZ7Ghi5HarbHuh7CT5/ocxaHW0iUL3G2VYgCZ42k+kQGUJMfzGRFr lJ1a0Wk7TP46QKnlhZ5bE734TiBy0w2q6eqo8KpfIQWnH4Q2M+G3Yh97Ab78OqEUYmAB uOAA== X-Gm-Message-State: ALKqPwfT46DcwOl4N1j+y2RC6RriMs+ChOqFmgZxM9h5HCppWhr+ymOD z/Yhpo3HkUk6niynZ8KMY7tb4A== X-Google-Smtp-Source: AB8JxZpow2wi+FGtSfgTS6xPuohw8XrKsJUds/4y18GiLfU0jUAFNyKvAjAcxWsXUdHgaW7SSSOGmw== X-Received: by 2002:adf:ab10:: with SMTP id q16-v6mr4874400wrc.239.1527152113702; Thu, 24 May 2018 01:55:13 -0700 (PDT) Received: from bender.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id z192-v6sm3348462wmc.10.2018.05.24.01.55.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 May 2018 01:55:12 -0700 (PDT) From: Neil Armstrong To: airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.com Date: Thu, 24 May 2018 10:55:00 +0200 Message-Id: <1527152101-17278-6-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527152101-17278-1-git-send-email-narmstrong@baylibre.com> References: <1527152101-17278-1-git-send-email-narmstrong@baylibre.com> Subject: [Intel-gfx] [PATCH v5 5/6] mfd: cros_ec_dev: Add CEC sub-device registration X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , eballetbo@gmail.com, sadolfsson@google.com, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, fparent@baylibre.com, felixe@google.com, bleung@google.com, darekm@google.com, linux-media@vger.kernel.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Enric Balletbo i Serra --- 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 1d6dc5c..272969e 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -383,6 +383,10 @@ static void cros_ec_sensors_register(struct cros_ec_dev *ec) kfree(msg); } +static const struct mfd_cell cros_ec_cec_cells[] = { + { .name = "cros-ec-cec" } +}; + static const struct mfd_cell cros_ec_rtc_cells[] = { { .name = "cros-ec-rtc" } }; @@ -426,6 +430,18 @@ 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 CEC host command support */ + if (cros_ec_check_features(ec, EC_FEATURE_CEC)) { + retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO, + cros_ec_cec_cells, + ARRAY_SIZE(cros_ec_cec_cells), + NULL, 0, NULL); + if (retval) + dev_err(ec->dev, + "failed to add cros-ec-cec device: %d\n", + retval); + } + /* 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,