From patchwork Thu Dec 29 22:27:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9491571 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 55A4662AB7 for ; Thu, 29 Dec 2016 22:31:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 426A120007 for ; Thu, 29 Dec 2016 22:31:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36CFA25D99; Thu, 29 Dec 2016 22:31:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08DC520007 for ; Thu, 29 Dec 2016 22:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753406AbcL2W2W (ORCPT ); Thu, 29 Dec 2016 17:28:22 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33543 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753278AbcL2W2R (ORCPT ); Thu, 29 Dec 2016 17:28:17 -0500 Received: by mail-pf0-f194.google.com with SMTP id 127so11203426pfg.0; Thu, 29 Dec 2016 14:28:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4oe8YmQg4bQkjxijNHjZQzBKbLASVNaVOGQWb/OLTQU=; b=d2gudmOJvMFJJGttycSz9sqlxRNAIlnl6w4/HC0DeyL7bCcsJDi4E9GeIbJIhkO19G vpMzO0bqtXKmMHIMBW4WyONKvSC6mZGR/ijOiudNiCFWpEpc2Z/WcxjmBuuikImq7DI2 hTvEqxRIH8ijpq3rixWuR/2hE+QR1D5CuWo15EDuSQ3klryTifxiGGXJ6BOsqg4fZeQh tk9qBz8fd8Pbqk004DIr+5dSP+tjL6lT9rlvHIgXEWnfsFJkJKduhftcih2wNVIAnl0z na4Xm5k1HhmxtZrydXcXUndwN3WXIgQIkcPCND22p8P/bLkoY+yVwRgIudhkOlWPv6nP JjYw== 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:in-reply-to :references; bh=4oe8YmQg4bQkjxijNHjZQzBKbLASVNaVOGQWb/OLTQU=; b=gqjzi6FttNKxtDEKbHgnWtYt3VBQIvktEBFfoN8LVoiAGZwjRSxnbjs69omth+06df vwppReD2Yu3os0eupm5TRKDyuA5dIh7ZyusR7sFeQUQnab2MsawiBJh3Zv7A1hp6Ys1J sRjcFcYx3wxr1S4HOHJRqdBAsLOr7ke+ms32WDOu6hkB4e9Zn+Rzlil//sYy7fC8B17v HkAxKRxDsERBpyS6NqhTlmLgYqYM/BlMfP2xh/MOIUSjnpxO3IbpgO4bLcesjJsXtUl9 3qYH4g3POSzXMKbnQg8qzkPSnWrmpwtIPDlbbRFjtqGDA0YXK9tank9N3XWjdRP3vahP EkEA== X-Gm-Message-State: AIkVDXKm1ZZmQLEUFSDW1PaA0YO3o7VO4/iqRLrGTRhYex9d/ShFM4ZlIi1CucYzePdgvw== X-Received: by 10.84.241.129 with SMTP id b1mr76529481pll.135.1483050496771; Thu, 29 Dec 2016 14:28:16 -0800 (PST) Received: from majic.sklembedded.com (c-73-241-2-21.hsd1.ca.comcast.net. [73.241.2.21]) by smtp.googlemail.com with ESMTPSA id u3sm107243068pfk.3.2016.12.29.14.28.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Dec 2016 14:28:15 -0800 (PST) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: shawnguo@kernel.org, kernel@pengutronix.de, fabio.estevam@nxp.com, robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk, linus.walleij@linaro.org, gnurou@gmail.com, mchehab@kernel.org, gregkh@linuxfoundation.org, p.zabel@pengutronix.de Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, Steve Longerbeam Subject: [PATCH 12/20] media: imx: Add CSI subdev driver Date: Thu, 29 Dec 2016 14:27:27 -0800 Message-Id: <1483050455-10683-13-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483050455-10683-1-git-send-email-steve_longerbeam@mentor.com> References: <1483050455-10683-1-git-send-email-steve_longerbeam@mentor.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is a media entity subdevice for the i.MX Camera Serial Interface module. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/Kconfig | 13 + drivers/staging/media/imx/Makefile | 2 + drivers/staging/media/imx/imx-csi.c | 638 ++++++++++++++++++++++++++++++++++++ 3 files changed, 653 insertions(+) create mode 100644 drivers/staging/media/imx/imx-csi.c diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index bfde58d..ce2d2c8 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -6,3 +6,16 @@ config VIDEO_IMX_MEDIA Say yes here to enable support for video4linux media controller driver for the i.MX5/6 SOC. +if VIDEO_IMX_MEDIA +menu "i.MX5/6 Media Sub devices" + +config VIDEO_IMX_CAMERA + tristate "i.MX5/6 Camera driver" + depends on VIDEO_IMX_MEDIA && VIDEO_DEV && I2C + select VIDEOBUF2_DMA_CONTIG + default y + ---help--- + A video4linux camera capture driver for i.MX5/6. + +endmenu +endif diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index ef9f11b..133672a 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -4,3 +4,5 @@ imx-media-objs := imx-media-dev.o imx-media-fim.o imx-media-internal-sd.o \ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o + diff --git a/drivers/staging/media/imx/imx-csi.c b/drivers/staging/media/imx/imx-csi.c new file mode 100644 index 0000000..975eafb --- /dev/null +++ b/drivers/staging/media/imx/imx-csi.c @@ -0,0 +1,638 @@ +/* + * V4L2 Capture CSI Subdev for Freescale i.MX5/6 SOC + * + * Copyright (c) 2014-2016 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include +#include +#include +#include