diff options
author | Bo-Chen Chen <rex-bc.chen@mediatek.com> | 2022-09-01 06:41:45 +0200 |
---|---|---|
committer | Dmitry Osipenko <dmitry.osipenko@collabora.com> | 2022-09-04 14:32:17 +0200 |
commit | 16075ed148833d7c4feb13bb295bbcb87a7f321e (patch) | |
tree | a32f9db30fc725e470659d917136ca446e92ceb0 /drivers/gpu/drm/mediatek/mtk_dp.c | |
parent | drm/mediatek: dp: Add multiple smc commands support (diff) | |
download | linux-16075ed148833d7c4feb13bb295bbcb87a7f321e.tar.xz linux-16075ed148833d7c4feb13bb295bbcb87a7f321e.zip |
drm/mediatek: dp: Add multiple calibration data formats support
The calibration data formats of eDP and DP are different. We add
"const struct mtk_dp_efuse_fmt *efuse_fmt" to the device data to
define them.
Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220901044149.16782-7-rex-bc.chen@mediatek.com
Diffstat (limited to '')
-rw-r--r-- | drivers/gpu/drm/mediatek/mtk_dp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index 971bd744cdb2..136e13150281 100644 --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -113,8 +113,10 @@ struct mtk_dp { struct mtk_dp_data { int bridge_type; unsigned int smc_cmd; + const struct mtk_dp_efuse_fmt *efuse_fmt; }; -static const struct mtk_dp_efuse_fmt mtk_dp_efuse_data[MTK_DP_CAL_MAX] = { + +static const struct mtk_dp_efuse_fmt mt8195_edp_efuse_fmt[MTK_DP_CAL_MAX] = { [MTK_DP_CAL_GLB_BIAS_TRIM] = { .idx = 3, .shift = 27, @@ -811,7 +813,7 @@ static void mtk_dp_get_calibration_data(struct mtk_dp *mtk_dp) } for (i = 0; i < MTK_DP_CAL_MAX; i++) { - fmt = &mtk_dp_efuse_data[i]; + fmt = &mtk_dp->data->efuse_fmt[i]; cal_data[i] = (buf[fmt->idx] >> fmt->shift) & fmt->mask; if (cal_data[i] < fmt->min_val || cal_data[i] > fmt->max_val) { @@ -827,7 +829,7 @@ static void mtk_dp_get_calibration_data(struct mtk_dp *mtk_dp) use_default_val: dev_warn(mtk_dp->dev, "Use default calibration data\n"); for (i = 0; i < MTK_DP_CAL_MAX; i++) - cal_data[i] = mtk_dp_efuse_data[i].default_val; + cal_data[i] = mtk_dp->data->efuse_fmt[i].default_val; } static void mtk_dp_set_calibration_data(struct mtk_dp *mtk_dp) @@ -1983,6 +1985,7 @@ static SIMPLE_DEV_PM_OPS(mtk_dp_pm_ops, mtk_dp_suspend, mtk_dp_resume); static const struct mtk_dp_data mt8195_edp_data = { .bridge_type = DRM_MODE_CONNECTOR_eDP, .smc_cmd = MTK_DP_SIP_ATF_EDP_VIDEO_UNMUTE, + .efuse_fmt = mt8195_edp_efuse_fmt, }; static const struct of_device_id mtk_dp_of_match[] = { |