mbox series

[00/10] ASoC: mediatek: Set i2s clock sharing from machine drivers

Message ID 20220908161154.648557-1-nfraprado@collabora.com (mailing list archive)
Headers show
Series ASoC: mediatek: Set i2s clock sharing from machine drivers | expand

Message

Nícolas F. R. A. Prado Sept. 8, 2022, 4:11 p.m. UTC
The i2s ports on MediaTek SoCs only support a single data lane. In order
to achieve full-duplex operation thus two i2s ports, one for input and
one for output, need to be used together and sharing a single clock from
one of the ports.

This clock sharing setting was previously read by the sound platform
driver from the devicetree, but given that the input/output pairing is
closely related to which codecs are connected to which ports, the
machine sound driver can infer and set it, so that no DT property is
required.

At this point only mt8183-kukui was using the DT property, but given
that this property was never documented, and that the API introduced in
this series makes it obsolete, the undocumented DT property can safely
be removed.

This series adds a function to allow setting the i2s shared clocks,
makes use of it in the machine drivers as required, and removes the no
longer required DT properties and support for them in the drivers, for
all of mt8192, mt8183 and mt8186.


Nícolas F. R. A. Prado (10):
  ASoC: mediatek: mt8192: Allow setting shared clocks from machine
    driver
  ASoC: mediatek: mt8192-mt6359: Make i2s9 share the clock from i2s8
  ASoC: mediatek: mt8192: Remove clock share parsing from DT
  ASoC: mediatek: mt8183: Allow setting shared clocks from machine
    driver
  ASoC: mediatek: mt8183: Configure shared clocks
  ASoC: mediatek: mt8183: Remove clock share parsing from DT
  arm64: dts: mediatek: kukui: Remove i2s-share properties
  ASoC: mediatek: mt8186: Allow setting shared clocks from machine
    driver
  ASoC: mediatek: mt8186: Configure shared clocks
  ASoC: mediatek: mt8186: Remove clock share parsing from DT

 .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi |  5 --
 sound/soc/mediatek/mt8183/mt8183-afe-common.h |  3 ++
 .../mediatek/mt8183/mt8183-da7219-max98357.c  | 33 +++++++++++++
 sound/soc/mediatek/mt8183/mt8183-dai-i2s.c    | 45 ++++++++---------
 .../mt8183/mt8183-mt6358-ts3a227-max98357.c   | 33 +++++++++++++
 sound/soc/mediatek/mt8186/mt8186-afe-common.h |  3 ++
 sound/soc/mediatek/mt8186/mt8186-dai-i2s.c    | 44 ++++++++---------
 .../mt8186/mt8186-mt6366-da7219-max98357.c    | 18 +++++++
 .../mt8186/mt8186-mt6366-rt1019-rt5682s.c     | 18 +++++++
 sound/soc/mediatek/mt8192/mt8192-afe-common.h |  3 ++
 sound/soc/mediatek/mt8192/mt8192-dai-i2s.c    | 49 ++++++++-----------
 .../mt8192/mt8192-mt6359-rt1015-rt5682.c      |  9 ++++
 12 files changed, 180 insertions(+), 83 deletions(-)

Comments

Mark Brown Sept. 9, 2022, 10:45 p.m. UTC | #1
On Thu, 8 Sep 2022 12:11:44 -0400, Nícolas F. R. A. Prado wrote:
> The i2s ports on MediaTek SoCs only support a single data lane. In order
> to achieve full-duplex operation thus two i2s ports, one for input and
> one for output, need to be used together and sharing a single clock from
> one of the ports.
> 
> This clock sharing setting was previously read by the sound platform
> driver from the devicetree, but given that the input/output pairing is
> closely related to which codecs are connected to which ports, the
> machine sound driver can infer and set it, so that no DT property is
> required.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[01/10] ASoC: mediatek: mt8192: Allow setting shared clocks from machine driver
        commit: 8ae4fcfd5b11b5c33154732fcad99ad0f5843ce2
