bus.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Common bus abstraction layer.
  4. *
  5. * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
  6. * Copyright (c) 2010, ST-Ericsson
  7. */
  8. #ifndef WFX_BUS_H
  9. #define WFX_BUS_H
  10. #include <linux/mmc/sdio_func.h>
  11. #include <linux/spi/spi.h>
  12. #define WFX_REG_CONFIG 0x0
  13. #define WFX_REG_CONTROL 0x1
  14. #define WFX_REG_IN_OUT_QUEUE 0x2
  15. #define WFX_REG_AHB_DPORT 0x3
  16. #define WFX_REG_BASE_ADDR 0x4
  17. #define WFX_REG_SRAM_DPORT 0x5
  18. #define WFX_REG_SET_GEN_R_W 0x6
  19. #define WFX_REG_FRAME_OUT 0x7
  20. struct wfx_hwbus_ops {
  21. int (*copy_from_io)(void *bus_priv, unsigned int addr, void *dst, size_t count);
  22. int (*copy_to_io)(void *bus_priv, unsigned int addr, const void *src, size_t count);
  23. int (*irq_subscribe)(void *bus_priv);
  24. int (*irq_unsubscribe)(void *bus_priv);
  25. void (*lock)(void *bus_priv);
  26. void (*unlock)(void *bus_priv);
  27. size_t (*align_size)(void *bus_priv, size_t size);
  28. };
  29. extern struct sdio_driver wfx_sdio_driver;
  30. extern struct spi_driver wfx_spi_driver;
  31. #endif