return result;
}
-bool dal_aux_engine_construct(
+void dal_aux_engine_construct(
struct aux_engine *engine,
struct dc_context *ctx)
{
- if (!dal_i2caux_construct_engine(&engine->base, ctx))
- return false;
+ dal_i2caux_construct_engine(&engine->base, ctx);
engine->delay = 0;
engine->max_defer_write_retry = 0;
- return true;
}
void dal_aux_engine_destruct(
bool acquire_reset;
};
-bool dal_aux_engine_construct(
+void dal_aux_engine_construct(
struct aux_engine *engine,
struct dc_context *ctx);
return NULL;
}
- if (dal_i2caux_dce110_construct(
- i2caux_dce110,
- ctx,
- dce100_aux_regs,
- dce100_hw_engine_regs,
- &i2c_shift,
- &i2c_mask))
- return &i2caux_dce110->base;
-
- ASSERT_CRITICAL(false);
-
- kfree(i2caux_dce110);
-
- return NULL;
+ dal_i2caux_dce110_construct(i2caux_dce110,
+ ctx,
+ dce100_aux_regs,
+ dce100_hw_engine_regs,
+ &i2c_shift,
+ &i2c_mask);
+ return &i2caux_dce110->base;
}
.acquire = dal_aux_engine_acquire,
};
-static bool construct(
+static void construct(
struct aux_engine_dce110 *engine,
const struct aux_engine_dce110_init_data *aux_init_data)
{
- if (!dal_aux_engine_construct(
- &engine->base, aux_init_data->ctx)) {
- ASSERT_CRITICAL(false);
- return false;
- }
+ dal_aux_engine_construct(&engine->base, aux_init_data->ctx);
engine->base.base.funcs = &engine_funcs;
engine->base.funcs = &aux_engine_funcs;
engine->timeout_period = aux_init_data->timeout_period;
engine->regs = aux_init_data->regs;
-
- return true;
}
static void destruct(
return NULL;
}
- if (construct(engine, aux_init_data))
- return &engine->base;
-
- ASSERT_CRITICAL(false);
-
- kfree(engine);
-
- return NULL;
+ construct(engine, aux_init_data);
+ return &engine->base;
}
.wait_on_operation_result = dal_i2c_hw_engine_wait_on_operation_result,
};
-bool i2c_hw_engine_dce110_construct(
+static void construct(
struct i2c_hw_engine_dce110 *hw_engine,
const struct i2c_hw_engine_dce110_create_arg *arg)
{
uint32_t xtal_ref_div = 0;
- if (!arg->reference_frequency)
- return false;
-
- if (!dal_i2c_hw_engine_construct(&hw_engine->base, arg->ctx))
- return false;
+ dal_i2c_hw_engine_construct(&hw_engine->base, arg->ctx);
hw_engine->base.base.base.funcs = &engine_funcs;
hw_engine->base.base.funcs = &i2c_engine_funcs;
*/
hw_engine->reference_frequency =
(arg->reference_frequency * 2) / xtal_ref_div;
-
- return true;
}
struct i2c_engine *dal_i2c_hw_engine_dce110_create(
ASSERT_CRITICAL(false);
return NULL;
}
+ if (!arg->reference_frequency) {
+ ASSERT_CRITICAL(false);
+ return NULL;
+ }
engine_dce10 = kzalloc(sizeof(struct i2c_hw_engine_dce110),
GFP_KERNEL);
return NULL;
}
- if (i2c_hw_engine_dce110_construct(engine_dce10, arg))
- return &engine_dce10->base.base;
-
- ASSERT_CRITICAL(false);
-
- kfree(engine_dce10);
-
- return NULL;
+ construct(engine_dce10, arg);
+ return &engine_dce10->base.base;
}
struct i2c_engine *dal_i2c_hw_engine_dce110_create(
const struct i2c_hw_engine_dce110_create_arg *arg);
-bool i2c_hw_engine_dce110_construct(
- struct i2c_hw_engine_dce110 *engine_dce110,
- const struct i2c_hw_engine_dce110_create_arg *arg);
-
#endif
.submit_request = dal_i2c_sw_engine_submit_request,
};
-static bool construct(
+static void construct(
struct i2c_sw_engine_dce110 *engine_dce110,
const struct i2c_sw_engine_dce110_create_arg *arg_dce110)
{
arg_base.ctx = arg_dce110->ctx;
arg_base.default_speed = arg_dce110->default_speed;
- if (!dal_i2c_sw_engine_construct(
- &engine_dce110->base, &arg_base)) {
- ASSERT_CRITICAL(false);
- return false;
- }
+ dal_i2c_sw_engine_construct(&engine_dce110->base, &arg_base);
/*struct engine struct engine_funcs*/
engine_dce110->base.base.base.funcs = &engine_funcs;
engine_dce110->base.base.funcs = &i2c_engine_funcs;
engine_dce110->base.default_speed = arg_dce110->default_speed;
engine_dce110->engine_id = arg_dce110->engine_id;
-
- return true;
}
struct i2c_engine *dal_i2c_sw_engine_dce110_create(
return NULL;
}
- if (construct(engine_dce110, arg))
- return &engine_dce110->base.base;
-
- ASSERT_CRITICAL(false);
-
- kfree(engine_dce110);
-
- return NULL;
+ construct(engine_dce110, arg);
+ return &engine_dce110->base.base;
}
I2C_COMMON_MASK_SH_LIST_DCE110(_MASK)
};
-bool dal_i2caux_dce110_construct(
+void dal_i2caux_dce110_construct(
struct i2caux_dce110 *i2caux_dce110,
struct dc_context *ctx,
const struct dce110_aux_registers aux_regs[],
base = &i2caux_dce110->base;
- if (!dal_i2caux_construct(base, ctx)) {
- ASSERT_CRITICAL(false);
- return false;
- }
+ dal_i2caux_construct(base, ctx);
i2caux_dce110->base.funcs = &i2caux_funcs;
i2caux_dce110->i2c_hw_buffer_in_use = false;
} while (i < ARRAY_SIZE(hw_aux_lines));
/*TODO Generic I2C SW and HW*/
-
- return true;
}
/*
return NULL;
}
- if (dal_i2caux_dce110_construct(
- i2caux_dce110,
- ctx,
- dce110_aux_regs,
- i2c_hw_engine_regs,
- &i2c_shift,
- &i2c_mask))
- return &i2caux_dce110->base;
-
- ASSERT_CRITICAL(false);
-
- kfree(i2caux_dce110);
-
- return NULL;
+ dal_i2caux_dce110_construct(i2caux_dce110,
+ ctx,
+ dce110_aux_regs,
+ i2c_hw_engine_regs,
+ &i2c_shift,
+ &i2c_mask);
+ return &i2caux_dce110->base;
}
struct i2caux *dal_i2caux_dce110_create(
struct dc_context *ctx);
-bool dal_i2caux_dce110_construct(
+void dal_i2caux_dce110_construct(
struct i2caux_dce110 *i2caux_dce110,
struct dc_context *ctx,
const struct dce110_aux_registers *aux_regs,
I2C_COMMON_MASK_SH_LIST_DCE110(_MASK)
};
-static bool construct(
+static void construct(
struct i2caux_dce110 *i2caux_dce110,
struct dc_context *ctx)
{
- if (!dal_i2caux_dce110_construct(
- i2caux_dce110,
- ctx,
- dce112_aux_regs,
- dce112_hw_engine_regs,
- &i2c_shift,
- &i2c_mask)) {
- ASSERT_CRITICAL(false);
- return false;
- }
-
- return true;
+ dal_i2caux_dce110_construct(i2caux_dce110,
+ ctx,
+ dce112_aux_regs,
+ dce112_hw_engine_regs,
+ &i2c_shift,
+ &i2c_mask);
}
/*
return NULL;
}
- if (construct(i2caux_dce110, ctx))
- return &i2caux_dce110->base;
-
- ASSERT_CRITICAL(false);
-
- kfree(i2caux_dce110);
-
- return NULL;
+ construct(i2caux_dce110, ctx);
+ return &i2caux_dce110->base;
}
return NULL;
}
- if (dal_i2caux_dce110_construct(
- i2caux_dce110,
- ctx,
- dce120_aux_regs,
- dce120_hw_engine_regs,
- &i2c_shift,
- &i2c_mask))
- return &i2caux_dce110->base;
-
- ASSERT_CRITICAL(false);
-
- kfree(i2caux_dce110);
-
- return NULL;
+ dal_i2caux_dce110_construct(i2caux_dce110,
+ ctx,
+ dce120_aux_regs,
+ dce120_hw_engine_regs,
+ &i2c_shift,
+ &i2c_mask);
+ return &i2caux_dce110->base;
}
dal_i2c_hw_engine_wait_on_operation_result,
};
-static bool construct(
+static void construct(
struct i2c_hw_engine_dce80 *engine,
const struct i2c_hw_engine_dce80_create_arg *arg)
{
- if (arg->engine_id >= sizeof(ddc_setup_offset) / sizeof(int32_t))
- return false;
- if (arg->engine_id >= sizeof(ddc_speed_offset) / sizeof(int32_t))
- return false;
-
- if (!arg->reference_frequency)
- return false;
-
- if (!dal_i2c_hw_engine_construct(&engine->base, arg->ctx))
- return false;
+ dal_i2c_hw_engine_construct(&engine->base, arg->ctx);
engine->base.base.base.funcs = &engine_funcs;
engine->base.base.funcs = &i2c_engine_funcs;
engine->buffer_used_bytes = 0;
engine->transaction_count = 0;
engine->engine_keep_power_up_count = 1;
-
- return true;
}
struct i2c_engine *dal_i2c_hw_engine_dce80_create(
return NULL;
}
+ if ((arg->engine_id >= sizeof(ddc_setup_offset) / sizeof(int32_t)) ||
+ (arg->engine_id >= sizeof(ddc_speed_offset) / sizeof(int32_t)) ||
+ !arg->reference_frequency) {
+ BREAK_TO_DEBUGGER();
+ return NULL;
+ }
+
engine = kzalloc(sizeof(struct i2c_hw_engine_dce80), GFP_KERNEL);
if (!engine) {
return NULL;
}
- if (construct(engine, arg))
- return &engine->base.base;
-
- BREAK_TO_DEBUGGER();
-
- kfree(engine);
-
- return NULL;
+ construct(engine, arg);
+ return &engine->base.base;
}
.submit_request = dal_i2c_sw_engine_submit_request,
};
-static bool construct(
+static void construct(
struct i2c_sw_engine_dce80 *engine,
const struct i2c_sw_engine_dce80_create_arg *arg)
{
arg_base.ctx = arg->ctx;
arg_base.default_speed = arg->default_speed;
- if (!dal_i2c_sw_engine_construct(&engine->base, &arg_base)) {
- BREAK_TO_DEBUGGER();
- return false;
- }
+ dal_i2c_sw_engine_construct(&engine->base, &arg_base);
engine->base.base.base.funcs = &engine_funcs;
engine->base.base.funcs = &i2c_engine_funcs;
engine->base.default_speed = arg->default_speed;
engine->engine_id = arg->engine_id;
-
- return true;
}
struct i2c_engine *dal_i2c_sw_engine_dce80_create(
return NULL;
}
- if (construct(engine, arg))
- return &engine->base.base;
-
- BREAK_TO_DEBUGGER();
-
- kfree(engine);
-
- return NULL;
+ construct(engine, arg);
+ return &engine->base.base;
}
.acquire_aux_engine = dal_i2caux_acquire_aux_engine,
};
-static bool construct(
+static void construct(
struct i2caux_dce80 *i2caux_dce80,
struct dc_context *ctx)
{
uint32_t i;
- if (!dal_i2caux_construct(base, ctx)) {
- BREAK_TO_DEBUGGER();
- return false;
- }
+ dal_i2caux_construct(base, ctx);
i2caux_dce80->base.funcs = &i2caux_funcs;
i2caux_dce80->i2c_hw_buffer_in_use = false;
} while (i < ARRAY_SIZE(hw_aux_lines));
/* TODO Generic I2C SW and HW */
-
- return true;
}
struct i2caux *dal_i2caux_dce80_create(
return NULL;
}
- if (construct(i2caux_dce80, ctx))
- return &i2caux_dce80->base;
-
- BREAK_TO_DEBUGGER();
-
- kfree(i2caux_dce80);
-
- return NULL;
+ construct(i2caux_dce80, ctx);
+ return &i2caux_dce80->base;
}
return NULL;
}
- if (dal_i2caux_dce110_construct(
- i2caux_dce110,
- ctx,
- dcn10_aux_regs,
- dcn10_hw_engine_regs,
- &i2c_shift,
- &i2c_mask))
- return &i2caux_dce110->base;
-
- ASSERT_CRITICAL(false);
-
- kfree(i2caux_dce110);
-
- return NULL;
+ dal_i2caux_dce110_construct(i2caux_dce110,
+ ctx,
+ dcn10_aux_regs,
+ dcn10_hw_engine_regs,
+ &i2c_shift,
+ &i2c_mask);
+ return &i2caux_dce110->base;
}
.acquire_aux_engine = NULL,
};
-static bool construct(
+static void construct(
struct i2caux *i2caux,
struct dc_context *ctx)
{
- if (!dal_i2caux_construct(i2caux, ctx)) {
- ASSERT_CRITICAL(false);
- return false;
- }
-
+ dal_i2caux_construct(i2caux, ctx);
i2caux->funcs = &i2caux_funcs;
-
- return true;
}
struct i2caux *dal_i2caux_diag_fpga_create(
return NULL;
}
- if (construct(i2caux, ctx))
- return i2caux;
-
- ASSERT_CRITICAL(false);
-
- kfree(i2caux);
-
- return NULL;
+ construct(i2caux, ctx);
+ return i2caux;
}
struct dc_context *ctx;
};
-bool dal_i2caux_construct_engine(
+void dal_i2caux_construct_engine(
struct engine *engine,
struct dc_context *ctx);
#include "engine.h"
-bool dal_i2caux_construct_engine(
+void dal_i2caux_construct_engine(
struct engine *engine,
struct dc_context *ctx)
{
engine->ddc = NULL;
engine->ctx = ctx;
- return true;
}
void dal_i2caux_destruct_engine(
}
-bool dal_i2c_engine_construct(
+void dal_i2c_engine_construct(
struct i2c_engine *engine,
struct dc_context *ctx)
{
- if (!dal_i2caux_construct_engine(&engine->base, ctx))
- return false;
-
+ dal_i2caux_construct_engine(&engine->base, ctx);
engine->timeout_delay = 0;
- return true;
}
void dal_i2c_engine_destruct(
uint32_t timeout_delay;
};
-bool dal_i2c_engine_construct(
+void dal_i2c_engine_construct(
struct i2c_engine *engine,
struct dc_context *ctx);
(1 + (length << 3) + 1);
}
-bool dal_i2c_generic_hw_engine_construct(
+void dal_i2c_generic_hw_engine_construct(
struct i2c_generic_hw_engine *engine,
struct dc_context *ctx)
{
- if (!dal_i2c_hw_engine_construct(&engine->base, ctx))
- return false;
- return true;
+ dal_i2c_hw_engine_construct(&engine->base, ctx);
}
void dal_i2c_generic_hw_engine_destruct(
const struct i2c_generic_hw_engine_funcs *funcs;
};
-bool dal_i2c_generic_hw_engine_construct(
+void dal_i2c_generic_hw_engine_construct(
struct i2c_generic_hw_engine *engine,
struct dc_context *ctx);
return result;
}
-bool dal_i2c_hw_engine_construct(
+void dal_i2c_hw_engine_construct(
struct i2c_hw_engine *engine,
struct dc_context *ctx)
{
- if (!dal_i2c_engine_construct(&engine->base, ctx))
- return false;
+ dal_i2c_engine_construct(&engine->base, ctx);
engine->original_speed = I2CAUX_DEFAULT_I2C_HW_SPEED;
engine->default_speed = I2CAUX_DEFAULT_I2C_HW_SPEED;
- return true;
}
void dal_i2c_hw_engine_destruct(
uint32_t default_speed;
};
-bool dal_i2c_hw_engine_construct(
+void dal_i2c_hw_engine_construct(
struct i2c_hw_engine *engine,
struct dc_context *ctx);
.submit_request = dal_i2c_sw_engine_submit_request,
};
-bool dal_i2c_sw_engine_construct(
+void dal_i2c_sw_engine_construct(
struct i2c_sw_engine *engine,
const struct i2c_sw_engine_create_arg *arg)
{
- if (!dal_i2c_engine_construct(&engine->base, arg->ctx))
- return false;
-
+ dal_i2c_engine_construct(&engine->base, arg->ctx);
dal_i2c_sw_engine_set_speed(&engine->base, arg->default_speed);
engine->base.funcs = &i2c_engine_funcs;
engine->base.base.funcs = &engine_funcs;
- return true;
}
struct i2c_engine *dal_i2c_sw_engine_create(
return NULL;
}
- if (dal_i2c_sw_engine_construct(engine, arg))
- return &engine->base;
-
- BREAK_TO_DEBUGGER();
-
- kfree(engine);
-
- return NULL;
+ dal_i2c_sw_engine_construct(engine, arg);
+ return &engine->base;
}
struct dc_context *ctx;
};
-bool dal_i2c_sw_engine_construct(
+void dal_i2c_sw_engine_construct(
struct i2c_sw_engine *engine,
const struct i2c_sw_engine_create_arg *arg);
engine->ddc = NULL;
}
-bool dal_i2caux_construct(
+void dal_i2caux_construct(
struct i2caux *i2caux,
struct dc_context *ctx)
{
i2caux->default_i2c_hw_speed = DEFAULT_I2C_HW_SPEED;
i2caux->default_i2c_sw_speed = DEFAULT_I2C_SW_SPEED;
}
-
- return true;
}
void dal_i2caux_destruct(
uint32_t default_i2c_hw_speed;
};
-bool dal_i2caux_construct(
+void dal_i2caux_construct(
struct i2caux *i2caux,
struct dc_context *ctx);