08 Nov, 2018
2 commits
-
Fix 'Division or modulo by zero' coverity issue(CID-4159438).
In fact, no need to call set_ramp_delay() in case of ramp_disable
is true, hence, ramp_delay never be 0 while set_ramp_delay() called.Signed-off-by: Robin Gong
Reviewed-by: Anson Huang -
Fix 'Explicit null dereferenced' coverity issue(CID-3351937).
Signed-off-by: Robin Gong
Reviewed-by: Anson Huang
29 Oct, 2018
32 commits
-
For customed BD71840 on i.mx8mm-evk board, LDO1/LDO2 setting is
different as BD71837, and no LDOx_SEL for LDO3/4. Correct LDO1_VOLT_SEL/
LDO1_VOLT_SEL and remove unused LDO enable code in probe, since those
can be done by 'regulator-boot-on'/'regulator-always-on' in dts.Signed-off-by: Robin Gong
-
Fix reboot failure on i.mx845s evk board. For BD71837, BUCKx_SEL and
BUCKx_EN of all bucks can't be set to 1 as explicity enabled or disabled,
otherwise, it may mess up with the default state machine if pmic reset
triggered. Remove enable/disable interfaces in driver to avoid touch such
bits.Signed-off-by: Robin Gong
-
Signed-off-by: Haoran.Wang
Signed-off-by: Robin Gong
Signed-off-by: Anson Huang
(cherry picked from commit 37f67d291e74a3428310cb5c98f556411042f810) -
add 500us enable_time for switch to be stable while turned on.
Signed-off-by: Robin Gong
-
Add enable/disable support for switch regulator on pfuze100.
Signed-off-by: Robin Gong
Signed-off-by: Bai Ping -
Actually, m4 only fill the least 1byte, so we'd better clear 'val' before
reading by rpmsg, thus the gabage data will not bother us.Signed-off-by: Robin Gong
(cherry picked from commit df3428c6588a00fa153a3b6996cc33b21b69efb6) -
Add off_on_delay for fixed regulator. This can assign the delay time
between the regulator disable and regulator enable.User can define the delay value by using 'off-on-delay' in dts file.
Signed-off-by: Haibo Chen
-
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-arm2Signed-off-by: Cristina Ciocan
-
Multi drivers(mmc, cpufreq..) may access pf1550 regulator rpmsg driver at
the same time, so we have to add mutex for this multi-entry case. Otherwise
the below kernel warning maybe triggered:------------[ cut here ]------------
WARNING: CPU: 0 PID: 19 at kernel/power/qos.c:453 pf1550_send_message+0x4c/0xf8()
pm_qos_add_request() called for already added request
Modules linked in:
CPU: 0 PID: 19 Comm: kworker/0:1 Not tainted 4.1.33-02293-g80b8c19 #636
Hardware name: Freescale i.MX7ULP (Device Tree)
Workqueue: events od_dbs_timer
[] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[] (show_stack) from [] (dump_stack+0x88/0x9c)
[] (dump_stack) from [] (warn_slowpath_common+0x80/0xb0)
[] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x30/0x40)
[] (warn_slowpath_fmt) from [] (pf1550_send_message+0x4c/0xf8)
[] (pf1550_send_message) from [] (pf1550_get_voltage+0x48/0x5c)
[] (pf1550_get_voltage) from [] (_regulator_get_voltage+0x68/0xb4)
[] (_regulator_get_voltage) from [] (_regulator_do_set_voltage+0x5c/0x3e4)
[] (_regulator_do_set_voltage) from [] (regulator_set_voltage+0xb0/0x14c)
[] (regulator_set_voltage) from [] (imx7ulp_set_target+0x178/0x238)
[] (imx7ulp_set_target) from [] (__cpufreq_driver_target+0x164/0x294)
[] (__cpufreq_driver_target) from [] (dbs_check_cpu+0x1a0/0x1e0)
[] (dbs_check_cpu) from [] (od_dbs_timer+0x80/0x138)
[] (od_dbs_timer) from [] (process_one_work+0x118/0x3e4)
[] (process_one_work) from [] (worker_thread+0x4c/0x4f4)
[] (worker_thread) from [] (kthread+0xdc/0xf4)
[] (kthread) from [] (ret_from_fork+0x14/0x2c)
---[ end trace f8281ecde7a0b4ce ]---
------------[ cut here ]------------Signed-off-by: Robin Gong
-
update driver since m4 side refine the header structure.
Signed-off-by: Robin Gong
-
At some systems, the pinctrl setting will be lost or needs to
set as "sleep" state to save power consumption. So, we need to
configure pinctrl as "sleep" state when system enters suspend,
and as "default" state after system resumes. In this way, the
pinctrl value can be recovered as "default" state after resuming.Signed-off-by: Peter Chen
-
In bypass mode, the anatop digital regulators do not have any minimum
dropout value (the input voltage is equal to the output voltage according
to documentation).Having a min dropout value of 125mV will lead to an increased voltage
for PMIC supplies.Only set minimum dropout value for ldo enabled mode.
Signed-off-by: Irina Tirdea
-
When a regulator is in bypass mode it's output is equal to it's supply
and it can't do any adjustment. Deal with all set_voltage calls by
propagating them upwards.Signed-off-by: Leonard Crestez
-
It is difficult to understand what's going on inside a single if
statement so split it into a separate function.Signed-off-by: Leonard Crestez
-
An anatop regulator will return -EPROBE_DEFER when trying to register,
if it has a supply from PMIC and this supply is not yet registered.
This does not represent an error since the driver will call probe again later,
so skip the error message in this case.Signed-off-by: Irina Tirdea
-
Sometimes rpmsg callback triggered quickly before reinit_completion, then
cause "rpmsg_send timeout!". Move reinit_completion to the place before
rpmsg_send to make sure the completion is ready before callback triggered.Signed-off-by: Robin Gong
(cherry picked from commit 8e44277d3f27e5f46232bd705ee9ef594db42575) -
Since multi rpmsg instances supported now, we can use the specific rpmsg
channel name "rpmsg-regulator-channel" instead of "rpmsg-openamp-demo-channel"Signed-off-by: Robin Gong
(cherry picked from commit 8a9d73fe43da2833951b428f389aac01aef7cb2a) -
CLKE bit of MU_CR may bring VLS state mess in M4 side, so use pm_qos instead
to prevent i.mx7ulp A7 core enter STOP mode during pf1550 send command by rpmsgSigned-off-by: Robin Gong
-
According to API definition, Set the voltage for the regulator within the
range specified, the driver should select the voltage closest to min_uV.Signed-off-by: Dong Aisheng
-
add pf1550 regulator rpmsg driver to control pf1550 on the m4 side
by rpmsg.Signed-off-by: Robin Gong
-
Add one new regulator events macro 'REGULATOR_EVENT_AFT_DO_ENABLE'.
1.8v of imx7d pcie phy, should be turned on after
the 1p0d(1.0v) of pcie phy is turned on.Signed-off-by: Richard Zhu
-
Do not probe if the device node is not correct in dts.
Signed-off-by: Robin Gong
-
check OTP_SW2_DVS_ENB bit for the different voltage list while SW2
regulator registered.Signed-off-by: Robin Gong
-
The voltage of LDO1 and LDO3 are not linear, use voltage_table instead,so
add new ops for them. Meanwhile, correct 12500uV for one step of SW1/SW2
rather than 125000uV.Signed-off-by: Robin Gong
-
Add basic pf1550 regulator driver.
Signed-off-by: Robin Gong
-
Regards to the pfuze3000 doc update, regulator driver need to be updated too.
Otherwise the voltage information show wrongly.Signed-off-by: Robin Gong
-
Some registers on pfuze3000 will lost after exit from LPSR, need restore them,
otherwise system may reboot with below command after system enter LPSR one time:root@imx7d_all:~# echo enabled > /sys/class/tty/ttymxc0/power/wakeup
root@imx7d_all:~# echo mem > /sys/power/statebecause LDOGCTL not recover as 1. Add 'fsl,lpsr-mode' property to this case,
please add this property if your board support LPSR mode as imx7d-12x12-lpddr3-arm2
board.Signed-off-by: Robin Gong
-
Add PMIC 'MAX17135' module drivers to 4.1.y kernel. These are necessary
to supply power for E-ink panel display functions.Signed-off-by: Robby Cai
-
The code reads the default voltage selector from its register.
If the default voltage selector is 0 which results in faulty
behaviour of this regulator driver.This patch sets a default voltage selector for vddpcie-phy if
it is not set in the register.Signed-off-by: Richard Zhu
-
The anatop on i.MX6 requires that vddpu use the same voltage level as
vddsoc. It's a quick hacking to force the check whenever vddpu is
about to be enabled.Signed-off-by: Shawn Guo
Signed-off-by: Robin GongAlso take into consideration bypass mode when using the vddsoc selector
for vddpu.Signed-off-by: Irina Tirdea
Signed-off-by: Leonard Crestez -
Add two new regulator events macro 'REGULATOR_EVENT_PRE_DO_ENABLE'
and 'REGULATOR_EVENT_PRE_DO_DISABLE', since some gpc operations
should be required when MIPI PHY is powered on/off.Signed-off-by: Fancy Fang
-
Add non core enable/disable API.
Signed-off-by: Peter Chen
(cherry picked from commit 38681ee653cb75fa1839547414c7780c4f3a7c00)
04 Oct, 2018
1 commit
-
commit fb6de923ca3358a91525552b4907d4cb38730bdd upstream.
dev_set_drvdata() needs to be called before device_register()
exposes device to userspace. Otherwise kernel crashes after it
gets null pointer from dev_get_drvdata() when userspace tries
to access sysfs entries.[Removed backtrace for length -- broonie]
Signed-off-by: Yu Zhao
Signed-off-by: Mark Brown
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman
03 Aug, 2018
2 commits
-
[ Upstream commit 02f3703934a42417021405ef336fe45add13c3d1 ]
In of_get_regulation_constraints() we were taking the result of
of_map_mode() (an unsigned int) and assigning it to an int. We were
then checking whether this value was -EINVAL. Some implementers of
of_map_mode() were returning -EINVAL (even though the return type of
their function needed to be unsigned int) because they needed to
signal an error back to of_get_regulation_constraints().In general in the regulator framework the mode is always referred to
as an unsigned int. While we could fix this to be a signed int (the
highest value we store in there right now is 0x8), it's actually
pretty clean to just define the regulator mode 0x0 (the lack of any
bits set) as an invalid mode. Let's do that.Fixes: 5e5e3a42c653 ("regulator: of: Add support for parsing initial and suspend modes")
Suggested-by: Javier Martinez Canillas
Signed-off-by: Douglas Anderson
Reviewed-by: Javier Martinez Canillas
Signed-off-by: Mark Brown
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman -
[ Upstream commit 0b01fd3d40fe6402e5fa3b491ef23109feb1aaa5 ]
If is_enabled() is not defined, regulator core will assume
this regulator is already enabled, then it can NOT be really
enabled after disabled.Based on Li Jun's patch from the NXP kernel tree.
Signed-off-by: Anson Huang
Signed-off-by: Mark Brown
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
30 May, 2018
2 commits
-
[ Upstream commit 30966861a7a2051457be8c49466887d78cc47e97 ]
If an unlikely failure in 'of_get_regulator_init_data()' occurs, we must
release the reference on the current 'child' node before returning.Signed-off-by: Christophe JAILLET
Signed-off-by: Mark Brown
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman -
[ Upstream commit ed8cffda27dea6fd3dafb3ee881c5a786edac9ca ]
Re-order error handling code and gotos to avoid leaks in error handling
paths.Fixes: 9f946099fe19 ("regulator: gpio: fix parsing of gpio list")
Signed-off-by: Christophe JAILLET
Signed-off-by: Mark Brown
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
15 Mar, 2018
1 commit
-
commit f63248fac563125fd5a2f0bc780ce7a299872cab upstream.
stm32_vrefbuf_enable() wrongly checks VRR bit: 0 stands for not ready,
1 for ready. It currently checks the opposite.
This makes enable routine to exit immediately without waiting for ready
flag.Fixes: 0cdbf481e927 ("regulator: Add support for stm32-vrefbuf")
Signed-off-by: Fabrice Gasnier
Signed-off-by: Mark Brown
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman