Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271779
b: refs/heads/master
c: d395322
h: refs/heads/master
i:
  271777: 45e5b7b
  271775: 10e17de
v: v3
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Sep 6, 2011
1 parent b41452b commit 38cd5a1
Show file tree
Hide file tree
Showing 8 changed files with 984 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 30c9939d79d6edf64092148842835893d156b672
refs/heads/master: d3953223b0905437fef7ce60506b5fdfaf98dda6
5 changes: 3 additions & 2 deletions trunk/drivers/media/video/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -949,8 +949,9 @@ config VIDEO_MX2
Interface

config VIDEO_SAMSUNG_S5P_FIMC
tristate "Samsung S5P and EXYNOS4 camera host interface driver"
depends on VIDEO_V4L2 && PLAT_S5P && PM_RUNTIME
tristate "Samsung S5P and EXYNOS4 camera interface driver (EXPERIMENTAL)"
depends on VIDEO_V4L2 && I2C && PLAT_S5P && PM_RUNTIME && \
VIDEO_V4L2_SUBDEV_API && EXPERIMENTAL
select VIDEOBUF2_DMA_CONTIG
select V4L2_MEM2MEM_DEV
---help---
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/s5p-fimc/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
s5p-fimc-objs := fimc-core.o fimc-reg.o fimc-capture.o
s5p-fimc-objs := fimc-core.o fimc-reg.o fimc-capture.o fimc-mdevice.o
s5p-csis-objs := mipi-csis.o

obj-$(CONFIG_VIDEO_S5P_MIPI_CSIS) += s5p-csis.o
Expand Down
33 changes: 15 additions & 18 deletions trunk/drivers/media/video/s5p-fimc/fimc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <media/videobuf2-dma-contig.h>

#include "fimc-core.h"
#include "fimc-mdevice.h"

