kxsd9.h (ab04f734b08a404550ba5f8391307bad2145acff) | kxsd9.h (0d1fb2d52d8b4a1124cb2db7d22c4131ad5805cf) |
---|---|
1#include <linux/device.h> 2#include <linux/kernel.h> 3 4#define KXSD9_STATE_RX_SIZE 2 5#define KXSD9_STATE_TX_SIZE 2 6 | 1#include <linux/device.h> 2#include <linux/kernel.h> 3 4#define KXSD9_STATE_RX_SIZE 2 5#define KXSD9_STATE_TX_SIZE 2 6 |
7struct kxsd9_transport; 8 9/** 10 * struct kxsd9_transport - transport adapter for SPI or I2C 11 * @trdev: transport device such as SPI or I2C 12 * @readreg(): function to read a byte from an address in the device 13 * @writereg(): function to write a byte to an address in the device 14 * @readval(): function to read a 16bit value from the device 15 * @rx: cache aligned read buffer 16 * @tx: cache aligned write buffer 17 */ 18struct kxsd9_transport { 19 void *trdev; 20 int (*readreg) (struct kxsd9_transport *tr, u8 address); 21 int (*writereg) (struct kxsd9_transport *tr, u8 address, u8 val); 22 int (*readval) (struct kxsd9_transport *tr, u8 address); 23 u8 rx[KXSD9_STATE_RX_SIZE] ____cacheline_aligned; 24 u8 tx[KXSD9_STATE_TX_SIZE]; 25}; 26 | |
27int kxsd9_common_probe(struct device *parent, | 7int kxsd9_common_probe(struct device *parent, |
28 struct kxsd9_transport *transport, | 8 struct regmap *map, |
29 const char *name); 30int kxsd9_common_remove(struct device *parent); | 9 const char *name); 10int kxsd9_common_remove(struct device *parent); |