diff --git a/drivers/mfd/max96752f.c b/drivers/mfd/max96752f.c index 00bc47ea6100..347d80ea75a1 100644 --- a/drivers/mfd/max96752f.c +++ b/drivers/mfd/max96752f.c @@ -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, diff --git a/include/linux/mfd/max96752f.h b/include/linux/mfd/max96752f.h index 35867985fa2e..01d9b059aa85 100644 --- a/include/linux/mfd/max96752f.h +++ b/include/linux/mfd/max96752f.h @@ -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);