Commit 6d967a5a authored by Abel Vesa's avatar Abel Vesa Committed by Bjorn Andersson

remoteproc: qcom: q6v5: Use _clk_get_optional for aggre2_clk

Only msm8996 and msm8998 SLPIs need the RPM_SMD_AGGR2_NOC_CLK
(as aggre2 clock). None of the other platforms do. Back when the support
for the mentioned platforms was added to the q6v5 pass driver, the
devm_clk_get_optional was not available, so the has_aggre2_clk was
necessary in order to differentiate between plaforms that need this
clock and those which do not. Now that devm_clk_get_optional is available,
we can drop the has_aggre2_clk. This makes the adsp_data more cleaner
and removes the check within adsp_init_clocks.
Signed-off-by: default avatarAbel Vesa <abel.vesa@linaro.org>
Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220718121514.2451590-1-abel.vesa@linaro.org
parent 569d3a75
...@@ -37,7 +37,6 @@ struct adsp_data { ...@@ -37,7 +37,6 @@ struct adsp_data {
const char *firmware_name; const char *firmware_name;
int pas_id; int pas_id;
unsigned int minidump_id; unsigned int minidump_id;
bool has_aggre2_clk;
bool auto_boot; bool auto_boot;
bool decrypt_shutdown; bool decrypt_shutdown;
...@@ -68,7 +67,6 @@ struct qcom_adsp { ...@@ -68,7 +67,6 @@ struct qcom_adsp {
int pas_id; int pas_id;
unsigned int minidump_id; unsigned int minidump_id;
int crash_reason_smem; int crash_reason_smem;
bool has_aggre2_clk;
bool decrypt_shutdown; bool decrypt_shutdown;
const char *info_name; const char *info_name;
...@@ -345,15 +343,13 @@ static int adsp_init_clock(struct qcom_adsp *adsp) ...@@ -345,15 +343,13 @@ static int adsp_init_clock(struct qcom_adsp *adsp)
return ret; return ret;
} }
if (adsp->has_aggre2_clk) { adsp->aggre2_clk = devm_clk_get_optional(adsp->dev, "aggre2");
adsp->aggre2_clk = devm_clk_get(adsp->dev, "aggre2"); if (IS_ERR(adsp->aggre2_clk)) {
if (IS_ERR(adsp->aggre2_clk)) { ret = PTR_ERR(adsp->aggre2_clk);
ret = PTR_ERR(adsp->aggre2_clk); if (ret != -EPROBE_DEFER)
if (ret != -EPROBE_DEFER) dev_err(adsp->dev,
dev_err(adsp->dev, "failed to get aggre2 clock");
"failed to get aggre2 clock"); return ret;
return ret;
}
} }
return 0; return 0;
...@@ -505,7 +501,6 @@ static int adsp_probe(struct platform_device *pdev) ...@@ -505,7 +501,6 @@ static int adsp_probe(struct platform_device *pdev)
adsp->rproc = rproc; adsp->rproc = rproc;
adsp->minidump_id = desc->minidump_id; adsp->minidump_id = desc->minidump_id;
adsp->pas_id = desc->pas_id; adsp->pas_id = desc->pas_id;
adsp->has_aggre2_clk = desc->has_aggre2_clk;
adsp->info_name = desc->sysmon_name; adsp->info_name = desc->sysmon_name;
adsp->decrypt_shutdown = desc->decrypt_shutdown; adsp->decrypt_shutdown = desc->decrypt_shutdown;
platform_set_drvdata(pdev, adsp); platform_set_drvdata(pdev, adsp);
...@@ -585,7 +580,6 @@ static const struct adsp_data adsp_resource_init = { ...@@ -585,7 +580,6 @@ static const struct adsp_data adsp_resource_init = {
.crash_reason_smem = 423, .crash_reason_smem = 423,
.firmware_name = "adsp.mdt", .firmware_name = "adsp.mdt",
.pas_id = 1, .pas_id = 1,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.ssr_name = "lpass", .ssr_name = "lpass",
.sysmon_name = "adsp", .sysmon_name = "adsp",
...@@ -596,7 +590,6 @@ static const struct adsp_data sdm845_adsp_resource_init = { ...@@ -596,7 +590,6 @@ static const struct adsp_data sdm845_adsp_resource_init = {
.crash_reason_smem = 423, .crash_reason_smem = 423,
.firmware_name = "adsp.mdt", .firmware_name = "adsp.mdt",
.pas_id = 1, .pas_id = 1,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.load_state = "adsp", .load_state = "adsp",
.ssr_name = "lpass", .ssr_name = "lpass",
...@@ -608,7 +601,6 @@ static const struct adsp_data sm6350_adsp_resource = { ...@@ -608,7 +601,6 @@ static const struct adsp_data sm6350_adsp_resource = {
.crash_reason_smem = 423, .crash_reason_smem = 423,
.firmware_name = "adsp.mdt", .firmware_name = "adsp.mdt",
.pas_id = 1, .pas_id = 1,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"lcx", "lcx",
...@@ -625,7 +617,6 @@ static const struct adsp_data sm8150_adsp_resource = { ...@@ -625,7 +617,6 @@ static const struct adsp_data sm8150_adsp_resource = {
.crash_reason_smem = 423, .crash_reason_smem = 423,
.firmware_name = "adsp.mdt", .firmware_name = "adsp.mdt",
.pas_id = 1, .pas_id = 1,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
...@@ -641,7 +632,6 @@ static const struct adsp_data sm8250_adsp_resource = { ...@@ -641,7 +632,6 @@ static const struct adsp_data sm8250_adsp_resource = {
.crash_reason_smem = 423, .crash_reason_smem = 423,
.firmware_name = "adsp.mdt", .firmware_name = "adsp.mdt",
.pas_id = 1, .pas_id = 1,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"lcx", "lcx",
...@@ -658,7 +648,6 @@ static const struct adsp_data sm8350_adsp_resource = { ...@@ -658,7 +648,6 @@ static const struct adsp_data sm8350_adsp_resource = {
.crash_reason_smem = 423, .crash_reason_smem = 423,
.firmware_name = "adsp.mdt", .firmware_name = "adsp.mdt",
.pas_id = 1, .pas_id = 1,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"lcx", "lcx",
...@@ -675,7 +664,6 @@ static const struct adsp_data msm8996_adsp_resource = { ...@@ -675,7 +664,6 @@ static const struct adsp_data msm8996_adsp_resource = {
.crash_reason_smem = 423, .crash_reason_smem = 423,
.firmware_name = "adsp.mdt", .firmware_name = "adsp.mdt",
.pas_id = 1, .pas_id = 1,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
...@@ -690,7 +678,6 @@ static const struct adsp_data cdsp_resource_init = { ...@@ -690,7 +678,6 @@ static const struct adsp_data cdsp_resource_init = {
.crash_reason_smem = 601, .crash_reason_smem = 601,
.firmware_name = "cdsp.mdt", .firmware_name = "cdsp.mdt",
.pas_id = 18, .pas_id = 18,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.ssr_name = "cdsp", .ssr_name = "cdsp",
.sysmon_name = "cdsp", .sysmon_name = "cdsp",
...@@ -701,7 +688,6 @@ static const struct adsp_data sdm845_cdsp_resource_init = { ...@@ -701,7 +688,6 @@ static const struct adsp_data sdm845_cdsp_resource_init = {
.crash_reason_smem = 601, .crash_reason_smem = 601,
.firmware_name = "cdsp.mdt", .firmware_name = "cdsp.mdt",
.pas_id = 18, .pas_id = 18,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.load_state = "cdsp", .load_state = "cdsp",
.ssr_name = "cdsp", .ssr_name = "cdsp",
...@@ -713,7 +699,6 @@ static const struct adsp_data sm6350_cdsp_resource = { ...@@ -713,7 +699,6 @@ static const struct adsp_data sm6350_cdsp_resource = {
.crash_reason_smem = 601, .crash_reason_smem = 601,
.firmware_name = "cdsp.mdt", .firmware_name = "cdsp.mdt",
.pas_id = 18, .pas_id = 18,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
...@@ -730,7 +715,6 @@ static const struct adsp_data sm8150_cdsp_resource = { ...@@ -730,7 +715,6 @@ static const struct adsp_data sm8150_cdsp_resource = {
.crash_reason_smem = 601, .crash_reason_smem = 601,
.firmware_name = "cdsp.mdt", .firmware_name = "cdsp.mdt",
.pas_id = 18, .pas_id = 18,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
...@@ -746,7 +730,6 @@ static const struct adsp_data sm8250_cdsp_resource = { ...@@ -746,7 +730,6 @@ static const struct adsp_data sm8250_cdsp_resource = {
.crash_reason_smem = 601, .crash_reason_smem = 601,
.firmware_name = "cdsp.mdt", .firmware_name = "cdsp.mdt",
.pas_id = 18, .pas_id = 18,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
...@@ -762,7 +745,6 @@ static const struct adsp_data sc8280xp_nsp0_resource = { ...@@ -762,7 +745,6 @@ static const struct adsp_data sc8280xp_nsp0_resource = {
.crash_reason_smem = 601, .crash_reason_smem = 601,
.firmware_name = "cdsp.mdt", .firmware_name = "cdsp.mdt",
.pas_id = 18, .pas_id = 18,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"nsp", "nsp",
...@@ -777,7 +759,6 @@ static const struct adsp_data sc8280xp_nsp1_resource = { ...@@ -777,7 +759,6 @@ static const struct adsp_data sc8280xp_nsp1_resource = {
.crash_reason_smem = 633, .crash_reason_smem = 633,
.firmware_name = "cdsp.mdt", .firmware_name = "cdsp.mdt",
.pas_id = 30, .pas_id = 30,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"nsp", "nsp",
...@@ -792,7 +773,6 @@ static const struct adsp_data sm8350_cdsp_resource = { ...@@ -792,7 +773,6 @@ static const struct adsp_data sm8350_cdsp_resource = {
.crash_reason_smem = 601, .crash_reason_smem = 601,
.firmware_name = "cdsp.mdt", .firmware_name = "cdsp.mdt",
.pas_id = 18, .pas_id = 18,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
...@@ -810,7 +790,6 @@ static const struct adsp_data mpss_resource_init = { ...@@ -810,7 +790,6 @@ static const struct adsp_data mpss_resource_init = {
.firmware_name = "modem.mdt", .firmware_name = "modem.mdt",
.pas_id = 4, .pas_id = 4,
.minidump_id = 3, .minidump_id = 3,
.has_aggre2_clk = false,
.auto_boot = false, .auto_boot = false,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
...@@ -827,7 +806,6 @@ static const struct adsp_data sc8180x_mpss_resource = { ...@@ -827,7 +806,6 @@ static const struct adsp_data sc8180x_mpss_resource = {
.crash_reason_smem = 421, .crash_reason_smem = 421,
.firmware_name = "modem.mdt", .firmware_name = "modem.mdt",
.pas_id = 4, .pas_id = 4,
.has_aggre2_clk = false,
.auto_boot = false, .auto_boot = false,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
...@@ -843,7 +821,6 @@ static const struct adsp_data slpi_resource_init = { ...@@ -843,7 +821,6 @@ static const struct adsp_data slpi_resource_init = {
.crash_reason_smem = 424, .crash_reason_smem = 424,
.firmware_name = "slpi.mdt", .firmware_name = "slpi.mdt",
.pas_id = 12, .pas_id = 12,
.has_aggre2_clk = true,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"ssc_cx", "ssc_cx",
...@@ -858,7 +835,6 @@ static const struct adsp_data sm8150_slpi_resource = { ...@@ -858,7 +835,6 @@ static const struct adsp_data sm8150_slpi_resource = {
.crash_reason_smem = 424, .crash_reason_smem = 424,
.firmware_name = "slpi.mdt", .firmware_name = "slpi.mdt",
.pas_id = 12, .pas_id = 12,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"lcx", "lcx",
...@@ -875,7 +851,6 @@ static const struct adsp_data sm8250_slpi_resource = { ...@@ -875,7 +851,6 @@ static const struct adsp_data sm8250_slpi_resource = {
.crash_reason_smem = 424, .crash_reason_smem = 424,
.firmware_name = "slpi.mdt", .firmware_name = "slpi.mdt",
.pas_id = 12, .pas_id = 12,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"lcx", "lcx",
...@@ -892,7 +867,6 @@ static const struct adsp_data sm8350_slpi_resource = { ...@@ -892,7 +867,6 @@ static const struct adsp_data sm8350_slpi_resource = {
.crash_reason_smem = 424, .crash_reason_smem = 424,
.firmware_name = "slpi.mdt", .firmware_name = "slpi.mdt",
.pas_id = 12, .pas_id = 12,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"lcx", "lcx",
...@@ -919,7 +893,6 @@ static const struct adsp_data sdx55_mpss_resource = { ...@@ -919,7 +893,6 @@ static const struct adsp_data sdx55_mpss_resource = {
.crash_reason_smem = 421, .crash_reason_smem = 421,
.firmware_name = "modem.mdt", .firmware_name = "modem.mdt",
.pas_id = 4, .pas_id = 4,
.has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
...@@ -936,7 +909,6 @@ static const struct adsp_data sm8450_mpss_resource = { ...@@ -936,7 +909,6 @@ static const struct adsp_data sm8450_mpss_resource = {
.firmware_name = "modem.mdt", .firmware_name = "modem.mdt",
.pas_id = 4, .pas_id = 4,
.minidump_id = 3, .minidump_id = 3,
.has_aggre2_clk = false,
.auto_boot = false, .auto_boot = false,
.decrypt_shutdown = true, .decrypt_shutdown = true,
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment