From patchwork Fri Jun 1 08:19:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10442717 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 B95CA602BC for ; Fri, 1 Jun 2018 08:19:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA7D628F33 for ; Fri, 1 Jun 2018 08:19:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F2AA28F70; Fri, 1 Jun 2018 08:19:59 +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 5F8D028F33 for ; Fri, 1 Jun 2018 08:19:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3CFB36E5CE; Fri, 1 Jun 2018 08:19:32 +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 9968E6E5C2 for ; Fri, 1 Jun 2018 08:19:30 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id l1-v6so1168707wmb.2 for ; Fri, 01 Jun 2018 01:19:30 -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=Q7y3MvYIky+EU872AFNFrganN22Td9vgv+T+9KQGxaw=; b=HmoDZb0VFAYngYeU5+kl/7UU36AmnzId4FhhOJa5UyVKS47/Mp9S3cDKtf++Z0AhPo 3GDloqXisxHyb7Lw4Oa9knxqF9ZthsLM7yGBhepqo5lXdg5CAqEEhD8UqR8nCzcCvftq s1U9vNWXEM6Ee67PXA09wavGX2ruQNeJa1NVR/Y0Q8Nwt3lIDEkVX7zxjy2o+F1D+8Pp 1k7GQOGZBrQMS7Mg97Er4u88CuPeKsLEWdFLg4hzGrC+6J3g6BMzqRqjFb7WykGcKGxD iKtermUFn9WeRZAo3g42F8Ri05/THiKmqsLlXd8ZS8g8MLTC3KXTRRSTE9FtmJr3h96l 00/w== X-Gm-Message-State: ALKqPwd0w4s6ScgEk76qUEMMBh0LBN1spf3n9rul2NhqsyvXcIC1lzVk oJj0jvBfGtLWC3WN75bCy41pkQ== X-Google-Smtp-Source: ADUXVKI+0gebShQAOrAeeOimMuseGGkE4LfYPE5gz5jLWKWegqcqXWkt9zZN3rRUSqx7EXPWCRq0SA== X-Received: by 2002:a1c:3610:: with SMTP id d16-v6mr2071135wma.126.1527841169090; Fri, 01 Jun 2018 01:19:29 -0700 (PDT) Received: from bender.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id h7-v6sm555949wmc.44.2018.06.01.01.19.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Jun 2018 01:19:28 -0700 (PDT) From: Neil Armstrong To: airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.com Date: Fri, 1 Jun 2018 10:19:13 +0200 Message-Id: <1527841154-24832-6-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527841154-24832-1-git-send-email-narmstrong@baylibre.com> References: <1527841154-24832-1-git-send-email-narmstrong@baylibre.com> Subject: [Intel-gfx] [PATCH v7 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,