From patchwork Wed Jul 4 15:08: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: 10507221 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 D5FC2600F5 for ; Wed, 4 Jul 2018 15:09:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C73DB28D96 for ; Wed, 4 Jul 2018 15:09:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB5E728D9A; Wed, 4 Jul 2018 15:09:06 +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=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 8274228D96 for ; Wed, 4 Jul 2018 15:09:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 762146EC0F; Wed, 4 Jul 2018 15:08:37 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id E41896EC03 for ; Wed, 4 Jul 2018 15:08:32 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id b188-v6so6357514wme.3 for ; Wed, 04 Jul 2018 08:08:32 -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=z7yQuQmvGAlbR4zcfDmJZAnreypXNnkd4KjoHxuswAM=; b=YzSGxrDH1wv65ncV+wmtw6roq9QxCt9OKeKTOxj5p0I5gYncYUXuyUNLo63MLIvay4 nSLzFP4A61HOaI7ViYr3l1pM2lvYAIGYieSGsjsBF9G4is5HVFgT4i8RSDxzWrqmVF9K OBzgkbxQRYBWEBR8+2BYMWfUqJ9m3Awz9YLJ2j6iod+IJVmGHHjZ+udIr4LbwCd7Y2oJ lEaijd25KJffPFIyBLlxxaVnfk8AtSB5LzD6301H0lOY8uvbhA+whvnvmYP/T3VV3EI3 9PxarngxBMeS4joZ9JeXhVZx4rR0wx2coCAD+v/f1XAxS8aennPWASDN3fKpZp78Wxle B3Fg== X-Gm-Message-State: APt69E35MRRhmiJZ/VVLUDR+lpLwVbgHFKWP0DRNhqP7+/maCFm4NxBV qs/MVaKFabBV4VndZZEQJFP7Lg== X-Google-Smtp-Source: AAOMgpc6GhL/llorRjRgLJndJx1uMgwpayF3tbJ2BroKWzzk+K/wEJI3hnPLfSJCLJrDQeufMKbcRQ== X-Received: by 2002:adf:b3d4:: with SMTP id x20-v6mr1955233wrd.272.1530716911082; Wed, 04 Jul 2018 08:08:31 -0700 (PDT) Received: from bender.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id l7-v6sm9607737wmh.1.2018.07.04.08.08.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Jul 2018 08:08:30 -0700 (PDT) From: Neil Armstrong To: airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.com Date: Wed, 4 Jul 2018 17:08:20 +0200 Message-Id: <1530716901-30164-6-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530716901-30164-1-git-send-email-narmstrong@baylibre.com> References: <1530716901-30164-1-git-send-email-narmstrong@baylibre.com> Subject: [Intel-gfx] [PATCH v8 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 Acked-for-MFD-by: Lee Jones --- 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 306e1fd..1e2049f 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -377,6 +377,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" } }; @@ -419,6 +423,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,