1. 03 Jun, 2017 3 commits
    • Tony Lindgren's avatar
      iio: adc: cpcap: Remove hung interrupt quirk · 9d965236
      Tony Lindgren authored
      This is no longer needed as the real problem was interrupt flags
      not getting passed properly from device tree to the cpcap-core.c
      mfd driver. This got fixed with commit ac894732 ("mfd: cpcap:
      Fix interrupt to use level interrupt") So let's remove ADC
      interrupt specific the quirk.
      
      Cc: Marcel Partap <mpartap@gmx.net>
      Cc: Michael Scott <michael.scott@linaro.org>
      Reviewed-by: default avatarSebastian Reichel <sre@kernel.org>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      9d965236
    • Tony Lindgren's avatar
      iio: adc: cpcap: Fix die temperature · 951d21de
      Tony Lindgren authored
      It seems that "MC13783 Power Management and Audio Ciruit User's Guide"
      MC1378UG.pdf documents several similar components as in the CPCAP PMIC.
      
      Chapter "9.5.5 Die Temperature and UID" says that the die temperature
      value is 282 at 25C with LSB of -1.14C. Converting CPCAP PMIC channel3
      values with following seems to produce values that make sense for a
      PMIC die:
      
      temperature = 25000 + ((regval - 282) * 114)
      
      As we don't have any other documentation, let's assume the die
      temperature is unconfigured in the Motorola mapphone Linux kernel
      and the current temperature conversion table should be only used
      for the battery thermistor and not for the die temperature.
      
      Cc: Marcel Partap <mpartap@gmx.net>
      Cc: Michael Scott <michael.scott@linaro.org>
      Cc: Sebastian Reichel <sre@kernel.org>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      951d21de
    • Tony Lindgren's avatar
      iio: adc: cpcap: Fix default register values and battery temperature · 3f9f3a1a
      Tony Lindgren authored
      Looking at the register dumps from Android kernel on droid 4, I noticed
      the values with the mainline kernel don't match. Let's fix this by
      initializing the ADC registers to what Android does.
      
      For getting correct values from the battery thermistor, we need to
      toggle the CPCAP_BIT_THERMBIAS_EN when measuring battery temperature
      to get correct battery temperatures. And looks like we also need to
      wait a little bit before reading the battery temperature as otherwise
      the results are inaccurate.
      
      Cc: Marcel Partap <mpartap@gmx.net>
      Cc: Michael Scott <michael.scott@linaro.org>
      Cc: Sebastian Reichel <sre@kernel.org>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      3f9f3a1a
  2. 29 May, 2017 37 commits