Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge remote-tracking branches 'asoc/topic/sh', 'asoc/topic/simple', 'asoc/topic/spear', 'asoc/topic/sunxi' and 'asoc/topic/tlv320aic3x' into asoc-next

+862 -68
+33
Documentation/devicetree/bindings/sound/sun4i-codec.txt
··· 1 + * Allwinner A10 Codec 2 + 3 + Required properties: 4 + - compatible: must be either "allwinner,sun4i-a10-codec" or 5 + "allwinner,sun7i-a20-codec" 6 + - reg: must contain the registers location and length 7 + - interrupts: must contain the codec interrupt 8 + - dmas: DMA channels for tx and rx dma. See the DMA client binding, 9 + Documentation/devicetree/bindings/dma/dma.txt 10 + - dma-names: should include "tx" and "rx". 11 + - clocks: a list of phandle + clock-specifer pairs, one for each entry 12 + in clock-names. 13 + - clock-names: should contain followings: 14 + - "apb": the parent APB clock for this controller 15 + - "codec": the parent module clock 16 + - routing : A list of the connections between audio components. Each 17 + entry is a pair of strings, the first being the connection's sink, 18 + the second being the connection's source. 19 + 20 + 21 + Example: 22 + codec: codec@01c22c00 { 23 + #sound-dai-cells = <0>; 24 + compatible = "allwinner,sun7i-a20-codec"; 25 + reg = <0x01c22c00 0x40>; 26 + interrupts = <0 30 4>; 27 + clocks = <&apb0_gates 0>, <&codec_clk>; 28 + clock-names = "apb", "codec"; 29 + dmas = <&dma 0 19>, <&dma 0 19>; 30 + dma-names = "rx", "tx"; 31 + routing = "Headphone Jack", "HP Right", 32 + "Headphone Jack", "HP Left"; 33 + };
+10 -1
Documentation/devicetree/bindings/sound/tdm-slot.txt
··· 4 4 5 5 TDM slot properties: 6 6 dai-tdm-slot-num : Number of slots in use. 7 - dai-tdm-slot-width : Width in bits for each slot. 7 + dai-tdm-slot-width : Width in bits for each slot. 8 + dai-tdm-slot-tx-mask : Transmit direction slot mask, optional 9 + dai-tdm-slot-rx-mask : Receive direction slot mask, optional 8 10 9 11 For instance: 10 12 dai-tdm-slot-num = <2>; 11 13 dai-tdm-slot-width = <8>; 14 + dai-tdm-slot-tx-mask = <0 1>; 15 + dai-tdm-slot-rx-mask = <1 0>; 12 16 13 17 And for each spcified driver, there could be one .of_xlate_tdm_slot_mask() 14 18 to specify a explicit mapping of the channels and the slots. If it's absent ··· 22 18 For snd_soc_of_xlate_tdm_slot_mask(), the tx and rx masks will use a 1 bit 23 19 for an active slot as default, and the default active bits are at the LSB of 24 20 the masks. 21 + 22 + The explicit masks are given as array of integers, where the first 23 + number presents bit-0 (LSB), second presents bit-1, etc. Any non zero 24 + number is considered 1 and 0 is 0. snd_soc_of_xlate_tdm_slot_mask() 25 + does not do anything, if either mask is set non zero value.
+2
include/sound/simple_card.h
··· 19 19 unsigned int sysclk; 20 20 int slots; 21 21 int slot_width; 22 + unsigned int tx_slot_mask; 23 + unsigned int rx_slot_mask; 22 24 struct clk *clk; 23 25 }; 24 26
+2
include/sound/soc.h
··· 1613 1613 int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, 1614 1614 const char *propname); 1615 1615 int snd_soc_of_parse_tdm_slot(struct device_node *np, 1616 + unsigned int *tx_mask, 1617 + unsigned int *rx_mask, 1616 1618 unsigned int *slots, 1617 1619 unsigned int *slot_width); 1618 1620 void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
+1
sound/soc/Kconfig
··· 58 58 source "sound/soc/sirf/Kconfig" 59 59 source "sound/soc/spear/Kconfig" 60 60 source "sound/soc/sti/Kconfig" 61 + source "sound/soc/sunxi/Kconfig" 61 62 source "sound/soc/tegra/Kconfig" 62 63 source "sound/soc/txx9/Kconfig" 63 64 source "sound/soc/ux500/Kconfig"
+1
sound/soc/Makefile
··· 40 40 obj-$(CONFIG_SND_SOC) += sirf/ 41 41 obj-$(CONFIG_SND_SOC) += spear/ 42 42 obj-$(CONFIG_SND_SOC) += sti/ 43 + obj-$(CONFIG_SND_SOC) += sunxi/ 43 44 obj-$(CONFIG_SND_SOC) += tegra/ 44 45 obj-$(CONFIG_SND_SOC) += txx9/ 45 46 obj-$(CONFIG_SND_SOC) += ux500/
+26 -4
sound/soc/codecs/tlv320aic3x.c
··· 80 80 unsigned int sysclk; 81 81 unsigned int dai_fmt; 82 82 unsigned int tdm_delay; 83 + unsigned int slot_width; 83 84 struct list_head list; 84 85 int master; 85 86 int gpio_reset; ··· 1026 1025 u8 data, j, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1; 1027 1026 u16 d, pll_d = 1; 1028 1027 int clk; 1028 + int width = aic3x->slot_width; 1029 + 1030 + if (!width) 1031 + width = params_width(params); 1029 1032 1030 1033 /* select data word length */ 1031 1034 data = snd_soc_read(codec, AIC3X_ASD_INTF_CTRLB) & (~(0x3 << 4)); 1032 - switch (params_width(params)) { 1035 + switch (width) { 1033 1036 case 16: 1034 1037 break; 1035 1038 case 20: ··· 1175 1170 struct snd_soc_codec *codec = dai->codec; 1176 1171 struct aic3x_priv *aic3x = snd_soc_codec_get_drvdata(codec); 1177 1172 int delay = 0; 1173 + int width = aic3x->slot_width; 1174 + 1175 + if (!width) 1176 + width = substream->runtime->sample_bits; 1178 1177 1179 1178 /* TDM slot selection only valid in DSP_A/_B mode */ 1180 1179 if (aic3x->dai_fmt == SND_SOC_DAIFMT_DSP_A) 1181 - delay += (aic3x->tdm_delay + 1); 1180 + delay += (aic3x->tdm_delay*width + 1); 1182 1181 else if (aic3x->dai_fmt == SND_SOC_DAIFMT_DSP_B) 1183 - delay += aic3x->tdm_delay; 1182 + delay += aic3x->tdm_delay*width; 1184 1183 1185 1184 /* Configure data delay */ 1186 1185 snd_soc_write(codec, AIC3X_ASD_INTF_CTRLC, delay); ··· 1305 1296 return -EINVAL; 1306 1297 } 1307 1298 1308 - aic3x->tdm_delay = lsb * slot_width; 1299 + switch (slot_width) { 1300 + case 16: 1301 + case 20: 1302 + case 24: 1303 + case 32: 1304 + break; 1305 + default: 1306 + dev_err(codec->dev, "Unsupported slot width %d\n", slot_width); 1307 + return -EINVAL; 1308 + } 1309 + 1310 + 1311 + aic3x->tdm_delay = lsb; 1312 + aic3x->slot_width = slot_width; 1309 1313 1310 1314 /* DOUT in high-impedance on inactive bit clocks */ 1311 1315 snd_soc_update_bits(codec, AIC3X_ASD_INTF_CTRLA,
+6 -2
sound/soc/generic/simple-card.c
··· 151 151 } 152 152 153 153 if (set->slots) { 154 - ret = snd_soc_dai_set_tdm_slot(dai, 0, 0, 154 + ret = snd_soc_dai_set_tdm_slot(dai, 155 + set->tx_slot_mask, 156 + set->rx_slot_mask, 155 157 set->slots, 156 158 set->slot_width); 157 159 if (ret && ret != -ENOTSUPP) { ··· 245 243 return ret; 246 244 247 245 /* Parse TDM slot */ 248 - ret = snd_soc_of_parse_tdm_slot(np, &dai->slots, &dai->slot_width); 246 + ret = snd_soc_of_parse_tdm_slot(np, &dai->tx_slot_mask, 247 + &dai->rx_slot_mask, 248 + &dai->slots, &dai->slot_width); 249 249 if (ret) 250 250 return ret; 251 251
+24 -61
sound/soc/sh/siu_dai.c
··· 738 738 struct siu_info *info; 739 739 int ret; 740 740 741 - info = kmalloc(sizeof(*info), GFP_KERNEL); 741 + info = devm_kmalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); 742 742 if (!info) 743 743 return -ENOMEM; 744 744 siu_i2s_data = info; ··· 746 746 747 747 ret = request_firmware(&fw_entry, "siu_spb.bin", &pdev->dev); 748 748 if (ret) 749 - goto ereqfw; 749 + return ret; 750 750 751 751 /* 752 752 * Loaded firmware is "const" - read only, but we have to modify it in ··· 757 757 release_firmware(fw_entry); 758 758 759 759 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 760 - if (!res) { 761 - ret = -ENODEV; 762 - goto egetres; 763 - } 760 + if (!res) 761 + return -ENODEV; 764 762 765 - region = request_mem_region(res->start, resource_size(res), 766 - pdev->name); 763 + region = devm_request_mem_region(&pdev->dev, res->start, 764 + resource_size(res), pdev->name); 767 765 if (!region) { 768 766 dev_err(&pdev->dev, "SIU region already claimed\n"); 769 - ret = -EBUSY; 770 - goto ereqmemreg; 767 + return -EBUSY; 771 768 } 772 769 773 - ret = -ENOMEM; 774 - info->pram = ioremap(res->start, PRAM_SIZE); 770 + info->pram = devm_ioremap(&pdev->dev, res->start, PRAM_SIZE); 775 771 if (!info->pram) 776 - goto emappram; 777 - info->xram = ioremap(res->start + XRAM_OFFSET, XRAM_SIZE); 772 + return -ENOMEM; 773 + info->xram = devm_ioremap(&pdev->dev, res->start + XRAM_OFFSET, 774 + XRAM_SIZE); 778 775 if (!info->xram) 779 - goto emapxram; 780 - info->yram = ioremap(res->start + YRAM_OFFSET, YRAM_SIZE); 776 + return -ENOMEM; 777 + info->yram = devm_ioremap(&pdev->dev, res->start + YRAM_OFFSET, 778 + YRAM_SIZE); 781 779 if (!info->yram) 782 - goto emapyram; 783 - info->reg = ioremap(res->start + REG_OFFSET, resource_size(res) - 784 - REG_OFFSET); 780 + return -ENOMEM; 781 + info->reg = devm_ioremap(&pdev->dev, res->start + REG_OFFSET, 782 + resource_size(res) - REG_OFFSET); 785 783 if (!info->reg) 786 - goto emapreg; 784 + return -ENOMEM; 787 785 788 786 dev_set_drvdata(&pdev->dev, info); 789 787 790 788 /* register using ARRAY version so we can keep dai name */ 791 - ret = snd_soc_register_component(&pdev->dev, &siu_i2s_component, 792 - &siu_i2s_dai, 1); 789 + ret = devm_snd_soc_register_component(&pdev->dev, &siu_i2s_component, 790 + &siu_i2s_dai, 1); 793 791 if (ret < 0) 794 - goto edaiinit; 792 + return ret; 795 793 796 - ret = snd_soc_register_platform(&pdev->dev, &siu_platform); 794 + ret = devm_snd_soc_register_platform(&pdev->dev, &siu_platform); 797 795 if (ret < 0) 798 - goto esocregp; 796 + return ret; 799 797 800 798 pm_runtime_enable(&pdev->dev); 801 799 802 - return ret; 803 - 804 - esocregp: 805 - snd_soc_unregister_component(&pdev->dev); 806 - edaiinit: 807 - iounmap(info->reg); 808 - emapreg: 809 - iounmap(info->yram); 810 - emapyram: 811 - iounmap(info->xram); 812 - emapxram: 813 - iounmap(info->pram); 814 - emappram: 815 - release_mem_region(res->start, resource_size(res)); 816 - ereqmemreg: 817 - egetres: 818 - ereqfw: 819 - kfree(info); 820 - 821 - return ret; 800 + return 0; 822 801 } 823 802 824 803 static int siu_remove(struct platform_device *pdev) 825 804 { 826 - struct siu_info *info = dev_get_drvdata(&pdev->dev); 827 - struct resource *res; 828 - 829 805 pm_runtime_disable(&pdev->dev); 830 - 831 - snd_soc_unregister_platform(&pdev->dev); 832 - snd_soc_unregister_component(&pdev->dev); 833 - 834 - iounmap(info->reg); 835 - iounmap(info->yram); 836 - iounmap(info->xram); 837 - iounmap(info->pram); 838 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 839 - if (res) 840 - release_mem_region(res->start, resource_size(res)); 841 - kfree(info); 842 - 843 806 return 0; 844 807 } 845 808
+25
sound/soc/soc-core.c
··· 3291 3291 } 3292 3292 EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_simple_widgets); 3293 3293 3294 + static int snd_soc_of_get_slot_mask(struct device_node *np, 3295 + const char *prop_name, 3296 + unsigned int *mask) 3297 + { 3298 + u32 val; 3299 + const __be32 *of_slot_mask = of_get_property(np, prop_name, &val); 3300 + int i; 3301 + 3302 + if (!of_slot_mask) 3303 + return 0; 3304 + val /= sizeof(u32); 3305 + for (i = 0; i < val; i++) 3306 + if (be32_to_cpup(&of_slot_mask[i])) 3307 + *mask |= (1 << i); 3308 + 3309 + return val; 3310 + } 3311 + 3294 3312 int snd_soc_of_parse_tdm_slot(struct device_node *np, 3313 + unsigned int *tx_mask, 3314 + unsigned int *rx_mask, 3295 3315 unsigned int *slots, 3296 3316 unsigned int *slot_width) 3297 3317 { 3298 3318 u32 val; 3299 3319 int ret; 3320 + 3321 + if (tx_mask) 3322 + snd_soc_of_get_slot_mask(np, "dai-tdm-slot-tx-mask", tx_mask); 3323 + if (rx_mask) 3324 + snd_soc_of_get_slot_mask(np, "dai-tdm-slot-rx-mask", rx_mask); 3300 3325 3301 3326 if (of_property_read_bool(np, "dai-tdm-slot-num")) { 3302 3327 ret = of_property_read_u32(np, "dai-tdm-slot-num", &val);
+11
sound/soc/sunxi/Kconfig
··· 1 + menu "Allwinner SoC Audio support" 2 + 3 + config SND_SUN4I_CODEC 4 + tristate "Allwinner A10 Codec Support" 5 + select SND_SOC_GENERIC_DMAENGINE_PCM 6 + select REGMAP_MMIO 7 + help 8 + Select Y or M to add support for the Codec embedded in the Allwinner 9 + A10 and affiliated SoCs. 10 + 11 + endmenu
+2
sound/soc/sunxi/Makefile
··· 1 + obj-$(CONFIG_SND_SUN4I_CODEC) += sun4i-codec.o 2 +
+719
sound/soc/sunxi/sun4i-codec.c
··· 1 + /* 2 + * Copyright 2014 Emilio López <emilio@elopez.com.ar> 3 + * Copyright 2014 Jon Smirl <jonsmirl@gmail.com> 4 + * Copyright 2015 Maxime Ripard <maxime.ripard@free-electrons.com> 5 + * 6 + * Based on the Allwinner SDK driver, released under the GPL. 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License as published by 10 + * the Free Software Foundation; either version 2 of the License, or 11 + * (at your option) any later version. 12 + * 13 + * This program is distributed in the hope that it will be useful, 14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 + * GNU General Public License for more details. 17 + */ 18 + 19 + #include <linux/init.h> 20 + #include <linux/kernel.h> 21 + #include <linux/module.h> 22 + #include <linux/platform_device.h> 23 + #include <linux/delay.h> 24 + #include <linux/slab.h> 25 + #include <linux/of.h> 26 + #include <linux/of_platform.h> 27 + #include <linux/of_address.h> 28 + #include <linux/clk.h> 29 + #include <linux/regmap.h> 30 + 31 + #include <sound/core.h> 32 + #include <sound/pcm.h> 33 + #include <sound/pcm_params.h> 34 + #include <sound/soc.h> 35 + #include <sound/tlv.h> 36 + #include <sound/initval.h> 37 + #include <sound/dmaengine_pcm.h> 38 + 39 + /* Codec DAC register offsets and bit fields */ 40 + #define SUN4I_CODEC_DAC_DPC (0x00) 41 + #define SUN4I_CODEC_DAC_DPC_EN_DA (31) 42 + #define SUN4I_CODEC_DAC_DPC_DVOL (12) 43 + #define SUN4I_CODEC_DAC_FIFOC (0x04) 44 + #define SUN4I_CODEC_DAC_FIFOC_DAC_FS (29) 45 + #define SUN4I_CODEC_DAC_FIFOC_FIR_VERSION (28) 46 + #define SUN4I_CODEC_DAC_FIFOC_SEND_LASAT (26) 47 + #define SUN4I_CODEC_DAC_FIFOC_TX_FIFO_MODE (24) 48 + #define SUN4I_CODEC_DAC_FIFOC_DRQ_CLR_CNT (21) 49 + #define SUN4I_CODEC_DAC_FIFOC_TX_TRIG_LEVEL (8) 50 + #define SUN4I_CODEC_DAC_FIFOC_MONO_EN (6) 51 + #define SUN4I_CODEC_DAC_FIFOC_TX_SAMPLE_BITS (5) 52 + #define SUN4I_CODEC_DAC_FIFOC_DAC_DRQ_EN (4) 53 + #define SUN4I_CODEC_DAC_FIFOC_FIFO_FLUSH (0) 54 + #define SUN4I_CODEC_DAC_FIFOS (0x08) 55 + #define SUN4I_CODEC_DAC_TXDATA (0x0c) 56 + #define SUN4I_CODEC_DAC_ACTL (0x10) 57 + #define SUN4I_CODEC_DAC_ACTL_DACAENR (31) 58 + #define SUN4I_CODEC_DAC_ACTL_DACAENL (30) 59 + #define SUN4I_CODEC_DAC_ACTL_MIXEN (29) 60 + #define SUN4I_CODEC_DAC_ACTL_LDACLMIXS (15) 61 + #define SUN4I_CODEC_DAC_ACTL_RDACRMIXS (14) 62 + #define SUN4I_CODEC_DAC_ACTL_LDACRMIXS (13) 63 + #define SUN4I_CODEC_DAC_ACTL_DACPAS (8) 64 + #define SUN4I_CODEC_DAC_ACTL_MIXPAS (7) 65 + #define SUN4I_CODEC_DAC_ACTL_PA_MUTE (6) 66 + #define SUN4I_CODEC_DAC_ACTL_PA_VOL (0) 67 + #define SUN4I_CODEC_DAC_TUNE (0x14) 68 + #define SUN4I_CODEC_DAC_DEBUG (0x18) 69 + 70 + /* Codec ADC register offsets and bit fields */ 71 + #define SUN4I_CODEC_ADC_FIFOC (0x1c) 72 + #define SUN4I_CODEC_ADC_FIFOC_EN_AD (28) 73 + #define SUN4I_CODEC_ADC_FIFOC_RX_FIFO_MODE (24) 74 + #define SUN4I_CODEC_ADC_FIFOC_RX_TRIG_LEVEL (8) 75 + #define SUN4I_CODEC_ADC_FIFOC_MONO_EN (7) 76 + #define SUN4I_CODEC_ADC_FIFOC_RX_SAMPLE_BITS (6) 77 + #define SUN4I_CODEC_ADC_FIFOC_ADC_DRQ_EN (4) 78 + #define SUN4I_CODEC_ADC_FIFOC_FIFO_FLUSH (0) 79 + #define SUN4I_CODEC_ADC_FIFOS (0x20) 80 + #define SUN4I_CODEC_ADC_RXDATA (0x24) 81 + #define SUN4I_CODEC_ADC_ACTL (0x28) 82 + #define SUN4I_CODEC_ADC_ACTL_ADC_R_EN (31) 83 + #define SUN4I_CODEC_ADC_ACTL_ADC_L_EN (30) 84 + #define SUN4I_CODEC_ADC_ACTL_PREG1EN (29) 85 + #define SUN4I_CODEC_ADC_ACTL_PREG2EN (28) 86 + #define SUN4I_CODEC_ADC_ACTL_VMICEN (27) 87 + #define SUN4I_CODEC_ADC_ACTL_VADCG (20) 88 + #define SUN4I_CODEC_ADC_ACTL_ADCIS (17) 89 + #define SUN4I_CODEC_ADC_ACTL_PA_EN (4) 90 + #define SUN4I_CODEC_ADC_ACTL_DDE (3) 91 + #define SUN4I_CODEC_ADC_DEBUG (0x2c) 92 + 93 + /* Other various ADC registers */ 94 + #define SUN4I_CODEC_DAC_TXCNT (0x30) 95 + #define SUN4I_CODEC_ADC_RXCNT (0x34) 96 + #define SUN4I_CODEC_AC_SYS_VERI (0x38) 97 + #define SUN4I_CODEC_AC_MIC_PHONE_CAL (0x3c) 98 + 99 + struct sun4i_codec { 100 + struct device *dev; 101 + struct regmap *regmap; 102 + struct clk *clk_apb; 103 + struct clk *clk_module; 104 + 105 + struct snd_dmaengine_dai_dma_data playback_dma_data; 106 + }; 107 + 108 + static void sun4i_codec_start_playback(struct sun4i_codec *scodec) 109 + { 110 + /* 111 + * FIXME: according to the BSP, we might need to drive a PA 112 + * GPIO high here on some boards 113 + */ 114 + 115 + /* Flush TX FIFO */ 116 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 117 + BIT(SUN4I_CODEC_DAC_FIFOC_FIFO_FLUSH), 118 + BIT(SUN4I_CODEC_DAC_FIFOC_FIFO_FLUSH)); 119 + 120 + /* Enable DAC DRQ */ 121 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 122 + BIT(SUN4I_CODEC_DAC_FIFOC_DAC_DRQ_EN), 123 + BIT(SUN4I_CODEC_DAC_FIFOC_DAC_DRQ_EN)); 124 + } 125 + 126 + static void sun4i_codec_stop_playback(struct sun4i_codec *scodec) 127 + { 128 + /* 129 + * FIXME: according to the BSP, we might need to drive a PA 130 + * GPIO low here on some boards 131 + */ 132 + 133 + /* Disable DAC DRQ */ 134 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 135 + BIT(SUN4I_CODEC_DAC_FIFOC_DAC_DRQ_EN), 136 + 0); 137 + } 138 + 139 + static int sun4i_codec_trigger(struct snd_pcm_substream *substream, int cmd, 140 + struct snd_soc_dai *dai) 141 + { 142 + struct snd_soc_pcm_runtime *rtd = substream->private_data; 143 + struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card); 144 + 145 + if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) 146 + return -ENOTSUPP; 147 + 148 + switch (cmd) { 149 + case SNDRV_PCM_TRIGGER_START: 150 + case SNDRV_PCM_TRIGGER_RESUME: 151 + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 152 + sun4i_codec_start_playback(scodec); 153 + break; 154 + 155 + case SNDRV_PCM_TRIGGER_STOP: 156 + case SNDRV_PCM_TRIGGER_SUSPEND: 157 + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 158 + sun4i_codec_stop_playback(scodec); 159 + break; 160 + 161 + default: 162 + return -EINVAL; 163 + } 164 + 165 + return 0; 166 + } 167 + 168 + static int sun4i_codec_prepare(struct snd_pcm_substream *substream, 169 + struct snd_soc_dai *dai) 170 + { 171 + struct snd_soc_pcm_runtime *rtd = substream->private_data; 172 + struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card); 173 + u32 val; 174 + 175 + if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) 176 + return -ENOTSUPP; 177 + 178 + /* Flush the TX FIFO */ 179 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 180 + BIT(SUN4I_CODEC_DAC_FIFOC_FIFO_FLUSH), 181 + BIT(SUN4I_CODEC_DAC_FIFOC_FIFO_FLUSH)); 182 + 183 + /* Set TX FIFO Empty Trigger Level */ 184 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 185 + 0x3f << SUN4I_CODEC_DAC_FIFOC_TX_TRIG_LEVEL, 186 + 0xf << SUN4I_CODEC_DAC_FIFOC_TX_TRIG_LEVEL); 187 + 188 + if (substream->runtime->rate > 32000) 189 + /* Use 64 bits FIR filter */ 190 + val = 0; 191 + else 192 + /* Use 32 bits FIR filter */ 193 + val = BIT(SUN4I_CODEC_DAC_FIFOC_FIR_VERSION); 194 + 195 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 196 + BIT(SUN4I_CODEC_DAC_FIFOC_FIR_VERSION), 197 + val); 198 + 199 + /* Send zeros when we have an underrun */ 200 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 201 + BIT(SUN4I_CODEC_DAC_FIFOC_SEND_LASAT), 202 + 0); 203 + 204 + return 0; 205 + } 206 + 207 + static unsigned long sun4i_codec_get_mod_freq(struct snd_pcm_hw_params *params) 208 + { 209 + unsigned int rate = params_rate(params); 210 + 211 + switch (rate) { 212 + case 176400: 213 + case 88200: 214 + case 44100: 215 + case 33075: 216 + case 22050: 217 + case 14700: 218 + case 11025: 219 + case 7350: 220 + return 22579200; 221 + 222 + case 192000: 223 + case 96000: 224 + case 48000: 225 + case 32000: 226 + case 24000: 227 + case 16000: 228 + case 12000: 229 + case 8000: 230 + return 24576000; 231 + 232 + default: 233 + return 0; 234 + } 235 + } 236 + 237 + static int sun4i_codec_get_hw_rate(struct snd_pcm_hw_params *params) 238 + { 239 + unsigned int rate = params_rate(params); 240 + 241 + switch (rate) { 242 + case 192000: 243 + case 176400: 244 + return 6; 245 + 246 + case 96000: 247 + case 88200: 248 + return 7; 249 + 250 + case 48000: 251 + case 44100: 252 + return 0; 253 + 254 + case 32000: 255 + case 33075: 256 + return 1; 257 + 258 + case 24000: 259 + case 22050: 260 + return 2; 261 + 262 + case 16000: 263 + case 14700: 264 + return 3; 265 + 266 + case 12000: 267 + case 11025: 268 + return 4; 269 + 270 + case 8000: 271 + case 7350: 272 + return 5; 273 + 274 + default: 275 + return -EINVAL; 276 + } 277 + } 278 + 279 + static int sun4i_codec_hw_params(struct snd_pcm_substream *substream, 280 + struct snd_pcm_hw_params *params, 281 + struct snd_soc_dai *dai) 282 + { 283 + struct snd_soc_pcm_runtime *rtd = substream->private_data; 284 + struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card); 285 + unsigned long clk_freq; 286 + int hwrate; 287 + u32 val; 288 + 289 + if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) 290 + return -ENOTSUPP; 291 + 292 + clk_freq = sun4i_codec_get_mod_freq(params); 293 + if (!clk_freq) 294 + return -EINVAL; 295 + 296 + if (clk_set_rate(scodec->clk_module, clk_freq)) 297 + return -EINVAL; 298 + 299 + hwrate = sun4i_codec_get_hw_rate(params); 300 + if (hwrate < 0) 301 + return hwrate; 302 + 303 + /* Set DAC sample rate */ 304 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 305 + 7 << SUN4I_CODEC_DAC_FIFOC_DAC_FS, 306 + hwrate << SUN4I_CODEC_DAC_FIFOC_DAC_FS); 307 + 308 + /* Set the number of channels we want to use */ 309 + if (params_channels(params) == 1) 310 + val = BIT(SUN4I_CODEC_DAC_FIFOC_MONO_EN); 311 + else 312 + val = 0; 313 + 314 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 315 + BIT(SUN4I_CODEC_DAC_FIFOC_MONO_EN), 316 + val); 317 + 318 + /* Set the number of sample bits to either 16 or 24 bits */ 319 + if (hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS)->min == 32) { 320 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 321 + BIT(SUN4I_CODEC_DAC_FIFOC_TX_SAMPLE_BITS), 322 + BIT(SUN4I_CODEC_DAC_FIFOC_TX_SAMPLE_BITS)); 323 + 324 + /* Set TX FIFO mode to padding the LSBs with 0 */ 325 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 326 + BIT(SUN4I_CODEC_DAC_FIFOC_TX_FIFO_MODE), 327 + 0); 328 + 329 + scodec->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 330 + } else { 331 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 332 + BIT(SUN4I_CODEC_DAC_FIFOC_TX_SAMPLE_BITS), 333 + 0); 334 + 335 + /* Set TX FIFO mode to repeat the MSB */ 336 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 337 + BIT(SUN4I_CODEC_DAC_FIFOC_TX_FIFO_MODE), 338 + BIT(SUN4I_CODEC_DAC_FIFOC_TX_FIFO_MODE)); 339 + 340 + scodec->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; 341 + } 342 + 343 + return 0; 344 + } 345 + 346 + static int sun4i_codec_startup(struct snd_pcm_substream *substream, 347 + struct snd_soc_dai *dai) 348 + { 349 + struct snd_soc_pcm_runtime *rtd = substream->private_data; 350 + struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card); 351 + 352 + /* 353 + * Stop issuing DRQ when we have room for less than 16 samples 354 + * in our TX FIFO 355 + */ 356 + regmap_update_bits(scodec->regmap, SUN4I_CODEC_DAC_FIFOC, 357 + 3 << SUN4I_CODEC_DAC_FIFOC_DRQ_CLR_CNT, 358 + 3 << SUN4I_CODEC_DAC_FIFOC_DRQ_CLR_CNT); 359 + 360 + return clk_prepare_enable(scodec->clk_module); 361 + } 362 + 363 + static void sun4i_codec_shutdown(struct snd_pcm_substream *substream, 364 + struct snd_soc_dai *dai) 365 + { 366 + struct snd_soc_pcm_runtime *rtd = substream->private_data; 367 + struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card); 368 + 369 + clk_disable_unprepare(scodec->clk_module); 370 + } 371 + 372 + static const struct snd_soc_dai_ops sun4i_codec_dai_ops = { 373 + .startup = sun4i_codec_startup, 374 + .shutdown = sun4i_codec_shutdown, 375 + .trigger = sun4i_codec_trigger, 376 + .hw_params = sun4i_codec_hw_params, 377 + .prepare = sun4i_codec_prepare, 378 + }; 379 + 380 + static struct snd_soc_dai_driver sun4i_codec_dai = { 381 + .name = "Codec", 382 + .ops = &sun4i_codec_dai_ops, 383 + .playback = { 384 + .stream_name = "Codec Playback", 385 + .channels_min = 1, 386 + .channels_max = 2, 387 + .rate_min = 8000, 388 + .rate_max = 192000, 389 + .rates = SNDRV_PCM_RATE_8000_48000 | 390 + SNDRV_PCM_RATE_96000 | 391 + SNDRV_PCM_RATE_192000 | 392 + SNDRV_PCM_RATE_KNOT, 393 + .formats = SNDRV_PCM_FMTBIT_S16_LE | 394 + SNDRV_PCM_FMTBIT_S32_LE, 395 + .sig_bits = 24, 396 + }, 397 + }; 398 + 399 + /*** Codec ***/ 400 + static const struct snd_kcontrol_new sun4i_codec_pa_mute = 401 + SOC_DAPM_SINGLE("Switch", SUN4I_CODEC_DAC_ACTL, 402 + SUN4I_CODEC_DAC_ACTL_PA_MUTE, 1, 0); 403 + 404 + static DECLARE_TLV_DB_SCALE(sun4i_codec_pa_volume_scale, -6300, 100, 1); 405 + 406 + static const struct snd_kcontrol_new sun4i_codec_widgets[] = { 407 + SOC_SINGLE_TLV("PA Volume", SUN4I_CODEC_DAC_ACTL, 408 + SUN4I_CODEC_DAC_ACTL_PA_VOL, 0x3F, 0, 409 + sun4i_codec_pa_volume_scale), 410 + }; 411 + 412 + static const struct snd_kcontrol_new sun4i_codec_left_mixer_controls[] = { 413 + SOC_DAPM_SINGLE("Left DAC Playback Switch", SUN4I_CODEC_DAC_ACTL, 414 + SUN4I_CODEC_DAC_ACTL_LDACLMIXS, 1, 0), 415 + }; 416 + 417 + static const struct snd_kcontrol_new sun4i_codec_right_mixer_controls[] = { 418 + SOC_DAPM_SINGLE("Right DAC Playback Switch", SUN4I_CODEC_DAC_ACTL, 419 + SUN4I_CODEC_DAC_ACTL_RDACRMIXS, 1, 0), 420 + SOC_DAPM_SINGLE("Left DAC Playback Switch", SUN4I_CODEC_DAC_ACTL, 421 + SUN4I_CODEC_DAC_ACTL_LDACRMIXS, 1, 0), 422 + }; 423 + 424 + static const struct snd_kcontrol_new sun4i_codec_pa_mixer_controls[] = { 425 + SOC_DAPM_SINGLE("DAC Playback Switch", SUN4I_CODEC_DAC_ACTL, 426 + SUN4I_CODEC_DAC_ACTL_DACPAS, 1, 0), 427 + SOC_DAPM_SINGLE("Mixer Playback Switch", SUN4I_CODEC_DAC_ACTL, 428 + SUN4I_CODEC_DAC_ACTL_MIXPAS, 1, 0), 429 + }; 430 + 431 + static const struct snd_soc_dapm_widget sun4i_codec_dapm_widgets[] = { 432 + /* Digital parts of the DACs */ 433 + SND_SOC_DAPM_SUPPLY("DAC", SUN4I_CODEC_DAC_DPC, 434 + SUN4I_CODEC_DAC_DPC_EN_DA, 0, 435 + NULL, 0), 436 + 437 + /* Analog parts of the DACs */ 438 + SND_SOC_DAPM_DAC("Left DAC", "Codec Playback", SUN4I_CODEC_DAC_ACTL, 439 + SUN4I_CODEC_DAC_ACTL_DACAENL, 0), 440 + SND_SOC_DAPM_DAC("Right DAC", "Codec Playback", SUN4I_CODEC_DAC_ACTL, 441 + SUN4I_CODEC_DAC_ACTL_DACAENR, 0), 442 + 443 + /* Mixers */ 444 + SND_SOC_DAPM_MIXER("Left Mixer", SND_SOC_NOPM, 0, 0, 445 + sun4i_codec_left_mixer_controls, 446 + ARRAY_SIZE(sun4i_codec_left_mixer_controls)), 447 + SND_SOC_DAPM_MIXER("Right Mixer", SND_SOC_NOPM, 0, 0, 448 + sun4i_codec_right_mixer_controls, 449 + ARRAY_SIZE(sun4i_codec_right_mixer_controls)), 450 + 451 + /* Global Mixer Enable */ 452 + SND_SOC_DAPM_SUPPLY("Mixer Enable", SUN4I_CODEC_DAC_ACTL, 453 + SUN4I_CODEC_DAC_ACTL_MIXEN, 0, NULL, 0), 454 + 455 + /* Pre-Amplifier */ 456 + SND_SOC_DAPM_MIXER("Pre-Amplifier", SUN4I_CODEC_ADC_ACTL, 457 + SUN4I_CODEC_ADC_ACTL_PA_EN, 0, 458 + sun4i_codec_pa_mixer_controls, 459 + ARRAY_SIZE(sun4i_codec_pa_mixer_controls)), 460 + SND_SOC_DAPM_SWITCH("Pre-Amplifier Mute", SND_SOC_NOPM, 0, 0, 461 + &sun4i_codec_pa_mute), 462 + 463 + SND_SOC_DAPM_OUTPUT("HP Right"), 464 + SND_SOC_DAPM_OUTPUT("HP Left"), 465 + }; 466 + 467 + static const struct snd_soc_dapm_route sun4i_codec_dapm_routes[] = { 468 + /* Left DAC Routes */ 469 + { "Left DAC", NULL, "DAC" }, 470 + 471 + /* Right DAC Routes */ 472 + { "Right DAC", NULL, "DAC" }, 473 + 474 + /* Right Mixer Routes */ 475 + { "Right Mixer", NULL, "Mixer Enable" }, 476 + { "Right Mixer", "Left DAC Playback Switch", "Left DAC" }, 477 + { "Right Mixer", "Right DAC Playback Switch", "Right DAC" }, 478 + 479 + /* Left Mixer Routes */ 480 + { "Left Mixer", NULL, "Mixer Enable" }, 481 + { "Left Mixer", "Left DAC Playback Switch", "Left DAC" }, 482 + 483 + /* Pre-Amplifier Mixer Routes */ 484 + { "Pre-Amplifier", "Mixer Playback Switch", "Left Mixer" }, 485 + { "Pre-Amplifier", "Mixer Playback Switch", "Right Mixer" }, 486 + { "Pre-Amplifier", "DAC Playback Switch", "Left DAC" }, 487 + { "Pre-Amplifier", "DAC Playback Switch", "Right DAC" }, 488 + 489 + /* PA -> HP path */ 490 + { "Pre-Amplifier Mute", "Switch", "Pre-Amplifier" }, 491 + { "HP Right", NULL, "Pre-Amplifier Mute" }, 492 + { "HP Left", NULL, "Pre-Amplifier Mute" }, 493 + }; 494 + 495 + static struct snd_soc_codec_driver sun4i_codec_codec = { 496 + .controls = sun4i_codec_widgets, 497 + .num_controls = ARRAY_SIZE(sun4i_codec_widgets), 498 + .dapm_widgets = sun4i_codec_dapm_widgets, 499 + .num_dapm_widgets = ARRAY_SIZE(sun4i_codec_dapm_widgets), 500 + .dapm_routes = sun4i_codec_dapm_routes, 501 + .num_dapm_routes = ARRAY_SIZE(sun4i_codec_dapm_routes), 502 + }; 503 + 504 + static const struct snd_soc_component_driver sun4i_codec_component = { 505 + .name = "sun4i-codec", 506 + }; 507 + 508 + #define SUN4I_CODEC_RATES SNDRV_PCM_RATE_8000_192000 509 + #define SUN4I_CODEC_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ 510 + SNDRV_PCM_FMTBIT_S32_LE) 511 + 512 + static int sun4i_codec_dai_probe(struct snd_soc_dai *dai) 513 + { 514 + struct snd_soc_card *card = snd_soc_dai_get_drvdata(dai); 515 + struct sun4i_codec *scodec = snd_soc_card_get_drvdata(card); 516 + 517 + snd_soc_dai_init_dma_data(dai, &scodec->playback_dma_data, 518 + NULL); 519 + 520 + return 0; 521 + } 522 + 523 + static struct snd_soc_dai_driver dummy_cpu_dai = { 524 + .name = "sun4i-codec-cpu-dai", 525 + .probe = sun4i_codec_dai_probe, 526 + .playback = { 527 + .stream_name = "Playback", 528 + .channels_min = 1, 529 + .channels_max = 2, 530 + .rates = SUN4I_CODEC_RATES, 531 + .formats = SUN4I_CODEC_FORMATS, 532 + .sig_bits = 24, 533 + }, 534 + }; 535 + 536 + static const struct regmap_config sun4i_codec_regmap_config = { 537 + .reg_bits = 32, 538 + .reg_stride = 4, 539 + .val_bits = 32, 540 + .max_register = SUN4I_CODEC_AC_MIC_PHONE_CAL, 541 + }; 542 + 543 + static const struct of_device_id sun4i_codec_of_match[] = { 544 + { .compatible = "allwinner,sun4i-a10-codec" }, 545 + { .compatible = "allwinner,sun7i-a20-codec" }, 546 + {} 547 + }; 548 + MODULE_DEVICE_TABLE(of, sun4i_codec_of_match); 549 + 550 + static struct snd_soc_dai_link *sun4i_codec_create_link(struct device *dev, 551 + int *num_links) 552 + { 553 + struct snd_soc_dai_link *link = devm_kzalloc(dev, sizeof(*link), 554 + GFP_KERNEL); 555 + if (!link) 556 + return NULL; 557 + 558 + link->name = "cdc"; 559 + link->stream_name = "CDC PCM"; 560 + link->codec_dai_name = "Codec"; 561 + link->cpu_dai_name = dev_name(dev); 562 + link->codec_name = dev_name(dev); 563 + link->platform_name = dev_name(dev); 564 + link->dai_fmt = SND_SOC_DAIFMT_I2S; 565 + 566 + *num_links = 1; 567 + 568 + return link; 569 + }; 570 + 571 + static struct snd_soc_card *sun4i_codec_create_card(struct device *dev) 572 + { 573 + struct snd_soc_card *card; 574 + int ret; 575 + 576 + card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); 577 + if (!card) 578 + return NULL; 579 + 580 + card->dai_link = sun4i_codec_create_link(dev, &card->num_links); 581 + if (!card->dai_link) 582 + return NULL; 583 + 584 + card->dev = dev; 585 + card->name = "sun4i-codec"; 586 + 587 + ret = snd_soc_of_parse_audio_routing(card, "routing"); 588 + if (ret) { 589 + dev_err(dev, "Failed to create our audio routing\n"); 590 + return NULL; 591 + } 592 + 593 + return card; 594 + }; 595 + 596 + static int sun4i_codec_probe(struct platform_device *pdev) 597 + { 598 + struct snd_soc_card *card; 599 + struct sun4i_codec *scodec; 600 + struct resource *res; 601 + void __iomem *base; 602 + int ret; 603 + 604 + scodec = devm_kzalloc(&pdev->dev, sizeof(*scodec), GFP_KERNEL); 605 + if (!scodec) 606 + return -ENOMEM; 607 + 608 + scodec->dev = &pdev->dev; 609 + 610 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 611 + base = devm_ioremap_resource(&pdev->dev, res); 612 + if (IS_ERR(base)) { 613 + dev_err(&pdev->dev, "Failed to map the registers\n"); 614 + return PTR_ERR(base); 615 + } 616 + 617 + scodec->regmap = devm_regmap_init_mmio(&pdev->dev, base, 618 + &sun4i_codec_regmap_config); 619 + if (IS_ERR(scodec->regmap)) { 620 + dev_err(&pdev->dev, "Failed to create our regmap\n"); 621 + return PTR_ERR(scodec->regmap); 622 + } 623 + 624 + /* Get the clocks from the DT */ 625 + scodec->clk_apb = devm_clk_get(&pdev->dev, "apb"); 626 + if (IS_ERR(scodec->clk_apb)) { 627 + dev_err(&pdev->dev, "Failed to get the APB clock\n"); 628 + return PTR_ERR(scodec->clk_apb); 629 + } 630 + 631 + scodec->clk_module = devm_clk_get(&pdev->dev, "codec"); 632 + if (IS_ERR(scodec->clk_module)) { 633 + dev_err(&pdev->dev, "Failed to get the module clock\n"); 634 + return PTR_ERR(scodec->clk_module); 635 + } 636 + 637 + /* Enable the bus clock */ 638 + if (clk_prepare_enable(scodec->clk_apb)) { 639 + dev_err(&pdev->dev, "Failed to enable the APB clock\n"); 640 + return -EINVAL; 641 + } 642 + 643 + /* DMA configuration for TX FIFO */ 644 + scodec->playback_dma_data.addr = res->start + SUN4I_CODEC_DAC_TXDATA; 645 + scodec->playback_dma_data.maxburst = 4; 646 + scodec->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; 647 + 648 + ret = snd_soc_register_codec(&pdev->dev, &sun4i_codec_codec, 649 + &sun4i_codec_dai, 1); 650 + if (ret) { 651 + dev_err(&pdev->dev, "Failed to register our codec\n"); 652 + goto err_clk_disable; 653 + } 654 + 655 + ret = devm_snd_soc_register_component(&pdev->dev, 656 + &sun4i_codec_component, 657 + &dummy_cpu_dai, 1); 658 + if (ret) { 659 + dev_err(&pdev->dev, "Failed to register our DAI\n"); 660 + goto err_unregister_codec; 661 + } 662 + 663 + ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); 664 + if (ret) { 665 + dev_err(&pdev->dev, "Failed to register against DMAEngine\n"); 666 + goto err_unregister_codec; 667 + } 668 + 669 + card = sun4i_codec_create_card(&pdev->dev); 670 + if (!card) { 671 + dev_err(&pdev->dev, "Failed to create our card\n"); 672 + goto err_unregister_codec; 673 + } 674 + 675 + platform_set_drvdata(pdev, card); 676 + snd_soc_card_set_drvdata(card, scodec); 677 + 678 + ret = snd_soc_register_card(card); 679 + if (ret) { 680 + dev_err(&pdev->dev, "Failed to register our card\n"); 681 + goto err_unregister_codec; 682 + } 683 + 684 + return 0; 685 + 686 + err_unregister_codec: 687 + snd_soc_unregister_codec(&pdev->dev); 688 + err_clk_disable: 689 + clk_disable_unprepare(scodec->clk_apb); 690 + return ret; 691 + } 692 + 693 + static int sun4i_codec_remove(struct platform_device *pdev) 694 + { 695 + struct snd_soc_card *card = platform_get_drvdata(pdev); 696 + struct sun4i_codec *scodec = snd_soc_card_get_drvdata(card); 697 + 698 + snd_soc_unregister_card(card); 699 + snd_soc_unregister_codec(&pdev->dev); 700 + clk_disable_unprepare(scodec->clk_apb); 701 + 702 + return 0; 703 + } 704 + 705 + static struct platform_driver sun4i_codec_driver = { 706 + .driver = { 707 + .name = "sun4i-codec", 708 + .of_match_table = sun4i_codec_of_match, 709 + }, 710 + .probe = sun4i_codec_probe, 711 + .remove = sun4i_codec_remove, 712 + }; 713 + module_platform_driver(sun4i_codec_driver); 714 + 715 + MODULE_DESCRIPTION("Allwinner A10 codec driver"); 716 + MODULE_AUTHOR("Emilio López <emilio@elopez.com.ar>"); 717 + MODULE_AUTHOR("Jon Smirl <jonsmirl@gmail.com>"); 718 + MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>"); 719 + MODULE_LICENSE("GPL");