On 9/1/25 9:50 PM, Srinivas Kandagatla wrote: > cleanup the register layout structs to prepare for adding new 3.x > controller support. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxxxxxxxx> > --- > drivers/soundwire/qcom.c | 69 ++++++++++++++++++++++++++++++++-------- > 1 file changed, 56 insertions(+), 13 deletions(-) > > diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c > index 4fa3e1c080ef..e3d248432d49 100644 > --- a/drivers/soundwire/qcom.c > +++ b/drivers/soundwire/qcom.c > @@ -107,6 +107,15 @@ > #define SWRM_DP_BLOCK_CTRL3_BANK(n, m) (0x1138 + 0x100 * (n - 1) + 0x40 * m) > #define SWRM_DP_SAMPLECTRL2_BANK(n, m) (0x113C + 0x100 * (n - 1) + 0x40 * m) > #define SWRM_DIN_DPn_PCM_PORT_CTRL(n) (0x1054 + 0x100 * (n - 1)) > + > +#define SWRM_DPn_PORT_CTRL_BANK(offset, n, m) (offset + 0x100 * (n - 1) + 0x40 * m) > +#define SWRM_DPn_PORT_CTRL_2_BANK(offset, n, m) (offset + 0x100 * (n - 1) + 0x40 * m) > +#define SWRM_DPn_BLOCK_CTRL_1(offset, n) (offset + 0x100 * (n - 1)) > +#define SWRM_DPn_BLOCK_CTRL2_BANK(offset, n, m) (offset + 0x100 * (n - 1) + 0x40 * m) > +#define SWRM_DPn_PORT_HCTRL_BANK(offset, n, m) (offset + 0x100 * (n - 1) + 0x40 * m) > +#define SWRM_DPn_BLOCK_CTRL3_BANK(offset, n, m) (offset + 0x100 * (n - 1) + 0x40 * m) > +#define SWRM_DPn_SAMPLECTRL2_BANK(offset, n, m) (offset + 0x100 * (n - 1) + 0x40 * m) > + > #define SWR_V1_3_MSTR_MAX_REG_ADDR 0x1740 > #define SWR_V2_0_MSTR_MAX_REG_ADDR 0x50ac > > @@ -171,6 +180,13 @@ enum { > SWRM_REG_CMD_FIFO_RD_CMD, > SWRM_REG_CMD_FIFO_STATUS, > SWRM_REG_CMD_FIFO_RD_FIFO_ADDR, > + SWRM_OFFSET_DP_PORT_CTRL_BANK, > + SWRM_OFFSET_DP_PORT_CTRL_2_BANK, > + SWRM_OFFSET_DP_BLOCK_CTRL_1, > + SWRM_OFFSET_DP_BLOCK_CTRL2_BANK, > + SWRM_OFFSET_DP_PORT_HCTRL_BANK, > + SWRM_OFFSET_DP_BLOCK_CTRL3_BANK, > + SWRM_OFFSET_DP_SAMPLECTRL2_BANK, > }; > > struct qcom_swrm_ctrl { > @@ -230,6 +246,13 @@ static const unsigned int swrm_v1_3_reg_layout[] = { > [SWRM_REG_CMD_FIFO_RD_CMD] = SWRM_V1_3_CMD_FIFO_RD_CMD, > [SWRM_REG_CMD_FIFO_STATUS] = SWRM_V1_3_CMD_FIFO_STATUS, > [SWRM_REG_CMD_FIFO_RD_FIFO_ADDR] = SWRM_V1_3_CMD_FIFO_RD_FIFO_ADDR, > + [SWRM_OFFSET_DP_PORT_CTRL_BANK] = 0x1124, > + [SWRM_OFFSET_DP_PORT_CTRL_2_BANK] = 0x1128, > + [SWRM_OFFSET_DP_BLOCK_CTRL_1] = 0x112C, > + [SWRM_OFFSET_DP_BLOCK_CTRL2_BANK] = 0x1130, > + [SWRM_OFFSET_DP_PORT_HCTRL_BANK] = 0x1134, > + [SWRM_OFFSET_DP_BLOCK_CTRL3_BANK] = 0x1138, > + [SWRM_OFFSET_DP_SAMPLECTRL2_BANK] = 0x113C, lowercase hex, please [...] > - int reg = SWRM_DP_PORT_CTRL_BANK((params->port_num), bank); all (?) the defines that the patch context shows as removed can also be dropped now Konrad