Skip to contentSkip to conversation

TV driver for Samsung Exynos4 platform (platform-part)

PATCH New Tomasz Stanislawski 1 participant 5 messages Apr 11, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover TV driver for Samsung Exynos4 platform (platform-part)

Hello Everyone,
This patchset introduce TV devices to Samsung Exynos4 platform (former s5pv310). It is dedicated for 2.6.39-rc1 kernel. It is the third version of a TV driver. The platform part was moved to a separate patchset. Moreover, the patchset adds following auxiliary entities:
- I2C controller 8 for HDMI physical interface
- power regulators
- TV clocks, include ops for fout_vpll clock
- dependencies between TV and Power Domain devices

Please refer to post 'TV driver for Samsung Exynos4 platform (media part)' for sources of the TV driver. Link missing due to circular dependency between both posts.

*** BLURB HERE ***

Tomasz Stanislawski (4):
i2c-s3c2410: fix I2C dedicated for hdmiphy
exynos4: add i2c controller 8 (HDMIPHY)
arm: exynos4: add s5p-tv
arm: exynos4: universal_c210: add s5p-tv

 arch/arm/mach-exynos4/Kconfig                   |    7 +
 arch/arm/mach-exynos4/Makefile                  |    1 +
 arch/arm/mach-exynos4/clock.c                   |  223 ++++++++++++++++++++++-
 arch/arm/mach-exynos4/cpu.c                     |    3 +
 arch/arm/mach-exynos4/dev-tv.c                  |  114 ++++++++++++
 arch/arm/mach-exynos4/include/mach/irqs.h       |    8 +
 arch/arm/mach-exynos4/include/mach/map.h        |   27 +++
 arch/arm/mach-exynos4/include/mach/regs-clock.h |    1 +
 arch/arm/mach-exynos4/include/mach/regs-pmu.h   |    6 +
 arch/arm/mach-exynos4/mach-universal_c210.c     |   81 ++++++++
 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       |    6 +
 arch/arm/plat-samsung/include/plat/iic-core.h   |    7 +
 arch/arm/plat-samsung/include/plat/iic.h        |    1 +
 drivers/i2c/busses/i2c-s3c2410.c                |   36 ++++-
 17 files changed, 593 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-exynos4/dev-tv.c
 create mode 100644 arch/arm/plat-samsung/dev-i2c8.c
Signature · 1 line
1.7.4.3
#1 lore raw

PATCH v3 1/4 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
index 6c00c10..99cfe2f 100644
@@ -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.4.3
#2 lore raw

PATCH v3 2/4 exynos4: add i2c controller 8 (HDMIPHY)

In reply to Tomasz Stanislawski
---
 arch/arm/mach-exynos4/clock.c                 |    6 ++
 arch/arm/mach-exynos4/cpu.c                   |    3 +
 arch/arm/mach-exynos4/include/mach/irqs.h     |    4 ++
 arch/arm/mach-exynos4/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-core.h |    7 +++
 arch/arm/plat-samsung/include/plat/iic.h      |    1 +
 10 files changed, 97 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-samsung/dev-i2c8.c
arch/arm/mach-exynos4/clock.c +6 -0
index 963195e..40a231a 100644
@@ -619,6 +619,12 @@ static struct clk init_clocks_off[] = {
 		.enable		= exynos4_clk_ip_peril_ctrl,
 		.ctrlbit	= (1 << 13),
 	}, {
+		.name           = "i2c",
+		.id             = 8,
+		.parent         = &clk_aclk_100.clk,
+		.enable         = exynos4_clk_ip_peril_ctrl,
+		.ctrlbit        = (1 << 14),
+	}, {
 		.name		= "sysmmu",
 		.id		= S5P_SYSMMU_MDMA,
 		.enable		= exynos4_clk_ip_image_ctrl,
arch/arm/mach-exynos4/cpu.c +3 -0
index 7930113..52b145e 100644
@@ -23,6 +23,7 @@
 #include <plat/sdhci.h>
 #include <plat/devs.h>
 #include <plat/fimc-core.h>
+#include <plat/iic-core.h>
 
 #include <mach/regs-irq.h>
 
@@ -123,6 +124,8 @@ void __init exynos4_map_io(void)
 	exynos4_default_sdhci2();
 	exynos4_default_sdhci3();
 
+	s3c_i2c8_setname("s3c2440-hdmiphy-i2c");
+
 	s3c_fimc_setname(0, "exynos4-fimc");
 	s3c_fimc_setname(1, "exynos4-fimc");
 	s3c_fimc_setname(2, "exynos4-fimc");
arch/arm/mach-exynos4/include/mach/irqs.h +4 -0
index ad1d00c..dd048f8 100644
@@ -76,6 +76,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)
@@ -102,6 +105,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-exynos4/include/mach/map.h +1 -0
index 862967f..ff98626 100644
@@ -127,6 +127,7 @@
 #define S3C_PA_IIC5			EXYNOS4_PA_IIC(5)
 #define S3C_PA_IIC6			EXYNOS4_PA_IIC(6)
 #define S3C_PA_IIC7			EXYNOS4_PA_IIC(7)
