Updated s5p-tv platform definitions
Subsystems (3)
cover Updated s5p-tv platform definitions
Hello,
This patch series contains platform definitions for s5p-tv driver rebased onto latest for-next branch (including generic GIC and clockdev changes).
Best regards
Signature · 51 lines
Marek Szyprowski Samsung Poland R&D Center Patch summary: Tomasz Stanislawski (8): ARM: Samsung: add i2c8 controller definitions ARM: Exynos4: add support for i2c8 controller (for HDMIPHY) ARM: S5PV210: add support for i2c3 controller (for HDMIPHY) ARM: S5P: add support for tv device ARM: Exynos4: add support for TV device ARM: Exynos4: enable TV support on Universal_C210 board ARM: S5PV210: add support for TV device ARM: S5PV210: enable TV support on GONI board arch/arm/mach-exynos4/Kconfig | 2 + arch/arm/mach-exynos4/clock.c | 211 +++++++++++++++++++++++ arch/arm/mach-exynos4/cpu.c | 6 + arch/arm/mach-exynos4/include/mach/irqs.h | 5 + 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 | 76 ++++++++ arch/arm/mach-s5pv210/Kconfig | 8 + arch/arm/mach-s5pv210/Makefile | 1 + arch/arm/mach-s5pv210/clock.c | 162 ++++++++++++++++-- arch/arm/mach-s5pv210/cpu.c | 5 + arch/arm/mach-s5pv210/include/mach/irqs.h | 2 +- arch/arm/mach-s5pv210/include/mach/map.h | 18 ++ arch/arm/mach-s5pv210/include/mach/regs-clock.h | 7 +- arch/arm/mach-s5pv210/mach-goni.c | 9 + arch/arm/mach-s5pv210/setup-i2c3.c | 26 +++ arch/arm/plat-s5p/Kconfig | 5 + arch/arm/plat-s5p/Makefile | 1 + arch/arm/plat-s5p/dev-tv.c | 100 +++++++++++ arch/arm/plat-samsung/Kconfig | 5 + arch/arm/plat-samsung/Makefile | 1 + arch/arm/plat-samsung/dev-i2c8.c | 58 ++++++ arch/arm/plat-samsung/include/plat/devs.h | 6 + arch/arm/plat-samsung/include/plat/iic-core.h | 14 ++ arch/arm/plat-samsung/include/plat/iic.h | 1 + arch/arm/plat-samsung/include/plat/tv-core.h | 44 +++++ 27 files changed, 793 insertions(+), 14 deletions(-) create mode 100644 arch/arm/mach-s5pv210/setup-i2c3.c create mode 100644 arch/arm/plat-s5p/dev-tv.c create mode 100644 arch/arm/plat-samsung/dev-i2c8.c create mode 100644 arch/arm/plat-samsung/include/plat/tv-core.h -- 1.7.1.569.g6f426
PATCH 1/8 ARM: Samsung: add i2c8 controller definitions
From: Tomasz Stanislawski <[email protected]>
This patch adds generic i2c8 controller definitions.
--- arch/arm/plat-samsung/Kconfig | 5 ++ arch/arm/plat-samsung/Makefile | 1 + arch/arm/plat-samsung/dev-i2c8.c | 58 +++++++++++++++++++++++++ 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 + 6 files changed, 73 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-samsung/dev-i2c8.c
arch/arm/plat-samsung/Kconfig +5 -0
@@ -212,6 +212,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
@@ -45,6 +45,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 +58 -0
58 lines not on this page · raw message
arch/arm/plat-samsung/include/plat/devs.h +1 -0
@@ -60,6 +60,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
@@ -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
@@ -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 1/8] ARM: Samsung: add i2c8 controller definitions
Review
Quoted 36 lines · Marek Szyprowski
From: Tomasz Stanislawski <[email protected]>
This patch adds generic i2c8 controller definitions.
Signed-off-by Tomasz Stanislawski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/plat-samsung/Kconfig | 5 ++ arch/arm/plat-samsung/Makefile | 1 + arch/arm/plat-samsung/dev-i2c8.c | 58 +++++++++++++++++++++++++ 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 + 6 files changed, 73 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-samsung/dev-i2c8.carch/arm/plat-samsung/Kconfig +5
-0@@ -212,6 +212,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
Review
Quoted 12 lines
index 53eb15b..7f0e660 100644
arch/arm/plat-samsung/Makefile +1
-0@@ -45,6 +45,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(quoted diff) +0
-0
b/arch/arm/plat-samsung/dev-i2c8.c
Review
Quoted 77 lines
new file mode 100644
index 0000000..23e8ccfarch/arm/plat-samsung/dev-i2c8.c new file +58
-0@@ -0,0 +1,58 @@ +/* +* Copyright (c) 2010 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* S3C series device definition for i2c device 8 +* +* Based on plat-samsung/dev-i2c7.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-i2c" , + .id =8 , + .num_resources =ARRAY_SIZE (s3c_i2c_resource), + .resource = s3c_i2c_resource, +}; + +void __init s3c_i2c8_set_platdata (struct s3c2410_platform_i2c *pd) +{ +struct s3c2410_platform_i2c *npd; + +if (!pd) { + pd = &default_i2c_data; + pd->bus_num =8 ; + } + + npd =s3c_set_platdata (pd,sizeof (struct s3c2410_platform_i2c ), + &s3c_device_i2c8); +}arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/devs.h +0
-0
samsung/include/plat/devs.h
index d5f700d..62ee543 100644arch/arm/plat-samsung/include/plat/devs.h +1
-0@@ -60,6 +60,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;(quoted diff) +0
-0
b/arch/arm/plat-
Quoted 29 lines
samsung/include/plat/iic-core.h
index f182669..97ecc44 100644arch/arm/plat-samsung/include/plat/iic-core.h +7
-0@@ -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- renamed from arch/arm/plat-samsung/include/plat/iic.h +0
-0
samsung/include/plat/iic.h
index 56b0059..535524a 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
As I remember, please don't use dev-i2c8 as a dedicated HDMIPHY on EXYNOS4. It can be used for other general i2c.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH 2/8 ARM: Exynos4: add support for i2c8 controller (for HDMIPHY)
In reply to Marek SzyprowskiFrom: Tomasz Stanislawski <[email protected]>
This patch adds platform definitions for i2c8 controller for Samsung Exynos4 platform (as HDMIPHY dedicated bus).
--- arch/arm/mach-exynos4/clock.c | 6 ++++++ arch/arm/mach-exynos4/cpu.c | 2 ++ arch/arm/mach-exynos4/include/mach/irqs.h | 3 +++ arch/arm/mach-exynos4/include/mach/map.h | 1 + 4 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/mach-exynos4/clock.c +6 -0
@@ -581,6 +581,12 @@ static struct clk init_clocks_off[] = { .enable = exynos4_clk_ip_peril_ctrl, .ctrlbit = (1 << 13), }, { + .name = "i2c", + .devname = "s3c2440-hdmiphy-i2c.8", + .parent = &clk_aclk_100.clk, + .enable = exynos4_clk_ip_peril_ctrl, + .ctrlbit = (1 << 14), + }, { .name = "SYSMMU_MDMA", .enable = exynos4_clk_ip_image_ctrl, .ctrlbit = (1 << 5),
arch/arm/mach-exynos4/cpu.c +2 -0
@@ -140,6 +140,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 +3 -0
@@ -93,6 +93,9 @@#define IRQ_2D IRQ_SPI(89)#define IRQ_PCIE IRQ_SPI(90) +#define IRQ_HDMI_I2C IRQ_SPI(93) +#define IRQ_IIC8 IRQ_HDMI_I2C +#define IRQ_MFC IRQ_SPI(94)#define IRQ_AUDIO_SS IRQ_SPI(96)
arch/arm/mach-exynos4/include/mach/map.h +1 -0
@@ -133,6 +133,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
Signature · 1 line
1.7.1.569.g6f426
PATCH 3/8 ARM: S5PV210: add support for i2c3 controller (for HDMIPHY)
In reply to Marek SzyprowskiFrom: Tomasz Stanislawski <[email protected]>
This patch add support for i2c3 controller for S5PV210 platform (as HDMIPHY dedicated bus).
--- arch/arm/mach-s5pv210/Kconfig | 5 ++++ arch/arm/mach-s5pv210/Makefile | 1 + arch/arm/mach-s5pv210/clock.c | 6 +++++ arch/arm/mach-s5pv210/cpu.c | 1 + arch/arm/mach-s5pv210/include/mach/map.h | 2 + arch/arm/mach-s5pv210/setup-i2c3.c | 26 +++++++++++++++++++++++++ arch/arm/plat-samsung/include/plat/iic-core.h | 7 ++++++ 7 files changed, 48 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pv210/setup-i2c3.c
arch/arm/mach-s5pv210/Kconfig +5 -0
@@ -28,6 +28,11 @@ config S5PV210_SETUP_I2C2 help Common setup code for i2c bus 2. +config S5PV210_SETUP_I2C3 + bool + help + Common setup code for i2c bus 3. + config S5PV210_SETUP_IDE bool help
arch/arm/mach-s5pv210/Makefile +1 -0
@@ -34,6 +34,7 @@ obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o obj-$(CONFIG_S5PV210_SETUP_FIMC) += setup-fimc.o obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o +obj-$(CONFIG_S5PV210_SETUP_I2C3) += setup-i2c3.o obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o obj-$(CONFIG_S5PV210_SETUP_SDHCI) += setup-sdhci.o
arch/arm/mach-s5pv210/clock.c +6 -0
@@ -407,6 +407,12 @@ static struct clk init_clocks_off[] = { .enable = s5pv210_clk_ip3_ctrl, .ctrlbit = (1<<9), }, { + .name = "i2c", + .devname = "s3c2440-hdmiphy-i2c.3", + .parent = &clk_pclk_psys.clk, + .enable = s5pv210_clk_ip3_ctrl, + .ctrlbit = (1 << 11), + }, { .name = "spi", .devname = "s3c64xx-spi.0", .parent = &clk_pclk_psys.clk,
arch/arm/mach-s5pv210/cpu.c +1 -0
@@ -138,6 +138,7 @@ void __init s5pv210_map_io(void)s3c_i2c0_setname ("s3c2440-i2c" );s3c_i2c1_setname ("s3c2440-i2c" );s3c_i2c2_setname ("s3c2440-i2c" ); +s3c_i2c3_setname ("s3c2440-hdmiphy-i2c" );s3c_fb_setname ("s5pv210-fb" );
arch/arm/mach-s5pv210/include/mach/map.h +2 -0
@@ -41,6 +41,7 @@#define S5PV210_PA_IIC0 0xE1800000#define S5PV210_PA_IIC1 0xFAB00000#define S5PV210_PA_IIC2 0xE1A00000 +#define S5PV210_PA_IIC3 0xFA900000#define S5PV210_PA_AC97 0xE2200000
@@ -100,6 +101,7 @@#define S3C_PA_IIC S5PV210_PA_IIC0#define S3C_PA_IIC1 S5PV210_PA_IIC1#define S3C_PA_IIC2 S5PV210_PA_IIC2 +#define S3C_PA_IIC3 S5PV210_PA_IIC3#define S3C_PA_RTC S5PV210_PA_RTC#define S3C_PA_USB_HSOTG S5PV210_PA_HSOTG#define S3C_PA_WDT S5PV210_PA_WATCHDOG
arch/arm/mach-s5pv210/setup-i2c3.c new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* I2C3 GPIO configuration. +* +* based on linux/arch/arm/mach-s5pv210/setup-i2c2.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/kernel.h> +#include <linux/types.h> +#include <linux/gpio.h> + +struct platform_device ;/* don't need the contents */ + +#include <plat/iic.h> +#include <plat/gpio-cfg.h> + +void s3c_i2c3_cfg_gpio (struct platform_device *dev) +{ +/* controller is internally connected, nothing to configure */ +}
arch/arm/plat-samsung/include/plat/iic-core.h +7 -0
@@ -39,6 +39,13 @@ static inline void s3c_i2c2_setname(char *name)#endif } +static inline void s3c_i2c3_setname (char *name) +{ +#ifdef CONFIG_S3C_DEV_I2C3 + s3c_device_i2c3.name = name; +#endif +} +static inline void s3c_i2c8_setname (char *name) {#ifdef CONFIG_S3C_DEV_I2C8
Signature · 1 line
1.7.1.569.g6f426
PATCH 4/8 ARM: S5P: add support for tv device
In reply to Marek SzyprowskiFrom: Tomasz Stanislawski <[email protected]>
This patch adds:
- resources for TV drivers and devices
- setters for names of TV devices
--- arch/arm/plat-s5p/Kconfig | 5 ++ arch/arm/plat-s5p/Makefile | 1 + arch/arm/plat-s5p/dev-tv.c | 100 ++++++++++++++++++++++++++ arch/arm/plat-samsung/include/plat/devs.h | 5 ++ arch/arm/plat-samsung/include/plat/tv-core.h | 44 +++++++++++ 5 files changed, 155 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-s5p/dev-tv.c create mode 100644 arch/arm/plat-samsung/include/plat/tv-core.h
arch/arm/plat-s5p/Kconfig +5 -0
@@ -91,6 +91,11 @@ config S5P_DEV_CSIS1 help Compile in platform device definitions for MIPI-CSIS channel 1 +config S5P_DEV_TV + bool + help + Compile in platform device definition for TV interface + config S5P_DEV_USB_EHCI bool help
arch/arm/plat-s5p/Makefile +1 -0
@@ -33,5 +33,6 @@ obj-$(CONFIG_S5P_DEV_FIMC3) += dev-fimc3.o obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o +obj-$(CONFIG_S5P_DEV_TV) += dev-tv.o obj-$(CONFIG_S5P_DEV_USB_EHCI) += dev-ehci.o obj-$(CONFIG_S5P_SETUP_MIPIPHY) += setup-mipiphy.o
arch/arm/plat-s5p/dev-tv.c new file +100 -0
100 lines not on this page · raw message
arch/arm/plat-samsung/include/plat/devs.h +5 -0
@@ -140,6 +140,11 @@ extern struct platform_device s5p_device_fimc3;extern struct platform_device s5p_device_mfc;extern struct platform_device s5p_device_mfc_l;extern struct platform_device s5p_device_mfc_r; + +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;
arch/arm/plat-samsung/include/plat/tv-core.h new file +44 -0
44 lines not on this page · raw message
Signature · 1 line
1.7.1.569.g6f426
RE: [PATCH 4/8] ARM: S5P: add support for tv device
Quoted 67 lines · Marek Szyprowski
From: Tomasz Stanislawski <[email protected]>
This patch adds:
- resources for TV drivers and devices
- setters for names of TV devicesSigned-off-by Tomasz Stanislawski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/plat-s5p/Kconfig | 5 ++ arch/arm/plat-s5p/Makefile | 1 + arch/arm/plat-s5p/dev-tv.c | 100 ++++++++++++++++++++++++++ arch/arm/plat-samsung/include/plat/devs.h | 5 ++ arch/arm/plat-samsung/include/plat/tv-core.h | 44 +++++++++++ 5 files changed, 155 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-s5p/dev-tv.c create mode 100644 arch/arm/plat-samsung/include/plat/tv-core.harch/arm/plat-s5p/Kconfig +5
-0@@ -91,6 +91,11 @@ config S5P_DEV_CSIS1 help Compile in platform device definitions for MIPI-CSIS channel 1 +config S5P_DEV_TV + bool + help + Compile in platform device definition for TV interface + config S5P_DEV_USB_EHCI bool helparch/arm/plat-s5p/Makefile +1
-0@@ -33,5 +33,6 @@ obj-$(CONFIG_S5P_DEV_FIMC3) += dev-fimc3.o obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o +obj-$(CONFIG_S5P_DEV_TV) += dev-tv.o obj-$(CONFIG_S5P_DEV_USB_EHCI) += dev-ehci.o obj-$(CONFIG_S5P_SETUP_MIPIPHY) += setup-mipiphy.oarch/arm/plat-s5p/dev-tv.c new file +13
-0@@ -0,0 +1,100 @@ +/* linux/arch/arm/plat-s5p/dev-tv.c +* +* Copyright 2011 Samsung Electronics +* Tomasz Stanislawski <[email protected]> +* +* S5P series device definition for TV device +* +* 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/dma-mapping.h>
arch/arm/plat-s5p/dev-tv.c line 23
Quoted 10 lines
arch/arm/plat-s5p/dev-tv.c new file +10
-0+ +#include <mach/irqs.h> +#include <mach/map.h> + +#include <plat/devs.h> + +/* HDMI interface */ +static struct resource s5p_hdmi_resources[] = { + [0 ] = { + .start =S5P_PA_HDMI ,
^^
Tab?
arch/arm/plat-s5p/dev-tv.c line 24
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .end = S5P_PA_HDMI + S5P_SZ_HDMI - 1,
^^^^
Tab
+ .end = S5P_PA_HDMI + SZ_XXX - 1,
Just use SZ_XXX...
arch/arm/plat-s5p/dev-tv.c line 25
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .flags = IORESOURCE_MEM,
^^
arch/arm/plat-s5p/dev-tv.c line 28
Quoted 3 lines
arch/arm/plat-s5p/dev-tv.c new file +3
-0+ }, + [1] = { + .start = IRQ_HDMI,
^^
arch/arm/plat-s5p/dev-tv.c line 29
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .end = IRQ_HDMI,
^^^^
arch/arm/plat-s5p/dev-tv.c line 30
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .flags = IORESOURCE_IRQ,
^^
arch/arm/plat-s5p/dev-tv.c line 35
Quoted 5 lines
arch/arm/plat-s5p/dev-tv.c new file +5
-0+ }, +}; + +struct platform_device s5p_device_hdmi = { + .name ="s5p-hdmi" ,
^^^^^^^^^^^
arch/arm/plat-s5p/dev-tv.c line 36
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .id = -1,
^^^^^^^^^^^^^
arch/arm/plat-s5p/dev-tv.c line 37
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .num_resources = ARRAY_SIZE(s5p_hdmi_resources),
^^
arch/arm/plat-s5p/dev-tv.c line 38
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .resource = s5p_hdmi_resources,
^^^^^^^
arch/arm/plat-s5p/dev-tv.c line 45
Quoted 7 lines
arch/arm/plat-s5p/dev-tv.c new file +7
-0+}; +EXPORT_SYMBOL (s5p_device_hdmi); + +/* MIXER */ +static struct resource s5p_mixer_resources[] = { + [0 ] = { + .start =S5P_PA_MIXER ,
^^
arch/arm/plat-s5p/dev-tv.c line 46
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .end = S5P_PA_MIXER + S5P_SZ_MIXER - 1,
^^^^
arch/arm/plat-s5p/dev-tv.c line 47
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .flags = IORESOURCE_MEM,
^^
arch/arm/plat-s5p/dev-tv.c line 51
Quoted 4 lines
arch/arm/plat-s5p/dev-tv.c new file +4
-0+ .name = "mxr" + }, + [1] = { + .start = S5P_PA_VP,
^^
arch/arm/plat-s5p/dev-tv.c line 52
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .end = S5P_PA_VP + S5P_SZ_VP - 1,
^^^^
arch/arm/plat-s5p/dev-tv.c line 53
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .flags = IORESOURCE_MEM,
^^
arch/arm/plat-s5p/dev-tv.c line 57
Quoted 4 lines
arch/arm/plat-s5p/dev-tv.c new file +4
-0+ .name = "vp" + }, + [2] = { + .start = IRQ_MIXER,
^^
arch/arm/plat-s5p/dev-tv.c line 58
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .end = IRQ_MIXER,
^^^^
arch/arm/plat-s5p/dev-tv.c line 59
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .flags = IORESOURCE_IRQ,
^^
arch/arm/plat-s5p/dev-tv.c line 65
Quoted 6 lines
arch/arm/plat-s5p/dev-tv.c new file +6
-0+ .name = "irq" + }, +}; + +struct platform_device s5p_device_mixer = { + .name ="s5p-mixer" ,
^^^^^^^^^^^
arch/arm/plat-s5p/dev-tv.c line 66
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .id = -1,
^^^^^^^^^^^^^
arch/arm/plat-s5p/dev-tv.c line 67
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .num_resources = ARRAY_SIZE(s5p_mixer_resources),
^^
arch/arm/plat-s5p/dev-tv.c line 68
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .resource = s5p_mixer_resources,
^^^^^^^
arch/arm/plat-s5p/dev-tv.c line 74
Quoted 6 lines
arch/arm/plat-s5p/dev-tv.c new file +6
-0+ .dev = { + .coherent_dma_mask = DMA_BIT_MASK(32), + .dma_mask = &s5p_device_mixer.dev.coherent_dma_mask, + } +}; +EXPORT_SYMBOL (s5p_device_mixer);
+static u64 s5p_XXX_dmamask = DMA_BIT_MAKS(32);
+struct platform_device s5p_device_mixer = {
+ .name = "s5p-mixer",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(s5p_mixer_resources),
+ .resource = s5p_mixer_resources,
+ .dev = {
+ .dma_mask = &s5p_XXX_dmamask,
+ .coherent_dma_mask = DMA_BIT_MASK(32),
+ }
+};
arch/arm/plat-s5p/dev-tv.c line 79
Quoted 5 lines
arch/arm/plat-s5p/dev-tv.c new file +5
-0+ +/* HDMI interface */ +static struct resource s5p_sdo_resources[] = { + [0 ] = { + .start =S5P_PA_SDO ,
^^
arch/arm/plat-s5p/dev-tv.c line 80
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .end = S5P_PA_SDO + S5P_SZ_SDO - 1,
^^^^
arch/arm/plat-s5p/dev-tv.c line 81
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .flags = IORESOURCE_MEM,
^^
arch/arm/plat-s5p/dev-tv.c line 84
Quoted 3 lines
arch/arm/plat-s5p/dev-tv.c new file +3
-0+ }, + [1] = { + .start = IRQ_SDO,
^^
arch/arm/plat-s5p/dev-tv.c line 85
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .end = IRQ_SDO,
^^^^
arch/arm/plat-s5p/dev-tv.c line 86
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .flags = IORESOURCE_IRQ,
^^
arch/arm/plat-s5p/dev-tv.c line 91
Quoted 5 lines
arch/arm/plat-s5p/dev-tv.c new file +5
-0+ }, +}; + +struct platform_device s5p_device_sdo = { + .name ="s5p-sdo" ,
^^^^^^^^^^^
arch/arm/plat-s5p/dev-tv.c line 92
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .id = -1,
^^^^^^^^^^^^^
arch/arm/plat-s5p/dev-tv.c line 93
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .num_resources = ARRAY_SIZE(s5p_sdo_resources),
^^
arch/arm/plat-s5p/dev-tv.c line 94
Quoted 1 line
arch/arm/plat-s5p/dev-tv.c new file +1
-0+ .resource = s5p_sdo_resources,
^^^^^^^
Quoted 42 lines
arch/arm/plat-s5p/dev-tv.c new file +6
-0+ .dev = { + .coherent_dma_mask = DMA_BIT_MASK(32), + .dma_mask = &s5p_device_sdo.dev.coherent_dma_mask, + } +}; +EXPORT_SYMBOL (s5p_device_sdo);arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/devs.h +0
-0
samsung/include/plat/devs.h
index 62ee543..9442d3f 100644arch/arm/plat-samsung/include/plat/devs.h +5
-0@@ -140,6 +140,11 @@ extern struct platform_device s5p_device_fimc3;extern struct platform_device s5p_device_mfc;extern struct platform_device s5p_device_mfc_l;extern struct platform_device s5p_device_mfc_r; + +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;arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/tv-core.h +0
-0
samsung/include/plat/tv-core.h
new file mode 100644
index 0000000..3bc34f3arch/arm/plat-samsung/include/plat/tv-core.h new file +12
-0@@ -0,0 +1,44 @@ +/* +* arch/arm/plat-samsung/include/plat/tv.h +* +* Copyright 2011 Samsung Electronics Co., Ltd. +* Tomasz Stanislawski <[email protected]> +* +* Samsung TV driver core functions +* +* 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. +*/
arch/arm/plat-samsung/include/plat/tv-core.h line 22
Quoted 10 lines
arch/arm/plat-samsung/include/plat/tv-core.h new file +10
-0+ +#ifndef __SAMSUNG_PLAT_TV_H +#define __SAMSUNG_PLAT_TV_H __FILE__ + +/* +* These functions are only for use with the core support code, such as +* the CPU-specific initialization code. +*/ + +/* Re-define device name to differentiate the subsystem in various SoCs.
*/
Quoted 23 lines
arch/arm/plat-samsung/include/plat/tv-core.h new file +22
-1+static inline void s5p_hdmi_setname (char *name) +{ +#ifdef CONFIG_S5P_DEV_TV + s5p_device_hdmi.name = name; +#endif +} + +static inline void s5p_mixer_setname (char *name) +{ +#ifdef CONFIG_S5P_DEV_TV + s5p_device_mixer.name = name; +#endif +} + +static inline void s5p_sdo_setname (char *name) +{ +#ifdef CONFIG_S5P_DEV_TV + s5p_device_sdo.name = name; +#endif +} + +#endif /* __SAMSUNG_PLAT_TV_H */ --
Quoted 1 line
1.7.1.569.g6f426
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH 5/8 ARM: Exynos4: add support for TV device
In reply to Marek SzyprowskiFrom: Tomasz Stanislawski <[email protected]>
This patch adds clocks and definitions needed by TV driver infrastructure for Samsung Exynos4 platform.
--- arch/arm/mach-exynos4/clock.c | 205 +++++++++++++++++++++++ arch/arm/mach-exynos4/cpu.c | 4 + 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 + 6 files changed, 245 insertions(+), 1 deletions(-)
arch/arm/mach-exynos4/clock.c +205 -0
@@ -83,6 +83,11 @@ static int exynos4_clk_ip_mfc_ctrl(struct clk *clk, int enable)return s5p_gatectrl (S5P_CLKGATE_IP_MFC , clk, enable); } +static int exynos4_clksrc_mask_tv_ctrl (struct clk *clk,int enable) +{ +return s5p_gatectrl (S5P_CLKSRC_MASK_TV , clk, enable); +} +static int exynos4_clk_ip_cam_ctrl (struct clk *clk,int enable) {return s5p_gatectrl (S5P_CLKGATE_IP_CAM , clk, enable);
@@ -123,6 +128,16 @@ static int exynos4_clk_ip_perir_ctrl(struct clk *clk, int enable)return s5p_gatectrl (S5P_CLKGATE_IP_PERIR , clk, enable); } +static int exynos4_clk_hdmiphy_ctrl (struct clk *clk,int enable) +{ +return s5p_gatectrl (S5P_HDMI_PHY_CONTROL , clk, enable); +} + +static int exynos4_clk_dac_ctrl (struct clk *clk,int enable) +{ +return s5p_gatectrl (S5P_DAC_PHY_CONTROL , clk, enable); +} +/* Core list of CMU_CPU side */ static struct clksrc_clk clk_mout_apll = {
@@ -449,6 +464,36 @@ static struct clk init_clocks_off[] = { .enable = exynos4_clk_ip_fsys_ctrl, .ctrlbit = (1 << 9), }, { + .name = "dac", + .devname = "s5p-sdo", + .enable = exynos4_clk_ip_tv_ctrl, + .ctrlbit = (1 << 2), + }, { + .name = "mixer", + .devname = "s5p-mixer", + .enable = exynos4_clk_ip_tv_ctrl, + .ctrlbit = (1 << 1), + }, { + .name = "vp", + .devname = "s5p-mixer", + .enable = exynos4_clk_ip_tv_ctrl, + .ctrlbit = (1 << 0), + }, { + .name = "hdmi", + .devname = "s5p-hdmi", + .enable = exynos4_clk_ip_tv_ctrl, + .ctrlbit = (1 << 3), + }, { + .name = "hdmiphy", + .devname = "s5p-hdmi", + .enable = exynos4_clk_hdmiphy_ctrl, + .ctrlbit = (1 << 0), + }, { + .name = "dacphy", + .devname = "s5p-sdo", + .enable = exynos4_clk_dac_ctrl, + .ctrlbit = (1 << 0), + }, { .name = "sata", .parent = &clk_aclk_133.clk, .enable = exynos4_clk_ip_fsys_ctrl,
@@ -788,6 +833,82 @@ static struct clksrc_sources clkset_mout_mfc = { .nr_sources = ARRAY_SIZE(clkset_mout_mfc_list), }; +static struct clk *clkset_sclk_dac_list[] = { + [0 ] = &clk_sclk_vpll.clk, + [1 ] = &clk_sclk_hdmiphy, +}; + +static struct clksrc_sources clkset_sclk_dac = { + .sources = clkset_sclk_dac_list, + .nr_sources =ARRAY_SIZE (clkset_sclk_dac_list), +}; + +static struct clksrc_clk clk_sclk_dac = { + .clk = { + .name ="sclk_dac" , + .enable = exynos4_clksrc_mask_tv_ctrl, + .ctrlbit = (1 <<8 ), + }, + .sources = &clkset_sclk_dac, + .reg_src = { .reg =S5P_CLKSRC_TV , .shift =8 , .size =1 }, +}; + +static struct clksrc_clk clk_sclk_pixel = { + .clk = { + .name ="sclk_pixel" , + .parent = &clk_sclk_vpll.clk, + }, + .reg_div = { .reg =S5P_CLKDIV_TV , .shift =0 , .size =4 }, +}; + +static struct clk *clkset_sclk_hdmi_list[] = { + [0 ] = &clk_sclk_pixel.clk, + [1 ] = &clk_sclk_hdmiphy, +}; + +static struct clksrc_sources clkset_sclk_hdmi = { + .sources = clkset_sclk_hdmi_list, + .nr_sources =ARRAY_SIZE (clkset_sclk_hdmi_list), +}; + +static struct clksrc_clk clk_sclk_hdmi = { + .clk = { + .name ="sclk_hdmi" , + .enable = exynos4_clksrc_mask_tv_ctrl, + .ctrlbit = (1 <<0 ), + }, + .sources = &clkset_sclk_hdmi, + .reg_src = { .reg =S5P_CLKSRC_TV , .shift =0 , .size =1 }, +}; + +static struct clk *clkset_sclk_mixer_list[] = { + [0 ] = &clk_sclk_dac.clk, + [1 ] = &clk_sclk_hdmi.clk, +}; + +static struct clksrc_sources clkset_sclk_mixer = { + .sources = clkset_sclk_mixer_list, + .nr_sources =ARRAY_SIZE (clkset_sclk_mixer_list), +}; + +static struct clksrc_clk clk_sclk_mixer = { + .clk = { + .name ="sclk_mixer" , + .enable = exynos4_clksrc_mask_tv_ctrl, + .ctrlbit = (1 <<4 ), + }, + .sources = &clkset_sclk_mixer, + .reg_src = { .reg =S5P_CLKSRC_TV , .shift =4 , .size =1 }, +}; + +static struct clksrc_clk *sclk_tv[] = { + &clk_sclk_dac, + &clk_sclk_pixel, + &clk_sclk_hdmi, + &clk_sclk_mixer, +NULL , +}; +static struct clksrc_clk clk_dout_mmc0 = { .clk = { .name ="dout_mmc0" ,
@@ -1129,6 +1250,81 @@ static struct clk_ops exynos4_fout_apll_ops = { .get_rate = exynos4_fout_apll_get_rate, }; +struct vpll_div_data { +u32 rate; +u32 pdiv; +u32 mdiv; +u32 sdiv; +u32 k; +u32 mfr; +u32 mrr; +u32 vsel; + +}; + +static struct vpll_div_data vpll_div[] = { + {54000000 ,3 ,53 ,3 ,1024 ,0 ,17 ,0 }, + {108000000 ,3 ,53 ,2 ,1024 ,0 ,17 ,0 }, +}; + +static unsigned long exynos4_vpll_get_rate (struct clk *clk) +{ +return clk->rate; +} + +static int exynos4_vpll_set_rate (struct clk *clk,unsigned long rate) +{ +unsigned int vpll_con0, vpll_con1; +unsigned int i; + +/* Return if nothing changed */ +if (clk->rate == rate) +return 0 ; + + vpll_con0 =__raw_readl (S5P_VPLL_CON0 ); + vpll_con0 &= ~(0x1 <<27 | \ +PLL90XX_MDIV_MASK <<PLL90XX_MDIV_SHIFT | \ +PLL90XX_PDIV_MASK <<PLL90XX_PDIV_SHIFT | \ +PLL90XX_SDIV_MASK <<PLL90XX_SDIV_SHIFT ); + + vpll_con1 =__raw_readl (S5P_VPLL_CON1 ); + vpll_con1 &= ~(0x1f <<24 | \ +0x3f <<16 | \ +0xfff <<0 ); + +for (i =0 ; i <ARRAY_SIZE (vpll_div); i++) { +if (vpll_div[i].rate == rate) { + vpll_con0 |= vpll_div[i].vsel <<27 ; + vpll_con0 |= vpll_div[i].pdiv <<PLL90XX_PDIV_SHIFT ; + vpll_con0 |= vpll_div[i].mdiv <<PLL90XX_MDIV_SHIFT ; + vpll_con0 |= vpll_div[i].sdiv <<PLL90XX_SDIV_SHIFT ; + + vpll_con1 |= vpll_div[i].mrr <<24 ; + vpll_con1 |= vpll_div[i].mfr <<16 ; + vpll_con1 |= vpll_div[i].k <<0 ; +break ; + } + } + +if (i ==ARRAY_SIZE (vpll_div)) { +printk (KERN_ERR "%s: Invalid Clock VPLL Frequency\n" , + __func__); +return -EINVAL ; + } + +__raw_writel (vpll_con0,S5P_VPLL_CON0 ); +__raw_writel (vpll_con1,S5P_VPLL_CON1 ); + + clk->rate = rate; + +return 0 ; +} + +static struct clk_ops exynos4_vpll_ops = { + .get_rate = exynos4_vpll_get_rate, + .set_rate = exynos4_vpll_set_rate, +}; + void __init_or_cpufreq exynos4_setup_clocks(void) {struct clk *xtal_clk;
@@ -1171,6 +1367,7 @@ void __init_or_cpufreq exynos4_setup_clocks(void) clk_fout_apll.ops = &exynos4_fout_apll_ops; clk_fout_mpll.rate = mpll; clk_fout_epll.rate = epll; + clk_fout_vpll.ops = &exynos4_vpll_ops; clk_fout_vpll.rate = vpll; printk(KERN_INFO "EXYNOS4: PLL settings, A=%ld, M=%ld, E=%ld V=%ld",
@@ -1199,6 +1396,10 @@ void __init_or_cpufreq exynos4_setup_clocks(void)static struct clk *clks[]__initdata = {/* Nothing here yet */ + &clk_sclk_hdmi27m, + &clk_sclk_hdmiphy, + &clk_sclk_usbphy0, + &clk_sclk_usbphy1, };void __init exynos4_register_clocks (void )
@@ -1210,6 +1411,10 @@ void __init exynos4_register_clocks(void)for (ptr =0 ; ptr <ARRAY_SIZE (sysclks); ptr++)s3c_register_clksrc (sysclks[ptr],1 ); +/* register TV clocks */ +for (ptr =0 ; sclk_tv[ptr]; ++ptr) +s3c_register_clksrc (sclk_tv[ptr],1 ); +s3c_register_clksrc (clksrcs,ARRAY_SIZE (clksrcs));s3c_register_clocks (init_clocks,ARRAY_SIZE (init_clocks));
arch/arm/mach-exynos4/cpu.c +4 -0
@@ -25,6 +25,7 @@#include <plat/devs.h> #include <plat/fimc-core.h> #include <plat/iic-core.h> +#include <plat/tv-core.h> #include <mach/regs-irq.h>
@@ -151,6 +152,9 @@ void __init exynos4_map_io(void)s3c_i2c0_setname ("s3c2440-i2c" );s3c_i2c1_setname ("s3c2440-i2c" );s3c_i2c2_setname ("s3c2440-i2c" ); + +/* setup TV devices */ +s5p_hdmi_setname ("exynos4-hdmi" ); }void __init exynos4_init_clocks (int xtal)
arch/arm/mach-exynos4/include/mach/irqs.h +3 -1
@@ -93,10 +93,12 @@#define IRQ_2D IRQ_SPI(89)#define IRQ_PCIE IRQ_SPI(90) +#define IRQ_MIXER IRQ_SPI(91) +#define IRQ_HDMI IRQ_SPI(92)#define IRQ_HDMI_I2C IRQ_SPI(93)#define IRQ_IIC8 IRQ_HDMI_I2C -#define IRQ_MFC IRQ_SPI(94) +#define IRQ_SDO IRQ_SPI(95)#define IRQ_AUDIO_SS IRQ_SPI(96)#define IRQ_I2S0 IRQ_SPI(97)
arch/arm/mach-exynos4/include/mach/map.h +26 -0
@@ -168,4 +168,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
@@ -36,6 +36,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
@@ -33,9 +33,15 @@#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_USBHOST_PHY_CONTROL S5P_PMUREG(0x0708)#define S5P_USBHOST_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)
Signature · 1 line
1.7.1.569.g6f426
RE: [PATCH 5/8] ARM: Exynos4: add support for TV device
arch/arm/mach-exynos4/clock.c static int exynos4_clk_ip_mfc_ctrl(struct clk *clk, int
Quoted 25 lines · Marek Szyprowski
From: Tomasz Stanislawski <[email protected]>
This patch adds clocks and definitions needed by TV driver infrastructure for Samsung Exynos4 platform.
Signed-off-by Tomasz Stanislawski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>Reviewed-by Marek Szyprowski <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/mach-exynos4/clock.c | 205 +++++++++++++++++++++++ arch/arm/mach-exynos4/cpu.c | 4 + 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 + 6 files changed, 245 insertions(+), 1 deletions(-)arch/arm/mach-exynos4/clock.c +0
-0@@ -83,6 +83,11 @@ static int exynos4_clk_ip_mfc_ctrl(struct clk *clk, int
enable)
arch/arm/mach-exynos4/clock.c static int exynos4_clk_ip_perir_ctrl(struct clk *clk,
Quoted 12 lines
arch/arm/mach-exynos4/clock.c +5
-0return s5p_gatectrl (S5P_CLKGATE_IP_MFC , clk, enable); } +static int exynos4_clksrc_mask_tv_ctrl (struct clk *clk,int enable) +{ +return s5p_gatectrl (S5P_CLKSRC_MASK_TV , clk, enable); +} +static int exynos4_clk_ip_cam_ctrl (struct clk *clk,int enable) {return s5p_gatectrl (S5P_CLKGATE_IP_CAM , clk, enable);@@ -123,6 +128,16 @@ static int exynos4_clk_ip_perir_ctrl(struct clk *clk,
int
Quoted 152 lines
arch/arm/mach-exynos4/clock.c +10
-0enable)return s5p_gatectrl (S5P_CLKGATE_IP_PERIR , clk, enable); } +static int exynos4_clk_hdmiphy_ctrl (struct clk *clk,int enable) +{ +return s5p_gatectrl (S5P_HDMI_PHY_CONTROL , clk, enable); +} + +static int exynos4_clk_dac_ctrl (struct clk *clk,int enable) +{ +return s5p_gatectrl (S5P_DAC_PHY_CONTROL , clk, enable); +} +/* Core list of CMU_CPU side */ static struct
clksrc_clkclk_mout_apll= {arch/arm/mach-exynos4/clock.c +117
-0@@ -449,6 +464,36 @@ static struct clk init_clocks_off[] = { .enable = exynos4_clk_ip_fsys_ctrl, .ctrlbit = (1 << 9), }, { + .name = "dac", + .devname = "s5p-sdo", + .enable = exynos4_clk_ip_tv_ctrl, + .ctrlbit = (1 << 2), + }, { + .name = "mixer", + .devname = "s5p-mixer", + .enable = exynos4_clk_ip_tv_ctrl, + .ctrlbit = (1 << 1), + }, { + .name = "vp", + .devname = "s5p-mixer", + .enable = exynos4_clk_ip_tv_ctrl, + .ctrlbit = (1 << 0), + }, { + .name = "hdmi", + .devname = "s5p-hdmi", + .enable = exynos4_clk_ip_tv_ctrl, + .ctrlbit = (1 << 3), + }, { + .name = "hdmiphy", + .devname = "s5p-hdmi", + .enable = exynos4_clk_hdmiphy_ctrl, + .ctrlbit = (1 << 0), + }, { + .name = "dacphy", + .devname = "s5p-sdo", + .enable = exynos4_clk_dac_ctrl, + .ctrlbit = (1 << 0), + }, { .name = "sata", .parent = &clk_aclk_133.clk, .enable = exynos4_clk_ip_fsys_ctrl,@@ -788,6 +833,82 @@ static struct clksrc_sources clkset_mout_mfc = { .nr_sources = ARRAY_SIZE(clkset_mout_mfc_list), }; +static struct clk *clkset_sclk_dac_list[] = { + [0 ] = &clk_sclk_vpll.clk, + [1 ] = &clk_sclk_hdmiphy, +}; + +static struct clksrc_sources clkset_sclk_dac = { + .sources = clkset_sclk_dac_list, + .nr_sources =ARRAY_SIZE (clkset_sclk_dac_list), +}; + +static struct clksrc_clk clk_sclk_dac = { + .clk = { + .name ="sclk_dac" , + .enable = exynos4_clksrc_mask_tv_ctrl, + .ctrlbit = (1 <<8 ), + }, + .sources = &clkset_sclk_dac, + .reg_src = { .reg =S5P_CLKSRC_TV , .shift =8 , .size =1 }, +}; + +static struct clksrc_clk clk_sclk_pixel = { + .clk = { + .name ="sclk_pixel" , + .parent = &clk_sclk_vpll.clk, + }, + .reg_div = { .reg =S5P_CLKDIV_TV , .shift =0 , .size =4 }, +}; + +static struct clk *clkset_sclk_hdmi_list[] = { + [0 ] = &clk_sclk_pixel.clk, + [1 ] = &clk_sclk_hdmiphy, +}; + +static struct clksrc_sources clkset_sclk_hdmi = { + .sources = clkset_sclk_hdmi_list, + .nr_sources =ARRAY_SIZE (clkset_sclk_hdmi_list), +}; + +static struct clksrc_clk clk_sclk_hdmi = { + .clk = { + .name ="sclk_hdmi" , + .enable = exynos4_clksrc_mask_tv_ctrl, + .ctrlbit = (1 <<0 ), + }, + .sources = &clkset_sclk_hdmi, + .reg_src = { .reg =S5P_CLKSRC_TV , .shift =0 , .size =1 }, +}; + +static struct clk *clkset_sclk_mixer_list[] = { + [0 ] = &clk_sclk_dac.clk, + [1 ] = &clk_sclk_hdmi.clk, +}; + +static struct clksrc_sources clkset_sclk_mixer = { + .sources = clkset_sclk_mixer_list, + .nr_sources =ARRAY_SIZE (clkset_sclk_mixer_list), +}; + +static struct clksrc_clk clk_sclk_mixer = { + .clk = { + .name ="sclk_mixer" , + .enable = exynos4_clksrc_mask_tv_ctrl, + .ctrlbit = (1 <<4 ), + }, + .sources = &clkset_sclk_mixer, + .reg_src = { .reg =S5P_CLKSRC_TV , .shift =4 , .size =1 }, +}; + +static struct clksrc_clk *sclk_tv[] = { + &clk_sclk_dac, + &clk_sclk_pixel, + &clk_sclk_hdmi, + &clk_sclk_mixer, +NULL , +}; +static struct clksrc_clk clk_dout_mmc0 = { .clk = { .name ="dout_mmc0" ,@@ -1129,6 +1250,81 @@ static struct clk_ops exynos4_fout_apll_ops = { .get_rate = exynos4_fout_apll_get_rate, }; +struct vpll_div_data { +u32 rate; +u32 pdiv; +u32 mdiv; +u32 sdiv; +u32 k; +u32 mfr; +u32 mrr; +u32 vsel; + +};
arch/arm/mach-exynos4/clock.c static struct clk_ops exynos4_fout_apll_ops = { · line 1273
Quoted 10 lines
arch/arm/mach-exynos4/clock.c +10
-0+ +static struct vpll_div_data vpll_div[] = { + {54000000 ,3 ,53 ,3 ,1024 ,0 ,17 ,0 }, + {108000000 ,3 ,53 ,2 ,1024 ,0 ,17 ,0 }, +}; + +static unsigned long exynos4_vpll_get_rate (struct clk *clk) +{ +return clk->rate; +}
Please refer to my reply on s5pv210/clock.c.
Quoted 34 lines
arch/arm/mach-exynos4/clock.c +34
-0+ +static int exynos4_vpll_set_rate (struct clk *clk,unsigned long rate) +{ +unsigned int vpll_con0, vpll_con1; +unsigned int i; + +/* Return if nothing changed */ +if (clk->rate == rate) +return 0 ; + + vpll_con0 =__raw_readl (S5P_VPLL_CON0 ); + vpll_con0 &= ~(0x1 <<27 | \ +PLL90XX_MDIV_MASK <<PLL90XX_MDIV_SHIFT | \ +PLL90XX_PDIV_MASK <<PLL90XX_PDIV_SHIFT | \ +PLL90XX_SDIV_MASK <<PLL90XX_SDIV_SHIFT ); + + vpll_con1 =__raw_readl (S5P_VPLL_CON1 ); + vpll_con1 &= ~(0x1f <<24 | \ +0x3f <<16 | \ +0xfff <<0 ); + +for (i =0 ; i <ARRAY_SIZE (vpll_div); i++) { +if (vpll_div[i].rate == rate) { + vpll_con0 |= vpll_div[i].vsel <<27 ; + vpll_con0 |= vpll_div[i].pdiv <<PLL90XX_PDIV_SHIFT ; + vpll_con0 |= vpll_div[i].mdiv <<PLL90XX_MDIV_SHIFT ; + vpll_con0 |= vpll_div[i].sdiv <<PLL90XX_SDIV_SHIFT ; + + vpll_con1 |= vpll_div[i].mrr <<24 ; + vpll_con1 |= vpll_div[i].mfr <<16 ; + vpll_con1 |= vpll_div[i].k <<0 ; +break ; + } + }
arch/arm/mach-exynos4/clock.c static struct clk_ops exynos4_fout_apll_ops = { · line 1317
Quoted 10 lines
arch/arm/mach-exynos4/clock.c +10
-0+ +if (i ==ARRAY_SIZE (vpll_div)) { +printk (KERN_ERR "%s: Invalid Clock VPLL Frequency\n" , + __func__); +return -EINVAL ; + } + +__raw_writel (vpll_con0,S5P_VPLL_CON0 ); +__raw_writel (vpll_con1,S5P_VPLL_CON1 ); +
Same.
arch/arm/mach-exynos4/clock.c static struct clk_ops exynos4_fout_apll_ops = { · line 1321
Quoted 4 lines
arch/arm/mach-exynos4/clock.c +4
-0+ clk->rate = rate; + +return 0 ; +}
Same.
arch/arm/mach-exynos4/clock.c static struct clk_ops exynos4_fout_apll_ops = { · line 1326
Quoted 5 lines
arch/arm/mach-exynos4/clock.c +5
-0+ +static struct clk_ops exynos4_vpll_ops = { + .get_rate = exynos4_vpll_get_rate, + .set_rate = exynos4_vpll_set_rate, +};
Same...
Review
Quoted 113 lines
arch/arm/mach-exynos4/clock.c +2
-0+ void __init_or_cpufreq exynos4_setup_clocks(void) {struct clk *xtal_clk;@@ -1171,6 +1367,7 @@ void __init_or_cpufreq exynos4_setup_clocks(void) clk_fout_apll.ops = &exynos4_fout_apll_ops; clk_fout_mpll.rate = mpll; clk_fout_epll.rate = epll; + clk_fout_vpll.ops = &exynos4_vpll_ops; clk_fout_vpll.rate = vpll; printk(KERN_INFO "EXYNOS4: PLL settings, A=%ld, M=%ld, E=%ldV=%ld",
arch/arm/mach-exynos4/clock.c +8
-0@@ -1199,6 +1396,10 @@ void __init_or_cpufreq exynos4_setup_clocks(void)static struct clk *clks[]__initdata = {/* Nothing here yet */ + &clk_sclk_hdmi27m, + &clk_sclk_hdmiphy, + &clk_sclk_usbphy0, + &clk_sclk_usbphy1, };void __init exynos4_register_clocks (void )@@ -1210,6 +1411,10 @@ void __init exynos4_register_clocks(void)for (ptr =0 ; ptr <ARRAY_SIZE (sysclks); ptr++)s3c_register_clksrc (sysclks[ptr],1 ); +/* register TV clocks */ +for (ptr =0 ; sclk_tv[ptr]; ++ptr) +s3c_register_clksrc (sclk_tv[ptr],1 ); +s3c_register_clksrc (clksrcs,ARRAY_SIZE (clksrcs));s3c_register_clocks (init_clocks,ARRAY_SIZE (init_clocks));arch/arm/mach-exynos4/cpu.c +4
-0@@ -25,6 +25,7 @@#include <plat/devs.h> #include <plat/fimc-core.h> #include <plat/iic-core.h> +#include <plat/tv-core.h> #include <mach/regs-irq.h> @@ -151,6 +152,9 @@ void __init exynos4_map_io(void)s3c_i2c0_setname ("s3c2440-i2c" );s3c_i2c1_setname ("s3c2440-i2c" );s3c_i2c2_setname ("s3c2440-i2c" ); + +/* setup TV devices */ +s5p_hdmi_setname ("exynos4-hdmi" ); }void __init exynos4_init_clocks (int xtal)arch/arm/mach- renamed from arch/arm/mach-exynos4/include/mach/irqs.h +0
-0
exynos4/include/mach/irqs.h
index c342ba1..c2077ce 100644arch/arm/mach-exynos4/include/mach/irqs.h +3
-1@@ -93,10 +93,12 @@#define IRQ_2D IRQ_SPI(89)#define IRQ_PCIE IRQ_SPI(90) +#define IRQ_MIXER IRQ_SPI(91) +#define IRQ_HDMI IRQ_SPI(92)#define IRQ_HDMI_I2C IRQ_SPI(93)#define IRQ_IIC8 IRQ_HDMI_I2C -#define IRQ_MFC IRQ_SPI(94) +#define IRQ_SDO IRQ_SPI(95)#define IRQ_AUDIO_SS IRQ_SPI(96)#define IRQ_I2S0 IRQ_SPI(97)arch/arm/mach- renamed from arch/arm/mach-exynos4/include/mach/map.h +0
-0
exynos4/include/mach/map.h
index 1fd986b..79ec1f9 100644arch/arm/mach-exynos4/include/mach/map.h +26
-0@@ -168,4 +168,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 */ (quoted diff) +0
-0
b/arch/arm/mach-
Review
Quoted 13 lines
exynos4/include/mach/regs-clock.h
index 64bdd24..854c736 100644arch/arm/mach-exynos4/include/mach/regs-clock.h +1
-0@@ -36,6 +36,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)(quoted diff) +0
-0
b/arch/arm/mach-
Quoted 23 lines
exynos4/include/mach/regs-pmu.h
index fa49bbb..faf9b98 100644arch/arm/mach-exynos4/include/mach/regs-pmu.h +4
-0@@ -33,9 +33,15 @@#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_USBHOST_PHY_CONTROL S5P_PMUREG(0x0708)#define S5P_USBHOST_PHY_ENABLE (1 << 0) +#define S5P_DAC_PHY_CONTROL S5P_PMUREG(0x070C)arch/arm/mach-exynos4/include/mach/regs-pmu.h +2
-0+#define S5P_DAC_PHY_ENABLE (1 << 0) +#define S5P_MIPI_DPHY_CONTROL (n) S5P_PMUREG(0x0710 + (n) *
Quoted 5 lines
4)
#defineS5P_MIPI_DPHY_ENABLE(1 << 0)
#defineS5P_MIPI_DPHY_SRESETN(1 << 1)
--
1.7.1.569.g6f426
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH 6/8 ARM: Exynos4: enable TV support on Universal_C210 board
In reply to Marek SzyprowskiFrom: Tomasz Stanislawski <[email protected]>
This patch adds platform devices and regulators for TV devices on Samsung Universal C210 board.
--- arch/arm/mach-exynos4/Kconfig | 2 + arch/arm/mach-exynos4/mach-universal_c210.c | 76 +++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 0 deletions(-)
arch/arm/mach-exynos4/Kconfig +2 -0
@@ -166,9 +166,11 @@ config MACH_UNIVERSAL_C210 select S3C_DEV_I2C1 select S3C_DEV_I2C3 select S3C_DEV_I2C5 + select S3C_DEV_I2C8 select S5P_DEV_MFC select S5P_DEV_ONENAND select EXYNOS4_DEV_PD + select S5P_DEV_TV select EXYNOS4_SETUP_I2C1 select EXYNOS4_SETUP_I2C3 select EXYNOS4_SETUP_I2C5
arch/arm/mach-exynos4/mach-universal_c210.c +76 -0
148 lines not on this page · raw message
Signature · 1 line
1.7.1.569.g6f426
RE: [PATCH 6/8] ARM: Exynos4: enable TV support on Universal_C210 board
arch/arm/mach-exynos4/mach-universal_c210.c static struct regulator_init_data lp3974_buck3_data =
Quoted 47 lines · Marek Szyprowski
From: Tomasz Stanislawski <[email protected]>
This patch adds platform devices and regulators for TV devices on Samsung Universal C210 board.
Signed-off-by Tomasz Stanislawski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/mach-exynos4/Kconfig | 2 + arch/arm/mach-exynos4/mach-universal_c210.c | 76 +++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 0 deletions(-)arch/arm/mach-exynos4/Kconfig +2
-0@@ -166,9 +166,11 @@ config MACH_UNIVERSAL_C210 select S3C_DEV_I2C1 select S3C_DEV_I2C3 select S3C_DEV_I2C5 + select S3C_DEV_I2C8 select S5P_DEV_MFC select S5P_DEV_ONENAND select EXYNOS4_DEV_PD + select S5P_DEV_TV select EXYNOS4_SETUP_I2C1 select EXYNOS4_SETUP_I2C3 select EXYNOS4_SETUP_I2C5arch/arm/mach- renamed from arch/arm/mach-exynos4/mach-universal_c210.c +0
-0
exynos4/mach-universal_c210.c
index 0e280d1..0fd81be 100644arch/arm/mach-exynos4/mach-universal_c210.c +0
-0@@ -110,6 +110,8 @@ static struct regulator_consumer_supply
lp3974_buck1_consumer=
static structregulator_consumer_supplylp3974_buck2_consumer=arch/arm/mach-exynos4/mach-universal_c210.c +2
-0REGULATOR_SUPPLY ("vddg3d" ,NULL ); +static struct regulator_consumer_supply lp3974_buck3_consumer = +REGULATOR_SUPPLY ("vdet" ,"s5p-sdo" );static struct regulator_init_data lp3974_buck1_data = { .constraints = { .name ="VINT_1.1V" ,@@ -153,6 +155,8 @@ static struct regulator_init_data lp3974_buck3_data =
{
arch/arm/mach-exynos4/mach-universal_c210.c static struct regulator_init_data lp3974_ldo2_data =
Quoted 9 lines
arch/arm/mach-exynos4/mach-universal_c210.c +2
-0.enabled = 1, }, }, + .num_consumer_supplies = 1, + .consumer_supplies = &lp3974_buck3_consumer, }; static struct regulator_init_data lp3974_buck4_data = {@@ -181,6 +185,13 @@ static struct regulator_init_data lp3974_ldo2_data =
{
arch/arm/mach-exynos4/mach-universal_c210.c static struct regulator_init_data lp3974_ldo2_data = { · line 190
Quoted 6 lines
arch/arm/mach-exynos4/mach-universal_c210.c +3
-0}, }; +static struct regulator_consumer_supply lp3974_ldo3_consumer[] = { +REGULATOR_SUPPLY ("vusb_a" ,"s3c-hsotg" ), +REGULATOR_SUPPLY ("vdd11" ,"s5p-mipi-csis.0" ),
Is this for TV?
arch/arm/mach-exynos4/mach-universal_c210.c static struct regulator_init_data lp3974_ldo3_data =
Quoted 8 lines
arch/arm/mach-exynos4/mach-universal_c210.c +4
-0+REGULATOR_SUPPLY ("vdd" ,"exynos4-hdmi" ), + REGULATOR_SUPPLY("vdd_pll", "exynos4-hdmi"), +}; +static struct regulator_init_data lp3974_ldo3_data = { .constraints = { .name ="VUSB+MIPI_1.1V" ,@@ -192,6 +203,12 @@ static struct regulator_init_data lp3974_ldo3_data =
{
arch/arm/mach-exynos4/mach-universal_c210.c static struct regulator_init_data lp3974_ldo7_data =
Quoted 22 lines
arch/arm/mach-exynos4/mach-universal_c210.c +8
-0.disabled = 1, }, }, + .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo3_consumer), + .consumer_supplies = lp3974_ldo3_consumer, +}; + +static struct regulator_consumer_supply lp3974_ldo4_consumer[] = { +REGULATOR_SUPPLY ("vdd_osc" ,"exynos4-hdmi" ), }; static struct regulator_init_data lp3974_ldo4_data = {@@ -205,6 +222,8 @@ static struct regulator_init_data lp3974_ldo4_data = { .disabled = 1, }, }, + .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo4_consumer), + .consumer_supplies = lp3974_ldo4_consumer, }; static struct regulator_init_data lp3974_ldo5_data = {@@ -246,6 +265,11 @@ static struct regulator_init_data lp3974_ldo7_data =
{
arch/arm/mach-exynos4/mach-universal_c210.c static struct regulator_init_data lp3974_ldo7_data = { · line 269
Quoted 5 lines
arch/arm/mach-exynos4/mach-universal_c210.c +2
-0}, }; +static struct regulator_consumer_supply lp3974_ldo8_consumer[] = { +REGULATOR_SUPPLY ("vusb_d" ,"s3c-hsotg" ),
Same as above.
Quoted 66 lines
arch/arm/mach-exynos4/mach-universal_c210.c +33
-0+ REGULATOR_SUPPLY("vdd33a_dac", "s5p-sdo"), +}; +static struct regulator_init_data lp3974_ldo8_data = { .constraints = { .name ="VUSB+VDAC_3.3V" ,@@ -257,6 +281,8 @@ static struct regulator_init_data lp3974_ldo8_data = { .disabled = 1, }, }, + .num_consumer_supplies = ARRAY_SIZE(lp3974_ldo8_consumer), + .consumer_supplies = lp3974_ldo8_consumer, }; static struct regulator_init_data lp3974_ldo9_data = {@@ -472,6 +498,34 @@ static struct max8998_platform_data universal_lp3974_pdata = { .wakeup = true, }; +static struct regulator_consumer_supply hdmi_fixed_consumer = +REGULATOR_SUPPLY ("hdmi-en" ,"exynos4-hdmi" ); + +static struct regulator_init_data hdmi_fixed_voltage_init_data = { + .constraints = { + .name ="HDMI_5V" , + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =1 , + .consumer_supplies = &hdmi_fixed_consumer, +}; + +static struct fixed_voltage_config hdmi_fixed_voltage_config = { + .supply_name ="HDMI_EN1" , + .microvolts =5000000 , + .gpio =EXYNOS4_GPE0 (1 ), + .enable_high = true, + .init_data = &hdmi_fixed_voltage_init_data, +}; + +static struct platform_device hdmi_fixed_voltage = { + .name ="reg-fixed-voltage" , + .id =6 , + .dev = { + .platform_data = &hdmi_fixed_voltage_config, + }, +}; +/* GPIO I2C 5 (PMIC) */ static struct i2c_board_info i2c5_devs[]__initdata = {arch/arm/mach-exynos4/mach-universal_c210.c +6
-0{@@ -714,6 +768,12 @@ static struct platform_device *universal_devices[] __initdata = { &s3c_device_hsmmc3, &s3c_device_i2c3, &s3c_device_i2c5, + &s3c_device_i2c8, + &hdmi_fixed_voltage, + &exynos4_device_pd[PD_TV ], + &s5p_device_hdmi, + &s5p_device_sdo, + &s5p_device_mixer, /* Universal Devices */arch/arm/mach-exynos4/mach-universal_c210.c +0
-0&i2c_gpio12,
arch/arm/mach-exynos4/mach-universal_c210.c static void __init universal_map_io(void) · line 792
Quoted 1 line
arch/arm/mach-exynos4/mach-universal_c210.c +0
-0@@ -732,6 +792,20 @@ static void __init universal_map_io(void) s3c24xx_init_uarts(universal_uartcfgs,
ARRAY_SIZE(universal_uartcfgs));
Quoted 36 lines
arch/arm/mach-exynos4/mach-universal_c210.c +16
-1} +void s5p_tv_setup (void ) +{ +/* direct HPD to HDMI chip */ +gpio_request (EXYNOS4_GPX3 (7 ),"hpd-plug" ); + +gpio_direction_input (EXYNOS4_GPX3 (7 )); +s3c_gpio_cfgpin (EXYNOS4_GPX3 (7 ),S3C_GPIO_SFN (0x3 )); +s3c_gpio_setpull (EXYNOS4_GPX3 (7 ),S3C_GPIO_PULL_NONE ); + +/* setup dependencies between TV devices */ + s5p_device_hdmi.dev.parent = &exynos4_device_pd[PD_TV ].dev; + s5p_device_mixer.dev.parent = &exynos4_device_pd[PD_TV ].dev; +} +static void __init universal_reserve (void ) {s5p_mfc_reserve_mem (0x43000000 ,8 <<20 ,0x51000000 ,8 <<20 );@@ -740,6 +814,7 @@ static void __init universal_reserve(void)static void __init universal_machine_init (void ) {universal_sdhci_init (); +s5p_tv_setup ();i2c_register_board_info (0 , i2c0_devs,ARRAY_SIZE (i2c0_devs));i2c_register_board_info (1 , i2c1_devs,ARRAY_SIZE (i2c1_devs));@@ -749,6 +824,7 @@ static void __init universal_machine_init(void)i2c_register_board_info (3 , i2c3_devs,ARRAY_SIZE (i2c3_devs));s3c_i2c5_set_platdata (NULL ); +s3c_i2c8_set_platdata (NULL );i2c_register_board_info (5 , i2c5_devs,ARRAY_SIZE (i2c5_devs));universal_touchkey_init (); --
Quoted 1 line
1.7.1.569.g6f426
Please don't mix some changes in one patch.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH 7/8 ARM: S5PV210: add support for TV device
In reply to Marek SzyprowskiFrom: Tomasz Stanislawski <[email protected]>
This patch adds clocks and definitions needed by TV driver infrastructure for Samsung S5PV210 platform.
--- arch/arm/mach-s5pv210/clock.c | 156 +++++++++++++++++++++-- arch/arm/mach-s5pv210/cpu.c | 4 + arch/arm/mach-s5pv210/include/mach/irqs.h | 2 +- arch/arm/mach-s5pv210/include/mach/map.h | 16 +++ arch/arm/mach-s5pv210/include/mach/regs-clock.h | 7 +- 5 files changed, 171 insertions(+), 14 deletions(-)
arch/arm/mach-s5pv210/clock.c +145 -11
@@ -174,6 +174,17 @@ static int s5pv210_clk_mask1_ctrl(struct clk *clk, int enable)return s5p_gatectrl (S5P_CLK_SRC_MASK1 , clk, enable); } +static int exynos4_clk_hdmiphy_ctrl (struct clk *clk,int enable) +{ +return s5p_gatectrl (S5P_HDMI_PHY_CONTROL , clk, enable); +} + +static int exynos4_clk_dac_ctrl (struct clk *clk,int enable) +{ +return s5p_gatectrl (S5P_DAC_PHY_CONTROL , clk, enable); +} + +static struct clk clk_sclk_hdmi27m = { .name ="sclk_hdmi27m" , .rate =27000000 ,
@@ -330,6 +341,40 @@ static struct clk init_clocks_off[] = { .enable = s5pv210_clk_ip0_ctrl, .ctrlbit = (1 << 16), }, { + .name = "dac", + .devname = "s5p-sdo", + .parent = &clk_hclk_dsys.clk, + .enable = s5pv210_clk_ip1_ctrl, + .ctrlbit = (1 << 10), + }, { + .name = "mixer", + .devname = "s5p-mixer", + .parent = &clk_hclk_dsys.clk, + .enable = s5pv210_clk_ip1_ctrl, + .ctrlbit = (1 << 9), + }, { + .name = "vp", + .devname = "s5p-mixer", + .parent = &clk_hclk_dsys.clk, + .enable = s5pv210_clk_ip1_ctrl, + .ctrlbit = (1 << 8), + }, { + .name = "hdmi", + .devname = "s5pv210-hdmi", + .parent = &clk_hclk_dsys.clk, + .enable = s5pv210_clk_ip1_ctrl, + .ctrlbit = (1 << 11), + }, { + .name = "hdmiphy", + .devname = "s5pv210-hdmi", + .enable = exynos4_clk_hdmiphy_ctrl, + .ctrlbit = (1 << 0), + }, { + .name = "dacphy", + .devname = "s5p-sdo", + .enable = exynos4_clk_dac_ctrl, + .ctrlbit = (1 << 0), + }, { .name = "otg", .parent = &clk_hclk_psys.clk, .enable = s5pv210_clk_ip1_ctrl,
@@ -600,6 +645,26 @@ static struct clksrc_sources clkset_sclk_mixer = { .nr_sources = ARRAY_SIZE(clkset_sclk_mixer_list), }; +static struct clksrc_clk clk_sclk_mixer = { + .clk = { + .name ="sclk_mixer" , + .enable = s5pv210_clk_mask0_ctrl, + .ctrlbit = (1 <<1 ), + }, + .sources = &clkset_sclk_mixer, + .reg_src = { .reg =S5P_CLK_SRC1 , .shift =4 , .size =1 }, +}; + +static struct clksrc_clk *sclk_tv[] = { + &clk_sclk_dac, + &clk_sclk_pixel, + &clk_sclk_hdmi, + &clk_sclk_mixer, +NULL , +}; + +/* -------------------------------------------- */ +static struct clk *clkset_sclk_audio0_list[] = { [0 ] = &clk_ext_xtal_mux, [1 ] = &clk_pcmcdclk0,
@@ -783,14 +848,6 @@ static struct clksrc_clk clksrcs[] = { .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, }, { .clk = { - .name = "sclk_mixer", - .enable = s5pv210_clk_mask0_ctrl, - .ctrlbit = (1 << 1), - }, - .sources = &clkset_sclk_mixer, - .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 1 }, - }, { - .clk = { .name = "sclk_fimc", .devname = "s5pv210-fimc.0", .enable = s5pv210_clk_mask1_ctrl,
@@ -981,9 +1038,6 @@ static struct clksrc_clk *sysclks[] = { &clk_pclk_psys, &clk_vpllsrc, &clk_sclk_vpll, - &clk_sclk_dac, - &clk_sclk_pixel, - &clk_sclk_hdmi, &clk_mout_dmc0, &clk_sclk_dmc0, &clk_sclk_audio0,
@@ -1068,6 +1122,81 @@ static struct clk_ops s5pv210_epll_ops = { .get_rate = s5p_epll_get_rate, }; +struct vpll_div_data { +u32 rate; +u32 pdiv; +u32 mdiv; +u32 sdiv; +u32 k; +u32 mfr; +u32 mrr; +u32 vsel; + +}; + +static struct vpll_div_data vpll_div[] = { + {54000000 ,3 ,53 ,3 ,1024 ,0 ,17 ,0 }, + {108000000 ,3 ,53 ,2 ,1024 ,0 ,17 ,0 }, +}; + +static unsigned long s5pv210_vpll_get_rate (struct clk *clk) +{ +return clk->rate; +} + +static int s5pv210_vpll_set_rate (struct clk *clk,unsigned long rate) +{ +unsigned int vpll_con0, vpll_con1; +unsigned int i; + +/* Return if nothing changed */ +if (clk->rate == rate) +return 0 ; + + vpll_con0 =__raw_readl (S5P_VPLL_CON0 ); + vpll_con0 &= ~(0x1 <<27 | \ +PLL90XX_MDIV_MASK <<PLL90XX_MDIV_SHIFT | \ +PLL90XX_PDIV_MASK <<PLL90XX_PDIV_SHIFT | \ +PLL90XX_SDIV_MASK <<PLL90XX_SDIV_SHIFT ); + + vpll_con1 =__raw_readl (S5P_VPLL_CON1 ); + vpll_con1 &= ~(0x1f <<24 | \ +0x3f <<16 | \ +0xfff <<0 ); + +for (i =0 ; i <ARRAY_SIZE (vpll_div); i++) { +if (vpll_div[i].rate == rate) { + vpll_con0 |= vpll_div[i].vsel <<27 ; + vpll_con0 |= vpll_div[i].pdiv <<PLL90XX_PDIV_SHIFT ; + vpll_con0 |= vpll_div[i].mdiv <<PLL90XX_MDIV_SHIFT ; + vpll_con0 |= vpll_div[i].sdiv <<PLL90XX_SDIV_SHIFT ; + + vpll_con1 |= vpll_div[i].mrr <<24 ; + vpll_con1 |= vpll_div[i].mfr <<16 ; + vpll_con1 |= vpll_div[i].k <<0 ; +break ; + } + } + +if (i ==ARRAY_SIZE (vpll_div)) { +printk (KERN_ERR "%s: Invalid Clock VPLL Frequency\n" , + __func__); +return -EINVAL ; + } + +__raw_writel (vpll_con0,S5P_VPLL_CON0 ); +__raw_writel (vpll_con1,S5P_VPLL_CON1 ); + + clk->rate = rate; + +return 0 ; +} + +static struct clk_ops s5pv210_vpll_ops = { + .get_rate = s5pv210_vpll_get_rate, + .set_rate = s5pv210_vpll_set_rate, +}; + void __init_or_cpufreq s5pv210_setup_clocks(void) {struct clk *xtal_clk;
@@ -1116,6 +1245,7 @@ void __init_or_cpufreq s5pv210_setup_clocks(void) clk_fout_apll.ops = &clk_fout_apll_ops; clk_fout_mpll.rate = mpll; clk_fout_epll.rate = epll; + clk_fout_vpll.ops = &s5pv210_vpll_ops; clk_fout_vpll.rate = vpll; printk(KERN_INFO "S5PV210: PLL settings, A=%ld, M=%ld, E=%ld V=%ld",
@@ -1161,6 +1291,10 @@ void __init s5pv210_register_clocks(void)for (ptr =0 ; ptr <ARRAY_SIZE (sysclks); ptr++)s3c_register_clksrc (sysclks[ptr],1 ); +/* register TV clocks */ +for (ptr =0 ; sclk_tv[ptr]; ++ptr) +s3c_register_clksrc (sclk_tv[ptr],1 ); +s3c_register_clksrc (clksrcs,ARRAY_SIZE (clksrcs));s3c_register_clocks (init_clocks,ARRAY_SIZE (init_clocks));
arch/arm/mach-s5pv210/cpu.c +4 -0
@@ -41,6 +41,7 @@#include <plat/keypad-core.h> #include <plat/sdhci.h> #include <plat/reset.h> +#include <plat/tv-core.h> /* Initial IO mappings */
@@ -144,6 +145,9 @@ void __init s5pv210_map_io(void)/* Use s5pv210-keypad instead of samsung-keypad */ samsung_keypad_setname ("s5pv210-keypad" ); + +/* setup TV devices */ +s5p_hdmi_setname ("s5pv210-hdmi" ); }void __init s5pv210_init_clocks (int xtal)
arch/arm/mach-s5pv210/include/mach/irqs.h +1 -1
@@ -86,7 +86,7 @@#define IRQ_HDMI S5P_IRQ_VIC2(12)#define IRQ_IIC1 S5P_IRQ_VIC2(13)#define IRQ_MFC S5P_IRQ_VIC2(14) -#define IRQ_TVENC S5P_IRQ_VIC2(15) +#define IRQ_SDO S5P_IRQ_VIC2(15)#define IRQ_I2S0 S5P_IRQ_VIC2(16)#define IRQ_I2S1 S5P_IRQ_VIC2(17)#define IRQ_I2S2 S5P_IRQ_VIC2(18)
arch/arm/mach-s5pv210/include/mach/map.h +16 -0
@@ -91,6 +91,12 @@#define S5PV210_PA_FIMC1 0xFB300000#define S5PV210_PA_FIMC2 0xFB400000 +/* TV devices */ +#define S5PV210_PA_SDO 0xF9000000 +#define S5PV210_PA_VP 0xF9100000 +#define S5PV210_PA_MIXER 0xF9200000 +#define S5PV210_PA_HDMI 0xFA100000 +/* Compatibiltiy Defines */ #define S3C_PA_FB S5PV210_PA_FB
@@ -112,6 +118,16 @@#define S5P_PA_FIMC2 S5PV210_PA_FIMC2#define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS#define S5P_PA_MFC S5PV210_PA_MFC + +#define S5P_PA_SDO S5PV210_PA_SDO +#define S5P_SZ_SDO SZ_64K +#define S5P_PA_VP S5PV210_PA_VP +#define S5P_SZ_VP SZ_64K +#define S5P_PA_MIXER S5PV210_PA_MIXER +#define S5P_SZ_MIXER SZ_64K +#define S5P_PA_HDMI S5PV210_PA_HDMI +#define S5P_SZ_HDMI SZ_1M +#define S5P_PA_ONENAND S5PC110_PA_ONENAND#define S5P_PA_ONENAND_DMA S5PC110_PA_ONENAND_DMA#define S5P_PA_SDRAM S5PV210_PA_SDRAM
arch/arm/mach-s5pv210/include/mach/regs-clock.h +5 -2
@@ -26,7 +26,9 @@#define S5P_MPLL_CON S5P_CLKREG(0x108)#define S5P_EPLL_CON S5P_CLKREG(0x110)#define S5P_EPLL_CON1 S5P_CLKREG(0x114) -#define S5P_VPLL_CON S5P_CLKREG(0x120) +#define S5P_VPLL_CON0 S5P_CLKREG(0x120) +#define S5P_VPLL_CON S5P_VPLL_CON0 +#define S5P_VPLL_CON1 S5P_CLKREG(0x120)#define S5P_CLK_SRC0 S5P_CLKREG(0x200)#define S5P_CLK_SRC1 S5P_CLKREG(0x204)
@@ -144,8 +146,9 @@#define S5P_OTHERS S5P_CLKREG(0xE000)#define S5P_OM_STAT S5P_CLKREG(0xE100) +#define S5P_HDMI_PHY_CONTROL S5P_CLKREG(0xE804)#define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C) -#define S5P_DAC_CONTROL S5P_CLKREG(0xE810) +#define S5P_DAC_PHY_CONTROL S5P_CLKREG(0xE810)#define S5P_MIPI_DPHY_CONTROL (x) S5P_CLKREG(0xE814)#define S5P_MIPI_DPHY_ENABLE (1 << 0)#define S5P_MIPI_DPHY_SRESETN (1 << 1)
Signature · 1 line
1.7.1.569.g6f426
RE: [PATCH 7/8] ARM: S5PV210: add support for TV device
arch/arm/mach-s5pv210/clock.c static int s5pv210_clk_mask1_ctrl(struct clk *clk,
Quoted 23 lines · Marek Szyprowski
From: Tomasz Stanislawski <[email protected]>
This patch adds clocks and definitions needed by TV driver infrastructure for Samsung S5PV210 platform.
Signed-off-by Tomasz Stanislawski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/mach-s5pv210/clock.c | 156 +++++++++++++++++++++-- arch/arm/mach-s5pv210/cpu.c | 4 + arch/arm/mach-s5pv210/include/mach/irqs.h | 2 +- arch/arm/mach-s5pv210/include/mach/map.h | 16 +++ arch/arm/mach-s5pv210/include/mach/regs-clock.h | 7 +- 5 files changed, 171 insertions(+), 14 deletions(-)arch/arm/mach-s5pv210/clock.c +0
-0@@ -174,6 +174,17 @@ static int s5pv210_clk_mask1_ctrl(struct clk *clk,
int
Quoted 5 lines
arch/arm/mach-s5pv210/clock.c +1
-0enable)return s5p_gatectrl (S5P_CLK_SRC_MASK1 , clk, enable); } +static int exynos4_clk_hdmiphy_ctrl (struct clk *clk,int enable)
arch/arm/mach-s5pv210/clock.c static int s5pv210_clk_mask1_ctrl(struct clk *clk, int enable) · line 187
Quoted 10 lines
arch/arm/mach-s5pv210/clock.c +10
-0+{ +return s5p_gatectrl (S5P_HDMI_PHY_CONTROL , clk, enable); +} + +static int exynos4_clk_dac_ctrl (struct clk *clk,int enable) +{ +return s5p_gatectrl (S5P_DAC_PHY_CONTROL , clk, enable); +} + +
Just 1 empty line is enough...
Quoted 57 lines
arch/arm/mach-s5pv210/clock.c +0
-0static struct clk clk_sclk_hdmi27m = { .name ="sclk_hdmi27m" ,arch/arm/mach-s5pv210/clock.c +43
-0.rate = 27000000,@@ -330,6 +341,40 @@ static struct clk init_clocks_off[] = { .enable = s5pv210_clk_ip0_ctrl, .ctrlbit = (1 << 16), }, { + .name = "dac", + .devname = "s5p-sdo", + .parent = &clk_hclk_dsys.clk, + .enable = s5pv210_clk_ip1_ctrl, + .ctrlbit = (1 << 10), + }, { + .name = "mixer", + .devname = "s5p-mixer", + .parent = &clk_hclk_dsys.clk, + .enable = s5pv210_clk_ip1_ctrl, + .ctrlbit = (1 << 9), + }, { + .name = "vp", + .devname = "s5p-mixer", + .parent = &clk_hclk_dsys.clk, + .enable = s5pv210_clk_ip1_ctrl, + .ctrlbit = (1 << 8), + }, { + .name = "hdmi", + .devname = "s5pv210-hdmi", + .parent = &clk_hclk_dsys.clk, + .enable = s5pv210_clk_ip1_ctrl, + .ctrlbit = (1 << 11), + }, { + .name = "hdmiphy", + .devname = "s5pv210-hdmi", + .enable = exynos4_clk_hdmiphy_ctrl, + .ctrlbit = (1 << 0), + }, { + .name = "dacphy", + .devname = "s5p-sdo", + .enable = exynos4_clk_dac_ctrl, + .ctrlbit = (1 << 0), + }, { .name = "otg", .parent = &clk_hclk_psys.clk, .enable = s5pv210_clk_ip1_ctrl,@@ -600,6 +645,26 @@ static struct clksrc_sources clkset_sclk_mixer = { .nr_sources = ARRAY_SIZE(clkset_sclk_mixer_list), }; +static struct clksrc_clk clk_sclk_mixer = { + .clk = { + .name ="sclk_mixer" , + .enable = s5pv210_clk_mask0_ctrl, + .ctrlbit = (1 <<1 ), + }, + .sources = &clkset_sclk_mixer, + .reg_src = { .reg =S5P_CLK_SRC1 , .shift =4 , .size =1 }, +};
arch/arm/mach-s5pv210/clock.c static struct clksrc_sources clkset_sclk_mixer = { · line 666
Quoted 10 lines
arch/arm/mach-s5pv210/clock.c +10
-0+ +static struct clksrc_clk *sclk_tv[] = { + &clk_sclk_dac, + &clk_sclk_pixel, + &clk_sclk_hdmi, + &clk_sclk_mixer, +NULL , +}; + +/* -------------------------------------------- */
?
Quoted 38 lines
arch/arm/mach-s5pv210/clock.c +6
-11+static struct clk *clkset_sclk_audio0_list[] = { [0 ] = &clk_ext_xtal_mux, [1 ] = &clk_pcmcdclk0,@@ -783,14 +848,6 @@ static struct clksrc_clk clksrcs[] = { .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, }, { .clk = { - .name = "sclk_mixer", - .enable = s5pv210_clk_mask0_ctrl, - .ctrlbit = (1 << 1), - }, - .sources = &clkset_sclk_mixer, - .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 1 }, - }, { - .clk = { .name = "sclk_fimc", .devname = "s5pv210-fimc.0", .enable = s5pv210_clk_mask1_ctrl,@@ -981,9 +1038,6 @@ static struct clksrc_clk *sysclks[] = { &clk_pclk_psys, &clk_vpllsrc, &clk_sclk_vpll, - &clk_sclk_dac, - &clk_sclk_pixel, - &clk_sclk_hdmi, &clk_mout_dmc0, &clk_sclk_dmc0, &clk_sclk_audio0,@@ -1068,6 +1122,81 @@ static struct clk_ops s5pv210_epll_ops = { .get_rate = s5p_epll_get_rate, }; +struct vpll_div_data { +u32 rate; +u32 pdiv; +u32 mdiv; +u32 sdiv;
arch/arm/mach-s5pv210/clock.c static struct clk_ops s5pv210_epll_ops = { · line 1139
Quoted 10 lines
arch/arm/mach-s5pv210/clock.c +10
-0+u32 k; +u32 mfr; +u32 mrr; +u32 vsel; + +}; + +static struct vpll_div_data vpll_div[] = { + {54000000 ,3 ,53 ,3 ,1024 ,0 ,17 ,0 }, + {108000000 ,3 ,53 ,2 ,1024 ,0 ,17 ,0 },
Basically, this can be changed on each board.
arch/arm/mach-s5pv210/clock.c static struct clk_ops s5pv210_epll_ops = { · line 1142
Quoted 3 lines
arch/arm/mach-s5pv210/clock.c +3
-0+}; + +static unsigned long s5pv210_vpll_get_rate (struct clk *clk)
How about following in arch/arm/plat-s5p/clock.c ?
unsigned long s5p_vpll_get_rate(struct clk *clk)
{
return clk->rate;
}arch/arm/mach-s5pv210/clock.c static struct clk_ops s5pv210_epll_ops = { · line 1147
Quoted 5 lines
arch/arm/mach-s5pv210/clock.c +5
-0+{ +return clk->rate; +} + +static int s5pv210_vpll_set_rate (struct clk *clk,unsigned long rate)
Would be better if this function could be used on other SoC which has PLL90XX.
Quoted 32 lines
arch/arm/mach-s5pv210/clock.c +32
-0+{ +unsigned int vpll_con0, vpll_con1; +unsigned int i; + +/* Return if nothing changed */ +if (clk->rate == rate) +return 0 ; + + vpll_con0 =__raw_readl (S5P_VPLL_CON0 ); + vpll_con0 &= ~(0x1 <<27 | \ +PLL90XX_MDIV_MASK <<PLL90XX_MDIV_SHIFT | \ +PLL90XX_PDIV_MASK <<PLL90XX_PDIV_SHIFT | \ +PLL90XX_SDIV_MASK <<PLL90XX_SDIV_SHIFT ); + + vpll_con1 =__raw_readl (S5P_VPLL_CON1 ); + vpll_con1 &= ~(0x1f <<24 | \ +0x3f <<16 | \ +0xfff <<0 ); + +for (i =0 ; i <ARRAY_SIZE (vpll_div); i++) { +if (vpll_div[i].rate == rate) { + vpll_con0 |= vpll_div[i].vsel <<27 ; + vpll_con0 |= vpll_div[i].pdiv <<PLL90XX_PDIV_SHIFT ; + vpll_con0 |= vpll_div[i].mdiv <<PLL90XX_MDIV_SHIFT ; + vpll_con0 |= vpll_div[i].sdiv <<PLL90XX_SDIV_SHIFT ; + + vpll_con1 |= vpll_div[i].mrr <<24 ; + vpll_con1 |= vpll_div[i].mfr <<16 ; + vpll_con1 |= vpll_div[i].k <<0 ; +break ; + } + }
arch/arm/mach-s5pv210/clock.c static struct clk_ops s5pv210_epll_ops = { · line 1189
Quoted 10 lines
arch/arm/mach-s5pv210/clock.c +10
-0+ +if (i ==ARRAY_SIZE (vpll_div)) { +printk (KERN_ERR "%s: Invalid Clock VPLL Frequency\n" , + __func__); +return -EINVAL ; + } + +__raw_writel (vpll_con0,S5P_VPLL_CON0 ); +__raw_writel (vpll_con1,S5P_VPLL_CON1 ); +
Need to add check PLL locking here.
Quoted 90 lines
arch/arm/mach-s5pv210/clock.c +11
-0+ clk->rate = rate; + +return 0 ; +} + +static struct clk_ops s5pv210_vpll_ops = { + .get_rate = s5pv210_vpll_get_rate, + .set_rate = s5pv210_vpll_set_rate, +}; + void __init_or_cpufreq s5pv210_setup_clocks(void) {struct clk *xtal_clk;@@ -1116,6 +1245,7 @@ void __init_or_cpufreq s5pv210_setup_clocks(void) clk_fout_apll.ops = &clk_fout_apll_ops; clk_fout_mpll.rate = mpll; clk_fout_epll.rate = epll; + clk_fout_vpll.ops = &s5pv210_vpll_ops; clk_fout_vpll.rate = vpll; printk(KERN_INFO "S5PV210: PLL settings, A=%ld, M=%ld, E=%ldV=%ld",
arch/arm/mach-s5pv210/clock.c +4
-0@@ -1161,6 +1291,10 @@ void __init s5pv210_register_clocks(void)for (ptr =0 ; ptr <ARRAY_SIZE (sysclks); ptr++)s3c_register_clksrc (sysclks[ptr],1 ); +/* register TV clocks */ +for (ptr =0 ; sclk_tv[ptr]; ++ptr) +s3c_register_clksrc (sclk_tv[ptr],1 ); +s3c_register_clksrc (clksrcs,ARRAY_SIZE (clksrcs));arch/arm/mach-s5pv210/clock.c +0
-0s3c_register_clocks (init_clocks,ARRAY_SIZE (init_clocks));arch/arm/mach-s5pv210/cpu.c +4
-0@@ -41,6 +41,7 @@#include <plat/keypad-core.h> #include <plat/sdhci.h> #include <plat/reset.h> +#include <plat/tv-core.h> /* Initial IO mappings */ @@ -144,6 +145,9 @@ void __init s5pv210_map_io(void)/* Use s5pv210-keypad instead of samsung-keypad */ samsung_keypad_setname ("s5pv210-keypad" ); + +/* setup TV devices */ +s5p_hdmi_setname ("s5pv210-hdmi" ); }void __init s5pv210_init_clocks (int xtal)arch/arm/mach- renamed from arch/arm/mach-s5pv210/include/mach/irqs.h +0
-0
s5pv210/include/mach/irqs.h
index b9f9ec3..b724d1e 100644arch/arm/mach-s5pv210/include/mach/irqs.h +1
-1@@ -86,7 +86,7 @@#define IRQ_HDMI S5P_IRQ_VIC2(12)#define IRQ_IIC1 S5P_IRQ_VIC2(13)#define IRQ_MFC S5P_IRQ_VIC2(14) -#define IRQ_TVENC S5P_IRQ_VIC2(15) +#define IRQ_SDO S5P_IRQ_VIC2(15)#define IRQ_I2S0 S5P_IRQ_VIC2(16)#define IRQ_I2S1 S5P_IRQ_VIC2(17)#define IRQ_I2S2 S5P_IRQ_VIC2(18)arch/arm/mach- renamed from arch/arm/mach-s5pv210/include/mach/map.h +0
-0
s5pv210/include/mach/map.h
index bb405b3..1f2f3aa 100644arch/arm/mach-s5pv210/include/mach/map.h +6
-0@@ -91,6 +91,12 @@#define S5PV210_PA_FIMC1 0xFB300000#define S5PV210_PA_FIMC2 0xFB400000 +/* TV devices */ +#define S5PV210_PA_SDO 0xF9000000 +#define S5PV210_PA_VP 0xF9100000 +#define S5PV210_PA_MIXER 0xF9200000 +#define S5PV210_PA_HDMI 0xFA100000 +/* Compatibiltiy Defines */ #define S3C_PA_FB S5PV210_PA_FB
arch/arm/mach-s5pv210/include/mach/map.h line 123
Quoted 6 lines
arch/arm/mach-s5pv210/include/mach/map.h +3
-0@@ -112,6 +118,16 @@#define S5P_PA_FIMC2 S5PV210_PA_FIMC2#define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS#define S5P_PA_MFC S5PV210_PA_MFC + +#define S5P_PA_SDO S5PV210_PA_SDO +#define S5P_SZ_SDO SZ_64K
Don't define SZ_XXX here, if SZ_XX is needed, just use it.
arch/arm/mach-s5pv210/include/mach/map.h line 125
Quoted 2 lines
arch/arm/mach-s5pv210/include/mach/map.h +2
-0+#define S5P_PA_VP S5PV210_PA_VP +#define S5P_SZ_VP SZ_64K
Same as above.
arch/arm/mach-s5pv210/include/mach/map.h line 127
Quoted 2 lines
arch/arm/mach-s5pv210/include/mach/map.h +2
-0+#define S5P_PA_MIXER S5PV210_PA_MIXER +#define S5P_SZ_MIXER SZ_64K
Same.
arch/arm/mach-s5pv210/include/mach/map.h line 129
Quoted 2 lines
arch/arm/mach-s5pv210/include/mach/map.h +2
-0+#define S5P_PA_HDMI S5PV210_PA_HDMI +#define S5P_SZ_HDMI SZ_1M
Same.
Review
Quoted 6 lines
arch/arm/mach-s5pv210/include/mach/map.h +1
-0+#define S5P_PA_ONENAND S5PC110_PA_ONENAND#define S5P_PA_ONENAND_DMA S5PC110_PA_ONENAND_DMA #define
S5P_PA_SDRAMS5PV210_PA_SDRAM(quoted diff) +0
-0
b/arch/arm/mach-
Quoted 27 lines
s5pv210/include/mach/regs-clock.h
index 78925c5..69c16f9 100644arch/arm/mach-s5pv210/include/mach/regs-clock.h +5
-3@@ -26,7 +26,9 @@#define S5P_MPLL_CON S5P_CLKREG(0x108)#define S5P_EPLL_CON S5P_CLKREG(0x110)#define S5P_EPLL_CON1 S5P_CLKREG(0x114) -#define S5P_VPLL_CON S5P_CLKREG(0x120) +#define S5P_VPLL_CON0 S5P_CLKREG(0x120) +#define S5P_VPLL_CON S5P_VPLL_CON0 +#define S5P_VPLL_CON1 S5P_CLKREG(0x120)#define S5P_CLK_SRC0 S5P_CLKREG(0x200)#define S5P_CLK_SRC1 S5P_CLKREG(0x204)@@ -144,8 +146,9 @@#define S5P_OTHERS S5P_CLKREG(0xE000)#define S5P_OM_STAT S5P_CLKREG(0xE100) +#define S5P_HDMI_PHY_CONTROL S5P_CLKREG(0xE804)#define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C) -#define S5P_DAC_CONTROL S5P_CLKREG(0xE810) +#define S5P_DAC_PHY_CONTROL S5P_CLKREG(0xE810)#define S5P_MIPI_DPHY_CONTROL (x) S5P_CLKREG(0xE814)#define S5P_MIPI_DPHY_ENABLE (1 << 0)#define S5P_MIPI_DPHY_SRESETN (1 << 1) --
Quoted 1 line
1.7.1.569.g6f426
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH 8/8 ARM: S5PV210: enable TV support on GONI board
In reply to Marek SzyprowskiFrom: Tomasz Stanislawski <[email protected]>
This patch adds platform devices and regulators for TV devices on Samsung Goni board.
--- arch/arm/mach-s5pv210/Kconfig | 3 +++ arch/arm/mach-s5pv210/mach-goni.c | 9 +++++++++ 2 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv210/Kconfig +3 -0
@@ -95,13 +95,16 @@ config MACH_GONI select S3C_DEV_HSMMC2 select S3C_DEV_I2C1 select S3C_DEV_I2C2 + select S3C_DEV_I2C3 select S5P_DEV_MFC select S3C_DEV_USB_HSOTG select S5P_DEV_ONENAND select SAMSUNG_DEV_KEYPAD + select S5P_DEV_TV select S5PV210_SETUP_FB_24BPP select S5PV210_SETUP_I2C1 select S5PV210_SETUP_I2C2 + select S5PV210_SETUP_I2C3 select S5PV210_SETUP_KEYPAD select S5PV210_SETUP_SDHCI help
arch/arm/mach-s5pv210/mach-goni.c +9 -0
@@ -285,6 +285,7 @@ static struct regulator_consumer_supply goni_ldo5_consumers[] = {static struct regulator_consumer_supply goni_ldo8_consumers[] = {REGULATOR_SUPPLY ("vusb_d" ,"s3c-hsotg" ), +REGULATOR_SUPPLY ("vdd33a_dac" ,"s5p-sdo" ), };static struct regulator_consumer_supply goni_ldo11_consumers[] = {
@@ -475,6 +476,10 @@ static struct regulator_consumer_supply buck1_consumer =static struct regulator_consumer_supply buck2_consumer =REGULATOR_SUPPLY ("vddint" ,NULL ); +static struct regulator_consumer_supply buck3_consumer = +REGULATOR_SUPPLY ("vdet" ,"s5p-sdo" ); + +static struct regulator_init_data goni_buck1_data = { .constraints = { .name ="VARM_1.2V" ,
@@ -511,6 +516,8 @@ static struct regulator_init_data goni_buck3_data = { .enabled = 1, }, }, + .num_consumer_supplies = 1, + .consumer_supplies = &buck3_consumer, }; static struct regulator_init_data goni_buck4_data = {
@@ -812,6 +819,8 @@ static struct platform_device *goni_devices[] __initdata = { &s5p_device_mfc, &s5p_device_mfc_l, &s5p_device_mfc_r, + &s5p_device_mixer, + &s5p_device_sdo, &s3c_device_i2c0, &s5p_device_fimc0, &s5p_device_fimc1,
Signature · 1 line
1.7.1.569.g6f426