Rohit Vaswani | 927199e | 2013-01-09 13:41:48 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -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 | * |
| 12 | */ |
| 13 | |
| 14 | #include <linux/init.h> |
| 15 | #include <linux/ioport.h> |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 16 | #include <linux/gpio.h> |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 17 | #include <linux/platform_device.h> |
| 18 | #include <linux/bootmem.h> |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 19 | #include <linux/mfd/pm8xxx/pm8921.h> |
| 20 | #include <linux/leds.h> |
| 21 | #include <linux/leds-pm8xxx.h> |
Jay Chokshi | f3a9ea8 | 2012-01-12 16:34:43 -0800 | [diff] [blame] | 22 | #include <linux/mfd/pm8xxx/pm8xxx-adc.h> |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 23 | #include <asm/mach-types.h> |
| 24 | #include <asm/mach/mmc.h> |
| 25 | #include <mach/msm_bus_board.h> |
| 26 | #include <mach/board.h> |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 27 | #include <mach/gpiomux.h> |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 28 | #include <mach/restart.h> |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 29 | #include <mach/socinfo.h> |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 30 | #include "devices.h" |
| 31 | #include "board-8064.h" |
| 32 | |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 33 | struct pm8xxx_gpio_init { |
| 34 | unsigned gpio; |
| 35 | struct pm_gpio config; |
| 36 | }; |
| 37 | |
| 38 | struct pm8xxx_mpp_init { |
| 39 | unsigned mpp; |
| 40 | struct pm8xxx_mpp_config_data config; |
| 41 | }; |
| 42 | |
| 43 | #define PM8921_GPIO_INIT(_gpio, _dir, _buf, _val, _pull, _vin, _out_strength, \ |
| 44 | _func, _inv, _disable) \ |
| 45 | { \ |
| 46 | .gpio = PM8921_GPIO_PM_TO_SYS(_gpio), \ |
| 47 | .config = { \ |
| 48 | .direction = _dir, \ |
| 49 | .output_buffer = _buf, \ |
| 50 | .output_value = _val, \ |
| 51 | .pull = _pull, \ |
| 52 | .vin_sel = _vin, \ |
| 53 | .out_strength = _out_strength, \ |
| 54 | .function = _func, \ |
| 55 | .inv_int_pol = _inv, \ |
| 56 | .disable_pin = _disable, \ |
| 57 | } \ |
| 58 | } |
| 59 | |
| 60 | #define PM8921_MPP_INIT(_mpp, _type, _level, _control) \ |
| 61 | { \ |
| 62 | .mpp = PM8921_MPP_PM_TO_SYS(_mpp), \ |
| 63 | .config = { \ |
| 64 | .type = PM8XXX_MPP_TYPE_##_type, \ |
| 65 | .level = _level, \ |
| 66 | .control = PM8XXX_MPP_##_control, \ |
| 67 | } \ |
| 68 | } |
| 69 | |
| 70 | #define PM8821_MPP_INIT(_mpp, _type, _level, _control) \ |
| 71 | { \ |
| 72 | .mpp = PM8821_MPP_PM_TO_SYS(_mpp), \ |
| 73 | .config = { \ |
| 74 | .type = PM8XXX_MPP_TYPE_##_type, \ |
| 75 | .level = _level, \ |
| 76 | .control = PM8XXX_MPP_##_control, \ |
| 77 | } \ |
| 78 | } |
| 79 | |
| 80 | #define PM8921_GPIO_DISABLE(_gpio) \ |
| 81 | PM8921_GPIO_INIT(_gpio, PM_GPIO_DIR_IN, 0, 0, 0, PM_GPIO_VIN_S4, \ |
| 82 | 0, 0, 0, 1) |
| 83 | |
| 84 | #define PM8921_GPIO_OUTPUT(_gpio, _val, _strength) \ |
| 85 | PM8921_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \ |
| 86 | PM_GPIO_PULL_NO, PM_GPIO_VIN_S4, \ |
| 87 | PM_GPIO_STRENGTH_##_strength, \ |
| 88 | PM_GPIO_FUNC_NORMAL, 0, 0) |
| 89 | |
Jay Chokshi | 1de4f9d | 2012-02-07 16:11:31 -0800 | [diff] [blame] | 90 | #define PM8921_GPIO_OUTPUT_BUFCONF(_gpio, _val, _strength, _bufconf) \ |
| 91 | PM8921_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT,\ |
| 92 | PM_GPIO_OUT_BUF_##_bufconf, _val, \ |
| 93 | PM_GPIO_PULL_NO, PM_GPIO_VIN_S4, \ |
| 94 | PM_GPIO_STRENGTH_##_strength, \ |
| 95 | PM_GPIO_FUNC_NORMAL, 0, 0) |
| 96 | |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 97 | #define PM8921_GPIO_INPUT(_gpio, _pull) \ |
| 98 | PM8921_GPIO_INIT(_gpio, PM_GPIO_DIR_IN, PM_GPIO_OUT_BUF_CMOS, 0, \ |
| 99 | _pull, PM_GPIO_VIN_S4, \ |
| 100 | PM_GPIO_STRENGTH_NO, \ |
| 101 | PM_GPIO_FUNC_NORMAL, 0, 0) |
| 102 | |
| 103 | #define PM8921_GPIO_OUTPUT_FUNC(_gpio, _val, _func) \ |
| 104 | PM8921_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \ |
| 105 | PM_GPIO_PULL_NO, PM_GPIO_VIN_S4, \ |
| 106 | PM_GPIO_STRENGTH_HIGH, \ |
| 107 | _func, 0, 0) |
| 108 | |
| 109 | #define PM8921_GPIO_OUTPUT_VIN(_gpio, _val, _vin) \ |
| 110 | PM8921_GPIO_INIT(_gpio, PM_GPIO_DIR_OUT, PM_GPIO_OUT_BUF_CMOS, _val, \ |
| 111 | PM_GPIO_PULL_NO, _vin, \ |
| 112 | PM_GPIO_STRENGTH_HIGH, \ |
| 113 | PM_GPIO_FUNC_NORMAL, 0, 0) |
| 114 | |
| 115 | /* Initial PM8921 GPIO configurations */ |
| 116 | static struct pm8xxx_gpio_init pm8921_gpios[] __initdata = { |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 117 | PM8921_GPIO_OUTPUT(14, 1, HIGH), /* HDMI Mux Selector */ |
Jay Chokshi | 1de4f9d | 2012-02-07 16:11:31 -0800 | [diff] [blame] | 118 | PM8921_GPIO_OUTPUT_BUFCONF(25, 0, LOW, CMOS), /* DISP_RESET_N */ |
| 119 | PM8921_GPIO_OUTPUT_FUNC(26, 0, PM_GPIO_FUNC_2), /* Bl: Off, PWM mode */ |
David Keitel | 2f613d9 | 2012-02-15 11:29:16 -0800 | [diff] [blame] | 120 | PM8921_GPIO_OUTPUT_VIN(30, 1, PM_GPIO_VIN_VPH), /* SMB349 susp line */ |
Jay Chokshi | 1de4f9d | 2012-02-07 16:11:31 -0800 | [diff] [blame] | 121 | PM8921_GPIO_OUTPUT_BUFCONF(36, 1, LOW, OPEN_DRAIN), |
Amy Maloche | 70090f99 | 2012-02-16 16:35:26 -0800 | [diff] [blame] | 122 | PM8921_GPIO_OUTPUT_FUNC(44, 0, PM_GPIO_FUNC_2), |
| 123 | PM8921_GPIO_OUTPUT(33, 0, HIGH), |
| 124 | PM8921_GPIO_OUTPUT(20, 0, HIGH), |
Anirudh Ghayal | 7147801 | 2012-03-08 17:54:23 -0800 | [diff] [blame] | 125 | PM8921_GPIO_INPUT(35, PM_GPIO_PULL_UP_30), |
| 126 | PM8921_GPIO_INPUT(38, PM_GPIO_PULL_UP_30), |
Shiv Maliyappanahalli | 7e0beff | 2012-02-06 15:56:39 -0800 | [diff] [blame] | 127 | /* TABLA CODEC RESET */ |
Santosh Mardi | 0f81fcc | 2012-09-10 14:39:57 +0530 | [diff] [blame] | 128 | PM8921_GPIO_OUTPUT(34, 1, HIGH), |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 129 | PM8921_GPIO_OUTPUT(13, 0, HIGH), /* PCIE_CLK_PWR_EN */ |
Niranjana Vishwanathapura | 459a27d | 2012-07-20 12:23:55 -0600 | [diff] [blame] | 130 | PM8921_GPIO_INPUT(12, PM_GPIO_PULL_UP_30), /* PCIE_WAKE_N */ |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 131 | }; |
| 132 | |
Rohit Vaswani | 927199e | 2013-01-09 13:41:48 -0800 | [diff] [blame] | 133 | static struct pm8xxx_gpio_init pm8921_fsm8064_ep_gpios[] __initdata = { |
| 134 | PM8921_GPIO_OUTPUT_VIN(1, 1, PM_GPIO_VIN_VPH), /* 5V reg */ |
| 135 | PM8921_GPIO_OUTPUT_VIN(12, 1, PM_GPIO_VIN_VPH), /* 12V reg */ |
| 136 | /* De-assert CW_GPS_RST_N for CW GPS module to lock to GPS source */ |
| 137 | PM8921_GPIO_OUTPUT_VIN(14, 1, PM_GPIO_VIN_VPH), |
| 138 | /* PPS_SRC_SEL_N, chooses between WGR7640 PPS source (high) or |
| 139 | * CW GPS module PPS source (low) */ |
Rohit Vaswani | d12ce57 | 2013-03-05 15:05:51 -0800 | [diff] [blame] | 140 | PM8921_GPIO_OUTPUT_VIN(19, 0, PM_GPIO_VIN_VPH), /* PPS_SRC_SEL_N */ |
Rohit Vaswani | 927199e | 2013-01-09 13:41:48 -0800 | [diff] [blame] | 141 | |
| 142 | PM8921_GPIO_OUTPUT_VIN(13, 1, PM_GPIO_VIN_VPH), /* PCIE_CLK_PWR_EN */ |
| 143 | PM8921_GPIO_OUTPUT_VIN(37, 1, PM_GPIO_VIN_VPH), /* PCIE_RST_N */ |
| 144 | PM8921_GPIO_INPUT(11, PM_GPIO_PULL_UP_30), /* PCIE_WAKE_N */ |
| 145 | |
| 146 | PM8921_GPIO_OUTPUT_VIN(23, 1, PM_GPIO_VIN_VPH), /* USB2_HSIC_RST_N */ |
| 147 | |
| 148 | PM8921_GPIO_OUTPUT_VIN(24, 1, PM_GPIO_VIN_VPH), /* USB3_RST_N */ |
| 149 | PM8921_GPIO_OUTPUT_VIN(34, 1, PM_GPIO_VIN_VPH), /* USB4_RST_N */ |
| 150 | }; |
| 151 | |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 152 | static struct pm8xxx_gpio_init pm8921_mtp_kp_gpios[] __initdata = { |
Anirudh Ghayal | 7147801 | 2012-03-08 17:54:23 -0800 | [diff] [blame] | 153 | PM8921_GPIO_INPUT(3, PM_GPIO_PULL_UP_30), |
| 154 | PM8921_GPIO_INPUT(4, PM_GPIO_PULL_UP_30), |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 155 | }; |
| 156 | |
| 157 | static struct pm8xxx_gpio_init pm8921_cdp_kp_gpios[] __initdata = { |
Anirudh Ghayal | 7147801 | 2012-03-08 17:54:23 -0800 | [diff] [blame] | 158 | PM8921_GPIO_INPUT(27, PM_GPIO_PULL_UP_30), |
| 159 | PM8921_GPIO_INPUT(42, PM_GPIO_PULL_UP_30), |
Oluwafemi Adeyemi | 48fc326 | 2012-03-19 13:26:52 -0700 | [diff] [blame] | 160 | PM8921_GPIO_INPUT(17, PM_GPIO_PULL_UP_1P5), /* SD_WP */ |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 161 | }; |
| 162 | |
Saket Saurabh | 54bd17a | 2012-09-11 17:00:46 +0530 | [diff] [blame] | 163 | static struct pm8xxx_gpio_init pm8921_mpq8064_hrd_gpios[] __initdata = { |
| 164 | PM8921_GPIO_OUTPUT(37, 0, LOW), /* MUX1_SEL */ |
Mohan Pallaka | b8aa828 | 2012-10-04 14:26:21 +0530 | [diff] [blame] | 165 | PM8921_GPIO_INPUT(40, PM_GPIO_PULL_UP_30), /* irq for sx150 exp2 */ |
Saket Saurabh | 54bd17a | 2012-09-11 17:00:46 +0530 | [diff] [blame] | 166 | }; |
| 167 | |
David Collins | 03c1637 | 2012-10-04 15:57:28 -0700 | [diff] [blame] | 168 | static struct pm8xxx_gpio_init touchscreen_gpios[] __initdata = { |
| 169 | PM8921_GPIO_OUTPUT(23, 0, HIGH), /* touchscreen power FET */ |
| 170 | }; |
| 171 | |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 172 | /* Initial PM8917 GPIO configurations */ |
| 173 | static struct pm8xxx_gpio_init pm8917_gpios[] __initdata = { |
| 174 | PM8921_GPIO_OUTPUT(14, 1, HIGH), /* HDMI Mux Selector */ |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 175 | PM8921_GPIO_OUTPUT_BUFCONF(25, 0, LOW, CMOS), /* DISP_RESET_N */ |
David Collins | d992d31 | 2012-08-22 13:59:23 -0700 | [diff] [blame] | 176 | PM8921_GPIO_OUTPUT(26, 1, HIGH), /* Backlight: on */ |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 177 | PM8921_GPIO_OUTPUT_BUFCONF(36, 1, LOW, OPEN_DRAIN), |
| 178 | PM8921_GPIO_OUTPUT_FUNC(38, 0, PM_GPIO_FUNC_2), |
| 179 | PM8921_GPIO_OUTPUT(33, 0, HIGH), |
| 180 | PM8921_GPIO_OUTPUT(20, 0, HIGH), |
| 181 | PM8921_GPIO_INPUT(35, PM_GPIO_PULL_UP_30), |
| 182 | PM8921_GPIO_INPUT(30, PM_GPIO_PULL_UP_30), |
| 183 | /* TABLA CODEC RESET */ |
| 184 | PM8921_GPIO_OUTPUT(34, 1, MED), |
| 185 | PM8921_GPIO_OUTPUT(13, 0, HIGH), /* PCIE_CLK_PWR_EN */ |
| 186 | PM8921_GPIO_INPUT(12, PM_GPIO_PULL_UP_30), /* PCIE_WAKE_N */ |
| 187 | }; |
| 188 | |
| 189 | /* PM8921 GPIO 42 remaps to PM8917 GPIO 8 */ |
| 190 | static struct pm8xxx_gpio_init pm8917_cdp_kp_gpios[] __initdata = { |
| 191 | PM8921_GPIO_INPUT(27, PM_GPIO_PULL_UP_30), |
| 192 | PM8921_GPIO_INPUT(8, PM_GPIO_PULL_UP_30), |
| 193 | PM8921_GPIO_INPUT(17, PM_GPIO_PULL_UP_1P5), /* SD_WP */ |
| 194 | }; |
| 195 | |
Vijayavardhan Vennapusa | 4fa1369 | 2012-08-02 14:35:03 +0530 | [diff] [blame] | 196 | static struct pm8xxx_gpio_init pm8921_mpq_gpios[] __initdata = { |
| 197 | PM8921_GPIO_INIT(27, PM_GPIO_DIR_IN, PM_GPIO_OUT_BUF_CMOS, 0, |
| 198 | PM_GPIO_PULL_NO, PM_GPIO_VIN_VPH, PM_GPIO_STRENGTH_NO, |
| 199 | PM_GPIO_FUNC_NORMAL, 0, 0), |
| 200 | }; |
| 201 | |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 202 | /* Initial PM8XXX MPP configurations */ |
| 203 | static struct pm8xxx_mpp_init pm8xxx_mpps[] __initdata = { |
Jay Chokshi | 1de4f9d | 2012-02-07 16:11:31 -0800 | [diff] [blame] | 204 | PM8921_MPP_INIT(3, D_OUTPUT, PM8921_MPP_DIG_LEVEL_VPH, DOUT_CTRL_LOW), |
David Collins | 55095e4 | 2013-01-03 13:42:28 -0800 | [diff] [blame] | 205 | /* External 5V regulator enable; shared by HDMI and USB_OTG switches. */ |
| 206 | PM8921_MPP_INIT(7, D_OUTPUT, PM8921_MPP_DIG_LEVEL_VPH, DOUT_CTRL_LOW), |
Jay Chokshi | 1de4f9d | 2012-02-07 16:11:31 -0800 | [diff] [blame] | 207 | PM8921_MPP_INIT(8, D_OUTPUT, PM8921_MPP_DIG_LEVEL_S4, DOUT_CTRL_LOW), |
Hemant Kumar | 5692535 | 2012-02-13 16:59:52 -0800 | [diff] [blame] | 208 | /*MPP9 is used to detect docking station connection/removal on Liquid*/ |
| 209 | PM8921_MPP_INIT(9, D_INPUT, PM8921_MPP_DIG_LEVEL_S4, DIN_TO_INT), |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 210 | /* PCIE_RESET_N */ |
| 211 | PM8921_MPP_INIT(1, D_OUTPUT, PM8921_MPP_DIG_LEVEL_VPH, DOUT_CTRL_HIGH), |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 212 | }; |
| 213 | |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 214 | |
| 215 | void __init apq8064_configure_gpios(struct pm8xxx_gpio_init *data, int len) |
| 216 | { |
| 217 | int i, rc; |
| 218 | |
| 219 | for (i = 0; i < len; i++) { |
| 220 | rc = pm8xxx_gpio_config(data[i].gpio, &data[i].config); |
| 221 | if (rc) |
| 222 | pr_err("%s: pm8xxx_gpio_config(%u) failed: rc=%d\n", |
| 223 | __func__, data[i].gpio, rc); |
| 224 | } |
| 225 | } |
| 226 | |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 227 | void __init apq8064_pm8xxx_gpio_mpp_init(void) |
| 228 | { |
| 229 | int i, rc; |
| 230 | |
Rohit Vaswani | 927199e | 2013-01-09 13:41:48 -0800 | [diff] [blame] | 231 | if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917) { |
Yan He | dbc96ce | 2013-01-29 12:39:33 -0800 | [diff] [blame] | 232 | /* PCIE_CLK_PWR_EN is 23 and PCIE_WAKE_N is 22 |
| 233 | for MPQ8064 Hybrid */ |
| 234 | if (machine_is_mpq8064_hrd()) { |
| 235 | int size = ARRAY_SIZE(pm8921_gpios); |
| 236 | for (i = 0; i < size; i++) |
| 237 | if (pm8921_gpios[i].gpio == 13) |
| 238 | pm8921_gpios[i].gpio = 23; |
| 239 | else if (pm8921_gpios[i].gpio == 12) |
| 240 | pm8921_gpios[i].gpio = 22; |
| 241 | } |
| 242 | |
Rohit Vaswani | 927199e | 2013-01-09 13:41:48 -0800 | [diff] [blame] | 243 | if (machine_is_fsm8064_ep()) |
| 244 | apq8064_configure_gpios(pm8921_fsm8064_ep_gpios, |
| 245 | ARRAY_SIZE(pm8921_fsm8064_ep_gpios)); |
| 246 | else |
| 247 | apq8064_configure_gpios(pm8921_gpios, |
| 248 | ARRAY_SIZE(pm8921_gpios)); |
| 249 | } else { |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 250 | apq8064_configure_gpios(pm8917_gpios, ARRAY_SIZE(pm8917_gpios)); |
Rohit Vaswani | 927199e | 2013-01-09 13:41:48 -0800 | [diff] [blame] | 251 | } |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 252 | |
| 253 | if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid()) { |
David Collins | 03c1637 | 2012-10-04 15:57:28 -0700 | [diff] [blame] | 254 | apq8064_configure_gpios(touchscreen_gpios, |
| 255 | ARRAY_SIZE(touchscreen_gpios)); |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 256 | if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917) |
| 257 | apq8064_configure_gpios(pm8921_cdp_kp_gpios, |
| 258 | ARRAY_SIZE(pm8921_cdp_kp_gpios)); |
| 259 | else |
| 260 | apq8064_configure_gpios(pm8917_cdp_kp_gpios, |
| 261 | ARRAY_SIZE(pm8917_cdp_kp_gpios)); |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 262 | } |
| 263 | |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 264 | if (machine_is_apq8064_mtp()) |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 265 | apq8064_configure_gpios(pm8921_mtp_kp_gpios, |
| 266 | ARRAY_SIZE(pm8921_mtp_kp_gpios)); |
Mohan Pallaka | 474b94b | 2012-01-25 12:59:58 +0530 | [diff] [blame] | 267 | |
Vijayavardhan Vennapusa | 4fa1369 | 2012-08-02 14:35:03 +0530 | [diff] [blame] | 268 | if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() |
David Collins | d49a1c5 | 2012-08-22 13:18:06 -0700 | [diff] [blame] | 269 | || machine_is_mpq8064_dtv()) |
| 270 | apq8064_configure_gpios(pm8921_mpq_gpios, |
| 271 | ARRAY_SIZE(pm8921_mpq_gpios)); |
Vijayavardhan Vennapusa | 4fa1369 | 2012-08-02 14:35:03 +0530 | [diff] [blame] | 272 | |
Saket Saurabh | 54bd17a | 2012-09-11 17:00:46 +0530 | [diff] [blame] | 273 | if (machine_is_mpq8064_hrd()) |
| 274 | apq8064_configure_gpios(pm8921_mpq8064_hrd_gpios, |
| 275 | ARRAY_SIZE(pm8921_mpq8064_hrd_gpios)); |
| 276 | |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 277 | for (i = 0; i < ARRAY_SIZE(pm8xxx_mpps); i++) { |
| 278 | rc = pm8xxx_mpp_config(pm8xxx_mpps[i].mpp, |
| 279 | &pm8xxx_mpps[i].config); |
| 280 | if (rc) { |
| 281 | pr_err("%s: pm8xxx_mpp_config: rc=%d\n", __func__, rc); |
| 282 | break; |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | static struct pm8xxx_pwrkey_platform_data apq8064_pm8921_pwrkey_pdata = { |
| 288 | .pull_up = 1, |
| 289 | .kpd_trigger_delay_us = 15625, |
| 290 | .wakeup = 1, |
| 291 | }; |
| 292 | |
| 293 | static struct pm8xxx_misc_platform_data apq8064_pm8921_misc_pdata = { |
| 294 | .priority = 0, |
| 295 | }; |
| 296 | |
| 297 | #define PM8921_LC_LED_MAX_CURRENT 4 /* I = 4mA */ |
| 298 | #define PM8921_LC_LED_LOW_CURRENT 1 /* I = 1mA */ |
| 299 | #define PM8XXX_LED_PWM_PERIOD 1000 |
| 300 | #define PM8XXX_LED_PWM_DUTY_MS 20 |
| 301 | /** |
| 302 | * PM8XXX_PWM_CHANNEL_NONE shall be used when LED shall not be |
| 303 | * driven using PWM feature. |
| 304 | */ |
| 305 | #define PM8XXX_PWM_CHANNEL_NONE -1 |
| 306 | |
| 307 | static struct led_info pm8921_led_info[] = { |
| 308 | [0] = { |
| 309 | .name = "led:red", |
| 310 | .default_trigger = "ac-online", |
| 311 | }, |
| 312 | }; |
| 313 | |
| 314 | static struct led_platform_data pm8921_led_core_pdata = { |
| 315 | .num_leds = ARRAY_SIZE(pm8921_led_info), |
| 316 | .leds = pm8921_led_info, |
| 317 | }; |
| 318 | |
| 319 | static int pm8921_led0_pwm_duty_pcts[56] = { |
| 320 | 1, 4, 8, 12, 16, 20, 24, 28, 32, 36, |
| 321 | 40, 44, 46, 52, 56, 60, 64, 68, 72, 76, |
| 322 | 80, 84, 88, 92, 96, 100, 100, 100, 98, 95, |
| 323 | 92, 88, 84, 82, 78, 74, 70, 66, 62, 58, |
| 324 | 58, 54, 50, 48, 42, 38, 34, 30, 26, 22, |
| 325 | 14, 10, 6, 4, 1 |
| 326 | }; |
| 327 | |
Jay Chokshi | be51723 | 2012-06-15 18:20:56 -0700 | [diff] [blame] | 328 | /* |
| 329 | * Note: There is a bug in LPG module that results in incorrect |
| 330 | * behavior of pattern when LUT index 0 is used. So effectively |
| 331 | * there are 63 usable LUT entries. |
| 332 | */ |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 333 | static struct pm8xxx_pwm_duty_cycles pm8921_led0_pwm_duty_cycles = { |
| 334 | .duty_pcts = (int *)&pm8921_led0_pwm_duty_pcts, |
| 335 | .num_duty_pcts = ARRAY_SIZE(pm8921_led0_pwm_duty_pcts), |
| 336 | .duty_ms = PM8XXX_LED_PWM_DUTY_MS, |
Jay Chokshi | be51723 | 2012-06-15 18:20:56 -0700 | [diff] [blame] | 337 | .start_idx = 1, |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 338 | }; |
| 339 | |
| 340 | static struct pm8xxx_led_config pm8921_led_configs[] = { |
| 341 | [0] = { |
| 342 | .id = PM8XXX_ID_LED_0, |
| 343 | .mode = PM8XXX_LED_MODE_PWM2, |
| 344 | .max_current = PM8921_LC_LED_MAX_CURRENT, |
| 345 | .pwm_channel = 5, |
| 346 | .pwm_period_us = PM8XXX_LED_PWM_PERIOD, |
| 347 | .pwm_duty_cycles = &pm8921_led0_pwm_duty_cycles, |
| 348 | }, |
| 349 | }; |
| 350 | |
| 351 | static struct pm8xxx_led_platform_data apq8064_pm8921_leds_pdata = { |
| 352 | .led_core = &pm8921_led_core_pdata, |
| 353 | .configs = pm8921_led_configs, |
| 354 | .num_configs = ARRAY_SIZE(pm8921_led_configs), |
| 355 | }; |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 356 | |
Jay Chokshi | f3a9ea8 | 2012-01-12 16:34:43 -0800 | [diff] [blame] | 357 | static struct pm8xxx_adc_amux apq8064_pm8921_adc_channels_data[] = { |
| 358 | {"vcoin", CHANNEL_VCOIN, CHAN_PATH_SCALING2, AMUX_RSV1, |
| 359 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 360 | {"vbat", CHANNEL_VBAT, CHAN_PATH_SCALING2, AMUX_RSV1, |
| 361 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 362 | {"dcin", CHANNEL_DCIN, CHAN_PATH_SCALING4, AMUX_RSV1, |
| 363 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 364 | {"ichg", CHANNEL_ICHG, CHAN_PATH_SCALING1, AMUX_RSV1, |
| 365 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 366 | {"vph_pwr", CHANNEL_VPH_PWR, CHAN_PATH_SCALING2, AMUX_RSV1, |
| 367 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 368 | {"ibat", CHANNEL_IBAT, CHAN_PATH_SCALING1, AMUX_RSV1, |
| 369 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 370 | {"batt_therm", CHANNEL_BATT_THERM, CHAN_PATH_SCALING1, AMUX_RSV2, |
| 371 | ADC_DECIMATION_TYPE2, ADC_SCALE_BATT_THERM}, |
| 372 | {"batt_id", CHANNEL_BATT_ID, CHAN_PATH_SCALING1, AMUX_RSV1, |
| 373 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 374 | {"usbin", CHANNEL_USBIN, CHAN_PATH_SCALING3, AMUX_RSV1, |
| 375 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 376 | {"pmic_therm", CHANNEL_DIE_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1, |
| 377 | ADC_DECIMATION_TYPE2, ADC_SCALE_PMIC_THERM}, |
| 378 | {"625mv", CHANNEL_625MV, CHAN_PATH_SCALING1, AMUX_RSV1, |
| 379 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 380 | {"125v", CHANNEL_125V, CHAN_PATH_SCALING1, AMUX_RSV1, |
| 381 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 382 | {"chg_temp", CHANNEL_CHG_TEMP, CHAN_PATH_SCALING1, AMUX_RSV1, |
| 383 | ADC_DECIMATION_TYPE2, ADC_SCALE_DEFAULT}, |
| 384 | {"xo_therm", CHANNEL_MUXOFF, CHAN_PATH_SCALING1, AMUX_RSV0, |
| 385 | ADC_DECIMATION_TYPE2, ADC_SCALE_XOTHERM}, |
| 386 | }; |
| 387 | |
| 388 | static struct pm8xxx_adc_properties apq8064_pm8921_adc_data = { |
| 389 | .adc_vdd_reference = 1800, /* milli-voltage for this adc */ |
| 390 | .bitresolution = 15, |
| 391 | .bipolar = 0, |
| 392 | }; |
| 393 | |
| 394 | static struct pm8xxx_adc_platform_data apq8064_pm8921_adc_pdata = { |
| 395 | .adc_channel = apq8064_pm8921_adc_channels_data, |
| 396 | .adc_num_board_channel = ARRAY_SIZE(apq8064_pm8921_adc_channels_data), |
| 397 | .adc_prop = &apq8064_pm8921_adc_data, |
| 398 | .adc_mpp_base = PM8921_MPP_PM_TO_SYS(1), |
| 399 | }; |
| 400 | |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 401 | static struct pm8xxx_mpp_platform_data |
| 402 | apq8064_pm8921_mpp_pdata __devinitdata = { |
| 403 | .mpp_base = PM8921_MPP_PM_TO_SYS(1), |
| 404 | }; |
| 405 | |
| 406 | static struct pm8xxx_gpio_platform_data |
| 407 | apq8064_pm8921_gpio_pdata __devinitdata = { |
| 408 | .gpio_base = PM8921_GPIO_PM_TO_SYS(1), |
| 409 | }; |
| 410 | |
| 411 | static struct pm8xxx_irq_platform_data |
| 412 | apq8064_pm8921_irq_pdata __devinitdata = { |
| 413 | .irq_base = PM8921_IRQ_BASE, |
Jeffrey Chuang | a92c7ab | 2012-03-01 23:56:00 -0800 | [diff] [blame] | 414 | .devirq = MSM_GPIO_TO_INT(74), |
| 415 | .irq_trigger_flag = IRQF_TRIGGER_LOW, |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 416 | .dev_id = 0, |
| 417 | }; |
| 418 | |
Ashay Jaiswal | 0b023dc | 2012-01-25 10:18:36 +0530 | [diff] [blame] | 419 | static struct pm8xxx_rtc_platform_data |
| 420 | apq8064_pm8921_rtc_pdata = { |
| 421 | .rtc_write_enable = false, |
| 422 | .rtc_alarm_powerup = false, |
| 423 | }; |
| 424 | |
Jay Chokshi | 42fe9f0 | 2012-02-01 20:52:08 -0800 | [diff] [blame] | 425 | static int apq8064_pm8921_therm_mitigation[] = { |
| 426 | 1100, |
| 427 | 700, |
| 428 | 600, |
| 429 | 325, |
| 430 | }; |
| 431 | |
| 432 | #define MAX_VOLTAGE_MV 4200 |
Abhijeet Dharmapurikar | d6d66c7 | 2012-08-06 14:02:51 -0700 | [diff] [blame] | 433 | #define CHG_TERM_MA 100 |
Jay Chokshi | 42fe9f0 | 2012-02-01 20:52:08 -0800 | [diff] [blame] | 434 | static struct pm8921_charger_platform_data |
| 435 | apq8064_pm8921_chg_pdata __devinitdata = { |
Jay Chokshi | 42fe9f0 | 2012-02-01 20:52:08 -0800 | [diff] [blame] | 436 | .update_time = 60000, |
| 437 | .max_voltage = MAX_VOLTAGE_MV, |
| 438 | .min_voltage = 3200, |
David Keitel | 0789fc6 | 2012-06-07 17:43:27 -0700 | [diff] [blame] | 439 | .uvd_thresh_voltage = 4050, |
David Keitel | 8b079fb | 2012-06-28 19:14:30 -0700 | [diff] [blame] | 440 | .alarm_low_mv = 3400, |
| 441 | .alarm_high_mv = 4000, |
Xiaozhe Shi | 14e8fa1 | 2012-10-11 15:49:58 -0700 | [diff] [blame] | 442 | .resume_voltage_delta = 60, |
| 443 | .resume_charge_percent = 99, |
Abhijeet Dharmapurikar | d6d66c7 | 2012-08-06 14:02:51 -0700 | [diff] [blame] | 444 | .term_current = CHG_TERM_MA, |
Jay Chokshi | 42fe9f0 | 2012-02-01 20:52:08 -0800 | [diff] [blame] | 445 | .cool_temp = 10, |
Abhijeet Dharmapurikar | 807d60f | 2012-11-05 13:37:13 -0800 | [diff] [blame] | 446 | .warm_temp = 45, |
Jay Chokshi | 42fe9f0 | 2012-02-01 20:52:08 -0800 | [diff] [blame] | 447 | .temp_check_period = 1, |
| 448 | .max_bat_chg_current = 1100, |
| 449 | .cool_bat_chg_current = 350, |
| 450 | .warm_bat_chg_current = 350, |
| 451 | .cool_bat_voltage = 4100, |
| 452 | .warm_bat_voltage = 4100, |
| 453 | .thermal_mitigation = apq8064_pm8921_therm_mitigation, |
| 454 | .thermal_levels = ARRAY_SIZE(apq8064_pm8921_therm_mitigation), |
Abhijeet Dharmapurikar | 499a36f | 2012-07-30 12:48:17 -0700 | [diff] [blame] | 455 | .rconn_mohm = 18, |
Jay Chokshi | 42fe9f0 | 2012-02-01 20:52:08 -0800 | [diff] [blame] | 456 | }; |
| 457 | |
| 458 | static struct pm8xxx_ccadc_platform_data |
| 459 | apq8064_pm8xxx_ccadc_pdata = { |
Xiaozhe Shi | d69c91e | 2012-11-06 10:00:38 -0800 | [diff] [blame] | 460 | .r_sense_uohm = 10000, |
David Keitel | 3c37882 | 2012-06-07 13:43:22 -0700 | [diff] [blame] | 461 | .calib_delay_ms = 600000, |
Jay Chokshi | 42fe9f0 | 2012-02-01 20:52:08 -0800 | [diff] [blame] | 462 | }; |
| 463 | |
| 464 | static struct pm8921_bms_platform_data |
| 465 | apq8064_pm8921_bms_pdata __devinitdata = { |
Abhijeet Dharmapurikar | d6d66c7 | 2012-08-06 14:02:51 -0700 | [diff] [blame] | 466 | .battery_type = BATT_UNKNOWN, |
Xiaozhe Shi | d69c91e | 2012-11-06 10:00:38 -0800 | [diff] [blame] | 467 | .r_sense_uohm = 10000, |
Abhijeet Dharmapurikar | d6d66c7 | 2012-08-06 14:02:51 -0700 | [diff] [blame] | 468 | .v_cutoff = 3400, |
| 469 | .max_voltage_uv = MAX_VOLTAGE_MV * 1000, |
| 470 | .rconn_mohm = 18, |
| 471 | .shutdown_soc_valid_limit = 20, |
| 472 | .adjust_soc_low_threshold = 25, |
| 473 | .chg_term_ua = CHG_TERM_MA * 1000, |
Abhijeet Dharmapurikar | 683472d | 2012-10-30 16:21:58 -0700 | [diff] [blame] | 474 | .normal_voltage_calc_ms = 20000, |
| 475 | .low_voltage_calc_ms = 1000, |
Anirudh Ghayal | 6fe4ffa | 2013-02-01 11:44:33 +0530 | [diff] [blame] | 476 | .alarm_low_mv = 3400, |
| 477 | .alarm_high_mv = 4000, |
Abhijeet Dharmapurikar | 4870761 | 2013-03-26 13:14:03 -0700 | [diff] [blame] | 478 | .high_ocv_correction_limit_uv = 50, |
| 479 | .low_ocv_correction_limit_uv = 100, |
| 480 | .hold_soc_est = 3, |
Anirudh Ghayal | 0f9116d | 2013-05-07 16:40:12 +0530 | [diff] [blame] | 481 | .enable_fcc_learning = 1, |
| 482 | .min_fcc_learning_soc = 20, |
| 483 | .min_fcc_ocv_pc = 30, |
Anirudh Ghayal | a221d91 | 2013-06-13 19:03:58 +0530 | [diff] [blame] | 484 | .min_fcc_learning_samples = 5, |
Jay Chokshi | 42fe9f0 | 2012-02-01 20:52:08 -0800 | [diff] [blame] | 485 | }; |
| 486 | |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 487 | static struct pm8921_platform_data |
| 488 | apq8064_pm8921_platform_data __devinitdata = { |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 489 | .irq_pdata = &apq8064_pm8921_irq_pdata, |
| 490 | .gpio_pdata = &apq8064_pm8921_gpio_pdata, |
| 491 | .mpp_pdata = &apq8064_pm8921_mpp_pdata, |
Ashay Jaiswal | 0b023dc | 2012-01-25 10:18:36 +0530 | [diff] [blame] | 492 | .rtc_pdata = &apq8064_pm8921_rtc_pdata, |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 493 | .pwrkey_pdata = &apq8064_pm8921_pwrkey_pdata, |
| 494 | .misc_pdata = &apq8064_pm8921_misc_pdata, |
| 495 | .leds_pdata = &apq8064_pm8921_leds_pdata, |
Jay Chokshi | f3a9ea8 | 2012-01-12 16:34:43 -0800 | [diff] [blame] | 496 | .adc_pdata = &apq8064_pm8921_adc_pdata, |
Jay Chokshi | 42fe9f0 | 2012-02-01 20:52:08 -0800 | [diff] [blame] | 497 | .charger_pdata = &apq8064_pm8921_chg_pdata, |
| 498 | .bms_pdata = &apq8064_pm8921_bms_pdata, |
| 499 | .ccadc_pdata = &apq8064_pm8xxx_ccadc_pdata, |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 500 | }; |
| 501 | |
| 502 | static struct pm8xxx_irq_platform_data |
| 503 | apq8064_pm8821_irq_pdata __devinitdata = { |
| 504 | .irq_base = PM8821_IRQ_BASE, |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 505 | .devirq = PM8821_SEC_IRQ_N, |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 506 | .irq_trigger_flag = IRQF_TRIGGER_HIGH, |
| 507 | .dev_id = 1, |
| 508 | }; |
| 509 | |
| 510 | static struct pm8xxx_mpp_platform_data |
| 511 | apq8064_pm8821_mpp_pdata __devinitdata = { |
| 512 | .mpp_base = PM8821_MPP_PM_TO_SYS(1), |
| 513 | }; |
| 514 | |
| 515 | static struct pm8821_platform_data |
| 516 | apq8064_pm8821_platform_data __devinitdata = { |
| 517 | .irq_pdata = &apq8064_pm8821_irq_pdata, |
| 518 | .mpp_pdata = &apq8064_pm8821_mpp_pdata, |
| 519 | }; |
| 520 | |
| 521 | static struct msm_ssbi_platform_data apq8064_ssbi_pm8921_pdata __devinitdata = { |
| 522 | .controller_type = MSM_SBI_CTRL_PMIC_ARBITER, |
| 523 | .slave = { |
| 524 | .name = "pm8921-core", |
| 525 | .platform_data = &apq8064_pm8921_platform_data, |
| 526 | }, |
| 527 | }; |
| 528 | |
| 529 | static struct msm_ssbi_platform_data apq8064_ssbi_pm8821_pdata __devinitdata = { |
| 530 | .controller_type = MSM_SBI_CTRL_PMIC_ARBITER, |
| 531 | .slave = { |
| 532 | .name = "pm8821-core", |
| 533 | .platform_data = &apq8064_pm8821_platform_data, |
| 534 | }, |
| 535 | }; |
| 536 | |
| 537 | void __init apq8064_init_pmic(void) |
| 538 | { |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 539 | pmic_reset_irq = PM8921_IRQ_BASE + PM8921_RESOUT_IRQ; |
| 540 | |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 541 | apq8064_device_ssbi_pmic1.dev.platform_data = |
| 542 | &apq8064_ssbi_pm8921_pdata; |
| 543 | apq8064_device_ssbi_pmic2.dev.platform_data = |
| 544 | &apq8064_ssbi_pm8821_pdata; |
David Collins | 793793b | 2012-08-21 15:43:02 -0700 | [diff] [blame] | 545 | if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917) { |
| 546 | apq8064_pm8921_platform_data.regulator_pdatas |
| 547 | = msm8064_pm8921_regulator_pdata; |
| 548 | apq8064_pm8921_platform_data.num_regulators |
| 549 | = msm8064_pm8921_regulator_pdata_len; |
| 550 | } else { |
| 551 | apq8064_pm8921_platform_data.regulator_pdatas |
| 552 | = msm8064_pm8917_regulator_pdata; |
| 553 | apq8064_pm8921_platform_data.num_regulators |
| 554 | = msm8064_pm8917_regulator_pdata_len; |
| 555 | } |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 556 | |
Jin Hong | c5f5d54 | 2012-04-12 16:48:51 -0700 | [diff] [blame] | 557 | if (machine_is_apq8064_mtp()) { |
David Keitel | 35e1187 | 2012-02-17 17:40:42 -0800 | [diff] [blame] | 558 | apq8064_pm8921_bms_pdata.battery_type = BATT_PALLADIUM; |
| 559 | } else if (machine_is_apq8064_liquid()) { |
| 560 | apq8064_pm8921_bms_pdata.battery_type = BATT_DESAY; |
David Keitel | b7bf2c9 | 2012-08-24 17:54:00 -0700 | [diff] [blame] | 561 | } else if (machine_is_apq8064_cdp()) { |
| 562 | apq8064_pm8921_chg_pdata.has_dc_supply = true; |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 563 | } |
Abhijeet Dharmapurikar | bbaef59 | 2012-10-10 10:07:51 -0700 | [diff] [blame] | 564 | |
| 565 | if (!machine_is_apq8064_mtp() && !machine_is_apq8064_liquid()) |
| 566 | apq8064_pm8921_chg_pdata.battery_less_hardware = 1; |
Anirudh Ghayal | 80c729b | 2013-02-22 11:17:19 +0530 | [diff] [blame] | 567 | |
| 568 | if (machine_is_mpq8064_hrd()) |
| 569 | apq8064_pm8921_chg_pdata.disable_chg_rmvl_wrkarnd = 1; |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 570 | } |