aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2014-08-29 03:12:12 -0400
committerMark Brown <broonie@kernel.org>2014-09-01 11:36:42 -0400
commiteadb0019d206591e34e864b62059b292e157d8fc (patch)
tree4ca657b7129cd9152582b31870eddbc950bcf016
parent025b78b809134ae710efca7ccf0a84b927ffb7c4 (diff)
ASoC: fsl-sai: using 'lsb-first' property instead of 'big-endian-data'.
The 'big-endian-data' property is originally used to indicate whether the LSB firstly or MSB firstly will be transmitted to the CODEC or received from the CODEC, and there has nothing relation to the memory data. Generally, if the audio data in big endian format, which will be using the bytes reversion, Here this can only be used to bits reversion. So using the 'lsb-first' instead of 'big-endian-data' can make the code to be readable easier and more easy to understand what this property is used to do. This property used for configuring whether the LSB or the MSB is transmitted first for the fifo data. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--Documentation/devicetree/bindings/sound/fsl-sai.txt8
-rw-r--r--sound/soc/fsl/fsl_sai.c6
-rw-r--r--sound/soc/fsl/fsl_sai.h2
3 files changed, 8 insertions, 8 deletions
diff --git a/Documentation/devicetree/bindings/sound/fsl-sai.txt b/Documentation/devicetree/bindings/sound/fsl-sai.txt
index 06a405e7f3e7..4956b14d4b06 100644
--- a/Documentation/devicetree/bindings/sound/fsl-sai.txt
+++ b/Documentation/devicetree/bindings/sound/fsl-sai.txt
@@ -20,9 +20,9 @@ Required properties:
20 See ../pinctrl/pinctrl-bindings.txt for details of the property values. 20 See ../pinctrl/pinctrl-bindings.txt for details of the property values.
21- big-endian: Boolean property, required if all the FTM_PWM registers 21- big-endian: Boolean property, required if all the FTM_PWM registers
22 are big-endian rather than little-endian. 22 are big-endian rather than little-endian.
23- big-endian-data: If this property is absent, the little endian mode will 23- lsb-first: Configures whether the LSB or the MSB is transmitted first for
24 be in use as default, or the big endian mode will be in use for all the 24 the fifo data. If this property is absent, the MSB is transmitted first as
25 fifo data. 25 default, or the LSB is transmitted first.
26- fsl,sai-synchronous-rx: This is a boolean property. If present, indicating 26- fsl,sai-synchronous-rx: This is a boolean property. If present, indicating
27 that SAI will work in the synchronous mode (sync Tx with Rx) which means 27 that SAI will work in the synchronous mode (sync Tx with Rx) which means
28 both the transimitter and receiver will send and receive data by following 28 both the transimitter and receiver will send and receive data by following
@@ -53,5 +53,5 @@ sai2: sai@40031000 {
53 dmas = <&edma0 0 VF610_EDMA_MUXID0_SAI2_TX>, 53 dmas = <&edma0 0 VF610_EDMA_MUXID0_SAI2_TX>,
54 <&edma0 0 VF610_EDMA_MUXID0_SAI2_RX>; 54 <&edma0 0 VF610_EDMA_MUXID0_SAI2_RX>;
55 big-endian; 55 big-endian;
56 big-endian-data; 56 lsb-first;
57}; 57};
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index a6eb7849959c..7eeb1dd8ce27 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -175,7 +175,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
175 bool tx = fsl_dir == FSL_FMT_TRANSMITTER; 175 bool tx = fsl_dir == FSL_FMT_TRANSMITTER;
176 u32 val_cr2 = 0, val_cr4 = 0; 176 u32 val_cr2 = 0, val_cr4 = 0;
177 177
178 if (!sai->big_endian_data) 178 if (!sai->is_lsb_first)
179 val_cr4 |= FSL_SAI_CR4_MF; 179 val_cr4 |= FSL_SAI_CR4_MF;
180 180
181 /* DAI mode */ 181 /* DAI mode */
@@ -304,7 +304,7 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream,
304 val_cr5 |= FSL_SAI_CR5_WNW(word_width); 304 val_cr5 |= FSL_SAI_CR5_WNW(word_width);
305 val_cr5 |= FSL_SAI_CR5_W0W(word_width); 305 val_cr5 |= FSL_SAI_CR5_W0W(word_width);
306 306
307 if (sai->big_endian_data) 307 if (sai->is_lsb_first)
308 val_cr5 |= FSL_SAI_CR5_FBT(0); 308 val_cr5 |= FSL_SAI_CR5_FBT(0);
309 else 309 else
310 val_cr5 |= FSL_SAI_CR5_FBT(word_width - 1); 310 val_cr5 |= FSL_SAI_CR5_FBT(word_width - 1);
@@ -573,7 +573,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
573 if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx6sx-sai")) 573 if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx6sx-sai"))
574 sai->sai_on_imx = true; 574 sai->sai_on_imx = true;
575 575
576 sai->big_endian_data = of_property_read_bool(np, "big-endian-data"); 576 sai->is_lsb_first = of_property_read_bool(np, "lsb-first");
577 577
578 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 578 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
579 base = devm_ioremap_resource(&pdev->dev, res); 579 base = devm_ioremap_resource(&pdev->dev, res);
diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h
index 2cded440d567..34667209b607 100644
--- a/sound/soc/fsl/fsl_sai.h
+++ b/sound/soc/fsl/fsl_sai.h
@@ -132,7 +132,7 @@ struct fsl_sai {
132 struct clk *bus_clk; 132 struct clk *bus_clk;
133 struct clk *mclk_clk[FSL_SAI_MCLK_MAX]; 133 struct clk *mclk_clk[FSL_SAI_MCLK_MAX];
134 134
135 bool big_endian_data; 135 bool is_lsb_first;
136 bool is_dsp_mode; 136 bool is_dsp_mode;
137 bool sai_on_imx; 137 bool sai_on_imx;
138 bool synchronous[2]; 138 bool synchronous[2];