+#define S3C_PA_IIC8			EXYNOS4_PA_IIC(8)
 #define S3C_PA_RTC			EXYNOS4_PA_RTC
 #define S3C_PA_WDT			EXYNOS4_PA_WATCHDOG
 
arch/arm/plat-samsung/Kconfig +5 -0
index be72100..c764227 100644
@@ -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
index e9de58a..752df43 100644
@@ -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
index 0ae5dd0..d240fd3 100644
@@ -56,6 +56,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-core.h +7 -0
index f182669..97ecc44 100644
@@ -39,4 +39,11 @@ static inline void s3c_i2c2_setname(char *name)
 #endif
 }
 
+static inline void s3c_i2c8_setname(char *name)
+{
+#ifdef CONFIG_S3C_DEV_I2C8
+	s3c_device_i2c8.name = name;
+#endif
+}
+
 #endif /* __ASM_ARCH_IIC_H */
arch/arm/plat-samsung/include/plat/iic.h +1 -0
index 1543da8..dd0d728 100644
@@ -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.4.3
#3 lore raw

PATCH v3 3/4 arm: exynos4: add s5p-tv

In reply to Tomasz Stanislawski

exynos4: fix and clean code for TV power
exynos4: tv: fix clock setup
exynos4: tv: integrate with Power Domain driver
exynos4: tv: register fix
exynos4: tv: add port HDMI_EN1 gpio to regulator api
exynos4: tv: use hdmiphy as clock
exynos4: tv: moved TV setup to separete function
exynos4: hdmi: removed control for clocks and regulators
exynos4: mixer: removed control for clocks and regulators
exynos4: tv: fix regulator name to tv_core
exynos4: phy: add phy for DAC
exynos4: clk: add set/get rate for fout_vpll
exynos4: tv: fix platform data
exynos4: tv: add SDO to platform devices
exynos4: tv: add vdet regulator for SDO
exynos4: clock: fix TV clock gating
exynos4: tv: remove usage of platform data

---
 arch/arm/mach-exynos4/Kconfig                   |    5 +
 arch/arm/mach-exynos4/Makefile                  |    1 +
 arch/arm/mach-exynos4/clock.c                   |  217 ++++++++++++++++++++++-
 arch/arm/mach-exynos4/dev-tv.c                  |  114 ++++++++++++
 arch/arm/mach-exynos4/include/mach/irqs.h       |    4 +
 arch/arm/mach-exynos4/include/mach/map.h        |   26 +++
 arch/arm/mach-exynos4/include/mach/regs-clock.h |    1 +
 arch/arm/mach-exynos4/include/mach/regs-pmu.h   |    6 +
 arch/arm/plat-samsung/include/plat/devs.h       |    5 +
 9 files changed, 378 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-exynos4/dev-tv.c
arch/arm/mach-exynos4/Kconfig +5 -0
index 544a594..0f830b8 100644
@@ -35,6 +35,11 @@ config EXYNOS4_DEV_SYSMMU
 	help
 	  Common setup code for SYSTEM MMU in EXYNOS4
 
+config EXYNOS4_DEV_TV
+	bool
+	help
+	  Compile in platform device definition for TV interface
+
 config EXYNOS4_SETUP_I2C1
 	bool
 	help
arch/arm/mach-exynos4/Makefile +1 -0
index 9be104f..61c9cfe 100644
@@ -42,6 +42,7 @@ obj-y					+= dev-audio.o
 obj-$(CONFIG_EXYNOS4_DEV_AHCI)		+= dev-ahci.o
 obj-$(CONFIG_EXYNOS4_DEV_PD)		+= dev-pd.o
 obj-$(CONFIG_EXYNOS4_DEV_SYSMMU)	+= dev-sysmmu.o
