Message ID | 20230811201406.4096210-1-contact@jookia.org |
---|---|
Headers | show |
Series | sun4i-i2s: Support channel remapping | expand |
On Sat, Aug 12, 2023 at 06:14:06AM +1000, John Watts wrote: > The sun4i I2S controller supports mapping arbitrary TDM slots to > each channel. Allow this to be expressed in the device tree. > > This is currently only implemented in the R329 I2S variant. > > Allow this to be configured using a new channel-dins property. > > Signed-off-by: John Watts <contact@jookia.org> > --- > .../bindings/sound/allwinner,sun4i-a10-i2s.yaml | 8 ++++++++ > 1 file changed, 8 insertions(+) Same comments on this one.
On Sat, Aug 12, 2023 at 06:13:59AM +1000, John Watts wrote: > First, I split up channel-dins and channel-slots. This is mainly > because I implemented one first but both of them only make sense > together. The registers themselves use a format of a byte per > channel with the upper nibble being the din and the lower being > the slot. Perhaps this is a better format to copy? I think this is fine. > Third, channel-slots is available on all sun4i-i2s controllers, > but I only have it implemented on the R329 variant for now when > there are multiple din pins. > I could add support for this on older controllers but there's not > really a use case for manual configuration as there's no DIN > and I don't have hardware to test it on. It's fine to leave this for someone who cares about that hardware to implement, might be nice to add a warning if the properties are set but not supported but it's not essential. > Fourth, I don't limit the readable channels to the channels > listed. Reading more channels than you have currently results in > the controller assuming you want to use TDM, but that's not the > case here and you can have strange duplicate channels show up. It would be better to have constraints which prevent userspace doing the wrong thing here. > Fifth, it might be a good idea to increase the maximum channels > from 8 to 16, especially if people are going to be running > multiple TDM streams on one controller. If there's no reason not to...