From patchwork Tue May 16 12:56:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 99868 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp2005719qge; Tue, 16 May 2017 05:57:23 -0700 (PDT) X-Received: by 10.99.122.21 with SMTP id v21mr11955063pgc.98.1494939443454; Tue, 16 May 2017 05:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494939443; cv=none; d=google.com; s=arc-20160816; b=nugEDWdqIk6s/Q3FNO99cStMb6wJ3TloJRloy365yRRbuf/hsKgyXJwOZ/vxJcQns3 uUCD9bU0Sa7bjfomDpbWCZCFeaIBdOErSp5TOjb6S143A66kRLHK2llJTqlEsUv0z7C0 cLg7QDa2wmIvBRqmxwRLfO9LNFPE7hgoRqDkC+11NrncRF33GYnTmAjoB5qZV8p6v8ri ONdvyOEiC5VyXMoOqlyhVnyILFEJwBRWMfBxlClgY6OjTO06Bcx5FpMIFhAqY0PI7okb PLT5HRbxxBPlHkrauk5BUGBdusq+cqJkuy3iLleQ1kuRloaxM46qntsmDgoZIlONz0DU 8ZCg== 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=MNQcCM9/HY3wQ71rkJiXm3G9mEKdw3HXqghUm4M8BEk=; b=VCGOdy6LyPluIkvdhLEYnY5PK8oucM8r0rrs0OtEdICf1twTGLvjgSi2Tcj8mZRF+k cWvTahvFUMdPnAuH3TDTKR6mvkiqak06g4smFgTrE1nDrANb21pC+7FfPAyQqQn8yzX+ Bn1wKIL0bEVeMzYmFcHsRvs2SyUxI5CynFZlHvlgUQMYczjbL4oezq3oV2smTYGrAr1+ SrZFfVjFWFsOG8qsenaMnROz+9UQ+8pV1qN2jCSoKAirbaW0hPVhmAFfHbWPUCJgelZ9 75j2rQj4oSH9iNIADIu+HlDK2cOkTnNh6j1EDRcpeLN56uVWi0sV3CvQnAhB/LZM8nR0 1lUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (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 i9si13773909pgn.205.2017.05.16.05.57.23; Tue, 16 May 2017 05:57:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-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=@linaro.org; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752064AbdEPM5W (ORCPT + 4 others); Tue, 16 May 2017 08:57:22 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:37519 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219AbdEPM5V (ORCPT ); Tue, 16 May 2017 08:57:21 -0400 Received: by mail-wm0-f54.google.com with SMTP id d127so119419741wmf.0 for ; Tue, 16 May 2017 05:57:20 -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=MNQcCM9/HY3wQ71rkJiXm3G9mEKdw3HXqghUm4M8BEk=; b=HKfXdedD/FGMjtbacGzn7awRlTZx96mmict4HEF87hu4ylqgIY7hIZ4OIfUtiEPx2d mTKtvb5TeCtRhdbK7+VQHgIDeEfQqO4I3gaLaUffywV1/VC0RIN3wgSxnK64QW0g4ZoK uPDh4nyvzpMMhTmNEnyzogzUs3lcfeLUi4pZI= 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=MNQcCM9/HY3wQ71rkJiXm3G9mEKdw3HXqghUm4M8BEk=; b=L1Y414Otx0IZ2X0heMNU3Q1J/KLvcOCYcGSde+kGYlT95nNw9IFzJnYjvMw7zlBnpf USdjrTm5vccNPxCjTnMebeHZDZu9l/UuTO1A2o5Pm7t/gw0PD9YNVAsqQkohnOfbbCyY 6GvoRLNoOMhP1ls1Ah0hC67c4iga5oxpkD1QTQSeYUVwFDkoT21zLgPw36pOHQiprdd8 /4GBfAIQ5MnEZPqxk4DY8hW/EVtGWDNQuVgeD9UiCY9qVzYoFwQg0QzkBjk8G/FHpj4F BLz2+PCQ8a8AVheJyUvWQ0H/v5RwL0ZHalKoKfRIt05mNSxZIkirVA8s6C1cANl+khth Cf6g== X-Gm-Message-State: AODbwcCI6y+g77wFMNrwe7NPO8XcOr+Js/DUiqUbLBci+r5peYdhymbs wmsQYLnuxv5clbh9 X-Received: by 10.28.16.212 with SMTP id 203mr6418528wmq.26.1494939439418; Tue, 16 May 2017 05:57:19 -0700 (PDT) Received: from lmenx321.st.com. ([80.214.124.106]) by smtp.gmail.com with ESMTPSA id w96sm2288567wrc.14.2017.05.16.05.57.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 May 2017 05:57:18 -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 v2 0/2] cec: STM32 driver Date: Tue, 16 May 2017 14:56:21 +0200 Message-Id: <1494939383-18937-1-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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): binding for stm32 cec driver cec: add STM32 cec driver .../devicetree/bindings/media/st,stm32-cec.txt | 19 + drivers/media/platform/Kconfig | 11 + drivers/media/platform/Makefile | 2 + drivers/media/platform/stm32/Makefile | 1 + drivers/media/platform/stm32/stm32-cec.c | 384 +++++++++++++++++++++ 5 files changed, 417 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