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: 10410571 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 419356031B for ; Fri, 18 May 2018 13:05:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 321CD28984 for ; Fri, 18 May 2018 13:05:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2683928986; Fri, 18 May 2018 13:05:46 +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=unavailable 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 E1D9428984 for ; Fri, 18 May 2018 13:05:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B3696ED95; Fri, 18 May 2018 13:05:27 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A3596ED80 for ; Fri, 18 May 2018 13:05:16 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id x12-v6so3433569wmc.0 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=aYIgoCkJjr7KygFCj7/dCuCu/CTxJfpurhrH5R7CpoATQRD9qBTGvDSGEjdzlnP0/Y 5Cznpt0P7UuxR59QKYHdD85nUL0rbQWy9xLieYQGvPfCL3sxLyzVblRjHVGVD236zTQv gGqSjomjor8ts9HH2cAlbtAbexL6hyNLpUv07ne6WUKLq9dn6PRS78wHYuJK759rMjrT /NziAiakrnGZsYbWKVpqFkp4+udYCTI+SfIo7JGII40/JltBsuehchDze0twwuDwHhdR lBfxGvXU6c/o2yJ9CsRxSM1Cpz3lCnWDhOv1UST2DM5wH6Ou8m8zH4klmxXyveumH5Ol +b5w== X-Gm-Message-State: ALKqPwdm3E4cBDkC79R2wf5BDhN1gTq/S5ymx+CgMpw+b4/Gq2JyMR27 6ePAcTh/UfyXeT0ZBmRVueuD6g== 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 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> Subject: [Intel-gfx] [PATCH v2 4/5] mfd: cros_ec_dev: Add CEC sub-device registration X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & 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, bleung@google.com, darekm@google.com, linux-media@vger.kernel.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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,