HDMI driver for Samsung S5PV310 platform
Subsystems (5)
v2 cover HDMI driver for Samsung S5PV310 platform
From: Marek Szyprowski <[email protected]>
Hello,
I would like to present the second version of HDMI driver for S5PC210 platform. The driver is under a heavy development. The most recent changes are:
1. Minor bugs and fixes:
- pink line on left side of display
- premature start of VP's streaming
- usage of free memory
- usage of non-initialized variables
- fixed sequence of power setup
- dependencies in Kconfig
2. Integration with Runtime Power Managment and Power Domain driver.
3. The CMA was substituted by the SYSMMU driver.
4. Applying existing frameworks:
- activation of HDMIPHY using clock API
- control of power on HDMI-5V pin using regulator API
5. Moving all clocks and regulator management from platform to the drivers' code.
6. Redesigned the control of mixer's debugging.
7. Added a watchdog to deal with HW failures.
Original HDMI driver RFC:
==============
Introduction
==============
The purpose of this RFC is to discuss the driver for a TV output interface available in upcoming Samsung SoC. The HW is able to generate digital and analog signals. Current version of the driver supports only digital output.
Internally the driver uses videobuf2 framework, and CMA memory allocator. Not all of them are merged by now, but I decided to post the sources to start discussion driver's design.
======================
Hardware description
======================
The SoC contains a few HW sub-blocks:
1. Video Processor (VP). It is used for processing of NV12 data. An image stored in RAM is accessed by DMA. Pixels are cropped, scaled. Additionally, post processing operations like brightness, sharpness and contrast adjustments could be performed. The output in YCbCr444 format is send to Mixer.
2. Mixer (MXR). The piece of hardware responsible for mixing and blending multiple data inputs before passing it to an output device. The MXR is capable of handling up to three image layers. One is the output of VP. Other two are images in RGB format (multiple variants are supported). The layers are scaled, cropped and blended with background color. The blending factor, and layers' priority are controlled by MXR's registers. The output is passed either to HDMI or TVOUT.
3. HDMI. The piece of HW responsible for generation of HDMI packets. It takes pixel data from mixer and transforms it into data frames. The output is send to HDMIPHY interface.
4. HDMIPHY. Physical interface for HDMI. Its duties are sending HDMI packets to HDMI connector. Basically, it contains a PLL that produces source clock for Mixer, VP and HDMI during streaming.
5. TVOUT. Generation of TV analog signal. (driver not implemented)
6. VideoDAC. Modulator for TVOUT signal. (driver not implemented)
The diagram below depicts connection between all HW pieces.
+-----------+
NV12 data ---dma--->| Video |
| Processor |
+-----------+
|
V
+-----------+
RGB data ---dma--->| |
| Mixer |
RGB data ---dma--->| |
+-----------+
|
* dmux
/
+-----* *------+
| |
V V
+-----------+ +-----------+
| HDMI | | TVOUT |
+-----------+ +-----------+
| |
V V
+-----------+ +-----------+
| HDMIPHY | | VideoDAC |
+-----------+ +-----------+
| |
V V
HDMI Composite
connector connector==================
Driver interface
==================
The posted driver implements three V4L2 nodes. Every video node implements V4L2 output buffer. One of nodes corresponds to input of Video Processor. The other two nodes correspond to RGB inputs of Mixer. All nodes share the same output. It is one of the Mixer's outputs: TVOUT or HDMI. Changing output in one layer using S_OUTPUT would change outputs of all other video nodes. The same thing happens if one try to reconfigure output i.e. by calling S_DV_PRESET. However it not possible to change or reconfigure the output while streaming. To sum up, all features in posted version of driver goes as follows:
1. QUERYCAP
2. S_FMT, G_FMT - single and multiplanar API
a) node named video0 supports formats NV12, NV12, NV12T (tiled version of
NV12), NV12MT (multiplane version of NV12T).
b) nodes named graph0 and graph1 support formats RGB565, ARGB1555, ARGB4444,
ARGB8888.
3. Buffer with USERPTR and MMAP memory.
4. Streaming and buffer control. (STREAMON, STREAMOFF, REQBUF, QBUF, DQBUF)
5. OUTPUT enumeration.
6. DV preset control (SET, GET, ENUM). Currently modes 480P59_94, 720P59_94, 1080P30, 1080P59_94 and 1080P60 work.
7. Positioning layer's window on output display using S_CROP, G_GROP, CROPCAP.
8. Positioning and cropping data in buffer using S_CROP, G_GROP, CROPCAP with buffer type OVERLAY. *
TODOs:
- add analog TVOUT driver
- add S_OUTPUT
- add S_STD ioctl
- add control of alpha blending / chroma keying via V4L2 controls
- add controls for luminance curve and sharpness in VP
- consider exporting all output functionalities to separate video node
- consider media controller framework
- better control over debugging
- fix dependency between all TV drivers
* The need of cropping in source buffers came from problem with MFC driver for S5P. The MFC supports only width divisible by 64. If a width of a decoded movie is not aligned do 64 then padding pixels are filled with zeros. This is an ugly green color in YCbCr colorspace. Filling it with zeros by a CPU is a waste of resources since an image can be cropped in VP. Is it possible to set crops for user data for M2M devices. V4L2 lacks such functionality of non-M2M devices. Therefore cropping in buffer V4L2_BUF_TYPE_VIDEO_OVERLAY was used as an work around.
=====================
Device Architecture
=====================
Three drivers are added in this patch.
1. HDMIPHY. It is an I2C driver for HDMIPHY interface. It exports following callback by V4L2 subdevice:
- s_power: currently stub
- s_stream: configures and starts/stops HDMIPHY
- s_dv_preset: used to choose proper frequency of clock for other TV devices
2. HDMI. The auxiliary driver used to control HDMI interface. It exports its subdev to a subdev pool for use by other drivers. The following callbacks are implemented:
- s_power: runs HDMI hardware, regulators and clocks.
- s_stream: runs HDMIPHY and starts generation of video frames.
- enum_dv_presets
- s_dv_preset
- g_mbus_format: returns information on data format expected by on HDMI input The driver supports an interrupt. It is used to detect plug/unplug events in
kernel debugs. The API for detection of such an events in V4L2 API is to be defined.
3. Mixer & Video Processor driver. It is called 's5p-mixer' because of historical reasons. It was decided combine VP and MXR drivers into one because of shared interrupt and very similar interface via V4L2 nodes. The driver is a realization of many-to-many relation between multiple input layers and multiple outputs. All shared resources are kept in struct mxr_device. It provides utilities for management and synchronization of access to resources and reference counting. The outputs are obtained from subdev pool basing on names supplied in platform data. One layer is a single video node. Since layers differs simple inheritance is applied. Every layer type implements set of ops. There are different ops for Mixer layers and other for VP layer.
The videobuf2 framework was used for the management of buffers and streaming. All other V4L2 ioctls are processed in layers common interface. The CMA was used as memory allocator for Mixer's buffers. It could be easily exchanged with any other allocator integrated with videobuf2 framework.
Driver is not yet integrated with power domain driver. Moreover one of mixer's clocks has to change parent while entering streaming mode. Therefore all power and clock management was moved to platform data until final solutions emerges.
===============
Usage summary
===============
Follow steps below to display double-buffered animation on HDMI output.
01. Open video node named graph0.
02. S_FMT(type = OUTPUT, pixelformat = V4L2_PIX_FMT_RGB*, width, height, ...)
03. REQ_BUFS(type = OUTPUT, memory = MMAP, count = 2)
04. MMAP(type = OUTPUT, index = 0)
05. MMAP(type = OUTPUT, index = 1)
06. Fill buffer 0 with data
07. QBUF(type = OUTPUT, index = 0)
08. STREAM_ON(type = OUTPUT)
09. Fill buffer 1 with data
10. QBUF(type = OUTPUT, index = 1)
11. DQBUF(type = OUTPUT)
12. QBUF(type = OUTPUT, index = 0)
13. DQBUF(type = OUTPUT)
14. Goto 09
===============
Patch Summary
===============
Tomasz Stanislawski (6):
i2c-s3c2410: fix I2C dedicated for hdmiphy
universal: i2c: add I2C controller 8 (HDMIPHY)
v4l: add macro for 1080p59_54 preset
s5p-tv: add driver for HDMI output on S5PC210 platform
s5pv310: add s5p-tv to platform devices
s5pv310: add s5p-tv to Universal C210 board
arch/arm/mach-s5pv310/Kconfig | 7 + arch/arm/mach-s5pv310/Makefile | 1 + arch/arm/mach-s5pv310/clock.c | 138 ++- arch/arm/mach-s5pv310/dev-tv.c | 103 ++ arch/arm/mach-s5pv310/include/mach/irqs.h | 8 + arch/arm/mach-s5pv310/include/mach/map.h | 27 + arch/arm/mach-s5pv310/include/mach/regs-clock.h | 3 + arch/arm/mach-s5pv310/include/mach/regs-pmu.h | 2 + arch/arm/mach-s5pv310/mach-universal_c210.c | 54 + arch/arm/plat-samsung/Kconfig | 5 + arch/arm/plat-samsung/Makefile | 1 + arch/arm/plat-samsung/dev-i2c8.c | 68 + arch/arm/plat-samsung/include/plat/devs.h | 3 + arch/arm/plat-samsung/include/plat/iic.h | 1 + arch/arm/plat-samsung/include/plat/tv.h | 26 + drivers/i2c/busses/i2c-s3c2410.c | 36 +- drivers/media/video/Kconfig | 8 + drivers/media/video/Makefile | 1 + drivers/media/video/s5p-tv/Kconfig | 58 + drivers/media/video/s5p-tv/Makefile | 15 + drivers/media/video/s5p-tv/hdmi.h | 74 + drivers/media/video/s5p-tv/hdmi_drv.c | 963 ++++++++++++ drivers/media/video/s5p-tv/hdmiphy_drv.c | 247 +++ drivers/media/video/s5p-tv/mixer.h | 314 ++++ drivers/media/video/s5p-tv/mixer_drv.c | 487 ++++++ drivers/media/video/s5p-tv/mixer_grp_layer.c | 180 +++ drivers/media/video/s5p-tv/mixer_reg.c | 523 +++++++ drivers/media/video/s5p-tv/mixer_reg.h | 44 + drivers/media/video/s5p-tv/mixer_video.c | 863 +++++++++++ drivers/media/video/s5p-tv/mixer_vp_layer.c | 201 +++ drivers/media/video/s5p-tv/regs-hdmi.h | 1849 +++++++++++++++++++++++ drivers/media/video/s5p-tv/regs-vmx.h | 196 +++ drivers/media/video/s5p-tv/regs-vp.h | 277 ++++ drivers/media/video/v4l2-common.c | 1 + include/linux/videodev2.h | 1 + 35 files changed, 6783 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-s5pv310/dev-tv.c create mode 100644 arch/arm/plat-samsung/dev-i2c8.c create mode 100644 arch/arm/plat-samsung/include/plat/tv.h create mode 100644 drivers/media/video/s5p-tv/Kconfig create mode 100644 drivers/media/video/s5p-tv/Makefile create mode 100644 drivers/media/video/s5p-tv/hdmi.h create mode 100644 drivers/media/video/s5p-tv/hdmi_drv.c create mode 100644 drivers/media/video/s5p-tv/hdmiphy_drv.c create mode 100644 drivers/media/video/s5p-tv/mixer.h create mode 100644 drivers/media/video/s5p-tv/mixer_drv.c create mode 100644 drivers/media/video/s5p-tv/mixer_grp_layer.c create mode 100644 drivers/media/video/s5p-tv/mixer_reg.c create mode 100644 drivers/media/video/s5p-tv/mixer_reg.h create mode 100644 drivers/media/video/s5p-tv/mixer_video.c create mode 100644 drivers/media/video/s5p-tv/mixer_vp_layer.c create mode 100644 drivers/media/video/s5p-tv/regs-hdmi.h create mode 100644 drivers/media/video/s5p-tv/regs-vmx.h create mode 100644 drivers/media/video/s5p-tv/regs-vp.h
Signature · 1 line
1.7.1.569.g6f426
PATCH v2 1/6 i2c-s3c2410: fix I2C dedicated for hdmiphy
The I2C HDMIPHY dedicated controller has different timeout handling and reset conditions.
--- drivers/i2c/busses/i2c-s3c2410.c | 36 +++++++++++++++++++++++++++++++++++- 1 files changed, 35 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-s3c2410.c +35 -1
@@ -54,6 +54,7 @@ enum s3c24xx_i2c_state {enum s3c24xx_i2c_type {TYPE_S3C2410 ,TYPE_S3C2440 , +TYPE_S3C2440_HDMIPHY , };struct s3c24xx_i2c {
@@ -96,7 +97,21 @@ static inline int s3c24xx_i2c_is2440(struct s3c24xx_i2c *i2c)enum s3c24xx_i2c_type type; type =platform_get_device_id (pdev)->driver_data; -return type ==TYPE_S3C2440 ; +return type ==TYPE_S3C2440 || type ==TYPE_S3C2440_HDMIPHY ; +} + +/* s3c24xx_i2c_is2440_hdmiphy() +* +* return true is this is an s3c2440 dedicated for HDMIPHY interface +*/ + +static inline int s3c24xx_i2c_is2440_hdmiphy (struct s3c24xx_i2c *i2c) +{ +struct platform_device *pdev =to_platform_device (i2c->dev); +enum s3c24xx_i2c_type type; + + type =platform_get_device_id (pdev)->driver_data; +return type ==TYPE_S3C2440_HDMIPHY ; }/* s3c24xx_i2c_master_complete
@@ -461,6 +476,13 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c *i2c)unsigned long iicstat;int timeout =400 ; +/* if hang-up of HDMIPHY occured reduce timeout +* The controller will work after reset, so waiting +* 400 ms will cause unneccessary system hangup +*/ +if (s3c24xx_i2c_is2440_hdmiphy (i2c)) + timeout =10 ; +while (timeout-- >0 ) { iicstat =readl (i2c->regs +S3C2410_IICSTAT );
@@ -470,6 +492,15 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c *i2c)msleep (1 ); } +/* hang-up of bus dedicated for HDMIPHY occured, resetting */ +if (s3c24xx_i2c_is2440_hdmiphy (i2c)) { +writel (0 , i2c->regs +S3C2410_IICCON ); +writel (0 , i2c->regs +S3C2410_IICSTAT ); +writel (0 , i2c->regs +S3C2410_IICDS ); + +return 0 ; + } +return -ETIMEDOUT ; }
@@ -1009,6 +1040,9 @@ static struct platform_device_id s3c24xx_driver_ids[] = { }, { .name = "s3c2440-i2c", .driver_data = TYPE_S3C2440, + }, { + .name = "s3c2440-hdmiphy-i2c", + .driver_data = TYPE_S3C2440_HDMIPHY, }, { }, };MODULE_DEVICE_TABLE (platform, s3c24xx_driver_ids);
Signature · 1 line
1.7.1.569.g6f426
PATCH v2 2/6 universal: i2c: add I2C controller 8 (HDMIPHY)
In reply to Tomasz Stanislawski--- arch/arm/mach-s5pv310/clock.c | 6 +++ arch/arm/mach-s5pv310/include/mach/irqs.h | 4 ++ arch/arm/mach-s5pv310/include/mach/map.h | 1 + arch/arm/plat-samsung/Kconfig | 5 ++ arch/arm/plat-samsung/Makefile | 1 + arch/arm/plat-samsung/dev-i2c8.c | 68 +++++++++++++++++++++++++++++ arch/arm/plat-samsung/include/plat/devs.h | 1 + arch/arm/plat-samsung/include/plat/iic.h | 1 + 8 files changed, 87 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-samsung/dev-i2c8.c
arch/arm/mach-s5pv310/clock.c +6 -0
@@ -685,6 +685,12 @@ static struct clk init_clocks_off[] = { .parent = &clk_aclk_100.clk, .enable = s5pv310_clk_ip_peril_ctrl, .ctrlbit = (1 << 13), + }, { + .name = "i2c", + .id = 8, + .parent = &clk_aclk_100.clk, + .enable = s5pv310_clk_ip_peril_ctrl, + .ctrlbit = (1 << 14), }, };
arch/arm/mach-s5pv310/include/mach/irqs.h +4 -0
@@ -77,6 +77,9 @@#define IRQ_PDMA0 COMBINER_IRQ(21, 0)#define IRQ_PDMA1 COMBINER_IRQ(21, 1) +#define IRQ_HDMI COMBINER_IRQ(16, 0) +#define IRQ_HDMI_I2C COMBINER_IRQ(16, 1) +#define IRQ_TIMER0_VIC COMBINER_IRQ(22, 0)#define IRQ_TIMER1_VIC COMBINER_IRQ(22, 1)#define IRQ_TIMER2_VIC COMBINER_IRQ(22, 2)
@@ -100,6 +103,7 @@#define IRQ_IIC5 COMBINER_IRQ(27, 5)#define IRQ_IIC6 COMBINER_IRQ(27, 6)#define IRQ_IIC7 COMBINER_IRQ(27, 7) +#define IRQ_IIC8 IRQ_HDMI_I2C#define IRQ_HSMMC0 COMBINER_IRQ(29, 0)#define IRQ_HSMMC1 COMBINER_IRQ(29, 1)
arch/arm/mach-s5pv310/include/mach/map.h +1 -0
@@ -120,6 +120,7 @@#define S3C_PA_IIC5 S5PV310_PA_IIC(5)#define S3C_PA_IIC6 S5PV310_PA_IIC(6)#define S3C_PA_IIC7 S5PV310_PA_IIC(7) +#define S3C_PA_IIC8 S5PV310_PA_IIC(8)#define S3C_PA_RTC S5PV310_PA_RTC#define S3C_PA_WDT S5PV310_PA_WATCHDOG
arch/arm/plat-samsung/Kconfig +5 -0
@@ -211,6 +211,11 @@ config S3C_DEV_I2C7 help Compile in platform device definition for I2C controller 7 +config S3C_DEV_I2C8 + bool + help + Compile in platform device definitions for I2C channel 8 (HDMIPHY) + config S3C_DEV_FB bool help
arch/arm/plat-samsung/Makefile +1 -0
@@ -46,6 +46,7 @@ obj-$(CONFIG_S3C_DEV_I2C4) += dev-i2c4.o obj-$(CONFIG_S3C_DEV_I2C5) += dev-i2c5.o obj-$(CONFIG_S3C_DEV_I2C6) += dev-i2c6.o obj-$(CONFIG_S3C_DEV_I2C7) += dev-i2c7.o +obj-$(CONFIG_S3C_DEV_I2C8) += dev-i2c8.o obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o obj-y += dev-uart.o obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
arch/arm/plat-samsung/dev-i2c8.c new file +68 -0
68 lines not on this page · raw message
arch/arm/plat-samsung/include/plat/devs.h +1 -0
@@ -53,6 +53,7 @@ extern struct platform_device s3c_device_i2c4;extern struct platform_device s3c_device_i2c5;extern struct platform_device s3c_device_i2c6;extern struct platform_device s3c_device_i2c7; +extern struct platform_device s3c_device_i2c8;extern struct platform_device s3c_device_rtc;extern struct platform_device s3c_device_adc;extern struct platform_device s3c_device_sdi;
arch/arm/plat-samsung/include/plat/iic.h +1 -0
@@ -60,6 +60,7 @@ extern void s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *i2c);extern void s3c_i2c5_set_platdata (struct s3c2410_platform_i2c *i2c);extern void s3c_i2c6_set_platdata (struct s3c2410_platform_i2c *i2c);extern void s3c_i2c7_set_platdata (struct s3c2410_platform_i2c *i2c); +extern void s3c_i2c8_set_platdata (struct s3c2410_platform_i2c *i2c);/* defined by architecture to configure gpio */ extern void s3c_i2c0_cfg_gpio (struct platform_device *dev);
Signature · 1 line
1.7.1.569.g6f426
RE: [PATCH 2/6] universal: i2c: add I2C controller 8 (HDMIPHY)
Review
Quoted 86 lines · Tomasz Stanislawski
Signed-off-by Tomasz Stanislawski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- arch/arm/mach-s5pv310/clock.c | 6 +++ arch/arm/mach-s5pv310/include/mach/irqs.h | 4 ++ arch/arm/mach-s5pv310/include/mach/map.h | 1 + arch/arm/plat-samsung/Kconfig | 5 ++ arch/arm/plat-samsung/Makefile | 1 + arch/arm/plat-samsung/dev-i2c8.c | 68 +++++++++++++++++++++++++++++ arch/arm/plat-samsung/include/plat/devs.h | 1 + arch/arm/plat-samsung/include/plat/iic.h | 1 + 8 files changed, 87 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-samsung/dev-i2c8.carch/arm/mach-s5pv310/clock.c +6
-0@@ -685,6 +685,12 @@ static struct clk init_clocks_off[] = { .parent = &clk_aclk_100.clk, .enable = s5pv310_clk_ip_peril_ctrl, .ctrlbit = (1 << 13), + }, { + .name = "i2c", + .id = 8, + .parent = &clk_aclk_100.clk, + .enable = s5pv310_clk_ip_peril_ctrl, + .ctrlbit = (1 << 14), }, };arch/arm/mach- renamed from arch/arm/mach-s5pv310/include/mach/irqs.h +0
-0
s5pv310/include/mach/irqs.h
index f6b99c6..f7ddc98 100644arch/arm/mach-s5pv310/include/mach/irqs.h +4
-0@@ -77,6 +77,9 @@#define IRQ_PDMA0 COMBINER_IRQ(21, 0)#define IRQ_PDMA1 COMBINER_IRQ(21, 1) +#define IRQ_HDMI COMBINER_IRQ(16, 0) +#define IRQ_HDMI_I2C COMBINER_IRQ(16, 1) +#define IRQ_TIMER0_VIC COMBINER_IRQ(22, 0)#define IRQ_TIMER1_VIC COMBINER_IRQ(22, 1)#define IRQ_TIMER2_VIC COMBINER_IRQ(22, 2)@@ -100,6 +103,7 @@#define IRQ_IIC5 COMBINER_IRQ(27, 5)#define IRQ_IIC6 COMBINER_IRQ(27, 6)#define IRQ_IIC7 COMBINER_IRQ(27, 7) +#define IRQ_IIC8 IRQ_HDMI_I2C#define IRQ_HSMMC0 COMBINER_IRQ(29, 0)#define IRQ_HSMMC1 COMBINER_IRQ(29, 1)arch/arm/mach- renamed from arch/arm/mach-s5pv310/include/mach/map.h +0
-0
s5pv310/include/mach/map.h
index 576ba55..0aa0171 100644arch/arm/mach-s5pv310/include/mach/map.h +1
-0@@ -120,6 +120,7 @@#define S3C_PA_IIC5 S5PV310_PA_IIC(5)#define S3C_PA_IIC6 S5PV310_PA_IIC(6)#define S3C_PA_IIC7 S5PV310_PA_IIC(7) +#define S3C_PA_IIC8 S5PV310_PA_IIC(8)#define S3C_PA_RTC S5PV310_PA_RTC#define S3C_PA_WDT S5PV310_PA_WATCHDOGarch/arm/plat-samsung/Kconfig +5
-0@@ -211,6 +211,11 @@ config S3C_DEV_I2C7 help Compile in platform device definition for I2C controller 7 +config S3C_DEV_I2C8 + bool + help + Compile in platform device definitions for I2C channel 8 (HDMIPHY) + config S3C_DEV_FB bool help(quoted diff) +0
-0
b/arch/arm/plat-samsung/Makefile
Quoted 73 lines
index 7e92457..826ae4f 100644
arch/arm/plat-samsung/Makefile +1
-0@@ -46,6 +46,7 @@ obj-$(CONFIG_S3C_DEV_I2C4) += dev-i2c4.o obj-$(CONFIG_S3C_DEV_I2C5) += dev-i2c5.o obj-$(CONFIG_S3C_DEV_I2C6) += dev-i2c6.o obj-$(CONFIG_S3C_DEV_I2C7) += dev-i2c7.o +obj-$(CONFIG_S3C_DEV_I2C8) += dev-i2c8.o obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o obj-y += dev-uart.o obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.oarch/arm/plat-samsung/dev- renamed from arch/arm/plat-samsung/dev-i2c8.c +0
-0
i2c8.c
new file mode 100644
index 0000000..8edba7farch/arm/plat-samsung/dev-i2c8.c new file +55
-0@@ -0,0 +1,68 @@ +/* linux/arch/arm/plat-samsung/dev-i2c7.c +* +* Copyright (c) 2010 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* S3C series device definition for i2c device 8 +* +* Based on plat-samsung/dev-i2c8.c +* +* 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. +*/ + +#include <linux/gfp.h> +#include <linux/kernel.h> +#include <linux/string.h> +#include <linux/platform_device.h> + +#include <mach/irqs.h> +#include <mach/map.h> + +#include <plat/regs-iic.h> +#include <plat/iic.h> +#include <plat/devs.h> +#include <plat/cpu.h> + +static struct resource s3c_i2c_resource[] = { + [0 ] = { + .start =S3C_PA_IIC8 , + .end =S3C_PA_IIC8 +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .start =IRQ_IIC8 , + .end =IRQ_IIC8 , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device s3c_device_i2c8 = { + .name ="s3c2440-hdmiphy-i2c" , + .id =8 , + .num_resources =ARRAY_SIZE (s3c_i2c_resource), + .resource = s3c_i2c_resource, +}; + +static struct s3c2410_platform_i2c default_i2c_data8__initdata = { + .flags =0 , + .bus_num =8 , + .slave_addr =0x10 , + .frequency =400 *1000 , + .sda_delay =100 , +}; +
arch/arm/plat-samsung/dev-i2c8.c line 65
Quoted 10 lines
arch/arm/plat-samsung/dev-i2c8.c new file +10
-0+void __init s3c_i2c8_set_platdata (struct s3c2410_platform_i2c *pd) +{ +struct s3c2410_platform_i2c *npd; + +if (!pd) + pd = &default_i2c_data8; + + npd =kmemdup (pd,sizeof (struct s3c2410_platform_i2c ),GFP_KERNEL ); +if (!npd) + printk(KERN_ERR "%s: no memory for platform data\n",
__func__);
Quoted 29 lines
arch/arm/plat-samsung/dev-i2c8.c new file +3
-0+ + s3c_device_i2c8.dev.platform_data = npd; +}arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/devs.h +0
-0
samsung/include/plat/devs.h
index 6a869b8..f14709c 100644arch/arm/plat-samsung/include/plat/devs.h +1
-0@@ -53,6 +53,7 @@ extern struct platform_device s3c_device_i2c4;extern struct platform_device s3c_device_i2c5;extern struct platform_device s3c_device_i2c6;extern struct platform_device s3c_device_i2c7; +extern struct platform_device s3c_device_i2c8;extern struct platform_device s3c_device_rtc;extern struct platform_device s3c_device_adc;extern struct platform_device s3c_device_sdi;arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/iic.h +0
-0
samsung/include/plat/iic.h
index 1543da8..dd0d728 100644arch/arm/plat-samsung/include/plat/iic.h +1
-0@@ -60,6 +60,7 @@ extern void s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *i2c);extern void s3c_i2c5_set_platdata (struct s3c2410_platform_i2c *i2c);extern void s3c_i2c6_set_platdata (struct s3c2410_platform_i2c *i2c);extern void s3c_i2c7_set_platdata (struct s3c2410_platform_i2c *i2c); +extern void s3c_i2c8_set_platdata (struct s3c2410_platform_i2c *i2c);/* defined by architecture to configure gpio */
Quoted 3 lines
extern void
s3c_i2c0_cfg_gpio(struct platform_device *dev);
--
1.7.1.569.g6f426
Basically, EXYNOS4 can't support I2C channel 8 for general purpose. Yeah, it is dedicated to HDMI..it means we can't use i2c8 stuff...
(As a note, I2C interface for HDMI PHY is internally connected.)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
Re: [PATCH 2/6] universal: i2c: add I2C controller 8 (HDMIPHY)
Quoted 208 lines · Kukjin Kim
Quoted 85 lines · Tomasz Stanislawski
Signed-off-by Tomasz Stanislawski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>---
arch/arm/mach-s5pv310/clock.c | 6 +++arch/arm/mach-s5pv310/include/mach/irqs.h| 4 ++arch/arm/mach-s5pv310/include/mach/map.h| 1 +arch/arm/plat-samsung/Kconfig| 5 ++arch/arm/plat-samsung/Makefile| 1 +arch/arm/plat-samsung/dev-i2c8.c| 68
+++++++++++++++++++++++++++++
arch/arm/plat-samsung/include/plat/devs.h | 1 +arch/arm/plat-samsung/include/plat/iic.h| 1 +8 files changed, 87 insertions(+), 0 deletions(-)create mode 100644
arch/arm/plat-samsung/dev-i2c8.carch/arm/mach-s5pv310/clock.c +6
-0@@ -685,6 +685,12 @@ static struct clk init_clocks_off[] = { .parent = &clk_aclk_100.clk, .enable = s5pv310_clk_ip_peril_ctrl, .ctrlbit = (1 << 13), + }, { + .name = "i2c", + .id = 8, + .parent = &clk_aclk_100.clk, + .enable = s5pv310_clk_ip_peril_ctrl, + .ctrlbit = (1 << 14), }, };arch/arm/mach- renamed from arch/arm/mach-s5pv310/include/mach/irqs.h +0
-0
s5pv310/include/mach/irqs.h
index f6b99c6..f7ddc98 100644arch/arm/mach-s5pv310/include/mach/irqs.h +4
-0@@ -77,6 +77,9 @@ #define IRQ_PDMA0 COMBINER_IRQ(21, 0) #define IRQ_PDMA1 COMBINER_IRQ(21, 1) +#define IRQ_HDMI COMBINER_IRQ(16, 0) +#define IRQ_HDMI_I2C COMBINER_IRQ(16, 1) + #define IRQ_TIMER0_VIC COMBINER_IRQ(22, 0) #define IRQ_TIMER1_VIC COMBINER_IRQ(22, 1) #define IRQ_TIMER2_VIC COMBINER_IRQ(22, 2)@@ -100,6 +103,7 @@ #define IRQ_IIC5 COMBINER_IRQ(27, 5) #define IRQ_IIC6 COMBINER_IRQ(27, 6) #define IRQ_IIC7 COMBINER_IRQ(27, 7) +#define IRQ_IIC8 IRQ_HDMI_I2C #define IRQ_HSMMC0 COMBINER_IRQ(29, 0) #define IRQ_HSMMC1 COMBINER_IRQ(29, 1)arch/arm/mach- renamed from arch/arm/mach-s5pv310/include/mach/map.h +0
-0
s5pv310/include/mach/map.h
index 576ba55..0aa0171 100644arch/arm/mach-s5pv310/include/mach/map.h +1
-0@@ -120,6 +120,7 @@ #define S3C_PA_IIC5 S5PV310_PA_IIC(5) #define S3C_PA_IIC6 S5PV310_PA_IIC(6) #define S3C_PA_IIC7 S5PV310_PA_IIC(7) +#define S3C_PA_IIC8 S5PV310_PA_IIC(8) #define S3C_PA_RTC S5PV310_PA_RTC #define S3C_PA_WDT S5PV310_PA_WATCHDOGarch/arm/plat-samsung/Kconfig +0
-0@@ -211,6 +211,11 @@ config S3C_DEV_I2C7help
Compile in platform device definition for I2C controller 7arch/arm/plat-samsung/Kconfig +5
-0+config S3C_DEV_I2C8 + bool + help + Compile in platform device definitions for I2C channel 8 (HDMIPHY) +config
S3C_DEV_FB
bool
helpReview
Quoted 1 line
(quoted diff) +0
-0b/arch/arm/plat-samsung/Makefile
Quoted 73 lines
index 7e92457..826ae4f 100644
arch/arm/plat-samsung/Makefile +0
-0@@ -46,6 +46,7 @@ obj-$(CONFIG_S3C_DEV_I2C4) += dev-i2c4.oobj-$(CONFIG_S3C_DEV_I2C5) += dev-i2c5.o obj-$(CONFIG_S3C_DEV_I2C6) += dev-i2c6.o obj-$(CONFIG_S3C_DEV_I2C7) += dev-i2c7.o +obj-$(CONFIG_S3C_DEV_I2C8) += dev-i2c8.o obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o obj-y += dev-uart.o obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
arch/arm/plat-samsung/dev- renamed from arch/arm/plat-samsung/dev-i2c8.c +0
-0
i2c8.c
new file mode 100644
index 0000000..8edba7farch/arm/plat-samsung/dev-i2c8.c new file +55
-0@@ -0,0 +1,68 @@ +/* linux/arch/arm/plat-samsung/dev-i2c7.c +* +* Copyright (c) 2010 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* S3C series device definition for i2c device 8 +* +* Based on plat-samsung/dev-i2c8.c +* +* 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. +*/ + +#include <linux/gfp.h> +#include <linux/kernel.h> +#include <linux/string.h> +#include <linux/platform_device.h> + +#include <mach/irqs.h> +#include <mach/map.h> + +#include <plat/regs-iic.h> +#include <plat/iic.h> +#include <plat/devs.h> +#include <plat/cpu.h> + +static struct resource s3c_i2c_resource[] = { + [0] = { + .start = S3C_PA_IIC8, + .end = S3C_PA_IIC8 + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_IIC8, + .end = IRQ_IIC8, + .flags = IORESOURCE_IRQ, + }, +}; + +struct platform_device s3c_device_i2c8 = { + .name = "s3c2440-hdmiphy-i2c", + .id = 8, + .num_resources = ARRAY_SIZE(s3c_i2c_resource), + .resource = s3c_i2c_resource, +}; + +static struct s3c2410_platform_i2c default_i2c_data8__initdata = { + .flags = 0, + .bus_num = 8, + .slave_addr = 0x10, + .frequency = 400*1000, + .sda_delay = 100, +}; +arch/arm/plat-samsung/dev-i2c8.c line 65
Quoted 10 lines
arch/arm/plat-samsung/dev-i2c8.c new file +10
-0+void __init s3c_i2c8_set_platdata (struct s3c2410_platform_i2c *pd) +{ + struct s3c2410_platform_i2c *npd; + + if (!pd) + pd = &default_i2c_data8; + + npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL); + if (!npd) + printk(KERN_ERR "%s: no memory for platform data\n",
__func__);Quoted 29 lines
arch/arm/plat-samsung/dev-i2c8.c new file +3
-0+ + s3c_device_i2c8.dev.platform_data = npd; +}arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/devs.h +0
-0
samsung/include/plat/devs.h
index 6a869b8..f14709c 100644arch/arm/plat-samsung/include/plat/devs.h +1
-0@@ -53,6 +53,7 @@ extern struct platform_device s3c_device_i2c4; extern struct platform_device s3c_device_i2c5; extern struct platform_device s3c_device_i2c6; extern struct platform_device s3c_device_i2c7; +extern struct platform_device s3c_device_i2c8; extern struct platform_device s3c_device_rtc; extern struct platform_device s3c_device_adc; extern struct platform_device s3c_device_sdi;arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/iic.h +0
-0
samsung/include/plat/iic.h
index 1543da8..dd0d728 100644arch/arm/plat-samsung/include/plat/iic.h +1
-0@@ -60,6 +60,7 @@ extern void s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *i2c); extern void s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *i2c); extern void s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *i2c); extern void s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *i2c); +extern void s3c_i2c8_set_platdata (struct s3c2410_platform_i2c *i2c); /* defined by architecture to configure gpio */Quoted 3 lines
extern void
s3c_i2c0_cfg_gpio(struct platform_device *dev); --
1.7.1.569.g6f426Basically, EXYNOS4 can't support I2C channel 8 for general purpose. Yeah, it is dedicated to HDMI..it means we can't use i2c8 stuff...
Quoted 1 line
(As a note, I2C interface for HDMI PHY is internally connected.)
Please give the specific and proper comments/review instead of general comment. so what's the proper name? i2c-hdmi? or others?
Yes, it will be not a proper name, i2c8. Some time later new chip supports more than 7 I2Cs. then it will be conflict with i2c8. But we can't predict the when this chip comes.
Kyungmin Park
Quoted 14 lines
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 2/6] universal: i2c: add I2C controller 8 (HDMIPHY)
In reply to Kukjin KimHello,
Quoted 208 lines · Kukjin Kim
Review
Quoted 86 lines · Tomasz Stanislawski
Signed-off-by Tomasz Stanislawski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- arch/arm/mach-s5pv310/clock.c | 6 +++ arch/arm/mach-s5pv310/include/mach/irqs.h | 4 ++ arch/arm/mach-s5pv310/include/mach/map.h | 1 + arch/arm/plat-samsung/Kconfig | 5 ++ arch/arm/plat-samsung/Makefile | 1 + arch/arm/plat-samsung/dev-i2c8.c | 68 +++++++++++++++++++++++++++++ arch/arm/plat-samsung/include/plat/devs.h | 1 + arch/arm/plat-samsung/include/plat/iic.h | 1 + 8 files changed, 87 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-samsung/dev-i2c8.carch/arm/mach-s5pv310/clock.c +6
-0@@ -685,6 +685,12 @@ static struct clk init_clocks_off[] = { .parent = &clk_aclk_100.clk, .enable = s5pv310_clk_ip_peril_ctrl, .ctrlbit = (1 << 13), + }, { + .name = "i2c", + .id = 8, + .parent = &clk_aclk_100.clk, + .enable = s5pv310_clk_ip_peril_ctrl, + .ctrlbit = (1 << 14), }, };arch/arm/mach- renamed from arch/arm/mach-s5pv310/include/mach/irqs.h +0
-0
s5pv310/include/mach/irqs.h
index f6b99c6..f7ddc98 100644arch/arm/mach-s5pv310/include/mach/irqs.h +4
-0@@ -77,6 +77,9 @@#define IRQ_PDMA0 COMBINER_IRQ(21, 0)#define IRQ_PDMA1 COMBINER_IRQ(21, 1) +#define IRQ_HDMI COMBINER_IRQ(16, 0) +#define IRQ_HDMI_I2C COMBINER_IRQ(16, 1) +#define IRQ_TIMER0_VIC COMBINER_IRQ(22, 0)#define IRQ_TIMER1_VIC COMBINER_IRQ(22, 1)#define IRQ_TIMER2_VIC COMBINER_IRQ(22, 2)@@ -100,6 +103,7 @@#define IRQ_IIC5 COMBINER_IRQ(27, 5)#define IRQ_IIC6 COMBINER_IRQ(27, 6)#define IRQ_IIC7 COMBINER_IRQ(27, 7) +#define IRQ_IIC8 IRQ_HDMI_I2C#define IRQ_HSMMC0 COMBINER_IRQ(29, 0)#define IRQ_HSMMC1 COMBINER_IRQ(29, 1)arch/arm/mach- renamed from arch/arm/mach-s5pv310/include/mach/map.h +0
-0
s5pv310/include/mach/map.h
index 576ba55..0aa0171 100644arch/arm/mach-s5pv310/include/mach/map.h +1
-0@@ -120,6 +120,7 @@#define S3C_PA_IIC5 S5PV310_PA_IIC(5)#define S3C_PA_IIC6 S5PV310_PA_IIC(6)#define S3C_PA_IIC7 S5PV310_PA_IIC(7) +#define S3C_PA_IIC8 S5PV310_PA_IIC(8)#define S3C_PA_RTC S5PV310_PA_RTC#define S3C_PA_WDT S5PV310_PA_WATCHDOGarch/arm/plat-samsung/Kconfig +5
-0@@ -211,6 +211,11 @@ config S3C_DEV_I2C7 help Compile in platform device definition for I2C controller 7 +config S3C_DEV_I2C8 + bool + help + Compile in platform device definitions for I2C channel 8 (HDMIPHY) + config S3C_DEV_FB bool help(quoted diff) +0
-0b/arch/arm/plat-samsung/Makefile
Quoted 73 lines
index 7e92457..826ae4f 100644
arch/arm/plat-samsung/Makefile +1
-0@@ -46,6 +46,7 @@ obj-$(CONFIG_S3C_DEV_I2C4) += dev-i2c4.o obj-$(CONFIG_S3C_DEV_I2C5) += dev-i2c5.o obj-$(CONFIG_S3C_DEV_I2C6) += dev-i2c6.o obj-$(CONFIG_S3C_DEV_I2C7) += dev-i2c7.o +obj-$(CONFIG_S3C_DEV_I2C8) += dev-i2c8.o obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o obj-y += dev-uart.o obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.oarch/arm/plat-samsung/dev- renamed from arch/arm/plat-samsung/dev-i2c8.c +0
-0
i2c8.c
new file mode 100644
index 0000000..8edba7farch/arm/plat-samsung/dev-i2c8.c new file +55
-0@@ -0,0 +1,68 @@ +/* linux/arch/arm/plat-samsung/dev-i2c7.c +* +* Copyright (c) 2010 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* S3C series device definition for i2c device 8 +* +* Based on plat-samsung/dev-i2c8.c +* +* 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. +*/ + +#include <linux/gfp.h> +#include <linux/kernel.h> +#include <linux/string.h> +#include <linux/platform_device.h> + +#include <mach/irqs.h> +#include <mach/map.h> + +#include <plat/regs-iic.h> +#include <plat/iic.h> +#include <plat/devs.h> +#include <plat/cpu.h> + +static struct resource s3c_i2c_resource[] = { + [0 ] = { + .start =S3C_PA_IIC8 , + .end =S3C_PA_IIC8 +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .start =IRQ_IIC8 , + .end =IRQ_IIC8 , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device s3c_device_i2c8 = { + .name ="s3c2440-hdmiphy-i2c" , + .id =8 , + .num_resources =ARRAY_SIZE (s3c_i2c_resource), + .resource = s3c_i2c_resource, +}; + +static struct s3c2410_platform_i2c default_i2c_data8__initdata = { + .flags =0 , + .bus_num =8 , + .slave_addr =0x10 , + .frequency =400 *1000 , + .sda_delay =100 , +}; +arch/arm/plat-samsung/dev-i2c8.c line 65
Quoted 10 lines
arch/arm/plat-samsung/dev-i2c8.c new file +10
-0+void __init s3c_i2c8_set_platdata (struct s3c2410_platform_i2c *pd) +{ +struct s3c2410_platform_i2c *npd; + +if (!pd) + pd = &default_i2c_data8; + + npd =kmemdup (pd,sizeof (struct s3c2410_platform_i2c ),GFP_KERNEL ); +if (!npd) + printk(KERN_ERR "%s: no memory for platform data\n",
__func__);Quoted 29 lines
arch/arm/plat-samsung/dev-i2c8.c new file +3
-0+ + s3c_device_i2c8.dev.platform_data = npd; +}arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/devs.h +0
-0
samsung/include/plat/devs.h
index 6a869b8..f14709c 100644arch/arm/plat-samsung/include/plat/devs.h +1
-0@@ -53,6 +53,7 @@ extern struct platform_device s3c_device_i2c4;extern struct platform_device s3c_device_i2c5;extern struct platform_device s3c_device_i2c6;extern struct platform_device s3c_device_i2c7; +extern struct platform_device s3c_device_i2c8;extern struct platform_device s3c_device_rtc;extern struct platform_device s3c_device_adc;extern struct platform_device s3c_device_sdi;arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/iic.h +0
-0
samsung/include/plat/iic.h
index 1543da8..dd0d728 100644arch/arm/plat-samsung/include/plat/iic.h +1
-0@@ -60,6 +60,7 @@ extern void s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *i2c);extern void s3c_i2c5_set_platdata (struct s3c2410_platform_i2c *i2c);extern void s3c_i2c6_set_platdata (struct s3c2410_platform_i2c *i2c);extern void s3c_i2c7_set_platdata (struct s3c2410_platform_i2c *i2c); +extern void s3c_i2c8_set_platdata (struct s3c2410_platform_i2c *i2c);/* defined by architecture to configure gpio */ Quoted 3 lines
extern void
s3c_i2c0_cfg_gpio(struct platform_device *dev);
--
1.7.1.569.g6f426Basically, EXYNOS4 can't support I2C channel 8 for general purpose. Yeah, it is dedicated to HDMI..it means we can't use i2c8 stuff...
Quoted 1 line
(As a note, I2C interface for HDMI PHY is internally connected.)
This i2c8 interface is in fact specialized for hdmi-phy only, but it can perfectly use s3c-2410 i2c host bus driver. I definitely see no reason to reimplement i2c bus logic in the hdmi/tv driver just because it is a 'part of hdmi/tv driver'. The generic s3c2410-i2c driver should be used instead.
If you don't like above proposal, maybe the i2c8-dev.c should register itself as a generic "s3c2440-i2c" platform device data and exynos4 cpu startup code will rename it to "s3c2440-hdmi-phy-i2c" (the hdmiphy specialized version).
Note that a lot of drivers for advanced pci video capture cards use standard i2c bus drivers for controlling card-internal modules. If the other driver can be reused with a very little effort, why hesitate to use it?
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
PATCH v2 3/6 v4l: add macro for 1080p59_54 preset
In reply to Tomasz StanislawskiThe 1080p59_94 is supported in latest Samusng SoC.
--- drivers/media/video/v4l2-common.c | 1 + include/linux/videodev2.h | 1 + 2 files changed, 2 insertions(+), 0 deletions(-)
drivers/media/video/v4l2-common.c +1 -0
@@ -645,6 +645,7 @@ int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info) { 1920, 1080, "1080p@30" }, /* V4L2_DV_1080P30 */ { 1920, 1080, "1080p@50" }, /* V4L2_DV_1080P50 */ { 1920, 1080, "1080p@60" }, /* V4L2_DV_1080P60 */ + { 1920, 1080, "[email protected]" }, /* V4L2_DV_1080P59_94 */ };if (info ==NULL || preset >=ARRAY_SIZE (dv_presets))
include/linux/videodev2.h +1 -0
@@ -875,6 +875,7 @@ struct v4l2_dv_enum_preset {#define V4L2_DV_1080P30 16/* SMPTE 296M */ #define V4L2_DV_1080P50 17/* BT.1120 */ #define V4L2_DV_1080P60 18/* BT.1120 */ +#define V4L2_DV_1080P59_94 19/* * D V B T T I M I N G S
Signature · 1 line
1.7.1.569.g6f426
PATCH v2 4/6 s5p-tv: add driver for HDMI output on S5PC210 platform
In reply to Tomasz Stanislawskistp-tv: mixer: add watchdog timer for stream stopping
s5p-tv: mixer: fix cleaning list for enqueued buffers during stream stop
s5p-tv: mixer: add new debugging api
s5p-tv: mixer: port to new debugging API
s5p-tv: hdmi: fix missing owner module for subdev
s5p-tv: integrate with Runtime Power Management
s5p-tv: hdmiphy: fixed configuration handling
s5p-tv: mixer: fix freed mem usage
s5p-tv: fix sequence of power setup
s5p-tv: fix Kconfig
s5p-tv: mixer: add support for SYSMMU
s5p-tv: mixer: fix sysmmu and power setup sequence
s5p-tv: mixer: fix premature start of VP streaming
s5p-tv: hdmi: fix pink line bug
s5p-tv: hdmi: add controll for clocks and regulators
s5p-tv: mixer: add control for clocks and regulators
--- arch/arm/plat-samsung/include/plat/tv.h | 26 + drivers/media/video/Kconfig | 8 + drivers/media/video/Makefile | 1 + drivers/media/video/s5p-tv/Kconfig | 58 + drivers/media/video/s5p-tv/Makefile | 15 + drivers/media/video/s5p-tv/hdmi.h | 74 + drivers/media/video/s5p-tv/hdmi_drv.c | 963 ++++++++++++++ drivers/media/video/s5p-tv/hdmiphy_drv.c | 247 ++++ drivers/media/video/s5p-tv/mixer.h | 314 +++++ drivers/media/video/s5p-tv/mixer_drv.c | 487 +++++++ drivers/media/video/s5p-tv/mixer_grp_layer.c | 180 +++ drivers/media/video/s5p-tv/mixer_reg.c | 523 ++++++++ drivers/media/video/s5p-tv/mixer_reg.h | 44 + drivers/media/video/s5p-tv/mixer_video.c | 863 ++++++++++++ drivers/media/video/s5p-tv/mixer_vp_layer.c | 201 +++ drivers/media/video/s5p-tv/regs-hdmi.h | 1849 ++++++++++++++++++++++++++ drivers/media/video/s5p-tv/regs-vmx.h | 196 +++ drivers/media/video/s5p-tv/regs-vp.h | 277 ++++ 18 files changed, 6326 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-samsung/include/plat/tv.h create mode 100644 drivers/media/video/s5p-tv/Kconfig create mode 100644 drivers/media/video/s5p-tv/Makefile create mode 100644 drivers/media/video/s5p-tv/hdmi.h create mode 100644 drivers/media/video/s5p-tv/hdmi_drv.c create mode 100644 drivers/media/video/s5p-tv/hdmiphy_drv.c create mode 100644 drivers/media/video/s5p-tv/mixer.h create mode 100644 drivers/media/video/s5p-tv/mixer_drv.c create mode 100644 drivers/media/video/s5p-tv/mixer_grp_layer.c create mode 100644 drivers/media/video/s5p-tv/mixer_reg.c create mode 100644 drivers/media/video/s5p-tv/mixer_reg.h create mode 100644 drivers/media/video/s5p-tv/mixer_video.c create mode 100644 drivers/media/video/s5p-tv/mixer_vp_layer.c create mode 100644 drivers/media/video/s5p-tv/regs-hdmi.h create mode 100644 drivers/media/video/s5p-tv/regs-vmx.h create mode 100644 drivers/media/video/s5p-tv/regs-vp.h
arch/arm/plat-samsung/include/plat/tv.h new file +26 -0
@@ -0,0 +1,26 @@ +/* arch/arm/plat-samsung/include/plat/tv.h +* +* S5P - TV platform data definitions +* +* 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. +*/ + +#ifndef __PLAT_S5P_TV_H +#define __PLAT_S5P_TV_H __FILE__ + +#include <linux/device.h> + +struct mxr_platform_output { +char *output_name; +char *module_name; +}; + +struct mxr_platform_data { +struct mxr_platform_output *output; +int output_cnt; +}; + +#endif /* __PLAT_S5P_TV_H */ +
drivers/media/video/Kconfig +8 -0
@@ -1034,3 +1034,11 @@ config VIDEO_SAMSUNG_S5P_MFC MFC 5.1 driver for V4L2. endif # V4L_MEM2MEM_DRIVERS + +menuconfig VIDEO_SAMSUNG_S5P_TV + bool "Digital/analog TV output interfaces" + default y +if VIDEO_SAMSUNG_S5P_TV +source "drivers/media/video/s5p-tv/Kconfig" +endif # VIDEO_SAMSUNG_S5P_TV +
drivers/media/video/Makefile +1 -0
@@ -165,6 +165,7 @@ obj-$(CONFIG_VIDEO_SH_MOBILE_CEU) += sh_mobile_ceu_camera.o obj-$(CONFIG_VIDEO_OMAP1) += omap1_camera.o obj-$(CONFIG_VIDEO_SAMSUNG_S5P_FIMC) += s5p-fimc/ obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MFC) += s5p-mfc/ +obj-$(CONFIG_VIDEO_SAMSUNG_S5P_TV) += s5p-tv/ obj-$(CONFIG_ARCH_DAVINCI) += davinci/
drivers/media/video/s5p-tv/Kconfig new file +58 -0
58 lines not on this page · raw message
drivers/media/video/s5p-tv/Makefile new file +15 -0
@@ -0,0 +1,15 @@ +# drivers/media/video/samsung/tvout/Makefile +# +# Copyright (c) 2010 Samsung Electronics Co., Ltd. +# http://www.samsung.com/ +# Tomasz Stanislawski <[email protected]> +# +# Licensed under GPLv2 + +obj-$(CONFIG_VIDEO_SAMSUNG_S5P_HDMIPHY) += s5p-hdmiphy.o +s5p-hdmiphy-y += hdmiphy_drv.o +obj-$(CONFIG_VIDEO_SAMSUNG_S5P_HDMI) += s5p-hdmi.o +s5p-hdmi-y += hdmi_drv.o +obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MIXER) += s5p-mixer.o +s5p-mixer-y += mixer_drv.o mixer_video.o mixer_reg.o mixer_grp_layer.o mixer_vp_layer.o +
drivers/media/video/s5p-tv/hdmi.h new file +74 -0
74 lines not on this page · raw message
drivers/media/video/s5p-tv/hdmi_drv.c new file +963 -0
963 lines not on this page · raw message
drivers/media/video/s5p-tv/hdmiphy_drv.c new file +247 -0
247 lines not on this page · raw message
drivers/media/video/s5p-tv/mixer.h new file +314 -0
314 lines not on this page · raw message
drivers/media/video/s5p-tv/mixer_drv.c new file +487 -0
487 lines not on this page · raw message
drivers/media/video/s5p-tv/mixer_grp_layer.c new file +180 -0
180 lines not on this page · raw message
drivers/media/video/s5p-tv/mixer_reg.c new file +523 -0
523 lines not on this page · raw message
drivers/media/video/s5p-tv/mixer_reg.h new file +44 -0
44 lines not on this page · raw message
drivers/media/video/s5p-tv/mixer_video.c new file +863 -0
51 lines not on this page · raw message
drivers/media/video/s5p-tv/mixer_vp_layer.c new file +201 -0
201 lines not on this page · raw message
drivers/media/video/s5p-tv/regs-hdmi.h new file +1849 -0
1,849 lines not on this page · raw message
drivers/media/video/s5p-tv/regs-vmx.h new file +196 -0
196 lines not on this page · raw message
drivers/media/video/s5p-tv/regs-vp.h new file +277 -0
277 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.1.569.g6f426
Part of the diff is not shown here. View the raw message.
PATCH v2 5/6 s5pv310: add s5p-tv to platform devices
In reply to Tomasz Stanislawskis5pv310: fix and clean code for TV power
s5pv310: tv: fix clock setup
s5pv310: tv: integrate with Power Domain driver
s5pv310: tv: register fix
s5pv310: tv: add port HDMI_EN1 gpio to regulator api
s5pv310: tv: use hdmiphy as clock
s5pv310: tv: moved TV setup to separete function
s5pv310: hdmi: removed control for clocks and regulators
s5pv310: mixer: removed control for clocks and regulators
--- arch/arm/mach-s5pv310/Kconfig | 5 + arch/arm/mach-s5pv310/Makefile | 1 + arch/arm/mach-s5pv310/clock.c | 132 ++++++++++++++++++++++- arch/arm/mach-s5pv310/dev-tv.c | 103 ++++++++++++++++++ arch/arm/mach-s5pv310/include/mach/irqs.h | 4 + arch/arm/mach-s5pv310/include/mach/map.h | 26 +++++ arch/arm/mach-s5pv310/include/mach/regs-clock.h | 3 + arch/arm/mach-s5pv310/include/mach/regs-pmu.h | 2 + arch/arm/plat-samsung/include/plat/devs.h | 2 + 9 files changed, 277 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-s5pv310/dev-tv.c
arch/arm/mach-s5pv310/Kconfig +5 -0
@@ -20,6 +20,11 @@ config S5PV310_DEV_PD help Compile in platform device definitions for Power Domain +config S5PV310_DEV_TV + bool + help + Compile in platform device definition for TV interface + config S5PV310_SETUP_I2C1 bool help
arch/arm/mach-s5pv310/Makefile +1 -0
@@ -32,6 +32,7 @@ obj-y += dev-audio.o obj-$(CONFIG_S5PV310_DEV_PD) += dev-pd.o obj-$(CONFIG_S5PV310_DEV_SYSMMU) += dev-sysmmu.o +obj-$(CONFIG_S5PV310_DEV_TV) += dev-tv.o obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o obj-$(CONFIG_S5PV310_SETUP_I2C2) += setup-i2c2.o obj-$(CONFIG_S5PV310_SETUP_I2C3) += setup-i2c3.o
arch/arm/mach-s5pv310/clock.c +131 -1
174 lines not on this page · raw message
arch/arm/mach-s5pv310/dev-tv.c new file +103 -0
103 lines not on this page · raw message
arch/arm/mach-s5pv310/include/mach/irqs.h +4 -0
@@ -121,6 +121,10 @@#define IRQ_MCT_L1 COMBINER_IRQ(35, 3) +/* Set the default NR_IRQS */ +#define IRQ_MIXER COMBINER_IRQ(36, 0) +#define IRQ_TVENC COMBINER_IRQ(36, 1) +#define IRQ_EINT4 COMBINER_IRQ(37, 0)#define IRQ_EINT5 COMBINER_IRQ(37, 1)#define IRQ_EINT6 COMBINER_IRQ(37, 2)
arch/arm/mach-s5pv310/include/mach/map.h +26 -0
@@ -152,4 +152,30 @@#define S5P_SZ_UART SZ_256 +/* CEC */ +#define S5PV210_PA_CEC (0x100B0000) +#define S5P_PA_CEC S5PV210_PA_CEC +#define S5P_SZ_CEC SZ_4K + +/* TVOUT */ +#define S5PV210_PA_TVENC (0x12C20000) +#define S5P_PA_TVENC S5PV210_PA_TVENC +#define S5P_SZ_TVENC SZ_64K + +#define S5PV210_PA_VP (0x12C00000) +#define S5P_PA_VP S5PV210_PA_VP +#define S5P_SZ_VP SZ_64K + +#define S5PV210_PA_MIXER (0x12C10000) +#define S5P_PA_MIXER S5PV210_PA_MIXER +#define S5P_SZ_MIXER SZ_64K + +#define S5PV210_PA_HDMI (0x12D00000) +#define S5P_PA_HDMI S5PV210_PA_HDMI +#define S5P_SZ_HDMI SZ_1M + +#define S5PV210_I2C_HDMI_PHY (0x138E0000) +#define S5P_I2C_HDMI_PHY S5PV210_I2C_HDMI_PHY +#define S5P_I2C_HDMI_SZ_PHY SZ_1K +#endif /* __ASM_ARCH_MAP_H */
arch/arm/mach-s5pv310/include/mach/regs-clock.h +3 -0
@@ -33,6 +33,7 @@#define S5P_CLKSRC_TOP0 S5P_CLKREG(0x0C210)#define S5P_CLKSRC_TOP1 S5P_CLKREG(0x0C214)#define S5P_CLKSRC_CAM S5P_CLKREG(0x0C220) +#define S5P_CLKSRC_TV S5P_CLKREG(0x0C224)#define S5P_CLKSRC_IMAGE S5P_CLKREG(0x0C230)#define S5P_CLKSRC_LCD0 S5P_CLKREG(0x0C234)#define S5P_CLKSRC_LCD1 S5P_CLKREG(0x0C238)
@@ -42,6 +43,7 @@#define S5P_CLKDIV_TOP S5P_CLKREG(0x0C510)#define S5P_CLKDIV_CAM S5P_CLKREG(0x0C520) +#define S5P_CLKDIV_TV S5P_CLKREG(0x0C524)#define S5P_CLKDIV_IMAGE S5P_CLKREG(0x0C530)#define S5P_CLKDIV_LCD0 S5P_CLKREG(0x0C534)#define S5P_CLKDIV_LCD1 S5P_CLKREG(0x0C538)
@@ -58,6 +60,7 @@#define S5P_CLKSRC_MASK_TOP S5P_CLKREG(0x0C310)#define S5P_CLKSRC_MASK_CAM S5P_CLKREG(0x0C320) +#define S5P_CLKSRC_MASK_TV S5P_CLKREG(0x0C324)#define S5P_CLKSRC_MASK_LCD0 S5P_CLKREG(0x0C334)#define S5P_CLKSRC_MASK_LCD1 S5P_CLKREG(0x0C338)#define S5P_CLKSRC_MASK_FSYS S5P_CLKREG(0x0C340)
arch/arm/mach-s5pv310/include/mach/regs-pmu.h +2 -0
@@ -27,4 +27,6 @@#define S5P_INT_LOCAL_PWR_EN 0x7 +#define S5P_HDMI_PHY_CONTROL S5P_PMUREG(0x0700) +#endif /* __ASM_ARCH_REGS_PMU_H */
arch/arm/plat-samsung/include/plat/devs.h +2 -0
@@ -135,6 +135,8 @@ extern struct platform_device s5p_device_fimc0;extern struct platform_device s5p_device_fimc1;extern struct platform_device s5p_device_fimc2;extern struct platform_device s5p_device_fimc3; +extern struct platform_device s5p_device_hdmi; +extern struct platform_device s5p_device_mixer;extern struct platform_device s5p_device_mfc;extern struct platform_device s5p_device_mipi_csis0;
Signature · 1 line
1.7.1.569.g6f426
PATCH v2 6/6 s5pv310: add s5p-tv to Universal C210 board
In reply to Tomasz Stanislawski--- arch/arm/mach-s5pv310/Kconfig | 2 + arch/arm/mach-s5pv310/mach-universal_c210.c | 54 +++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv310/Kconfig +2 -0
@@ -112,10 +112,12 @@ config MACH_UNIVERSAL_C210 select S5PV310_SETUP_SDHCI select S3C_DEV_I2C1 select S3C_DEV_I2C5 + select S3C_DEV_I2C8 select S5P_DEV_MFC select S5PV310_DEV_PD select S5PV310_DEV_SYSMMU select S5PV310_SETUP_I2C1 + select S5PV310_DEV_TV select S5PV310_SETUP_I2C5 help Machine support for Samsung Mobile Universal S5PC210 Reference
arch/arm/mach-s5pv310/mach-universal_c210.c +54 -0
92 lines not on this page · raw message
Signature · 1 line
1.7.1.569.g6f426
Hi all,
As I know, S5P-TV(HDMI) stuff needs more discussion.
I don't want to just merge platform devices which is not used anywhere. Besides, there are two schemes for it in mailing list now.
I think we have to improve this next time and need to focus more on its driver now.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
Quoted 19 lines · Tomasz Stanislawski
From: Marek Szyprowski <[email protected]>
Hello,
I would like to present the second version of HDMI driver for S5PC210 platform.
The driver is under a heavy development. The most recent changes are:1. Minor bugs and fixes:
- pink line on left side of display
- premature start of VP's streaming
- usage of free memory
- usage of non-initialized variables
- fixed sequence of power setup
- dependencies inKconfig2. Integration with Runtime Power Managment and Power Domain driver.
Quoted 7 lines
3. The CMA was substituted by the SYSMMU driver.
4. Applying existing frameworks:
- activation of HDMIPHY using clock API
- control of power on HDMI-5V pin using regulator API5. Moving all clocks and regulator management from platform to the
drivers'
Quoted 8 lines
code.
6. Redesigned the control of mixer's debugging.
7. Added a watchdog to deal with HW failures.
Original HDMI driver RFC:
Quoted 7 lines
==============
Introduction
==============The purpose of this RFC is to discuss the driver for a TV output interface available in upcoming Samsung SoC. The HW is able to generate digital and analog signals. Current version of the driver supports only digital
output.
Quoted 6 lines
Internally the driver uses videobuf2 framework, and CMA memory allocator. Not
all of them are merged by now, but I decided to post the sources to start discussion driver's design.
Quoted 8 lines
======================
Hardware description
======================The SoC contains a few HW sub-blocks:
1. Video Processor (VP). It is used for processing of NV12 data. An image stored in RAM is accessed by DMA. Pixels are cropped, scaled.
Additionally,
Quoted 8 lines
post processing operations like brightness, sharpness and contrast adjustments
could be performed. The output in YCbCr444 format is send to Mixer.2. Mixer (MXR). The piece of hardware responsible for mixing and blending multiple data inputs before passing it to an output device. The MXR is capable
of handling up to three image layers. One is the output of VP. Other two
are
Quoted 3 lines
images in RGB format (multiple variants are supported). The layers are scaled,
cropped and blended with background color. The blending factor, and
layers'
Quoted 5 lines
priority are controlled by MXR's registers. The output is passed either to HDMI
or TVOUT.3. HDMI. The piece of HW responsible for generation of HDMI packets. It
takes
Quoted 1 line
pixel data from mixer and transforms it into data frames. The output is
send
Quoted 3 lines
to HDMIPHY interface.
4. HDMIPHY. Physical interface for HDMI. Its duties are sending HDMI
packets
Quoted 2 lines
to
HDMI connector. Basically, it contains a PLL that produces source clock
for
Quoted 43 lines
Mixer, VP and HDMI during streaming.
5. TVOUT. Generation of TV analog signal. (driver not implemented)
6. VideoDAC. Modulator for TVOUT signal. (driver not implemented)
The diagram below depicts connection between all HW pieces.
+-----------+ NV12 data ---dma--->| Video | | Processor | +-----------+ | V +-----------+ RGB data ---dma--->| | | Mixer | RGB data ---dma--->| | +-----------+ | * dmux / +-----* *------+ | | V V +-----------+ +-----------+ | HDMI | | TVOUT | +-----------+ +-----------+ | | V V +-----------+ +-----------+ | HDMIPHY | | VideoDAC | +-----------+ +-----------+ | | V V HDMI Composite connector connector==================
Driver interface
==================
Quoted 5 lines
The posted driver implements three V4L2 nodes. Every video node implements V4L2
output buffer. One of nodes corresponds to input of Video Processor. The other
two nodes correspond to RGB inputs of Mixer. All nodes share the same
output.
Quoted 1 line
It is one of the Mixer's outputs: TVOUT or HDMI. Changing output in one
layer
Quoted 1 line
using
S_OUTPUTwould change outputs of all other video nodes. The same
thing
Quoted 1 line
happens if one try to reconfigure output i.e. by calling
S_DV_PRESET.
However
Quoted 1 line
it not possible to change or reconfigure the output while streaming. To
sum
Quoted 6 lines
up,
all features in posted version of driver goes as follows:1. QUERYCAP
2.S_FMT,G_FMT- single and multiplanar API
a) node named video0 supports formats NV12, NV12, NV12T (tiled version
of
Quoted 2 lines
NV12), NV12MT (multiplane version of NV12T).
b) nodes named graph0 and graph1 support formats RGB565, ARGB1555,
ARGB4444,
Quoted 3 lines
ARGB8888.
3. Buffer with USERPTR and MMAP memory.
4. Streaming and buffer control. (STREAMON, STREAMOFF, REQBUF, QBUF,
DQBUF)
Quoted 2 lines
5. OUTPUT enumeration.
6. DV preset control (SET, GET, ENUM). Currently modes 480P59_94,
720P59_94,
Quoted 2 lines
1080P30, 1080P59_94 and 1080P60 work.
7. Positioning layer's window on output display usingS_CROP,G_GROP,
CROPCAP.
Quoted 1 line
8. Positioning and cropping data in buffer using
S_CROP,G_GROP, CROPCAP
with
Quoted 13 lines
buffer type OVERLAY. *
TODOs:
- add analog TVOUT driver
- addS_OUTPUT
- addS_STDioctl
- add control of alpha blending / chroma keying via V4L2 controls
- add controls for luminance curve and sharpness in VP
- consider exporting all output functionalities to separate video node
- consider media controller framework
- better control over debugging
- fix dependency between all TV drivers
Quoted 7 lines
* The need of cropping in source buffers came from problem with MFC driver for
S5P. The MFC supports only width divisible by 64. If a width of a decoded movie
is not aligned do 64 then padding pixels are filled with zeros. This is an ugly
green color in YCbCr colorspace. Filling it with zeros by a CPU is a waste
of
Quoted 3 lines
resources since an image can be cropped in VP. Is it possible to set crops for
user data for M2M devices. V4L2 lacks such functionality of non-M2M
devices.
Quoted 1 line
Therefore cropping in buffer
V4L2_BUF_TYPE_VIDEO_OVERLAYwas used as an
work
Quoted 9 lines
around.
=====================
Device Architecture
=====================Three drivers are added in this patch.
1. HDMIPHY. It is an I2C driver for HDMIPHY interface. It exports
following
Quoted 4 lines
callback by V4L2 subdevice:
-s_power: currently stub
-s_stream: configures and starts/stops HDMIPHY
-s_dv_preset: used to choose proper frequency of clock for other TV
devices
Quoted 2 lines
2. HDMI. The auxiliary driver used to control HDMI interface. It exports
its
Quoted 1 line
subdev to a subdev pool for use by other drivers. The following callbacks
are
Quoted 6 lines
implemented:
-s_power: runs HDMI hardware, regulators and clocks.
-s_stream: runs HDMIPHY and starts generation of video frames.
-enum_dv_presets
-s_dv_preset
-g_mbus_format: returns information on data format expected by on HDMI
input
Quoted 1 line
The driver supports an interrupt. It is used to detect plug/unplug
events
Quoted 2 lines
in
kernel debugs. The API for detection of such an events in V4L2 API is to
be
Quoted 6 lines
defined.
3. Mixer & Video Processor driver. It is called 's5p-mixer' because of historical reasons. It was decided combine VP and MXR drivers into one because
of shared interrupt and very similar interface via V4L2 nodes. The driver
is
Quoted 6 lines
a
realization of many-to-many relation between multiple input layers and multiple
outputs. All shared resources are kept in structmxr_device. It provides utilities for management and synchronization of access to resources and reference counting. The outputs are obtained from subdev pool basing on
names
Quoted 2 lines
supplied in platform data. One layer is a single video node. Since layers differs simple inheritance is applied. Every layer type implements set of
ops.
Quoted 3 lines
There are different ops for Mixer layers and other for VP layer.
The videobuf2 framework was used for the management of buffers and
streaming.
Quoted 1 line
All other V4L2 ioctls are processed in layers common interface. The CMA
was
Quoted 9 lines
used as memory allocator for Mixer's buffers. It could be easily exchanged with
any other allocator integrated with videobuf2 framework.Driver is not yet integrated with power domain driver. Moreover one of mixer's
clocks has to change parent while entering streaming mode. Therefore all power
and clock management was moved to platform data until final solutions
emerges.
Quoted 9 lines
===============
Usage summary
===============Follow steps below to display double-buffered animation on HDMI output.
01. Open video node named graph0.
02. S_FMT(type = OUTPUT, pixelformat = V4L2_PIX_FMT_RGB*, width, height,
...)
Quoted 83 lines
03.
REQ_BUFS(type = OUTPUT, memory = MMAP, count = 2)
04.MMAP(type = OUTPUT, index = 0)
05.MMAP(type = OUTPUT, index = 1)
06. Fill buffer 0 with data
07.QBUF(type = OUTPUT, index = 0)
08.STREAM_ON(type = OUTPUT)
09. Fill buffer 1 with data
10.QBUF(type = OUTPUT, index = 1)
11. DQBUF(type = OUTPUT)
12.QBUF(type = OUTPUT, index = 0)
13. DQBUF(type = OUTPUT)
14. Goto 09===============
Patch Summary
===============Tomasz Stanislawski (6):
i2c-s3c2410: fix I2C dedicated for hdmiphy
universal: i2c: add I2C controller 8 (HDMIPHY)
v4l: add macro for 1080p59_54 preset
s5p-tv: add driver for HDMI output on S5PC210 platform
s5pv310: add s5p-tv to platform devices
s5pv310: add s5p-tv to Universal C210 boardarch/arm/mach-s5pv310/Kconfig | 7 + arch/arm/mach-s5pv310/Makefile | 1 + arch/arm/mach-s5pv310/clock.c | 138 ++- arch/arm/mach-s5pv310/dev-tv.c | 103 ++ arch/arm/mach-s5pv310/include/mach/irqs.h | 8 + arch/arm/mach-s5pv310/include/mach/map.h | 27 + arch/arm/mach-s5pv310/include/mach/regs-clock.h | 3 + arch/arm/mach-s5pv310/include/mach/regs-pmu.h | 2 + arch/arm/mach-s5pv310/mach-universal_c210.c | 54 + arch/arm/plat-samsung/Kconfig | 5 + arch/arm/plat-samsung/Makefile | 1 + arch/arm/plat-samsung/dev-i2c8.c | 68 + arch/arm/plat-samsung/include/plat/devs.h | 3 + arch/arm/plat-samsung/include/plat/iic.h | 1 + arch/arm/plat-samsung/include/plat/tv.h | 26 + drivers/i2c/busses/i2c-s3c2410.c | 36 +- drivers/media/video/Kconfig | 8 + drivers/media/video/Makefile | 1 + drivers/media/video/s5p-tv/Kconfig | 58 + drivers/media/video/s5p-tv/Makefile | 15 + drivers/media/video/s5p-tv/hdmi.h | 74 + drivers/media/video/s5p-tv/hdmi_drv.c | 963 ++++++++++++ drivers/media/video/s5p-tv/hdmiphy_drv.c | 247 +++ drivers/media/video/s5p-tv/mixer.h | 314 ++++ drivers/media/video/s5p-tv/mixer_drv.c | 487 ++++++ drivers/media/video/s5p-tv/mixer_grp_layer.c | 180 +++ drivers/media/video/s5p-tv/mixer_reg.c | 523 +++++++ drivers/media/video/s5p-tv/mixer_reg.h | 44 + drivers/media/video/s5p-tv/mixer_video.c | 863 +++++++++++ drivers/media/video/s5p-tv/mixer_vp_layer.c | 201 +++ drivers/media/video/s5p-tv/regs-hdmi.h | 1849 +++++++++++++++++++++++ drivers/media/video/s5p-tv/regs-vmx.h | 196 +++ drivers/media/video/s5p-tv/regs-vp.h | 277 ++++ drivers/media/video/v4l2-common.c | 1 + include/linux/videodev2.h | 1 + 35 files changed, 6783 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-s5pv310/dev-tv.c create mode 100644 arch/arm/plat-samsung/dev-i2c8.c create mode 100644 arch/arm/plat-samsung/include/plat/tv.h create mode 100644 drivers/media/video/s5p-tv/Kconfig create mode 100644 drivers/media/video/s5p-tv/Makefile create mode 100644 drivers/media/video/s5p-tv/hdmi.h create mode 100644 drivers/media/video/s5p-tv/hdmi_drv.c create mode 100644 drivers/media/video/s5p-tv/hdmiphy_drv.c create mode 100644 drivers/media/video/s5p-tv/mixer.h create mode 100644 drivers/media/video/s5p-tv/mixer_drv.c create mode 100644 drivers/media/video/s5p-tv/mixer_grp_layer.c create mode 100644 drivers/media/video/s5p-tv/mixer_reg.c create mode 100644 drivers/media/video/s5p-tv/mixer_reg.h create mode 100644 drivers/media/video/s5p-tv/mixer_video.c create mode 100644 drivers/media/video/s5p-tv/mixer_vp_layer.c create mode 100644 drivers/media/video/s5p-tv/regs-hdmi.h create mode 100644 drivers/media/video/s5p-tv/regs-vmx.h create mode 100644 drivers/media/video/s5p-tv/regs-vp.h--
1.7.1.569.g6f426
Quoted 7 lines · Kukjin Kim
Hi all,
As I know, S5P-TV(HDMI) stuff needs more discussion.
I don't want to just merge platform devices which is not used anywhere.
Besides, there are two schemes for it in mailing list now.
It's different one, which scheme is used at multimedia, platform devices are same.
Quoted 3 lines
I think we have to improve this next time and need to focus more on its driver now.
As you said, arch supports the platform devices, we focus on only driver itself.
Quoted 366 lines
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.Quoted 19 lines · Tomasz Stanislawski
From: Marek Szyprowski <[email protected]>
Hello,
I would like to present the second version of HDMI driver for S5PC210 platform.
The driver is under a heavy development. The most recent changes are:1. Minor bugs and fixes:
- pink line on left side of display
- premature start of VP's streaming
- usage of free memory
- usage of non-initialized variables
- fixed sequence of power setup
- dependencies inKconfig2. Integration with Runtime Power Managment and Power Domain driver.
Quoted 7 lines
3. The CMA was substituted by the SYSMMU driver.
4. Applying existing frameworks:
- activation of HDMIPHY using clock API
- control of power on HDMI-5V pin using regulator API5. Moving all clocks and regulator management from platform to the
drivers'
Quoted 8 lines
code.
6. Redesigned the control of mixer's debugging.
7. Added a watchdog to deal with HW failures.
Original HDMI driver RFC:
Quoted 7 lines
==============
Introduction
==============The purpose of this RFC is to discuss the driver for a TV output interface available in upcoming Samsung SoC. The HW is able to generate digital and analog signals. Current version of the driver supports only digital
output.
Quoted 6 lines
Internally the driver uses videobuf2 framework, and CMA memory allocator. Not
all of them are merged by now, but I decided to post the sources to start discussion driver's design.Quoted 8 lines
======================
Hardware description
======================The SoC contains a few HW sub-blocks:
1. Video Processor (VP). It is used for processing of NV12 data. An image stored in RAM is accessed by DMA. Pixels are cropped, scaled.
Additionally,
Quoted 8 lines
post processing operations like brightness, sharpness and contrast adjustments
could be performed. The output in YCbCr444 format is send to Mixer.2. Mixer (MXR). The piece of hardware responsible for mixing and blending multiple data inputs before passing it to an output device. The MXR is capable
of handling up to three image layers. One is the output of VP. Other twoare
Quoted 3 lines
images in RGB format (multiple variants are supported). The layers are scaled,
cropped and blended with background color. The blending factor, andlayers'
Quoted 5 lines
priority are controlled by MXR's registers. The output is passed either to HDMI
or TVOUT.3. HDMI. The piece of HW responsible for generation of HDMI packets. It
takes
Quoted 1 line
pixel data from mixer and transforms it into data frames. The output is
send
Quoted 3 lines
to HDMIPHY interface.
4. HDMIPHY. Physical interface for HDMI. Its duties are sending HDMI
packets
Quoted 2 lines
to
HDMI connector. Basically, it contains a PLL that produces source clockfor
Quoted 43 lines
Mixer, VP and HDMI during streaming.
5. TVOUT. Generation of TV analog signal. (driver not implemented)
6. VideoDAC. Modulator for TVOUT signal. (driver not implemented)
The diagram below depicts connection between all HW pieces.
+-----------+ NV12 data ---dma--->| Video | | Processor | +-----------+ | V +-----------+ RGB data ---dma--->| | | Mixer | RGB data ---dma--->| | +-----------+ | * dmux / +-----* *------+ | | V V +-----------+ +-----------+ | HDMI | | TVOUT | +-----------+ +-----------+ | | V V +-----------+ +-----------+ | HDMIPHY | | VideoDAC | +-----------+ +-----------+ | |V V
HDMI Composite
connector connector==================
Driver interface
==================Quoted 5 lines
The posted driver implements three V4L2 nodes. Every video node implements V4L2
output buffer. One of nodes corresponds to input of Video Processor. The other
two nodes correspond to RGB inputs of Mixer. All nodes share the sameoutput.
Quoted 1 line
It is one of the Mixer's outputs: TVOUT or HDMI. Changing output in one
layer
Quoted 1 line
using
S_OUTPUTwould change outputs of all other video nodes. The samething
Quoted 1 line
happens if one try to reconfigure output i.e. by calling
S_DV_PRESET.However
Quoted 1 line
it not possible to change or reconfigure the output while streaming. To
sum
Quoted 6 lines
up,
all features in posted version of driver goes as follows:1. QUERYCAP
2.S_FMT,G_FMT- single and multiplanar API
a) node named video0 supports formats NV12, NV12, NV12T (tiled versionof
Quoted 2 lines
NV12), NV12MT (multiplane version of NV12T).
b) nodes named graph0 and graph1 support formats RGB565, ARGB1555,ARGB4444,
Quoted 3 lines
ARGB8888.
3. Buffer with USERPTR and MMAP memory.
4. Streaming and buffer control. (STREAMON, STREAMOFF, REQBUF, QBUF,DQBUF)
Quoted 2 lines
5. OUTPUT enumeration.
6. DV preset control (SET, GET, ENUM). Currently modes 480P59_94,720P59_94,
Quoted 2 lines
1080P30, 1080P59_94 and 1080P60 work.
7. Positioning layer's window on output display usingS_CROP,G_GROP,CROPCAP.
Quoted 1 line
8. Positioning and cropping data in buffer using
S_CROP,G_GROP, CROPCAPwith
Quoted 13 lines
buffer type OVERLAY. *
TODOs:
- add analog TVOUT driver
- addS_OUTPUT
- addS_STDioctl
- add control of alpha blending / chroma keying via V4L2 controls
- add controls for luminance curve and sharpness in VP
- consider exporting all output functionalities to separate video node
- consider media controller framework
- better control over debugging
- fix dependency between all TV driversQuoted 7 lines
* The need of cropping in source buffers came from problem with MFC driver for
S5P. The MFC supports only width divisible by 64. If a width of a decoded movie
is not aligned do 64 then padding pixels are filled with zeros. This is an ugly
green color in YCbCr colorspace. Filling it with zeros by a CPU is a wasteof
Quoted 3 lines
resources since an image can be cropped in VP. Is it possible to set crops for
user data for M2M devices. V4L2 lacks such functionality of non-M2Mdevices.
Quoted 1 line
Therefore cropping in buffer
V4L2_BUF_TYPE_VIDEO_OVERLAYwas used as anwork
Quoted 9 lines
around.
=====================
Device Architecture
=====================Three drivers are added in this patch.
1. HDMIPHY. It is an I2C driver for HDMIPHY interface. It exports
following
Quoted 4 lines
callback by V4L2 subdevice:
-s_power: currently stub
-s_stream: configures and starts/stops HDMIPHY
-s_dv_preset: used to choose proper frequency of clock for other TVdevices
Quoted 2 lines
2. HDMI. The auxiliary driver used to control HDMI interface. It exports
its
Quoted 1 line
subdev to a subdev pool for use by other drivers. The following callbacks
are
Quoted 6 lines
implemented:
-s_power: runs HDMI hardware, regulators and clocks.
-s_stream: runs HDMIPHY and starts generation of video frames.
-enum_dv_presets
-s_dv_preset
-g_mbus_format: returns information on data format expected by on HDMIinput
Quoted 1 line
The driver supports an interrupt. It is used to detect plug/unplug
events
Quoted 2 lines
in
kernel debugs. The API for detection of such an events in V4L2 API is tobe
Quoted 6 lines
defined.
3. Mixer & Video Processor driver. It is called 's5p-mixer' because of historical reasons. It was decided combine VP and MXR drivers into one because
of shared interrupt and very similar interface via V4L2 nodes. The driveris
Quoted 6 lines
a
realization of many-to-many relation between multiple input layers and multiple
outputs. All shared resources are kept in structmxr_device. It provides utilities for management and synchronization of access to resources and reference counting. The outputs are obtained from subdev pool basing onnames
Quoted 2 lines
supplied in platform data. One layer is a single video node. Since layers differs simple inheritance is applied. Every layer type implements set of
ops.
Quoted 3 lines
There are different ops for Mixer layers and other for VP layer.
The videobuf2 framework was used for the management of buffers and
streaming.
Quoted 1 line
All other V4L2 ioctls are processed in layers common interface. The CMA
was
Quoted 9 lines
used as memory allocator for Mixer's buffers. It could be easily exchanged with
any other allocator integrated with videobuf2 framework.Driver is not yet integrated with power domain driver. Moreover one of mixer's
clocks has to change parent while entering streaming mode. Therefore all power
and clock management was moved to platform data until final solutionsemerges.
Quoted 9 lines
===============
Usage summary
===============Follow steps below to display double-buffered animation on HDMI output.
01. Open video node named graph0.
02. S_FMT(type = OUTPUT, pixelformat = V4L2_PIX_FMT_RGB*, width, height,...)
Quoted 81 lines
03.
REQ_BUFS(type = OUTPUT, memory = MMAP, count = 2)
04.MMAP(type = OUTPUT, index = 0)
05.MMAP(type = OUTPUT, index = 1)
06. Fill buffer 0 with data
07.QBUF(type = OUTPUT, index = 0)
08.STREAM_ON(type = OUTPUT)
09. Fill buffer 1 with data
10.QBUF(type = OUTPUT, index = 1)
11. DQBUF(type = OUTPUT)
12.QBUF(type = OUTPUT, index = 0)
13. DQBUF(type = OUTPUT)
14. Goto 09===============
Patch Summary
===============Tomasz Stanislawski (6):
i2c-s3c2410: fix I2C dedicated for hdmiphy
universal: i2c: add I2C controller 8 (HDMIPHY)
v4l: add macro for 1080p59_54 preset
s5p-tv: add driver for HDMI output on S5PC210 platform
s5pv310: add s5p-tv to platform devices
s5pv310: add s5p-tv to Universal C210 boardarch/arm/mach-s5pv310/Kconfig | 7 + arch/arm/mach-s5pv310/Makefile | 1 + arch/arm/mach-s5pv310/clock.c | 138 ++- arch/arm/mach-s5pv310/dev-tv.c | 103 ++arch/arm/mach-s5pv310/include/mach/irqs.h | 8 +
arch/arm/mach-s5pv310/include/mach/map.h| 27 +arch/arm/mach-s5pv310/include/mach/regs-clock.h| 3 +arch/arm/mach-s5pv310/include/mach/regs-pmu.h| 2 +arch/arm/mach-s5pv310/mach-universal_c210.c| 54 +arch/arm/plat-samsung/Kconfig| 5 +arch/arm/plat-samsung/Makefile| 1 +arch/arm/plat-samsung/dev-i2c8.c| 68 +arch/arm/plat-samsung/include/plat/devs.h| 3 +arch/arm/plat-samsung/include/plat/iic.h| 1 +arch/arm/plat-samsung/include/plat/tv.h| 26 +drivers/i2c/busses/i2c-s3c2410.c| 36 +-drivers/media/video/Kconfig| 8 +drivers/media/video/Makefile| 1 +drivers/media/video/s5p-tv/Kconfig| 58 +drivers/media/video/s5p-tv/Makefile| 15 +drivers/media/video/s5p-tv/hdmi.h| 74 +drivers/media/video/s5p-tv/hdmi_drv.c| 963 ++++++++++++drivers/media/video/s5p-tv/hdmiphy_drv.c| 247 +++drivers/media/video/s5p-tv/mixer.h| 314 ++++drivers/media/video/s5p-tv/mixer_drv.c| 487 ++++++drivers/media/video/s5p-tv/mixer_grp_layer.c| 180 +++drivers/media/video/s5p-tv/mixer_reg.c| 523 +++++++drivers/media/video/s5p-tv/mixer_reg.h| 44 +drivers/media/video/s5p-tv/mixer_video.c| 863 +++++++++++drivers/media/video/s5p-tv/mixer_vp_layer.c| 201 +++drivers/media/video/s5p-tv/regs-hdmi.h| 1849
+++++++++++++++++++++++
drivers/media/video/s5p-tv/regs-vmx.h | 196 +++drivers/media/video/s5p-tv/regs-vp.h| 277 ++++drivers/media/video/v4l2-common.c| 1 +include/linux/videodev2.h| 1 +35 files changed, 6783 insertions(+), 2 deletions(-)create mode 100644
arch/arm/mach-s5pv310/dev-tv.ccreate mode 100644arch/arm/plat-samsung/dev-i2c8.ccreate mode 100644arch/arm/plat-samsung/include/plat/tv.hcreate mode 100644drivers/media/video/s5p-tv/Kconfigcreate mode 100644drivers/media/video/s5p-tv/Makefilecreate mode 100644drivers/media/video/s5p-tv/hdmi.hcreate mode 100644drivers/media/video/s5p-tv/hdmi_drv.ccreate mode 100644drivers/media/video/s5p-tv/hdmiphy_drv.ccreate mode 100644drivers/media/video/s5p-tv/mixer.hcreate mode 100644drivers/media/video/s5p-tv/mixer_drv.ccreate mode 100644drivers/media/video/s5p-tv/mixer_grp_layer.ccreate mode 100644drivers/media/video/s5p-tv/mixer_reg.ccreate mode 100644drivers/media/video/s5p-tv/mixer_reg.hcreate mode 100644drivers/media/video/s5p-tv/mixer_video.ccreate mode 100644drivers/media/video/s5p-tv/mixer_vp_layer.ccreate mode 100644drivers/media/video/s5p-tv/regs-hdmi.hcreate mode 100644drivers/media/video/s5p-tv/regs-vmx.hcreate mode 100644drivers/media/video/s5p-tv/regs-vp.hQuoted 2 lines
--
1.7.1.569.g6f426--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html