Linux 4.16.11
[linux/fpc-iii.git] / drivers / fsi / fsi-master.h
blob12f7b119567da4d4a5fd988e45165b81cc8acefb
1 /*
2 * FSI master definitions. These comprise the core <--> master interface,
3 * to allow the core to interact with the (hardware-specific) masters.
5 * Copyright (C) IBM Corporation 2016
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 #ifndef DRIVERS_FSI_MASTER_H
18 #define DRIVERS_FSI_MASTER_H
20 #include <linux/device.h>
22 #define FSI_MASTER_FLAG_SWCLOCK 0x1
24 struct fsi_master {
25 struct device dev;
26 int idx;
27 int n_links;
28 int flags;
29 int (*read)(struct fsi_master *, int link, uint8_t id,
30 uint32_t addr, void *val, size_t size);
31 int (*write)(struct fsi_master *, int link, uint8_t id,
32 uint32_t addr, const void *val, size_t size);
33 int (*term)(struct fsi_master *, int link, uint8_t id);
34 int (*send_break)(struct fsi_master *, int link);
35 int (*link_enable)(struct fsi_master *, int link);
38 #define dev_to_fsi_master(d) container_of(d, struct fsi_master, dev)
40 extern int fsi_master_register(struct fsi_master *master);
41 extern void fsi_master_unregister(struct fsi_master *master);
43 #endif /* DRIVERS_FSI_MASTER_H */