Skip to content

Rpi 4.4.y adau1977 #1454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2016
Merged

Conversation

andrey2805
Copy link
Contributor

The following 2 commits are result of my work on bring up of ADAU1977 ADC on RPI 2b+.
They add basic support for the codec usage including: Device tree overlay, binding I2S bus and setting I2S mode, clock source and frequency setting according to specification.

@andrey2805
Copy link
Contributor Author

Forgot to mention that the adau1977-adc is based on HifiBerry DAC driver by Florian Meier and the guides and specs for the HW are at http://www.analog.com/en/products/audio-video/audio-ad-converters/adau1977.html#product-overview

@pelwell
Copy link
Contributor

pelwell commented May 4, 2016

There are a number of problems with this PR:

  1. Overlays belong in arch/arm/boot/dts/overlays.
  2. Why aren't the two overlays combined into one?
  3. Make the card definition in the overlay (the one with the i2s-controller property) the last fragment - that will allow it to be dynamically unloaded with crashing.
  4. Change the comment at the top of the -adc overlay.
  5. Overlays need to be compiled, for which you need add them into arch/arm/boot/dts/overlays/Makefile. Please observe alphabetical order.
  6. I require an entry in the README for each overlay. Copy the formatting of other entries, insert in alphabetical order and don't use TABs.
  7. Your driver needs to be compiled, for which you need to add something to sound/soc/bcm/Makefile.
  8. Although copying is allowed, it is polite to mention the author of any work you have copied from.
  9. I don't think you need to add an of_device_id/compatible string to the I2C driver. It is a feature of the I2C subsystem that it will look for the element after the comma in a compatible string and look it up using the i2c_device_id table. In fact I think that including an explicit compatible string can stop the device type matching feature from working (the same I2C driver supports multiple devices by returning different IDs for different devices - see the use of ADAU1977 and ADAU1988 in the i2c_device_id table).
  10. It is better not to modify upstream code if you can avoid it.

There may be more, but that's enough for now.

@andrey2805
Copy link
Contributor Author

Thanks for your comments, will rework in short time.

@andrey2805
Copy link
Contributor Author

Here are the follow-up commits.

@andrey2805
Copy link
Contributor Author

And another minor typo...

@@ -161,6 +161,13 @@ Params:
and the other i2c baudrate parameters.


Name: adau1977-adc
Info: Overlay for activation of ADAU1977 ADC codec over I2C for conrtrol
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo ("conrtrol" -> "control") and whitespace at the end of this line.

@pelwell
Copy link
Contributor

pelwell commented May 5, 2016

The final pieces you are missing are the additions to bcmrpi_defconfig and bcm2709_defconfig to cause the codec and card driver to be built:

diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig
index 54c8f4e..47bd1c2 100644
--- a/arch/arm/configs/bcm2709_defconfig
+++ b/arch/arm/configs/bcm2709_defconfig
@@ -861,6 +861,7 @@ CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m
 CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m
 CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
 CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
+CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
 CONFIG_SND_SOC_ADAU1701=m
 CONFIG_SND_SOC_WM8804_I2C=m
 CONFIG_SND_SIMPLE_CARD=m
diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig
index 13471cc..d66fcd4 100644
--- a/arch/arm/configs/bcmrpi_defconfig
+++ b/arch/arm/configs/bcmrpi_defconfig
@@ -853,6 +853,7 @@ CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m
 CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m
 CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
 CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
+CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
 CONFIG_SND_SOC_ADAU1701=m
 CONFIG_SND_SOC_WM8804_I2C=m
 CONFIG_SND_SIMPLE_CARD=m

Make the changes I have suggested, then squash all the commits into one and update your PR using git push -f.

@andrey2805 andrey2805 force-pushed the rpi-4.4.y-adau1977 branch from f40885c to 9cd196c Compare May 6, 2016 03:15
@andrey2805
Copy link
Contributor Author

Done.

@@ -161,6 +161,13 @@ Params:
and the other i2c baudrate parameters.


Name: adau1977-adc
Info: Overlay for activation of ADAU1977 ADC codec over I2C for control
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still have whitespace at the end of this line.

@pelwell
Copy link
Contributor

pelwell commented May 6, 2016

Remove the trailing whitespace plus the two dev_info()s, squash and push, and I will merge it.

This commit adds basic support for the codec usage including: Device tree overlay,
binding I2S bus and setting I2S mode, clock source and frequency setting according
to spec.

Signed-off-by: Andrey Grodzovsky <[email protected]>
@andrey2805 andrey2805 force-pushed the rpi-4.4.y-adau1977 branch from 9cd196c to 055cc05 Compare May 7, 2016 00:56
@andrey2805
Copy link
Contributor Author

Done.

@pelwell pelwell merged commit 9083d49 into raspberrypi:rpi-4.4.y May 7, 2016
popcornmix added a commit to raspberrypi/firmware that referenced this pull request May 13, 2016
kernel: adau1977-adc: Add basic machine driver for adau1977 codec driver
See: raspberrypi/linux#1454

kernel: Allow up to 24dB digital gain to be applied when using IQAudIO DAC
See: raspberrypi/linux#1458

kernel: config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE
See: raspberrypi/linux#1456

kernel: Rpi 4.4.y: HDMI hotplug detection, overlay cleanup
See: raspberrypi/linux#1457

kernel: BCM270X_DT: Add umbrella I2C Mux overlay i2c-mux
See: raspberrypi/linux#1465

kernel: BCM270X_DT: Fix the tinylcd35 overlay RTC support

firmware: ldconfig: Support filter based on gpio level
firmware: ldconfig: Allow specifying a overlay_prefix from config.txt
See: #593

firmware: dispmanx: Avoid dispmanx updates when running vc4-kms-v3d driver
See: #595

firmware: RIL Camera: Correct buffer size checking for RGB and BGR888
firmware: RIL video_encode: Add support for levels 4.1 and 4.2
firmware: IMX219: Add assert on failure to init
firmware: imx219: New VGA and full FOV 720p modes
firmware: imx219: Reorder modes to roughly match OV5647
firmware: imx219: Enable sensor DPC
See: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=145815
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request May 13, 2016
kernel: adau1977-adc: Add basic machine driver for adau1977 codec driver
See: raspberrypi/linux#1454

kernel: Allow up to 24dB digital gain to be applied when using IQAudIO DAC
See: raspberrypi/linux#1458

kernel: config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE
See: raspberrypi/linux#1456

kernel: Rpi 4.4.y: HDMI hotplug detection, overlay cleanup
See: raspberrypi/linux#1457

kernel: BCM270X_DT: Add umbrella I2C Mux overlay i2c-mux
See: raspberrypi/linux#1465

kernel: BCM270X_DT: Fix the tinylcd35 overlay RTC support

firmware: ldconfig: Support filter based on gpio level
firmware: ldconfig: Allow specifying a overlay_prefix from config.txt
See: raspberrypi/firmware#593

firmware: dispmanx: Avoid dispmanx updates when running vc4-kms-v3d driver
See: raspberrypi/firmware#595

firmware: RIL Camera: Correct buffer size checking for RGB and BGR888
firmware: RIL video_encode: Add support for levels 4.1 and 4.2
firmware: IMX219: Add assert on failure to init
firmware: imx219: New VGA and full FOV 720p modes
firmware: imx219: Reorder modes to roughly match OV5647
firmware: imx219: Enable sensor DPC
See: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=145815
neuschaefer pushed a commit to neuschaefer/raspi-binary-firmware that referenced this pull request Feb 27, 2017
kernel: adau1977-adc: Add basic machine driver for adau1977 codec driver
See: raspberrypi/linux#1454

kernel: Allow up to 24dB digital gain to be applied when using IQAudIO DAC
See: raspberrypi/linux#1458

kernel: config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE
See: raspberrypi/linux#1456

kernel: Rpi 4.4.y: HDMI hotplug detection, overlay cleanup
See: raspberrypi/linux#1457

kernel: BCM270X_DT: Add umbrella I2C Mux overlay i2c-mux
See: raspberrypi/linux#1465

kernel: BCM270X_DT: Fix the tinylcd35 overlay RTC support

firmware: ldconfig: Support filter based on gpio level
firmware: ldconfig: Allow specifying a overlay_prefix from config.txt
See: raspberrypi#593

firmware: dispmanx: Avoid dispmanx updates when running vc4-kms-v3d driver
See: raspberrypi#595

firmware: RIL Camera: Correct buffer size checking for RGB and BGR888
firmware: RIL video_encode: Add support for levels 4.1 and 4.2
firmware: IMX219: Add assert on failure to init
firmware: imx219: New VGA and full FOV 720p modes
firmware: imx219: Reorder modes to roughly match OV5647
firmware: imx219: Enable sensor DPC
See: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=145815
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants