• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching +full:argument +full:- +full:count

48 	size_t count;  member
65 { .offset = 0, .count = 15 },
67 { .offset = 0x70, .count = 2 },
69 { .offset = 0x80, .count = 16 },
71 { .offset = 0x100, .count = 11 },
73 { .offset = 0x200, .count = 8 },
79 { .offset = 0x701, .count = 4 },
81 { .offset = 0x720, .count = 16},
83 { .offset = 0x732, .count = 2 },
85 { .offset = 0x2008, .count = 1 },
92 printf(" read: Read [count] bytes dpcd reg at an offset\n"); in print_usage()
95 …printf(" --device=DEVID Aux device id, as listed in /dev/drm_dp_aux_dev[n]. Defaults to 0. Upper … in print_usage()
96 printf(" --offset=REG_ADDR DPCD register offset in hex. Defaults to 0x0. Upper limit - 0xfffff\n"); in print_usage()
97 …printf(" --count=BYTES For reads, specify number of bytes to be read from the offset. Defaults to… in print_usage()
98 printf(" --value For writes, specify a hex value to be written. Upper limit - 0xff\n\n"); in print_usage()
100 printf(" --help: print the usage\n"); in print_usage()
119 { "count", required_argument, NULL, 'c' }, in parse_opts()
127 while ((ret = getopt_long(argc, argv, "-:c:d:ho:v:", longopts, NULL)) != -1) { in parse_opts()
133 "--count argument is invalid/negative/out-of-range\n"); in parse_opts()
137 dpcd->rw.count = temp; in parse_opts()
144 "--device argument is invalid/negative/out-of-range\n"); in parse_opts()
148 dpcd->devid = temp; in parse_opts()
161 "--offset argument is invalid/negative/out-of-range\n"); in parse_opts()
165 dpcd->rw.offset = temp; in parse_opts()
172 "--value argument is invalid/negative/out-of-range\n"); in parse_opts()
176 dpcd->val = temp; in parse_opts()
181 dpcd->cmd = READ; in parse_opts()
183 dpcd->cmd = WRITE; in parse_opts()
184 dpcd->file_op = O_WRONLY; in parse_opts()
192 fprintf(stderr, "Option -%c requires an argument\n", in parse_opts()
203 if ((dpcd->rw.count + dpcd->rw.offset) > (MAX_DP_OFFSET + 1)) { in parse_opts()
204 fprintf(stderr, "Out of bounds. Count + Offset <= 0x100000\n"); in parse_opts()
208 if ((dpcd->cmd == WRITE) && (vflag != 'v')) { in parse_opts()
217 static int dpcd_read(int fd, uint32_t offset, size_t count) in dpcd_read() argument
220 uint8_t *buf = calloc(count, sizeof(uint8_t)); in dpcd_read()
227 pret = pread(fd, buf, count, offset); in dpcd_read()
229 fprintf(stderr, "Failed to read - %s\n", strerror(errno)); in dpcd_read()
234 if (pret < count) { in dpcd_read()
236 "Read %u byte(s), expected %zu bytes, starting at offset %x\n\n", pret, count, offset); in dpcd_read()
256 fprintf(stderr, "Failed to write - %s\n", strerror(errno)); in dpcd_write()
268 size_t count; in dpcd_dump() local
272 count = dump_list[i].count ? dump_list[i].count: 1; in dpcd_dump()
273 ret = dpcd_read(fd, dump_list[i].offset, count); in dpcd_dump()
292 .rw.count = 1, in main()
305 "Failed to open %s aux device - error: %s\n", dev_name, in main()
312 ret = dpcd_read(fd, dpcd.rw.offset, dpcd.rw.count); in main()