Re: [PATCH 1/4] drm/bridge: ti-sn65dsi86: Combine register accesses in ti_sn_aux_transfer()
From: Stephen Boyd
Date: Thu Oct 29 2020 - 21:18:07 EST
Quoting Stephen Boyd (2020-10-28 18:11:51)
> @@ -72,6 +74,7 @@
> #define SN_AUX_ADDR_19_16_REG 0x74
> #define SN_AUX_ADDR_15_8_REG 0x75
> #define SN_AUX_ADDR_7_0_REG 0x76
> +#define SN_AUX_ADDR_MASK GENMASK(19, 0)
> #define SN_AUX_LENGTH_REG 0x77
> #define SN_AUX_CMD_REG 0x78
> #define AUX_CMD_SEND BIT(0)
> @@ -841,11 +844,13 @@ static ssize_t ti_sn_aux_transfer(struct drm_dp_aux *aux,
> struct ti_sn_bridge *pdata = aux_to_ti_sn_bridge(aux);
> u32 request = msg->request & ~DP_AUX_I2C_MOT;
> u32 request_val = AUX_CMD_REQ(msg->request);
> - u8 *buf = (u8 *)msg->buffer;
> + u8 *buf = msg->buffer;
> + unsigned int len = msg->size;
> unsigned int val;
> - int ret, i;
> + int ret;
> + u8 addr_len[SN_AUX_LENGTH_REG + 1 - SN_AUX_ADDR_19_16_REG];
I realize now that the SN_AUX_CMD_REG is also here and it has a "go bit"
in it. We can combine another register write here by writing out the
address, length, and request in one go. I rolled that into v2.