MLK-13982: 4.9 rebase: EPDC does not work
authorCristina Ciocan <cristina-mihaela.ciocan@nxp.com>
Mon, 27 Feb 2017 10:04:17 +0000 (12:04 +0200)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:10:48 +0000 (15:10 -0500)
commit1d79fc41510573f0abcc4994b9f172e0a7b8d6cb
tree7bd9f21967e4f41ab034e5f0629193a1e606e882
parent8a4af51122c41c31d68874bc360eaf4a6db982ab
MLK-13982: 4.9 rebase: EPDC does not work

The Linux kernel regulator core implementation does not accept negative
voltage values; all negative values are treated as errors.

The problem with the EPDC is that the panel uses a negative voltage
regulator which fails to be enabled by the regulator core. This issue has
slipped up until the 4.9 rebase because the voltage range [min, max] was
checked against only when min = max. This has been fixed in 4.9, resulting
in errors in the VCOM regulator driver.

The fix is to use the negative values when communicating with the hardware,
but send only positive values to the regulator core.

This patch sends the absolute value to the regulator core and transforms
the received value (from the regulator core) to negative one before sending
it to hardware.

Fix device tree to deal with negative voltage regulator values by setting
min_value = -real_max_value and vice versa. Boards affected:
- imx6dl-sabresd
- imx6ull-14x14-ddr3-arm2
- imx7d-12x12-lpddr3-arm2
- imx7d-sdb
- imx6sll-evk
- imx6sl-evk
- imx6sll-lpddr3-arm2

Signed-off-by: Cristina Ciocan <cristina-mihaela.ciocan@nxp.com>
arch/arm/boot/dts/imx6dl-sabresd.dts
arch/arm/boot/dts/imx6sl-evk.dts
arch/arm/boot/dts/imx6sll-evk.dts
arch/arm/boot/dts/imx6sll-lpddr3-arm2.dts
arch/arm/boot/dts/imx6ull-14x14-ddr3-arm2.dts
arch/arm/boot/dts/imx7d-12x12-lpddr3-arm2.dts
arch/arm/boot/dts/imx7d-sdb.dts
drivers/regulator/max17135-regulator.c