1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2017, The Linux Foundation. All rights reserved.
6 #ifndef QCOM_PHY_QMP_COMMON_H_
7 #define QCOM_PHY_QMP_COMMON_H_
9 struct qmp_phy_init_tbl {
13 * mask of lanes for which this register is written
14 * for cases when second lane needs different values
19 #define QMP_PHY_INIT_CFG(o, v) \
26 #define QMP_PHY_INIT_CFG_LANE(o, v, l) \
33 static inline void qmp_configure_lane(void __iomem *base,
34 const struct qmp_phy_init_tbl tbl[],
39 const struct qmp_phy_init_tbl *t = tbl;
44 for (i = 0; i < num; i++, t++) {
45 if (!(t->lane_mask & lane_mask))
48 writel(t->val, base + t->offset);
52 static inline void qmp_configure(void __iomem *base,
53 const struct qmp_phy_init_tbl tbl[],
56 qmp_configure_lane(base, tbl, num, 0xff);