dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org,
	olof@lixom.net, seanpaul@google.com
Cc: Neil Armstrong <narmstrong@baylibre.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, marcheu@chromium.org,
	bleung@google.com, darekm@google.com,
	linux-media@vger.kernel.org
Subject: [PATCH v8 5/6] mfd: cros_ec_dev: Add CEC sub-device registration
Date: Wed,  4 Jul 2018 17:08:20 +0200	[thread overview]
Message-ID: <1530716901-30164-6-git-send-email-narmstrong@baylibre.com> (raw)
In-Reply-To: <1530716901-30164-1-git-send-email-narmstrong@baylibre.com>

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 <narmstrong@baylibre.com>
Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 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,
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-07-04 15:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04 15:08 [PATCH v8 0/6] Add ChromeOS EC CEC Support Neil Armstrong
2018-07-04 15:08 ` [PATCH v8 1/6] media: cec-notifier: Get notifier by device and connector name Neil Armstrong
2018-07-04 15:08 ` [PATCH v8 2/6] drm/i915: hdmi: add CEC notifier to intel_hdmi Neil Armstrong
2018-07-04 15:08 ` [PATCH v8 3/6] mfd: cros-ec: Increase maximum mkbp event size Neil Armstrong
2018-07-12 12:26   ` Lee Jones
2018-07-04 15:08 ` [PATCH v8 4/6] mfd: cros-ec: Introduce CEC commands and events definitions Neil Armstrong
2018-07-04 15:08 ` Neil Armstrong [this message]
2018-07-04 15:08 ` [PATCH v8 6/6] media: platform: Add ChromeOS EC CEC driver Neil Armstrong
2018-07-12 12:26 ` [PATCH v8 0/6] Add ChromeOS EC CEC Support Lee Jones
2018-07-12 12:42   ` Neil Armstrong
2018-07-12 13:02     ` Hans Verkuil
2018-07-13  7:46 ` [GIT PULL] Immutable branch between MFD and DRM/i915, Media and Platform due for the v4.19 merge window Lee Jones
2018-07-16  7:38   ` Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1530716901-30164-6-git-send-email-narmstrong@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=airlied@linux.ie \
    --cc=bleung@google.com \
    --cc=darekm@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=felixe@google.com \
    --cc=fparent@baylibre.com \
    --cc=hans.verkuil@cisco.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=marcheu@chromium.org \
    --cc=olof@lixom.net \
    --cc=sadolfsson@google.com \
    --cc=seanpaul@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox