From patchwork Wed May 31 12:13:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 100741 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp291645qge; Wed, 31 May 2017 05:14:09 -0700 (PDT) X-Received: by 10.84.224.2 with SMTP id r2mr2403319plj.19.1496232849080; Wed, 31 May 2017 05:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496232849; cv=none; d=google.com; s=arc-20160816; b=lINHLwSGBg+NNCInKD+afuka0OVvnWBrDWiL4I4u0ip01oXDoPcUUMTJXNnV+6Uftc kd6xpimGaFz5ULjWJvUDZCCyg6PRCC83GnnxgnEkQTRM19iwZi6BwtCx9GoyzJQE/UuI WTD9Rhw03xPYmE4nt9KEkaqLaeq18AuELFTbXJKOnKkgsPYQ9sRq1kmkJGe/OkeWdFfn XOL/zw4jJojwYSUr/vrasg0jIBweAN50x+jfikZT/kjU6VNnYLU0fZvuy/pUkjPfw4jD EonxCBIw0NyQ+4DwXnOftnoK1iWK1ipPNVkoWOplErQ9xwowbyq5ZLK/Lcqr6DKAkVuN vPXQ== 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=awaHPB6sDfHgkF/OCzWF6CUAY/92K2rIaZKSdzC2fpw=; b=Iw0aEJwo9d8NlpbSmM0vazq8yNmod6jUUCaoUyl3ltruMtylsmPp11rSJdp8PvxtrS WlidCUsF4C36ER1EydqPSs9zKnNVT07OTTcU+gBDVjkv6Vrb3tnaCalBXkSAPLS4+FTb BfJ3yuxsPdXt1IWshtt9njswT1tW3NP2cP6tRaUtiQs7INXKl7ZB3SgG3nwVyeVWHzdw 3ENc+EAtSWwlIZDegIdu6zLFAjoXt6G6JMLYadX1HLIRW0BWVbTnPxc6n9vOWsG+1bM9 5L1JKOnhEZS38GDpFVybq2IV8tsHvAoz8KDxqEE0qJMJdUUYJ9jgeTnq3bl4ffrHB5vT GVig== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i126si16338401pfg.384.2017.05.31.05.14.08; Wed, 31 May 2017 05:14:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751071AbdEaMOH (ORCPT + 7 others); Wed, 31 May 2017 08:14:07 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:38505 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086AbdEaMOG (ORCPT ); Wed, 31 May 2017 08:14:06 -0400 Received: by mail-wm0-f48.google.com with SMTP id e127so17116140wmg.1 for ; Wed, 31 May 2017 05:14:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=5uxe8MDtBjqet91LCwpvWDw8gkvMU2g+SWNHlr1SxM4=; b=aTzRL1LK4RJUV/8yGC5nlHBV+qNTgMEbpt2U+KJj7qzyzcIJadJQhZqNvSwNriG8zg Iftr14tSkTRySfbV28fXUUWqr074l8/YK95RyJc1K8GNRtwoJUpetr/dNH64KHpu+Gnq ZUQmrVwDlEmaCfYqMkXKgxhYAs8oBxIaupsB4= 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=5uxe8MDtBjqet91LCwpvWDw8gkvMU2g+SWNHlr1SxM4=; b=aOANZvNrL0+hc+v7mbk9xkH4eKhwxIC89VN8t6vKKgO3FzXacdHFyzMK2JDOT3Fgo0 4UkH10wsFMbwHvfrjL/8+cZs+XGTsQw+joFeYbQBYyyK4kgQnqWAqzaJbjw7+pM3mgDY j4QpSPten3gi7Q141WWMRptUqYZduQAyw4xzsTYZgAVwR0MUSA4UF2u98Ubqq6A6mzjm AThmxLQ860YY7pwz/fjWZQoxt81JO/+rN2A5bmC6NSF3R/ltcKtXmloJnQeFjK76NA6V X+23nfJL460PHu14jeYE8dyJQunDzpJK2guLjieVuAgTG8gJLxmvmK/jh2Vnn2EsEJZ4 uNgA== X-Gm-Message-State: AODbwcDHudjLi+ZwU2yXxJ6l513iLgUw+Iz45OR/XRgeFmC5ERddAP46 aWSu9b/wSqINgem0rOLmqA== X-Received: by 10.223.139.152 with SMTP id o24mr12791699wra.20.1496232845062; Wed, 31 May 2017 05:14:05 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.231.254]) by smtp.gmail.com with ESMTPSA id z23sm2093823wrz.0.2017.05.31.05.14.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 05:14:04 -0700 (PDT) From: Benjamin Gaignard To: yannick.fertre@st.com, alexandre.torgue@st.com, hverkuil@xs4all.nl, devicetree@vger.kernel.org, linux-media@vger.kernel.org, robh@kernel.org, hans.verkuil@cisco.com Cc: Benjamin Gaignard Subject: [PATCH v6 0/2] cec: STM32 driver Date: Wed, 31 May 2017 14:13:54 +0200 Message-Id: <1496232836-18220-1-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org version 6: - fix duplicate constant in define - add monitor mode version 5: - remove cec notifier (to be added after drm driver release) version 4: - rebased on Hans cec-config branch - rework bindings commit message - add notifier support - update KConfig version 2: - fix typo in compagnie name - add yannick sign-off - use cec_message instead of custom struct in cec device - add monitor mode I don't change the split between irq handler and irq thread because it would had mean to handle all errors cases irq handler to keep a correct sequence. I don't think it is critical as it is since cec is a very slow protocol. This serie of patches add cec driver for STM32 platforms. This code doesn't implement cec notifier because STM32 doesn't provide HDMI yet but it will be added later. Those patches have been developped on top of media_tree master branch where STM32 DCMI code has not been merged so conflict in Kconfig and Makefile could occur depending of merge ordering. Compliance has been tested on STM32F769. ~ # cec-ctl -p 1.0.0.0 --playback Driver Info: Driver Name : stm32-cec Adapter Name : stm32-cec Capabilities : 0x0000000f Physical Address Logical Addresses Transmit Passthrough Driver version : 4.11.0 Available Logical Addresses: 1 Physical Address : 1.0.0.0 Logical Address Mask : 0x0010 CEC Version : 2.0 Vendor ID : 0x000c03 (HDMI) OSD Name : 'Playback' Logical Addresses : 1 (Allow RC Passthrough) Logical Address : 4 (Playback Device 1) Primary Device Type : Playback Logical Address Type : Playback All Device Types : Playback RC TV Profile : None Device Features : None ~ # cec-compliance -A cec-compliance SHA : 6acac5cec698de39b9398b66c4f5f4db6b2730d8 Driver Info: Driver Name : stm32-cec Adapter Name : stm32-cec Capabilities : 0x0000000f Physical Address Logical Addresses Transmit Passthrough Driver version : 4.11.0 Available Logical Addresses: 1 Physical Address : 1.0.0.0 Logical Address Mask : 0x0010 CEC Version : 2.0 Vendor ID : 0x000c03 Logical Addresses : 1 (Allow RC Passthrough) Logical Address : 4 Primary Device Type : Playback Logical Address Type : Playback All Device Types : Playback RC TV Profile : None Device Features : None Compliance test for device /dev/cec0: The test results mean the following: OK Supported correctly by the device. OK (Not Supported) Not supported and not mandatory for the device. OK (Presumed) Presumably supported. Manually check to confirm. OK (Unexpected) Supported correctly but is not expected to be supported for this device. OK (Refused) Supported by the device, but was refused. FAIL Failed and was expected to be supported by this device. Find remote devices: Polling: OK CEC API: CEC_ADAP_G_CAPS: OK CEC_DQEVENT: OK CEC_ADAP_G/S_PHYS_ADDR: OK CEC_ADAP_G/S_LOG_ADDRS: OK CEC_TRANSMIT: OK CEC_RECEIVE: OK CEC_TRANSMIT/RECEIVE (non-blocking): OK (Presumed) CEC_G/S_MODE: OK CEC_EVENT_LOST_MSGS: OK Network topology: System Information for device 0 (TV) from device 4 (Playback Device 1): CEC Version : 1.4 Physical Address : 0.0.0.0 Primary Device Type : TV Vendor ID : 0x00903e OSD Name : 'TV' Menu Language : fre Power Status : On Total: 10, Succeeded: 10, Failed: 0, Warnings: 0 Benjamin Gaignard (2): dt-bindings: media: stm32 cec driver cec: add STM32 cec driver .../devicetree/bindings/media/st,stm32-cec.txt | 19 ++ drivers/media/platform/Kconfig | 12 + drivers/media/platform/Makefile | 2 + drivers/media/platform/stm32/Makefile | 1 + drivers/media/platform/stm32/stm32-cec.c | 369 +++++++++++++++++++++ 5 files changed, 403 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/st,stm32-cec.txt create mode 100644 drivers/media/platform/stm32/Makefile create mode 100644 drivers/media/platform/stm32/stm32-cec.c -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html