Skip to contentSkip to conversation

mfd: Add support for WM8351 revision B

PATCH New Mark Brown 1 participant 2 messages Mar 3, 2009

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/2 mfd: Add support for WM8351 revision B

No software visible difference from revision A.

---
 drivers/mfd/wm8350-core.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/mfd/wm8350-core.c +5 -0
index c384cd2..a285cc0 100644
@@ -1386,6 +1386,11 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
 			wm8350->power.rev_g_coeff = 1;
 			break;
 
+		case 1:
+			dev_info(wm8350->dev, "WM8351 Rev B\n");
+			wm8350->power.rev_g_coeff = 1;
+			break;
+
 		default:
 			dev_err(wm8350->dev, "Unknown WM8351 CHIP_REV\n");
 			ret = -ENODEV;
Signature · 1 line
1.6.1.3
author
#1 lore raw

PATCH 2/2 mfd: Use the value of the final spin when reading the AUXADC

Reverse the order of the tests for loop exit so we use a valid value before we time out. Vanishingly unlikely to happen since we retry for several times the expected conversion time.

---
 drivers/mfd/wm8350-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mfd/wm8350-core.c +1 -1
index a285cc0..c2be308 100644
@@ -1111,7 +1111,7 @@ int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref)
 	do {
 		schedule_timeout_interruptible(1);
 		reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1);
-	} while (--tries && (reg & WM8350_AUXADC_POLL));
+	} while ((reg & WM8350_AUXADC_POLL) && --tries);
 
 	if (!tries)
 		dev_err(wm8350->dev, "adc chn %d read timeout\n", channel);
Signature · 1 line
1.6.1.3