]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/radeon/kms: enable HDMI audio on RS600/RS690/RS740
authorRafał Miłecki <zajec5@gmail.com>
Sat, 19 Jun 2010 10:24:57 +0000 (12:24 +0200)
committerDave Airlie <airlied@redhat.com>
Mon, 2 Aug 2010 00:00:06 +0000 (10:00 +1000)
We will need method of selecting encoder that should receive HDMI block. For
now we assign HDMI block to first enabled encoder. Hopefully there are not many
RS6x0 chips with two digital encoders.

[airlied: add RS740 checks as per Alex suggestion.]

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/r600_hdmi.c
drivers/gpu/drm/radeon/rs600.c
drivers/gpu/drm/radeon/rs690.c

index 26b4bc9d89a574d048dfcfc190e5c11b2de341ee..e6a58ed48dcf255d70189306551d4bddc91db22e 100644 (file)
@@ -435,7 +435,8 @@ static int r600_hdmi_find_free_block(struct drm_device *dev)
                }
        }
 
-       if (rdev->family == CHIP_RS600 || rdev->family == CHIP_RS690) {
+       if (rdev->family == CHIP_RS600 || rdev->family == CHIP_RS690 ||
+           rdev->family == CHIP_RS740) {
                return free_blocks[0] ? R600_HDMI_BLOCK1 : 0;
        } else if (rdev->family >= CHIP_R600) {
                if (free_blocks[0])
@@ -466,7 +467,8 @@ static void r600_hdmi_assign_block(struct drm_encoder *encoder)
                if (ASIC_IS_DCE32(rdev))
                        radeon_encoder->hdmi_config_offset = dig->dig_encoder ?
                                R600_HDMI_CONFIG2 : R600_HDMI_CONFIG1;
-       } else if (rdev->family >= CHIP_R600) {
+       } else if (rdev->family >= CHIP_R600 || rdev->family == CHIP_RS600 ||
+                  rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) {
                radeon_encoder->hdmi_offset = r600_hdmi_find_free_block(dev);
        }
 }
index 5ce3ccc7a42378ccecb3601d6d6b5e337f850676..27d2e706c650258a3c3aeec76dde828ea500b7d0 100644 (file)
@@ -812,6 +812,13 @@ static int rs600_startup(struct radeon_device *rdev)
                dev_err(rdev->dev, "failled initializing IB (%d).\n", r);
                return r;
        }
+
+       r = r600_audio_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "failed initializing audio\n");
+               return r;
+       }
+
        return 0;
 }
 
@@ -838,6 +845,7 @@ int rs600_resume(struct radeon_device *rdev)
 
 int rs600_suspend(struct radeon_device *rdev)
 {
+       r600_audio_fini(rdev);
        r100_cp_disable(rdev);
        r100_wb_disable(rdev);
        rs600_irq_disable(rdev);
@@ -847,6 +855,7 @@ int rs600_suspend(struct radeon_device *rdev)
 
 void rs600_fini(struct radeon_device *rdev)
 {
+       r600_audio_fini(rdev);
        r100_cp_fini(rdev);
        r100_wb_fini(rdev);
        r100_ib_fini(rdev);
index 5fea094ed8cb08fd223793b77e5298b6c8b87d0f..23676b659e65488260679c8375d8042d8f38e19e 100644 (file)
@@ -640,6 +640,13 @@ static int rs690_startup(struct radeon_device *rdev)
                dev_err(rdev->dev, "failled initializing IB (%d).\n", r);
                return r;
        }
+
+       r = r600_audio_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "failed initializing audio\n");
+               return r;
+       }
+
        return 0;
 }
 
@@ -666,6 +673,7 @@ int rs690_resume(struct radeon_device *rdev)
 
 int rs690_suspend(struct radeon_device *rdev)
 {
+       r600_audio_fini(rdev);
        r100_cp_disable(rdev);
        r100_wb_disable(rdev);
        rs600_irq_disable(rdev);
@@ -675,6 +683,7 @@ int rs690_suspend(struct radeon_device *rdev)
 
 void rs690_fini(struct radeon_device *rdev)
 {
+       r600_audio_fini(rdev);
        r100_cp_fini(rdev);
        r100_wb_fini(rdev);
        r100_ib_fini(rdev);