aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_device.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index d1cdda9b5586..88c19070247f 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -443,20 +443,24 @@ static uint32_t cail_reg_read(struct card_info *info, uint32_t reg)
443 return r; 443 return r;
444} 444}
445 445
446static struct card_info atom_card_info = {
447 .dev = NULL,
448 .reg_read = cail_reg_read,
449 .reg_write = cail_reg_write,
450 .mc_read = cail_mc_read,
451 .mc_write = cail_mc_write,
452 .pll_read = cail_pll_read,
453 .pll_write = cail_pll_write,
454};
455
456int radeon_atombios_init(struct radeon_device *rdev) 446int radeon_atombios_init(struct radeon_device *rdev)
457{ 447{
458 atom_card_info.dev = rdev->ddev; 448 struct card_info *atom_card_info =
459 rdev->mode_info.atom_context = atom_parse(&atom_card_info, rdev->bios); 449 kzalloc(sizeof(struct card_info), GFP_KERNEL);
450
451 if (!atom_card_info)
452 return -ENOMEM;
453
454 rdev->mode_info.atom_card_info = atom_card_info;
455 atom_card_info->dev = rdev->ddev;
456 atom_card_info->reg_read = cail_reg_read;
457 atom_card_info->reg_write = cail_reg_write;
458 atom_card_info->mc_read = cail_mc_read;
459 atom_card_info->mc_write = cail_mc_write;
460 atom_card_info->pll_read = cail_pll_read;
461 atom_card_info->pll_write = cail_pll_write;
462
463 rdev->mode_info.atom_context = atom_parse(atom_card_info, rdev->bios);
460 radeon_atom_initialize_bios_scratch_regs(rdev->ddev); 464 radeon_atom_initialize_bios_scratch_regs(rdev->ddev);
461 return 0; 465 return 0;
462} 466}
@@ -464,6 +468,7 @@ int radeon_atombios_init(struct radeon_device *rdev)
464void radeon_atombios_fini(struct radeon_device *rdev) 468void radeon_atombios_fini(struct radeon_device *rdev)
465{ 469{
466 kfree(rdev->mode_info.atom_context); 470 kfree(rdev->mode_info.atom_context);
471 kfree(rdev->mode_info.atom_card_info);
467} 472}
468 473
469int radeon_combios_init(struct radeon_device *rdev) 474int radeon_combios_init(struct radeon_device *rdev)