blob: 88e369c8174080a29f99a2eff2276c8654d0c493 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* 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
20enum 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
29struct 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
42extern struct msm_mpm_device_data msm_mpm_dev_data;
43
44int msm_mpm_enable_pin(enum msm_mpm_pin pin, unsigned int enable);
45int msm_mpm_set_pin_wake(enum msm_mpm_pin pin, unsigned int on);
46int msm_mpm_set_pin_type(enum msm_mpm_pin pin, unsigned int flow_type);
47bool msm_mpm_irqs_detectable(bool from_idle);
48bool msm_mpm_gpio_irqs_detectable(bool from_idle);
49void msm_mpm_enter_sleep(bool from_idle);
50void msm_mpm_exit_sleep(bool from_idle);
51void msm_mpm_irq_extn_init(void);
52#else
53
54int msm_mpm_enable_irq(unsigned int irq, unsigned int enable)
55{ return -ENODEV; }
56int msm_mpm_set_irq_wake(unsigned int irq, unsigned int on)
57{ return -ENODEV; }
58int msm_mpm_set_irq_type(unsigned int irq, unsigned int flow_type)
59{ return -ENODEV; }
60int msm_mpm_enable_pin(enum msm_mpm_pin pin, unsigned int enable)
61{ return -ENODEV; }
62int msm_mpm_set_pin_wake(enum msm_mpm_pin pin, unsigned int on)
63{ return -ENODEV; }
64int msm_mpm_set_pin_type(enum msm_mpm_pin pin, unsigned int flow_type)
65{ return -ENODEV; }
66bool msm_mpm_irqs_detectable(bool from_idle)
67{ return false; }
68bool msm_mpm_gpio_irqs_detectable(bool from_idle)
69{ return false; }
70void msm_mpm_enter_sleep(bool from_idle) {}
71void msm_mpm_exit_sleep(bool from_idle) {}
72void msm_mpm_irq_extn_init(void) {}
73#endif
74
75
76
77#endif /* __ARCH_ARM_MACH_MSM_MPM_H */