Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IIO: Add 4-byte unsigned reads into generic-buffer example

Add unsigned 32bit-wide reads into the generic-buffer.c

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Juergen Beisert <jbe@pengutronix.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Marek Vasut and committed by
Jonathan Cameron
6cffc1f8 390d75c1

+10
+10
drivers/staging/iio/Documentation/generic_buffer.c
··· 104 104 print2byte(*(uint16_t *)(data + channels[k].location), 105 105 &channels[k]); 106 106 break; 107 + case 4: 108 + if (!channels[k].is_signed) { 109 + uint32_t val = *(uint32_t *) 110 + (data + channels[k].location); 111 + printf("%05f ", ((float)val + 112 + channels[k].offset)* 113 + channels[k].scale); 114 + 115 + } 116 + break; 107 117 case 8: 108 118 if (channels[k].is_signed) { 109 119 int64_t val = *(int64_t *)