Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1972442imm; Thu, 24 May 2018 03:50:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr+iKZyEHwzo3stWwRL2glCXvLB6RjZjR3tVnekQagW/mmMXWxv8t71W16LhoOOOuhnO/Ix X-Received: by 2002:a65:5c4a:: with SMTP id v10-v6mr5563032pgr.247.1527159018828; Thu, 24 May 2018 03:50:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527159018; cv=none; d=google.com; s=arc-20160816; b=vunO1z1OXsW4W/J+dbaVn6iE+6+JbW4fQdfV/+kTB/aQvx9qa5uthi9312ZlRxpTiS +4AyF7sS2ujILEI/ZqHwAJlTCSigTo019Sgiz1rMfx2WXoNU2hSOCkFhxF2YSU4LiS+V W7HXxG5n2ATfR1Uu55vYKVuioZwKVbpSDFvVR4PZMMvUjJVO3UJ5dTuh/6NKMCUYSvL2 iBdHwPiP3Dxyv4fE1RMqnfkLwFT1J/DId2DWn12YoSocPdfF8WOBm0qFQ5BPATBOt0as OY4X1cJlP3+AwpjuE8fGGp+dvkBgwXnp50vf6tG0L+1x+6IlEp6q+AbQH4A2QwtRqIA6 GhWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=/A5fTAgfxN/Dpk8oBOhLCMiGfvqNaEcDFbcaIl0V0D4=; b=bPX6xlxibikDWGlf11bVq/E0WJN9CXOl0kTzs8kf+q2Kxq2cP2hP//Q9PMxemr6mBY pQ5qGJsJ5n9hMafW8WFrd7AFlZZyYr0g9z0koO0zAxxUFKjtnRdy2NzJ/sHZxz+88v6L mb1jUahmPDozgDRhlWsPo4kEuVOgJlN+1HkzaKuAyjQN2z+SSGYqfScJYndHNO1WHRtX UXAD8dke1SkAoxcLnyYkBfMFhVrGZQ17fI9gu98MF9pf3O7WbOy7trnaJ1zzYUhhW7wx 72UbBTTXsdd2pN+Kh2Nhv2qZUGvTNhHL1dDRbxNn6V1Z2w5AdP4f4jBOF7gRGTRUmgGx kYhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=fM96NAxR; 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-v6si20528032plx.591.2018.05.24.03.50.04; Thu, 24 May 2018 03:50:18 -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=fM96NAxR; 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 S1030493AbeEXJ5g (ORCPT + 99 others); Thu, 24 May 2018 05:57:36 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:50838 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030450AbeEXJ50 (ORCPT ); Thu, 24 May 2018 05:57:26 -0400 Received: by mail-wm0-f67.google.com with SMTP id t11-v6so3408810wmt.0 for ; Thu, 24 May 2018 02:57:25 -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; bh=/A5fTAgfxN/Dpk8oBOhLCMiGfvqNaEcDFbcaIl0V0D4=; b=fM96NAxRC+4rCSAGhIh17p7JThEYp1iZj0kg/BRjwkHu2fTjQH6l4vaKNMNOHksmGe +0mBVEEkc+OpFmOEwIbpS+d2DXy7GmHNAw/n1v/u5DHB9okzcgXcB0YZedaCroDMz2IU us77nwewewog35h+JE5YeJWDq0uIe/5FplbMPKI/eNe7PUSsWwERCL8/ExHxM+vSlWKF kML0cm4FNh6sLlQ8f9l9S/fiVM0zdVL5xE41g/x6lNzQMpTYXepiE6fsf08A4HWFOIjV 0/czSx0q/21W6bcGyzC61J8bw+4BiWlbI85mpAE0Izr6V8PSJtXjm4tCYgptn1NlDy0v vXAw== 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; bh=/A5fTAgfxN/Dpk8oBOhLCMiGfvqNaEcDFbcaIl0V0D4=; b=aVCyIdF3WvaN2K7jzeRa1PRcepwYfrKd+lHDCRbrdM8b6yD/sH1SrTpYDzwy1kTxOa J/OzYHijlGg0qPzGLAqQ/engpcfpV3d1xQ7kiJWPOkKGu0XwTAk0Cos5n/6r7sFcTIM7 31KIlzABVm0ajBjqb+GeHxbL4E33raKwzSLv89GeLfW1FKdF5UAhJ5o0iKbPUTvZ8qAT M129c25S11Oyn7p2JWTkXoDOwpSBA70n3drPWwEzj/oZKeS+P4IKkVOq47mPLHSVylgI Yp1huFhKCAzIJRYTVNXrgCU2k/biKncLAvAd4Goe/lHgaXo/IQQ7hwdleOt3Ouug3HMr F8vw== X-Gm-Message-State: ALKqPwcHJBIAIkwlC2gTENIpjJSHQn+6OuANZ5HflOzDHfw9ipgvrXZl K1Z5JizvCOsAGY+1g0eXMgLShA== X-Received: by 2002:a1c:8045:: with SMTP id b66-v6mr6204392wmd.108.1527155844572; Thu, 24 May 2018 02:57:24 -0700 (PDT) Received: from bender.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id b66-v6sm6868525wma.48.2018.05.24.02.57.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 May 2018 02:57:23 -0700 (PDT) From: Neil Armstrong To: airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.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, eballetbo@gmail.com Subject: [PATCH v6 0/6] Add ChromeOS EC CEC Support Date: Thu, 24 May 2018 11:57:15 +0200 Message-Id: <1527155841-28494-1-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All, The new Google "Fizz" Intel-based ChromeOS device is gaining CEC support through it's Embedded Controller, to enable the Linux CEC Core to communicate with it and get the CEC Physical Address from the correct HDMI Connector, the following must be added/changed: - Add the CEC sub-device registration in the ChromeOS EC MFD Driver - Add the CEC related commands and events definitions into the EC MFD driver - Add a way to get a CEC notifier with it's (optional) connector name - Add the CEC notifier to the i915 HDMI driver - Add the proper ChromeOS EC CEC Driver The CEC notifier with the connector name is the tricky point, since even on Device-Tree platforms, there is no way to distinguish between multiple HDMI connectors from the same DRM driver. The solution I implemented is pretty simple and only adds an optional connector name to eventually distinguish an HDMI connector notifier from another if they share the same device. Feel free to comment this patchset ! Changes since v5: - Small fixups on include/linux/mfd/cros_ec_commands.h - Fixed on cros-ec-cec driver accordingly - Added Reviewed-By tags Changes since v4: - Split patch 3 to move the mkbp event size change into a separate patch Changes since v3 (incorrectly reported as v2): - Renamed "Chrome OS" to "ChromeOS" - Updated cros_ec_commands.h new structs definitions to kernel doc format - Added Reviewed-By tags Changes since v2: - Add i915 port_identifier() and use this stable name as cec_notifier conn name - Fixed and cleaned up the CEC commands and events handling - Rebased the CEC sub-device registration on top of Enric's serie - Fixed comments typo on cec driver - Protected the DMI match only with PCI and DMI Kconfigs Changes since v1: - Added cec_notifier_put to intel_hdmi - Fixed all small reported issues on the EC CEC driver - Moved the cec_notifier_get out of the #if .. #else .. #endif Changes since RFC: - Moved CEC sub-device registration after CEC commands and events definitions patch - Removed get_notifier_get_byname - Added CEC_CORE select into i915 Kconfig - Removed CEC driver fallback if notifier is not configured on HW, added explicit warn - Fixed CEC core return type on error - Moved to cros-ec-cec media platform directory - Use bus_find_device() to find the pci i915 device instead of get_notifier_get_byname() - Fix Logical Address setup - Added comment about HW support - Removed memset of msg structures Neil Armstrong (6): media: cec-notifier: Get notifier by device and connector name drm/i915: hdmi: add CEC notifier to intel_hdmi mfd: cros-ec: Increase maximum mkbp event size mfd: cros-ec: Introduce CEC commands and events definitions. mfd: cros_ec_dev: Add CEC sub-device registration media: platform: Add ChromeOS EC CEC driver drivers/gpu/drm/i915/Kconfig | 1 + drivers/gpu/drm/i915/intel_display.h | 20 ++ drivers/gpu/drm/i915/intel_drv.h | 2 + drivers/gpu/drm/i915/intel_hdmi.c | 13 + drivers/media/cec/cec-notifier.c | 11 +- drivers/media/platform/Kconfig | 11 + drivers/media/platform/Makefile | 2 + drivers/media/platform/cros-ec-cec/Makefile | 1 + drivers/media/platform/cros-ec-cec/cros-ec-cec.c | 347 +++++++++++++++++++++++ drivers/mfd/cros_ec_dev.c | 16 ++ drivers/platform/chrome/cros_ec_proto.c | 40 ++- include/linux/mfd/cros_ec.h | 2 +- include/linux/mfd/cros_ec_commands.h | 100 +++++++ include/media/cec-notifier.h | 27 +- 14 files changed, 577 insertions(+), 16 deletions(-) create mode 100644 drivers/media/platform/cros-ec-cec/Makefile create mode 100644 drivers/media/platform/cros-ec-cec/cros-ec-cec.c -- 2.7.4