|
2681 | 2681 | * Enables the LVDS port. This bit must be set before DPLLs are enabled, as |
2682 | 2682 | * the DPLL semantics change when the LVDS is assigned to that pipe. |
2683 | 2683 | */ |
2684 | | -#define LVDS_PORT_EN (1 << 31) |
| 2684 | +#define LVDS_PORT_EN REG_BIT(31) |
2685 | 2685 | /* Selects pipe B for LVDS data. Must be set on pre-965. */ |
2686 | | -#define LVDS_PIPE_SEL_SHIFT 30 |
2687 | | -#define LVDS_PIPE_SEL_MASK (1 << 30) |
2688 | | -#define LVDS_PIPE_SEL(pipe) ((pipe) << 30) |
2689 | | -#define LVDS_PIPE_SEL_SHIFT_CPT 29 |
2690 | | -#define LVDS_PIPE_SEL_MASK_CPT (3 << 29) |
2691 | | -#define LVDS_PIPE_SEL_CPT(pipe) ((pipe) << 29) |
| 2686 | +#define LVDS_PIPE_SEL_MASK REG_BIT(30) |
| 2687 | +#define LVDS_PIPE_SEL(pipe) REG_FIELD_PREP(LVDS_PIPE_SEL_MASK, (pipe)) |
| 2688 | +#define LVDS_PIPE_SEL_MASK_CPT REG_GENMASK(30, 29) |
| 2689 | +#define LVDS_PIPE_SEL_CPT(pipe) REG_FIELD_PREP(LVDS_PIPE_SEL_MASK_CPT, (pipe)) |
2692 | 2690 | /* LVDS dithering flag on 965/g4x platform */ |
2693 | | -#define LVDS_ENABLE_DITHER (1 << 25) |
| 2691 | +#define LVDS_ENABLE_DITHER REG_BIT(25) |
2694 | 2692 | /* LVDS sync polarity flags. Set to invert (i.e. negative) */ |
2695 | | -#define LVDS_VSYNC_POLARITY (1 << 21) |
2696 | | -#define LVDS_HSYNC_POLARITY (1 << 20) |
| 2693 | +#define LVDS_VSYNC_POLARITY REG_BIT(21) |
| 2694 | +#define LVDS_HSYNC_POLARITY REG_BIT(20) |
2697 | 2695 |
|
2698 | 2696 | /* Enable border for unscaled (or aspect-scaled) display */ |
2699 | | -#define LVDS_BORDER_ENABLE (1 << 15) |
| 2697 | +#define LVDS_BORDER_ENABLE REG_BIT(15) |
2700 | 2698 | /* |
2701 | 2699 | * Enables the A0-A2 data pairs and CLKA, containing 18 bits of color data per |
2702 | 2700 | * pixel. |
2703 | 2701 | */ |
2704 | | -#define LVDS_A0A2_CLKA_POWER_MASK (3 << 8) |
2705 | | -#define LVDS_A0A2_CLKA_POWER_DOWN (0 << 8) |
2706 | | -#define LVDS_A0A2_CLKA_POWER_UP (3 << 8) |
| 2702 | +#define LVDS_A0A2_CLKA_POWER_MASK REG_GENMASK(9, 8) |
| 2703 | +#define LVDS_A0A2_CLKA_POWER_DOWN REG_FIELD_PREP(LVDS_A0A2_CLKA_POWER_MASK, 0) |
| 2704 | +#define LVDS_A0A2_CLKA_POWER_UP REG_FIELD_PREP(LVDS_A0A2_CLKA_POWER_MASK, 3) |
2707 | 2705 | /* |
2708 | 2706 | * Controls the A3 data pair, which contains the additional LSBs for 24 bit |
2709 | 2707 | * mode. Only enabled if LVDS_A0A2_CLKA_POWER_UP also indicates it should be |
2710 | 2708 | * on. |
2711 | 2709 | */ |
2712 | | -#define LVDS_A3_POWER_MASK (3 << 6) |
2713 | | -#define LVDS_A3_POWER_DOWN (0 << 6) |
2714 | | -#define LVDS_A3_POWER_UP (3 << 6) |
| 2710 | +#define LVDS_A3_POWER_MASK REG_GENMASK(7, 6) |
| 2711 | +#define LVDS_A3_POWER_DOWN REG_FIELD_PREP(LVDS_A3_POWER_MASK, 0) |
| 2712 | +#define LVDS_A3_POWER_UP REG_FIELD_PREP(LVDS_A3_POWER_MASK, 3) |
2715 | 2713 | /* |
2716 | 2714 | * Controls the CLKB pair. This should only be set when LVDS_B0B3_POWER_UP |
2717 | 2715 | * is set. |
2718 | 2716 | */ |
2719 | | -#define LVDS_CLKB_POWER_MASK (3 << 4) |
2720 | | -#define LVDS_CLKB_POWER_DOWN (0 << 4) |
2721 | | -#define LVDS_CLKB_POWER_UP (3 << 4) |
| 2717 | +#define LVDS_CLKB_POWER_MASK REG_GENMASK(5, 4) |
| 2718 | +#define LVDS_CLKB_POWER_DOWN REG_FIELD_PREP(LVDS_CLKB_POWER_MASK, 0) |
| 2719 | +#define LVDS_CLKB_POWER_UP REG_FIELD_PREP(LVDS_CLKB_POWER_MASK, 3) |
2722 | 2720 | /* |
2723 | 2721 | * Controls the B0-B3 data pairs. This must be set to match the DPLL p2 |
2724 | 2722 | * setting for whether we are in dual-channel mode. The B3 pair will |
2725 | 2723 | * additionally only be powered up when LVDS_A3_POWER_UP is set. |
2726 | 2724 | */ |
2727 | | -#define LVDS_B0B3_POWER_MASK (3 << 2) |
2728 | | -#define LVDS_B0B3_POWER_DOWN (0 << 2) |
2729 | | -#define LVDS_B0B3_POWER_UP (3 << 2) |
| 2725 | +#define LVDS_B0B3_POWER_MASK REG_GENMASK(3, 2) |
| 2726 | +#define LVDS_B0B3_POWER_DOWN REG_FIELD_PREP(LVDS_B0B3_POWER_MASK, 0) |
| 2727 | +#define LVDS_B0B3_POWER_UP REG_FIELD_PREP(LVDS_B0B3_POWER_MASK, 3) |
2730 | 2728 |
|
2731 | 2729 | /* Video Data Island Packet control */ |
2732 | 2730 | #define VIDEO_DIP_DATA _MMIO(0x61178) |
|
6461 | 6459 | #define FDI_PLL_CTL_2 _MMIO(0xfe004) |
6462 | 6460 |
|
6463 | 6461 | #define PCH_LVDS _MMIO(0xe1180) |
6464 | | -#define LVDS_DETECTED (1 << 1) |
| 6462 | +#define LVDS_DETECTED REG_BIT(1) |
6465 | 6463 |
|
6466 | 6464 | #define _PCH_DP_B 0xe4100 |
6467 | 6465 | #define PCH_DP_B _MMIO(_PCH_DP_B) |
|
0 commit comments