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

mfd: Read CUST_ID from the wm8994 device

Read CUST_ID from the device and log it for diagnostics.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Mark Brown and committed by
Samuel Ortiz
cc7a7279 b7b142d9

+8 -3
+4 -3
drivers/mfd/wm8994-core.c
··· 500 500 ret); 501 501 goto err_enable; 502 502 } 503 - wm8994->revision = ret; 503 + wm8994->revision = ret & WM8994_CHIP_REV_MASK; 504 + wm8994->cust_id = (ret & WM8994_CUST_ID_MASK) >> WM8994_CUST_ID_SHIFT; 504 505 505 506 switch (wm8994->type) { 506 507 case WM8994: ··· 554 553 break; 555 554 } 556 555 557 - dev_info(wm8994->dev, "%s revision %c\n", devname, 558 - 'A' + wm8994->revision); 556 + dev_info(wm8994->dev, "%s revision %c CUST_ID %02x\n", devname, 557 + 'A' + wm8994->revision, wm8994->cust_id); 559 558 560 559 switch (wm8994->type) { 561 560 case WM1811:
+1
include/linux/mfd/wm8994/core.h
··· 57 57 58 58 enum wm8994_type type; 59 59 int revision; 60 + int cust_id; 60 61 61 62 struct device *dev; 62 63 struct regmap *regmap;
+3
include/linux/mfd/wm8994/registers.h
··· 2212 2212 /* 2213 2213 * R256 (0x100) - Chip Revision 2214 2214 */ 2215 + #define WM8994_CUST_ID_MASK 0xFF00 /* CUST_ID - [15:8] */ 2216 + #define WM8994_CUST_ID_SHIFT 8 /* CUST_ID - [15:8] */ 2217 + #define WM8994_CUST_ID_WIDTH 8 /* CUST_ID - [15:8] */ 2215 2218 #define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */ 2216 2219 #define WM8994_CHIP_REV_SHIFT 0 /* CHIP_REV - [3:0] */ 2217 2220 #define WM8994_CHIP_REV_WIDTH 4 /* CHIP_REV - [3:0] */