Re: [PATCH 1/2] i2c: s3c2410: add optional pin configuration using pinctrl interface
On 11 September 2012 00:51, Stephen Warren swar...@wwwdotorg.org wrote: On 09/06/2012 05:06 AM, Thomas Abraham wrote: On 6 September 2012 15:04, Tomasz Figa t.f...@samsung.com wrote: Hi, This patch shows the problem of the need to explicitly migrate all drivers to pinctrl. Maybe we should consider extending the pinctrl subsystem to set the default state automatically before binding a driver to a device, at least in case of DT-based platforms? The pinctrl driver allows for activating default pin configuration when the pinctrl driver loads. This is referred to as hogging. But should hog be used or not is something that needs to be decided. Some of the factors which favor the driver explicitly setting up the pin configuration are 1. After a suspend and resume cycle, the pin configuration registers may be reset to default values. Hence, during resume, the pin configuration has be redone. I'd think it's the pinctrl driver's responsibility to make hogging work correctly across suspend/resume. Ok. I will add this functionality in the Samsung pinctrl driver. Thanks, Thomas. [...] -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH V4] ARM: EXYNOS5: Add bus clock and set parent clock for FIMD
On Monday, September 17, 2012 11:43 PM Leela Krishna Amudala wrote This patch adds the bus clock for FIMD and changes the device name for lcd clock also sets mout_mpll_user as parent clock to fimd Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com Acked-by: Jingoo Han jg1@samsung.com It looks good. --- arch/arm/mach-exynos/clock-exynos5.c | 35 - arch/arm/mach-exynos/clock-exynos5.h | 17 2 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 arch/arm/mach-exynos/clock-exynos5.h diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c index 774533c..0f6ff97 100644 --- a/arch/arm/mach-exynos/clock-exynos5.c +++ b/arch/arm/mach-exynos/clock-exynos5.c @@ -27,6 +27,7 @@ #include mach/sysmmu.h #include common.h +#include clock-exynos5.h #ifdef CONFIG_PM_SLEEP static struct sleep_save exynos5_clock_save[] = { @@ -891,6 +892,13 @@ static struct clk exynos5_clk_mdma1 = { .ctrlbit= (1 4), }; +static struct clk exynos5_clk_fimd1 = { + .name = fimd, + .devname= exynos5-fb.1, + .enable = exynos5_clk_ip_disp1_ctrl, + .ctrlbit= (1 0), +}; + struct clk *exynos5_clkset_group_list[] = { [0] = clk_ext_xtal_mux, [1] = NULL, @@ -1120,6 +1128,18 @@ static struct clksrc_clk exynos5_clk_sclk_spi2 = { .reg_div = { .reg = EXYNOS5_CLKDIV_PERIC2, .shift = 8, .size = 8 }, }; +struct clksrc_clk exynos5_clk_sclk_fimd1 = { + .clk= { + .name = sclk_fimd, + .devname= exynos5-fb.1, + .enable = exynos5_clksrc_mask_disp1_0_ctrl, + .ctrlbit= (1 0), + }, + .sources = exynos5_clkset_group, + .reg_src = { .reg = EXYNOS5_CLKSRC_DISP1_0, .shift = 0, .size = 4 }, + .reg_div = { .reg = EXYNOS5_CLKDIV_DISP1_0, .shift = 0, .size = 4 }, +}; + static struct clksrc_clk exynos5_clksrcs[] = { { .clk= { @@ -1131,16 +1151,6 @@ static struct clksrc_clk exynos5_clksrcs[] = { .reg_div = { .reg = EXYNOS5_CLKDIV_FSYS3, .shift = 8, .size = 8 }, }, { .clk= { - .name = sclk_fimd, - .devname= s3cfb.1, - .enable = exynos5_clksrc_mask_disp1_0_ctrl, - .ctrlbit= (1 0), - }, - .sources = exynos5_clkset_group, - .reg_src = { .reg = EXYNOS5_CLKSRC_DISP1_0, .shift = 0, .size = 4 }, - .reg_div = { .reg = EXYNOS5_CLKDIV_DISP1_0, .shift = 0, .size = 4 }, - }, { - .clk= { .name = aclk_266_gscl, }, .sources = clk_src_gscl_266, @@ -1240,12 +1250,14 @@ static struct clksrc_clk *exynos5_sysclks[] = { exynos5_clk_mdout_spi0, exynos5_clk_mdout_spi1, exynos5_clk_mdout_spi2, + exynos5_clk_sclk_fimd1, }; static struct clk *exynos5_clk_cdev[] = { exynos5_clk_pdma0, exynos5_clk_pdma1, exynos5_clk_mdma1, + exynos5_clk_fimd1, }; static struct clksrc_clk *exynos5_clksrc_cdev[] = { @@ -1274,6 +1286,7 @@ static struct clk_lookup exynos5_clk_lookup[] = { CLKDEV_INIT(dma-pl330.0, apb_pclk, exynos5_clk_pdma0), CLKDEV_INIT(dma-pl330.1, apb_pclk, exynos5_clk_pdma1), CLKDEV_INIT(dma-pl330.2, apb_pclk, exynos5_clk_mdma1), + CLKDEV_INIT(exynos5-fb.1, lcd, exynos5_clk_fimd1), }; static unsigned long exynos5_epll_get_rate(struct clk *clk) @@ -1492,6 +1505,8 @@ void __init_or_cpufreq exynos5_setup_clocks(void) clk_set_rate(exynos5_clk_aclk_acp.clk, 26700); clk_set_rate(exynos5_clk_pclk_acp.clk, 13400); + clk_set_parent(exynos5_clk_sclk_fimd1.clk, + exynos5_clk_mout_mpll_user.clk); for (ptr = 0; ptr ARRAY_SIZE(exynos5_clksrcs); ptr++) s3c_set_clksrc(exynos5_clksrcs[ptr], true); diff --git a/arch/arm/mach-exynos/clock-exynos5.h b/arch/arm/mach-exynos/clock-exynos5.h new file mode 100644 index 000..6f78f5d --- /dev/null +++ b/arch/arm/mach-exynos/clock-exynos5.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Header file for exynos5 clock support + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#ifndef __ASM_ARCH_EXYNOS5_CLOCK_H +#define __ASM_ARCH_EXYNOS5_CLOCK_H __FILE__ + +extern struct clksrc_clk exynos5_clk_sclk_fimd1; + +#endif /* __ASM_ARCH_EXYNOS5_CLOCK_H */ -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to
RE: [PATCH] ARM: EXYNOS: Add dp clock support for EXYNOS5
Jingoo Han wrote: Add dp clock instance for EXYNOS5 dp controller. Signed-off-by: Jingoo Han jg1@samsung.com --- arch/arm/mach-exynos/clock-exynos5.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach- exynos/clock-exynos5.c index eb3f4fc..d688abe 100644 --- a/arch/arm/mach-exynos/clock-exynos5.c +++ b/arch/arm/mach-exynos/clock-exynos5.c @@ -683,6 +683,11 @@ static struct clk exynos5_init_clocks_off[] = { .enable = exynos5_clk_ip_disp1_ctrl, .ctrlbit= (1 5), }, { + .name = dp, + .devname= exynos-dp, + .enable = exynos5_clk_ip_disp1_ctrl, + .ctrlbit= (1 4), + }, { .name = jpeg, .enable = exynos5_clk_ip_gen_ctrl, .ctrlbit= (1 2), -- 1.7.1 OK, applied. Thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/7] s5p-fimc/mipi-csis drivers cleanup
This series is a cleanup of s5p-fimc/mipi-csis drivers and changes required for adding device tree support. It depends on Arnd's platform data headers cleanup patch: ARM: samsung: move platform_data definitions git.kernel.org/?p=linux/kernel/git/arm/arm-soc.git;a=commit;h=d7243bd51b783ffd2 Sylwester Nawrocki (7): ARM: samsung: Remove unused fields from FIMC and CSIS platform data ARM: samsung: Change __s5p_mipi_phy_control() function signature ARM: EXYNOS: Change MIPI-CSIS device regulator supply names s5p-csis: Replace phy_enable platform data callback with direct call s5p-fimc: Remove unused platform data structure fields s5p-csis: Allow to specify pixel clock's source through platform data s5p-csis: Change regulator supply names arch/arm/mach-exynos/mach-nuri.c | 7 ++- arch/arm/mach-exynos/mach-origen.c | 4 ++-- arch/arm/mach-exynos/mach-universal_c210.c | 7 ++- arch/arm/plat-samsung/setup-mipiphy.c | 20 +++- drivers/media/video/s5p-fimc/mipi-csis.c | 23 +-- include/linux/platform_data/mipi-csis.h| 30 -- include/media/s5p_fimc.h | 2 -- 7 files changed, 38 insertions(+), 55 deletions(-) -- 1.7.11.3 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] ARM: EXYNOS: Use non-secure MDMA1
Kukjin Kim wrote: On 08/28/12 04:08, Tomasz Figa wrote: Using secure MDMA1 on TrustZone-enabled boards causes early boot crash, so use non-secure instead. Signed-off-by: Tomasz Figat.f...@samsung.com Signed-off-by: Kyungmin Parkkyungmin.p...@samsung.com --- arch/arm/mach-exynos/dma.c | 2 +- arch/arm/mach-exynos/include/mach/map.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-exynos/dma.c b/arch/arm/mach-exynos/dma.c index f60b66d..8858df5 100644 --- a/arch/arm/mach-exynos/dma.c +++ b/arch/arm/mach-exynos/dma.c @@ -261,7 +261,7 @@ static struct dma_pl330_platdata exynos_mdma1_pdata = { }; static AMBA_AHB_DEVICE(exynos_mdma1, dma-pl330.2, 0x00041330, - EXYNOS4_PA_MDMA1, {EXYNOS4_IRQ_MDMA1},exynos_mdma1_pdata); + EXYNOS4_PA_NS_MDMA1, {EXYNOS4_IRQ_MDMA1},exynos_mdma1_pdata); static int __init exynos_dma_init(void) { diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach- exynos/include/mach/map.h index 51943f2..5df5910 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h @@ -89,7 +89,8 @@ #define EXYNOS4_PA_L2CC 0x10502000 #define EXYNOS4_PA_MDMA0 0x1081 -#define EXYNOS4_PA_MDMA1 0x1284 +#define EXYNOS4_PA_S_MDMA1 0x1284 +#define EXYNOS4_PA_NS_MDMA10x1285 #define EXYNOS4_PA_PDMA0 0x1268 #define EXYNOS4_PA_PDMA1 0x1269 #define EXYNOS5_PA_MDMA0 0x1080 Cc'ed Boojin Kim. Well, just fix the address is enough like exynos5 stuff? I don't have any idea why we need secure mdma and non-secure mdma both here... diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h index c72b675..c941053 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h @@ -89,7 +89,7 @@ #define EXYNOS4_PA_L2CC0x10502000 #define EXYNOS4_PA_MDMA00x1081 -#define EXYNOS4_PA_MDMA1 0x1284 +#define EXYNOS4_PA_MDMA1 0x1285 #define EXYNOS4_PA_PDMA00x1268 #define EXYNOS4_PA_PDMA10x1269 #define EXYNOS5_PA_MDMA00x1080 -- From: Kukjin Kim kgene@samsung.com Subject: [PATCH] ARM: EXYNOS: fix address for EXYNOS4 MDMA1 use non-secure mdma1 address. Reported-by: Tomasz Figa t.f...@samsung.com Signed-off-by: Kukjin Kim kgene@samsung.com --- arch/arm/mach-exynos/include/mach/map.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h index c72b675..c941053 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h @@ -89,7 +89,7 @@ #define EXYNOS4_PA_L2CC0x10502000 #define EXYNOS4_PA_MDMA0 0x1081 -#define EXYNOS4_PA_MDMA1 0x1284 +#define EXYNOS4_PA_MDMA1 0x1285 #define EXYNOS4_PA_PDMA0 0x1268 #define EXYNOS4_PA_PDMA1 0x1269 #define EXYNOS5_PA_MDMA0 0x1080 -- 1.7.4.1 Thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/7] ARM: samsung: Remove unused fields from FIMC and CSIS platform data
The MIPI-CSI2 bus data alignment is now being derived from the media bus pixel code, the drivers don't use the corresponding structure fields, so remove them. Also remove the s5p_csis_phy_enable callback which is now used directly by s5p-csis driver. Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- arch/arm/mach-exynos/mach-nuri.c | 3 --- arch/arm/mach-exynos/mach-universal_c210.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c index 667aefc..da6e7ce 100644 --- a/arch/arm/mach-exynos/mach-nuri.c +++ b/arch/arm/mach-exynos/mach-nuri.c @@ -1180,9 +1180,7 @@ static struct platform_device cam_8m_12v_fixed_rdev = { static struct s5p_platform_mipi_csis mipi_csis_platdata = { .clk_rate = 16600UL, .lanes = 2, - .alignment = 32, .hs_settle = 12, - .phy_enable = s5p_csis_phy_enable, }; #define GPIO_CAM_MEGA_RST EXYNOS4_GPY3(7) /* ISP_RESET */ @@ -1226,7 +1224,6 @@ static struct s5p_fimc_isp_info nuri_camera_sensors[] = { .bus_type = FIMC_MIPI_CSI2, .board_info = m5mols_board_info, .clk_frequency = 2400UL, - .csi_data_align = 32, }, }; diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c index 3056fa7..0b0a2d0 100644 --- a/arch/arm/mach-exynos/mach-universal_c210.c +++ b/arch/arm/mach-exynos/mach-universal_c210.c @@ -944,9 +944,7 @@ static struct platform_device cam_s_if_fixed_reg_dev = { static struct s5p_platform_mipi_csis mipi_csis_platdata = { .clk_rate = 16600UL, .lanes = 2, - .alignment = 32, .hs_settle = 12, - .phy_enable = s5p_csis_phy_enable, }; #define GPIO_CAM_LEVEL_EN(n) EXYNOS4210_GPE4(n + 3) @@ -1011,7 +1009,6 @@ static struct s5p_fimc_isp_info universal_camera_sensors[] = { .board_info = m5mols_board_info, .i2c_bus_num= 0, .clk_frequency = 2400UL, - .csi_data_align = 32, }, #endif }; -- 1.7.11.3 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/7] ARM: samsung: Change __s5p_mipi_phy_control() function signature
Replace pdev argument __s5p_mipi_phy_control() helper with plain int so MIPI-CSIS hardware instance index can be passed directly making the function usable on platforms instantiated from device tree. Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- arch/arm/plat-samsung/setup-mipiphy.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/arch/arm/plat-samsung/setup-mipiphy.c b/arch/arm/plat-samsung/setup-mipiphy.c index 683c466..1474593 100644 --- a/arch/arm/plat-samsung/setup-mipiphy.c +++ b/arch/arm/plat-samsung/setup-mipiphy.c @@ -14,24 +14,18 @@ #include linux/spinlock.h #include mach/regs-clock.h -static int __s5p_mipi_phy_control(struct platform_device *pdev, - bool on, u32 reset) +static int __s5p_mipi_phy_control(int id, bool on, u32 reset) { static DEFINE_SPINLOCK(lock); void __iomem *addr; unsigned long flags; - int pid; u32 cfg; - if (!pdev) + id = max(0, id); + if (id 1) return -EINVAL; - pid = (pdev-id == -1) ? 0 : pdev-id; - - if (pid != 0 pid != 1) - return -EINVAL; - - addr = S5P_MIPI_DPHY_CONTROL(pid); + addr = S5P_MIPI_DPHY_CONTROL(id); spin_lock_irqsave(lock, flags); @@ -52,12 +46,12 @@ static int __s5p_mipi_phy_control(struct platform_device *pdev, return 0; } -int s5p_csis_phy_enable(struct platform_device *pdev, bool on) +int s5p_csis_phy_enable(int id, bool on) { - return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_SRESETN); + return __s5p_mipi_phy_control(id, on, S5P_MIPI_DPHY_SRESETN); } int s5p_dsim_phy_enable(struct platform_device *pdev, bool on) { - return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_MRESETN); + return __s5p_mipi_phy_control(pdev-id, on, S5P_MIPI_DPHY_MRESETN); } -- 1.7.11.3 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/7] ARM: EXYNOS: Change MIPI-CSIS device regulator supply names
Rename MIPI-CSIS regulator supply names to match definitions in the driver after commit s5p-csis: Change regulator supply names. Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- arch/arm/mach-exynos/mach-nuri.c | 4 ++-- arch/arm/mach-exynos/mach-origen.c | 4 ++-- arch/arm/mach-exynos/mach-universal_c210.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c index da6e7ce..bfe6955 100644 --- a/arch/arm/mach-exynos/mach-nuri.c +++ b/arch/arm/mach-exynos/mach-nuri.c @@ -378,10 +378,10 @@ static struct regulator_consumer_supply __initdata max8997_ldo1_[] = { }; static struct regulator_consumer_supply __initdata max8997_ldo3_[] = { REGULATOR_SUPPLY(vusb_d, s3c-hsotg), /* USB */ - REGULATOR_SUPPLY(vdd11, s5p-mipi-csis.0), /* MIPI */ + REGULATOR_SUPPLY(vddcore, s5p-mipi-csis.0), /* MIPI */ }; static struct regulator_consumer_supply __initdata max8997_ldo4_[] = { - REGULATOR_SUPPLY(vdd18, s5p-mipi-csis.0), /* MIPI */ + REGULATOR_SUPPLY(vddio, s5p-mipi-csis.0), /* MIPI */ }; static struct regulator_consumer_supply __initdata max8997_ldo5_[] = { REGULATOR_SUPPLY(vhsic, modemctl), /* MODEM */ diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c index 65ac45b..b58bbca 100644 --- a/arch/arm/mach-exynos/mach-origen.c +++ b/arch/arm/mach-exynos/mach-origen.c @@ -96,12 +96,12 @@ static struct s3c2410_uartcfg origen_uartcfgs[] __initdata = { }; static struct regulator_consumer_supply __initdata ldo3_consumer[] = { - REGULATOR_SUPPLY(vdd11, s5p-mipi-csis.0), /* MIPI */ + REGULATOR_SUPPLY(vddcore, s5p-mipi-csis.0), /* MIPI */ REGULATOR_SUPPLY(vdd, exynos4-hdmi), /* HDMI */ REGULATOR_SUPPLY(vdd_pll, exynos4-hdmi), /* HDMI */ }; static struct regulator_consumer_supply __initdata ldo6_consumer[] = { - REGULATOR_SUPPLY(vdd18, s5p-mipi-csis.0), /* MIPI */ + REGULATOR_SUPPLY(vddio, s5p-mipi-csis.0), /* MIPI */ }; static struct regulator_consumer_supply __initdata ldo7_consumer[] = { REGULATOR_SUPPLY(avdd, alc5625), /* Realtek ALC5625 */ diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c index 0b0a2d0..ac00757 100644 --- a/arch/arm/mach-exynos/mach-universal_c210.c +++ b/arch/arm/mach-exynos/mach-universal_c210.c @@ -211,7 +211,7 @@ static struct regulator_consumer_supply lp3974_ldo3_consumer[] = { REGULATOR_SUPPLY(vusb_a, s3c-hsotg), REGULATOR_SUPPLY(vdd, exynos4-hdmi), REGULATOR_SUPPLY(vdd_pll, exynos4-hdmi), - REGULATOR_SUPPLY(vdd11, s5p-mipi-csis.0), + REGULATOR_SUPPLY(vddcore, s5p-mipi-csis.0), }; static struct regulator_init_data lp3974_ldo3_data = { @@ -275,7 +275,7 @@ static struct regulator_init_data lp3974_ldo6_data = { }; static struct regulator_consumer_supply lp3974_ldo7_consumer[] = { - REGULATOR_SUPPLY(vdd18, s5p-mipi-csis.0), + REGULATOR_SUPPLY(vddio, s5p-mipi-csis.0), }; static struct regulator_init_data lp3974_ldo7_data = { -- 1.7.11.3 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/7] s5p-csis: Replace phy_enable platform data callback with direct call
The phy_enable callback is common for all Samsung SoC platforms, replace it with direct function call so the MIPI-CSI2 DPHY control is also possible on device tree instantiated platforms. Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- drivers/media/video/s5p-fimc/mipi-csis.c | 13 +++-- include/linux/platform_data/mipi-csis.h | 11 +-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/media/video/s5p-fimc/mipi-csis.c b/drivers/media/video/s5p-fimc/mipi-csis.c index c9afb05..1a2db5d 100644 --- a/drivers/media/video/s5p-fimc/mipi-csis.c +++ b/drivers/media/video/s5p-fimc/mipi-csis.c @@ -150,6 +150,7 @@ static const struct s5pcsis_event s5pcsis_events[] = { *protecting @format and @flags members * @pads: CSIS pads array * @sd: v4l2_subdev associated with CSIS device instance + * @index: the hardware instance index * @pdev: CSIS platform device * @regs: mmaped I/O registers memory * @supplies: CSIS regulator supplies @@ -165,6 +166,7 @@ struct csis_state { struct mutex lock; struct media_pad pads[CSIS_PADS_NUM]; struct v4l2_subdev sd; + u8 index; struct platform_device *pdev; void __iomem *regs; struct regulator_bulk_data supplies[CSIS_NUM_SUPPLIES]; @@ -619,14 +621,15 @@ static int __devinit s5pcsis_probe(struct platform_device *pdev) spin_lock_init(state-slock); state-pdev = pdev; + state-index = max(0, pdev-id); pdata = pdev-dev.platform_data; - if (pdata == NULL || pdata-phy_enable == NULL) { + if (pdata == NULL) { dev_err(pdev-dev, Platform data not fully specified\n); return -EINVAL; } - if ((pdev-id == 1 pdata-lanes CSIS1_MAX_LANES) || + if ((state-index == 1 pdata-lanes CSIS1_MAX_LANES) || pdata-lanes CSIS0_MAX_LANES) { dev_err(pdev-dev, Unsupported number of data lanes: %d\n, pdata-lanes); @@ -709,7 +712,6 @@ e_clkput: static int s5pcsis_pm_suspend(struct device *dev, bool runtime) { - struct s5p_platform_mipi_csis *pdata = dev-platform_data; struct platform_device *pdev = to_platform_device(dev); struct v4l2_subdev *sd = platform_get_drvdata(pdev); struct csis_state *state = sd_to_csis_state(sd); @@ -721,7 +723,7 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime) mutex_lock(state-lock); if (state-flags ST_POWERED) { s5pcsis_stop_stream(state); - ret = pdata-phy_enable(state-pdev, false); + ret = s5p_csis_phy_enable(state-index, false); if (ret) goto unlock; ret = regulator_bulk_disable(CSIS_NUM_SUPPLIES, @@ -740,7 +742,6 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime) static int s5pcsis_pm_resume(struct device *dev, bool runtime) { - struct s5p_platform_mipi_csis *pdata = dev-platform_data; struct platform_device *pdev = to_platform_device(dev); struct v4l2_subdev *sd = platform_get_drvdata(pdev); struct csis_state *state = sd_to_csis_state(sd); @@ -758,7 +759,7 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime) state-supplies); if (ret) goto unlock; - ret = pdata-phy_enable(state-pdev, true); + ret = s5p_csis_phy_enable(state-index, true); if (!ret) { state-flags |= ST_POWERED; } else { diff --git a/include/linux/platform_data/mipi-csis.h b/include/linux/platform_data/mipi-csis.h index c45b1e8..2e59e43 100644 --- a/include/linux/platform_data/mipi-csis.h +++ b/include/linux/platform_data/mipi-csis.h @@ -11,8 +11,6 @@ #ifndef __PLAT_SAMSUNG_MIPI_CSIS_H_ #define __PLAT_SAMSUNG_MIPI_CSIS_H_ __FILE__ -struct platform_device; - /** * struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver * @clk_rate: bus clock frequency @@ -34,10 +32,11 @@ struct s5p_platform_mipi_csis { /** * s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control - * @pdev: MIPI-CSIS platform device - * @on: true to enable D-PHY and deassert its reset - * false to disable D-PHY + * @id: MIPI-CSIS harware instance index (0...1) + * @on: true to enable D-PHY and deassert its reset + * false to disable D-PHY + * @return: 0 on success, or negative error code on failure */ -int s5p_csis_phy_enable(struct platform_device *pdev, bool on); +int s5p_csis_phy_enable(int id, bool on); #endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */ -- 1.7.11.3 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/7] s5p-fimc: Remove unused platform data structure fields
alignment, fixed_phy_vdd and phy_enable fields are now unused so removed them. The data alignment is now derived directly from media bus pixel code, phy_enable callback has been replaced with direct function call and fixed_phy_vdd was dropped in commit 438df3ebe5f0ce408490a777a758d5905f0dd58f [media] s5p-csis: Handle all available power supplies. Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- include/linux/platform_data/mipi-csis.h | 15 --- include/media/s5p_fimc.h| 2 -- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/include/linux/platform_data/mipi-csis.h b/include/linux/platform_data/mipi-csis.h index 2e59e43..8b703e1 100644 --- a/include/linux/platform_data/mipi-csis.h +++ b/include/linux/platform_data/mipi-csis.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd. * - * S5P series MIPI CSI slave device support + * Samsung S5P/Exynos SoC series MIPI CSIS device support * * 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 @@ -13,21 +13,14 @@ /** * struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver - * @clk_rate: bus clock frequency - * @lanes: number of data lanes used - * @alignment: data alignment in bits - * @hs_settle: HS-RX settle time - * @fixed_phy_vdd: false to enable external D-PHY regulator management in the - *driver or true in case this regulator has no enable function - * @phy_enable: pointer to a callback controlling D-PHY enable/reset + * @clk_rate:bus clock frequency + * @lanes: number of data lanes used + * @hs_settle: HS-RX settle time */ struct s5p_platform_mipi_csis { unsigned long clk_rate; u8 lanes; - u8 alignment; u8 hs_settle; - bool fixed_phy_vdd; - int (*phy_enable)(struct platform_device *pdev, bool on); }; /** diff --git a/include/media/s5p_fimc.h b/include/media/s5p_fimc.h index 09421a61..eaea62a 100644 --- a/include/media/s5p_fimc.h +++ b/include/media/s5p_fimc.h @@ -30,7 +30,6 @@ struct i2c_board_info; * @board_info: pointer to I2C subdevice's board info * @clk_frequency: frequency of the clock the host interface provides to sensor * @bus_type: determines bus type, MIPI, ITU-R BT.601 etc. - * @csi_data_align: MIPI-CSI interface data alignment in bits * @i2c_bus_num: i2c control bus id the sensor is attached to * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU) * @clk_id: index of the SoC peripheral clock for sensors @@ -40,7 +39,6 @@ struct s5p_fimc_isp_info { struct i2c_board_info *board_info; unsigned long clk_frequency; enum cam_bus_type bus_type; - u16 csi_data_align; u16 i2c_bus_num; u16 mux_id; u16 flags; -- 1.7.11.3 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 6/7] s5p-csis: Allow to specify pixel clock's source through platform data
Depending on the sensor configuration it might be required to adjust the CSIS's output pixel clock so it is greater than its input pixel clock, in order to avoid the input data FIFO overflow. Use platform data to select SCLK_CSIS clock from CMU as a source, rather than CSI APB clock. Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- drivers/media/video/s5p-fimc/mipi-csis.c | 4 +++- include/linux/platform_data/mipi-csis.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/s5p-fimc/mipi-csis.c b/drivers/media/video/s5p-fimc/mipi-csis.c index 1a2db5d..fbfe739 100644 --- a/drivers/media/video/s5p-fimc/mipi-csis.c +++ b/drivers/media/video/s5p-fimc/mipi-csis.c @@ -306,8 +306,10 @@ static void s5pcsis_set_params(struct csis_state *state) val |= S5PCSIS_CTRL_ALIGN_32BIT; else /* 24-bits */ val = ~S5PCSIS_CTRL_ALIGN_32BIT; - /* Not using external clock. */ + val = ~S5PCSIS_CTRL_WCLK_EXTCLK; + if (pdata-wclk_source) + val |= S5PCSIS_CTRL_WCLK_EXTCLK; s5pcsis_write(state, S5PCSIS_CTRL, val); /* Update the shadow register. */ diff --git a/include/linux/platform_data/mipi-csis.h b/include/linux/platform_data/mipi-csis.h index 8b703e1..bf34e17 100644 --- a/include/linux/platform_data/mipi-csis.h +++ b/include/linux/platform_data/mipi-csis.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd. + * Copyright (C) 2010 - 2012 Samsung Electronics Co., Ltd. * * Samsung S5P/Exynos SoC series MIPI CSIS device support * @@ -14,11 +14,13 @@ /** * struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver * @clk_rate:bus clock frequency + * @wclk_source: CSI wrapper clock selection: 0 - bus clock, 1 - ext. SCLK_CAM * @lanes: number of data lanes used * @hs_settle: HS-RX settle time */ struct s5p_platform_mipi_csis { unsigned long clk_rate; + u8 wclk_source; u8 lanes; u8 hs_settle; }; -- 1.7.11.3 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] DMA: PL330: return ENOMEM instead of 0 from pl330_alloc_chan_resources
Inderpal Singh wrote: Since 0 is not considered as error at dmaengine level, return ENOMEM from pl330_alloc_chan_resources in case of failure. Signed-off-by: Inderpal Singh inderpal.si...@linaro.org Acked-by: Kukjin Kim kgene@samsung.com Thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. --- drivers/dma/pl330.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index e4feba6..14d881c 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2393,7 +2393,7 @@ static int pl330_alloc_chan_resources(struct dma_chan *chan) pch-pl330_chid = pl330_request_channel(pdmac-pif); if (!pch-pl330_chid) { spin_unlock_irqrestore(pch-lock, flags); - return 0; + return -ENOMEM; } tasklet_init(pch-task, pl330_tasklet, (unsigned long) pch); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/7] ARM: samsung: Remove unused fields from FIMC and CSIS platform data
On 09/17/2012 01:02 PM, Kukjin Kim wrote: Sylwester Nawrocki wrote: The MIPI-CSI2 bus data alignment is now being derived from the media bus pixel code, the drivers don't use the corresponding structure fields, so remove them. Also remove the s5p_csis_phy_enable callback which is now used directly by s5p-csis driver. Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com Acked-by: Kukjin Kim kgene@samsung.com Thank you for your ack on these three first patches, I'll then ask Mauro to push it upstream through his tree. As he usually sends his patches out late during merge window, there should hopefully be no merge conflicts. Regards, -- Sylwester Nawrocki Samsung Poland RD Center -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] ARM: SAMSUNG: Use spin_lock_{irqsave,irqrestore} in clk_set_rate
Tushar Behera wrote: The spinlock clocks_lock can be held during ISR, hence it is not safe to hold that lock with disabling interrupts. It fixes following potential deadlock. = [ INFO: possible irq lock inversion dependency detected ] 3.6.0-rc4+ #2 Not tainted - swapper/0/1 just changed the state of lock: ((host-lock)-rlock){-.}, at: [c027fb0d] sdhci_irq+0x15/0x564 but this lock took another, HARDIRQ-unsafe lock in the past: (clocks_lock){+.+...} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0CPU1 lock(clocks_lock); local_irq_disable(); lock((host-lock)-rlock); lock(clocks_lock); Interrupt lock((host-lock)-rlock); *** DEADLOCK *** Signed-off-by: Tushar Behera tushar.beh...@linaro.org --- arch/arm/plat-samsung/clock.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c index 65c5eca..9b71719 100644 --- a/arch/arm/plat-samsung/clock.c +++ b/arch/arm/plat-samsung/clock.c @@ -144,6 +144,7 @@ long clk_round_rate(struct clk *clk, unsigned long rate) int clk_set_rate(struct clk *clk, unsigned long rate) { + unsigned long flags; int ret; if (IS_ERR(clk)) @@ -159,9 +160,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) if (clk-ops == NULL || clk-ops-set_rate == NULL) return -EINVAL; - spin_lock(clocks_lock); + spin_lock_irqsave(clocks_lock, flags); ret = (clk-ops-set_rate)(clk, rate); - spin_unlock(clocks_lock); + spin_unlock_irqrestore(clocks_lock, flags); return ret; } -- 1.7.4.1 Looks OK, applied. Thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] ARM: dts: use uart2 for console on smdkv310 and smdk5250
Cc: Thomas Abraham thomas.abra...@linaro.org Signed-off-by: Kukjin Kim kgene@samsung.com --- arch/arm/boot/dts/exynos4210-smdkv310.dts |2 +- arch/arm/boot/dts/exynos5250-smdk5250.dts |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts b/arch/arm/boot/dts/exynos4210-smdkv310.dts index 1beccc8..cb01e3d 100644 --- a/arch/arm/boot/dts/exynos4210-smdkv310.dts +++ b/arch/arm/boot/dts/exynos4210-smdkv310.dts @@ -26,7 +26,7 @@ }; chosen { - bootargs = root=/dev/ram0 rw ramdisk=8192 initrd=0x4100,8M console=ttySAC1,115200 init=/linuxrc; + bootargs = root=/dev/ram0 rw ramdisk=8192 initrd=0x4100,8M console=ttySAC2,115200 init=/linuxrc; }; sdhci@1253 { diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts index 8a5e348..62e1039 100644 --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts @@ -21,7 +21,7 @@ }; chosen { - bootargs = root=/dev/ram0 rw ramdisk=8192 console=ttySAC1,115200; + bootargs = root=/dev/ram0 rw ramdisk=8192 initrd=0x4100,8M console=ttySAC2,115200 init=/linuxrc; }; i2c@12C6 { -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 0/5] usb: phy: samsung: Introducing usb phy driver for samsung SoCs
Changes from v5: Moved clk_get() to driver's probe function. Now reference clock frequency selection value is stored in samsung_usbphy structure for later use. Used IS_ENABLED() instead of #ifdef in samsung_usbphy_get_driver_data(). Changes from v4: Moved header file contents to driver's source file Removed unnecessary print message from driver's probe function Dropped the Free Software Foundation address from the header Changed the platform data code to use __initdata Changes from v3: Replaced susbsys_initcall()/module_exit() by module_platform_driver(). Accordingly in the hsotg driver returned -EPROBE_DEFER until phy driver is registered Removed unnecessary devm_usb_put_phy() call from the hsotg driver remove. Changes from v2: Changed the driver filenames to samsung-usbphy Changed 's3c' to 'samsung' for platform device as well as platform data Moved platform data structure to a separate file Rectified coding style related errors Changes from v1: Rebased patches to latest usb-next branch Changed the name 'sec_usbphy' to 'samsung_usbphy' This patch set introduces a phy driver for samsung SoCs. It uses the existing transceiver infrastructure to provide phy control functions. Use of this driver can be extended for usb host phy as well. Over the period of time all the phy related code for most of the samsung SoCs can be integrated here. Removing the existing phy code from mach-s3c64xx. Same can be done for other SoCs when they start supporting this phy driver. This driver is tested with smdk6410 and Exynos4210(with DT). Praveen Paneri (5): usb: phy: samsung: Introducing usb phy driver for hsotg usb: s3c-hsotg: Adding phy driver support ARM: S3C64XX: Removing old phy setup code ARM: S3C64XX: Enabling samsung-usbphy driver ARM: Exynos4210: Enabling samsung-usbphy driver .../devicetree/bindings/usb/samsung-usbphy.txt |9 + arch/arm/boot/dts/exynos4210.dtsi |5 + arch/arm/mach-exynos/include/mach/map.h|1 + arch/arm/mach-exynos/mach-exynos4-dt.c |8 + arch/arm/mach-exynos/setup-usb-phy.c | 13 + arch/arm/mach-s3c64xx/include/mach/map.h |2 + arch/arm/mach-s3c64xx/mach-crag6410.c | 10 +- arch/arm/mach-s3c64xx/mach-smartq.c| 11 +- arch/arm/mach-s3c64xx/mach-smdk6410.c | 10 +- arch/arm/mach-s3c64xx/setup-usb-phy.c | 79 + arch/arm/plat-samsung/devs.c | 28 ++ arch/arm/plat-samsung/include/plat/devs.h |1 + arch/arm/plat-samsung/include/plat/usb-phy.h |1 + drivers/usb/gadget/s3c-hsotg.c | 37 ++- drivers/usb/phy/Kconfig|8 + drivers/usb/phy/Makefile |1 + drivers/usb/phy/samsung-usbphy.c | 360 include/linux/platform_data/samsung-usbphy.h | 27 ++ 18 files changed, 520 insertions(+), 91 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/samsung-usbphy.txt create mode 100644 drivers/usb/phy/samsung-usbphy.c create mode 100644 include/linux/platform_data/samsung-usbphy.h -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 1/5] usb: phy: samsung: Introducing usb phy driver for hsotg
This driver uses usb_phy interface to interact with s3c-hsotg. Supports phy_init and phy_shutdown functions to enable/disable phy. Tested with smdk6410 and smdkv310. More SoCs can be brought under later. Signed-off-by: Praveen Paneri p.pan...@samsung.com Acked-by: Heiko Stuebner he...@sntech.de --- .../devicetree/bindings/usb/samsung-usbphy.txt |9 + drivers/usb/phy/Kconfig|8 + drivers/usb/phy/Makefile |1 + drivers/usb/phy/samsung-usbphy.c | 360 include/linux/platform_data/samsung-usbphy.h | 27 ++ 5 files changed, 405 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/samsung-usbphy.txt create mode 100644 drivers/usb/phy/samsung-usbphy.c create mode 100644 include/linux/platform_data/samsung-usbphy.h diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt new file mode 100644 index 000..fefd9c8 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt @@ -0,0 +1,9 @@ +* Samsung's usb phy transceiver + +The Samsung's phy transceiver is used for controlling usb otg phy for +s3c-hsotg usb device controller. + +Required properties: +- compatible : should be samsung,exynos4210-usbphy +- reg : base physical address of the phy registers and length of memory mapped + region. diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index 63c339b..313685f 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -32,3 +32,11 @@ config MV_U3D_PHY help Enable this to support Marvell USB 3.0 phy controller for Marvell SoC. + +config SAMSUNG_USBPHY + bool Samsung USB PHY controller Driver + depends on USB_S3C_HSOTG + select USB_OTG_UTILS + help + Enable this to support Samsung USB phy controller for samsung + SoCs. diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile index b069f29..55dcfc1 100644 --- a/drivers/usb/phy/Makefile +++ b/drivers/usb/phy/Makefile @@ -8,3 +8,4 @@ obj-$(CONFIG_OMAP_USB2) += omap-usb2.o obj-$(CONFIG_USB_ISP1301) += isp1301.o obj-$(CONFIG_MV_U3D_PHY) += mv_u3d_phy.o obj-$(CONFIG_USB_EHCI_TEGRA) += tegra_usb_phy.o +obj-$(CONFIG_SAMSUNG_USBPHY) += samsung-usbphy.o diff --git a/drivers/usb/phy/samsung-usbphy.c b/drivers/usb/phy/samsung-usbphy.c new file mode 100644 index 000..95ec4d0 --- /dev/null +++ b/drivers/usb/phy/samsung-usbphy.c @@ -0,0 +1,360 @@ +/* linux/drivers/usb/phy/samsung-usbphy.c + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Author: Praveen Paneri p.pan...@samsung.com + * + * Samsung USB2.0 High-speed OTG transceiver, talks to S3C HS OTG controller + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include linux/module.h +#include linux/platform_device.h +#include linux/clk.h +#include linux/delay.h +#include linux/err.h +#include linux/io.h +#include linux/of.h +#include linux/usb/otg.h +#include linux/platform_data/samsung-usbphy.h + +/* Register definitions */ + +#define S3C_PHYPWR (0x00) + +#define S3C_PHYPWR_NORMAL_MASK (0x19 0) +#define S3C_PHYPWR_OTG_DISABLE (1 4) +#define S3C_PHYPWR_ANALOG_POWERDOWN(1 3) +#define S3C_PHYPWR_FORCE_SUSPEND (1 1) +/* For Exynos4 */ +#define EXYNOS4_PHYPWR_NORMAL_MASK (0x39 0) +#define EXYNOS4_PHYPWR_SLEEP (1 5) + +#define S3C_PHYCLK (0x04) + +#define S3C_PHYCLK_MODE_SERIAL (1 6) +#define S3C_PHYCLK_EXT_OSC (1 5) +#define S3C_PHYCLK_COMMON_ON_N (1 4) +#define S3C_PHYCLK_ID_PULL (1 2) +#define S3C_PHYCLK_CLKSEL_MASK (0x3 0) +#define S3C_PHYCLK_CLKSEL_SHIFT(0) +#define S3C_PHYCLK_CLKSEL_48M (0x0 0) +#define S3C_PHYCLK_CLKSEL_12M (0x2 0) +#define S3C_PHYCLK_CLKSEL_24M (0x3 0) + +#define S3C_RSTCON (0x08) + +#define S3C_RSTCON_PHYCLK (1 2) +#define S3C_RSTCON_HCLK(1 1) +#define S3C_RSTCON_PHY (1 0) + +#ifndef MHZ +#define MHZ (1000*1000) +#endif + +enum samsung_cpu_type { + TYPE_S3C64XX, + TYPE_EXYNOS4210, +}; + +/* + * struct samsung_usbphy
[PATCH v6 2/5] usb: s3c-hsotg: Adding phy driver support
Adding the transceiver to hsotg driver. Keeping the platform data for continuing the smooth operation for boards which still uses it Signed-off-by: Praveen Paneri p.pan...@samsung.com --- drivers/usb/gadget/s3c-hsotg.c | 37 +++-- 1 files changed, 27 insertions(+), 10 deletions(-) diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 6f696ee..29815b9 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c @@ -32,6 +32,7 @@ #include linux/usb/ch9.h #include linux/usb/gadget.h +#include linux/usb/otg.h #include linux/platform_data/s3c-hsotg.h #include mach/map.h @@ -133,7 +134,9 @@ struct s3c_hsotg_ep { * struct s3c_hsotg - driver state. * @dev: The parent device supplied to the probe function * @driver: USB gadget driver - * @plat: The platform specific configuration data. + * @phy: The otg phy transceiver structure for phy control. + * @plat: The platform specific configuration data. This can be removed once + * all SoCs support usb transceiver. * @regs: The memory area mapped for accessing registers. * @irq: The IRQ number we are using * @supplies: Definition of USB power supplies @@ -153,6 +156,7 @@ struct s3c_hsotg_ep { struct s3c_hsotg { struct device*dev; struct usb_gadget_driver *driver; + struct usb_phy *phy; struct s3c_hsotg_plat*plat; spinlock_t lock; @@ -2854,7 +2858,10 @@ static void s3c_hsotg_phy_enable(struct s3c_hsotg *hsotg) struct platform_device *pdev = to_platform_device(hsotg-dev); dev_dbg(hsotg-dev, pdev 0x%p\n, pdev); - if (hsotg-plat-phy_init) + + if (hsotg-phy) + usb_phy_init(hsotg-phy); + else if (hsotg-plat-phy_init) hsotg-plat-phy_init(pdev, hsotg-plat-phy_type); } @@ -2869,7 +2876,9 @@ static void s3c_hsotg_phy_disable(struct s3c_hsotg *hsotg) { struct platform_device *pdev = to_platform_device(hsotg-dev); - if (hsotg-plat-phy_exit) + if (hsotg-phy) + usb_phy_shutdown(hsotg-phy); + else if (hsotg-plat-phy_exit) hsotg-plat-phy_exit(pdev, hsotg-plat-phy_type); } @@ -3493,6 +3502,7 @@ static void s3c_hsotg_release(struct device *dev) static int __devinit s3c_hsotg_probe(struct platform_device *pdev) { struct s3c_hsotg_plat *plat = pdev-dev.platform_data; + struct usb_phy *phy; struct device *dev = pdev-dev; struct s3c_hsotg_ep *eps; struct s3c_hsotg *hsotg; @@ -3501,20 +3511,27 @@ static int __devinit s3c_hsotg_probe(struct platform_device *pdev) int ret; int i; - plat = pdev-dev.platform_data; - if (!plat) { - dev_err(pdev-dev, no platform data defined\n); - return -EINVAL; - } - hsotg = devm_kzalloc(pdev-dev, sizeof(struct s3c_hsotg), GFP_KERNEL); if (!hsotg) { dev_err(dev, cannot get memory\n); return -ENOMEM; } + plat = pdev-dev.platform_data; + if (!plat) { + /* Fallback for transceiver */ + phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); + if (IS_ERR_OR_NULL(phy)) { + dev_err(pdev-dev, no platform data or transceiver defined\n); + return -EPROBE_DEFER; + } else { + hsotg-phy = phy; + } + } else { + hsotg-plat = plat; + } + hsotg-dev = dev; - hsotg-plat = plat; hsotg-clk = devm_clk_get(pdev-dev, otg); if (IS_ERR(hsotg-clk)) { -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 3/5] ARM: S3C64XX: Removing old phy setup code
This patch removes old phy code from platform side. 'setup-usb-phy.c' will be used for providing transceiver platform data in next patch. Not all of the platform data code is removed as there are others making use of platform_data defined for hsotg. That can be removed once all the SoCs start using the new transceiver for usb phy setup. Signed-off-by: Praveen Paneri p.pan...@samsung.com --- arch/arm/mach-s3c64xx/mach-crag6410.c |3 - arch/arm/mach-s3c64xx/mach-smartq.c |3 - arch/arm/mach-s3c64xx/mach-smdk6410.c |3 - arch/arm/mach-s3c64xx/setup-usb-phy.c | 79 - 4 files changed, 0 insertions(+), 88 deletions(-) diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c index 09cd812..b0f5baf 100644 --- a/arch/arm/mach-s3c64xx/mach-crag6410.c +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c @@ -31,7 +31,6 @@ #include linux/spi/spi.h #include linux/i2c/pca953x.h -#include linux/platform_data/s3c-hsotg.h #include video/platform_lcd.h @@ -766,7 +765,6 @@ static const struct gpio_led_platform_data gpio_leds_pdata = { .num_leds = ARRAY_SIZE(gpio_leds), }; -static struct s3c_hsotg_plat crag6410_hsotg_pdata; static void __init crag6410_machine_init(void) { @@ -792,7 +790,6 @@ static void __init crag6410_machine_init(void) s3c_i2c0_set_platdata(i2c0_pdata); s3c_i2c1_set_platdata(i2c1_pdata); s3c_fb_set_platdata(crag6410_lcd_pdata); - s3c_hsotg_set_platdata(crag6410_hsotg_pdata); i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0)); i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c index ceeb1de..7400da1 100644 --- a/arch/arm/mach-s3c64xx/mach-smartq.c +++ b/arch/arm/mach-s3c64xx/mach-smartq.c @@ -18,7 +18,6 @@ #include linux/serial_core.h #include linux/spi/spi_gpio.h #include linux/usb/gpio_vbus.h -#include linux/platform_data/s3c-hsotg.h #include asm/mach-types.h #include asm/mach/map.h @@ -187,7 +186,6 @@ static struct s3c_hwmon_pdata smartq_hwmon_pdata __initdata = { }, }; -static struct s3c_hsotg_plat smartq_hsotg_pdata; static int __init smartq_lcd_setup_gpio(void) { @@ -385,7 +383,6 @@ void __init smartq_map_io(void) void __init smartq_machine_init(void) { s3c_i2c0_set_platdata(NULL); - s3c_hsotg_set_platdata(smartq_hsotg_pdata); s3c_hwmon_set_platdata(smartq_hwmon_pdata); s3c_sdhci1_set_platdata(smartq_internal_hsmmc_pdata); s3c_sdhci2_set_platdata(smartq_internal_hsmmc_pdata); diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index 0fe4f15..cbdc91b 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c @@ -30,7 +30,6 @@ #include linux/regulator/fixed.h #include linux/regulator/machine.h #include linux/pwm_backlight.h -#include linux/platform_data/s3c-hsotg.h #ifdef CONFIG_SMDK6410_WM1190_EV1 #include linux/mfd/wm8350/core.h @@ -627,7 +626,6 @@ static struct platform_pwm_backlight_data smdk6410_bl_data = { .pwm_id = 1, }; -static struct s3c_hsotg_plat smdk6410_hsotg_pdata; static void __init smdk6410_map_io(void) { @@ -657,7 +655,6 @@ static void __init smdk6410_machine_init(void) s3c_i2c0_set_platdata(NULL); s3c_i2c1_set_platdata(NULL); s3c_fb_set_platdata(smdk6410_lcd_pdata); - s3c_hsotg_set_platdata(smdk6410_hsotg_pdata); samsung_keypad_set_platdata(smdk6410_keypad_data); diff --git a/arch/arm/mach-s3c64xx/setup-usb-phy.c b/arch/arm/mach-s3c64xx/setup-usb-phy.c index f6757e0..7a09553 100644 --- a/arch/arm/mach-s3c64xx/setup-usb-phy.c +++ b/arch/arm/mach-s3c64xx/setup-usb-phy.c @@ -9,82 +9,3 @@ * */ -#include linux/clk.h -#include linux/delay.h -#include linux/err.h -#include linux/io.h -#include linux/platform_device.h -#include mach/map.h -#include mach/regs-sys.h -#include plat/cpu.h -#include plat/regs-usb-hsotg-phy.h -#include plat/usb-phy.h - -static int s3c_usb_otgphy_init(struct platform_device *pdev) -{ - struct clk *xusbxti; - u32 phyclk; - - writel(readl(S3C64XX_OTHERS) | S3C64XX_OTHERS_USBMASK, S3C64XX_OTHERS); - - /* set clock frequency for PLL */ - phyclk = readl(S3C_PHYCLK) ~S3C_PHYCLK_CLKSEL_MASK; - - xusbxti = clk_get(pdev-dev, xusbxti); - if (xusbxti !IS_ERR(xusbxti)) { - switch (clk_get_rate(xusbxti)) { - case 12 * MHZ: - phyclk |= S3C_PHYCLK_CLKSEL_12M; - break; - case 24 * MHZ: - phyclk |= S3C_PHYCLK_CLKSEL_24M; - break; - default: - case 48 * MHZ: - /* default reference clock */ - break; - } - clk_put(xusbxti); - } - - /* TODO:
[PATCH v6 4/5] ARM: S3C64XX: Enabling samsung-usbphy driver
Adding platform device for samsung-usbphy driver. Enabling it for s3c64xx based machines using s3c-hsotg. Signed-off-by: Praveen Paneri p.pan...@samsung.com --- arch/arm/mach-s3c64xx/include/mach/map.h |2 + arch/arm/mach-s3c64xx/mach-crag6410.c|7 ++ arch/arm/mach-s3c64xx/mach-smartq.c |8 +++ arch/arm/mach-s3c64xx/mach-smdk6410.c|7 ++ arch/arm/mach-s3c64xx/setup-usb-phy.c| 14 + arch/arm/plat-samsung/devs.c | 28 ++ arch/arm/plat-samsung/include/plat/devs.h|1 + arch/arm/plat-samsung/include/plat/usb-phy.h |1 + 8 files changed, 68 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-s3c64xx/include/mach/map.h b/arch/arm/mach-s3c64xx/include/mach/map.h index 8e2097b..dc482bb 100644 --- a/arch/arm/mach-s3c64xx/include/mach/map.h +++ b/arch/arm/mach-s3c64xx/include/mach/map.h @@ -65,6 +65,7 @@ #define S3C64XX_PA_NAND(0x7020) #define S3C64XX_PA_FB (0x7710) +#define S3C64XX_PA_USB_HSPHY (0x7C10) #define S3C64XX_PA_USB_HSOTG (0x7C00) #define S3C64XX_PA_WATCHDOG(0x7E004000) #define S3C64XX_PA_RTC (0x7E005000) @@ -113,6 +114,7 @@ #define S3C_PA_FB S3C64XX_PA_FB #define S3C_PA_USBHOST S3C64XX_PA_USBHOST #define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG +#define S3C_PA_USB_PHY S3C64XX_PA_USB_HSPHY #define S3C_PA_RTC S3C64XX_PA_RTC #define S3C_PA_WDT S3C64XX_PA_WATCHDOG #define S3C_PA_SPI0S3C64XX_PA_SPI0 diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c index b0f5baf..adc2e15 100644 --- a/arch/arm/mach-s3c64xx/mach-crag6410.c +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c @@ -31,6 +31,7 @@ #include linux/spi/spi.h #include linux/i2c/pca953x.h +#include linux/platform_data/samsung-usbphy.h #include video/platform_lcd.h @@ -69,6 +70,7 @@ #include plat/adc.h #include plat/iic.h #include plat/pm.h +#include plat/usb-phy.h #include common.h @@ -336,6 +338,7 @@ static struct platform_device wallvdd_device = { }; static struct platform_device *crag6410_devices[] __initdata = { + samsung_device_usbphy, s3c_device_hsmmc0, s3c_device_hsmmc2, s3c_device_i2c0, @@ -765,6 +768,9 @@ static const struct gpio_led_platform_data gpio_leds_pdata = { .num_leds = ARRAY_SIZE(gpio_leds), }; +static struct samsung_usbphy_data crag6410_usbphy_pdata __initdata = { + .pmu_isolation = s5p_usb_phy_pmu_isolation, +}; static void __init crag6410_machine_init(void) { @@ -790,6 +796,7 @@ static void __init crag6410_machine_init(void) s3c_i2c0_set_platdata(i2c0_pdata); s3c_i2c1_set_platdata(i2c1_pdata); s3c_fb_set_platdata(crag6410_lcd_pdata); + samsung_usbphy_set_pdata(crag6410_usbphy_pdata); i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0)); i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c index 7400da1..90dc821 100644 --- a/arch/arm/mach-s3c64xx/mach-smartq.c +++ b/arch/arm/mach-s3c64xx/mach-smartq.c @@ -18,6 +18,7 @@ #include linux/serial_core.h #include linux/spi/spi_gpio.h #include linux/usb/gpio_vbus.h +#include linux/platform_data/samsung-usbphy.h #include asm/mach-types.h #include asm/mach/map.h @@ -36,6 +37,7 @@ #include plat/usb-control.h #include plat/sdhci.h #include plat/ts.h +#include plat/usb-phy.h #include video/platform_lcd.h @@ -234,6 +236,7 @@ static struct i2c_board_info smartq_i2c_devs[] __initdata = { }; static struct platform_device *smartq_devices[] __initdata = { + samsung_device_usbphy, s3c_device_hsmmc1, /* Init iNAND first, ... */ s3c_device_hsmmc0, /* ... then the external SD card */ s3c_device_hsmmc2, @@ -380,9 +383,14 @@ void __init smartq_map_io(void) smartq_lcd_mode_set(); } +static struct samsung_usbphy_data smartq_usbphy_pdata __initdata = { + .pmu_isolation = s5p_usb_phy_pmu_isolation, +}; + void __init smartq_machine_init(void) { s3c_i2c0_set_platdata(NULL); + samsung_usbphy_set_pdata(smartq_usbphy_pdata); s3c_hwmon_set_platdata(smartq_hwmon_pdata); s3c_sdhci1_set_platdata(smartq_internal_hsmmc_pdata); s3c_sdhci2_set_platdata(smartq_internal_hsmmc_pdata); diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index cbdc91b..4cf1252 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c @@ -30,6 +30,7 @@ #include linux/regulator/fixed.h #include linux/regulator/machine.h #include linux/pwm_backlight.h +#include linux/platform_data/samsung-usbphy.h #ifdef CONFIG_SMDK6410_WM1190_EV1 #include linux/mfd/wm8350/core.h @@ -72,6 +73,7 @@ #include plat/keypad.h #include
[PATCH v6 5/5] ARM: Exynos4210: Enabling samsung-usbphy driver
Adding usbphy node for Exynos4210 along with the platform data. Signed-off-by: Praveen Paneri p.pan...@samsung.com --- arch/arm/boot/dts/exynos4210.dtsi |5 + arch/arm/mach-exynos/include/mach/map.h |1 + arch/arm/mach-exynos/mach-exynos4-dt.c |8 arch/arm/mach-exynos/setup-usb-phy.c| 13 + 4 files changed, 27 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/exynos4210.dtsi b/arch/arm/boot/dts/exynos4210.dtsi index 02891fe..e28cf10 100644 --- a/arch/arm/boot/dts/exynos4210.dtsi +++ b/arch/arm/boot/dts/exynos4210.dtsi @@ -62,6 +62,11 @@ interrupts = 0 44 0, 0 45 0; }; + usbphy@125B { + compatible = samsung,exynos4210-usbphy; + reg = 0x125B 0x100; + }; + keypad@100A { compatible = samsung,s5pv210-keypad; reg = 0x100A 0x100; diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h index c72b675..0625c0a 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h @@ -234,6 +234,7 @@ #define S3C_PA_SPI1EXYNOS4_PA_SPI1 #define S3C_PA_SPI2EXYNOS4_PA_SPI2 #define S3C_PA_USB_HSOTG EXYNOS4_PA_HSOTG +#define S3C_PA_USB_PHY EXYNOS4_PA_HSPHY #define S5P_PA_EHCIEXYNOS4_PA_EHCI #define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0 diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c index b2b5d5f..0739be8 100644 --- a/arch/arm/mach-exynos/mach-exynos4-dt.c +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c @@ -13,6 +13,7 @@ #include linux/of_platform.h #include linux/serial_core.h +#include linux/platform_data/samsung-usbphy.h #include asm/mach/arch.h #include asm/hardware/gic.h @@ -20,9 +21,14 @@ #include plat/cpu.h #include plat/regs-serial.h +#include plat/usb-phy.h #include common.h +static struct samsung_usbphy_data exynos4_usbphy_pdata = { + .pmu_isolation = s5p_usb_phy_pmu_isolation, +}; + /* * The following lookup table is used to override device names when devices * are registered from device tree. This is temporarily added to enable @@ -63,6 +69,8 @@ static const struct of_dev_auxdata exynos4210_auxdata_lookup[] __initconst = { exynos4210-spi.2, NULL), OF_DEV_AUXDATA(arm,pl330, EXYNOS4_PA_PDMA0, dma-pl330.0, NULL), OF_DEV_AUXDATA(arm,pl330, EXYNOS4_PA_PDMA1, dma-pl330.1, NULL), + OF_DEV_AUXDATA(samsung,exynos4210-usbphy, EXYNOS4_PA_HSPHY, + s3c-usbphy, exynos4_usbphy_pdata), {}, }; diff --git a/arch/arm/mach-exynos/setup-usb-phy.c b/arch/arm/mach-exynos/setup-usb-phy.c index b81cc56..1c62d20 100644 --- a/arch/arm/mach-exynos/setup-usb-phy.c +++ b/arch/arm/mach-exynos/setup-usb-phy.c @@ -221,3 +221,16 @@ int s5p_usb_phy_exit(struct platform_device *pdev, int type) return -EINVAL; } + +void s5p_usb_phy_pmu_isolation(int on) +{ + if (on) { + writel(readl(S5P_USBDEVICE_PHY_CONTROL) +~S5P_USBDEVICE_PHY_ENABLE, + S5P_USBDEVICE_PHY_CONTROL); + } else { + writel(readl(S5P_USBDEVICE_PHY_CONTROL) + | S5P_USBDEVICE_PHY_ENABLE, + S5P_USBDEVICE_PHY_CONTROL); + } +} -- 1.7.1 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 0/9] mmc: dw_mmc: add support for device tree based instantiation
This series add device tree support for Synopsis Designware IP - Mobile Storage Host Controller (MSHC). I had addressed all comments for the v5 version of this patch series and had reposted only those patches that were modified. The version number of those reposted patches was maintained as v5 as the changes did not need any major rework. This is mainly a repost of the v5 patches with all patches marked as v6. The only new change in this series is adding a comment about bus_hz in platform data structure of the driver as suggested by Seungwon Jeon. Thomas Abraham (9): mmc: dw_mmc: convert copy of struct device in struct dw_mci to a reference mmc: dw_mmc: Use devm_* functions in dw_mmc platform driver mmc: dw_mmc: allow probe to succeed even if one slot is initialized mmc: dw_mmc: lookup for optional biu and ciu clocks mmc: dw_mmc: add quirk to indicate missing write protect line mmc: dw_mmc: add device tree support mmc: dw_mmc: prepare functions in dw_mmc-pltfm for reuse mmc: dw_mmc: add support for implementation specific callbacks mmc: dw_mmc: add support for exynos specific implementation of dw-mshc .../devicetree/bindings/mmc/exynos-dw-mshc.txt | 87 ++ .../devicetree/bindings/mmc/synposis-dw-mshc.txt | 79 + drivers/mmc/host/Kconfig |9 + drivers/mmc/host/Makefile |1 + drivers/mmc/host/dw_mmc-exynos.c | 253 drivers/mmc/host/dw_mmc-pci.c |2 +- drivers/mmc/host/dw_mmc-pltfm.c| 60 +++-- drivers/mmc/host/dw_mmc-pltfm.h| 20 ++ drivers/mmc/host/dw_mmc.c | 308 +--- drivers/mmc/host/dw_mmc.h | 24 ++ include/linux/mmc/dw_mmc.h | 15 +- 11 files changed, 782 insertions(+), 76 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt create mode 100644 Documentation/devicetree/bindings/mmc/synposis-dw-mshc.txt create mode 100644 drivers/mmc/host/dw_mmc-exynos.c create mode 100644 drivers/mmc/host/dw_mmc-pltfm.h -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 1/9] mmc: dw_mmc: convert copy of struct device in struct dw_mci to a reference
The 'struct dw_mci' maintains a copy of the pdev-dev instance instead of maintaining a reference to that 'struct device' instance. Any resource allocated using the device resource management kernel API with the instance of 'struct device' in 'struct dw_mci' is then incorrect. Fix this by converting the copy of 'struct device' in 'struct dw_mci' to a reference. Signed-off-by: Thomas Abraham thomas.abra...@linaro.org Acked-by: Will Newton will.new...@imgtec.com --- drivers/mmc/host/dw_mmc-pci.c |2 +- drivers/mmc/host/dw_mmc-pltfm.c |2 +- drivers/mmc/host/dw_mmc.c | 56 +++--- include/linux/mmc/dw_mmc.h |2 +- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-pci.c b/drivers/mmc/host/dw_mmc-pci.c index f5ab03d..edb37e9 100644 --- a/drivers/mmc/host/dw_mmc-pci.c +++ b/drivers/mmc/host/dw_mmc-pci.c @@ -59,7 +59,7 @@ static int __devinit dw_mci_pci_probe(struct pci_dev *pdev, host-irq = pdev-irq; host-irq_flags = IRQF_SHARED; - host-dev = pdev-dev; + host-dev = pdev-dev; host-pdata = pci_board_data; host-regs = pci_iomap(pdev, PCI_BAR_NO, COMPLETE_BAR); diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c index a54d3a3..528d37b 100644 --- a/drivers/mmc/host/dw_mmc-pltfm.c +++ b/drivers/mmc/host/dw_mmc-pltfm.c @@ -43,7 +43,7 @@ static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) goto err_free; } - host-dev = pdev-dev; + host-dev = pdev-dev; host-irq_flags = 0; host-pdata = pdev-dev.platform_data; ret = -ENOMEM; diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 36f98c0..a18e73c 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -266,7 +266,7 @@ static void dw_mci_start_command(struct dw_mci *host, struct mmc_command *cmd, u32 cmd_flags) { host-cmd = cmd; - dev_vdbg(host-dev, + dev_vdbg(host-dev, start command: ARGR=0x%08x CMDR=0x%08x\n, cmd-arg, cmd_flags); @@ -308,7 +308,7 @@ static void dw_mci_dma_cleanup(struct dw_mci *host) if (data) if (!data-host_cookie) - dma_unmap_sg(host-dev, + dma_unmap_sg(host-dev, data-sg, data-sg_len, dw_mci_get_dma_dir(data)); @@ -334,7 +334,7 @@ static void dw_mci_idmac_complete_dma(struct dw_mci *host) { struct mmc_data *data = host-data; - dev_vdbg(host-dev, DMA complete\n); + dev_vdbg(host-dev, DMA complete\n); host-dma_ops-cleanup(host); @@ -414,13 +414,13 @@ static int dw_mci_idmac_init(struct dw_mci *host) dma_support = (mci_readl(host, HCON) 16) 0x3; if (!dma_support || dma_support 2) { - dev_err(host-dev, + dev_err(host-dev, Host Controller does not support IDMA Tx.\n); host-dma_ops = NULL; return -ENODEV; } - dev_info(host-dev, Using internal DMA controller.\n); + dev_info(host-dev, Using internal DMA controller.\n); /* Forward link the descriptor list */ for (i = 0, p = host-sg_cpu; i host-ring_size - 1; i++, p++) @@ -476,7 +476,7 @@ static int dw_mci_pre_dma_transfer(struct dw_mci *host, return -EINVAL; } - sg_len = dma_map_sg(host-dev, + sg_len = dma_map_sg(host-dev, data-sg, data-sg_len, dw_mci_get_dma_dir(data)); @@ -519,7 +519,7 @@ static void dw_mci_post_req(struct mmc_host *mmc, return; if (data-host_cookie) - dma_unmap_sg(slot-host-dev, + dma_unmap_sg(slot-host-dev, data-sg, data-sg_len, dw_mci_get_dma_dir(data)); @@ -545,7 +545,7 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data) host-using_dma = 1; - dev_vdbg(host-dev, + dev_vdbg(host-dev, sd sg_cpu: %#lx sg_dma: %#lx sg_len: %d\n, (unsigned long)host-sg_cpu, (unsigned long)host-sg_dma, sg_len); @@ -939,12 +939,12 @@ static void dw_mci_request_end(struct dw_mci *host, struct mmc_request *mrq) slot = list_entry(host-queue.next, struct dw_mci_slot, queue_node); list_del(slot-queue_node); - dev_vdbg(host-dev, list not empty: %s is next\n, + dev_vdbg(host-dev, list not empty: %s is next\n, mmc_hostname(slot-mmc)); host-state = STATE_SENDING_CMD;
[PATCH v6 2/9] mmc: dw_mmc: Use devm_* functions in dw_mmc platform driver
Use devm_* managed functions for simpler error handling. Signed-off-by: Thomas Abraham thomas.abra...@linaro.org Acked-by: Will Newton will.new...@imgtec.com --- drivers/mmc/host/dw_mmc-pltfm.c | 29 - 1 files changed, 8 insertions(+), 21 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c index 528d37b..ce7be1a 100644 --- a/drivers/mmc/host/dw_mmc-pltfm.c +++ b/drivers/mmc/host/dw_mmc-pltfm.c @@ -27,38 +27,27 @@ static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) struct resource *regs; int ret; - host = kzalloc(sizeof(struct dw_mci), GFP_KERNEL); + host = devm_kzalloc(pdev-dev, sizeof(struct dw_mci), GFP_KERNEL); if (!host) return -ENOMEM; regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!regs) { - ret = -ENXIO; - goto err_free; - } + if (!regs) + return -ENXIO; host-irq = platform_get_irq(pdev, 0); - if (host-irq 0) { - ret = host-irq; - goto err_free; - } + if (host-irq 0) + return host-irq; host-dev = pdev-dev; host-irq_flags = 0; host-pdata = pdev-dev.platform_data; - ret = -ENOMEM; - host-regs = ioremap(regs-start, resource_size(regs)); + host-regs = devm_request_and_ioremap(pdev-dev, regs); if (!host-regs) - goto err_free; + return -ENOMEM; + platform_set_drvdata(pdev, host); ret = dw_mci_probe(host); - if (ret) - goto err_out; - return ret; -err_out: - iounmap(host-regs); -err_free: - kfree(host); return ret; } @@ -68,8 +57,6 @@ static int __devexit dw_mci_pltfm_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); dw_mci_remove(host); - iounmap(host-regs); - kfree(host); return 0; } -- 1.6.6.rc2 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 3/9] mmc: dw_mmc: allow probe to succeed even if one slot is initialized
Instead of aborting the probe in case a slot initialization fails, allow initialization of as many slots as possible. If there are atleast one instance of slot that is successfully initialized, allow the driver probe to succeed. Signed-off-by: Thomas Abraham thomas.abra...@linaro.org Acked-by: Will Newton will.new...@imgtec.com --- drivers/mmc/host/dw_mmc.c | 23 +-- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index a18e73c..227c42e 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1946,6 +1946,7 @@ int dw_mci_probe(struct dw_mci *host) { int width, i, ret = 0; u32 fifo_size; + int init_slots = 0; if (!host-pdata || !host-pdata-init) { dev_err(host-dev, @@ -2054,10 +2055,18 @@ int dw_mci_probe(struct dw_mci *host) /* We need at least one slot to succeed */ for (i = 0; i host-num_slots; i++) { ret = dw_mci_init_slot(host, i); - if (ret) { - ret = -ENODEV; - goto err_init_slot; - } + if (ret) + dev_dbg(host-dev, slot %d init failed\n, i); + else + init_slots++; + } + + if (init_slots) { + dev_info(host-dev, %d slots initialized\n, init_slots); + } else { + dev_dbg(host-dev, attempted to initialize %d slots, + but failed on all\n, host-num_slots); + goto err_init_slot; } /* @@ -2092,12 +2101,6 @@ int dw_mci_probe(struct dw_mci *host) return 0; err_init_slot: - /* De-init any initialized slots */ - while (i 0) { - if (host-slot[i]) - dw_mci_cleanup_slot(host-slot[i], i); - i--; - } free_irq(host-irq, host); err_workqueue: -- 1.6.6.rc2 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 4/9] mmc: dw_mmc: lookup for optional biu and ciu clocks
Some platforms allow for clock gating and control of bus interface unit clock and card interface unit clock. Add support for clock lookup of optional biu and ciu clocks for clock gating and clock speed determination. Signed-off-by: Abhilash Kesavan a.kesa...@samsung.com Signed-off-by: Thomas Abraham thomas.abra...@linaro.org Acked-by: Will Newton will.new...@imgtec.com --- drivers/mmc/host/dw_mmc.c | 52 +-- include/linux/mmc/dw_mmc.h |4 +++ 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 227c42e..de45ad2 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1960,13 +1960,42 @@ int dw_mci_probe(struct dw_mci *host) return -ENODEV; } - if (!host-pdata-bus_hz) { + host-biu_clk = clk_get(host-dev, biu); + if (IS_ERR(host-biu_clk)) { + dev_dbg(host-dev, biu clock not available\n); + } else { + ret = clk_prepare_enable(host-biu_clk); + if (ret) { + dev_err(host-dev, failed to enable biu clock\n); + clk_put(host-biu_clk); + return ret; + } + } + + host-ciu_clk = clk_get(host-dev, ciu); + if (IS_ERR(host-ciu_clk)) { + dev_dbg(host-dev, ciu clock not available\n); + } else { + ret = clk_prepare_enable(host-ciu_clk); + if (ret) { + dev_err(host-dev, failed to enable ciu clock\n); + clk_put(host-ciu_clk); + goto err_clk_biu; + } + } + + if (IS_ERR(host-ciu_clk)) + host-bus_hz = host-pdata-bus_hz; + else + host-bus_hz = clk_get_rate(host-ciu_clk); + + if (!host-bus_hz) { dev_err(host-dev, Platform data must supply bus speed\n); - return -ENODEV; + ret = -ENODEV; + goto err_clk_ciu; } - host-bus_hz = host-pdata-bus_hz; host-quirks = host-pdata-quirks; spin_lock_init(host-lock); @@ -2116,6 +2145,17 @@ err_dmaunmap: regulator_disable(host-vmmc); regulator_put(host-vmmc); } + +err_clk_ciu: + if (!IS_ERR(host-ciu_clk)) { + clk_disable_unprepare(host-ciu_clk); + clk_put(host-ciu_clk); + } +err_clk_biu: + if (!IS_ERR(host-biu_clk)) { + clk_disable_unprepare(host-biu_clk); + clk_put(host-biu_clk); + } return ret; } EXPORT_SYMBOL(dw_mci_probe); @@ -2149,6 +2189,12 @@ void dw_mci_remove(struct dw_mci *host) regulator_put(host-vmmc); } + if (!IS_ERR(host-ciu_clk)) + clk_disable_unprepare(host-ciu_clk); + if (!IS_ERR(host-biu_clk)) + clk_disable_unprepare(host-biu_clk); + clk_put(host-ciu_clk); + clk_put(host-biu_clk); } EXPORT_SYMBOL(dw_mci_remove); diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index a37a573..787ad56 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h @@ -78,6 +78,8 @@ struct mmc_data; * @data_offset: Set the offset of DATA register according to VERID. * @dev: Device associated with the MMC controller. * @pdata: Platform data associated with the MMC controller. + * @biu_clk: Pointer to bus interface unit clock instance. + * @ciu_clk: Pointer to card interface unit clock instance. * @slot: Slots sharing this MMC controller. * @fifo_depth: depth of FIFO. * @data_shift: log2 of FIFO item size. @@ -158,6 +160,8 @@ struct dw_mci { u16 data_offset; struct device *dev; struct dw_mci_board *pdata; + struct clk *biu_clk; + struct clk *ciu_clk; struct dw_mci_slot *slot[MAX_MCI_SLOTS]; /* FIFO push and pull */ -- 1.6.6.rc2 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 5/9] mmc: dw_mmc: add quirk to indicate missing write protect line
If the write protect pad of the controller is not connected to the write protect pin of the slot, the driver should be notified of this condition so that incorrect check for write protection by reading the WRTORT register can avoided. The get_ro platform callback can be used for in such cases, but with device tree support enabled, such platform callbacks cannot be supported. Add a new quirk for notifying the driver about the missing write protect line so the driver can assume that the card write protection is disabled. Signed-off-by: Thomas Abraham thomas.abra...@linaro.org Acked-by: Will Newton will.new...@imgtec.com --- drivers/mmc/host/dw_mmc.c |4 +++- include/linux/mmc/dw_mmc.h |3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index de45ad2..455a155 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -830,7 +830,9 @@ static int dw_mci_get_ro(struct mmc_host *mmc) struct dw_mci_board *brd = slot-host-pdata; /* Use platform get_ro function, else try on board write protect */ - if (brd-get_ro) + if (brd-quirks DW_MCI_QUIRK_NO_WRITE_PROTECT) + read_only = 0; + else if (brd-get_ro) read_only = brd-get_ro(slot-id); else read_only = diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 787ad56..b72e4aa 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h @@ -205,7 +205,8 @@ struct dw_mci_dma_ops { #define DW_MCI_QUIRK_HIGHSPEED BIT(2) /* Unreliable card detection */ #define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) - +/* Write Protect detection not available */ +#define DW_MCI_QUIRK_NO_WRITE_PROTECT BIT(4) struct dma_pdata; -- 1.6.6.rc2 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 6/9] mmc: dw_mmc: add device tree support
Add device tree based discovery support. Signed-off-by: Thomas Abraham thomas.abra...@linaro.org Acked-by: Will Newton will.new...@imgtec.com --- .../devicetree/bindings/mmc/synposis-dw-mshc.txt | 79 drivers/mmc/host/dw_mmc-pltfm.c|9 ++ drivers/mmc/host/dw_mmc.c | 130 ++- 3 files changed, 211 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/synposis-dw-mshc.txt diff --git a/Documentation/devicetree/bindings/mmc/synposis-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/synposis-dw-mshc.txt new file mode 100644 index 000..06cd32d --- /dev/null +++ b/Documentation/devicetree/bindings/mmc/synposis-dw-mshc.txt @@ -0,0 +1,79 @@ +* Synopsis Designware Mobile Storage Host Controller + +The Synopsis designware mobile storage host controller is used to interface +a SoC with storage medium such as eMMC or SD/MMC cards. This file documents +differences between the core mmc properties described by mmc.txt and the +properties used by the Synopsis Designware Mobile Storage Host Controller. + +Required Properties: + +* compatible: should be + - snps,dw-mshc: for controllers compliant with synopsis dw-mshc. +* #address-cells: should be 1. +* #size-cells: should be 0. + +# Slots: The slot specific information are contained within child-nodes with + each child-node representing a supported slot. There should be atleast one + child node representing a card slot. The name of the child node representing + the slot is recommended to be slot@n where n is the unique number of the slot + connnected to the controller. The following are optional properties which + can be included in the slot child node. + + * reg: specifies the physical slot number. The valid values of this + property is 0 to (num-slots -1), where num-slots is the value + specified by the num-slots property. + + * bus-width: as documented in mmc core bindings. + + * wp-gpios: specifies the write protect gpio line. The format of the + gpio specifier depends on the gpio controller. If the write-protect + line is not available, this property is optional. + +Optional properties: + +* num-slots: specifies the number of slots supported by the controller. + The number of physical slots actually used could be equal or less than the + value specified by num-slots. If this property is not specified, the value + of num-slot property is assumed to be 1. + +* fifo-depth: The maximum size of the tx/rx fifo's. If this property is not + specified, the default value of the fifo size is determined from the + controller registers. + +* card-detect-delay: Delay in milli-seconds before detecting card after card + insert event. The default value is 0. + +* supports-highspeed: Enables support for high speed cards (upto 50MHz) + +* broken-cd: as documented in mmc core bindings. + +Aliases: + +- All the MSHC controller nodes should be represented in the aliases node using + the following format 'mshc{n}' where n is a unique number for the alias. + +Example: + +The MSHC controller node can be split into two portions, SoC specific and +board specific portions as listed below. + + dwmmc0@1220 { + compatible = snps,dw-mshc; + reg = 0x1220 0x1000; + interrupts = 0 75 0; + #address-cells = 1; + #size-cells = 0; + }; + + dwmmc0@1220 { + num-slots = 1; + supports-highspeed; + broken-cd; + fifo-depth = 0x80; + card-detect-delay = 200; + + slot@0 { + reg = 0; + bus-width = 8; + }; + }; diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c index ce7be1a..7205905 100644 --- a/drivers/mmc/host/dw_mmc-pltfm.c +++ b/drivers/mmc/host/dw_mmc-pltfm.c @@ -19,6 +19,8 @@ #include linux/mmc/host.h #include linux/mmc/mmc.h #include linux/mmc/dw_mmc.h +#include linux/of.h + #include dw_mmc.h static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) @@ -94,10 +96,17 @@ static int dw_mci_pltfm_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(dw_mci_pltfm_pmops, dw_mci_pltfm_suspend, dw_mci_pltfm_resume); +static const struct of_device_id dw_mci_pltfm_match[] = { + { .compatible = snps,dw-mshc, }, + {}, +}; +MODULE_DEVICE_TABLE(of, dw_mci_pltfm_match); + static struct platform_driver dw_mci_pltfm_driver = { .remove = __exit_p(dw_mci_pltfm_remove), .driver = { .name = dw_mmc, + .of_match_table = of_match_ptr(dw_mci_pltfm_match), .pm = dw_mci_pltfm_pmops, }, }; diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 455a155..c792466 100644 --- a/drivers/mmc/host/dw_mmc.c +++
[PATCH v6 7/9] mmc: dw_mmc: prepare functions in dw_mmc-pltfm for reuse
Platform implementations of dw-mshc controller may choose to exterd the features of the standard dw-mshc controller such as adding additional clocking options or modifying the bus interface. Support for such implementation specific extensions can be incorporated into dw_mmc-pltfm, but including multiple such platform specific implementations would convolute the existing dw_mmc-pltfm code. Instead, it would be better to create implementation specific platform drivers to support implementation specific features. Such platforms drivers can reuse the existing infrastructure in dw_mmc-pltfm for resource identification and controller registration and provide support for implementation specific features. So, allow the infrastructure in dw_mmc-pltfm to be reused by other implementation specific platform drivers. Signed-off-by: Thomas Abraham thomas.abra...@linaro.org Acked-by: Will Newton will.new...@imgtec.com --- drivers/mmc/host/dw_mmc-pltfm.c | 12 ++-- drivers/mmc/host/dw_mmc-pltfm.h | 19 +++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 drivers/mmc/host/dw_mmc-pltfm.h diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c index 7205905..e17da91 100644 --- a/drivers/mmc/host/dw_mmc-pltfm.c +++ b/drivers/mmc/host/dw_mmc-pltfm.c @@ -23,7 +23,7 @@ #include dw_mmc.h -static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) +int dw_mci_pltfm_register(struct platform_device *pdev) { struct dw_mci *host; struct resource *regs; @@ -52,6 +52,12 @@ static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) ret = dw_mci_probe(host); return ret; } +EXPORT_SYMBOL_GPL(dw_mci_pltfm_register); + +static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) +{ + return dw_mci_pltfm_register(pdev); +} static int __devexit dw_mci_pltfm_remove(struct platform_device *pdev) { @@ -61,6 +67,7 @@ static int __devexit dw_mci_pltfm_remove(struct platform_device *pdev) dw_mci_remove(host); return 0; } +EXPORT_SYMBOL_GPL(dw_mci_pltfm_remove); #ifdef CONFIG_PM_SLEEP /* @@ -94,7 +101,8 @@ static int dw_mci_pltfm_resume(struct device *dev) #define dw_mci_pltfm_resumeNULL #endif /* CONFIG_PM_SLEEP */ -static SIMPLE_DEV_PM_OPS(dw_mci_pltfm_pmops, dw_mci_pltfm_suspend, dw_mci_pltfm_resume); +SIMPLE_DEV_PM_OPS(dw_mci_pltfm_pmops, dw_mci_pltfm_suspend, dw_mci_pltfm_resume); +EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops); static const struct of_device_id dw_mci_pltfm_match[] = { { .compatible = snps,dw-mshc, }, diff --git a/drivers/mmc/host/dw_mmc-pltfm.h b/drivers/mmc/host/dw_mmc-pltfm.h new file mode 100644 index 000..6c065d9 --- /dev/null +++ b/drivers/mmc/host/dw_mmc-pltfm.h @@ -0,0 +1,19 @@ +/* + * Synopsys DesignWare Multimedia Card Interface Platform driver + * + * Copyright (C) 2012, Samsung Electronics Co., Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#ifndef _DW_MMC_PLTFM_H_ +#define _DW_MMC_PLTFM_H_ + +extern int dw_mci_pltfm_register(struct platform_device *pdev); +extern int __devexit dw_mci_pltfm_remove(struct platform_device *pdev); +extern const struct dev_pm_ops dw_mci_pltfm_pmops; + +#endif /* _DW_MMC_PLTFM_H_ */ -- 1.6.6.rc2 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 8/9] mmc: dw_mmc: add support for implementation specific callbacks
The core dw-mshc controller driver can let platform specific implementations of the dw-mshc controller to control the hardware as required by such implementations. This is acheived by invoking implementation specific (optional) callbacks. Define the list of callbacks supported the add invocation points for the same. Signed-off-by: Thomas Abraham thomas.abra...@linaro.org Acked-by: Will Newton will.new...@imgtec.com --- drivers/mmc/host/dw_mmc-pltfm.c | 12 - drivers/mmc/host/dw_mmc-pltfm.h |3 +- drivers/mmc/host/dw_mmc.c | 47 ++- drivers/mmc/host/dw_mmc.h | 24 include/linux/mmc/dw_mmc.h |4 +++ 5 files changed, 86 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c index e17da91..c960ca7 100644 --- a/drivers/mmc/host/dw_mmc-pltfm.c +++ b/drivers/mmc/host/dw_mmc-pltfm.c @@ -23,7 +23,8 @@ #include dw_mmc.h -int dw_mci_pltfm_register(struct platform_device *pdev) +int dw_mci_pltfm_register(struct platform_device *pdev, + struct dw_mci_drv_data *drv_data) { struct dw_mci *host; struct resource *regs; @@ -41,6 +42,7 @@ int dw_mci_pltfm_register(struct platform_device *pdev) if (host-irq 0) return host-irq; + host-drv_data = drv_data; host-dev = pdev-dev; host-irq_flags = 0; host-pdata = pdev-dev.platform_data; @@ -48,6 +50,12 @@ int dw_mci_pltfm_register(struct platform_device *pdev) if (!host-regs) return -ENOMEM; + if (host-drv_data-init) { + ret = host-drv_data-init(host); + if (ret) + return ret; + } + platform_set_drvdata(pdev, host); ret = dw_mci_probe(host); return ret; @@ -56,7 +64,7 @@ EXPORT_SYMBOL_GPL(dw_mci_pltfm_register); static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev) { - return dw_mci_pltfm_register(pdev); + return dw_mci_pltfm_register(pdev, NULL); } static int __devexit dw_mci_pltfm_remove(struct platform_device *pdev) diff --git a/drivers/mmc/host/dw_mmc-pltfm.h b/drivers/mmc/host/dw_mmc-pltfm.h index 6c065d9..301f245 100644 --- a/drivers/mmc/host/dw_mmc-pltfm.h +++ b/drivers/mmc/host/dw_mmc-pltfm.h @@ -12,7 +12,8 @@ #ifndef _DW_MMC_PLTFM_H_ #define _DW_MMC_PLTFM_H_ -extern int dw_mci_pltfm_register(struct platform_device *pdev); +extern int dw_mci_pltfm_register(struct platform_device *pdev, + struct dw_mci_drv_data *drv_data); extern int __devexit dw_mci_pltfm_remove(struct platform_device *pdev); extern const struct dev_pm_ops dw_mci_pltfm_pmops; diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index c792466..9f8e487 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -231,6 +231,7 @@ static void dw_mci_set_timeout(struct dw_mci *host) static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd) { struct mmc_data *data; + struct dw_mci_slot *slot = mmc_priv(mmc); u32 cmdr; cmd-error = -EINPROGRESS; @@ -260,6 +261,9 @@ static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd) cmdr |= SDMMC_CMD_DAT_WR; } + if (slot-host-drv_data-prepare_command) + slot-host-drv_data-prepare_command(slot-host, cmdr); + return cmdr; } @@ -815,6 +819,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) slot-clock = ios-clock; } + if (slot-host-drv_data-set_ios) + slot-host-drv_data-set_ios(slot-host, ios); + switch (ios-power_mode) { case MMC_POWER_UP: set_bit(DW_MMC_CARD_NEED_INIT, slot-flags); @@ -1820,6 +1827,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) { struct mmc_host *mmc; struct dw_mci_slot *slot; + int ctrl_id, ret; u8 bus_width; mmc = mmc_alloc_host(sizeof(struct dw_mci_slot), host-dev); @@ -1851,6 +1859,16 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) if (host-pdata-caps) mmc-caps = host-pdata-caps; + if (host-dev-of_node) { + ctrl_id = of_alias_get_id(host-dev-of_node, mshc); + if (ctrl_id 0) + ctrl_id = 0; + } else { + ctrl_id = to_platform_device(host-dev)-id; + } + if (host-drv_data host-drv_data-caps) + mmc-caps |= host-drv_data-caps[ctrl_id]; + if (host-pdata-caps2) mmc-caps2 = host-pdata-caps2; @@ -1861,6 +1879,14 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) else bus_width = 1; + if (host-drv_data-setup_bus) { + struct device_node *slot_np; +
[PATCH v6 9/9] mmc: dw_mmc: add support for exynos specific implementation of dw-mshc
From: Thomas Abraham thomas...@samsung.com Samsung Exynos SoC's extend the dw-mshc controller for additional clock and bus control. Add support for these extensions and include provide device tree based discovery suppory as well. Signed-off-by: Thomas Abraham thomas.abra...@linaro.org Acked-by: Will Newton will.new...@imgtec.com --- .../devicetree/bindings/mmc/exynos-dw-mshc.txt | 87 +++ drivers/mmc/host/Kconfig |9 + drivers/mmc/host/Makefile |1 + drivers/mmc/host/dw_mmc-exynos.c | 253 include/linux/mmc/dw_mmc.h |2 +- 5 files changed, 351 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt create mode 100644 drivers/mmc/host/dw_mmc-exynos.c diff --git a/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt new file mode 100644 index 000..7927689 --- /dev/null +++ b/Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt @@ -0,0 +1,87 @@ +* Samsung Exynos specific extensions to the Synopsis Designware Mobile + Storage Host Controller + +The Synopsis designware mobile storage host controller is used to interface +a SoC with storage medium such as eMMC or SD/MMC cards. This file documents +differences between the core Synopsis dw mshc controller properties described +by synposis-dw-mshc.txt and the properties used by the Samsung Exynos specific +extensions to the Synopsis Designware Mobile Storage Host Controller. + +Required Properties: + +* compatible: should be + - samsung,exynos4210-dw-mshc: for controllers with Samsung Exynos4210 + specific extentions. + - samsung,exynos4412-dw-mshc: for controllers with Samsung Exynos4412 + specific extentions. + - samsung,exynos5250-dw-mshc: for controllers with Samsung Exynos5250 + specific extentions. + +* samsung,dw-mshc-ciu-div: Specifies the divider value for the card interface + unit (ciu) clock. This property is applicable only for Exynos5 SoC's and + ignored for Exynos4 SoC's. The valid range of divider value is 0 to 7. + +* samsung,dw-mshc-sdr-timing: Specifies the value of CIU clock phase shift value + in transmit mode and CIU clock phase shift value in receive mode for single + data rate mode operation. Refer notes below for the order of the cells and the + valid values. + +* samsung,dw-mshc-ddr-timing: Specifies the value of CUI clock phase shift value + in transmit mode and CIU clock phase shift value in receive mode for double + data rate mode operation. Refer notes below for the order of the cells and the + valid values. + + Notes for the sdr-timing and ddr-timing values: + +The order of the cells should be + - First Cell: CIU clock phase shift value for tx mode. + - Second Cell: CIU clock phase shift value for rx mode. + +Valid values for SDR and DDR CIU clock timing for Exynos5250: + - valid value for tx phase shift and rx phase shift is 0 to 7. + - when CIU clock divider value is set to 3, all possible 8 phase shift +values can be used. + - if CIU clock divider value is 0 (that is divide by 1), both tx and rx +phase shift clocks should be 0. + +Required properties for a slot: + +* gpios: specifies a list of gpios used for command, clock and data bus. The + first gpio is the command line and the second gpio is the clock line. The + rest of the gpios (depending on the bus-width property) are the data lines in + no particular order. The format of the gpio specifier depends on the gpio + controller. + +Example: + + The MSHC controller node can be split into two portions, SoC specific and + board specific portions as listed below. + + dwmmc0@1220 { + compatible = samsung,exynos5250-dw-mshc; + reg = 0x1220 0x1000; + interrupts = 0 75 0; + #address-cells = 1; + #size-cells = 0; + }; + + dwmmc0@1220 { + num-slots = 1; + supports-highspeed; + broken-cd; + fifo-depth = 0x80; + card-detect-delay = 200; + samsung,dw-mshc-ciu-div = 3; + samsung,dw-mshc-sdr-timing = 2 3; + samsung,dw-mshc-ddr-timing = 1 2; + + slot@0 { + reg = 0; + bus-width = 8; + gpios = gpc0 0 2 0 3, gpc0 1 2 0 3, + gpc1 0 2 3 3, gpc1 1 2 3 3, + gpc1 2 2 3 3, gpc1 3 2 3 3, + gpc0 3 2 3 3, gpc0 4 2 3 3, + gpc0 5 2 3 3, gpc0 6 2 3 3; + }; + }; diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index d588a27..dee73c0 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig
[GIT PULL] Samsung fixes-3 for v3.6
Hi Arnd and Olof, Here is second Samsung fixes for v3.6. This includes using spin_lock_irqsave in clk_set_parent() to avoid spinlock recursion and fixing wrong definitions. If any problems, please kindly let me know. Thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. The following changes since commit 4cbe5a555fa58a79b6ecbb6c531b8bab0650778d: Linux 3.6-rc4 (2012-09-01 10:39:58 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git v3.6-samsung-fixes-2 Julia Lawall (1): ARM: S3C24xx: delete double assignment Mandeep Singh Baines (1): ARM: SAMSUNG: use spin_lock_irqsave() in clk_set_parent Peter Senna Tschudin (1): ARM: S3C24XX: removes unnecessary semicolon Seung-Woo Kim (1): ARM: EXYNOS: fixed SYSMMU setup definition to mate parameter name arch/arm/mach-exynos/include/mach/sysmmu.h |2 +- arch/arm/mach-s3c24xx/mach-h1940.c |4 ++-- arch/arm/plat-samsung/clock.c |5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL] Samsung fixes-3 for v3.6
Hi, On Mon, Sep 17, 2012 at 3:56 PM, Kukjin Kim kgene@samsung.com wrote: Hi Arnd and Olof, Here is second Samsung fixes for v3.6. This includes using spin_lock_irqsave in clk_set_parent() to avoid spinlock recursion and fixing wrong definitions. If any problems, please kindly let me know. Thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. The following changes since commit 4cbe5a555fa58a79b6ecbb6c531b8bab0650778d: Linux 3.6-rc4 (2012-09-01 10:39:58 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git v3.6-samsung-fixes-2 Julia Lawall (1): ARM: S3C24xx: delete double assignment Mandeep Singh Baines (1): ARM: SAMSUNG: use spin_lock_irqsave() in clk_set_parent Peter Senna Tschudin (1): ARM: S3C24XX: removes unnecessary semicolon Seung-Woo Kim (1): ARM: EXYNOS: fixed SYSMMU setup definition to mate parameter name We're very late in the release cycle for 3.6, and only critical fixes should go in -- no cleanups. Please queue those in a fixes-non-critical branch for 3.7 instead. Only the one from Mandeep seems to be a real bug fix, I think? -Olof -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [GIT PULL] Samsung fixes-3 for v3.6
Olof Johansson wrote: Hi, On Mon, Sep 17, 2012 at 3:56 PM, Kukjin Kim kgene@samsung.com wrote: Hi Arnd and Olof, Here is second Samsung fixes for v3.6. This includes using spin_lock_irqsave in clk_set_parent() to avoid spinlock recursion and fixing wrong definitions. If any problems, please kindly let me know. Thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. The following changes since commit 4cbe5a555fa58a79b6ecbb6c531b8bab0650778d: Linux 3.6-rc4 (2012-09-01 10:39:58 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git v3.6-samsung-fixes-2 Julia Lawall (1): ARM: S3C24xx: delete double assignment Mandeep Singh Baines (1): ARM: SAMSUNG: use spin_lock_irqsave() in clk_set_parent Peter Senna Tschudin (1): ARM: S3C24XX: removes unnecessary semicolon Seung-Woo Kim (1): ARM: EXYNOS: fixed SYSMMU setup definition to mate parameter name We're very late in the release cycle for 3.6, and only critical fixes should go in -- no cleanups. Please queue those in a fixes-non-critical branch for 3.7 instead. Only the one from Mandeep seems to be a real bug fix, I think? Well...I don't think so, others also should be fixed before v3.6 because as you can see, it can occur unexpected behavior and must be wrong. But last one is small thing... Thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL] Samsung fixes-3 for v3.6
Hi, On Mon, Sep 17, 2012 at 4:05 PM, Kukjin Kim kgene@samsung.com wrote: Well...I don't think so, others also should be fixed before v3.6 because as you can see, it can occur unexpected behavior and must be wrong. But last one is small thing... ARM: EXYNOS: fixed SYSMMU setup definition to mate parameter name is a valid cleanup, but it has zero functional impact, it just reorders two unused arguments to a stub macro. ARM: S3C24xx: delete double assignment is a valid bugfix, but the bug was introduced in ARM: S3C2410: H1940: Use leds-gpio driver for LEDs managing in 2.6.39 so fixing it in 3.7 seems just as fine as 3.6, in my opinion -- it's gone unnoticed so far and was just found by tools. ARM: S3C24XX: removes unnecessary semicolon fixes a harmless extra semicolon after a switch statement. Valid cleanup but definitely not urgent for 3.6. -Olof -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [GIT PULL] Samsung fixes-3 for v3.6
Olof Johansson wrote: Hi, On Mon, Sep 17, 2012 at 4:05 PM, Kukjin Kim kgene@samsung.com wrote: Well...I don't think so, others also should be fixed before v3.6 because as you can see, it can occur unexpected behavior and must be wrong. But last one is small thing... ARM: EXYNOS: fixed SYSMMU setup definition to mate parameter name is a valid cleanup, but it has zero functional impact, it just reorders two unused arguments to a stub macro. ARM: S3C24xx: delete double assignment is a valid bugfix, but the bug was introduced in ARM: S3C2410: H1940: Use leds-gpio driver for LEDs managing in 2.6.39 so fixing it in 3.7 seems just as fine as 3.6, in my opinion -- it's gone unnoticed so far and was just found by tools. ARM: S3C24XX: removes unnecessary semicolon fixes a harmless extra semicolon after a switch statement. Valid cleanup but definitely not urgent for 3.6. Agreed. Let me sort out the branch for fixes soon, then re-send pull request. Thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5] mmc: sdhci-s3c: Add device tree support
On 23 August 2012 22:40, Thomas Abraham thomas.abra...@linaro.org wrote: Add device tree based discovery support for Samsung's sdhci controller Cc: Ben Dooks ben-li...@fluff.org Cc: Kukjin Kim kgene@samsung.com Cc: Chris Ball c...@laptop.org Signed-off-by: Thomas Abraham thomas.abra...@linaro.org --- Changes since v4: Adapted to new mmc core card detection bindings as specfied in the patch: [PATCH] mmc: dt: Add card-detection properties to core binding and extends it samsung,cd-pinmux-gpio property as suggested by Mitch Bradley w...@firmworks.com Changes since v3: The patch series that adds device tree support for Samsung sdhci controller had six patches in total, of which, the first five patches have been accepted. The sixth patch in the series was dropped since it was using custom Samsung properties for descrbing the bus-width and card-detect gpio, but had otherwise addressed all the comments. This patch reworks the sixth patch in v3 of the sdhci device tree support patch series. The only change in this patch from the v3 version is the use of generic mmc bindings for descrbing the bus-width and card-detect gpio. .../devicetree/bindings/mmc/samsung-sdhci.txt | 53 +++ drivers/mmc/host/sdhci-s3c.c | 162 +++- 2 files changed, 209 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/samsung-sdhci.txt Hi Chris, This patch adds device tree support for sdhci-s3c driver. All the comments for this patch has been addressed. Can this be queued for v3.7? Thanks, Thomas. diff --git a/Documentation/devicetree/bindings/mmc/samsung-sdhci.txt b/Documentation/devicetree/bindings/mmc/samsung-sdhci.txt new file mode 100644 index 000..361c2ee --- /dev/null +++ b/Documentation/devicetree/bindings/mmc/samsung-sdhci.txt @@ -0,0 +1,53 @@ +* Samsung's SDHCI Controller device tree bindings + +Samsung's SDHCI controller is used as a connectivity interface with external +MMC, SD and eMMC storage mediums. This file documents differences between the +core mmc properties described by mmc.txt and the properties used by the +Samsung implmentation of the SDHCI controller. + +Note: The mmc core bindings documentation states that if none of the core +card-detect bindings are used, then the standard sdhci card detect mechanism +is used. The Samsung's SDHCI controller bindings extends this as listed below. + +[A] The property samsung,cd-pinmux-gpio can be used as stated in the +Optional Board Specific Properties section below. + +[B] If core card-detect bindings and samsung,cd-pinmux-gpio property +is not specified, it is assumed that there is no card detection +mechanism used. + +Required SoC Specific Properties: +- compatible: should be one of the following + - samsung,s3c6410-sdhci: For controllers compatible with s3c6410 sdhci +controller. + - samsung,exynos4210-sdhci: For controllers compatible with Exynos4 sdhci +controller. + +Required Board Specific Properties: +- gpios: Should specify the gpios used for clock, command and data lines. The + gpio specifier format depends on the gpio controller. + +Optional Board Specific Properties: +- samsung,cd-pinmux-gpio: Specifies the card detect line that is routed + through a pinmux to the card-detect pin of the card slot. This property + should be used only if none of the mmc core card-detect properties are + used. + +Example: + sdhci@1253 { + compatible = samsung,exynos4210-sdhci; + reg = 0x1253 0x100; + interrupts = 0 75 0; + bus-width = 4; + cd-gpios = gpk2 2 2 3 3; + gpios = gpk2 0 2 0 3, /* clock line */ + gpk2 1 2 0 3, /* command line */ + gpk2 3 2 3 3, /* data line 0 */ + gpk2 4 2 3 3, /* data line 1 */ + gpk2 5 2 3 3, /* data line 2 */ + gpk2 6 2 3 3; /* data line 3 */ + }; + + Note: This example shows both SoC specific and board specific properties + in a single device node. The properties can be actually be seperated + into SoC specific node and board specific node. diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index a50c205..445910e 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -34,6 +34,9 @@ #define MAX_BUS_CLK(4) +/* Number of gpio's used is max data bus width + command and clock lines */ +#define NUM_GPIOS(x) (x + 2) + /** * struct sdhci_s3c - S3C SDHCI instance * @host: The SDHCI host created @@ -41,6 +44,7 @@ * @ioarea: The resource created when we claimed the IO area. * @pdata: The platform data for this controller. * @cur_clk: The index of the current bus clock. + * @gpios: List of gpio numbers parsed from device tree. *
Re: [PATCH v6 0/9] mmc: dw_mmc: add support for device tree based instantiation
On 17 September 2012 23:46, Thomas Abraham thomas.abra...@linaro.org wrote: This series add device tree support for Synopsis Designware IP - Mobile Storage Host Controller (MSHC). I had addressed all comments for the v5 version of this patch series and had reposted only those patches that were modified. The version number of those reposted patches was maintained as v5 as the changes did not need any major rework. This is mainly a repost of the v5 patches with all patches marked as v6. The only new change in this series is adding a comment about bus_hz in platform data structure of the driver as suggested by Seungwon Jeon. Thomas Abraham (9): mmc: dw_mmc: convert copy of struct device in struct dw_mci to a reference mmc: dw_mmc: Use devm_* functions in dw_mmc platform driver mmc: dw_mmc: allow probe to succeed even if one slot is initialized mmc: dw_mmc: lookup for optional biu and ciu clocks mmc: dw_mmc: add quirk to indicate missing write protect line mmc: dw_mmc: add device tree support mmc: dw_mmc: prepare functions in dw_mmc-pltfm for reuse mmc: dw_mmc: add support for implementation specific callbacks mmc: dw_mmc: add support for exynos specific implementation of dw-mshc .../devicetree/bindings/mmc/exynos-dw-mshc.txt | 87 ++ .../devicetree/bindings/mmc/synposis-dw-mshc.txt | 79 + drivers/mmc/host/Kconfig |9 + drivers/mmc/host/Makefile |1 + drivers/mmc/host/dw_mmc-exynos.c | 253 drivers/mmc/host/dw_mmc-pci.c |2 +- drivers/mmc/host/dw_mmc-pltfm.c| 60 +++-- drivers/mmc/host/dw_mmc-pltfm.h| 20 ++ drivers/mmc/host/dw_mmc.c | 308 +--- drivers/mmc/host/dw_mmc.h | 24 ++ include/linux/mmc/dw_mmc.h | 15 +- 11 files changed, 782 insertions(+), 76 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt create mode 100644 Documentation/devicetree/bindings/mmc/synposis-dw-mshc.txt create mode 100644 drivers/mmc/host/dw_mmc-exynos.c create mode 100644 drivers/mmc/host/dw_mmc-pltfm.h Hi Jaehoon, Seungwon, All the changes you have suggested for this patch series has been completed. If you could ack this series, it would be great. Thanks, Thomas. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/2] DMA: PL330: Clock and runtime cleanup
On Fri, 2012-09-07 at 12:14 +0530, Inderpal Singh wrote: The controller clock is being managed at AMBA bus level probe/remove and pm_runtime/suspend functions. The existing driver does the clock enable/disable again in the same code paths, which unneccessarily increments the usage count of the clock for the same device. The following patches remove the redundant clock enable/disable from the driver. Applied thanks -- ~Vinod -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5] mmc: sdhci-s3c: Add device tree support
Hi, On Mon, Sep 17 2012, Thomas Abraham wrote: On 23 August 2012 22:40, Thomas Abraham thomas.abra...@linaro.org wrote: Add device tree based discovery support for Samsung's sdhci controller Cc: Ben Dooks ben-li...@fluff.org Cc: Kukjin Kim kgene@samsung.com Cc: Chris Ball c...@laptop.org Signed-off-by: Thomas Abraham thomas.abra...@linaro.org --- Changes since v4: Adapted to new mmc core card detection bindings as specfied in the patch: [PATCH] mmc: dt: Add card-detection properties to core binding and extends it samsung,cd-pinmux-gpio property as suggested by Mitch Bradley w...@firmworks.com Changes since v3: The patch series that adds device tree support for Samsung sdhci controller had six patches in total, of which, the first five patches have been accepted. The sixth patch in the series was dropped since it was using custom Samsung properties for descrbing the bus-width and card-detect gpio, but had otherwise addressed all the comments. This patch reworks the sixth patch in v3 of the sdhci device tree support patch series. The only change in this patch from the v3 version is the use of generic mmc bindings for descrbing the bus-width and card-detect gpio. .../devicetree/bindings/mmc/samsung-sdhci.txt | 53 +++ drivers/mmc/host/sdhci-s3c.c | 162 +++- 2 files changed, 209 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/samsung-sdhci.txt Hi Chris, This patch adds device tree support for sdhci-s3c driver. All the comments for this patch has been addressed. Can this be queued for v3.7? Yes, sounds good. Jaehoon, perhaps you could give your Reviewed-by for me to add to the patch? I've pushed this to mmc-next for 3.7 now, after adding Jaehoon's else-if suggestion that wasn't acted on: diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 3d91c7a..0c77b10 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -461,22 +461,18 @@ static int __devinit sdhci_s3c_parse_dt(struct device *dev, if (gpio_is_valid(gpio)) { pdata-cd_type = S3C_SDHCI_CD_GPIO; goto found_cd; - } else { - if (gpio != -ENOENT) { - dev_err(dev, invalid card detect gpio specified\n); - return -EINVAL; - } + } else if (gpio != -ENOENT) { + dev_err(dev, invalid card detect gpio specified\n); + return -EINVAL; } gpio = of_get_named_gpio(node, samsung,cd-pinmux-gpio, 0); if (gpio_is_valid(gpio)) { pdata-cd_type = S3C_SDHCI_CD_INTERNAL; goto found_cd; - } else { - if (gpio != -ENOENT) { - dev_err(dev, invalid card detect gpio specified\n); - return -EINVAL; - } + } else if (gpio != -ENOENT) { + dev_err(dev, invalid card detect gpio specified\n); + return -EINVAL; } dev_info(dev, assuming no card detect line available\n); Thanks, - Chris. -- Chris Ball c...@laptop.org http://printf.net/ One Laptop Per Child -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5] mmc: sdhci-s3c: Add device tree support
On 18 September 2012 09:20, Chris Ball c...@laptop.org wrote: Hi, On Mon, Sep 17 2012, Thomas Abraham wrote: On 23 August 2012 22:40, Thomas Abraham thomas.abra...@linaro.org wrote: Add device tree based discovery support for Samsung's sdhci controller Cc: Ben Dooks ben-li...@fluff.org Cc: Kukjin Kim kgene@samsung.com Cc: Chris Ball c...@laptop.org Signed-off-by: Thomas Abraham thomas.abra...@linaro.org --- Changes since v4: Adapted to new mmc core card detection bindings as specfied in the patch: [PATCH] mmc: dt: Add card-detection properties to core binding and extends it samsung,cd-pinmux-gpio property as suggested by Mitch Bradley w...@firmworks.com Changes since v3: The patch series that adds device tree support for Samsung sdhci controller had six patches in total, of which, the first five patches have been accepted. The sixth patch in the series was dropped since it was using custom Samsung properties for descrbing the bus-width and card-detect gpio, but had otherwise addressed all the comments. This patch reworks the sixth patch in v3 of the sdhci device tree support patch series. The only change in this patch from the v3 version is the use of generic mmc bindings for descrbing the bus-width and card-detect gpio. .../devicetree/bindings/mmc/samsung-sdhci.txt | 53 +++ drivers/mmc/host/sdhci-s3c.c | 162 +++- 2 files changed, 209 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/samsung-sdhci.txt Hi Chris, This patch adds device tree support for sdhci-s3c driver. All the comments for this patch has been addressed. Can this be queued for v3.7? Yes, sounds good. Jaehoon, perhaps you could give your Reviewed-by for me to add to the patch? I've pushed this to mmc-next for 3.7 now, after adding Jaehoon's else-if suggestion that wasn't acted on: diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 3d91c7a..0c77b10 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -461,22 +461,18 @@ static int __devinit sdhci_s3c_parse_dt(struct device *dev, if (gpio_is_valid(gpio)) { pdata-cd_type = S3C_SDHCI_CD_GPIO; goto found_cd; - } else { - if (gpio != -ENOENT) { - dev_err(dev, invalid card detect gpio specified\n); - return -EINVAL; - } + } else if (gpio != -ENOENT) { + dev_err(dev, invalid card detect gpio specified\n); + return -EINVAL; } gpio = of_get_named_gpio(node, samsung,cd-pinmux-gpio, 0); if (gpio_is_valid(gpio)) { pdata-cd_type = S3C_SDHCI_CD_INTERNAL; goto found_cd; - } else { - if (gpio != -ENOENT) { - dev_err(dev, invalid card detect gpio specified\n); - return -EINVAL; - } + } else if (gpio != -ENOENT) { + dev_err(dev, invalid card detect gpio specified\n); + return -EINVAL; } Thank you Chris for your modification. Regards, Thomas. dev_info(dev, assuming no card detect line available\n); Thanks, - Chris. -- Chris Ball c...@laptop.org http://printf.net/ One Laptop Per Child -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5] mmc: sdhci-s3c: Add device tree support
On 09/18/2012 12:50 PM, Chris Ball wrote: Hi, On Mon, Sep 17 2012, Thomas Abraham wrote: On 23 August 2012 22:40, Thomas Abraham thomas.abra...@linaro.org wrote: Add device tree based discovery support for Samsung's sdhci controller Cc: Ben Dooks ben-li...@fluff.org Cc: Kukjin Kim kgene@samsung.com Cc: Chris Ball c...@laptop.org Signed-off-by: Thomas Abraham thomas.abra...@linaro.org --- Changes since v4: Adapted to new mmc core card detection bindings as specfied in the patch: [PATCH] mmc: dt: Add card-detection properties to core binding and extends it samsung,cd-pinmux-gpio property as suggested by Mitch Bradley w...@firmworks.com Changes since v3: The patch series that adds device tree support for Samsung sdhci controller had six patches in total, of which, the first five patches have been accepted. The sixth patch in the series was dropped since it was using custom Samsung properties for descrbing the bus-width and card-detect gpio, but had otherwise addressed all the comments. This patch reworks the sixth patch in v3 of the sdhci device tree support patch series. The only change in this patch from the v3 version is the use of generic mmc bindings for descrbing the bus-width and card-detect gpio. .../devicetree/bindings/mmc/samsung-sdhci.txt | 53 +++ drivers/mmc/host/sdhci-s3c.c | 162 +++- 2 files changed, 209 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/samsung-sdhci.txt Hi Chris, This patch adds device tree support for sdhci-s3c driver. All the comments for this patch has been addressed. Can this be queued for v3.7? Yes, sounds good. Jaehoon, perhaps you could give your Reviewed-by for me to add to the patch? I've pushed this to mmc-next for 3.7 now, after adding Jaehoon's else-if suggestion that wasn't acted on: Right, I suggested them. thanks Chris. Looks good to me this patch except for them. Reviewed-by: Jaehoon Chung jh80.ch...@samsung.com diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 3d91c7a..0c77b10 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -461,22 +461,18 @@ static int __devinit sdhci_s3c_parse_dt(struct device *dev, if (gpio_is_valid(gpio)) { pdata-cd_type = S3C_SDHCI_CD_GPIO; goto found_cd; - } else { - if (gpio != -ENOENT) { - dev_err(dev, invalid card detect gpio specified\n); - return -EINVAL; - } + } else if (gpio != -ENOENT) { + dev_err(dev, invalid card detect gpio specified\n); + return -EINVAL; } gpio = of_get_named_gpio(node, samsung,cd-pinmux-gpio, 0); if (gpio_is_valid(gpio)) { pdata-cd_type = S3C_SDHCI_CD_INTERNAL; goto found_cd; - } else { - if (gpio != -ENOENT) { - dev_err(dev, invalid card detect gpio specified\n); - return -EINVAL; - } + } else if (gpio != -ENOENT) { + dev_err(dev, invalid card detect gpio specified\n); + return -EINVAL; } dev_info(dev, assuming no card detect line available\n); Thanks, - Chris. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] ARM: Exynos4: Put PCM, Slimbus, Spdif clocks to off state
On 6 September 2012 19:46, Chander Kashyap chander.kash...@linaro.org wrote: The clocks for PCM, Slimbus, Spdif added to off list in order to turn them off at boot time. Signed-off-by: Chander Kashyap chander.kash...@linaro.org --- arch/arm/mach-exynos/clock-exynos4.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/mach-exynos/clock-exynos4.c b/arch/arm/mach-exynos/clock-exynos4.c index 7cc5491..6a45c9a 100644 --- a/arch/arm/mach-exynos/clock-exynos4.c +++ b/arch/arm/mach-exynos/clock-exynos4.c @@ -627,6 +627,25 @@ static struct clk exynos4_init_clocks_off[] = { .enable = exynos4_clk_ip_peril_ctrl, .ctrlbit= (1 21), }, { + .name = pcm, + .devname= samsung-pcm.1, + .enable = exynos4_clk_ip_peril_ctrl, + .ctrlbit= (1 22), + }, { + .name = pcm, + .devname= samsung-pcm.2, + .enable = exynos4_clk_ip_peril_ctrl, + .ctrlbit= (1 23), + }, { + .name = slimbus, + .enable = exynos4_clk_ip_peril_ctrl, + .ctrlbit= (1 25), + }, { + .name = spdif, + .devname= samsung-spdif, + .enable = exynos4_clk_ip_peril_ctrl, + .ctrlbit= (1 26), + }, { .name = ac97, .devname= samsung-ac97, .enable = exynos4_clk_ip_peril_ctrl, -- 1.7.9.5 Acked-by: Thomas Abraham thomas.abra...@linaro.org -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] ARM: SAMSUNG: Add check for NULL in clock interface
On 6 September 2012 19:55, Chander Kashyap chander.kash...@linaro.org wrote: The clock instance parameter in Samsung clock interface is not being checked for NULL pointers. Add checks for NULL pointers. Signed-off-by: Chander Kashyap chander.kash...@linaro.org --- arch/arm/plat-samsung/clock.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c index 65c5eca..7938fbc 100644 --- a/arch/arm/plat-samsung/clock.c +++ b/arch/arm/plat-samsung/clock.c @@ -119,7 +119,7 @@ void clk_disable(struct clk *clk) unsigned long clk_get_rate(struct clk *clk) { - if (IS_ERR(clk)) + if (IS_ERR_OR_NULL(clk)) return 0; if (clk-rate != 0) @@ -136,7 +136,7 @@ unsigned long clk_get_rate(struct clk *clk) long clk_round_rate(struct clk *clk, unsigned long rate) { - if (!IS_ERR(clk) clk-ops clk-ops-round_rate) + if (!IS_ERR_OR_NULL(clk) clk-ops clk-ops-round_rate) return (clk-ops-round_rate)(clk, rate); return rate; @@ -146,7 +146,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate) { int ret; - if (IS_ERR(clk)) + if (IS_ERR_OR_NULL(clk)) return -EINVAL; /* We do not default just do a clk-rate = rate as @@ -175,7 +175,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent) { int ret = 0; - if (IS_ERR(clk)) + if (IS_ERR_OR_NULL(clk) || IS_ERR_OR_NULL(parent)) return -EINVAL; spin_lock(clocks_lock); -- 1.7.9.5 Acked-by: Thomas Abraham thomas.abra...@linaro.org -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ARM: dts: use uart2 for console on smdkv310 and smdk5250
On 17 September 2012 17:16, Kukjin Kim kgene@samsung.com wrote: Cc: Thomas Abraham thomas.abra...@linaro.org Signed-off-by: Kukjin Kim kgene@samsung.com --- arch/arm/boot/dts/exynos4210-smdkv310.dts |2 +- arch/arm/boot/dts/exynos5250-smdk5250.dts |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts b/arch/arm/boot/dts/exynos4210-smdkv310.dts index 1beccc8..cb01e3d 100644 --- a/arch/arm/boot/dts/exynos4210-smdkv310.dts +++ b/arch/arm/boot/dts/exynos4210-smdkv310.dts @@ -26,7 +26,7 @@ }; chosen { - bootargs = root=/dev/ram0 rw ramdisk=8192 initrd=0x4100,8M console=ttySAC1,115200 init=/linuxrc; + bootargs = root=/dev/ram0 rw ramdisk=8192 initrd=0x4100,8M console=ttySAC2,115200 init=/linuxrc; }; Dear Mr. Kim, What is the reason for changing the console port to 2 for smdkv310 board? Thanks, Thomas. sdhci@1253 { diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts index 8a5e348..62e1039 100644 --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts @@ -21,7 +21,7 @@ }; chosen { - bootargs = root=/dev/ram0 rw ramdisk=8192 console=ttySAC1,115200; + bootargs = root=/dev/ram0 rw ramdisk=8192 initrd=0x4100,8M console=ttySAC2,115200 init=/linuxrc; }; i2c@12C6 { -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html