+obj-$(CONFIG_EXYNOS4_DEV_TV)		+= dev-tv.o
 
 obj-$(CONFIG_EXYNOS4_SETUP_FIMC)	+= setup-fimc.o
 obj-$(CONFIG_EXYNOS4_SETUP_I2C1)	+= setup-i2c1.o
arch/arm/mach-exynos4/clock.c +216 -1

265 lines not on this page · raw message

arch/arm/mach-exynos4/dev-tv.c new file +114 -0

114 lines not on this page · raw message

arch/arm/mach-exynos4/include/mach/irqs.h +4 -0
index dd048f8..7a687f1 100644
@@ -124,6 +124,10 @@
 
 #define IRQ_MCT_L1		COMBINER_IRQ(35, 3)
 
+/* Set the default NR_IRQS */
+#define IRQ_MIXER		COMBINER_IRQ(36, 0)
+#define IRQ_SDO			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-exynos4/include/mach/map.h +26 -0
index ff98626..1bd8c45 100644
@@ -160,4 +160,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_SDO		(0x12C20000)
+#define S5P_PA_SDO		S5PV210_PA_SDO
+#define S5P_SZ_SDO		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-exynos4/include/mach/regs-clock.h +1 -0
index 2c1472b..b7e1bda 100644
@@ -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_MFC			S5P_CLKREG(0x0C228)
 #define S5P_CLKSRC_IMAGE		S5P_CLKREG(0x0C230)
 #define S5P_CLKSRC_LCD0			S5P_CLKREG(0x0C234)
arch/arm/mach-exynos4/include/mach/regs-pmu.h +6 -0
index 62b0014..6bfb451 100644
@@ -33,6 +33,12 @@
 #define S5P_EINT_WAKEUP_MASK			S5P_PMUREG(0x0604)
 #define S5P_WAKEUP_MASK				S5P_PMUREG(0x0608)
 
+#define S5P_HDMI_PHY_CONTROL			S5P_PMUREG(0x0700)
+#define S5P_HDMI_PHY_ENABLE			(1 << 0)
+
+#define S5P_DAC_PHY_CONTROL			S5P_PMUREG(0x070C)
+#define S5P_DAC_PHY_ENABLE			(1 << 0)
+
 #define S5P_MIPI_DPHY_CONTROL(n)		S5P_PMUREG(0x0710 + (n) * 4)
 #define S5P_MIPI_DPHY_ENABLE			(1 << 0)
 #define S5P_MIPI_DPHY_SRESETN			(1 << 1)
arch/arm/plat-samsung/include/plat/devs.h +5 -0
index d240fd3..fb5bd9f 100644
@@ -140,6 +140,11 @@ extern struct platform_device s5p_device_fimc1;
 extern struct platform_device s5p_device_fimc2;
 extern struct platform_device s5p_device_fimc3;
 
+/* TV devices */
+extern struct platform_device s5p_device_hdmi;
+extern struct platform_device s5p_device_mixer;
+extern struct platform_device s5p_device_sdo;
+
 extern struct platform_device s5p_device_mipi_csis0;
 extern struct platform_device s5p_device_mipi_csis1;
 
Signature · 1 line
1.7.4.3
#4 lore raw

PATCH v3 4/4 arm: exynos4: universal_c210: add s5p-tv

In reply to Tomasz Stanislawski

universal_c210: tv: fix configuration of regulator

---
 arch/arm/mach-exynos4/Kconfig               |    2 +
 arch/arm/mach-exynos4/mach-universal_c210.c |   81 +++++++++++++++++++++++++++
 2 files changed, 83 insertions(+), 0 deletions(-)
arch/arm/mach-exynos4/Kconfig +2 -0
index 0f830b8..ad3a6e0 100644
@@ -162,9 +162,11 @@ config MACH_UNIVERSAL_C210
 	select S3C_DEV_HSMMC3
 	select S3C_DEV_I2C1
 	select S3C_DEV_I2C5
+ 	select S3C_DEV_I2C8
 	select S5P_DEV_ONENAND
 	select EXYNOS4_DEV_PD
 	select EXYNOS4_DEV_SYSMMU
+ 	select EXYNOS4_DEV_TV
 	select EXYNOS4_SETUP_I2C1
 	select EXYNOS4_SETUP_I2C5
 	select EXYNOS4_SETUP_SDHCI
arch/arm/mach-exynos4/mach-universal_c210.c +81 -0

172 lines not on this page · raw message

Signature · 1 line
1.7.4.3