Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231417
b: refs/heads/master
c: 8cf460a
h: refs/heads/master
i:
  231415: 2b63351
v: v3
  • Loading branch information
Kukjin Kim committed Dec 30, 2010
1 parent ede9cd3 commit a4f5835
Show file tree
Hide file tree
Showing 43 changed files with 234 additions and 1,266 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57ca51514905b7aea532977e4e87e989d33bfcbb
refs/heads/master: 8cf460a5d7c12e16ba29d0e4940df4657a7439cc
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-s3c64xx/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ static struct clksrc_clk clksrcs[] = {
}, {
.clk = {
.name = "audio-bus",
.id = 2,
.id = -1, /* There's only one IISv4 port */
.ctrlbit = S3C6410_CLKCON_SCLK_AUDIO2,
.enable = s3c64xx_sclk_ctrl,
},
Expand Down
60 changes: 26 additions & 34 deletions trunk/arch/arm/mach-s3c64xx/dev-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@
#include <plat/audio.h>
#include <plat/gpio-cfg.h>

static const char *rclksrc[] = {
[0] = "iis",
[1] = "audio-bus",
};

static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev)
static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev)
{
unsigned int base;

Expand All @@ -38,12 +33,6 @@ static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev)
case 1:
base = S3C64XX_GPE(0);
break;
case 2:
s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5));
s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5));
s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5));
s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(5));
return 0;
default:
printk(KERN_DEBUG "Invalid I2S Controller number: %d\n",
pdev->id);
Expand All @@ -55,6 +44,16 @@ static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev)
return 0;
}

static int s3c64xx_i2sv4_cfg_gpio(struct platform_device *pdev)
{
s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5));
s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5));
s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5));
s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(5));

return 0;
}

static struct resource s3c64xx_iis0_resource[] = {
[0] = {
.start = S3C64XX_PA_IIS0,
Expand All @@ -73,22 +72,17 @@ static struct resource s3c64xx_iis0_resource[] = {
},
};

static struct s3c_audio_pdata i2sv3_pdata = {
.cfg_gpio = s3c64xx_i2s_cfg_gpio,
.type = {
.i2s = {
.src_clk = rclksrc,
},
},
static struct s3c_audio_pdata s3c_i2s0_pdata = {
.cfg_gpio = s3c64xx_i2sv3_cfg_gpio,
};

struct platform_device s3c64xx_device_iis0 = {
.name = "samsung-i2s",
.name = "s3c64xx-iis",
.id = 0,
.num_resources = ARRAY_SIZE(s3c64xx_iis0_resource),
.resource = s3c64xx_iis0_resource,
.dev = {
.platform_data = &i2sv3_pdata,
.platform_data = &s3c_i2s0_pdata,
},
};
EXPORT_SYMBOL(s3c64xx_device_iis0);
Expand All @@ -111,13 +105,17 @@ static struct resource s3c64xx_iis1_resource[] = {
},
};

static struct s3c_audio_pdata s3c_i2s1_pdata = {
.cfg_gpio = s3c64xx_i2sv3_cfg_gpio,
};

struct platform_device s3c64xx_device_iis1 = {
.name = "samsung-i2s",
.name = "s3c64xx-iis",
.id = 1,
.num_resources = ARRAY_SIZE(s3c64xx_iis1_resource),
.resource = s3c64xx_iis1_resource,
.dev = {
.platform_data = &i2sv3_pdata,
.platform_data = &s3c_i2s1_pdata,
},
};
EXPORT_SYMBOL(s3c64xx_device_iis1);
Expand All @@ -140,23 +138,17 @@ static struct resource s3c64xx_iisv4_resource[] = {
},
};

