Re: [PATCH v3 5/5] i2c: qcom-cci: Enforce the required CCI clock rate
From: Loic Poulain
Date: Sat Aug 01 2026 - 03:18:13 EST
On Fri, Jul 31, 2026 at 10:55 PM Andi Shyti <andi.shyti@xxxxxxxxxx> wrote:
>
> Hi Loic,
>
> ...
>
> > @@ -588,6 +646,10 @@ static int __maybe_unused cci_resume_runtime(struct device *dev)
> > struct cci *cci = dev_get_drvdata(dev);
> > int ret;
> >
> > + ret = cci_set_core_rate(cci, cci_get_required_rate(cci));
> > + if (ret)
> > + return ret;
> > +
> > ret = cci_enable_clocks(cci);
> > if (ret)
> > return ret;
> > @@ -694,6 +756,19 @@ static int cci_probe(struct platform_device *pdev)
> > return dev_err_probe(dev, PTR_ERR(cci->cci_clk),
> > "failed to get CCI clock\n");
> >
> > + ret = devm_pm_opp_set_clkname(dev, "cci");
> > + if (ret)
> > + return dev_err_probe(dev, ret, "failed to set CCI OPP clk\n");
>
> what if CONFIG_PM_OPP is not configured in?
In that case we will 'gracefully' fail the probe as the operation will
return -EOPNOTSUPP. Actually, this mirrors spi-qup and spi-qcom-qspi.
On a qcom arm64 build, several always-present symbols pull it in.
That said, it could be better to make the dependency explicit rather
than rely on transitive selects and add select PM_OPP to the qcom-cci
Kconfig entry?
>
> Thanks,
> Andi
>
> > +
> > + /* OPP table is optional */
> > + ret = devm_pm_opp_of_add_table(dev);
> > + if (ret && ret != -ENODEV)
> > + return dev_err_probe(dev, ret, "failed to add OPP table\n");