35 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/* Copyright 2022 William Breathitt Gray */3#ifndef _I8255_H_4#define _I8255_H_5 6struct device;7struct irq_domain;8struct regmap;9 10#define i8255_volatile_regmap_range(_base) regmap_reg_range(_base, _base + 0x2)11 12/**13 * struct i8255_regmap_config - Configuration for the register map of an i825514 * @parent: parent device15 * @map: regmap for the i825516 * @num_ppi: number of i8255 Programmable Peripheral Interface17 * @names: (optional) array of names for gpios18 * @domain: (optional) IRQ domain if the controller is interrupt-capable19 *20 * Note: The regmap is expected to have cache enabled and i8255 control21 * registers not marked as volatile.22 */23struct i8255_regmap_config {24 struct device *parent;25 struct regmap *map;26 int num_ppi;27 const char *const *names;28 struct irq_domain *domain;29};30 31int devm_i8255_regmap_register(struct device *dev,32 const struct i8255_regmap_config *config);33 34#endif /* _I8255_H_ */35