Merge tag 'v5.15.57' into rpi-5.15.y
[platform/kernel/linux-rpi.git] / include / linux / mfd / rpisense / core.h
1 /*
2  * Raspberry Pi Sense HAT core driver
3  * http://raspberrypi.org
4  *
5  * Copyright (C) 2015 Raspberry Pi
6  *
7  * Author: Serge Schneider
8  *
9  *  This program is free software; you can redistribute  it and/or modify it
10  *  under  the terms of  the GNU General  Public License as published by the
11  *  Free Software Foundation;  either version 2 of the  License, or (at your
12  *  option) any later version.
13  *
14  */
15
16 #ifndef __LINUX_MFD_RPISENSE_CORE_H_
17 #define __LINUX_MFD_RPISENSE_CORE_H_
18
19 #include <linux/mfd/rpisense/joystick.h>
20 #include <linux/mfd/rpisense/framebuffer.h>
21
22 /*
23  * Register values.
24  */
25 #define RPISENSE_FB                     0x00
26 #define RPISENSE_WAI                    0xF0
27 #define RPISENSE_VER                    0xF1
28 #define RPISENSE_KEYS                   0xF2
29 #define RPISENSE_EE_WP                  0xF3
30
31 #define RPISENSE_ID                     's'
32
33 struct rpisense {
34         struct device *dev;
35         struct i2c_client *i2c_client;
36
37         /* Client devices */
38         struct rpisense_js joystick;
39         struct rpisense_fb framebuffer;
40 };
41
42 struct rpisense *rpisense_get_dev(void);
43 s32 rpisense_reg_read(struct rpisense *rpisense, int reg);
44 int rpisense_reg_write(struct rpisense *rpisense, int reg, u16 val);
45 int rpisense_block_write(struct rpisense *rpisense, const char *buf, int count);
46
47 #endif