static struct s3c_audio_pdata i2sv4_pdata = {
.cfg_gpio = s3c64xx_i2s_cfg_gpio,
.type = {
.i2s = {
.quirks = QUIRK_PRI_6CHAN,
.src_clk = rclksrc,
},
},
static struct s3c_audio_pdata s3c_i2sv4_pdata = {
.cfg_gpio = s3c64xx_i2sv4_cfg_gpio,
};

struct platform_device s3c64xx_device_iisv4 = {
.name = "samsung-i2s",
.id = 2,
.name = "s3c64xx-iis-v4",
.id = -1,
.num_resources = ARRAY_SIZE(s3c64xx_iisv4_resource),
.resource = s3c64xx_iisv4_resource,
.dev = {
.platform_data = &i2sv4_pdata,
.platform_data = &s3c_i2sv4_pdata,
},
};
EXPORT_SYMBOL(s3c64xx_device_iisv4);
Expand Down
37 changes: 18 additions & 19 deletions trunk/arch/arm/mach-s3c64xx/irq-eint.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,41 +30,41 @@
#include <plat/pm.h>

#define eint_offset(irq) ((irq) - IRQ_EINT(0))
#define eint_irq_to_bit(irq) ((u32)(1 << eint_offset(irq)))
#define eint_irq_to_bit(irq) (1 << eint_offset(irq))

static inline void s3c_irq_eint_mask(struct irq_data *data)
static inline void s3c_irq_eint_mask(unsigned int irq)
{
u32 mask;

mask = __raw_readl(S3C64XX_EINT0MASK);
mask |= (u32)data->chip_data;
mask |= eint_irq_to_bit(irq);
__raw_writel(mask, S3C64XX_EINT0MASK);
}

static void s3c_irq_eint_unmask(struct irq_data *data)
static void s3c_irq_eint_unmask(unsigned int irq)
{
u32 mask;

mask = __raw_readl(S3C64XX_EINT0MASK);
mask &= ~((u32)data->chip_data);
mask &= ~eint_irq_to_bit(irq);
__raw_writel(mask, S3C64XX_EINT0MASK);
}

static inline void s3c_irq_eint_ack(struct irq_data *data)
static inline void s3c_irq_eint_ack(unsigned int irq)
{
__raw_writel((u32)data->chip_data, S3C64XX_EINT0PEND);
__raw_writel(eint_irq_to_bit(irq), S3C64XX_EINT0PEND);
}

static void s3c_irq_eint_maskack(struct irq_data *data)
static void s3c_irq_eint_maskack(unsigned int irq)
{
/* compiler should in-line these */
s3c_irq_eint_mask(data);
s3c_irq_eint_ack(data);
s3c_irq_eint_mask(irq);
s3c_irq_eint_ack(irq);
}

static int s3c_irq_eint_set_type(struct irq_data *data, unsigned int type)
static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
{
int offs = eint_offset(data->irq);
int offs = eint_offset(irq);
int pin, pin_val;
int shift;
u32 ctrl, mask;
Expand Down Expand Up @@ -140,12 +140,12 @@ static int s3c_irq_eint_set_type(struct irq_data *data, unsigned int type)

static struct irq_chip s3c_irq_eint = {
.name = "s3c-eint",
.irq_mask = s3c_irq_eint_mask,
.irq_unmask = s3c_irq_eint_unmask,
.irq_mask_ack = s3c_irq_eint_maskack,
.irq_ack = s3c_irq_eint_ack,
.irq_set_type = s3c_irq_eint_set_type,
.irq_set_wake = s3c_irqext_wake,
.mask = s3c_irq_eint_mask,
.unmask = s3c_irq_eint_unmask,
.mask_ack = s3c_irq_eint_maskack,
.ack = s3c_irq_eint_ack,
.set_type = s3c_irq_eint_set_type,
.set_wake = s3c_irqext_wake,
};

/* s3c_irq_demux_eint
Expand Down Expand Up @@ -198,7 +198,6 @@ static int __init s3c64xx_init_irq_eint(void)

for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) {
set_irq_chip(irq, &s3c_irq_eint);
set_irq_chip_data(irq, (void *)eint_irq_to_bit(irq));
set_irq_handler(irq, handle_level_irq);
set_irq_flags(irq, IRQF_VALID);
}
Expand Down
44 changes: 7 additions & 37 deletions trunk/arch/arm/mach-s5p6442/dev-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static int s5p6442_cfg_i2s(struct platform_device *pdev)
base = S5P6442_GPC1(0);
break;

case 0:
case -1:
base = S5P6442_GPC0(0);
break;

Expand All @@ -42,19 +42,8 @@ static int s5p6442_cfg_i2s(struct platform_device *pdev)
return 0;
}

static const char *rclksrc_v35[] = {
[0] = "busclk",
[1] = "i2sclk",
};

static struct s3c_audio_pdata i2sv35_pdata = {
static struct s3c_audio_pdata s3c_i2s_pdata = {
.cfg_gpio = s5p6442_cfg_i2s,
.type = {
.i2s = {
.quirks = QUIRK_SEC_DAI | QUIRK_NEED_RSTCLR,
.src_clk = rclksrc_v35,
},
},
};

static struct resource s5p6442_iis0_resource[] = {
Expand All @@ -73,34 +62,15 @@ static struct resource s5p6442_iis0_resource[] = {
.end = DMACH_I2S0_RX,
.flags = IORESOURCE_DMA,
},
[3] = {
.start = DMACH_I2S0S_TX,
.end = DMACH_I2S0S_TX,
.flags = IORESOURCE_DMA,
},
};

struct platform_device s5p6442_device_iis0 = {
.name = "samsung-i2s",
.id = 0,
.name = "s3c64xx-iis-v4",
.id = -1,
.num_resources = ARRAY_SIZE(s5p6442_iis0_resource),
.resource = s5p6442_iis0_resource,
.dev = {
.platform_data = &i2sv35_pdata,
},
};

static const char *rclksrc_v3[] = {
[0] = "iis",
[1] = "sclk_audio",
};

static struct s3c_audio_pdata i2sv3_pdata = {
.cfg_gpio = s5p6442_cfg_i2s,
.type = {
.i2s = {
.src_clk = rclksrc_v3,
},
.platform_data = &s3c_i2s_pdata,
},
};

Expand All @@ -123,12 +93,12 @@ static struct resource s5p6442_iis1_resource[] = {
};

struct platform_device s5p6442_device_iis1 = {
.name = "samsung-i2s",
.name = "s3c64xx-iis",
.id = 1,
.num_resources = ARRAY_SIZE(s5p6442_iis1_resource),
.resource = s5p6442_iis1_resource,
.dev = {
.platform_data = &i2sv3_pdata,
.platform_data = &s3c_i2s_pdata,
},
};

Expand Down
10 changes: 0 additions & 10 deletions trunk/arch/arm/mach-s5p6442/mach-smdk6442.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/types.h>
#include <linux/init.h>
#include <linux/serial_core.h>
#include <linux/i2c.h>

#include <asm/mach/arch.h>
#include <asm/mach/map.h>
Expand All @@ -26,7 +25,6 @@
#include <plat/s5p6442.h>
#include <plat/devs.h>
#include <plat/cpu.h>
#include <plat/iic.h>

/* Following are default values for UCON, ULCON and UFCON UART registers */
#define SMDK6442_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
Expand Down Expand Up @@ -67,15 +65,10 @@ static struct s3c2410_uartcfg smdk6442_uartcfgs[] __initdata = {
};

static struct platform_device *smdk6442_devices[] __initdata = {
&s3c_device_i2c0,
&s5p6442_device_iis0,
&s3c_device_wdt,
};

static struct i2c_board_info smdk6442_i2c_devs0[] __initdata = {
{ I2C_BOARD_INFO("wm8580", 0x1b), },
};

static void __init smdk6442_map_io(void)
{
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
Expand All @@ -85,9 +78,6 @@ static void __init smdk6442_map_io(void)

static void __init smdk6442_machine_init(void)
{
s3c_i2c0_set_platdata(NULL);
i2c_register_board_info(0, smdk6442_i2c_devs0,
ARRAY_SIZE(smdk6442_i2c_devs0));
platform_add_devices(smdk6442_devices, ARRAY_SIZE(smdk6442_devices));
}

Expand Down
5 changes: 1 addition & 4 deletions trunk/arch/arm/mach-s5p6442/setup-i2c0.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@

#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/gpio.h>

struct platform_device; /* don't need the contents */

#include <plat/gpio-cfg.h>
#include <plat/iic.h>

void s3c_i2c0_cfg_gpio(struct platform_device *dev)
{
s3c_gpio_cfgall_range(S5P6442_GPD1(0), 2,
S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
/* Will be populated later */
}
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-s5p64x0/clock-s5p6440.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static struct clk init_clocks_disable[] = {
.enable = s5p64x0_pclk_ctrl,
.ctrlbit = (1 << 25),
}, {
.name = "iis",
.name = "i2s_v40",
.id = 0,
.parent = &clk_pclk_low.clk,
.enable = s5p64x0_pclk_ctrl,
Expand Down
14 changes: 1 addition & 13 deletions trunk/arch/arm/mach-s5p64x0/clock-s5p6450.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,22 +256,10 @@ static struct clk init_clocks_disable[] = {
.ctrlbit = (1 << 22),
}, {
.name = "iis",
.id = 0,
.id = -1,
.parent = &clk_pclk_low.clk,
.enable = s5p64x0_pclk_ctrl,
.ctrlbit = (1 << 26),
}, {
.name = "iis",
.id = 1,
.parent = &clk_pclk_low.clk,
.enable = s5p64x0_pclk_ctrl,
.ctrlbit = (1 << 15),
}, {
.name = "iis",
.id = 2,
.parent = &clk_pclk_low.clk,
.enable = s5p64x0_pclk_ctrl,
.ctrlbit = (1 << 16),
}, {
.name = "i2c",
.id = 1,
Expand Down
Loading

0 comments on commit a4f5835

Please sign in to comment.