blob: 7764b0079d2827326e1ccd3b6e2720b2957e24ab [file] [log] [blame]
Jeremy Kerr09aecfa2017-06-06 16:08:36 -05001/*
2 * FSI master definitions. These comprise the core <--> master interface,
3 * to allow the core to interact with the (hardware-specific) masters.
4 *
5 * Copyright (C) IBM Corporation 2016
6 *
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.
10 *
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.
15 */
16
17#ifndef DRIVERS_FSI_MASTER_H
18#define DRIVERS_FSI_MASTER_H
19
20#include <linux/device.h>
21
22struct fsi_master {
23 struct device dev;
24 int idx;
25 int n_links;
26 int flags;
27 int (*read)(struct fsi_master *, int link, uint8_t id,
28 uint32_t addr, void *val, size_t size);
29 int (*write)(struct fsi_master *, int link, uint8_t id,
30 uint32_t addr, const void *val, size_t size);
31 int (*term)(struct fsi_master *, int link, uint8_t id);
32 int (*send_break)(struct fsi_master *, int link);
33 int (*link_enable)(struct fsi_master *, int link);
34};
35
36#define dev_to_fsi_master(d) container_of(d, struct fsi_master, dev)
37
38extern int fsi_master_register(struct fsi_master *master);
39extern void fsi_master_unregister(struct fsi_master *master);
40
41#endif /* DRIVERS_FSI_MASTER_H */