bcmi2c.h (990B)
1 /* 2 * 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 7 * 8 */ 9 10 #ifndef __BCM_BCMI2C_H__ 11 #define __BCM_BCMI2C_H__ 12 13 #if defined(INCLUDE_I2C) 14 15 #include <bcm/types.h> 16 17 #ifndef BCM_HIDE_DISPATCHABLE 18 19 /* Open I2C device. */ 20 extern int bcm_i2c_open( 21 int unit, 22 char *devname, 23 uint32 flags, 24 int speed); 25 26 /* Write to I2C device. */ 27 extern int bcm_i2c_write( 28 int unit, 29 int fd, 30 uint32 addr, 31 uint8 *data, 32 uint32 nbytes); 33 34 /* Read from I2C device. */ 35 extern int bcm_i2c_read( 36 int unit, 37 int fd, 38 uint32 addr, 39 uint8 *data, 40 uint32 *nbytes); 41 42 /* Perform IOCTL access on I2C driver. */ 43 extern int bcm_i2c_ioctl( 44 int unit, 45 int fd, 46 int opcode, 47 void *data, 48 int len); 49 50 #endif /* defined(INCLUDE_I2C) */ 51 52 #endif /* BCM_HIDE_DISPATCHABLE */ 53 54 #endif /* __BCM_BCMI2C_H__ */