Re: [PATCH v3 1/1] i2c: mediatek: add runtime PM operations and bus regulator control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Zoie,

On Fri, Jan 03, 2025 at 10:32:34PM +0800, Zoie Lin wrote:
> This commit introduces support for runtime PM operations in
> the I2C driver, enabling runtime suspend and resume functionality.

Please, don't start the commit log with "This patch...", please
use the informative form.

> Although in the most platforms, the bus power of i2c are always

/the//
/are/is/

> on, some platforms disable the i2c bus power in order to meet
> low power request.
> 
> This implementation includes bus regulator control to facilitate
> proper handling of the bus power based on platform requirements.
> 
> Signed-off-by: Zoie Lin <zoie.lin@xxxxxxxxxxxx>

...

> +static int mtk_i2c_runtime_resume(struct device *dev)
> +{
> +	int ret = 0;

initialization is not needed.

> +	struct mtk_i2c *i2c = dev_get_drvdata(dev);
> +
> +	if (i2c->adap.bus_regulator) {
> +		ret = regulator_enable(i2c->adap.bus_regulator);
> +		if (ret) {
> +			dev_err(dev, "enable regulator failed!\n");
> +			return ret;
> +		}
> +	}
> +
> +	ret = clk_bulk_enable(I2C_MT65XX_CLK_MAX, i2c->clocks);
> +	if (ret) {
> +		if (i2c->adap.bus_regulator)
> +			regulator_disable(i2c->adap.bus_regulator);
> +		return ret;

no need to return here...

> +	}

... you can remove the brackets...

> +	return 0;

... return ret;

Andi

> +}




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux