Re: [PATCH] media: ov5640: Use runtime PM

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

 



Hi Pauls, Jacopo,

On Wed, Mar 09, 2022 at 03:24:15PM +0100, Paul Kocialkowski wrote:
> Hi Jacopo,
> 
> On Wed 09 Mar 22, 14:47, Jacopo Mondi wrote:
> > Hi Paul,
> > 
> > On Wed, Mar 09, 2022 at 08:32:32PM +0900, Paul Elder wrote:
> > > Switch to using runtime PM for power management.
> > 
> > What happens if CONFIG_PM is not selected ? Two of the existing
> > sensor drivers in mainline depends on PM but not the ov5640, and I'm
> > not sure we should depend on PM to be able to compile the module.
> 
> I think the direction for the media subsystem is to use runtime pm
> everywhere possible, which is not opional (like traditional PM) so
> I really thinks it makes sense to have the sensor driver depend on it.

Without runtime PM, the sensor is always powered on. There's no reason why
the driver shouldn't work without it. Few will want to use such
configuration though.

I don't see a problem with depending on CONFIG_PM though.

> 
> The alternative would probably be to keep the s_power implementation
> when !CONFIG_PM which is certinaly not something we want.
> 
> > Also I see very few #ifdef CONFIG_PM in drivers/media/i2c so either
> > the CONFIG_PM dependency is not an issue or most sensor drivers don't
> > care.
> 
> This seems like an overlook, I think drivers that rely on runtime pm
> do need to depend on PM in Kconfig.

Runtime PM has nop functions that are used instead if it's disabled in
kernel configuration. #ifdef's shouldn't be used.

-- 
Regards,

Sakari Ailus



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux