gpio-i8255.h 964 B

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright 2022 William Breathitt Gray */
  3. #ifndef _I8255_H_
  4. #define _I8255_H_
  5. struct device;
  6. struct irq_domain;
  7. struct regmap;
  8. #define i8255_volatile_regmap_range(_base) regmap_reg_range(_base, _base + 0x2)
  9. /**
  10. * struct i8255_regmap_config - Configuration for the register map of an i8255
  11. * @parent: parent device
  12. * @map: regmap for the i8255
  13. * @num_ppi: number of i8255 Programmable Peripheral Interface
  14. * @names: (optional) array of names for gpios
  15. * @domain: (optional) IRQ domain if the controller is interrupt-capable
  16. *
  17. * Note: The regmap is expected to have cache enabled and i8255 control
  18. * registers not marked as volatile.
  19. */
  20. struct i8255_regmap_config {
  21. struct device *parent;
  22. struct regmap *map;
  23. int num_ppi;
  24. const char *const *names;
  25. struct irq_domain *domain;
  26. };
  27. int devm_i8255_regmap_register(struct device *dev,
  28. const struct i8255_regmap_config *config);
  29. #endif /* _I8255_H_ */