15 #include <linux/kernel.h>
16 #include <linux/module.h>
17 #include <linux/i2c.h>
21 #include <linux/random.h>
27 #define WM831X_UNIQUE_ID_LEN 16
30 static int wm831x_unique_id_read(
struct wm831x *
wm831x,
char *
id)
39 id[i * 2] = (val >> 8) & 0xff;
40 id[(i * 2) + 1] = val & 0xff;
54 rval = wm831x_unique_id_read(wm831x,
id);
59 ret +=
sprintf(&buf[ret],
"%02x", buf[i]);
61 ret +=
sprintf(&buf[ret],
"\n");
75 dev_err(wm831x->
dev,
"Unique ID attribute not created: %d\n",
78 ret = wm831x_unique_id_read(wm831x, uuid);
82 dev_err(wm831x->
dev,
"Failed to read UUID: %d\n", ret);