}
out:
mutex_unlock(&dp->lock);
- if (!ret)
+ if (!ret) {
+#ifdef CONFIG_SWITCH
+ switch_set_state(&dp->switchdev, 1);
+#else
hdmi_event_connect(dp->dev);
+#endif
+ }
}
static void cdn_dp_encoder_disable(struct drm_encoder *encoder)
}
}
mutex_unlock(&dp->lock);
+#ifdef CONFIG_SWITCH
+ switch_set_state(&dp->switchdev, 0);
+#else
hdmi_event_disconnect(dp->dev);
+#endif
/*
* In the following 2 cases, we need to run the event_work to re-enable
drm_connector_helper_add(connector, &cdn_dp_connector_helper_funcs);
+#ifdef CONFIG_SWITCH
+ dp->switchdev.name = "hdmi";
+ switch_dev_register(&dp->switchdev);
+#endif
+
ret = drm_mode_connector_attach_encoder(connector, encoder);
if (ret) {
DRM_ERROR("failed to attach connector and encoder\n");
struct drm_encoder *encoder = &dp->encoder;
struct drm_connector *connector = &dp->connector;
+#ifdef CONFIG_SWITCH
+ switch_dev_unregister(&dp->switchdev);
+#endif
+
cancel_work_sync(&dp->event_work);
platform_device_unregister(dp->audio_pdev);
cdn_dp_encoder_disable(encoder);
#include <drm/drm_crtc_helper.h>
#include <drm/drm_dp_helper.h>
#include <drm/drm_panel.h>
+#ifdef CONFIG_SWITCH
+#include <linux/switch.h>
+#endif
#include "rockchip_drm_drv.h"
#define MAX_PHY 2
u8 dpcd[DP_RECEIVER_CAP_SIZE];
bool sink_has_audio;
+#ifdef CONFIG_SWITCH
+ struct switch_dev switchdev;
+#endif
};
#endif /* _CDN_DP_CORE_H */