Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp553369imm; Tue, 15 May 2018 05:50:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoEXKic2/4vLL5XgUoF0kVxB5tR5CT8QDV/3fn/z4fwcMztMvTthx1n+NXFqUoY6FyF0k35 X-Received: by 2002:a17:902:968d:: with SMTP id n13-v6mr13930626plp.168.1526388656244; Tue, 15 May 2018 05:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526388656; cv=none; d=google.com; s=arc-20160816; b=B6JtAjV4+I8GBL5Ou/QYzqZ5Lvua/s2gsW2kOj+mjP3J0qXdOeaJANxwEQiZ5KzAnP 7oFlxY6YdV1Z62sFuqt2yWE1fv1bZb64113FeSFoJQ8iGiyY1hiLN9fF29Mg2dWWlrnd +KDqk925AfJ0mMgBDqfX34NBwPidTdrYAnjKGksT6imsp7lvcTl5UgkIcEbMr17k46w9 M2iOWklrYRZi2v3pzR1PzZ3OAYKuumKDO18uTRfK/adAuQ68Ift5DbgCX7WdLOq5sM/g OqQH2SMz1rJI2SV/AakorpuD6+QpelpV4F+miyiaomsVjl6xH0FSHiUCHegd9ca/r8El nmdg== 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=40h69Ym1hKsaIscCGxBBh4L7/P2RkBJylYVpojHKJbo=; b=rI22jmYA5Vo/QttzPHxDv8nkGnYV9TpDbLS8r2swCGhndUzZGQgfNJt6Y1WM6cgu35 XKgxD75lOE2xigOwZ3rPGAdOqiTE6xKk77oe7saSKz+kUXfWc2YKFcdz3m1h3Z4E3MnA 4RN0Nry33m8ozeKumWdjt3PPcz77NPir3Z2YfS3iADQjwAJxVHcgwPLkJqvAyD+nX16d BBoIdRtu9I0TWMTdLAyAG8fUNubaZMjXLJgb4MR7RXZ+VMOnBXBqU2Bl1nSTITuLIDd8 DWddC/U5cznrDqYsBzdMoaLuHUB9HCeSEQkZgeDGL9VXrlVkhkWG5tbQfFuQaAmRn1or PW5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=IjzuOFyI; 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 x128-v6si11813579pfb.237.2018.05.15.05.50.34; Tue, 15 May 2018 05:50:56 -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=IjzuOFyI; 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 S1752903AbeEOMrQ (ORCPT + 99 others); Tue, 15 May 2018 08:47:16 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:45123 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752170AbeEOMrO (ORCPT ); Tue, 15 May 2018 08:47:14 -0400 Received: by mail-qk0-f196.google.com with SMTP id a8-v6so1991530qkj.12 for ; Tue, 15 May 2018 05:47:14 -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=40h69Ym1hKsaIscCGxBBh4L7/P2RkBJylYVpojHKJbo=; b=IjzuOFyI0tDFfswGWmIFkV5iOJ1QpFNdDhJNRxW98UFzWcDtVH1qZZw4KF/Gdgx1Wd FRLyY1yktHyqTRDBgAkFlm/fA9KIv2xV3YExag6ACtzQUQ6mZYeuYM4t1C2oDzkZBuKh njZgr+I/UqkTXGLQhj15U172l3Sv7ByiOAMMxICyZrWwBGA84qNIRqX4QIKlzDZeqwgt 5fN79Tmk+qFBNnv8bP38kU6cCNJgfbA+MNVs3pEIaPhCIKv4D/n60pLdYszxIagx3reM NMEEZevYwvESctHDd7AfPaFyCr+CTqoLHZHLNrGu5bwr1qe6dPETcyq2dVky6vgIZGFg 541Q== 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=40h69Ym1hKsaIscCGxBBh4L7/P2RkBJylYVpojHKJbo=; b=C4g1gap9vFo+Qm94i/HwjbV72hyug07p1LtqcXFWZMDPhqSaySF+pXPyxGV2ZT2x1B iVIsBhUhXqSzhe9vaZ2bYPNbV0cirMH3Pv7StNIyy6qAAdndEcl0v9Z2rWS3oEOKSRDJ iadoguyRoFfEjfhpjdcE6oR/taKF0h27zOzW2+TT6aquj0aE0ww5/fozuoA5d+qUYTXQ DBZZTH60kbbgac6oMBIyLe7B7L5b2jSl+KBXomu3YFewlv0KB5jj7UM5osXdYxq7dRjH isJL2WA3WwONU0kG2RQHKvZwTEkNNnzillDGDGLvgtCDCn6xd3pJcJqu8WC10yg/lnt8 8yCg== X-Gm-Message-State: ALKqPwezDB+QzCg2icOiuUhgocgtViBJ5WIPkdV41de/PgzP7mWH5vyZ IrTSMO9nsDUob32EcntENeY6qQ== X-Received: by 2002:a37:1a59:: with SMTP id a86-v6mr12617779qka.426.1526388433862; Tue, 15 May 2018 05:47:13 -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.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 May 2018 05:47:13 -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 Subject: [PATCH 0/5] Add ChromeOS EC CEC Support Date: Tue, 15 May 2018 14:46:56 +0200 Message-Id: <1526388421-18808-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 throught 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 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 (5): media: cec-notifier: Get notifier by device and connector name drm/i915: hdmi: add CEC notifier to intel_hdmi mfd: cros-ec: Introduce CEC commands and events definitions. mfd: cros_ec_dev: Add CEC sub-device registration media: platform: Add Chrome OS EC CEC driver drivers/gpu/drm/i915/Kconfig | 1 + drivers/gpu/drm/i915/intel_drv.h | 2 + drivers/gpu/drm/i915/intel_hdmi.c | 10 + drivers/media/cec/cec-notifier.c | 12 +- 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 | 336 +++++++++++++++++++++++ drivers/mfd/cros_ec_dev.c | 16 ++ drivers/platform/chrome/cros_ec_proto.c | 42 ++- include/linux/mfd/cros_ec.h | 2 +- include/linux/mfd/cros_ec_commands.h | 80 ++++++ include/media/cec-notifier.h | 30 +- 13 files changed, 530 insertions(+), 15 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