From e73486b8c9d8d649dd080eb1b810e5b0c11a955a Mon Sep 17 00:00:00 2001 From: Kukjin Kim Date: Wed, 23 Sep 2009 12:59:07 +0900 Subject: ARM: S3C64XX: Fix S3C64XX_CLKDIV0_ARM_MASK value Fix the values of S3C6400_CLKDIV0_ARM_MASK and S3C6410_CLKDIV0_ARM_MASK. Signed-off-by: Kukjin Kim Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/include/plat/regs-clock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h b/arch/arm/plat-s3c64xx/include/plat/regs-clock.h index a8777a755dfa..ff46e7fa957a 100644 --- a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h +++ b/arch/arm/plat-s3c64xx/include/plat/regs-clock.h @@ -51,8 +51,8 @@ #define S3C6400_CLKDIV0_HCLK_SHIFT (8) #define S3C6400_CLKDIV0_MPLL_MASK (0x1 << 4) #define S3C6400_CLKDIV0_MPLL_SHIFT (4) -#define S3C6400_CLKDIV0_ARM_MASK (0x3 << 0) -#define S3C6410_CLKDIV0_ARM_MASK (0x7 << 0) +#define S3C6400_CLKDIV0_ARM_MASK (0x7 << 0) +#define S3C6410_CLKDIV0_ARM_MASK (0xf << 0) #define S3C6400_CLKDIV0_ARM_SHIFT (0) /* CLKDIV1 */ -- cgit v1.2.3-59-g8ed1b From e179ac0f4ea4f1e989fa754bada366f88fd81d27 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Wed, 21 Oct 2009 18:17:58 +0100 Subject: ARM: S3C64XX: Set rate of crystal mux The current code assumes that the external clock mux will be set to the crystal. Set this up explicitly within the clock API. Signed-off-by: Mark Brown Signed-off-by: Ben Dooks --- arch/arm/plat-s3c64xx/s3c6400-clock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c index 9745852261e0..6ffa21eb1b91 100644 --- a/arch/arm/plat-s3c64xx/s3c6400-clock.c +++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c @@ -677,6 +677,9 @@ void __init_or_cpufreq s3c6400_setup_clocks(void) printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal); + /* For now assume the mux always selects the crystal */ + clk_ext_xtal_mux.parent = xtal_clk; + epll = s3c6400_get_epll(xtal); mpll = s3c6400_get_pll(xtal, __raw_readl(S3C_MPLL_CON)); apll = s3c6400_get_pll(xtal, __raw_readl(S3C_APLL_CON)); -- cgit v1.2.3-59-g8ed1b From e3d8024891dbfec6cf36c9b76177650f48118462 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 22 Sep 2009 16:48:56 +0100 Subject: ARM: S3C: Add info for supporting circular DMA buffers The S3C64XX DMA implementation will work a lot better with the ability to enqueue circular buffers as the hardware can do it's own linked-list management. Add a function s3c_dma_has_circular() to show that the system can do this and a flag for the channel. Update the s3c24xx/s3c64xx I2S DMA code to deal with this. Signed-off-by: Ben Dooks Signed-off-by: Ben Dooks Acked-by: Mark Brown --- arch/arm/mach-s3c2410/include/mach/dma.h | 7 +++++++ arch/arm/mach-s3c6400/include/mach/dma.h | 5 +++++ sound/soc/s3c24xx/s3c24xx-pcm.c | 17 +++++++++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-s3c2410/include/mach/dma.h b/arch/arm/mach-s3c2410/include/mach/dma.h index c3a2629e0ded..92e2687009ea 100644 --- a/arch/arm/mach-s3c2410/include/mach/dma.h +++ b/arch/arm/mach-s3c2410/include/mach/dma.h @@ -110,6 +110,8 @@ enum s3c2410_dma_loadst { * waiting for reloads */ #define S3C2410_DMAF_AUTOSTART (1<<1) /* auto-start if buffer queued */ +#define S3C2410_DMAF_CIRCULAR (1 << 2) /* no circular dma support */ + /* dma buffer */ struct s3c2410_dma_buf; @@ -194,4 +196,9 @@ struct s3c2410_dma_chan { typedef unsigned long dma_device_t; +static inline bool s3c_dma_has_circular(void) +{ + return false; +} + #endif /* __ASM_ARCH_DMA_H */ diff --git a/arch/arm/mach-s3c6400/include/mach/dma.h b/arch/arm/mach-s3c6400/include/mach/dma.h index 1067619f0ba0..004edab23954 100644 --- a/arch/arm/mach-s3c6400/include/mach/dma.h +++ b/arch/arm/mach-s3c6400/include/mach/dma.h @@ -68,6 +68,11 @@ static __inline__ int s3c_dma_has_circular(void) #define S3C2410_DMAF_CIRCULAR (1 << 0) +static inline bool s3c_dma_has_circular(void) +{ + return false; +} + #include #endif /* __ASM_ARCH_IRQ_H */ diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c index 5cbbdc80fde3..1f35c6fcf5fd 100644 --- a/sound/soc/s3c24xx/s3c24xx-pcm.c +++ b/sound/soc/s3c24xx/s3c24xx-pcm.c @@ -75,11 +75,19 @@ static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream) { struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; dma_addr_t pos = prtd->dma_pos; + unsigned int limit; int ret; pr_debug("Entered %s\n", __func__); - while (prtd->dma_loaded < prtd->dma_limit) { + if (s3c_dma_has_circular()) { + limit = (prtd->dma_end - prtd->dma_start) / prtd->dma_period; + } else + limit = prtd->dma_limit; + + pr_debug("%s: loaded %d, limit %d\n", __func__, prtd->dma_loaded, limit); + + while (prtd->dma_loaded < limit) { unsigned long len = prtd->dma_period; pr_debug("dma_loaded: %d\n", prtd->dma_loaded); @@ -123,7 +131,7 @@ static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel, snd_pcm_period_elapsed(substream); spin_lock(&prtd->lock); - if (prtd->state & ST_RUNNING) { + if (prtd->state & ST_RUNNING && !s3c_dma_has_circular()) { prtd->dma_loaded--; s3c24xx_pcm_enqueue(substream); } @@ -164,6 +172,11 @@ static int s3c24xx_pcm_hw_params(struct snd_pcm_substream *substream, printk(KERN_ERR "failed to get dma channel\n"); return ret; } + + /* use the circular buffering if we have it available. */ + if (s3c_dma_has_circular()) + s3c2410_dma_setflags(prtd->params->channel, + S3C2410_DMAF_CIRCULAR); } s3c2410_dma_set_buffdone_fn(prtd->params->channel, -- cgit v1.2.3-59-g8ed1b From b4719cd62707ca6f1a4d55b89066a7b9acc72347 Mon Sep 17 00:00:00 2001 From: Ramax Lo Date: Tue, 22 Sep 2009 00:04:16 +0800 Subject: ARM: S3C24XX: Define a macro to avoid compilation error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Define a macro to avoid the following error during kernel build process for platforms other than s3c2410: arch/arm/plat-s3c24xx/cpu.c:84: error: ‘s3c2410a_init’ undeclared here (not in a function) Signed-off-by: Ramax Lo Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/include/plat/s3c2410.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h b/arch/arm/plat-s3c24xx/include/plat/s3c2410.h index b6deeef8f663..82ab4aad1bbe 100644 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h +++ b/arch/arm/plat-s3c24xx/include/plat/s3c2410.h @@ -27,6 +27,7 @@ extern void s3c2410_init_clocks(int xtal); #define s3c2410_init_uarts NULL #define s3c2410_map_io NULL #define s3c2410_init NULL +#define s3c2410a_init NULL #endif extern int s3c2410_baseclk_add(void); -- cgit v1.2.3-59-g8ed1b From f5fb9b1a15285fde54c6b70cf35d328333e5b519 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 22 Sep 2009 21:40:39 +0100 Subject: ARM: S3C24XX: Introduce S3C2442B CPU Add the S3C2442B CPU ID to aid support the Openmoko GTA02 / Freerunner. Signed-off-by: Harald Welte Signed-off-by: Andy Green Signed-off-by: Nelson Castillo [ben-linux@fluff.org: edit description for clarity and S3C2442B as uppercase] Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/cpu.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c index 5447e60f3936..4af9dd948793 100644 --- a/arch/arm/plat-s3c24xx/cpu.c +++ b/arch/arm/plat-s3c24xx/cpu.c @@ -61,6 +61,7 @@ static const char name_s3c2410[] = "S3C2410"; static const char name_s3c2412[] = "S3C2412"; static const char name_s3c2440[] = "S3C2440"; static const char name_s3c2442[] = "S3C2442"; +static const char name_s3c2442b[] = "S3C2442B"; static const char name_s3c2443[] = "S3C2443"; static const char name_s3c2410a[] = "S3C2410A"; static const char name_s3c2440a[] = "S3C2440A"; @@ -111,6 +112,15 @@ static struct cpu_table cpu_ids[] __initdata = { .init = s3c2442_init, .name = name_s3c2442 }, + { + .idcode = 0x32440aab, + .idmask = 0xffffffff, + .map_io = s3c244x_map_io, + .init_clocks = s3c244x_init_clocks, + .init_uarts = s3c244x_init_uarts, + .init = s3c2442_init, + .name = name_s3c2442b + }, { .idcode = 0x32412001, .idmask = 0xffffffff, -- cgit v1.2.3-59-g8ed1b From 2e31de6511a47738974d6b48fdc60c4f82f80d24 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Wed, 14 Oct 2009 10:13:22 +0100 Subject: ARM: S3C2410: Fix link if CONFIG_S3C2410_IOTIMING is not set Fix the link errors if cpu-frequency support is enabled on s3c2410 systems but there is no CONFIG_S3C2410_IOTIMING set. Fix this by ensuring the relevant symbols are defined NULL if the code is not being built in. Fixes the following error: arch/arm/mach-s3c2410/built-in.o: undefined reference to `s3c2410_iotiming_get' arch/arm/mach-s3c2410/built-in.o: undefined reference to `s3c2410_iotiming_set' arch/arm/mach-s3c2410/built-in.o: undefined reference to `s3c2410_iotiming_calc' Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h index efeb025affc7..c776120b99e6 100644 --- a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h +++ b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h @@ -222,7 +222,9 @@ extern struct clk *s3c_cpufreq_clk_get(struct device *, const char *); /* S3C2410 and compatible exported functions */ extern void s3c2410_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg); +extern void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg); +#ifdef CONFIG_S3C2410_IOTIMING extern int s3c2410_iotiming_calc(struct s3c_cpufreq_config *cfg, struct s3c_iotimings *iot); @@ -231,8 +233,11 @@ extern int s3c2410_iotiming_get(struct s3c_cpufreq_config *cfg, extern void s3c2410_iotiming_set(struct s3c_cpufreq_config *cfg, struct s3c_iotimings *iot); - -extern void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg); +#else +#define s3c2410_iotiming_calc NULL +#define s3c2410_iotiming_get NULL +#define s3c2410_iotiming_set NULL +#endif /* CONFIG_S3C2410_IOTIMING */ /* S3C2412 compatible routines */ -- cgit v1.2.3-59-g8ed1b From d3bf3956c75b38def079fb6db40b5cf3f1466a93 Mon Sep 17 00:00:00 2001 From: Ryan Mallon Date: Wed, 14 Oct 2009 09:18:30 +1300 Subject: ARM: S3C: Fix adc function exports Fix the export of s3c_adc_read. Signed-off-by: Ryan Mallon [ben-linux@fluff.org: remove unexport of s3c_adc_start, needed for ts] Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/plat-s3c24xx/adc.c b/arch/arm/plat-s3c24xx/adc.c index 4d36b784fb8b..df47322492d5 100644 --- a/arch/arm/plat-s3c24xx/adc.c +++ b/arch/arm/plat-s3c24xx/adc.c @@ -189,7 +189,7 @@ int s3c_adc_read(struct s3c_adc_client *client, unsigned int ch) err: return ret; } -EXPORT_SYMBOL_GPL(s3c_adc_convert); +EXPORT_SYMBOL_GPL(s3c_adc_read); static void s3c_adc_default_select(struct s3c_adc_client *client, unsigned select) -- cgit v1.2.3-59-g8ed1b From 60e5c1b5ecd99e06d3133a2a20d58d3c2b9968ac Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Sat, 17 Oct 2009 08:42:49 +0200 Subject: ARM: S3C24XX: arch/arm/plat-s3c24xx: Move dereference after NULL test If the NULL test on buf is needed, then the dereference should be after the NULL test. A simplified version of the semantic match that detects this problem is as follows (http://coccinelle.lip6.fr/): // @match exists@ expression x, E; identifier fld; @@ * x->fld ... when != \(x = E\|&x\) * x == NULL // Signed-off-by: Julia Lawall Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/dma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c index 196b19123653..f046f8c51084 100644 --- a/arch/arm/plat-s3c24xx/dma.c +++ b/arch/arm/plat-s3c24xx/dma.c @@ -208,14 +208,14 @@ s3c2410_dma_loadbuffer(struct s3c2410_dma_chan *chan, { unsigned long reload; - pr_debug("s3c2410_chan_loadbuffer: loading buff %p (0x%08lx,0x%06x)\n", - buf, (unsigned long)buf->data, buf->size); - if (buf == NULL) { dmawarn("buffer is NULL\n"); return -EINVAL; } + pr_debug("s3c2410_chan_loadbuffer: loading buff %p (0x%08lx,0x%06x)\n", + buf, (unsigned long)buf->data, buf->size); + /* check the state of the channel before we do anything */ if (chan->load_state == S3C2410_DMALOAD_1LOADED) { -- cgit v1.2.3-59-g8ed1b From 0bfb34f3a168ee598164803ab3147dd41fc3f843 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Mon, 26 Oct 2009 20:37:21 +0000 Subject: ARM: S3C2440: mini2440: Fix missing CONFIG_S3C_DEV_USB_HOST Fix missing select of S3C_DEV_USB_HOST when building for mini2440 only. Fixes the following error: built-in.o: undefined reference to `s3c_device_usb` Signed-off-by: Ben Dooks --- arch/arm/mach-s3c2440/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig index d7bba919a77e..a8b69d77571b 100644 --- a/arch/arm/mach-s3c2440/Kconfig +++ b/arch/arm/mach-s3c2440/Kconfig @@ -103,6 +103,7 @@ config MACH_MINI2440 select LEDS_TRIGGER_BACKLIGHT select SND_S3C24XX_SOC_S3C24XX_UDA134X select S3C_DEV_NAND + select S3C_DEV_USB_HOST help Say Y here to select support for the MINI2440. Is a 10cm x 10cm board available via various sources. It can come with a 3.5" or 7" touch LCD. -- cgit v1.2.3-59-g8ed1b From 365854af7e393591d980998dec350b6d9ee695ee Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Mon, 26 Oct 2009 21:17:15 +0000 Subject: ARM: S3C24XX: Fix warnings in arch/arm/plat-s3c24xx/gpio.c Fix the following warnings from sparse in arch/arm/plat-s3c24xx/gpio. due to the missing include of gpio.c:36:6: warning: symbol 's3c2410_gpio_cfgpin' was not declared. Should it be static? gpio.c:84:14: warning: symbol 's3c2410_gpio_getcfg' was not declared. Should it be static? gpio.c:103:6: warning: symbol 's3c2410_gpio_pullup' was not declared. Should it be static? gpio.c:125:5: warning: symbol 's3c2410_gpio_getpull' was not declared. Should it be static? gpio.c:138:6: warning: symbol 's3c2410_gpio_setpin' was not declared. Should it be static? gpio.c:157:14: warning: symbol 's3c2410_gpio_getpin' was not declared. Should it be static? gpio.c:184:5: warning: symbol 's3c2410_gpio_getirq' was not declared. Should it be static? Signed-off-by: Ben Dooks --- arch/arm/plat-s3c24xx/gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c index 95df059b5a1d..5467470badfd 100644 --- a/arch/arm/plat-s3c24xx/gpio.c +++ b/arch/arm/plat-s3c24xx/gpio.c @@ -29,6 +29,7 @@ #include #include +#include #include #include -- cgit v1.2.3-59-g8ed1b From 0070994783cc7953416cf5da2e190c05edb01391 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Mon, 26 Oct 2009 21:19:27 +0000 Subject: ARM: S3C2440: mini2440: Fix spare warnings Fix the following sparse warnings in arch/arm/mach-s3c2440/mach-mini2440.c due to missing 'static'. warning: symbol 'mini2440_lcd_cfg' was not declared. Should it be static? warning: symbol 'mini2440_fb_info' was not declared. Should it be static? Signed-off-by: Ben Dooks --- arch/arm/mach-s3c2440/mach-mini2440.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c index ec71a6965786..1c3382fefdd2 100644 --- a/arch/arm/mach-s3c2440/mach-mini2440.c +++ b/arch/arm/mach-s3c2440/mach-mini2440.c @@ -144,7 +144,7 @@ static struct s3c2410_udc_mach_info mini2440_udc_cfg __initdata = { .type = (S3C2410_LCDCON1_TFT16BPP |\ S3C2410_LCDCON1_TFT) -struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = { +static struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = { [0] = { /* mini2440 + 3.5" TFT + touchscreen */ _LCD_DECLARE( 7, /* The 3.5 is quite fast */ @@ -191,7 +191,7 @@ struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = { #define S3C2410_GPCCON_MASK(x) (3 << ((x) * 2)) #define S3C2410_GPDCON_MASK(x) (3 << ((x) * 2)) -struct s3c2410fb_mach_info mini2440_fb_info __initdata = { +static struct s3c2410fb_mach_info mini2440_fb_info __initdata = { .displays = &mini2440_lcd_cfg[0], /* not constant! see init */ .num_displays = 1, .default_display = 0, -- cgit v1.2.3-59-g8ed1b From 620abe28776d8cec0a275fac25e254c1f0bc1c73 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Mon, 26 Oct 2009 21:21:32 +0000 Subject: ARM: S3C2410: Fix sparse warnings in arch/arm/mach-s3c2410/gpio.c Fix sparse warning in arch/arm/mach-s3c2410/gpio.c due to missing include of . Fixes the following warning: warning: symbol 's3c2410_gpio_irqfilter' was not declared. Should it be static? Signed-off-by: Ben Dooks --- arch/arm/mach-s3c2410/gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-s3c2410/gpio.c b/arch/arm/mach-s3c2410/gpio.c index 7974afca297c..9664e011dae2 100644 --- a/arch/arm/mach-s3c2410/gpio.c +++ b/arch/arm/mach-s3c2410/gpio.c @@ -28,6 +28,7 @@ #include #include +#include #include #include -- cgit v1.2.3-59-g8ed1b