From patchwork Sun Aug 11 06:02:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 2842680 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6DC3EBF546 for ; Sun, 11 Aug 2013 06:03:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97A002018A for ; Sun, 11 Aug 2013 06:03:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A7B9D20189 for ; Sun, 11 Aug 2013 06:03:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751666Ab3HKGC6 (ORCPT ); Sun, 11 Aug 2013 02:02:58 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:48602 "EHLO mail-pb0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396Ab3HKGC5 (ORCPT ); Sun, 11 Aug 2013 02:02:57 -0400 Received: by mail-pb0-f41.google.com with SMTP id rp2so5817367pbb.14 for ; Sat, 10 Aug 2013 23:02:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=RIhEDxWcXNheCf8EJPWdbC5qkyFWBCNAsklOxNOTo0g=; b=sKfk2Zoty8T43y3TQR5moM28blaGd/1PLT1uT/Lca4bHyOb64zmvEXK3XcB16QHLxd kw1NmSjb8OfGPSAfMfJ3139Xni2wuu68nxycIvli4pbAQLXUchLX9GaBOJvqiSdJBdyb EWOVuE2u4MYZkx/uX7QQo1/SiJa6qkmTgW6AF8HZS7+5wUG1xg0teG+jR5n+NfaEYAIF UGvIpdoAQlbH2KXnD2fSfFbICO5vUJmdZ5d/wsXzF0JLtmd+MZuzPkqHzBAFF3zSUzNR S/ICYDWmKdpPT/ZrRZPagG3IcaMrEFomnJ13Vb3o7ONI9ia25EQTxew1+q3vc6+xrpxD wgYQ== X-Received: by 10.68.239.42 with SMTP id vp10mr18468770pbc.164.1376200975637; Sat, 10 Aug 2013 23:02:55 -0700 (PDT) Received: from localhost.localdomain ([112.79.41.37]) by mx.google.com with ESMTPSA id ot4sm32109681pac.17.2013.08.10.23.02.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 10 Aug 2013 23:02:54 -0700 (PDT) From: "Lad, Prabhakar" To: LMML , Hans Verkuil Cc: DLOS , LKML , Mauro Carvalho Chehab , devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org, "Lad, Prabhakar" Subject: [PATCH] media: OF: add "sync-on-green-active" property Date: Sun, 11 Aug 2013 11:32:24 +0530 Message-Id: <1376200944-20478-1-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Lad, Prabhakar" This patch adds 'sync-on-green-active' property as part of endpoint property. Signed-off-by: Lad, Prabhakar Acked-by: Sylwester Nawrocki --- Changes for non RFC: 1: Fixed review comments pointed by Hans. 2: Added Ack from Sylwester. Changes for v5: 1: Changed description for sync-on-green-active property in documentation file as suggested by Sylwester. Changes for v4: 1: Fixed review comments pointed by Sylwester. Changes for v3: 1: Fixed review comments pointed by Laurent and Sylwester. RFC v2 https://patchwork.kernel.org/patch/2578091/ RFC V1 https://patchwork.kernel.org/patch/2572341/ .../devicetree/bindings/media/video-interfaces.txt | 2 ++ drivers/media/v4l2-core/v4l2-of.c | 4 ++++ include/media/v4l2-mediabus.h | 3 +++ 3 files changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt index e022d2d..ce719f8 100644 --- a/Documentation/devicetree/bindings/media/video-interfaces.txt +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt @@ -88,6 +88,8 @@ Optional endpoint properties - field-even-active: field signal level during the even field data transmission. - pclk-sample: sample data on rising (1) or falling (0) edge of the pixel clock signal. +- sync-on-green-active: active state of Sync-on-green (SoG) signal, 0/1 for + LOW/HIGH respectively. - data-lanes: an array of physical data lane indexes. Position of an entry determines the logical lane number, while the value of an entry indicates physical lane, e.g. for 2-lane MIPI CSI-2 bus we could have diff --git a/drivers/media/v4l2-core/v4l2-of.c b/drivers/media/v4l2-core/v4l2-of.c index aa59639..5c4c9f0 100644 --- a/drivers/media/v4l2-core/v4l2-of.c +++ b/drivers/media/v4l2-core/v4l2-of.c @@ -100,6 +100,10 @@ static void v4l2_of_parse_parallel_bus(const struct device_node *node, if (!of_property_read_u32(node, "data-shift", &v)) bus->data_shift = v; + if (!of_property_read_u32(node, "sync-on-green-active", &v)) + flags |= v ? V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH : + V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW; + bus->flags = flags; } diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 83ae07e..395c4a9 100644 --- a/include/media/v4l2-mediabus.h +++ b/include/media/v4l2-mediabus.h @@ -40,6 +40,9 @@ #define V4L2_MBUS_FIELD_EVEN_HIGH (1 << 10) /* FIELD = 1/0 - Field1 (odd)/Field2 (even) */ #define V4L2_MBUS_FIELD_EVEN_LOW (1 << 11) +/* Active state of Sync-on-green (SoG) signal, 0/1 for LOW/HIGH respectively. */ +#define V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH (1 << 12) +#define V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW (1 << 13) /* Serial flags */ /* How many lanes the client can use */