Skip to content

Commit 8c7c194

Browse files
Michael Rieschvinodkoul
authored andcommitted
phy: rockchip: phy-rockchip-inno-csidphy: allow writes to grf register 0
The driver for the Rockchip MIPI CSI-2 DPHY uses GRF register offset value 0 to sort out undefined registers. However, the RK3588 CSIDPHY GRF this offset is perfectly fine (in fact, register 0 is the only one in this register file). Introduce a boolean variable to indicate valid registers and allow writes to register 0. Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Michael Riesch <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 5072b8e commit 8c7c194

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/phy/rockchip/phy-rockchip-inno-csidphy.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@ struct dphy_reg {
8787
u32 offset;
8888
u32 mask;
8989
u32 shift;
90+
u8 valid;
9091
};
9192

9293
#define PHY_REG(_offset, _width, _shift) \
93-
{ .offset = _offset, .mask = BIT(_width) - 1, .shift = _shift, }
94+
{ .offset = _offset, .mask = BIT(_width) - 1, .shift = _shift, .valid = 1, }
9495

9596
static const struct dphy_reg rk1808_grf_dphy_regs[] = {
9697
[GRF_DPHY_CSIPHY_FORCERXMODE] = PHY_REG(RK1808_GRF_PD_VI_CON_OFFSET, 4, 0),
@@ -145,7 +146,7 @@ static inline void write_grf_reg(struct rockchip_inno_csidphy *priv,
145146
const struct dphy_drv_data *drv_data = priv->drv_data;
146147
const struct dphy_reg *reg = &drv_data->grf_regs[index];
147148

148-
if (reg->offset)
149+
if (reg->valid)
149150
regmap_write(priv->grf, reg->offset,
150151
HIWORD_UPDATE(value, reg->mask, reg->shift));
151152
}

0 commit comments

Comments
 (0)