Mauro Carvalho Chehab | b67b81d | 2016-07-22 09:38:58 -0300 | [diff] [blame^] | 1 | V4L2 clocks |
| 2 | ----------- |
| 3 | |
| 4 | .. attention:: |
| 5 | |
| 6 | This is a temporary API and it shall be replaced by the generic |
| 7 | clock API, when the latter becomes widely available. |
| 8 | |
| 9 | Many subdevices, like camera sensors, TV decoders and encoders, need a clock |
| 10 | signal to be supplied by the system. Often this clock is supplied by the |
| 11 | respective bridge device. The Linux kernel provides a Common Clock Framework for |
| 12 | this purpose. However, it is not (yet) available on all architectures. Besides, |
| 13 | the nature of the multi-functional (clock, data + synchronisation, I2C control) |
| 14 | connection of subdevices to the system might impose special requirements on the |
| 15 | clock API usage. E.g. V4L2 has to support clock provider driver unregistration |
| 16 | while a subdevice driver is holding a reference to the clock. For these reasons |
| 17 | a V4L2 clock helper API has been developed and is provided to bridge and |
| 18 | subdevice drivers. |
| 19 | |
| 20 | The API consists of two parts: two functions to register and unregister a V4L2 |
| 21 | clock source: v4l2_clk_register() and v4l2_clk_unregister() and calls to control |
| 22 | a clock object, similar to the respective generic clock API calls: |
| 23 | v4l2_clk_get(), v4l2_clk_put(), v4l2_clk_enable(), v4l2_clk_disable(), |
| 24 | v4l2_clk_get_rate(), and v4l2_clk_set_rate(). Clock suppliers have to provide |
| 25 | clock operations that will be called when clock users invoke respective API |
| 26 | methods. |
| 27 | |
| 28 | It is expected that once the CCF becomes available on all relevant |
| 29 | architectures this API will be removed. |