Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at d986ba0329dcca102e227995371135c9bbcefb6b 96 lines 2.6 kB view raw
1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* FSI device & driver interfaces 3 * 4 * Copyright (C) IBM Corporation 2016 5 */ 6 7#ifndef LINUX_FSI_H 8#define LINUX_FSI_H 9 10#include <linux/device.h> 11 12struct fsi_device { 13 struct device dev; 14 u8 engine_type; 15 u8 version; 16 u8 unit; 17 struct fsi_slave *slave; 18 uint32_t addr; 19 uint32_t size; 20}; 21 22static inline void *fsi_get_drvdata(struct fsi_device *fsi_dev) 23{ 24 return dev_get_drvdata(&fsi_dev->dev); 25} 26 27static inline void fsi_set_drvdata(struct fsi_device *fsi_dev, void *data) 28{ 29 dev_set_drvdata(&fsi_dev->dev, data); 30} 31 32extern int fsi_device_read(struct fsi_device *dev, uint32_t addr, 33 void *val, size_t size); 34extern int fsi_device_write(struct fsi_device *dev, uint32_t addr, 35 const void *val, size_t size); 36extern int fsi_device_peek(struct fsi_device *dev, void *val); 37 38struct fsi_device_id { 39 u8 engine_type; 40 u8 version; 41}; 42 43#define FSI_VERSION_ANY 0 44 45#define FSI_DEVICE(t) \ 46 .engine_type = (t), .version = FSI_VERSION_ANY, 47 48#define FSI_DEVICE_VERSIONED(t, v) \ 49 .engine_type = (t), .version = (v), 50 51struct fsi_driver { 52 int (*probe)(struct fsi_device *fsidev); 53 void (*remove)(struct fsi_device *fsidev); 54 struct device_driver drv; 55 const struct fsi_device_id *id_table; 56}; 57 58#define to_fsi_dev(devp) container_of(devp, struct fsi_device, dev) 59#define to_fsi_drv(drvp) container_of_const(drvp, struct fsi_driver, drv) 60 61extern int fsi_driver_register(struct fsi_driver *fsi_drv); 62extern void fsi_driver_unregister(struct fsi_driver *fsi_drv); 63 64/* module_fsi_driver() - Helper macro for drivers that don't do 65 * anything special in module init/exit. This eliminates a lot of 66 * boilerplate. Each module may only use this macro once, and 67 * calling it replaces module_init() and module_exit() 68 */ 69#define module_fsi_driver(__fsi_driver) \ 70 module_driver(__fsi_driver, fsi_driver_register, \ 71 fsi_driver_unregister) 72 73/* direct slave API */ 74extern int fsi_slave_claim_range(struct fsi_slave *slave, 75 uint32_t addr, uint32_t size); 76extern void fsi_slave_release_range(struct fsi_slave *slave, 77 uint32_t addr, uint32_t size); 78extern int fsi_slave_read(struct fsi_slave *slave, uint32_t addr, 79 void *val, size_t size); 80extern int fsi_slave_write(struct fsi_slave *slave, uint32_t addr, 81 const void *val, size_t size); 82 83extern const struct device_type fsi_cdev_type; 84 85enum fsi_dev_type { 86 fsi_dev_cfam, 87 fsi_dev_sbefifo, 88 fsi_dev_scom, 89 fsi_dev_occ 90}; 91 92extern int fsi_get_new_minor(struct fsi_device *fdev, enum fsi_dev_type type, 93 dev_t *out_dev, int *out_index); 94extern void fsi_free_minor(dev_t dev); 95 96#endif /* LINUX_FSI_H */