From: Graeme Gregory <gg@xxxxxxxxxxxxxxx>
Read the chip varient and the OTP information from the chip and display
this on probe to aid in debugging of issues.
Older palmas chips do not have the USB_ID programmed and will therefore
return 0x0000 for this field.
+
/* Change IRQ into clear on read mode for efficiency */
slave = PALMAS_BASE_TO_SLAVE(PALMAS_INTERRUPT_BASE);
- addr = PALMAS_BASE_TO_REG(PALMAS_INTERRUPT_BASE, PALMAS_INT_CTRL);
reg = PALMAS_INT_CTRL_INT_CLEAR;
- regmap_write(palmas->regmap[slave], addr, reg);
+ ret = palmas_write(palmas, PALMAS_INTERRUPT_BASE, PALMAS_INT_CTRL, reg);
- slave = PALMAS_BASE_TO_SLAVE(PALMAS_PU_PD_OD_BASE);
- addr = PALMAS_BASE_TO_REG(PALMAS_PU_PD_OD_BASE,
- PALMAS_PRIMARY_SECONDARY_PAD1);
-
if (pdata->mux_from_pdata) {
reg = pdata->pad1;
- ret = regmap_write(palmas->regmap[slave], addr, reg);
+ ret = palmas_write(palmas, PALMAS_PU_PD_OD_BASE,
+ PALMAS_PRIMARY_SECONDARY_PAD1, reg);