mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
drm/rockchip: analogix_dp: Expand device data to support multiple edp display
There are two main modifications: one is expanding struct rockchip_dp_chip_data to an array, and the other is adding &rockchip_dp_chip_data.reg to separate different edp devices. Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20250224081325.96724-3-damon.ding@rock-chips.com
This commit is contained in:
committed by
Heiko Stuebner
parent
2bf9f61049
commit
718b3bb9c0
@@ -52,10 +52,12 @@ struct rockchip_grf_reg_field {
|
||||
* struct rockchip_dp_chip_data - splite the grf setting of kind of chips
|
||||
* @lcdc_sel: grf register field of lcdc_sel
|
||||
* @chip_type: specific chip type
|
||||
* @reg: register base address
|
||||
*/
|
||||
struct rockchip_dp_chip_data {
|
||||
const struct rockchip_grf_reg_field lcdc_sel;
|
||||
u32 chip_type;
|
||||
u32 reg;
|
||||
};
|
||||
|
||||
struct rockchip_dp_device {
|
||||
@@ -396,6 +398,8 @@ static int rockchip_dp_probe(struct platform_device *pdev)
|
||||
const struct rockchip_dp_chip_data *dp_data;
|
||||
struct drm_panel *panel = NULL;
|
||||
struct rockchip_dp_device *dp;
|
||||
struct resource *res;
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
dp_data = of_device_get_match_data(dev);
|
||||
@@ -410,9 +414,24 @@ static int rockchip_dp_probe(struct platform_device *pdev)
|
||||
if (!dp)
|
||||
return -ENOMEM;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
|
||||
i = 0;
|
||||
while (dp_data[i].reg) {
|
||||
if (dp_data[i].reg == res->start) {
|
||||
dp->data = &dp_data[i];
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
if (!dp->data)
|
||||
return dev_err_probe(dev, -EINVAL, "no chip-data for %s node\n",
|
||||
dev->of_node->name);
|
||||
|
||||
dp->dev = dev;
|
||||
dp->adp = ERR_PTR(-ENODEV);
|
||||
dp->data = dp_data;
|
||||
dp->plat_data.panel = panel;
|
||||
dp->plat_data.dev_type = dp->data->chip_type;
|
||||
dp->plat_data.power_on = rockchip_dp_poweron;
|
||||
@@ -464,14 +483,22 @@ static int rockchip_dp_resume(struct device *dev)
|
||||
static DEFINE_RUNTIME_DEV_PM_OPS(rockchip_dp_pm_ops, rockchip_dp_suspend,
|
||||
rockchip_dp_resume, NULL);
|
||||
|
||||
static const struct rockchip_dp_chip_data rk3399_edp = {
|
||||
.lcdc_sel = GRF_REG_FIELD(0x6250, 5, 5),
|
||||
.chip_type = RK3399_EDP,
|
||||
static const struct rockchip_dp_chip_data rk3399_edp[] = {
|
||||
{
|
||||
.lcdc_sel = GRF_REG_FIELD(0x6250, 5, 5),
|
||||
.chip_type = RK3399_EDP,
|
||||
.reg = 0xff970000,
|
||||
},
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
static const struct rockchip_dp_chip_data rk3288_dp = {
|
||||
.lcdc_sel = GRF_REG_FIELD(0x025c, 5, 5),
|
||||
.chip_type = RK3288_DP,
|
||||
static const struct rockchip_dp_chip_data rk3288_dp[] = {
|
||||
{
|
||||
.lcdc_sel = GRF_REG_FIELD(0x025c, 5, 5),
|
||||
.chip_type = RK3288_DP,
|
||||
.reg = 0xff970000,
|
||||
},
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
static const struct of_device_id rockchip_dp_dt_ids[] = {
|
||||
|
||||
Reference in New Issue
Block a user