wl12xx.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * This file is part of wl12xx
  3. *
  4. * Copyright (C) 2009 Nokia Corporation
  5. *
  6. * Contact: Luciano Coelho <luciano.coelho@nokia.com>
  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. #ifndef _LINUX_WL12XX_H
  24. #define _LINUX_WL12XX_H
  25. /* Reference clock values */
  26. enum {
  27. WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */
  28. WL12XX_REFCLOCK_26 = 1, /* 26 MHz */
  29. WL12XX_REFCLOCK_38 = 2, /* 38.4 MHz */
  30. WL12XX_REFCLOCK_52 = 3, /* 52 MHz */
  31. WL12XX_REFCLOCK_38_XTAL = 4, /* 38.4 MHz, XTAL */
  32. WL12XX_REFCLOCK_26_XTAL = 5, /* 26 MHz, XTAL */
  33. };
  34. /* TCXO clock values */
  35. enum {
  36. WL12XX_TCXOCLOCK_19_2 = 0, /* 19.2MHz */
  37. WL12XX_TCXOCLOCK_26 = 1, /* 26 MHz */
  38. WL12XX_TCXOCLOCK_38_4 = 2, /* 38.4MHz */
  39. WL12XX_TCXOCLOCK_52 = 3, /* 52 MHz */
  40. WL12XX_TCXOCLOCK_16_368 = 4, /* 16.368 MHz */
  41. WL12XX_TCXOCLOCK_32_736 = 5, /* 32.736 MHz */
  42. WL12XX_TCXOCLOCK_16_8 = 6, /* 16.8 MHz */
  43. WL12XX_TCXOCLOCK_33_6 = 7, /* 33.6 MHz */
  44. };
  45. struct wl12xx_platform_data {
  46. void (*set_power)(bool enable);
  47. /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
  48. int irq;
  49. bool use_eeprom;
  50. int board_ref_clock;
  51. int board_tcxo_clock;
  52. unsigned long platform_quirks;
  53. bool pwr_in_suspend;
  54. struct wl1271_if_operations *ops;
  55. };
  56. /* Platform does not support level trigger interrupts */
  57. #define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0)
  58. #ifdef CONFIG_WL12XX_PLATFORM_DATA
  59. int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
  60. #else
  61. static inline
  62. int wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
  63. {
  64. return -ENOSYS;
  65. }
  66. #endif
  67. struct wl12xx_platform_data *wl12xx_get_platform_data(void);
  68. #endif