@@ -168,6 +168,7 @@ struct dw_hdmi {
unsigned int audio_n;
bool audio_enable;
+ unsigned int reg_shift;
struct regmap *regm;
};
@@ -181,21 +182,21 @@ struct dw_hdmi {
static inline void hdmi_writeb(struct dw_hdmi *hdmi, u8 val, int offset)
{
- regmap_write(hdmi->regm, offset, val);
+ regmap_write(hdmi->regm, offset << hdmi->reg_shift, val);
}
static inline u8 hdmi_readb(struct dw_hdmi *hdmi, int offset)
{
unsigned int val = 0;
- regmap_read(hdmi->regm, offset, &val);
+ regmap_read(hdmi->regm, offset << hdmi->reg_shift, &val);
return val;
}
static void hdmi_modb(struct dw_hdmi *hdmi, u8 data, u8 mask, unsigned reg)
{
- regmap_update_bits(hdmi->regm, reg, mask, data);
+ regmap_update_bits(hdmi->regm, reg << hdmi->reg_shift, mask, data);
}
static void hdmi_mask_writeb(struct dw_hdmi *hdmi, u8 data, unsigned int reg,
@@ -1984,11 +1985,10 @@ static const struct regmap_config hdmi_regmap_8bit_config = {
};
static const struct regmap_config hdmi_regmap_32bit_config = {
- .reg_bits = 8,
- .pad_bits = 24,
+ .reg_bits = 32,
.val_bits = 32,
.reg_stride = 4,
- .max_register = HDMI_I2CM_FS_SCL_LCNT_0_ADDR,
+ .max_register = HDMI_I2CM_FS_SCL_LCNT_0_ADDR << 2,
};
static struct dw_hdmi *
@@ -2044,6 +2044,7 @@ __dw_hdmi_probe(struct platform_device *pdev,
switch (val) {
case 4:
reg_config = &hdmi_regmap_32bit_config;
+ hdmi->reg_shift = 2;
break;
case 1:
reg_config = &hdmi_regmap_8bit_config;