From patchwork Thu May 24 09:57:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10424641 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 EF1B160327 for ; Thu, 24 May 2018 12:20:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6EF1296DC for ; Thu, 24 May 2018 12:20:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CED322947F; Thu, 24 May 2018 12:20:36 +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 32D732947F for ; Thu, 24 May 2018 12:20:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A51506E6B6; Thu, 24 May 2018 12:15:50 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A56C6E01C for ; Thu, 24 May 2018 09:57:34 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id 94-v6so1960035wrf.5 for ; Thu, 24 May 2018 02:57:34 -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=MlEBVhPwk0WmtkKGmm9ScGxmSyu1lFumw3Rk8/2NTujnsqNrpTdIepkZxnSYVStCiV 3Hh/gvdoLwJfY7xjEKQZ0ojlU0TQR/il1bb1g6A/dP8xf0xxg7h7GftmviZUKBSjzr4d ZpxdHzVuX7qP0A39O2ZBOOXkLNeFk+oZeQuQbbxCk2RRGyyYoYTh6ztTBNXVGd8FF7To u4jdda9qp6zE6IC2HPfMJmZHcTvMEkUXp2MGN3QyiJLVmqsucr/Z6xWUiaxv/O9Z3iR1 IVz6/zQI8DQBTFC+8mSqxtpnt5H+sbuUV7GJDfOaNsTb8pKJw+De6YcKb2l1/9ECah1k d6TQ== X-Gm-Message-State: ALKqPwd0gr9vRwKRnIqArzQCwGFHeeaSH93AkU6grxyKnCHDpeCNHF53 mUjmr4FdtY/QPcOt/RfzdVyjYQ== X-Google-Smtp-Source: AB8JxZqyWYPby7iskYecAUtf/iS1HQTtNMQ8ssbm5H3Hz8TUIzlcLX3R/YIIhAh6yPuzsCnFOLLy4A== X-Received: by 2002:adf:88b6:: with SMTP id f51-v6mr5046173wrf.55.1527155852880; Thu, 24 May 2018 02:57:32 -0700 (PDT) Received: from bender.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id b66-v6sm6868525wma.48.2018.05.24.02.57.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 May 2018 02:57:31 -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 11:57:20 +0200 Message-Id: <1527155841-28494-6-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527155841-28494-1-git-send-email-narmstrong@baylibre.com> References: <1527155841-28494-1-git-send-email-narmstrong@baylibre.com> Subject: [Intel-gfx] [PATCH v6 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 Acked-by: Hans Verkuil --- 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,