Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp324745imm; Fri, 1 Jun 2018 01:20:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKajVV66b/NOUhroVJSaw/yLwhUAD1kOcLIdP23+rv06n2pllq36/DzG9UA6xOsyPhP1FsU X-Received: by 2002:a63:2ac4:: with SMTP id q187-v6mr7846756pgq.333.1527841244262; Fri, 01 Jun 2018 01:20:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527841244; cv=none; d=google.com; s=arc-20160816; b=GDuT86k9RM4bUbD429gK9tHFKtxPYxyD6420N0xqbTcTJxu4QOPnx9yaYgH1wiXOO3 Sp6xIq+yXIbnB9MlLURCZedrqLaIk52sGsV9U35gvS3Y4/dbkFxNXbAKT+dfdrX0daTR BirBgF8QYElZyQCa3NbiN4TsL2Ufe5hVLzdm0rIPpPM0MQldpQgSRq7xNXsiI68qrxOM S6261hdWm8HfwvBDW2bGlzOwcxaX96nc6Ad2iy4VIxBesdWE7vl+MzGyYLo2jI98677W Pf8skQhcTkKak5Bt6pjtUyxK4LICFvy/qRuLf2pqicZCxbkw30dBkb/3wka2k9FnqpBA 5vdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Q7y3MvYIky+EU872AFNFrganN22Td9vgv+T+9KQGxaw=; b=sB+SGrgfAO7RBVyMje7Wb+05GGjieJ49yvbCGeUsT1lU413z+5CLgYqNDKxqsJAL5o d2F+u4M1wHpOh5jJ2I85y2cyZ/KMRatlVgfYf/YKWbSLLXbYVButxx7IEXJYuvzGANRd +w20LqLtdMb9K6AGUSglYzO7c9oVrcRhKK1HsjpGrpgxIMgD/vzaz5ij1IBQ7RzrwszM l9uAT55zerlfFQNmZq+iI+VSbBUHCNLZuiTFvuSeG/rfnJqhZtEOtMw9AUrO4pE4oepi /HBSZrFKk9MdRiPAoFj8qMerc64NjINUXAqBLbOe3SJSyZLEZ3NpjJ6YqwLuWiMTrC3K 1oSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=NbrwqWoA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k82-v6si6811573pfa.53.2018.06.01.01.20.28; Fri, 01 Jun 2018 01:20:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=NbrwqWoA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751514AbeFAITl (ORCPT + 99 others); Fri, 1 Jun 2018 04:19:41 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:37081 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750961AbeFAITa (ORCPT ); Fri, 1 Jun 2018 04:19:30 -0400 Received: by mail-wm0-f65.google.com with SMTP id l1-v6so1168706wmb.2 for ; Fri, 01 Jun 2018 01:19:29 -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=Q7y3MvYIky+EU872AFNFrganN22Td9vgv+T+9KQGxaw=; b=NbrwqWoAGR7VUP5IdEDruMzA7Ojq6EdJSFZgopo8z737zV6tbY+tEvSTU5GZxJUQan pwLK98+UQK9L47jaMXLDukUR4IuJ2xjgpXauGTueNJpE7mH4P7k6gvNXvfpOVup3jNIE rP40JCL2DOjV4i+blqhQqqdBDWxjcu5nY6SAUjbnKmMibKB81fQVcaEmoRoB8Ck0qgZG uVaY+mXXNPysqnGbaILlHwqzAqa+mX+yJlJqBFvmyIgDgdCld78jGBjcbcOGgnIOkosv H00pK4JmiJx29XX4Pd7E5gkn2iAjHBbRriYa2gFf+BdR3kOwVnZClgws9oz1aC2sRZzH vXfQ== 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=msKoNmgcXHPv2wQImGPGHz5xOIm1v9gr8s1+3pRM9/Fqjut550DnCM7GCmnQxPDmrj uyXjKWx47GuHdY/+ru7GnDfKw/uV5YNBEGnhDzqQRw4mI7CPaNwTkX3pQC4RZDeXO5Yi lEYTA/fzx/rDO5ny7xYWON+fKG7KHrnRhSDQ7wkVXyzaGoob0jdw+fTEYux5kD68raHB v3p0oqLZmfXx/0T1/8bk8A/y3SyJuPqc97O3LOQKOnxNVphoHfKwFoZSlJIW67n0Pclm +xklpzjSStCDyCpp4vzJgTIKOPMAhm+WcBq704yY+7YAPhQRP+ZT7w1abBGBwGDtxt+L JT5g== X-Gm-Message-State: ALKqPwcbXx/zkWugnT3esZbCbksxvJnUCm8tXcUhf8CIAIP0yeFeVMC/ M9ewwDcFyMQmIB7qdCjXwMPFNg== 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 Cc: Neil Armstrong , 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 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 2.7.4