Commit Graph
4 Commits
Author SHA1 Message Date
Changcheng Deng 92c550f9ff PM: AVS: qcom-cpr: Use div64_ul instead of do_div
do_div() does a 64-by-32 division. Here the divisor is an unsigned long
which on some platforms is 64 bit wide. So use div64_ul instead of do_div
to avoid a possible truncation.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Changcheng Deng <[email protected]>
Signed-off-by: Bjorn Andersson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2021-12-20 19:10:09 -06:00
Cai Huoqing 0e6fda9c65 PM: AVS: qcom-cpr: Make use of the helper function devm_platform_ioremap_resource()
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <[email protected]>
Signed-off-by: Bjorn Andersson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2021-09-21 17:41:48 -05:00
Douglas Anderson 6feba6a62c PM: AVS: qcom-cpr: Use nvmem_cell_read_variable_le_u32()
Let's delete the private function cpr_read_efuse() since it does the
basically the same thing as the new API call
nvmem_cell_read_variable_le_u32().

Differences between the new API call and the old private function:
* less error printing (I assume this is OK).
* will give an error if the value doesn't fit in 32-bits (the old code
  would have truncated silently).

Reviewed-by: Bjorn Andersson <[email protected]>
Acked-by: Niklas Cassel <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://lore.kernel.org/r/20210521134437.v2.1.Id1c70158722750aec0673d60c12e46a9c66bbfed@changeid
Signed-off-by: Bjorn Andersson <[email protected]>
2021-08-03 18:00:18 -05:00
Ulf Hansson a7305e684f PM: AVS: qcom-cpr: Move the driver to the qcom specific drivers
The avs drivers are all SoC specific drivers that doesn't share any code.
Instead they are located in a directory, mostly to keep similar
functionality together. From a maintenance point of view, it makes better
sense to collect SoC specific drivers like these, into the SoC specific
directories.

Therefore, let's move the qcom-cpr driver to the qcom directory.

Signed-off-by: Ulf Hansson <[email protected]>
Acked-by: Bjorn Andersson <[email protected]>
Acked-by: Niklas Cassel <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
2020-10-22 18:38:21 +02:00