Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2010-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 | #ifndef __ARCH_ARM_MACH_MSM_MPM_H |
| 15 | #define __ARCH_ARM_MACH_MSM_MPM_H |
| 16 | |
| 17 | #include <linux/types.h> |
| 18 | #include <linux/list.h> |
| 19 | |
| 20 | enum msm_mpm_pin { |
| 21 | MSM_MPM_PIN_SDC3_DAT1 = 21, |
| 22 | MSM_MPM_PIN_SDC3_DAT3 = 22, |
| 23 | MSM_MPM_PIN_SDC4_DAT1 = 23, |
| 24 | MSM_MPM_PIN_SDC4_DAT3 = 24, |
| 25 | }; |
| 26 | |
| 27 | #define MSM_MPM_NR_MPM_IRQS 64 |
| 28 | |
| 29 | struct msm_mpm_device_data { |
| 30 | uint16_t *irqs_m2a; |
| 31 | unsigned int irqs_m2a_size; |
| 32 | uint16_t *bypassed_apps_irqs; |
| 33 | unsigned int bypassed_apps_irqs_size; |
| 34 | void __iomem *mpm_request_reg_base; |
| 35 | void __iomem *mpm_status_reg_base; |
| 36 | void __iomem *mpm_apps_ipc_reg; |
| 37 | unsigned int mpm_apps_ipc_val; |
| 38 | unsigned int mpm_ipc_irq; |
| 39 | }; |
| 40 | |
| 41 | #ifdef CONFIG_MSM_MPM |
| 42 | extern struct msm_mpm_device_data msm_mpm_dev_data; |
| 43 | |
| 44 | int msm_mpm_enable_pin(enum msm_mpm_pin pin, unsigned int enable); |
| 45 | int msm_mpm_set_pin_wake(enum msm_mpm_pin pin, unsigned int on); |
| 46 | int msm_mpm_set_pin_type(enum msm_mpm_pin pin, unsigned int flow_type); |
| 47 | bool msm_mpm_irqs_detectable(bool from_idle); |
| 48 | bool msm_mpm_gpio_irqs_detectable(bool from_idle); |
| 49 | void msm_mpm_enter_sleep(bool from_idle); |
| 50 | void msm_mpm_exit_sleep(bool from_idle); |
| 51 | void msm_mpm_irq_extn_init(void); |
| 52 | #else |
| 53 | |
| 54 | int msm_mpm_enable_irq(unsigned int irq, unsigned int enable) |
| 55 | { return -ENODEV; } |
| 56 | int msm_mpm_set_irq_wake(unsigned int irq, unsigned int on) |
| 57 | { return -ENODEV; } |
| 58 | int msm_mpm_set_irq_type(unsigned int irq, unsigned int flow_type) |
| 59 | { return -ENODEV; } |
| 60 | int msm_mpm_enable_pin(enum msm_mpm_pin pin, unsigned int enable) |
| 61 | { return -ENODEV; } |
| 62 | int msm_mpm_set_pin_wake(enum msm_mpm_pin pin, unsigned int on) |
| 63 | { return -ENODEV; } |
| 64 | int msm_mpm_set_pin_type(enum msm_mpm_pin pin, unsigned int flow_type) |
| 65 | { return -ENODEV; } |
| 66 | bool msm_mpm_irqs_detectable(bool from_idle) |
| 67 | { return false; } |
| 68 | bool msm_mpm_gpio_irqs_detectable(bool from_idle) |
| 69 | { return false; } |
| 70 | void msm_mpm_enter_sleep(bool from_idle) {} |
| 71 | void msm_mpm_exit_sleep(bool from_idle) {} |
| 72 | void msm_mpm_irq_extn_init(void) {} |
| 73 | #endif |
| 74 | |
| 75 | |
| 76 | |
| 77 | #endif /* __ARCH_ARM_MACH_MSM_MPM_H */ |