tree:
https://github.com/plbossart/sound pr/25
head: b4029a7d718a1281309cf2d46f2a52930d8f9ce4
commit: b4029a7d718a1281309cf2d46f2a52930d8f9ce4 [4/4] add support for es8326
config: csky-randconfig-r036-20220208
(
https://download.01.org/0day-ci/archive/20220208/202202081943.UtmI9RnY-lk...)
compiler: csky-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://github.com/plbossart/sound/commit/b4029a7d718a1281309cf2d46f2a529...
git remote add plbossart-sound
https://github.com/plbossart/sound
git fetch --no-tags plbossart-sound pr/25
git checkout b4029a7d718a1281309cf2d46f2a52930d8f9ce4
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir
ARCH=csky SHELL=/bin/bash sound/soc/codecs/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
> sound/soc/codecs/es8326.c:601:18: error: 'struct
snd_soc_dai_driver' has no member named 'symmetric_rates'; did you mean
'symmetric_rate'?
601 | .symmetric_rates = 1,
| ^~~~~~~~~~~~~~~
| symmetric_rate
> sound/soc/codecs/es8326.c:601:36: warning: initialization of
'const struct snd_soc_cdai_ops *' from 'int' makes pointer from integer
without a cast [-Wint-conversion]
601 | .symmetric_rates = 1,
| ^
sound/soc/codecs/es8326.c:601:36: note: (near initialization for
'es8326_dai.cops')
sound/soc/codecs/es8326.c: In function 'es8326_i2c_probe':
> sound/soc/codecs/es8326.c:748:17: warning: this 'if'
clause does not guard... [-Wmisleading-indentation]
748 | if
(!es8326->mclk)
| ^~
sound/soc/codecs/es8326.c:750:33: note: ...this statement, but the latter is
misleadingly indented as if it were guarded by the 'if'
750 | ret = clk_prepare_enable(es8326->mclk);
| ^~~
At top level:
sound/soc/codecs/es8326.c:30:33: warning: 'es8326_reg_defaults' defined but not
used [-Wunused-const-variable=]
30 | static const struct reg_default es8326_reg_defaults[] = {
| ^~~~~~~~~~~~~~~~~~~
vim +601 sound/soc/codecs/es8326.c
583
584 static struct snd_soc_dai_driver es8326_dai = {
585 .name = "ES8326 HiFi",
586 .playback = {
587 .stream_name = "Playback",
588 .channels_min = 1,
589 .channels_max = 2,
590 .rates = es8326_RATES,
591 .formats = es8326_FORMATS,
592 },
593 .capture = {
594 .stream_name = "Capture",
595 .channels_min = 1,
596 .channels_max = 2,
597 .rates = es8326_RATES,
598 .formats = es8326_FORMATS,
599 },
600 .ops = &es8326_ops,
601 .symmetric_rates = 1,
602 };
603
604 static int es8326_probe(struct snd_soc_component*codec)
605 {
606 struct es8326_priv *es8326 = snd_soc_component_get_drvdata(codec);
607 es8326->component = codec;
608
609 if (codec == NULL) {
610 dev_err(codec->dev, "Codec device not registered\n");
611 return -ENODEV;
612 }
613
614 snd_soc_component_write(codec, ES8326_CLK_CTL_01, ES8326_CLK_ON);
615 /* Two channel ADC */
616 snd_soc_component_write(codec, ES8326_PULLUP_CTL_F9, 0x02);
617 snd_soc_component_write(codec, ES8326_CLK_INV_02, 0x00);
618 snd_soc_component_write(codec, ES8326_CLK_DIV_CPC_0C, 0x1F);
619 snd_soc_component_write(codec, ES8326_CLK_VMIDS1_10, 0xC8);
620 snd_soc_component_write(codec, ES8326_CLK_VMIDS2_11, 0x88);
621 snd_soc_component_write(codec, ES8326_CLK_CAL_TIME_12, 0x20);
622 snd_soc_component_write(codec, ES8326_DAC_MUTE_14, 0x00);
623 snd_soc_component_write(codec, ES8326_ANA_LOWPOWER_19, 0xF0);
624 snd_soc_component_write(codec, ES8326_SYS_BIAS_1D, 0x08);
625 snd_soc_component_write(codec, ES8326_DAC2HPMIX_25, 0x22);
626 snd_soc_component_write(codec, ES8326_ADC_SCALE_29, 0x00);
627 snd_soc_component_write(codec, ES8326_ADC1_SRC_2A, es8326->mic1_src);
628 snd_soc_component_write(codec, ES8326_ADC2_SRC_2B, es8326->mic2_src);
629 snd_soc_component_write(codec, ES8326_HP_CAL_4A, 0x00);
630 snd_soc_component_write(codec, ES8326_DAC_DSM_4D, 0x08);
631 snd_soc_component_write(codec, ES8326_DAC_RAMPRATE_4E, 0x20);
632 snd_soc_component_write(codec, ES8326_DAC_VPPSCALE_4F, 0x15);
633 snd_soc_component_write(codec, ES8326_HPJACK_TIMER_56, 0x88);
634 snd_soc_component_write(codec, ES8326_HP_DET_57,
ES8326_HP_DET_SRC_PIN9|es8326->jack_pol);
635 snd_soc_component_write(codec, ES8326_INT_SOURCE_58, 0x08);
636 snd_soc_component_write(codec, ES8326_INTOUT_IO_59, 0x45);
637 snd_soc_component_write(codec, ES8326_RESET_00, ES8326_CSM_ON);
638 snd_soc_component_update_bits(codec, ES8326_PAGGAIN_23,
639 ES8326_MIC_SEL_MASK, ES8326_MIC1_SEL);
640
641 es8326_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
642
643 return 0;
644 }
645
646 static void es8326_remove(struct snd_soc_component*codec)
647 {
648 es8326_set_bias_level(codec, SND_SOC_BIAS_OFF);
649 }
650
651 static void es8326_enable_jack_detect(struct snd_soc_component *component,
652 struct snd_soc_jack *jack)
653 {
654 struct es8326_priv *es8326 = snd_soc_component_get_drvdata(component);
655
656 dev_dbg(component->dev,"Enter into %s\n", __func__);
657
658 mutex_lock(&es8326->lock);
659
660 es8326->jack = jack;
661
662 mutex_unlock(&es8326->lock);
663 /* Enable irq and sync initial jack state */
664 enable_irq(es8326->irq);
665 es8326_irq(es8326->irq, es8326);
666 }
667
668
669
670 static void es8326_disable_jack_detect(struct snd_soc_component *component)
671 {
672 struct es8326_priv *es8326 = snd_soc_component_get_drvdata(component);
673
674 dev_dbg(component->dev,"Enter into %s\n", __func__);
675 if (!es8326->jack)
676 return; /* Already disabled (or never enabled) */
677
678 disable_irq(es8326->irq);
679
680 mutex_lock(&es8326->lock);
681
682 if (es8326->jack->status & SND_JACK_MICROPHONE) {
683 snd_soc_jack_report(es8326->jack, 0, SND_JACK_BTN_0);
684 }
685
686 es8326->jack = NULL;
687
688 mutex_unlock(&es8326->lock);
689 }
690
691 static int es8326_set_jack(struct snd_soc_component *component,
692 struct snd_soc_jack *jack, void *data)
693 {
694 if (jack)
695 es8326_enable_jack_detect(component, jack);
696 else
697 es8326_disable_jack_detect(component);
698
699 return 0;
700 }
701 static struct snd_soc_component_driver soc_component_dev_es8326 = {
702 .probe = es8326_probe,
703 .remove = es8326_remove,
704 .set_bias_level = es8326_set_bias_level,
705 .set_jack = es8326_set_jack,
706
707 .dapm_widgets = es8326_dapm_widgets,
708 .num_dapm_widgets = ARRAY_SIZE(es8326_dapm_widgets),
709 .dapm_routes = es8326_dapm_routes,
710 .num_dapm_routes = ARRAY_SIZE(es8326_dapm_routes),
711 .controls = es8326_snd_controls,
712 .num_controls = ARRAY_SIZE(es8326_snd_controls),
713 };
714
715 static int es8326_i2c_probe(struct i2c_client *i2c,
716 const struct i2c_device_id *id)
717 {
718 struct es8326_priv *es8326;
719 u8 reg;
720 int ret = -1;
721 struct i2c_adapter *adapter = to_i2c_adapter(i2c->dev.parent);
722
723 if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {
724 dev_warn(&adapter->dev,
725 "I2C-Adapter doesn't support I2C_FUNC_I2C\n");
726 return -EIO;
727 }
728
729 es8326 = devm_kzalloc(&i2c->dev, sizeof(struct es8326_priv), GFP_KERNEL);
730 if (es8326 == NULL)
731 return -ENOMEM;
732
733 i2c_set_clientdata(i2c, es8326);
734 es8326->i2c = i2c;
735 mutex_init(&es8326->lock);
736 es8326->regmap = devm_regmap_init_i2c(i2c, &es8326_regmap_config);
737 if (IS_ERR(es8326->regmap)) {
738 ret = PTR_ERR(es8326->regmap);
739 dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret);
740 return ret;
741 }
742
743 es8326->mclk = devm_clk_get_optional(&i2c->dev, "mclk");
744 if (IS_ERR(es8326->mclk)) {
745 dev_err(&i2c->dev,"%s,unable to get mclk\n", __func__);
746 return PTR_ERR(es8326->mclk);
747 }
748 if (!es8326->mclk)
749 dev_err(&i2c->dev,"%s, assuming static mclk\n", __func__);
750 ret = clk_prepare_enable(es8326->mclk);
751 if (ret) {
752 dev_err(&i2c->dev,"%s, unable to enable mclk\n", __func__);
753 return ret;
754 }
755
756 reg = 0x00;
757 ret = i2c_master_recv(i2c, ®, 1);
758 if (ret < 0) {
759 dev_err(&i2c->dev, "i2c recv Failed\n");
760 return ret;
761 }
762 es8326->irq = i2c->irq;
763 ret = devm_request_threaded_irq(&i2c->dev, es8326->irq, NULL,
es8326_irq,
764 IRQF_TRIGGER_RISING | IRQF_ONESHOT,
765 "es8326", es8326);
766 if(ret == 0)
767 {
768 disable_irq(es8326->irq);
769 }
770 else{
771 dev_warn(&i2c->dev, "Getting irq failed.");
772 }
773
774 ret = of_property_read_u8(i2c->dev.of_node, "amic1-src",
&es8326->amic1_src);
775 if (ret != 0) {
776 dev_dbg(&i2c->dev, "amic1-src return %d", ret);
777 es8326->amic1_src = ES8326_MIC1_SEL;
778 }
779
780 ret = of_property_read_u8(i2c->dev.of_node, "amic2-src",
&es8326->amic2_src);
781 if (ret != 0) {
782 dev_dbg(&i2c->dev, "amic2-src return %d", ret);
783 es8326->amic2_src = ES8326_MIC1_SEL;
784 }
785
786 ret = of_property_read_u8(i2c->dev.of_node, "mic1-src",
&es8326->mic1_src);
787 if (ret != 0) {
788 dev_dbg(&i2c->dev, "mic1-src return %d", ret);
789 es8326->mic1_src = ES8326_ADC_AMIC;
790 }
791 dev_dbg(&i2c->dev, "mic1-src %x",es8326->mic1_src);
792
793 ret = of_property_read_u8(i2c->dev.of_node, "mic2-src",
&es8326->mic2_src);
794 if (ret != 0) {
795 dev_dbg(&i2c->dev, "mic2-src return %d", ret);
796 es8326->mic2_src = ES8326_ADC_DMIC;
797 }
798 dev_dbg(&i2c->dev, "mic2-src %x",es8326->mic2_src);
799
800 ret = of_property_read_u8(i2c->dev.of_node, "jack-pol",
&es8326->jack_pol);
801 if (ret != 0) {
802 dev_dbg(&i2c->dev, "jack-pol return %d", ret);
803 es8326->jack_pol =
ES8326_HP_DET_JACK_POL|ES8326_HP_DET_BUTTON_POL|ES8326_HP_TYPE_OMTP;
804 }
805 dev_dbg(&i2c->dev, "jack-pol %x",es8326->jack_pol);
806
807 ret = of_property_read_u32(i2c->dev.of_node, "mclk-rate",
&es8326->mclk_rate);
808 if (ret != 0) {
809 dev_dbg(&i2c->dev, "mclk-rate return %d", ret);
810 es8326->mclk_rate = 19200000;
811 }
812 dev_dbg(&i2c->dev, "mclk-rate %u",es8326->mclk_rate);
813
814 return devm_snd_soc_register_component(&i2c->dev,
815 &soc_component_dev_es8326,
816 &es8326_dai, 1);
817 }
818
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org