summaryrefslogtreecommitdiffstats
path: root/drivers/soc/qcom/rpmpd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* soc: qcom: Move power-domain drivers to the genpd dirUlf Hansson2023-07-141-992/+0
| | | | | | | | | | | | | To simplify with maintenance let's move the qcom power-domain drivers to the new genpd directory. Going forward, patches are intended to be managed through a separate git tree, according to MAINTAINERS. Cc: Bjorn Andersson <andersson@kernel.org> Cc: Konrad Dybcio <konrad.dybcio@linaro.org> Cc: Andy Gross <agross@kernel.org> Cc: <linux-arm-msm@vger.kernel.org> Acked-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
* soc: qcom: rpmpd: use correct __le32 typeMin-Hua Chen2023-05-251-2/+2
| | | | | | | | | | | | | | Use cpu_to_le32 to cast constants to __le32 before comparing them with __le32 type pd->key. This fixes the following sparse warnings: drivers/soc/qcom/rpmpd.c:895:31: sparse: warning: restricted __le32 degrades to integer drivers/soc/qcom/rpmpd.c:896:15: sparse: warning: restricted __le32 degrades to integer Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230522160757.284165-1-minhuadotchen@gmail.com
* soc: qcom: rpmpd: Remove useless commentsKonrad Dybcio2023-03-151-13/+0
| | | | | | | | | It goes without saying that socname_rpmpds[] is the array of the RPM power domains associated with socname. Remove these comments. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230313-topic-rpmpd-v3-10-06a4f448ff90@linaro.org
* soc: qcom: rpmpd: Hook up VDDMX as parent of SM6375 VDDGXKonrad Dybcio2023-03-151-0/+4
| | | | | | | | | | | | The GPU core clock requires that both VDDGX and VDDMX domains are scaled at the same rate at the same time (well, MX just before GX but you get the idea). Set MX as parent of GX to take care of that. Suggested-by: Bjorn Andersson <andersson@kernel.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230313-topic-rpmpd-v3-9-06a4f448ff90@linaro.org
* soc: qcom: rpmpd: Add parent PD supportKonrad Dybcio2023-03-151-0/+10
| | | | | | | | | | | In some cases (like with the GPU core clock on GMU-less SoCs) it's required that we scale more than one voltage domain. This can be achieved by linking them in a parent-child relationship. Add support for specifying a parent PD, similarly to what has been done in the RPMhPD driver. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230313-topic-rpmpd-v3-8-06a4f448ff90@linaro.org
* soc: qcom: rpmpd: Make bindings assignments consistentKonrad Dybcio2023-03-151-59/+59
| | | | | | | | | | | Currently the whitespace between [DT_BINDING] = &struct is all over the place.. some SoC structs have a space, others have a tab, others have N tabs.. Make that a single tab for everybody to keep things coherent. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230313-topic-rpmpd-v3-7-06a4f448ff90@linaro.org
* soc: qcom: rpmpd: Improve the namingKonrad Dybcio2023-03-151-216/+216
| | | | | | | | | | Now that we aren't bound by the preprocessor macros, improve the naming to be a bit less preprocessor-y and touch up some rpmpd.pd.name fields while at it. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230313-topic-rpmpd-v3-6-06a4f448ff90@linaro.org
* soc: qcom: rpmpd: Expand struct definition macrosKonrad Dybcio2023-03-151-98/+441
| | | | | | | | | Expand the struct definition macros to make things easier to see and maintain. Now that the macros are unnecessary, remove them. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230313-topic-rpmpd-v3-5-06a4f448ff90@linaro.org
* soc: qcom: rpmpd: Remove vdd* from struct namesKonrad Dybcio2023-03-151-156/+156
| | | | | | | | | | It's rather obvious by the characteristic of these resources that they correspond to some voltage lines governed by RPM. Remove the "vdd" unnecessary prefix from them. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230313-topic-rpmpd-v3-4-06a4f448ff90@linaro.org
* soc: qcom: rpmpd: Unify Low Power Island definitionsKonrad Dybcio2023-03-151-4/+2
| | | | | | | | | Up until now, we had 2 separate entries for VDD_LPI[CM]X and VDD_LPI_[CM]X which both pointed to the same RPM resource. Fix it. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230313-topic-rpmpd-v3-3-06a4f448ff90@linaro.org
* soc: qcom: rpmpd: Bring all definitions to the topKonrad Dybcio2023-03-151-62/+49
| | | | | | | | | Keep all definitions in one place in preparation for a cleanup to make things tidier. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230313-topic-rpmpd-v3-2-06a4f448ff90@linaro.org
* soc: qcom: rpmpd: Remove SoC names from RPMPD definitionsKonrad Dybcio2023-03-151-196/+164
| | | | | | | | | Replace the SoC names with type+id_key (or type+id+..name..+key for fixed-key definitions) and remove duplicate entries. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230313-topic-rpmpd-v3-1-06a4f448ff90@linaro.org
* Revert "soc: qcom: rpmpd: Add SM4250 support"Konrad Dybcio2023-01-191-18/+0
| | | | | | | | | | | SM4250 and SM6115 use a shared device tree and the RPMPDs are identical. There's no need for a separate entry, so remove it. This reverts commit 5b617b1b10c1c6a4365d8f956032e95c53b8e388. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230113152232.2624545-1-konrad.dybcio@linaro.org
* soc: qcom: rpmpd: Add SM4250 supportBhupesh Sharma2022-12-051-0/+18
| | | | | | | | | | | | | | SM4250 has the same RPM power domains as SM6115. Add SM4250 support by reusing SM6115 power domains. Cc: Bjorn Andersson <andersson@kernel.org> Cc: Rajendra Nayak <rnayak@codeaurora.org> Cc: Konrad Dybcio <konrad.dybcio@somainline.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20221127112204.1486337-3-bhupesh.sharma@linaro.org
* soc: qcom: rpmpd: Add SM6375 supportKonrad Dybcio2022-09-141-0/+22
| | | | | | | | Add support for RPMPDs on SM6375. Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20220716193201.455728-2-konrad.dybcio@somainline.org
* soc: qcom: rpmpd: Add compatible for MSM8909Stephan Gerhold2022-07-191-0/+1
| | | | | | | | | MSM8909 has the same power domains as MSM8916, so just define another compatible for the existing definition. Signed-off-by: Stephan Gerhold <stephan.gerhold@kernkonzept.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20220705143523.3390944-5-stephan.gerhold@kernkonzept.com
* soc: qcom: rpmpd: Add MSM8226 supportLuca Weiss2022-02-241-0/+17
| | | | | | | | Add the power domains preset in MSM8226. Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20220220223004.507739-2-luca@z3ntu.xyz
* soc: qcom: rpmpd: Check for null return of devm_kcallocJiasheng Jiang2022-01-311-0/+3
| | | | | | | | | | | | | | | Because of the possible failure of the allocation, data->domains might be NULL pointer and will cause the dereference of the NULL pointer later. Therefore, it might be better to check it and directly return -ENOMEM without releasing data manually if fails, because the comment of the devm_kmalloc() says "Memory allocated with this function is automatically freed on driver detach.". Fixes: bbe3a66c3f5a ("soc: qcom: rpmpd: Add a Power domain driver to model corners") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20211231094419.1941054-1-jiasheng@iscas.ac.cn
* soc: qcom: rpmpd: Add support for sm6125Martin Botka2021-12-211-0/+23
| | | | | | | | | Add RPM power domains located in Qualcomm SM6125 SoC. Signed-off-by: Martin Botka <martin.botka@somainline.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20211130212332.25401-2-martin.botka@somainline.org
* soc: qcom: rpmpd: Add QCM2290 supportShawn Guo2021-11-181-0/+18
| | | | | | | | | QCM2290 has the same RPM power domains as SM6115. Add QCM2290 support by reusing SM6115 power domains. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20211108134442.30051-4-shawn.guo@linaro.org
* soc: qcom: rpmpd: Drop unused res_name from struct rpmpdShawn Guo2021-11-181-1/+0
| | | | | | | | The res_name field in struct rpmpd is unused. Drop it. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20211108134442.30051-2-shawn.guo@linaro.org
* soc: qcom: rpmpd: Add power domains for MSM8953Vladimir Lypak2021-09-221-0/+24
| | | | | | | | | | Add support for MSM8953 power domains. Signed-off-by: Vladimir Lypak <vladimir.lypak@gmail.com> Signed-off-by: Adam Skladowski <a_skl39@protonmail.com> Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20210825170252.20137-1-sireeshkodali1@gmail.com
* drivers: soc: qcom: rpmpd: Add SM6115 RPM Power DomainsIskren Chernev2021-07-201-0/+28
| | | | | | | | The SM4250/6115 have 4 rpm power domains, ported from downstream DT. Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com> Link: https://lore.kernel.org/r/20210627185927.695411-6-iskren.chernev@gmail.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* soc: qcom: rpmpd: Add MDM9607 RPM Power DomainsKonrad Dybcio2021-06-101-0/+22
| | | | | | | | | | | This SoC while being from 8916 era, makes use of the newer-style, floor-level management, instead of the older floor-corner. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org> Link: https://lore.kernel.org/r/20210131013233.54666-1-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* drivers: soc: qcom: rpmpd: Add msm8994 RPM Power DomainsKonrad Dybcio2021-01-251-0/+28
| | | | | | | | | | | | | | | MSM8994 uses similar to MSM8996, legacy-style voltage control, but does not include a VDD_SC_CX line. This setup is also correct for MSM8992. Do note that there exist some boards that use a tertiary PMIC (most likely pm8004), where SMPB on VDDGFX becomes SMPC. I cannot test this configuration though. Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org> Link: https://lore.kernel.org/r/20210118161943.105733-1-konrad.dybcio@somainline.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* soc: qcom: rpmpd: Add MSM8916 power domainsStephan Gerhold2020-10-261-0/+21
| | | | | | | | | MSM8916 has two RPM power domains: VDDCX and VDDMX. Add the necessary definitions to manage them with rpmpd. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Link: https://lore.kernel.org/r/20200916104135.25085-4-stephan@gerhold.net Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* soc: qcom: rpmpd: Add MSM8939 power-domainsJun Nie2020-10-261-0/+27
| | | | | | | | | Add the shared modemcx/cx/mx power-domains found on MSM8939. Reviewed-by: Stephan Gerhold <stephan@gerhold.net> Signed-off-by: Jun Nie <jun.nie@linaro.org> Link: https://lore.kernel.org/r/20200930100145.9457-3-jun.nie@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* soc: qcom: rpmpd: Rename MAX_8996_RPMPD_STATE to MAX_CORNER_RPMPD_STATEStephan Gerhold2020-10-261-2/+2
| | | | | | | | | | | | | | | Older SoCs like MSM8916, MSM8939, MSM8974, MSM8996, ... use "voltage corners" instead of "voltage levels". It seems like they all use exactly the same set of corner values, a value from 0-6 where 6 is the maximum corner (super turbo). In preparation to add the power domains for MSM8916, rename MAX_8996_RPMPD_STATE to MAX_CORNER_RPMPD_STATE to make it clear that this is the max_state to be used for all SoCs using corners. - Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Link: https://lore.kernel.org/r/20200916104135.25085-2-stephan@gerhold.net Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* soc: qcom: rpmpd: Add SDM660 power-domainsKonrad Dybcio2020-10-261-0/+33
| | | | | | | | | | Add the shared cx/mx and sensor sub-system's cx and mx power-domains found on SDM660. Signed-off-by: Konrad Dybcio <konradybcio@gmail.com> Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> Link: https://lore.kernel.org/r/20201018122620.9735-1-kholk11@gmail.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* soc: qcom: rpmpd: Allow RPMPD driver to be loaded as a moduleJohn Stultz2020-04-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch allow the rpmpd driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded. Ideally, it would include a remove hook and related logic, but apparently the genpd code isn't able to track usage and cleaning things up? (See: https://lkml.org/lkml/2019/1/24/38) So making it a permenent module at least improves things slightly over requiring it to be a built in driver. Cc: Todd Kjos <tkjos@google.com> Cc: Saravana Kannan <saravanak@google.com> Cc: Andy Gross <agross@kernel.org> Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: Rajendra Nayak <rnayak@codeaurora.org> Cc: linux-arm-msm@vger.kernel.org Acked-by: Saravana Kannan <saravanak@google.com> Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: John Stultz <john.stultz@linaro.org> Link: https://lore.kernel.org/r/20200326224459.105170-2-john.stultz@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* soc: qcom: rpmpd: Add rpm power domains for msm8976AngeloGioacchino Del Regno2019-10-071-0/+23
| | | | | | | | | The MSM8956/76 SoCs have two main voltage-level power domains, VDD_CX and VDD_MX, which also have their own voltage-floor-level (VFL) corner. Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* soc: qcom: rpmpd: Add MSM8998 power-domainsSibi Sankar2019-05-301-0/+36
| | | | | | | | | | | Add the shared cx/mx and sensor sub-system's cx and mx power-domains found on MSM8998. Reviewed-by: Jeffrey Hugo <jhugo@codeaurora.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <agross@kernel.org>
* soc: qcom: rpmpd: Add QCS404 power-domainsBjorn Andersson2019-05-301-1/+51
| | | | | | | | | | | | | | Add the shared cx/mx and the low-power-island's cx and mx power-domains found on QCS404. Reviewed-by: Jeffrey Hugo <jhugo@codeaurora.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> [sibi: Fixup corner/vfc with vlfl/vfl] Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <agross@kernel.org>
* soc: qcom: rpmpd: Modify corner defining macrosBjorn Andersson2019-05-301-21/+17
| | | | | | | | | | | | | | QCS404 uses individual resource type magic for each power-domain, so adjust the macros slightly to make them reusable for this. Reviewed-by: Jeffrey Hugo <jhugo@codeaurora.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> [sibi: Extend rpmpd corner pair to a generic rpmpd pair] Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <agross@kernel.org>
* soc: qcom: rpmpd: Add support to set rpmpd state to maxSibi Sankar2019-05-301-3/+7
| | | | | | | | | | | rpmpd max state varies across SoCs and SoC families, add support in the driver to make it SoC/SoC family specific Reviewed-by: Jeffrey Hugo <jhugo@codeaurora.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <agross@kernel.org>
* soc: qcom: rpmpd: fixup rpmpd set performance stateSibi Sankar2019-05-301-1/+1
| | | | | | | | | | | | | | | Remoteproc q6v5-mss calls set_performance_state with INT_MAX on rpmpd. This is currently ignored since it is greater than the max supported state. Fixup rpmpd state to max if the required state is greater than all the supported states. Fixes: 075d3db8d10d ("soc: qcom: rpmpd: Add support for get/set performance state") Reviewed-by: Marc Gonzalez <marc.w.gonzalez@free.fr> Reviewed-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Jeffrey Hugo <jhugo@codeaurora.org> Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <agross@kernel.org>
* soc: qcom: rpmpd: Drop family A RPM dependencyBjorn Andersson2019-01-221-6/+4
| | | | | | | | | | The MFD_QCOM_RPM is the RPM in family A, but the rpmpd driver only implements support for SMD based devices. Drop the dependency and remove includes of the family A headers. No functional change. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Rajendra Nayak <rnayak@codeaurora.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
* soc: qcom: rpmpd: Add support for get/set performance stateRajendra Nayak2019-01-221-0/+35
| | | | | | | | | | | | Add support for the .set_performace_state() and .opp_to_performance_state() callbacks in the rpmpd driver. Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
* soc: qcom: rpmpd: Add a Power domain driver to model cornersRajendra Nayak2019-01-221-0/+282
The Power domains for corners just pass the performance state set by the consumers to the RPM (Remote Power manager) which then takes care of setting the appropriate voltage on the corresponding rails to meet the performance needs. We add all power domain data needed on msm8996 here. This driver can easily be extended by adding data for other qualcomm SoCs as well. Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>