Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: rzg2l_adc: Enable runtime PM autosuspend support

Enable runtime PM autosuspend support for the rzg2l_adc driver. With this
change, consecutive conversion requests will no longer cause the device to
be runtime-enabled/disabled after each request. Instead, the device will
transition based on the delay configured by the user.

This approach reduces the frequency of hardware register access during
runtime PM suspend/resume cycles, thereby saving CPU cycles.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/20241206111337.726244-9-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Claudiu Beznea and committed by
Jonathan Cameron
d7c3e346 5d7fb2d5

+6 -2
+6 -2
drivers/iio/adc/rzg2l_adc.c
··· 208 208 rzg2l_adc_start_stop(adc, false); 209 209 210 210 rpm_put: 211 - pm_runtime_put_sync(dev); 211 + pm_runtime_mark_last_busy(dev); 212 + pm_runtime_put_autosuspend(dev); 212 213 return ret; 213 214 } 214 215 ··· 374 373 rzg2l_adc_writel(adc, RZG2L_ADM(3), reg); 375 374 376 375 exit_hw_init: 377 - pm_runtime_put_sync(dev); 376 + pm_runtime_mark_last_busy(dev); 377 + pm_runtime_put_autosuspend(dev); 378 378 return ret; 379 379 } 380 380 ··· 413 411 return dev_err_probe(dev, PTR_ERR(adc->presetn), 414 412 "failed to get/deassert presetn\n"); 415 413 414 + pm_runtime_set_autosuspend_delay(dev, 300); 415 + pm_runtime_use_autosuspend(dev); 416 416 ret = devm_pm_runtime_enable(dev); 417 417 if (ret) 418 418 return ret;