Re: [PATCH 03/12] ARM: Exynos5: Add watchdog timer clock instance
On 4/17/12, Thomas Abraham thomas.abra...@linaro.org wrote: Add watchdog timer clock instance for Exynos5 watchdog controller. Signed-off-by: Thomas Abraham thomas.abra...@linaro.org --- 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 ad3bec4..662615d 100644 --- a/arch/arm/mach-exynos/clock-exynos5.c +++ b/arch/arm/mach-exynos/clock-exynos5.c @@ -474,6 +474,11 @@ static struct clk exynos5_init_clocks_off[] = { .enable = exynos5_clk_ip_peris_ctrl, .ctrlbit= (1 20), }, { + .name = watchdog, + .parent = exynos5_clk_aclk_66.clk, + .enable = exynos5_clk_ip_peris_ctrl, + .ctrlbit= (1 19), Hi, Can you place this in order? It has same exynos5_clk_ip_peris_ctrl, but located under (1 20). Thank you, Kyungmin Park + }, { .name = hsmmc, .devname= exynos4-sdhci.0, .parent = exynos5_clk_aclk_200.clk, -- 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 -- 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 06/12] rtc-s3c: Fix breakage introduced by S3C2443/S3C2416 support
Hi, It's already merged with different patch, #ifdef CONFIG_OF static const struct of_device_id s3c_rtc_dt_match[] = { { .compatible = samsung,s3c2410-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C2410], }, { .compatible = samsung,s3c2416-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C2416], }, { .compatible = samsung,s3c2443-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C2443], }, { .compatible = samsung,s3c6410-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C64XX], }, {}, }; MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match); #else #define s3c_rtc_dt_match NULL #endif Thank you, Kyungmin Park On 4/17/12, Thomas Abraham thomas.abra...@linaro.org wrote: From: Heiko Stuebner he...@sntech.de Commits 7006ee4f (rtc-s3c: make room for more variants in devicetree block) and 6c0a2365 (rtc-s3c: add variants for S3C2443 and S3C2416) introduced build-failures with enabled CONFIG_USE_OF option. This patch fixes missing , in s3c_rtc_dt_match and wrong handling of the of_device_id.data property. Reported-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Heiko Stuebner he...@sntech.de --- drivers/rtc/rtc-s3c.c | 18 +- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 9ccea13..c792b6d 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -449,7 +449,7 @@ static inline int s3c_rtc_get_driver_data(struct platform_device *pdev) if (pdev-dev.of_node) { const struct of_device_id *match; match = of_match_node(s3c_rtc_dt_match, pdev-dev.of_node); - return match-data; + return (int)match-data; } #endif return platform_get_device_id(pdev)-driver_data; @@ -667,17 +667,17 @@ static int s3c_rtc_resume(struct platform_device *pdev) #ifdef CONFIG_OF static const struct of_device_id s3c_rtc_dt_match[] = { { - .compatible = samsung,s3c2410-rtc - .data = TYPE_S3C2410, + .compatible = samsung,s3c2410-rtc, + .data = (void *)TYPE_S3C2410, }, { - .compatible = samsung,s3c2416-rtc - .data = TYPE_S3C2416, + .compatible = samsung,s3c2416-rtc, + .data = (void *)TYPE_S3C2416, }, { - .compatible = samsung,s3c2443-rtc - .data = TYPE_S3C2443, + .compatible = samsung,s3c2443-rtc, + .data = (void *)TYPE_S3C2443, }, { - .compatible = samsung,s3c6410-rtc - .data = TYPE_S3C64XX, + .compatible = samsung,s3c6410-rtc, + .data = (void *)TYPE_S3C64XX, }, {}, }; -- 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 -- 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 07/12] ARM: Exynos5: Modify the GIC physical address for static io-mapping
Hi, On 4/17/12, Thomas Abraham thomas.abra...@linaro.org wrote: From: Changhwan Youn chaos.y...@samsung.com Adapt to changes in GIC physical address in rev1 of Exynos5. Does it different from rev0 and rev1? and does it support the rev1 only? Thank you, Kyungmin Park Signed-off-by: Changhwan Youn chaos.y...@samsung.com --- arch/arm/mach-exynos/common.c |4 ++-- arch/arm/mach-exynos/include/mach/map.h |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 35ac675..457d031 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -265,12 +265,12 @@ static struct map_desc exynos5_iodesc[] __initdata = { }, { .virtual= (unsigned long)S5P_VA_GIC_CPU, .pfn= __phys_to_pfn(EXYNOS5_PA_GIC_CPU), - .length = SZ_64K, + .length = SZ_8K, .type = MT_DEVICE, }, { .virtual= (unsigned long)S5P_VA_GIC_DIST, .pfn= __phys_to_pfn(EXYNOS5_PA_GIC_DIST), - .length = SZ_64K, + .length = SZ_4K, .type = MT_DEVICE, }, }; diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h index 0e2292d..648d59b 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h @@ -78,8 +78,8 @@ #define EXYNOS4_PA_GIC_CPU 0x1048 #define EXYNOS4_PA_GIC_DIST 0x1049 -#define EXYNOS5_PA_GIC_CPU 0x1048 -#define EXYNOS5_PA_GIC_DIST 0x1049 +#define EXYNOS5_PA_GIC_CPU 0x10482000 +#define EXYNOS5_PA_GIC_DIST 0x10481000 #define EXYNOS4_PA_COREPERI 0x1050 #define EXYNOS4_PA_TWD 0x10500600 -- 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 -- 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 08/12] gpio/samsung: add GPC4 bank instance
On 4/17/12, Thomas Abraham thomas.abra...@linaro.org wrote: From: Sangsu Park sangsu4u.p...@samsung.com Add GPC4 bank instance which is included in rev1 of Exynos5. Cc: Grant Likely grant.lik...@secretlab.ca Signed-off-by: Sangsu Park sangsu4u.p...@samsung.com --- arch/arm/mach-exynos/include/mach/gpio.h |9 ++--- drivers/gpio/gpio-samsung.c |8 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-exynos/include/mach/gpio.h b/arch/arm/mach-exynos/include/mach/gpio.h index d7498af..df5612b 100644 --- a/arch/arm/mach-exynos/include/mach/gpio.h +++ b/arch/arm/mach-exynos/include/mach/gpio.h @@ -153,10 +153,11 @@ enum exynos4_gpio_number { #define EXYNOS5_GPIO_B2_NR (4) #define EXYNOS5_GPIO_B3_NR (4) #define EXYNOS5_GPIO_C0_NR (7) -#define EXYNOS5_GPIO_C1_NR (7) +#define EXYNOS5_GPIO_C1_NR (4) #define EXYNOS5_GPIO_C2_NR (7) #define EXYNOS5_GPIO_C3_NR (7) -#define EXYNOS5_GPIO_D0_NR (8) +#define EXYNOS5_GPIO_C4_NR (8) +#define EXYNOS5_GPIO_D0_NR (4) #define EXYNOS5_GPIO_D1_NR (8) #define EXYNOS5_GPIO_Y0_NR (6) #define EXYNOS5_GPIO_Y1_NR (4) @@ -199,7 +200,8 @@ enum exynos5_gpio_number { EXYNOS5_GPIO_C1_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_C0), EXYNOS5_GPIO_C2_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_C1), EXYNOS5_GPIO_C3_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_C2), - EXYNOS5_GPIO_D0_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_C3), + EXYNOS5_GPIO_C4_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_C3), + EXYNOS5_GPIO_D0_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_C4), EXYNOS5_GPIO_D1_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_D0), EXYNOS5_GPIO_Y0_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_D1), EXYNOS5_GPIO_Y1_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_Y0), @@ -242,6 +244,7 @@ enum exynos5_gpio_number { #define EXYNOS5_GPC1(_nr)(EXYNOS5_GPIO_C1_START + (_nr)) #define EXYNOS5_GPC2(_nr)(EXYNOS5_GPIO_C2_START + (_nr)) #define EXYNOS5_GPC3(_nr)(EXYNOS5_GPIO_C3_START + (_nr)) +#define EXYNOS5_GPC4(_nr)(EXYNOS5_GPIO_C4_START + (_nr)) #define EXYNOS5_GPD0(_nr)(EXYNOS5_GPIO_D0_START + (_nr)) #define EXYNOS5_GPD1(_nr)(EXYNOS5_GPIO_D1_START + (_nr)) #define EXYNOS5_GPY0(_nr)(EXYNOS5_GPIO_Y0_START + (_nr)) diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index 4627787..0153bb9 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@ -2452,6 +2452,12 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = { }, }, { .chip = { + .base = EXYNOS5_GPC4(0), + .ngpio = EXYNOS5_GPIO_C4_NR, + .label = GPC4, + }, + }, { + .chip = { .base = EXYNOS5_GPD0(0), .ngpio = EXYNOS5_GPIO_D0_NR, .label = GPD0, @@ -2880,6 +2886,8 @@ static __init int samsung_gpiolib_init(void) for (i = 0; i 4; i++, chip++, gpx_base += 0x20) chip-base = gpx_base; + exynos5_gpios_1[11].base = gpio_base1 + 0x2E0; '11' seems dangerous. I think you add comments here and above to know '11' meaning. + chip = exynos5_gpios_1; nr_chips = ARRAY_SIZE(exynos5_gpios_1); -- 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 -- 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 03/12] ARM: Exynos5: Add watchdog timer clock instance
On 17 April 2012 11:44, Kyungmin Park kmp...@infradead.org wrote: On 4/17/12, Thomas Abraham thomas.abra...@linaro.org wrote: Add watchdog timer clock instance for Exynos5 watchdog controller. Signed-off-by: Thomas Abraham thomas.abra...@linaro.org --- 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 ad3bec4..662615d 100644 --- a/arch/arm/mach-exynos/clock-exynos5.c +++ b/arch/arm/mach-exynos/clock-exynos5.c @@ -474,6 +474,11 @@ static struct clk exynos5_init_clocks_off[] = { .enable = exynos5_clk_ip_peris_ctrl, .ctrlbit = (1 20), }, { + .name = watchdog, + .parent = exynos5_clk_aclk_66.clk, + .enable = exynos5_clk_ip_peris_ctrl, + .ctrlbit = (1 19), Hi, Can you place this in order? It has same exynos5_clk_ip_peris_ctrl, but located under (1 20). Hi Mr. Park, At present, there is only one clock gate from the peris register for which there is a struct clock instance. This patch adds the watchdog timer clock gate right below it and maintains the descending bit position order. Thanks, Thomas. Thank you, Kyungmin Park + }, { .name = hsmmc, .devname = exynos4-sdhci.0, .parent = exynos5_clk_aclk_200.clk, -- 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 -- 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 06/12] rtc-s3c: Fix breakage introduced by S3C2443/S3C2416 support
On 17 April 2012 12:00, Kyungmin Park kmp...@infradead.org wrote: Hi, It's already merged with different patch, This is a repost of the patch from Heiko Stuebner which would be required to fix compilation issue for rtc driver. I think you are referring to that patch but it is not merged yet. So I am reposting it with this series. Thanks, Thomas. #ifdef CONFIG_OF static const struct of_device_id s3c_rtc_dt_match[] = { { .compatible = samsung,s3c2410-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C2410], }, { .compatible = samsung,s3c2416-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C2416], }, { .compatible = samsung,s3c2443-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C2443], }, { .compatible = samsung,s3c6410-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C64XX], }, {}, }; MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match); #else #define s3c_rtc_dt_match NULL #endif Thank you, Kyungmin Park On 4/17/12, Thomas Abraham thomas.abra...@linaro.org wrote: From: Heiko Stuebner he...@sntech.de Commits 7006ee4f (rtc-s3c: make room for more variants in devicetree block) and 6c0a2365 (rtc-s3c: add variants for S3C2443 and S3C2416) introduced build-failures with enabled CONFIG_USE_OF option. This patch fixes missing , in s3c_rtc_dt_match and wrong handling of the of_device_id.data property. Reported-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Heiko Stuebner he...@sntech.de --- drivers/rtc/rtc-s3c.c | 18 +- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 9ccea13..c792b6d 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -449,7 +449,7 @@ static inline int s3c_rtc_get_driver_data(struct platform_device *pdev) if (pdev-dev.of_node) { const struct of_device_id *match; match = of_match_node(s3c_rtc_dt_match, pdev-dev.of_node); - return match-data; + return (int)match-data; } #endif return platform_get_device_id(pdev)-driver_data; @@ -667,17 +667,17 @@ static int s3c_rtc_resume(struct platform_device *pdev) #ifdef CONFIG_OF static const struct of_device_id s3c_rtc_dt_match[] = { { - .compatible = samsung,s3c2410-rtc - .data = TYPE_S3C2410, + .compatible = samsung,s3c2410-rtc, + .data = (void *)TYPE_S3C2410, }, { - .compatible = samsung,s3c2416-rtc - .data = TYPE_S3C2416, + .compatible = samsung,s3c2416-rtc, + .data = (void *)TYPE_S3C2416, }, { - .compatible = samsung,s3c2443-rtc - .data = TYPE_S3C2443, + .compatible = samsung,s3c2443-rtc, + .data = (void *)TYPE_S3C2443, }, { - .compatible = samsung,s3c6410-rtc - .data = TYPE_S3C64XX, + .compatible = samsung,s3c6410-rtc, + .data = (void *)TYPE_S3C64XX, }, {}, }; -- 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 -- 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 07/12] ARM: Exynos5: Modify the GIC physical address for static io-mapping
On 17 April 2012 12:01, Kyungmin Park kmp...@infradead.org wrote: Hi, On 4/17/12, Thomas Abraham thomas.abra...@linaro.org wrote: From: Changhwan Youn chaos.y...@samsung.com Adapt to changes in GIC physical address in rev1 of Exynos5. Does it different from rev0 and rev1? and does it support the rev1 only? The physical base address of CPU and distributor portions of GIC are different on Rev0 and Rev1.0. This patch series overrides Rev0 and hence the mainline will support only Rev1.0. If the support for Rev0 should also be maintained (if there are users of it), then I can maintain the support for Rev0 also. Thanks, Thomas. Thank you, Kyungmin Park Signed-off-by: Changhwan Youn chaos.y...@samsung.com --- arch/arm/mach-exynos/common.c | 4 ++-- arch/arm/mach-exynos/include/mach/map.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 35ac675..457d031 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -265,12 +265,12 @@ static struct map_desc exynos5_iodesc[] __initdata = { }, { .virtual = (unsigned long)S5P_VA_GIC_CPU, .pfn = __phys_to_pfn(EXYNOS5_PA_GIC_CPU), - .length = SZ_64K, + .length = SZ_8K, .type = MT_DEVICE, }, { .virtual = (unsigned long)S5P_VA_GIC_DIST, .pfn = __phys_to_pfn(EXYNOS5_PA_GIC_DIST), - .length = SZ_64K, + .length = SZ_4K, .type = MT_DEVICE, }, }; diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h index 0e2292d..648d59b 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h @@ -78,8 +78,8 @@ #define EXYNOS4_PA_GIC_CPU 0x1048 #define EXYNOS4_PA_GIC_DIST 0x1049 -#define EXYNOS5_PA_GIC_CPU 0x1048 -#define EXYNOS5_PA_GIC_DIST 0x1049 +#define EXYNOS5_PA_GIC_CPU 0x10482000 +#define EXYNOS5_PA_GIC_DIST 0x10481000 #define EXYNOS4_PA_COREPERI 0x1050 #define EXYNOS4_PA_TWD 0x10500600 -- 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 ___ linux-arm-kernel mailing list linux-arm-ker...@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -- 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 08/12] gpio/samsung: add GPC4 bank instance
On 17 April 2012 12:03, Kyungmin Park kmp...@infradead.org wrote: On 4/17/12, Thomas Abraham thomas.abra...@linaro.org wrote: From: Sangsu Park sangsu4u.p...@samsung.com Add GPC4 bank instance which is included in rev1 of Exynos5. Cc: Grant Likely grant.lik...@secretlab.ca Signed-off-by: Sangsu Park sangsu4u.p...@samsung.com --- arch/arm/mach-exynos/include/mach/gpio.h | 9 ++--- drivers/gpio/gpio-samsung.c | 8 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-exynos/include/mach/gpio.h b/arch/arm/mach-exynos/include/mach/gpio.h index d7498af..df5612b 100644 --- a/arch/arm/mach-exynos/include/mach/gpio.h +++ b/arch/arm/mach-exynos/include/mach/gpio.h @@ -153,10 +153,11 @@ enum exynos4_gpio_number { #define EXYNOS5_GPIO_B2_NR (4) #define EXYNOS5_GPIO_B3_NR (4) #define EXYNOS5_GPIO_C0_NR (7) -#define EXYNOS5_GPIO_C1_NR (7) +#define EXYNOS5_GPIO_C1_NR (4) #define EXYNOS5_GPIO_C2_NR (7) #define EXYNOS5_GPIO_C3_NR (7) -#define EXYNOS5_GPIO_D0_NR (8) +#define EXYNOS5_GPIO_C4_NR (8) +#define EXYNOS5_GPIO_D0_NR (4) #define EXYNOS5_GPIO_D1_NR (8) #define EXYNOS5_GPIO_Y0_NR (6) #define EXYNOS5_GPIO_Y1_NR (4) @@ -199,7 +200,8 @@ enum exynos5_gpio_number { EXYNOS5_GPIO_C1_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_C0), EXYNOS5_GPIO_C2_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_C1), EXYNOS5_GPIO_C3_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_C2), - EXYNOS5_GPIO_D0_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_C3), + EXYNOS5_GPIO_C4_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_C3), + EXYNOS5_GPIO_D0_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_C4), EXYNOS5_GPIO_D1_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_D0), EXYNOS5_GPIO_Y0_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_D1), EXYNOS5_GPIO_Y1_START = EXYNOS_GPIO_NEXT(EXYNOS5_GPIO_Y0), @@ -242,6 +244,7 @@ enum exynos5_gpio_number { #define EXYNOS5_GPC1(_nr) (EXYNOS5_GPIO_C1_START + (_nr)) #define EXYNOS5_GPC2(_nr) (EXYNOS5_GPIO_C2_START + (_nr)) #define EXYNOS5_GPC3(_nr) (EXYNOS5_GPIO_C3_START + (_nr)) +#define EXYNOS5_GPC4(_nr) (EXYNOS5_GPIO_C4_START + (_nr)) #define EXYNOS5_GPD0(_nr) (EXYNOS5_GPIO_D0_START + (_nr)) #define EXYNOS5_GPD1(_nr) (EXYNOS5_GPIO_D1_START + (_nr)) #define EXYNOS5_GPY0(_nr) (EXYNOS5_GPIO_Y0_START + (_nr)) diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index 4627787..0153bb9 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@ -2452,6 +2452,12 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = { }, }, { .chip = { + .base = EXYNOS5_GPC4(0), + .ngpio = EXYNOS5_GPIO_C4_NR, + .label = GPC4, + }, + }, { + .chip = { .base = EXYNOS5_GPD0(0), .ngpio = EXYNOS5_GPIO_D0_NR, .label = GPD0, @@ -2880,6 +2886,8 @@ static __init int samsung_gpiolib_init(void) for (i = 0; i 4; i++, chip++, gpx_base += 0x20) chip-base = gpx_base; + exynos5_gpios_1[11].base = gpio_base1 + 0x2E0; '11' seems dangerous. I think you add comments here and above to know '11' meaning. Yes, true. But these will go away when the Samsung pinctrl driver will be merged. For now, I will put a comment to explain the meaning of 11. Thanks for reviewing the patches. Thanks, Thomas. + chip = exynos5_gpios_1; nr_chips = ARRAY_SIZE(exynos5_gpios_1); -- 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 -- 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 06/12] rtc-s3c: Fix breakage introduced by S3C2443/S3C2416 support
On 4/17/12, Thomas Abraham thomas.abra...@linaro.org wrote: On 17 April 2012 12:00, Kyungmin Park kmp...@infradead.org wrote: Hi, It's already merged with different patch, This is a repost of the patch from Heiko Stuebner which would be required to fix compilation issue for rtc driver. I think you are referring to that patch but it is not merged yet. So I am reposting it with this series. No it's 3.4.0-rc3. it's already included. Thanks, Thomas. #ifdef CONFIG_OF static const struct of_device_id s3c_rtc_dt_match[] = { { .compatible = samsung,s3c2410-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C2410], }, { .compatible = samsung,s3c2416-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C2416], }, { .compatible = samsung,s3c2443-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C2443], }, { .compatible = samsung,s3c6410-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C64XX], }, {}, }; MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match); #else #define s3c_rtc_dt_match NULL #endif Thank you, Kyungmin Park On 4/17/12, Thomas Abraham thomas.abra...@linaro.org wrote: From: Heiko Stuebner he...@sntech.de Commits 7006ee4f (rtc-s3c: make room for more variants in devicetree block) and 6c0a2365 (rtc-s3c: add variants for S3C2443 and S3C2416) introduced build-failures with enabled CONFIG_USE_OF option. This patch fixes missing , in s3c_rtc_dt_match and wrong handling of the of_device_id.data property. Reported-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Heiko Stuebner he...@sntech.de --- drivers/rtc/rtc-s3c.c | 18 +- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 9ccea13..c792b6d 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -449,7 +449,7 @@ static inline int s3c_rtc_get_driver_data(struct platform_device *pdev) if (pdev-dev.of_node) { const struct of_device_id *match; match = of_match_node(s3c_rtc_dt_match, pdev-dev.of_node); - return match-data; + return (int)match-data; } #endif return platform_get_device_id(pdev)-driver_data; @@ -667,17 +667,17 @@ static int s3c_rtc_resume(struct platform_device *pdev) #ifdef CONFIG_OF static const struct of_device_id s3c_rtc_dt_match[] = { { - .compatible = samsung,s3c2410-rtc - .data = TYPE_S3C2410, + .compatible = samsung,s3c2410-rtc, + .data = (void *)TYPE_S3C2410, }, { - .compatible = samsung,s3c2416-rtc - .data = TYPE_S3C2416, + .compatible = samsung,s3c2416-rtc, + .data = (void *)TYPE_S3C2416, }, { - .compatible = samsung,s3c2443-rtc - .data = TYPE_S3C2443, + .compatible = samsung,s3c2443-rtc, + .data = (void *)TYPE_S3C2443, }, { - .compatible = samsung,s3c6410-rtc - .data = TYPE_S3C64XX, + .compatible = samsung,s3c6410-rtc, + .data = (void *)TYPE_S3C64XX, }, {}, }; -- 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 -- 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 -- 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 06/12] rtc-s3c: Fix breakage introduced by S3C2443/S3C2416 support
On 17 April 2012 13:55, Kyungmin Park kmp...@infradead.org wrote: On 4/17/12, Thomas Abraham thomas.abra...@linaro.org wrote: On 17 April 2012 12:00, Kyungmin Park kmp...@infradead.org wrote: Hi, It's already merged with different patch, This is a repost of the patch from Heiko Stuebner which would be required to fix compilation issue for rtc driver. I think you are referring to that patch but it is not merged yet. So I am reposting it with this series. No it's 3.4.0-rc3. it's already included. Right, it is merged already. I was still on -rc2 and did not notice this change. Thanks, Thomas. Thanks, Thomas. #ifdef CONFIG_OF static const struct of_device_id s3c_rtc_dt_match[] = { { .compatible = samsung,s3c2410-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C2410], }, { .compatible = samsung,s3c2416-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C2416], }, { .compatible = samsung,s3c2443-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C2443], }, { .compatible = samsung,s3c6410-rtc, .data = s3c_rtc_drv_data_array[TYPE_S3C64XX], }, {}, }; MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match); #else #define s3c_rtc_dt_match NULL #endif Thank you, Kyungmin Park On 4/17/12, Thomas Abraham thomas.abra...@linaro.org wrote: From: Heiko Stuebner he...@sntech.de Commits 7006ee4f (rtc-s3c: make room for more variants in devicetree block) and 6c0a2365 (rtc-s3c: add variants for S3C2443 and S3C2416) introduced build-failures with enabled CONFIG_USE_OF option. This patch fixes missing , in s3c_rtc_dt_match and wrong handling of the of_device_id.data property. Reported-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Heiko Stuebner he...@sntech.de --- drivers/rtc/rtc-s3c.c | 18 +- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 9ccea13..c792b6d 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -449,7 +449,7 @@ static inline int s3c_rtc_get_driver_data(struct platform_device *pdev) if (pdev-dev.of_node) { const struct of_device_id *match; match = of_match_node(s3c_rtc_dt_match, pdev-dev.of_node); - return match-data; + return (int)match-data; } #endif return platform_get_device_id(pdev)-driver_data; @@ -667,17 +667,17 @@ static int s3c_rtc_resume(struct platform_device *pdev) #ifdef CONFIG_OF static const struct of_device_id s3c_rtc_dt_match[] = { { - .compatible = samsung,s3c2410-rtc - .data = TYPE_S3C2410, + .compatible = samsung,s3c2410-rtc, + .data = (void *)TYPE_S3C2410, }, { - .compatible = samsung,s3c2416-rtc - .data = TYPE_S3C2416, + .compatible = samsung,s3c2416-rtc, + .data = (void *)TYPE_S3C2416, }, { - .compatible = samsung,s3c2443-rtc - .data = TYPE_S3C2443, + .compatible = samsung,s3c2443-rtc, + .data = (void *)TYPE_S3C2443, }, { - .compatible = samsung,s3c6410-rtc - .data = TYPE_S3C64XX, + .compatible = samsung,s3c6410-rtc, + .data = (void *)TYPE_S3C64XX, }, {}, }; -- 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 -- 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 -- 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/3] i2c-s3c2410: Rework device type handling
Hi, On Wed, Mar 21, 2012 at 08:11:52PM +0100, Karol Lewandowski wrote: Reorganize driver a bit to better handle device tree-based systems: - move machine type to driver's private structure instead of quering platform device variants in runtime - replace s3c24xx_i2c_type enum with unsigned int that holds bitmask with revision-specific quirks Signed-off-by: Karol Lewandowski k.lewando...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com Okay, so this driver needs to the 'data' field from either platform_device_id or of_device_id and implements a function for that, namely s3c24xx_get_device_quirks(). Grant, Rob: I'd think there might be more drivers in need of that, so maybe it makes sense to have a generic of-helper function? --- drivers/i2c/busses/i2c-s3c2410.c | 47 ++--- 1 files changed, 23 insertions(+), 24 deletions(-) diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 85e3664..f7b6a14 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -44,8 +44,14 @@ #include plat/regs-iic.h #include plat/iic.h -/* i2c controller state */ +#ifdef CONFIG_OF +static const struct of_device_id s3c24xx_i2c_match[]; +#endif Uh, forward declaration with #ifdef. I'd think we should get this simply to the front. dd +/* Treat S3C2410 as baseline hardware, anything else is supported via quirks */ +#define QUIRK_S3C2440(1 0) Minor: Is it really a quirk being s3c2440? Maybe FLAG_*, dunno. + +/* i2c controller state */ enum s3c24xx_i2c_state { STATE_IDLE, STATE_START, @@ -54,14 +60,10 @@ enum s3c24xx_i2c_state { STATE_STOP }; -enum s3c24xx_i2c_type { - TYPE_S3C2410, - TYPE_S3C2440, -}; - struct s3c24xx_i2c { spinlock_t lock; wait_queue_head_t wait; + unsigned intquirks; unsigned intsuspended:1; struct i2c_msg *msg; @@ -88,26 +90,22 @@ struct s3c24xx_i2c { #endif }; -/* default platform data removed, dev should always carry data. */ - -/* s3c24xx_i2c_is2440() +/* s3c24xx_get_device_quirks * - * return true is this is an s3c2440 + * Get controller type either from device tree or platform device variant. */ -static inline int s3c24xx_i2c_is2440(struct s3c24xx_i2c *i2c) +static inline unsigned int s3c24xx_get_device_quirks(struct platform_device *pdev) { - struct platform_device *pdev = to_platform_device(i2c-dev); - enum s3c24xx_i2c_type type; - #ifdef CONFIG_OF - if (i2c-dev-of_node) - return of_device_is_compatible(i2c-dev-of_node, - samsung,s3c2440-i2c); +if (pdev-dev.of_node) { + const struct of_device_id *match; + match = of_match_node(s3c24xx_i2c_match[0], pdev-dev.of_node); Minor: I think it is more readable to drop the [0] + return (unsigned int)match-data; +} #endif - type = platform_get_device_id(pdev)-driver_data; - return type == TYPE_S3C2440; + return platform_get_device_id(pdev)-driver_data; } /* s3c24xx_i2c_master_complete @@ -676,7 +674,7 @@ static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got) writel(iiccon, i2c-regs + S3C2410_IICCON); - if (s3c24xx_i2c_is2440(i2c)) { + if (i2c-quirks QUIRK_S3C2440) { unsigned long sda_delay; if (pdata-sda_delay) { @@ -906,6 +904,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) goto err_noclk; } + i2c-quirks = s3c24xx_get_device_quirks(pdev); if (pdata) memcpy(i2c-pdata, pdata, sizeof(*pdata)); else @@ -1113,18 +1112,18 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = { static struct platform_device_id s3c24xx_driver_ids[] = { { .name = s3c2410-i2c, - .driver_data= TYPE_S3C2410, + .driver_data= 0, }, { .name = s3c2440-i2c, - .driver_data= TYPE_S3C2440, + .driver_data= QUIRK_S3C2440, }, { }, }; MODULE_DEVICE_TABLE(platform, s3c24xx_driver_ids); #ifdef CONFIG_OF static const struct of_device_id s3c24xx_i2c_match[] = { - { .compatible = samsung,s3c2410-i2c }, - { .compatible = samsung,s3c2440-i2c }, + { .compatible = samsung,s3c2410-i2c, .data = (void *)0 }, + { .compatible = samsung,s3c2440-i2c, .data = (void *)QUIRK_S3C2440 }, Hmm, the need to sepcify the quirks twice may lead to only one instance being updated in future patches, but I don't see a way around that, currently :( {}, }; MODULE_DEVICE_TABLE(of, s3c24xx_i2c_match); -- 1.7.9 Thanks, Wolfram -- Pengutronix e.K. | Wolfram Sang|
Re: [PATCH 3/3] i2c-s3c2410: Add HDMIPHY quirk for S3C2440
Hi, On Wed, Mar 21, 2012 at 08:11:53PM +0100, Karol Lewandowski wrote: This patch adds support for s3c2440 I2C bus controller dedicated HDMIPHY device on Exynos4 platform. Some quirks are introduced due to differences between HDMIPHY and other I2C controllers on Exynos4. These differences are: - no GPIOs, HDMIPHY is inside the SoC and the controller is connected internally - due to unknown reason (probably HW bug in HDMIPHY and/or the controller) a transfer fails to finish. The controller hangs after sending the last byte, the workaround for this bug is resetting the controller after each transfer Signed-off-by: Tomasz Stanislawski t.stanisl...@samsung.com Signed-off-by: Karol Lewandowski k.lewando...@samsung.com Tested-by: Tomasz Stanislawski t.stanisl...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- .../devicetree/bindings/i2c/samsung-i2c.txt| 11 +- drivers/i2c/busses/i2c-s3c2410.c | 35 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/i2c/samsung-i2c.txt b/Documentation/devicetree/bindings/i2c/samsung-i2c.txt index 38832c7..c6670f9 100644 --- a/Documentation/devicetree/bindings/i2c/samsung-i2c.txt +++ b/Documentation/devicetree/bindings/i2c/samsung-i2c.txt @@ -10,14 +10,21 @@ Required properties: region. - interrupts: interrupt number to the cpu. - samsung,i2c-sda-delay: Delay (in ns) applied to data line (SDA) edges. - - gpios: The order of the gpios should be the following: SDA, SCL. -The gpio specifier depends on the gpio controller. Optional properties: + - gpios: The order of the gpios should be the following: SDA, SCL. +The gpio specifier depends on the gpio controller. Required in all cases +except when samsung,i2c-no-gpio is also specified. + - samsung,i2c-no-gpio: input/output lines of the controller are +permanently wired to the respective client, there are no gpio +lines that need to be configured to enable this controller Can't we just skip this property... - samsung,i2c-slave-addr: Slave address in multi-master enviroment. If not specified, default value is 0. - samsung,i2c-max-bus-freq: Desired frequency in Hz of the bus. If not specified, the default value in Hz is 10. + - samsung,i2c-quirk-hdmiphy: Quirk for HDMI PHY block found on +Exynos4 platform - reduce timeout and reset controller after each +transfer ... and this one, if we declare a new compatible-entry for exynos4? Example: diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index f7b6a14..e50f523 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -50,6 +50,8 @@ static const struct of_device_id s3c24xx_i2c_match[]; /* Treat S3C2410 as baseline hardware, anything else is supported via quirks */ #define QUIRK_S3C2440(1 0) +#define QUIRK_HDMIPHY(1 1) +#define QUIRK_NO_GPIO(1 2) /* i2c controller state */ enum s3c24xx_i2c_state { @@ -469,6 +471,13 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c *i2c) unsigned long iicstat; int timeout = 400; + /* the timeout for HDMIPHY is reduced to 10 ms because + * the hangup is expected to happen, so waiting 400 ms + * causes only unnecessary system hangup + */ + if (i2c-quirks QUIRK_HDMIPHY) + timeout = 10; + while (timeout-- 0) { iicstat = readl(i2c-regs + S3C2410_IICSTAT); @@ -478,6 +487,15 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c *i2c) msleep(1); } + /* hang-up of bus dedicated for HDMIPHY occurred, resetting */ + if (i2c-quirks QUIRK_HDMIPHY) { + writel(0, i2c-regs + S3C2410_IICCON); + writel(0, i2c-regs + S3C2410_IICSTAT); + writel(0, i2c-regs + S3C2410_IICDS); + + return 0; + } + return -ETIMEDOUT; } @@ -759,6 +777,9 @@ static int s3c24xx_i2c_parse_dt_gpio(struct s3c24xx_i2c *i2c) { int idx, gpio, ret; + if (i2c-quirks QUIRK_NO_GPIO) + return 0; + for (idx = 0; idx 2; idx++) { gpio = of_get_gpio(i2c-dev-of_node, idx); if (!gpio_is_valid(gpio)) { @@ -783,6 +804,10 @@ free_gpio: static void s3c24xx_i2c_dt_gpio_free(struct s3c24xx_i2c *i2c) { unsigned int idx; + + if (i2c-quirks QUIRK_NO_GPIO) + return; + for (idx = 0; idx 2; idx++) gpio_free(i2c-gpios[idx]); } @@ -859,6 +884,13 @@ s3c24xx_i2c_parse_dt(struct device_node *np, struct s3c24xx_i2c *i2c) return; pdata-bus_num = -1; /* i2c bus number is dynamically assigned */ + + if (of_get_property(np, samsung,i2c-quirk-hdmiphy, NULL)) +
Re: [PATCH v4 1/2] mfd: add irq domain support for max8997 interrupts
On 31 March 2012 03:36, Grant Likely grant.lik...@secretlab.ca wrote: On Sat, 24 Mar 2012 15:19:49 +0530, Thomas Abraham thomas.abra...@linaro.org wrote: Add irq domain support for max8997 interrupts. The reverse mapping method used is linear mapping since the sub-drivers of max8997 such as regulator and charger drivers can use the max8997 irq_domain to get the linux irq number for max8997 interrupts. All uses of irq_base in platform data and max8997 driver private data are removed. Cc: MyungJoo Ham myungjoo@samsung.com Signed-off-by: Thomas Abraham thomas.abra...@linaro.org Acked-by: Grant Likely grant.lik...@secretlab.ca --- arch/arm/mach-exynos/mach-nuri.c | 4 -- arch/arm/mach-exynos/mach-origen.c | 1 - drivers/mfd/max8997-irq.c | 61 -- drivers/mfd/max8997.c | 1 - include/linux/mfd/max8997-private.h | 4 ++- include/linux/mfd/max8997.h | 1 - 6 files changed, 39 insertions(+), 33 deletions(-) diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c index 7ac81ce..b21d85d 100644 --- a/arch/arm/mach-exynos/mach-nuri.c +++ b/arch/arm/mach-exynos/mach-nuri.c @@ -1077,12 +1077,8 @@ static struct platform_device nuri_max8903_device = { static void __init nuri_power_init(void) { int gpio; - int irq_base = IRQ_GPIO_END + 1; int ta_en = 0; - nuri_max8997_pdata.irq_base = irq_base; - irq_base += MAX8997_IRQ_NR; - gpio = EXYNOS4_GPX0(7); gpio_request(gpio, AP_PMIC_IRQ); s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c index 827cb99..d3b2e9d 100644 --- a/arch/arm/mach-exynos/mach-origen.c +++ b/arch/arm/mach-exynos/mach-origen.c @@ -424,7 +424,6 @@ static struct max8997_platform_data __initdata origen_max8997_pdata = { .buck1_gpiodvs = false, .buck2_gpiodvs = false, .buck5_gpiodvs = false, - .irq_base = IRQ_GPIO_END + 1, .ignore_gpiodvs_side_effect = true, .buck125_default_idx = 0x0, diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c index 09274cf..00390a1 100644 --- a/drivers/mfd/max8997-irq.c +++ b/drivers/mfd/max8997-irq.c @@ -142,7 +142,8 @@ static void max8997_irq_sync_unlock(struct irq_data *data) static const inline struct max8997_irq_data * irq_to_max8997_irq(struct max8997_dev *max8997, int irq) { - return max8997_irqs[irq - max8997-irq_base]; + struct irq_data *data = irq_get_irq_data(irq); + return max8997_irqs[data-hwirq]; } Haha, this is kind of bogus now. There are only two users of this function, and *both* of them already have the irq_data pointer. Instead of this, delete this function entirely and make each caller derefernce max8997_irqs directly: const struct max8997_irq_data *irq_data = max8997_irqs[data-hwirq]; Otherwise, looks good. After fixing you can add my: Acked-by: Grant Likely grant.lik...@secretlab.ca Hi Grant, Thanks for the suggestion. I have modified the code accordingly and included your ack. Regards, 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 2/2] regulator: add device tree support for max8997
On 28 March 2012 22:33, Karol Lewandowski k.lewando...@samsung.com wrote: On 24.03.2012 10:49, Thomas Abraham wrote: Hi Thomas! Add device tree based discovery support for max8997. ... +Regulators: The regulators of max8997 that have to be instantiated should be +included in a sub-node named 'regulators'. Regulator nodes included in this +sub-node should be of the format as below. Note: The 'n' in LDOn and BUCKn +represents the LDO or BUCK number as per the datasheet of max8997. + + For LDO's: + LDOn { + standard regulator bindings here + }; + + For BUCK's: + BUCKn { + standard regulator bindings here + }; + Small note - driver supports[1] configuring following regulators by using respective DT node names: - EN32KHz_AP - EN32KHz_CP - ENVICHG - ESAFEOUT1 - ESAFEOUT2 - CHARGER - CHARGER_CV - CHARGER_TOPOFF I wonder if these should be mentioned in documentation too. [1] These are used in e.g. mach-nuri.c Yes, I missed the above regulators in the documentation. I have included them now and will resubmit this patch. diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 9657929..dce8aaf 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c .. +static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, + struct max8997_platform_data *pdata) +{ + struct device_node *pmic_np, *regulators_np, *reg_np; + struct max8997_regulator_data *rdata; + unsigned int i, dvs_voltage_nr = 1, ret; + + pmic_np = iodev-dev-of_node; + if (!pmic_np) { + dev_err(iodev-dev, could not find pmic sub-node\n); + return -ENODEV; + } + + regulators_np = of_find_node_by_name(pmic_np, regulators); + if (!regulators_np) { + dev_err(iodev-dev, could not find regulators sub-node\n); + return -EINVAL; + } + + /* count the number of regulators to be supported in pmic */ + pdata-num_regulators = 0; + for_each_child_of_node(regulators_np, reg_np) + pdata-num_regulators++; + + rdata = devm_kzalloc(iodev-dev, sizeof(*rdata) * + pdata-num_regulators, GFP_KERNEL); + if (!rdata) { + dev_err(iodev-dev, could not allocate memory for + regulator data\n); + return -ENOMEM; + } + pdata-regulators = rdata; + for_each_child_of_node(regulators_np, reg_np) { + for (i = 0; i ARRAY_SIZE(regulators); i++) + if (!of_node_cmp(reg_np-name, regulators[i].name)) + break; + rdata-id = i; rdata-id will be equal to ARRAY_SIZE(regulators) when one adds DT node name (below regulators) which is different from what can be found in regulators[] table. On my test machine this results in hard lockup - possibly because something tries to access regulators[ARRAY_SIZE(regulators)] later on. Following patch fixes this on my machine (using DTS with misspelled LDO1 for LDx1): diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index dce8aaf..c20fd72 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c @@ -1011,6 +1011,13 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, for (i = 0; i ARRAY_SIZE(regulators); i++) if (!of_node_cmp(reg_np-name, regulators[i].name)) break; + + if (i == ARRAY_SIZE(regulators)) { + dev_warn(iodev-dev, don't know how to configure regulator %s\n, + reg_np-name); + continue; + } + rdata-id = i; rdata-initdata = of_get_regulator_init_data( iodev-dev, reg_np); Thanks for this fix. I have merged this change into this patch. Regards, Thomas. Regards, -- Karol Lewandowski | Samsung Poland RD Center | Linux/Platform -- 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 2/2] regulator: add device tree support for max8997
On Wed, Apr 18, 2012 at 12:05:59AM +0530, Thomas Abraham wrote: On 28 March 2012 22:33, Karol Lewandowski k.lewando...@samsung.com wrote: + For BUCK's: No 's here, BTW. - EN32KHz_AP - EN32KHz_CP - ENVICHG - ESAFEOUT1 - ESAFEOUT2 - CHARGER - CHARGER_CV - CHARGER_TOPOFF I wonder if these should be mentioned in documentation too. Yes, I missed the above regulators in the documentation. I have included them now and will resubmit this patch. Please omit the clocks; these are obviously a bodge due to the inability to support clocks off-SoC so we shouldn't be enshrining them in the device tree bindings. signature.asc Description: Digital signature
[PATCH] ARM: SAMSUNG: Should check for IS_ERR(clk) instead of NULL
From: Jonghwan Choi jhbird.c...@samsung.com On the error condition clk_get() returns ERR_PTR(). Signed-off-by: Jonghwan Choi jhbird.c...@samsung.com --- .../arm/plat-samsung/include/plat/watchdog-reset.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/plat-samsung/include/plat/watchdog-reset.h b/arch/arm/plat-samsung/include/plat/watchdog-reset.h index f19aff1..bc4db9b 100644 --- a/arch/arm/plat-samsung/include/plat/watchdog-reset.h +++ b/arch/arm/plat-samsung/include/plat/watchdog-reset.h @@ -25,7 +25,7 @@ static inline void arch_wdt_reset(void) __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ - if (s3c2410_wdtclk) + if (!IS_ERR(s3c2410_wdtclk)) clk_enable(s3c2410_wdtclk); /* put initial values into count and data */ -- 1.7.0.4 -- 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: EXYNOS: add the definition for IRQ_DWMCI
In dev-dwmci.c, IRQ_DWMCI is referenced. But there is no defined anywhere. This patch is added the missing definition for IRQ_DWMCI. Signed-off-by: Jaehoon Chung jh80.ch...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- arch/arm/mach-exynos/include/mach/irqs.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-exynos/include/mach/irqs.h b/arch/arm/mach-exynos/include/mach/irqs.h index 1161675..ed2295f 100644 --- a/arch/arm/mach-exynos/include/mach/irqs.h +++ b/arch/arm/mach-exynos/include/mach/irqs.h @@ -201,6 +201,7 @@ #define IRQ_HSMMC1 EXYNOS4_IRQ_HSMMC1 #define IRQ_HSMMC2 EXYNOS4_IRQ_HSMMC2 #define IRQ_HSMMC3 EXYNOS4_IRQ_HSMMC3 +#define IRQ_DWMCI EXYNOS4_IRQ_DWMCI #define IRQ_MIPI_CSIS0 EXYNOS4_IRQ_MIPI_CSIS0 -- 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