blob: 717bd738525867f5bbc37d408985a24be4b0101f [file] [log] [blame]
Sameer Thalappil1878d762013-04-24 14:54:39 -07001/* Copyright (c) 2011-2013, The Linux Foundation. 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 _WCNSS_WLAN_H_
15#define _WCNSS_WLAN_H_
16
17#include <linux/device.h>
18
Sameer Thalappil409ed352011-12-07 10:53:31 -080019enum wcnss_opcode {
20 WCNSS_WLAN_SWITCH_OFF = 0,
21 WCNSS_WLAN_SWITCH_ON,
22};
23
Sameer Thalappil8d686d42012-08-24 10:07:31 -070024enum wcnss_hw_type {
25 WCNSS_RIVA_HW = 0,
26 WCNSS_PRONTO_HW,
27};
28
Sameer Thalappil409ed352011-12-07 10:53:31 -080029struct wcnss_wlan_config {
30 int use_48mhz_xo;
31};
32
Sameer Thalappil1d69b8022013-06-10 19:10:07 -070033enum {
34 WCNSS_XO_48MHZ = 1,
35 WCNSS_XO_19MHZ,
36 WCNSS_XO_INVALID,
37};
38
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070039#define WCNSS_WLAN_IRQ_INVALID -1
Sameer Thalappiled3f7da2012-11-01 12:54:01 -070040#define HAVE_WCNSS_SUSPEND_RESUME_NOTIFY 1
41#define HAVE_WCNSS_RESET_INTR 1
Sameer Thalappil1878d762013-04-24 14:54:39 -070042#define HAVE_WCNSS_CAL_DOWNLOAD 1
Sameer Thalappild0952f62013-05-03 10:18:29 -070043#define HAVE_WCNSS_RX_BUFF_COUNT 1
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070044
45struct device *wcnss_wlan_get_device(void);
46struct resource *wcnss_wlan_get_memory_map(struct device *dev);
47int wcnss_wlan_get_dxe_tx_irq(struct device *dev);
48int wcnss_wlan_get_dxe_rx_irq(struct device *dev);
49void wcnss_wlan_register_pm_ops(struct device *dev,
50 const struct dev_pm_ops *pm_ops);
Sameer Thalappilecdd1002011-09-09 10:52:27 -070051void wcnss_wlan_unregister_pm_ops(struct device *dev,
52 const struct dev_pm_ops *pm_ops);
Sameer Thalappila112bbc2012-05-23 12:20:32 -070053void wcnss_register_thermal_mitigation(struct device *dev,
54 void (*tm_notify)(struct device *dev, int));
55void wcnss_unregister_thermal_mitigation(
56 void (*tm_notify)(struct device *dev, int));
Sameer Thalappil409ed352011-12-07 10:53:31 -080057struct platform_device *wcnss_get_platform_device(void);
58struct wcnss_wlan_config *wcnss_get_wlan_config(void);
59int wcnss_wlan_power(struct device *dev,
60 struct wcnss_wlan_config *cfg,
Sameer Thalappil1d69b8022013-06-10 19:10:07 -070061 enum wcnss_opcode opcode,
62 int *iris_xo_mode_set);
Sameer Thalappil8d686d42012-08-24 10:07:31 -070063int wcnss_req_power_on_lock(char *driver_name);
64int wcnss_free_power_on_lock(char *driver_name);
Jeff Johnson8b1f6d02012-02-03 20:43:26 -080065unsigned int wcnss_get_serial_number(void);
Sameer Thalappil13f45182012-07-23 18:02:45 -070066void wcnss_flush_delayed_boot_votes(void);
Sameer Thalappilf138da52012-07-30 12:56:37 -070067void wcnss_allow_suspend(void);
68void wcnss_prevent_suspend(void);
Sameer Thalappil8d686d42012-08-24 10:07:31 -070069int wcnss_hardware_type(void);
Sameer Thalappil24db5282012-09-10 11:58:33 -070070void *wcnss_prealloc_get(unsigned int size);
71int wcnss_prealloc_put(void *ptr);
Sameer Thalappil19e02352012-09-24 15:26:12 -070072void wcnss_reset_intr(void);
Sameer Thalappiled3f7da2012-11-01 12:54:01 -070073void wcnss_suspend_notify(void);
74void wcnss_resume_notify(void);
Sameer Thalappil1b3e6112012-12-14 15:16:07 -080075void wcnss_riva_log_debug_regs(void);
76void wcnss_pronto_log_debug_regs(void);
Sameer Thalappil1878d762013-04-24 14:54:39 -070077int wcnss_device_ready(void);
Naresh Jayaram08cee442013-04-26 19:50:00 +053078void wcnss_riva_dump_pmic_regs(void);
Sameer Thalappil58cec312013-05-13 15:52:08 -070079int wcnss_xo_auto_detect_enabled(void);
Sameer Thalappild0952f62013-05-03 10:18:29 -070080u32 wcnss_get_wlan_rx_buff_count(void);
Sameer Thalappil1d69b8022013-06-10 19:10:07 -070081int wcnss_wlan_iris_xo_mode(void);
Sameer Thalappil24db5282012-09-10 11:58:33 -070082
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070083#define wcnss_wlan_get_drvdata(dev) dev_get_drvdata(dev)
84#define wcnss_wlan_set_drvdata(dev, data) dev_set_drvdata((dev), (data))
Sameer Thalappil8d686d42012-08-24 10:07:31 -070085/* WLAN driver uses these names */
86#define req_riva_power_on_lock(name) wcnss_req_power_on_lock(name)
87#define free_riva_power_on_lock(name) wcnss_free_power_on_lock(name)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070088
89#endif /* _WCNSS_WLAN_H_ */