/arch/arm/mach-fsm/board-qsd8x50.c
C | 2555 lines | 2175 code | 321 blank | 59 comment | 147 complexity | 877d604654a65f0f02f6f411d3b4dd5e MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
Large files files are truncated, but you can click here to view the full file
- /* Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- *
- */
- #include <linux/kernel.h>
- #include <linux/irq.h>
- #include <linux/gpio.h>
- #include <linux/platform_device.h>
- #include <linux/android_pmem.h>
- #include <linux/bootmem.h>
- #include <linux/i2c.h>
- #include <linux/spi/spi.h>
- #include <linux/delay.h>
- #include <linux/mfd/tps65023.h>
- #include <linux/bma150.h>
- #include <linux/power_supply.h>
- #include <linux/clk.h>
- #include <asm/mach-types.h>
- #include <asm/mach/arch.h>
- #include <asm/io.h>
- #include <asm/setup.h>
- #include <asm/mach/mmc.h>
- #include <mach/vreg.h>
- #include <mach/mpp.h>
- #include <mach/gpio.h>
- #include <mach/board.h>
- #include <mach/sirc.h>
- #include <mach/dma.h>
- #include <mach/rpc_hsusb.h>
- #include <mach/rpc_pmapp.h>
- #include <mach/msm_hsusb.h>
- #include <mach/msm_serial_hs.h>
- #include <mach/msm_touchpad.h>
- #include <mach/msm_i2ckbd.h>
- #include <mach/pmic.h>
- #include <mach/camera.h>
- #include <mach/memory.h>
- #include <mach/msm_spi.h>
- #include <mach/msm_tsif.h>
- #include <mach/msm_battery.h>
- #include <mach/rpc_server_handset.h>
- #include "devices.h"
- #include "timer.h"
- #include "socinfo.h"
- #include "msm-keypad-devices.h"
- #include "pm.h"
- #include "proc_comm.h"
- #include <linux/msm_kgsl.h>
- #ifdef CONFIG_USB_ANDROID
- #include <linux/usb/android_composite.h>
- #endif
- #define TOUCHPAD_SUSPEND 34
- #define TOUCHPAD_IRQ 38
- #define MSM_PMEM_SF_SIZE 0x1700000
- #define SMEM_SPINLOCK_I2C "S:6"
- #define MSM_PMEM_ADSP_SIZE 0x2B96000
- #define MSM_FB_SIZE 0x2EE000
- #define MSM_AUDIO_SIZE 0x80000
- #define MSM_GPU_PHYS_SIZE SZ_2M
- #ifdef CONFIG_MSM_SOC_REV_A
- #define MSM_SMI_BASE 0xE0000000
- #else
- #define MSM_SMI_BASE 0x00000000
- #endif
- #define MSM_SHARED_RAM_PHYS (MSM_SMI_BASE + 0x00100000)
- #define MSM_PMEM_SMI_BASE (MSM_SMI_BASE + 0x02B00000)
- #define MSM_PMEM_SMI_SIZE 0x01500000
- #define MSM_FB_BASE MSM_PMEM_SMI_BASE
- #define MSM_GPU_PHYS_BASE (MSM_FB_BASE + MSM_FB_SIZE)
- #define MSM_PMEM_SMIPOOL_BASE (MSM_GPU_PHYS_BASE + MSM_GPU_PHYS_SIZE)
- #define MSM_PMEM_SMIPOOL_SIZE (MSM_PMEM_SMI_SIZE - MSM_FB_SIZE \
- - MSM_GPU_PHYS_SIZE)
- #define PMEM_KERNEL_EBI1_SIZE 0x28000
- #define PMIC_VREG_WLAN_LEVEL 2600
- #define PMIC_VREG_GP6_LEVEL 2900
- #define FPGA_SDCC_STATUS 0x70000280
- static struct resource smc91x_resources[] = {
- [0] = {
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .flags = IORESOURCE_IRQ,
- },
- };
- #ifdef CONFIG_USB_FUNCTION
- static struct usb_mass_storage_platform_data usb_mass_storage_pdata = {
- .nluns = 0x02,
- .buf_size = 16384,
- .vendor = "GOOGLE",
- .product = "Mass storage",
- .release = 0xffff,
- };
- static struct platform_device mass_storage_device = {
- .name = "usb_mass_storage",
- .id = -1,
- .dev = {
- .platform_data = &usb_mass_storage_pdata,
- },
- };
- #endif
- #ifdef CONFIG_USB_ANDROID
- static char *usb_functions_default[] = {
- "diag",
- "modem",
- "nmea",
- "rmnet",
- "usb_mass_storage",
- };
- static char *usb_functions_default_adb[] = {
- "diag",
- "adb",
- "modem",
- "nmea",
- "rmnet",
- "usb_mass_storage",
- };
- static char *usb_functions_rndis[] = {
- "rndis",
- };
- static char *usb_functions_rndis_adb[] = {
- "rndis",
- "adb",
- };
- static char *usb_functions_all[] = {
- #ifdef CONFIG_USB_ANDROID_RNDIS
- "rndis",
- #endif
- #ifdef CONFIG_USB_ANDROID_DIAG
- "diag",
- #endif
- "adb",
- #ifdef CONFIG_USB_F_SERIAL
- "modem",
- "nmea",
- #endif
- #ifdef CONFIG_USB_ANDROID_RMNET
- "rmnet",
- #endif
- "usb_mass_storage",
- #ifdef CONFIG_USB_ANDROID_ACM
- "acm",
- #endif
- };
- static struct android_usb_product usb_products[] = {
- {
- .product_id = 0x9026,
- .num_functions = ARRAY_SIZE(usb_functions_default),
- .functions = usb_functions_default,
- },
- {
- .product_id = 0x9025,
- .num_functions = ARRAY_SIZE(usb_functions_default_adb),
- .functions = usb_functions_default_adb,
- },
- {
- .product_id = 0xf00e,
- .num_functions = ARRAY_SIZE(usb_functions_rndis),
- .functions = usb_functions_rndis,
- },
- {
- .product_id = 0x9024,
- .num_functions = ARRAY_SIZE(usb_functions_rndis_adb),
- .functions = usb_functions_rndis_adb,
- },
- };
- static struct usb_mass_storage_platform_data mass_storage_pdata = {
- .nluns = 1,
- .vendor = "Qualcomm Incorporated",
- .product = "Mass storage",
- .release = 0x0100,
- };
- static struct platform_device usb_mass_storage_device = {
- .name = "usb_mass_storage",
- .id = -1,
- .dev = {
- .platform_data = &mass_storage_pdata,
- },
- };
- static struct usb_ether_platform_data rndis_pdata = {
- /* ethaddr is filled by board_serialno_setup */
- .vendorID = 0x05C6,
- .vendorDescr = "Qualcomm Incorporated",
- };
- static struct platform_device rndis_device = {
- .name = "rndis",
- .id = -1,
- .dev = {
- .platform_data = &rndis_pdata,
- },
- };
- static struct android_usb_platform_data android_usb_pdata = {
- .vendor_id = 0x05C6,
- .product_id = 0x9026,
- .version = 0x0100,
- .product_name = "Qualcomm HSUSB Device",
- .manufacturer_name = "Qualcomm Incorporated",
- .num_products = ARRAY_SIZE(usb_products),
- .products = usb_products,
- .num_functions = ARRAY_SIZE(usb_functions_all),
- .functions = usb_functions_all,
- .serial_number = "1234567890ABCDEF",
- };
- static struct platform_device android_usb_device = {
- .name = "android_usb",
-