From patchwork Wed Apr 17 15:17:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Moll X-Patchwork-Id: 2459761 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 6DD46DF2E5 for ; Thu, 18 Apr 2013 11:18:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7CB22E63B3 for ; Thu, 18 Apr 2013 04:18:26 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from service88.mimecast.com (service88.mimecast.com [195.130.217.12]) by gabe.freedesktop.org (Postfix) with ESMTP id 73FB2E66E7 for ; Wed, 17 Apr 2013 08:25:43 -0700 (PDT) Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 17 Apr 2013 16:18:19 +0100 Received: from hornet.Cambridge.Arm.com ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 17 Apr 2013 16:17:39 +0100 From: Pawel Moll To: linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: [RFC 08/10] video: Versatile Express MUXFPGA driver Date: Wed, 17 Apr 2013 16:17:20 +0100 Message-Id: <1366211842-21497-9-git-send-email-pawel.moll@arm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1366211842-21497-1-git-send-email-pawel.moll@arm.com> References: <1366211842-21497-1-git-send-email-pawel.moll@arm.com> X-OriginalArrivalTime: 17 Apr 2013 15:17:39.0373 (UTC) FILETIME=[B2E715D0:01CE3B7E] X-MC-Unique: 113041716181920301 X-Mailman-Approved-At: Thu, 18 Apr 2013 04:09:27 -0700 Cc: Russell King - ARM Linux , Laurent Pinchart , Pawel Moll X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Versatile Express' DVI video output can be connected to one the three sources - motherboard's CLCD controller or a video signal generated by one of the daughterboards. This driver provides a Common Display Framework driver for the muxer FPGA, which acts as a switch selecting one of the video data sources. The default source is selected basing on the priority list (which itself can be modified via module paramter), but the user can make his own decision about it using the device's sysfs "source" attribute. Signed-off-by: Pawel Moll --- .../testing/sysfs-driver-video-vexpress-muxfpga | 5 + drivers/video/Makefile | 3 + drivers/video/vexpress-muxfpga.c | 228 ++++++++++++++++++++ 3 files changed, 236 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-video-vexpress-muxfpga create mode 100644 drivers/video/vexpress-muxfpga.c diff --git a/Documentation/ABI/testing/sysfs-driver-video-vexpress-muxfpga b/Documentation/ABI/testing/sysfs-driver-video-vexpress-muxfpga new file mode 100644 index 0000000..bfd568d --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-video-vexpress-muxfpga @@ -0,0 +1,5 @@ +What: /sys/bus/platform/drivers/vexpress-muxfpga//source +Date: April 2013 +Contant: Pawel Moll +Description: This file stores the id of the video signal source + supposed to be routed to the board's DVI output. diff --git a/drivers/video/Makefile b/drivers/video/Makefile index b989e8e..84c6083 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -176,3 +176,6 @@ obj-$(CONFIG_DISPLAY_TIMING) += display_timing.o obj-$(CONFIG_OF_DISPLAY_TIMING) += of_display_timing.o obj-$(CONFIG_VIDEOMODE) += videomode.o obj-$(CONFIG_OF_VIDEOMODE) += of_videomode.o + +# platform specific output drivers +obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress-muxfpga.o diff --git a/drivers/video/vexpress-muxfpga.c b/drivers/video/vexpress-muxfpga.c new file mode 100644 index 0000000..1731ad0 --- /dev/null +++ b/drivers/video/vexpress-muxfpga.c @@ -0,0 +1,228 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Copyright (C) 2013 ARM Limited + */ + +#define pr_fmt(fmt) "vexpress-muxfpga: " fmt + +#include +#include +#include +#include +#include