Add overlay for Chipdip I2S master DAC#4444
Add overlay for Chipdip I2S master DAC#4444pelwell merged 7 commits intoraspberrypi:rpi-5.10.yfrom chipdipru:rpi-5.10.y
Conversation
pelwell
left a comment
There was a problem hiding this comment.
- The overlay file has the wrong name -
chipdip-i2s-master-dac-overlay.dtsis required, otherwise the kernelmakerules won't work. - There is no Makefile entry for the overlay.
- There is no README entry for the overlay.
- See inline comments.
|
Hello! Thank you for paying attention to the request. Your comments were taken into account axcept two: about Makefile entry and README entry for the overlay. I am very new to the system, could you please give a link with explanation or example of what I shall do. Thank you. |
|
Every overlay needs an entry in arch/arm/boot/dts/overlays/Makefile and arch/arm/boot/dts/overlays/README. Without the Makefile entry the overlay will not be compiled and installed. Without the README entry users will not be able to discover the overlay (using the command The Makefile entry is very simple - it just needs a line with the name of the overlay once compiled - in your case The README entry is also not difficult to write, but you need to follow some strict rules:
Just find an entry for a simple overlay with no parameters and copy it, being sure to update the names and description. |
|
Thank you very much for explanation! Changes are made to Makefile and README files. It seems that I have placed "chipdip-i2s-master-dac-overlay.dts" overlay in wrong folder. Now it is in arch/arm/boot/dts, but other similar overlays for sound cards are in arch/arm/boot/dts/overlays/. Is it possible at this stage to change folder and place "chipdip-i2s-master-dac-overlay.dts" in arch/arm/boot/dts/overlays/ ? |
|
I'll review your updates later, but in the meantime you can move the overlay using "git mv ", "git commit" and "git push ..." in the usual way. |
…rm/boot/dts/overlays/chipdip-i2s-master-dac-overlay.dts
|
Thank you! |
|
Excuse me for offtop, but I did not manage to find any information regarding to the following situation. |
|
I'm happy with that. If you give me an name/email address for the "Signed-off-by:" line I can squash and merge your commits.
The kernel won't launch any user processes - it relies on systemd, udev and other external mechanisms to start programs in response to events. With a bit more information about the sequence of operations involved I can perhaps suggest an approach that might work. |
|
Thanks a lot!
Thank you for your help! |
|
A better way to achieve what you are trying to do would have been to write a codec driver that, instead of sending I2C commands to configure the real codec, changes the GPIOs for you. I don't think it would be a lot of work, it should be more responsive and more efficient, and it doesn't need the user or distribution to install and start any extra programs. |
|
Thank you very much for help! |
|
Phil, when is new release of the kernel planned? |
|
We never provide guarantees on updates - we don't work to a strict schedule - but the usual "rule of thumb" is:
|
|
Thank you. |
See: raspberrypi/linux#4433 kernel: media: bcm2835-unicam: Forward input status from subdevice See: raspberrypi/linux#4437 kernel: bcm2711_thermal: Don't clamp temperature at zero See: raspberrypi/linux#4438 kernel: vc4/drm: Pick up more upstream patches See: raspberrypi/linux#4441 kernel: Add overlay for Chipdip I2S master DAC See: raspberrypi/linux#4444
See: raspberrypi/linux#4433 kernel: media: bcm2835-unicam: Forward input status from subdevice See: raspberrypi/linux#4437 kernel: bcm2711_thermal: Don't clamp temperature at zero See: raspberrypi/linux#4438 kernel: vc4/drm: Pick up more upstream patches See: raspberrypi/linux#4441 kernel: Add overlay for Chipdip I2S master DAC See: raspberrypi/linux#4444
|
Hello, Phil! We need to have the same overlay in the 4.19.y kernel. What do we have to do for that? Shall we create a new pull request and as a base repository select rpi-4.19.y or should this be done in some other way? |
|
We won't be building any more 4.19 kernels, but the commit is in rpi-4.19.y tree now: bfef951 |
|
Thank you very much! |
Phil, as you suggested I am trying writing driver for our sound cards. Being new to the kernel I have difficulties I have not yet managed to break through. I looked through drivers available for other cards https://github.com/raspberrypi/linux/tree/rpi-5.10.y/sound/soc/bcm but did not understand their principles. I could not find information on how drivers are called, how (from where) their functions are called, how actually the system knows what functions are included in a driver or maybe there is some another software thing which is aware of the dirver internals. |
|
I guess I've been putting off this reply because saying exactly what you need to do would take a long time (including some research because I'm not really fluent in ALSA). First of all, I made a mistake in my comment when I suggested writing a codec driver - a sound card driver would be a better fit, because you want to make use of the existing spdif-dit codec but also intercept the hw_params method. Rather than write it all out I'll suggest a few initial steps and then make it an interactive exchange:
|
|
Phil, thank you very much for help! |
|
Modules are located based on the various aliases that they export - "of:" aliases contain compatible strings. All aliases end up in so the path above can be rewritten as: If your intention is to get this module into our kernel tree eventually then I suggest you save some time and make it an in-tree module now, at which point |
|
Look at https://github.com/pelwell/linux/tree/chipdipdac - all I had to do was change the CODEC string to spdif-transmitter and it loaded OK. You'll need to add a README and make the soundcard driver do something useful with the hw_params. |
|
Oh, Phil, thank you endlessly! Now it works as expected. I am searching information on GPIO usage. Drivers using GPIOs, I looked through, get information about GPIOs from overlay. Is it possible to assign GPIOs in driver directly leaving overlay without GPIO information? |
|
I have added code for GPIO to the driver and overlay. It seems the driver works as expected and controls GPIOs. I am going to test it for some time to be sure everything is correct. Thank you very much, Phil! |
|
Congratulations. I think you made the right choice by putting the GPIO declarations in the overlay - it makes the code simpler. Have a think about whether you want to replace the old overlay with the new one - I allowed them to coexist, but there's probably no reason to keep the old one as well. I'll take another pull request when you're ready, and don't feel you need to keep my Signed-off-by on the commits - it's just how I have git configured. |
|
Yes of cause, it would be better to replace the old overlay by a newer one. As for Signed-off-by field, if you do not mind I am going to add you as driver co author because without your help it would be much longer way to get it working. |
|
I'm fine with that, although I don't feel it's necessary. |
Configures Raspberry PI to work as I2S slave with BCLK = 64Fs. Tested on Raspberry PI3 with Chipdip I2S master DACs based on ADAU1701 and PCM5242.