net-cw1200.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (C) ST-Ericsson SA 2011
  3. *
  4. * Author: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>
  5. * License terms: GNU General Public License (GPL) version 2
  6. */
  7. #ifndef CW1200_PLAT_H_INCLUDED
  8. #define CW1200_PLAT_H_INCLUDED
  9. struct cw1200_platform_data_spi {
  10. u8 spi_bits_per_word; /* REQUIRED */
  11. u16 ref_clk; /* REQUIRED (in KHz) */
  12. /* All others are optional */
  13. bool have_5ghz;
  14. int reset; /* GPIO to RSTn signal (0 disables) */
  15. int powerup; /* GPIO to POWERUP signal (0 disables) */
  16. int (*power_ctrl)(const struct cw1200_platform_data_spi *pdata,
  17. bool enable); /* Control 3v3 / 1v8 supply */
  18. int (*clk_ctrl)(const struct cw1200_platform_data_spi *pdata,
  19. bool enable); /* Control CLK32K */
  20. const u8 *macaddr; /* if NULL, use cw1200_mac_template module parameter */
  21. const char *sdd_file; /* if NULL, will use default for detected hw type */
  22. };
  23. struct cw1200_platform_data_sdio {
  24. u16 ref_clk; /* REQUIRED (in KHz) */
  25. /* All others are optional */
  26. bool have_5ghz;
  27. bool no_nptb; /* SDIO hardware does not support non-power-of-2-blocksizes */
  28. int reset; /* GPIO to RSTn signal (0 disables) */
  29. int powerup; /* GPIO to POWERUP signal (0 disables) */
  30. int irq; /* IRQ line or 0 to use SDIO IRQ */
  31. int (*power_ctrl)(const struct cw1200_platform_data_sdio *pdata,
  32. bool enable); /* Control 3v3 / 1v8 supply */
  33. int (*clk_ctrl)(const struct cw1200_platform_data_sdio *pdata,
  34. bool enable); /* Control CLK32K */
  35. const u8 *macaddr; /* if NULL, use cw1200_mac_template module parameter */
  36. const char *sdd_file; /* if NULL, will use default for detected hw type */
  37. };
  38. /* An example of SPI support in your board setup file:
  39. static struct cw1200_platform_data_spi cw1200_platform_data = {
  40. .ref_clk = 38400,
  41. .spi_bits_per_word = 16,
  42. .reset = GPIO_RF_RESET,
  43. .powerup = GPIO_RF_POWERUP,
  44. .macaddr = wifi_mac_addr,
  45. .sdd_file = "sdd_sagrad_1091_1098.bin",
  46. };
  47. static struct spi_board_info myboard_spi_devices[] __initdata = {
  48. {
  49. .modalias = "cw1200_wlan_spi",
  50. .max_speed_hz = 52000000,
  51. .bus_num = 0,
  52. .irq = WIFI_IRQ,
  53. .platform_data = &cw1200_platform_data,
  54. .chip_select = 0,
  55. },
  56. };
  57. */
  58. /* An example of SDIO support in your board setup file:
  59. static struct cw1200_platform_data_sdio my_cw1200_platform_data = {
  60. .ref_clk = 38400,
  61. .have_5ghz = false,
  62. .sdd_file = "sdd_myplatform.bin",
  63. };
  64. cw1200_sdio_set_platform_data(&my_cw1200_platform_data);
  65. */
  66. void __init cw1200_sdio_set_platform_data(struct cw1200_platform_data_sdio *pdata);
  67. #endif /* CW1200_PLAT_H_INCLUDED */