843-brcmfmac-make-brcmf_of_probe-more-generic.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  2. Date: Sat, 7 Jan 2017 23:43:45 +0100
  3. Subject: [PATCH] brcmfmac: make brcmf_of_probe more generic
  4. MIME-Version: 1.0
  5. Content-Type: text/plain; charset=UTF-8
  6. Content-Transfer-Encoding: 8bit
  7. We may want to use Open Firmware for other devices than just SDIO ones.
  8. In future we may want to support more Broadcom properties so there is
  9. really no reason for such limitation.
  10. Call brcmf_of_probe for all kind of devices & move extra conditions to
  11. the body of that funcion.
  12. Signed-off-by: Rafał Miłecki <[email protected]>
  13. ---
  14. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
  15. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
  16. @@ -299,11 +299,9 @@ struct brcmf_mp_device *brcmf_get_module
  17. }
  18. }
  19. }
  20. - if ((bus_type == BRCMF_BUSTYPE_SDIO) && (!found)) {
  21. - /* No platform data for this device. In case of SDIO try OF
  22. - * (Open Firwmare) Device Tree.
  23. - */
  24. - brcmf_of_probe(dev, &settings->bus.sdio);
  25. + if (!found) {
  26. + /* No platform data for this device, try OF (Open Firwmare) */
  27. + brcmf_of_probe(dev, bus_type, settings);
  28. }
  29. return settings;
  30. }
  31. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
  32. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
  33. @@ -23,14 +23,17 @@
  34. #include "common.h"
  35. #include "of.h"
  36. -void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio)
  37. +void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
  38. + struct brcmf_mp_device *settings)
  39. {
  40. + struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio;
  41. struct device_node *np = dev->of_node;
  42. int irq;
  43. u32 irqf;
  44. u32 val;
  45. - if (!np || !of_device_is_compatible(np, "brcm,bcm4329-fmac"))
  46. + if (!np || bus_type != BRCMF_BUSTYPE_SDIO ||
  47. + !of_device_is_compatible(np, "brcm,bcm4329-fmac"))
  48. return;
  49. if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0)
  50. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h
  51. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h
  52. @@ -14,9 +14,11 @@
  53. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  54. */
  55. #ifdef CONFIG_OF
  56. -void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio);
  57. +void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
  58. + struct brcmf_mp_device *settings);
  59. #else
  60. -static void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio)
  61. +static void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
  62. + struct brcmf_mp_device *settings)
  63. {
  64. }
  65. #endif /* CONFIG_OF */