]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
regulator: act8865: Fix act8600_sudcdc_voltage_ranges setting
authorAxel Lin <axel.lin@ingics.com>
Thu, 10 Jan 2019 09:26:16 +0000 (17:26 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit0c7b53e3b83fb75d3f789253f82da9ec5eee5e1c
tree374032be1bddc5ae20d201442d7936a15da7c732
parent42abc8a767693a02e5d79123ac88e0cb06c1fea2
regulator: act8865: Fix act8600_sudcdc_voltage_ranges setting

BugLink: https://bugs.launchpad.net/bugs/1838116
[ Upstream commit f01a7beb6791f1c419424c1a6958b7d0a289c974 ]

The act8600_sudcdc_voltage_ranges setting does not match the datasheet.

The problems in below entry:
  REGULATOR_LINEAR_RANGE(19000000, 191, 255, 400000),

1. The off-by-one min_sel causes wrong volatage calculation.
   The min_sel should be 192.
2. According to the datasheet[1] Table 7. (on page 43):
   The selector 248 (0b11111000) ~ 255 (0b11111111) are 41.400V.

Also fix off-by-one for ACT8600_SUDCDC_VOLTAGE_NUM.

[1] https://active-semi.com/wp-content/uploads/ACT8600_Datasheet.pdf

Fixes: df3a950e4e73 ("regulator: act8865: Add act8600 support")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/regulator/act8865-regulator.c