[PATCH 22/76] drm/amd/dal: remove AS dependency from i2c_aux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tony Cheng <tony.cheng@xxxxxxx>

- remove dal_adapter_service_get_firmware_info.  call bios directly
- remove dal_adapter_service_get_i2caux. get i2caux from dc_ctx
- remove FEATURE_RESTORE_USAGE_I2C_SW_ENGINE. always 0

Signed-off-by: Tony Cheng <tony.cheng at amd.com>
Acked-by: Harry Wentland <harry.wentland at amd.com>
---
 .../gpu/drm/amd/dal/dc/adapter/adapter_service.c   | 26 +-----------------
 drivers/gpu/drm/amd/dal/dc/core/dc.c               |  2 +-
 drivers/gpu/drm/amd/dal/dc/dc_types.h              |  6 ++++-
 .../gpu/drm/amd/dal/dc/dce100/dce100_resource.c    |  2 +-
 .../gpu/drm/amd/dal/dc/dce110/dce110_resource.c    |  2 +-
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c  |  2 +-
 .../amd/dal/dc/gpu/dce110/display_clock_dce110.c   |  3 ++-
 .../drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c |  3 ++-
 .../drm/amd/dal/dc/i2caux/dce100/i2caux_dce100.c   |  2 --
 .../drm/amd/dal/dc/i2caux/dce100/i2caux_dce100.h   |  1 -
 .../drm/amd/dal/dc/i2caux/dce110/i2caux_dce110.c   | 10 ++-----
 .../drm/amd/dal/dc/i2caux/dce110/i2caux_dce110.h   |  2 --
 .../drm/amd/dal/dc/i2caux/dce112/i2caux_dce112.c   |  5 +---
 .../drm/amd/dal/dc/i2caux/dce112/i2caux_dce112.h   |  1 -
 .../gpu/drm/amd/dal/dc/i2caux/dce80/i2caux_dce80.c |  8 +++---
 .../gpu/drm/amd/dal/dc/i2caux/dce80/i2caux_dce80.h |  1 -
 .../amd/dal/dc/i2caux/diagnostics/i2caux_diag.c    |  6 ++---
 .../amd/dal/dc/i2caux/diagnostics/i2caux_diag.h    |  1 -
 drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.c         | 31 +++++++---------------
 drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.h         |  3 +--
 .../amd/dal/include/adapter_service_interface.h    |  6 -----
 drivers/gpu/drm/amd/dal/include/i2caux_interface.h |  1 -
 22 files changed, 32 insertions(+), 92 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
index d25f9da35b07..328cc8a41770 100644
--- a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
+++ b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
@@ -86,16 +86,6 @@ static const struct feature_source_entry feature_entry_table[] = {
 	{FEATURE_MAXIMIZE_URGENCY_WATERMARKS, false, true},
 	{FEATURE_MAXIMIZE_STUTTER_MARKS, false, true},
 	{FEATURE_MAXIMIZE_NBP_MARKS, false, true},
-	/*
-	 * We meet HW I2C issue when test S3 resume on KB.
-	 * An EPR is created for debug the issue.
-	 * Make Test has already been implemented
-	 * with HW I2C. The work load for revert back to SW I2C in make test
-	 * is big. Below is workaround for this issue.
-	 * Driver uses SW I2C.
-	 * Make Test uses HW I2C.
-	 */
-	{FEATURE_RESTORE_USAGE_I2C_SW_ENGINE, false, true},
 	{FEATURE_USE_MAX_DISPLAY_CLK, false, true},
 	{FEATURE_ALLOW_EDP_RESOURCE_SHARING, false, true},
 	{FEATURE_SUPPORT_DP_YUV, false, true},
@@ -672,7 +662,7 @@ static bool adapter_service_construct(
 	dcb = as->ctx->dc_bios;
 
 	/* Create I2C AUX */
-	as->i2caux = dal_i2caux_create(as, as->ctx);
+	as->i2caux = dal_i2caux_create(as->ctx);
 
 	if (!as->i2caux) {
 		ASSERT_CRITICAL(false);
@@ -943,20 +933,6 @@ struct dal_asic_runtime_flags dal_adapter_service_get_asic_runtime_flags(
 }
 
 /*
- * dal_adapter_service_get_firmware_info
- *
- * Get firmware information from BIOS
- */
-bool dal_adapter_service_get_firmware_info(
-	struct adapter_service *as,
-	struct firmware_info *info)
-{
-	struct dc_bios *dcb = as->ctx->dc_bios;
-
-	return dcb->funcs->get_firmware_info(dcb, info) == BP_RESULT_OK;
-}
-
-/*
  * dal_adapter_service_get_feature_value
  *
  * Get the cached value of a given feature. This value can be a boolean, int,
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index a65950bf771b..ec33cf9a7fd0 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -518,8 +518,8 @@ static bool construct(struct core_dc *dc,
 	dc->ctx = dc_ctx;
 	dc->ctx->dce_environment = init_params->dce_environment;
 
-
 	dc_version = resource_parse_asic_id(init_params->asic_id);
+	dc->ctx->dce_version = dc_version;
 
 	/* Resource should construct all asic specific resources.
 	 * This should be the only place where we need to parse the asic id
diff --git a/drivers/gpu/drm/amd/dal/dc/dc_types.h b/drivers/gpu/drm/amd/dal/dc/dc_types.h
index 38ca365da1ad..b30dfbf7281e 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc_types.h
@@ -30,7 +30,7 @@
 #include "irq_types.h"
 #include "dc_dp_types.h"
 #include "dc_hw_types.h"
-#include "signal_types.h"
+#include "dal_types.h"
 
 /* forward declarations */
 struct dc_surface;
@@ -73,6 +73,10 @@ struct dc_context {
 
 	enum dce_environment dce_environment;
 
+	/* todo: below should probably move to dc.  to facilitate removal
+	 * of AS we will store these here
+	 */
+	enum dce_version dce_version;
 	struct dc_bios *dc_bios;
 	bool created_bios;
 	struct gpio_service *gpio_service;
diff --git a/drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c b/drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c
index c8c83e86eb53..d1587fe3b854 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c
@@ -880,7 +880,7 @@ static bool construct(
 
 	bp = ctx->dc_bios;
 
-	if (dal_adapter_service_get_firmware_info(as, &info) &&
+	if ((bp->funcs->get_firmware_info(bp, &info) == BP_RESULT_OK) &&
 		info.external_clock_source_frequency_for_dp != 0) {
 		pool->base.dp_clock_source =
 				dce100_clock_source_create(ctx, bp, CLOCK_SOURCE_ID_EXTERNAL, NULL, true);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c
index 82cdcb5c2eb1..33f4455e80f6 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_resource.c
@@ -1211,7 +1211,7 @@ static bool construct(
 
 	bp = ctx->dc_bios;
 
-	if (dal_adapter_service_get_firmware_info(as, &info) &&
+	if ((bp->funcs->get_firmware_info(bp, &info) == BP_RESULT_OK) &&
 		info.external_clock_source_frequency_for_dp != 0) {
 		pool->base.dp_clock_source =
 				dce110_clock_source_create(ctx, bp, CLOCK_SOURCE_ID_EXTERNAL, NULL, true);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c
index 705c69a8a5c4..932f37559da9 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c
@@ -886,7 +886,7 @@ static bool construct(
 
 	bp = ctx->dc_bios;
 
-	if (dal_adapter_service_get_firmware_info(as, &info) &&
+	if ((bp->funcs->get_firmware_info(bp, &info) == BP_RESULT_OK) &&
 		info.external_clock_source_frequency_for_dp != 0) {
 		pool->base.dp_clock_source =
 				dce80_clock_source_create(ctx, bp, CLOCK_SOURCE_ID_EXTERNAL, NULL, true);
diff --git a/drivers/gpu/drm/amd/dal/dc/gpu/dce110/display_clock_dce110.c b/drivers/gpu/drm/amd/dal/dc/gpu/dce110/display_clock_dce110.c
index d422294715ce..8b9d984f3bb9 100644
--- a/drivers/gpu/drm/amd/dal/dc/gpu/dce110/display_clock_dce110.c
+++ b/drivers/gpu/drm/amd/dal/dc/gpu/dce110/display_clock_dce110.c
@@ -670,6 +670,7 @@ static bool display_clock_integrated_info_construct(
 	struct display_clock_dce110 *disp_clk,
 	struct adapter_service *as)
 {
+	struct dc_bios *bp = disp_clk->disp_clk_base.ctx->dc_bios;
 	struct integrated_info info;
 	struct firmware_info fw_info;
 	uint32_t i;
@@ -683,7 +684,7 @@ static bool display_clock_integrated_info_construct(
 
 	disp_clk->dentist_vco_freq_khz = info.dentist_vco_freq;
 	if (disp_clk->dentist_vco_freq_khz == 0) {
-		dal_adapter_service_get_firmware_info(as, &fw_info);
+		bp->funcs->get_firmware_info(bp, &fw_info);
 		disp_clk->dentist_vco_freq_khz =
 			fw_info.smu_gpu_pll_output_freq;
 		if (disp_clk->dentist_vco_freq_khz == 0)
diff --git a/drivers/gpu/drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c b/drivers/gpu/drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c
index e37b397bbd9f..b69e40493e27 100644
--- a/drivers/gpu/drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c
+++ b/drivers/gpu/drm/amd/dal/dc/gpu/dce80/display_clock_dce80.c
@@ -753,6 +753,7 @@ static bool display_clock_integrated_info_construct(
 	struct display_clock_dce80 *disp_clk,
 	struct adapter_service *as)
 {
+	struct dc_bios *bp = disp_clk->disp_clk.ctx->dc_bios;
 	struct integrated_info info = { { { 0 } } };
 	struct firmware_info fw_info = { { 0 } };
 	uint32_t i;
@@ -761,7 +762,7 @@ static bool display_clock_integrated_info_construct(
 
 	disp_clk->dentist_vco_freq_khz = info.dentist_vco_freq;
 	if (disp_clk->dentist_vco_freq_khz == 0) {
-		dal_adapter_service_get_firmware_info(as, &fw_info);
+		bp->funcs->get_firmware_info(bp, &fw_info);
 		disp_clk->dentist_vco_freq_khz =
 			fw_info.smu_gpu_pll_output_freq;
 		if (disp_clk->dentist_vco_freq_khz == 0)
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/dce100/i2caux_dce100.c b/drivers/gpu/drm/amd/dal/dc/i2caux/dce100/i2caux_dce100.c
index e3ababdfe7aa..ab138464aaa2 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/dce100/i2caux_dce100.c
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/dce100/i2caux_dce100.c
@@ -77,7 +77,6 @@ static const struct dce110_i2c_hw_engine_registers dce100_hw_engine_regs[] = {
 };
 
 struct i2caux *dal_i2caux_dce100_create(
-	struct adapter_service *as,
 	struct dc_context *ctx)
 {
 	struct i2caux_dce110 *i2caux_dce110 =
@@ -90,7 +89,6 @@ struct i2caux *dal_i2caux_dce100_create(
 
 	if (dal_i2caux_dce110_construct(
 			i2caux_dce110,
-			as,
 			ctx,
 			dce100_aux_regs,
 			dce100_hw_engine_regs))
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/dce100/i2caux_dce100.h b/drivers/gpu/drm/amd/dal/dc/i2caux/dce100/i2caux_dce100.h
index b2902c65d645..2b508d3e0ef4 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/dce100/i2caux_dce100.h
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/dce100/i2caux_dce100.h
@@ -27,7 +27,6 @@
 #define __DAL_I2C_AUX_DCE100_H__
 
 struct i2caux *dal_i2caux_dce100_create(
-	struct adapter_service *as,
 	struct dc_context *ctx);
 
 #endif /* __DAL_I2C_AUX_DCE100_H__ */
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2caux_dce110.c b/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2caux_dce110.c
index 566056b6782f..a66c365edfac 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2caux_dce110.c
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2caux_dce110.c
@@ -190,7 +190,6 @@ static const struct dce110_i2c_hw_engine_registers i2c_hw_engine_regs[] = {
 
 bool dal_i2caux_dce110_construct(
 	struct i2caux_dce110 *i2caux_dce110,
-	struct adapter_service *as,
 	struct dc_context *ctx,
 	const struct dce110_aux_registers aux_regs[],
 	const struct dce110_i2c_hw_engine_registers i2c_hw_engine_regs[])
@@ -204,14 +203,11 @@ bool dal_i2caux_dce110_construct(
 	 * Some BIOS setting incorrect cause this
 	 * For production, we always get value from BIOS*/
 	reference_frequency =
-		dal_i2caux_get_reference_clock(as) >> 1;
-
-	use_i2c_sw_engine = dal_adapter_service_is_feature_supported(as,
-		FEATURE_RESTORE_USAGE_I2C_SW_ENGINE);
+		dal_i2caux_get_reference_clock(ctx->dc_bios) >> 1;
 
 	base = &i2caux_dce110->base;
 
-	if (!dal_i2caux_construct(base, as, ctx)) {
+	if (!dal_i2caux_construct(base, ctx)) {
 		ASSERT_CRITICAL(false);
 		return false;
 	}
@@ -288,7 +284,6 @@ bool dal_i2caux_dce110_construct(
  * pointer to the base struct of DCE11 I2CAUX
  */
 struct i2caux *dal_i2caux_dce110_create(
-	struct adapter_service *as,
 	struct dc_context *ctx)
 {
 	struct i2caux_dce110 *i2caux_dce110 =
@@ -301,7 +296,6 @@ struct i2caux *dal_i2caux_dce110_create(
 
 	if (dal_i2caux_dce110_construct(
 			i2caux_dce110,
-			as,
 			ctx,
 			dce110_aux_regs,
 			i2c_hw_engine_regs))
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2caux_dce110.h b/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2caux_dce110.h
index d26eec0ff12c..4d544f4e6289 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2caux_dce110.h
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/dce110/i2caux_dce110.h
@@ -38,12 +38,10 @@ struct dce110_aux_registers;
 struct dce110_i2c_hw_engine_registers;
 
 struct i2caux *dal_i2caux_dce110_create(
-	struct adapter_service *as,
 	struct dc_context *ctx);
 
 bool dal_i2caux_dce110_construct(
 	struct i2caux_dce110 *i2caux_dce110,
-	struct adapter_service *as,
 	struct dc_context *ctx,
 	const struct dce110_aux_registers *aux_regs,
 	const struct dce110_i2c_hw_engine_registers *i2c_hw_engine_regs);
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/dce112/i2caux_dce112.c b/drivers/gpu/drm/amd/dal/dc/i2caux/dce112/i2caux_dce112.c
index 748f0c4c3968..2b1456e3d367 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/dce112/i2caux_dce112.c
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/dce112/i2caux_dce112.c
@@ -81,12 +81,10 @@ static const struct dce110_i2c_hw_engine_registers dce112_hw_engine_regs[] = {
 
 static bool construct(
 	struct i2caux_dce110 *i2caux_dce110,
-	struct adapter_service *as,
 	struct dc_context *ctx)
 {
 	if (!dal_i2caux_dce110_construct(
 			i2caux_dce110,
-			as,
 			ctx,
 			dce112_aux_regs,
 			dce112_hw_engine_regs)) {
@@ -111,7 +109,6 @@ static bool construct(
  * pointer to the base struct of DCE11 I2CAUX
  */
 struct i2caux *dal_i2caux_dce112_create(
-	struct adapter_service *as,
 	struct dc_context *ctx)
 {
 	struct i2caux_dce110 *i2caux_dce110 =
@@ -122,7 +119,7 @@ struct i2caux *dal_i2caux_dce112_create(
 		return NULL;
 	}
 
-	if (construct(i2caux_dce110, as, ctx))
+	if (construct(i2caux_dce110, ctx))
 		return &i2caux_dce110->base;
 
 	ASSERT_CRITICAL(false);
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/dce112/i2caux_dce112.h b/drivers/gpu/drm/amd/dal/dc/i2caux/dce112/i2caux_dce112.h
index 06a530c7c996..8d35453c25b6 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/dce112/i2caux_dce112.h
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/dce112/i2caux_dce112.h
@@ -27,7 +27,6 @@
 #define __DAL_I2C_AUX_DCE112_H__
 
 struct i2caux *dal_i2caux_dce112_create(
-	struct adapter_service *as,
 	struct dc_context *ctx);
 
 #endif /* __DAL_I2C_AUX_DCE112_H__ */
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2caux_dce80.c b/drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2caux_dce80.c
index be1d26408d97..5e71450c44e0 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2caux_dce80.c
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2caux_dce80.c
@@ -189,7 +189,6 @@ static const struct i2caux_funcs i2caux_funcs = {
 
 static bool construct(
 	struct i2caux_dce80 *i2caux_dce80,
-	struct adapter_service *as,
 	struct dc_context *ctx)
 {
 	/* Entire family have I2C engine reference clock frequency
@@ -198,7 +197,7 @@ static bool construct(
 	struct i2caux *base = &i2caux_dce80->base;
 
 	uint32_t reference_frequency =
-		dal_i2caux_get_reference_clock(as) >> 1;
+		dal_i2caux_get_reference_clock(ctx->dc_bios) >> 1;
 
 	/*bool use_i2c_sw_engine = dal_adapter_service_is_feature_supported(as,
 		FEATURE_RESTORE_USAGE_I2C_SW_ENGINE);*/
@@ -208,7 +207,7 @@ static bool construct(
 
 	uint32_t i;
 
-	if (!dal_i2caux_construct(base, as, ctx)) {
+	if (!dal_i2caux_construct(base, ctx)) {
 		BREAK_TO_DEBUGGER();
 		return false;
 	}
@@ -275,7 +274,6 @@ static bool construct(
 }
 
 struct i2caux *dal_i2caux_dce80_create(
-	struct adapter_service *as,
 	struct dc_context *ctx)
 {
 	struct i2caux_dce80 *i2caux_dce80 =
@@ -286,7 +284,7 @@ struct i2caux *dal_i2caux_dce80_create(
 		return NULL;
 	}
 
-	if (construct(i2caux_dce80, as, ctx))
+	if (construct(i2caux_dce80, ctx))
 		return &i2caux_dce80->base;
 
 	BREAK_TO_DEBUGGER();
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2caux_dce80.h b/drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2caux_dce80.h
index 85417a896279..21908629e973 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2caux_dce80.h
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/dce80/i2caux_dce80.h
@@ -33,7 +33,6 @@ struct i2caux_dce80 {
 };
 
 struct i2caux *dal_i2caux_dce80_create(
-	struct adapter_service *as,
 	struct dc_context *ctx);
 
 #endif
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/diagnostics/i2caux_diag.c b/drivers/gpu/drm/amd/dal/dc/i2caux/diagnostics/i2caux_diag.c
index 027b207654d2..029bf735036c 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/diagnostics/i2caux_diag.c
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/diagnostics/i2caux_diag.c
@@ -75,10 +75,9 @@ static const struct i2caux_funcs i2caux_funcs = {
 
 static bool construct(
 	struct i2caux *i2caux,
-	struct adapter_service *as,
 	struct dc_context *ctx)
 {
-	if (!dal_i2caux_construct(i2caux, as, ctx)) {
+	if (!dal_i2caux_construct(i2caux, ctx)) {
 		ASSERT_CRITICAL(false);
 		return false;
 	}
@@ -89,7 +88,6 @@ static bool construct(
 }
 
 struct i2caux *dal_i2caux_diag_fpga_create(
-	struct adapter_service *as,
 	struct dc_context *ctx)
 {
 	struct i2caux *i2caux =	dm_alloc(sizeof(struct i2caux));
@@ -99,7 +97,7 @@ struct i2caux *dal_i2caux_diag_fpga_create(
 		return NULL;
 	}
 
-	if (construct(i2caux, as, ctx))
+	if (construct(i2caux, ctx))
 		return i2caux;
 
 	ASSERT_CRITICAL(false);
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/diagnostics/i2caux_diag.h b/drivers/gpu/drm/amd/dal/dc/i2caux/diagnostics/i2caux_diag.h
index 3de250bd7660..a83eeb748283 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/diagnostics/i2caux_diag.h
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/diagnostics/i2caux_diag.h
@@ -27,7 +27,6 @@
 #define __DAL_I2C_AUX_DIAG_FPGA_H__
 
 struct i2caux *dal_i2caux_diag_fpga_create(
-	struct adapter_service *as,
 	struct dc_context *ctx);
 
 #endif /* __DAL_I2C_AUX_DIAG_FPGA_H__ */
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.c b/drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.c
index d9121316d255..63ffd7cb418d 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.c
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.c
@@ -64,33 +64,21 @@
  */
 
 struct i2caux *dal_i2caux_create(
-	struct adapter_service *as,
 	struct dc_context *ctx)
 {
-	enum dce_version dce_version;
-	enum dce_environment dce_environment;
-
-	if (!as) {
-		BREAK_TO_DEBUGGER();
-		return NULL;
-	}
-
-	dce_version = dal_adapter_service_get_dce_version(as);
-	dce_environment = ctx->dce_environment;
-
-	if (IS_FPGA_MAXIMUS_DC(dce_environment)) {
-		return dal_i2caux_diag_fpga_create(as, ctx);
+	if (IS_FPGA_MAXIMUS_DC(ctx->dce_environment)) {
+		return dal_i2caux_diag_fpga_create(ctx);
 	}
 
-	switch (dce_version) {
+	switch (ctx->dce_version) {
 	case DCE_VERSION_8_0:
-		return dal_i2caux_dce80_create(as, ctx);
+		return dal_i2caux_dce80_create(ctx);
 	case DCE_VERSION_11_2:
-		return dal_i2caux_dce112_create(as, ctx);
+		return dal_i2caux_dce112_create(ctx);
 	case DCE_VERSION_11_0:
-		return dal_i2caux_dce110_create(as, ctx);
+		return dal_i2caux_dce110_create(ctx);
 	case DCE_VERSION_10_0:
-		return dal_i2caux_dce100_create(as, ctx);
+		return dal_i2caux_dce100_create(ctx);
 	default:
 		BREAK_TO_DEBUGGER();
 		return NULL;
@@ -313,11 +301,11 @@ void dal_i2caux_destroy(
  */
 
 uint32_t dal_i2caux_get_reference_clock(
-	struct adapter_service *as)
+		struct dc_bios *bios)
 {
 	struct firmware_info info = { { 0 } };
 
-	if (!dal_adapter_service_get_firmware_info(as, &info))
+	if (bios->funcs->get_firmware_info(bios, &info) != BP_RESULT_OK)
 		return 0;
 
 	return info.pll_info.crystal_frequency;
@@ -413,7 +401,6 @@ void dal_i2caux_release_engine(
 
 bool dal_i2caux_construct(
 	struct i2caux *i2caux,
-	struct adapter_service *as,
 	struct dc_context *ctx)
 {
 	uint32_t i = 0;
diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.h b/drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.h
index 76f5b637ec3f..bc20de3da1c4 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.h
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.h
@@ -27,7 +27,7 @@
 #define __DAL_I2C_AUX_H__
 
 uint32_t dal_i2caux_get_reference_clock(
-	struct adapter_service *as);
+	struct dc_bios *bios);
 
 struct i2caux;
 
@@ -99,7 +99,6 @@ struct i2caux {
 
 bool dal_i2caux_construct(
 	struct i2caux *i2caux,
-	struct adapter_service *as,
 	struct dc_context *ctx);
 
 void dal_i2caux_release_engine(
diff --git a/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h b/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h
index ef45693925d6..9de495532eb1 100644
--- a/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h
+++ b/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h
@@ -76,7 +76,6 @@ enum adapter_feature_id {
 	FEATURE_MAXIMIZE_URGENCY_WATERMARKS,
 	FEATURE_MAXIMIZE_STUTTER_MARKS,
 	FEATURE_MAXIMIZE_NBP_MARKS,
-	FEATURE_RESTORE_USAGE_I2C_SW_ENGINE,
 	FEATURE_USE_MAX_DISPLAY_CLK,
 	FEATURE_ALLOW_EDP_RESOURCE_SHARING,
 	FEATURE_SUPPORT_DP_YUV,
@@ -337,11 +336,6 @@ void dal_adapter_service_destroy(
 enum dce_version dal_adapter_service_get_dce_version(
 	const struct adapter_service *as);
 
-/* Get firmware information from BIOS */
-bool dal_adapter_service_get_firmware_info(
-	struct adapter_service *as,
-	struct firmware_info *info);
-
 /* Get number of spread spectrum entries from BIOS */
 uint32_t dal_adapter_service_get_ss_info_num(
 	struct adapter_service *as,
diff --git a/drivers/gpu/drm/amd/dal/include/i2caux_interface.h b/drivers/gpu/drm/amd/dal/include/i2caux_interface.h
index ecbf84908b0b..a78576a38b36 100644
--- a/drivers/gpu/drm/amd/dal/include/i2caux_interface.h
+++ b/drivers/gpu/drm/amd/dal/include/i2caux_interface.h
@@ -67,7 +67,6 @@ union aux_config {
 struct i2caux;
 
 struct i2caux *dal_i2caux_create(
-	struct adapter_service *as,
 	struct dc_context *ctx);
 
 bool dal_i2caux_submit_i2c_command(
-- 
2.10.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux