mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
drm/i915/cx0: Add macro to get DDI port width from a register value
A follow-up change will need to retrieve the DDI port field from the register value, add a macro for this. Make things symmetric with setting the field in the register. Signed-off-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> Link: https://lore.kernel.org/r/20251117104602.2363671-8-mika.kahola@intel.com
This commit is contained in:
parent
7c3342213a
commit
4f8b1e08c2
|
|
@ -2349,8 +2349,13 @@ enum skl_power_gate {
|
|||
#define DDI_BUF_CTL_TC_PHY_OWNERSHIP REG_BIT(6)
|
||||
#define DDI_A_4_LANES REG_BIT(4)
|
||||
#define DDI_PORT_WIDTH_MASK REG_GENMASK(3, 1)
|
||||
#define DDI_PORT_WIDTH_ENCODE(width) ((width) == 3 ? 4 : (width) - 1)
|
||||
#define DDI_PORT_WIDTH_DECODE(regval) ((regval) == 4 ? 3 : (regval) + 1)
|
||||
#define DDI_PORT_WIDTH(width) REG_FIELD_PREP(DDI_PORT_WIDTH_MASK, \
|
||||
((width) == 3 ? 4 : (width) - 1))
|
||||
DDI_PORT_WIDTH_ENCODE(width))
|
||||
#define DDI_PORT_WIDTH_GET(regval) DDI_PORT_WIDTH_DECODE(REG_FIELD_GET(DDI_PORT_WIDTH_MASK, \
|
||||
(regval)))
|
||||
|
||||
#define DDI_PORT_WIDTH_SHIFT 1
|
||||
#define DDI_INIT_DISPLAY_DETECTED REG_BIT(0)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user