On Sun, Nov 28, 2010 at 08:05:06PM +0100, Guennadi Liakhovetski wrote: > On Sun, 28 Nov 2010, Alberto Panizzo wrote: > > In certain machines, camera devices are supplied directly > > by a number of regulators. This patch add the ability to drive > > these regulators directly by the soc_camera driver. > IIRC, there has been a discussion a while ago, how to supply power to > cameras by regulators. Someone has tried to provide a .power() hook in the > platform code, but the problem was the order of driver loading / probing. > So, how about doing the following: > 1. in your platform code you register a notifier like > bus_register_notifier(&soc_camera_bus_type, &cam_notifier); FWIW I'm looking at implementing a standard regulator API feature along these lines in the background. This should hopefully mean we don't need driver support for most simple power control applications. No ETA yet. > The reasons why I do not want to add this to the core are: (1) I do not > want to have two methods for turning power on and off: a platform provided > .power() hook and and a set of regulators, (2) would anyone really want to > use several regulators for a camera sensor? If so, can it be the case, > that, for example, the regulators have to be switched off in the reverse > order to switching on? Or something else? (3) regulators can often do > more, than just set one of two power levels - for on and off. What if a > need arises to use other voltages? The way MMC handled this was to provide a standard version of the hook in the core which could be used by platforms with regulators supplying the device - they just assign the appropriate function as their power() operation AIUI. That seems a fairly clean way of keeping stuff in the core without giving up the flexibility. > Is there any really good reason, why we _have_ to do this in soc-camera > core? It does save everyone open coding stuff. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html