|
54 | 54 | #include "cdns-mhdp8546-hdcp.h"
|
55 | 55 | #include "cdns-mhdp8546-j721e.h"
|
56 | 56 |
|
| 57 | +static void cdns_mhdp_bridge_hpd_enable(struct drm_bridge *bridge) |
| 58 | +{ |
| 59 | + struct cdns_mhdp_device *mhdp = bridge_to_mhdp(bridge); |
| 60 | + |
| 61 | + /* Enable SW event interrupts */ |
| 62 | + if (mhdp->bridge_attached) |
| 63 | + writel(readl(mhdp->regs + CDNS_APB_INT_MASK) & |
| 64 | + ~CDNS_APB_INT_MASK_SW_EVENT_INT, |
| 65 | + mhdp->regs + CDNS_APB_INT_MASK); |
| 66 | +} |
| 67 | + |
| 68 | +static void cdns_mhdp_bridge_hpd_disable(struct drm_bridge *bridge) |
| 69 | +{ |
| 70 | + struct cdns_mhdp_device *mhdp = bridge_to_mhdp(bridge); |
| 71 | + |
| 72 | + writel(readl(mhdp->regs + CDNS_APB_INT_MASK) | |
| 73 | + CDNS_APB_INT_MASK_SW_EVENT_INT, |
| 74 | + mhdp->regs + CDNS_APB_INT_MASK); |
| 75 | +} |
| 76 | + |
57 | 77 | static int cdns_mhdp_mailbox_read(struct cdns_mhdp_device *mhdp)
|
58 | 78 | {
|
59 | 79 | int ret, empty;
|
@@ -749,9 +769,7 @@ static int cdns_mhdp_fw_activate(const struct firmware *fw,
|
749 | 769 | * MHDP_HW_STOPPED happens only due to driver removal when
|
750 | 770 | * bridge should already be detached.
|
751 | 771 | */
|
752 |
| - if (mhdp->bridge_attached) |
753 |
| - writel(~(u32)CDNS_APB_INT_MASK_SW_EVENT_INT, |
754 |
| - mhdp->regs + CDNS_APB_INT_MASK); |
| 772 | + cdns_mhdp_bridge_hpd_enable(&mhdp->bridge); |
755 | 773 |
|
756 | 774 | spin_unlock(&mhdp->start_lock);
|
757 | 775 |
|
@@ -1740,8 +1758,7 @@ static int cdns_mhdp_attach(struct drm_bridge *bridge,
|
1740 | 1758 |
|
1741 | 1759 | /* Enable SW event interrupts */
|
1742 | 1760 | if (hw_ready)
|
1743 |
| - writel(~(u32)CDNS_APB_INT_MASK_SW_EVENT_INT, |
1744 |
| - mhdp->regs + CDNS_APB_INT_MASK); |
| 1761 | + cdns_mhdp_bridge_hpd_enable(bridge); |
1745 | 1762 |
|
1746 | 1763 | return 0;
|
1747 | 1764 | aux_unregister:
|
@@ -2212,23 +2229,6 @@ static struct edid *cdns_mhdp_bridge_get_edid(struct drm_bridge *bridge,
|
2212 | 2229 | return cdns_mhdp_get_edid(mhdp, connector);
|
2213 | 2230 | }
|
2214 | 2231 |
|
2215 |
| -static void cdns_mhdp_bridge_hpd_enable(struct drm_bridge *bridge) |
2216 |
| -{ |
2217 |
| - struct cdns_mhdp_device *mhdp = bridge_to_mhdp(bridge); |
2218 |
| - |
2219 |
| - /* Enable SW event interrupts */ |
2220 |
| - if (mhdp->bridge_attached) |
2221 |
| - writel(~(u32)CDNS_APB_INT_MASK_SW_EVENT_INT, |
2222 |
| - mhdp->regs + CDNS_APB_INT_MASK); |
2223 |
| -} |
2224 |
| - |
2225 |
| -static void cdns_mhdp_bridge_hpd_disable(struct drm_bridge *bridge) |
2226 |
| -{ |
2227 |
| - struct cdns_mhdp_device *mhdp = bridge_to_mhdp(bridge); |
2228 |
| - |
2229 |
| - writel(CDNS_APB_INT_MASK_SW_EVENT_INT, mhdp->regs + CDNS_APB_INT_MASK); |
2230 |
| -} |
2231 |
| - |
2232 | 2232 | static const struct drm_bridge_funcs cdns_mhdp_bridge_funcs = {
|
2233 | 2233 | .atomic_enable = cdns_mhdp_atomic_enable,
|
2234 | 2234 | .atomic_disable = cdns_mhdp_atomic_disable,
|
|
0 commit comments