All of 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, felixe@google.com, bleung@google.com,
	darekm@google.com, marcheu@chromium.org, fparent@baylibre.com,
	dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	eballetbo@gmail.com
Subject: [PATCH v7 5/6] mfd: cros_ec_dev: Add CEC sub-device registration
Date: Fri,  1 Jun 2018 10:19:13 +0200	[thread overview]
Message-ID: <1527841154-24832-6-git-send-email-narmstrong@baylibre.com> (raw)
In-Reply-To: <1527841154-24832-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>
---
 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,
-- 
2.7.4

  parent reply	other threads:[~2018-06-01  8:19 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01  8:19 [PATCH v7 0/6] Add ChromeOS EC CEC Support Neil Armstrong
2018-06-01  8:19 ` Neil Armstrong
2018-06-01  8:19 ` [PATCH v7 1/6] media: cec-notifier: Get notifier by device and connector name Neil Armstrong
2018-06-01  8:19   ` Neil Armstrong
2018-06-01  8:19 ` [PATCH v7 2/6] drm/i915: hdmi: add CEC notifier to intel_hdmi Neil Armstrong
2018-06-01  8:19   ` Neil Armstrong
2018-06-01  8:19 ` [PATCH v7 3/6] mfd: cros-ec: Increase maximum mkbp event size Neil Armstrong
2018-06-01  8:19   ` Neil Armstrong
2018-06-01  8:38   ` Hans Verkuil
2018-06-01  8:38     ` Hans Verkuil
2018-06-18  7:44   ` Lee Jones
2018-06-18  7:44     ` Lee Jones
2018-06-18  8:35     ` Neil Armstrong
2018-06-18  8:35       ` Neil Armstrong
2018-07-03  9:43       ` Lee Jones
2018-07-03  9:43         ` Lee Jones
2018-07-03 12:27         ` Neil Armstrong
2018-07-03 12:27           ` Neil Armstrong
2018-06-01  8:19 ` [PATCH v7 4/6] mfd: cros-ec: Introduce CEC commands and events definitions Neil Armstrong
2018-06-01  8:19   ` Neil Armstrong
2018-06-18  7:45   ` Lee Jones
2018-06-18  7:45     ` Lee Jones
2018-06-01  8:19 ` Neil Armstrong [this message]
2018-07-04  7:47   ` [PATCH v7 5/6] mfd: cros_ec_dev: Add CEC sub-device registration Lee Jones
2018-07-04  7:47     ` Lee Jones
2018-07-04 12:38     ` Neil Armstrong
2018-07-04 12:38       ` Neil Armstrong
2018-07-04 13:12       ` Lee Jones
2018-07-04 13:12         ` Lee Jones
2018-06-01  8:19 ` [PATCH v7 6/6] media: platform: Add ChromeOS EC CEC driver Neil Armstrong
2018-06-01  8:19   ` Neil Armstrong
2018-06-01  8:27 ` ✗ Fi.CI.BAT: failure for Add ChromeOS EC CEC Support (rev8) Patchwork
2018-06-08  7:53 ` [PATCH v7 0/6] Add ChromeOS EC CEC Support Hans Verkuil
2018-06-08  7:53   ` Hans Verkuil
2018-06-08  8:17   ` Neil Armstrong
2018-06-08  8:17     ` Neil Armstrong
2018-06-08  8:24     ` Hans Verkuil
2018-06-11  6:03       ` Lee Jones
2018-06-11  6:03         ` Lee Jones
2018-06-11  8:56         ` Neil Armstrong
2018-06-11  8:56           ` Neil Armstrong
2018-06-11 10:17           ` Hans Verkuil
2018-06-11 10:17             ` Hans Verkuil

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=1527841154-24832-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=eballetbo@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.