Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer

kbuild test robot
2020-05-09T11:24:46Z

[-- Attachment #1: Type: text/plain, Size: 31207 bytes --]

Hi Yongbo,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Yongbo-Zhang/ASoC-rsnd-add-interrupt-support-for-SSI-BUSIF-buffer/20200509-035713
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.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
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=xtensa

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

sound/soc/sh/rcar/ssi.c: In function 'rsnd_ssi_quit':
>> sound/soc/sh/rcar/ssi.c:596:12: error: invalid storage class for function 'rsnd_ssi_hw_params'
596 | static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:596:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
596 | static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
| ^~~~~~
>> sound/soc/sh/rcar/ssi.c:615:12: error: invalid storage class for function 'rsnd_ssi_start'
615 | static int rsnd_ssi_start(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:648:12: error: invalid storage class for function 'rsnd_ssi_stop'
648 | static int rsnd_ssi_stop(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:692:12: error: invalid storage class for function 'rsnd_ssi_irq'
692 | static int rsnd_ssi_irq(struct rsnd_mod *mod,
| ^~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:734:13: error: invalid storage class for function 'rsnd_ssi_pio_interrupt'
734 | static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:736:13: error: invalid storage class for function '__rsnd_ssi_interrupt'
736 | static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c: In function '__rsnd_ssi_interrupt':
sound/soc/sh/rcar/ssi.c:760:13: error: implicit declaration of function 'rsnd_ssi_pio_interrupt'; did you mean 'rsnd_mod_interrupt'? [-Werror=implicit-function-declaration]
760 | elapsed = rsnd_ssi_pio_interrupt(mod, io);
| ^~~~~~~~~~~~~~~~~~~~~~
| rsnd_mod_interrupt
sound/soc/sh/rcar/ssi.c:798:14: error: too few arguments to function 'rsnd_mod_write'
798 | status = rsnd_mod_write(mod,
| ^~~~~~~~~~~~~~
In file included from sound/soc/sh/rcar/ssi.c:21:
sound/soc/sh/rcar/rsnd.h:260:6: note: declared here
260 | void rsnd_mod_write(struct rsnd_mod *mod, enum rsnd_reg reg, u32 data);
| ^~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c: In function 'rsnd_ssi_quit':
sound/soc/sh/rcar/ssi.c:829:20: error: invalid storage class for function 'rsnd_ssi_interrupt'
829 | static irqreturn_t rsnd_ssi_interrupt(int irq, void *data)
| ^~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:838:13: error: invalid storage class for function 'rsnd_ssi_get_status'
838 | static u32 *rsnd_ssi_get_status(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:876:13: error: invalid storage class for function 'rsnd_ssi_parent_attach'
876 | static void rsnd_ssi_parent_attach(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:906:12: error: invalid storage class for function 'rsnd_ssi_pcm_new'
906 | static int rsnd_ssi_pcm_new(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:920:12: error: invalid storage class for function 'rsnd_ssi_common_probe'
920 | static int rsnd_ssi_common_probe(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:963:12: error: invalid storage class for function 'rsnd_ssi_common_remove'
963 | static int rsnd_ssi_common_remove(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:987:13: error: invalid storage class for function 'rsnd_ssi_pio_interrupt'
987 | static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1030:12: error: invalid storage class for function 'rsnd_ssi_pio_init'
1030 | static int rsnd_ssi_pio_init(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1048:12: error: invalid storage class for function 'rsnd_ssi_pio_pointer'
1048 | static int rsnd_ssi_pio_pointer(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1060:12: error: invalid storage class for function 'rsnd_ssi_prepare'
1060 | static int rsnd_ssi_prepare(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1069:12: error: initializer element is not constant
1069 | .probe = rsnd_ssi_common_probe,
| ^~~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1069:12: note: (near initialization for 'rsnd_ssi_pio_ops.probe')
sound/soc/sh/rcar/ssi.c:1070:13: error: initializer element is not constant
1070 | .remove = rsnd_ssi_common_remove,
| ^~~~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1070:13: note: (near initialization for 'rsnd_ssi_pio_ops.remove')
sound/soc/sh/rcar/ssi.c:1071:11: error: initializer element is not constant
1071 | .init = rsnd_ssi_pio_init,
| ^~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1071:11: note: (near initialization for 'rsnd_ssi_pio_ops.init')
sound/soc/sh/rcar/ssi.c:1073:12: error: initializer element is not constant
1073 | .start = rsnd_ssi_start,
| ^~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1073:12: note: (near initialization for 'rsnd_ssi_pio_ops.start')
sound/soc/sh/rcar/ssi.c:1074:11: error: initializer element is not constant
1074 | .stop = rsnd_ssi_stop,
| ^~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1074:11: note: (near initialization for 'rsnd_ssi_pio_ops.stop')
sound/soc/sh/rcar/ssi.c:1075:10: error: initializer element is not constant
1075 | .irq = rsnd_ssi_irq,
| ^~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1075:10: note: (near initialization for 'rsnd_ssi_pio_ops.irq')
sound/soc/sh/rcar/ssi.c:1076:13: error: initializer element is not constant
1076 | .pointer = rsnd_ssi_pio_pointer,
| ^~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1076:13: note: (near initialization for 'rsnd_ssi_pio_ops.pointer')
sound/soc/sh/rcar/ssi.c:1077:13: error: initializer element is not constant
1077 | .pcm_new = rsnd_ssi_pcm_new,
| ^~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1077:13: note: (near initialization for 'rsnd_ssi_pio_ops.pcm_new')
sound/soc/sh/rcar/ssi.c:1078:15: error: initializer element is not constant
1078 | .hw_params = rsnd_ssi_hw_params,
| ^~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1078:15: note: (near initialization for 'rsnd_ssi_pio_ops.hw_params')
sound/soc/sh/rcar/ssi.c:1079:13: error: initializer element is not constant
1079 | .prepare = rsnd_ssi_prepare,
| ^~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1079:13: note: (near initialization for 'rsnd_ssi_pio_ops.prepare')
sound/soc/sh/rcar/ssi.c:1080:16: error: initializer element is not constant
1080 | .get_status = rsnd_ssi_get_status,
| ^~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1080:16: note: (near initialization for 'rsnd_ssi_pio_ops.get_status')
>> sound/soc/sh/rcar/ssi.c:1083:12: error: invalid storage class for function 'rsnd_ssi_dma_probe'
1083 | static int rsnd_ssi_dma_probe(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1106:12: error: invalid storage class for function 'rsnd_ssi_fallback'
1106 | static int rsnd_ssi_fallback(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1126:25: error: invalid storage class for function 'rsnd_ssi_dma_req'
1126 | static struct dma_chan *rsnd_ssi_dma_req(struct rsnd_dai_stream *io,
| ^~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1155:13: error: initializer element is not constant
1155 | .dma_req = rsnd_ssi_dma_req,
| ^~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1155:13: note: (near initialization for 'rsnd_ssi_dma_ops.dma_req')
sound/soc/sh/rcar/ssi.c:1156:12: error: initializer element is not constant
1156 | .probe = rsnd_ssi_dma_probe,
| ^~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1156:12: note: (near initialization for 'rsnd_ssi_dma_ops.probe')
sound/soc/sh/rcar/ssi.c:1157:13: error: initializer element is not constant
1157 | .remove = rsnd_ssi_common_remove,
| ^~~~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1157:13: note: (near initialization for 'rsnd_ssi_dma_ops.remove')
sound/soc/sh/rcar/ssi.c:1160:12: error: initializer element is not constant
1160 | .start = rsnd_ssi_start,
| ^~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1160:12: note: (near initialization for 'rsnd_ssi_dma_ops.start')
sound/soc/sh/rcar/ssi.c:1161:11: error: initializer element is not constant
1161 | .stop = rsnd_ssi_stop,
| ^~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1161:11: note: (near initialization for 'rsnd_ssi_dma_ops.stop')
sound/soc/sh/rcar/ssi.c:1162:10: error: initializer element is not constant
1162 | .irq = rsnd_ssi_irq,
| ^~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1162:10: note: (near initialization for 'rsnd_ssi_dma_ops.irq')
sound/soc/sh/rcar/ssi.c:1163:13: error: initializer element is not constant
1163 | .pcm_new = rsnd_ssi_pcm_new,
| ^~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1163:13: note: (near initialization for 'rsnd_ssi_dma_ops.pcm_new')
sound/soc/sh/rcar/ssi.c:1164:14: error: initializer element is not constant
1164 | .fallback = rsnd_ssi_fallback,
| ^~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1164:14: note: (near initialization for 'rsnd_ssi_dma_ops.fallback')
sound/soc/sh/rcar/ssi.c:1165:15: error: initializer element is not constant
1165 | .hw_params = rsnd_ssi_hw_params,
| ^~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1165:15: note: (near initialization for 'rsnd_ssi_dma_ops.hw_params')
sound/soc/sh/rcar/ssi.c:1166:13: error: initializer element is not constant
1166 | .prepare = rsnd_ssi_prepare,
| ^~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1166:13: note: (near initialization for 'rsnd_ssi_dma_ops.prepare')
sound/soc/sh/rcar/ssi.c:1167:16: error: initializer element is not constant
1167 | .get_status = rsnd_ssi_get_status,
| ^~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1167:16: note: (near initialization for 'rsnd_ssi_dma_ops.get_status')
sound/soc/sh/rcar/ssi.c:1170:12: error: invalid storage class for function 'rsnd_ssi_is_dma_mode'
1170 | static int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod)
| ^~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1178:13: error: invalid storage class for function 'rsnd_ssi_connect'
1178 | static void rsnd_ssi_connect(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1337:1: error: expected declaration or statement at end of input
1337 | }
| ^
sound/soc/sh/rcar/ssi.c: At top level:
sound/soc/sh/rcar/ssi.c:120:12: warning: 'rsnd_ssi_is_dma_mode' used but never defined
120 | static int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod);
| ^~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1329:6: warning: 'rsnd_ssi_remove' defined but not used [-Wunused-function]
1329 | void rsnd_ssi_remove(struct rsnd_priv *priv)
| ^~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1246:5: warning: 'rsnd_ssi_probe' defined but not used [-Wunused-function]
1246 | int rsnd_ssi_probe(struct rsnd_priv *priv)
| ^~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1238:5: warning: '__rsnd_ssi_is_pin_sharing' defined but not used [-Wunused-function]
1238 | int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1230:18: warning: 'rsnd_ssi_mod_get' defined but not used [-Wunused-function]
1230 | struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id)
| ^~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1203:6: warning: 'rsnd_parse_connect_ssi' defined but not used [-Wunused-function]
1203 | void rsnd_parse_connect_ssi(struct rsnd_dai *rdai,
| ^~~~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:1170:12: warning: 'rsnd_ssi_is_dma_mode' defined but not used [-Wunused-function]
1170 | static int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod)
| ^~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:987:13: warning: 'rsnd_ssi_pio_interrupt' defined but not used [-Wunused-function]
987 | static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~~~~~~~~~~
sound/soc/sh/rcar/ssi.c:528:12: warning: 'rsnd_ssi_quit' defined but not used [-Wunused-function]
528 | static int rsnd_ssi_quit(struct rsnd_mod *mod,
| ^~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +/rsnd_ssi_hw_params +596 sound/soc/sh/rcar/ssi.c

ae5c322303fff5 Kuninori Morimoto 2013-07-21 595
919567d914b3c1 Kuninori Morimoto 2015-04-10 @596 static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto 2015-06-15 597 struct rsnd_dai_stream *io,
919567d914b3c1 Kuninori Morimoto 2015-04-10 598 struct snd_pcm_substream *substream,
919567d914b3c1 Kuninori Morimoto 2015-04-10 599 struct snd_pcm_hw_params *params)
919567d914b3c1 Kuninori Morimoto 2015-04-10 600 {
fb2815f44a9eb3 Dragos Tarcatu 2018-09-03 601 struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
fb2815f44a9eb3 Dragos Tarcatu 2018-09-03 602 unsigned int fmt_width = snd_pcm_format_width(params_format(params));
fb2815f44a9eb3 Dragos Tarcatu 2018-09-03 603
fb2815f44a9eb3 Dragos Tarcatu 2018-09-03 604 if (fmt_width > rdai->chan_width) {
fb2815f44a9eb3 Dragos Tarcatu 2018-09-03 605 struct rsnd_priv *priv = rsnd_io_to_priv(io);
fb2815f44a9eb3 Dragos Tarcatu 2018-09-03 606 struct device *dev = rsnd_priv_to_dev(priv);
fb2815f44a9eb3 Dragos Tarcatu 2018-09-03 607
fb2815f44a9eb3 Dragos Tarcatu 2018-09-03 608 dev_err(dev, "invalid combination of slot-width and format-data-width\n");
fb2815f44a9eb3 Dragos Tarcatu 2018-09-03 609 return -EINVAL;
fb2815f44a9eb3 Dragos Tarcatu 2018-09-03 610 }
919567d914b3c1 Kuninori Morimoto 2015-04-10 611
919567d914b3c1 Kuninori Morimoto 2015-04-10 612 return 0;
919567d914b3c1 Kuninori Morimoto 2015-04-10 613 }
919567d914b3c1 Kuninori Morimoto 2015-04-10 614
6a25c8da00284f Kuninori Morimoto 2016-01-26 @615 static int rsnd_ssi_start(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto 2015-06-15 616 struct rsnd_dai_stream *io,
690602fcd85385 Kuninori Morimoto 2015-01-15 617 struct rsnd_priv *priv)
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 618 {
597b046f0d99b0 Kuninori Morimoto 2017-08-08 619 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
597b046f0d99b0 Kuninori Morimoto 2017-08-08 620
fd9adcfdc1434f Kuninori Morimoto 2016-02-18 621 if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto 2016-02-18 622 return 0;
fd9adcfdc1434f Kuninori Morimoto 2016-02-18 623
b4c83b17155781 Kuninori Morimoto 2015-12-17 624 /*
b4c83b17155781 Kuninori Morimoto 2015-12-17 625 * EN will be set via SSIU :: SSI_CONTROL
b4c83b17155781 Kuninori Morimoto 2015-12-17 626 * if Multi channel mode
b4c83b17155781 Kuninori Morimoto 2015-12-17 627 */
4f5c634d58e719 Kuninori Morimoto 2016-02-18 628 if (rsnd_ssi_multi_slaves_runtime(io))
0dc6bf75023a42 Kuninori Morimoto 2016-02-18 629 return 0;
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 630
597b046f0d99b0 Kuninori Morimoto 2017-08-08 631 /*
597b046f0d99b0 Kuninori Morimoto 2017-08-08 632 * EN is for data output.
597b046f0d99b0 Kuninori Morimoto 2017-08-08 633 * SSI parent EN is not needed.
597b046f0d99b0 Kuninori Morimoto 2017-08-08 634 */
0c258657ddfe81 Matthias Blankertz 2020-04-17 635 if (rsnd_ssi_is_parent(mod, io))
597b046f0d99b0 Kuninori Morimoto 2017-08-08 636 return 0;
597b046f0d99b0 Kuninori Morimoto 2017-08-08 637
597b046f0d99b0 Kuninori Morimoto 2017-08-08 638 ssi->cr_en = EN;
597b046f0d99b0 Kuninori Morimoto 2017-08-08 639
597b046f0d99b0 Kuninori Morimoto 2017-08-08 640 rsnd_mod_write(mod, SSICR, ssi->cr_own |
597b046f0d99b0 Kuninori Morimoto 2017-08-08 641 ssi->cr_clk |
597b046f0d99b0 Kuninori Morimoto 2017-08-08 642 ssi->cr_mode |
597b046f0d99b0 Kuninori Morimoto 2017-08-08 643 ssi->cr_en);
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 644
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 645 return 0;
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 646 }
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 647
6a25c8da00284f Kuninori Morimoto 2016-01-26 648 static int rsnd_ssi_stop(struct rsnd_mod *mod,
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 649 struct rsnd_dai_stream *io,
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 650 struct rsnd_priv *priv)
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 651 {
6a25c8da00284f Kuninori Morimoto 2016-01-26 652 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
6a25c8da00284f Kuninori Morimoto 2016-01-26 653 u32 cr;
6a25c8da00284f Kuninori Morimoto 2016-01-26 654
fd9adcfdc1434f Kuninori Morimoto 2016-02-18 655 if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto 2016-02-18 656 return 0;
fd9adcfdc1434f Kuninori Morimoto 2016-02-18 657
0c258657ddfe81 Matthias Blankertz 2020-04-17 658 if (rsnd_ssi_is_parent(mod, io))
6a25c8da00284f Kuninori Morimoto 2016-01-26 659 return 0;
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 660
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 661 cr = ssi->cr_own |
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 662 ssi->cr_clk;
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 663
ce548931207c0d Kuninori Morimoto 2017-10-31 664 /*
ce548931207c0d Kuninori Morimoto 2017-10-31 665 * disable all IRQ,
ce548931207c0d Kuninori Morimoto 2017-10-31 666 * Playback: Wait all data was sent
ce548931207c0d Kuninori Morimoto 2017-10-31 667 * Capture: It might not receave data. Do nothing
ce548931207c0d Kuninori Morimoto 2017-10-31 668 */
ce548931207c0d Kuninori Morimoto 2017-10-31 669 if (rsnd_io_is_play(io)) {
54cb6221688660 Matthias Blankertz 2020-04-17 670 rsnd_mod_write(mod, SSICR, cr | ssi->cr_en);
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 671 rsnd_ssi_status_check(mod, DIRQ);
ce548931207c0d Kuninori Morimoto 2017-10-31 672 }
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 673
54cb6221688660 Matthias Blankertz 2020-04-17 674 /* In multi-SSI mode, stop is performed by setting ssi0129 in
54cb6221688660 Matthias Blankertz 2020-04-17 675 * SSI_CONTROL to 0 (in rsnd_ssio_stop_gen2). Do nothing here.
54cb6221688660 Matthias Blankertz 2020-04-17 676 */
54cb6221688660 Matthias Blankertz 2020-04-17 677 if (rsnd_ssi_multi_slaves_runtime(io))
54cb6221688660 Matthias Blankertz 2020-04-17 678 return 0;
54cb6221688660 Matthias Blankertz 2020-04-17 679
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 680 /*
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 681 * disable SSI,
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 682 * and, wait idle state
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 683 */
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 684 rsnd_mod_write(mod, SSICR, cr); /* disabled all */
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 685 rsnd_ssi_status_check(mod, IIRQ);
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 686
597b046f0d99b0 Kuninori Morimoto 2017-08-08 687 ssi->cr_en = 0;
597b046f0d99b0 Kuninori Morimoto 2017-08-08 688
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 689 return 0;
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26 690 }
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 691
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 @692 static int rsnd_ssi_irq(struct rsnd_mod *mod,
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 693 struct rsnd_dai_stream *io,
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 694 struct rsnd_priv *priv,
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 695 int enable)
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 696 {
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 697 u32 val = 0;
391d452251464b Yongbo Zhang 2020-05-08 698 int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang 2020-05-08 699 int id = rsnd_mod_id(mod);
391d452251464b Yongbo Zhang 2020-05-08 700
391d452251464b Yongbo Zhang 2020-05-08 701 is_tdm = rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang 2020-05-08 702 is_tdm_split = rsnd_runtime_is_tdm_split(io);
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 703
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 704 if (rsnd_is_gen1(priv))
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 705 return 0;
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 706
0c258657ddfe81 Matthias Blankertz 2020-04-17 707 if (rsnd_ssi_is_parent(mod, io))
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 708 return 0;
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 709
fd9adcfdc1434f Kuninori Morimoto 2016-02-18 710 if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto 2016-02-18 711 return 0;
fd9adcfdc1434f Kuninori Morimoto 2016-02-18 712
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 713 if (enable)
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 714 val = rsnd_ssi_is_dma_mode(mod) ? 0x0e000000 : 0x0f000000;
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 715
391d452251464b Yongbo Zhang 2020-05-08 716 if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang 2020-05-08 717 switch (id) {
391d452251464b Yongbo Zhang 2020-05-08 718 case 0:
391d452251464b Yongbo Zhang 2020-05-08 719 case 1:
391d452251464b Yongbo Zhang 2020-05-08 720 case 2:
391d452251464b Yongbo Zhang 2020-05-08 721 case 3:
391d452251464b Yongbo Zhang 2020-05-08 722 case 4:
391d452251464b Yongbo Zhang 2020-05-08 723 case 9:
391d452251464b Yongbo Zhang 2020-05-08 724 val |= 0xff00;
391d452251464b Yongbo Zhang 2020-05-08 725 break;
391d452251464b Yongbo Zhang 2020-05-08 726 }
391d452251464b Yongbo Zhang 2020-05-08 727 }
391d452251464b Yongbo Zhang 2020-05-08 728
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 729 rsnd_mod_write(mod, SSI_INT_ENABLE, val);
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 730
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 731 return 0;
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 732 }
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 733
d8d9b9730cd62c Kuninori Morimoto 2017-12-11 @734 static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
d8d9b9730cd62c Kuninori Morimoto 2017-12-11 735 struct rsnd_dai_stream *io);
bfc0cfe6b7acb1 Kuninori Morimoto 2015-06-15 736 static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
bfc0cfe6b7acb1 Kuninori Morimoto 2015-06-15 737 struct rsnd_dai_stream *io)
ae5c322303fff5 Kuninori Morimoto 2013-07-21 738 {
690602fcd85385 Kuninori Morimoto 2015-01-15 739 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
2b62786951ca38 Kuninori Morimoto 2018-02-13 740 struct device *dev = rsnd_priv_to_dev(priv);
765ae7c8dda7d0 Kuninori Morimoto 2015-01-15 741 int is_dma = rsnd_ssi_is_dma_mode(mod);
02299d9875bab5 Kuninori Morimoto 2015-05-21 742 u32 status;
75defee0f1b3fc Kuninori Morimoto 2015-06-15 743 bool elapsed = false;
6a25c8da00284f Kuninori Morimoto 2016-01-26 744 bool stop = false;
391d452251464b Yongbo Zhang 2020-05-08 745 int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang 2020-05-08 746
391d452251464b Yongbo Zhang 2020-05-08 747 is_tdm = rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang 2020-05-08 748 is_tdm_split = rsnd_runtime_is_tdm_split(io);
02299d9875bab5 Kuninori Morimoto 2015-05-21 749
02299d9875bab5 Kuninori Morimoto 2015-05-21 750 spin_lock(&priv->lock);
ae5c322303fff5 Kuninori Morimoto 2013-07-21 751
02299d9875bab5 Kuninori Morimoto 2015-05-21 752 /* ignore all cases if not working */
d5bbe7de563ccc Kuninori Morimoto 2015-06-15 753 if (!rsnd_io_is_working(io))
02299d9875bab5 Kuninori Morimoto 2015-05-21 754 goto rsnd_ssi_interrupt_out;
02299d9875bab5 Kuninori Morimoto 2015-05-21 755
6a25c8da00284f Kuninori Morimoto 2016-01-26 756 status = rsnd_ssi_status_get(mod);
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 757
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 758 /* PIO only */
d8d9b9730cd62c Kuninori Morimoto 2017-12-11 759 if (!is_dma && (status & DIRQ))
d8d9b9730cd62c Kuninori Morimoto 2017-12-11 760 elapsed = rsnd_ssi_pio_interrupt(mod, io);
ae5c322303fff5 Kuninori Morimoto 2013-07-21 761
12927a8f802642 Kuninori Morimoto 2015-06-15 762 /* DMA only */
2b62786951ca38 Kuninori Morimoto 2018-02-13 763 if (is_dma && (status & (UIRQ | OIRQ))) {
c0ea089dbad47a Kuninori Morimoto 2018-10-30 764 rsnd_dbg_irq_status(dev, "%s err status : 0x%08x\n",
c0ea089dbad47a Kuninori Morimoto 2018-10-30 765 rsnd_mod_name(mod), status);
2b62786951ca38 Kuninori Morimoto 2018-02-13 766
6a25c8da00284f Kuninori Morimoto 2016-01-26 767 stop = true;
2b62786951ca38 Kuninori Morimoto 2018-02-13 768 }
69e32a58bde674 Kuninori Morimoto 2015-10-26 769
391d452251464b Yongbo Zhang 2020-05-08 770 status = 0;
391d452251464b Yongbo Zhang 2020-05-08 771
391d452251464b Yongbo Zhang 2020-05-08 772 if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang 2020-05-08 773 switch (id) {
391d452251464b Yongbo Zhang 2020-05-08 774 case 0:
391d452251464b Yongbo Zhang 2020-05-08 775 case 1:
391d452251464b Yongbo Zhang 2020-05-08 776 case 2:
391d452251464b Yongbo Zhang 2020-05-08 777 case 3:
391d452251464b Yongbo Zhang 2020-05-08 778 case 4:
391d452251464b Yongbo Zhang 2020-05-08 779 for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang 2020-05-08 780 status = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang 2020-05-08 781 SSI_SYS_STATUS(i * 2));
391d452251464b Yongbo Zhang 2020-05-08 782 status &= 0xf << (id * 4);
391d452251464b Yongbo Zhang 2020-05-08 783
391d452251464b Yongbo Zhang 2020-05-08 784 if (status) {
391d452251464b Yongbo Zhang 2020-05-08 785 rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang 2020-05-08 786 "%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang 2020-05-08 787 rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang 2020-05-08 788 rsnd_mod_write(mod,
391d452251464b Yongbo Zhang 2020-05-08 789 SSI_SYS_STATUS(i * 2),
391d452251464b Yongbo Zhang 2020-05-08 790 0xf << (id * 4));
391d452251464b Yongbo Zhang 2020-05-08 791 stop = true;
391d452251464b Yongbo Zhang 2020-05-08 792 break;
391d452251464b Yongbo Zhang 2020-05-08 793 }
391d452251464b Yongbo Zhang 2020-05-08 794 }
391d452251464b Yongbo Zhang 2020-05-08 795 break;
391d452251464b Yongbo Zhang 2020-05-08 796 case 9:
391d452251464b Yongbo Zhang 2020-05-08 797 for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang 2020-05-08 798 status = rsnd_mod_write(mod,
391d452251464b Yongbo Zhang 2020-05-08 799 SSI_SYS_STATUS((i * 2) + 1));
391d452251464b Yongbo Zhang 2020-05-08 800 status &= 0xf << 4;
391d452251464b Yongbo Zhang 2020-05-08 801
391d452251464b Yongbo Zhang 2020-05-08 802 if (status) {
391d452251464b Yongbo Zhang 2020-05-08 803 rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang 2020-05-08 804 "%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang 2020-05-08 805 rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang 2020-05-08 806 rsnd_mod_write(mod,
391d452251464b Yongbo Zhang 2020-05-08 807 SSI_SYS_STATUS((i * 2) + 1),
391d452251464b Yongbo Zhang 2020-05-08 808 0xf << 4);
391d452251464b Yongbo Zhang 2020-05-08 809 stop = true;
391d452251464b Yongbo Zhang 2020-05-08 810 break;
391d452251464b Yongbo Zhang 2020-05-08 811 }
391d452251464b Yongbo Zhang 2020-05-08 812 }
391d452251464b Yongbo Zhang 2020-05-08 813 break;
391d452251464b Yongbo Zhang 2020-05-08 814 }
391d452251464b Yongbo Zhang 2020-05-08 815 }
391d452251464b Yongbo Zhang 2020-05-08 816
5342dff2326393 Kuninori Morimoto 2015-11-26 817 rsnd_ssi_status_clear(mod);
02299d9875bab5 Kuninori Morimoto 2015-05-21 818 rsnd_ssi_interrupt_out:
02299d9875bab5 Kuninori Morimoto 2015-05-21 819 spin_unlock(&priv->lock);
02299d9875bab5 Kuninori Morimoto 2015-05-21 820
75defee0f1b3fc Kuninori Morimoto 2015-06-15 821 if (elapsed)
75defee0f1b3fc Kuninori Morimoto 2015-06-15 822 rsnd_dai_period_elapsed(io);
6a25c8da00284f Kuninori Morimoto 2016-01-26 823
6a25c8da00284f Kuninori Morimoto 2016-01-26 824 if (stop)
6a25c8da00284f Kuninori Morimoto 2016-01-26 825 snd_pcm_stop_xrun(io->substream);
6a25c8da00284f Kuninori Morimoto 2016-01-26 826

:::::: The code at line 596 was first introduced by commit
:::::: 919567d914b3c134e60c01db72a03a0adc5f41b9 ASoC: rsnd: make sure SSI parent/child uses same number of sound channel.

:::::: TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
:::::: CC: Mark Brown <broonie@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62814 bytes --]