Merge tag 'rtc-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
[linux-block.git] / include / linux / spi / max7301.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
0c36ec31
JB
2#ifndef LINUX_SPI_MAX7301_H
3#define LINUX_SPI_MAX7301_H
4
e5e26d80 5#include <linux/gpio/driver.h>
e952805d
WS
6
7/*
8 * Some registers must be read back to modify.
9 * To save time we cache them here in memory
10 */
11struct max7301 {
12 struct mutex lock;
13 u8 port_config[8]; /* field 0 is unused */
14 u32 out_level; /* cached output levels */
4a22b8a4 15 u32 input_pullup_active;
e952805d
WS
16 struct gpio_chip chip;
17 struct device *dev;
18 int (*write)(struct device *dev, unsigned int reg, unsigned int val);
19 int (*read)(struct device *dev, unsigned int reg);
20};
21
0c36ec31
JB
22struct max7301_platform_data {
23 /* number assigned to the first GPIO */
24 unsigned base;
4a22b8a4
MKB
25 /*
26 * bitmask controlling the pullup configuration,
27 *
28 * _note_ the 4 lowest bits are unused, because the first 4
29 * ports of the controller are not used, too.
30 */
31 u32 input_pullup_active;
0c36ec31
JB
32};
33
06de2cd7 34extern void __max730x_remove(struct device *dev);
e952805d 35extern int __max730x_probe(struct max7301 *ts);
0c36ec31 36#endif