From: kbuild test robot <lkp@intel.com>
To: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Cc: kbuild-all@01.org, Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Jonathan Cameron <jic23@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
Alexandre Torgue <alexandre.torgue@st.com>,
linux-iio@vger.kernel.org, arnaud.pouliquen@st.com,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [alsa-devel] [PATCH v5 13/13] ASoC: stm32: add DFSDM DAI support
Date: Fri, 1 Dec 2017 22:41:33 +0800 [thread overview]
Message-ID: <201712012209.tM3mzVo9%fengguang.wu@intel.com> (raw)
In-Reply-To: <1511881557-28596-14-git-send-email-arnaud.pouliquen@st.com>
[-- Attachment #1: Type: text/plain, Size: 7495 bytes --]
Hi Arnaud,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on iio/togreg]
[also build test WARNING on v4.15-rc1 next-20171201]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Arnaud-Pouliquen/Add-STM32-DFSDM-support/20171201-215409
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: blackfin-allyesconfig (attached as .config)
compiler: bfin-uclinux-gcc (GCC) 6.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=blackfin
All warnings (new ones prefixed by >>):
In file included from include/linux/printk.h:329:0,
from include/linux/kernel.h:13,
from include/linux/clk.h:16,
from sound/soc//stm/stm32_adfsdm.c:23:
sound/soc//stm/stm32_adfsdm.c: In function 'stm32_afsdm_pcm_cb':
>> sound/soc//stm/stm32_adfsdm.c:173:20: warning: format '%d' expects argument of type 'int', but argument 7 has type 'size_t {aka long unsigned int}' [-Wformat=]
dev_dbg(rtd->dev, "%s: buff_add :%p, pos = %d, size = %d\n",
^
include/linux/dynamic_debug.h:134:39: note: in definition of macro 'dynamic_dev_dbg'
__dynamic_dev_dbg(&descriptor, dev, fmt, \
^~~
>> sound/soc//stm/stm32_adfsdm.c:173:2: note: in expansion of macro 'dev_dbg'
dev_dbg(rtd->dev, "%s: buff_add :%p, pos = %d, size = %d\n",
^~~~~~~
vim +/dev_dbg +173 sound/soc//stm/stm32_adfsdm.c
> 23 #include <linux/clk.h>
24 #include <linux/module.h>
25 #include <linux/platform_device.h>
26 #include <linux/slab.h>
27
28 #include <linux/iio/iio.h>
29 #include <linux/iio/consumer.h>
30 #include <linux/iio/adc/stm32-dfsdm-adc.h>
31
32 #include <sound/pcm.h>
33 #include <sound/soc.h>
34
35 #define STM32_ADFSDM_DRV_NAME "stm32-adfsdm"
36
37 #define DFSDM_MAX_PERIOD_SIZE (PAGE_SIZE / 2)
38 #define DFSDM_MAX_PERIODS 6
39
40 struct stm32_adfsdm_priv {
41 struct snd_soc_dai_driver dai_drv;
42 struct snd_pcm_substream *substream;
43 struct device *dev;
44
45 /* IIO */
46 struct iio_channel *iio_ch;
47 struct iio_cb_buffer *iio_cb;
48 bool iio_active;
49
50 /* PCM buffer */
51 unsigned char *pcm_buff;
52 unsigned int pos;
53 bool allocated;
54 };
55
56 struct stm32_adfsdm_data {
57 unsigned int rate; /* SNDRV_PCM_RATE value */
58 unsigned int freq; /* frequency in Hz */
59 };
60
61 static const struct snd_pcm_hardware stm32_adfsdm_pcm_hw = {
62 .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
63 SNDRV_PCM_INFO_PAUSE,
64 .formats = SNDRV_PCM_FMTBIT_S32_LE,
65
66 .rate_min = 8000,
67 .rate_max = 32000,
68
69 .channels_min = 1,
70 .channels_max = 1,
71
72 .periods_min = 2,
73 .periods_max = DFSDM_MAX_PERIODS,
74
75 .period_bytes_max = DFSDM_MAX_PERIOD_SIZE,
76 .buffer_bytes_max = DFSDM_MAX_PERIODS * DFSDM_MAX_PERIOD_SIZE
77 };
78
79 static void stm32_adfsdm_shutdown(struct snd_pcm_substream *substream,
80 struct snd_soc_dai *dai)
81 {
82 struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(dai);
83
84 if (priv->iio_active) {
85 iio_channel_stop_all_cb(priv->iio_cb);
86 priv->iio_active = false;
87 }
88 }
89
90 static int stm32_adfsdm_dai_prepare(struct snd_pcm_substream *substream,
91 struct snd_soc_dai *dai)
92 {
93 struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(dai);
94 int ret;
95
96 ret = iio_write_channel_attribute(priv->iio_ch,
97 substream->runtime->rate, 0,
98 IIO_CHAN_INFO_SAMP_FREQ);
99 if (ret < 0) {
100 dev_err(dai->dev, "%s: Failed to set %d sampling rate\n",
101 __func__, substream->runtime->rate);
102 return ret;
103 }
104
105 if (!priv->iio_active) {
106 ret = iio_channel_start_all_cb(priv->iio_cb);
107 if (!ret)
108 priv->iio_active = true;
109 else
110 dev_err(dai->dev, "%s: IIO channel start failed (%d)\n",
111 __func__, ret);
112 }
113
114 return ret;
115 }
116
117 static int stm32_adfsdm_set_sysclk(struct snd_soc_dai *dai, int clk_id,
118 unsigned int freq, int dir)
119 {
120 struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(dai);
121 ssize_t size;
122
123 dev_dbg(dai->dev, "%s: Enter for freq %d\n", __func__, freq);
124
125 /* Set IIO frequency if CODEC is master as clock comes from SPI_IN*/
126 if (dir == SND_SOC_CLOCK_IN) {
127 char str_freq[10];
128
129 snprintf(str_freq, sizeof(str_freq), "%d\n", freq);
130 size = iio_write_channel_ext_info(priv->iio_ch, "spi_clk_freq",
131 str_freq, sizeof(str_freq));
132 if (size != sizeof(str_freq)) {
133 dev_err(dai->dev, "%s: Failed to set SPI clock\n",
134 __func__);
135 return -EINVAL;
136 }
137 }
138 return 0;
139 }
140
141 static const struct snd_soc_dai_ops stm32_adfsdm_dai_ops = {
142 .shutdown = stm32_adfsdm_shutdown,
143 .prepare = stm32_adfsdm_dai_prepare,
144 .set_sysclk = stm32_adfsdm_set_sysclk,
145 };
146
147 static const struct snd_soc_dai_driver stm32_adfsdm_dai = {
148 .capture = {
149 .channels_min = 1,
150 .channels_max = 1,
151 .formats = SNDRV_PCM_FMTBIT_S32_LE,
152 .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
153 SNDRV_PCM_RATE_32000),
154 },
155 .ops = &stm32_adfsdm_dai_ops,
156 };
157
158 static const struct snd_soc_component_driver stm32_adfsdm_dai_component = {
159 .name = "stm32_dfsdm_audio",
160 };
161
162 static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private)
163 {
164 struct stm32_adfsdm_priv *priv = private;
165 struct snd_soc_pcm_runtime *rtd = priv->substream->private_data;
166 u8 *pcm_buff = priv->pcm_buff;
167 u8 *src_buff = (u8 *)data;
168 unsigned int buff_size = snd_pcm_lib_buffer_bytes(priv->substream);
169 unsigned int period_size = snd_pcm_lib_period_bytes(priv->substream);
170 unsigned int old_pos = priv->pos;
171 unsigned int cur_size = size;
172
> 173 dev_dbg(rtd->dev, "%s: buff_add :%p, pos = %d, size = %d\n",
174 __func__, &pcm_buff[priv->pos], priv->pos, size);
175
176 if ((priv->pos + size) > buff_size) {
177 memcpy(&pcm_buff[priv->pos], src_buff, buff_size - priv->pos);
178 cur_size -= buff_size - priv->pos;
179 priv->pos = 0;
180 }
181
182 memcpy(&pcm_buff[priv->pos], &src_buff[size - cur_size], cur_size);
183 priv->pos = (priv->pos + cur_size) % buff_size;
184
185 if (cur_size != size || (old_pos && (old_pos % period_size < size)))
186 snd_pcm_period_elapsed(priv->substream);
187
188 return 0;
189 }
190
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 46104 bytes --]
next prev parent reply other threads:[~2017-12-01 14:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-28 15:05 [PATCH v5 00/13] Add STM32 DFSDM support Arnaud Pouliquen
2017-11-28 15:05 ` [PATCH v5 01/13] iio: Add hardware consumer buffer support Arnaud Pouliquen
2017-11-28 15:05 ` [PATCH v5 02/13] docs: driver-api: add iio hw consumer section Arnaud Pouliquen
2018-01-10 11:13 ` Applied "docs: driver-api: add iio hw consumer section" to the asoc tree Mark Brown
2017-11-28 15:05 ` [PATCH v5 03/13] IIO: hw_consumer: add devm_iio_hw_consumer_alloc Arnaud Pouliquen
2018-01-10 11:13 ` Applied "IIO: hw_consumer: add devm_iio_hw_consumer_alloc" to the asoc tree Mark Brown
2017-11-28 15:05 ` [PATCH v5 04/13] IIO: inkern: API for manipulating channel attributes Arnaud Pouliquen
2017-11-29 6:20 ` Phil Reid
2017-12-01 14:41 ` [alsa-devel] " kbuild test robot
2017-12-01 15:12 ` kbuild test robot
2017-11-28 15:05 ` [PATCH v5 05/13] IIO: Add DT bindings for sigma delta adc modulator Arnaud Pouliquen
2017-11-28 15:05 ` [PATCH v5 06/13] IIO: ADC: add sigma delta modulator support Arnaud Pouliquen
2017-11-28 15:05 ` [PATCH v5 07/13] IIO: add DT bindings for stm32 DFSDM filter Arnaud Pouliquen
2017-11-28 15:05 ` [PATCH v5 08/13] IIO: ADC: add stm32 DFSDM core support Arnaud Pouliquen
2017-11-28 15:05 ` [PATCH v5 09/13] IIO: ADC: add STM32 DFSDM sigma delta ADC support Arnaud Pouliquen
2017-11-28 15:05 ` [PATCH v5 10/13] IIO: ADC: add stm32 DFSDM support for PDM microphone Arnaud Pouliquen
2017-11-28 15:05 ` [PATCH v5 11/13] IIO: consumer: allow to set buffer sizes Arnaud Pouliquen
2017-11-28 15:05 ` [PATCH v5 12/13] ASoC: add bindings for stm32 DFSDM filter Arnaud Pouliquen
2017-11-28 15:05 ` [PATCH v5 13/13] ASoC: stm32: add DFSDM DAI support Arnaud Pouliquen
2017-11-29 15:37 ` Mark Brown
2017-12-01 14:41 ` kbuild test robot [this message]
2017-12-01 19:16 ` [alsa-devel] " kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201712012209.tM3mzVo9%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=alexandre.torgue@st.com \
--cc=alsa-devel@alsa-project.org \
--cc=arnaud.pouliquen@st.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=kbuild-all@01.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=perex@perex.cz \
--cc=pmeerw@pmeerw.net \
--cc=robh+dt@kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox