]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda/cs8409: Dont disable I2C clock between consecutive accesses
authorLucas Tanure <tanureal@opensource.cirrus.com>
Wed, 11 Aug 2021 18:56:40 +0000 (19:56 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 12 Aug 2021 11:41:48 +0000 (13:41 +0200)
commitd85ca15dff27797f3e00cf8f53ce1d9f2f45bd38
tree5cae1d43034d42f9cb89358b32eb50f7fbdbbdd0
parentb3db1f78baa2250cd68a9b4f5fdc0b171c4f229c
ALSA: hda/cs8409: Dont disable I2C clock between consecutive accesses

Only disable I2C clock 25 ms after not being used.

The current implementation enables and disables the I2C clock for each
I2C transaction. Each enable/disable call requires two verb transactions.
This means each I2C transaction requires a total of four verb transactions
to enable and disable the clock.
However, if there are multiple consecutive I2C transactions, it is not
necessary to enable and disable the clock each time, instead it is more
efficient to enable the clock for the first transaction, and disable it
after the final transaction, which would improve performance.
This is achieved by using a timeout which disables the clock if no request
to enable the clock has occurred for 25 ms.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210811185654.6837-14-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_cs8409.c
sound/pci/hda/patch_cs8409.h