From patchwork Tue May 15 14:42:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10401335 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 D97D7600F4 for ; Tue, 15 May 2018 14:42:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8CFD203B9 for ; Tue, 15 May 2018 14:42:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDA42204BD; Tue, 15 May 2018 14:42:51 +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=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 7D0E1203B9 for ; Tue, 15 May 2018 14:42:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EFAA66E266; Tue, 15 May 2018 14:42:47 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A1E96E266 for ; Tue, 15 May 2018 14:42:46 +0000 (UTC) Received: by mail-qt0-x241.google.com with SMTP id e8-v6so569503qth.0 for ; Tue, 15 May 2018 07:42:46 -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=tUAgRvGa1b4dADcgfwYthpo+Jlq+8Rnm+StL0aDt6XL+b+sGOyK888eX0f1ppHoqVk xB5gijki6aFWPIhPr9naoz5KOGo/r1JYe2y5ugmcYhgyz9Qf2xaI+JANcVc6mUg1wmdu 0aqYe+uk4kSsSGm9W6IepdzzwYgZg31WPssgECvfgV85ZEUpz3YpNpr+ZerMFq0vQrQG 8ZGNgARy0T1dlMzIxZZa1cMFcDk6fJ7no5zLCDZUwDWrbcPirym5bmgmwrP7DygCLeSu JCJCZgTfoiNz/D0Az126xDaDT7J0IA4Eyhgi23W3kU6OFc2CGYgqZhl5/qC3rfXF61BI 0WLQ== 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=YO9+NBqW1dWbo7ujaMfD+D/ieOwzDuXYQ6ZEtZ+61174Jn7Sautiqjy/x8IWLv3r6r SvbP0gKPhTZtg+xz4p3aG2WbLoNjWBqqe7pm6oV+jafJPwU3wh7atJdSmTHU1PgV+Ylq gwRsmdn1GJ6/853UBmVVce/RRYRnYq1ltDNzmxPyVY2ZHGFbY7kGk0K6mn0EBSqJ+9Wh biyqYS8zO5hww0UbNNvbdNI6ITxgFHl9rHeA4U9/6s/09EE8oIUMHB9DTLsu6VhI/1mR guBD5I8IPy+3ulzEjq6nTM4jYO6IqbTtc0lW/f/JICNL1i0ZoyJR8HKWbsTDzXvN8CxS Agjg== X-Gm-Message-State: ALKqPwevOSsedaOJHarRycge+c+zyrYk67vBfUYh0/LQpUKOVkb1Dclq 5pesRLmlItBAMd2zAHIoC/N+gQ== X-Google-Smtp-Source: AB8JxZrARCxe9FY7qKR2mwvxZWJrdtv7E75Pyt6v6mIP83ya+XRd8Kn/S3ZW6xdhF4iSRiC0cxTURg== X-Received: by 2002:a0c:d7c9:: with SMTP id g9-v6mr13512249qvj.161.1526395365450; Tue, 15 May 2018 07:42:45 -0700 (PDT) Received: from localhost.localdomain ([2620:0:1043:fd00:748b:2433:2688:e1f]) by smtp.gmail.com with ESMTPSA id z5-v6sm132693qtb.88.2018.05.15.07.42.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 May 2018 07:42:44 -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 16:42:21 +0200 Message-Id: <1526395342-15481-5-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526395342-15481-1-git-send-email-narmstrong@baylibre.com> References: <1526395342-15481-1-git-send-email-narmstrong@baylibre.com> Subject: [Intel-gfx] [PATCH v2 4/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 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 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);