aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-06-21 06:05:52 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-06-21 06:05:52 -0400
commitf5e8779a5e3e40cf1bf97dfe00ae24d681b66396 (patch)
tree0bd0a503ff72d981c595b1595f113bde6c766b8d /arch/arm/mach-shmobile
parent3760e79450f48e31fde2b2dd49c5ab6a685c3ea8 (diff)
parent080e0d1384a3fce16b7d5324dbfc47c136cc3573 (diff)
Merge branch 'renesas-kzm9g' into renesas-board
* renesas-kzm9g: ARM: shmobile: kzm9g: Support Real Time Clock ARM: shmobile: kzm9g: enable FSI-AK4648 ARM: shmobile: sh73a0: add FSI clock
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/Kconfig1
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c82
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c4
3 files changed, 86 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index df33909205e2..4c3b031be6f3 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -122,6 +122,7 @@ config MACH_KZM9G
122 depends on ARCH_SH73A0 122 depends on ARCH_SH73A0
123 select ARCH_REQUIRE_GPIOLIB 123 select ARCH_REQUIRE_GPIOLIB
124 select USE_OF 124 select USE_OF
125 select SND_SOC_AK4642 if SND_SIMPLE_CARD
125 126
126comment "SH-Mobile System Configuration" 127comment "SH-Mobile System Configuration"
127 128
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index d8e33b682832..a5cb11358e00 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
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 3946c4ba2aa8..ad6f9ade7402 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -477,7 +477,7 @@ enum { MSTP001,
477 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100, 477 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,
478 MSTP219, MSTP218, 478 MSTP219, MSTP218,
479 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, 479 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
480 MSTP331, MSTP329, MSTP325, MSTP323, 480 MSTP331, MSTP329, MSTP328, MSTP325, MSTP323,
481 MSTP314, MSTP313, MSTP312, MSTP311, 481 MSTP314, MSTP313, MSTP312, MSTP311,
482 MSTP303, MSTP302, MSTP301, MSTP300, 482 MSTP303, MSTP302, MSTP301, MSTP300,
483 MSTP411, MSTP410, MSTP403, 483 MSTP411, MSTP410, MSTP403,
@@ -507,6 +507,7 @@ static struct clk mstp_clks[MSTP_NR] = {
507 [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */ 507 [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */
508 [MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */ 508 [MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */
509 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */ 509 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
510 [MSTP328] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 28, 0), /*FSI*/
510 [MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */ 511 [MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */
511 [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */ 512 [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */
512 [MSTP314] = MSTP(&div6_clks[DIV6_SDHI0], SMSTPCR3, 14, 0), /* SDHI0 */ 513 [MSTP314] = MSTP(&div6_clks[DIV6_SDHI0], SMSTPCR3, 14, 0), /* SDHI0 */
@@ -562,6 +563,7 @@ static struct clk_lookup lookups[] = {
562 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ 563 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
563 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */ 564 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
564 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */ 565 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
566 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */
565 CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */ 567 CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */
566 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */ 568 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */
567 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */ 569 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */