From patchwork Tue May 15 12:47:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10401009 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 AE3D36024A for ; Tue, 15 May 2018 12:47:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A9AE287AC for ; Tue, 15 May 2018 12:47:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E49E287B5; Tue, 15 May 2018 12:47:34 +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 4C0E9287AC for ; Tue, 15 May 2018 12:47:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD3EC6E225; Tue, 15 May 2018 12:47:31 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 467E46E226 for ; Tue, 15 May 2018 12:47:30 +0000 (UTC) Received: by mail-qk0-x242.google.com with SMTP id a8-v6so1992175qkj.12 for ; Tue, 15 May 2018 05:47:30 -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=xizymeUQv2zFuDadw6RIkGdli2r9wJ31+bXoDEpPHZ0=; b=yI0z7hD81acOlHliaYaRuHsST6iVwtzldErtjkIZKgNMI5Ntl9SwrxoxUXUtn6edfK kxnms8OflnJejqPEv335ytvQRWAyeIm6ySDD1ewfAOb3Elp38KetFFwYh7ETXvtXecRf JfNc1xN5xlqWcJDWL6uY8gc9X6UrW8Rcni4XPmCKXbnUNWJsC3Hzx8bHwe7y1o/PyusJ uUM0pehayBJGH30NmGeFGt2+dFzKaaoasNeMV55VBNMeR+vOkQS9855WC00vwiQ4a1ah X46PVX7APhvfSFU9tT+tw1a96IkL68dbQHxJG5AJ3bDxMXd5drpF2jGMSyIq53Lj3sti JjJg== 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=xizymeUQv2zFuDadw6RIkGdli2r9wJ31+bXoDEpPHZ0=; b=Kr+wDfFLWk8yTO6MeOOUa1KdVu2fDQClNxyzsdxB0zOEwgP6/RQbOKrYFThogeH800 KXP/1z1kusnZyba/87Gl8n9f0I7FPRGCiOGyT325gSOsK5VfKRn3nZErQn/6dey7AbNf vsteeF7RXrszy9/DPsA2Xs86y7ZsaghXiCdPKkfTdCk3hcy9na9+v0m6f2RsAlp77Qnr 3ln1Uuh1dFnJ3GHuRpUHhlqdJc2cN9XBsavODCKfHJPnEumvORyMeHEIwqX47w1jjqGM 1JRTvXpNRiXxVWeUR0Qsg3KBI2rqQ9cCRIFC0fuYunWcEjGW6L0HdrOLYuG9xJ/GLFTq uaDA== X-Gm-Message-State: ALKqPwc4PBW4mIxvQmVb0WCFJUUvZh5Y2N54S88PsnPkjpF6wS92/Ol2 rtbn0tDXEjQjiV38wnmwu08rIQ== X-Google-Smtp-Source: AB8JxZpL2ESeRCHaodEW0vqxTmYbgUXNnVAoYcbTI2m1SFVM9ddDJoprDPoAmuy9INBOEo9CWRSAgg== X-Received: by 2002:a37:2b69:: with SMTP id r102-v6mr12644618qkh.26.1526388449297; Tue, 15 May 2018 05:47:29 -0700 (PDT) Received: from localhost.localdomain ([2620:0:1043:fd00:748b:2433:2688:e1f]) by smtp.gmail.com with ESMTPSA id d88-v6sm9725530qkj.25.2018.05.15.05.47.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 May 2018 05:47:28 -0700 (PDT) From: Neil Armstrong To: airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.com Date: Tue, 15 May 2018 14:47:00 +0200 Message-Id: <1526388421-18808-5-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526388421-18808-1-git-send-email-narmstrong@baylibre.com> References: <1526388421-18808-1-git-send-email-narmstrong@baylibre.com> Subject: [Intel-gfx] [PATCH 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 --- 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 eafd06f..57064ec 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -383,6 +383,18 @@ static void cros_ec_sensors_register(struct cros_ec_dev *ec) kfree(msg); } +static void cros_ec_cec_register(struct cros_ec_dev *ec) +{ + int ret; + struct mfd_cell cec_cell = { + .name = "cros-ec-cec", + }; + + ret = mfd_add_devices(ec->dev, 0, &cec_cell, 1, NULL, 0, NULL); + if (ret) + dev_err(ec->dev, "failed to add EC CEC\n"); +} + static int ec_device_probe(struct platform_device *pdev) { int retval = -ENOMEM; @@ -422,6 +434,10 @@ 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 handles CEC. */ + if (cros_ec_check_features(ec, EC_FEATURE_CEC)) + cros_ec_cec_register(ec); + /* Take control of the lightbar from the EC. */ lb_manual_suspend_ctrl(ec, 1);