aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-kzm9g.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile/board-kzm9g.c')
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c83
1 files changed, 83 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index d8e33b682832..c06d04b11b0e 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -33,6 +33,8 @@
33#include <linux/smsc911x.h> 33#include <linux/smsc911x.h>
34#include <linux/usb/r8a66597.h> 34#include <linux/usb/r8a66597.h>
35#include <linux/videodev2.h> 35#include <linux/videodev2.h>
36#include <sound/sh_fsi.h>
37#include <sound/simple_card.h>
36#include <mach/irqs.h> 38#include <mach/irqs.h>
37#include <mach/sh73a0.h> 39#include <mach/sh73a0.h>
38#include <mach/common.h> 40#include <mach/common.h>
@@ -54,6 +56,14 @@
54#define GPIO_PCF8575_PORT15 (GPIO_NR + 13) 56#define GPIO_PCF8575_PORT15 (GPIO_NR + 13)
55#define GPIO_PCF8575_PORT16 (GPIO_NR + 14) 57#define GPIO_PCF8575_PORT16 (GPIO_NR + 14)
56 58
59/*
60 * FSI-AK4648
61 *
62 * this command is required when playback.
63 *
64 * # amixer set "LINEOUT Mixer DACL" on
65 */
66
57/* SMSC 9221 */ 67/* SMSC 9221 */
58static struct resource smsc9221_resources[] = { 68static struct resource smsc9221_resources[] = {
59 [0] = { 69 [0] = {
@@ -267,11 +277,73 @@ static struct platform_device gpio_keys_device = {
267 }, 277 },
268}; 278};
269 279
280/* FSI-AK4648 */
281static struct sh_fsi_platform_info fsi_info = {
282 .port_a = {
283 },
284};
285
286static struct resource fsi_resources[] = {
287 [0] = {
288 .name = "FSI",
289 .start = 0xEC230000,
290 .end = 0xEC230400 - 1,
291 .flags = IORESOURCE_MEM,
292 },
293 [1] = {
294 .start = gic_spi(146),
295 .flags = IORESOURCE_IRQ,
296 },
297};
298
299static struct platform_device fsi_device = {
300 .name = "sh_fsi2",
301 .id = -1,
302 .num_resources = ARRAY_SIZE(fsi_resources),
303 .resource = fsi_resources,
304 .dev = {
305 .platform_data = &fsi_info,
306 },
307};
308
309static struct asoc_simple_dai_init_info fsi2_ak4648_init_info = {
310 .fmt = SND_SOC_DAIFMT_LEFT_J,
311 .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
312 .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
313 .sysclk = 11289600,
314};
315
316static struct asoc_simple_card_info fsi2_ak4648_info = {
317 .name = "AK4648",
318 .card = "FSI2A-AK4648",
319 .cpu_dai = "fsia-dai",
320 .codec = "ak4642-codec.0-0012",
321 .platform = "sh_fsi2",
322 .codec_dai = "ak4642-hifi",
323 .init = &fsi2_ak4648_init_info,
324};
325
326static struct platform_device fsi_ak4648_device = {
327 .name = "asoc-simple-card",
328 .dev = {
329 .platform_data = &fsi2_ak4648_info,
330 },
331};
332
270/* I2C */ 333/* I2C */
271static struct pcf857x_platform_data pcf8575_pdata = { 334static struct pcf857x_platform_data pcf8575_pdata = {
272 .gpio_base = GPIO_PCF8575_BASE, 335 .gpio_base = GPIO_PCF8575_BASE,
273}; 336};
274 337
338static struct i2c_board_info i2c0_devices[] = {
339 {
340 I2C_BOARD_INFO("ak4648", 0x12),
341 },
342 {
343 I2C_BOARD_INFO("r2025sd", 0x32),
344 }
345};
346
275static struct i2c_board_info i2c1_devices[] = { 347static struct i2c_board_info i2c1_devices[] = {
276 { 348 {
277 I2C_BOARD_INFO("st1232-ts", 0x55), 349 I2C_BOARD_INFO("st1232-ts", 0x55),
@@ -293,6 +365,8 @@ static struct platform_device *kzm_devices[] __initdata = {
293 &mmc_device, 365 &mmc_device,
294 &sdhi0_device, 366 &sdhi0_device,
295 &gpio_keys_device, 367 &gpio_keys_device,
368 &fsi_device,
369 &fsi_ak4648_device,
296}; 370};
297 371
298/* 372/*
@@ -431,11 +505,19 @@ static void __init kzm_init(void)
431 gpio_request(GPIO_FN_PORT27_I2C_SCL3, NULL); 505 gpio_request(GPIO_FN_PORT27_I2C_SCL3, NULL);
432 gpio_request(GPIO_FN_PORT28_I2C_SDA3, NULL); 506 gpio_request(GPIO_FN_PORT28_I2C_SDA3, NULL);
433 507
508 /* enable FSI2 port A (ak4648) */
509 gpio_request(GPIO_FN_FSIACK, NULL);
510 gpio_request(GPIO_FN_FSIAILR, NULL);
511 gpio_request(GPIO_FN_FSIAIBT, NULL);
512 gpio_request(GPIO_FN_FSIAISLD, NULL);
513 gpio_request(GPIO_FN_FSIAOSLD, NULL);
514
434#ifdef CONFIG_CACHE_L2X0 515#ifdef CONFIG_CACHE_L2X0
435 /* Early BRESP enable, Shared attribute override enable, 64K*8way */ 516 /* Early BRESP enable, Shared attribute override enable, 64K*8way */
436 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff); 517 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
437#endif 518#endif
438 519
520 i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices));
439 i2c_register_board_info(1, i2c1_devices, ARRAY_SIZE(i2c1_devices)); 521 i2c_register_board_info(1, i2c1_devices, ARRAY_SIZE(i2c1_devices));
440 i2c_register_board_info(3, i2c3_devices, ARRAY_SIZE(i2c3_devices)); 522 i2c_register_board_info(3, i2c3_devices, ARRAY_SIZE(i2c3_devices));
441 523
@@ -455,6 +537,7 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g")
455 .init_irq = sh73a0_init_irq, 537 .init_irq = sh73a0_init_irq,
456 .handle_irq = gic_handle_irq, 538 .handle_irq = gic_handle_irq,
457 .init_machine = kzm_init, 539 .init_machine = kzm_init,
540 .init_late = shmobile_init_late,
458 .timer = &shmobile_timer, 541 .timer = &shmobile_timer,
459 .dt_compat = kzm9g_boards_compat_dt, 542 .dt_compat = kzm9g_boards_compat_dt,
460MACHINE_END 543MACHINE_END