mirror of
https://github.com/torvalds/linux.git
synced 2024-11-19 02:21:47 +00:00
8e73e367f7
This branch contains code cleanups, moves and removals for 3.12. There's a large number of various cleanups, and a nice net removal of 13500 lines of code. Highlights worth mentioning are: - A series of patches from Stephen Boyd removing the ARM local timer API. - Move of Qualcomm MSM IOMMU code to drivers/iommu. - Samsung PWM driver cleanups from Tomasz Figa, removing legacy PWM driver and switching over to the drivers/pwm one. - Removal of some unusued auto-generated headers for OMAP2+ (PRM/CM). There's also a move of a header file out of include/linux/i2c/ to platform_data, where it really belongs. It touches mostly ARM platform code for include changes so we took it through our tree. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJSKg/NAAoJEIwa5zzehBx3vxIP/19ouV4WrzOeEMz2Id8bYT5/ Tu9HRm+PJJ2O+4P+DYlycRAEHsbuDbwgdcqToH3quca1YnIcoJgY0FA6D0ihQ5uE EvTgFIpkNMLnR43GYDOE3a/rR3hYPg5oQabKFn7ZGLG2ND3D3d2N05WT8XNbTYDk nvCXvyRRT1ynCEzbxRBiE8x62ao4bqa5dZ1zrHHIEoakqciXEng8IU0nxx7SUarv 61GBJHVoGFpwOWXdgt2uxyXFbn6nMrhf33ynB+RRAZhqlrC8FROj8Iz+3EoKSAHc fMJSw6jgdjMCfTDvi0j/eemoNC4fm0eP17Dz9WcwxtIrJPNFVrxZq+biDnpb49nM IHsbNrILosw9AbHr3C0kTU9tp+Jie2cE1RWHqTIN3S3zb4qN+fIJiU6o6LMhsNP5 +ZxL4M5IYmvZYbU3a+A00TPwVRqBbsZB+et9RtYZsdpepovDiN4XcixEoT7ffqrt VLjJyoX7Aqmds46lMdsdD3bpPkREmMdf8aMm5fvdIqwbJi1pFMMGMdTgN2WLG5aM r0bj/DizxL7Brs8RHwOScUgXteZs3gg87v5Ns/3zAyJZvE4norPAiT+EJeXylpRO LDqqaypFs75nU+mWLNo8Fzck4Xue55SBqx5Bo3aD/Smk8B6r4KMqnMKVsV5RFHAU XfWb49HulUwHHdn5DAPx =1vE4 -----END PGP SIGNATURE----- Merge tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC cleanups from Olof Johansson: "This branch contains code cleanups, moves and removals for 3.12. There's a large number of various cleanups, and a nice net removal of 13500 lines of code. Highlights worth mentioning are: - A series of patches from Stephen Boyd removing the ARM local timer API. - Move of Qualcomm MSM IOMMU code to drivers/iommu. - Samsung PWM driver cleanups from Tomasz Figa, removing legacy PWM driver and switching over to the drivers/pwm one. - Removal of some unusued auto-generated headers for OMAP2+ (PRM/CM). There's also a move of a header file out of include/linux/i2c/ to platform_data, where it really belongs. It touches mostly ARM platform code for include changes so we took it through our tree" * tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (83 commits) ARM: OMAP2+: Add back the define for AM33XX_RST_GLOBAL_WARM_SW_MASK gpio: (gpio-pca953x) move header to linux/platform_data/ arm: zynq: hotplug: Remove unreachable code ARM: SAMSUNG: Remove unnecessary exynos4_default_sdhci*() tegra: simplify use of devm_ioremap_resource ARM: SAMSUNG: Remove plat/regs-timer.h header ARM: SAMSUNG: Remove remaining uses of plat/regs-timer.h header ARM: SAMSUNG: Remove pwm-clock infrastructure ARM: SAMSUNG: Remove old PWM timer platform devices pwm: Remove superseded pwm-samsung-legacy driver ARM: SAMSUNG: Modify board files to use new PWM platform device ARM: SAMSUNG: Rework private data handling in dev-backlight pwm: Add new pwm-samsung driver ARM: mach-mvebu: remove redundant DT parsing and validation ARM: msm: Only compile io.c on platforms that use it iommu/msm: Move mach includes to iommu directory ARM: msm: Remove devices-iommu.c ARM: msm: Move mach/board.h contents to common.h ARM: msm: Migrate msm_timer to CLOCKSOURCE_OF_DECLARE ARM: msm: Remove TMR and TMR0 static mappings ...
389 lines
9.1 KiB
C
389 lines
9.1 KiB
C
/*
|
|
* Copyright (C) 2008 Google, Inc.
|
|
* Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
|
|
*
|
|
* This software is licensed under the terms of the GNU General Public
|
|
* License version 2, as published by the Free Software Foundation, and
|
|
* may be copied, distributed, and modified under those terms.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/clkdev.h>
|
|
#include <linux/dma-mapping.h>
|
|
|
|
#include <mach/irqs.h>
|
|
#include <mach/msm_iomap.h>
|
|
#include <mach/dma.h>
|
|
|
|
#include "devices.h"
|
|
#include "common.h"
|
|
|
|
#include <asm/mach/flash.h>
|
|
|
|
#include <linux/platform_data/mmc-msm_sdcc.h>
|
|
#include "clock.h"
|
|
#include "clock-pcom.h"
|
|
|
|
static struct resource msm_gpio_resources[] = {
|
|
{
|
|
.start = 64 + 165 + 9,
|
|
.end = 64 + 165 + 9,
|
|
.flags = IORESOURCE_IRQ,
|
|
},
|
|
{
|
|
.start = 64 + 165 + 10,
|
|
.end = 64 + 165 + 10,
|
|
.flags = IORESOURCE_IRQ,
|
|
},
|
|
{
|
|
.start = 0xa9000800,
|
|
.end = 0xa9000800 + SZ_4K - 1,
|
|
.flags = IORESOURCE_MEM,
|
|
.name = "gpio1"
|
|
},
|
|
{
|
|
.start = 0xa9100C00,
|
|
.end = 0xa9100C00 + SZ_4K - 1,
|
|
.flags = IORESOURCE_MEM,
|
|
.name = "gpio2"
|
|
},
|
|
};
|
|
|
|
struct platform_device msm_device_gpio_8x50 = {
|
|
.name = "gpio-msm-8x50",
|
|
.num_resources = ARRAY_SIZE(msm_gpio_resources),
|
|
.resource = msm_gpio_resources,
|
|
};
|
|
|
|
static struct resource resources_uart3[] = {
|
|
{
|
|
.start = INT_UART3,
|
|
.end = INT_UART3,
|
|
.flags = IORESOURCE_IRQ,
|
|
},
|
|
{
|
|
.start = MSM_UART3_PHYS,
|
|
.end = MSM_UART3_PHYS + MSM_UART3_SIZE - 1,
|
|
.flags = IORESOURCE_MEM,
|
|
.name = "uart_resource"
|
|
},
|
|
};
|
|
|
|
struct platform_device msm_device_uart3 = {
|
|
.name = "msm_serial",
|
|
.id = 2,
|
|
.num_resources = ARRAY_SIZE(resources_uart3),
|
|
.resource = resources_uart3,
|
|
};
|
|
|
|
struct platform_device msm_device_smd = {
|
|
.name = "msm_smd",
|
|
.id = -1,
|
|
};
|
|
|
|
static struct resource resources_otg[] = {
|
|
{
|
|
.start = MSM_HSUSB_PHYS,
|
|
.end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE,
|
|
.flags = IORESOURCE_MEM,
|
|
},
|
|
{
|
|
.start = INT_USB_HS,
|
|
.end = INT_USB_HS,
|
|
.flags = IORESOURCE_IRQ,
|
|
},
|
|
};
|
|
|
|
struct platform_device msm_device_otg = {
|
|
.name = "msm_otg",
|
|
.id = -1,
|
|
.num_resources = ARRAY_SIZE(resources_otg),
|
|
.resource = resources_otg,
|
|
.dev = {
|
|
.coherent_dma_mask = 0xffffffff,
|
|
},
|
|
};
|
|
|
|
static struct resource resources_hsusb[] = {
|
|
{
|
|
.start = MSM_HSUSB_PHYS,
|
|
.end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE,
|
|
.flags = IORESOURCE_MEM,
|
|
},
|
|
{
|
|
.start = INT_USB_HS,
|
|
.end = INT_USB_HS,
|
|
.flags = IORESOURCE_IRQ,
|
|
},
|
|
};
|
|
|
|
struct platform_device msm_device_hsusb = {
|
|
.name = "msm_hsusb",
|
|
.id = -1,
|
|
.num_resources = ARRAY_SIZE(resources_hsusb),
|
|
.resource = resources_hsusb,
|
|
.dev = {
|
|
.coherent_dma_mask = 0xffffffff,
|
|
},
|
|
};
|
|
|
|
static u64 dma_mask = 0xffffffffULL;
|
|
static struct resource resources_hsusb_host[] = {
|
|
{
|
|
.start = MSM_HSUSB_PHYS,
|
|
.end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE,
|
|
.flags = IORESOURCE_MEM,
|
|
},
|
|
{
|
|
.start = INT_USB_HS,
|
|
.end = INT_USB_HS,
|
|
.flags = IORESOURCE_IRQ,
|
|
},
|
|
};
|
|
|
|
struct platform_device msm_device_hsusb_host = {
|
|
.name = "msm_hsusb_host",
|
|
.id = -1,
|
|
.num_resources = ARRAY_SIZE(resources_hsusb_host),
|
|
.resource = resources_hsusb_host,
|
|
.dev = {
|
|
.dma_mask = &dma_mask,
|
|
.coherent_dma_mask = 0xffffffffULL,
|
|
},
|
|
};
|
|
|
|
static struct resource resources_sdc1[] = {
|
|
{
|
|
.start = MSM_SDC1_PHYS,
|
|
.end = MSM_SDC1_PHYS + MSM_SDC1_SIZE - 1,
|
|
.flags = IORESOURCE_MEM,
|
|
},
|
|
{
|
|
.start = INT_SDC1_0,
|
|
.end = INT_SDC1_0,
|
|
.flags = IORESOURCE_IRQ,
|
|
.name = "cmd_irq",
|
|
},
|
|
{
|
|
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
|
|
.name = "status_irq"
|
|
},
|
|
{
|
|
.start = 8,
|
|
.end = 8,
|
|
.flags = IORESOURCE_DMA,
|
|
},
|
|
};
|
|
|
|
static struct resource resources_sdc2[] = {
|
|
{
|
|
.start = MSM_SDC2_PHYS,
|
|
.end = MSM_SDC2_PHYS + MSM_SDC2_SIZE - 1,
|
|
.flags = IORESOURCE_MEM,
|
|
},
|
|
{
|
|
.start = INT_SDC2_0,
|
|
.end = INT_SDC2_0,
|
|
.flags = IORESOURCE_IRQ,
|
|
.name = "cmd_irq",
|
|
},
|
|
{
|
|
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
|
|
.name = "status_irq"
|
|
},
|
|
{
|
|
.start = 8,
|
|
.end = 8,
|
|
.flags = IORESOURCE_DMA,
|
|
},
|
|
};
|
|
|
|
static struct resource resources_sdc3[] = {
|
|
{
|
|
.start = MSM_SDC3_PHYS,
|
|
.end = MSM_SDC3_PHYS + MSM_SDC3_SIZE - 1,
|
|
.flags = IORESOURCE_MEM,
|
|
},
|
|
{
|
|
.start = INT_SDC3_0,
|
|
.end = INT_SDC3_0,
|
|
.flags = IORESOURCE_IRQ,
|
|
.name = "cmd_irq",
|
|
},
|
|
{
|
|
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
|
|
.name = "status_irq"
|
|
},
|
|
{
|
|
.start = 8,
|
|
.end = 8,
|
|
.flags = IORESOURCE_DMA,
|
|
},
|
|
};
|
|
|
|
static struct resource resources_sdc4[] = {
|
|
{
|
|
.start = MSM_SDC4_PHYS,
|
|
.end = MSM_SDC4_PHYS + MSM_SDC4_SIZE - 1,
|
|
.flags = IORESOURCE_MEM,
|
|
},
|
|
{
|
|
.start = INT_SDC4_0,
|
|
.end = INT_SDC4_0,
|
|
.flags = IORESOURCE_IRQ,
|
|
.name = "cmd_irq",
|
|
},
|
|
{
|
|
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
|
|
.name = "status_irq"
|
|
},
|
|
{
|
|
.start = 8,
|
|
.end = 8,
|
|
.flags = IORESOURCE_DMA,
|
|
},
|
|
};
|
|
|
|
struct platform_device msm_device_sdc1 = {
|
|
.name = "msm_sdcc",
|
|
.id = 1,
|
|
.num_resources = ARRAY_SIZE(resources_sdc1),
|
|
.resource = resources_sdc1,
|
|
.dev = {
|
|
.coherent_dma_mask = 0xffffffff,
|
|
},
|
|
};
|
|
|
|
struct platform_device msm_device_sdc2 = {
|
|
.name = "msm_sdcc",
|
|
.id = 2,
|
|
.num_resources = ARRAY_SIZE(resources_sdc2),
|
|
.resource = resources_sdc2,
|
|
.dev = {
|
|
.coherent_dma_mask = 0xffffffff,
|
|
},
|
|
};
|
|
|
|
struct platform_device msm_device_sdc3 = {
|
|
.name = "msm_sdcc",
|
|
.id = 3,
|
|
.num_resources = ARRAY_SIZE(resources_sdc3),
|
|
.resource = resources_sdc3,
|
|
.dev = {
|
|
.coherent_dma_mask = 0xffffffff,
|
|
},
|
|
};
|
|
|
|
struct platform_device msm_device_sdc4 = {
|
|
.name = "msm_sdcc",
|
|
.id = 4,
|
|
.num_resources = ARRAY_SIZE(resources_sdc4),
|
|
.resource = resources_sdc4,
|
|
.dev = {
|
|
.coherent_dma_mask = 0xffffffff,
|
|
},
|
|
};
|
|
|
|
static struct platform_device *msm_sdcc_devices[] __initdata = {
|
|
&msm_device_sdc1,
|
|
&msm_device_sdc2,
|
|
&msm_device_sdc3,
|
|
&msm_device_sdc4,
|
|
};
|
|
|
|
int __init msm_add_sdcc(unsigned int controller,
|
|
struct msm_mmc_platform_data *plat,
|
|
unsigned int stat_irq, unsigned long stat_irq_flags)
|
|
{
|
|
struct platform_device *pdev;
|
|
struct resource *res;
|
|
|
|
if (controller < 1 || controller > 4)
|
|
return -EINVAL;
|
|
|
|
pdev = msm_sdcc_devices[controller-1];
|
|
pdev->dev.platform_data = plat;
|
|
|
|
res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "status_irq");
|
|
if (!res)
|
|
return -EINVAL;
|
|
else if (stat_irq) {
|
|
res->start = res->end = stat_irq;
|
|
res->flags &= ~IORESOURCE_DISABLED;
|
|
res->flags |= stat_irq_flags;
|
|
}
|
|
|
|
return platform_device_register(pdev);
|
|
}
|
|
|
|
static struct clk_pcom_desc msm_clocks_8x50[] = {
|
|
CLK_PCOM("adm_clk", ADM_CLK, NULL, 0),
|
|
CLK_PCOM("ce_clk", CE_CLK, NULL, 0),
|
|
CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN),
|
|
CLK_PCOM("ebi2_clk", EBI2_CLK, NULL, 0),
|
|
CLK_PCOM("ecodec_clk", ECODEC_CLK, NULL, 0),
|
|
CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF | CLK_MINMAX),
|
|
CLK_PCOM("gp_clk", GP_CLK, NULL, 0),
|
|
CLK_PCOM("grp_clk", GRP_3D_CLK, NULL, 0),
|
|
CLK_PCOM("i2c_clk", I2C_CLK, NULL, 0),
|
|
CLK_PCOM("icodec_rx_clk", ICODEC_RX_CLK, NULL, 0),
|
|
CLK_PCOM("icodec_tx_clk", ICODEC_TX_CLK, NULL, 0),
|
|
CLK_PCOM("imem_clk", IMEM_CLK, NULL, OFF),
|
|
CLK_PCOM("mdc_clk", MDC_CLK, NULL, 0),
|
|
CLK_PCOM("mddi_clk", PMDH_CLK, NULL, OFF | CLK_MINMAX),
|
|
CLK_PCOM("mdp_clk", MDP_CLK, NULL, OFF),
|
|
CLK_PCOM("mdp_lcdc_pclk_clk", MDP_LCDC_PCLK_CLK, NULL, 0),
|
|
CLK_PCOM("mdp_lcdc_pad_pclk_clk", MDP_LCDC_PAD_PCLK_CLK, NULL, 0),
|
|
CLK_PCOM("mdp_vsync_clk", MDP_VSYNC_CLK, NULL, 0),
|
|
CLK_PCOM("pbus_clk", PBUS_CLK, NULL, CLK_MIN),
|
|
CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0),
|
|
CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF),
|
|
CLK_PCOM("sdc_clk", SDC1_CLK, "msm_sdcc.1", OFF),
|
|
CLK_PCOM("sdc_pclk", SDC1_P_CLK, "msm_sdcc.1", OFF),
|
|
CLK_PCOM("sdc_clk", SDC2_CLK, "msm_sdcc.2", OFF),
|
|
CLK_PCOM("sdc_pclk", SDC2_P_CLK, "msm_sdcc.2", OFF),
|
|
CLK_PCOM("sdc_clk", SDC3_CLK, "msm_sdcc.3", OFF),
|
|
CLK_PCOM("sdc_pclk", SDC3_P_CLK, "msm_sdcc.3", OFF),
|
|
CLK_PCOM("sdc_clk", SDC4_CLK, "msm_sdcc.4", OFF),
|
|
CLK_PCOM("sdc_pclk", SDC4_P_CLK, "msm_sdcc.4", OFF),
|
|
CLK_PCOM("spi_clk", SPI_CLK, NULL, 0),
|
|
CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0),
|
|
CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0),
|
|
CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0),
|
|
CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0),
|
|
CLK_PCOM("core", UART1_CLK, NULL, OFF),
|
|
CLK_PCOM("core", UART2_CLK, NULL, 0),
|
|
CLK_PCOM("core", UART3_CLK, "msm_serial.2", OFF),
|
|
CLK_PCOM("uartdm_clk", UART1DM_CLK, NULL, OFF),
|
|
CLK_PCOM("uartdm_clk", UART2DM_CLK, NULL, 0),
|
|
CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF),
|
|
CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF),
|
|
CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0),
|
|
CLK_PCOM("vdc_clk", VDC_CLK, NULL, OFF | CLK_MIN),
|
|
CLK_PCOM("vfe_clk", VFE_CLK, NULL, OFF),
|
|
CLK_PCOM("vfe_mdc_clk", VFE_MDC_CLK, NULL, OFF),
|
|
CLK_PCOM("vfe_axi_clk", VFE_AXI_CLK, NULL, OFF),
|
|
CLK_PCOM("usb_hs2_clk", USB_HS2_CLK, NULL, OFF),
|
|
CLK_PCOM("usb_hs2_pclk", USB_HS2_P_CLK, NULL, OFF),
|
|
CLK_PCOM("usb_hs3_clk", USB_HS3_CLK, NULL, OFF),
|
|
CLK_PCOM("usb_hs3_pclk", USB_HS3_P_CLK, NULL, OFF),
|
|
CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0),
|
|
};
|
|
|
|
static struct pcom_clk_pdata msm_clock_8x50_pdata = {
|
|
.lookup = msm_clocks_8x50,
|
|
.num_lookups = ARRAY_SIZE(msm_clocks_8x50),
|
|
};
|
|
|
|
struct platform_device msm_clock_8x50 = {
|
|
.name = "msm-clock-pcom",
|
|
.dev.platform_data = &msm_clock_8x50_pdata,
|
|
};
|