Jeremy Kerr | 0508ad1 | 2017-02-01 10:53:41 -0600 | [diff] [blame] | 1 | /* FSI device & driver interfaces |
| 2 | * |
| 3 | * Copyright (C) IBM Corporation 2016 |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | */ |
| 14 | |
| 15 | #ifndef LINUX_FSI_H |
| 16 | #define LINUX_FSI_H |
| 17 | |
| 18 | #include <linux/device.h> |
| 19 | |
Jeremy Kerr | fda07a6 | 2017-02-01 10:53:42 -0600 | [diff] [blame] | 20 | struct fsi_device { |
Jeremy Kerr | dd37eed | 2017-02-01 10:53:43 -0600 | [diff] [blame] | 21 | struct device dev; |
| 22 | u8 engine_type; |
| 23 | u8 version; |
Jeremy Kerr | fda07a6 | 2017-02-01 10:53:42 -0600 | [diff] [blame] | 24 | }; |
| 25 | |
Jeremy Kerr | dd37eed | 2017-02-01 10:53:43 -0600 | [diff] [blame] | 26 | struct fsi_device_id { |
| 27 | u8 engine_type; |
| 28 | u8 version; |
| 29 | }; |
| 30 | |
| 31 | #define FSI_VERSION_ANY 0 |
| 32 | |
| 33 | #define FSI_DEVICE(t) \ |
| 34 | .engine_type = (t), .version = FSI_VERSION_ANY, |
| 35 | |
| 36 | #define FSI_DEVICE_VERSIONED(t, v) \ |
| 37 | .engine_type = (t), .version = (v), |
| 38 | |
| 39 | |
Jeremy Kerr | fda07a6 | 2017-02-01 10:53:42 -0600 | [diff] [blame] | 40 | struct fsi_driver { |
Jeremy Kerr | dd37eed | 2017-02-01 10:53:43 -0600 | [diff] [blame] | 41 | struct device_driver drv; |
| 42 | const struct fsi_device_id *id_table; |
Jeremy Kerr | fda07a6 | 2017-02-01 10:53:42 -0600 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | #define to_fsi_dev(devp) container_of(devp, struct fsi_device, dev) |
| 46 | #define to_fsi_drv(drvp) container_of(drvp, struct fsi_driver, drv) |
| 47 | |
Jeremy Kerr | 0508ad1 | 2017-02-01 10:53:41 -0600 | [diff] [blame] | 48 | extern struct bus_type fsi_bus_type; |
| 49 | |
| 50 | #endif /* LINUX_FSI_H */ |