Sameer Thalappil | 1878d76 | 2013-04-24 14:54:39 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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 _WCNSS_WLAN_H_ |
| 15 | #define _WCNSS_WLAN_H_ |
| 16 | |
| 17 | #include <linux/device.h> |
| 18 | |
Sameer Thalappil | 409ed35 | 2011-12-07 10:53:31 -0800 | [diff] [blame] | 19 | enum wcnss_opcode { |
| 20 | WCNSS_WLAN_SWITCH_OFF = 0, |
| 21 | WCNSS_WLAN_SWITCH_ON, |
| 22 | }; |
| 23 | |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 24 | enum wcnss_hw_type { |
| 25 | WCNSS_RIVA_HW = 0, |
| 26 | WCNSS_PRONTO_HW, |
| 27 | }; |
| 28 | |
Sameer Thalappil | 409ed35 | 2011-12-07 10:53:31 -0800 | [diff] [blame] | 29 | struct wcnss_wlan_config { |
| 30 | int use_48mhz_xo; |
| 31 | }; |
| 32 | |
Sameer Thalappil | 1d69b802 | 2013-06-10 19:10:07 -0700 | [diff] [blame] | 33 | enum { |
| 34 | WCNSS_XO_48MHZ = 1, |
| 35 | WCNSS_XO_19MHZ, |
| 36 | WCNSS_XO_INVALID, |
| 37 | }; |
| 38 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 39 | #define WCNSS_WLAN_IRQ_INVALID -1 |
Sameer Thalappil | ed3f7da | 2012-11-01 12:54:01 -0700 | [diff] [blame] | 40 | #define HAVE_WCNSS_SUSPEND_RESUME_NOTIFY 1 |
| 41 | #define HAVE_WCNSS_RESET_INTR 1 |
Sameer Thalappil | 1878d76 | 2013-04-24 14:54:39 -0700 | [diff] [blame] | 42 | #define HAVE_WCNSS_CAL_DOWNLOAD 1 |
Sameer Thalappil | d0952f6 | 2013-05-03 10:18:29 -0700 | [diff] [blame] | 43 | #define HAVE_WCNSS_RX_BUFF_COUNT 1 |
Hardik Kantilal Patel | 0a6ed94 | 2013-12-17 19:33:07 +0530 | [diff] [blame^] | 44 | #define WLAN_MAC_ADDR_SIZE (6) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 45 | |
| 46 | struct device *wcnss_wlan_get_device(void); |
| 47 | struct resource *wcnss_wlan_get_memory_map(struct device *dev); |
| 48 | int wcnss_wlan_get_dxe_tx_irq(struct device *dev); |
| 49 | int wcnss_wlan_get_dxe_rx_irq(struct device *dev); |
| 50 | void wcnss_wlan_register_pm_ops(struct device *dev, |
| 51 | const struct dev_pm_ops *pm_ops); |
Sameer Thalappil | ecdd100 | 2011-09-09 10:52:27 -0700 | [diff] [blame] | 52 | void wcnss_wlan_unregister_pm_ops(struct device *dev, |
| 53 | const struct dev_pm_ops *pm_ops); |
Sameer Thalappil | a112bbc | 2012-05-23 12:20:32 -0700 | [diff] [blame] | 54 | void wcnss_register_thermal_mitigation(struct device *dev, |
| 55 | void (*tm_notify)(struct device *dev, int)); |
| 56 | void wcnss_unregister_thermal_mitigation( |
| 57 | void (*tm_notify)(struct device *dev, int)); |
Sameer Thalappil | 409ed35 | 2011-12-07 10:53:31 -0800 | [diff] [blame] | 58 | struct platform_device *wcnss_get_platform_device(void); |
| 59 | struct wcnss_wlan_config *wcnss_get_wlan_config(void); |
| 60 | int wcnss_wlan_power(struct device *dev, |
| 61 | struct wcnss_wlan_config *cfg, |
Sameer Thalappil | 1d69b802 | 2013-06-10 19:10:07 -0700 | [diff] [blame] | 62 | enum wcnss_opcode opcode, |
| 63 | int *iris_xo_mode_set); |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 64 | int wcnss_req_power_on_lock(char *driver_name); |
| 65 | int wcnss_free_power_on_lock(char *driver_name); |
Jeff Johnson | 8b1f6d0 | 2012-02-03 20:43:26 -0800 | [diff] [blame] | 66 | unsigned int wcnss_get_serial_number(void); |
Sameer Thalappil | 13f4518 | 2012-07-23 18:02:45 -0700 | [diff] [blame] | 67 | void wcnss_flush_delayed_boot_votes(void); |
Hardik Kantilal Patel | 0a6ed94 | 2013-12-17 19:33:07 +0530 | [diff] [blame^] | 68 | int wcnss_get_wlan_mac_address(char mac_addr[WLAN_MAC_ADDR_SIZE]); |
Sameer Thalappil | f138da5 | 2012-07-30 12:56:37 -0700 | [diff] [blame] | 69 | void wcnss_allow_suspend(void); |
| 70 | void wcnss_prevent_suspend(void); |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 71 | int wcnss_hardware_type(void); |
Sameer Thalappil | 24db528 | 2012-09-10 11:58:33 -0700 | [diff] [blame] | 72 | void *wcnss_prealloc_get(unsigned int size); |
| 73 | int wcnss_prealloc_put(void *ptr); |
Sameer Thalappil | 19e0235 | 2012-09-24 15:26:12 -0700 | [diff] [blame] | 74 | void wcnss_reset_intr(void); |
Sameer Thalappil | ed3f7da | 2012-11-01 12:54:01 -0700 | [diff] [blame] | 75 | void wcnss_suspend_notify(void); |
| 76 | void wcnss_resume_notify(void); |
Sameer Thalappil | 1b3e611 | 2012-12-14 15:16:07 -0800 | [diff] [blame] | 77 | void wcnss_riva_log_debug_regs(void); |
| 78 | void wcnss_pronto_log_debug_regs(void); |
Sameer Thalappil | 1878d76 | 2013-04-24 14:54:39 -0700 | [diff] [blame] | 79 | int wcnss_device_ready(void); |
Naresh Jayaram | 08cee44 | 2013-04-26 19:50:00 +0530 | [diff] [blame] | 80 | void wcnss_riva_dump_pmic_regs(void); |
Sameer Thalappil | 58cec31 | 2013-05-13 15:52:08 -0700 | [diff] [blame] | 81 | int wcnss_xo_auto_detect_enabled(void); |
Sameer Thalappil | d0952f6 | 2013-05-03 10:18:29 -0700 | [diff] [blame] | 82 | u32 wcnss_get_wlan_rx_buff_count(void); |
Sameer Thalappil | 1d69b802 | 2013-06-10 19:10:07 -0700 | [diff] [blame] | 83 | int wcnss_wlan_iris_xo_mode(void); |
Sameer Thalappil | 36f7a1a | 2013-10-09 18:32:38 -0700 | [diff] [blame] | 84 | #ifdef CONFIG_WCNSS_REGISTER_DUMP_ON_BITE |
| 85 | void wcnss_log_debug_regs_on_bite(void); |
| 86 | #else |
| 87 | static inline void wcnss_log_debug_regs_on_bite(void) |
| 88 | { |
| 89 | } |
| 90 | #endif |
Leo Chang | f98087f | 2013-11-14 15:08:24 -0800 | [diff] [blame] | 91 | int wcnss_set_wlan_unsafe_channel( |
| 92 | u16 *unsafe_ch_list, u16 ch_count); |
| 93 | int wcnss_get_wlan_unsafe_channel( |
| 94 | u16 *unsafe_ch_list, u16 buffer_size, |
| 95 | u16 *ch_count); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 96 | #define wcnss_wlan_get_drvdata(dev) dev_get_drvdata(dev) |
| 97 | #define wcnss_wlan_set_drvdata(dev, data) dev_set_drvdata((dev), (data)) |
Sameer Thalappil | 8d686d4 | 2012-08-24 10:07:31 -0700 | [diff] [blame] | 98 | /* WLAN driver uses these names */ |
| 99 | #define req_riva_power_on_lock(name) wcnss_req_power_on_lock(name) |
| 100 | #define free_riva_power_on_lock(name) wcnss_free_power_on_lock(name) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 101 | |
| 102 | #endif /* _WCNSS_WLAN_H_ */ |