static char *fimc_clocks[MAX_FIMC_CLOCKS] = {
"sclk_fimc", "fimc"
Expand Down Expand Up @@ -1867,6 +1868,7 @@ static struct fimc_pix_limit s5p_pix_limit[4] = {
static struct samsung_fimc_variant fimc0_variant_s5p = {
.has_inp_rot = 1,
.has_out_rot = 1,
.has_cam_if = 1,
.min_inp_pixsize = 16,
.min_out_pixsize = 16,
.hor_offs_align = 8,
Expand All @@ -1875,6 +1877,7 @@ static struct samsung_fimc_variant fimc0_variant_s5p = {
};

static struct samsung_fimc_variant fimc2_variant_s5p = {
.has_cam_if = 1,
.min_inp_pixsize = 16,
.min_out_pixsize = 16,
.hor_offs_align = 8,
Expand All @@ -1886,6 +1889,7 @@ static struct samsung_fimc_variant fimc0_variant_s5pv210 = {
.pix_hoff = 1,
.has_inp_rot = 1,
.has_out_rot = 1,
.has_cam_if = 1,
.min_inp_pixsize = 16,
.min_out_pixsize = 16,
.hor_offs_align = 8,
Expand All @@ -1897,6 +1901,7 @@ static struct samsung_fimc_variant fimc1_variant_s5pv210 = {
.pix_hoff = 1,
.has_inp_rot = 1,
.has_out_rot = 1,
.has_cam_if = 1,
.has_mainscaler_ext = 1,
.min_inp_pixsize = 16,
.min_out_pixsize = 16,
Expand All @@ -1906,6 +1911,7 @@ static struct samsung_fimc_variant fimc1_variant_s5pv210 = {
};

static struct samsung_fimc_variant fimc2_variant_s5pv210 = {
.has_cam_if = 1,
.pix_hoff = 1,
.min_inp_pixsize = 16,
.min_out_pixsize = 16,
Expand All @@ -1918,6 +1924,7 @@ static struct samsung_fimc_variant fimc0_variant_exynos4 = {
.pix_hoff = 1,
.has_inp_rot = 1,
.has_out_rot = 1,
.has_cam_if = 1,
.has_cistatus2 = 1,
.has_mainscaler_ext = 1,
.min_inp_pixsize = 16,
Expand All @@ -1927,8 +1934,9 @@ static struct samsung_fimc_variant fimc0_variant_exynos4 = {
.pix_limit = &s5p_pix_limit[1],
};

static struct samsung_fimc_variant fimc2_variant_exynos4 = {
static struct samsung_fimc_variant fimc3_variant_exynos4 = {
.pix_hoff = 1,
.has_cam_if = 1,
.has_cistatus2 = 1,
.has_mainscaler_ext = 1,
.min_inp_pixsize = 16,
Expand Down Expand Up @@ -1966,7 +1974,7 @@ static struct samsung_fimc_driverdata fimc_drvdata_exynos4 = {
[0] = &fimc0_variant_exynos4,
[1] = &fimc0_variant_exynos4,
[2] = &fimc0_variant_exynos4,
[3] = &fimc2_variant_exynos4,
[3] = &fimc3_variant_exynos4,
},
.num_entities = 4,
.lclk_frequency = 166000000UL,
Expand Down Expand Up @@ -1994,32 +2002,21 @@ static const struct dev_pm_ops fimc_pm_ops = {

static struct platform_driver fimc_driver = {
.probe = fimc_probe,
.remove = __devexit_p(fimc_remove),
.remove = __devexit_p(fimc_remove),
.id_table = fimc_driver_ids,
.driver = {
.name = MODULE_NAME,
.name = FIMC_MODULE_NAME,
.owner = THIS_MODULE,
.pm = &fimc_pm_ops,
}
};

static int __init fimc_init(void)
int __init fimc_register_driver(void)
{
int ret = platform_driver_register(&fimc_driver);
if (ret)
err("platform_driver_register failed: %d\n", ret);
return ret;
return platform_driver_probe(&fimc_driver, fimc_probe);
}

static void __exit fimc_exit(void)
void __exit fimc_unregister_driver(void)
{
platform_driver_unregister(&fimc_driver);
}

module_init(fimc_init);
module_exit(fimc_exit);

MODULE_AUTHOR("Sylwester Nawrocki <s.nawrocki@samsung.com>");
MODULE_DESCRIPTION("S5P FIMC camera host interface/video postprocessor driver");
MODULE_LICENSE("GPL");
MODULE_VERSION("1.0.1");
16 changes: 15 additions & 1 deletion trunk/drivers/media/video/s5p-fimc/fimc-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/* Time to wait for next frame VSYNC interrupt while stopping operation. */
#define FIMC_SHUTDOWN_TIMEOUT ((100*HZ)/1000)
#define MAX_FIMC_CLOCKS 2
#define MODULE_NAME "s5p-fimc"
#define FIMC_MODULE_NAME "s5p-fimc"
#define FIMC_MAX_DEVS 4
#define FIMC_MAX_OUT_BUFS 4
#define SCALER_MAX_HRATIO 64
Expand Down Expand Up @@ -308,6 +308,7 @@ struct fimc_m2m_device {
* @reqbufs_count: the number of buffers requested in REQBUFS ioctl
* @input_index: input (camera sensor) index
* @refcnt: driver's private reference counter
* @user_subdev_api: true if subdevs are not configured by the host driver
*/
struct fimc_vid_cap {
struct fimc_ctx *ctx;
Expand All @@ -325,6 +326,7 @@ struct fimc_vid_cap {
unsigned int reqbufs_count;
int input_index;
int refcnt;
bool user_subdev_api;
};

/**
Expand Down Expand Up @@ -355,6 +357,7 @@ struct fimc_pix_limit {
* @has_cistatus2: 1 if CISTATUS2 register is present in this IP revision
* @has_mainscaler_ext: 1 if extended mainscaler ratios in CIEXTEN register
* are present in this IP revision
* @has_cam_if: set if this instance has a camera input interface
* @pix_limit: pixel size constraints for the scaler
* @min_inp_pixsize: minimum input pixel size
* @min_out_pixsize: minimum output pixel size
Expand All @@ -367,6 +370,7 @@ struct samsung_fimc_variant {
unsigned int has_out_rot:1;
unsigned int has_cistatus2:1;
unsigned int has_mainscaler_ext:1;
unsigned int has_cam_if:1;
struct fimc_pix_limit *pix_limit;
u16 min_inp_pixsize;
u16 min_out_pixsize;
Expand All @@ -387,6 +391,12 @@ struct samsung_fimc_driverdata {
int num_entities;
};

struct fimc_pipeline {
struct media_pipeline *pipe;
struct v4l2_subdev *sensor;
struct v4l2_subdev *csis;
};

struct fimc_ctx;

/**
Expand All @@ -408,6 +418,7 @@ struct fimc_ctx;
* @vid_cap: camera capture device information
* @state: flags used to synchronize m2m and capture mode operation
* @alloc_ctx: videobuf2 memory allocator context
* @pipeline: fimc video capture pipeline data structure
*/
struct fimc_dev {
spinlock_t slock;
Expand All @@ -427,6 +438,7 @@ struct fimc_dev {
struct fimc_vid_cap vid_cap;
unsigned long state;
struct vb2_alloc_ctx *alloc_ctx;
struct fimc_pipeline pipeline;
};

/**
Expand Down Expand Up @@ -645,6 +657,8 @@ int fimc_prepare_addr(struct fimc_ctx *ctx, struct vb2_buffer *vb,
int fimc_register_m2m_device(struct fimc_dev *fimc,
struct v4l2_device *v4l2_dev);
void fimc_unregister_m2m_device(struct fimc_dev *fimc);
int fimc_register_driver(void);
void fimc_unregister_driver(void);

/* -----------------------------------------------------*/
/* fimc-capture.c */
Expand Down
Loading

0 comments on commit 38cd5a1

Please sign in to comment.