blob: 10a6fb0c93cf4342aa1e8194c4d149004966ba26 [file] [log] [blame]
Praveen Chidambaram78499012011-11-01 17:15:17 -06001/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
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
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070020#define MSM_MPM_NR_MPM_IRQS 64
21
22struct msm_mpm_device_data {
23 uint16_t *irqs_m2a;
24 unsigned int irqs_m2a_size;
25 uint16_t *bypassed_apps_irqs;
26 unsigned int bypassed_apps_irqs_size;
27 void __iomem *mpm_request_reg_base;
28 void __iomem *mpm_status_reg_base;
29 void __iomem *mpm_apps_ipc_reg;
30 unsigned int mpm_apps_ipc_val;
31 unsigned int mpm_ipc_irq;
32};
33
Praveen Chidambaram78499012011-11-01 17:15:17 -060034extern struct msm_mpm_device_data msm8660_mpm_dev_data;
35extern struct msm_mpm_device_data msm8960_mpm_dev_data;
36extern struct msm_mpm_device_data msm9615_mpm_dev_data;
37extern struct msm_mpm_device_data apq8064_mpm_dev_data;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070038
Praveen Chidambaram78499012011-11-01 17:15:17 -060039void msm_mpm_irq_extn_init(struct msm_mpm_device_data *mpm_data);
40
41#ifdef CONFIG_MSM_MPM
Subhash Jadavanife608a22012-04-13 10:45:53 +053042int msm_mpm_enable_pin(unsigned int pin, unsigned int enable);
43int msm_mpm_set_pin_wake(unsigned int pin, unsigned int on);
44int msm_mpm_set_pin_type(unsigned int pin, unsigned int flow_type);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070045bool msm_mpm_irqs_detectable(bool from_idle);
46bool msm_mpm_gpio_irqs_detectable(bool from_idle);
47void msm_mpm_enter_sleep(bool from_idle);
48void msm_mpm_exit_sleep(bool from_idle);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070049#else
Subhash Jadavani350290f2012-04-12 10:57:56 +053050static inline int msm_mpm_enable_irq(unsigned int irq, unsigned int enable)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070051{ return -ENODEV; }
Subhash Jadavani350290f2012-04-12 10:57:56 +053052static inline int msm_mpm_set_irq_wake(unsigned int irq, unsigned int on)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070053{ return -ENODEV; }
Subhash Jadavani350290f2012-04-12 10:57:56 +053054static inline int msm_mpm_set_irq_type(unsigned int irq, unsigned int flow_type)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070055{ return -ENODEV; }
Subhash Jadavanife608a22012-04-13 10:45:53 +053056static inline int msm_mpm_enable_pin(unsigned int pin, unsigned int enable)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070057{ return -ENODEV; }
Subhash Jadavanife608a22012-04-13 10:45:53 +053058static inline int msm_mpm_set_pin_wake(unsigned int pin, unsigned int on)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070059{ return -ENODEV; }
Subhash Jadavanife608a22012-04-13 10:45:53 +053060static inline int msm_mpm_set_pin_type(unsigned int pin,
Subhash Jadavani350290f2012-04-12 10:57:56 +053061 unsigned int flow_type)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070062{ return -ENODEV; }
Subhash Jadavani350290f2012-04-12 10:57:56 +053063static inline bool msm_mpm_irqs_detectable(bool from_idle)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070064{ return false; }
Subhash Jadavani350290f2012-04-12 10:57:56 +053065static inline bool msm_mpm_gpio_irqs_detectable(bool from_idle)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070066{ return false; }
Subhash Jadavani350290f2012-04-12 10:57:56 +053067static inline void msm_mpm_enter_sleep(bool from_idle) {}
68static inline void msm_mpm_exit_sleep(bool from_idle) {}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070069#endif
70
71
72
73#endif /* __ARCH_ARM_MACH_MSM_MPM_H */