DT support for rx51-audio
Subsystems (6)
cover DT support for rx51-audio
Hi,
This patchset adds DT support in rx51-audio. I tested it on the Nokia N900 and was able to play sound with aplay using earphones and earspeaker. The Loudspeakers did not work. I don't know the reason.
The patchset consists of 4 patches:
1. convert rx51-audio to snd_soc_register_card()
2. init audio in rx51 platform file
3. add some DT helpers to ASoC core
4. add DT support to rx51-audio
Please note, that the patch is RFC level for now. For example non DT boot does not work, because I did not yet add pdata in boardcode.
Proposed DTS node would look like this:
sound: rx51-audio {
compatible = "nokia,rx51-audio";
ti,mcbsp = <&mcbsp2>;
ti,codec = <&tlv320aic3x>;
ti,codec_aux = <&tlv320aic3x_aux>;
ti,headset_amp = <&tpa6130a2>;
tvout-selection-gpio = <&gpio2 8 GPIO_ACTIVE_HIGH>; /* 40 */
jack-detection-gpio = <&gpio6 17 GPIO_ACTIVE_HIGH>; /* 177 */
eci-sw-gpio = <&gpio6 22 GPIO_ACTIVE_HIGH>; /* 182 */
speaker-amp-gpio = <&twl_gpio 7 GPIO_ACTIVE_HIGH>;
};-- Sebastian
Pali Rohár (2):
ASoC: omap: rx51: Use snd_soc_register_card
ARM: OMAP: rx51: Register audio device
Sebastian Reichel (2):
ASoC: Allow Aux Codecs to be specified using DT
ASoC: RX-51: Add DT support to sound driver
.../devicetree/bindings/sound/nokia,rx51.txt | 28 +++ .../devicetree/bindings/vendor-prefixes.txt | 1 + arch/arm/mach-omap2/board-rx51-peripherals.c | 11 ++ include/sound/rx51.h | 18 ++ include/sound/soc.h | 13 +- sound/soc/omap/omap-mcbsp.c | 5 +- sound/soc/omap/omap-mcbsp.h | 2 +- sound/soc/omap/rx51.c | 212 +++++++++++++++------ sound/soc/soc-core.c | 68 +++++-- 9 files changed, 277 insertions(+), 81 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/nokia,rx51.txt create mode 100644 include/sound/rx51.h
Signature · 1 line
1.8.4.rc3
RFC 1/4 ASoC: omap: rx51: Use snd_soc_register_card
From: Pali Rohár <[email protected]>
This patch converts the rx51 ASoC module to use snd_soc_register_card. It also adds module alias to support driver autoloading.
--- sound/soc/omap/rx51.c | 49 +++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-)
sound/soc/omap/rx51.c +29 -20
@@ -390,10 +390,9 @@ static struct snd_soc_card rx51_sound_card = { .num_configs = ARRAY_SIZE(rx51_codec_conf), }; -static struct platform_device *rx51_snd_device; - -static int __init rx51_soc_init (void ) +static int rx51_soc_probe (struct platform_device *pdev) { +struct snd_soc_card *card = &rx51_sound_card;int err;if (!machine_is_nokia_rx51 () && !of_machine_is_compatible ("nokia,omap3-n900" ))
@@ -408,22 +407,17 @@ static int __init rx51_soc_init(void)if (err) goto err_gpio_eci_sw; - rx51_snd_device =platform_device_alloc ("soc-audio" ,-1 ); -if (!rx51_snd_device) { - err = -ENOMEM ; - goto err1; - } - -platform_set_drvdata (rx51_snd_device, &rx51_sound_card); + card->dev = &pdev->dev; - err =platform_device_add (rx51_snd_device); -if (err) - goto err2; + err =snd_soc_register_card (card); +if (err) { +dev_err (&pdev->dev,"snd_soc_register_card failed (%d)\n" , err); + goto err_snd; + }return 0 ; -err2: -platform_device_put (rx51_snd_device); -err1: +err_snd: + card->dev =NULL ;gpio_free (RX51_ECI_SW_GPIO ); err_gpio_eci_sw:gpio_free (RX51_TVOUT_SEL_GPIO );
@@ -432,19 +426,34 @@ err_gpio_tvout_sel:return err; } -static void __exit rx51_soc_exit(void) +static int rx51_soc_remove (struct platform_device *pdev) { +struct snd_soc_card *card =platform_get_drvdata (pdev); +snd_soc_jack_free_gpios (&rx51_av_jack,ARRAY_SIZE (rx51_av_jack_gpios), rx51_av_jack_gpios); -platform_device_unregister (rx51_snd_device); +snd_soc_unregister_card (card); + card->dev =NULL ; +gpio_free (RX51_ECI_SW_GPIO );gpio_free (RX51_TVOUT_SEL_GPIO ); + +return 0 ; } -module_init (rx51_soc_init); -module_exit (rx51_soc_exit); +static struct platform_driver rx51_soc_driver = { + .driver = { + .name ="rx51-audio" , + .owner =THIS_MODULE , + }, + .probe = rx51_soc_probe, + .remove = rx51_soc_remove, +}; + +module_platform_driver (rx51_soc_driver);MODULE_AUTHOR ("Nokia Corporation" );MODULE_DESCRIPTION ("ALSA SoC Nokia RX-51" );MODULE_LICENSE ("GPL" ); +MODULE_ALIAS ("platform:rx51-audio" );
Signature · 1 line
1.8.4.rc3
Mark Brown
maintainerRe: [RFC 1/4] ASoC: omap: rx51: Use snd_soc_register_card
Quoted 5 lines · Sebastian Reichel
From: Pali Rohár <[email protected]>
This patch converts the rx51 ASoC module to use
snd_soc_register_card. It also adds module alias
to support driver autoloading.
You should really use devm_snd_soc_register_card() here.
Re: [RFC 1/4] ASoC: omap: rx51: Use snd_soc_register_card
In reply to Sebastian ReichelQuoted 8 lines · Sebastian Reichel
From: Pali Rohár <[email protected]>
This patch converts the rx51 ASoC module to use
snd_soc_register_card. It also adds module alias
to support driver autoloading.Signed-off-by Pali Rohár <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>
Signature · 6 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RFC 2/4 ARM: OMAP: rx51: Register audio device
In reply to Sebastian ReichelFrom: Pali Rohár <[email protected]>
This patch adds support for the audio chip to the legacy boardcode of the Nokia N900.
--- arch/arm/mach-omap2/board-rx51-peripherals.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/arm/mach-omap2/board-rx51-peripherals.c +11 -0
@@ -1205,6 +1205,16 @@ error:*/ } +static struct platform_device rx51_audio_device = { + .name ="rx51-audio" , + .id =-1 , +}; + +static void __init rx51_init_audio (void ) +{ +platform_device_register (&rx51_audio_device); +} +static struct tsc2005_platform_data tsc2005_pdata = { .ts_pressure_max =2048 , .ts_pressure_fudge =2 ,
@@ -1287,6 +1297,7 @@ void __init rx51_peripherals_init(void)gpmc_onenand_init (board_onenand_data);board_smc91x_init ();rx51_add_gpio_keys (); +rx51_init_audio ();rx51_init_wl1251 ();rx51_init_tsc2005 ();rx51_init_si4713 ();
Signature · 1 line
1.8.4.rc3
Re: [RFC 2/4] ARM: OMAP: rx51: Register audio device
Hi!
Quoted 4 lines
From: Pali Rohár <[email protected]>
This patch adds support for the audio chip to the legacy boardcode of the Nokia N900.
Quoted 2 lines · you
For example non DT boot
does not work, because I did not yet add pdata in boardcode.
So, perhaps we don't need this patch for now and can rely only do audio on device-tree-enabled configurations?
Thanks,
Pavel
Signature · 6 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RFC 3/4 ASoC: Allow Aux Codecs to be specified using DT
In reply to Sebastian ReichelThis patch adds support for specifying auxiliary codecs and codec configuration via device tree phandles.
This change adds new fields to snd_soc_aux_dev and snd_soc_codec_conf and adds support for the changes to SoC core methods.
--- include/sound/soc.h | 13 +++++++++- sound/soc/soc-core.c | 68 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 59 insertions(+), 22 deletions(-)
include/sound/soc.h +12 -1
@@ -937,7 +937,12 @@ struct snd_soc_dai_link { };struct snd_soc_codec_conf { +/* +* specify device either by device name, or by +* DT/OF node, but not both. +*/ const char *dev_name; +const struct device_node *of_node;/* * optional map of kcontrol, widget and path name prefixes that are
@@ -954,7 +959,13 @@ struct snd_soc_codec_conf {struct snd_soc_aux_dev {const char *name;/* Codec name */ -const char *codec_name;/* for multi-codec */ + +/* +* specify multi-codec either by device name, or by +* DT/OF node, but not both. +*/ +const char *codec_name; +const struct device_node *codec_of_node;/* codec/machine specific init - e.g. add machine controls */ int (*init)(struct snd_soc_dapm_context *dapm);
sound/soc/soc-core.c +47 -21
106 lines not on this page · raw message
Signature · 1 line
1.8.4.rc3
Mark Brown
maintainerRe: [RFC 3/4] ASoC: Allow Aux Codecs to be specified using DT
Quoted 2 lines · Sebastian Reichel
This patch adds support for specifying auxiliary codecs and codec configuration via device tree phandles.
This doesn't apply against current git, please check and resend. Please also consider your CC list more carefully, there's an awful lot of people on this...
Re: [RFC 3/4] ASoC: Allow Aux Codecs to be specified using DT
Quoted 5 lines · Mark Brown
Quoted 2 lines · Sebastian Reichel
This patch adds support for specifying auxiliary codecs and codec configuration via device tree phandles.
This doesn't apply against current git, please check and resend.
Can you give me a git url to rebase against? I used current git master from torvalds.
Quoted 2 lines
Please also consider your CC list more carefully, there's an awful lot of people on this...
I added exactly those recipients, that were returned by ./scripts/get_maintainer.pl for the patchset.
The list of involved people is quite long, because the patchset touches devicetree, documentation, boardcode, asoc and the specific driver.
-- Sebastian
Mark Brown
maintainerRe: [RFC 3/4] ASoC: Allow Aux Codecs to be specified using DT
Quoted 6 lines · Sebastian Reichel
Quoted 1 line · Mark Brown
This doesn't apply against current git, please check and resend.
Can you give me a git url to rebase against? I used current git master from torvalds.
From MAINTAINERS:
SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
M: Liam Girdwood <[email protected]> M: Mark Brown <[email protected]> T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git L: [email protected] (moderated for non-subscribers) W: http://alsa-project.org/main/index.php/ASoC S: Supported F: Documentation/sound/alsa/soc/ F: sound/soc/ F: include/sound/soc*
Quoted 9 lines
Quoted 2 lines
Please also consider your CC list more carefully, there's an awful lot of people on this...
I added exactly those recipients, that were returned by
./scripts/get_maintainer.plfor the patchset.The list of involved people is quite long, because the patchset touches devicetree, documentation, boardcode, asoc and the specific driver.
You shouldn't be using the output of get_maintainers directly, you should understand why everyone it's including is in the list and if they really should be. This is especially important if you are sending a series that covers many subsystems, or nested subsystems.
Re: [RFC 3/4] ASoC: Allow Aux Codecs to be specified using DT
In reply to Sebastian ReichelHi!
Quoted 18 lines
This patch adds support for specifying auxiliary codecs and codec configuration via device tree phandles.
This change adds new fields to
snd_soc_aux_devandsnd_soc_codec_confand adds support for the changes to SoC core methods.Signed-off-by Sebastian Reichel <[email protected]>--- include/sound/soc.h | 13 +++++++++- sound/soc/soc-core.c | 68 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 59 insertions(+), 22 deletions(-)sound/soc/soc-core.c +1
-0@@ -1527,15 +1529,23 @@ static void soc_unregister_ac97_dai_link(struct snd_soc_codec *codec)static int soc_check_aux_dev (struct snd_soc_card *card,int num) {struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num]; +const char *codecname = aux_dev->codec_name;struct snd_soc_codec *codec;
sound/soc/soc-core.c static void soc_unregister_ac97_dai_link(struct snd_soc_codec *codec) · line 1542
Quoted 10 lines
sound/soc/soc-core.c +5
-1/* find CODEC from registered CODECs*/ list_for_each_entry (codec, &codec_list, list) { -if (!strcmp (codec->name, aux_dev->codec_name)) +if (aux_dev->codec_of_node && + codec->dev->of_node == aux_dev->codec_of_node) +return 0 ; +if (aux_dev->codec_name && + !strcmp (codec->name, aux_dev->codec_name))return 0 ;
You can use codecname here.
Quoted 4 lines
sound/soc/soc-core.c +0
-4-if (!strcmp (codec->name, aux_dev->codec_name)) { -if (codec->probed) { -dev_err (codec->dev, -"ASoC: codec already probed" );
sound/soc/soc-core.c static int soc_probe_aux_dev(struct snd_soc_card *card, int num) · line 1567
Quoted 10 lines
sound/soc/soc-core.c +6
-4- ret = -EBUSY ; - goto out; - } - goto found; +if (aux_dev->codec_of_node && + codec->dev->of_node != aux_dev->codec_of_node) +continue ; +if (aux_dev->codec_name && +strcmp (codec->name, aux_dev->codec_name)) +continue ;
So in (error) case of ! aux_dev->codec_of_node && ! aux_dev->codec_name we match first possible codec?
Given code similarity between this and the one above, should there be helper function that does the comparison (or even walks the list)?
Quoted 9 lines
sound/soc/soc-core.c +0
-5@@ -1644,12 +1663,19 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)/* check to see if we need to override the compress_type */ for (i =0 ; i < card->num_configs; ++i) { codec_conf = &card->codec_conf[i]; -if (!strcmp (codec->name, codec_conf->dev_name)) { - compress_type = codec_conf->compress_type; -if (compress_type && compress_type - != codec->compress_type) -break ;
sound/soc/soc-core.c static int snd_soc_instantiate_card(struct snd_soc_card *card) · line 1674
Quoted 10 lines
sound/soc/soc-core.c +9
-1- } + +if (codec_conf->of_node && + codec->dev->of_node != codec_conf->of_node) +continue ; + +if (codec_conf->dev_name && +strcmp (codec->name, codec_conf->dev_name)) +continue ; +
..third copy of codec matching.
Thanks for doing all the good work,
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [RFC 3/4] ASoC: Allow Aux Codecs to be specified using DT
Hi!
Quoted 5 lines
So in (error) case of !
aux_dev->codec_of_node&& !aux_dev->codec_namewe match first possible codec?Given code similarity between this and the one above, should there be helper function that does the comparison (or even walks the list)?
Something like this? soc_probe_aux_dev now looks better... (Only compile tested).
sound/soc/soc-core.c +30 -34
@@ -1526,69 +1526,65 @@ static void soc_unregister_ac97_dai_link(struct snd_soc_codec *codec) }#endif -static int soc_check_aux_dev (struct snd_soc_card *card,int num) +struct snd_soc_codec *soc_find_matching_codec (struct snd_soc_card *card,int num) {struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num]; -const char *codecname = aux_dev->codec_name;struct snd_soc_codec *codec; -/* find CODEC from registered CODECs*/ +/* find CODEC from registered CODECs */ list_for_each_entry (codec, &codec_list, list) { -if (aux_dev->codec_of_node && - codec->dev->of_node == aux_dev->codec_of_node) -return 0 ; -if (aux_dev->codec_name && - !strcmp (codec->name, aux_dev->codec_name)) -return 0 ; +if (aux_dev->codec_of_node && + (codec->dev->of_node != aux_dev->codec_of_node)) +continue ; +if (aux_dev->codec_name &&strcmp (codec->name, aux_dev->codec_name)) +continue ; +return codec; } +return NULL ; +} +static int soc_check_aux_dev (struct snd_soc_card *card,int num) +{ +struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num]; +const char *codecname = aux_dev->codec_name; +struct snd_soc_codec *codec =soc_find_matching_codec (card, num); + +if (codec) +return 0 ;if (aux_dev->codec_of_node) codecname =of_node_full_name (aux_dev->codec_of_node);dev_err (card->dev,"ASoC: %s not registered\n" , codecname); -return -EPROBE_DEFER ; } +static int soc_probe_aux_dev (struct snd_soc_card *card,int num) {struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num]; -struct snd_soc_codec *codec;const char *codecname = aux_dev->codec_name;int ret = -ENODEV ; +struct snd_soc_codec *codec =soc_find_matching_codec (card, num); -/* find CODEC from registered CODECs*/ -list_for_each_entry (codec, &codec_list, list) { -if (aux_dev->codec_of_node && - codec->dev->of_node != aux_dev->codec_of_node) -continue ; -if (aux_dev->codec_name && -strcmp (codec->name, aux_dev->codec_name)) -continue ; +if (!codec) { +if (aux_dev->codec_of_node) + codecname =of_node_full_name (aux_dev->codec_of_node); -if (codec->probed) { -dev_err (codec->dev,"ASoC: codec already probed" ); - ret = -EBUSY ; - goto out; - } - goto found; +/* codec not found */ +dev_err (card->dev,"ASoC: codec %s not found" , codecname); +return -EPROBE_DEFER ; } -if (aux_dev->codec_of_node) - codecname =of_node_full_name (aux_dev->codec_of_node); - -/* codec not found */ -dev_err (card->dev,"ASoC: codec %s not found" , codecname); -return -EPROBE_DEFER ; +if (codec->probed) { +dev_err (codec->dev,"ASoC: codec already probed" ); +return -EBUSY ; + } -found: ret =soc_probe_codec (card, codec);if (ret <0 )return ret; ret =soc_post_component_init (card, codec, num,1 ); - -out:return ret; }
Signature · 6 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RFC 4/4 ASoC: RX-51: Add DT support to sound driver
In reply to Sebastian ReichelThis patch adds device tree support to the Nokia N900 audio driver. It also removes GPIO defines and gets them from platform data / device tree, since some GPIO numbers may be different with DT boot.
The binding also changes a helper function in omap-mcbsp, which is currently only used by the Nokia N900. This change is needed, because DT instanced omap-mcbsp driver has no valid id assigned.
Last but not least the DT binding is documented.
--- .../devicetree/bindings/sound/nokia,rx51.txt | 28 ++++ .../devicetree/bindings/vendor-prefixes.txt | 1 + include/sound/rx51.h | 18 +++ sound/soc/omap/omap-mcbsp.c | 5 +- sound/soc/omap/omap-mcbsp.h | 2 +- sound/soc/omap/rx51.c | 175 ++++++++++++++++----- 6 files changed, 184 insertions(+), 45 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/nokia,rx51.txt create mode 100644 include/sound/rx51.h
Documentation/devicetree/bindings/sound/nokia,rx51.txt new file +28 -0
@@ -0,0 +1,28 @@ +* Nokia N900 audio setup + +Required properties: +- compatible: "nokia,rx51-audio" +- ti,mcbsp: phandle for the McBSP node +- ti,codec: phandle for the main TLV320AIC3X node +- ti,codec_aux: phandle for the main TLV320AIC3X auxiliary node +- ti,headset_amp: phandle for the TPA6130A2 node +- tvout-selection-gpio: GPIO for tvout selection +- jack-detection-gpio: GPIO for jack detection +- eci-sw-gpio: GPIO for ECI SW +- speaker-amp-gpio: GPIO for Speaker Amp + +Example: + +sound { + compatible = "nokia,rx51-audio"; + + ti,mcbsp = <&mcbsp2>; + ti,codec = <&tlv320aic3x>; + ti,codec_aux = <&tlv320aic3x_aux>; + ti,headset_amp = <&tpa6130a2>; + + tvout-selection-gpio = <&gpio2 8 GPIO_ACTIVE_HIGH>; /* 40 */ + jack-detection-gpio = <&gpio6 17 GPIO_ACTIVE_HIGH>; /* 177 */ + eci-sw-gpio = <&gpio6 22 GPIO_ACTIVE_HIGH>; /* 182 */ + speaker-amp-gpio = <&twl_gpio 7 GPIO_ACTIVE_HIGH>; +};
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -42,6 +42,7 @@ microchip Microchip Technology Inc. mosaixtech Mosaix Technologies, Inc. national National Semiconductor nintendo Nintendo +nokia Nokia Corporation nvidia NVIDIA nxp NXP Semiconductors onnn ON Semiconductor Corp.
include/sound/rx51.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* Platform data for Nokia RX-51 SoC audio +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#ifndef __RX51_AUDIO_H__ +#define __RX51_AUDIO_H__ + +struct rx51_audio_pdata { +int tvout_selection_gpio; +int jack_detection_gpio; +int eci_sw_gpio; +int speaker_amp_gpio; +}; + +#endif
sound/soc/omap/omap-mcbsp.c +3 -2
@@ -691,7 +691,7 @@ OMAP_MCBSP_SOC_SINGLE_S16_EXT("McBSP" #port " Sidetone Channel 1 Volume", \OMAP_MCBSP_ST_CONTROLS (2 );OMAP_MCBSP_ST_CONTROLS (3 ); -int omap_mcbsp_st_add_controls (struct snd_soc_pcm_runtime *rtd) +int omap_mcbsp_st_add_controls (struct snd_soc_pcm_runtime *rtd,int port_id) {struct snd_soc_dai *cpu_dai = rtd->cpu_dai;struct omap_mcbsp *mcbsp =snd_soc_dai_get_drvdata (cpu_dai);
@@ -701,7 +701,7 @@ int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd)return 0 ; } -switch (mcbsp->id) { +switch (port_id) {case 2 :/* McBSP 2 */ return snd_soc_add_dai_controls(cpu_dai, omap_mcbsp2_st_controls,
@@ -711,6 +711,7 @@ int omap_mcbsp_st_add_controls(struct snd_soc_pcm_runtime *rtd) omap_mcbsp3_st_controls, ARRAY_SIZE(omap_mcbsp3_st_controls));default : +dev_err (mcbsp->dev,"Port %d not supported\n" , port_id);break ; }
sound/soc/omap/omap-mcbsp.h +1 -1
@@ -39,6 +39,6 @@ enum omap_mcbsp_div { OMAP_MCBSP_CLKGDV, /* Sample rate generator divider */ }; -int omap_mcbsp_st_add_controls (struct snd_soc_pcm_runtime *rtd); +int omap_mcbsp_st_add_controls (struct snd_soc_pcm_runtime *rtd,int port_id);#endif
sound/soc/omap/rx51.c +133 -42
281 lines not on this page · raw message
Signature · 1 line
1.8.4.rc3
Re: [RFC 4/4] ASoC: RX-51: Add DT support to sound driver
Quoted 28 lines · Sebastian Reichel
This patch adds device tree support to the Nokia N900 audio driver. It also removes GPIO defines and gets them from platform data / device tree, since some GPIO numbers may be different with DT boot.
The binding also changes a helper function in omap-mcbsp, which is currently only used by the Nokia N900. This change is needed, because DT instanced omap-mcbsp driver has no valid id assigned.
Last but not least the DT binding is documented.
Signed-off-by Sebastian Reichel <[email protected]>---
.../devicetree/bindings/sound/nokia,rx51.txt | 28 ++++ .../devicetree/bindings/vendor-prefixes.txt | 1 + include/sound/rx51.h | 18 +++ sound/soc/omap/omap-mcbsp.c | 5 +- sound/soc/omap/omap-mcbsp.h | 2 +- sound/soc/omap/rx51.c | 175 ++++++++++++++++----- 6 files changed, 184 insertions(+), 45 deletions(-)create mode 100644
Documentation/devicetree/bindings/sound/nokia,rx51.txtcreate mode 100644include/sound/rx51.hDocumentation/devicetree/bindings/sound/nokia,rx51.txt new file +0
-0
Documentation/devicetree/bindings/sound/nokia,rx51.txt line 1
Quoted 1 line
Documentation/devicetree/bindings/sound/nokia,rx51.txt new file +1
-0@@ -0,0 +1,28 @@ +* Nokia N900 audio setup
This needs more description
Documentation/devicetree/bindings/sound/nokia,rx51.txt line 8
Quoted 7 lines
Documentation/devicetree/bindings/sound/nokia,rx51.txt new file +7
-0+ +Required properties: +- compatible: "nokia,rx51-audio" +- ti,mcbsp: phandle for the McBSP node +- ti,codec: phandle for the main TLV320AIC3X node +- ti,codec_aux: phandle for the main TLV320AIC3X auxiliary node +- ti,headset_amp: phandle for the TPA6130A2 node
Hmm, I don't think these should be ti prefixed but nokia.
Documentation/devicetree/bindings/sound/nokia,rx51.txt line 12
Quoted 4 lines
Documentation/devicetree/bindings/sound/nokia,rx51.txt new file +4
-0+- tvout-selection-gpio: GPIO for tvout selection +- jack-detection-gpio: GPIO for jack detection +- eci-sw-gpio: GPIO for ECI SW +- speaker-amp-gpio: GPIO for Speaker Amp
why aren't the gpio properties vendor prefixed?
Quoted 16 lines
Documentation/devicetree/bindings/sound/nokia,rx51.txt new file +16
-0+ +Example: + +sound { + compatible = "nokia,rx51-audio"; + + ti,mcbsp = <&mcbsp2>; + ti,codec = <&tlv320aic3x>; + ti,codec_aux = <&tlv320aic3x_aux>; + ti,headset_amp = <&tpa6130a2>; + + tvout-selection-gpio = <&gpio2 8 GPIO_ACTIVE_HIGH>; /* 40 */ + jack-detection-gpio = <&gpio6 17 GPIO_ACTIVE_HIGH>; /* 177 */ + eci-sw-gpio = <&gpio6 22 GPIO_ACTIVE_HIGH>; /* 182 */ + speaker-amp-gpio = <&twl_gpio 7 GPIO_ACTIVE_HIGH>; +};
Signature · 2 lines
Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Re: [RFC 4/4] ASoC: RX-51: Add DT support to sound driver
In reply to Sebastian ReichelQuoted 2 lines · Sebastian Reichel
+- eci-sw-gpio: GPIO for ECI SW +- speaker-amp-gpio: GPIO for Speaker Amp
Can you please spell out the acronyms? ECI? SW? Amp?
I guess SW=switch, Amp=amplifier, but ECI beats me.
Yours,
Linus Walleij
Mark Brown
maintainerRe: [RFC 4/4] ASoC: RX-51: Add DT support to sound driver
Quoted 8 lines · Linus Walleij
Quoted 2 lines · Sebastian Reichel
+- eci-sw-gpio: GPIO for ECI SW +- speaker-amp-gpio: GPIO for Speaker AmpCan you please spell out the acronyms? ECI? SW? Amp?
I guess SW=switch, Amp=amplifier, but ECI beats me.
ECI is the name of Nokia's accesory interface spec, it should be as clear as GPIO for anyone working on Nokia hardware (which this is).
Re: [RFC 4/4] ASoC: RX-51: Add DT support to sound driver
In reply to Sebastian ReichelHi!
Quoted 1 line
This patch adds device tree support to the Nokia N900 audio driver.
Note, N900 audio driver.
Quoted 1 line
+- compatible: "nokia,rx51-audio"
Still, it is rx51-audio. If it is feasible, could we move away from rx51 naming and into n900 naming that is familiar to mere humans?
We can rename the sources later, but I guess we should get dts binding right first time...
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [RFC 4/4] ASoC: RX-51: Add DT support to sound driver
Hi
Quoted 6 lines · Pavel Machek
Hi!
Quoted 1 line
This patch adds device tree support to the Nokia N900 audio driver.
Note, N900 audio driver.
Quoted 7 lines
Quoted 1 line
+- compatible: "nokia,rx51-audio"
Still, it is rx51-audio. If it is feasible, could we move away from rx51 naming and into n900 naming that is familiar to mere humans?
We can rename the sources later, but I guess we should get dts binding right first time...
Sorry the long response. I definitely would like n900 naming more in dts.
History is that the basic board file for N900 went to mainline before sales started and used the hw name in sources and Kconfig. Audio machine driver then followed the same rx51 hw naming scheme with rest of sources.
Signature · 1 line
Jarkko