aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-shmobile/Kconfig1
-rw-r--r--arch/arm/mach-shmobile/board-lager.c100
2 files changed, 101 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 7e3f42bfaf6b..bcbd74c564a1 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -272,6 +272,7 @@ config MACH_LAGER
272 depends on ARCH_R8A7790 272 depends on ARCH_R8A7790
273 select USE_OF 273 select USE_OF
274 select MICREL_PHY if SH_ETH 274 select MICREL_PHY if SH_ETH
275 select SND_SOC_AK4642 if SND_SIMPLE_CARD
275 276
276config MACH_KOELSCH 277config MACH_KOELSCH
277 bool "Koelsch board" 278 bool "Koelsch board"
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index 6a7041f9afa6..e8242c552da1 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -20,6 +20,7 @@
20 20
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <linux/gpio_keys.h> 22#include <linux/gpio_keys.h>
23#include <linux/i2c.h>
23#include <linux/input.h> 24#include <linux/input.h>
24#include <linux/interrupt.h> 25#include <linux/interrupt.h>
25#include <linux/irq.h> 26#include <linux/irq.h>
@@ -52,6 +53,20 @@
52#include <linux/spi/flash.h> 53#include <linux/spi/flash.h>
53#include <linux/spi/rspi.h> 54#include <linux/spi/rspi.h>
54#include <linux/spi/spi.h> 55#include <linux/spi/spi.h>
56#include <sound/rcar_snd.h>
57#include <sound/simple_card.h>
58
59/*
60 * SSI-AK4643
61 *
62 * SW1: 1: AK4643
63 * 2: CN22
64 * 3: ADV7511
65 *
66 * this command is required when playback.
67 *
68 * # amixer set "LINEOUT Mixer DACL" on
69 */
55 70
56/* DU */ 71/* DU */
57static struct rcar_du_encoder_data lager_du_encoders[] = { 72static struct rcar_du_encoder_data lager_du_encoders[] = {
@@ -509,6 +524,77 @@ static const struct resource usbhs_phy_resources[] __initconst = {
509 DEFINE_RES_MEM(0xe6590100, 0x100), 524 DEFINE_RES_MEM(0xe6590100, 0x100),
510}; 525};
511 526
527/* I2C */
528static struct i2c_board_info i2c2_devices[] = {
529 {
530 I2C_BOARD_INFO("ak4643", 0x12),
531 }
532};
533
534/* Sound */
535static struct resource rsnd_resources[] __initdata = {
536 [RSND_GEN2_SCU] = DEFINE_RES_MEM(0xec500000, 0x1000),
537 [RSND_GEN2_ADG] = DEFINE_RES_MEM(0xec5a0000, 0x100),
538 [RSND_GEN2_SSIU] = DEFINE_RES_MEM(0xec540000, 0x1000),
539 [RSND_GEN2_SSI] = DEFINE_RES_MEM(0xec541000, 0x1280),
540};
541
542static struct rsnd_ssi_platform_info rsnd_ssi[] = {
543 RSND_SSI_SET(0, 0, gic_spi(370), RSND_SSI_PLAY),
544 RSND_SSI_SET(0, 0, gic_spi(371), RSND_SSI_CLK_PIN_SHARE),
545};
546
547static struct rsnd_scu_platform_info rsnd_scu[2] = {
548 /* no member at this point */
549};
550
551static struct rcar_snd_info rsnd_info = {
552 .flags = RSND_GEN2,
553 .ssi_info = rsnd_ssi,
554 .ssi_info_nr = ARRAY_SIZE(rsnd_ssi),
555 .scu_info = rsnd_scu,
556 .scu_info_nr = ARRAY_SIZE(rsnd_scu),
557};
558
559static struct asoc_simple_card_info rsnd_card_info = {
560 .name = "AK4643",
561 .card = "SSI01-AK4643",
562 .codec = "ak4642-codec.2-0012",
563 .platform = "rcar_sound",
564 .daifmt = SND_SOC_DAIFMT_LEFT_J,
565 .cpu_dai = {
566 .name = "rcar_sound",
567 .fmt = SND_SOC_DAIFMT_CBS_CFS,
568 },
569 .codec_dai = {
570 .name = "ak4642-hifi",
571 .fmt = SND_SOC_DAIFMT_CBM_CFM,
572 .sysclk = 11289600,
573 },
574};
575
576static void __init lager_add_rsnd_device(void)
577{
578 struct platform_device_info cardinfo = {
579 .parent = &platform_bus,
580 .name = "asoc-simple-card",
581 .id = -1,
582 .data = &rsnd_card_info,
583 .size_data = sizeof(struct asoc_simple_card_info),
584 .dma_mask = DMA_BIT_MASK(32),
585 };
586
587 i2c_register_board_info(2, i2c2_devices,
588 ARRAY_SIZE(i2c2_devices));
589
590 platform_device_register_resndata(
591 &platform_bus, "rcar_sound", -1,
592 rsnd_resources, ARRAY_SIZE(rsnd_resources),
593 &rsnd_info, sizeof(rsnd_info));
594
595 platform_device_register_full(&cardinfo);
596}
597
512static const struct pinctrl_map lager_pinctrl_map[] = { 598static const struct pinctrl_map lager_pinctrl_map[] = {
513 /* DU (CN10: ARGB0, CN13: LVDS) */ 599 /* DU (CN10: ARGB0, CN13: LVDS) */
514 PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790", 600 PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
@@ -517,12 +603,24 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
517 "du_sync_1", "du"), 603 "du_sync_1", "du"),
518 PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790", 604 PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
519 "du_clk_out_0", "du"), 605 "du_clk_out_0", "du"),
606 /* I2C2 */
607 PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar.2", "pfc-r8a7790",
608 "i2c2", "i2c2"),
520 /* SCIF0 (CN19: DEBUG SERIAL0) */ 609 /* SCIF0 (CN19: DEBUG SERIAL0) */
521 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790", 610 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
522 "scif0_data", "scif0"), 611 "scif0_data", "scif0"),
523 /* SCIF1 (CN20: DEBUG SERIAL1) */ 612 /* SCIF1 (CN20: DEBUG SERIAL1) */
524 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7790", 613 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7790",
525 "scif1_data", "scif1"), 614 "scif1_data", "scif1"),
615 /* SSI (CN17: sound) */
616 PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
617 "ssi0129_ctrl", "ssi"),
618 PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
619 "ssi0_data", "ssi"),
620 PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
621 "ssi1_data", "ssi"),
622 PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
623 "audio_clk_a", "audio_clk"),
526 /* MMCIF1 */ 624 /* MMCIF1 */
527 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.1", "pfc-r8a7790", 625 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.1", "pfc-r8a7790",
528 "mmc1_data8", "mmc1"), 626 "mmc1_data8", "mmc1"),
@@ -616,6 +714,8 @@ static void __init lager_add_standard_devices(void)
616 &usbhs_phy_pdata, 714 &usbhs_phy_pdata,
617 sizeof(usbhs_phy_pdata)); 715 sizeof(usbhs_phy_pdata));
618 lager_register_usbhs(); 716 lager_register_usbhs();
717
718 lager_add_rsnd_device();
619} 719}
620 720
621/* 721/*