Commit 72ae8e28 authored by Guido Gunther's avatar Guido Gunther

media: Remove unused NXP vendor code

We remove the unused output/ folder and code for non i.MX8MQ SoCs to
make this easier to manage and formwardable to 4.18.
Signed-off-by: Guido Gunther's avatarGuido Günther <guido.gunther@puri.sm>
parent 20f8f2e2
......@@ -139,7 +139,6 @@ config VIDEO_MX8_CAPTURE
source "drivers/media/platform/imx8/Kconfig"
source "drivers/media/platform/mxc/capture/Kconfig"
source "drivers/media/platform/mxc/output/Kconfig"
source "drivers/media/platform/soc_camera/Kconfig"
source "drivers/media/platform/exynos4-is/Kconfig"
......
......@@ -96,9 +96,7 @@ ifeq ($(CONFIG_VIDEO_MXC_CAPTURE),y)
error "mxc capture defined $(CONFIG_VIDEO_MXC_CAPTURE)"
endif
#obj-$(CONFIG_VIDEO_MXC_CAPTURE) += mxc/capture/
obj-y += mxc/capture/
obj-$(CONFIG_VIDEO_MXC_OUTPUT) += mxc/output/
obj-$(CONFIG_VIDEO_MX8_CAPTURE) += mxc/capture/
obj-$(CONFIG_VIDEO_MX8_CAPTURE) += imx8/
obj-y += meson/
if VIDEO_MX8_CAPTURE
menu "IMX8 Camera ISI/MIPI Features support"
config IMX8_MEDIA_DEVICE
tristate "IMX8 Media Device Driver"
default y
config IMX8_CAPTURE_DRIVER
tristate "IMX8 Camera Controller"
depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
select V4L2_MEM2MEM_DEV
select VIDEOBUF2_DMA_CONTIG
default y
config IMX8_MIPI_CSI2
tristate "IMX8 MIPI CSI2 Controller"
select V4L2_FWNODE
default y
config IMX8_MIPI_CSI2_YAV
tristate "IMX8 MIPI CSI2 Controller Yet Another Version"
select V4L2_FWNODE
default y
config GMSL_MAX9286
tristate "Maxim max9286 GMSL Deserializer Input support"
select SENSOR_OV10635
depends on I2C
---help---
If you plan to use the max9286 GMSL Deserializer with your capture system, say Y here.
config IMX8_JPEG
tristate "IMX8 JPEG Encoder/Decoder"
depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
select V4L2_MEM2MEM_DEV
select VIDEOBUF2_DMA_CONTIG
default y
......
mxc-capture-objs := mxc-isi-core.o mxc-isi-cap.o mxc-isi-hw.o
obj-$(CONFIG_IMX8_CAPTURE_DRIVER) += mxc-capture.o
obj-$(CONFIG_IMX8_MIPI_CSI2) += mxc-mipi-csi2.o
obj-$(CONFIG_IMX8_MIPI_CSI2_YAV) += mxc-mipi-csi2_yav.o
max9286_gmsl-objs := max9286.o
obj-$(CONFIG_GMSL_MAX9286) += max9286_gmsl.o
obj-$(CONFIG_IMX8_MEDIA_DEVICE) += mxc-media-dev.o
obj-$(CONFIG_IMX8_JPEG) += mxc-jpeg-hw.o mxc-jpeg.o
This diff is collapsed.
/*
* Copyright 2017 NXP
*/
/*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later.
*/
#ifndef __MAX9286_H__
#define __MAX9286_H__
#define MIPI_CSI2_SENS_VC0_PAD_SOURCE 0
#define MIPI_CSI2_SENS_VC1_PAD_SOURCE 1
#define MIPI_CSI2_SENS_VC2_PAD_SOURCE 2
#define MIPI_CSI2_SENS_VC3_PAD_SOURCE 3
#define MIPI_CSI2_SENS_VCX_PADS_NUM 4
#define MAX_FPS 30
#define MIN_FPS 15
#define DEFAULT_FPS 30
/*!
* Maintains the information on the current state of the sesor.
*/
struct imxdpu_videomode {
char name[64]; /* may not be needed */
uint32_t pixelclock; /* Hz */
/* htotal (pixels) = hlen + hfp + hsync + hbp */
uint32_t hlen;
uint32_t hfp;
uint32_t hbp;
uint32_t hsync;
/* field0 - vtotal (lines) = vlen + vfp + vsync + vbp */
uint32_t vlen;
uint32_t vfp;
uint32_t vbp;
uint32_t vsync;
/* field1 */
uint32_t vlen1;
uint32_t vfp1;
uint32_t vbp1;
uint32_t vsync1;
uint32_t flags;
uint32_t format;
uint32_t dest_format; /*buffer format for capture*/
int16_t clip_top;
int16_t clip_left;
uint16_t clip_width;
uint16_t clip_height;
};
struct sensor_data {
struct v4l2_subdev subdev;
struct media_pad pads[MIPI_CSI2_SENS_VCX_PADS_NUM];
struct i2c_client *i2c_client;
struct v4l2_mbus_framefmt format;
struct v4l2_captureparm streamcap;
char running;
/* control settings */
int brightness;
int hue;
int contrast;
int saturation;
int red;
int green;
int blue;
int ae_mode;
u32 mclk;
u8 mclk_source;
struct clk *sensor_clk;
int v_channel;
bool is_mipi;
struct imxdpu_videomode cap_mode;
unsigned int sensor_num; /* sensor num connect max9271 */
unsigned char sensor_is_there; /* Bit 0~3 for 4 cameras, 0b1= is there; 0b0 = is not there */
int pwn_gpio;
};
#endif
This diff is collapsed.
/*
* Copyright 2017 NXP
*/
/*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/
#include "mxc-media-dev.h"
static irqreturn_t mxc_isi_irq_handler(int irq, void *priv)
{
struct mxc_isi_dev *mxc_isi = priv;
struct device *dev = &mxc_isi->pdev->dev;
u32 status;
spin_lock(&mxc_isi->slock);
status = mxc_isi_get_irq_status(mxc_isi);
mxc_isi_clean_irq_status(mxc_isi, status);
if (status & CHNL_STS_FRM_STRD_MASK)
mxc_isi_frame_write_done(mxc_isi);
if (status & (CHNL_STS_AXI_WR_ERR_Y_MASK |
CHNL_STS_AXI_WR_ERR_U_MASK |
CHNL_STS_AXI_WR_ERR_V_MASK))
dev_dbg(dev, "%s, IRQ AXI Error stat=0x%X\n", __func__, status);
if (status & (CHNL_STS_OFLW_PANIC_Y_BUF_MASK |
CHNL_STS_OFLW_PANIC_U_BUF_MASK |
CHNL_STS_OFLW_PANIC_V_BUF_MASK))
dev_dbg(dev, "%s, IRQ Panic OFLW Error stat=0x%X\n", __func__, status);
if (status & (CHNL_STS_OFLW_Y_BUF_MASK |
CHNL_STS_OFLW_U_BUF_MASK |
CHNL_STS_OFLW_V_BUF_MASK))
dev_dbg(dev, "%s, IRQ OFLW Error stat=0x%X\n", __func__, status);
if (status & (CHNL_STS_EXCS_OFLW_Y_BUF_MASK |
CHNL_STS_EXCS_OFLW_U_BUF_MASK |
CHNL_STS_EXCS_OFLW_V_BUF_MASK))
dev_dbg(dev, "%s, IRQ EXCS OFLW Error stat=0x%X\n", __func__, status);
spin_unlock(&mxc_isi->slock);
return IRQ_HANDLED;
}
/**
* mxc_isi_adjust_mplane_format - adjust bytesperline or sizeimage
*/
void mxc_isi_adjust_mplane_format(struct mxc_isi_fmt *fmt, u32 width, u32 height,
struct v4l2_pix_format_mplane *pix)
{
u32 bytesperline = 0;
int i;
pix->colorspace = V4L2_COLORSPACE_JPEG;
pix->field = V4L2_FIELD_NONE;
pix->num_planes = fmt->memplanes;
pix->pixelformat = fmt->fourcc;
pix->height = height;
pix->width = width;
for (i = 0; i < pix->num_planes; ++i) {
struct v4l2_plane_pix_format *plane_fmt = &pix->plane_fmt[i];
u32 bpl = plane_fmt->bytesperline;
if (fmt->colplanes > 1 && (bpl == 0 || bpl < pix->width))
bpl = pix->width; /* Planar */
if (fmt->colplanes == 1 && /* Packed */
(bpl == 0 || ((bpl * 8) / fmt->depth[i]) < pix->width))
bpl = (pix->width * fmt->depth[0]) / 8;
if (i == 0)
bytesperline = bpl;
else if (i == 1 && fmt->memplanes == 3)
bytesperline /= 2;
plane_fmt->bytesperline = bytesperline;
plane_fmt->sizeimage = max((pix->width * pix->height *
fmt->depth[i]) / 8, plane_fmt->sizeimage);
}
}
static int mxc_isi_parse_dt(struct mxc_isi_dev *mxc_isi)
{
struct device *dev = &mxc_isi->pdev->dev;
struct device_node *node = dev->of_node;
int ret = 0;
mxc_isi->id = of_alias_get_id(node, "isi");
ret = of_property_read_u32_array(node, "interface",
mxc_isi->interface, 3);
if (ret < 0)
return ret;
dev_dbg(dev, "%s, isi_%d,interface(%d, %d, %d)\n", __func__, mxc_isi->id,
mxc_isi->interface[0], mxc_isi->interface[1], mxc_isi->interface[2]);
return 0;
}
static int mxc_isi_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct mxc_isi_dev *mxc_isi;
struct resource *res;
int ret = 0;
mxc_isi = devm_kzalloc(dev, sizeof(*mxc_isi), GFP_KERNEL);
if (!mxc_isi)
return -ENOMEM;
mxc_isi->pdev = pdev;
ret = mxc_isi_parse_dt(mxc_isi);
if (ret < 0)
return ret;
if (mxc_isi->id >= MXC_ISI_MAX_DEVS || mxc_isi->id < 0) {
dev_err(dev, "Invalid driver data or device id (%d)\n",
mxc_isi->id);
return -EINVAL;
}
init_waitqueue_head(&mxc_isi->irq_queue);
spin_lock_init(&mxc_isi->slock);
mutex_init(&mxc_isi->lock);
mxc_isi->clk = devm_clk_get(dev, NULL);
if (IS_ERR(mxc_isi->clk)) {
dev_err(dev, "failed to get isi clk\n");
return PTR_ERR(mxc_isi->clk);
}
ret = clk_prepare(mxc_isi->clk);
if (ret < 0) {
dev_err(dev, "%s, prepare clk error\n", __func__);
return -EINVAL;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
mxc_isi->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(mxc_isi->regs)) {
dev_err(dev, "Failed to get ISI register map\n");
return PTR_ERR(mxc_isi->regs);
}
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL) {
dev_err(dev, "Failed to get IRQ resource\n");
return -ENXIO;
}
ret = devm_request_irq(dev, res->start, mxc_isi_irq_handler,
0, dev_name(dev), mxc_isi);
if (ret < 0) {
dev_err(dev, "failed to install irq (%d)\n", ret);
return -EINVAL;
}
ret = mxc_isi_initialize_capture_subdev(mxc_isi);
if (ret < 0) {
dev_err(dev, "failed to init cap subdev (%d)\n", ret);
return -EINVAL;
}
platform_set_drvdata(pdev, mxc_isi);
ret = clk_enable(mxc_isi->clk);
if (ret < 0) {
dev_err(dev, "%s, enable clk error\n", __func__);
goto err_sclk;
}
mxc_isi->flags = MXC_ISI_PM_POWERED;
pm_runtime_set_active(dev);
pm_runtime_enable(dev);
pm_runtime_get_sync(dev);
pm_runtime_put_sync(dev);
dev_dbg(dev, "mxc_isi.%d registered successfully\n", mxc_isi->id);
return 0;
err_sclk:
mxc_isi_unregister_capture_subdev(mxc_isi);
return ret;
}
static int mxc_isi_remove(struct platform_device *pdev)
{
struct mxc_isi_dev *mxc_isi = platform_get_drvdata(pdev);
struct device *dev = &pdev->dev;
mxc_isi_unregister_capture_subdev(mxc_isi);
clk_disable_unprepare(mxc_isi->clk);
pm_runtime_disable(dev);
return 0;
}
#ifdef CONFIG_PM_SLEEP
static int mxc_isi_pm_suspend(struct device *dev)
{
struct mxc_isi_dev *mxc_isi = dev_get_drvdata(dev);
if ((mxc_isi->flags & MXC_ISI_PM_SUSPENDED) ||
(mxc_isi->flags & MXC_ISI_RUNTIME_SUSPEND))
return 0;
clk_disable_unprepare(mxc_isi->clk);
mxc_isi->flags |= MXC_ISI_PM_SUSPENDED;
mxc_isi->flags &= ~MXC_ISI_PM_POWERED;
return 0;
}
static int mxc_isi_pm_resume(struct device *dev)
{
struct mxc_isi_dev *mxc_isi = dev_get_drvdata(dev);
int ret;
if (mxc_isi->flags & MXC_ISI_PM_POWERED)
return 0;
mxc_isi->flags |= MXC_ISI_PM_POWERED;
mxc_isi->flags &= ~MXC_ISI_PM_SUSPENDED;
ret = clk_prepare_enable(mxc_isi->clk);
return (ret) ? -EAGAIN : 0;
}
#endif
static int mxc_isi_runtime_suspend(struct device *dev)
{
struct mxc_isi_dev *mxc_isi = dev_get_drvdata(dev);
if (mxc_isi->flags & MXC_ISI_RUNTIME_SUSPEND)
return 0;
if (mxc_isi->flags & MXC_ISI_PM_POWERED) {
clk_disable_unprepare(mxc_isi->clk);
mxc_isi->flags |= MXC_ISI_RUNTIME_SUSPEND;
mxc_isi->flags &= ~MXC_ISI_PM_POWERED;
}
return 0;
}
static int mxc_isi_runtime_resume(struct device *dev)
{
struct mxc_isi_dev *mxc_isi = dev_get_drvdata(dev);
if (mxc_isi->flags & MXC_ISI_PM_POWERED)
return 0;
if (mxc_isi->flags & MXC_ISI_RUNTIME_SUSPEND) {
clk_prepare_enable(mxc_isi->clk);
mxc_isi->flags |= MXC_ISI_PM_POWERED;
mxc_isi->flags &= ~MXC_ISI_RUNTIME_SUSPEND;
}
return 0;
}
static const struct dev_pm_ops mxc_isi_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(mxc_isi_pm_suspend, mxc_isi_pm_resume)
SET_RUNTIME_PM_OPS(mxc_isi_runtime_suspend, mxc_isi_runtime_resume, NULL)
};
static const struct of_device_id mxc_isi_of_match[] = {
{.compatible = "fsl,imx8-isi",},
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, mxc_isi_of_match);
static struct platform_driver mxc_isi_driver = {
.probe = mxc_isi_probe,
.remove = mxc_isi_remove,
.driver = {
.of_match_table = mxc_isi_of_match,
.name = MXC_ISI_DRIVER_NAME,
.pm = &mxc_isi_pm_ops,
}
};
module_platform_driver(mxc_isi_driver);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
ifeq ($(CONFIG_VIDEO_MXC_IPU_CAMERA),y)
obj-$(CONFIG_VIDEO_MXC_CAPTURE) += mxc_v4l2_capture.o
obj-$(CONFIG_MXC_IPU_PRP_VF_SDC) += ipu_prp_vf_sdc.o ipu_prp_vf_sdc_bg.o
obj-$(CONFIG_MXC_IPU_DEVICE_QUEUE_SDC) += ipu_fg_overlay_sdc.o ipu_bg_overlay_sdc.o
obj-$(CONFIG_MXC_IPU_PRP_ENC) += ipu_prp_enc.o ipu_still.o
obj-$(CONFIG_MXC_IPU_CSI_ENC) += ipu_csi_enc.o ipu_still.o
endif
obj-$(CONFIG_VIDEO_MXC_CSI_CAMERA) += mx6s_capture.o
obj-$(CONFIG_MXC_VADC) += mxc_vadc.o
obj-$(CONFIG_MXC_MIPI_CSI) += mxc_mipi_csi.o
# Used for iMX 6QDL
ov5640_camera_int-objs := ov5640.o
obj-$(CONFIG_MXC_CAMERA_OV5640) += ov5640_camera_int.o
# Used for iMX 6UL/ULL/SX/SL/SLL
ov5640_camera_v2-objs := ov5640_v2.o
obj-$(CONFIG_MXC_CAMERA_OV5640_V2) += ov5640_camera_v2.o
ov5642_camera-objs := ov5642.o
obj-$(CONFIG_MXC_CAMERA_OV5642) += ov5642_camera.o
# Used for iMX 6QDL/DQSCM
ov5640_camera_mipi_int-objs := ov5640_mipi.o
obj-$(CONFIG_MXC_CAMERA_OV5640_MIPI) += ov5640_camera_mipi_int.o
# Used for iMX 7D
ov5640_camera_mipi_v2-objs := ov5640_mipi_v2.o
obj-$(CONFIG_MXC_CAMERA_OV5640_MIPI_V2) += ov5640_camera_mipi_v2.o
ov5647_camera_mipi-objs := ov5647_mipi.o
obj-$(CONFIG_MXC_CAMERA_OV5647_MIPI) += ov5647_camera_mipi.o
adv7180_tvin-objs := adv7180.o
obj-$(CONFIG_MXC_TVIN_ADV7180) += adv7180_tvin.o
obj-$(CONFIG_VIDEO_V4L2_MXC_INT_DEVICE) += v4l2-int-device.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
obj-$(CONFIG_VIDEO_MXC_IPU_OUTPUT) += mxc_vout.o
obj-$(CONFIG_VIDEO_MXC_PXP_V4L2) += mxc_pxp_v4l2.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment