| .. | .. |
|---|
| 700 | 700 | } |
|---|
| 701 | 701 | |
|---|
| 702 | 702 | static enum drm_mode_status adv7511_mode_valid(struct adv7511 *adv7511, |
|---|
| 703 | | - struct drm_display_mode *mode) |
|---|
| 703 | + const struct drm_display_mode *mode) |
|---|
| 704 | 704 | { |
|---|
| 705 | 705 | if (mode->clock > 165000) |
|---|
| 706 | 706 | return MODE_CLOCK_HIGH; |
|---|
| .. | .. |
|---|
| 789 | 789 | else |
|---|
| 790 | 790 | low_refresh_rate = ADV7511_LOW_REFRESH_RATE_NONE; |
|---|
| 791 | 791 | |
|---|
| 792 | | - regmap_update_bits(adv7511->regmap, 0xfb, |
|---|
| 793 | | - 0x6, low_refresh_rate << 1); |
|---|
| 792 | + if (adv7511->type == ADV7511) |
|---|
| 793 | + regmap_update_bits(adv7511->regmap, 0xfb, |
|---|
| 794 | + 0x6, low_refresh_rate << 1); |
|---|
| 795 | + else |
|---|
| 796 | + regmap_update_bits(adv7511->regmap, 0x4a, |
|---|
| 797 | + 0xc, low_refresh_rate << 2); |
|---|
| 798 | + |
|---|
| 794 | 799 | regmap_update_bits(adv7511->regmap, 0x17, |
|---|
| 795 | 800 | 0x60, (vsync_polarity << 6) | (hsync_polarity << 5)); |
|---|
| 796 | | - |
|---|
| 797 | | - if (adv7511->type == ADV7533 || adv7511->type == ADV7535) |
|---|
| 798 | | - adv7533_mode_set(adv7511, adj_mode); |
|---|
| 799 | 801 | |
|---|
| 800 | 802 | drm_mode_copy(&adv7511->curr_mode, adj_mode); |
|---|
| 801 | 803 | |
|---|
| .. | .. |
|---|
| 916 | 918 | adv7511_mode_set(adv, mode, adj_mode); |
|---|
| 917 | 919 | } |
|---|
| 918 | 920 | |
|---|
| 921 | +static enum drm_mode_status adv7511_bridge_mode_valid(struct drm_bridge *bridge, |
|---|
| 922 | + const struct drm_display_info *info, |
|---|
| 923 | + const struct drm_display_mode *mode) |
|---|
| 924 | +{ |
|---|
| 925 | + struct adv7511 *adv = bridge_to_adv7511(bridge); |
|---|
| 926 | + |
|---|
| 927 | + if (adv->type == ADV7533 || adv->type == ADV7535) |
|---|
| 928 | + return adv7533_mode_valid(adv, mode); |
|---|
| 929 | + else |
|---|
| 930 | + return adv7511_mode_valid(adv, mode); |
|---|
| 931 | +} |
|---|
| 932 | + |
|---|
| 919 | 933 | static int adv7511_bridge_attach(struct drm_bridge *bridge, |
|---|
| 920 | 934 | enum drm_bridge_attach_flags flags) |
|---|
| 921 | 935 | { |
|---|
| .. | .. |
|---|
| 966 | 980 | .enable = adv7511_bridge_enable, |
|---|
| 967 | 981 | .disable = adv7511_bridge_disable, |
|---|
| 968 | 982 | .mode_set = adv7511_bridge_mode_set, |
|---|
| 983 | + .mode_valid = adv7511_bridge_mode_valid, |
|---|
| 969 | 984 | .attach = adv7511_bridge_attach, |
|---|
| 970 | 985 | .detect = adv7511_bridge_detect, |
|---|
| 971 | 986 | .get_edid = adv7511_bridge_get_edid, |
|---|