From patchwork Mon May 21 14:21:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10415469 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 BB1E060545 for ; Mon, 21 May 2018 14:22:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADBC728982 for ; Mon, 21 May 2018 14:22:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A27B128985; Mon, 21 May 2018 14:22:06 +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.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 15B4428982 for ; Mon, 21 May 2018 14:22:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D1FB76F0E5; Mon, 21 May 2018 14:22:01 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id EA4DA6F0DE for ; Mon, 21 May 2018 14:21:57 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id o78-v6so27016523wmg.0 for ; Mon, 21 May 2018 07:21:57 -0700 (PDT) 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=zJSNYnlPAAyAhFc+i4T3g8zcQjGcB27fQWh/R9b/eIc=; b=DfPA+9v19HeUs+gUSgJBXfkuKw4RX0rD4vPGOc3MJ0vFnKcp6/huoFGNYZZwWqmLIV /yMHqqxA967blaI7GSBbcRP4nbzeMgDExRaWMBvJKStxW6yP7MtZcCRjF2+7zy0Tm7aE il3qlpmRMet87a7zZBldpSP48DeaWcTVQ4ErRUOahcMTr5nFkv/iUh+8JskBmc0sWusd QnmkfhCyCGlHNf2l1fUbyfpNwNgIR1BwH7/RcV1ZXGNJR7ASciiyai//KkWhMLBJcTFB 9v/+tOCmjxOAPX2lnIV2PZoDIcbf3cs/GSz3UEdINDK3EnolQ1wRT0kNzoL0gkg7dVzG kbfw== X-Gm-Message-State: ALKqPwfDRHbiiwT+0sJvhHxLDJojGcRLMo8eDf0378lDbS1Usb0CfEbS EpLA5mw6jZmHEFZZgQz4rCTpZw== X-Google-Smtp-Source: AB8JxZr5nCvmC+/95wB402hON3YqVp6crlkYqCr1vBjpiGbRD919CkrMWd5QGHoiYEmlF79VL2cJ2g== X-Received: by 2002:a1c:bf16:: with SMTP id p22-v6mr10963145wmf.112.1526912516436; Mon, 21 May 2018 07:21:56 -0700 (PDT) Received: from bender.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id m69-v6sm27213446wmd.47.2018.05.21.07.21.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 May 2018 07:21:55 -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: Mon, 21 May 2018 16:21:45 +0200 Message-Id: <1526912506-18406-5-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526912506-18406-1-git-send-email-narmstrong@baylibre.com> References: <1526912506-18406-1-git-send-email-narmstrong@baylibre.com> Subject: [Intel-gfx] [PATCH v4 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,