Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 12 | */ |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 13 | #include <linux/err.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/platform_device.h> |
| 16 | #include <linux/io.h> |
| 17 | #include <linux/irq.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 18 | #include <linux/i2c.h> |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 19 | #include <linux/i2c/sx150x.h> |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 20 | #include <linux/i2c/isl9519.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 21 | #include <linux/gpio.h> |
| 22 | #include <linux/msm_ssbi.h> |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 23 | #include <linux/regulator/msm-gpio-regulator.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 24 | #include <linux/mfd/pm8xxx/pm8921.h> |
Siddartha Mohanadoss | af91d90 | 2011-10-20 10:23:34 -0700 | [diff] [blame] | 25 | #include <linux/mfd/pm8xxx/pm8xxx-adc.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 26 | #include <linux/regulator/consumer.h> |
| 27 | #include <linux/spi/spi.h> |
| 28 | #include <linux/slimbus/slimbus.h> |
| 29 | #include <linux/bootmem.h> |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 30 | #include <linux/cyttsp-qc.h> |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 31 | #include <linux/dma-contiguous.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 32 | #include <linux/dma-mapping.h> |
| 33 | #include <linux/platform_data/qcom_crypto_device.h> |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 34 | #include <linux/platform_data/qcom_wcnss_device.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 35 | #include <linux/leds.h> |
| 36 | #include <linux/leds-pm8xxx.h> |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 37 | #include <linux/i2c/atmel_mxt_ts.h> |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 38 | #include <linux/msm_tsens.h> |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 39 | #include <linux/ks8851.h> |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 40 | #include <linux/i2c/isa1200.h> |
Jack Cheung | 0b1987e | 2011-11-18 13:36:29 -0800 | [diff] [blame] | 41 | #include <linux/memory.h> |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 42 | #include <linux/memblock.h> |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 43 | #include <linux/msm_thermal.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 44 | |
| 45 | #include <asm/mach-types.h> |
| 46 | #include <asm/mach/arch.h> |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 47 | #include <asm/setup.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 48 | #include <asm/hardware/gic.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 49 | #include <asm/mach/mmc.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 50 | |
| 51 | #include <mach/board.h> |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 52 | #include <mach/msm_tspp.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 53 | #include <mach/msm_iomap.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 54 | #include <mach/msm_spi.h> |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 55 | #include <mach/msm_serial_hs.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 56 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 57 | #include <mach/msm_hsusb.h> |
| 58 | #else |
| 59 | #include <linux/usb/msm_hsusb.h> |
| 60 | #endif |
| 61 | #include <linux/usb/android.h> |
| 62 | #include <mach/usbdiag.h> |
| 63 | #include <mach/socinfo.h> |
| 64 | #include <mach/rpm.h> |
Rohit Vaswani | a513aa8d | 2011-07-18 15:14:28 -0700 | [diff] [blame] | 65 | #include <mach/gpiomux.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 66 | #include <mach/msm_bus_board.h> |
| 67 | #include <mach/msm_memtypes.h> |
| 68 | #include <mach/dma.h> |
| 69 | #include <mach/msm_dsps.h> |
| 70 | #include <mach/msm_xo.h> |
Abhijeet Dharmapurikar | 6d565fd | 2011-09-15 18:49:56 -0700 | [diff] [blame] | 71 | #include <mach/restart.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 72 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 73 | #ifdef CONFIG_WCD9310_CODEC |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 74 | #include <linux/mfd/wcd9xxx/core.h> |
| 75 | #include <linux/mfd/wcd9xxx/pdata.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 76 | #endif |
| 77 | |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 78 | #include <linux/smsc3503.h> |
Mitchel Humpherys | cfa31af | 2012-09-06 11:34:03 -0700 | [diff] [blame] | 79 | #include <linux/msm_ion.h> |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 80 | #include <mach/ion.h> |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 81 | #include <mach/mdm2.h> |
Vamsi Krishna | 6aa6b1f | 2011-12-14 22:55:20 -0800 | [diff] [blame] | 82 | #include <mach/mdm-peripheral.h> |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 83 | #include <mach/msm_rtb.h> |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 84 | #include <mach/msm_cache_dump.h> |
| 85 | #include <mach/scm.h> |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 86 | #include <mach/iommu_domains.h> |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 87 | |
Jordan Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 88 | #include <mach/kgsl.h> |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 89 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 90 | #include "timer.h" |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 91 | #include "devices.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 92 | #include "devices-msm8x60.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 93 | #include "spm.h" |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 94 | #include "board-8960.h" |
Matt Wagantall | 7cca464 | 2012-02-01 16:43:24 -0800 | [diff] [blame] | 95 | #include "pm.h" |
Abhijeet Dharmapurikar | efaca4f | 2011-12-27 16:24:07 -0800 | [diff] [blame] | 96 | #include <mach/cpuidle.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 97 | #include "rpm_resources.h" |
Subhash Jadavani | 909e04f | 2012-04-12 10:52:50 +0530 | [diff] [blame] | 98 | #include <mach/mpm.h> |
Matt Wagantall | 33d01f5 | 2012-02-23 23:27:44 -0800 | [diff] [blame] | 99 | #include "clock.h" |
Maheshkumar Sivasubramanian | 8ccc16e | 2011-10-25 15:59:57 -0600 | [diff] [blame] | 100 | #include "pm-boot.h" |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 101 | #include "msm_watchdog.h" |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 102 | #include "platsmp.h" |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 103 | |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 104 | #if defined(CONFIG_BT) && defined(CONFIG_BT_HCIUART_ATH3K) |
| 105 | #include <linux/wlan_plat.h> |
| 106 | #include <linux/mutex.h> |
| 107 | #endif |
| 108 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 109 | static struct platform_device msm_fm_platform_init = { |
| 110 | .name = "iris_fm", |
| 111 | .id = -1, |
| 112 | }; |
| 113 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 114 | #define KS8851_RST_GPIO 89 |
| 115 | #define KS8851_IRQ_GPIO 90 |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 116 | |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 117 | #define MHL_GPIO_INT 4 |
| 118 | #define MHL_GPIO_RESET 15 |
| 119 | |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 120 | #if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE) |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 121 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 122 | struct sx150x_platform_data msm8960_sx150x_data[] = { |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 123 | [SX150X_CAM] = { |
| 124 | .gpio_base = GPIO_CAM_EXPANDER_BASE, |
| 125 | .oscio_is_gpo = false, |
| 126 | .io_pullup_ena = 0x0, |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 127 | .io_pulldn_ena = 0xc0, |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 128 | .io_open_drain_ena = 0x0, |
| 129 | .irq_summary = -1, |
| 130 | }, |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 131 | [SX150X_LIQUID] = { |
| 132 | .gpio_base = GPIO_LIQUID_EXPANDER_BASE, |
| 133 | .oscio_is_gpo = false, |
| 134 | .io_pullup_ena = 0x0c08, |
| 135 | .io_pulldn_ena = 0x4060, |
| 136 | .io_open_drain_ena = 0x000c, |
| 137 | .io_polarity = 0, |
| 138 | .irq_summary = -1, |
| 139 | }, |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 140 | }; |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 141 | |
| 142 | #endif |
| 143 | |
Olav Haugan | a21169d | 2012-01-04 09:17:06 -0800 | [diff] [blame] | 144 | #define MSM_PMEM_ADSP_SIZE 0x7800000 |
Bharath Ramachandramurthy | 2fd017a | 2012-03-13 10:21:09 -0700 | [diff] [blame] | 145 | #define MSM_PMEM_AUDIO_SIZE 0x4CF000 |
Mathew Karimpanal | 15fa5c4 | 2011-12-14 21:28:10 -0800 | [diff] [blame] | 146 | #define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */ |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 147 | #define MSM_LIQUID_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 148 | #define MSM_HDMI_PRIM_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 149 | |
| 150 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 151 | #define HOLE_SIZE 0x20000 |
Rajeshwar Kurapaty | c3e190a | 2012-12-04 19:28:05 +0530 | [diff] [blame] | 152 | #define MSM_ION_MFC_META_SIZE 0x40000 /* 256 Kbytes */ |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 153 | #define MSM_CONTIG_MEM_SIZE 0x65000 |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 154 | #ifdef CONFIG_MSM_IOMMU |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 155 | #define MSM_ION_MM_SIZE 0x3800000 /* Need to be multiple of 64K */ |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 156 | #define MSM_ION_SF_SIZE 0x0 |
Olav Haugan | fbbf05b | 2012-04-05 14:33:41 -0700 | [diff] [blame] | 157 | #define MSM_ION_QSECOM_SIZE 0x780000 /* (7.5MB) */ |
Laura Abbott | 98e8ddc | 2013-02-09 09:35:30 -0800 | [diff] [blame] | 158 | #define MSM_ION_HEAP_NUM 8 |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 159 | #else |
| 160 | #define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE |
| 161 | #define MSM_ION_SF_SIZE MSM_PMEM_SIZE |
Olav Haugan | fbbf05b | 2012-04-05 14:33:41 -0700 | [diff] [blame] | 162 | #define MSM_ION_QSECOM_SIZE 0x600000 /* (6MB) */ |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 163 | #define MSM_ION_HEAP_NUM 8 |
| 164 | #endif |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 165 | #define MSM_ION_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* 128kb */ |
Rajeshwar Kurapaty | c3e190a | 2012-12-04 19:28:05 +0530 | [diff] [blame] | 166 | #define MSM_ION_MFC_SIZE (SZ_8K + MSM_ION_MFC_META_SIZE) |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 167 | #define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 168 | |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 169 | #define MSM_LIQUID_ION_MM_SIZE (MSM_ION_MM_SIZE + 0x600000) |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 170 | #define MSM_LIQUID_ION_SF_SIZE MSM_LIQUID_PMEM_SIZE |
| 171 | #define MSM_HDMI_PRIM_ION_SF_SIZE MSM_HDMI_PRIM_PMEM_SIZE |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 172 | |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 173 | #define MSM_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* 2mb -128kb*/ |
| 174 | #define MSM8960_FIXED_AREA_START (0xa0000000 - (MSM_ION_MM_FW_SIZE + \ |
| 175 | HOLE_SIZE)) |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 176 | #define MAX_FIXED_AREA_SIZE 0x10000000 |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 177 | #define MSM8960_FW_START MSM8960_FIXED_AREA_START |
Laura Abbott | 98e8ddc | 2013-02-09 09:35:30 -0800 | [diff] [blame] | 178 | #define MSM_ION_ADSP_SIZE SZ_8M |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 179 | |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 180 | static unsigned msm_ion_sf_size = MSM_ION_SF_SIZE; |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 181 | #else |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 182 | #define MSM_CONTIG_MEM_SIZE 0x110C000 |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 183 | #define MSM_ION_HEAP_NUM 1 |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 184 | #endif |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 185 | |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 186 | #ifdef CONFIG_KERNEL_MSM_CONTIG_MEM_REGION |
| 187 | static unsigned msm_contig_mem_size = MSM_CONTIG_MEM_SIZE; |
| 188 | static int __init msm_contig_mem_size_setup(char *p) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 189 | { |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 190 | msm_contig_mem_size = memparse(p, NULL); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 191 | return 0; |
| 192 | } |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 193 | early_param("msm_contig_mem_size", msm_contig_mem_size_setup); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 194 | #endif |
| 195 | |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 196 | #define DSP_RAM_BASE_8960 0x8da00000 |
| 197 | #define DSP_RAM_SIZE_8960 0x1800000 |
| 198 | static int dspcrashd_pdata_8960 = 0xDEADDEAD; |
| 199 | |
| 200 | static struct resource resources_dspcrashd_8960[] = { |
| 201 | { |
| 202 | .name = "msm_dspcrashd", |
| 203 | .start = DSP_RAM_BASE_8960, |
| 204 | .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960, |
| 205 | .flags = IORESOURCE_DMA, |
| 206 | }, |
| 207 | }; |
| 208 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame] | 209 | static struct platform_device msm_device_dspcrashd_8960 = { |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 210 | .name = "msm_dspcrashd", |
| 211 | .num_resources = ARRAY_SIZE(resources_dspcrashd_8960), |
| 212 | .resource = resources_dspcrashd_8960, |
| 213 | .dev = { .platform_data = &dspcrashd_pdata_8960 }, |
| 214 | }; |
| 215 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 216 | static struct memtype_reserve msm8960_reserve_table[] __initdata = { |
| 217 | [MEMTYPE_SMI] = { |
| 218 | }, |
| 219 | [MEMTYPE_EBI0] = { |
| 220 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 221 | }, |
| 222 | [MEMTYPE_EBI1] = { |
| 223 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 224 | }, |
| 225 | }; |
| 226 | |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 227 | static void __init reserve_rtb_memory(void) |
| 228 | { |
| 229 | #if defined(CONFIG_MSM_RTB) |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 230 | msm8960_reserve_table[MEMTYPE_EBI1].size += msm8960_rtb_pdata.size; |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 231 | #endif |
| 232 | } |
| 233 | |
Laura Abbott | 938d750 | 2013-04-09 10:44:16 -0700 | [diff] [blame] | 234 | static int msm8960_paddr_to_memtype(phys_addr_t paddr) |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 235 | { |
| 236 | return MEMTYPE_EBI1; |
| 237 | } |
| 238 | |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 239 | #define FMEM_ENABLED 0 |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 240 | |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 241 | #ifdef CONFIG_ION_MSM |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 242 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 243 | static struct ion_cp_heap_pdata cp_mm_msm8960_ion_pdata = { |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 244 | .permission_type = IPT_TYPE_MM_CARVEOUT, |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 245 | .align = SZ_64K, |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 246 | .fixed_position = FIXED_MIDDLE, |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 247 | .iommu_map_all = 1, |
| 248 | .iommu_2x_map_domain = VIDEO_DOMAIN, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 249 | }; |
| 250 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 251 | static struct ion_cp_heap_pdata cp_mfc_msm8960_ion_pdata = { |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 252 | .permission_type = IPT_TYPE_MFC_SHAREDMEM, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 253 | .align = PAGE_SIZE, |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 254 | .fixed_position = FIXED_HIGH, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 255 | }; |
| 256 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 257 | static struct ion_co_heap_pdata co_msm8960_ion_pdata = { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 258 | .adjacent_mem_id = INVALID_HEAP_ID, |
| 259 | .align = PAGE_SIZE, |
| 260 | }; |
| 261 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 262 | static struct ion_co_heap_pdata fw_co_msm8960_ion_pdata = { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 263 | .adjacent_mem_id = ION_CP_MM_HEAP_ID, |
| 264 | .align = SZ_128K, |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 265 | .fixed_position = FIXED_LOW, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 266 | }; |
| 267 | #endif |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 268 | |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 269 | static u64 msm_dmamask = DMA_BIT_MASK(32); |
| 270 | |
| 271 | static struct platform_device ion_mm_heap_device = { |
| 272 | .name = "ion-mm-heap-device", |
| 273 | .id = -1, |
| 274 | .dev = { |
| 275 | .dma_mask = &msm_dmamask, |
| 276 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 277 | } |
| 278 | }; |
| 279 | |
Laura Abbott | 98e8ddc | 2013-02-09 09:35:30 -0800 | [diff] [blame] | 280 | static struct platform_device ion_adsp_heap_device = { |
| 281 | .name = "ion-adsp-heap-device", |
| 282 | .id = -1, |
| 283 | .dev = { |
| 284 | .dma_mask = &msm_dmamask, |
| 285 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 286 | } |
| 287 | }; |
| 288 | |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 289 | /** |
| 290 | * These heaps are listed in the order they will be allocated. Due to |
| 291 | * video hardware restrictions and content protection the FW heap has to |
| 292 | * be allocated adjacent (below) the MM heap and the MFC heap has to be |
| 293 | * allocated after the MM heap to ensure MFC heap is not more than 256MB |
| 294 | * away from the base address of the FW heap. |
| 295 | * However, the order of FW heap and MM heap doesn't matter since these |
| 296 | * two heaps are taken care of by separate code to ensure they are adjacent |
| 297 | * to each other. |
| 298 | * Don't swap the order unless you know what you are doing! |
| 299 | */ |
Benjamin Gaignard | 63d8103 | 2012-06-25 15:27:30 -0700 | [diff] [blame] | 300 | struct ion_platform_heap msm8960_heaps[] = { |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 301 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 302 | .id = ION_SYSTEM_HEAP_ID, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 303 | .type = ION_HEAP_TYPE_SYSTEM, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 304 | .name = ION_VMALLOC_HEAP_NAME, |
| 305 | }, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 306 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 307 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 308 | .id = ION_CP_MM_HEAP_ID, |
Olav Haugan | 0a85251 | 2012-01-09 10:20:55 -0800 | [diff] [blame] | 309 | .type = ION_HEAP_TYPE_CP, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 310 | .name = ION_MM_HEAP_NAME, |
| 311 | .size = MSM_ION_MM_SIZE, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 312 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 313 | .extra_data = (void *) &cp_mm_msm8960_ion_pdata, |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 314 | .priv = &ion_mm_heap_device.dev, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 315 | }, |
Laura Abbott | 8c01736 | 2011-09-22 20:59:12 -0700 | [diff] [blame] | 316 | { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 317 | .id = ION_MM_FIRMWARE_HEAP_ID, |
| 318 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 319 | .name = ION_MM_FIRMWARE_HEAP_NAME, |
| 320 | .size = MSM_ION_MM_FW_SIZE, |
| 321 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 322 | .extra_data = (void *) &fw_co_msm8960_ion_pdata, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 323 | }, |
| 324 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 325 | .id = ION_CP_MFC_HEAP_ID, |
Olav Haugan | 0a85251 | 2012-01-09 10:20:55 -0800 | [diff] [blame] | 326 | .type = ION_HEAP_TYPE_CP, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 327 | .name = ION_MFC_HEAP_NAME, |
| 328 | .size = MSM_ION_MFC_SIZE, |
| 329 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 330 | .extra_data = (void *) &cp_mfc_msm8960_ion_pdata, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 331 | }, |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 332 | #ifndef CONFIG_MSM_IOMMU |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 333 | { |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 334 | .id = ION_SF_HEAP_ID, |
| 335 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 336 | .name = ION_SF_HEAP_NAME, |
| 337 | .size = MSM_ION_SF_SIZE, |
| 338 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 339 | .extra_data = (void *) &co_msm8960_ion_pdata, |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 340 | }, |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 341 | #endif |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 342 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 343 | .id = ION_IOMMU_HEAP_ID, |
Laura Abbott | 8c01736 | 2011-09-22 20:59:12 -0700 | [diff] [blame] | 344 | .type = ION_HEAP_TYPE_IOMMU, |
| 345 | .name = ION_IOMMU_HEAP_NAME, |
| 346 | }, |
Olav Haugan | 80854eb | 2012-01-12 12:00:23 -0800 | [diff] [blame] | 347 | { |
| 348 | .id = ION_QSECOM_HEAP_ID, |
| 349 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 350 | .name = ION_QSECOM_HEAP_NAME, |
| 351 | .size = MSM_ION_QSECOM_SIZE, |
| 352 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 353 | .extra_data = (void *) &co_msm8960_ion_pdata, |
Olav Haugan | 80854eb | 2012-01-12 12:00:23 -0800 | [diff] [blame] | 354 | }, |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 355 | { |
| 356 | .id = ION_AUDIO_HEAP_ID, |
| 357 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 358 | .name = ION_AUDIO_HEAP_NAME, |
| 359 | .size = MSM_ION_AUDIO_SIZE, |
| 360 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 361 | .extra_data = (void *) &co_msm8960_ion_pdata, |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 362 | }, |
Laura Abbott | 98e8ddc | 2013-02-09 09:35:30 -0800 | [diff] [blame] | 363 | { |
| 364 | .id = ION_ADSP_HEAP_ID, |
| 365 | .type = ION_HEAP_TYPE_DMA, |
| 366 | .name = ION_ADSP_HEAP_NAME, |
| 367 | .size = MSM_ION_ADSP_SIZE, |
| 368 | .memory_type = ION_EBI_TYPE, |
| 369 | .extra_data = (void *) &co_msm8960_ion_pdata, |
| 370 | .priv = &ion_adsp_heap_device.dev, |
| 371 | }, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 372 | #endif |
Benjamin Gaignard | 63d8103 | 2012-06-25 15:27:30 -0700 | [diff] [blame] | 373 | }; |
| 374 | |
| 375 | static struct ion_platform_data msm8960_ion_pdata = { |
| 376 | .nr = MSM_ION_HEAP_NUM, |
| 377 | .heaps = msm8960_heaps, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 378 | }; |
| 379 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 380 | static struct platform_device msm8960_ion_dev = { |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 381 | .name = "ion-msm", |
| 382 | .id = 1, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 383 | .dev = { .platform_data = &msm8960_ion_pdata }, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 384 | }; |
| 385 | #endif |
| 386 | |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 387 | static void __init adjust_mem_for_liquid(void) |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 388 | { |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 389 | unsigned int i; |
| 390 | |
Laura Abbott | f3aada4 | 2013-03-08 14:44:52 -0800 | [diff] [blame] | 391 | if (machine_is_msm8960_liquid()) |
| 392 | msm_ion_sf_size = MSM_LIQUID_ION_SF_SIZE; |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 393 | |
Laura Abbott | f3aada4 | 2013-03-08 14:44:52 -0800 | [diff] [blame] | 394 | if (msm8960_hdmi_as_primary_selected()) |
| 395 | msm_ion_sf_size = MSM_HDMI_PRIM_ION_SF_SIZE; |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 396 | |
Laura Abbott | f3aada4 | 2013-03-08 14:44:52 -0800 | [diff] [blame] | 397 | if (machine_is_msm8960_liquid() || |
| 398 | msm8960_hdmi_as_primary_selected()) { |
| 399 | for (i = 0; i < msm8960_ion_pdata.nr; i++) { |
| 400 | if (msm8960_ion_pdata.heaps[i].id == |
| 401 | ION_SF_HEAP_ID) { |
| 402 | msm8960_ion_pdata.heaps[i].size = |
| 403 | msm_ion_sf_size; |
| 404 | pr_debug("msm_ion_sf_size 0x%x\n", |
| 405 | msm_ion_sf_size); |
| 406 | break; |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 407 | } |
| 408 | } |
| 409 | } |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 410 | } |
| 411 | |
| 412 | static void __init reserve_mem_for_ion(enum ion_memory_types mem_type, |
| 413 | unsigned long size) |
| 414 | { |
| 415 | msm8960_reserve_table[mem_type].size += size; |
| 416 | } |
| 417 | |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 418 | static void __init msm8960_reserve_fixed_area(unsigned long fixed_area_size) |
| 419 | { |
| 420 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
| 421 | int ret; |
| 422 | |
| 423 | if (fixed_area_size > MAX_FIXED_AREA_SIZE) |
| 424 | panic("fixed area size is larger than %dM\n", |
| 425 | MAX_FIXED_AREA_SIZE >> 20); |
| 426 | |
| 427 | reserve_info->fixed_area_size = fixed_area_size; |
| 428 | reserve_info->fixed_area_start = MSM8960_FW_START; |
| 429 | |
| 430 | ret = memblock_remove(reserve_info->fixed_area_start, |
| 431 | reserve_info->fixed_area_size); |
| 432 | BUG_ON(ret); |
| 433 | #endif |
| 434 | } |
| 435 | |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 436 | /** |
Larry Bassel | d653d09 | 2013-06-20 10:46:21 -0700 | [diff] [blame^] | 437 | * Reserve memory for ION. Also handle special case |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 438 | * for video heaps (MM,FW, and MFC). Video requires heaps MM and MFC to be |
| 439 | * at a higher address than FW in addition to not more than 256MB away from the |
Larry Bassel | d653d09 | 2013-06-20 10:46:21 -0700 | [diff] [blame^] | 440 | * base address of the firmware. In addition the MM heap must be |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 441 | * adjacent to the FW heap for content protection purposes. |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 442 | */ |
| 443 | static void __init reserve_ion_memory(void) |
| 444 | { |
| 445 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
| 446 | unsigned int i; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 447 | int ret; |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 448 | unsigned int fixed_size = 0; |
| 449 | unsigned int fixed_low_size, fixed_middle_size, fixed_high_size; |
| 450 | unsigned long fixed_low_start, fixed_middle_start, fixed_high_start; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 451 | unsigned long cma_alignment; |
| 452 | unsigned int low_use_cma = 0; |
| 453 | unsigned int middle_use_cma = 0; |
| 454 | unsigned int high_use_cma = 0; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 455 | |
| 456 | adjust_mem_for_liquid(); |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 457 | fixed_low_size = 0; |
| 458 | fixed_middle_size = 0; |
| 459 | fixed_high_size = 0; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 460 | |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 461 | cma_alignment = PAGE_SIZE << max(MAX_ORDER, pageblock_order); |
| 462 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 463 | for (i = 0; i < msm8960_ion_pdata.nr; ++i) { |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 464 | struct ion_platform_heap *heap = |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 465 | &(msm8960_ion_pdata.heaps[i]); |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 466 | int align = SZ_4K; |
| 467 | int iommu_map_all = 0; |
| 468 | int adjacent_mem_id = INVALID_HEAP_ID; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 469 | int use_cma = 0; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 470 | |
| 471 | if (heap->extra_data) { |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 472 | int fixed_position = NOT_FIXED; |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 473 | |
Mitchel Humpherys | 362b52b | 2012-09-13 10:53:22 -0700 | [diff] [blame] | 474 | switch ((int) heap->type) { |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 475 | case ION_HEAP_TYPE_CP: |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 476 | fixed_position = ((struct ion_cp_heap_pdata *) |
| 477 | heap->extra_data)->fixed_position; |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 478 | align = ((struct ion_cp_heap_pdata *) |
| 479 | heap->extra_data)->align; |
| 480 | iommu_map_all = |
| 481 | ((struct ion_cp_heap_pdata *) |
| 482 | heap->extra_data)->iommu_map_all; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 483 | if (((struct ion_cp_heap_pdata *) |
| 484 | heap->extra_data)->is_cma) { |
| 485 | heap->size = ALIGN(heap->size, |
| 486 | cma_alignment); |
| 487 | use_cma = 1; |
| 488 | } |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 489 | break; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 490 | case ION_HEAP_TYPE_DMA: |
| 491 | use_cma = 1; |
| 492 | /* Purposely fall through here */ |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 493 | case ION_HEAP_TYPE_CARVEOUT: |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 494 | fixed_position = ((struct ion_co_heap_pdata *) |
| 495 | heap->extra_data)->fixed_position; |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 496 | adjacent_mem_id = ((struct ion_co_heap_pdata *) |
| 497 | heap->extra_data)->adjacent_mem_id; |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 498 | break; |
| 499 | default: |
| 500 | break; |
| 501 | } |
| 502 | |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 503 | if (iommu_map_all) { |
| 504 | if (heap->size & (SZ_64K-1)) { |
| 505 | heap->size = ALIGN(heap->size, SZ_64K); |
| 506 | pr_info("Heap %s not aligned to 64K. Adjusting size to %x\n", |
| 507 | heap->name, heap->size); |
| 508 | } |
| 509 | } |
| 510 | |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 511 | if (fixed_position != NOT_FIXED) |
| 512 | fixed_size += heap->size; |
Chintan Pandya | 07f05cd | 2013-04-12 14:50:29 +0530 | [diff] [blame] | 513 | else if (!use_cma) |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 514 | reserve_mem_for_ion(MEMTYPE_EBI1, heap->size); |
| 515 | |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 516 | if (fixed_position == FIXED_LOW) { |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 517 | fixed_low_size += heap->size; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 518 | low_use_cma = use_cma; |
| 519 | } else if (fixed_position == FIXED_MIDDLE) { |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 520 | fixed_middle_size += heap->size; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 521 | middle_use_cma = use_cma; |
| 522 | } else if (fixed_position == FIXED_HIGH) { |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 523 | fixed_high_size += heap->size; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 524 | high_use_cma = use_cma; |
| 525 | } else if (use_cma) { |
| 526 | /* |
| 527 | * Heaps that use CMA but are not part of the |
| 528 | * fixed set. Create wherever. |
| 529 | */ |
| 530 | dma_declare_contiguous( |
| 531 | heap->priv, |
| 532 | heap->size, |
| 533 | 0, |
| 534 | 0xb0000000); |
| 535 | } |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 536 | } |
| 537 | } |
| 538 | |
| 539 | if (!fixed_size) |
| 540 | return; |
| 541 | |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 542 | /* |
| 543 | * Given the setup for the fixed area, we can't round up all sizes. |
| 544 | * Some sizes must be set up exactly and aligned correctly. Incorrect |
| 545 | * alignments are considered a configuration issue |
Larry Bassel | 4d4f448 | 2012-04-04 11:26:09 -0700 | [diff] [blame] | 546 | */ |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 547 | |
| 548 | fixed_low_start = MSM8960_FIXED_AREA_START; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 549 | if (low_use_cma) { |
| 550 | BUG_ON(!IS_ALIGNED(fixed_low_start, cma_alignment)); |
| 551 | BUG_ON(!IS_ALIGNED(fixed_low_size + HOLE_SIZE, cma_alignment)); |
| 552 | } else { |
| 553 | BUG_ON(!IS_ALIGNED(fixed_low_size + HOLE_SIZE, SECTION_SIZE)); |
| 554 | ret = memblock_remove(fixed_low_start, |
| 555 | fixed_low_size + HOLE_SIZE); |
| 556 | BUG_ON(ret); |
| 557 | } |
| 558 | |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 559 | fixed_middle_start = fixed_low_start + fixed_low_size + HOLE_SIZE; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 560 | if (middle_use_cma) { |
| 561 | BUG_ON(!IS_ALIGNED(fixed_middle_start, cma_alignment)); |
| 562 | BUG_ON(!IS_ALIGNED(fixed_middle_size, cma_alignment)); |
| 563 | } else { |
| 564 | BUG_ON(!IS_ALIGNED(fixed_middle_size, SECTION_SIZE)); |
| 565 | ret = memblock_remove(fixed_middle_start, fixed_middle_size); |
| 566 | BUG_ON(ret); |
| 567 | } |
| 568 | |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 569 | fixed_high_start = fixed_middle_start + fixed_middle_size; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 570 | if (high_use_cma) { |
| 571 | fixed_high_size = ALIGN(fixed_high_size, cma_alignment); |
| 572 | BUG_ON(!IS_ALIGNED(fixed_high_start, cma_alignment)); |
| 573 | } else { |
| 574 | /* This is the end of the fixed area so it's okay to round up */ |
| 575 | fixed_high_size = ALIGN(fixed_high_size, SECTION_SIZE); |
| 576 | ret = memblock_remove(fixed_high_start, fixed_high_size); |
| 577 | BUG_ON(ret); |
| 578 | } |
| 579 | |
| 580 | |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 581 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 582 | for (i = 0; i < msm8960_ion_pdata.nr; ++i) { |
| 583 | struct ion_platform_heap *heap = &(msm8960_ion_pdata.heaps[i]); |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 584 | |
| 585 | if (heap->extra_data) { |
| 586 | int fixed_position = NOT_FIXED; |
Steve Muckle | 75c34ca | 2012-06-12 14:27:40 -0700 | [diff] [blame] | 587 | struct ion_cp_heap_pdata *pdata = NULL; |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 588 | |
Mitchel Humpherys | 362b52b | 2012-09-13 10:53:22 -0700 | [diff] [blame] | 589 | switch ((int) heap->type) { |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 590 | case ION_HEAP_TYPE_CP: |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 591 | pdata = |
| 592 | (struct ion_cp_heap_pdata *)heap->extra_data; |
| 593 | fixed_position = pdata->fixed_position; |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 594 | break; |
| 595 | case ION_HEAP_TYPE_CARVEOUT: |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 596 | case ION_HEAP_TYPE_DMA: |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 597 | fixed_position = ((struct ion_co_heap_pdata *) |
| 598 | heap->extra_data)->fixed_position; |
| 599 | break; |
| 600 | default: |
| 601 | break; |
| 602 | } |
| 603 | |
| 604 | switch (fixed_position) { |
| 605 | case FIXED_LOW: |
| 606 | heap->base = fixed_low_start; |
| 607 | break; |
| 608 | case FIXED_MIDDLE: |
| 609 | heap->base = fixed_middle_start; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 610 | if (middle_use_cma) { |
| 611 | ret = dma_declare_contiguous( |
| 612 | &ion_mm_heap_device.dev, |
| 613 | heap->size, |
| 614 | fixed_middle_start, |
| 615 | 0xa0000000); |
| 616 | WARN_ON(ret); |
| 617 | } |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 618 | pdata->secure_base = fixed_middle_start |
| 619 | - HOLE_SIZE; |
| 620 | pdata->secure_size = HOLE_SIZE + heap->size; |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 621 | break; |
| 622 | case FIXED_HIGH: |
| 623 | heap->base = fixed_high_start; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 624 | break; |
| 625 | default: |
| 626 | break; |
| 627 | } |
| 628 | } |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 629 | } |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 630 | #endif |
| 631 | } |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 632 | |
| 633 | static void __init reserve_mdp_memory(void) |
| 634 | { |
| 635 | msm8960_mdp_writeback(msm8960_reserve_table); |
| 636 | } |
| 637 | |
Stephen Boyd | 668d765 | 2012-04-25 11:31:01 -0700 | [diff] [blame] | 638 | static void __init reserve_cache_dump_memory(void) |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 639 | { |
| 640 | #ifdef CONFIG_MSM_CACHE_DUMP |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 641 | unsigned int total; |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 642 | |
Laura Abbott | 155ab6f | 2012-05-25 08:52:18 -0700 | [diff] [blame] | 643 | total = msm8960_cache_dump_pdata.l1_size + |
| 644 | msm8960_cache_dump_pdata.l2_size; |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 645 | msm8960_reserve_table[MEMTYPE_EBI1].size += total; |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 646 | #endif |
| 647 | } |
| 648 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 649 | static void __init msm8960_calculate_reserve_sizes(void) |
| 650 | { |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 651 | reserve_ion_memory(); |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 652 | reserve_mdp_memory(); |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 653 | reserve_rtb_memory(); |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 654 | reserve_cache_dump_memory(); |
Laura Abbott | f3aada4 | 2013-03-08 14:44:52 -0800 | [diff] [blame] | 655 | msm8960_reserve_table[MEMTYPE_EBI1].size += msm_contig_mem_size; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 656 | } |
| 657 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 658 | static struct reserve_info msm8960_reserve_info __initdata = { |
| 659 | .memtype_reserve_table = msm8960_reserve_table, |
| 660 | .calculate_reserve_sizes = msm8960_calculate_reserve_sizes, |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 661 | .reserve_fixed_area = msm8960_reserve_fixed_area, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 662 | .paddr_to_memtype = msm8960_paddr_to_memtype, |
| 663 | }; |
| 664 | |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 665 | static void __init msm8960_early_memory(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 666 | { |
| 667 | reserve_info = &msm8960_reserve_info; |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 668 | } |
| 669 | |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 670 | static char prim_panel_name[PANEL_NAME_MAX_LEN]; |
| 671 | static char ext_panel_name[PANEL_NAME_MAX_LEN]; |
| 672 | static int __init prim_display_setup(char *param) |
| 673 | { |
| 674 | if (strnlen(param, PANEL_NAME_MAX_LEN)) |
| 675 | strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN); |
| 676 | return 0; |
| 677 | } |
| 678 | early_param("prim_display", prim_display_setup); |
| 679 | |
| 680 | static int __init ext_display_setup(char *param) |
| 681 | { |
| 682 | if (strnlen(param, PANEL_NAME_MAX_LEN)) |
| 683 | strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN); |
| 684 | return 0; |
| 685 | } |
| 686 | early_param("ext_display", ext_display_setup); |
| 687 | |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 688 | static void __init msm8960_reserve(void) |
| 689 | { |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 690 | msm8960_set_display_params(prim_panel_name, ext_panel_name); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 691 | msm_reserve(); |
| 692 | } |
| 693 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 694 | static void __init msm8960_allocate_memory_regions(void) |
| 695 | { |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 696 | msm8960_allocate_fb_region(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 697 | } |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 698 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 699 | #ifdef CONFIG_WCD9310_CODEC |
| 700 | |
| 701 | #define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS) |
| 702 | |
Patrick Lai | 3043fba | 2011-08-01 14:15:57 -0700 | [diff] [blame] | 703 | /* Micbias setting is based on 8660 CDP/MTP/FLUID requirement |
| 704 | * 4 micbiases are used to power various analog and digital |
| 705 | * microphones operating at 1800 mV. Technically, all micbiases |
| 706 | * can source from single cfilter since all microphones operate |
| 707 | * at the same voltage level. The arrangement below is to make |
| 708 | * sure all cfilters are exercised. LDO_H regulator ouput level |
| 709 | * does not need to be as high as 2.85V. It is choosen for |
| 710 | * microphone sensitivity purpose. |
| 711 | */ |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 712 | static struct wcd9xxx_pdata tabla_platform_data = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 713 | .slimbus_slave_device = { |
| 714 | .name = "tabla-slave", |
| 715 | .e_addr = {0, 0, 0x10, 0, 0x17, 2}, |
| 716 | }, |
| 717 | .irq = MSM_GPIO_TO_INT(62), |
| 718 | .irq_base = TABLA_INTERRUPT_BASE, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 719 | .num_irqs = NR_WCD9XXX_IRQS, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 720 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
Patrick Lai | 3043fba | 2011-08-01 14:15:57 -0700 | [diff] [blame] | 721 | .micbias = { |
| 722 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 723 | .cfilt1_mv = 1800, |
Joonwoo Park | cf473b4 | 2012-03-29 19:48:16 -0700 | [diff] [blame] | 724 | .cfilt2_mv = 2700, |
Patrick Lai | 3043fba | 2011-08-01 14:15:57 -0700 | [diff] [blame] | 725 | .cfilt3_mv = 1800, |
| 726 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 727 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 728 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 729 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 730 | }, |
| 731 | .regulator = { |
| 732 | { |
| 733 | .name = "CDC_VDD_CP", |
| 734 | .min_uV = 1800000, |
| 735 | .max_uV = 1800000, |
| 736 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 737 | }, |
| 738 | { |
| 739 | .name = "CDC_VDDA_RX", |
| 740 | .min_uV = 1800000, |
| 741 | .max_uV = 1800000, |
| 742 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 743 | }, |
| 744 | { |
| 745 | .name = "CDC_VDDA_TX", |
| 746 | .min_uV = 1800000, |
| 747 | .max_uV = 1800000, |
| 748 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 749 | }, |
| 750 | { |
| 751 | .name = "VDDIO_CDC", |
| 752 | .min_uV = 1800000, |
| 753 | .max_uV = 1800000, |
| 754 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 755 | }, |
| 756 | { |
| 757 | .name = "VDDD_CDC_D", |
| 758 | .min_uV = 1225000, |
David Collins | 8f2a196 | 2012-05-18 09:47:59 -0700 | [diff] [blame] | 759 | .max_uV = 1250000, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 760 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 761 | }, |
| 762 | { |
| 763 | .name = "CDC_VDDA_A_1P2V", |
| 764 | .min_uV = 1225000, |
David Collins | 8f2a196 | 2012-05-18 09:47:59 -0700 | [diff] [blame] | 765 | .max_uV = 1250000, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 766 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 767 | }, |
| 768 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 769 | }; |
| 770 | |
| 771 | static struct slim_device msm_slim_tabla = { |
| 772 | .name = "tabla-slim", |
| 773 | .e_addr = {0, 1, 0x10, 0, 0x17, 2}, |
| 774 | .dev = { |
| 775 | .platform_data = &tabla_platform_data, |
| 776 | }, |
| 777 | }; |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 778 | |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 779 | static struct wcd9xxx_pdata tabla20_platform_data = { |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 780 | .slimbus_slave_device = { |
| 781 | .name = "tabla-slave", |
| 782 | .e_addr = {0, 0, 0x60, 0, 0x17, 2}, |
| 783 | }, |
| 784 | .irq = MSM_GPIO_TO_INT(62), |
| 785 | .irq_base = TABLA_INTERRUPT_BASE, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 786 | .num_irqs = NR_WCD9XXX_IRQS, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 787 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 788 | .micbias = { |
| 789 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 790 | .cfilt1_mv = 1800, |
Joonwoo Park | cf473b4 | 2012-03-29 19:48:16 -0700 | [diff] [blame] | 791 | .cfilt2_mv = 2700, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 792 | .cfilt3_mv = 1800, |
| 793 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 794 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 795 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 796 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 797 | }, |
| 798 | .regulator = { |
| 799 | { |
| 800 | .name = "CDC_VDD_CP", |
| 801 | .min_uV = 1800000, |
| 802 | .max_uV = 1800000, |
| 803 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 804 | }, |
| 805 | { |
| 806 | .name = "CDC_VDDA_RX", |
| 807 | .min_uV = 1800000, |
| 808 | .max_uV = 1800000, |
| 809 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 810 | }, |
| 811 | { |
| 812 | .name = "CDC_VDDA_TX", |
| 813 | .min_uV = 1800000, |
| 814 | .max_uV = 1800000, |
| 815 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 816 | }, |
| 817 | { |
| 818 | .name = "VDDIO_CDC", |
| 819 | .min_uV = 1800000, |
| 820 | .max_uV = 1800000, |
| 821 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 822 | }, |
| 823 | { |
| 824 | .name = "VDDD_CDC_D", |
| 825 | .min_uV = 1225000, |
David Collins | 8f2a196 | 2012-05-18 09:47:59 -0700 | [diff] [blame] | 826 | .max_uV = 1250000, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 827 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 828 | }, |
| 829 | { |
| 830 | .name = "CDC_VDDA_A_1P2V", |
| 831 | .min_uV = 1225000, |
David Collins | 8f2a196 | 2012-05-18 09:47:59 -0700 | [diff] [blame] | 832 | .max_uV = 1250000, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 833 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 834 | }, |
| 835 | }, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 836 | }; |
| 837 | |
| 838 | static struct slim_device msm_slim_tabla20 = { |
| 839 | .name = "tabla2x-slim", |
| 840 | .e_addr = {0, 1, 0x60, 0, 0x17, 2}, |
| 841 | .dev = { |
| 842 | .platform_data = &tabla20_platform_data, |
| 843 | }, |
| 844 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 845 | #endif |
| 846 | |
| 847 | static struct slim_boardinfo msm_slim_devices[] = { |
| 848 | #ifdef CONFIG_WCD9310_CODEC |
| 849 | { |
| 850 | .bus_num = 1, |
| 851 | .slim_slave = &msm_slim_tabla, |
| 852 | }, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 853 | { |
| 854 | .bus_num = 1, |
| 855 | .slim_slave = &msm_slim_tabla20, |
| 856 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 857 | #endif |
| 858 | /* add more slimbus slaves as needed */ |
| 859 | }; |
| 860 | |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 861 | #define MSM_WCNSS_PHYS 0x03000000 |
| 862 | #define MSM_WCNSS_SIZE 0x280000 |
| 863 | |
| 864 | static struct resource resources_wcnss_wlan[] = { |
| 865 | { |
| 866 | .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 867 | .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 868 | .name = "wcnss_wlanrx_irq", |
| 869 | .flags = IORESOURCE_IRQ, |
| 870 | }, |
| 871 | { |
| 872 | .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 873 | .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 874 | .name = "wcnss_wlantx_irq", |
| 875 | .flags = IORESOURCE_IRQ, |
| 876 | }, |
| 877 | { |
| 878 | .start = MSM_WCNSS_PHYS, |
| 879 | .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1, |
| 880 | .name = "wcnss_mmio", |
| 881 | .flags = IORESOURCE_MEM, |
| 882 | }, |
Ankur Nandwani | ad0d9ac | 2011-09-26 11:49:25 -0700 | [diff] [blame] | 883 | { |
| 884 | .start = 84, |
| 885 | .end = 88, |
| 886 | .name = "wcnss_gpios_5wire", |
| 887 | .flags = IORESOURCE_IO, |
| 888 | }, |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 889 | }; |
| 890 | |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 891 | static struct qcom_wcnss_opts qcom_wcnss_pdata = { |
| 892 | .has_48mhz_xo = 1, |
| 893 | }; |
| 894 | |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 895 | static struct platform_device msm_device_wcnss_wlan = { |
| 896 | .name = "wcnss_wlan", |
| 897 | .id = 0, |
| 898 | .num_resources = ARRAY_SIZE(resources_wcnss_wlan), |
| 899 | .resource = resources_wcnss_wlan, |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 900 | .dev = {.platform_data = &qcom_wcnss_pdata}, |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 901 | }; |
| 902 | |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 903 | #ifdef CONFIG_QSEECOM |
| 904 | /* qseecom bus scaling */ |
| 905 | static struct msm_bus_vectors qseecom_clks_init_vectors[] = { |
| 906 | { |
| 907 | .src = MSM_BUS_MASTER_SPS, |
| 908 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 909 | .ib = 0, |
| 910 | .ab = 0, |
| 911 | }, |
| 912 | { |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 913 | .src = MSM_BUS_MASTER_SPS, |
| 914 | .dst = MSM_BUS_SLAVE_SPS, |
| 915 | .ib = 0, |
| 916 | .ab = 0, |
| 917 | }, |
| 918 | { |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 919 | .src = MSM_BUS_MASTER_SPDM, |
| 920 | .dst = MSM_BUS_SLAVE_SPDM, |
| 921 | .ib = 0, |
| 922 | .ab = 0, |
| 923 | }, |
| 924 | }; |
| 925 | |
| 926 | static struct msm_bus_vectors qseecom_enable_dfab_vectors[] = { |
| 927 | { |
| 928 | .src = MSM_BUS_MASTER_SPS, |
| 929 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 930 | .ib = (492 * 8) * 1000000UL, |
| 931 | .ab = (492 * 8) * 100000UL, |
| 932 | }, |
| 933 | { |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 934 | .src = MSM_BUS_MASTER_SPS, |
| 935 | .dst = MSM_BUS_SLAVE_SPS, |
| 936 | .ib = (492 * 8) * 1000000UL, |
| 937 | .ab = (492 * 8) * 100000UL, |
| 938 | }, |
| 939 | { |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 940 | .src = MSM_BUS_MASTER_SPDM, |
| 941 | .dst = MSM_BUS_SLAVE_SPDM, |
| 942 | .ib = 0, |
| 943 | .ab = 0, |
| 944 | }, |
| 945 | }; |
| 946 | |
| 947 | static struct msm_bus_vectors qseecom_enable_sfpb_vectors[] = { |
| 948 | { |
| 949 | .src = MSM_BUS_MASTER_SPS, |
| 950 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 951 | .ib = 0, |
| 952 | .ab = 0, |
| 953 | }, |
| 954 | { |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 955 | .src = MSM_BUS_MASTER_SPS, |
| 956 | .dst = MSM_BUS_SLAVE_SPS, |
| 957 | .ib = 0, |
| 958 | .ab = 0, |
| 959 | }, |
| 960 | { |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 961 | .src = MSM_BUS_MASTER_SPDM, |
| 962 | .dst = MSM_BUS_SLAVE_SPDM, |
| 963 | .ib = (64 * 8) * 1000000UL, |
| 964 | .ab = (64 * 8) * 100000UL, |
| 965 | }, |
| 966 | }; |
| 967 | |
Ramesh Masavarapu | 8d75658 | 2012-10-03 10:18:06 -0700 | [diff] [blame] | 968 | static struct msm_bus_vectors qseecom_enable_dfab_sfpb_vectors[] = { |
| 969 | { |
| 970 | .src = MSM_BUS_MASTER_SPS, |
| 971 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 972 | .ib = (492 * 8) * 1000000UL, |
| 973 | .ab = (492 * 8) * 100000UL, |
| 974 | }, |
| 975 | { |
| 976 | .src = MSM_BUS_MASTER_SPS, |
| 977 | .dst = MSM_BUS_SLAVE_SPS, |
| 978 | .ib = (492 * 8) * 1000000UL, |
| 979 | .ab = (492 * 8) * 100000UL, |
| 980 | }, |
| 981 | { |
| 982 | .src = MSM_BUS_MASTER_SPDM, |
| 983 | .dst = MSM_BUS_SLAVE_SPDM, |
| 984 | .ib = (64 * 8) * 1000000UL, |
| 985 | .ab = (64 * 8) * 100000UL, |
| 986 | }, |
| 987 | }; |
| 988 | |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 989 | static struct msm_bus_paths qseecom_hw_bus_scale_usecases[] = { |
| 990 | { |
| 991 | ARRAY_SIZE(qseecom_clks_init_vectors), |
| 992 | qseecom_clks_init_vectors, |
| 993 | }, |
| 994 | { |
| 995 | ARRAY_SIZE(qseecom_enable_dfab_vectors), |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 996 | qseecom_enable_dfab_vectors, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 997 | }, |
| 998 | { |
| 999 | ARRAY_SIZE(qseecom_enable_sfpb_vectors), |
| 1000 | qseecom_enable_sfpb_vectors, |
| 1001 | }, |
Ramesh Masavarapu | 8d75658 | 2012-10-03 10:18:06 -0700 | [diff] [blame] | 1002 | { |
| 1003 | ARRAY_SIZE(qseecom_enable_dfab_sfpb_vectors), |
| 1004 | qseecom_enable_dfab_sfpb_vectors, |
| 1005 | }, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1006 | }; |
| 1007 | |
| 1008 | static struct msm_bus_scale_pdata qseecom_bus_pdata = { |
| 1009 | qseecom_hw_bus_scale_usecases, |
| 1010 | ARRAY_SIZE(qseecom_hw_bus_scale_usecases), |
| 1011 | .name = "qsee", |
| 1012 | }; |
| 1013 | |
| 1014 | static struct platform_device qseecom_device = { |
| 1015 | .name = "qseecom", |
| 1016 | .id = 0, |
| 1017 | .dev = { |
| 1018 | .platform_data = &qseecom_bus_pdata, |
| 1019 | }, |
| 1020 | }; |
| 1021 | #endif |
| 1022 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1023 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1024 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \ |
| 1025 | defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1026 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1027 | |
| 1028 | #define QCE_SIZE 0x10000 |
| 1029 | #define QCE_0_BASE 0x18500000 |
| 1030 | |
| 1031 | #define QCE_HW_KEY_SUPPORT 0 |
| 1032 | #define QCE_SHA_HMAC_SUPPORT 1 |
| 1033 | #define QCE_SHARE_CE_RESOURCE 1 |
| 1034 | #define QCE_CE_SHARED 0 |
| 1035 | |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 1036 | /* Begin Bus scaling definitions */ |
| 1037 | static struct msm_bus_vectors crypto_hw_init_vectors[] = { |
| 1038 | { |
| 1039 | .src = MSM_BUS_MASTER_ADM_PORT0, |
| 1040 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1041 | .ab = 0, |
| 1042 | .ib = 0, |
| 1043 | }, |
| 1044 | { |
| 1045 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 1046 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 1047 | .ab = 0, |
| 1048 | .ib = 0, |
| 1049 | }, |
| 1050 | }; |
| 1051 | |
| 1052 | static struct msm_bus_vectors crypto_hw_active_vectors[] = { |
| 1053 | { |
| 1054 | .src = MSM_BUS_MASTER_ADM_PORT0, |
| 1055 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1056 | .ab = 70000000UL, |
| 1057 | .ib = 70000000UL, |
| 1058 | }, |
| 1059 | { |
| 1060 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 1061 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 1062 | .ab = 2480000000UL, |
| 1063 | .ib = 2480000000UL, |
| 1064 | }, |
| 1065 | }; |
| 1066 | |
| 1067 | static struct msm_bus_paths crypto_hw_bus_scale_usecases[] = { |
| 1068 | { |
| 1069 | ARRAY_SIZE(crypto_hw_init_vectors), |
| 1070 | crypto_hw_init_vectors, |
| 1071 | }, |
| 1072 | { |
| 1073 | ARRAY_SIZE(crypto_hw_active_vectors), |
| 1074 | crypto_hw_active_vectors, |
| 1075 | }, |
| 1076 | }; |
| 1077 | |
| 1078 | static struct msm_bus_scale_pdata crypto_hw_bus_scale_pdata = { |
| 1079 | crypto_hw_bus_scale_usecases, |
| 1080 | ARRAY_SIZE(crypto_hw_bus_scale_usecases), |
| 1081 | .name = "cryptohw", |
| 1082 | }; |
| 1083 | /* End Bus Scaling Definitions*/ |
| 1084 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1085 | static struct resource qcrypto_resources[] = { |
| 1086 | [0] = { |
| 1087 | .start = QCE_0_BASE, |
| 1088 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 1089 | .flags = IORESOURCE_MEM, |
| 1090 | }, |
| 1091 | [1] = { |
| 1092 | .name = "crypto_channels", |
| 1093 | .start = DMOV_CE_IN_CHAN, |
| 1094 | .end = DMOV_CE_OUT_CHAN, |
| 1095 | .flags = IORESOURCE_DMA, |
| 1096 | }, |
| 1097 | [2] = { |
| 1098 | .name = "crypto_crci_in", |
| 1099 | .start = DMOV_CE_IN_CRCI, |
| 1100 | .end = DMOV_CE_IN_CRCI, |
| 1101 | .flags = IORESOURCE_DMA, |
| 1102 | }, |
| 1103 | [3] = { |
| 1104 | .name = "crypto_crci_out", |
| 1105 | .start = DMOV_CE_OUT_CRCI, |
| 1106 | .end = DMOV_CE_OUT_CRCI, |
| 1107 | .flags = IORESOURCE_DMA, |
| 1108 | }, |
| 1109 | }; |
| 1110 | |
| 1111 | static struct resource qcedev_resources[] = { |
| 1112 | [0] = { |
| 1113 | .start = QCE_0_BASE, |
| 1114 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 1115 | .flags = IORESOURCE_MEM, |
| 1116 | }, |
| 1117 | [1] = { |
| 1118 | .name = "crypto_channels", |
| 1119 | .start = DMOV_CE_IN_CHAN, |
| 1120 | .end = DMOV_CE_OUT_CHAN, |
| 1121 | .flags = IORESOURCE_DMA, |
| 1122 | }, |
| 1123 | [2] = { |
| 1124 | .name = "crypto_crci_in", |
| 1125 | .start = DMOV_CE_IN_CRCI, |
| 1126 | .end = DMOV_CE_IN_CRCI, |
| 1127 | .flags = IORESOURCE_DMA, |
| 1128 | }, |
| 1129 | [3] = { |
| 1130 | .name = "crypto_crci_out", |
| 1131 | .start = DMOV_CE_OUT_CRCI, |
| 1132 | .end = DMOV_CE_OUT_CRCI, |
| 1133 | .flags = IORESOURCE_DMA, |
| 1134 | }, |
| 1135 | }; |
| 1136 | |
| 1137 | #endif |
| 1138 | |
| 1139 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1140 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 1141 | |
| 1142 | static struct msm_ce_hw_support qcrypto_ce_hw_suppport = { |
| 1143 | .ce_shared = QCE_CE_SHARED, |
| 1144 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 1145 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 1146 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 1147 | .bus_scale_table = &crypto_hw_bus_scale_pdata, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1148 | }; |
| 1149 | |
| 1150 | static struct platform_device qcrypto_device = { |
| 1151 | .name = "qcrypto", |
| 1152 | .id = 0, |
| 1153 | .num_resources = ARRAY_SIZE(qcrypto_resources), |
| 1154 | .resource = qcrypto_resources, |
| 1155 | .dev = { |
| 1156 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1157 | .platform_data = &qcrypto_ce_hw_suppport, |
| 1158 | }, |
| 1159 | }; |
| 1160 | #endif |
| 1161 | |
| 1162 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1163 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1164 | |
| 1165 | static struct msm_ce_hw_support qcedev_ce_hw_suppport = { |
| 1166 | .ce_shared = QCE_CE_SHARED, |
| 1167 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 1168 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 1169 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 1170 | .bus_scale_table = &crypto_hw_bus_scale_pdata, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1171 | }; |
| 1172 | |
| 1173 | static struct platform_device qcedev_device = { |
| 1174 | .name = "qce", |
| 1175 | .id = 0, |
| 1176 | .num_resources = ARRAY_SIZE(qcedev_resources), |
| 1177 | .resource = qcedev_resources, |
| 1178 | .dev = { |
| 1179 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1180 | .platform_data = &qcedev_ce_hw_suppport, |
| 1181 | }, |
| 1182 | }; |
| 1183 | #endif |
| 1184 | |
Joel King | 0cbf5d8 | 2012-05-24 15:21:38 -0700 | [diff] [blame] | 1185 | static struct mdm_platform_data sglte_platform_data = { |
| 1186 | .mdm_version = "4.0", |
| 1187 | .ramdump_delay_ms = 1000, |
Taniya Das | 2b7646b | 2013-01-15 11:28:14 +0530 | [diff] [blame] | 1188 | /* delay between two PS_HOLDs */ |
| 1189 | .ps_hold_delay_ms = 500, |
Joel King | 63ce833 | 2012-06-01 09:59:26 -0700 | [diff] [blame] | 1190 | .soft_reset_inverted = 1, |
Joel King | 0cbf5d8 | 2012-05-24 15:21:38 -0700 | [diff] [blame] | 1191 | .peripheral_platform_device = NULL, |
Ameya Thakur | c9a7a84 | 2012-06-24 22:47:52 -0700 | [diff] [blame] | 1192 | .ramdump_timeout_ms = 600000, |
Ameya Thakur | a98bde5 | 2012-06-28 18:55:19 -0700 | [diff] [blame] | 1193 | .no_powerdown_after_ramdumps = 1, |
Ameya Thakur | 43248fd | 2012-07-10 18:50:52 -0700 | [diff] [blame] | 1194 | .image_upgrade_supported = 1, |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 1195 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1196 | |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1197 | #define MSM_TSIF0_PHYS (0x18200000) |
| 1198 | #define MSM_TSIF1_PHYS (0x18201000) |
| 1199 | #define MSM_TSIF_SIZE (0x200) |
| 1200 | #define MSM_TSPP_PHYS (0x18202000) |
| 1201 | #define MSM_TSPP_SIZE (0x1000) |
| 1202 | #define MSM_TSPP_BAM_PHYS (0x18204000) |
| 1203 | #define MSM_TSPP_BAM_SIZE (0x2000) |
| 1204 | |
| 1205 | #define TSIF_0_CLK GPIO_CFG(75, 1, GPIO_CFG_INPUT, \ |
| 1206 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1207 | #define TSIF_0_EN GPIO_CFG(76, 1, GPIO_CFG_INPUT, \ |
| 1208 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1209 | #define TSIF_0_DATA GPIO_CFG(77, 1, GPIO_CFG_INPUT, \ |
| 1210 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1211 | #define TSIF_0_SYNC GPIO_CFG(82, 1, GPIO_CFG_INPUT, \ |
| 1212 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1213 | #define TSIF_1_CLK GPIO_CFG(79, 1, GPIO_CFG_INPUT, \ |
| 1214 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1215 | #define TSIF_1_EN GPIO_CFG(80, 1, GPIO_CFG_INPUT, \ |
| 1216 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1217 | #define TSIF_1_DATA GPIO_CFG(81, 1, GPIO_CFG_INPUT, \ |
| 1218 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1219 | #define TSIF_1_SYNC GPIO_CFG(78, 1, GPIO_CFG_INPUT, \ |
| 1220 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1221 | |
| 1222 | static const struct msm_gpio tsif_gpios[] = { |
| 1223 | { .gpio_cfg = TSIF_0_CLK, .label = "tsif0_clk", }, |
| 1224 | { .gpio_cfg = TSIF_0_EN, .label = "tsif0_en", }, |
| 1225 | { .gpio_cfg = TSIF_0_DATA, .label = "tsif0_data", }, |
| 1226 | { .gpio_cfg = TSIF_0_SYNC, .label = "tsif0_sync", }, |
| 1227 | { .gpio_cfg = TSIF_1_CLK, .label = "tsif1_clk", }, |
| 1228 | { .gpio_cfg = TSIF_1_EN, .label = "tsif1_en", }, |
| 1229 | { .gpio_cfg = TSIF_1_DATA, .label = "tsif1_data", }, |
| 1230 | { .gpio_cfg = TSIF_1_SYNC, .label = "tsif1_sync", }, |
| 1231 | }; |
| 1232 | |
| 1233 | static struct resource tspp_resources[] = { |
| 1234 | [0] = { |
Liron Kuch | 5933992 | 2013-01-01 18:29:47 +0200 | [diff] [blame] | 1235 | .name = "TSIF_TSPP_IRQ", |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1236 | .flags = IORESOURCE_IRQ, |
| 1237 | .start = TSIF_TSPP_IRQ, |
Liron Kuch | 5933992 | 2013-01-01 18:29:47 +0200 | [diff] [blame] | 1238 | .end = TSIF_TSPP_IRQ, |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1239 | }, |
| 1240 | [1] = { |
Liron Kuch | 5933992 | 2013-01-01 18:29:47 +0200 | [diff] [blame] | 1241 | .name = "TSIF0_IRQ", |
| 1242 | .flags = IORESOURCE_IRQ, |
| 1243 | .start = TSIF1_IRQ, |
| 1244 | .end = TSIF1_IRQ, |
| 1245 | }, |
| 1246 | [2] = { |
| 1247 | .name = "TSIF1_IRQ", |
| 1248 | .flags = IORESOURCE_IRQ, |
| 1249 | .start = TSIF2_IRQ, |
| 1250 | .end = TSIF2_IRQ, |
| 1251 | }, |
| 1252 | [3] = { |
| 1253 | .name = "TSIF_BAM_IRQ", |
| 1254 | .flags = IORESOURCE_IRQ, |
| 1255 | .start = TSIF_BAM_IRQ, |
| 1256 | .end = TSIF_BAM_IRQ, |
| 1257 | }, |
| 1258 | [4] = { |
| 1259 | .name = "MSM_TSIF0_PHYS", |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1260 | .flags = IORESOURCE_MEM, |
| 1261 | .start = MSM_TSIF0_PHYS, |
| 1262 | .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1, |
| 1263 | }, |
Liron Kuch | 5933992 | 2013-01-01 18:29:47 +0200 | [diff] [blame] | 1264 | [5] = { |
| 1265 | .name = "MSM_TSIF1_PHYS", |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1266 | .flags = IORESOURCE_MEM, |
| 1267 | .start = MSM_TSIF1_PHYS, |
| 1268 | .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1, |
| 1269 | }, |
Liron Kuch | 5933992 | 2013-01-01 18:29:47 +0200 | [diff] [blame] | 1270 | [6] = { |
| 1271 | .name = "MSM_TSPP_PHYS", |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1272 | .flags = IORESOURCE_MEM, |
| 1273 | .start = MSM_TSPP_PHYS, |
| 1274 | .end = MSM_TSPP_PHYS + MSM_TSPP_SIZE - 1, |
| 1275 | }, |
Liron Kuch | 5933992 | 2013-01-01 18:29:47 +0200 | [diff] [blame] | 1276 | [7] = { |
| 1277 | .name = "MSM_TSPP_BAM_PHYS", |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1278 | .flags = IORESOURCE_MEM, |
| 1279 | .start = MSM_TSPP_BAM_PHYS, |
| 1280 | .end = MSM_TSPP_BAM_PHYS + MSM_TSPP_BAM_SIZE - 1, |
| 1281 | }, |
| 1282 | }; |
| 1283 | |
| 1284 | static struct msm_tspp_platform_data tspp_platform_data = { |
| 1285 | .num_gpios = ARRAY_SIZE(tsif_gpios), |
| 1286 | .gpios = tsif_gpios, |
| 1287 | .tsif_pclk = "tsif_pclk", |
| 1288 | .tsif_ref_clk = "tsif_ref_clk", |
Vikram Mulukutla | e9ca54b | 2013-04-19 11:08:42 -0700 | [diff] [blame] | 1289 | .tsif_vreg_present = 0, |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1290 | }; |
| 1291 | |
| 1292 | static struct platform_device msm_device_tspp = { |
| 1293 | .name = "msm_tspp", |
| 1294 | .id = 0, |
| 1295 | .num_resources = ARRAY_SIZE(tspp_resources), |
| 1296 | .resource = tspp_resources, |
| 1297 | .dev = { |
| 1298 | .platform_data = &tspp_platform_data |
| 1299 | }, |
| 1300 | }; |
| 1301 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1302 | #define MSM_SHARED_RAM_PHYS 0x80000000 |
| 1303 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1304 | static void __init msm8960_map_io(void) |
| 1305 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1306 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1307 | msm_map_msm8960_io(); |
Abhimanyu Kapur | 91a0a50 | 2013-01-11 19:24:59 -0800 | [diff] [blame] | 1308 | if (socinfo_init() < 0) |
Jeff Ohlstein | 3a77f9f | 2011-09-06 14:50:20 -0700 | [diff] [blame] | 1309 | pr_err("socinfo_init() failed!\n"); |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 1310 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1311 | } |
| 1312 | |
| 1313 | static void __init msm8960_init_irq(void) |
| 1314 | { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1315 | struct msm_mpm_device_data *data = NULL; |
| 1316 | |
| 1317 | #ifdef CONFIG_MSM_MPM |
| 1318 | data = &msm8960_mpm_dev_data; |
| 1319 | #endif |
| 1320 | |
| 1321 | msm_mpm_irq_extn_init(data); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1322 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1323 | (void *)MSM_QGIC_CPU_BASE); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1324 | } |
| 1325 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1326 | static void __init msm8960_init_buses(void) |
| 1327 | { |
| 1328 | #ifdef CONFIG_MSM_BUS_SCALING |
Gagan Mac | dc1dc14 | 2011-09-16 15:13:35 -0600 | [diff] [blame] | 1329 | msm_bus_rpm_set_mt_mask(); |
Gagan Mac | ae154c4b | 2011-10-05 19:24:43 -0600 | [diff] [blame] | 1330 | msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1; |
| 1331 | msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1; |
Gagan Mac | ae154c4b | 2011-10-05 19:24:43 -0600 | [diff] [blame] | 1332 | msm_bus_apps_fabric.dev.platform_data = |
| 1333 | &msm_bus_8960_apps_fabric_pdata; |
| 1334 | msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata; |
Gagan Mac | 680bfc0 | 2012-07-19 19:11:00 -0600 | [diff] [blame] | 1335 | if (cpu_is_msm8960ab()) { |
| 1336 | msm_bus_8960_sg_mm_fabric_pdata.rpm_enabled = 1; |
| 1337 | msm_bus_mm_fabric.dev.platform_data = |
| 1338 | &msm_bus_8960_sg_mm_fabric_pdata; |
| 1339 | } else { |
| 1340 | msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1; |
| 1341 | msm_bus_mm_fabric.dev.platform_data = |
| 1342 | &msm_bus_8960_mm_fabric_pdata; |
| 1343 | } |
Gagan Mac | ae154c4b | 2011-10-05 19:24:43 -0600 | [diff] [blame] | 1344 | msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata; |
| 1345 | msm_bus_cpss_fpb.dev.platform_data = &msm_bus_8960_cpss_fpb_pdata; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1346 | #endif |
| 1347 | } |
| 1348 | |
| 1349 | static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = { |
| 1350 | .max_clock_speed = 15060000, |
Kiran Gunda | c5fbd7f | 2012-07-30 13:22:39 +0530 | [diff] [blame] | 1351 | .infinite_mode = 0xFFC0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1352 | }; |
| 1353 | |
| 1354 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 1355 | static struct msm_otg_platform_data msm_otg_pdata; |
| 1356 | #else |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 1357 | static int wr_phy_init_seq[] = { |
| 1358 | 0x44, 0x80, /* set VBUS valid threshold |
| 1359 | and disconnect valid threshold */ |
Chiranjeevi Velempati | f983aeb | 2012-08-23 08:16:50 +0530 | [diff] [blame] | 1360 | 0x68, 0x81, /* update DC voltage level */ |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 1361 | 0x14, 0x82, /* set preemphasis and rise/fall time */ |
| 1362 | 0x13, 0x83, /* set source impedance adjusment */ |
| 1363 | -1}; |
| 1364 | |
| 1365 | static int liquid_v1_phy_init_seq[] = { |
| 1366 | 0x44, 0x80,/* set VBUS valid threshold |
| 1367 | and disconnect valid threshold */ |
Chiranjeevi Velempati | f983aeb | 2012-08-23 08:16:50 +0530 | [diff] [blame] | 1368 | 0x6C, 0x81,/* update DC voltage level */ |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 1369 | 0x18, 0x82,/* set preemphasis and rise/fall time */ |
| 1370 | 0x23, 0x83,/* set source impedance sdjusment */ |
| 1371 | -1}; |
| 1372 | |
Mayank Rana | a61da7a | 2012-08-14 10:57:00 +0530 | [diff] [blame] | 1373 | static int sglte_phy_init_seq[] = { |
| 1374 | 0x44, 0x80, /* set VBUS valid threshold |
| 1375 | and disconnect valid threshold */ |
Chiranjeevi Velempati | f983aeb | 2012-08-23 08:16:50 +0530 | [diff] [blame] | 1376 | 0x6A, 0x81, /* update DC voltage level */ |
Mayank Rana | a61da7a | 2012-08-14 10:57:00 +0530 | [diff] [blame] | 1377 | 0x24, 0x82, /* set preemphasis and rise/fall time */ |
| 1378 | 0x13, 0x83, /* set source impedance adjusment */ |
| 1379 | -1}; |
| 1380 | |
Manu Gautam | cd82e9d | 2011-12-20 14:17:28 +0530 | [diff] [blame] | 1381 | #ifdef CONFIG_MSM_BUS_SCALING |
| 1382 | /* Bandwidth requests (zero) if no vote placed */ |
| 1383 | static struct msm_bus_vectors usb_init_vectors[] = { |
| 1384 | { |
| 1385 | .src = MSM_BUS_MASTER_SPS, |
| 1386 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1387 | .ab = 0, |
| 1388 | .ib = 0, |
| 1389 | }, |
| 1390 | }; |
| 1391 | |
| 1392 | /* Bus bandwidth requests in Bytes/sec */ |
| 1393 | static struct msm_bus_vectors usb_max_vectors[] = { |
| 1394 | { |
| 1395 | .src = MSM_BUS_MASTER_SPS, |
| 1396 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1397 | .ab = 60000000, /* At least 480Mbps on bus. */ |
| 1398 | .ib = 960000000, /* MAX bursts rate */ |
| 1399 | }, |
| 1400 | }; |
| 1401 | |
| 1402 | static struct msm_bus_paths usb_bus_scale_usecases[] = { |
| 1403 | { |
| 1404 | ARRAY_SIZE(usb_init_vectors), |
| 1405 | usb_init_vectors, |
| 1406 | }, |
| 1407 | { |
| 1408 | ARRAY_SIZE(usb_max_vectors), |
| 1409 | usb_max_vectors, |
| 1410 | }, |
| 1411 | }; |
| 1412 | |
| 1413 | static struct msm_bus_scale_pdata usb_bus_scale_pdata = { |
| 1414 | usb_bus_scale_usecases, |
| 1415 | ARRAY_SIZE(usb_bus_scale_usecases), |
| 1416 | .name = "usb", |
| 1417 | }; |
| 1418 | #endif |
| 1419 | |
Jack Pham | 87f202f | 2012-08-06 00:24:22 -0700 | [diff] [blame] | 1420 | #define MSM_MPM_PIN_USB1_OTGSESSVLD 40 |
| 1421 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1422 | static struct msm_otg_platform_data msm_otg_pdata = { |
| 1423 | .mode = USB_OTG, |
| 1424 | .otg_control = OTG_PMIC_CONTROL, |
| 1425 | .phy_type = SNPS_28NM_INTEGRATED_PHY, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1426 | .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE), |
Anji jonnala | 4e3e677 | 2011-09-15 18:53:42 +0530 | [diff] [blame] | 1427 | .power_budget = 750, |
Manu Gautam | cd82e9d | 2011-12-20 14:17:28 +0530 | [diff] [blame] | 1428 | #ifdef CONFIG_MSM_BUS_SCALING |
| 1429 | .bus_scale_table = &usb_bus_scale_pdata, |
Jack Pham | 87f202f | 2012-08-06 00:24:22 -0700 | [diff] [blame] | 1430 | .mpm_otgsessvld_int = MSM_MPM_PIN_USB1_OTGSESSVLD, |
Manu Gautam | cd82e9d | 2011-12-20 14:17:28 +0530 | [diff] [blame] | 1431 | #endif |
Pavankumar Kondeti | 2aec9f3 | 2012-06-13 09:06:03 +0530 | [diff] [blame] | 1432 | #ifdef CONFIG_FB_MSM_HDMI_MHL_8334 |
| 1433 | .mhl_dev_name = "sii8334", |
| 1434 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1435 | }; |
| 1436 | #endif |
| 1437 | |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1438 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
Vijayavardhan Vennapusa | 2b592824f | 2011-11-02 19:51:32 +0530 | [diff] [blame] | 1439 | #define HSIC_HUB_RESET_GPIO 91 |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1440 | static struct msm_hsic_host_platform_data msm_hsic_pdata = { |
Manu Gautam | 3c59839 | 2013-03-22 16:59:10 +0530 | [diff] [blame] | 1441 | .strobe = 150, |
| 1442 | .data = 151, |
| 1443 | .phy_sof_workaround = true, |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1444 | }; |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 1445 | |
| 1446 | static struct smsc_hub_platform_data hsic_hub_pdata = { |
| 1447 | .hub_reset = HSIC_HUB_RESET_GPIO, |
| 1448 | }; |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1449 | #else |
| 1450 | static struct msm_hsic_host_platform_data msm_hsic_pdata; |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 1451 | static struct smsc_hub_platform_data hsic_hub_pdata; |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1452 | #endif |
| 1453 | |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 1454 | static struct platform_device smsc_hub_device = { |
| 1455 | .name = "msm_smsc_hub", |
| 1456 | .id = -1, |
| 1457 | .dev = { |
| 1458 | .platform_data = &hsic_hub_pdata, |
| 1459 | }, |
| 1460 | }; |
| 1461 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1462 | #define PID_MAGIC_ID 0x71432909 |
| 1463 | #define SERIAL_NUM_MAGIC_ID 0x61945374 |
| 1464 | #define SERIAL_NUMBER_LENGTH 127 |
| 1465 | #define DLOAD_USB_BASE_ADD 0x2A03F0C8 |
| 1466 | |
| 1467 | struct magic_num_struct { |
| 1468 | uint32_t pid; |
| 1469 | uint32_t serial_num; |
| 1470 | }; |
| 1471 | |
| 1472 | struct dload_struct { |
| 1473 | uint32_t reserved1; |
| 1474 | uint32_t reserved2; |
| 1475 | uint32_t reserved3; |
| 1476 | uint16_t reserved4; |
| 1477 | uint16_t pid; |
| 1478 | char serial_number[SERIAL_NUMBER_LENGTH]; |
| 1479 | uint16_t reserved5; |
| 1480 | struct magic_num_struct magic_struct; |
| 1481 | }; |
| 1482 | |
| 1483 | static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum) |
| 1484 | { |
| 1485 | struct dload_struct __iomem *dload = 0; |
| 1486 | |
| 1487 | dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload)); |
| 1488 | if (!dload) { |
| 1489 | pr_err("%s: cannot remap I/O memory region: %08x\n", |
| 1490 | __func__, DLOAD_USB_BASE_ADD); |
| 1491 | return -ENXIO; |
| 1492 | } |
| 1493 | |
| 1494 | pr_debug("%s: dload:%p pid:%x serial_num:%s\n", |
| 1495 | __func__, dload, pid, snum); |
| 1496 | /* update pid */ |
| 1497 | dload->magic_struct.pid = PID_MAGIC_ID; |
| 1498 | dload->pid = pid; |
| 1499 | |
| 1500 | /* update serial number */ |
| 1501 | dload->magic_struct.serial_num = 0; |
| 1502 | if (!snum) { |
| 1503 | memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH); |
| 1504 | goto out; |
| 1505 | } |
| 1506 | |
| 1507 | dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID; |
Jin Hong | e49b148 | 2011-10-03 11:15:50 -0700 | [diff] [blame] | 1508 | strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1509 | out: |
| 1510 | iounmap(dload); |
| 1511 | return 0; |
| 1512 | } |
| 1513 | |
| 1514 | static struct android_usb_platform_data android_usb_pdata = { |
| 1515 | .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num, |
| 1516 | }; |
| 1517 | |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 1518 | static struct platform_device android_usb_device = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1519 | .name = "android_usb", |
| 1520 | .id = -1, |
| 1521 | .dev = { |
| 1522 | .platform_data = &android_usb_pdata, |
| 1523 | }, |
| 1524 | }; |
| 1525 | |
| 1526 | static uint8_t spm_wfi_cmd_sequence[] __initdata = { |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 1527 | 0x03, 0x0f, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1528 | }; |
| 1529 | |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1530 | static uint8_t spm_retention_cmd_sequence[] __initdata = { |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 1531 | 0x00, 0x05, 0x03, 0x0D, |
| 1532 | 0x0B, 0x00, 0x0f, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1533 | }; |
| 1534 | |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 1535 | static uint8_t spm_retention_with_krait_v3_cmd_sequence[] __initdata = { |
| 1536 | 0x42, 0x1B, 0x00, |
| 1537 | 0x05, 0x03, 0x01, 0x0B, |
| 1538 | 0x00, 0x42, 0x1B, |
| 1539 | 0x0f, |
| 1540 | }; |
| 1541 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1542 | static uint8_t spm_power_collapse_without_rpm[] __initdata = { |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 1543 | 0x00, 0x24, 0x54, 0x10, |
| 1544 | 0x09, 0x03, 0x01, |
| 1545 | 0x10, 0x54, 0x30, 0x0C, |
| 1546 | 0x24, 0x30, 0x0f, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1547 | }; |
| 1548 | |
| 1549 | static uint8_t spm_power_collapse_with_rpm[] __initdata = { |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 1550 | 0x00, 0x24, 0x54, 0x10, |
| 1551 | 0x09, 0x07, 0x01, 0x0B, |
| 1552 | 0x10, 0x54, 0x30, 0x0C, |
| 1553 | 0x24, 0x30, 0x0f, |
| 1554 | }; |
| 1555 | |
| 1556 | /* 8960AB has a different command to assert apc_pdn */ |
| 1557 | static uint8_t spm_power_collapse_without_rpm_krait_v3[] __initdata = { |
| 1558 | 0x00, 0x24, 0x84, 0x10, |
| 1559 | 0x09, 0x03, 0x01, |
| 1560 | 0x10, 0x84, 0x30, 0x0C, |
| 1561 | 0x24, 0x30, 0x0f, |
| 1562 | }; |
| 1563 | |
| 1564 | static uint8_t spm_power_collapse_with_rpm_krait_v3[] __initdata = { |
| 1565 | 0x00, 0x24, 0x84, 0x10, |
| 1566 | 0x09, 0x07, 0x01, 0x0B, |
| 1567 | 0x10, 0x84, 0x30, 0x0C, |
| 1568 | 0x24, 0x30, 0x0f, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1569 | }; |
| 1570 | |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1571 | static struct msm_spm_seq_entry msm_spm_boot_cpu_seq_list[] __initdata = { |
| 1572 | [0] = { |
| 1573 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 1574 | .notify_rpm = false, |
| 1575 | .cmd = spm_wfi_cmd_sequence, |
| 1576 | }, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1577 | [1] = { |
| 1578 | .mode = MSM_SPM_MODE_POWER_RETENTION, |
| 1579 | .notify_rpm = false, |
| 1580 | .cmd = spm_retention_cmd_sequence, |
| 1581 | }, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1582 | [2] = { |
| 1583 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1584 | .notify_rpm = false, |
| 1585 | .cmd = spm_power_collapse_without_rpm, |
| 1586 | }, |
| 1587 | [3] = { |
| 1588 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1589 | .notify_rpm = true, |
| 1590 | .cmd = spm_power_collapse_with_rpm, |
| 1591 | }, |
| 1592 | }; |
| 1593 | |
| 1594 | static struct msm_spm_seq_entry msm_spm_nonboot_cpu_seq_list[] __initdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1595 | [0] = { |
| 1596 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 1597 | .notify_rpm = false, |
| 1598 | .cmd = spm_wfi_cmd_sequence, |
| 1599 | }, |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 1600 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1601 | [1] = { |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 1602 | .mode = MSM_SPM_MODE_POWER_RETENTION, |
| 1603 | .notify_rpm = false, |
| 1604 | .cmd = spm_retention_cmd_sequence, |
| 1605 | }, |
| 1606 | |
| 1607 | [2] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1608 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1609 | .notify_rpm = false, |
| 1610 | .cmd = spm_power_collapse_without_rpm, |
| 1611 | }, |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 1612 | |
| 1613 | [3] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1614 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1615 | .notify_rpm = true, |
| 1616 | .cmd = spm_power_collapse_with_rpm, |
| 1617 | }, |
| 1618 | }; |
| 1619 | |
| 1620 | static struct msm_spm_platform_data msm_spm_data[] __initdata = { |
| 1621 | [0] = { |
| 1622 | .reg_base_addr = MSM_SAW0_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1623 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1624 | #if defined(CONFIG_MSM_AVS_HW) |
Anji Jonnala | 39dd725 | 2012-11-26 15:56:26 +0530 | [diff] [blame] | 1625 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x58589464, |
Praveen Chidambaram | 631f282 | 2012-03-16 12:08:42 -0600 | [diff] [blame] | 1626 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00020000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1627 | #endif |
| 1628 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1629 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x03020004, |
| 1630 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0084009C, |
| 1631 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A4001C, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1632 | .vctl_timeout_us = 50, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1633 | .num_modes = ARRAY_SIZE(msm_spm_boot_cpu_seq_list), |
| 1634 | .modes = msm_spm_boot_cpu_seq_list, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1635 | }, |
| 1636 | [1] = { |
| 1637 | .reg_base_addr = MSM_SAW1_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1638 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1639 | #if defined(CONFIG_MSM_AVS_HW) |
Anji Jonnala | 39dd725 | 2012-11-26 15:56:26 +0530 | [diff] [blame] | 1640 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x58589464, |
Praveen Chidambaram | 631f282 | 2012-03-16 12:08:42 -0600 | [diff] [blame] | 1641 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00020000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1642 | #endif |
| 1643 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 1644 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1645 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 1646 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 1647 | .vctl_timeout_us = 50, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1648 | .num_modes = ARRAY_SIZE(msm_spm_nonboot_cpu_seq_list), |
| 1649 | .modes = msm_spm_nonboot_cpu_seq_list, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1650 | }, |
| 1651 | }; |
| 1652 | |
| 1653 | static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = { |
| 1654 | 0x00, 0x20, 0x03, 0x20, |
| 1655 | 0x00, 0x0f, |
| 1656 | }; |
| 1657 | |
| 1658 | static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = { |
| 1659 | 0x00, 0x20, 0x34, 0x64, |
| 1660 | 0x48, 0x07, 0x48, 0x20, |
| 1661 | 0x50, 0x64, 0x04, 0x34, |
| 1662 | 0x50, 0x0f, |
| 1663 | }; |
| 1664 | static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = { |
| 1665 | 0x00, 0x10, 0x34, 0x64, |
| 1666 | 0x48, 0x07, 0x48, 0x10, |
| 1667 | 0x50, 0x64, 0x04, 0x34, |
| 1668 | 0x50, 0x0F, |
| 1669 | }; |
| 1670 | |
| 1671 | static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = { |
| 1672 | [0] = { |
| 1673 | .mode = MSM_SPM_L2_MODE_RETENTION, |
| 1674 | .notify_rpm = false, |
| 1675 | .cmd = l2_spm_wfi_cmd_sequence, |
| 1676 | }, |
| 1677 | [1] = { |
| 1678 | .mode = MSM_SPM_L2_MODE_GDHS, |
| 1679 | .notify_rpm = true, |
| 1680 | .cmd = l2_spm_gdhs_cmd_sequence, |
| 1681 | }, |
| 1682 | [2] = { |
| 1683 | .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE, |
| 1684 | .notify_rpm = true, |
| 1685 | .cmd = l2_spm_power_off_cmd_sequence, |
| 1686 | }, |
| 1687 | }; |
| 1688 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1689 | static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = { |
| 1690 | [0] = { |
| 1691 | .reg_base_addr = MSM_SAW_L2_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1692 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 1693 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1694 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE, |
| 1695 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020, |
| 1696 | .modes = msm_spm_l2_seq_list, |
| 1697 | .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list), |
| 1698 | }, |
| 1699 | }; |
| 1700 | |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1701 | #define HAP_SHIFT_LVL_OE_GPIO 47 |
| 1702 | #define HAP_SHIFT_LVL_OE_GPIO_SGLTE 89 |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1703 | #define PM_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33) |
| 1704 | #define PM_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20) |
| 1705 | |
| 1706 | static struct msm_xo_voter *xo_handle_d1; |
| 1707 | |
| 1708 | static int isa1200_power(int on) |
| 1709 | { |
| 1710 | int rc = 0; |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1711 | int hap_oe_gpio = HAP_SHIFT_LVL_OE_GPIO; |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1712 | |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1713 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) |
| 1714 | hap_oe_gpio = HAP_SHIFT_LVL_OE_GPIO_SGLTE; |
| 1715 | |
| 1716 | |
| 1717 | gpio_set_value(hap_oe_gpio, !!on); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1718 | |
| 1719 | rc = on ? msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_ON) : |
| 1720 | msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_OFF); |
| 1721 | if (rc < 0) { |
| 1722 | pr_err("%s: failed to %svote for TCXO D1 buffer%d\n", |
| 1723 | __func__, on ? "" : "de-", rc); |
| 1724 | goto err_xo_vote; |
| 1725 | } |
| 1726 | |
| 1727 | return 0; |
| 1728 | |
| 1729 | err_xo_vote: |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1730 | gpio_set_value(hap_oe_gpio, !on); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1731 | return rc; |
| 1732 | } |
| 1733 | |
| 1734 | static int isa1200_dev_setup(bool enable) |
| 1735 | { |
| 1736 | int rc = 0; |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1737 | int hap_oe_gpio = HAP_SHIFT_LVL_OE_GPIO; |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1738 | |
| 1739 | struct pm_gpio hap_gpio_config = { |
| 1740 | .direction = PM_GPIO_DIR_OUT, |
| 1741 | .pull = PM_GPIO_PULL_NO, |
| 1742 | .out_strength = PM_GPIO_STRENGTH_HIGH, |
| 1743 | .function = PM_GPIO_FUNC_NORMAL, |
| 1744 | .inv_int_pol = 0, |
| 1745 | .vin_sel = 2, |
| 1746 | .output_buffer = PM_GPIO_OUT_BUF_CMOS, |
| 1747 | .output_value = 0, |
| 1748 | }; |
| 1749 | |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1750 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) |
| 1751 | hap_oe_gpio = HAP_SHIFT_LVL_OE_GPIO_SGLTE; |
| 1752 | |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1753 | if (enable == true) { |
| 1754 | rc = pm8xxx_gpio_config(PM_HAP_EN_GPIO, &hap_gpio_config); |
| 1755 | if (rc) { |
| 1756 | pr_err("%s: pm8921 gpio %d config failed(%d)\n", |
| 1757 | __func__, PM_HAP_EN_GPIO, rc); |
| 1758 | return rc; |
| 1759 | } |
| 1760 | |
| 1761 | rc = pm8xxx_gpio_config(PM_HAP_LEN_GPIO, &hap_gpio_config); |
| 1762 | if (rc) { |
| 1763 | pr_err("%s: pm8921 gpio %d config failed(%d)\n", |
| 1764 | __func__, PM_HAP_LEN_GPIO, rc); |
| 1765 | return rc; |
| 1766 | } |
| 1767 | |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1768 | rc = gpio_request(hap_oe_gpio, "hap_shft_lvl_oe"); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1769 | if (rc) { |
| 1770 | pr_err("%s: unable to request gpio %d (%d)\n", |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1771 | __func__, hap_oe_gpio, rc); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1772 | return rc; |
| 1773 | } |
| 1774 | |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1775 | rc = gpio_direction_output(hap_oe_gpio, 0); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1776 | if (rc) { |
| 1777 | pr_err("%s: Unable to set direction\n", __func__); |
| 1778 | goto free_gpio; |
| 1779 | } |
| 1780 | |
| 1781 | xo_handle_d1 = msm_xo_get(MSM_XO_TCXO_D1, "isa1200"); |
| 1782 | if (IS_ERR(xo_handle_d1)) { |
| 1783 | rc = PTR_ERR(xo_handle_d1); |
| 1784 | pr_err("%s: failed to get the handle for D1(%d)\n", |
| 1785 | __func__, rc); |
| 1786 | goto gpio_set_dir; |
| 1787 | } |
| 1788 | } else { |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1789 | gpio_free(hap_oe_gpio); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1790 | |
| 1791 | msm_xo_put(xo_handle_d1); |
| 1792 | } |
| 1793 | |
| 1794 | return 0; |
| 1795 | |
| 1796 | gpio_set_dir: |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1797 | gpio_set_value(hap_oe_gpio, 0); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1798 | free_gpio: |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1799 | gpio_free(hap_oe_gpio); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1800 | return rc; |
| 1801 | } |
| 1802 | |
| 1803 | static struct isa1200_regulator isa1200_reg_data[] = { |
| 1804 | { |
| 1805 | .name = "vcc_i2c", |
| 1806 | .min_uV = ISA_I2C_VTG_MIN_UV, |
| 1807 | .max_uV = ISA_I2C_VTG_MAX_UV, |
| 1808 | .load_uA = ISA_I2C_CURR_UA, |
| 1809 | }, |
| 1810 | }; |
| 1811 | |
| 1812 | static struct isa1200_platform_data isa1200_1_pdata = { |
| 1813 | .name = "vibrator", |
| 1814 | .dev_setup = isa1200_dev_setup, |
| 1815 | .power_on = isa1200_power, |
| 1816 | .hap_en_gpio = PM_HAP_EN_GPIO, |
| 1817 | .hap_len_gpio = PM_HAP_LEN_GPIO, |
| 1818 | .max_timeout = 15000, |
| 1819 | .mode_ctrl = PWM_GEN_MODE, |
| 1820 | .pwm_fd = { |
| 1821 | .pwm_div = 256, |
| 1822 | }, |
| 1823 | .is_erm = false, |
| 1824 | .smart_en = true, |
| 1825 | .ext_clk_en = true, |
| 1826 | .chip_en = 1, |
| 1827 | .regulator_info = isa1200_reg_data, |
| 1828 | .num_regulators = ARRAY_SIZE(isa1200_reg_data), |
| 1829 | }; |
| 1830 | |
| 1831 | static struct i2c_board_info msm_isa1200_board_info[] __initdata = { |
| 1832 | { |
| 1833 | I2C_BOARD_INFO("isa1200_1", 0x90>>1), |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1834 | }, |
| 1835 | }; |
| 1836 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1837 | #define CYTTSP_TS_GPIO_IRQ 11 |
| 1838 | #define CYTTSP_TS_SLEEP_GPIO 50 |
| 1839 | #define CYTTSP_TS_RESOUT_N_GPIO 52 |
| 1840 | |
| 1841 | /*virtual key support */ |
| 1842 | static ssize_t tma340_vkeys_show(struct kobject *kobj, |
| 1843 | struct kobj_attribute *attr, char *buf) |
| 1844 | { |
| 1845 | return snprintf(buf, 200, |
| 1846 | __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97" |
| 1847 | ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97" |
| 1848 | ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97" |
| 1849 | ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97" |
| 1850 | "\n"); |
| 1851 | } |
| 1852 | |
| 1853 | static struct kobj_attribute tma340_vkeys_attr = { |
| 1854 | .attr = { |
| 1855 | .mode = S_IRUGO, |
| 1856 | }, |
| 1857 | .show = &tma340_vkeys_show, |
| 1858 | }; |
| 1859 | |
| 1860 | static struct attribute *tma340_properties_attrs[] = { |
| 1861 | &tma340_vkeys_attr.attr, |
| 1862 | NULL |
| 1863 | }; |
| 1864 | |
| 1865 | static struct attribute_group tma340_properties_attr_group = { |
| 1866 | .attrs = tma340_properties_attrs, |
| 1867 | }; |
| 1868 | |
| 1869 | |
| 1870 | static int cyttsp_platform_init(struct i2c_client *client) |
| 1871 | { |
| 1872 | int rc = 0; |
| 1873 | static struct kobject *tma340_properties_kobj; |
| 1874 | |
| 1875 | tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c"; |
| 1876 | tma340_properties_kobj = kobject_create_and_add("board_properties", |
| 1877 | NULL); |
| 1878 | if (tma340_properties_kobj) |
| 1879 | rc = sysfs_create_group(tma340_properties_kobj, |
| 1880 | &tma340_properties_attr_group); |
| 1881 | if (!tma340_properties_kobj || rc) |
| 1882 | pr_err("%s: failed to create board_properties\n", |
| 1883 | __func__); |
| 1884 | |
| 1885 | return 0; |
| 1886 | } |
| 1887 | |
| 1888 | static struct cyttsp_regulator regulator_data[] = { |
| 1889 | { |
| 1890 | .name = "vdd", |
| 1891 | .min_uV = CY_TMA300_VTG_MIN_UV, |
| 1892 | .max_uV = CY_TMA300_VTG_MAX_UV, |
Anirudh Ghayal | f9929b1 | 2011-09-07 15:57:36 +0530 | [diff] [blame] | 1893 | .hpm_load_uA = CY_TMA300_CURR_24HZ_UA, |
| 1894 | .lpm_load_uA = CY_TMA300_SLEEP_CURR_UA, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1895 | }, |
| 1896 | /* TODO: Remove after runtime PM is enabled in I2C driver */ |
| 1897 | { |
| 1898 | .name = "vcc_i2c", |
| 1899 | .min_uV = CY_I2C_VTG_MIN_UV, |
| 1900 | .max_uV = CY_I2C_VTG_MAX_UV, |
Anirudh Ghayal | f9929b1 | 2011-09-07 15:57:36 +0530 | [diff] [blame] | 1901 | .hpm_load_uA = CY_I2C_CURR_UA, |
| 1902 | .lpm_load_uA = CY_I2C_SLEEP_CURR_UA, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1903 | }, |
| 1904 | }; |
| 1905 | |
| 1906 | static struct cyttsp_platform_data cyttsp_pdata = { |
| 1907 | .panel_maxx = 634, |
| 1908 | .panel_maxy = 1166, |
| 1909 | .disp_maxx = 616, |
| 1910 | .disp_maxy = 1023, |
| 1911 | .disp_minx = 0, |
| 1912 | .disp_miny = 16, |
| 1913 | .flags = 0x01, |
| 1914 | .gen = CY_GEN3, /* or */ |
| 1915 | .use_st = CY_USE_ST, |
| 1916 | .use_mt = CY_USE_MT, |
| 1917 | .use_hndshk = CY_SEND_HNDSHK, |
| 1918 | .use_trk_id = CY_USE_TRACKING_ID, |
Anirudh Ghayal | e96f66d | 2011-08-11 14:06:38 +0530 | [diff] [blame] | 1919 | .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1920 | .use_gestures = CY_USE_GESTURES, |
| 1921 | .fw_fname = "cyttsp_8960_cdp.hex", |
| 1922 | /* activate up to 4 groups |
| 1923 | * and set active distance |
| 1924 | */ |
| 1925 | .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 | |
| 1926 | CY_GEST_GRP3 | CY_GEST_GRP4 | |
| 1927 | CY_ACT_DIST, |
Amy Maloche | 7b741b2 | 2012-06-14 14:37:22 -0700 | [diff] [blame] | 1928 | .act_intrvl = 10, |
| 1929 | .tch_tmout = 200, |
| 1930 | .lp_intrvl = 30, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1931 | .sleep_gpio = CYTTSP_TS_SLEEP_GPIO, |
| 1932 | .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO, |
| 1933 | .irq_gpio = CYTTSP_TS_GPIO_IRQ, |
| 1934 | .regulator_info = regulator_data, |
| 1935 | .num_regulators = ARRAY_SIZE(regulator_data), |
| 1936 | .init = cyttsp_platform_init, |
Mohan Pallaka | 49c37d6 | 2011-08-01 11:52:00 +0530 | [diff] [blame] | 1937 | .correct_fw_ver = 9, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1938 | }; |
| 1939 | |
| 1940 | static struct i2c_board_info cyttsp_info[] __initdata = { |
| 1941 | { |
| 1942 | I2C_BOARD_INFO(CY_I2C_NAME, 0x24), |
| 1943 | .platform_data = &cyttsp_pdata, |
| 1944 | #ifndef CY_USE_TIMER |
| 1945 | .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ), |
| 1946 | #endif /* CY_USE_TIMER */ |
| 1947 | }, |
| 1948 | }; |
| 1949 | |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 1950 | /* configuration data for mxt1386 */ |
| 1951 | static const u8 mxt1386_config_data[] = { |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1952 | /* T6 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1953 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1954 | /* T38 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1955 | 11, 2, 0, 11, 11, 11, 0, 0, 0, 0, |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1956 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1957 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1958 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1959 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1960 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1961 | 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1962 | /* T7 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1963 | 100, 16, 50, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1964 | /* T8 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1965 | 8, 0, 0, 0, 0, 0, 8, 14, 50, 215, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1966 | /* T9 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1967 | 131, 0, 0, 26, 42, 0, 32, 63, 3, 5, |
| 1968 | 0, 2, 1, 113, 10, 10, 8, 10, 255, 2, |
| 1969 | 85, 5, 0, 0, 20, 20, 75, 25, 202, 29, |
| 1970 | 10, 10, 45, 46, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1971 | /* T15 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1972 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1973 | 0, |
Anirudh Ghayal | dab4e0d | 2012-01-09 14:59:27 +0530 | [diff] [blame] | 1974 | /* T18 Object */ |
| 1975 | 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1976 | /* T22 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1977 | 5, 0, 0, 0, 0, 0, 0, 0, 30, 0, |
| 1978 | 0, 0, 5, 8, 10, 13, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1979 | /* T24 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1980 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1981 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1982 | /* T25 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1983 | 3, 0, 188, 52, 52, 33, 0, 0, 0, 0, |
| 1984 | 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1985 | /* T27 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1986 | 0, 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1987 | /* T28 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 1988 | 0, 0, 0, 8, 12, 60, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1989 | /* T40 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1990 | 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1991 | /* T41 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1992 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1993 | /* T43 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 1994 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 1995 | }; |
| 1996 | |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 1997 | /* configuration data for mxt1386e using V1.0 firmware */ |
| 1998 | static const u8 mxt1386e_config_data_v1_0[] = { |
| 1999 | /* T6 Object */ |
| 2000 | 0, 0, 0, 0, 0, 0, |
| 2001 | /* T38 Object */ |
| 2002 | 12, 1, 0, 17, 1, 12, 0, 0, 0, 0, |
| 2003 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2004 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2005 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2006 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2007 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2008 | 0, 0, 0, 0, |
| 2009 | /* T7 Object */ |
| 2010 | 100, 16, 50, |
| 2011 | /* T8 Object */ |
| 2012 | 25, 0, 20, 20, 0, 0, 20, 50, 0, 0, |
| 2013 | /* T9 Object */ |
| 2014 | 131, 0, 0, 26, 42, 0, 32, 80, 2, 5, |
| 2015 | 0, 5, 5, 0, 10, 30, 10, 10, 255, 2, |
| 2016 | 85, 5, 10, 10, 10, 10, 135, 55, 70, 40, |
| 2017 | 10, 5, 0, 0, 0, |
| 2018 | /* T18 Object */ |
| 2019 | 0, 0, |
| 2020 | /* T24 Object */ |
| 2021 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2022 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2023 | /* T25 Object */ |
| 2024 | 3, 0, 60, 115, 156, 99, |
| 2025 | /* T27 Object */ |
| 2026 | 0, 0, 0, 0, 0, 0, 0, |
| 2027 | /* T40 Object */ |
| 2028 | 0, 0, 0, 0, 0, |
| 2029 | /* T42 Object */ |
| 2030 | 2, 0, 255, 0, 255, 0, 0, 0, 0, 0, |
| 2031 | /* T43 Object */ |
| 2032 | 0, 0, 0, 0, 0, 0, 0, |
| 2033 | /* T46 Object */ |
| 2034 | 64, 0, 20, 20, 0, 0, 0, 0, 0, |
| 2035 | /* T47 Object */ |
| 2036 | 0, 0, 0, 0, 0, 0, 3, 64, 66, 0, |
| 2037 | /* T48 Object */ |
| 2038 | 31, 64, 64, 0, 0, 0, 0, 0, 0, 0, |
| 2039 | 48, 40, 0, 10, 10, 0, 0, 100, 10, 80, |
| 2040 | 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, |
| 2041 | 52, 0, 12, 0, 17, 0, 1, 0, 0, 0, |
| 2042 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2043 | 0, 0, 0, 0, |
| 2044 | /* T56 Object */ |
| 2045 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2046 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2047 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2048 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2049 | 2, 99, 33, |
| 2050 | }; |
| 2051 | |
| 2052 | /* configuration data for mxt1386e using V2.1 firmware */ |
| 2053 | static const u8 mxt1386e_config_data_v2_1[] = { |
| 2054 | /* T6 Object */ |
| 2055 | 0, 0, 0, 0, 0, 0, |
| 2056 | /* T38 Object */ |
Jing Lin | 4a8a3e4 | 2012-09-12 10:08:22 -0700 | [diff] [blame] | 2057 | 12, 5, 0, 28, 8, 12, 0, 0, 0, 0, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2058 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2059 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2060 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2061 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2062 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2063 | 0, 0, 0, 0, |
| 2064 | /* T7 Object */ |
Jing Lin | 4a8a3e4 | 2012-09-12 10:08:22 -0700 | [diff] [blame] | 2065 | 32, 16, 50, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2066 | /* T8 Object */ |
| 2067 | 25, 0, 20, 20, 0, 0, 20, 50, 0, 0, |
| 2068 | /* T9 Object */ |
Jing Lin | 763f477 | 2012-05-25 13:39:40 -0700 | [diff] [blame] | 2069 | 139, 0, 0, 26, 42, 0, 32, 80, 2, 5, |
Jing Lin | a0bc410 | 2012-07-06 17:03:45 -0700 | [diff] [blame] | 2070 | 0, 5, 5, 79, 10, 30, 10, 10, 255, 2, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2071 | 85, 5, 10, 10, 10, 10, 135, 55, 70, 40, |
| 2072 | 10, 5, 0, 0, 0, |
| 2073 | /* T18 Object */ |
| 2074 | 0, 0, |
| 2075 | /* T24 Object */ |
| 2076 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2077 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2078 | /* T25 Object */ |
Jing Lin | 763f477 | 2012-05-25 13:39:40 -0700 | [diff] [blame] | 2079 | 1, 0, 60, 115, 156, 99, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2080 | /* T27 Object */ |
| 2081 | 0, 0, 0, 0, 0, 0, 0, |
| 2082 | /* T40 Object */ |
| 2083 | 0, 0, 0, 0, 0, |
| 2084 | /* T42 Object */ |
Jing Lin | 763f477 | 2012-05-25 13:39:40 -0700 | [diff] [blame] | 2085 | 0, 0, 255, 0, 255, 0, 0, 0, 0, 0, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2086 | /* T43 Object */ |
| 2087 | 0, 0, 0, 0, 0, 0, 0, 64, 0, 8, |
| 2088 | 16, |
| 2089 | /* T46 Object */ |
Jing Lin | a0bc410 | 2012-07-06 17:03:45 -0700 | [diff] [blame] | 2090 | 64, 0, 16, 16, 0, 0, 0, 0, 0, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2091 | /* T47 Object */ |
| 2092 | 0, 0, 0, 0, 0, 0, 3, 64, 66, 0, |
| 2093 | /* T48 Object */ |
Jing Lin | 763f477 | 2012-05-25 13:39:40 -0700 | [diff] [blame] | 2094 | 1, 64, 64, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2095 | 48, 40, 0, 10, 10, 0, 0, 100, 10, 80, |
| 2096 | 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, |
| 2097 | 52, 0, 12, 0, 17, 0, 1, 0, 0, 0, |
| 2098 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2099 | 0, 0, 0, 0, |
| 2100 | /* T56 Object */ |
| 2101 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2102 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2103 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2104 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2105 | 2, 99, 33, 0, 149, 24, 193, 255, 255, 255, |
| 2106 | 255, |
| 2107 | }; |
| 2108 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2109 | /* configuration data for mxt1386e on 3D SKU using V2.1 firmware */ |
| 2110 | static const u8 mxt1386e_config_data_3d[] = { |
| 2111 | /* T6 Object */ |
| 2112 | 0, 0, 0, 0, 0, 0, |
| 2113 | /* T38 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2114 | 13, 1, 0, 23, 2, 12, 0, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2115 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2116 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2117 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2118 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2119 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2120 | 0, 0, 0, 0, |
| 2121 | /* T7 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2122 | 100, 10, 50, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2123 | /* T8 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2124 | 25, 0, 20, 20, 0, 0, 0, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2125 | /* T9 Object */ |
| 2126 | 131, 0, 0, 26, 42, 0, 32, 80, 2, 5, |
| 2127 | 0, 5, 5, 0, 10, 30, 10, 10, 175, 4, |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2128 | 127, 7, 26, 21, 17, 19, 143, 35, 207, 40, |
| 2129 | 20, 5, 54, 49, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2130 | /* T18 Object */ |
| 2131 | 0, 0, |
| 2132 | /* T24 Object */ |
| 2133 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2134 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2135 | /* T25 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2136 | 0, 0, 72, 113, 168, 97, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2137 | /* T27 Object */ |
| 2138 | 0, 0, 0, 0, 0, 0, 0, |
| 2139 | /* T40 Object */ |
| 2140 | 0, 0, 0, 0, 0, |
| 2141 | /* T42 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2142 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2143 | /* T43 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2144 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2145 | 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2146 | /* T46 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2147 | 68, 0, 16, 16, 0, 0, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2148 | /* T47 Object */ |
| 2149 | 0, 0, 0, 0, 0, 0, 3, 64, 66, 0, |
| 2150 | /* T48 Object */ |
| 2151 | 31, 64, 64, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2152 | 32, 50, 0, 10, 10, 0, 0, 100, 10, 90, |
| 2153 | 0, 0, 0, 0, 0, 0, 0, 10, 1, 30, |
| 2154 | 52, 10, 5, 0, 33, 0, 1, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2155 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2156 | 0, 0, 0, 0, |
| 2157 | /* T56 Object */ |
| 2158 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2159 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2160 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2161 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2162 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2163 | 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2164 | }; |
| 2165 | |
Amy Maloche | 08266db | 2011-11-04 11:07:16 -0700 | [diff] [blame] | 2166 | #define MXT_TS_GPIO_IRQ 11 |
| 2167 | #define MXT_TS_LDO_EN_GPIO 50 |
| 2168 | #define MXT_TS_RESET_GPIO 52 |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2169 | |
| 2170 | static void mxt_init_hw_liquid(void) |
| 2171 | { |
| 2172 | int rc; |
| 2173 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2174 | rc = gpio_request(MXT_TS_LDO_EN_GPIO, "mxt_ldo_en_gpio"); |
| 2175 | if (rc) { |
Amy Maloche | 08266db | 2011-11-04 11:07:16 -0700 | [diff] [blame] | 2176 | pr_err("%s: unable to request mxt_ldo_en_gpio [%d]\n", |
| 2177 | __func__, MXT_TS_LDO_EN_GPIO); |
| 2178 | return; |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2179 | } |
| 2180 | |
| 2181 | rc = gpio_direction_output(MXT_TS_LDO_EN_GPIO, 1); |
| 2182 | if (rc) { |
Amy Maloche | 08266db | 2011-11-04 11:07:16 -0700 | [diff] [blame] | 2183 | pr_err("%s: unable to set_direction for mxt_ldo_en_gpio [%d]\n", |
| 2184 | __func__, MXT_TS_LDO_EN_GPIO); |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2185 | goto err_ldo_gpio_req; |
| 2186 | } |
| 2187 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2188 | return; |
| 2189 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2190 | err_ldo_gpio_req: |
| 2191 | gpio_free(MXT_TS_LDO_EN_GPIO); |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2192 | } |
| 2193 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2194 | static struct mxt_config_info mxt_config_array_2d[] = { |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 2195 | { |
| 2196 | .config = mxt1386_config_data, |
| 2197 | .config_length = ARRAY_SIZE(mxt1386_config_data), |
| 2198 | .family_id = 0xA0, |
| 2199 | .variant_id = 0x0, |
| 2200 | .version = 0x10, |
| 2201 | .build = 0xAA, |
Anirudh Ghayal | a77941e | 2012-02-23 19:12:26 -0800 | [diff] [blame] | 2202 | .bootldr_id = MXT_BOOTLOADER_ID_1386, |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 2203 | }, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2204 | { |
| 2205 | .config = mxt1386e_config_data_v1_0, |
| 2206 | .config_length = ARRAY_SIZE(mxt1386e_config_data_v1_0), |
| 2207 | .family_id = 0xA0, |
| 2208 | .variant_id = 0x2, |
| 2209 | .version = 0x10, |
| 2210 | .build = 0xAA, |
Anirudh Ghayal | a77941e | 2012-02-23 19:12:26 -0800 | [diff] [blame] | 2211 | .bootldr_id = MXT_BOOTLOADER_ID_1386E, |
Jing Lin | aeaeed5 | 2012-03-26 14:57:15 -0700 | [diff] [blame] | 2212 | .fw_name = "atmel_8960_liquid_v2_2_AA.hex", |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2213 | }, |
| 2214 | { |
| 2215 | .config = mxt1386e_config_data_v2_1, |
| 2216 | .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1), |
| 2217 | .family_id = 0xA0, |
| 2218 | .variant_id = 0x7, |
| 2219 | .version = 0x21, |
| 2220 | .build = 0xAA, |
Anirudh Ghayal | a77941e | 2012-02-23 19:12:26 -0800 | [diff] [blame] | 2221 | .bootldr_id = MXT_BOOTLOADER_ID_1386E, |
Jing Lin | aeaeed5 | 2012-03-26 14:57:15 -0700 | [diff] [blame] | 2222 | .fw_name = "atmel_8960_liquid_v2_2_AA.hex", |
| 2223 | }, |
| 2224 | { |
| 2225 | /* The config data for V2.2.AA is the same as for V2.1.AA */ |
| 2226 | .config = mxt1386e_config_data_v2_1, |
| 2227 | .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1), |
| 2228 | .family_id = 0xA0, |
| 2229 | .variant_id = 0x7, |
| 2230 | .version = 0x22, |
| 2231 | .build = 0xAA, |
| 2232 | .bootldr_id = MXT_BOOTLOADER_ID_1386E, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2233 | }, |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 2234 | }; |
| 2235 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2236 | static struct mxt_platform_data mxt_platform_data_2d = { |
| 2237 | .config_array = mxt_config_array_2d, |
| 2238 | .config_array_size = ARRAY_SIZE(mxt_config_array_2d), |
Mohan Pallaka | 56a1a5d | 2012-02-23 12:05:13 -0800 | [diff] [blame] | 2239 | .panel_minx = 0, |
| 2240 | .panel_maxx = 1365, |
| 2241 | .panel_miny = 0, |
| 2242 | .panel_maxy = 767, |
| 2243 | .disp_minx = 0, |
| 2244 | .disp_maxx = 1365, |
| 2245 | .disp_miny = 0, |
| 2246 | .disp_maxy = 767, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2247 | .irqflags = IRQF_TRIGGER_FALLING, |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2248 | .i2c_pull_up = true, |
Amy Maloche | 08266db | 2011-11-04 11:07:16 -0700 | [diff] [blame] | 2249 | .reset_gpio = MXT_TS_RESET_GPIO, |
| 2250 | .irq_gpio = MXT_TS_GPIO_IRQ, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2251 | }; |
| 2252 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2253 | static struct mxt_config_info mxt_config_array_3d[] = { |
| 2254 | { |
| 2255 | .config = mxt1386e_config_data_3d, |
| 2256 | .config_length = ARRAY_SIZE(mxt1386e_config_data_3d), |
| 2257 | .family_id = 0xA0, |
| 2258 | .variant_id = 0x7, |
| 2259 | .version = 0x21, |
| 2260 | .build = 0xAA, |
| 2261 | }, |
| 2262 | }; |
| 2263 | |
| 2264 | static struct mxt_platform_data mxt_platform_data_3d = { |
| 2265 | .config_array = mxt_config_array_3d, |
| 2266 | .config_array_size = ARRAY_SIZE(mxt_config_array_3d), |
Mohan Pallaka | 56a1a5d | 2012-02-23 12:05:13 -0800 | [diff] [blame] | 2267 | .panel_minx = 0, |
| 2268 | .panel_maxx = 1919, |
| 2269 | .panel_miny = 0, |
| 2270 | .panel_maxy = 1199, |
| 2271 | .disp_minx = 0, |
| 2272 | .disp_maxx = 1919, |
| 2273 | .disp_miny = 0, |
| 2274 | .disp_maxy = 1199, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2275 | .irqflags = IRQF_TRIGGER_FALLING, |
| 2276 | .i2c_pull_up = true, |
| 2277 | .reset_gpio = MXT_TS_RESET_GPIO, |
| 2278 | .irq_gpio = MXT_TS_GPIO_IRQ, |
| 2279 | }; |
| 2280 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2281 | static struct i2c_board_info mxt_device_info[] __initdata = { |
| 2282 | { |
| 2283 | I2C_BOARD_INFO("atmel_mxt_ts", 0x5b), |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2284 | .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ), |
| 2285 | }, |
| 2286 | }; |
| 2287 | |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 2288 | static struct msm_mhl_platform_data mhl_platform_data = { |
| 2289 | .irq = MSM_GPIO_TO_INT(4), |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 2290 | .gpio_mhl_int = MHL_GPIO_INT, |
| 2291 | .gpio_mhl_reset = MHL_GPIO_RESET, |
| 2292 | .gpio_mhl_power = 0, |
| 2293 | .gpio_hdmi_mhl_mux = 0, |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 2294 | }; |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 2295 | |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 2296 | static struct i2c_board_info sii_device_info[] __initdata = { |
| 2297 | { |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 2298 | #ifdef CONFIG_FB_MSM_HDMI_MHL_8334 |
| 2299 | /* |
| 2300 | * keeps SI 8334 as the default |
| 2301 | * MHL TX |
| 2302 | */ |
| 2303 | I2C_BOARD_INFO("sii8334", 0x39), |
| 2304 | .platform_data = &mhl_platform_data, |
| 2305 | #endif |
| 2306 | #ifdef CONFIG_FB_MSM_HDMI_MHL_9244 |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 2307 | I2C_BOARD_INFO("Sil-9244", 0x39), |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 2308 | .irq = MSM_GPIO_TO_INT(15), |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 2309 | #endif /* CONFIG_MSM_HDMI_MHL */ |
| 2310 | .flags = I2C_CLIENT_WAKE, |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 2311 | }, |
| 2312 | }; |
| 2313 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2314 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = { |
| 2315 | .clk_freq = 100000, |
| 2316 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2317 | }; |
| 2318 | |
| 2319 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = { |
| 2320 | .clk_freq = 100000, |
| 2321 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2322 | }; |
| 2323 | |
| 2324 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = { |
| 2325 | .clk_freq = 100000, |
| 2326 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2327 | }; |
| 2328 | |
| 2329 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = { |
| 2330 | .clk_freq = 100000, |
| 2331 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2332 | }; |
| 2333 | |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 2334 | static struct ks8851_pdata spi_eth_pdata = { |
| 2335 | .irq_gpio = KS8851_IRQ_GPIO, |
| 2336 | .rst_gpio = KS8851_RST_GPIO, |
| 2337 | }; |
Praveen Chidambaram | 043f4ce | 2011-08-02 09:37:59 -0600 | [diff] [blame] | 2338 | |
Anirudh Ghayal | 50137fb | 2012-07-31 16:58:53 +0530 | [diff] [blame] | 2339 | static struct spi_board_info spi_eth_info[] __initdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2340 | { |
| 2341 | .modalias = "ks8851", |
| 2342 | .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO), |
| 2343 | .max_speed_hz = 19200000, |
| 2344 | .bus_num = 0, |
| 2345 | .chip_select = 0, |
| 2346 | .mode = SPI_MODE_0, |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 2347 | .platform_data = &spi_eth_pdata |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2348 | }, |
Anirudh Ghayal | 50137fb | 2012-07-31 16:58:53 +0530 | [diff] [blame] | 2349 | }; |
| 2350 | static struct spi_board_info spi_board_info[] __initdata = { |
Chandan Uddaraju | 15e54b9 | 2011-09-12 10:52:36 -0700 | [diff] [blame] | 2351 | { |
| 2352 | .modalias = "dsi_novatek_3d_panel_spi", |
| 2353 | .max_speed_hz = 10800000, |
| 2354 | .bus_num = 0, |
| 2355 | .chip_select = 1, |
| 2356 | .mode = SPI_MODE_0, |
| 2357 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2358 | }; |
| 2359 | |
| 2360 | static struct platform_device msm_device_saw_core0 = { |
| 2361 | .name = "saw-regulator", |
| 2362 | .id = 0, |
| 2363 | .dev = { |
| 2364 | .platform_data = &msm_saw_regulator_pdata_s5, |
| 2365 | }, |
| 2366 | }; |
| 2367 | |
| 2368 | static struct platform_device msm_device_saw_core1 = { |
| 2369 | .name = "saw-regulator", |
| 2370 | .id = 1, |
| 2371 | .dev = { |
| 2372 | .platform_data = &msm_saw_regulator_pdata_s6, |
| 2373 | }, |
| 2374 | }; |
| 2375 | |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 2376 | static struct tsens_platform_data msm_tsens_pdata = { |
Siddartha Mohanadoss | caeaa92 | 2012-02-07 16:41:38 -0800 | [diff] [blame] | 2377 | .slope = {910, 910, 910, 910, 910}, |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 2378 | .tsens_factor = 1000, |
| 2379 | .hw_type = MSM_8960, |
| 2380 | .tsens_num_sensor = 5, |
| 2381 | }; |
| 2382 | |
Siddartha Mohanadoss | 48cad91 | 2012-04-05 21:29:54 -0700 | [diff] [blame] | 2383 | static struct platform_device msm_tsens_device = { |
| 2384 | .name = "tsens8960-tm", |
| 2385 | .id = -1, |
| 2386 | }; |
| 2387 | |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 2388 | static struct msm_thermal_data msm_thermal_pdata = { |
| 2389 | .sensor_id = 0, |
Eugene Seah | 2ee4a5d | 2012-06-25 18:16:41 -0600 | [diff] [blame] | 2390 | .poll_ms = 250, |
| 2391 | .limit_temp_degC = 60, |
| 2392 | .temp_hysteresis_degC = 10, |
| 2393 | .freq_step = 2, |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 2394 | }; |
| 2395 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2396 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 2397 | static struct platform_device fish_battery_device = { |
| 2398 | .name = "fish_battery", |
| 2399 | }; |
| 2400 | #endif |
| 2401 | |
Binqiang Qiu | f165c92 | 2012-08-15 18:00:18 -0700 | [diff] [blame] | 2402 | #ifdef CONFIG_BATTERY_BCL |
| 2403 | static struct platform_device battery_bcl_device = { |
| 2404 | .name = "battery_current_limit", |
| 2405 | .id = -1, |
| 2406 | }; |
| 2407 | #endif |
| 2408 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2409 | static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2410 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2411 | .id = PM8921_MPP_PM_TO_SYS(7), |
| 2412 | .dev = { |
| 2413 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V], |
| 2414 | }, |
| 2415 | }; |
| 2416 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2417 | static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2418 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2419 | .id = 91, |
| 2420 | .dev = { |
| 2421 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2], |
| 2422 | }, |
| 2423 | }; |
| 2424 | |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 2425 | static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = { |
| 2426 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2427 | .id = PM8921_GPIO_PM_TO_SYS(17), |
| 2428 | .dev = { |
| 2429 | .platform_data = |
| 2430 | &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V], |
| 2431 | }, |
| 2432 | }; |
| 2433 | |
David Collins | 35a78f5 | 2011-12-14 15:54:25 -0800 | [diff] [blame] | 2434 | static struct platform_device msm8960_device_ext_otg_sw_vreg __devinitdata = { |
| 2435 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2436 | .id = PM8921_GPIO_PM_TO_SYS(42), |
| 2437 | .dev = { |
| 2438 | .platform_data = |
| 2439 | &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_OTG_SW], |
| 2440 | }, |
| 2441 | }; |
| 2442 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2443 | static struct platform_device msm8960_device_rpm_regulator __devinitdata = { |
| 2444 | .name = "rpm-regulator", |
| 2445 | .id = -1, |
| 2446 | .dev = { |
| 2447 | .platform_data = &msm_rpm_regulator_pdata, |
| 2448 | }, |
| 2449 | }; |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 2450 | #ifdef CONFIG_SERIAL_MSM_HS |
| 2451 | static int configure_uart_gpios(int on) |
| 2452 | { |
| 2453 | int ret = 0, i; |
| 2454 | int uart_gpios[] = {93, 94, 95, 96}; |
| 2455 | |
| 2456 | for (i = 0; i < ARRAY_SIZE(uart_gpios); i++) { |
| 2457 | if (on) { |
| 2458 | ret = gpio_request(uart_gpios[i], NULL); |
| 2459 | if (ret) { |
| 2460 | pr_err("%s: unable to request uart gpio[%d]\n", |
| 2461 | __func__, uart_gpios[i]); |
| 2462 | break; |
| 2463 | } |
| 2464 | } else { |
| 2465 | gpio_free(uart_gpios[i]); |
| 2466 | } |
| 2467 | } |
| 2468 | |
| 2469 | if (ret && on && i) |
| 2470 | for (; i >= 0; i--) |
| 2471 | gpio_free(uart_gpios[i]); |
| 2472 | return ret; |
| 2473 | } |
| 2474 | |
| 2475 | static struct msm_serial_hs_platform_data msm_uart_dm9_pdata = { |
Mayank Rana | d85a508 | 2012-04-29 17:24:13 -0700 | [diff] [blame] | 2476 | .gpio_config = configure_uart_gpios, |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 2477 | }; |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 2478 | |
| 2479 | static int configure_gsbi8_uart_gpios(int on) |
| 2480 | { |
| 2481 | int ret = 0, i; |
| 2482 | int uart_gpios[] = {34, 35, 36, 37}; |
| 2483 | |
| 2484 | for (i = 0; i < ARRAY_SIZE(uart_gpios); i++) { |
| 2485 | if (on) { |
| 2486 | ret = gpio_request(uart_gpios[i], NULL); |
| 2487 | if (ret) { |
| 2488 | pr_err("%s: unable to request uart gpio[%d]\n", |
| 2489 | __func__, uart_gpios[i]); |
| 2490 | break; |
| 2491 | } |
| 2492 | } else { |
| 2493 | gpio_free(uart_gpios[i]); |
| 2494 | } |
| 2495 | } |
| 2496 | |
| 2497 | if (ret && on && i) |
| 2498 | for (; i >= 0; i--) |
| 2499 | gpio_free(uart_gpios[i]); |
| 2500 | return ret; |
| 2501 | } |
| 2502 | |
| 2503 | static struct msm_serial_hs_platform_data msm_uart_dm8_pdata = { |
| 2504 | .gpio_config = configure_gsbi8_uart_gpios, |
| 2505 | }; |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 2506 | #else |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 2507 | static struct msm_serial_hs_platform_data msm_uart_dm8_pdata; |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 2508 | static struct msm_serial_hs_platform_data msm_uart_dm9_pdata; |
| 2509 | #endif |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2510 | |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2511 | #if defined(CONFIG_BT) && defined(CONFIG_BT_HCIUART_ATH3K) |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2512 | enum WLANBT_STATUS { |
| 2513 | WLANOFF_BTOFF = 1, |
| 2514 | WLANOFF_BTON, |
| 2515 | WLANON_BTOFF, |
| 2516 | WLANON_BTON |
| 2517 | }; |
| 2518 | |
| 2519 | static DEFINE_MUTEX(ath_wlanbt_mutex); |
| 2520 | static int gpio_wlan_sys_rest_en = 26; |
| 2521 | static int ath_wlanbt_status = WLANOFF_BTOFF; |
| 2522 | |
| 2523 | static int ath6kl_power_control(int on) |
| 2524 | { |
| 2525 | int rc; |
| 2526 | |
| 2527 | if (on) { |
| 2528 | rc = gpio_request(gpio_wlan_sys_rest_en, "wlan sys_rst_n"); |
| 2529 | if (rc) { |
| 2530 | pr_err("%s: unable to request gpio %d (%d)\n", |
| 2531 | __func__, gpio_wlan_sys_rest_en, rc); |
| 2532 | return rc; |
| 2533 | } |
| 2534 | rc = gpio_direction_output(gpio_wlan_sys_rest_en, 0); |
| 2535 | msleep(200); |
| 2536 | rc = gpio_direction_output(gpio_wlan_sys_rest_en, 1); |
| 2537 | msleep(100); |
| 2538 | } else { |
| 2539 | gpio_set_value(gpio_wlan_sys_rest_en, 0); |
| 2540 | rc = gpio_direction_input(gpio_wlan_sys_rest_en); |
| 2541 | msleep(100); |
| 2542 | gpio_free(gpio_wlan_sys_rest_en); |
| 2543 | } |
| 2544 | return 0; |
| 2545 | }; |
| 2546 | |
| 2547 | static int ath6kl_wlan_power(int on) |
| 2548 | { |
| 2549 | int ret = 0; |
| 2550 | |
| 2551 | mutex_lock(&ath_wlanbt_mutex); |
| 2552 | if (on) { |
| 2553 | if (ath_wlanbt_status == WLANOFF_BTOFF) { |
| 2554 | ret = ath6kl_power_control(1); |
| 2555 | ath_wlanbt_status = WLANON_BTOFF; |
| 2556 | } else if (ath_wlanbt_status == WLANOFF_BTON) |
| 2557 | ath_wlanbt_status = WLANON_BTON; |
| 2558 | } else { |
| 2559 | if (ath_wlanbt_status == WLANON_BTOFF) { |
| 2560 | ret = ath6kl_power_control(0); |
| 2561 | ath_wlanbt_status = WLANOFF_BTOFF; |
| 2562 | } else if (ath_wlanbt_status == WLANON_BTON) |
| 2563 | ath_wlanbt_status = WLANOFF_BTON; |
| 2564 | } |
| 2565 | mutex_unlock(&ath_wlanbt_mutex); |
| 2566 | pr_debug("%s on= %d, wlan_status= %d\n", |
| 2567 | __func__, on, ath_wlanbt_status); |
| 2568 | return ret; |
| 2569 | }; |
| 2570 | |
| 2571 | static struct wifi_platform_data ath6kl_wifi_control = { |
| 2572 | .set_power = ath6kl_wlan_power, |
| 2573 | }; |
| 2574 | |
| 2575 | static struct platform_device msm_wlan_power_device = { |
| 2576 | .name = "ath6kl_power", |
| 2577 | .dev = { |
| 2578 | .platform_data = &ath6kl_wifi_control, |
| 2579 | }, |
| 2580 | }; |
| 2581 | |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2582 | static struct resource bluesleep_resources[] = { |
| 2583 | { |
| 2584 | .name = "gpio_host_wake", |
| 2585 | .start = 27, |
| 2586 | .end = 27, |
| 2587 | .flags = IORESOURCE_IO, |
| 2588 | }, |
| 2589 | { |
| 2590 | .name = "gpio_ext_wake", |
| 2591 | .start = 29, |
| 2592 | .end = 29, |
| 2593 | .flags = IORESOURCE_IO, |
| 2594 | }, |
| 2595 | { |
| 2596 | .name = "host_wake", |
| 2597 | .start = MSM_GPIO_TO_INT(27), |
| 2598 | .end = MSM_GPIO_TO_INT(27), |
| 2599 | .flags = IORESOURCE_IRQ, |
| 2600 | }, |
| 2601 | }; |
| 2602 | |
| 2603 | static struct platform_device msm_bluesleep_device = { |
| 2604 | .name = "bluesleep", |
| 2605 | .id = -1, |
| 2606 | .num_resources = ARRAY_SIZE(bluesleep_resources), |
| 2607 | .resource = bluesleep_resources, |
| 2608 | }; |
| 2609 | |
| 2610 | static struct platform_device msm_bt_power_device = { |
| 2611 | .name = "bt_power", |
| 2612 | }; |
| 2613 | |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2614 | static int gpio_bt_sys_rest_en = 28; |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2615 | |
| 2616 | static int bluetooth_power(int on) |
| 2617 | { |
| 2618 | int rc; |
| 2619 | |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2620 | mutex_lock(&ath_wlanbt_mutex); |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2621 | if (on) { |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2622 | if (ath_wlanbt_status == WLANOFF_BTOFF) { |
| 2623 | ath6kl_power_control(1); |
| 2624 | ath_wlanbt_status = WLANOFF_BTON; |
| 2625 | } else if (ath_wlanbt_status == WLANON_BTOFF) |
| 2626 | ath_wlanbt_status = WLANON_BTON; |
| 2627 | |
Ram Mohan Korukonda | c4cfb69 | 2012-08-18 22:24:03 +0530 | [diff] [blame] | 2628 | rc = gpio_request(gpio_bt_sys_rest_en, "bt sys_rst_n"); |
| 2629 | if (rc) { |
| 2630 | pr_err("%s: unable to request gpio %d (%d)\n", |
| 2631 | __func__, gpio_bt_sys_rest_en, rc); |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2632 | mutex_unlock(&ath_wlanbt_mutex); |
| 2633 | return rc; |
Ram Mohan Korukonda | c4cfb69 | 2012-08-18 22:24:03 +0530 | [diff] [blame] | 2634 | } |
| 2635 | rc = gpio_direction_output(gpio_bt_sys_rest_en, 0); |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2636 | msleep(20); |
| 2637 | rc = gpio_direction_output(gpio_bt_sys_rest_en, 1); |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2638 | msleep(100); |
| 2639 | } else { |
| 2640 | gpio_set_value(gpio_bt_sys_rest_en, 0); |
| 2641 | rc = gpio_direction_input(gpio_bt_sys_rest_en); |
| 2642 | msleep(100); |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2643 | gpio_free(gpio_bt_sys_rest_en); |
Ram Mohan Korukonda | c4cfb69 | 2012-08-18 22:24:03 +0530 | [diff] [blame] | 2644 | |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2645 | if (ath_wlanbt_status == WLANOFF_BTON) { |
| 2646 | ath6kl_power_control(0); |
| 2647 | ath_wlanbt_status = WLANOFF_BTOFF; |
| 2648 | } else if (ath_wlanbt_status == WLANON_BTON) |
| 2649 | ath_wlanbt_status = WLANON_BTOFF; |
| 2650 | } |
| 2651 | mutex_unlock(&ath_wlanbt_mutex); |
| 2652 | pr_debug("%s on= %d, wlan_status= %d\n", |
| 2653 | __func__, on, ath_wlanbt_status); |
| 2654 | return 0; |
| 2655 | }; |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2656 | |
| 2657 | static void __init bt_power_init(void) |
| 2658 | { |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2659 | msm_bt_power_device.dev.platform_data = &bluetooth_power; |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2660 | return; |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2661 | }; |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2662 | #else |
| 2663 | #define bt_power_init(x) do {} while (0) |
| 2664 | #endif |
| 2665 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2666 | static struct platform_device *common_devices[] __initdata = { |
Stepan Moskovchenko | df13d34 | 2011-08-03 19:01:25 -0700 | [diff] [blame] | 2667 | &msm8960_device_dmov, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2668 | &msm_device_smd, |
Mayank Rana | 9f51f58 | 2011-08-04 18:35:59 +0530 | [diff] [blame] | 2669 | &msm_device_uart_dm6, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2670 | &msm_device_saw_core0, |
| 2671 | &msm_device_saw_core1, |
| 2672 | &msm8960_device_ext_5v_vreg, |
David Collins | 8757961 | 2012-01-30 16:00:15 -0800 | [diff] [blame] | 2673 | &msm8960_device_ssbi_pmic, |
David Collins | 96aa3e1 | 2012-02-29 10:31:34 -0800 | [diff] [blame] | 2674 | &msm8960_device_ext_otg_sw_vreg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2675 | &msm8960_device_qup_spi_gsbi1, |
| 2676 | &msm8960_device_qup_i2c_gsbi3, |
| 2677 | &msm8960_device_qup_i2c_gsbi4, |
| 2678 | &msm8960_device_qup_i2c_gsbi10, |
| 2679 | #ifndef CONFIG_MSM_DSPS |
| 2680 | &msm8960_device_qup_i2c_gsbi12, |
| 2681 | #endif |
| 2682 | &msm_slim_ctrl, |
| 2683 | &msm_device_wcnss_wlan, |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2684 | #if defined(CONFIG_BT) && defined(CONFIG_BT_HCIUART_ATH3K) |
| 2685 | &msm_bluesleep_device, |
| 2686 | &msm_bt_power_device, |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2687 | &msm_wlan_power_device, |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2688 | #endif |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 2689 | #if defined(CONFIG_QSEECOM) |
| 2690 | &qseecom_device, |
| 2691 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2692 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 2693 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 2694 | &qcrypto_device, |
| 2695 | #endif |
| 2696 | |
| 2697 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 2698 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 2699 | &qcedev_device, |
| 2700 | #endif |
| 2701 | #ifdef CONFIG_MSM_ROTATOR |
| 2702 | &msm_rotator_device, |
| 2703 | #endif |
| 2704 | &msm_device_sps, |
| 2705 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 2706 | &fish_battery_device, |
| 2707 | #endif |
Binqiang Qiu | f165c92 | 2012-08-15 18:00:18 -0700 | [diff] [blame] | 2708 | #ifdef CONFIG_BATTERY_BCL |
| 2709 | &battery_bcl_device, |
| 2710 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2711 | &msm_device_bam_dmux, |
| 2712 | &msm_fm_platform_init, |
Joel Nider | a126194 | 2011-09-12 16:30:09 +0300 | [diff] [blame] | 2713 | #if defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE) |
| 2714 | #ifdef CONFIG_MSM_USE_TSIF1 |
| 2715 | &msm_device_tsif[1], |
| 2716 | #else |
| 2717 | &msm_device_tsif[0], |
| 2718 | #endif |
| 2719 | #endif |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 2720 | &msm_device_tspp, |
Mona Hossain | 9c430e3 | 2011-07-27 11:04:47 -0700 | [diff] [blame] | 2721 | #ifdef CONFIG_HW_RANDOM_MSM |
| 2722 | &msm_device_rng, |
| 2723 | #endif |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 2724 | #ifdef CONFIG_ION_MSM |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2725 | &msm8960_ion_dev, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 2726 | #endif |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2727 | &msm8960_rpm_device, |
| 2728 | &msm8960_rpm_log_device, |
| 2729 | &msm8960_rpm_stat_device, |
Anji Jonnala | 9312992 | 2012-10-09 20:57:53 +0530 | [diff] [blame] | 2730 | &msm8960_rpm_master_stat_device, |
Mona Hossain | 11c03ac | 2011-10-26 12:42:10 -0700 | [diff] [blame] | 2731 | &msm_device_tz_log, |
Pratik Patel | 3b0ca88 | 2012-06-01 16:54:14 -0700 | [diff] [blame] | 2732 | &coresight_tpiu_device, |
| 2733 | &coresight_etb_device, |
| 2734 | &coresight_funnel_device, |
| 2735 | &coresight_etm0_device, |
| 2736 | &coresight_etm1_device, |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 2737 | &msm_device_dspcrashd_8960, |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 2738 | &msm8960_device_watchdog, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2739 | &msm8960_rtb_device, |
Stepan Moskovchenko | 28662c5 | 2012-03-01 12:48:45 -0800 | [diff] [blame] | 2740 | &msm8960_device_cache_erp, |
Stepan Moskovchenko | c055725 | 2012-06-07 17:39:14 -0700 | [diff] [blame] | 2741 | &msm8960_device_ebi1_ch0_erp, |
| 2742 | &msm8960_device_ebi1_ch1_erp, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2743 | &msm8960_cache_dump_device, |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 2744 | &msm8960_iommu_domain_device, |
Siddartha Mohanadoss | 48cad91 | 2012-04-05 21:29:54 -0700 | [diff] [blame] | 2745 | &msm_tsens_device, |
Anji Jonnala | f91d897 | 2013-02-26 17:55:50 +0530 | [diff] [blame] | 2746 | &msm8960_cpu_slp_status, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2747 | }; |
| 2748 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2749 | static struct platform_device *cdp_devices[] __initdata = { |
Stephen Boyd | eb81988 | 2011-08-29 14:46:30 -0700 | [diff] [blame] | 2750 | &msm_8960_q6_lpass, |
Stephen Boyd | 322a992 | 2011-09-20 01:05:54 -0700 | [diff] [blame] | 2751 | &msm_8960_riva, |
Stephen Boyd | d89eebe | 2011-09-28 23:28:11 -0700 | [diff] [blame] | 2752 | &msm_pil_tzapps, |
Stephen Boyd | 25c4a0b | 2011-09-20 00:12:36 -0700 | [diff] [blame] | 2753 | &msm_pil_dsps, |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 2754 | &msm_pil_vidc, |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 2755 | &msm8960_device_otg, |
| 2756 | &msm8960_device_gadget_peripheral, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2757 | &msm_device_hsusb_host, |
| 2758 | &android_usb_device, |
| 2759 | &msm_pcm, |
Kiran Kandi | 5e809b0 | 2012-01-31 00:24:33 -0800 | [diff] [blame] | 2760 | &msm_multi_ch_pcm, |
Jayasena Sangaraboina | 99bf09c | 2012-07-17 12:03:08 -0700 | [diff] [blame] | 2761 | &msm_lowlatency_pcm, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2762 | &msm_pcm_routing, |
| 2763 | &msm_cpudai0, |
| 2764 | &msm_cpudai1, |
Kiran Kandi | 97fe19d | 2012-05-20 22:34:04 -0700 | [diff] [blame] | 2765 | &msm8960_cpudai_slimbus_2_rx, |
Kiran Kandi | 1e6371d | 2012-03-29 11:48:57 -0700 | [diff] [blame] | 2766 | &msm8960_cpudai_slimbus_2_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2767 | &msm_cpudai_hdmi_rx, |
| 2768 | &msm_cpudai_bt_rx, |
| 2769 | &msm_cpudai_bt_tx, |
| 2770 | &msm_cpudai_fm_rx, |
| 2771 | &msm_cpudai_fm_tx, |
Bhalchandra Gajare | 0e795c4 | 2011-08-15 18:10:30 -0700 | [diff] [blame] | 2772 | &msm_cpudai_auxpcm_rx, |
| 2773 | &msm_cpudai_auxpcm_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2774 | &msm_cpu_fe, |
| 2775 | &msm_stub_codec, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2776 | #ifdef CONFIG_MSM_GEMINI |
| 2777 | &msm8960_gemini_device, |
| 2778 | #endif |
Kalyani Oruganti | 465d1e1 | 2012-05-15 10:23:05 -0700 | [diff] [blame] | 2779 | #ifdef CONFIG_MSM_MERCURY |
| 2780 | &msm8960_mercury_device, |
| 2781 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2782 | &msm_voice, |
| 2783 | &msm_voip, |
| 2784 | &msm_lpa_pcm, |
Laxminath Kasam | cee1d60 | 2011-08-01 19:26:57 +0530 | [diff] [blame] | 2785 | &msm_cpudai_afe_01_rx, |
| 2786 | &msm_cpudai_afe_01_tx, |
| 2787 | &msm_cpudai_afe_02_rx, |
| 2788 | &msm_cpudai_afe_02_tx, |
| 2789 | &msm_pcm_afe, |
Asish Bhattacharya | 96bb6f4 | 2011-11-01 20:36:09 +0530 | [diff] [blame] | 2790 | &msm_compr_dsp, |
Helen Zeng | 0705a5f | 2011-10-14 15:29:52 -0700 | [diff] [blame] | 2791 | &msm_cpudai_incall_music_rx, |
Helen Zeng | e3d716a | 2011-10-14 16:32:16 -0700 | [diff] [blame] | 2792 | &msm_cpudai_incall_record_rx, |
| 2793 | &msm_cpudai_incall_record_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2794 | &msm_pcm_hostless, |
| 2795 | &msm_bus_apps_fabric, |
| 2796 | &msm_bus_sys_fabric, |
| 2797 | &msm_bus_mm_fabric, |
| 2798 | &msm_bus_sys_fpb, |
| 2799 | &msm_bus_cpss_fpb, |
| 2800 | }; |
| 2801 | |
| 2802 | static void __init msm8960_i2c_init(void) |
| 2803 | { |
Kiran Gunda | af3b356 | 2012-08-31 14:00:05 +0530 | [diff] [blame] | 2804 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) |
| 2805 | msm8960_i2c_qup_gsbi4_pdata.keep_ahb_clk_on = 1; |
| 2806 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2807 | msm8960_device_qup_i2c_gsbi4.dev.platform_data = |
| 2808 | &msm8960_i2c_qup_gsbi4_pdata; |
| 2809 | |
| 2810 | msm8960_device_qup_i2c_gsbi3.dev.platform_data = |
| 2811 | &msm8960_i2c_qup_gsbi3_pdata; |
| 2812 | |
| 2813 | msm8960_device_qup_i2c_gsbi10.dev.platform_data = |
| 2814 | &msm8960_i2c_qup_gsbi10_pdata; |
| 2815 | |
| 2816 | msm8960_device_qup_i2c_gsbi12.dev.platform_data = |
| 2817 | &msm8960_i2c_qup_gsbi12_pdata; |
| 2818 | } |
| 2819 | |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 2820 | static void __init msm8960_gfx_init(void) |
| 2821 | { |
Jordan Crouse | 4815e9f | 2012-07-09 15:36:37 -0600 | [diff] [blame] | 2822 | struct kgsl_device_platform_data *kgsl_3d0_pdata = |
| 2823 | msm_kgsl_3d0.dev.platform_data; |
Jeremy Gebben | 58b2dce | 2011-10-13 11:14:19 -0600 | [diff] [blame] | 2824 | uint32_t soc_platform_version = socinfo_get_version(); |
Jordan Crouse | 4815e9f | 2012-07-09 15:36:37 -0600 | [diff] [blame] | 2825 | |
Carter Cooper | a4a7ed2 | 2012-08-20 22:11:42 -0600 | [diff] [blame] | 2826 | /* Fixup data that needs to change based on GPU ID */ |
Jordan Crouse | 4815e9f | 2012-07-09 15:36:37 -0600 | [diff] [blame] | 2827 | if (cpu_is_msm8960ab()) { |
Hareesh Gundu | ec2f1d8 | 2013-02-20 20:16:11 +0530 | [diff] [blame] | 2828 | if (SOCINFO_VERSION_MINOR(soc_platform_version) == 0) |
| 2829 | kgsl_3d0_pdata->chipid = ADRENO_CHIPID(3, 2, 1, 0); |
| 2830 | else |
| 2831 | kgsl_3d0_pdata->chipid = ADRENO_CHIPID(3, 2, 1, 1); |
Suman Tatiraju | 03a95db | 2012-10-29 18:24:53 -0700 | [diff] [blame] | 2832 | /* 8960PRO nominal clock rate is 320Mhz */ |
| 2833 | kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 320000000; |
Lucille Sylvester | 0a82ff2 | 2012-12-06 14:10:19 -0700 | [diff] [blame] | 2834 | #ifdef CONFIG_MSM_BUS_SCALING |
| 2835 | kgsl_3d0_pdata->bus_scale_table = &grp3d_bus_scale_pdata_ab; |
| 2836 | #endif |
Harsh Vardhan Dwivedi | 623b9a2 | 2012-10-28 20:54:17 -0600 | [diff] [blame] | 2837 | |
| 2838 | /* |
| 2839 | * If this an A320 GPU device (MSM8960AB), then |
| 2840 | * switch the resource table to 8960AB, to reflect the |
| 2841 | * separate register and shader memory mapping used in A320. |
| 2842 | */ |
| 2843 | |
| 2844 | msm_kgsl_3d0.num_resources = kgsl_num_resources_8960ab; |
| 2845 | msm_kgsl_3d0.resource = kgsl_3d0_resources_8960ab; |
Carter Cooper | a4a7ed2 | 2012-08-20 22:11:42 -0600 | [diff] [blame] | 2846 | } else { |
| 2847 | kgsl_3d0_pdata->iommu_count = 1; |
Harsh Vardhan Dwivedi | 623b9a2 | 2012-10-28 20:54:17 -0600 | [diff] [blame] | 2848 | |
Carter Cooper | a4a7ed2 | 2012-08-20 22:11:42 -0600 | [diff] [blame] | 2849 | if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) { |
| 2850 | kgsl_3d0_pdata->pwrlevel[0].gpu_freq = 320000000; |
| 2851 | kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 266667000; |
| 2852 | } |
| 2853 | if (SOCINFO_VERSION_MAJOR(soc_platform_version) >= 3) { |
| 2854 | /* 8960v3 GPU registers returns 5 for patch release |
| 2855 | * but it should be 6, so dummy up the chipid here |
| 2856 | * based the platform type |
| 2857 | */ |
| 2858 | kgsl_3d0_pdata->chipid = ADRENO_CHIPID(2, 2, 0, 6); |
| 2859 | } |
Jordan Crouse | 4815e9f | 2012-07-09 15:36:37 -0600 | [diff] [blame] | 2860 | } |
Carter Cooper | 83e9dab | 2012-08-20 15:17:23 -0600 | [diff] [blame] | 2861 | |
| 2862 | /* Register the 3D core */ |
| 2863 | platform_device_register(&msm_kgsl_3d0); |
| 2864 | |
| 2865 | /* Register the 2D cores if we are not 8960PRO */ |
| 2866 | if (!cpu_is_msm8960ab()) { |
| 2867 | platform_device_register(&msm_kgsl_2d0); |
| 2868 | platform_device_register(&msm_kgsl_2d1); |
| 2869 | } |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 2870 | } |
| 2871 | |
Subhash Jadavani | 933e6a6 | 2011-12-26 18:05:04 +0530 | [diff] [blame] | 2872 | static struct msm_rpmrs_level msm_rpmrs_levels[] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2873 | { |
| 2874 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT, |
| 2875 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2876 | true, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2877 | 1, 784, 180000, 100, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2878 | }, |
| 2879 | |
| 2880 | { |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 2881 | MSM_PM_SLEEP_MODE_RETENTION, |
| 2882 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2883 | true, |
| 2884 | 415, 715, 340827, 475, |
| 2885 | }, |
| 2886 | |
| 2887 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2888 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE, |
| 2889 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2890 | true, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2891 | 1300, 228, 1200000, 2000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2892 | }, |
| 2893 | |
| 2894 | { |
| 2895 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2896 | MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE), |
| 2897 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2898 | 2000, 138, 1208400, 3200, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2899 | }, |
| 2900 | |
| 2901 | { |
| 2902 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
Maheshkumar Sivasubramanian | 7df1236 | 2011-11-02 08:25:49 -0600 | [diff] [blame] | 2903 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 2904 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2905 | 6000, 119, 1850300, 9000, |
Maheshkumar Sivasubramanian | 7df1236 | 2011-11-02 08:25:49 -0600 | [diff] [blame] | 2906 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2907 | |
| 2908 | { |
| 2909 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2910 | MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE), |
| 2911 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2912 | 9200, 68, 2839200, 16400, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2913 | }, |
| 2914 | |
| 2915 | { |
| 2916 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2917 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE), |
| 2918 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2919 | 10300, 63, 3128000, 18200, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2920 | }, |
| 2921 | |
| 2922 | { |
| 2923 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2924 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 2925 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2926 | 18000, 10, 4602600, 27000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2927 | }, |
| 2928 | |
| 2929 | { |
| 2930 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2931 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW), |
| 2932 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2933 | 20000, 2, 5752000, 32000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2934 | }, |
| 2935 | }; |
| 2936 | |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 2937 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2938 | static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = { |
| 2939 | .levels = &msm_rpmrs_levels[0], |
| 2940 | .num_levels = ARRAY_SIZE(msm_rpmrs_levels), |
| 2941 | .vdd_mem_levels = { |
| 2942 | [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000, |
| 2943 | [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000, |
| 2944 | [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000, |
| 2945 | [MSM_RPMRS_VDD_MEM_MAX] = 1150000, |
| 2946 | }, |
| 2947 | .vdd_dig_levels = { |
| 2948 | [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000, |
| 2949 | [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000, |
| 2950 | [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000, |
| 2951 | [MSM_RPMRS_VDD_DIG_MAX] = 1150000, |
| 2952 | }, |
| 2953 | .vdd_mask = 0x7FFFFF, |
| 2954 | .rpmrs_target_id = { |
| 2955 | [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK, |
| 2956 | [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST, |
| 2957 | [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0, |
| 2958 | [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1, |
| 2959 | [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0, |
| 2960 | [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1, |
| 2961 | [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL, |
| 2962 | }, |
| 2963 | }; |
| 2964 | |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 2965 | static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = { |
| 2966 | .mode = MSM_PM_BOOT_CONFIG_TZ, |
| 2967 | }; |
| 2968 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2969 | #ifdef CONFIG_I2C |
| 2970 | #define I2C_SURF 1 |
| 2971 | #define I2C_FFA (1 << 1) |
| 2972 | #define I2C_RUMI (1 << 2) |
| 2973 | #define I2C_SIM (1 << 3) |
| 2974 | #define I2C_FLUID (1 << 4) |
Amir Samuelov | 05f8780 | 2011-08-27 18:30:12 +0300 | [diff] [blame] | 2975 | #define I2C_LIQUID (1 << 5) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2976 | |
| 2977 | struct i2c_registry { |
| 2978 | u8 machs; |
| 2979 | int bus; |
| 2980 | struct i2c_board_info *info; |
| 2981 | int len; |
| 2982 | }; |
| 2983 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2984 | /* Sensors DSPS platform data */ |
| 2985 | #ifdef CONFIG_MSM_DSPS |
| 2986 | #define DSPS_PIL_GENERIC_NAME "dsps" |
| 2987 | #endif /* CONFIG_MSM_DSPS */ |
| 2988 | |
| 2989 | static void __init msm8960_init_dsps(void) |
| 2990 | { |
| 2991 | #ifdef CONFIG_MSM_DSPS |
| 2992 | struct msm_dsps_platform_data *pdata = |
| 2993 | msm_dsps_device.dev.platform_data; |
| 2994 | pdata->pil_name = DSPS_PIL_GENERIC_NAME; |
| 2995 | pdata->gpios = NULL; |
| 2996 | pdata->gpios_num = 0; |
| 2997 | |
| 2998 | platform_device_register(&msm_dsps_device); |
| 2999 | #endif /* CONFIG_MSM_DSPS */ |
| 3000 | } |
| 3001 | |
Vamsi Krishna | 6aa6b1f | 2011-12-14 22:55:20 -0800 | [diff] [blame] | 3002 | static int hsic_peripheral_status = 1; |
| 3003 | static DEFINE_MUTEX(hsic_status_lock); |
| 3004 | |
| 3005 | void peripheral_connect() |
| 3006 | { |
| 3007 | mutex_lock(&hsic_status_lock); |
| 3008 | if (hsic_peripheral_status) |
| 3009 | goto out; |
| 3010 | platform_device_add(&msm_device_hsic_host); |
| 3011 | hsic_peripheral_status = 1; |
| 3012 | out: |
| 3013 | mutex_unlock(&hsic_status_lock); |
| 3014 | } |
| 3015 | EXPORT_SYMBOL(peripheral_connect); |
| 3016 | |
| 3017 | void peripheral_disconnect() |
| 3018 | { |
| 3019 | mutex_lock(&hsic_status_lock); |
| 3020 | if (!hsic_peripheral_status) |
| 3021 | goto out; |
| 3022 | platform_device_del(&msm_device_hsic_host); |
| 3023 | hsic_peripheral_status = 0; |
| 3024 | out: |
| 3025 | mutex_unlock(&hsic_status_lock); |
| 3026 | } |
| 3027 | EXPORT_SYMBOL(peripheral_disconnect); |
| 3028 | |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 3029 | static void __init msm8960_init_smsc_hub(void) |
| 3030 | { |
| 3031 | uint32_t version = socinfo_get_version(); |
| 3032 | |
| 3033 | if (SOCINFO_VERSION_MAJOR(version) == 1) |
| 3034 | return; |
| 3035 | |
| 3036 | if (machine_is_msm8960_liquid()) |
| 3037 | platform_device_register(&smsc_hub_device); |
| 3038 | } |
| 3039 | |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 3040 | static void __init msm8960_init_hsic(void) |
| 3041 | { |
| 3042 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 3043 | uint32_t version = socinfo_get_version(); |
| 3044 | |
Vamsi Krishna | f74d2edb | 2011-12-02 10:41:11 -0800 | [diff] [blame] | 3045 | if (SOCINFO_VERSION_MAJOR(version) == 1) |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 3046 | return; |
| 3047 | |
Joel King | 0cbf5d8 | 2012-05-24 15:21:38 -0700 | [diff] [blame] | 3048 | if (machine_is_msm8960_liquid()) |
Vamsi Krishna | f74d2edb | 2011-12-02 10:41:11 -0800 | [diff] [blame] | 3049 | platform_device_register(&msm_device_hsic_host); |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 3050 | #endif |
| 3051 | } |
| 3052 | |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 3053 | #ifdef CONFIG_ISL9519_CHARGER |
| 3054 | static struct isl_platform_data isl_data __initdata = { |
| 3055 | .valid_n_gpio = 0, /* Not required when notify-by-pmic */ |
| 3056 | .chg_detection_config = NULL, /* Not required when notify-by-pmic */ |
| 3057 | .max_system_voltage = 4200, |
| 3058 | .min_system_voltage = 3200, |
Amir Samuelov | 95f49ff | 2012-01-29 09:14:08 +0200 | [diff] [blame] | 3059 | .chgcurrent = 1900, |
| 3060 | .term_current = 0, |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 3061 | .input_current = 2048, |
| 3062 | }; |
| 3063 | |
| 3064 | static struct i2c_board_info isl_charger_i2c_info[] __initdata = { |
| 3065 | { |
| 3066 | I2C_BOARD_INFO("isl9519q", 0x9), |
| 3067 | .irq = 0, /* Not required when notify-by-pmic */ |
| 3068 | .platform_data = &isl_data, |
| 3069 | }, |
| 3070 | }; |
| 3071 | #endif /* CONFIG_ISL9519_CHARGER */ |
| 3072 | |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 3073 | static struct i2c_board_info liquid_io_expander_i2c_info[] __initdata = { |
| 3074 | { |
| 3075 | I2C_BOARD_INFO("sx1508q", 0x20), |
| 3076 | .platform_data = &msm8960_sx150x_data[SX150X_LIQUID] |
| 3077 | }, |
| 3078 | }; |
| 3079 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3080 | static struct i2c_registry msm8960_i2c_devices[] __initdata = { |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 3081 | #ifdef CONFIG_ISL9519_CHARGER |
| 3082 | { |
| 3083 | I2C_LIQUID, |
| 3084 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
| 3085 | isl_charger_i2c_info, |
| 3086 | ARRAY_SIZE(isl_charger_i2c_info), |
| 3087 | }, |
| 3088 | #endif /* CONFIG_ISL9519_CHARGER */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3089 | { |
| 3090 | I2C_SURF | I2C_FFA | I2C_FLUID, |
| 3091 | MSM_8960_GSBI3_QUP_I2C_BUS_ID, |
| 3092 | cyttsp_info, |
| 3093 | ARRAY_SIZE(cyttsp_info), |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 3094 | }, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 3095 | { |
| 3096 | I2C_LIQUID, |
| 3097 | MSM_8960_GSBI3_QUP_I2C_BUS_ID, |
| 3098 | mxt_device_info, |
| 3099 | ARRAY_SIZE(mxt_device_info), |
| 3100 | }, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 3101 | { |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 3102 | I2C_SURF | I2C_FFA | I2C_LIQUID, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 3103 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 3104 | sii_device_info, |
| 3105 | ARRAY_SIZE(sii_device_info), |
| 3106 | }, |
| 3107 | { |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 3108 | I2C_LIQUID | I2C_FFA, |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 3109 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 3110 | msm_isa1200_board_info, |
| 3111 | ARRAY_SIZE(msm_isa1200_board_info), |
| 3112 | }, |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 3113 | { |
| 3114 | I2C_LIQUID, |
| 3115 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
| 3116 | liquid_io_expander_i2c_info, |
| 3117 | ARRAY_SIZE(liquid_io_expander_i2c_info), |
| 3118 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3119 | }; |
| 3120 | #endif /* CONFIG_I2C */ |
| 3121 | |
| 3122 | static void __init register_i2c_devices(void) |
| 3123 | { |
| 3124 | #ifdef CONFIG_I2C |
| 3125 | u8 mach_mask = 0; |
| 3126 | int i; |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 3127 | #ifdef CONFIG_MSM_CAMERA |
| 3128 | struct i2c_registry msm8960_camera_i2c_devices = { |
| 3129 | I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI, |
| 3130 | MSM_8960_GSBI4_QUP_I2C_BUS_ID, |
| 3131 | msm8960_camera_board_info.board_info, |
| 3132 | msm8960_camera_board_info.num_i2c_board_info, |
| 3133 | }; |
| 3134 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3135 | |
| 3136 | /* Build the matching 'supported_machs' bitmask */ |
| 3137 | if (machine_is_msm8960_cdp()) |
| 3138 | mach_mask = I2C_SURF; |
Amy Maloche | 2d02803 | 2011-07-20 14:08:06 -0700 | [diff] [blame] | 3139 | else if (machine_is_msm8960_fluid()) |
| 3140 | mach_mask = I2C_FLUID; |
Amir Samuelov | 05f8780 | 2011-08-27 18:30:12 +0300 | [diff] [blame] | 3141 | else if (machine_is_msm8960_liquid()) |
| 3142 | mach_mask = I2C_LIQUID; |
Amy Maloche | 1b0663f | 2011-08-02 16:46:22 -0700 | [diff] [blame] | 3143 | else if (machine_is_msm8960_mtp()) |
| 3144 | mach_mask = I2C_FFA; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3145 | else |
| 3146 | pr_err("unmatched machine ID in register_i2c_devices\n"); |
| 3147 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 3148 | if (machine_is_msm8960_liquid()) { |
| 3149 | if (SOCINFO_VERSION_MAJOR(socinfo_get_platform_version()) == 3) |
| 3150 | mxt_device_info[0].platform_data = |
| 3151 | &mxt_platform_data_3d; |
| 3152 | else |
| 3153 | mxt_device_info[0].platform_data = |
| 3154 | &mxt_platform_data_2d; |
| 3155 | } |
| 3156 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3157 | /* Run the array and install devices as appropriate */ |
| 3158 | for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) { |
| 3159 | if (msm8960_i2c_devices[i].machs & mach_mask) |
| 3160 | i2c_register_board_info(msm8960_i2c_devices[i].bus, |
| 3161 | msm8960_i2c_devices[i].info, |
| 3162 | msm8960_i2c_devices[i].len); |
| 3163 | } |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 3164 | |
| 3165 | if (!mhl_platform_data.gpio_mhl_power) |
| 3166 | pr_debug("mhl device configured for ext debug board\n"); |
| 3167 | |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 3168 | #ifdef CONFIG_MSM_CAMERA |
| 3169 | if (msm8960_camera_i2c_devices.machs & mach_mask) |
| 3170 | i2c_register_board_info(msm8960_camera_i2c_devices.bus, |
| 3171 | msm8960_camera_i2c_devices.info, |
| 3172 | msm8960_camera_i2c_devices.len); |
| 3173 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3174 | #endif |
| 3175 | } |
| 3176 | |
Siddartha Mohanadoss | 30447fe | 2012-09-26 09:42:32 -0700 | [diff] [blame] | 3177 | static void __init msm8960_tsens_init(void) |
| 3178 | { |
| 3179 | if (cpu_is_msm8960()) |
| 3180 | if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1) |
| 3181 | return; |
| 3182 | |
| 3183 | msm_tsens_early_init(&msm_tsens_pdata); |
| 3184 | } |
| 3185 | |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 3186 | static void __init msm8960ab_update_krait_spm(void) |
Mahesh Sivasubramanian | c5c82f4 | 2012-10-22 13:33:59 -0600 | [diff] [blame] | 3187 | { |
| 3188 | int i; |
| 3189 | |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 3190 | /* Update the SPM sequences for SPC and PC */ |
| 3191 | for (i = 0; i < ARRAY_SIZE(msm_spm_data); i++) { |
| 3192 | int j; |
| 3193 | struct msm_spm_platform_data *pdata = &msm_spm_data[i]; |
| 3194 | for (j = 0; j < pdata->num_modes; j++) { |
| 3195 | if (pdata->modes[j].cmd == |
| 3196 | spm_power_collapse_without_rpm) |
| 3197 | pdata->modes[j].cmd = |
| 3198 | spm_power_collapse_without_rpm_krait_v3; |
| 3199 | else if (pdata->modes[j].cmd == |
| 3200 | spm_power_collapse_with_rpm) |
| 3201 | pdata->modes[j].cmd = |
| 3202 | spm_power_collapse_with_rpm_krait_v3; |
| 3203 | } |
| 3204 | } |
Mahesh Sivasubramanian | c5c82f4 | 2012-10-22 13:33:59 -0600 | [diff] [blame] | 3205 | } |
| 3206 | |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 3207 | static void __init msm8960ab_update_retention_spm(void) |
| 3208 | { |
| 3209 | int i; |
| 3210 | |
| 3211 | /* Update the SPM sequences for krait retention on all cores */ |
| 3212 | for (i = 0; i < ARRAY_SIZE(msm_spm_data); i++) { |
| 3213 | int j; |
| 3214 | struct msm_spm_platform_data *pdata = &msm_spm_data[i]; |
| 3215 | for (j = 0; j < pdata->num_modes; j++) { |
| 3216 | if (pdata->modes[j].cmd == |
| 3217 | spm_retention_cmd_sequence) |
| 3218 | pdata->modes[j].cmd = |
| 3219 | spm_retention_with_krait_v3_cmd_sequence; |
| 3220 | } |
| 3221 | } |
| 3222 | } |
| 3223 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3224 | static void __init msm8960_cdp_init(void) |
| 3225 | { |
Naveen Ramaraj | 76483ad | 2011-09-06 14:25:44 -0700 | [diff] [blame] | 3226 | if (meminfo_init(SYS_MEMORY, SZ_256M) < 0) |
| 3227 | pr_err("meminfo_init() failed!\n"); |
| 3228 | |
Rohit Vaswani | b1cc493 | 2012-07-23 21:30:11 -0700 | [diff] [blame] | 3229 | platform_device_register(&msm_gpio_device); |
Siddartha Mohanadoss | 30447fe | 2012-09-26 09:42:32 -0700 | [diff] [blame] | 3230 | msm8960_tsens_init(); |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 3231 | msm_thermal_init(&msm_thermal_pdata); |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 3232 | BUG_ON(msm_rpm_init(&msm8960_rpm_data)); |
| 3233 | BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data)); |
Abhijeet Dharmapurikar | 6d565fd | 2011-09-15 18:49:56 -0700 | [diff] [blame] | 3234 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3235 | regulator_suppress_info_printing(); |
| 3236 | if (msm_xo_init()) |
| 3237 | pr_err("Failed to initialize XO votes\n"); |
David Collins | e68647e | 2012-09-04 15:44:19 -0700 | [diff] [blame] | 3238 | configure_msm8960_power_grid(); |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 3239 | platform_device_register(&msm8960_device_rpm_regulator); |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 3240 | msm_clock_init(&msm8960_clock_init_data); |
Vijayavardhan Vennapusa | fc464f0 | 2011-11-04 21:54:00 +0530 | [diff] [blame] | 3241 | if (machine_is_msm8960_liquid()) |
| 3242 | msm_otg_pdata.mhl_enable = true; |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 3243 | msm8960_device_otg.dev.platform_data = &msm_otg_pdata; |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 3244 | if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() || |
| 3245 | machine_is_msm8960_cdp()) { |
Mayank Rana | a61da7a | 2012-08-14 10:57:00 +0530 | [diff] [blame] | 3246 | /* Due to availability of USB Switch in SGLTE Platform |
| 3247 | * it requires different HSUSB PHY settings compare to |
| 3248 | * 8960 MTP/CDP platform. |
| 3249 | */ |
| 3250 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) |
| 3251 | msm_otg_pdata.phy_init_seq = sglte_phy_init_seq; |
| 3252 | else |
| 3253 | msm_otg_pdata.phy_init_seq = wr_phy_init_seq; |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 3254 | } else if (machine_is_msm8960_liquid()) { |
| 3255 | msm_otg_pdata.phy_init_seq = |
| 3256 | liquid_v1_phy_init_seq; |
| 3257 | } |
Ofir Cohen | 94213a7 | 2012-05-03 14:26:32 +0300 | [diff] [blame] | 3258 | android_usb_pdata.swfi_latency = |
Anji jonnala | a7c1c5c | 2011-12-12 12:20:36 +0530 | [diff] [blame] | 3259 | msm_rpmrs_levels[0].latency_us; |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 3260 | msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata; |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 3261 | if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2 && |
| 3262 | machine_is_msm8960_liquid()) |
| 3263 | msm_device_hsic_host.dev.parent = &smsc_hub_device.dev; |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 3264 | msm8960_init_gpiomux(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3265 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 3266 | &msm8960_qup_spi_gsbi1_pdata; |
| 3267 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
Anirudh Ghayal | 50137fb | 2012-07-31 16:58:53 +0530 | [diff] [blame] | 3268 | if (socinfo_get_platform_subtype() != PLATFORM_SUBTYPE_SGLTE) |
| 3269 | spi_register_board_info(spi_eth_info, ARRAY_SIZE(spi_eth_info)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 3270 | |
| 3271 | msm8960_init_pmic(); |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 3272 | if (machine_is_msm8960_liquid() || (machine_is_msm8960_mtp() && |
Shantanu Jain | ae54a62 | 2012-12-03 15:09:39 +0530 | [diff] [blame] | 3273 | (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE || |
| 3274 | cpu_is_msm8960ab()))) |
Mohan Pallaka | f69f049 | 2011-11-21 13:08:33 +0530 | [diff] [blame] | 3275 | msm_isa1200_board_info[0].platform_data = &isa1200_1_pdata; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3276 | msm8960_i2c_init(); |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 3277 | msm8960_gfx_init(); |
Mahesh Sivasubramanian | c5c82f4 | 2012-10-22 13:33:59 -0600 | [diff] [blame] | 3278 | |
| 3279 | if (cpu_is_msm8960ab()) |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 3280 | msm8960ab_update_krait_spm(); |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 3281 | if (cpu_is_krait_v3()) { |
Praveen Chidambaram | f27a515 | 2013-02-01 11:44:53 -0700 | [diff] [blame] | 3282 | struct msm_pm_init_data_type *pdata = |
| 3283 | msm8960_pm_8x60.dev.platform_data; |
| 3284 | pdata->retention_calls_tz = false; |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 3285 | msm8960ab_update_retention_spm(); |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 3286 | } |
Praveen Chidambaram | f27a515 | 2013-02-01 11:44:53 -0700 | [diff] [blame] | 3287 | platform_device_register(&msm8960_pm_8x60); |
| 3288 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3289 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 3290 | msm_spm_l2_init(msm_spm_l2_data); |
Mahesh Sivasubramanian | c5c82f4 | 2012-10-22 13:33:59 -0600 | [diff] [blame] | 3291 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3292 | msm8960_init_buses(); |
Stephen Boyd | 913c29d | 2012-10-25 11:46:04 -0700 | [diff] [blame] | 3293 | if (cpu_is_msm8960ab()) { |
| 3294 | platform_add_devices(msm8960ab_footswitch, |
| 3295 | msm8960ab_num_footswitch); |
| 3296 | } else { |
| 3297 | platform_add_devices(msm8960_footswitch, |
| 3298 | msm8960_num_footswitch); |
| 3299 | } |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 3300 | if (machine_is_msm8960_liquid()) |
| 3301 | platform_device_register(&msm8960_device_ext_3p3v_vreg); |
David Collins | d5a4073 | 2011-11-29 15:53:56 -0800 | [diff] [blame] | 3302 | if (machine_is_msm8960_cdp()) |
| 3303 | platform_device_register(&msm8960_device_ext_l2_vreg); |
Stepan Moskovchenko | 2b4b1cd | 2012-03-29 18:21:04 -0700 | [diff] [blame] | 3304 | |
| 3305 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) |
| 3306 | platform_device_register(&msm8960_device_uart_gsbi8); |
| 3307 | else |
| 3308 | platform_device_register(&msm8960_device_uart_gsbi5); |
| 3309 | |
Mayank Rana | a7f75a6 | 2012-04-21 10:09:42 -0700 | [diff] [blame] | 3310 | /* For 8960 Fusion 2.2 Primary IPC */ |
Mayank Rana | d85a508 | 2012-04-29 17:24:13 -0700 | [diff] [blame] | 3311 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) { |
| 3312 | msm_uart_dm9_pdata.wakeup_irq = gpio_to_irq(94); /* GSBI9(2) */ |
Mayank Rana | a7f75a6 | 2012-04-21 10:09:42 -0700 | [diff] [blame] | 3313 | msm_device_uart_dm9.dev.platform_data = &msm_uart_dm9_pdata; |
Mayank Rana | 77f83c2 | 2012-07-10 09:31:02 +0530 | [diff] [blame] | 3314 | platform_device_register(&msm_device_uart_dm9); |
Mayank Rana | d85a508 | 2012-04-29 17:24:13 -0700 | [diff] [blame] | 3315 | } |
Mayank Rana | a7f75a6 | 2012-04-21 10:09:42 -0700 | [diff] [blame] | 3316 | |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 3317 | /* For 8960 Standalone External Bluetooth Interface */ |
| 3318 | if (socinfo_get_platform_subtype() != PLATFORM_SUBTYPE_SGLTE) { |
| 3319 | msm_device_uart_dm8.dev.platform_data = &msm_uart_dm8_pdata; |
| 3320 | platform_device_register(&msm_device_uart_dm8); |
| 3321 | } |
Patrick Daly | 6578e0c | 2012-07-19 18:50:02 -0700 | [diff] [blame] | 3322 | if (cpu_is_msm8960ab()) |
| 3323 | platform_device_register(&msm8960ab_device_acpuclk); |
| 3324 | else |
| 3325 | platform_device_register(&msm8960_device_acpuclk); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3326 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Arun Menon | 697e91b | 2012-08-20 15:25:50 -0700 | [diff] [blame] | 3327 | msm8960_add_vidc_device(); |
Patrick Daly | 6578e0c | 2012-07-19 18:50:02 -0700 | [diff] [blame] | 3328 | |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 3329 | msm8960_pm8921_gpio_mpp_init(); |
Stephen Boyd | ed03568 | 2012-09-13 12:41:31 -0700 | [diff] [blame] | 3330 | /* Don't add modem devices on APQ targets */ |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 3331 | if (socinfo_get_id() != 124) |
| 3332 | platform_device_register(&msm_8960_q6_mss); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3333 | platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices)); |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 3334 | msm8960_init_smsc_hub(); |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 3335 | msm8960_init_hsic(); |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 3336 | #ifdef CONFIG_MSM_CAMERA |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3337 | msm8960_init_cam(); |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 3338 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3339 | msm8960_init_mmc(); |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 3340 | if (machine_is_msm8960_liquid()) |
| 3341 | mxt_init_hw_liquid(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3342 | register_i2c_devices(); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 3343 | msm8960_init_fb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3344 | slim_register_board_info(msm_slim_devices, |
| 3345 | ARRAY_SIZE(msm_slim_devices)); |
| 3346 | msm8960_init_dsps(); |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 3347 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 3348 | bt_power_init(); |
Joel King | 0cbf5d8 | 2012-05-24 15:21:38 -0700 | [diff] [blame] | 3349 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) { |
| 3350 | mdm_sglte_device.dev.platform_data = &sglte_platform_data; |
| 3351 | platform_device_register(&mdm_sglte_device); |
| 3352 | } |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 3353 | } |
| 3354 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3355 | MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP") |
| 3356 | .map_io = msm8960_map_io, |
| 3357 | .reserve = msm8960_reserve, |
| 3358 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 3359 | .handle_irq = gic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3360 | .timer = &msm_timer, |
| 3361 | .init_machine = msm8960_cdp_init, |
| 3362 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 3363 | .init_very_early = msm8960_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3364 | .restart = msm_restart, |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 3365 | .smp = &msm8960_smp_ops, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3366 | MACHINE_END |
| 3367 | |
| 3368 | MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP") |
| 3369 | .map_io = msm8960_map_io, |
| 3370 | .reserve = msm8960_reserve, |
| 3371 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 3372 | .handle_irq = gic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3373 | .timer = &msm_timer, |
| 3374 | .init_machine = msm8960_cdp_init, |
| 3375 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 3376 | .init_very_early = msm8960_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3377 | .restart = msm_restart, |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 3378 | .smp = &msm8960_smp_ops, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3379 | MACHINE_END |
| 3380 | |
| 3381 | MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID") |
| 3382 | .map_io = msm8960_map_io, |
| 3383 | .reserve = msm8960_reserve, |
| 3384 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 3385 | .handle_irq = gic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3386 | .timer = &msm_timer, |
| 3387 | .init_machine = msm8960_cdp_init, |
| 3388 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 3389 | .init_very_early = msm8960_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3390 | .restart = msm_restart, |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 3391 | .smp = &msm8960_smp_ops, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3392 | MACHINE_END |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 3393 | |
| 3394 | MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID") |
| 3395 | .map_io = msm8960_map_io, |
| 3396 | .reserve = msm8960_reserve, |
| 3397 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 3398 | .handle_irq = gic_handle_irq, |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 3399 | .timer = &msm_timer, |
| 3400 | .init_machine = msm8960_cdp_init, |
| 3401 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 3402 | .init_very_early = msm8960_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3403 | .restart = msm_restart, |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 3404 | .smp = &msm8960_smp_ops, |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 3405 | MACHINE_END |