mfd: MAX96752F: add stream id for each link

Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: I7e512351db58050c8550100c7a79c046dda5ea4e
This commit is contained in:
Guochun Huang
2022-05-21 17:56:10 +08:00
committed by Tao Huang
parent 2fa624200c
commit 4f64073a92
2 changed files with 17 additions and 0 deletions

View File

@@ -105,6 +105,11 @@ void max96752f_regcache_sync(struct max96752f *max96752f)
client->addr = addr;
regmap_update_bits(max96752f->regmap, 0x0050, STR_SEL,
FIELD_PREP(STR_SEL, max96752f->stream_id));
regmap_update_bits(max96752f->regmap, 0x0073, TX_SRC_ID,
FIELD_PREP(TX_SRC_ID, max96752f->stream_id));
regcache_sync(max96752f->regmap);
}
EXPORT_SYMBOL(max96752f_regcache_sync);
@@ -135,6 +140,11 @@ static int max96752f_i2c_probe(struct i2c_client *client)
max96752f->dev = dev;
max96752f->client = client;
ret = device_property_read_u32(dev->parent, "reg", &max96752f->stream_id);
if (ret)
return dev_err_probe(dev, ret, "failed to get gmsl id\n");
i2c_set_clientdata(client, max96752f);
max96752f->regmap = devm_regmap_init_i2c(client,

View File

@@ -54,6 +54,12 @@
#define SLEEP BIT(3)
#define LINK_CFG GENMASK(1, 0)
/* 0050h */
#define STR_SEL GENMASK(1, 0)
/* 0073h */
#define TX_SRC_ID GENMASK(2, 0)
/* 0108h */
#define VID_LOCK BIT(6)
@@ -99,6 +105,7 @@ struct max96752f {
struct regmap *regmap;
struct i2c_client *client;
struct i2c_mux_core *muxc;
u32 stream_id;
};
void max96752f_regcache_sync(struct max96752f *max96752f);