[02/10] ASoC: mediatek: mt8192-mt6359: Make i2s9 share the clock from i2s8
        commit: 3ffb9fa3963964a730c34f48e502ac0625efc145
[03/10] ASoC: mediatek: mt8192: Remove clock share parsing from DT
        commit: 9ccd51ce396a46d9d4d0c87aa6a82dd26a2f281a
[04/10] ASoC: mediatek: mt8183: Allow setting shared clocks from machine driver
        commit: fea84890e5c1fb65ae8e25b2f9b86363af1f45f2
[05/10] ASoC: mediatek: mt8183: Configure shared clocks
        commit: 4583392a135cc30409f5a6ceebb8374e550b03e0
[06/10] ASoC: mediatek: mt8183: Remove clock share parsing from DT
        commit: cbebe67859a0e8d51e578fdd9f927f8ef2504ba4
[07/10] arm64: dts: mediatek: kukui: Remove i2s-share properties
        commit: b3821f7839c2ec322926d16557aff29f4be1f4dc
[08/10] ASoC: mediatek: mt8186: Allow setting shared clocks from machine driver
        commit: 4132a778e806f77c2bd01a9a34b07edc9dd99d76
[09/10] ASoC: mediatek: mt8186: Configure shared clocks
        commit: 9986bdaee4776c5d595933cace9d54c6bc084e91
[10/10] ASoC: mediatek: mt8186: Remove clock share parsing from DT
        commit: 62da80c6a124dd68b12c4d2197ecc74b79823571

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Matthias Brugger Sept. 13, 2022, 3:56 p.m. UTC | #2
On 10/09/2022 00:45, Mark Brown wrote:
> On Thu, 8 Sep 2022 12:11:44 -0400, Nícolas F. R. A. Prado wrote:
>> The i2s ports on MediaTek SoCs only support a single data lane. In order
>> to achieve full-duplex operation thus two i2s ports, one for input and
>> one for output, need to be used together and sharing a single clock from
>> one of the ports.
>>
>> This clock sharing setting was previously read by the sound platform
>> driver from the devicetree, but given that the input/output pairing is
>> closely related to which codecs are connected to which ports, the
>> machine sound driver can infer and set it, so that no DT property is
>> required.
>>
>> [...]
> 
> Applied to
> 
>     https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
> 
> Thanks!
> 
> [01/10] ASoC: mediatek: mt8192: Allow setting shared clocks from machine driver
>          commit: 8ae4fcfd5b11b5c33154732fcad99ad0f5843ce2
> [02/10] ASoC: mediatek: mt8192-mt6359: Make i2s9 share the clock from i2s8
>          commit: 3ffb9fa3963964a730c34f48e502ac0625efc145
> [03/10] ASoC: mediatek: mt8192: Remove clock share parsing from DT
>          commit: 9ccd51ce396a46d9d4d0c87aa6a82dd26a2f281a
> [04/10] ASoC: mediatek: mt8183: Allow setting shared clocks from machine driver
>          commit: fea84890e5c1fb65ae8e25b2f9b86363af1f45f2
> [05/10] ASoC: mediatek: mt8183: Configure shared clocks
>          commit: 4583392a135cc30409f5a6ceebb8374e550b03e0
> [06/10] ASoC: mediatek: mt8183: Remove clock share parsing from DT
>          commit: cbebe67859a0e8d51e578fdd9f927f8ef2504ba4
> [07/10] arm64: dts: mediatek: kukui: Remove i2s-share properties
>          commit: b3821f7839c2ec322926d16557aff29f4be1f4dc

DTS should go through my branch. We can see if there are any merge conflicts in 
linux-next and fix them somehow or you drop the patch and I take it through my 
tree. As you like.

Regards,
Matthias

