Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e641d158 authored by Kukjin Kim's avatar Kukjin Kim
Browse files

Merge branch 'next-samsung-asoc2' into for-next-new

parents 387c31c7 d8a2d39d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -695,7 +695,7 @@ static struct clksrc_clk clksrcs[] = {
	}, {
		.clk	= {
			.name		= "audio-bus",
			.id		= -1,  /* There's only one IISv4 port */
			.id		= 2,
			.ctrlbit        = S3C6410_CLKCON_SCLK_AUDIO2,
			.enable		= s3c64xx_sclk_ctrl,
		},
+34 −26
Original line number Diff line number Diff line
@@ -22,7 +22,12 @@
#include <plat/audio.h>
#include <plat/gpio-cfg.h>

static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev)
static const char *rclksrc[] = {
	[0] = "iis",
	[1] = "audio-bus",
};

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

@@ -33,6 +38,12 @@ static int s3c64xx_i2sv3_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);
@@ -44,16 +55,6 @@ static int s3c64xx_i2sv3_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,
@@ -72,17 +73,22 @@ static struct resource s3c64xx_iis0_resource[] = {
	},
};

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

struct platform_device s3c64xx_device_iis0 = {
	.name		  = "s3c64xx-iis",
	.name		  = "samsung-i2s",
	.id		  = 0,
	.num_resources	  = ARRAY_SIZE(s3c64xx_iis0_resource),
	.resource	  = s3c64xx_iis0_resource,
	.dev = {
		.platform_data = &s3c_i2s0_pdata,
		.platform_data = &i2sv3_pdata,
	},
};
EXPORT_SYMBOL(s3c64xx_device_iis0);
@@ -105,17 +111,13 @@ 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		  = "s3c64xx-iis",
	.name		  = "samsung-i2s",
	.id		  = 1,
	.num_resources	  = ARRAY_SIZE(s3c64xx_iis1_resource),
	.resource	  = s3c64xx_iis1_resource,
	.dev = {
		.platform_data = &s3c_i2s1_pdata,
		.platform_data = &i2sv3_pdata,
	},
};
EXPORT_SYMBOL(s3c64xx_device_iis1);
@@ -138,17 +140,23 @@ static struct resource s3c64xx_iisv4_resource[] = {
	},
};

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

struct platform_device s3c64xx_device_iisv4 = {
	.name		  = "s3c64xx-iis-v4",
	.id		  = -1,
	.name = "samsung-i2s",
	.id = 2,
	.num_resources	  = ARRAY_SIZE(s3c64xx_iisv4_resource),
	.resource	  = s3c64xx_iisv4_resource,
	.dev = {
		.platform_data = &s3c_i2sv4_pdata,
		.platform_data = &i2sv4_pdata,
	},
};
EXPORT_SYMBOL(s3c64xx_device_iisv4);
+37 −7
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ static int s5p6442_cfg_i2s(struct platform_device *pdev)
		base = S5P6442_GPC1(0);
		break;

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

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

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

static struct s3c_audio_pdata i2sv35_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[] = {
@@ -62,15 +73,34 @@ 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		  = "s3c64xx-iis-v4",
	.id		  = -1,
	.name = "samsung-i2s",
	.id = 0,
	.num_resources	  = ARRAY_SIZE(s5p6442_iis0_resource),
	.resource	  = s5p6442_iis0_resource,
	.dev = {
		.platform_data = &s3c_i2s_pdata,
		.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,
		},
	},
};

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

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

+10 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#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>
@@ -25,6 +26,7 @@
#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 |	\
@@ -65,10 +67,15 @@ 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);
@@ -78,6 +85,9 @@ 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));
}

+4 −1
Original line number Diff line number Diff line
@@ -14,12 +14,15 @@

#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)
{
	/* Will be populated later */
	s3c_gpio_cfgall_range(S5P6442_GPD1(0), 2,
			      S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
}
Loading