rb4xx-cpld.h 813 B

12345678910111213141516171819202122232425
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * CPLD driver for the MikroTik RouterBoard 4xx series
  4. *
  5. * Copyright (C) 2008-2011 Gabor Juhos <[email protected]>
  6. * Copyright (C) 2008 Imre Kaloz <[email protected]>
  7. * Copyright (C) 2015 Bert Vermeulen <[email protected]>
  8. * Copyright (C) 2020 Christopher Hill <[email protected]>
  9. *
  10. * This file was based on the driver for Linux 2.6.22 published by
  11. * MikroTik for their RouterBoard 4xx series devices.
  12. */
  13. #include <linux/spi/spi.h>
  14. struct rb4xx_cpld {
  15. struct spi_device *spi;
  16. int (*write_nand)(struct rb4xx_cpld *self, const void *tx_buf,
  17. unsigned int len);
  18. int (*read_nand)(struct rb4xx_cpld *self, void *rx_buf,
  19. unsigned int len);
  20. int (*gpio_set_0_7)(struct rb4xx_cpld *self, u8 values);
  21. int (*gpio_set_8)(struct rb4xx_cpld *self, u8 value);
  22. };