From 0cbaa44841db3d06d2a21ae4ab679882033f3dbe Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Tue, 6 Jun 2017 16:08:39 -0500 Subject: lib: Add crc4 module Add a little helper for crc4 calculations. This works 4-bits-at-a-time, using a simple table approach. We will need this in the FSI core code, as well as any master implementations that need to calculate CRCs in software. Signed-off-by: Jeremy Kerr Signed-off-by: Chris Bostic Signed-off-by: Joel Stanley Signed-off-by: Greg Kroah-Hartman --- include/linux/crc4.h | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 include/linux/crc4.h (limited to 'include/linux/crc4.h') diff --git a/include/linux/crc4.h b/include/linux/crc4.h new file mode 100644 index 000000000000..8f739f1d794f --- /dev/null +++ b/include/linux/crc4.h @@ -0,0 +1,8 @@ +#ifndef _LINUX_CRC4_H +#define _LINUX_CRC4_H + +#include + +extern uint8_t crc4(uint8_t c, uint64_t x, int bits); + +#endif /* _LINUX_CRC4_H */ -- cgit v1.2.3