.. | .. |
---|
24 | 24 | * Li Peng <peng.li@intel.com> |
---|
25 | 25 | */ |
---|
26 | 26 | |
---|
27 | | -#include <drm/drmP.h> |
---|
| 27 | +#include <linux/delay.h> |
---|
| 28 | + |
---|
28 | 29 | #include <drm/drm.h> |
---|
| 30 | +#include <drm/drm_simple_kms_helper.h> |
---|
| 31 | + |
---|
| 32 | +#include "psb_drv.h" |
---|
29 | 33 | #include "psb_intel_drv.h" |
---|
30 | 34 | #include "psb_intel_reg.h" |
---|
31 | | -#include "psb_drv.h" |
---|
32 | 35 | |
---|
33 | 36 | #define HDMI_READ(reg) readl(hdmi_dev->regs + (reg)) |
---|
34 | 37 | #define HDMI_WRITE(reg, val) writel(val, hdmi_dev->regs + (reg)) |
---|
.. | .. |
---|
157 | 160 | |
---|
158 | 161 | static unsigned int htotal_calculate(struct drm_display_mode *mode) |
---|
159 | 162 | { |
---|
160 | | - u32 htotal, new_crtc_htotal; |
---|
161 | | - |
---|
162 | | - htotal = (mode->crtc_hdisplay - 1) | ((mode->crtc_htotal - 1) << 16); |
---|
| 163 | + u32 new_crtc_htotal; |
---|
163 | 164 | |
---|
164 | 165 | /* |
---|
165 | 166 | * 1024 x 768 new_crtc_htotal = 0x1024; |
---|
.. | .. |
---|
620 | 621 | .destroy = oaktrail_hdmi_destroy, |
---|
621 | 622 | }; |
---|
622 | 623 | |
---|
623 | | -static void oaktrail_hdmi_enc_destroy(struct drm_encoder *encoder) |
---|
624 | | -{ |
---|
625 | | - drm_encoder_cleanup(encoder); |
---|
626 | | -} |
---|
627 | | - |
---|
628 | | -static const struct drm_encoder_funcs oaktrail_hdmi_enc_funcs = { |
---|
629 | | - .destroy = oaktrail_hdmi_enc_destroy, |
---|
630 | | -}; |
---|
631 | | - |
---|
632 | 624 | void oaktrail_hdmi_init(struct drm_device *dev, |
---|
633 | 625 | struct psb_intel_mode_device *mode_dev) |
---|
634 | 626 | { |
---|
.. | .. |
---|
651 | 643 | &oaktrail_hdmi_connector_funcs, |
---|
652 | 644 | DRM_MODE_CONNECTOR_DVID); |
---|
653 | 645 | |
---|
654 | | - drm_encoder_init(dev, encoder, |
---|
655 | | - &oaktrail_hdmi_enc_funcs, |
---|
656 | | - DRM_MODE_ENCODER_TMDS, NULL); |
---|
| 646 | + drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_TMDS); |
---|
657 | 647 | |
---|
658 | 648 | gma_connector_attach_encoder(gma_connector, gma_encoder); |
---|
659 | 649 | |
---|
.. | .. |
---|
672 | 662 | failed_connector: |
---|
673 | 663 | kfree(gma_encoder); |
---|
674 | 664 | } |
---|
675 | | - |
---|
676 | | -static const struct pci_device_id hdmi_ids[] = { |
---|
677 | | - { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x080d) }, |
---|
678 | | - { 0 } |
---|
679 | | -}; |
---|
680 | 665 | |
---|
681 | 666 | void oaktrail_hdmi_setup(struct drm_device *dev) |
---|
682 | 667 | { |
---|
.. | .. |
---|
815 | 800 | PSB_WVDC32(hdmi_dev->saveDPLL_ADJUST, DPLL_ADJUST); |
---|
816 | 801 | PSB_WVDC32(hdmi_dev->saveDPLL_UPDATE, DPLL_UPDATE); |
---|
817 | 802 | PSB_WVDC32(hdmi_dev->saveDPLL_CLK_ENABLE, DPLL_CLK_ENABLE); |
---|
818 | | - DRM_UDELAY(150); |
---|
| 803 | + udelay(150); |
---|
819 | 804 | |
---|
820 | 805 | /* pipe */ |
---|
821 | 806 | PSB_WVDC32(pipeb->src, PIPEBSRC); |
---|