@@ -2631,7 +2631,7 @@ intel_sdvo_unselect_i2c_bus(struct intel_sdvo *sdvo)
2631
2631
}
2632
2632
2633
2633
static bool
2634
- intel_sdvo_is_hdmi_connector (struct intel_sdvo * intel_sdvo , int device )
2634
+ intel_sdvo_is_hdmi_connector (struct intel_sdvo * intel_sdvo )
2635
2635
{
2636
2636
return intel_sdvo_check_supp_encode (intel_sdvo );
2637
2637
}
@@ -2736,24 +2736,21 @@ static struct intel_sdvo_connector *intel_sdvo_connector_alloc(void)
2736
2736
}
2737
2737
2738
2738
static bool
2739
- intel_sdvo_dvi_init (struct intel_sdvo * intel_sdvo , int device )
2739
+ intel_sdvo_dvi_init (struct intel_sdvo * intel_sdvo , u16 type )
2740
2740
{
2741
2741
struct drm_encoder * encoder = & intel_sdvo -> base .base ;
2742
2742
struct drm_connector * connector ;
2743
2743
struct intel_encoder * intel_encoder = to_intel_encoder (encoder );
2744
2744
struct intel_connector * intel_connector ;
2745
2745
struct intel_sdvo_connector * intel_sdvo_connector ;
2746
2746
2747
- DRM_DEBUG_KMS ("initialising DVI device %d \n" , device );
2747
+ DRM_DEBUG_KMS ("initialising DVI type 0x%x \n" , type );
2748
2748
2749
2749
intel_sdvo_connector = intel_sdvo_connector_alloc ();
2750
2750
if (!intel_sdvo_connector )
2751
2751
return false;
2752
2752
2753
- if (device == 0 )
2754
- intel_sdvo_connector -> output_flag = SDVO_OUTPUT_TMDS0 ;
2755
- else if (device == 1 )
2756
- intel_sdvo_connector -> output_flag = SDVO_OUTPUT_TMDS1 ;
2753
+ intel_sdvo_connector -> output_flag = type ;
2757
2754
2758
2755
intel_connector = & intel_sdvo_connector -> base ;
2759
2756
connector = & intel_connector -> base ;
@@ -2773,7 +2770,7 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
2773
2770
encoder -> encoder_type = DRM_MODE_ENCODER_TMDS ;
2774
2771
connector -> connector_type = DRM_MODE_CONNECTOR_DVID ;
2775
2772
2776
- if (intel_sdvo_is_hdmi_connector (intel_sdvo , device )) {
2773
+ if (intel_sdvo_is_hdmi_connector (intel_sdvo )) {
2777
2774
connector -> connector_type = DRM_MODE_CONNECTOR_HDMIA ;
2778
2775
intel_sdvo_connector -> is_hdmi = true;
2779
2776
}
@@ -2790,14 +2787,14 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
2790
2787
}
2791
2788
2792
2789
static bool
2793
- intel_sdvo_tv_init (struct intel_sdvo * intel_sdvo , int type )
2790
+ intel_sdvo_tv_init (struct intel_sdvo * intel_sdvo , u16 type )
2794
2791
{
2795
2792
struct drm_encoder * encoder = & intel_sdvo -> base .base ;
2796
2793
struct drm_connector * connector ;
2797
2794
struct intel_connector * intel_connector ;
2798
2795
struct intel_sdvo_connector * intel_sdvo_connector ;
2799
2796
2800
- DRM_DEBUG_KMS ("initialising TV type %d \n" , type );
2797
+ DRM_DEBUG_KMS ("initialising TV type 0x%x \n" , type );
2801
2798
2802
2799
intel_sdvo_connector = intel_sdvo_connector_alloc ();
2803
2800
if (!intel_sdvo_connector )
@@ -2829,14 +2826,14 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type)
2829
2826
}
2830
2827
2831
2828
static bool
2832
- intel_sdvo_analog_init (struct intel_sdvo * intel_sdvo , int device )
2829
+ intel_sdvo_analog_init (struct intel_sdvo * intel_sdvo , u16 type )
2833
2830
{
2834
2831
struct drm_encoder * encoder = & intel_sdvo -> base .base ;
2835
2832
struct drm_connector * connector ;
2836
2833
struct intel_connector * intel_connector ;
2837
2834
struct intel_sdvo_connector * intel_sdvo_connector ;
2838
2835
2839
- DRM_DEBUG_KMS ("initialising analog device %d \n" , device );
2836
+ DRM_DEBUG_KMS ("initialising analog type 0x%x \n" , type );
2840
2837
2841
2838
intel_sdvo_connector = intel_sdvo_connector_alloc ();
2842
2839
if (!intel_sdvo_connector )
@@ -2848,10 +2845,7 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device)
2848
2845
encoder -> encoder_type = DRM_MODE_ENCODER_DAC ;
2849
2846
connector -> connector_type = DRM_MODE_CONNECTOR_VGA ;
2850
2847
2851
- if (device == 0 )
2852
- intel_sdvo_connector -> output_flag = SDVO_OUTPUT_RGB0 ;
2853
- else if (device == 1 )
2854
- intel_sdvo_connector -> output_flag = SDVO_OUTPUT_RGB1 ;
2848
+ intel_sdvo_connector -> output_flag = type ;
2855
2849
2856
2850
if (intel_sdvo_connector_init (intel_sdvo_connector , intel_sdvo ) < 0 ) {
2857
2851
kfree (intel_sdvo_connector );
@@ -2862,15 +2856,15 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device)
2862
2856
}
2863
2857
2864
2858
static bool
2865
- intel_sdvo_lvds_init (struct intel_sdvo * intel_sdvo , int device )
2859
+ intel_sdvo_lvds_init (struct intel_sdvo * intel_sdvo , u16 type )
2866
2860
{
2867
2861
struct drm_encoder * encoder = & intel_sdvo -> base .base ;
2868
2862
struct drm_i915_private * i915 = to_i915 (encoder -> dev );
2869
2863
struct drm_connector * connector ;
2870
2864
struct intel_connector * intel_connector ;
2871
2865
struct intel_sdvo_connector * intel_sdvo_connector ;
2872
2866
2873
- DRM_DEBUG_KMS ("initialising LVDS device %d \n" , device );
2867
+ DRM_DEBUG_KMS ("initialising LVDS type 0x%x \n" , type );
2874
2868
2875
2869
intel_sdvo_connector = intel_sdvo_connector_alloc ();
2876
2870
if (!intel_sdvo_connector )
@@ -2881,10 +2875,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
2881
2875
encoder -> encoder_type = DRM_MODE_ENCODER_LVDS ;
2882
2876
connector -> connector_type = DRM_MODE_CONNECTOR_LVDS ;
2883
2877
2884
- if (device == 0 )
2885
- intel_sdvo_connector -> output_flag = SDVO_OUTPUT_LVDS0 ;
2886
- else if (device == 1 )
2887
- intel_sdvo_connector -> output_flag = SDVO_OUTPUT_LVDS1 ;
2878
+ intel_sdvo_connector -> output_flag = type ;
2888
2879
2889
2880
if (intel_sdvo_connector_init (intel_sdvo_connector , intel_sdvo ) < 0 ) {
2890
2881
kfree (intel_sdvo_connector );
@@ -2959,11 +2950,11 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo)
2959
2950
intel_sdvo_select_ddc_bus (i915 , intel_sdvo );
2960
2951
2961
2952
if (flags & SDVO_OUTPUT_TMDS0 )
2962
- if (!intel_sdvo_dvi_init (intel_sdvo , 0 ))
2953
+ if (!intel_sdvo_dvi_init (intel_sdvo , SDVO_OUTPUT_TMDS0 ))
2963
2954
return false;
2964
2955
2965
2956
if (flags & SDVO_OUTPUT_TMDS1 )
2966
- if (!intel_sdvo_dvi_init (intel_sdvo , 1 ))
2957
+ if (!intel_sdvo_dvi_init (intel_sdvo , SDVO_OUTPUT_TMDS1 ))
2967
2958
return false;
2968
2959
2969
2960
/* TV has no XXX1 function block */
@@ -2980,19 +2971,19 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo)
2980
2971
return false;
2981
2972
2982
2973
if (flags & SDVO_OUTPUT_RGB0 )
2983
- if (!intel_sdvo_analog_init (intel_sdvo , 0 ))
2974
+ if (!intel_sdvo_analog_init (intel_sdvo , SDVO_OUTPUT_RGB0 ))
2984
2975
return false;
2985
2976
2986
2977
if (flags & SDVO_OUTPUT_RGB1 )
2987
- if (!intel_sdvo_analog_init (intel_sdvo , 1 ))
2978
+ if (!intel_sdvo_analog_init (intel_sdvo , SDVO_OUTPUT_RGB1 ))
2988
2979
return false;
2989
2980
2990
2981
if (flags & SDVO_OUTPUT_LVDS0 )
2991
- if (!intel_sdvo_lvds_init (intel_sdvo , 0 ))
2982
+ if (!intel_sdvo_lvds_init (intel_sdvo , SDVO_OUTPUT_LVDS0 ))
2992
2983
return false;
2993
2984
2994
2985
if (flags & SDVO_OUTPUT_LVDS1 )
2995
- if (!intel_sdvo_lvds_init (intel_sdvo , 1 ))
2986
+ if (!intel_sdvo_lvds_init (intel_sdvo , SDVO_OUTPUT_LVDS1 ))
2996
2987
return false;
2997
2988
2998
2989
intel_sdvo -> base .pipe_mask = ~0 ;
0 commit comments