summaryrefslogtreecommitdiffstats
path: root/sound/soc/generic
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: simple-card: Support setting mclk via a fixed factorAndrew Lunn2014-05-261-0/+28
| | | | | | | | | | Some platforms require that the codecs mclk is a fixed multiplication factor of the audio stream rate. Add a optional property to the binding to hold this factor and implement a hw_params() function to make use of it. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: is_top_level_node parameter to simple_card_dai_link_of()Jyri Sarha2014-04-241-4/+7
| | | | | | | | | Restore correct parsing of dai-link subnodes with more explicit implementation for applying the "simple-audio-card,"-prefix to dai-link property and subnode names. Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: Improve coding styleNicolin Chen2014-04-241-12/+11
| | | | | | | Improve indentation and space. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: Simplify error msg in simple_card_dai_link_of()Nicolin Chen2014-04-241-4/+2
| | | | | | | It would look better to use prop instead. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: Drop node->name checkingNicolin Chen2014-04-241-2/+1
| | | | | | | | | | | | | The current simple-card driver limits the DT node name to "sound". Any of other names is forbidden while actually we should allow DT to pass other node names. And if this function is being called, the node must already have the compatible "simple-audio-card" in DTB. So there should be no need to check the name here. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: Move dai-link level properties away from dai subnodesJyri Sarha2014-04-231-99/+140
| | | | | | | | | | | | The properties like format, bitclock-master, frame-master, bitclock-inversion, and frame-inversion should be common to the dais connected with a dai-link. For bitclock-master and frame-master properties to be unambiguous they need to indicate the mastering dai node with a phandle. Signed-off-by: Jyri Sarha <jsarha@ti.com> Acked-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: core: Update snd_soc_of_parse_daifmt() interfaceJyri Sarha2014-04-231-2/+3
| | | | | | | | | | | | | Adds struct device_node **bitclkmaster and struct device_node **framemaster function parameters. With the new syntax bitclock-master and frame-master properties can explicitly indicate the dai-link bit-clock and frame masters with a phandle. This patch also makes the minimal changes to simple-card for it to work with the updated snd_soc_of_parse_daifmt(). Simple-card appears to be the only user of snd_soc_of_parse_daifmt() for now. Signed-off-by: Jyri Sarha <jsarha@ti.com> Acked-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: Handle many DAI linksJean-Francois Moine2014-03-251-69/+121
| | | | | | | | Some simple audio cards may have many DAI links. This patch extends the simple-card driver for handling such cards. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: dynamically allocate the DAI link and propertiesJean-Francois Moine2014-03-251-15/+27
| | | | | | | | | | | The DAI link array and the properties (fmt, sysclk slots) are hard-coded for a single CPU / CODEC link. This patch dynamically allocates the DAI link array and the properties with the aim of supporting many DAI links. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: overwrite cpu_dai->fmt with codec_dai->fmtNicolin Chen2014-03-181-6/+14
| | | | | | | | | | | | | | | | | | | The current simple-card driver separates the daimft for cpu_dai and codec_dai. So we might get different values for them (0x4003 and 0x1003 for example): asoc-simple-card sound-cs42888.12: cpu : 2024000.esai / 4003 / 132000000 asoc-simple-card sound-cs42888.12: codec : cs42888 / 1003 / 24576000 asoc-simple-card sound-cs42888.12: cs42888 <-> 2024000.esai mapping ok This is not allowed at all as we need to keep the DAIFMT settings identical for both the ends of the link. Thus this patch fixes it by overwriting the cpu_dai->fmt with codec_dai->fmt since we defined the DAIFMT_MASTER basing on CODEC at the first place while the other bits are same. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: Simplify codeJean-Francois Moine2014-03-171-5/+5
| | | | | | | | | | The global DAI format is used only in the function asoc_simple_card_parse_of(). So, move it from the private data to the stack. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Reviewed-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: Fix the reference count of device nodesJean-Francois Moine2014-03-141-13/+37
| | | | | | | | The reference count of some device nodes is not correctly reset at end of card probe. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: card name can be optionKuninori Morimoto2014-03-101-2/+1
| | | | | | | | | snd_card.name is now option on DT case. non-DT case can follow same style, and it is understandable from platform point of view. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: tidyup cpu/codec dai_fmt settings for non-DTKuninori Morimoto2014-03-051-0/+3
| | | | | | | | | | | | 30d0341e7da0c012f64fb290dd1153360fb49a8d (ASoC: simple-card: simplify the daifmt code) simplify cpu/codec dai_fmt which consists from dai specific format + common format. But, it didn't care about non-DT case. This patch fixes it Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: cpu_dai_name creates confusion when DT caseKuninori Morimoto2014-02-281-0/+11
| | | | | | | | | | | | | | | | | | | | Basically, soc_bind_dai_link() checks cpu_dai->dev->of_node and dai_link->cpu_of_node in DT case. But after that it will check cpu_dai->name and dai_link->cpu_dai_name too. On the other hand, snd_soc_dai :: name is created by fmt_single_name() or fmt_multiple_name(). There is no confusion if dai name is created by fmt_multiple_name(), since cpu_dai->name is same as dai_link->cpu_dai_name. but, if dai name is created by fmt_single_name(), CPU DAI never match. Thus, simple-card not set dai_link->cpu_dai_name if DT case to skip naming match on soc_bind_dai_link() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: add slot information parsing supportsXiubo Li2014-02-231-0/+18
| | | | | | | | For some CPU/CODEC DAI devices the slot information maybe needed. This patch adds the slot information parsing for simple-card driver. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: add off-codec widgets supports.Xiubo Li2014-02-101-0/+8
| | | | | Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: Add snd_card's name parsing from DT node supportXiubo Li2014-02-031-1/+5
| | | | | | | | | | | | | | If the DT is used and the CPU DAI device has only one DAI, the card name will be like : ALSA device list: 0: 40031000.sai-sgtl5000 And this name maybe a little ugly to some customers, so here the card name parsing from DT node is supported. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: simplify the daifmt codeXiubo Li2014-02-031-11/+9
| | | | | | | | | | | | | | In the asoc_simple_card_parse_of() will parse the device node's CPU/CODEC DAI commone fmts, and then in asoc_simple_card_sub_parse_of() will parse the CPU/CODEC DAI's sub-node fmts, so we can combine the info->daifmt and info->set.fmt in asoc_simple_card_sub_parse_of() not while just before _set_fmt(). And this will be more easy to add new functions, such as supporting _set_tdm_slot(), etc. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: fix __asoc_simple_card_dai_initXiubo Li2014-02-031-7/+15
| | | | | | | | If the CPU/CODEC DAI set_sysclk() is not support, the -ENOTSUPP will returnd. Here do the check like set_fmt(). Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: simplify codeJean-Francois Moine2014-02-031-16/+16
| | | | | | | Rename the pointer to the private data structure to 'priv' to avoid confusion with the platform data pointer. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: simplify codeJean-Francois Moine2014-02-031-3/+11
| | | | | | | | | | | The platform data structure contains information which is used only by the driver, and the driver allocates platform information fields which are of no use. Move the driver specific data to a new private structure and cleanup the platform data structure. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: simplify codeJean-Francois Moine2014-02-031-14/+20
| | | | | | | | | | | | In the non-DT sequence, the platform data is copied as a whole to the dynamic card info and the same pointer 'cinfo' is used to copy the platform information to the card. Use 'priv' as the pointer to the dynamic card info and copy only the useful information from the platform data. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: simplify codeJean-Francois Moine2014-02-031-12/+16
| | | | | | | | The CPU and CODEC DAI names are still copied to the user info structure. Put them directly in the DAI links. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: simplify codeJean-Francois Moine2014-02-031-13/+16
| | | | | | | Have a cleaner code using a DAI link pointer. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: simplify codeJean-Francois Moine2014-02-031-35/+20
| | | | | | | | | The OF pointers are put in the stack and then copied to the card descriptor. Put them directly at their right place. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: simplify codeJean-Francois Moine2014-02-031-10/+12
| | | | | | | | | | The DT values are copied to the non-DT structure before being moved to the card structure. Set directly the DT values in the card and move the non-DT copy to the non-DT sequence. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: simplify codeJean-Francois Moine2014-02-031-9/+9
| | | | | | | | The check of the mandatory fields is done for DT in its specific sequence. Move the global check to the non-DT sequence. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
*-. Merge remote-tracking branches 'asoc/topic/adsp', 'asoc/topic/atmel', ↵Mark Brown2014-01-161-34/+36
|\ \ | | | | | | | | | 'asoc/topic/bcm2835', 'asoc/topic/docs', 'asoc/topic/fsl', 'asoc/topic/generic', 'asoc/topic/kirkwood', 'asoc/topic/mc13783', 'asoc/topic/mxs', 'asoc/topic/nuc900', 'asoc/topic/sai', 'asoc/topic/sh', 'asoc/topic/ssm2602', 'asoc/topic/tlv320aic3x', 'asoc/topic/twl4030', 'asoc/topic/ux500', 'asoc/topic/width' and 'asoc/topic/x86' into for-tiwai
| | * ASoC: simple-card: fix one bug to writing to the platform dataXiubo Li2014-01-141-19/+21
| | | | | | | | | | | | | | | | | | | | | | | | It's a bug that writing to the platform data directly, for it should be constant. So just copy it before writing. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: simple-card: use snd_soc_card_set/get_drvdataXiubo Li2014-01-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Remove asoc_simple_get_card_info macro and use snd_soc_card_set_drvdata and snd_soc_card_get_drvdata instead. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: simple-card: fix the cinfo error checkXiubo Li2014-01-091-5/+7
| | | | | | | | | | | | | | | | | | | | | If the dt is used and the cinfo is NULL, the -ENOMEM should be return. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: simple-card: fix a bug where cinfo will be NULL before using itXiubo Li2014-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | If the dt is not used, the cinfo will be always NULL before using it. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: simple-card: keep the property's name the same patternXiubo Li2014-01-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though we might not have rigor rule for the simple card property names, according to the existing ones, they are all in a same pattern: [simple-audio-card,]XXX; Rename simple-audio-routing to simple-audio-card,routing, and make the simple card's properties has one unified name. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: simple-card: fix the DAPM routes map parsingXiubo Li2014-01-071-3/+5
| | | | | | | | | | | | | | | | | | | | | The simple-card's DAPM route maping is optional. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: simple-card: Fix the sysclk selection.Xiubo Li2014-01-061-6/+2
| | | | | | | | | | | | | | | | | | | | | For spdif there is no need to do the sysclk setting. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | |
| \ \
*-. \ \ Merge remote-tracking branches 'asoc/topic/ad1836', 'asoc/topic/ad193x', ↵Mark Brown2014-01-021-15/+29
|\ \ \ \ | | |/ / | |/| / | | |/ 'asoc/topic/adav80x', 'asoc/topic/adsp', 'asoc/topic/ak4641', 'asoc/topic/ak4642', 'asoc/topic/arizona', 'asoc/topic/atmel', 'asoc/topic/au1x', 'asoc/topic/axi', 'asoc/topic/bcm2835', 'asoc/topic/blackfin', 'asoc/topic/cs4271', 'asoc/topic/cs42l52', 'asoc/topic/da7210', 'asoc/topic/davinci', 'asoc/topic/ep93xx', 'asoc/topic/fsl', 'asoc/topic/fsl-mxs', 'asoc/topic/generic', 'asoc/topic/hdmi', 'asoc/topic/jack', 'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/mxs', 'asoc/topic/omap', 'asoc/topic/pxa', 'asoc/topic/rcar', 'asoc/topic/s6000', 'asoc/topic/sai', 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc/topic/spear', 'asoc/topic/ssm2518', 'asoc/topic/ssm2602', 'asoc/topic/tegra', 'asoc/topic/tlv320aic3x', 'asoc/topic/twl6040', 'asoc/topic/txx9', 'asoc/topic/uda1380', 'asoc/topic/width', 'asoc/topic/wm8510', 'asoc/topic/wm8523', 'asoc/topic/wm8580', 'asoc/topic/wm8711', 'asoc/topic/wm8728', 'asoc/topic/wm8731', 'asoc/topic/wm8741', 'asoc/topic/wm8750', 'asoc/topic/wm8753', 'asoc/topic/wm8776', 'asoc/topic/wm8804', 'asoc/topic/wm8900', 'asoc/topic/wm8901', 'asoc/topic/wm8940', 'asoc/topic/wm8962', 'asoc/topic/wm8974', 'asoc/topic/wm8985', 'asoc/topic/wm8988', 'asoc/topic/wm8990', 'asoc/topic/wm8991', 'asoc/topic/wm8994', 'asoc/topic/wm8995', 'asoc/topic/wm9081' and 'asoc/topic/x86' into asoc-next
| | * ASoC: simple-card: Add device's module clock selection.Xiubo Li2014-01-011-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | Try to get the device's module clock if the dt has no clocks and system-clock-frequency properties. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: simple-card: Cleanup __asoc_simple_card_dai_init() ret checkXiubo Li2013-12-311-1/+1
| | | | | | | | | | | | | | | | | | | | | The ret parameter is always equal to zero till here. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: simple-card: Add DAPM routes parse from device treeXiubo Li2013-12-311-2/+9
| | | | | | | | | | | | | | | | | | | | | Parses a simple DAPM route table from device tree. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: simple-card: Use devm_snd_soc_register_card()Xiubo Li2013-12-191-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | Makes the code slightly shorter. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | ASoC: simple-card: Add cpu_dai and codec_dai names NULL checkXiubo Li2013-12-211-0/+3
| |/ |/| | | | | | | | | | | | | The name of cpu DAI maybe omitted, and then strlen() will lead kernel panic. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: simple-card: add Device Tree supportKuninori Morimoto2013-12-021-6/+150
|/ | | | | | | | Support for loading the simple-card module via DeviceTree. It requests CPU/CODEC information. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: un-implemented set_fmt is not errorKuninori Morimoto2013-10-201-0/+5
| | | | | | | | | | | Current simple-card returns error if DAI doesn't support .set_fmt callback. But the error is -ENOTSUPP (= not supported), and it is not error. This patch avoids such case Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: Provide owner and MODULE_ALIAS()Fabio Estevam2013-08-231-0/+2
| | | | | | | Add .owner field and also MODULE_ALIAS(), so that auto module loading can work. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: simple-card: add asoc_simple_dai for initializingKuninori Morimoto2013-01-141-28/+30
| | | | | | | | | | | | | | | | | | | | Current simple-card driver calls asoc_simple_card_dai_init() if platform had a asoc_simple_card_dai_init pointer. And, this initialization function works only when platform has an applicable initial value for each dai settings. And basically, almost all sound card requires certain initialization. This means that almost all platform has initialization settings, and driver do nothing if it doesn't have settings. And additionally, current simple-card supports sysclk settings but it was only for codec. In order to abolish deviation between cpu and codec, and in order to simplify processing, this patch adds asoc_simple_dai, and removed pointless struct asoc_simple_dai_init_info which was trigger of calling asoc_simple_card_dai_init(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: simple-card: use struct device pointer for dev_xxx()Kuninori Morimoto2012-12-271-2/+3
| | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: add generic simple-card supportKuninori Morimoto2012-04-133-0/+121
Current ASoC requires card.c file to each platforms in order to specifies its CPU and Codecs pair. But the differences between these were only value/strings of setting. In order to reduce duplicate driver, this patch adds generic/simple-card. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
OpenPOWER on IntegriCloud