Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame^] | 1 | /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| 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> |
| 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/bootmem.h> |
| 18 | #include <asm/mach-types.h> |
| 19 | #include <asm/mach/mmc.h> |
| 20 | #include <mach/msm_bus_board.h> |
| 21 | #include <mach/board.h> |
| 22 | #include <mach/gpio.h> |
| 23 | #include <mach/gpiomux.h> |
| 24 | #include "devices.h" |
| 25 | #include "board-8064.h" |
| 26 | |
| 27 | |
| 28 | static struct pm8xxx_mpp_platform_data |
| 29 | apq8064_pm8921_mpp_pdata __devinitdata = { |
| 30 | .mpp_base = PM8921_MPP_PM_TO_SYS(1), |
| 31 | }; |
| 32 | |
| 33 | static struct pm8xxx_gpio_platform_data |
| 34 | apq8064_pm8921_gpio_pdata __devinitdata = { |
| 35 | .gpio_base = PM8921_GPIO_PM_TO_SYS(1), |
| 36 | }; |
| 37 | |
| 38 | static struct pm8xxx_irq_platform_data |
| 39 | apq8064_pm8921_irq_pdata __devinitdata = { |
| 40 | .irq_base = PM8921_IRQ_BASE, |
| 41 | .devirq = PM8921_USR_IRQ_N, |
| 42 | .irq_trigger_flag = IRQF_TRIGGER_HIGH, |
| 43 | .dev_id = 0, |
| 44 | }; |
| 45 | |
| 46 | static struct pm8921_platform_data |
| 47 | apq8064_pm8921_platform_data __devinitdata = { |
| 48 | .regulator_pdatas = msm8064_pm8921_regulator_pdata, |
| 49 | .irq_pdata = &apq8064_pm8921_irq_pdata, |
| 50 | .gpio_pdata = &apq8064_pm8921_gpio_pdata, |
| 51 | .mpp_pdata = &apq8064_pm8921_mpp_pdata, |
| 52 | }; |
| 53 | |
| 54 | static struct pm8xxx_irq_platform_data |
| 55 | apq8064_pm8821_irq_pdata __devinitdata = { |
| 56 | .irq_base = PM8821_IRQ_BASE, |
| 57 | .devirq = PM8821_USR_IRQ_N, |
| 58 | .irq_trigger_flag = IRQF_TRIGGER_HIGH, |
| 59 | .dev_id = 1, |
| 60 | }; |
| 61 | |
| 62 | static struct pm8xxx_mpp_platform_data |
| 63 | apq8064_pm8821_mpp_pdata __devinitdata = { |
| 64 | .mpp_base = PM8821_MPP_PM_TO_SYS(1), |
| 65 | }; |
| 66 | |
| 67 | static struct pm8821_platform_data |
| 68 | apq8064_pm8821_platform_data __devinitdata = { |
| 69 | .irq_pdata = &apq8064_pm8821_irq_pdata, |
| 70 | .mpp_pdata = &apq8064_pm8821_mpp_pdata, |
| 71 | }; |
| 72 | |
| 73 | static struct msm_ssbi_platform_data apq8064_ssbi_pm8921_pdata __devinitdata = { |
| 74 | .controller_type = MSM_SBI_CTRL_PMIC_ARBITER, |
| 75 | .slave = { |
| 76 | .name = "pm8921-core", |
| 77 | .platform_data = &apq8064_pm8921_platform_data, |
| 78 | }, |
| 79 | }; |
| 80 | |
| 81 | static struct msm_ssbi_platform_data apq8064_ssbi_pm8821_pdata __devinitdata = { |
| 82 | .controller_type = MSM_SBI_CTRL_PMIC_ARBITER, |
| 83 | .slave = { |
| 84 | .name = "pm8821-core", |
| 85 | .platform_data = &apq8064_pm8821_platform_data, |
| 86 | }, |
| 87 | }; |
| 88 | |
| 89 | void __init apq8064_init_pmic(void) |
| 90 | { |
| 91 | apq8064_device_ssbi_pmic1.dev.platform_data = |
| 92 | &apq8064_ssbi_pm8921_pdata; |
| 93 | apq8064_device_ssbi_pmic2.dev.platform_data = |
| 94 | &apq8064_ssbi_pm8821_pdata; |
| 95 | apq8064_pm8921_platform_data.num_regulators = |
| 96 | msm8064_pm8921_regulator_pdata_len; |
| 97 | |
| 98 | if (machine_is_apq8064_rumi3()) { |
| 99 | apq8064_pm8921_irq_pdata.devirq = 0; |
| 100 | apq8064_pm8821_irq_pdata.devirq = 0; |
| 101 | } |
| 102 | } |