Lines Matching refs:fd
18 static void do_read(int fd, int len) in do_read() argument
30 status = read(fd, buf, len); in do_read()
49 static void do_msg(int fd, int len) in do_msg() argument
68 status = ioctl(fd, SPI_IOC_MESSAGE(2), xfer); in do_msg()
80 static void dumpstat(const char *name, int fd) in dumpstat() argument
85 if (ioctl(fd, SPI_IOC_RD_MODE32, &mode) < 0) { in dumpstat()
89 if (ioctl(fd, SPI_IOC_RD_LSB_FIRST, &lsb) < 0) { in dumpstat()
93 if (ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits) < 0) { in dumpstat()
97 if (ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) < 0) { in dumpstat()
111 int fd; in main() local
143 fd = open(name, O_RDWR); in main()
144 if (fd < 0) { in main()
149 dumpstat(name, fd); in main()
152 do_msg(fd, msglen); in main()
155 do_read(fd, readcount); in main()
157 close(fd); in main()