Hi Akash, On Wed, Apr 15, 2020 at 03:53:14PM +0530, Akash Asthana wrote: > Get the interconnect paths for I2C based Serial Engine device > and vote according to the bus speed of the driver. > > Signed-off-by: Akash Asthana <akashast@xxxxxxxxxxxxxx> > --- > Changes in V2: > - As per Bjorn's comment, removed se == NULL check from geni_i2c_icc_get > - As per Bjorn's comment, removed code to set se->icc_path* to NULL in failure > - As per Bjorn's comment, introduced and using devm_of_icc_get API for getting > path handle > - As per Matthias comment, added error handling for icc_set_bw call > > Changes in V3: > - As per Matthias comment, use common library APIs defined in geni-se > driver for ICC functionality. > > Changes in V4: > - Move peak_bw guess as twice of avg_bw if nothing mentioned explicitly > to ICC core. > > drivers/i2c/busses/i2c-qcom-geni.c | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c > index 18d1e4f..7bf830a 100644 > --- a/drivers/i2c/busses/i2c-qcom-geni.c > +++ b/drivers/i2c/busses/i2c-qcom-geni.c > @@ -557,6 +557,22 @@ static int geni_i2c_probe(struct platform_device *pdev) > gi2c->adap.dev.of_node = dev->of_node; > strlcpy(gi2c->adap.name, "Geni-I2C", sizeof(gi2c->adap.name)); > > + ret = geni_icc_get(&gi2c->se, "qup-memory"); > + if (ret) > + return ret; > + /* > + * Set the bus quota for core and cpu to a reasonable value for > + * register access. > + * Set quota for DDR based on bus speed. > + */ > + gi2c->se.icc_paths[0].avg_bw = GENI_DEFAULT_BW; > + gi2c->se.icc_paths[1].avg_bw = GENI_DEFAULT_BW; > + gi2c->se.icc_paths[2].avg_bw = Bps_to_icc(gi2c->clk_freq_out); As commented on patch "soc: qcom: geni: Support for ICC voting" the use of literals to index the paths isn't very clear, please use enums.