From 9adb15b80bf1dc6b30a584e76efc876dfd029a13 Mon Sep 17 00:00:00 2001 From: Thomas Abraham Date: Tue, 8 Sep 2009 14:26:00 +0900 Subject: ARM: S3C6410: use correct divider_shift in setrate_clksrc() In s3c64xx_setrate_clksrc() we used sclk->shift, but actually need to use sclk->divider_shift to correctly calculate the value for the divider register. Signed-off-by: Thomas Abraham [ben-linux@fluff.org: Minor re-indentation of description] Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/s3c6400-clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/plat-s3c64xx') diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c index febac1950d8e..c972d2f8c271 100644 --- a/arch/arm/plat-s3c64xx/s3c6400-clock.c +++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c @@ -302,8 +302,8 @@ static int s3c64xx_setrate_clksrc(struct clk *clk, unsigned long rate) return -EINVAL; val = __raw_readl(reg); - val &= ~(0xf << sclk->shift); - val |= (div - 1) << sclk->shift; + val &= ~(0xf << sclk->divider_shift); + val |= (div - 1) << sclk->divider_shift; __raw_writel(val, reg); return 0; -- cgit v1.2.3 From 6d025ac2fcf9d736ee399efddae74a3362dfa7da Mon Sep 17 00:00:00 2001 From: Thomas Abraham Date: Tue, 8 Sep 2009 14:30:48 +0900 Subject: ARM: S3C6410: update clk->parent when setting clock source This ensures the clock hierarchy data structures are updated when we change the clock source in the actual hardware registers. Signed-off-by: Thomas Abraham [ben-linux@fluff.org: Minor re-indentation of subject] Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/s3c6400-clock.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm/plat-s3c64xx') diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c index c972d2f8c271..54eef9326c21 100644 --- a/arch/arm/plat-s3c64xx/s3c6400-clock.c +++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c @@ -328,6 +328,8 @@ static int s3c64xx_setparent_clksrc(struct clk *clk, struct clk *parent) clksrc |= src_nr << sclk->shift; __raw_writel(clksrc, S3C_CLK_SRC); + + clk->parent = parent; return 0; } -- cgit v1.2.3 From 5e49bc4d9e982bbfdaf7d6cf8bd96e43bd9f7db6 Mon Sep 17 00:00:00 2001 From: Thomas Abraham Date: Tue, 8 Sep 2009 14:35:29 +0900 Subject: ARM: S3C64XX: Fix divider value calculation in s3c64xx_roundrate_clksrc In s3c64xx_roundrate_clksrc function, the calculation is wrong. This patch fixes this calculation. Signed-off-by: Thomas Abraham Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/s3c6400-clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/plat-s3c64xx') diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c index 54eef9326c21..9745852261e0 100644 --- a/arch/arm/plat-s3c64xx/s3c6400-clock.c +++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c @@ -345,7 +345,7 @@ static unsigned long s3c64xx_roundrate_clksrc(struct clk *clk, if (rate > parent_rate) rate = parent_rate; else { - div = rate / parent_rate; + div = parent_rate / rate; if (div == 0) div = 1; -- cgit v1.2.3 From 23c94b47be85207a8a9e0ac3ac89b16edf6356f0 Mon Sep 17 00:00:00 2001 From: Jassi Date: Tue, 15 Sep 2009 19:01:18 +0900 Subject: ARM: S3C64XX: DMA: struct s3c64xx_dma_buff lli fix. Correct the lli structure in struct s3c64xx_dma_buff which should have been 'struct pl080s_lli' (samsung specific) instead of the generic version 'struct pl080_lli' Signed-Off-by: Jassi [ben-linux@fluff.org: Edited description and subject fields] Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/include/plat/dma-plat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/plat-s3c64xx') diff --git a/arch/arm/plat-s3c64xx/include/plat/dma-plat.h b/arch/arm/plat-s3c64xx/include/plat/dma-plat.h index 0c30dd986725..8f76a1e474d6 100644 --- a/arch/arm/plat-s3c64xx/include/plat/dma-plat.h +++ b/arch/arm/plat-s3c64xx/include/plat/dma-plat.h @@ -26,7 +26,7 @@ struct s3c64xx_dma_buff { struct s3c64xx_dma_buff *next; void *pw; - struct pl080_lli *lli; + struct pl080s_lli *lli; dma_addr_t lli_dma; }; -- cgit v1.2.3 From 3ea61e49223c499c705b80ea385cb4df9c08da21 Mon Sep 17 00:00:00 2001 From: Jassi Date: Tue, 15 Sep 2009 19:01:19 +0900 Subject: ARM: S3C64XX: DMA: 'size' argument of dma_pool_create Provide actual minimum(struct pl080s_lli) size of block to dma_pool_create call, instead of hardcoded 32 bytes. Signed-Off-by: Jassi Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/plat-s3c64xx') diff --git a/arch/arm/plat-s3c64xx/dma.c b/arch/arm/plat-s3c64xx/dma.c index 67aa93dbb69e..b26d2a242d9e 100644 --- a/arch/arm/plat-s3c64xx/dma.c +++ b/arch/arm/plat-s3c64xx/dma.c @@ -697,7 +697,7 @@ static int __init s3c64xx_dma_init(void) printk(KERN_INFO "%s: Registering DMA channels\n", __func__); - dma_pool = dma_pool_create("DMA-LLI", NULL, 32, 16, 0); + dma_pool = dma_pool_create("DMA-LLI", NULL, sizeof(struct pl080s_lli), 16, 0); if (!dma_pool) { printk(KERN_ERR "%s: failed to create pool\n", __func__); return -ENOMEM; -- cgit v1.2.3 From b93011e72c1476b08ff62977ecf648080ba38c1a Mon Sep 17 00:00:00 2001 From: Jassi Date: Tue, 15 Sep 2009 19:01:20 +0900 Subject: ARM: S3C64XX: DMA: Debugged alloc's with GFP_KERNEL flag in Intr context. s3c2410_dma_enqueue makes call to kzalloc and dma_pool_alloc with GFP_KERNEL flag set, this can be an issue for drivers, like I2S, which call s3c2410_dma_enqueue from dma-bufferdone callback. Change the flag GFP_KERNEL to GFP_ATOMIC to avoid any problems. Signed-Off-by: Jassi [ben-linux@fluff.org: Minor description edit and re-wrap] Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/plat-s3c64xx') diff --git a/arch/arm/plat-s3c64xx/dma.c b/arch/arm/plat-s3c64xx/dma.c index b26d2a242d9e..266a10745a85 100644 --- a/arch/arm/plat-s3c64xx/dma.c +++ b/arch/arm/plat-s3c64xx/dma.c @@ -345,13 +345,13 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id, if (!chan) return -EINVAL; - buff = kzalloc(sizeof(struct s3c64xx_dma_buff), GFP_KERNEL); + buff = kzalloc(sizeof(struct s3c64xx_dma_buff), GFP_ATOMIC); if (!buff) { printk(KERN_ERR "%s: no memory for buffer\n", __func__); return -ENOMEM; } - lli = dma_pool_alloc(dma_pool, GFP_KERNEL, &buff->lli_dma); + lli = dma_pool_alloc(dma_pool, GFP_ATOMIC, &buff->lli_dma); if (!lli) { printk(KERN_ERR "%s: no memory for lli\n", __func__); ret = -ENOMEM; -- cgit v1.2.3 From ebdb5ab81c6b9fda130975d50fd6f43cb15c4ce6 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 6 Jul 2009 14:57:48 +0100 Subject: ARM: S3C64XX: Provide for board-specific IRQs Set up some IRQ space to allocation to off-SoC interrupt controllers. Default this to 16 IRQs. If individual boards require more than this then they will need to modify this file so allocating a small number helps reduce the number of modifications required. Signed-off-by: Mark Brown Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/include/plat/irqs.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'arch/arm/plat-s3c64xx') diff --git a/arch/arm/plat-s3c64xx/include/plat/irqs.h b/arch/arm/plat-s3c64xx/include/plat/irqs.h index 743a70094d04..7956fd3bb194 100644 --- a/arch/arm/plat-s3c64xx/include/plat/irqs.h +++ b/arch/arm/plat-s3c64xx/include/plat/irqs.h @@ -194,9 +194,17 @@ #define IRQ_EINT_GROUP(group, no) (IRQ_EINT_GROUP##group##_BASE + (no)) +/* Define a group of interrupts for board-specific use (eg, for MFD + * interrupt controllers). */ +#define IRQ_BOARD_START (IRQ_EINT_GROUP9_BASE + IRQ_EINT_GROUP9_NR + 1) + +#define IRQ_BOARD_NR 16 + +#define IRQ_BOARD_END (IRQ_BOARD_START + IRQ_BOARD_NR) + /* Set the default NR_IRQS */ -#define NR_IRQS (IRQ_EINT_GROUP9_BASE + IRQ_EINT_GROUP9_NR + 1) +#define NR_IRQS (IRQ_BOARD_END + 1) #endif /* __ASM_PLAT_S3C64XX_IRQS_H */ -- cgit v1.2.3