From patchwork Mon May 14 22:40:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10399531 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 D6556601FB for ; Mon, 14 May 2018 22:40:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F33B02858D for ; Mon, 14 May 2018 22:40:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7DCD28592; Mon, 14 May 2018 22:40:56 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable 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 B48612858D for ; Mon, 14 May 2018 22:40:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 32EDC6E138; Mon, 14 May 2018 22:40:51 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com [IPv6:2a00:1450:4010:c07::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id EB97E6E127 for ; Mon, 14 May 2018 22:40:45 +0000 (UTC) Received: by mail-lf0-x241.google.com with SMTP id q2-v6so20367537lfc.12 for ; Mon, 14 May 2018 15:40:45 -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=N53vP6Qsy2sVodRxA/G1yv2wbHuF1Mm5qbm8/3AwhtSB0sBh553MnWtevFwEJZrLwM 7ygrxXCFddev/5N4VxuHvaCCtPZCfmwWYeUIapy4ImeBdNZJ9arzFr7sDsZNov3g+mPP eayyg6TrhbG7MgYVXXskuGyviff2spLYN217HMavKCeBP9tJ8Y8lQTgMavFz+a3OQce7 N0qI751t+hSKgn3A1pkBpu1L53/kM+xzuD897OvRTxxUeaQ1S31xGbfQ10jEj4xA2d0Q Q1e5sUaeCv2letD5KpOV/oGSQ+xwb+uuC++wxpQqndDfnspT0N0PT2LKgQs/cNIL9VhP l2cA== 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=Fm+oM0T5F2rC4f+bgtIp5Xipa9OhPn7IvKqBbulDLILNLhbnTrZntJkF0o7WJ1TK37 I9Lc0iX4yHuwOtaV5DK3uzTOohAMirLlOj22qfqZDNSffsLuAnoMEXyG+KCzX2R5dfy9 xBln+qeiv1x4KLbWEih1gw0qqRvJ5BdEXDWu3Pro2Uy6UO1Wew8Z7PF7C6mIlUqmvLTy 1JgVZ+Ya9muuDihUEkbOsGiOTjhugAEbkdd4KF7NaZcsgIEevJtFpRQ6T1+25PKfkxG/ 9veuKE5Etb3Hk3wiSuwqX9xp7fDGiA1Cn0q+bQ6ftlymlYDWb4dCTFVQ8B3ttV27gVHy IqrA== X-Gm-Message-State: ALKqPwce8HIzhZOzcovbhsqZziPPQ4rSahWQjyh6FBRjcm9OmOy1gdeG oehrKlZQLQohEafN2VacITIHbA== X-Google-Smtp-Source: AB8JxZr9bClea5TOrPp7HXrKWq/9KodOi2jyqXNmQU+Hl8gk9+ygk2fvG1Hq/h7eTuoxbaAQbMDExA== X-Received: by 2002:a19:b257:: with SMTP id b84-v6mr9629708lff.84.1526337644183; Mon, 14 May 2018 15:40:44 -0700 (PDT) Received: from bender.ownit.se (89-253-66-137.customers.ownit.se. [89.253.66.137]) by smtp.gmail.com with ESMTPSA id f196-v6sm2071149lff.59.2018.05.14.15.40.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 May 2018 15:40:43 -0700 (PDT) From: Neil Armstrong To: airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.com Date: Tue, 15 May 2018 00:40:35 +0200 Message-Id: <1526337639-3568-2-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526337639-3568-1-git-send-email-narmstrong@baylibre.com> References: <1526337639-3568-1-git-send-email-narmstrong@baylibre.com> Subject: [Intel-gfx] [RFC PATCH 1/5] 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 , 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 --- 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);