ARM: S3C24XX: Define a macro to avoid compilation error
Subsystems (5)
PATCH 1/12 ARM: S3C24XX: Define a macro to avoid compilation error
From: Ramax Lo <[email protected]>
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)
--- arch/arm/plat-s3c24xx/include/plat/s3c2410.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/plat-s3c24xx/include/plat/s3c2410.h +1 -0
@@ -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 );
Signature · 1 line
1.6.3.3
PATCH 1/12 ARM: S3C24XX: Define a macro to avoid compilation error
This series should have had the following prefix:
S3C64XX/S3C24XX fixes based on -rc5.
shortlog:
Ben Dooks (9):
ARM: S3C2410: Fix link if CONFIG_S3C2410_IOTIMING is not set
ARM: S3C: Add info for supporting circular DMA buffers Merge branch 'fixes-s3c24xx' into fixes-s3c
Merge branch 'fixes-s3c64xx-dma' into fixes-s3c
Merge branch 'fixes-s3c64xx' into fixes-s3c
ARM: S3C2440: mini2440: Fix missing CONFIG_S3C_DEV_USB_HOST
ARM: S3C24XX: Fix warnings in arch/arm/plat-s3c24xx/gpio.c
ARM: S3C2440: mini2440: Fix spare warnings
ARM: S3C2410: Fix sparse warnings in arch/arm/mach-s3c2410/gpio.c
Harald Welte (1):
ARM: S3C24XX: Introduce S3C2442B CPU
Julia Lawall (1):
ARM: S3C24XX: arch/arm/plat-s3c24xx: Move dereference after NULL test
Kukjin Kim (1):
ARM: S3C64XX: Fix S3C64XX_CLKDIV0_ARM_MASK value
Mark Brown (1):
ARM: S3C64XX: Set rate of crystal mux
Ramax Lo (1):
ARM: S3C24XX: Define a macro to avoid compilation error
Ryan Mallon (1):
ARM: S3C: Fix adc function exports
arch/arm/mach-s3c2410/gpio.c | 1 + arch/arm/mach-s3c2410/include/mach/dma.h | 7 +++++++ arch/arm/mach-s3c2440/Kconfig | 1 + arch/arm/mach-s3c2440/mach-mini2440.c | 4 ++-- arch/arm/mach-s3c6400/include/mach/dma.h | 5 +++++ arch/arm/plat-s3c24xx/adc.c | 2 +- arch/arm/plat-s3c24xx/cpu.c | 10 ++++++++++ arch/arm/plat-s3c24xx/dma.c | 6 +++--- arch/arm/plat-s3c24xx/gpio.c | 1 + arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h | 9 +++++++-- arch/arm/plat-s3c24xx/include/plat/s3c2410.h | 1 + arch/arm/plat-s3c64xx/include/plat/regs-clock.h | 4 ++-- arch/arm/plat-s3c64xx/s3c6400-clock.c | 3 +++ sound/soc/s3c24xx/s3c24xx-pcm.c | 17 +++++++++++++++-- 14 files changed, 59 insertions(+), 12 deletions(-)
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 2/12 ARM: S3C24XX: Introduce S3C2442B CPU
In reply to Ben DooksFrom: Harald Welte <[email protected]>
Add the S3C2442B CPU ID to aid support the Openmoko GTA02 / Freerunner.
--- arch/arm/plat-s3c24xx/cpu.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
arch/arm/plat-s3c24xx/cpu.c +10 -0
@@ -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" ;
@@ -112,6 +113,15 @@ static struct cpu_table cpu_ids[] __initdata = { .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, .map_io = s3c2412_map_io,
Signature · 1 line
1.6.3.3
PATCH 2/12 ARM: S3C24XX: Introduce S3C2442B CPU
Quoted 26 lines · Ben Dooks
From: Harald Welte <[email protected]>
Add the S3C2442B CPU ID to aid support the Openmoko GTA02 / Freerunner.
Signed-off-by Harald Welte <[email protected]>Signed-off-by Andy Green <[email protected]>Signed-off-by Nelson Castillo <[email protected]>[ben-linux at fluff.org: edit description for clarity and S3C2442B as uppercase]Signed-off-by Ben Dooks <[email protected]>--- arch/arm/plat-s3c24xx/cpu.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)arch/arm/plat-s3c24xx/cpu.c +1
-0@@ -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" ;
arch/arm/plat-s3c24xx/cpu.c static struct cpu_table cpu_ids[] __initdata = { · line 122
Quoted 10 lines
arch/arm/plat-s3c24xx/cpu.c +7
-0@@ -112,6 +113,15 @@ static struct cpu_table cpu_ids[] __initdata = { .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
Could we simply put the string here? This is unneccessary obfuscation... and it is used just once so it does not save anything...
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
PATCH 3/12 ARM: S3C2410: Fix link if CONFIG_S3C2410_IOTIMING is not set
In reply to Ben DooksFix 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'
--- arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h +7 -2
@@ -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 */
Signature · 1 line
1.6.3.3
PATCH 4/12 ARM: S3C: Fix adc function exports
In reply to Ben DooksFrom: Ryan Mallon <[email protected]>
Fix the export of s3c_adc_read.
--- arch/arm/plat-s3c24xx/adc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/plat-s3c24xx/adc.c +1 -1
@@ -188,7 +188,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)
Signature · 1 line
1.6.3.3
PATCH 5/12 ARM: S3C24XX: arch/arm/plat-s3c24xx: Move dereference after NULL test
In reply to Ben DooksFrom: Julia Lawall <[email protected]>
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/):
// <smpl>
@match exists@
expression x, E;
identifier fld;
@@
* x->fld
... when != \(x = E\|&x\)
* x == NULL
// </smpl>
--- arch/arm/plat-s3c24xx/dma.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/plat-s3c24xx/dma.c +3 -3
@@ -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 ) {
Signature · 1 line
1.6.3.3
PATCH 6/12 ARM: S3C64XX: Fix S3C64XX_CLKDIV0_ARM_MASK value
In reply to Ben DooksFrom: Kukjin Kim <[email protected]>
Fix the values of S3C6400_CLKDIV0_ARM_MASK and S3C6410_CLKDIV0_ARM_MASK.
--- arch/arm/plat-s3c64xx/include/plat/regs-clock.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-s3c64xx/include/plat/regs-clock.h +2 -2
@@ -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 */
Signature · 1 line
1.6.3.3
PATCH 7/12 ARM: S3C64XX: Set rate of crystal mux
In reply to Ben DooksFrom: Mark Brown <[email protected]>
The current code assumes that the external clock mux will be set to the crystal. Set this up explicitly within the clock API.
--- arch/arm/plat-s3c64xx/s3c6400-clock.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/plat-s3c64xx/s3c6400-clock.c +3 -0
@@ -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 ));
Signature · 1 line
1.6.3.3
PATCH 8/12 ARM: S3C: Add info for supporting circular DMA buffers
In reply to Ben DooksThe 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.
--- 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(-)
arch/arm/mach-s3c2410/include/mach/dma.h +7 -0
@@ -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 */
arch/arm/mach-s3c6400/include/mach/dma.h +5 -0
@@ -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 <plat/dma.h> #endif /* __ASM_ARCH_IRQ_H */
sound/soc/s3c24xx/s3c24xx-pcm.c +15 -2
@@ -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,
Signature · 1 line
1.6.3.3
PATCH 8/12 ARM: S3C: Add info for supporting circular DMA buffers
Quoted 4 lines · Ben Dooks
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.
Quoted 8 lines
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 <[email protected]>Signed-off-by Ben Dooks <[email protected]>CC Mark Brown <broonie@@opensource.wolfsonmicro.com>
If Samsung are going to be doing their upstreaming stuff it may make sense to merge this via ASoC since I anticipate some changes there, but on the other hand that seems to have ground to a halt and the merge may well go smoothly anyway. My standard answer here would be putting the patch on a branch by itself so if there are any issues it can be merged into both trees to avoid the merge issues.
PATCH 8/12 ARM: S3C: Add info for supporting circular DMA buffers
Quoted 5 lines · Mark Brown
Quoted 3 lines · Ben Dooks
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.
Quoted 8 lines
Acked-by Mark Brown <[email protected]>If Samsung are going to be doing their upstreaming stuff it may make sense to merge this via ASoC since I anticipate some changes there, but on the other hand that seems to have ground to a halt and the merge may well go smoothly anyway. My standard answer here would be putting the patch on a branch by itself so if there are any issues it can be merged into both trees to avoid the merge issues.
I was pushing this up via my tree, it touches both the core and ASoC code so decided to merge myself and copy-you.
On the whole Samsung merging, there is still work in progress there so we will see what is going to happen.
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 8/12 ARM: S3C: Add info for supporting circular DMA buffers
Quoted 2 lines · Ben Dooks
I was pushing this up via my tree, it touches both the core and ASoC code so decided to merge myself and copy-you.
Like I say, if you could put it on a branch I could pull in if need be in the case of merge conflicts that'd be ideal.
Quoted 2 lines
On the whole Samsung merging, there is still work in progress there so we will see what is going to happen.
The general trend appears to be moving away from upstream as far as I can see; public activity has certainly been dying down.
PATCH 9/12 ARM: S3C2440: mini2440: Fix missing CONFIG_S3C_DEV_USB_HOST
In reply to Ben DooksFix 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
--- arch/arm/mach-s3c2440/Kconfig | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2440/Kconfig +1 -0
@@ -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.
Signature · 1 line
1.6.3.3
PATCH 10/12 ARM: S3C24XX: Fix warnings in arch/arm/plat-s3c24xx/gpio.c
In reply to Ben DooksFix the following warnings from sparse in arch/arm/plat-s3c24xx/gpio. due to the missing include of <mach/gpio-fns.h>
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?
--- arch/arm/plat-s3c24xx/gpio.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/plat-s3c24xx/gpio.c +1 -0
@@ -29,6 +29,7 @@#include <linux/io.h> #include <mach/hardware.h> +#include <mach/gpio-fns.h> #include <asm/irq.h> #include <mach/regs-gpio.h>
Signature · 1 line
1.6.3.3
PATCH 11/12 ARM: S3C2440: mini2440: Fix spare warnings
In reply to Ben DooksFix 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?
--- arch/arm/mach-s3c2440/mach-mini2440.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-s3c2440/mach-mini2440.c +2 -2
@@ -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 ,
Signature · 1 line
1.6.3.3
PATCH 12/12 ARM: S3C2410: Fix sparse warnings in arch/arm/mach-s3c2410/gpio.c
In reply to Ben DooksFix sparse warning in arch/arm/mach-s3c2410/gpio.c due to missing include of <mach/gpio-fns.h>. Fixes the following warning:
warning: symbol 's3c2410_gpio_irqfilter' was not declared. Should it be static?
--- arch/arm/mach-s3c2410/gpio.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/gpio.c +1 -0
@@ -28,6 +28,7 @@#include <linux/io.h> #include <mach/hardware.h> +#include <mach/gpio-fns.h> #include <asm/irq.h> #include <mach/regs-gpio.h>
Signature · 1 line
1.6.3.3