gpio-idio-16.h (7ae9fb1b7ecbb5d85d07857943f677fd1a559b18) gpio-idio-16.h (db02247827ef2adc1617839b4bdcc5e1cef3e1ed)
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright 2022 William Breathitt Gray */
3#ifndef _IDIO_16_H_
4#define _IDIO_16_H_
5
6#include <linux/spinlock.h>
7#include <linux/types.h>
8
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright 2022 William Breathitt Gray */
3#ifndef _IDIO_16_H_
4#define _IDIO_16_H_
5
6#include <linux/spinlock.h>
7#include <linux/types.h>
8
9struct device;
10struct regmap;
11struct regmap_irq;
12
9/**
13/**
14 * struct idio_16_regmap_config - Configuration for the IDIO-16 register map
15 * @parent: parent device
16 * @map: regmap for the IDIO-16 device
17 * @regmap_irqs: descriptors for individual IRQs
18 * @num_regmap_irqs: number of IRQ descriptors
19 * @irq: IRQ number for the IDIO-16 device
20 * @no_status: device has no status register
21 * @filters: device has input filters
22 */
23struct idio_16_regmap_config {
24 struct device *parent;
25 struct regmap *map;
26 const struct regmap_irq *regmap_irqs;
27 int num_regmap_irqs;
28 unsigned int irq;
29 bool no_status;
30 bool filters;
31};
32
33/**
10 * struct idio_16 - IDIO-16 registers structure
11 * @out0_7: Read: FET Drive Outputs 0-7
12 * Write: FET Drive Outputs 0-7
13 * @in0_7: Read: Isolated Inputs 0-7
14 * Write: Clear Interrupt
15 * @irq_ctl: Read: Enable IRQ
16 * Write: Disable IRQ
17 * @filter_ctl: Read: Activate Input Filters 0-15

--- 45 unchanged lines hidden (view full) ---

63 const unsigned long *mask, unsigned long *bits);
64void idio_16_set(struct idio_16 __iomem *reg, struct idio_16_state *state,
65 unsigned long offset, unsigned long value);
66void idio_16_set_multiple(struct idio_16 __iomem *reg,
67 struct idio_16_state *state,
68 const unsigned long *mask, const unsigned long *bits);
69void idio_16_state_init(struct idio_16_state *state);
70
34 * struct idio_16 - IDIO-16 registers structure
35 * @out0_7: Read: FET Drive Outputs 0-7
36 * Write: FET Drive Outputs 0-7
37 * @in0_7: Read: Isolated Inputs 0-7
38 * Write: Clear Interrupt
39 * @irq_ctl: Read: Enable IRQ
40 * Write: Disable IRQ
41 * @filter_ctl: Read: Activate Input Filters 0-15

--- 45 unchanged lines hidden (view full) ---

87 const unsigned long *mask, unsigned long *bits);
88void idio_16_set(struct idio_16 __iomem *reg, struct idio_16_state *state,
89 unsigned long offset, unsigned long value);
90void idio_16_set_multiple(struct idio_16 __iomem *reg,
91 struct idio_16_state *state,
92 const unsigned long *mask, const unsigned long *bits);
93void idio_16_state_init(struct idio_16_state *state);
94
95int devm_idio_16_regmap_register(struct device *dev, const struct idio_16_regmap_config *config);
96
71#endif /* _IDIO_16_H_ */
97#endif /* _IDIO_16_H_ */