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