drm/exynos5: hdmi-audio plf device is registered
authorRahul Sharma <rahul.sharma@samsung.com>
Fri, 24 Aug 2012 20:54:56 +0000 (02:24 +0530)
committerGerrit <chrome-bot@google.com>
Fri, 14 Sep 2012 21:46:06 +0000 (14:46 -0700)
For exynos5, hdmi-audio is registered as a platform device. hdmi-audio
driver is registerd from /sound/soc/samsung. This helps in configuring
the hdmi-audio though ALSA framework.

BUG=none
TEST=verified various audio files using aplay
application.

Change-Id: I19f563dec7ca5035e111f8bdbc18dd3bce0eeec0
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/31363
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>

drivers/gpu/drm/exynos/exynos_hdmi.c

index 2b20b25..444cf09 100644 (file)
@@ -1996,6 +1996,8 @@ void hdmi_attach_hdmiphy_client(struct i2c_client *hdmiphy)
                hdmi_hdmiphy = hdmiphy;
 }
 
+struct platform_device *hdmi_audio_device;
+
 static int __devinit hdmi_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
@@ -2067,6 +2069,31 @@ static int __devinit hdmi_probe(struct platform_device *pdev)
                goto err_req_region;
        }
 
+       if (of_device_is_compatible(dev->of_node,
+               "samsung,exynos5-hdmi")) {
+
+               hdmi_audio_device =
+                       platform_device_alloc("exynos-hdmi-audio", -1);
+
+               if (!hdmi_audio_device) {
+                       ret = -ENOMEM;
+                       goto err_iomap;
+               }
+
+               ret = platform_device_add_resources(hdmi_audio_device, res, 1);
+               if (ret) {
+                       ret = -ENOMEM;
+                       goto err_iomap;
+               }
+
+               hdmi_audio_device->dev.of_node =
+                       of_get_next_child(dev->of_node, NULL);
+
+               ret = platform_device_add(hdmi_audio_device);
+               if (ret)
+                       platform_device_put(hdmi_audio_device);
+       }
+
        /* DDC i2c driver */
        if (i2c_add_driver(&ddc_driver)) {
                DRM_ERROR("failed to register ddc i2c driver\n");