Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of wl12xx |
| 3 | * |
| 4 | * Copyright (C) 2009 Nokia Corporation |
| 5 | * |
Kalle Valo | 4c5f7d7 | 2010-08-22 22:46:28 +0300 | [diff] [blame] | 6 | * Contact: Luciano Coelho <luciano.coelho@nokia.com> |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License |
| 10 | * version 2 as published by the Free Software Foundation. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 20 | * 02110-1301 USA |
| 21 | * |
| 22 | */ |
| 23 | |
Ohad Ben-Cohen | c1f9a09 | 2010-09-16 13:16:02 +0200 | [diff] [blame] | 24 | #ifndef _LINUX_WL12XX_H |
| 25 | #define _LINUX_WL12XX_H |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 26 | |
Luciano Coelho | 6cc9efe | 2013-01-25 12:05:34 +0200 | [diff] [blame] | 27 | #include <linux/err.h> |
| 28 | |
Luciano Coelho | 62c7d08 | 2011-03-10 16:42:47 +0200 | [diff] [blame] | 29 | /* Reference clock values */ |
Gery Kahn | c8aea56 | 2010-10-05 16:09:05 +0200 | [diff] [blame] | 30 | enum { |
Ido Yariv | d29633b | 2011-03-31 10:06:57 +0200 | [diff] [blame] | 31 | WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */ |
| 32 | WL12XX_REFCLOCK_26 = 1, /* 26 MHz */ |
| 33 | WL12XX_REFCLOCK_38 = 2, /* 38.4 MHz */ |
| 34 | WL12XX_REFCLOCK_52 = 3, /* 52 MHz */ |
| 35 | WL12XX_REFCLOCK_38_XTAL = 4, /* 38.4 MHz, XTAL */ |
| 36 | WL12XX_REFCLOCK_26_XTAL = 5, /* 26 MHz, XTAL */ |
Gery Kahn | c8aea56 | 2010-10-05 16:09:05 +0200 | [diff] [blame] | 37 | }; |
| 38 | |
Luciano Coelho | 62c7d08 | 2011-03-10 16:42:47 +0200 | [diff] [blame] | 39 | /* TCXO clock values */ |
| 40 | enum { |
| 41 | WL12XX_TCXOCLOCK_19_2 = 0, /* 19.2MHz */ |
| 42 | WL12XX_TCXOCLOCK_26 = 1, /* 26 MHz */ |
| 43 | WL12XX_TCXOCLOCK_38_4 = 2, /* 38.4MHz */ |
| 44 | WL12XX_TCXOCLOCK_52 = 3, /* 52 MHz */ |
| 45 | WL12XX_TCXOCLOCK_16_368 = 4, /* 16.368 MHz */ |
| 46 | WL12XX_TCXOCLOCK_32_736 = 5, /* 32.736 MHz */ |
| 47 | WL12XX_TCXOCLOCK_16_8 = 6, /* 16.8 MHz */ |
| 48 | WL12XX_TCXOCLOCK_33_6 = 7, /* 33.6 MHz */ |
| 49 | }; |
| 50 | |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 51 | struct wl12xx_platform_data { |
| 52 | void (*set_power)(bool enable); |
Grazvydas Ignotas | a02a295 | 2010-04-16 13:22:12 +0300 | [diff] [blame] | 53 | /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ |
| 54 | int irq; |
David-John Willis | c95cf3d0 | 2009-11-17 18:50:09 +0200 | [diff] [blame] | 55 | bool use_eeprom; |
Ohad Ben-Cohen | 15cea99 | 2010-09-16 01:31:51 +0200 | [diff] [blame] | 56 | int board_ref_clock; |
Luciano Coelho | 62c7d08 | 2011-03-10 16:42:47 +0200 | [diff] [blame] | 57 | int board_tcxo_clock; |
Ido Yariv | 341b7cd | 2011-03-31 10:07:01 +0200 | [diff] [blame] | 58 | unsigned long platform_quirks; |
Felipe Balbi | a390e85 | 2011-10-06 10:07:44 +0300 | [diff] [blame] | 59 | bool pwr_in_suspend; |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 60 | }; |
| 61 | |
Ido Yariv | 341b7cd | 2011-03-31 10:07:01 +0200 | [diff] [blame] | 62 | /* Platform does not support level trigger interrupts */ |
| 63 | #define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0) |
| 64 | |
Luciano Coelho | 6cc9efe | 2013-01-25 12:05:34 +0200 | [diff] [blame] | 65 | #ifdef CONFIG_WILINK_PLATFORM_DATA |
Ohad Ben-Cohen | 6583611 | 2010-09-28 20:20:28 +0200 | [diff] [blame] | 66 | |
Ohad Ben-Cohen | 61ee700 | 2010-09-16 01:31:12 +0200 | [diff] [blame] | 67 | int wl12xx_set_platform_data(const struct wl12xx_platform_data *data); |
Ohad Ben-Cohen | 6583611 | 2010-09-28 20:20:28 +0200 | [diff] [blame] | 68 | |
Luciano Coelho | 6cc9efe | 2013-01-25 12:05:34 +0200 | [diff] [blame] | 69 | struct wl12xx_platform_data *wl12xx_get_platform_data(void); |
| 70 | |
Ohad Ben-Cohen | 6583611 | 2010-09-28 20:20:28 +0200 | [diff] [blame] | 71 | #else |
| 72 | |
| 73 | static inline |
| 74 | int wl12xx_set_platform_data(const struct wl12xx_platform_data *data) |
| 75 | { |
| 76 | return -ENOSYS; |
| 77 | } |
| 78 | |
Luciano Coelho | 6cc9efe | 2013-01-25 12:05:34 +0200 | [diff] [blame] | 79 | static inline |
| 80 | struct wl12xx_platform_data *wl12xx_get_platform_data(void) |
| 81 | { |
| 82 | return ERR_PTR(-ENODATA); |
| 83 | } |
Ohad Ben-Cohen | 6583611 | 2010-09-28 20:20:28 +0200 | [diff] [blame] | 84 | |
Luciano Coelho | 6cc9efe | 2013-01-25 12:05:34 +0200 | [diff] [blame] | 85 | #endif |
Ohad Ben-Cohen | 61ee700 | 2010-09-16 01:31:12 +0200 | [diff] [blame] | 86 | |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 87 | #endif |