> [08/10] ASoC: mediatek: mt8186: Allow setting shared clocks from machine driver
>          commit: 4132a778e806f77c2bd01a9a34b07edc9dd99d76
> [09/10] ASoC: mediatek: mt8186: Configure shared clocks
>          commit: 9986bdaee4776c5d595933cace9d54c6bc084e91
> [10/10] ASoC: mediatek: mt8186: Remove clock share parsing from DT
>          commit: 62da80c6a124dd68b12c4d2197ecc74b79823571
> 
> All being well this means that it will be integrated into the linux-next
> tree (usually sometime in the next 24 hours) and sent to Linus during
> the next merge window (or sooner if it is a bug fix), however if
> problems are discovered then the patch may be dropped or reverted.
> 
> You may get further e-mails resulting from automated or manual testing
> and review of the tree, please engage with people reporting problems and
> send followup patches addressing any issues that are reported if needed.
> 
> If any updates are required or you are submitting further changes they
> should be sent as incremental updates against current git, existing
> patches will not be replaced.
> 
> Please add any relevant lists and maintainers to the CCs when replying
> to this mail.
> 
> Thanks,
> Mark
Mark Brown Sept. 13, 2022, 4:07 p.m. UTC | #3
On Tue, Sep 13, 2022 at 05:56:00PM +0200, Matthias Brugger wrote:

> DTS should go through my branch. We can see if there are any merge conflicts
> in linux-next and fix them somehow or you drop the patch and I take it
> through my tree. As you like.

Sorry, dropped now.
Mark Brown Sept. 13, 2022, 4:12 p.m. UTC | #4
On Thu, 8 Sep 2022 12:11:44 -0400, Nícolas F. R. A. Prado wrote:
> The i2s ports on MediaTek SoCs only support a single data lane. In order
> to achieve full-duplex operation thus two i2s ports, one for input and
> one for output, need to be used together and sharing a single clock from
> one of the ports.
> 
> This clock sharing setting was previously read by the sound platform
> driver from the devicetree, but given that the input/output pairing is
> closely related to which codecs are connected to which ports, the
> machine sound driver can infer and set it, so that no DT property is
> required.
> 
> [...]

Applied to

   broonie/sound.git for-next

Thanks!

[01/10] ASoC: mediatek: mt8192: Allow setting shared clocks from machine driver
        commit: 8ae4fcfd5b11b5c33154732fcad99ad0f5843ce2
[02/10] ASoC: mediatek: mt8192-mt6359: Make i2s9 share the clock from i2s8
        commit: 3ffb9fa3963964a730c34f48e502ac0625efc145
[03/10] ASoC: mediatek: mt8192: Remove clock share parsing from DT
        commit: 9ccd51ce396a46d9d4d0c87aa6a82dd26a2f281a
[04/10] ASoC: mediatek: mt8183: Allow setting shared clocks from machine driver
        commit: fea84890e5c1fb65ae8e25b2f9b86363af1f45f2
[05/10] ASoC: mediatek: mt8183: Configure shared clocks
        commit: 4583392a135cc30409f5a6ceebb8374e550b03e0
[06/10] ASoC: mediatek: mt8183: Remove clock share parsing from DT
        commit: cbebe67859a0e8d51e578fdd9f927f8ef2504ba4
[07/10] arm64: dts: mediatek: kukui: Remove i2s-share properties
        commit: b3821f7839c2ec322926d16557aff29f4be1f4dc
[08/10] ASoC: mediatek: mt8186: Allow setting shared clocks from machine driver
        commit: 4132a778e806f77c2bd01a9a34b07edc9dd99d76
[09/10] ASoC: mediatek: mt8186: Configure shared clocks
        commit: 9986bdaee4776c5d595933cace9d54c6bc084e91
[10/10] ASoC: mediatek: mt8186: Remove clock share parsing from DT
        commit: 62da80c6a124dd68b12c4d2197ecc74b79823571

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark