S3C64XX I2S: Added machine driver for WM8580
PATCH 1/1 S3C64XX I2S: Added machine driver for WM8580
New machine driver for WM8580 I2S i/f on SMDK64XX.
By default SoC-Slave is set and WM8580 is configured to use it's PLLA to generate clocks from a 12MHz crystal attached to WM8580.
--- sound/soc/s3c24xx/Kconfig | 8 + sound/soc/s3c24xx/Makefile | 2 + sound/soc/s3c24xx/smdk64xx_wm8580.c | 284 +++++++++++++++++++++++++++++++++++ 3 files changed, 294 insertions(+), 0 deletions(-) create mode 100644 sound/soc/s3c24xx/smdk64xx_wm8580.c
sound/soc/s3c24xx/Kconfig +8 -0
@@ -56,6 +56,14 @@ config SND_S3C24XX_SOC_JIVE_WM8750 help Sat Y if you want to add support for SoC audio on the Jive. +config SND_S3C64XX_SOC_WM8580 + tristate "SoC I2S Audio support for WM8580 on SMDK64XX" + depends on SND_S3C24XX_SOC && (MACH_SMDK6400 || MACH_SMDK6410) + select SND_SOC_WM8580 + select SND_S3C64XX_SOC_I2S + help + Sat Y if you want to add support for SoC audio on the SMDK64XX. + config SND_S3C24XX_SOC_SMDK2443_WM9710 tristate "SoC AC97 Audio support for SMDK2443 - WM9710" depends on SND_S3C24XX_SOC && MACH_SMDK2443
sound/soc/s3c24xx/Makefile +2 -0
@@ -23,6 +23,7 @@ snd-soc-s3c24xx-uda134x-objs := s3c24xx_uda134x.o snd-soc-s3c24xx-simtec-objs := s3c24xx_simtec.o snd-soc-s3c24xx-simtec-hermes-objs := s3c24xx_simtec_hermes.o snd-soc-s3c24xx-simtec-tlv320aic23-objs := s3c24xx_simtec_tlv320aic23.o +snd-soc-smdk64xx-wm8580-objs := smdk64xx_wm8580.o obj-$(CONFIG_SND_S3C24XX_SOC_JIVE_WM8750) += snd-soc-jive-wm8750.o obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o
@@ -33,4 +34,5 @@ obj-$(CONFIG_SND_S3C24XX_SOC_S3C24XX_UDA134X) += snd-soc-s3c24xx-uda134x.o obj-$(CONFIG_SND_S3C24XX_SOC_SIMTEC) += snd-soc-s3c24xx-simtec.o obj-$(CONFIG_SND_S3C24XX_SOC_SIMTEC_HERMES) += snd-soc-s3c24xx-simtec-hermes.o obj-$(CONFIG_SND_S3C24XX_SOC_SIMTEC_TLV320AIC23) += snd-soc-s3c24xx-simtec-tlv320aic23.o +obj-$(CONFIG_SND_S3C64XX_SOC_WM8580) += snd-soc-smdk64xx-wm8580.o
sound/soc/s3c24xx/smdk64xx_wm8580.c new file +284 -0
284 lines not on this page · raw message
Signature · 1 line
1.6.2.5
sound/soc/s3c24xx/smdk64xx_wm8580.c line 73
Quoted 4 lines · jassi brar
sound/soc/s3c24xx/smdk64xx_wm8580.c new file +4
-0+/* Exceptions for this CPU-CODEC combination */ +case 64000 : + rfs =384 ; +break ;
This needs to explain what the exceptions are for as well, otherwise anyone working with the code is going to have to work it out from scratch.
sound/soc/s3c24xx/smdk64xx_wm8580.c line 159
Quoted 6 lines
sound/soc/s3c24xx/smdk64xx_wm8580.c new file +6
-0+/* SMDK64xx Playback widgets */ +static const struct snd_soc_dapm_widget wm8580_dapm_widgets_pbk[] = { +SND_SOC_DAPM_HP ("Front-L/R" ,NULL ), +SND_SOC_DAPM_HP ("Center/Sub" ,NULL ), +SND_SOC_DAPM_HP ("Rear-L/R" ,NULL ), +};
All my previous comments about these and the way they're being configured still apply.
Quoted 10 lines · Mark Brown
Quoted 4 lines · jassi brar
+ /* Exceptions for this CPU-CODEC combination */
+ case 64000:
+ rfs = 384;
+ break;This needs to explain what the exceptions are for as well, otherwise anyone working with the code is going to have to work it out from scratch.
This note means stands for the forthcoming cases. The explanation is already given above the switch.
/* Currently, WM8580 driver doesn't support PLL-out rates
* other than those mentioned in Table-52 Page-58 of WM8580A
* manual. Some of these unavailable rates include
* {8000x256, 64000x256, 11025x256}Hz.
* As a wayout, we rather change rfs to a value that results in
* (params_rate(params) * rfs), and itself, acceptable to the both
* the CODEC and the CPU.
*/
The rates 64000, 8000 and 11025 are thus 'exceptions'.
Infact, these were the real cases that I pointed during MCLK/BCLK-RATIO discussions.
Currently, other cases work because 256fs RCLK is selected by default and these three don't
because there is no way to indicate it to the CODEC driver.
Quoted 9 lines
sound/soc/s3c24xx/smdk64xx_wm8580.c line 159
Quoted 6 lines
sound/soc/s3c24xx/smdk64xx_wm8580.c new file +6
-0+/* SMDK64xx Playback widgets */ +static const struct snd_soc_dapm_widget wm8580_dapm_widgets_pbk[] = { + SND_SOC_DAPM_HP("Front-L/R", NULL), + SND_SOC_DAPM_HP("Center/Sub", NULL), + SND_SOC_DAPM_HP("Rear-L/R", NULL), +};All my previous comments about these and the way they're being configured still apply.
Once 6channel support is up, i will submit a patch to implement audio routing options
using snd_soc_add_controls. Whereby user can set audio route on the device. For now, as we have only 2channels enabled, i decided to enable only Front-L/R and keep others disabled. Of the Mic and LineIn, we enable LineIn by default. How is that?
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 7 lines · jassi brar
This note means stands for the forthcoming cases. The explanation is already given above the switch.
/* Currently, WM8580 driver doesn't support PLL-out rates
* other than those mentioned in Table-52 Page-58 of WM8580A
* manual. Some of these unavailable rates include
* {8000x256, 64000x256, 11025x256}Hz.
Which version of the datasheet are you looking at? Table 52 in the current version 4.7 is (as it says) a list of example configurations, not an exhaustive list of supported configurations. Anything within the operating characteristics of the PLL is supported, set_pll() should enforce this where required.
Quoted 9 lines
Quoted 2 lines
All my previous comments about these and the way they're being configured still apply.
Once 6channel support is up, i will submit a patch to implement audio routing options
usingsnd_soc_add_controls. Whereby user can set audio route on the device. For now, as we have only 2channels enabled, i decided to enable only Front-L/R and keep others disabled. Of the Mic and LineIn, we enable LineIn by default. How is that?
Please just remove this for now or at most enable everything by default, like I say it's not buying anything except confusion as it stands.
If it's not present then the machine driver will immediately work when six channel support is added.
Quoted 10 lines · Mark Brown
Quoted 7 lines · jassi brar
This note means stands for the forthcoming cases. The explanation is already given above the switch.
/* Currently, WM8580 driver doesn't support PLL-out rates
* other than those mentioned in Table-52 Page-58 of WM8580A
* manual. Some of these unavailable rates include
* {8000x256, 64000x256, 11025x256}Hz.
Quoted 5 lines
Which version of the datasheet are you looking at? Table 52 in the current version 4.7 is (as it says) a list of example configurations, not an exhaustive list of supported configurations. Anything within the operating characteristics of the PLL is supported,
set_pll()should enforce this where required.
That very manual. And i don't say the WM8580 doesn't support, I said the WM8580 driver doesn't support: which can be verified looking at the CODEC driver.
Theoretically all output clocks are possible but usually the PLL coefficients have limits on their value and thus final output. WM8580 driver too seems to enforce that.
Though, you wud know better of WM8580.
Quoted 11 lines
Quoted 9 lines
Quoted 2 lines
All my previous comments about these and the way they're being configured still apply.
Once 6channel support is up, i will submit a patch to implement audio routing options
usingsnd_soc_add_controls. Whereby user can set audio route on the device. For now, as we have only 2channels enabled, i decided to enable only Front-L/R and keep others disabled. Of the Mic and LineIn, we enable LineIn by default. How is that?Please just remove this for now or at most enable everything by default,
Will enable all and submit again.
Thanks.
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 6 lines · jassi brar
Quoted 2 lines
sound/soc/s3c24xx/smdk64xx_wm8580.c line 53
Quoted 2 lines
sound/soc/s3c24xx/smdk64xx_wm8580.c new file +2
-0+/* Currently, WM8580 driver doesn't support PLL-out rates +* other than those mentioned in Table-52 Page-58 of WM8580A That very manual. And i don't say the WM8580 doesn't support, I said the WM8580 driver doesn't support: which can be verified looking at the CODEC driver.
Your comment says that only the output frequencies in table 52 are supported. Could you please provide more specific references to where this is done in the driver? I think you're confusing the fact that the example table lists most of the common audio frequencies with what the driver supports here.
Quoted 4 lines
Theoretically all output clocks are possible but usually the PLL coefficients have limits on their value and thus final output. WM8580 driver too seems to enforce that.
Though, you wud know better of WM8580.
So what you're actually saying is that 256fs doesn't give us the option of an an in-range Fvco for the FLL at those frequencies (which is the check I think you're talking about here)? That's a limitation of the chip.
Certainly, the comment is not accurate - the contents of table 52 aren't relevant here, the driver is calculating what it can do dynamically so the restrictions are a combination of the limits on Fvco and the pre and post scaling dividers available.
Quoted 9 lines · Mark Brown
Quoted 6 lines · jassi brar
Quoted 2 lines
Quoted 2 lines
+ /* Currently, WM8580 driver doesn't support PLL-out rates
+ * other than those mentioned in Table-52 Page-58 of WM8580AThat very manual. And i don't say the WM8580 doesn't support, I said the WM8580 driver doesn't support: which can be verified looking at the CODEC driver.
Quoted 5 lines
Your comment says that only the output frequencies in table 52 are supported. Could you please provide more specific references to where this is done in the driver? I think you're confusing the fact that the example table lists most of the common audio frequencies with what the driver supports here.
Let me be precise.
With this machine driver and the WM8580 CODEC driver from origin/for-2.6.32 if we do any of the following:-
snd_soc_dai_set_pll(codec_dai, WM8580_PLLA, 12000000, 8000*256); snd_soc_dai_set_pll(codec_dai, WM8580_PLLA, 12000000, 11025*256); snd_soc_dai_set_pll(codec_dai, WM8580_PLLA, 12000000, 64000*256);
we get the error: "wm8580: Unable to scale output frequency"
Quoted 5 lines
Quoted 4 lines
Theoretically all output clocks are possible but usually the PLL coefficients have limits on their value and thus final output. WM8580 driver too seems to enforce that.
Though, you wud know better of WM8580.
Quoted 8 lines
So what you're actually saying is that 256fs doesn't give us the option of an an in-range Fvco for the FLL at those frequencies (which is the check I think you're talking about here)? That's a limitation of the chip.
Certainly, the comment is not accurate - the contents of table 52 aren't relevant here, the driver is calculating what it can do dynamically so the restrictions are a combination of the limits on Fvco and the pre and post scaling dividers available.
Of course, there just might be a set of values for PLL coeffs that output 256fs for 8000, 11025 and 64000. If that set is within acceptable range of of the chip then it's just a matter of driver upgrade otherwise its a limitation
of the chip.
You wud know which case is it.
I apologize if my inappropriate selection of expression bothered you. In future, please feel free to suggest modification of any comment in the code. Regards.
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 8 lines · jassi brar
On Thu, Sep 17, 2009 at 10:11 PM, Mark Brown
Quoted 5 lines
Your comment says that only the output frequencies in table 52 are supported. Could you please provide more specific references to where this is done in the driver? I think you're confusing the fact that the example table lists most of the common audio frequencies with what the driver supports here.
Quoted 7 lines
Let me be precise.
With this machine driver and the WM8580 CODEC driver from origin/for-2.6.32 if we do any of the following:-snd_soc_dai_set_pll(codec_dai, WM8580_PLLA, 12000000, 8000*256); snd_soc_dai_set_pll(codec_dai, WM8580_PLLA, 12000000, 11025*256); snd_soc_dai_set_pll(codec_dai, WM8580_PLLA, 12000000, 64000*256);we get the error: "wm8580: Unable to scale output frequency"
Right, this is nothing to do with the list of example configurations and everything to do with the fact that those options are just not supported by the hardware. For example, 256fs for 8kHz is only 2.048MHz and even the largest postscale divider of 24 can't get anywhere near that from 90MHz which is the minimum Fvco for the PLL.
Quoted 3 lines
I apologize if my inappropriate selection of expression bothered you. In future, please feel free to suggest modification of any comment in the code. Regards.
Part of the issue here is that my review is in part based on the comments. If the code (including comments) seems obviously incorrect from reading then that's an issue in itself.