Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4495332imm; Fri, 18 May 2018 06:08:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqegrL6P7VFfm6mOQ5IdAadMD5wGMON0GJRYKX0qNVl5yug4+K8z4nkKEw55ZVTJ5CGSOBr X-Received: by 2002:a63:6887:: with SMTP id d129-v6mr7645564pgc.128.1526648921208; Fri, 18 May 2018 06:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526648921; cv=none; d=google.com; s=arc-20160816; b=k9jSMvSfBPs8zbqInvvZ5NuNhjggIv9bcBLQbUZZEWGpltaIT1UplZaXH49TikUsjk ssBYiNoWb5XFwUuNZpwS6IyHmePKaITaR2PzdUMcIN7861z4NxLq9aexjT35+fW6o5iR lqWV/TgKoPikaFeP12pepPilHSTNUlKpMQruL5idpOb7W+/vSIve+/HeHHKSpABSkBRm UY6o14ojhorK2wDCn/PW4PGpcxpElorILycjbEGpdw6Cz2Ck36aAFJCOGTjc5Wueae4r ps8yNWPPso0VdEo9O0Xd5kjfcpnDpdTU1/I1cJKPeO8h7NRJonCQJCo5lFHIuJ4ysfb3 DxMw== 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=cqcEATfgy99A+WHs/3y43KzNcbTvkzYQvc6Sfv4tX/4=; b=VXN88weZNcd5ziCrVzIGTjyUzcTEuFbfL0CI1WGENBywcnpunOi8qgQY/AB74nBusu xpiN/Okwj2/Hk5OUqH6cjyX9AlY7JqpVwAjFVDZk4NggBw7Cq+Bib3eZmiEgbStnI3SD c+jXZlELZmnCq3PIfAMBSHm4AyzqMp5KRuR1H5UyQT0Gxj+3ezvTk0lukChOQRf85JDg 4tWyns0PbhbLXV6v14EVW9j5PsAMKyejovh6EHYDzZiTvHyPehOkllBraqiuw0DIBa5Z 4zp/LNq4LQLzWZ96wjwTKKEkzEjci3g1Bwd+H7Bz46Lkyv9acdQGTYBwbwt66vxiYSvi P5VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=DcmC4f7X; 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 3-v6si6917767plm.428.2018.05.18.06.08.20; Fri, 18 May 2018 06:08:41 -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=DcmC4f7X; 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 S1752461AbeERNF0 (ORCPT + 99 others); Fri, 18 May 2018 09:05:26 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35420 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752282AbeERNFQ (ORCPT ); Fri, 18 May 2018 09:05:16 -0400 Received: by mail-wm0-f68.google.com with SMTP id o78-v6so15139046wmg.0 for ; Fri, 18 May 2018 06:05:15 -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=cqcEATfgy99A+WHs/3y43KzNcbTvkzYQvc6Sfv4tX/4=; b=DcmC4f7XNWdgEXAc882QSwcQFa8cugn/rYfljeCmQh2XJGNZ8PYiOe6KsRC5h3eik2 07xfJlADtrao01BA5WTuB/5NAAylG7K8rnGDN3NwoRs6tYLlpJKPk0HlgDff1riU3VAH 4ST7Iyg35HV0G1D2yfi77Lt//3I94+46sBkEbsVHGuDIf++H1glMCdtM883gxTzj+t1I V2dT1l9pwRIwkEW0UgLDBbidDw67SgD/62iCy6P19ISvo6x5BIlEc1p+oCmfHjZj8VL5 Ar9W4GbveVpCTdlGSsw5j5U/zLGP2Tc5rPu1AW5McGTCEnzjj2jlwV4WtkP7rxABeqR3 ybSg== 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=cqcEATfgy99A+WHs/3y43KzNcbTvkzYQvc6Sfv4tX/4=; b=ULB+ReXoJNok1vCbyFpGoukYF6hITL+twachMhIO91OZSvDCx6P+3i+RKM++Ipnx5p LXvI58Yimx8iuA2W901zVC/tzlCkOyH7CaAgK4f5wVR7qJccaY38KfvHKZTgiWySDcx/ ZJiUgKLLCE2P9sJwJf1Tz6mqWc8u5EPl+cMradH/2JUTf9xhQAl0Wj08jJvuEb7Ks8O3 I+sdVgQEpem5fr2rV5SiX2euiMCAqm2dq7+Ok/z96vz+D4q+sEWTTf1+E93hpfY2qMzc Tukyop4WSDrPD+8BjCk+Tj3JND2dXCN2TVl8gZEnckYKTWAU+m2XKwAJaMR0kFof5aiv dF8w== X-Gm-Message-State: ALKqPweyqoVcjjOpWdO7nmFVD4wWhypWePpUBVLcLRZ4O+2vTm6CG3K7 JcSsv6S0DEL7J1VIMq/Ghqc+uQ== X-Received: by 2002:a1c:80e:: with SMTP id 14-v6mr4779726wmi.9.1526648715041; Fri, 18 May 2018 06:05:15 -0700 (PDT) Received: from bender.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id 131-v6sm11928052wms.34.2018.05.18.06.05.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 06:05:14 -0700 (PDT) From: Neil Armstrong To: airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.com, eballetbo@gmail.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 Subject: [PATCH v2 4/5] mfd: cros_ec_dev: Add CEC sub-device registration Date: Fri, 18 May 2018 15:05:03 +0200 Message-Id: <1526648704-16873-5-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526648704-16873-1-git-send-email-narmstrong@baylibre.com> References: <1526648704-16873-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 --- 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