~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/fsi.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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 
 12 struct 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 
 22 extern int fsi_device_read(struct fsi_device *dev, uint32_t addr,
 23                 void *val, size_t size);
 24 extern int fsi_device_write(struct fsi_device *dev, uint32_t addr,
 25                 const void *val, size_t size);
 26 extern int fsi_device_peek(struct fsi_device *dev, void *val);
 27 
 28 struct fsi_device_id {
 29         u8      engine_type;
 30         u8      version;
 31 };
 32 
 33 #define FSI_VERSION_ANY         0
 34 
 35 #define FSI_DEVICE(t) \
 36         .engine_type = (t), .version = FSI_VERSION_ANY,
 37 
 38 #define FSI_DEVICE_VERSIONED(t, v) \
 39         .engine_type = (t), .version = (v),
 40 
 41 struct fsi_driver {
 42         struct device_driver            drv;
 43         const struct fsi_device_id      *id_table;
 44 };
 45 
 46 #define to_fsi_dev(devp) container_of(devp, struct fsi_device, dev)
 47 #define to_fsi_drv(drvp) container_of_const(drvp, struct fsi_driver, drv)
 48 
 49 extern int fsi_driver_register(struct fsi_driver *fsi_drv);
 50 extern void fsi_driver_unregister(struct fsi_driver *fsi_drv);
 51 
 52 /* module_fsi_driver() - Helper macro for drivers that don't do
 53  * anything special in module init/exit.  This eliminates a lot of
 54  * boilerplate.  Each module may only use this macro once, and
 55  * calling it replaces module_init() and module_exit()
 56  */
 57 #define module_fsi_driver(__fsi_driver) \
 58                 module_driver(__fsi_driver, fsi_driver_register, \
 59                                 fsi_driver_unregister)
 60 
 61 /* direct slave API */
 62 extern int fsi_slave_claim_range(struct fsi_slave *slave,
 63                 uint32_t addr, uint32_t size);
 64 extern void fsi_slave_release_range(struct fsi_slave *slave,
 65                 uint32_t addr, uint32_t size);
 66 extern int fsi_slave_read(struct fsi_slave *slave, uint32_t addr,
 67                 void *val, size_t size);
 68 extern int fsi_slave_write(struct fsi_slave *slave, uint32_t addr,
 69                 const void *val, size_t size);
 70 
 71 extern struct bus_type fsi_bus_type;
 72 extern const struct device_type fsi_cdev_type;
 73 
 74 enum fsi_dev_type {
 75         fsi_dev_cfam,
 76         fsi_dev_sbefifo,
 77         fsi_dev_scom,
 78         fsi_dev_occ
 79 };
 80 
 81 extern int fsi_get_new_minor(struct fsi_device *fdev, enum fsi_dev_type type,
 82                              dev_t *out_dev, int *out_index);
 83 extern void fsi_free_minor(dev_t dev);
 84 
 85 #endif /* LINUX_FSI_H */
 86 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php