From patchwork Fri May 18 13:05:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10410555 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 6258F602CB for ; Fri, 18 May 2018 13:05:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 530F928984 for ; Fri, 18 May 2018 13:05:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47A292898C; Fri, 18 May 2018 13:05:31 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 78B8B28984 for ; Fri, 18 May 2018 13:05:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3677B6ED89; Fri, 18 May 2018 13:05:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@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 997206ED7A for ; Fri, 18 May 2018 13:05:16 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id n10-v6so15017614wmc.1 for ; Fri, 18 May 2018 06:05:16 -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=knTSCGFn4oWgBrZlS2LfmwulHzxp+5lUcB9IcgAIJfV0Osz2jh63gNzWfjInijrM7W xwPWOVMPaG7gR+YkcfDgkru+XAfULkPOpN4e+0Ahj/1hAy1jcUf8jthq2BFKr3wBMA6c FCGmaEN/kx6J2jQwEurzAcytF89Qd/pWBQYGJ4b0rTCzqFCYOkiK+gxln8X6RmqN15+f MFp+PLJlJv2xtEX/spcCfriR7YV8bBBKDXIQcvIVoBK6u7APPfExEqSt4PnYIdYPf0lQ woAx8FYRblo+5uiBHTnTR2Wbczz7OLt1O2KUkpOaB9jd81CgNb74/nylViRIBnr1woo7 +BwA== X-Gm-Message-State: ALKqPwdZs6u3tPwD2PHnanerNqdXsNESqnwQ4+McpzoaA3xd+YFvD3eT 2wESpc1JTKpSK+4euI4bGUsQuw== X-Google-Smtp-Source: AB8JxZqYmjGqCDkg9y3bOovXOCEYX8+Bq5ItUQOOeLCS1pQbd/SmiW084kBiMATuODQLiDhlXDi4Mw== 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 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> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , 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 MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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,