]> git.baikalelectronics.ru Git - kernel.git/commit
spi: spi-imx: only enable the clocks when we start to transfer a message
authorHuang Shijie <b32955@freescale.com>
Wed, 23 Oct 2013 08:31:50 +0000 (16:31 +0800)
committerMark Brown <broonie@linaro.org>
Wed, 23 Oct 2013 09:05:05 +0000 (10:05 +0100)
commitf8efb2818158a1d1b654e333ab8d39851c4d1a22
tree301c4529564252aba7328e5bf6d264a20390db5f
parent86d248508222ff9e0e44bd8a8f911f814c598a6f
spi: spi-imx: only enable the clocks when we start to transfer a message

Current code keeps the clocks enabled all the time, it wastes the power
when there is no operaiton on the spi controller.

In order to save the power, this patch adds the two hooks:
   spi_imx_prepare_message: enable the clocks for this message
   spi_imx_unprepare_message: disable the clocks.

This patch also disables the clocks in the end of the probe.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-imx.c