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

media: ccs: Add debug prints for MSR registers

Also print out MSR registers written to the sensor. This isn't entirely
optimal as the debug strings are produced even if they're not used but
that isn't really a grave issue --- the I²C bus is very slow anyway.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Sakari Ailus and committed by
Mauro Carvalho Chehab
7a426098 57801b6a

+8
+8
drivers/media/i2c/ccs/ccs-reg-access.c
··· 387 387 388 388 for (j = 0; j < regs->len; 389 389 j += msg.len - 2, regdata += msg.len - 2) { 390 + char printbuf[(MAX_WRITE_LEN << 1) + 391 + 1 /* \0 */] = { 0 }; 390 392 int rval; 391 393 392 394 msg.len = min(regs->len - j, MAX_WRITE_LEN); 393 395 396 + bin2hex(printbuf, regdata, msg.len); 397 + dev_dbg(&client->dev, 398 + "writing msr reg 0x%4.4x value 0x%s\n", 399 + regs->addr + j, printbuf); 400 + 394 401 put_unaligned_be16(regs->addr + j, buf); 395 402 memcpy(buf + 2, regdata, msg.len); 403 + 396 404 msg.len += 2; 397 405 398 406 rval = ccs_write_retry(client, &msg);