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

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

Version: ~ [ linux-5.1-rc5 ] ~ [ linux-5.0.7 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.34 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.111 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.168 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.178 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.138 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.65 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp