From b5ce635d45fc7da686c9f3071877689d8db1d284 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Oct 2012 01:15:25 -0700 Subject: ARM: shmobile: marzen: add USB phy support Signed-off-by: Kuninori Morimoto Signed-off-by: Simon Horman --- arch/arm/configs/marzen_defconfig | 3 ++- arch/arm/mach-shmobile/board-marzen.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig index 5b8215f424c5..8a861b75494e 100644 --- a/arch/arm/configs/marzen_defconfig +++ b/arch/arm/configs/marzen_defconfig @@ -78,7 +78,8 @@ CONFIG_GPIO_SYSFS=y CONFIG_THERMAL=y CONFIG_RCAR_THERMAL=y CONFIG_SSB=y -# CONFIG_USB_SUPPORT is not set +CONFIG_USB=y +CONFIG_USB_RCAR_PHY=y CONFIG_MMC=y CONFIG_MMC_SDHI=y CONFIG_UIO=y diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index 69f7f464eff8..74c7f0b64718 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c @@ -144,11 +144,32 @@ static struct platform_device hspi_device = { .num_resources = ARRAY_SIZE(hspi_resources), }; +/* USB PHY */ +static struct resource usb_phy_resources[] = { + [0] = { + .start = 0xffe70000, + .end = 0xffe70900 - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 0xfff70000, + .end = 0xfff70900 - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device usb_phy_device = { + .name = "rcar_usb_phy", + .resource = usb_phy_resources, + .num_resources = ARRAY_SIZE(usb_phy_resources), +}; + static struct platform_device *marzen_devices[] __initdata = { ð_device, &sdhi0_device, &thermal_device, &hspi_device, + &usb_phy_device, }; static void __init marzen_init(void) -- cgit v1.2.1 From 94e1f7fbe0478f00ccbdb22d9b269943e1daeba6 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Oct 2012 01:15:34 -0700 Subject: ARM: shmobile: marzen: add USB EHCI driver support This patch supports CN21/CN22 USB 2.0 (port 0/1/2), and enable USB momery on defconfig Signed-off-by: Kuninori Morimoto Signed-off-by: Simon Horman --- arch/arm/configs/marzen_defconfig | 6 ++ arch/arm/mach-shmobile/Kconfig | 1 + arch/arm/mach-shmobile/board-marzen.c | 108 +++++++++++++++++++++++++++++++++- 3 files changed, 114 insertions(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig index 8a861b75494e..6540dfba1c17 100644 --- a/arch/arm/configs/marzen_defconfig +++ b/arch/arm/configs/marzen_defconfig @@ -47,6 +47,8 @@ CONFIG_DEVTMPFS_MOUNT=y # CONFIG_STANDALONE is not set # CONFIG_PREVENT_FIRMWARE_BUILD is not set # CONFIG_FW_LOADER is not set +CONFIG_SCSI=y +CONFIG_BLK_DEV_SD=y CONFIG_NETDEVICES=y # CONFIG_NET_VENDOR_BROADCOM is not set # CONFIG_NET_VENDOR_FARADAY is not set @@ -82,6 +84,10 @@ CONFIG_USB=y CONFIG_USB_RCAR_PHY=y CONFIG_MMC=y CONFIG_MMC_SDHI=y +CONFIG_USB=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_PLATFORM=y +CONFIG_USB_STORAGE=y CONFIG_UIO=y CONFIG_UIO_PDRV_GENIRQ=y # CONFIG_IOMMU_SUPPORT is not set diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 4eddca14ae07..4eae11cdf106 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig @@ -29,6 +29,7 @@ config ARCH_R8A7779 select ARM_GIC select CPU_V7 select SH_CLK_CPG + select USB_ARCH_HAS_EHCI config ARCH_EMEV2 bool "Emma Mobile EV2" diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index 74c7f0b64718..707b3bdaee8a 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c @@ -34,6 +34,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -172,6 +175,101 @@ static struct platform_device *marzen_devices[] __initdata = { &usb_phy_device, }; +/* USB */ +static struct usb_phy *phy; +static int usb_power_on(struct platform_device *pdev) +{ + if (!phy) + return -EIO; + + pm_runtime_enable(&pdev->dev); + pm_runtime_get_sync(&pdev->dev); + + usb_phy_init(phy); + + return 0; +} + +static void usb_power_off(struct platform_device *pdev) +{ + if (!phy) + return; + + usb_phy_shutdown(phy); + + pm_runtime_put_sync(&pdev->dev); + pm_runtime_disable(&pdev->dev); +} + +static struct usb_ehci_pdata ehcix_pdata = { + .power_on = usb_power_on, + .power_off = usb_power_off, + .power_suspend = usb_power_off, +}; + +static struct resource ehci0_resources[] = { + [0] = { + .start = 0xffe70000, + .end = 0xffe70400 - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = gic_spi(44), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device ehci0_device = { + .name = "ehci-platform", + .id = 0, + .dev = { + .dma_mask = &ehci0_device.dev.coherent_dma_mask, + .coherent_dma_mask = 0xffffffff, + .platform_data = &ehcix_pdata, + }, + .num_resources = ARRAY_SIZE(ehci0_resources), + .resource = ehci0_resources, +}; + +static struct resource ehci1_resources[] = { + [0] = { + .start = 0xfff70000, + .end = 0xfff70400 - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = gic_spi(45), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device ehci1_device = { + .name = "ehci-platform", + .id = 1, + .dev = { + .dma_mask = &ehci1_device.dev.coherent_dma_mask, + .coherent_dma_mask = 0xffffffff, + .platform_data = &ehcix_pdata, + }, + .num_resources = ARRAY_SIZE(ehci1_resources), + .resource = ehci1_resources, +}; + +static struct platform_device *marzen_late_devices[] __initdata = { + &ehci0_device, + &ehci1_device, +}; + +void __init marzen_init_late(void) +{ + /* get usb phy */ + phy = usb_get_phy(USB_PHY_TYPE_USB2); + + shmobile_init_late(); + platform_add_devices(marzen_late_devices, + ARRAY_SIZE(marzen_late_devices)); +} + static void __init marzen_init(void) { regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, @@ -209,6 +307,14 @@ static void __init marzen_init(void) gpio_request(GPIO_FN_HSPI_TX0, NULL); gpio_request(GPIO_FN_HSPI_RX0, NULL); + /* USB (CN21) */ + gpio_request(GPIO_FN_USB_OVC0, NULL); + gpio_request(GPIO_FN_USB_OVC1, NULL); + gpio_request(GPIO_FN_USB_OVC2, NULL); + + /* USB (CN22) */ + gpio_request(GPIO_FN_USB_PENC2, NULL); + r8a7779_add_standard_devices(); platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); } @@ -221,6 +327,6 @@ MACHINE_START(MARZEN, "marzen") .init_irq = r8a7779_init_irq, .handle_irq = gic_handle_irq, .init_machine = marzen_init, - .init_late = shmobile_init_late, + .init_late = marzen_init_late, .timer = &shmobile_timer, MACHINE_END -- cgit v1.2.1 From ac7c4ea037e376a89a37f4f8f9e315cdff364648 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Oct 2012 01:15:43 -0700 Subject: ARM: shmobile: marzen: add USB OHCI driver support This patch supports CN21/CN22 USB 1.x (port 0/1/2), and enable input event on defconfig Signed-off-by: Kuninori Morimoto Signed-off-by: Simon Horman --- arch/arm/configs/marzen_defconfig | 5 +-- arch/arm/mach-shmobile/Kconfig | 1 + arch/arm/mach-shmobile/board-marzen.c | 57 +++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig index 6540dfba1c17..728a43c446f8 100644 --- a/arch/arm/configs/marzen_defconfig +++ b/arch/arm/configs/marzen_defconfig @@ -61,9 +61,8 @@ CONFIG_SMSC911X=y # CONFIG_NET_VENDOR_STMICRO is not set # CONFIG_WLAN is not set # CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_KEYBOARD is not set +CONFIG_INPUT_EVDEV=y # CONFIG_INPUT_MOUSE is not set -# CONFIG_SERIO is not set # CONFIG_VT is not set # CONFIG_LEGACY_PTYS is not set # CONFIG_DEVKMEM is not set @@ -86,6 +85,8 @@ CONFIG_MMC=y CONFIG_MMC_SDHI=y CONFIG_USB=y CONFIG_USB_EHCI_HCD=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PLATFORM=y CONFIG_USB_EHCI_HCD_PLATFORM=y CONFIG_USB_STORAGE=y CONFIG_UIO=y diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 4eae11cdf106..9255546e7bf6 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig @@ -30,6 +30,7 @@ config ARCH_R8A7779 select CPU_V7 select SH_CLK_CPG select USB_ARCH_HAS_EHCI + select USB_ARCH_HAS_OHCI config ARCH_EMEV2 bool "Emma Mobile EV2" diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index 707b3bdaee8a..449f9289567d 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -255,9 +256,65 @@ static struct platform_device ehci1_device = { .resource = ehci1_resources, }; +static struct usb_ohci_pdata ohcix_pdata = { + .power_on = usb_power_on, + .power_off = usb_power_off, + .power_suspend = usb_power_off, +}; + +static struct resource ohci0_resources[] = { + [0] = { + .start = 0xffe70400, + .end = 0xffe70800 - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = gic_spi(44), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device ohci0_device = { + .name = "ohci-platform", + .id = 0, + .dev = { + .dma_mask = &ohci0_device.dev.coherent_dma_mask, + .coherent_dma_mask = 0xffffffff, + .platform_data = &ohcix_pdata, + }, + .num_resources = ARRAY_SIZE(ohci0_resources), + .resource = ohci0_resources, +}; + +static struct resource ohci1_resources[] = { + [0] = { + .start = 0xfff70400, + .end = 0xfff70800 - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = gic_spi(45), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device ohci1_device = { + .name = "ohci-platform", + .id = 1, + .dev = { + .dma_mask = &ohci1_device.dev.coherent_dma_mask, + .coherent_dma_mask = 0xffffffff, + .platform_data = &ohcix_pdata, + }, + .num_resources = ARRAY_SIZE(ohci1_resources), + .resource = ohci1_resources, +}; + static struct platform_device *marzen_late_devices[] __initdata = { &ehci0_device, &ehci1_device, + &ohci0_device, + &ohci1_device, }; void __init marzen_init_late(void) -- cgit v1.2.1 From c8c3243c7594858da9a8f51672984f79cd1585d3 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Wed, 7 Nov 2012 19:09:01 -0800 Subject: ARM: shmobile: mackerel: enable DMAEngine on USB Host Signed-off-by: Kuninori Morimoto Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-mackerel.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index f274252e4705..d5fe365cb870 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c @@ -816,6 +816,8 @@ static struct platform_device usbhs1_device = { .id = 1, .dev = { .platform_data = &usbhs1_private.info, + .dma_mask = &usbhs1_device.dev.coherent_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), }, .num_resources = ARRAY_SIZE(usbhs1_resources), .resource = usbhs1_resources, -- cgit v1.2.1 From 13e35b408ad0dd5592a7d2d1e6ad6c4962b8c4c5 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Wed, 7 Nov 2012 19:09:11 -0800 Subject: ARM: shmobile: use FSI driver's audio clock on armadillo800eva Current FSI driver can control audio clock without platform call-back functions This patch removed board-specific call-back/settings Signed-off-by: Kuninori Morimoto Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-armadillo800eva.c | 38 ++------------------------ 1 file changed, 3 insertions(+), 35 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index fe27d7eda4bb..3d4c0e438780 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c @@ -768,32 +768,6 @@ static struct platform_device ceu0_device = { }; /* FSI */ -static int fsi_hdmi_set_rate(struct device *dev, int rate, int enable) -{ - struct clk *fsib; - int ret; - - /* it support 48KHz only */ - if (48000 != rate) - return -EINVAL; - - fsib = clk_get(dev, "ickb"); - if (IS_ERR(fsib)) - return -EINVAL; - - if (enable) { - ret = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64; - clk_enable(fsib); - } else { - ret = 0; - clk_disable(fsib); - } - - clk_put(fsib); - - return ret; -} - static struct sh_fsi_platform_info fsi_info = { /* FSI-WM8978 */ .port_a = { @@ -802,8 +776,8 @@ static struct sh_fsi_platform_info fsi_info = { /* FSI-HDMI */ .port_b = { .flags = SH_FSI_FMT_SPDIF | - SH_FSI_ENABLE_STREAM_MODE, - .set_rate = fsi_hdmi_set_rate, + SH_FSI_ENABLE_STREAM_MODE | + SH_FSI_CLK_CPG, .tx_id = SHDMA_SLAVE_FSIB_TX, } }; @@ -938,13 +912,11 @@ static void __init eva_clock_init(void) struct clk *xtal1 = clk_get(NULL, "extal1"); struct clk *usb24s = clk_get(NULL, "usb24s"); struct clk *fsibck = clk_get(NULL, "fsibck"); - struct clk *fsib = clk_get(&fsi_device.dev, "ickb"); if (IS_ERR(system) || IS_ERR(xtal1) || IS_ERR(usb24s) || - IS_ERR(fsibck) || - IS_ERR(fsib)) { + IS_ERR(fsibck)) { pr_err("armadillo800eva board clock init failed\n"); goto clock_error; } @@ -956,9 +928,7 @@ static void __init eva_clock_init(void) clk_set_parent(usb24s, system); /* FSIBCK is 12.288MHz, and it is parent of FSI-B */ - clk_set_parent(fsib, fsibck); clk_set_rate(fsibck, 12288000); - clk_set_rate(fsib, 12288000); clock_error: if (!IS_ERR(system)) @@ -969,8 +939,6 @@ clock_error: clk_put(usb24s); if (!IS_ERR(fsibck)) clk_put(fsibck); - if (!IS_ERR(fsib)) - clk_put(fsib); } /* -- cgit v1.2.1 From 50ce2da3486a9ba5371fc772407d7ee8e819dedd Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Wed, 7 Nov 2012 19:09:20 -0800 Subject: ARM: shmobile: use FSI driver's audio clock on mackerel Current FSI driver can control audio clock without platform call-back functions This patch removed board-specific call-back/settings Signed-off-by: Kuninori Morimoto Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-mackerel.c | 72 +-------------------------------- 1 file changed, 1 insertion(+), 71 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index d5fe365cb870..bf2bcb92b426 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c @@ -862,76 +862,6 @@ static struct platform_device leds_device = { /* FSI */ #define IRQ_FSI evt2irq(0x1840) -static int __fsi_set_round_rate(struct clk *clk, long rate, int enable) -{ - int ret; - - if (rate <= 0) - return 0; - - if (!enable) { - clk_disable(clk); - return 0; - } - - ret = clk_set_rate(clk, clk_round_rate(clk, rate)); - if (ret < 0) - return ret; - - return clk_enable(clk); -} - -static int fsi_b_set_rate(struct device *dev, int rate, int enable) -{ - struct clk *fsib_clk; - struct clk *fdiv_clk = clk_get(NULL, "fsidivb"); - long fsib_rate = 0; - long fdiv_rate = 0; - int ackmd_bpfmd; - int ret; - - /* clock start */ - switch (rate) { - case 44100: - fsib_rate = rate * 256; - ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64; - break; - case 48000: - fsib_rate = 85428000; /* around 48kHz x 256 x 7 */ - fdiv_rate = rate * 256; - ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64; - break; - default: - pr_err("unsupported rate in FSI2 port B\n"); - return -EINVAL; - } - - /* FSI B setting */ - fsib_clk = clk_get(dev, "ickb"); - if (IS_ERR(fsib_clk)) - return -EIO; - - /* fsib */ - ret = __fsi_set_round_rate(fsib_clk, fsib_rate, enable); - if (ret < 0) - goto fsi_set_rate_end; - - /* FSI DIV */ - ret = __fsi_set_round_rate(fdiv_clk, fdiv_rate, enable); - if (ret < 0) { - /* disable FSI B */ - if (enable) - __fsi_set_round_rate(fsib_clk, fsib_rate, 0); - goto fsi_set_rate_end; - } - - ret = ackmd_bpfmd; - -fsi_set_rate_end: - clk_put(fsib_clk); - return ret; -} - static struct sh_fsi_platform_info fsi_info = { .port_a = { .flags = SH_FSI_BRS_INV, @@ -942,8 +872,8 @@ static struct sh_fsi_platform_info fsi_info = { .flags = SH_FSI_BRS_INV | SH_FSI_BRM_INV | SH_FSI_LRS_INV | + SH_FSI_CLK_CPG | SH_FSI_FMT_SPDIF, - .set_rate = fsi_b_set_rate, } }; -- cgit v1.2.1 From 12818d82ccad9868a820dbb193b4f9b797cd02d4 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Wed, 7 Nov 2012 19:09:29 -0800 Subject: ARM: shmobile: use FSI driver's audio clock on ap4evb Current FSI driver can control audio clock without platform call-back functions This patch removed board-specific call-back/settings Signed-off-by: Kuninori Morimoto Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-ap4evb.c | 139 +--------------------------------- 1 file changed, 1 insertion(+), 138 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index cefdd030361d..40657854e3ad 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c @@ -658,133 +658,16 @@ static struct platform_device lcdc_device = { /* FSI */ #define IRQ_FSI evt2irq(0x1840) -static int __fsi_set_rate(struct clk *clk, long rate, int enable) -{ - int ret = 0; - - if (rate <= 0) - return ret; - - if (enable) { - ret = clk_set_rate(clk, rate); - if (0 == ret) - ret = clk_enable(clk); - } else { - clk_disable(clk); - } - - return ret; -} - -static int __fsi_set_round_rate(struct clk *clk, long rate, int enable) -{ - return __fsi_set_rate(clk, clk_round_rate(clk, rate), enable); -} - -static int fsi_ak4642_set_rate(struct device *dev, int rate, int enable) -{ - struct clk *fsia_ick; - struct clk *fsiack; - int ret = -EIO; - - fsia_ick = clk_get(dev, "icka"); - if (IS_ERR(fsia_ick)) - return PTR_ERR(fsia_ick); - - /* - * FSIACK is connected to AK4642, - * and use external clock pin from it. - * it is parent of fsia_ick now. - */ - fsiack = clk_get_parent(fsia_ick); - if (!fsiack) - goto fsia_ick_out; - - /* - * we get 1/1 divided clock by setting same rate to fsiack and fsia_ick - * - ** FIXME ** - * Because the freq_table of external clk (fsiack) are all 0, - * the return value of clk_round_rate became 0. - * So, it use __fsi_set_rate here. - */ - ret = __fsi_set_rate(fsiack, rate, enable); - if (ret < 0) - goto fsiack_out; - - ret = __fsi_set_round_rate(fsia_ick, rate, enable); - if ((ret < 0) && enable) - __fsi_set_round_rate(fsiack, rate, 0); /* disable FSI ACK */ - -fsiack_out: - clk_put(fsiack); - -fsia_ick_out: - clk_put(fsia_ick); - - return 0; -} - -static int fsi_hdmi_set_rate(struct device *dev, int rate, int enable) -{ - struct clk *fsib_clk; - struct clk *fdiv_clk = clk_get(NULL, "fsidivb"); - long fsib_rate = 0; - long fdiv_rate = 0; - int ackmd_bpfmd; - int ret; - - switch (rate) { - case 44100: - fsib_rate = rate * 256; - ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64; - break; - case 48000: - fsib_rate = 85428000; /* around 48kHz x 256 x 7 */ - fdiv_rate = rate * 256; - ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64; - break; - default: - pr_err("unsupported rate in FSI2 port B\n"); - return -EINVAL; - } - - /* FSI B setting */ - fsib_clk = clk_get(dev, "ickb"); - if (IS_ERR(fsib_clk)) - return -EIO; - - ret = __fsi_set_round_rate(fsib_clk, fsib_rate, enable); - if (ret < 0) - goto fsi_set_rate_end; - - /* FSI DIV setting */ - ret = __fsi_set_round_rate(fdiv_clk, fdiv_rate, enable); - if (ret < 0) { - /* disable FSI B */ - if (enable) - __fsi_set_round_rate(fsib_clk, fsib_rate, 0); - goto fsi_set_rate_end; - } - - ret = ackmd_bpfmd; - -fsi_set_rate_end: - clk_put(fsib_clk); - return ret; -} - static struct sh_fsi_platform_info fsi_info = { .port_a = { .flags = SH_FSI_BRS_INV, - .set_rate = fsi_ak4642_set_rate, }, .port_b = { .flags = SH_FSI_BRS_INV | SH_FSI_BRM_INV | SH_FSI_LRS_INV | + SH_FSI_CLK_CPG | SH_FSI_FMT_SPDIF, - .set_rate = fsi_hdmi_set_rate, }, }; @@ -1144,25 +1027,6 @@ out: clk_put(hdmi_ick); } -static void __init fsi_init_pm_clock(void) -{ - struct clk *fsia_ick; - int ret; - - fsia_ick = clk_get(&fsi_device.dev, "icka"); - if (IS_ERR(fsia_ick)) { - ret = PTR_ERR(fsia_ick); - pr_err("Cannot get FSI ICK: %d\n", ret); - return; - } - - ret = clk_set_parent(fsia_ick, &sh7372_fsiack_clk); - if (ret < 0) - pr_err("Cannot set FSI-A parent: %d\n", ret); - - clk_put(fsia_ick); -} - /* TouchScreen */ #ifdef CONFIG_AP4EVB_QHD # define GPIO_TSC_IRQ GPIO_FN_IRQ28_123 @@ -1476,7 +1340,6 @@ static void __init ap4evb_init(void) ARRAY_SIZE(domain_devices)); hdmi_init_pm_clock(); - fsi_init_pm_clock(); sh7372_pm_init(); pm_clk_add(&fsi_device.dev, "spu2"); pm_clk_add(&lcdc1_device.dev, "hdmi"); -- cgit v1.2.1 From 3042ac5731e6db441dfce85612da4aa3913dab3b Mon Sep 17 00:00:00 2001 From: Bastian Hecht Date: Tue, 20 Nov 2012 01:05:00 +0100 Subject: ARM: shmobile: mackerel: Add FLCTL IRQ resource Since commit 3c7ea4e (mtd: sh_flctl: Add support for error IRQ) the sh_flctl driver requires the error IRQ line to signal failed transactions between the flash controller and the NAND chip. This information is mandatory - else the driver refuses to start up. We provide it here for the board mackerel. Signed-off-by: Bastian Hecht Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-mackerel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index bf2bcb92b426..3f56e70795b7 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c @@ -950,7 +950,11 @@ static struct resource nand_flash_resources[] = { .start = 0xe6a30000, .end = 0xe6a3009b, .flags = IORESOURCE_MEM, - } + }, + [1] = { + .start = evt2irq(0x0d80), /* flstei: status error irq */ + .flags = IORESOURCE_IRQ, + }, }; static struct sh_flctl_platform_data nand_flash_data = { -- cgit v1.2.1