diff --git a/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml b/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml index 08c618e7e4281d..2b27d6c8f58f14 100644 --- a/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml @@ -126,13 +126,16 @@ patternProperties: reg: contains: # MI2S DAI ID range PRIMARY_MI2S_RX - QUATERNARY_MI2S_TX and - # QUINARY_MI2S_RX - QUINARY_MI2S_TX + # QUINARY_MI2S_RX - QUINARY_MI2S_TX and + # LPI_MI2S_RX_0 - SENARY_MI2S_TX items: oneOf: - minimum: 16 maximum: 23 - minimum: 127 maximum: 128 + - minimum: 137 + maximum: 148 then: required: - qcom,sd-lines diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qcom/kodiak.dtsi index eb31bf364ae05c..d53338cc2bb4a6 100644 --- a/arch/arm64/boot/dts/qcom/kodiak.dtsi +++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi @@ -4496,6 +4496,35 @@ #sound-dai-cells = <0>; }; }; + + q6mvm: apr-service@9 { + compatible = "qcom,q6mvm"; + reg = ; + qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd"; + status = "disabled"; + + q6voicedai: dais { + compatible = "qcom,q6voice-dais"; + #address-cells = <1>; + #size-cells = <0>; + #sound-dai-cells = <1>; + }; + }; + + q6cvs: apr-service@a { + compatible = "qcom,q6cvs"; + reg = ; + qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd"; + status = "disabled"; + }; + + q6cvp: apr-service@b { + compatible = "qcom,q6cvp"; + reg = ; + qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd"; + status = "disabled"; + }; + }; fastrpc { diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts index 40ed56d209a441..e9f840c3f40ba4 100644 --- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts +++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts @@ -17,6 +17,8 @@ #include #include #include +#include + #include "kodiak.dtsi" #include "pm7250b.dtsi" #include "pm7325.dtsi" @@ -1298,7 +1300,38 @@ status = "okay"; }; +&q6cvp { + status = "okay"; +}; + +&q6cvs { + status = "okay"; +}; + +&q6mvm { + status = "okay"; +}; + + +&q6voicedai { + dai@1 { + reg = ; + }; +}; + &q6afedai { + dai@104 { + reg = ; + }; + + dai@113 { + reg = ; + }; + + dai@120 { + reg = ; + }; + dai@127 { reg = ; qcom,sd-lines = <0>; @@ -1483,6 +1516,27 @@ sound-dai = <&q6routing>; }; }; + + wcd-playback-dai-link { + link-name = "WCD Playback"; + codec { + sound-dai = <&wcd9385 0>, <&swr0 0>, <&lpass_rx_macro 0>; + }; + cpu { + sound-dai = <&q6afedai RX_CODEC_DMA_RX_0>; + }; + platform { + sound-dai = <&q6routing>; + }; + }; + + voicemmode1-dai-link { + link-name = "VoiceMMode1"; + cpu { + sound-dai = <&q6voicedai VOICEMMODE1>; + }; + }; + }; &spi13 { diff --git a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h index 6d1ce7f5da51c6..45850f2d434258 100644 --- a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h +++ b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h @@ -140,6 +140,18 @@ #define DISPLAY_PORT_RX_6 134 #define DISPLAY_PORT_RX_7 135 #define USB_RX 136 +#define LPI_MI2S_RX_0 137 +#define LPI_MI2S_TX_0 138 +#define LPI_MI2S_RX_1 139 +#define LPI_MI2S_TX_1 140 +#define LPI_MI2S_RX_2 141 +#define LPI_MI2S_TX_2 142 +#define LPI_MI2S_RX_3 143 +#define LPI_MI2S_TX_3 144 +#define LPI_MI2S_RX_4 145 +#define LPI_MI2S_TX_4 146 +#define SENARY_MI2S_RX 147 +#define SENARY_MI2S_TX 148 #define LPASS_CLK_ID_PRI_MI2S_IBIT 1 #define LPASS_CLK_ID_PRI_MI2S_EBIT 2 diff --git a/include/dt-bindings/sound/qcom,q6voice.h b/include/dt-bindings/sound/qcom,q6voice.h new file mode 100644 index 00000000000000..825bf7d47fe316 --- /dev/null +++ b/include/dt-bindings/sound/qcom,q6voice.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __DT_BINDINGS_Q6_VOICE_H__ +#define __DT_BINDINGS_Q6_VOICE_H__ + +#define CS_VOICE 0 +#define VOICEMMODE1 1 + +#endif /* __DT_BINDINGS_Q6_VOICE_H__ */ diff --git a/sound/hda/codecs/side-codecs/cs35l41_hda_i2c.c b/sound/hda/codecs/side-codecs/cs35l41_hda_i2c.c index e77495413c214d..96d8cc6c232428 100644 --- a/sound/hda/codecs/side-codecs/cs35l41_hda_i2c.c +++ b/sound/hda/codecs/side-codecs/cs35l41_hda_i2c.c @@ -39,8 +39,8 @@ static void cs35l41_hda_i2c_remove(struct i2c_client *clt) } static const struct i2c_device_id cs35l41_hda_i2c_id[] = { - { "cs35l41-hda" }, - {} + { .name = "cs35l41-hda" }, + { } }; static const struct acpi_device_id cs35l41_acpi_hda_match[] = { diff --git a/sound/hda/codecs/side-codecs/cs35l56_hda_i2c.c b/sound/hda/codecs/side-codecs/cs35l56_hda_i2c.c index 1072f17385ac52..e2f51612a73d27 100644 --- a/sound/hda/codecs/side-codecs/cs35l56_hda_i2c.c +++ b/sound/hda/codecs/side-codecs/cs35l56_hda_i2c.c @@ -51,10 +51,10 @@ static void cs35l56_hda_i2c_remove(struct i2c_client *clt) } static const struct i2c_device_id cs35l56_hda_i2c_id[] = { - { "cs35l54-hda", 0x3554 }, - { "cs35l56-hda", 0x3556 }, - { "cs35l57-hda", 0x3557 }, - {} + { .name = "cs35l54-hda", .driver_data = 0x3554 }, + { .name = "cs35l56-hda", .driver_data = 0x3556 }, + { .name = "cs35l57-hda", .driver_data = 0x3557 }, + { } }; static const struct acpi_device_id cs35l56_acpi_hda_match[] = { diff --git a/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c b/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c index 67240ce184e1a7..d59110402c7a74 100644 --- a/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c +++ b/sound/hda/codecs/side-codecs/tas2781_hda_i2c.c @@ -791,8 +791,8 @@ static const struct dev_pm_ops tas2781_hda_pm_ops = { }; static const struct i2c_device_id tas2781_hda_i2c_id[] = { - { "tas2781-hda" }, - {} + { .name = "tas2781-hda" }, + { } }; static const struct acpi_device_id tas2781_acpi_hda_match[] = { diff --git a/sound/soc/codecs/ad193x-i2c.c b/sound/soc/codecs/ad193x-i2c.c index 6aa168e01fbbde..d4d6560bdb80ba 100644 --- a/sound/soc/codecs/ad193x-i2c.c +++ b/sound/soc/codecs/ad193x-i2c.c @@ -14,8 +14,8 @@ #include "ad193x.h" static const struct i2c_device_id ad193x_id[] = { - { "ad1936", AD193X }, - { "ad1937", AD193X }, + { .name = "ad1936", .driver_data = AD193X }, + { .name = "ad1937", .driver_data = AD193X }, { } }; MODULE_DEVICE_TABLE(i2c, ad193x_id); diff --git a/sound/soc/codecs/adau1372-i2c.c b/sound/soc/codecs/adau1372-i2c.c index 73f83be38f7490..4217b7fc349c77 100644 --- a/sound/soc/codecs/adau1372-i2c.c +++ b/sound/soc/codecs/adau1372-i2c.c @@ -21,7 +21,7 @@ static int adau1372_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id adau1372_i2c_ids[] = { - { "adau1372" }, + { .name = "adau1372" }, { } }; MODULE_DEVICE_TABLE(i2c, adau1372_i2c_ids); diff --git a/sound/soc/codecs/adau1373.c b/sound/soc/codecs/adau1373.c index 16b9b265834179..5dd961b233ce95 100644 --- a/sound/soc/codecs/adau1373.c +++ b/sound/soc/codecs/adau1373.c @@ -1599,7 +1599,7 @@ static int adau1373_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id adau1373_i2c_id[] = { - { "adau1373" }, + { .name = "adau1373" }, { } }; MODULE_DEVICE_TABLE(i2c, adau1373_i2c_id); diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c index 6876462d8bdbb4..329ab01b62c002 100644 --- a/sound/soc/codecs/adau1701.c +++ b/sound/soc/codecs/adau1701.c @@ -860,10 +860,10 @@ static int adau1701_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id adau1701_i2c_id[] = { - { "adau1401" }, - { "adau1401a" }, - { "adau1701" }, - { "adau1702" }, + { .name = "adau1401" }, + { .name = "adau1401a" }, + { .name = "adau1701" }, + { .name = "adau1702" }, { } }; MODULE_DEVICE_TABLE(i2c, adau1701_i2c_id); diff --git a/sound/soc/codecs/adau1761-i2c.c b/sound/soc/codecs/adau1761-i2c.c index eba7e4f42c78ae..a329e5bddb99e2 100644 --- a/sound/soc/codecs/adau1761-i2c.c +++ b/sound/soc/codecs/adau1761-i2c.c @@ -33,10 +33,10 @@ static void adau1761_i2c_remove(struct i2c_client *client) } static const struct i2c_device_id adau1761_i2c_ids[] = { - { "adau1361", ADAU1361 }, - { "adau1461", ADAU1761 }, - { "adau1761", ADAU1761 }, - { "adau1961", ADAU1361 }, + { .name = "adau1361", .driver_data = ADAU1361 }, + { .name = "adau1461", .driver_data = ADAU1761 }, + { .name = "adau1761", .driver_data = ADAU1761 }, + { .name = "adau1961", .driver_data = ADAU1361 }, { } }; MODULE_DEVICE_TABLE(i2c, adau1761_i2c_ids); diff --git a/sound/soc/codecs/adau1781-i2c.c b/sound/soc/codecs/adau1781-i2c.c index cb67fde8d9a843..0e7954148af7cf 100644 --- a/sound/soc/codecs/adau1781-i2c.c +++ b/sound/soc/codecs/adau1781-i2c.c @@ -33,8 +33,8 @@ static void adau1781_i2c_remove(struct i2c_client *client) } static const struct i2c_device_id adau1781_i2c_ids[] = { - { "adau1381", ADAU1381 }, - { "adau1781", ADAU1781 }, + { .name = "adau1381", .driver_data = ADAU1381 }, + { .name = "adau1781", .driver_data = ADAU1781 }, { } }; MODULE_DEVICE_TABLE(i2c, adau1781_i2c_ids); diff --git a/sound/soc/codecs/adau1977-i2c.c b/sound/soc/codecs/adau1977-i2c.c index 441c8079246a4c..fc7ed5c1dd74b3 100644 --- a/sound/soc/codecs/adau1977-i2c.c +++ b/sound/soc/codecs/adau1977-i2c.c @@ -28,9 +28,9 @@ static int adau1977_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id adau1977_i2c_ids[] = { - { "adau1977", ADAU1977 }, - { "adau1978", ADAU1978 }, - { "adau1979", ADAU1978 }, + { .name = "adau1977", .driver_data = ADAU1977 }, + { .name = "adau1978", .driver_data = ADAU1978 }, + { .name = "adau1979", .driver_data = ADAU1978 }, { } }; MODULE_DEVICE_TABLE(i2c, adau1977_i2c_ids); diff --git a/sound/soc/codecs/adau7118-i2c.c b/sound/soc/codecs/adau7118-i2c.c index f9dc8f4ef9a4e2..7cccb4c6cff77d 100644 --- a/sound/soc/codecs/adau7118-i2c.c +++ b/sound/soc/codecs/adau7118-i2c.c @@ -68,8 +68,8 @@ static const struct of_device_id adau7118_of_match[] = { MODULE_DEVICE_TABLE(of, adau7118_of_match); static const struct i2c_device_id adau7118_id[] = { - {"adau7118"}, - {} + { .name = "adau7118" }, + { } }; MODULE_DEVICE_TABLE(i2c, adau7118_id); diff --git a/sound/soc/codecs/adav803.c b/sound/soc/codecs/adav803.c index 8b96c41f0354c1..9e5f8e866acb98 100644 --- a/sound/soc/codecs/adav803.c +++ b/sound/soc/codecs/adav803.c @@ -14,7 +14,7 @@ #include "adav80x.h" static const struct i2c_device_id adav803_id[] = { - { "adav803" }, + { .name = "adav803" }, { } }; MODULE_DEVICE_TABLE(i2c, adav803_id); diff --git a/sound/soc/codecs/ak4118.c b/sound/soc/codecs/ak4118.c index 23e868e4e3fba2..03dadba0b038fb 100644 --- a/sound/soc/codecs/ak4118.c +++ b/sound/soc/codecs/ak4118.c @@ -395,8 +395,8 @@ MODULE_DEVICE_TABLE(of, ak4118_of_match); #endif static const struct i2c_device_id ak4118_id_table[] = { - { "ak4118" }, - {} + { .name = "ak4118" }, + { } }; MODULE_DEVICE_TABLE(i2c, ak4118_id_table); diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c index aadc46a472806a..37555674cd157e 100644 --- a/sound/soc/codecs/ak4535.c +++ b/sound/soc/codecs/ak4535.c @@ -430,7 +430,7 @@ static int ak4535_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id ak4535_i2c_id[] = { - { "ak4535" }, + { .name = "ak4535" }, { } }; MODULE_DEVICE_TABLE(i2c, ak4535_i2c_id); diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c index de9e4318555596..3b198b9b460516 100644 --- a/sound/soc/codecs/ak4613.c +++ b/sound/soc/codecs/ak4613.c @@ -303,7 +303,7 @@ static const struct of_device_id ak4613_of_match[] = { MODULE_DEVICE_TABLE(of, ak4613_of_match); static const struct i2c_device_id ak4613_i2c_id[] = { - { "ak4613", (kernel_ulong_t)&ak4613_regmap_cfg }, + { .name = "ak4613", .driver_data = (kernel_ulong_t)&ak4613_regmap_cfg }, { } }; MODULE_DEVICE_TABLE(i2c, ak4613_i2c_id); diff --git a/sound/soc/codecs/ak4619.c b/sound/soc/codecs/ak4619.c index daf6e15b707732..755c002f0f1599 100644 --- a/sound/soc/codecs/ak4619.c +++ b/sound/soc/codecs/ak4619.c @@ -831,7 +831,7 @@ static const struct of_device_id ak4619_of_match[] = { MODULE_DEVICE_TABLE(of, ak4619_of_match); static const struct i2c_device_id ak4619_i2c_id[] = { - { "ak4619", (kernel_ulong_t)&ak4619_regmap_cfg }, + { .name = "ak4619", .driver_data = (kernel_ulong_t)&ak4619_regmap_cfg }, { } }; MODULE_DEVICE_TABLE(i2c, ak4619_i2c_id); diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index fe035d2fc9131b..08ec2035b2705e 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c @@ -672,10 +672,10 @@ static const struct of_device_id ak4642_of_match[] = { MODULE_DEVICE_TABLE(of, ak4642_of_match); static const struct i2c_device_id ak4642_i2c_id[] = { - { "ak4642", (kernel_ulong_t)&ak4642_drvdata }, - { "ak4643", (kernel_ulong_t)&ak4643_drvdata }, - { "ak4648", (kernel_ulong_t)&ak4648_drvdata }, - {} + { .name = "ak4642", .driver_data = (kernel_ulong_t)&ak4642_drvdata }, + { .name = "ak4643", .driver_data = (kernel_ulong_t)&ak4643_drvdata }, + { .name = "ak4648", .driver_data = (kernel_ulong_t)&ak4648_drvdata }, + { } }; MODULE_DEVICE_TABLE(i2c, ak4642_i2c_id); diff --git a/sound/soc/codecs/ak4671.c b/sound/soc/codecs/ak4671.c index d545aa2e0a39c5..aac54e9d54ee7c 100644 --- a/sound/soc/codecs/ak4671.c +++ b/sound/soc/codecs/ak4671.c @@ -646,7 +646,7 @@ static int ak4671_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id ak4671_i2c_id[] = { - { "ak4671" }, + { .name = "ak4671" }, { } }; MODULE_DEVICE_TABLE(i2c, ak4671_i2c_id); diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c index ec229b315f9fd8..f5a666c4936150 100644 --- a/sound/soc/codecs/alc5623.c +++ b/sound/soc/codecs/alc5623.c @@ -963,10 +963,10 @@ static const struct regmap_config alc5623_regmap = { }; static const struct i2c_device_id alc5623_i2c_table[] = { - {"alc5621", 0x21}, - {"alc5622", 0x22}, - {"alc5623", 0x23}, - {} + { .name = "alc5621", .driver_data = 0x21 }, + { .name = "alc5622", .driver_data = 0x22 }, + { .name = "alc5623", .driver_data = 0x23 }, + { } }; MODULE_DEVICE_TABLE(i2c, alc5623_i2c_table); diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c index 72f4622204fffd..2fd3dd7ef8b340 100644 --- a/sound/soc/codecs/alc5632.c +++ b/sound/soc/codecs/alc5632.c @@ -1092,8 +1092,8 @@ static const struct regmap_config alc5632_regmap = { }; static const struct i2c_device_id alc5632_i2c_table[] = { - {"alc5632", 0x5c}, - {} + { .name = "alc5632", .driver_data = 0x5c }, + { } }; MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table); diff --git a/sound/soc/codecs/aw87390.c b/sound/soc/codecs/aw87390.c index 613daccca3af8b..020213e0ca4b50 100644 --- a/sound/soc/codecs/aw87390.c +++ b/sound/soc/codecs/aw87390.c @@ -544,8 +544,7 @@ static int aw87390_i2c_probe(struct i2c_client *i2c) const struct snd_soc_component_driver *priv; int ret; - ret = i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C); - if (!ret) + if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) return dev_err_probe(&i2c->dev, -ENXIO, "check_functionality failed\n"); aw87390 = devm_kzalloc(&i2c->dev, sizeof(*aw87390), GFP_KERNEL); @@ -600,8 +599,8 @@ static const struct of_device_id aw87390_of_match[] = { MODULE_DEVICE_TABLE(of, aw87390_of_match); static const struct i2c_device_id aw87390_i2c_id[] = { - { AW87390_I2C_NAME }, - { AW87391_I2C_NAME }, + { .name = AW87390_I2C_NAME }, + { .name = AW87391_I2C_NAME }, { } }; MODULE_DEVICE_TABLE(i2c, aw87390_i2c_id); diff --git a/sound/soc/codecs/aw88081.c b/sound/soc/codecs/aw88081.c index fbd1fd12381a39..a5ba177a48df7e 100644 --- a/sound/soc/codecs/aw88081.c +++ b/sound/soc/codecs/aw88081.c @@ -1240,8 +1240,8 @@ static const struct snd_soc_component_driver soc_codec_dev_aw88081 = { }; static const struct i2c_device_id aw88081_i2c_id[] = { - { AW88081_I2C_NAME, AW88081}, - { AW88083_I2C_NAME, AW88083}, + { .name = AW88081_I2C_NAME, .driver_data = AW88081 }, + { .name = AW88083_I2C_NAME, .driver_data = AW88083 }, { } }; MODULE_DEVICE_TABLE(i2c, aw88081_i2c_id); @@ -1253,8 +1253,7 @@ static int aw88081_i2c_probe(struct i2c_client *i2c) struct aw88081 *aw88081; int ret; - ret = i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C); - if (!ret) + if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) return dev_err_probe(&i2c->dev, -ENXIO, "check_functionality failed"); aw88081 = devm_kzalloc(&i2c->dev, sizeof(*aw88081), GFP_KERNEL); diff --git a/sound/soc/codecs/aw88166.c b/sound/soc/codecs/aw88166.c index daee4de9e3b01f..511277553c40e6 100644 --- a/sound/soc/codecs/aw88166.c +++ b/sound/soc/codecs/aw88166.c @@ -1797,7 +1797,7 @@ static int aw88166_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id aw88166_i2c_id[] = { - { AW88166_I2C_NAME }, + { .name = AW88166_I2C_NAME }, { } }; MODULE_DEVICE_TABLE(i2c, aw88166_i2c_id); diff --git a/sound/soc/codecs/aw88261.c b/sound/soc/codecs/aw88261.c index 5e3f040411c897..d059820282f491 100644 --- a/sound/soc/codecs/aw88261.c +++ b/sound/soc/codecs/aw88261.c @@ -1290,8 +1290,7 @@ static int aw88261_i2c_probe(struct i2c_client *i2c) struct aw88261 *aw88261; int ret; - ret = i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C); - if (!ret) + if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) return dev_err_probe(&i2c->dev, -ENXIO, "check_functionality failed"); aw88261 = devm_kzalloc(&i2c->dev, sizeof(*aw88261), GFP_KERNEL); @@ -1334,7 +1333,7 @@ static int aw88261_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id aw88261_i2c_id[] = { - { "aw88261" }, + { .name = "aw88261" }, { } }; MODULE_DEVICE_TABLE(i2c, aw88261_i2c_id); diff --git a/sound/soc/codecs/aw88395/aw88395.c b/sound/soc/codecs/aw88395/aw88395.c index 3602b5b9f7d77b..74708a47209ec8 100644 --- a/sound/soc/codecs/aw88395/aw88395.c +++ b/sound/soc/codecs/aw88395/aw88395.c @@ -558,7 +558,7 @@ static int aw88395_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id aw88395_i2c_id[] = { - { AW88395_I2C_NAME }, + { .name = AW88395_I2C_NAME }, { } }; MODULE_DEVICE_TABLE(i2c, aw88395_i2c_id); diff --git a/sound/soc/codecs/aw88399.c b/sound/soc/codecs/aw88399.c index b588c27909b503..b2ec3503f7e239 100644 --- a/sound/soc/codecs/aw88399.c +++ b/sound/soc/codecs/aw88399.c @@ -2146,7 +2146,7 @@ static int aw88399_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id aw88399_i2c_id[] = { - { AW88399_I2C_NAME }, + { .name = AW88399_I2C_NAME }, { } }; MODULE_DEVICE_TABLE(i2c, aw88399_i2c_id); diff --git a/sound/soc/codecs/cs35l32.c b/sound/soc/codecs/cs35l32.c index 0bb4bdb3deecb6..c835088de578a7 100644 --- a/sound/soc/codecs/cs35l32.c +++ b/sound/soc/codecs/cs35l32.c @@ -555,8 +555,8 @@ MODULE_DEVICE_TABLE(of, cs35l32_of_match); static const struct i2c_device_id cs35l32_id[] = { - {"cs35l32"}, - {} + { .name = "cs35l32" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs35l32_id); diff --git a/sound/soc/codecs/cs35l33.c b/sound/soc/codecs/cs35l33.c index 98b4d371d93129..f49edb9ea1f2ce 100644 --- a/sound/soc/codecs/cs35l33.c +++ b/sound/soc/codecs/cs35l33.c @@ -1262,8 +1262,8 @@ static const struct of_device_id cs35l33_of_match[] = { MODULE_DEVICE_TABLE(of, cs35l33_of_match); static const struct i2c_device_id cs35l33_id[] = { - {"cs35l33"}, - {} + { .name = "cs35l33" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs35l33_id); diff --git a/sound/soc/codecs/cs35l34.c b/sound/soc/codecs/cs35l34.c index a5a8075598ffbc..e80984b221593a 100644 --- a/sound/soc/codecs/cs35l34.c +++ b/sound/soc/codecs/cs35l34.c @@ -1175,8 +1175,8 @@ static const struct of_device_id cs35l34_of_match[] = { MODULE_DEVICE_TABLE(of, cs35l34_of_match); static const struct i2c_device_id cs35l34_id[] = { - {"cs35l34"}, - {} + { .name = "cs35l34" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs35l34_id); diff --git a/sound/soc/codecs/cs35l35.c b/sound/soc/codecs/cs35l35.c index 7a01b1d9fc9d70..b2439ec3c19fba 100644 --- a/sound/soc/codecs/cs35l35.c +++ b/sound/soc/codecs/cs35l35.c @@ -1639,8 +1639,8 @@ static const struct of_device_id cs35l35_of_match[] = { MODULE_DEVICE_TABLE(of, cs35l35_of_match); static const struct i2c_device_id cs35l35_id[] = { - {"cs35l35"}, - {} + { .name = "cs35l35" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs35l35_id); diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c index 93818d7ec1a775..89645327945f18 100644 --- a/sound/soc/codecs/cs35l36.c +++ b/sound/soc/codecs/cs35l36.c @@ -1918,8 +1918,8 @@ static const struct of_device_id cs35l36_of_match[] = { MODULE_DEVICE_TABLE(of, cs35l36_of_match); static const struct i2c_device_id cs35l36_id[] = { - {"cs35l36"}, - {} + { .name = "cs35l36" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs35l36_id); diff --git a/sound/soc/codecs/cs35l41-i2c.c b/sound/soc/codecs/cs35l41-i2c.c index 34097996b784fb..23f59f3025bdca 100644 --- a/sound/soc/codecs/cs35l41-i2c.c +++ b/sound/soc/codecs/cs35l41-i2c.c @@ -20,11 +20,11 @@ #include "cs35l41.h" static const struct i2c_device_id cs35l41_id_i2c[] = { - { "cs35l40" }, - { "cs35l41" }, - { "cs35l51" }, - { "cs35l53" }, - {} + { .name = "cs35l40" }, + { .name = "cs35l41" }, + { .name = "cs35l51" }, + { .name = "cs35l53" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs35l41_id_i2c); diff --git a/sound/soc/codecs/cs35l45-i2c.c b/sound/soc/codecs/cs35l45-i2c.c index a09aa3b92ae157..3eba61e107a558 100644 --- a/sound/soc/codecs/cs35l45-i2c.c +++ b/sound/soc/codecs/cs35l45-i2c.c @@ -53,8 +53,8 @@ static const struct of_device_id cs35l45_of_match[] = { MODULE_DEVICE_TABLE(of, cs35l45_of_match); static const struct i2c_device_id cs35l45_id_i2c[] = { - { "cs35l45" }, - {} + { .name = "cs35l45" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs35l45_id_i2c); diff --git a/sound/soc/codecs/cs35l56-i2c.c b/sound/soc/codecs/cs35l56-i2c.c index 0492ddc4102d80..0f64ab628b03bd 100644 --- a/sound/soc/codecs/cs35l56-i2c.c +++ b/sound/soc/codecs/cs35l56-i2c.c @@ -72,9 +72,9 @@ static void cs35l56_i2c_remove(struct i2c_client *client) } static const struct i2c_device_id cs35l56_id_i2c[] = { - { "cs35l56", 0x3556 }, - { "cs35l63", 0x3563 }, - {} + { .name = "cs35l56", .driver_data = 0x3556 }, + { .name = "cs35l63", .driver_data = 0x3563 }, + { } }; MODULE_DEVICE_TABLE(i2c, cs35l56_id_i2c); diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c index 3f759c13d6d12f..286d5ca2985411 100644 --- a/sound/soc/codecs/cs4265.c +++ b/sound/soc/codecs/cs4265.c @@ -638,7 +638,7 @@ static const struct of_device_id cs4265_of_match[] = { MODULE_DEVICE_TABLE(of, cs4265_of_match); static const struct i2c_device_id cs4265_id[] = { - { "cs4265" }, + { .name = "cs4265" }, { } }; MODULE_DEVICE_TABLE(i2c, cs4265_id); diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c index 3139f03cd42b6f..203097b56fe064 100644 --- a/sound/soc/codecs/cs4270.c +++ b/sound/soc/codecs/cs4270.c @@ -734,8 +734,8 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client) * cs4270_id - I2C device IDs supported by this driver */ static const struct i2c_device_id cs4270_id[] = { - {"cs4270"}, - {} + { .name = "cs4270" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs4270_id); diff --git a/sound/soc/codecs/cs4271-i2c.c b/sound/soc/codecs/cs4271-i2c.c index 1d210b96917386..869a5317f67709 100644 --- a/sound/soc/codecs/cs4271-i2c.c +++ b/sound/soc/codecs/cs4271-i2c.c @@ -23,7 +23,7 @@ static int cs4271_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id cs4271_i2c_id[] = { - { "cs4271" }, + { .name = "cs4271" }, { } }; MODULE_DEVICE_TABLE(i2c, cs4271_i2c_id); diff --git a/sound/soc/codecs/cs42l42-i2c.c b/sound/soc/codecs/cs42l42-i2c.c index 98b6718ccabff9..c0942f28723be7 100644 --- a/sound/soc/codecs/cs42l42-i2c.c +++ b/sound/soc/codecs/cs42l42-i2c.c @@ -78,8 +78,8 @@ static const struct acpi_device_id __maybe_unused cs42l42_acpi_match[] = { MODULE_DEVICE_TABLE(acpi, cs42l42_acpi_match); static const struct i2c_device_id cs42l42_id[] = { - {"cs42l42"}, - {} + { .name = "cs42l42" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs42l42_id); diff --git a/sound/soc/codecs/cs42l51-i2c.c b/sound/soc/codecs/cs42l51-i2c.c index ba7e237619f226..a20a1030c498d7 100644 --- a/sound/soc/codecs/cs42l51-i2c.c +++ b/sound/soc/codecs/cs42l51-i2c.c @@ -14,7 +14,7 @@ #include "cs42l51.h" static const struct i2c_device_id cs42l51_i2c_id[] = { - { "cs42l51" }, + { .name = "cs42l51" }, { } }; MODULE_DEVICE_TABLE(i2c, cs42l51_i2c_id); diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index 662dc1a4835bdb..9d6bcfbbf0b201 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c @@ -1226,7 +1226,7 @@ MODULE_DEVICE_TABLE(of, cs42l52_of_match); static const struct i2c_device_id cs42l52_id[] = { - { "cs42l52" }, + { .name = "cs42l52" }, { } }; MODULE_DEVICE_TABLE(i2c, cs42l52_id); diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c index aabb74f1f43c24..4d9a22a1029c6b 100644 --- a/sound/soc/codecs/cs42l56.c +++ b/sound/soc/codecs/cs42l56.c @@ -1353,7 +1353,7 @@ MODULE_DEVICE_TABLE(of, cs42l56_of_match); static const struct i2c_device_id cs42l56_id[] = { - { "cs42l56" }, + { .name = "cs42l56" }, { } }; MODULE_DEVICE_TABLE(i2c, cs42l56_id); diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c index bda8442c1d661d..6ddc6549492af2 100644 --- a/sound/soc/codecs/cs42l73.c +++ b/sound/soc/codecs/cs42l73.c @@ -1369,8 +1369,8 @@ static const struct of_device_id cs42l73_of_match[] = { MODULE_DEVICE_TABLE(of, cs42l73_of_match); static const struct i2c_device_id cs42l73_id[] = { - {"cs42l73"}, - {} + { .name = "cs42l73" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs42l73_id); diff --git a/sound/soc/codecs/cs42l84.c b/sound/soc/codecs/cs42l84.c index 1e1307a16f8152..5652377dfe81ac 100644 --- a/sound/soc/codecs/cs42l84.c +++ b/sound/soc/codecs/cs42l84.c @@ -1087,8 +1087,8 @@ static const struct of_device_id cs42l84_of_match[] = { MODULE_DEVICE_TABLE(of, cs42l84_of_match); static const struct i2c_device_id cs42l84_id[] = { - { "cs42l84" }, - {} + { .name = "cs42l84" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs42l84_id); diff --git a/sound/soc/codecs/cs42xx8-i2c.c b/sound/soc/codecs/cs42xx8-i2c.c index 039b3ecb3b9bdc..af01b6876d4cb4 100644 --- a/sound/soc/codecs/cs42xx8-i2c.c +++ b/sound/soc/codecs/cs42xx8-i2c.c @@ -52,9 +52,9 @@ static const struct of_device_id cs42xx8_of_match[] = { MODULE_DEVICE_TABLE(of, cs42xx8_of_match); static const struct i2c_device_id cs42xx8_i2c_id[] = { - {"cs42448", (kernel_ulong_t)&cs42448_data}, - {"cs42888", (kernel_ulong_t)&cs42888_data}, - {} + { .name = "cs42448", .driver_data = (kernel_ulong_t)&cs42448_data }, + { .name = "cs42888", .driver_data = (kernel_ulong_t)&cs42888_data }, + { } }; MODULE_DEVICE_TABLE(i2c, cs42xx8_i2c_id); diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c index a3bdaac9c05903..e7b06f962790d7 100644 --- a/sound/soc/codecs/cs43130.c +++ b/sound/soc/codecs/cs43130.c @@ -2753,11 +2753,11 @@ MODULE_DEVICE_TABLE(acpi, cs43130_acpi_match); static const struct i2c_device_id cs43130_i2c_id[] = { - {"cs43130"}, - {"cs4399"}, - {"cs43131"}, - {"cs43198"}, - {} + { .name = "cs43130" }, + { .name = "cs4399" }, + { .name = "cs43131" }, + { .name = "cs43198" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs43130_i2c_id); diff --git a/sound/soc/codecs/cs4341.c b/sound/soc/codecs/cs4341.c index b726e22ef57d35..a44e6b3c298e75 100644 --- a/sound/soc/codecs/cs4341.c +++ b/sound/soc/codecs/cs4341.c @@ -248,7 +248,7 @@ static int cs4341_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id cs4341_i2c_id[] = { - { "cs4341" }, + { .name = "cs4341" }, { } }; MODULE_DEVICE_TABLE(i2c, cs4341_i2c_id); diff --git a/sound/soc/codecs/cs4349.c b/sound/soc/codecs/cs4349.c index d9a9c34fffe3dd..ced1270c4d68d0 100644 --- a/sound/soc/codecs/cs4349.c +++ b/sound/soc/codecs/cs4349.c @@ -358,8 +358,8 @@ static const struct of_device_id cs4349_of_match[] = { MODULE_DEVICE_TABLE(of, cs4349_of_match); static const struct i2c_device_id cs4349_i2c_id[] = { - {"cs4349"}, - {} + { .name = "cs4349" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs4349_i2c_id); diff --git a/sound/soc/codecs/cs530x-i2c.c b/sound/soc/codecs/cs530x-i2c.c index 52b02ceaa7e3fa..98cb61dd88c1fa 100644 --- a/sound/soc/codecs/cs530x-i2c.c +++ b/sound/soc/codecs/cs530x-i2c.c @@ -40,13 +40,13 @@ static const struct of_device_id cs530x_of_match[] = { MODULE_DEVICE_TABLE(of, cs530x_of_match); static const struct i2c_device_id cs530x_i2c_id[] = { - { "cs4282", CS4282 }, - { "cs4302", CS4302 }, - { "cs4304", CS4304 }, - { "cs4308", CS4308 }, - { "cs5302", CS5302 }, - { "cs5304", CS5304 }, - { "cs5308", CS5308 }, + { .name = "cs4282", .driver_data = CS4282 }, + { .name = "cs4302", .driver_data = CS4302 }, + { .name = "cs4304", .driver_data = CS4304 }, + { .name = "cs4308", .driver_data = CS4308 }, + { .name = "cs5302", .driver_data = CS5302 }, + { .name = "cs5304", .driver_data = CS5304 }, + { .name = "cs5308", .driver_data = CS5308 }, { } }; MODULE_DEVICE_TABLE(i2c, cs530x_i2c_id); diff --git a/sound/soc/codecs/cs53l30.c b/sound/soc/codecs/cs53l30.c index 93ea2fb4dae93f..511453b4c3752d 100644 --- a/sound/soc/codecs/cs53l30.c +++ b/sound/soc/codecs/cs53l30.c @@ -1083,8 +1083,8 @@ static const struct of_device_id cs53l30_of_match[] = { MODULE_DEVICE_TABLE(of, cs53l30_of_match); static const struct i2c_device_id cs53l30_id[] = { - { "cs53l30" }, - {} + { .name = "cs53l30" }, + { } }; MODULE_DEVICE_TABLE(i2c, cs53l30_id); diff --git a/sound/soc/codecs/cx2072x.c b/sound/soc/codecs/cx2072x.c index b0033bf9be3aa8..83c6cbd40804f6 100644 --- a/sound/soc/codecs/cx2072x.c +++ b/sound/soc/codecs/cx2072x.c @@ -1681,9 +1681,9 @@ static void cx2072x_i2c_remove(struct i2c_client *i2c) } static const struct i2c_device_id cx2072x_i2c_id[] = { - { "cx20721" }, - { "cx20723" }, - {} + { .name = "cx20721" }, + { .name = "cx20723" }, + { } }; MODULE_DEVICE_TABLE(i2c, cx2072x_i2c_id); diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index 94e59546c2fe26..4df1a25e318b6e 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c @@ -1238,7 +1238,7 @@ static int da7210_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id da7210_i2c_id[] = { - { "da7210" }, + { .name = "da7210" }, { } }; MODULE_DEVICE_TABLE(i2c, da7210_i2c_id); diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c index 19f69a523f221f..98b8858ded0253 100644 --- a/sound/soc/codecs/da7213.c +++ b/sound/soc/codecs/da7213.c @@ -2271,7 +2271,7 @@ static const struct dev_pm_ops da7213_pm = { }; static const struct i2c_device_id da7213_i2c_id[] = { - { "da7213" }, + { .name = "da7213" }, { } }; MODULE_DEVICE_TABLE(i2c, da7213_i2c_id); diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c index 5c80839704c70e..93bd045ed87012 100644 --- a/sound/soc/codecs/da7218.c +++ b/sound/soc/codecs/da7218.c @@ -3282,8 +3282,8 @@ static int da7218_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id da7218_i2c_id[] = { - { "da7217", DA7217_DEV_ID }, - { "da7218", DA7218_DEV_ID }, + { .name = "da7217", .driver_data = DA7217_DEV_ID }, + { .name = "da7218", .driver_data = DA7218_DEV_ID }, { } }; MODULE_DEVICE_TABLE(i2c, da7218_i2c_id); diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c index ec4059f381be3c..f0874d891e120f 100644 --- a/sound/soc/codecs/da7219.c +++ b/sound/soc/codecs/da7219.c @@ -2712,7 +2712,7 @@ static int da7219_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id da7219_i2c_id[] = { - { "da7219", }, + { .name = "da7219" }, { } }; MODULE_DEVICE_TABLE(i2c, da7219_i2c_id); diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c index 140e449d3ef4d2..12d1ac98461e47 100644 --- a/sound/soc/codecs/da732x.c +++ b/sound/soc/codecs/da732x.c @@ -1547,7 +1547,7 @@ static int da732x_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id da732x_i2c_id[] = { - { "da7320"}, + { .name = "da7320" }, { } }; MODULE_DEVICE_TABLE(i2c, da732x_i2c_id); diff --git a/sound/soc/codecs/da9055.c b/sound/soc/codecs/da9055.c index a52276e32f2fdc..a88c135331457b 100644 --- a/sound/soc/codecs/da9055.c +++ b/sound/soc/codecs/da9055.c @@ -1513,7 +1513,7 @@ static int da9055_i2c_probe(struct i2c_client *i2c) * and PMIC, which must be different to operate together. */ static const struct i2c_device_id da9055_i2c_id[] = { - { "da9055-codec" }, + { .name = "da9055-codec" }, { } }; MODULE_DEVICE_TABLE(i2c, da9055_i2c_id); diff --git a/sound/soc/codecs/es8311.c b/sound/soc/codecs/es8311.c index 0b07a53cc792e6..580d69f5770ddd 100644 --- a/sound/soc/codecs/es8311.c +++ b/sound/soc/codecs/es8311.c @@ -945,7 +945,7 @@ static int es8311_i2c_probe(struct i2c_client *i2c_client) } static const struct i2c_device_id es8311_id[] = { - { "es8311" }, + { .name = "es8311" }, { } }; MODULE_DEVICE_TABLE(i2c, es8311_id); diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c index 9245c33700dee2..6a428387e4964a 100644 --- a/sound/soc/codecs/es8316.c +++ b/sound/soc/codecs/es8316.c @@ -895,8 +895,8 @@ static int es8316_i2c_probe(struct i2c_client *i2c_client) } static const struct i2c_device_id es8316_i2c_id[] = { - {"es8316" }, - {} + { .name = "es8316" }, + { } }; MODULE_DEVICE_TABLE(i2c, es8316_i2c_id); diff --git a/sound/soc/codecs/es8323.c b/sound/soc/codecs/es8323.c index 605375b154c802..d067f7bda03a69 100644 --- a/sound/soc/codecs/es8323.c +++ b/sound/soc/codecs/es8323.c @@ -787,7 +787,7 @@ static int es8323_i2c_probe(struct i2c_client *i2c_client) } static const struct i2c_device_id es8323_i2c_id[] = { - { "es8323" }, + { .name = "es8323" }, { } }; MODULE_DEVICE_TABLE(i2c, es8323_i2c_id); diff --git a/sound/soc/codecs/es8326.c b/sound/soc/codecs/es8326.c index 55a65ef9920880..a79b2da350998d 100644 --- a/sound/soc/codecs/es8326.c +++ b/sound/soc/codecs/es8326.c @@ -1347,8 +1347,8 @@ static void es8326_i2c_remove(struct i2c_client *i2c) } static const struct i2c_device_id es8326_i2c_id[] = { - {"es8326" }, - {} + { .name = "es8326" }, + { } }; MODULE_DEVICE_TABLE(i2c, es8326_i2c_id); diff --git a/sound/soc/codecs/es8328-i2c.c b/sound/soc/codecs/es8328-i2c.c index 56bfbe9261ceea..36a4987e1a593d 100644 --- a/sound/soc/codecs/es8328-i2c.c +++ b/sound/soc/codecs/es8328-i2c.c @@ -16,8 +16,8 @@ #include "es8328.h" static const struct i2c_device_id es8328_id[] = { - { "es8328" }, - { "es8388" }, + { .name = "es8328" }, + { .name = "es8388" }, { } }; MODULE_DEVICE_TABLE(i2c, es8328_id); diff --git a/sound/soc/codecs/es8375.c b/sound/soc/codecs/es8375.c index 0b9406e93c0efb..e8747bc24433f3 100644 --- a/sound/soc/codecs/es8375.c +++ b/sound/soc/codecs/es8375.c @@ -752,7 +752,7 @@ static void es8375_i2c_shutdown(struct i2c_client *i2c) } static const struct i2c_device_id es8375_id[] = { - {"es8375"}, + { .name = "es8375" }, { } }; MODULE_DEVICE_TABLE(i2c, es8375_id); diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c index 449d9574b03a8d..3484c87853cb40 100644 --- a/sound/soc/codecs/es8389.c +++ b/sound/soc/codecs/es8389.c @@ -1015,7 +1015,7 @@ MODULE_DEVICE_TABLE(of, es8389_if_dt_ids); #endif static const struct i2c_device_id es8389_i2c_id[] = { - {"es8389"}, + { .name = "es8389" }, { } }; MODULE_DEVICE_TABLE(i2c, es8389_i2c_id); diff --git a/sound/soc/codecs/fs210x.c b/sound/soc/codecs/fs210x.c index e6195b71adadcc..9394922f3d7a71 100644 --- a/sound/soc/codecs/fs210x.c +++ b/sound/soc/codecs/fs210x.c @@ -1557,9 +1557,9 @@ static void fs210x_i2c_remove(struct i2c_client *client) } static const struct i2c_device_id fs210x_i2c_id[] = { - { "fs2104" }, - { "fs2105s" }, - {} + { .name = "fs2104" }, + { .name = "fs2105s" }, + { } }; MODULE_DEVICE_TABLE(i2c, fs210x_i2c_id); diff --git a/sound/soc/codecs/isabelle.c b/sound/soc/codecs/isabelle.c index b7a94631d77de0..fa1c23dda4eb6e 100644 --- a/sound/soc/codecs/isabelle.c +++ b/sound/soc/codecs/isabelle.c @@ -1133,7 +1133,7 @@ static int isabelle_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id isabelle_i2c_id[] = { - { "isabelle" }, + { .name = "isabelle" }, { } }; MODULE_DEVICE_TABLE(i2c, isabelle_i2c_id); diff --git a/sound/soc/codecs/lm4857.c b/sound/soc/codecs/lm4857.c index 26cdb750cbca62..06add7fb673791 100644 --- a/sound/soc/codecs/lm4857.c +++ b/sound/soc/codecs/lm4857.c @@ -128,7 +128,7 @@ static int lm4857_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id lm4857_i2c_id[] = { - { "lm4857" }, + { .name = "lm4857" }, { } }; MODULE_DEVICE_TABLE(i2c, lm4857_i2c_id); diff --git a/sound/soc/codecs/lm49453.c b/sound/soc/codecs/lm49453.c index 0430305097959e..6e2e292d143bb2 100644 --- a/sound/soc/codecs/lm49453.c +++ b/sound/soc/codecs/lm49453.c @@ -1443,7 +1443,7 @@ static int lm49453_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id lm49453_i2c_id[] = { - { "lm49453" }, + { .name = "lm49453" }, { } }; MODULE_DEVICE_TABLE(i2c, lm49453_i2c_id); diff --git a/sound/soc/codecs/max9768.c b/sound/soc/codecs/max9768.c index 7ad7a9fb72551d..8621d9bdb9fd65 100644 --- a/sound/soc/codecs/max9768.c +++ b/sound/soc/codecs/max9768.c @@ -213,7 +213,7 @@ static int max9768_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id max9768_i2c_id[] = { - { "max9768" }, + { .name = "max9768" }, { } }; MODULE_DEVICE_TABLE(i2c, max9768_i2c_id); diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index 9f40ca4b60d5b4..df438baf05dc38 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c @@ -1722,8 +1722,8 @@ static const struct snd_soc_component_driver soc_component_dev_max98088 = { }; static const struct i2c_device_id max98088_i2c_id[] = { - { "max98088", MAX98088 }, - { "max98089", MAX98089 }, + { .name = "max98088", .driver_data = MAX98088 }, + { .name = "max98089", .driver_data = MAX98089 }, { } }; MODULE_DEVICE_TABLE(i2c, max98088_i2c_id); diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 13a15459040fc3..aaa34ba86802d9 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -2572,8 +2572,8 @@ static const struct regmap_config max98090_regmap = { }; static const struct i2c_device_id max98090_i2c_id[] = { - { "max98090", MAX98090 }, - { "max98091", MAX98091 }, + { .name = "max98090", .driver_data = MAX98090 }, + { .name = "max98091", .driver_data = MAX98091 }, { } }; MODULE_DEVICE_TABLE(i2c, max98090_i2c_id); diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index aae6423156e166..ced9bd4d94da03 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c @@ -2109,7 +2109,7 @@ static const struct snd_soc_component_driver soc_component_dev_max98095 = { }; static const struct i2c_device_id max98095_i2c_id[] = { - { "max98095", MAX98095 }, + { .name = "max98095", .driver_data = MAX98095 }, { } }; MODULE_DEVICE_TABLE(i2c, max98095_i2c_id); diff --git a/sound/soc/codecs/max98371.c b/sound/soc/codecs/max98371.c index 852db211ba1e72..c8d4c68af56236 100644 --- a/sound/soc/codecs/max98371.c +++ b/sound/soc/codecs/max98371.c @@ -400,7 +400,7 @@ static int max98371_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id max98371_i2c_id[] = { - { "max98371" }, + { .name = "max98371" }, { } }; diff --git a/sound/soc/codecs/max98373-i2c.c b/sound/soc/codecs/max98373-i2c.c index f58b8c8625a706..20de379d08de2e 100644 --- a/sound/soc/codecs/max98373-i2c.c +++ b/sound/soc/codecs/max98373-i2c.c @@ -576,8 +576,8 @@ static int max98373_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id max98373_i2c_id[] = { - { "max98373"}, - { }, + { .name = "max98373" }, + { } }; MODULE_DEVICE_TABLE(i2c, max98373_i2c_id); diff --git a/sound/soc/codecs/max98388.c b/sound/soc/codecs/max98388.c index 076f15a9867e13..2576841b7de212 100644 --- a/sound/soc/codecs/max98388.c +++ b/sound/soc/codecs/max98388.c @@ -977,8 +977,8 @@ static int max98388_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id max98388_i2c_id[] = { - { "max98388"}, - { }, + { .name = "max98388" }, + { } }; MODULE_DEVICE_TABLE(i2c, max98388_i2c_id); diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c index ff58805e97d17f..2bbedf84ee5d08 100644 --- a/sound/soc/codecs/max98390.c +++ b/sound/soc/codecs/max98390.c @@ -1015,10 +1015,8 @@ static int max98390_i2c_probe(struct i2c_client *i2c) struct i2c_adapter *adapter = i2c->adapter; struct gpio_desc *reset_gpio; - ret = i2c_check_functionality(adapter, - I2C_FUNC_SMBUS_BYTE - | I2C_FUNC_SMBUS_BYTE_DATA); - if (!ret) { + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA)) { dev_err(&i2c->dev, "I2C check functionality failed\n"); return -ENXIO; } @@ -1098,8 +1096,8 @@ static int max98390_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id max98390_i2c_id[] = { - { "max98390"}, - {}, + { .name = "max98390" }, + { } }; MODULE_DEVICE_TABLE(i2c, max98390_i2c_id); diff --git a/sound/soc/codecs/max98396.c b/sound/soc/codecs/max98396.c index 18fd902271871d..9c1d7213410c27 100644 --- a/sound/soc/codecs/max98396.c +++ b/sound/soc/codecs/max98396.c @@ -1871,9 +1871,9 @@ static int max98396_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id max98396_i2c_id[] = { - { "max98396", CODEC_TYPE_MAX98396}, - { "max98397", CODEC_TYPE_MAX98397}, - { }, + { .name = "max98396", .driver_data = CODEC_TYPE_MAX98396 }, + { .name = "max98397", .driver_data = CODEC_TYPE_MAX98397 }, + { } }; MODULE_DEVICE_TABLE(i2c, max98396_i2c_id); diff --git a/sound/soc/codecs/max9850.c b/sound/soc/codecs/max9850.c index 1fcbc64a277110..9bd6a61212c1d3 100644 --- a/sound/soc/codecs/max9850.c +++ b/sound/soc/codecs/max9850.c @@ -321,7 +321,7 @@ static int max9850_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id max9850_i2c_id[] = { - { "max9850" }, + { .name = "max9850" }, { } }; MODULE_DEVICE_TABLE(i2c, max9850_i2c_id); diff --git a/sound/soc/codecs/max98504.c b/sound/soc/codecs/max98504.c index c94142768c8182..8b2620eaf9b0a5 100644 --- a/sound/soc/codecs/max98504.c +++ b/sound/soc/codecs/max98504.c @@ -363,7 +363,7 @@ MODULE_DEVICE_TABLE(of, max98504_of_match); #endif static const struct i2c_device_id max98504_i2c_id[] = { - { "max98504" }, + { .name = "max98504" }, { } }; MODULE_DEVICE_TABLE(i2c, max98504_i2c_id); diff --git a/sound/soc/codecs/max98520.c b/sound/soc/codecs/max98520.c index 2bf8976c182821..4fb98505db1a19 100644 --- a/sound/soc/codecs/max98520.c +++ b/sound/soc/codecs/max98520.c @@ -681,8 +681,8 @@ static int max98520_i2c_probe(struct i2c_client *i2c) struct max98520_priv *max98520; struct i2c_adapter *adapter = to_i2c_adapter(i2c->dev.parent); - ret = i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA); - if (!ret) { + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA)) { dev_err(&i2c->dev, "I2C check functionality failed\n"); return -ENXIO; } @@ -734,8 +734,8 @@ static int max98520_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id max98520_i2c_id[] = { - { "max98520"}, - { }, + { .name = "max98520" }, + { } }; MODULE_DEVICE_TABLE(i2c, max98520_i2c_id); diff --git a/sound/soc/codecs/max9860.c b/sound/soc/codecs/max9860.c index 716d16daf7d7e1..0d7ac37850bba4 100644 --- a/sound/soc/codecs/max9860.c +++ b/sound/soc/codecs/max9860.c @@ -709,7 +709,7 @@ static void max9860_remove(struct i2c_client *i2c) } static const struct i2c_device_id max9860_i2c_id[] = { - { "max9860", }, + { .name = "max9860" }, { } }; MODULE_DEVICE_TABLE(i2c, max9860_i2c_id); diff --git a/sound/soc/codecs/max9867.c b/sound/soc/codecs/max9867.c index 9cad9b698cf2fb..07a53ec2a18a3f 100644 --- a/sound/soc/codecs/max9867.c +++ b/sound/soc/codecs/max9867.c @@ -689,7 +689,7 @@ static int max9867_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id max9867_i2c_id[] = { - { "max9867" }, + { .name = "max9867" }, { } }; MODULE_DEVICE_TABLE(i2c, max9867_i2c_id); diff --git a/sound/soc/codecs/max9877.c b/sound/soc/codecs/max9877.c index 1bd0d4761ca67d..7cd07b6f9dd63b 100644 --- a/sound/soc/codecs/max9877.c +++ b/sound/soc/codecs/max9877.c @@ -151,7 +151,7 @@ static int max9877_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id max9877_i2c_id[] = { - { "max9877" }, + { .name = "max9877" }, { } }; MODULE_DEVICE_TABLE(i2c, max9877_i2c_id); diff --git a/sound/soc/codecs/max98925.c b/sound/soc/codecs/max98925.c index 124af6408d966b..4302ab16a642a2 100644 --- a/sound/soc/codecs/max98925.c +++ b/sound/soc/codecs/max98925.c @@ -617,7 +617,7 @@ static int max98925_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id max98925_i2c_id[] = { - { "max98925" }, + { .name = "max98925" }, { } }; MODULE_DEVICE_TABLE(i2c, max98925_i2c_id); diff --git a/sound/soc/codecs/max98926.c b/sound/soc/codecs/max98926.c index ae962bda163ebf..5305e1f9d97fd0 100644 --- a/sound/soc/codecs/max98926.c +++ b/sound/soc/codecs/max98926.c @@ -565,7 +565,7 @@ static int max98926_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id max98926_i2c_id[] = { - { "max98926" }, + { .name = "max98926" }, { } }; MODULE_DEVICE_TABLE(i2c, max98926_i2c_id); diff --git a/sound/soc/codecs/max98927.c b/sound/soc/codecs/max98927.c index 0e9b8970997cf6..65e6fdb30eec8d 100644 --- a/sound/soc/codecs/max98927.c +++ b/sound/soc/codecs/max98927.c @@ -873,8 +873,8 @@ static void max98927_i2c_remove(struct i2c_client *i2c) } static const struct i2c_device_id max98927_i2c_id[] = { - { "max98927"}, - { }, + { .name = "max98927" }, + { } }; MODULE_DEVICE_TABLE(i2c, max98927_i2c_id); diff --git a/sound/soc/codecs/ml26124.c b/sound/soc/codecs/ml26124.c index fad0cc90234614..8a14626d43ffde 100644 --- a/sound/soc/codecs/ml26124.c +++ b/sound/soc/codecs/ml26124.c @@ -573,7 +573,7 @@ static int ml26124_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id ml26124_i2c_id[] = { - { "ml26124" }, + { .name = "ml26124" }, { } }; MODULE_DEVICE_TABLE(i2c, ml26124_i2c_id); diff --git a/sound/soc/codecs/mt6660.c b/sound/soc/codecs/mt6660.c index ef63fd113cb73a..21741afc80ef12 100644 --- a/sound/soc/codecs/mt6660.c +++ b/sound/soc/codecs/mt6660.c @@ -557,8 +557,8 @@ static const struct of_device_id __maybe_unused mt6660_of_id[] = { MODULE_DEVICE_TABLE(of, mt6660_of_id); static const struct i2c_device_id mt6660_i2c_id[] = { - {"mt6660" }, - {}, + { .name = "mt6660" }, + { } }; MODULE_DEVICE_TABLE(i2c, mt6660_i2c_id); diff --git a/sound/soc/codecs/nau8325.c b/sound/soc/codecs/nau8325.c index 58ef5c493835b5..236d94c29c249e 100644 --- a/sound/soc/codecs/nau8325.c +++ b/sound/soc/codecs/nau8325.c @@ -877,7 +877,7 @@ static int nau8325_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id nau8325_i2c_ids[] = { - { "nau8325" }, + { .name = "nau8325" }, { } }; MODULE_DEVICE_TABLE(i2c, nau8325_i2c_ids); diff --git a/sound/soc/codecs/nau8540.c b/sound/soc/codecs/nau8540.c index caf2edb23088b6..fefbd5722c0041 100644 --- a/sound/soc/codecs/nau8540.c +++ b/sound/soc/codecs/nau8540.c @@ -965,7 +965,7 @@ static int nau8540_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id nau8540_i2c_ids[] = { - { "nau8540" }, + { .name = "nau8540" }, { } }; MODULE_DEVICE_TABLE(i2c, nau8540_i2c_ids); diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c index 9870e62d372e2b..a050387dd485f4 100644 --- a/sound/soc/codecs/nau8810.c +++ b/sound/soc/codecs/nau8810.c @@ -896,9 +896,9 @@ static int nau8810_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id nau8810_i2c_id[] = { - { "nau8810" }, - { "nau8812" }, - { "nau8814" }, + { .name = "nau8810" }, + { .name = "nau8812" }, + { .name = "nau8814" }, { } }; MODULE_DEVICE_TABLE(i2c, nau8810_i2c_id); diff --git a/sound/soc/codecs/nau8821.c b/sound/soc/codecs/nau8821.c index ffb526de0021ca..c45c5b864ea4b8 100644 --- a/sound/soc/codecs/nau8821.c +++ b/sound/soc/codecs/nau8821.c @@ -1968,7 +1968,7 @@ static int nau8821_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id nau8821_i2c_ids[] = { - { "nau8821" }, + { .name = "nau8821" }, { } }; MODULE_DEVICE_TABLE(i2c, nau8821_i2c_ids); diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c index a11759f85eaca1..19fee5f4bf5f60 100644 --- a/sound/soc/codecs/nau8822.c +++ b/sound/soc/codecs/nau8822.c @@ -1193,7 +1193,7 @@ static int nau8822_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id nau8822_i2c_id[] = { - { "nau8822" }, + { .name = "nau8822" }, { } }; MODULE_DEVICE_TABLE(i2c, nau8822_i2c_id); diff --git a/sound/soc/codecs/nau8824.c b/sound/soc/codecs/nau8824.c index 6ce76376244300..426a488ff2a348 100644 --- a/sound/soc/codecs/nau8824.c +++ b/sound/soc/codecs/nau8824.c @@ -2020,7 +2020,7 @@ static int nau8824_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id nau8824_i2c_ids[] = { - { "nau8824" }, + { .name = "nau8824" }, { } }; MODULE_DEVICE_TABLE(i2c, nau8824_i2c_ids); diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c index dd3528537ae42a..75d8bd01eabc57 100644 --- a/sound/soc/codecs/nau8825.c +++ b/sound/soc/codecs/nau8825.c @@ -2934,7 +2934,7 @@ static void nau8825_i2c_remove(struct i2c_client *client) {} static const struct i2c_device_id nau8825_i2c_ids[] = { - { "nau8825" }, + { .name = "nau8825" }, { } }; MODULE_DEVICE_TABLE(i2c, nau8825_i2c_ids); diff --git a/sound/soc/codecs/ntp8835.c b/sound/soc/codecs/ntp8835.c index 2b93bea11752cc..5837b9379fee7e 100644 --- a/sound/soc/codecs/ntp8835.c +++ b/sound/soc/codecs/ntp8835.c @@ -454,8 +454,8 @@ static int ntp8835_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id ntp8835_i2c_id[] = { - { "ntp8835" }, - {} + { .name = "ntp8835" }, + { } }; MODULE_DEVICE_TABLE(i2c, ntp8835_i2c_id); diff --git a/sound/soc/codecs/ntp8918.c b/sound/soc/codecs/ntp8918.c index 5593d48ef696f5..a18d79aa80aaab 100644 --- a/sound/soc/codecs/ntp8918.c +++ b/sound/soc/codecs/ntp8918.c @@ -370,8 +370,8 @@ static int ntp8918_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id ntp8918_i2c_id[] = { - { "ntp8918" }, - {} + { .name = "ntp8918" }, + { } }; MODULE_DEVICE_TABLE(i2c, ntp8918_i2c_id); diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c index f4e5f3133f2b04..cb923cecb47fc1 100644 --- a/sound/soc/codecs/pcm1681.c +++ b/sound/soc/codecs/pcm1681.c @@ -290,8 +290,8 @@ static const struct snd_soc_component_driver soc_component_dev_pcm1681 = { }; static const struct i2c_device_id pcm1681_i2c_id[] = { - {"pcm1681"}, - {} + { .name = "pcm1681" }, + { } }; MODULE_DEVICE_TABLE(i2c, pcm1681_i2c_id); diff --git a/sound/soc/codecs/pcm1789-i2c.c b/sound/soc/codecs/pcm1789-i2c.c index abadf4f8ed5eeb..4f1bb13fd4c37e 100644 --- a/sound/soc/codecs/pcm1789-i2c.c +++ b/sound/soc/codecs/pcm1789-i2c.c @@ -41,7 +41,7 @@ MODULE_DEVICE_TABLE(of, pcm1789_of_match); #endif static const struct i2c_device_id pcm1789_i2c_ids[] = { - { "pcm1789" }, + { .name = "pcm1789" }, { } }; MODULE_DEVICE_TABLE(i2c, pcm1789_i2c_ids); diff --git a/sound/soc/codecs/pcm179x-i2c.c b/sound/soc/codecs/pcm179x-i2c.c index effc1dd6df22cb..5337bcc7c62c71 100644 --- a/sound/soc/codecs/pcm179x-i2c.c +++ b/sound/soc/codecs/pcm179x-i2c.c @@ -38,7 +38,7 @@ MODULE_DEVICE_TABLE(of, pcm179x_of_match); #endif static const struct i2c_device_id pcm179x_i2c_ids[] = { - { "pcm179x" }, + { .name = "pcm179x" }, { } }; MODULE_DEVICE_TABLE(i2c, pcm179x_i2c_ids); diff --git a/sound/soc/codecs/pcm186x-i2c.c b/sound/soc/codecs/pcm186x-i2c.c index a50f9f6e39c18b..3bd9d557e3c207 100644 --- a/sound/soc/codecs/pcm186x-i2c.c +++ b/sound/soc/codecs/pcm186x-i2c.c @@ -23,10 +23,10 @@ static const struct of_device_id pcm186x_of_match[] = { MODULE_DEVICE_TABLE(of, pcm186x_of_match); static const struct i2c_device_id pcm186x_i2c_id[] = { - { "pcm1862", PCM1862 }, - { "pcm1863", PCM1863 }, - { "pcm1864", PCM1864 }, - { "pcm1865", PCM1865 }, + { .name = "pcm1862", .driver_data = PCM1862 }, + { .name = "pcm1863", .driver_data = PCM1863 }, + { .name = "pcm1864", .driver_data = PCM1864 }, + { .name = "pcm1865", .driver_data = PCM1865 }, { } }; MODULE_DEVICE_TABLE(i2c, pcm186x_i2c_id); diff --git a/sound/soc/codecs/pcm3168a-i2c.c b/sound/soc/codecs/pcm3168a-i2c.c index ff18c74b616c86..334f344761aa9a 100644 --- a/sound/soc/codecs/pcm3168a-i2c.c +++ b/sound/soc/codecs/pcm3168a-i2c.c @@ -33,7 +33,7 @@ static void pcm3168a_i2c_remove(struct i2c_client *i2c) } static const struct i2c_device_id pcm3168a_i2c_id[] = { - { "pcm3168a", }, + { .name = "pcm3168a" }, { } }; MODULE_DEVICE_TABLE(i2c, pcm3168a_i2c_id); diff --git a/sound/soc/codecs/pcm512x-i2c.c b/sound/soc/codecs/pcm512x-i2c.c index a1d849b0c50f39..836865d11d2267 100644 --- a/sound/soc/codecs/pcm512x-i2c.c +++ b/sound/soc/codecs/pcm512x-i2c.c @@ -35,13 +35,13 @@ static void pcm512x_i2c_remove(struct i2c_client *i2c) } static const struct i2c_device_id pcm512x_i2c_id[] = { - { "pcm5121", }, - { "pcm5122", }, - { "pcm5141", }, - { "pcm5142", }, - { "pcm5242", }, - { "tas5754", }, - { "tas5756", }, + { .name = "pcm5121" }, + { .name = "pcm5122" }, + { .name = "pcm5141" }, + { .name = "pcm5142" }, + { .name = "pcm5242" }, + { .name = "tas5754" }, + { .name = "tas5756" }, { } }; MODULE_DEVICE_TABLE(i2c, pcm512x_i2c_id); diff --git a/sound/soc/codecs/pcm6240.c b/sound/soc/codecs/pcm6240.c index 78b21fbfad50e0..27ff8d0983b041 100644 --- a/sound/soc/codecs/pcm6240.c +++ b/sound/soc/codecs/pcm6240.c @@ -27,28 +27,28 @@ #include "pcm6240.h" static const struct i2c_device_id pcmdevice_i2c_id[] = { - { "adc3120", ADC3120 }, - { "adc5120", ADC5120 }, - { "adc6120", ADC6120 }, - { "dix4192", DIX4192 }, - { "pcm1690", PCM1690 }, - { "pcm3120", PCM3120 }, - { "pcm3140", PCM3140 }, - { "pcm5120", PCM5120 }, - { "pcm5140", PCM5140 }, - { "pcm6120", PCM6120 }, - { "pcm6140", PCM6140 }, - { "pcm6240", PCM6240 }, - { "pcm6260", PCM6260 }, - { "pcm9211", PCM9211 }, - { "pcmd3140", PCMD3140 }, - { "pcmd3180", PCMD3180 }, - { "pcmd512x", PCMD512X }, - { "taa5212", TAA5212 }, - { "taa5412", TAA5412 }, - { "tad5212", TAD5212 }, - { "tad5412", TAD5412 }, - {} + { .name = "adc3120", .driver_data = ADC3120 }, + { .name = "adc5120", .driver_data = ADC5120 }, + { .name = "adc6120", .driver_data = ADC6120 }, + { .name = "dix4192", .driver_data = DIX4192 }, + { .name = "pcm1690", .driver_data = PCM1690 }, + { .name = "pcm3120", .driver_data = PCM3120 }, + { .name = "pcm3140", .driver_data = PCM3140 }, + { .name = "pcm5120", .driver_data = PCM5120 }, + { .name = "pcm5140", .driver_data = PCM5140 }, + { .name = "pcm6120", .driver_data = PCM6120 }, + { .name = "pcm6140", .driver_data = PCM6140 }, + { .name = "pcm6240", .driver_data = PCM6240 }, + { .name = "pcm6260", .driver_data = PCM6260 }, + { .name = "pcm9211", .driver_data = PCM9211 }, + { .name = "pcmd3140", .driver_data = PCMD3140 }, + { .name = "pcmd3180", .driver_data = PCMD3180 }, + { .name = "pcmd512x", .driver_data = PCMD512X }, + { .name = "taa5212", .driver_data = TAA5212 }, + { .name = "taa5412", .driver_data = TAA5412 }, + { .name = "tad5212", .driver_data = TAD5212 }, + { .name = "tad5412", .driver_data = TAD5412 }, + { } }; MODULE_DEVICE_TABLE(i2c, pcmdevice_i2c_id); diff --git a/sound/soc/codecs/rt1011.c b/sound/soc/codecs/rt1011.c index 03f31d9d916e6d..15488a0592837a 100644 --- a/sound/soc/codecs/rt1011.c +++ b/sound/soc/codecs/rt1011.c @@ -2201,7 +2201,7 @@ MODULE_DEVICE_TABLE(acpi, rt1011_acpi_match); #endif static const struct i2c_device_id rt1011_i2c_id[] = { - { "rt1011" }, + { .name = "rt1011" }, { } }; MODULE_DEVICE_TABLE(i2c, rt1011_i2c_id); diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c index ca1ed9d5a24ed4..ff0c08ff610e1d 100644 --- a/sound/soc/codecs/rt1015.c +++ b/sound/soc/codecs/rt1015.c @@ -1094,7 +1094,7 @@ static const struct regmap_config rt1015_regmap = { }; static const struct i2c_device_id rt1015_i2c_id[] = { - { "rt1015" }, + { .name = "rt1015" }, { } }; MODULE_DEVICE_TABLE(i2c, rt1015_i2c_id); diff --git a/sound/soc/codecs/rt1016.c b/sound/soc/codecs/rt1016.c index 9f86f071fca825..11c8c45574a131 100644 --- a/sound/soc/codecs/rt1016.c +++ b/sound/soc/codecs/rt1016.c @@ -608,7 +608,7 @@ static const struct regmap_config rt1016_regmap = { }; static const struct i2c_device_id rt1016_i2c_id[] = { - { "rt1016" }, + { .name = "rt1016" }, { } }; MODULE_DEVICE_TABLE(i2c, rt1016_i2c_id); diff --git a/sound/soc/codecs/rt1019.c b/sound/soc/codecs/rt1019.c index 86539c6f6cc1e9..370521149ac8a7 100644 --- a/sound/soc/codecs/rt1019.c +++ b/sound/soc/codecs/rt1019.c @@ -540,7 +540,7 @@ static const struct regmap_config rt1019_regmap = { }; static const struct i2c_device_id rt1019_i2c_id[] = { - { "rt1019" }, + { .name = "rt1019" }, { } }; MODULE_DEVICE_TABLE(i2c, rt1019_i2c_id); diff --git a/sound/soc/codecs/rt1305.c b/sound/soc/codecs/rt1305.c index 26b7382f97ef66..2d5fad76cf5283 100644 --- a/sound/soc/codecs/rt1305.c +++ b/sound/soc/codecs/rt1305.c @@ -981,8 +981,8 @@ MODULE_DEVICE_TABLE(acpi, rt1305_acpi_match); #endif static const struct i2c_device_id rt1305_i2c_id[] = { - { "rt1305" }, - { "rt1306" }, + { .name = "rt1305" }, + { .name = "rt1306" }, { } }; MODULE_DEVICE_TABLE(i2c, rt1305_i2c_id); diff --git a/sound/soc/codecs/rt1308.c b/sound/soc/codecs/rt1308.c index df50b38c24b97b..630946cd7cdf80 100644 --- a/sound/soc/codecs/rt1308.c +++ b/sound/soc/codecs/rt1308.c @@ -795,7 +795,7 @@ MODULE_DEVICE_TABLE(acpi, rt1308_acpi_match); #endif static const struct i2c_device_id rt1308_i2c_id[] = { - { "rt1308" }, + { .name = "rt1308" }, { } }; MODULE_DEVICE_TABLE(i2c, rt1308_i2c_id); diff --git a/sound/soc/codecs/rt1318.c b/sound/soc/codecs/rt1318.c index 01c58b15fd9136..252b4048a7a900 100644 --- a/sound/soc/codecs/rt1318.c +++ b/sound/soc/codecs/rt1318.c @@ -1140,7 +1140,7 @@ static const struct regmap_config rt1318_regmap = { }; static const struct i2c_device_id rt1318_i2c_id[] = { - { "rt1318" }, + { .name = "rt1318" }, { } }; MODULE_DEVICE_TABLE(i2c, rt1318_i2c_id); diff --git a/sound/soc/codecs/rt274.c b/sound/soc/codecs/rt274.c index bba714020c706f..63b5fc439773dd 100644 --- a/sound/soc/codecs/rt274.c +++ b/sound/soc/codecs/rt274.c @@ -1098,8 +1098,8 @@ MODULE_DEVICE_TABLE(of, rt274_of_match); #endif static const struct i2c_device_id rt274_i2c_id[] = { - {"rt274"}, - {} + { .name = "rt274" }, + { } }; MODULE_DEVICE_TABLE(i2c, rt274_i2c_id); diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index 195658f626cc53..ded0ea3324804e 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -1077,9 +1077,9 @@ static const struct regmap_config rt286_regmap = { }; static const struct i2c_device_id rt286_i2c_id[] = { - {"rt286"}, - {"rt288"}, - {} + { .name = "rt286" }, + { .name = "rt288" }, + { } }; MODULE_DEVICE_TABLE(i2c, rt286_i2c_id); diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c index 7d532a5a5f7349..5414a1712b5715 100644 --- a/sound/soc/codecs/rt298.c +++ b/sound/soc/codecs/rt298.c @@ -1138,8 +1138,8 @@ static const struct regmap_config rt298_regmap = { }; static const struct i2c_device_id rt298_i2c_id[] = { - {"rt298"}, - {} + { .name = "rt298" }, + { } }; MODULE_DEVICE_TABLE(i2c, rt298_i2c_id); diff --git a/sound/soc/codecs/rt5514.c b/sound/soc/codecs/rt5514.c index 649b44b790b030..00a4a208d2fa75 100644 --- a/sound/soc/codecs/rt5514.c +++ b/sound/soc/codecs/rt5514.c @@ -1200,7 +1200,7 @@ static const struct regmap_config rt5514_regmap = { }; static const struct i2c_device_id rt5514_i2c_id[] = { - { "rt5514" }, + { .name = "rt5514" }, { } }; MODULE_DEVICE_TABLE(i2c, rt5514_i2c_id); diff --git a/sound/soc/codecs/rt5575.c b/sound/soc/codecs/rt5575.c index c5525ad195ee56..34c3a4de45f22e 100644 --- a/sound/soc/codecs/rt5575.c +++ b/sound/soc/codecs/rt5575.c @@ -325,7 +325,7 @@ static int rt5575_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id rt5575_i2c_id[] = { - { "rt5575" }, + { .name = "rt5575" }, { } }; MODULE_DEVICE_TABLE(i2c, rt5575_i2c_id); diff --git a/sound/soc/codecs/rt5616.c b/sound/soc/codecs/rt5616.c index fb9cf127e3ff21..7297868a24fb05 100644 --- a/sound/soc/codecs/rt5616.c +++ b/sound/soc/codecs/rt5616.c @@ -1321,7 +1321,7 @@ static const struct regmap_config rt5616_regmap = { }; static const struct i2c_device_id rt5616_i2c_id[] = { - { "rt5616" }, + { .name = "rt5616" }, { } }; MODULE_DEVICE_TABLE(i2c, rt5616_i2c_id); diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c index 19c6d8f760d9eb..8ef1a46386fade 100644 --- a/sound/soc/codecs/rt5631.c +++ b/sound/soc/codecs/rt5631.c @@ -1671,8 +1671,8 @@ static const struct snd_soc_component_driver soc_component_dev_rt5631 = { }; static const struct i2c_device_id rt5631_i2c_id[] = { - { "rt5631" }, - { "alc5631" }, + { .name = "rt5631" }, + { .name = "alc5631" }, { } }; MODULE_DEVICE_TABLE(i2c, rt5631_i2c_id); diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index db2222e6f2e758..b0987023c4fd11 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -2953,9 +2953,9 @@ static const struct regmap_config rt5640_regmap = { }; static const struct i2c_device_id rt5640_i2c_id[] = { - { "rt5640" }, - { "rt5639" }, - { "rt5642" }, + { .name = "rt5640" }, + { .name = "rt5639" }, + { .name = "rt5642" }, { } }; MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id); diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index f7701b8d0d3c7e..8a9af260e5f7fe 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -3646,8 +3646,8 @@ static const struct regmap_config temp_regmap = { }; static const struct i2c_device_id rt5645_i2c_id[] = { - { "rt5645" }, - { "rt5650" }, + { .name = "rt5645" }, + { .name = "rt5650" }, { } }; MODULE_DEVICE_TABLE(i2c, rt5645_i2c_id); diff --git a/sound/soc/codecs/rt5651.c b/sound/soc/codecs/rt5651.c index 23c4bf3da2982f..5c729135f71bd8 100644 --- a/sound/soc/codecs/rt5651.c +++ b/sound/soc/codecs/rt5651.c @@ -2202,7 +2202,7 @@ MODULE_DEVICE_TABLE(acpi, rt5651_acpi_match); #endif static const struct i2c_device_id rt5651_i2c_id[] = { - { "rt5651" }, + { .name = "rt5651" }, { } }; MODULE_DEVICE_TABLE(i2c, rt5651_i2c_id); diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c index 3590ebd41c27e1..3097ee6d4e89f9 100644 --- a/sound/soc/codecs/rt5659.c +++ b/sound/soc/codecs/rt5659.c @@ -3814,8 +3814,8 @@ static const struct regmap_config rt5659_regmap = { }; static const struct i2c_device_id rt5659_i2c_id[] = { - { "rt5658" }, - { "rt5659" }, + { .name = "rt5658" }, + { .name = "rt5659" }, { } }; MODULE_DEVICE_TABLE(i2c, rt5659_i2c_id); diff --git a/sound/soc/codecs/rt5660.c b/sound/soc/codecs/rt5660.c index 84cdfb810c66cd..edf2e3e346e4f9 100644 --- a/sound/soc/codecs/rt5660.c +++ b/sound/soc/codecs/rt5660.c @@ -1225,7 +1225,7 @@ static const struct regmap_config rt5660_regmap = { }; static const struct i2c_device_id rt5660_i2c_id[] = { - { "rt5660" }, + { .name = "rt5660" }, { } }; MODULE_DEVICE_TABLE(i2c, rt5660_i2c_id); diff --git a/sound/soc/codecs/rt5663.c b/sound/soc/codecs/rt5663.c index eee1c98cc4aa6d..262d3bba1f3d4f 100644 --- a/sound/soc/codecs/rt5663.c +++ b/sound/soc/codecs/rt5663.c @@ -3307,8 +3307,8 @@ static const struct regmap_config temp_regmap = { }; static const struct i2c_device_id rt5663_i2c_id[] = { - { "rt5663" }, - {} + { .name = "rt5663" }, + { } }; MODULE_DEVICE_TABLE(i2c, rt5663_i2c_id); diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c index 38fb3a277e26d3..48f57cd0920d49 100644 --- a/sound/soc/codecs/rt5665.c +++ b/sound/soc/codecs/rt5665.c @@ -4534,8 +4534,8 @@ static const struct regmap_config rt5665_regmap = { }; static const struct i2c_device_id rt5665_i2c_id[] = { - {"rt5665"}, - {} + { .name = "rt5665" }, + { } }; MODULE_DEVICE_TABLE(i2c, rt5665_i2c_id); diff --git a/sound/soc/codecs/rt5668.c b/sound/soc/codecs/rt5668.c index c551696ae11aa7..fed6de40b8c80b 100644 --- a/sound/soc/codecs/rt5668.c +++ b/sound/soc/codecs/rt5668.c @@ -2334,8 +2334,8 @@ static const struct regmap_config rt5668_regmap = { }; static const struct i2c_device_id rt5668_i2c_id[] = { - {"rt5668b"}, - {} + { .name = "rt5668b" }, + { } }; MODULE_DEVICE_TABLE(i2c, rt5668_i2c_id); diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c index cb5d03bf4c7f47..1d120b5dc2be73 100644 --- a/sound/soc/codecs/rt5670.c +++ b/sound/soc/codecs/rt5670.c @@ -2876,9 +2876,9 @@ static const struct regmap_config rt5670_regmap = { }; static const struct i2c_device_id rt5670_i2c_id[] = { - { "rt5670" }, - { "rt5671" }, - { "rt5672" }, + { .name = "rt5670" }, + { .name = "rt5671" }, + { .name = "rt5672" }, { } }; MODULE_DEVICE_TABLE(i2c, rt5670_i2c_id); diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index d46385249867b3..49bd5e1e8f110d 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c @@ -5208,6 +5208,12 @@ static const struct acpi_device_id rt5677_acpi_match[] = { }; MODULE_DEVICE_TABLE(acpi, rt5677_acpi_match); +static const struct i2c_device_id rt5677_i2c_id[] = { + { .name = "rt5677", .driver_data = RT5677 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, rt5677_i2c_id); + static void rt5677_read_device_properties(struct rt5677_priv *rt5677, struct device *dev) { diff --git a/sound/soc/codecs/rt5682-i2c.c b/sound/soc/codecs/rt5682-i2c.c index e556a365adc81d..286cf0d17968a1 100644 --- a/sound/soc/codecs/rt5682-i2c.c +++ b/sound/soc/codecs/rt5682-i2c.c @@ -324,8 +324,8 @@ static const struct acpi_device_id rt5682_acpi_match[] = { MODULE_DEVICE_TABLE(acpi, rt5682_acpi_match); static const struct i2c_device_id rt5682_i2c_id[] = { - {"rt5682"}, - {} + { .name = "rt5682" }, + { } }; MODULE_DEVICE_TABLE(i2c, rt5682_i2c_id); diff --git a/sound/soc/codecs/rt5682s.c b/sound/soc/codecs/rt5682s.c index 98de94a792603d..3624067950c0ea 100644 --- a/sound/soc/codecs/rt5682s.c +++ b/sound/soc/codecs/rt5682s.c @@ -3325,8 +3325,8 @@ static const struct acpi_device_id rt5682s_acpi_match[] = { MODULE_DEVICE_TABLE(acpi, rt5682s_acpi_match); static const struct i2c_device_id rt5682s_i2c_id[] = { - {"rt5682s"}, - {} + { .name = "rt5682s" }, + { } }; MODULE_DEVICE_TABLE(i2c, rt5682s_i2c_id); diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 320312f8db92fd..59642673b4cbed 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1809,8 +1809,8 @@ static void sgtl5000_i2c_shutdown(struct i2c_client *client) } static const struct i2c_device_id sgtl5000_id[] = { - {"sgtl5000"}, - {}, + { .name = "sgtl5000" }, + { } }; MODULE_DEVICE_TABLE(i2c, sgtl5000_id); diff --git a/sound/soc/codecs/sma1303.c b/sound/soc/codecs/sma1303.c index 06de2b4fce5e2b..c7aaf98ef71e8f 100644 --- a/sound/soc/codecs/sma1303.c +++ b/sound/soc/codecs/sma1303.c @@ -1782,8 +1782,8 @@ static void sma1303_i2c_remove(struct i2c_client *client) } static const struct i2c_device_id sma1303_i2c_id[] = { - {"sma1303"}, - {} + { .name = "sma1303" }, + { } }; MODULE_DEVICE_TABLE(i2c, sma1303_i2c_id); diff --git a/sound/soc/codecs/sma1307.c b/sound/soc/codecs/sma1307.c index 5850bf6e71cade..1de6bd1e4ee7ec 100644 --- a/sound/soc/codecs/sma1307.c +++ b/sound/soc/codecs/sma1307.c @@ -2008,8 +2008,8 @@ static void sma1307_i2c_remove(struct i2c_client *client) } static const struct i2c_device_id sma1307_i2c_id[] = { - { "sma1307a" }, - { "sma1307aq" }, + { .name = "sma1307a" }, + { .name = "sma1307aq" }, { } }; diff --git a/sound/soc/codecs/src4xxx-i2c.c b/sound/soc/codecs/src4xxx-i2c.c index 55f00ce7c71880..34b3abdb9a70c6 100644 --- a/sound/soc/codecs/src4xxx-i2c.c +++ b/sound/soc/codecs/src4xxx-i2c.c @@ -19,7 +19,7 @@ static int src4xxx_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id src4xxx_i2c_ids[] = { - { "src4392" }, + { .name = "src4392" }, { } }; MODULE_DEVICE_TABLE(i2c, src4xxx_i2c_ids); diff --git a/sound/soc/codecs/ssm2518.c b/sound/soc/codecs/ssm2518.c index 9008e5416004fc..5192569ba6a89b 100644 --- a/sound/soc/codecs/ssm2518.c +++ b/sound/soc/codecs/ssm2518.c @@ -794,7 +794,7 @@ MODULE_DEVICE_TABLE(of, ssm2518_dt_ids); #endif static const struct i2c_device_id ssm2518_i2c_ids[] = { - { "ssm2518" }, + { .name = "ssm2518" }, { } }; MODULE_DEVICE_TABLE(i2c, ssm2518_i2c_ids); diff --git a/sound/soc/codecs/ssm2602-i2c.c b/sound/soc/codecs/ssm2602-i2c.c index 49c74cba17c701..23570d0a2f5356 100644 --- a/sound/soc/codecs/ssm2602-i2c.c +++ b/sound/soc/codecs/ssm2602-i2c.c @@ -26,9 +26,9 @@ static int ssm2602_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id ssm2602_i2c_id[] = { - { "ssm2602", SSM2602 }, - { "ssm2603", SSM2602 }, - { "ssm2604", SSM2604 }, + { .name = "ssm2602", .driver_data = SSM2602 }, + { .name = "ssm2603", .driver_data = SSM2602 }, + { .name = "ssm2604", .driver_data = SSM2604 }, { } }; MODULE_DEVICE_TABLE(i2c, ssm2602_i2c_id); diff --git a/sound/soc/codecs/ssm4567.c b/sound/soc/codecs/ssm4567.c index 15f88624faebb4..8415dd163edd69 100644 --- a/sound/soc/codecs/ssm4567.c +++ b/sound/soc/codecs/ssm4567.c @@ -472,7 +472,7 @@ static int ssm4567_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id ssm4567_i2c_ids[] = { - { "ssm4567" }, + { .name = "ssm4567" }, { } }; MODULE_DEVICE_TABLE(i2c, ssm4567_i2c_ids); diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c index b9f9784f51643a..652c6e3a9e6325 100644 --- a/sound/soc/codecs/sta32x.c +++ b/sound/soc/codecs/sta32x.c @@ -1154,9 +1154,9 @@ static int sta32x_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id sta32x_i2c_id[] = { - { "sta326" }, - { "sta328" }, - { "sta329" }, + { .name = "sta326" }, + { .name = "sta328" }, + { .name = "sta329" }, { } }; MODULE_DEVICE_TABLE(i2c, sta32x_i2c_id); diff --git a/sound/soc/codecs/sta350.c b/sound/soc/codecs/sta350.c index 71af82b099c016..95892b78b20505 100644 --- a/sound/soc/codecs/sta350.c +++ b/sound/soc/codecs/sta350.c @@ -1240,7 +1240,7 @@ static void sta350_i2c_remove(struct i2c_client *client) {} static const struct i2c_device_id sta350_i2c_id[] = { - { "sta350" }, + { .name = "sta350" }, { } }; MODULE_DEVICE_TABLE(i2c, sta350_i2c_id); diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c index 8c3b2652b02e29..994bfa7af52b16 100644 --- a/sound/soc/codecs/sta529.c +++ b/sound/soc/codecs/sta529.c @@ -364,7 +364,7 @@ static int sta529_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id sta529_i2c_id[] = { - { "sta529" }, + { .name = "sta529" }, { } }; MODULE_DEVICE_TABLE(i2c, sta529_i2c_id); diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index 43449d7c258430..bd2c5597ad1c04 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c @@ -745,7 +745,7 @@ static void tas2552_i2c_remove(struct i2c_client *client) } static const struct i2c_device_id tas2552_id[] = { - { "tas2552" }, + { .name = "tas2552" }, { } }; MODULE_DEVICE_TABLE(i2c, tas2552_id); diff --git a/sound/soc/codecs/tas2562.c b/sound/soc/codecs/tas2562.c index ceb367ae05ba5a..2f7cfc2be970b5 100644 --- a/sound/soc/codecs/tas2562.c +++ b/sound/soc/codecs/tas2562.c @@ -711,9 +711,9 @@ static int tas2562_parse_dt(struct tas2562_data *tas2562) } static const struct i2c_device_id tas2562_id[] = { - { "tas2562", TAS2562 }, - { "tas2564", TAS2564 }, - { "tas2110", TAS2110 }, + { .name = "tas2562", .driver_data = TAS2562 }, + { .name = "tas2564", .driver_data = TAS2564 }, + { .name = "tas2110", .driver_data = TAS2110 }, { } }; MODULE_DEVICE_TABLE(i2c, tas2562_id); diff --git a/sound/soc/codecs/tas2764.c b/sound/soc/codecs/tas2764.c index 36e25e48b35463..09a66d2fdd5ec0 100644 --- a/sound/soc/codecs/tas2764.c +++ b/sound/soc/codecs/tas2764.c @@ -921,7 +921,7 @@ static int tas2764_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id tas2764_i2c_id[] = { - { "tas2764"}, + { .name = "tas2764" }, { } }; MODULE_DEVICE_TABLE(i2c, tas2764_i2c_id); diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c index 6f878b01716f72..4b39b8394cefb3 100644 --- a/sound/soc/codecs/tas2770.c +++ b/sound/soc/codecs/tas2770.c @@ -862,7 +862,7 @@ static int tas2770_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id tas2770_i2c_id[] = { - { "tas2770"}, + { .name = "tas2770" }, { } }; MODULE_DEVICE_TABLE(i2c, tas2770_i2c_id); diff --git a/sound/soc/codecs/tas2780.c b/sound/soc/codecs/tas2780.c index cf3f6abd7e7ba7..1ec1c076204fb6 100644 --- a/sound/soc/codecs/tas2780.c +++ b/sound/soc/codecs/tas2780.c @@ -621,7 +621,7 @@ static int tas2780_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id tas2780_i2c_id[] = { - { "tas2780"}, + { .name = "tas2780" }, { } }; MODULE_DEVICE_TABLE(i2c, tas2780_i2c_id); diff --git a/sound/soc/codecs/tas2781-i2c.c b/sound/soc/codecs/tas2781-i2c.c index 41b89fcc69c370..34342811462b83 100644 --- a/sound/soc/codecs/tas2781-i2c.c +++ b/sound/soc/codecs/tas2781-i2c.c @@ -100,26 +100,26 @@ static const struct bulk_reg_val tas2781_cali_start_reg[] = { }; static const struct i2c_device_id tasdevice_id[] = { - { "tas2020", TAS2020 }, - { "tas2118", TAS2118 }, - { "tas2120", TAS2120 }, - { "tas2320", TAS2320 }, - { "tas2563", TAS2563 }, - { "tas2568", TAS2568 }, - { "tas2570", TAS2570 }, - { "tas2572", TAS2572 }, - { "tas2574", TAS2574 }, - { "tas2781", TAS2781 }, - { "tas5802", TAS5802 }, - { "tas5806m", TAS5806M }, - { "tas5806md", TAS5806MD }, - { "tas5815", TAS5815 }, - { "tas5822", TAS5822 }, - { "tas5825", TAS5825 }, - { "tas5827", TAS5827 }, - { "tas5828", TAS5828 }, - { "tas5830", TAS5830 }, - {} + { .name = "tas2020", .driver_data = TAS2020 }, + { .name = "tas2118", .driver_data = TAS2118 }, + { .name = "tas2120", .driver_data = TAS2120 }, + { .name = "tas2320", .driver_data = TAS2320 }, + { .name = "tas2563", .driver_data = TAS2563 }, + { .name = "tas2568", .driver_data = TAS2568 }, + { .name = "tas2570", .driver_data = TAS2570 }, + { .name = "tas2572", .driver_data = TAS2572 }, + { .name = "tas2574", .driver_data = TAS2574 }, + { .name = "tas2781", .driver_data = TAS2781 }, + { .name = "tas5802", .driver_data = TAS5802 }, + { .name = "tas5806m", .driver_data = TAS5806M }, + { .name = "tas5806md", .driver_data = TAS5806MD }, + { .name = "tas5815", .driver_data = TAS5815 }, + { .name = "tas5822", .driver_data = TAS5822 }, + { .name = "tas5825", .driver_data = TAS5825 }, + { .name = "tas5827", .driver_data = TAS5827 }, + { .name = "tas5828", .driver_data = TAS5828 }, + { .name = "tas5830", .driver_data = TAS5830 }, + { } }; MODULE_DEVICE_TABLE(i2c, tasdevice_id); diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c index 12bf6a89dbd869..2a76e404877052 100644 --- a/sound/soc/codecs/tas5086.c +++ b/sound/soc/codecs/tas5086.c @@ -891,7 +891,7 @@ static const struct snd_soc_component_driver soc_component_dev_tas5086 = { }; static const struct i2c_device_id tas5086_i2c_id[] = { - { "tas5086" }, + { .name = "tas5086" }, { } }; MODULE_DEVICE_TABLE(i2c, tas5086_i2c_id); diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c index 19ccf8641e16ae..8b5f9accf1207a 100644 --- a/sound/soc/codecs/tas571x.c +++ b/sound/soc/codecs/tas571x.c @@ -1064,13 +1064,13 @@ static const struct of_device_id tas571x_of_match[] __maybe_unused = { MODULE_DEVICE_TABLE(of, tas571x_of_match); static const struct i2c_device_id tas571x_i2c_id[] = { - { "tas5707", (kernel_ulong_t) &tas5707_chip }, - { "tas5711", (kernel_ulong_t) &tas5711_chip }, - { "tas5717", (kernel_ulong_t) &tas5717_chip }, - { "tas5719", (kernel_ulong_t) &tas5717_chip }, - { "tas5721", (kernel_ulong_t) &tas5721_chip }, - { "tas5733", (kernel_ulong_t) &tas5733_chip }, - { "tas5753", (kernel_ulong_t) &tas5753_chip }, + { .name = "tas5707", .driver_data = (kernel_ulong_t)&tas5707_chip }, + { .name = "tas5711", .driver_data = (kernel_ulong_t)&tas5711_chip }, + { .name = "tas5717", .driver_data = (kernel_ulong_t)&tas5717_chip }, + { .name = "tas5719", .driver_data = (kernel_ulong_t)&tas5717_chip }, + { .name = "tas5721", .driver_data = (kernel_ulong_t)&tas5721_chip }, + { .name = "tas5733", .driver_data = (kernel_ulong_t)&tas5733_chip }, + { .name = "tas5753", .driver_data = (kernel_ulong_t)&tas5753_chip }, { } }; MODULE_DEVICE_TABLE(i2c, tas571x_i2c_id); diff --git a/sound/soc/codecs/tas5720.c b/sound/soc/codecs/tas5720.c index 2dcdd0a4bf80fb..0bbcfaadf3f2a6 100644 --- a/sound/soc/codecs/tas5720.c +++ b/sound/soc/codecs/tas5720.c @@ -716,9 +716,9 @@ static struct snd_soc_dai_driver tas5720_dai[] = { }; static const struct i2c_device_id tas5720_id[] = { - { "tas5720", TAS5720 }, - { "tas5720a-q1", TAS5720A_Q1 }, - { "tas5722", TAS5722 }, + { .name = "tas5720", .driver_data = TAS5720 }, + { .name = "tas5720a-q1", .driver_data = TAS5720A_Q1 }, + { .name = "tas5722", .driver_data = TAS5722 }, { } }; MODULE_DEVICE_TABLE(i2c, tas5720_id); diff --git a/sound/soc/codecs/tas5805m.c b/sound/soc/codecs/tas5805m.c index 867046b7aaa0d4..bcc8cab8d667c1 100644 --- a/sound/soc/codecs/tas5805m.c +++ b/sound/soc/codecs/tas5805m.c @@ -580,7 +580,7 @@ static void tas5805m_i2c_remove(struct i2c_client *i2c) } static const struct i2c_device_id tas5805m_i2c_id[] = { - { "tas5805m", }, + { .name = "tas5805m" }, { } }; MODULE_DEVICE_TABLE(i2c, tas5805m_i2c_id); diff --git a/sound/soc/codecs/tas6424.c b/sound/soc/codecs/tas6424.c index 85ecc246896fbb..f5d50f8a1cfb9c 100644 --- a/sound/soc/codecs/tas6424.c +++ b/sound/soc/codecs/tas6424.c @@ -794,7 +794,7 @@ static void tas6424_i2c_remove(struct i2c_client *client) } static const struct i2c_device_id tas6424_i2c_ids[] = { - { "tas6424" }, + { .name = "tas6424" }, { } }; MODULE_DEVICE_TABLE(i2c, tas6424_i2c_ids); diff --git a/sound/soc/codecs/tda7419.c b/sound/soc/codecs/tda7419.c index 7d6fcba9986ea4..7ddea2fbe2d28b 100644 --- a/sound/soc/codecs/tda7419.c +++ b/sound/soc/codecs/tda7419.c @@ -614,7 +614,7 @@ static int tda7419_probe(struct i2c_client *i2c) } static const struct i2c_device_id tda7419_i2c_id[] = { - { "tda7419" }, + { .name = "tda7419" }, { } }; MODULE_DEVICE_TABLE(i2c, tda7419_i2c_id); diff --git a/sound/soc/codecs/tfa9879.c b/sound/soc/codecs/tfa9879.c index ac0c5c33767707..f30479f1f53b0d 100644 --- a/sound/soc/codecs/tfa9879.c +++ b/sound/soc/codecs/tfa9879.c @@ -296,7 +296,7 @@ static int tfa9879_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id tfa9879_i2c_id[] = { - { "tfa9879" }, + { .name = "tfa9879" }, { } }; MODULE_DEVICE_TABLE(i2c, tfa9879_i2c_id); diff --git a/sound/soc/codecs/tlv320adc3xxx.c b/sound/soc/codecs/tlv320adc3xxx.c index 270eee1ea5347f..d7d958ecd8db5b 100644 --- a/sound/soc/codecs/tlv320adc3xxx.c +++ b/sound/soc/codecs/tlv320adc3xxx.c @@ -1391,9 +1391,9 @@ static const struct snd_soc_component_driver soc_component_dev_adc3xxx = { }; static const struct i2c_device_id adc3xxx_i2c_id[] = { - { "tlv320adc3001", ADC3001 }, - { "tlv320adc3101", ADC3101 }, - {} + { .name = "tlv320adc3001", .driver_data = ADC3001 }, + { .name = "tlv320adc3101", .driver_data = ADC3101 }, + { } }; MODULE_DEVICE_TABLE(i2c, adc3xxx_i2c_id); diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx140.c index e4f27a734501f0..4eb9cea2727602 100644 --- a/sound/soc/codecs/tlv320adcx140.c +++ b/sound/soc/codecs/tlv320adcx140.c @@ -1326,10 +1326,10 @@ static int adcx140_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id adcx140_i2c_id[] = { - { "tlv320adc3140", 0 }, - { "tlv320adc5140", 1 }, - { "tlv320adc6140", 2 }, - {} + { .name = "tlv320adc3140", .driver_data = 0 }, + { .name = "tlv320adc5140", .driver_data = 1 }, + { .name = "tlv320adc6140", .driver_data = 2 }, + { } }; MODULE_DEVICE_TABLE(i2c, adcx140_i2c_id); diff --git a/sound/soc/codecs/tlv320aic23-i2c.c b/sound/soc/codecs/tlv320aic23-i2c.c index a31fb95048b8fc..2f928ae23887fb 100644 --- a/sound/soc/codecs/tlv320aic23-i2c.c +++ b/sound/soc/codecs/tlv320aic23-i2c.c @@ -28,8 +28,8 @@ static int tlv320aic23_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id tlv320aic23_id[] = { - {"tlv320aic23"}, - {} + { .name = "tlv320aic23" }, + { } }; MODULE_DEVICE_TABLE(i2c, tlv320aic23_id); diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index 4362c2c06ce8d3..1d2e0ea6d4fedd 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -1630,14 +1630,14 @@ static void aic31xx_configure_ocmv(struct aic31xx_priv *priv) } static const struct i2c_device_id aic31xx_i2c_id[] = { - { "tlv320aic310x", AIC3100 }, - { "tlv320aic311x", AIC3110 }, - { "tlv320aic3100", AIC3100 }, - { "tlv320aic3110", AIC3110 }, - { "tlv320aic3120", AIC3120 }, - { "tlv320aic3111", AIC3111 }, - { "tlv320dac3100", DAC3100 }, - { "tlv320dac3101", DAC3101 }, + { .name = "tlv320aic310x", .driver_data = AIC3100 }, + { .name = "tlv320aic311x", .driver_data = AIC3110 }, + { .name = "tlv320aic3100", .driver_data = AIC3100 }, + { .name = "tlv320aic3110", .driver_data = AIC3110 }, + { .name = "tlv320aic3120", .driver_data = AIC3120 }, + { .name = "tlv320aic3111", .driver_data = AIC3111 }, + { .name = "tlv320dac3100", .driver_data = DAC3100 }, + { .name = "tlv320dac3101", .driver_data = DAC3101 }, { } }; MODULE_DEVICE_TABLE(i2c, aic31xx_i2c_id); diff --git a/sound/soc/codecs/tlv320aic32x4-i2c.c b/sound/soc/codecs/tlv320aic32x4-i2c.c index b27b5ae1e4b20b..449353d5f0888b 100644 --- a/sound/soc/codecs/tlv320aic32x4-i2c.c +++ b/sound/soc/codecs/tlv320aic32x4-i2c.c @@ -38,9 +38,9 @@ static void aic32x4_i2c_remove(struct i2c_client *i2c) } static const struct i2c_device_id aic32x4_i2c_id[] = { - { "tlv320aic32x4", (kernel_ulong_t)AIC32X4_TYPE_AIC32X4 }, - { "tlv320aic32x6", (kernel_ulong_t)AIC32X4_TYPE_AIC32X6 }, - { "tas2505", (kernel_ulong_t)AIC32X4_TYPE_TAS2505 }, + { .name = "tlv320aic32x4", .driver_data = (kernel_ulong_t)AIC32X4_TYPE_AIC32X4 }, + { .name = "tlv320aic32x6", .driver_data = (kernel_ulong_t)AIC32X4_TYPE_AIC32X6 }, + { .name = "tas2505", .driver_data = (kernel_ulong_t)AIC32X4_TYPE_TAS2505 }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(i2c, aic32x4_i2c_id); diff --git a/sound/soc/codecs/tlv320aic3x-i2c.c b/sound/soc/codecs/tlv320aic3x-i2c.c index 0b585925c1ac4a..71528ad3a3b62d 100644 --- a/sound/soc/codecs/tlv320aic3x-i2c.c +++ b/sound/soc/codecs/tlv320aic3x-i2c.c @@ -18,11 +18,11 @@ #include "tlv320aic3x.h" static const struct i2c_device_id aic3x_i2c_id[] = { - { "tlv320aic3x", AIC3X_MODEL_3X }, - { "tlv320aic33", AIC3X_MODEL_33 }, - { "tlv320aic3007", AIC3X_MODEL_3007 }, - { "tlv320aic3104", AIC3X_MODEL_3104 }, - { "tlv320aic3106", AIC3X_MODEL_3106 }, + { .name = "tlv320aic3x", .driver_data = AIC3X_MODEL_3X }, + { .name = "tlv320aic33", .driver_data = AIC3X_MODEL_33 }, + { .name = "tlv320aic3007", .driver_data = AIC3X_MODEL_3007 }, + { .name = "tlv320aic3104", .driver_data = AIC3X_MODEL_3104 }, + { .name = "tlv320aic3106", .driver_data = AIC3X_MODEL_3106 }, { } }; MODULE_DEVICE_TABLE(i2c, aic3x_i2c_id); diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c index 5ce0db9326fd0f..e7c74de0b72485 100644 --- a/sound/soc/codecs/ts3a227e.c +++ b/sound/soc/codecs/ts3a227e.c @@ -424,7 +424,7 @@ static const struct dev_pm_ops ts3a227e_pm = { }; static const struct i2c_device_id ts3a227e_i2c_ids[] = { - { "ts3a227e" }, + { .name = "ts3a227e" }, { } }; MODULE_DEVICE_TABLE(i2c, ts3a227e_i2c_ids); diff --git a/sound/soc/codecs/tscs42xx.c b/sound/soc/codecs/tscs42xx.c index 7390ab250ebb6e..dba58185792039 100644 --- a/sound/soc/codecs/tscs42xx.c +++ b/sound/soc/codecs/tscs42xx.c @@ -1483,8 +1483,8 @@ static int tscs42xx_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id tscs42xx_i2c_id[] = { - { "tscs42A1" }, - { "tscs42A2" }, + { .name = "tscs42A1" }, + { .name = "tscs42A2" }, { } }; MODULE_DEVICE_TABLE(i2c, tscs42xx_i2c_id); diff --git a/sound/soc/codecs/tscs454.c b/sound/soc/codecs/tscs454.c index 64d0da40fbaff6..aad394937ce61e 100644 --- a/sound/soc/codecs/tscs454.c +++ b/sound/soc/codecs/tscs454.c @@ -3454,7 +3454,7 @@ static int tscs454_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id tscs454_i2c_id[] = { - { "tscs454" }, + { .name = "tscs454" }, { } }; MODULE_DEVICE_TABLE(i2c, tscs454_i2c_id); diff --git a/sound/soc/codecs/uda1342.c b/sound/soc/codecs/uda1342.c index b0b29012842da0..12f5757f4210da 100644 --- a/sound/soc/codecs/uda1342.c +++ b/sound/soc/codecs/uda1342.c @@ -319,7 +319,7 @@ static DEFINE_RUNTIME_DEV_PM_OPS(uda1342_pm_ops, uda1342_suspend, uda1342_resume, NULL); static const struct i2c_device_id uda1342_i2c_id[] = { - { "uda1342" }, + { .name = "uda1342" }, { } }; MODULE_DEVICE_TABLE(i2c, uda1342_i2c_id); diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index 9e9c540a45ca97..efb6651e7d462b 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c @@ -781,7 +781,7 @@ static int uda1380_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id uda1380_i2c_id[] = { - { "uda1380" }, + { .name = "uda1380" }, { } }; MODULE_DEVICE_TABLE(i2c, uda1380_i2c_id); diff --git a/sound/soc/codecs/wm1250-ev1.c b/sound/soc/codecs/wm1250-ev1.c index 1f59309d8c6936..5c1b00acb5bf86 100644 --- a/sound/soc/codecs/wm1250-ev1.c +++ b/sound/soc/codecs/wm1250-ev1.c @@ -204,7 +204,7 @@ static int wm1250_ev1_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm1250_ev1_i2c_id[] = { - { "wm1250-ev1" }, + { .name = "wm1250-ev1" }, { } }; MODULE_DEVICE_TABLE(i2c, wm1250_ev1_i2c_id); diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c index 126be2a2a8f343..9b68ee69324b7e 100644 --- a/sound/soc/codecs/wm2000.c +++ b/sound/soc/codecs/wm2000.c @@ -929,7 +929,7 @@ static int wm2000_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm2000_i2c_id[] = { - { "wm2000" }, + { .name = "wm2000" }, { } }; MODULE_DEVICE_TABLE(i2c, wm2000_i2c_id); diff --git a/sound/soc/codecs/wm2200.c b/sound/soc/codecs/wm2200.c index 87418c838ca022..ba8ce2e6e6150a 100644 --- a/sound/soc/codecs/wm2200.c +++ b/sound/soc/codecs/wm2200.c @@ -2471,7 +2471,7 @@ static const struct dev_pm_ops wm2200_pm = { }; static const struct i2c_device_id wm2200_i2c_id[] = { - { "wm2200" }, + { .name = "wm2200" }, { } }; MODULE_DEVICE_TABLE(i2c, wm2200_i2c_id); diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c index 96fd098a9d362b..bd94fa53c3624a 100644 --- a/sound/soc/codecs/wm5100.c +++ b/sound/soc/codecs/wm5100.c @@ -2669,7 +2669,7 @@ static const struct dev_pm_ops wm5100_pm = { }; static const struct i2c_device_id wm5100_i2c_id[] = { - { "wm5100" }, + { .name = "wm5100" }, { } }; MODULE_DEVICE_TABLE(i2c, wm5100_i2c_id); diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c index bebee333d3fd89..589a895648132c 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c @@ -669,7 +669,7 @@ static int wm8510_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8510_i2c_id[] = { - { "wm8510" }, + { .name = "wm8510" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8510_i2c_id); diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c index f003f19766e28c..65108a041c92a7 100644 --- a/sound/soc/codecs/wm8523.c +++ b/sound/soc/codecs/wm8523.c @@ -518,7 +518,7 @@ static int wm8523_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8523_i2c_id[] = { - { "wm8523" }, + { .name = "wm8523" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8523_i2c_id); diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 2be265bb075192..ca7bbe5d4fc35c 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c @@ -1034,8 +1034,8 @@ static const struct of_device_id wm8580_of_match[] = { MODULE_DEVICE_TABLE(of, wm8580_of_match); static const struct i2c_device_id wm8580_i2c_id[] = { - { "wm8580", (kernel_ulong_t)&wm8580_data }, - { "wm8581", (kernel_ulong_t)&wm8581_data }, + { .name = "wm8580", .driver_data = (kernel_ulong_t)&wm8580_data }, + { .name = "wm8581", .driver_data = (kernel_ulong_t)&wm8581_data }, { } }; MODULE_DEVICE_TABLE(i2c, wm8580_i2c_id); diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c index 2bab9d189519dd..5271966b161504 100644 --- a/sound/soc/codecs/wm8711.c +++ b/sound/soc/codecs/wm8711.c @@ -455,7 +455,7 @@ static int wm8711_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id wm8711_i2c_id[] = { - { "wm8711" }, + { .name = "wm8711" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8711_i2c_id); diff --git a/sound/soc/codecs/wm8728.c b/sound/soc/codecs/wm8728.c index 4c1a80561f06f3..6e6fd77c302036 100644 --- a/sound/soc/codecs/wm8728.c +++ b/sound/soc/codecs/wm8728.c @@ -296,7 +296,7 @@ static int wm8728_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8728_i2c_id[] = { - { "wm8728" }, + { .name = "wm8728" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8728_i2c_id); diff --git a/sound/soc/codecs/wm8731-i2c.c b/sound/soc/codecs/wm8731-i2c.c index 1254e583af51ee..5d19fcc4660608 100644 --- a/sound/soc/codecs/wm8731-i2c.c +++ b/sound/soc/codecs/wm8731-i2c.c @@ -47,7 +47,7 @@ static int wm8731_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8731_i2c_id[] = { - { "wm8731" }, + { .name = "wm8731" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8731_i2c_id); diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c index fee8a37ed1df25..4eb42d19bc7ec8 100644 --- a/sound/soc/codecs/wm8737.c +++ b/sound/soc/codecs/wm8737.c @@ -641,7 +641,7 @@ static int wm8737_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8737_i2c_id[] = { - { "wm8737" }, + { .name = "wm8737" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8737_i2c_id); diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c index 4dfbb33edb099d..ca56fdfb508878 100644 --- a/sound/soc/codecs/wm8741.c +++ b/sound/soc/codecs/wm8741.c @@ -606,7 +606,7 @@ static int wm8741_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8741_i2c_id[] = { - { "wm8741" }, + { .name = "wm8741" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8741_i2c_id); diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c index 0e1d3ebb15c49c..d3f1178c2d34e7 100644 --- a/sound/soc/codecs/wm8750.c +++ b/sound/soc/codecs/wm8750.c @@ -803,8 +803,8 @@ static int wm8750_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8750_i2c_id[] = { - { "wm8750" }, - { "wm8987" }, + { .name = "wm8750" }, + { .name = "wm8987" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8750_i2c_id); diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index a532a95e804805..95b23504f68dc8 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c @@ -1581,7 +1581,7 @@ static int wm8753_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8753_i2c_id[] = { - { "wm8753" }, + { .name = "wm8753" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8753_i2c_id); diff --git a/sound/soc/codecs/wm8776.c b/sound/soc/codecs/wm8776.c index c3f340657f0cc3..f3b02c77314f4f 100644 --- a/sound/soc/codecs/wm8776.c +++ b/sound/soc/codecs/wm8776.c @@ -513,8 +513,8 @@ static int wm8776_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8776_i2c_id[] = { - { "wm8775", WM8775 }, - { "wm8776", WM8776 }, + { .name = "wm8775", .driver_data = WM8775 }, + { .name = "wm8776", .driver_data = WM8776 }, { } }; MODULE_DEVICE_TABLE(i2c, wm8776_i2c_id); diff --git a/sound/soc/codecs/wm8804-i2c.c b/sound/soc/codecs/wm8804-i2c.c index 3380d7301b178b..3c49abd33d280d 100644 --- a/sound/soc/codecs/wm8804-i2c.c +++ b/sound/soc/codecs/wm8804-i2c.c @@ -31,7 +31,7 @@ static void wm8804_i2c_remove(struct i2c_client *i2c) } static const struct i2c_device_id wm8804_i2c_id[] = { - { "wm8804" }, + { .name = "wm8804" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8804_i2c_id); diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c index fea629541acda5..4de572800fcbfb 100644 --- a/sound/soc/codecs/wm8900.c +++ b/sound/soc/codecs/wm8900.c @@ -1290,7 +1290,7 @@ static void wm8900_i2c_remove(struct i2c_client *client) {} static const struct i2c_device_id wm8900_i2c_id[] = { - { "wm8900" }, + { .name = "wm8900" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8900_i2c_id); diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index f73f6ad06b3830..320d7737699d97 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c @@ -2203,7 +2203,7 @@ static const struct of_device_id wm8903_of_match[] = { MODULE_DEVICE_TABLE(of, wm8903_of_match); static const struct i2c_device_id wm8903_i2c_id[] = { - { "wm8903" }, + { .name = "wm8903" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8903_i2c_id); diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 4c73a340f25feb..9e5782e50f475b 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -2621,9 +2621,9 @@ static int wm8904_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8904_i2c_id[] = { - { "wm8904", WM8904 }, - { "wm8912", WM8912 }, - { "wm8918", WM8904 }, /* Actually a subset, updates to follow */ + { .name = "wm8904", .driver_data = WM8904 }, + { .name = "wm8912", .driver_data = WM8912 }, + { .name = "wm8918", .driver_data = WM8904 }, /* Actually a subset, updates to follow */ { } }; MODULE_DEVICE_TABLE(i2c, wm8904_i2c_id); diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c index 2f55d0c572a4f0..e631ec0722496a 100644 --- a/sound/soc/codecs/wm8940.c +++ b/sound/soc/codecs/wm8940.c @@ -851,7 +851,7 @@ static int wm8940_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8940_i2c_id[] = { - { "wm8940" }, + { .name = "wm8940" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8940_i2c_id); diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c index e1c61e026cbca0..c897a9ab764dd8 100644 --- a/sound/soc/codecs/wm8955.c +++ b/sound/soc/codecs/wm8955.c @@ -996,7 +996,7 @@ static int wm8955_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8955_i2c_id[] = { - { "wm8955" }, + { .name = "wm8955" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8955_i2c_id); diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index 384e8e7034468e..a810732c6af004 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c @@ -1551,7 +1551,7 @@ static void wm8960_i2c_remove(struct i2c_client *client) } static const struct i2c_device_id wm8960_i2c_id[] = { - { "wm8960" }, + { .name = "wm8960" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8960_i2c_id); diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index cfb8cfc918732d..504fc59e4be2a6 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c @@ -967,7 +967,7 @@ static int wm8961_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8961_i2c_id[] = { - { "wm8961" }, + { .name = "wm8961" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8961_i2c_id); diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 8d2435bf44eab9..de18b1f85a32c3 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -3991,7 +3991,7 @@ static const struct dev_pm_ops wm8962_pm = { }; static const struct i2c_device_id wm8962_i2c_id[] = { - { "wm8962" }, + { .name = "wm8962" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8962_i2c_id); diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c index 46aa556b44fa76..a5d2e91b66bbaa 100644 --- a/sound/soc/codecs/wm8971.c +++ b/sound/soc/codecs/wm8971.c @@ -692,7 +692,7 @@ static int wm8971_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8971_i2c_id[] = { - { "wm8971" }, + { .name = "wm8971" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8971_i2c_id); diff --git a/sound/soc/codecs/wm8974.c b/sound/soc/codecs/wm8974.c index 0bb5e947f46dcb..4656652b8e97c3 100644 --- a/sound/soc/codecs/wm8974.c +++ b/sound/soc/codecs/wm8974.c @@ -712,7 +712,7 @@ static int wm8974_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8974_i2c_id[] = { - { "wm8974" }, + { .name = "wm8974" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8974_i2c_id); diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c index 935761e5086504..ad8064bbaaac8b 100644 --- a/sound/soc/codecs/wm8978.c +++ b/sound/soc/codecs/wm8978.c @@ -1059,7 +1059,7 @@ static int wm8978_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8978_i2c_id[] = { - { "wm8978" }, + { .name = "wm8978" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8978_i2c_id); diff --git a/sound/soc/codecs/wm8983.c b/sound/soc/codecs/wm8983.c index cd34f71cf42aec..fab25f35fd1419 100644 --- a/sound/soc/codecs/wm8983.c +++ b/sound/soc/codecs/wm8983.c @@ -1060,7 +1060,7 @@ static int wm8983_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8983_i2c_id[] = { - { "wm8983" }, + { .name = "wm8983" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8983_i2c_id); diff --git a/sound/soc/codecs/wm8985.c b/sound/soc/codecs/wm8985.c index be23c0c608d142..2a64d5a851da8a 100644 --- a/sound/soc/codecs/wm8985.c +++ b/sound/soc/codecs/wm8985.c @@ -1195,8 +1195,8 @@ static int wm8985_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8985_i2c_id[] = { - { "wm8985", WM8985 }, - { "wm8758", WM8758 }, + { .name = "wm8985", .driver_data = WM8985 }, + { .name = "wm8758", .driver_data = WM8758 }, { } }; MODULE_DEVICE_TABLE(i2c, wm8985_i2c_id); diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c index 9bffe7a6ccecf6..741aecc7641a1b 100644 --- a/sound/soc/codecs/wm8988.c +++ b/sound/soc/codecs/wm8988.c @@ -897,7 +897,7 @@ static int wm8988_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8988_i2c_id[] = { - { "wm8988" }, + { .name = "wm8988" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8988_i2c_id); diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c index 9f2b42025ec9fb..11dfbbbdcd9207 100644 --- a/sound/soc/codecs/wm8990.c +++ b/sound/soc/codecs/wm8990.c @@ -1241,7 +1241,7 @@ static int wm8990_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8990_i2c_id[] = { - { "wm8990" }, + { .name = "wm8990" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8990_i2c_id); diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c index b8ed2a3e699b1c..225c235d3d8959 100644 --- a/sound/soc/codecs/wm8991.c +++ b/sound/soc/codecs/wm8991.c @@ -1315,7 +1315,7 @@ static int wm8991_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8991_i2c_id[] = { - { "wm8991" }, + { .name = "wm8991" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8991_i2c_id); diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c index 1c9299979898bb..2a94b23319b539 100644 --- a/sound/soc/codecs/wm8993.c +++ b/sound/soc/codecs/wm8993.c @@ -1735,7 +1735,7 @@ static void wm8993_i2c_remove(struct i2c_client *i2c) } static const struct i2c_device_id wm8993_i2c_id[] = { - { "wm8993" }, + { .name = "wm8993" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8993_i2c_id); diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c index 104ce09c02e05e..799989a5bf0f24 100644 --- a/sound/soc/codecs/wm8995.c +++ b/sound/soc/codecs/wm8995.c @@ -2259,8 +2259,8 @@ static int wm8995_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm8995_i2c_id[] = { - {"wm8995"}, - {} + { .name = "wm8995" }, + { } }; MODULE_DEVICE_TABLE(i2c, wm8995_i2c_id); diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index 2d9cbf66f7d40d..dface555f92888 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c @@ -3072,7 +3072,7 @@ static void wm8996_i2c_remove(struct i2c_client *client) } static const struct i2c_device_id wm8996_i2c_id[] = { - { "wm8996" }, + { .name = "wm8996" }, { } }; MODULE_DEVICE_TABLE(i2c, wm8996_i2c_id); diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c index 5bfe43c6c1f409..174f3c3877da09 100644 --- a/sound/soc/codecs/wm9081.c +++ b/sound/soc/codecs/wm9081.c @@ -1361,7 +1361,7 @@ static void wm9081_i2c_remove(struct i2c_client *client) {} static const struct i2c_device_id wm9081_i2c_id[] = { - { "wm9081" }, + { .name = "wm9081" }, { } }; MODULE_DEVICE_TABLE(i2c, wm9081_i2c_id); diff --git a/sound/soc/codecs/wm9090.c b/sound/soc/codecs/wm9090.c index 5182f0839b7ceb..8fc24b19313de1 100644 --- a/sound/soc/codecs/wm9090.c +++ b/sound/soc/codecs/wm9090.c @@ -607,8 +607,8 @@ static int wm9090_i2c_probe(struct i2c_client *i2c) } static const struct i2c_device_id wm9090_id[] = { - { "wm9090" }, - { "wm9093" }, + { .name = "wm9090" }, + { .name = "wm9093" }, { } }; MODULE_DEVICE_TABLE(i2c, wm9090_id); diff --git a/sound/soc/qcom/Kconfig b/sound/soc/qcom/Kconfig index e6e24f3b99222d..63a7ef1887d93e 100644 --- a/sound/soc/qcom/Kconfig +++ b/sound/soc/qcom/Kconfig @@ -156,6 +156,14 @@ config SND_SOC_QDSP6 audio drivers. This includes q6asm, q6adm, q6afe interfaces to DSP using apr. +config SND_SOC_QDSP6_Q6VOICE_DAI + tristate + +config SND_SOC_QDSP6_Q6VOICE + tristate "QDSP6 Q6Voice audio driver" + depends on SND_SOC_QDSP6 + select SND_SOC_QDSP6_Q6VOICE_DAI + config SND_SOC_MSM8996 tristate "SoC Machine driver for MSM8996 and APQ8096 boards" depends on QCOM_APR diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index 7ee60a58a3368c..cf1f3a767ceefa 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -120,6 +120,12 @@ int qcom_snd_parse_of(struct snd_soc_card *card) link->id = args.args[0]; + if (link->id >= LPASS_MAX_PORT) { + dev_err(dev, "%s: Invalid cpu dai id %d\n", link->name, link->id); + ret = -EINVAL; + goto err; + } + if (platform) { link->platforms->of_node = of_parse_phandle(platform, "sound-dai", diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h index 1b8d3f90bffaf4..ee6662885593c9 100644 --- a/sound/soc/qcom/common.h +++ b/sound/soc/qcom/common.h @@ -4,8 +4,11 @@ #ifndef __QCOM_SND_COMMON_H__ #define __QCOM_SND_COMMON_H__ +#include #include +#define LPASS_MAX_PORT (SENARY_MI2S_TX + 1) + int qcom_snd_parse_of(struct snd_soc_card *card); int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, struct snd_soc_jack *jack, bool *jack_setup); diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h index de3ec6f594c11c..68b71039b9814e 100644 --- a/sound/soc/qcom/lpass.h +++ b/sound/soc/qcom/lpass.h @@ -14,10 +14,11 @@ #include #include #include +#include "common.h" #include "lpass-hdmi.h" #define LPASS_AHBIX_CLOCK_FREQUENCY 131072000 -#define LPASS_MAX_PORTS (DISPLAY_PORT_RX_7 + 1) +#define LPASS_MAX_PORTS (LPASS_MAX_PORT) #define LPASS_MAX_MI2S_PORTS (8) #define LPASS_MAX_DMA_CHANNELS (8) #define LPASS_MAX_HDMI_DMA_CHANNELS (4) diff --git a/sound/soc/qcom/qdsp6/Makefile b/sound/soc/qcom/qdsp6/Makefile index 67267304e7e920..940b9ec19694ef 100644 --- a/sound/soc/qcom/qdsp6/Makefile +++ b/sound/soc/qcom/qdsp6/Makefile @@ -11,6 +11,9 @@ obj-$(CONFIG_SND_SOC_QDSP6_ADM) += q6adm.o obj-$(CONFIG_SND_SOC_QDSP6_ROUTING) += q6routing.o obj-$(CONFIG_SND_SOC_QDSP6_ASM) += q6asm.o obj-$(CONFIG_SND_SOC_QDSP6_ASM_DAI) += q6asm-dai.o +obj-$(CONFIG_SND_SOC_QDSP6_Q6VOICE) += q6cvp.o q6cvs.o q6mvm.o q6voice-common.o +obj-$(CONFIG_SND_SOC_QDSP6_Q6VOICE) += q6voice.o +obj-$(CONFIG_SND_SOC_QDSP6_Q6VOICE_DAI) += q6voice-dai.o obj-$(CONFIG_SND_SOC_QDSP6_APM) += snd-q6apm.o obj-$(CONFIG_SND_SOC_QDSP6_APM_DAI) += q6apm-dai.o diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c index 0f47aadaabe171..a0d21034a6264d 100644 --- a/sound/soc/qcom/qdsp6/q6afe-dai.c +++ b/sound/soc/qcom/qdsp6/q6afe-dai.c @@ -409,6 +409,7 @@ static int q6afe_dai_prepare(struct snd_pcm_substream *substream, q6afe_slim_port_prepare(dai_data->port[dai->id], &dai_data->port_config[dai->id].slim); break; + case SENARY_MI2S_RX ... SENARY_MI2S_TX: case QUINARY_MI2S_RX ... QUINARY_MI2S_TX: case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX: rc = q6afe_i2s_port_prepare(dai_data->port[dai->id], @@ -540,6 +541,7 @@ static const struct snd_soc_dapm_route q6afe_dapm_routes[] = { {"Tertiary MI2S Playback", NULL, "TERT_MI2S_RX"}, {"Quaternary MI2S Playback", NULL, "QUAT_MI2S_RX"}, {"Quinary MI2S Playback", NULL, "QUIN_MI2S_RX"}, + {"Senary MI2S Playback", NULL, "SEN_MI2S_RX"}, {"Primary TDM0 Playback", NULL, "PRIMARY_TDM_RX_0"}, {"Primary TDM1 Playback", NULL, "PRIMARY_TDM_RX_1"}, @@ -636,6 +638,7 @@ static const struct snd_soc_dapm_route q6afe_dapm_routes[] = { {"SEC_MI2S_TX", NULL, "Secondary MI2S Capture"}, {"QUAT_MI2S_TX", NULL, "Quaternary MI2S Capture"}, {"QUIN_MI2S_TX", NULL, "Quinary MI2S Capture"}, + {"SEN_MI2S_TX", NULL, "Senary MI2S Capture"}, {"WSA_CODEC_DMA_RX_0 Playback", NULL, "WSA_CODEC_DMA_RX_0"}, {"WSA_CODEC_DMA_TX_0", NULL, "WSA_CODEC_DMA_TX_0 Capture"}, @@ -770,6 +773,8 @@ static const struct snd_soc_dapm_widget q6afe_dai_widgets[] = { SND_SOC_DAPM_AIF_OUT("SLIMBUS_4_TX", NULL, 0, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_AIF_OUT("SLIMBUS_5_TX", NULL, 0, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_AIF_OUT("SLIMBUS_6_TX", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("SEN_MI2S_RX", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("SEN_MI2S_TX", NULL, 0, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_AIF_IN("QUIN_MI2S_RX", NULL, 0, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_AIF_OUT("QUIN_MI2S_TX", NULL, @@ -1037,6 +1042,7 @@ static void of_q6afe_parse_dai_data(struct device *dev, switch (id) { /* MI2S specific properties */ + case SENARY_MI2S_RX ... SENARY_MI2S_TX: case QUINARY_MI2S_RX ... QUINARY_MI2S_TX: case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX: priv = &data->priv[id]; diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c index 43d877322baee3..40237267fda051 100644 --- a/sound/soc/qcom/qdsp6/q6afe.c +++ b/sound/soc/qcom/qdsp6/q6afe.c @@ -130,6 +130,8 @@ #define AFE_PORT_ID_QUATERNARY_MI2S_TX 0x1007 #define AFE_PORT_ID_QUINARY_MI2S_RX 0x1016 #define AFE_PORT_ID_QUINARY_MI2S_TX 0x1017 +#define AFE_PORT_ID_SENARY_MI2S_RX 0x1018 +#define AFE_PORT_ID_SENARY_MI2S_TX 0x1019 /* Start of the range of port IDs for TDM devices. */ #define AFE_PORT_ID_TDM_PORT_RANGE_START 0x9000 @@ -718,6 +720,10 @@ static struct afe_port_map port_maps[AFE_PORT_MAX] = { QUINARY_MI2S_RX, 1, 1}, [QUINARY_MI2S_TX] = { AFE_PORT_ID_QUINARY_MI2S_TX, QUINARY_MI2S_TX, 0, 1}, + [SENARY_MI2S_RX] = { AFE_PORT_ID_SENARY_MI2S_RX, + SENARY_MI2S_RX, 1, 1}, + [SENARY_MI2S_TX] = { AFE_PORT_ID_SENARY_MI2S_TX, + SENARY_MI2S_TX, 0, 1}, [PRIMARY_TDM_RX_0] = { AFE_PORT_ID_PRIMARY_TDM_RX, PRIMARY_TDM_RX_0, 1, 1}, [PRIMARY_TDM_TX_0] = { AFE_PORT_ID_PRIMARY_TDM_TX, @@ -1777,6 +1783,8 @@ struct q6afe_port *q6afe_port_get_from_id(struct device *dev, int id) case AFE_PORT_ID_QUATERNARY_MI2S_TX: case AFE_PORT_ID_QUINARY_MI2S_RX: case AFE_PORT_ID_QUINARY_MI2S_TX: + case AFE_PORT_ID_SENARY_MI2S_RX: + case AFE_PORT_ID_SENARY_MI2S_TX: cfg_type = AFE_PARAM_ID_I2S_CONFIG; break; case AFE_PORT_ID_PRIMARY_TDM_RX ... AFE_PORT_ID_QUINARY_TDM_TX_7: diff --git a/sound/soc/qcom/qdsp6/q6afe.h b/sound/soc/qcom/qdsp6/q6afe.h index a29abe4ce43680..0b8c3ec1315caf 100644 --- a/sound/soc/qcom/qdsp6/q6afe.h +++ b/sound/soc/qcom/qdsp6/q6afe.h @@ -2,8 +2,9 @@ #ifndef __Q6AFE_H__ #define __Q6AFE_H__ +#include "../common.h" -#define AFE_PORT_MAX 137 +#define AFE_PORT_MAX (LPASS_MAX_PORT) #define MSM_AFE_PORT_TYPE_RX 0 #define MSM_AFE_PORT_TYPE_TX 1 diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c index ba64117b8cfe13..e904066484d5cf 100644 --- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c @@ -150,7 +150,7 @@ static void q6apm_lpass_dai_shutdown(struct snd_pcm_substream *substream, struct rc = q6apm_graph_stop(dai_data->graph[dai->id]); dai_data->is_port_started[dai->id] = false; if (rc < 0) - dev_err(dai->dev, "fail to close APM port (%d)\n", rc); + dev_err(dai->dev, "failed to stop APM port (%d)\n", rc); } if (dai_data->graph[dai->id]) { @@ -159,6 +159,31 @@ static void q6apm_lpass_dai_shutdown(struct snd_pcm_substream *substream, struct } } +static int q6apm_lpass_dai_trigger(struct snd_pcm_substream *substream, int cmd, + struct snd_soc_dai *dai) +{ + struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev); + int ret = 0; + + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + if (!dai_data->is_port_started[dai->id]) { + ret = q6apm_graph_start(dai_data->graph[dai->id]); + if (ret < 0) + dev_err(dai->dev, "Failed to start APM port %d\n", dai->id); + else + dai_data->is_port_started[dai->id] = true; + } + break; + default: + break; + } + + return ret; +} + static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev); @@ -171,10 +196,6 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct s q6apm_graph_stop(dai_data->graph[dai->id]); dai_data->is_port_started[dai->id] = false; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - q6apm_graph_close(dai_data->graph[dai->id]); - dai_data->graph[dai->id] = NULL; - } } /** @@ -203,14 +224,6 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct s dev_err(dai->dev, "Failed to prepare Graph %d\n", rc); goto err; } - - rc = q6apm_graph_start(dai_data->graph[dai->id]); - if (rc < 0) { - dev_err(dai->dev, "Failed to start APM port %d\n", dai->id); - goto err; - } - dai_data->is_port_started[dai->id] = true; - return 0; err: if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { @@ -254,6 +267,7 @@ static const struct snd_soc_dai_ops q6dma_ops = { .shutdown = q6apm_lpass_dai_shutdown, .set_channel_map = q6dma_set_channel_map, .hw_params = q6dma_hw_params, + .trigger = q6apm_lpass_dai_trigger, }; static const struct snd_soc_dai_ops q6i2s_ops = { @@ -263,6 +277,7 @@ static const struct snd_soc_dai_ops q6i2s_ops = { .set_channel_map = q6dma_set_channel_map, .hw_params = q6dma_hw_params, .set_fmt = q6i2s_set_fmt, + .trigger = q6apm_lpass_dai_trigger, }; static const struct snd_soc_dai_ops q6hdmi_ops = { @@ -271,6 +286,7 @@ static const struct snd_soc_dai_ops q6hdmi_ops = { .shutdown = q6apm_lpass_dai_shutdown, .hw_params = q6hdmi_hw_params, .set_fmt = q6i2s_set_fmt, + .trigger = q6apm_lpass_dai_trigger, }; static const struct snd_soc_component_driver q6apm_lpass_dai_component = { diff --git a/sound/soc/qcom/qdsp6/q6apm.h b/sound/soc/qcom/qdsp6/q6apm.h index 7ce08b401e3102..5cf538397841a7 100644 --- a/sound/soc/qcom/qdsp6/q6apm.h +++ b/sound/soc/qcom/qdsp6/q6apm.h @@ -14,9 +14,10 @@ #include #include #include +#include "../common.h" #include "audioreach.h" -#define APM_PORT_MAX 127 +#define APM_PORT_MAX LPASS_MAX_PORT #define APM_PORT_MAX_AUDIO_CHAN_CNT 8 #define PCM_CHANNEL_NULL 0 #define PCM_CHANNEL_FL 1 /* Front left channel. */ diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index 9e3d176f50c24f..7aac1b57893f3f 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -341,7 +341,7 @@ static int q6asm_dai_trigger(struct snd_soc_component *component, 0, 0, 0); break; case SNDRV_PCM_TRIGGER_STOP: - prtd->state = Q6ASM_STREAM_STOPPED; + // prtd->state = Q6ASM_STREAM_STOPPED; ret = q6asm_cmd_nowait(prtd->audio_client, prtd->stream_id, CMD_EOS); break; diff --git a/sound/soc/qcom/qdsp6/q6core.c b/sound/soc/qcom/qdsp6/q6core.c index 48825756a7abb5..dd55a1f94894fb 100644 --- a/sound/soc/qcom/qdsp6/q6core.c +++ b/sound/soc/qcom/qdsp6/q6core.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "q6core.h" #include "q6dsp-errno.h" @@ -20,9 +21,17 @@ #define AVCS_CMDRSP_ADSP_EVENT_GET_STATE 0x0001290D #define AVCS_GET_VERSIONS 0x00012905 #define AVCS_GET_VERSIONS_RSP 0x00012906 +#define AVCS_CMD_REGISTER_TOPOLOGIES 0x00012923 +#define AVCS_CMD_DEREGISTER_TOPOLOGIES 0x0001292a #define AVCS_CMD_GET_FWK_VERSION 0x001292c #define AVCS_CMDRSP_GET_FWK_VERSION 0x001292d +#define AVCS_MODE_DEREGISTER_ALL_CUSTOM_TOPOLOGIES 2 + +#define ACDB_SECTION_GPROPLUT 0x54554c504f525047 +#define ACDB_SECTION_DATAPOOL 0x4c4f4f5041544144 +#define ACDB_TOPOLOGIES_BLOB 0x000131a7 + struct avcs_svc_info { uint32_t service_id; uint32_t version; @@ -41,6 +50,13 @@ struct avcs_svc_api_info { uint32_t api_branch_version; } __packed; +struct avcs_cmd_register_topologies { + uint32_t payload_addr_lsw; + uint32_t payload_addr_msw; + uint32_t mem_map_handle; + uint32_t payload_size; +} __packed; + struct avcs_cmdrsp_get_fwk_version { uint32_t build_major_version; uint32_t build_minor_version; @@ -236,6 +252,38 @@ static bool __q6core_is_adsp_ready(struct q6core *core) return false; } +static int q6core_register_topologies(struct device *dev, u32 size, const void *data) +{ + struct q6core *core = dev_get_drvdata(dev); + struct apr_device *adev = core->adev; + struct avcs_cmd_register_topologies *cmd; + struct apr_pkt *pkt; + void *p, *dest; + int pkt_size; + + pkt_size = APR_HDR_SIZE + sizeof(*cmd) + size; + + p = kzalloc(pkt_size, GFP_KERNEL); + if (!p) + return -ENOMEM; + + pkt = p; + cmd = p + APR_HDR_SIZE; + dest = p + APR_HDR_SIZE + sizeof(*cmd); + if (!p) + return -ENOMEM; + + pkt->hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, + APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); + pkt->hdr.pkt_size = APR_HDR_SIZE + sizeof(*cmd) + size; + pkt->hdr.opcode = AVCS_CMD_REGISTER_TOPOLOGIES; + cmd->payload_size = size; + + memcpy(dest, data, size); + + return apr_send_pkt(adev, pkt); +} + /** * q6core_get_svc_api_info() - Get version number of a service. * @@ -325,6 +373,103 @@ bool q6core_is_adsp_ready(void) } EXPORT_SYMBOL_GPL(q6core_is_adsp_ready); +static int acdb_section_offset(const struct firmware *fw, + u64 section, u32 *off_out) +{ + const u8 *data = fw->data + 32; + u32 off = 32; + u32 sect_size; + u64 sect_id; + + while (off + 12 <= fw->size) { + sect_id = *(const u64 *) data; + sect_size = *(const u32 *) (data + 8); + + if (off + 12 + sect_size > fw->size) + return -EINVAL; + + if (sect_id == section) { + *off_out = off; + return 0; + } + + off += 12 + sect_size; + data += 12 + sect_size; + } + + return -ENOENT; +} + +static int acdb_get_global_property(const struct firmware *fw, + u32 prop_id, u32 *offset) +{ + u32 gproplut_off, datapool_off; + u32 lut_size, lut_nelts, i; + const u32 *data; + int ret; + + ret = acdb_section_offset(fw, ACDB_SECTION_GPROPLUT, &gproplut_off); + if (ret) + return ret; + + ret = acdb_section_offset(fw, ACDB_SECTION_DATAPOOL, &datapool_off); + if (ret) + return ret; + + lut_size = *(const u32 *) (fw->data + gproplut_off + 8); + if (lut_size < 4) + return -EINVAL; + + lut_nelts = *(const u32 *) (fw->data + gproplut_off + 12); + if (lut_size < 4 + 8 * lut_nelts) + return -EINVAL; + + data = (const u32 *) (fw->data + gproplut_off + 16); + for (i = 0; i < lut_nelts; i++) { + if (datapool_off + 12 + data[i * 2 + 1] + 4 > fw->size) + return -EINVAL; + + if (data[i * 2] == prop_id) { + *offset = datapool_off + 12 + data[i * 2 + 1]; + return 0; + } + } + + return -ENOENT; +} + +static int q6core_load_and_register_topologies(struct device *dev) +{ + const struct device_node *np = dev_of_node(dev); + const char *fw_name; + const struct firmware *fw; + u32 topo_off, size; + int ret; + + ret = of_property_read_string(np, "qcom,acdb-name", &fw_name); + if (ret) + return 0; + + ret = request_firmware(&fw, fw_name, dev); + if (ret) + return dev_err_probe(dev, ret, "failed to load Global_cal.acdb"); + + ret = acdb_get_global_property(fw, ACDB_TOPOLOGIES_BLOB, &topo_off); + if (ret) { + dev_err(dev, "ACDB parse error: %d\n", ret); + goto release_fw; + } + + size = *(const u32 *) (fw->data + topo_off); + ret = q6core_register_topologies(dev, size, fw->data + topo_off + 4); + if (ret < 0) + goto release_fw; + +release_fw: + release_firmware(fw); + return 0; +} + static int q6core_probe(struct apr_device *adev) { g_core = kzalloc_obj(*g_core); @@ -336,7 +481,8 @@ static int q6core_probe(struct apr_device *adev) mutex_init(&g_core->lock); g_core->adev = adev; init_waitqueue_head(&g_core->wait); - return 0; + + return q6core_load_and_register_topologies(&adev->dev); } static void q6core_exit(struct apr_device *adev) diff --git a/sound/soc/qcom/qdsp6/q6cvp.c b/sound/soc/qcom/qdsp6/q6cvp.c new file mode 100644 index 00000000000000..d87849b6dc992f --- /dev/null +++ b/sound/soc/qcom/qdsp6/q6cvp.c @@ -0,0 +1,331 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +// Copyright (c) 2020, Stephan Gerhold + +#include +#include +#include +#include "q6cvp.h" +#include "q6dsp-common.h" +#include "q6voice-common.h" + +#define VSS_IVOCPROC_DIRECTION_RX 0 +#define VSS_IVOCPROC_DIRECTION_TX 1 +#define VSS_IVOCPROC_DIRECTION_RX_TX 2 + +#define VSS_IVOCPROC_PORT_ID_NONE 0xFFFF + +#define VSS_IVOCPROC_TOPOLOGY_ID_NONE 0x00010F70 +#define VSS_IVOCPROC_TOPOLOGY_ID_TX_SM_ECNS 0x00010F71 +#define VSS_IVOCPROC_TOPOLOGY_ID_TX_DM_FLUENCE 0x00010F72 + +#define VSS_IVOCPROC_TOPOLOGY_ID_RX_DEFAULT 0x00010F77 + +#define VSS_IVOCPROC_VOCPROC_MODE_EC_INT_MIXING 0x00010F7C +#define VSS_IVOCPROC_VOCPROC_MODE_EC_EXT_MIXING 0x00010F7D + +#define VSS_ICOMMON_CAL_NETWORK_ID_NONE 0x0001135E + +#define VSS_IVOCPROC_CMD_ENABLE 0x000100C6 +#define VSS_IVOCPROC_CMD_DISABLE 0x000110E1 + +#define VSS_IVOCPROC_CMD_CREATE_FULL_CONTROL_SESSION_V2 0x000112BF +#define VSS_IVOCPROC_CMD_CREATE_FULL_CONTROL_SESSION_V3 0x00013169 + +#define VSS_IVOCPROC_CMD_TOPOLOGY_COMMIT 0x00013198 + +#define VSS_ICOMMON_CMD_SET_PARAM_V2 0x0001133D + +#define VSS_MODULE_CVD_GENERIC 0x0001316E + +#define VSS_PARAM_VOCPROC_RX_CHANNEL_INFO 0x0001328F +#define VSS_PARAM_VOCPROC_TX_CHANNEL_INFO 0x0001328E +#define VSS_PARAM_RX_PORT_ENDPOINT_MEDIA_INFO 0x00013254 +#define VSS_PARAM_TX_PORT_ENDPOINT_MEDIA_INFO 0x00013253 + +#define VOC_SET_MEDIA_FORMAT_PARAM_TOKEN 2 + +#define VSS_NUM_CHANNELS_MAX 8 + +struct vss_ivocproc_cmd_create_full_control_session_v2_cmd { + struct apr_hdr hdr; + + /* + * Vocproc direction. The supported values: + * VSS_IVOCPROC_DIRECTION_RX + * VSS_IVOCPROC_DIRECTION_TX + * VSS_IVOCPROC_DIRECTION_RX_TX + */ + u16 direction; + + /* + * Tx device port ID to which the vocproc connects. If a port ID is + * not being supplied, set this to #VSS_IVOCPROC_PORT_ID_NONE. + */ + u16 tx_port_id; + + /* + * Tx path topology ID. If a topology ID is not being supplied, set + * this to #VSS_IVOCPROC_TOPOLOGY_ID_NONE. + */ + u32 tx_topology_id; + + /* + * Rx device port ID to which the vocproc connects. If a port ID is + * not being supplied, set this to #VSS_IVOCPROC_PORT_ID_NONE. + */ + u16 rx_port_id; + + /* + * Rx path topology ID. If a topology ID is not being supplied, set + * this to #VSS_IVOCPROC_TOPOLOGY_ID_NONE. + */ + u32 rx_topology_id; + + /* Voice calibration profile ID. */ + u32 profile_id; + + /* + * Vocproc mode. The supported values: + * VSS_IVOCPROC_VOCPROC_MODE_EC_INT_MIXING + * VSS_IVOCPROC_VOCPROC_MODE_EC_EXT_MIXING + */ + u32 vocproc_mode; + + /* + * Port ID to which the vocproc connects for receiving echo + * cancellation reference signal. If a port ID is not being supplied, + * set this to #VSS_IVOCPROC_PORT_ID_NONE. This parameter value is + * ignored when the vocproc_mode parameter is set to + * VSS_IVOCPROC_VOCPROC_MODE_EC_INT_MIXING. + */ + u16 ec_ref_port_id; + + /* + * Session name string used to identify a session that can be shared + * with passive controllers (optional). + */ + char name[20]; +} __packed; + +struct vss_param_endpoint_media_format_info { + u32 port_id; + u16 num_channels; + u16 bits_per_sample; + u32 sample_rate; + u8 channel_mapping[VSS_NUM_CHANNELS_MAX]; +} __packed; + +struct vss_param_vocproc_dev_channel_info { + u32 num_channels; + u32 bits_per_sample; + u8 channel_mapping[VSS_NUM_CHANNELS_MAX]; +} __packed; + +struct vss_icommon_param_data { + u32 module_id; + u32 param_id; + u16 param_size; + u16 reserved; + + union { + struct vss_param_endpoint_media_format_info media_format_info; + struct vss_param_vocproc_dev_channel_info channel_info; + }; +} __packed; + +struct vss_icommon_cmd_set_param_v2_cmd { + struct apr_hdr hdr; + + /* + * Pointer to the unique identifier for an address. What type of + * address? DMA? Device-specific memory? Please direct inquiries of + * this type to the SoC manufacturer. + * + * Anyway, the most important information for this parameter is that + * this field is set to zero if the data is in-band, i.e. in the same + * packet. + */ + u32 mem_handle; + + /* + * This field is ignored if you are only paying attention to this + * documentation of the fields. Otherwise, refer to your own + * documentation. I did not ask for this, and will not fully document + * it if its accuracy cannot be measured. + */ + u64 mem_address; + + /* + * Just set this to the size of the parameter data. + */ + u32 mem_size; + + struct vss_icommon_param_data param_data; +} __packed; + +struct q6voice_session *q6cvp_session_create(enum q6voice_path_type path, + u16 tx_port, u16 rx_port, + u32 tx_topo, u32 rx_topo) +{ + struct vss_ivocproc_cmd_create_full_control_session_v2_cmd cmd; + + cmd.hdr.pkt_size = sizeof(cmd); + cmd.hdr.opcode = VSS_IVOCPROC_CMD_CREATE_FULL_CONTROL_SESSION_V2; + + cmd.tx_topology_id = tx_topo; + cmd.rx_topology_id = rx_topo; + + cmd.direction = VSS_IVOCPROC_DIRECTION_RX_TX; + cmd.tx_port_id = tx_port; + cmd.rx_port_id = rx_port; + cmd.profile_id = VSS_ICOMMON_CAL_NETWORK_ID_NONE; + cmd.vocproc_mode = VSS_IVOCPROC_VOCPROC_MODE_EC_INT_MIXING; + cmd.ec_ref_port_id = VSS_IVOCPROC_PORT_ID_NONE; + + return q6voice_session_create(Q6VOICE_SERVICE_CVP, path, &cmd.hdr); +} +EXPORT_SYMBOL_GPL(q6cvp_session_create); + +struct q6voice_session *q6cvp_session_create_v3(enum q6voice_path_type path, + u16 tx_port, u16 rx_port, + u32 tx_topo, u32 rx_topo) +{ + /* + * According to downstream, the v3 parameters are the exact same, with + * the only difference being the opcode. + */ + struct vss_ivocproc_cmd_create_full_control_session_v2_cmd cmd; + + cmd.hdr.pkt_size = sizeof(cmd); + cmd.hdr.opcode = VSS_IVOCPROC_CMD_CREATE_FULL_CONTROL_SESSION_V3; + + cmd.tx_topology_id = tx_topo; + cmd.rx_topology_id = rx_topo; + + cmd.direction = VSS_IVOCPROC_DIRECTION_RX_TX; + cmd.tx_port_id = tx_port; + cmd.rx_port_id = rx_port; + cmd.profile_id = VSS_ICOMMON_CAL_NETWORK_ID_NONE; + cmd.vocproc_mode = VSS_IVOCPROC_VOCPROC_MODE_EC_INT_MIXING; + cmd.ec_ref_port_id = VSS_IVOCPROC_PORT_ID_NONE; + + return q6voice_session_create(Q6VOICE_SERVICE_CVP, path, &cmd.hdr); +} +EXPORT_SYMBOL_GPL(q6cvp_session_create_v3); + +int q6cvp_send_channel_info(struct q6voice_session *cvp, bool is_tx) +{ + struct vss_icommon_cmd_set_param_v2_cmd cmd; + + cmd.hdr.pkt_size = offsetof(struct vss_icommon_cmd_set_param_v2_cmd, param_data.channel_info) + + sizeof(struct vss_param_vocproc_dev_channel_info); + cmd.hdr.opcode = VSS_ICOMMON_CMD_SET_PARAM_V2; + + cmd.mem_handle = 0; + cmd.mem_size = offsetof(struct vss_icommon_param_data, channel_info) + + sizeof(struct vss_param_vocproc_dev_channel_info); + + cmd.param_data.module_id = VSS_MODULE_CVD_GENERIC; + cmd.param_data.param_id = is_tx ? VSS_PARAM_VOCPROC_TX_CHANNEL_INFO + : VSS_PARAM_VOCPROC_RX_CHANNEL_INFO; + cmd.param_data.param_size = sizeof(struct vss_param_vocproc_dev_channel_info); + cmd.param_data.reserved = 0; + + if (is_tx) + cmd.param_data.channel_info.num_channels = 1; + else + cmd.param_data.channel_info.num_channels = 2; + + cmd.param_data.channel_info.bits_per_sample = 16; + + q6dsp_map_channels(cmd.param_data.channel_info.channel_mapping, + cmd.param_data.channel_info.num_channels); + + return q6voice_common_send(cvp, &cmd.hdr); +} +EXPORT_SYMBOL_GPL(q6cvp_send_channel_info); + +int q6cvp_send_media_format(struct q6voice_session *cvp, int port_id, bool is_tx) +{ + struct vss_icommon_cmd_set_param_v2_cmd cmd; + + cmd.hdr.pkt_size = offsetof(struct vss_icommon_cmd_set_param_v2_cmd, param_data.media_format_info) + + sizeof(struct vss_param_endpoint_media_format_info); + cmd.hdr.opcode = VSS_ICOMMON_CMD_SET_PARAM_V2; + + cmd.mem_handle = 0; + cmd.mem_size = offsetof(struct vss_icommon_param_data, media_format_info) + + sizeof(struct vss_param_endpoint_media_format_info); + + cmd.param_data.module_id = VSS_MODULE_CVD_GENERIC; + cmd.param_data.param_id = is_tx ? VSS_PARAM_TX_PORT_ENDPOINT_MEDIA_INFO + : VSS_PARAM_RX_PORT_ENDPOINT_MEDIA_INFO; + cmd.param_data.param_size = sizeof(struct vss_param_endpoint_media_format_info); + cmd.param_data.reserved = 0; + + cmd.param_data.media_format_info.port_id = port_id; + + if (is_tx) + cmd.param_data.media_format_info.num_channels = 1; + else + cmd.param_data.media_format_info.num_channels = 2; + + cmd.param_data.media_format_info.bits_per_sample = 16; + cmd.param_data.media_format_info.sample_rate = 48000; + + q6dsp_map_channels(cmd.param_data.channel_info.channel_mapping, + cmd.param_data.channel_info.num_channels); + + return q6voice_common_send(cvp, &cmd.hdr); +} +EXPORT_SYMBOL_GPL(q6cvp_send_media_format); + +int q6cvp_topology_commit(struct q6voice_session *cvp) +{ + struct apr_pkt cmd; + + cmd.hdr.pkt_size = APR_HDR_SIZE; + cmd.hdr.opcode = VSS_IVOCPROC_CMD_TOPOLOGY_COMMIT; + + return q6voice_common_send(cvp, &cmd.hdr); +} +EXPORT_SYMBOL_GPL(q6cvp_topology_commit); + +int q6cvp_enable(struct q6voice_session *cvp, bool state) +{ + struct apr_pkt cmd; + + cmd.hdr.pkt_size = APR_HDR_SIZE; + cmd.hdr.opcode = state ? VSS_IVOCPROC_CMD_ENABLE : VSS_IVOCPROC_CMD_DISABLE; + + return q6voice_common_send(cvp, &cmd.hdr); +} +EXPORT_SYMBOL_GPL(q6cvp_enable); + +static int q6cvp_probe(struct apr_device *adev) +{ + return q6voice_common_probe(adev, Q6VOICE_SERVICE_CVP); +} + +static const struct of_device_id q6cvp_device_id[] = { + { .compatible = "qcom,q6cvp" }, + {}, +}; +MODULE_DEVICE_TABLE(of, q6cvp_device_id); + +static struct apr_driver qcom_q6cvp_driver = { + .probe = q6cvp_probe, + .remove = q6voice_common_remove, + .callback = q6voice_common_callback, + .driver = { + .name = "qcom-q6cvp", + .of_match_table = of_match_ptr(q6cvp_device_id), + }, +}; + +module_apr_driver(qcom_q6cvp_driver); + +MODULE_AUTHOR("Stephan Gerhold "); +MODULE_DESCRIPTION("Q6 Core Voice Processor"); +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/qcom/qdsp6/q6cvp.h b/sound/soc/qcom/qdsp6/q6cvp.h new file mode 100644 index 00000000000000..aad99eb9e95def --- /dev/null +++ b/sound/soc/qcom/qdsp6/q6cvp.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _Q6_CVP_H +#define _Q6_CVP_H + +#include "q6voice.h" + +struct q6voice_session; + +struct q6voice_session *q6cvp_session_create(enum q6voice_path_type path, + u16 tx_port, u16 rx_port, + u32 tx_topo, u32 rx_topo); +struct q6voice_session *q6cvp_session_create_v3(enum q6voice_path_type path, + u16 tx_port, u16 rx_port, + u32 tx_topo, u32 rx_topo); +int q6cvp_send_channel_info(struct q6voice_session *cvp, bool is_tx); +int q6cvp_send_media_format(struct q6voice_session *cvp, int port_id, bool is_tx); +int q6cvp_topology_commit(struct q6voice_session *cvp); +int q6cvp_enable(struct q6voice_session *cvp, bool enable); + +#endif /*_Q6_CVP_H */ diff --git a/sound/soc/qcom/qdsp6/q6cvs.c b/sound/soc/qcom/qdsp6/q6cvs.c new file mode 100644 index 00000000000000..440715870a04cf --- /dev/null +++ b/sound/soc/qcom/qdsp6/q6cvs.c @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +// Copyright (c) 2020, Stephan Gerhold + +#include +#include +#include +#include "q6cvs.h" +#include "q6voice-common.h" + +static int q6cvs_probe(struct apr_device *adev) +{ + return q6voice_common_probe(adev, Q6VOICE_SERVICE_CVS); +} + +static const struct of_device_id q6cvs_device_id[] = { + { .compatible = "qcom,q6cvs" }, + {}, +}; +MODULE_DEVICE_TABLE(of, q6cvs_device_id); + +static struct apr_driver qcom_q6cvs_driver = { + .probe = q6cvs_probe, + .remove = q6voice_common_remove, + .callback = q6voice_common_callback, + .driver = { + .name = "qcom-q6cvs", + .of_match_table = of_match_ptr(q6cvs_device_id), + }, +}; + +module_apr_driver(qcom_q6cvs_driver); + +MODULE_AUTHOR("Stephan Gerhold "); +MODULE_DESCRIPTION("Q6 Core Voice Stream"); +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/qcom/qdsp6/q6cvs.h b/sound/soc/qcom/qdsp6/q6cvs.h new file mode 100644 index 00000000000000..5c204682c76496 --- /dev/null +++ b/sound/soc/qcom/qdsp6/q6cvs.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _Q6_CVS_H +#define _Q6_CVS_H + +#include "q6voice.h" + +struct q6voice_session; + +#endif /*_Q6_CVS_H */ diff --git a/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c b/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c index 4eed54b071a5c4..e5cd82f77b5520 100644 --- a/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c +++ b/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c @@ -96,6 +96,42 @@ .id = did, \ } +#define Q6AFE_MI2S_RX_DAI(pre, did) { \ + .playback = { \ + .stream_name = pre" MI2S Playback", \ + .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ + SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\ + SNDRV_PCM_RATE_176400, \ + .formats = SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S24_LE | \ + SNDRV_PCM_FMTBIT_S32_LE, \ + .channels_min = 1, \ + .channels_max = 8, \ + .rate_min = 8000, \ + .rate_max = 176400, \ + }, \ + .name = #did, \ + .id = did, \ + } + +#define Q6AFE_MI2S_TX_DAI(pre, did) { \ + .capture = { \ + .stream_name = pre" MI2S Capture", \ + .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ + SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\ + SNDRV_PCM_RATE_176400, \ + .formats = SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S24_LE | \ + SNDRV_PCM_FMTBIT_S32_LE, \ + .channels_min = 1, \ + .channels_max = 8, \ + .rate_min = 8000, \ + .rate_max = 176400, \ + }, \ + .name = #did, \ + .id = did, \ + } + static struct snd_soc_dai_driver q6dsp_audio_fe_dais[] = { { .playback = { @@ -483,7 +519,45 @@ static struct snd_soc_dai_driver q6dsp_audio_fe_dais[] = { }, .id = QUINARY_MI2S_TX, .name = "QUIN_MI2S_TX", + }, { + .playback = { + .stream_name = "Senary MI2S Playback", + .rates = SNDRV_PCM_RATE_8000_192000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 1, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 192000, + }, + .id = SENARY_MI2S_RX, + .name = "SEN_MI2S_RX", + }, { + .capture = { + .stream_name = "Senary MI2S Capture", + .rates = SNDRV_PCM_RATE_8000_192000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE | + SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 1, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 192000, + }, + .id = SENARY_MI2S_TX, + .name = "SEN_MI2S_TX", }, + Q6AFE_MI2S_RX_DAI("LPI RX0", LPI_MI2S_RX_0), + Q6AFE_MI2S_RX_DAI("LPI RX1", LPI_MI2S_RX_1), + Q6AFE_MI2S_RX_DAI("LPI RX2", LPI_MI2S_RX_2), + Q6AFE_MI2S_RX_DAI("LPI RX3", LPI_MI2S_RX_3), + Q6AFE_MI2S_RX_DAI("LPI RX4", LPI_MI2S_RX_4), + Q6AFE_MI2S_TX_DAI("LPI TX0", LPI_MI2S_TX_0), + Q6AFE_MI2S_TX_DAI("LPI TX1", LPI_MI2S_TX_1), + Q6AFE_MI2S_TX_DAI("LPI TX2", LPI_MI2S_TX_2), + Q6AFE_MI2S_TX_DAI("LPI TX3", LPI_MI2S_TX_3), + Q6AFE_MI2S_TX_DAI("LPI TX4", LPI_MI2S_TX_4), Q6AFE_TDM_PB_DAI("Primary", 0, PRIMARY_TDM_RX_0), Q6AFE_TDM_PB_DAI("Primary", 1, PRIMARY_TDM_RX_1), Q6AFE_TDM_PB_DAI("Primary", 2, PRIMARY_TDM_RX_2), @@ -634,8 +708,10 @@ struct snd_soc_dai_driver *q6dsp_audio_ports_set_config(struct device *dev, case SLIMBUS_0_RX ... SLIMBUS_6_TX: q6dsp_audio_fe_dais[i].ops = cfg->q6slim_ops; break; + case SENARY_MI2S_RX ... SENARY_MI2S_TX: case QUINARY_MI2S_RX ... QUINARY_MI2S_TX: case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX: + case LPI_MI2S_RX_0 ... LPI_MI2S_TX_4: q6dsp_audio_fe_dais[i].ops = cfg->q6i2s_ops; break; case PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7: diff --git a/sound/soc/qcom/qdsp6/q6mvm.c b/sound/soc/qcom/qdsp6/q6mvm.c new file mode 100644 index 00000000000000..ace0d9ca302572 --- /dev/null +++ b/sound/soc/qcom/qdsp6/q6mvm.c @@ -0,0 +1,174 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +// Copyright (c) 2020, Stephan Gerhold + +#include +#include +#include +#include +#include "q6mvm.h" +#include "q6voice-common.h" + +#define VSS_IMVM_CMD_CREATE_PASSIVE_CONTROL_SESSION 0x000110FF + +struct vss_imvm_cmd_create_control_session_cmd { + struct apr_hdr hdr; + + /* A variable-sized stream name. */ + char name[20]; +} __packed; + +#define VSS_IMVM_CMD_SET_POLICY_DUAL_CONTROL 0x00011327 + +/* This command is required to let MVM know who is in control of session. */ +struct vss_imvm_cmd_set_policy_dual_control_cmd { + struct apr_hdr hdr; + + /* Set to TRUE to enable modem state machine control */ + bool enable; +} __packed; + +#define VSS_IMVM_CMD_ATTACH_VOCPROC 0x0001123E +#define VSS_IMVM_CMD_DETACH_VOCPROC 0x0001123F + +/* + * Attach/detach a vocproc to the MVM. + * The MVM will symmetrically connect/disconnect this vocproc + * to/from all the streams currently attached to it. + */ +struct vss_imvm_cmd_attach_vocproc_cmd { + struct apr_hdr hdr; + + /* Handle of vocproc being attached. */ + u16 handle; +} __packed; + +#define VSS_IMVM_CMD_START_VOICE 0x00011190 +#define VSS_IMVM_CMD_STOP_VOICE 0x00011192 + +static inline const char *q6mvm_session_name(enum q6voice_path_type path) +{ + switch (path) { + case Q6VOICE_PATH_VOICE: + return "default modem voice"; + case Q6VOICE_PATH_VOIP: + return "10004000"; + case Q6VOICE_PATH_VOLTE: + return "10C02000"; + case Q6VOICE_PATH_VOICE2: + return "10DC1000"; + case Q6VOICE_PATH_QCHAT: + return "10803000"; + case Q6VOICE_PATH_VOWLAN: + return "10002000"; + case Q6VOICE_PATH_VOICEMMODE1: + return "11C05000"; + case Q6VOICE_PATH_VOICEMMODE2: + return "11DC5000"; + default: + return NULL; + } +} + +static int q6mvm_set_dual_control(struct q6voice_session *mvm) +{ + struct vss_imvm_cmd_set_policy_dual_control_cmd cmd; + + cmd.hdr.pkt_size = sizeof(cmd); + cmd.hdr.opcode = VSS_IMVM_CMD_SET_POLICY_DUAL_CONTROL; + + cmd.enable = true; + + return q6voice_common_send(mvm, &cmd.hdr); +} + +struct q6voice_session *q6mvm_session_create(enum q6voice_path_type path) +{ + struct vss_imvm_cmd_create_control_session_cmd cmd; + struct q6voice_session *mvm; + const char *session_name; + int ret; + + cmd.hdr.pkt_size = sizeof(cmd); + cmd.hdr.opcode = VSS_IMVM_CMD_CREATE_PASSIVE_CONTROL_SESSION; + + session_name = q6mvm_session_name(path); + if (session_name) + strscpy(cmd.name, session_name, sizeof(cmd.name)); + + mvm = q6voice_session_create(Q6VOICE_SERVICE_MVM, path, &cmd.hdr); + if (IS_ERR(mvm)) + return mvm; + + ret = q6mvm_set_dual_control(mvm); + if (ret) { + dev_err(mvm->dev, "failed to set dual control: %d\n", ret); + q6voice_session_release(mvm); + return ERR_PTR(ret); + } + + return mvm; +} +EXPORT_SYMBOL_GPL(q6mvm_session_create); + +int q6mvm_attach(struct q6voice_session *mvm, struct q6voice_session *cvp, + bool state) +{ + struct vss_imvm_cmd_attach_vocproc_cmd cmd; + + cmd.hdr.pkt_size = sizeof(cmd); + cmd.hdr.opcode = state ? VSS_IMVM_CMD_ATTACH_VOCPROC : VSS_IMVM_CMD_DETACH_VOCPROC; + + cmd.handle = cvp->handle; + + return q6voice_common_send(mvm, &cmd.hdr); +} +EXPORT_SYMBOL_GPL(q6mvm_attach); + +int q6mvm_start(struct q6voice_session *mvm, bool state) +{ + struct apr_pkt cmd; + + cmd.hdr.pkt_size = APR_HDR_SIZE; + cmd.hdr.opcode = state ? VSS_IMVM_CMD_START_VOICE : VSS_IMVM_CMD_STOP_VOICE; + + return q6voice_common_send(mvm, &cmd.hdr); +} +EXPORT_SYMBOL_GPL(q6mvm_start); + +static int q6mvm_probe(struct apr_device *adev) +{ + int ret; + + ret = q6voice_common_probe(adev, Q6VOICE_SERVICE_MVM); + if (ret) + return ret; + + return of_platform_populate(adev->dev.of_node, NULL, NULL, &adev->dev); +} + +static void q6mvm_remove(struct apr_device *adev) +{ + of_platform_depopulate(&adev->dev); + q6voice_common_remove(adev); +} + +static const struct of_device_id q6mvm_device_id[] = { + { .compatible = "qcom,q6mvm" }, + {}, +}; +MODULE_DEVICE_TABLE(of, q6mvm_device_id); + +static struct apr_driver qcom_q6mvm_driver = { + .probe = q6mvm_probe, + .remove = q6mvm_remove, + .callback = q6voice_common_callback, + .driver = { + .name = "qcom-q6mvm", + .of_match_table = of_match_ptr(q6mvm_device_id), + }, +}; + +module_apr_driver(qcom_q6mvm_driver); +MODULE_DESCRIPTION("Q6 Multimode Voice Manager"); +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/qcom/qdsp6/q6mvm.h b/sound/soc/qcom/qdsp6/q6mvm.h new file mode 100644 index 00000000000000..51279eddb89b66 --- /dev/null +++ b/sound/soc/qcom/qdsp6/q6mvm.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _Q6_MVM_H +#define _Q6_MVM_H + +#include "q6voice.h" + +struct q6voice_session; + +struct q6voice_session *q6mvm_session_create(enum q6voice_path_type path); + +int q6mvm_attach(struct q6voice_session *mvm, struct q6voice_session *cvp, + bool state); +int q6mvm_start(struct q6voice_session *mvm, bool state); + +#endif /*_Q6_MVM_H */ diff --git a/sound/soc/qcom/qdsp6/q6voice-common.c b/sound/soc/qcom/qdsp6/q6voice-common.c new file mode 100644 index 00000000000000..e0a5e4eea84e36 --- /dev/null +++ b/sound/soc/qcom/qdsp6/q6voice-common.c @@ -0,0 +1,272 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020, Stephan Gerhold + +#include +#include +#include +#include +#include "q6voice-common.h" + +#define APRV2_IBASIC_CMD_DESTROY_SESSION 0x0001003C + +#define TIMEOUT_MS 300 + +struct q6voice_service { + struct apr_device *adev; + enum q6voice_service_type type; + + /* Protect sessions array */ + spinlock_t lock; + struct q6voice_session *sessions[Q6VOICE_PATH_COUNT]; +}; + +/* Protect q6voice_services */ +static DEFINE_SPINLOCK(q6voice_services_lock); +static struct q6voice_service *q6voice_services[Q6VOICE_SERVICE_COUNT] = {0}; + +int q6voice_common_probe(struct apr_device *adev, enum q6voice_service_type type) +{ + struct device *dev = &adev->dev; + struct q6voice_service *svc, *current_svc; + unsigned long flags; + + if (type >= Q6VOICE_SERVICE_COUNT) + return -EINVAL; + + svc = devm_kzalloc(dev, sizeof(*svc), GFP_KERNEL); + if (!svc) + return -ENOMEM; + + svc->adev = adev; + svc->type = type; + spin_lock_init(&svc->lock); + + dev_set_drvdata(dev, svc); + + spin_lock_irqsave(&q6voice_services_lock, flags); + current_svc = q6voice_services[type]; + if (!current_svc) + q6voice_services[type] = svc; + spin_unlock_irqrestore(&q6voice_services_lock, flags); + + return current_svc ? -EEXIST : 0; +} +EXPORT_SYMBOL_GPL(q6voice_common_probe); + +void q6voice_common_remove(struct apr_device *adev) +{ + struct q6voice_service *svc = dev_get_drvdata(&adev->dev); + enum q6voice_service_type type = svc->type; + unsigned long flags; + + spin_lock_irqsave(&q6voice_services_lock, flags); + if (q6voice_services[type] == svc) + q6voice_services[type] = NULL; + spin_unlock_irqrestore(&q6voice_services_lock, flags); + + /* TODO: Should probably free up sessions here??? */ +} +EXPORT_SYMBOL_GPL(q6voice_common_remove); + +static void q6voice_session_free(struct kref *ref) +{ + struct q6voice_session *s = container_of(ref, struct q6voice_session, + refcount); + + kfree(s); +} + +static int q6voice_session_destroy(struct q6voice_session *s) +{ + struct apr_pkt cmd; + + cmd.hdr.pkt_size = APR_HDR_SIZE; + cmd.hdr.opcode = APRV2_IBASIC_CMD_DESTROY_SESSION; + + return q6voice_common_send(s, &cmd.hdr); +} + +void q6voice_session_release(struct q6voice_session *s) +{ + struct q6voice_service *svc = s->svc; + unsigned long flags; + + if (s->handle) + q6voice_session_destroy(s); + + spin_lock_irqsave(&svc->lock, flags); + if (svc->sessions[s->port] == s) + svc->sessions[s->port] = NULL; + spin_unlock_irqrestore(&svc->lock, flags); + + kref_put(&s->refcount, q6voice_session_free); +} +EXPORT_SYMBOL_GPL(q6voice_session_release); + +struct q6voice_session * +q6voice_session_create(enum q6voice_service_type type, + enum q6voice_path_type path, struct apr_hdr *hdr) +{ + struct q6voice_service *svc; + struct q6voice_session *s; + unsigned long flags; + int ret; + + spin_lock_irqsave(&q6voice_services_lock, flags); + svc = q6voice_services[type]; + spin_unlock_irqrestore(&q6voice_services_lock, flags); + if (!svc) + return ERR_PTR(-ENODEV); + + s = kzalloc(sizeof(*s), GFP_KERNEL); + if (!s) + return ERR_PTR(-ENOMEM); + + s->dev = &svc->adev->dev; + s->svc = svc; + s->port = path; + + kref_init(&s->refcount); + spin_lock_init(&s->lock); + init_waitqueue_head(&s->wait); + + spin_lock_irqsave(&svc->lock, flags); + if (svc->sessions[path]) { + spin_unlock_irqrestore(&svc->lock, flags); + kfree(s); + return ERR_PTR(-EBUSY); + } + svc->sessions[path] = s; + spin_unlock_irqrestore(&svc->lock, flags); + + dev_dbg(s->dev, "create session\n"); + + ret = q6voice_common_send(s, hdr); + if (ret) + goto err; + + if (!s->handle) { + dev_warn(s->dev, "failed to receive handle\n"); + ret = -EIO; + goto err; + } + + dev_dbg(s->dev, "handle: %d\n", s->handle); + + return s; + +err: + q6voice_session_release(s); + return ERR_PTR(ret); +} +EXPORT_SYMBOL_GPL(q6voice_session_create); + +static void q6voice_session_callback(struct q6voice_session *s, + const struct apr_resp_pkt *data) +{ + struct aprv2_ibasic_rsp_result_t *result = data->payload; + unsigned long flags; + + if (data->hdr.opcode != APR_BASIC_RSP_RESULT) + return; /* Not handled here */ + + dev_dbg(s->dev, "basic result: opcode %#x, status: %#x\n", + result->opcode, result->status); + + spin_lock_irqsave(&s->lock, flags); + if (result->opcode != s->expected_opcode) { + spin_unlock_irqrestore(&s->lock, flags); + dev_warn(s->dev, "unexpected reply for opcode %#x (status: %#x)\n", + result->opcode, result->status); + return; + } + + if (!s->handle) { + s->handle = data->hdr.src_port; + } else if (s->handle != data->hdr.src_port) { + spin_unlock_irqrestore(&s->lock, flags); + dev_warn(s->dev, "unexpected reply for session %#x (!= %#x)\n", + data->hdr.src_port, s->handle); + return; + } + + s->result = result->status; + s->expected_opcode = 0; + spin_unlock_irqrestore(&s->lock, flags); + + wake_up(&s->wait); +} + +int q6voice_common_callback(struct apr_device *adev, const struct apr_resp_pkt *data) +{ + struct device *dev = &adev->dev; + struct q6voice_service *v = dev_get_drvdata(dev); + struct q6voice_session *s; + unsigned long flags; + + dev_dbg(dev, "callback: %#x\n", data->hdr.opcode); + + if (data->hdr.dest_port >= Q6VOICE_PATH_COUNT) { + dev_warn(dev, "callback() called for unhandled/invalid path: %d\n", + data->hdr.dest_port); + return 0; + } + + spin_lock_irqsave(&v->lock, flags); + s = v->sessions[data->hdr.dest_port]; + if (s) + kref_get(&s->refcount); + spin_unlock_irqrestore(&v->lock, flags); + + if (s) { + q6voice_session_callback(s, data); + kref_put(&s->refcount, q6voice_session_free); + } else { + dev_warn(dev, "callback() called for inactive path: %d\n", + data->hdr.dest_port); + } + + return 0; +} +EXPORT_SYMBOL_GPL(q6voice_common_callback); + +int q6voice_common_send(struct q6voice_session *s, struct apr_hdr *hdr) +{ + unsigned long flags; + int ret; + + hdr->hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, + APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); + hdr->src_port = s->port; + hdr->dest_port = s->handle; + hdr->token = 0; + + spin_lock_irqsave(&s->lock, flags); + s->expected_opcode = hdr->opcode; + s->result = 0; + spin_unlock_irqrestore(&s->lock, flags); + + ret = apr_send_pkt(s->svc->adev, (struct apr_pkt *)hdr); + if (ret < 0) + return ret; + + ret = wait_event_timeout(s->wait, (s->expected_opcode == 0), + msecs_to_jiffies(TIMEOUT_MS)); + if (!ret) { + s->expected_opcode = 0; + return -ETIMEDOUT; + } + + if (s->result > 0) { + dev_err(s->dev, "command %#x failed with error %d\n", + hdr->opcode, s->result); + return -EIO; + } + + return 0; +} +EXPORT_SYMBOL_GPL(q6voice_common_send); + +MODULE_AUTHOR("Stephan Gerhold "); +MODULE_DESCRIPTION("Q6Voice common session management"); +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/qcom/qdsp6/q6voice-common.h b/sound/soc/qcom/qdsp6/q6voice-common.h new file mode 100644 index 00000000000000..48735a935c3fbb --- /dev/null +++ b/sound/soc/qcom/qdsp6/q6voice-common.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _Q6_VOICE_COMMON_H +#define _Q6_VOICE_COMMON_H + +#include +#include "q6voice.h" + +enum q6voice_service_type { + Q6VOICE_SERVICE_MVM, + Q6VOICE_SERVICE_CVP, + Q6VOICE_SERVICE_CVS, + Q6VOICE_SERVICE_COUNT +}; + +struct q6voice_service; + +struct q6voice_session { + struct device *dev; + struct q6voice_service *svc; + struct kref refcount; + + u16 port; + u16 handle; + + wait_queue_head_t wait; + + /* Protect expected_opcode and result */ + spinlock_t lock; + u32 expected_opcode; + u32 result; +}; + +int q6voice_common_probe(struct apr_device *adev, enum q6voice_service_type type); +void q6voice_common_remove(struct apr_device *adev); + +int q6voice_common_callback(struct apr_device *adev, const struct apr_resp_pkt *data); +int q6voice_common_send(struct q6voice_session *s, struct apr_hdr *hdr); + +struct q6voice_session *q6voice_session_create(enum q6voice_service_type type, + enum q6voice_path_type path, + struct apr_hdr *hdr); +void q6voice_session_release(struct q6voice_session *s); + +#endif /*_Q6_VOICE_COMMON_H */ diff --git a/sound/soc/qcom/qdsp6/q6voice-dai.c b/sound/soc/qcom/qdsp6/q6voice-dai.c new file mode 100644 index 00000000000000..16af108e0a96f9 --- /dev/null +++ b/sound/soc/qcom/qdsp6/q6voice-dai.c @@ -0,0 +1,458 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +// Copyright (c) 2020, Stephan Gerhold + +#include +#include +#include +#include +#include +#include +#include "q6voice.h" + +#define DRV_NAME "q6voice-dai" + +static enum q6voice_path_type q6voice_get_path(unsigned int dai_id) +{ + switch (dai_id) { + case CS_VOICE: + return Q6VOICE_PATH_VOICE; + case VOICEMMODE1: + return Q6VOICE_PATH_VOICEMMODE1; + } + + return Q6VOICE_PATH_COUNT; +} + +static int q6voice_dai_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct q6voice *v = snd_soc_dai_get_drvdata(dai); + enum q6voice_path_type path = q6voice_get_path(dai->driver->id); + + if (path == Q6VOICE_PATH_COUNT) { + dev_err(dai->dev, "Invalid DAI ID %u\n", dai->driver->id); + return -EINVAL; + } + + return q6voice_start(v, path, substream->stream); +} + +static void q6voice_dai_shutdown(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct q6voice *v = snd_soc_dai_get_drvdata(dai); + enum q6voice_path_type path = q6voice_get_path(dai->driver->id); + + if (path == Q6VOICE_PATH_COUNT) { + dev_err(dai->dev, "Invalid DAI ID %u\n", dai->driver->id); + return; + } + + q6voice_stop(v, path, substream->stream); +} + +static struct snd_soc_dai_ops q6voice_dai_ops = { + .startup = q6voice_dai_startup, + .shutdown = q6voice_dai_shutdown, +}; + +static struct snd_soc_dai_driver q6voice_dais[] = { + { + .id = CS_VOICE, + .name = "CS-VOICE", + /* The constraints here are not really meaningful... */ + .playback = { + .stream_name = "CS-VOICE Playback", + .formats = SNDRV_PCM_FMTBIT_S16_LE, + .rates = SNDRV_PCM_RATE_8000, + .rate_min = 8000, + .rate_max = 8000, + .channels_min = 1, + .channels_max = 1, + }, + .capture = { + .stream_name = "CS-VOICE Capture", + .formats = SNDRV_PCM_FMTBIT_S16_LE, + .rates = SNDRV_PCM_RATE_8000, + .rate_min = 8000, + .rate_max = 8000, + .channels_min = 1, + .channels_max = 1, + }, + .ops = &q6voice_dai_ops, + }, + { + .id = VOICEMMODE1, + .name = "VOICEMMODE1", + .playback = { + .stream_name = "VOICEMMODE1 Playback", + .formats = SNDRV_PCM_FMTBIT_S16_LE, + .rates = SNDRV_PCM_RATE_8000, + .rate_min = 8000, + .rate_max = 8000, + .channels_min = 1, + .channels_max = 1, + }, + .capture = { + .stream_name = "VOICEMMODE1 Capture", + .formats = SNDRV_PCM_FMTBIT_S16_LE, + .rates = SNDRV_PCM_RATE_8000, + .rate_min = 8000, + .rate_max = 8000, + .channels_min = 1, + .channels_max = 1, + }, + .ops = &q6voice_dai_ops, + }, +}; + +/* FIXME: Use codec2codec instead */ +static struct snd_pcm_hardware q6voice_dai_hardware = { + .info = SNDRV_PCM_INFO_INTERLEAVED, + .buffer_bytes_max = 4096 * 2, + .period_bytes_min = 2048, + .period_bytes_max = 4096, + .periods_min = 2, + .periods_max = 4, + .fifo_size = 0, +}; + +static int q6voice_dai_open(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + substream->runtime->hw = q6voice_dai_hardware; + return 0; +} + +static int q6voice_get_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol, bool capture) +{ + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); + struct snd_soc_component *c = snd_soc_dapm_to_component(dapm); + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + struct q6voice *v = snd_soc_component_get_drvdata(c); + enum q6voice_path_type path = q6voice_get_path(mc->shift); + + if (path == Q6VOICE_PATH_COUNT) { + dev_err(c->dev, "Invalid DAI ID %u\n", mc->shift); + return -EINVAL; + } + + ucontrol->value.integer.value[0] = + q6voice_get_port(v, path, capture) == mc->reg; + return 0; +} + +static int q6voice_put_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol, bool capture) +{ + struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol); + struct snd_soc_component *c = snd_soc_dapm_to_component(dapm); + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + struct q6voice *v = snd_soc_component_get_drvdata(c); + bool val = !!ucontrol->value.integer.value[0]; + enum q6voice_path_type path = q6voice_get_path(mc->shift); + + if (path == Q6VOICE_PATH_COUNT) { + dev_err(c->dev, "Invalid DAI ID %u\n", mc->shift); + return -EINVAL; + } + + if (val) + q6voice_set_port(v, path, capture, mc->reg); + else if (q6voice_get_port(v, path, capture) == mc->reg) + q6voice_set_port(v, path, capture, 0); + + snd_soc_dapm_mixer_update_power(dapm, kcontrol, val, NULL); + return 1; +} + +static int q6voice_get_mixer_capture(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) +{ + return q6voice_get_mixer(kcontrol, ucontrol, true); +} + +static int q6voice_get_mixer_playback(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) +{ + return q6voice_get_mixer(kcontrol, ucontrol, false); +} + +static int q6voice_put_mixer_capture(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) +{ + return q6voice_put_mixer(kcontrol, ucontrol, true); +} + +static int q6voice_put_mixer_playback(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) +{ + return q6voice_put_mixer(kcontrol, ucontrol, false); +} + +static int q6voice_get_topology_kctrl(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_component *c = snd_kcontrol_chip(kcontrol); + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + struct q6voice *v = snd_soc_component_get_drvdata(c); + enum q6voice_path_type path = q6voice_get_path(mc->reg); + bool capture = !!mc->shift; + + if (path >= Q6VOICE_PATH_COUNT) { + dev_err(c->dev, "Invalid DAI ID %u\n", mc->reg); + return -EINVAL; + } + + ucontrol->value.integer.value[0] = + q6voice_get_topology(v, path, capture); + + return 0; +} + +static int q6voice_put_topology_kctrl(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_component *c = snd_kcontrol_chip(kcontrol); + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + struct q6voice *v = snd_soc_component_get_drvdata(c); + u32 val = ucontrol->value.integer.value[0]; + enum q6voice_path_type path = q6voice_get_path(mc->reg); + bool capture = !!mc->shift; + + if (path >= Q6VOICE_PATH_COUNT) { + dev_err(c->dev, "Invalid DAI ID %u\n", mc->reg); + return -EINVAL; + } + + q6voice_set_topology(v, path, capture, val); + + return 1; +} + +static const struct snd_kcontrol_new q6voice_kcontrols[] = { + SOC_SINGLE_EXT("VoiceMMode1 TX Topology", VOICEMMODE1, 1, S32_MAX, 0, + q6voice_get_topology_kctrl, q6voice_put_topology_kctrl), + SOC_SINGLE_EXT("VoiceMMode1 RX Topology", VOICEMMODE1, 0, S32_MAX, 0, + q6voice_get_topology_kctrl, q6voice_put_topology_kctrl), +}; + +static const struct snd_kcontrol_new cs_voice_tx_mixer_controls[] = { + SOC_SINGLE_EXT("PRI_MI2S_TX", PRIMARY_MI2S_TX, CS_VOICE, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("SEC_MI2S_TX", SECONDARY_MI2S_TX, CS_VOICE, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("TERT_MI2S_TX", TERTIARY_MI2S_TX, CS_VOICE, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("QUAT_MI2S_TX", QUATERNARY_MI2S_TX, CS_VOICE, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("QUIN_MI2S_TX", QUINARY_MI2S_TX, CS_VOICE, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("SEN_MI2S_TX", SENARY_MI2S_TX, CS_VOICE, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), +}; + +static const struct snd_kcontrol_new voicemmode1_tx_mixer_controls[] = { + SOC_SINGLE_EXT("PRI_MI2S_TX", PRIMARY_MI2S_TX, VOICEMMODE1, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("SEC_MI2S_TX", SECONDARY_MI2S_TX, VOICEMMODE1, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("TERT_MI2S_TX", TERTIARY_MI2S_TX, VOICEMMODE1, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("QUAT_MI2S_TX", QUATERNARY_MI2S_TX, VOICEMMODE1, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("QUIN_MI2S_TX", QUINARY_MI2S_TX, VOICEMMODE1, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("TX_CODEC_DMA_TX_1", TX_CODEC_DMA_TX_1, VOICEMMODE1, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("TX_CODEC_DMA_TX_2", TX_CODEC_DMA_TX_2, VOICEMMODE1, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("TX_CODEC_DMA_TX_3", TX_CODEC_DMA_TX_3, VOICEMMODE1, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("TX_CODEC_DMA_TX_4", TX_CODEC_DMA_TX_4, VOICEMMODE1, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), + SOC_SINGLE_EXT("SEN_MI2S_TX", SENARY_MI2S_TX, VOICEMMODE1, 1, 0, + q6voice_get_mixer_capture, q6voice_put_mixer_capture), +}; + +static const struct snd_kcontrol_new primary_mi2s_rx_mixer_controls[] = { + SOC_SINGLE_EXT("CS-Voice", PRIMARY_MI2S_RX, CS_VOICE, 1, 0, + q6voice_get_mixer_playback, q6voice_put_mixer_playback), + SOC_SINGLE_EXT("VoiceMMode1", PRIMARY_MI2S_RX, VOICEMMODE1, 1, 0, + q6voice_get_mixer_playback, q6voice_put_mixer_playback), +}; + +static const struct snd_kcontrol_new secondary_mi2s_rx_mixer_controls[] = { + SOC_SINGLE_EXT("CS-Voice", SECONDARY_MI2S_RX, CS_VOICE, 1, 0, + q6voice_get_mixer_playback, q6voice_put_mixer_playback), + SOC_SINGLE_EXT("VoiceMMode1", SECONDARY_MI2S_RX, VOICEMMODE1, 1, 0, + q6voice_get_mixer_playback, q6voice_put_mixer_playback), +}; + +static const struct snd_kcontrol_new tertiary_mi2s_rx_mixer_controls[] = { + SOC_SINGLE_EXT("CS-Voice", TERTIARY_MI2S_RX, CS_VOICE, 1, 0, + q6voice_get_mixer_playback, q6voice_put_mixer_playback), + SOC_SINGLE_EXT("VoiceMMode1", TERTIARY_MI2S_RX, VOICEMMODE1, 1, 0, + q6voice_get_mixer_playback, q6voice_put_mixer_playback), +}; + +static const struct snd_kcontrol_new quaternary_mi2s_rx_mixer_controls[] = { + SOC_SINGLE_EXT("CS-Voice", QUATERNARY_MI2S_RX, CS_VOICE, 1, 0, + q6voice_get_mixer_playback, q6voice_put_mixer_playback), + SOC_SINGLE_EXT("VoiceMMode1", QUATERNARY_MI2S_RX, VOICEMMODE1, 1, 0, + q6voice_get_mixer_playback, q6voice_put_mixer_playback), +}; + +static const struct snd_kcontrol_new quinary_mi2s_rx_mixer_controls[] = { + SOC_SINGLE_EXT("CS-Voice", QUINARY_MI2S_RX, CS_VOICE, 1, 0, + q6voice_get_mixer_playback, q6voice_put_mixer_playback), + SOC_SINGLE_EXT("VoiceMMode1", QUINARY_MI2S_RX, VOICEMMODE1, 1, 0, + q6voice_get_mixer_playback, q6voice_put_mixer_playback), +}; + +static const struct snd_kcontrol_new senary_mi2s_rx_mixer_controls[] = { + SOC_SINGLE_EXT("CS-Voice", SENARY_MI2S_RX, CS_VOICE, 1, 0, + q6voice_get_mixer_playback, q6voice_put_mixer_playback), + SOC_SINGLE_EXT("VoiceMMode1", SENARY_MI2S_RX, VOICEMMODE1, 1, 0, + q6voice_get_mixer_playback, q6voice_put_mixer_playback), +}; + +static const struct snd_soc_dapm_widget q6voice_dapm_widgets[] = { + SND_SOC_DAPM_AIF_IN("CS-VOICE_DL1", "CS-VOICE Playback", 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("CS-VOICE_UL1", "CS-VOICE Capture", 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_MIXER("CS-Voice Capture Mixer", SND_SOC_NOPM, 0, 0, + cs_voice_tx_mixer_controls, + ARRAY_SIZE(cs_voice_tx_mixer_controls)), + SND_SOC_DAPM_AIF_IN("VOICEMMODE1_DL1", "VOICEMMODE1 Playback", 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("VOICEMMODE1_UL1", "VOICEMMODE1 Capture", 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_MIXER("VoiceMMode1 Capture Mixer", SND_SOC_NOPM, 0, 0, + voicemmode1_tx_mixer_controls, + ARRAY_SIZE(voicemmode1_tx_mixer_controls)), + SND_SOC_DAPM_MIXER("PRI_MI2S_RX Voice Mixer", SND_SOC_NOPM, 0, 0, + primary_mi2s_rx_mixer_controls, + ARRAY_SIZE(primary_mi2s_rx_mixer_controls)), + SND_SOC_DAPM_MIXER("SEC_MI2S_RX Voice Mixer", SND_SOC_NOPM, 0, 0, + secondary_mi2s_rx_mixer_controls, + ARRAY_SIZE(secondary_mi2s_rx_mixer_controls)), + SND_SOC_DAPM_MIXER("TERT_MI2S_RX Voice Mixer", SND_SOC_NOPM, 0, 0, + tertiary_mi2s_rx_mixer_controls, + ARRAY_SIZE(tertiary_mi2s_rx_mixer_controls)), + SND_SOC_DAPM_MIXER("QUAT_MI2S_RX Voice Mixer", SND_SOC_NOPM, 0, 0, + quaternary_mi2s_rx_mixer_controls, + ARRAY_SIZE(quaternary_mi2s_rx_mixer_controls)), + SND_SOC_DAPM_MIXER("QUIN_MI2S_RX Voice Mixer", SND_SOC_NOPM, 0, 0, + quinary_mi2s_rx_mixer_controls, + ARRAY_SIZE(quinary_mi2s_rx_mixer_controls)), + SND_SOC_DAPM_MIXER("SEN_MI2S_RX Voice Mixer", SND_SOC_NOPM, 0, 0, + senary_mi2s_rx_mixer_controls, + ARRAY_SIZE(senary_mi2s_rx_mixer_controls)), +}; + +static const struct snd_soc_dapm_route q6voice_dapm_routes[] = { + { "CS-Voice Capture Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX" }, + { "CS-Voice Capture Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX" }, + { "CS-Voice Capture Mixer", "TERT_MI2S_TX", "TERT_MI2S_TX" }, + { "CS-Voice Capture Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX" }, + { "CS-Voice Capture Mixer", "QUIN_MI2S_TX", "QUIN_MI2S_TX" }, + { "CS-Voice Capture Mixer", "SEN_MI2S_TX", "SEN_MI2S_TX" }, + { "CS-VOICE_UL1", NULL, "CS-Voice Capture Mixer" }, + { "VoiceMMode1 Capture Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX" }, + { "VoiceMMode1 Capture Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX" }, + { "VoiceMMode1 Capture Mixer", "TERT_MI2S_TX", "TERT_MI2S_TX" }, + { "VoiceMMode1 Capture Mixer", "QUAT_MI2S_TX", "QUAT_MI2S_TX" }, + { "VoiceMMode1 Capture Mixer", "QUIN_MI2S_TX", "QUIN_MI2S_TX" }, + { "VoiceMMode1 Capture Mixer", "TX_CODEC_DMA_TX_1", "TX_CODEC_DMA_TX_1" }, + { "VoiceMMode1 Capture Mixer", "TX_CODEC_DMA_TX_2", "TX_CODEC_DMA_TX_2" }, + { "VoiceMMode1 Capture Mixer", "TX_CODEC_DMA_TX_3", "TX_CODEC_DMA_TX_3" }, + { "VoiceMMode1 Capture Mixer", "TX_CODEC_DMA_TX_4", "TX_CODEC_DMA_TX_4" }, + { "VoiceMMode1 Capture Mixer", "SEN_MI2S_TX", "SEN_MI2S_TX" }, + { "VOICEMMODE1_UL1", NULL, "VoiceMMode1 Capture Mixer" }, + + { "PRI_MI2S_RX Voice Mixer", "CS-Voice", "CS-VOICE_DL1" }, + { "SEC_MI2S_RX Voice Mixer", "CS-Voice", "CS-VOICE_DL1" }, + { "TERT_MI2S_RX Voice Mixer", "CS-Voice", "CS-VOICE_DL1" }, + { "QUAT_MI2S_RX Voice Mixer", "CS-Voice", "CS-VOICE_DL1" }, + { "QUIN_MI2S_RX Voice Mixer", "CS-Voice", "CS-VOICE_DL1" }, + { "SEN_MI2S_RX Voice Mixer", "CS-Voice", "CS-VOICE_DL1" }, + { "PRI_MI2S_RX Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL1" }, + { "SEC_MI2S_RX Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL1" }, + { "TERT_MI2S_RX Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL1" }, + { "QUAT_MI2S_RX Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL1" }, + { "QUIN_MI2S_RX Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL1" }, + { "SEN_MI2S_RX Voice Mixer", "VoiceMMode1", "VOICEMMODE1_DL1" }, + + { "PRI_MI2S_RX", NULL, "PRI_MI2S_RX Voice Mixer" }, + { "SEC_MI2S_RX", NULL, "SEC_MI2S_RX Voice Mixer" }, + { "TERT_MI2S_RX", NULL, "TERT_MI2S_RX Voice Mixer" }, + { "QUAT_MI2S_RX", NULL, "QUAT_MI2S_RX Voice Mixer" }, + { "QUIN_MI2S_RX", NULL, "QUIN_MI2S_RX Voice Mixer" }, + { "SEN_MI2S_RX", NULL, "SEN_MI2S_RX Voice Mixer" }, +}; + +static unsigned int q6voice_reg_read(struct snd_soc_component *component, + unsigned int reg) +{ + /* default value */ + return 0; +} + +static int q6voice_reg_write(struct snd_soc_component *component, + unsigned int reg, unsigned int val) +{ + /* dummy */ + return 0; +} + +static const struct snd_soc_component_driver q6voice_dai_component = { + .name = DRV_NAME, + .open = q6voice_dai_open, + + .controls = q6voice_kcontrols, + .num_controls = ARRAY_SIZE(q6voice_kcontrols), + .dapm_widgets = q6voice_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(q6voice_dapm_widgets), + .dapm_routes = q6voice_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(q6voice_dapm_routes), + .read = q6voice_reg_read, + .write = q6voice_reg_write, + + /* Needs to probe after q6afe */ + .probe_order = SND_SOC_COMP_ORDER_LATE, +}; + +static int q6voice_dai_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct q6voice *v; + struct device_node *np = dev_of_node(dev); + bool cvd_v2_3; + + cvd_v2_3 = of_property_read_bool(np, "qcom,cvd-v2.3"); + + v = q6voice_create(dev, cvd_v2_3); + if (IS_ERR(v)) + return PTR_ERR(v); + + dev_set_drvdata(dev, v); + + return devm_snd_soc_register_component(dev, &q6voice_dai_component, + q6voice_dais, + ARRAY_SIZE(q6voice_dais)); +} + +static const struct of_device_id q6voice_dai_device_id[] = { + { .compatible = "qcom,q6voice-dais" }, + {}, +}; +MODULE_DEVICE_TABLE(of, q6voice_dai_device_id); + +static struct platform_driver q6voice_dai_platform_driver = { + .driver = { + .name = "q6voice-dai", + .of_match_table = of_match_ptr(q6voice_dai_device_id), + }, + .probe = q6voice_dai_probe, +}; +module_platform_driver(q6voice_dai_platform_driver); + +MODULE_AUTHOR("Stephan Gerhold "); +MODULE_DESCRIPTION("Q6Voice DAI driver"); +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/qcom/qdsp6/q6voice.c b/sound/soc/qcom/qdsp6/q6voice.c new file mode 100644 index 00000000000000..bb27cb7c0d0b82 --- /dev/null +++ b/sound/soc/qcom/qdsp6/q6voice.c @@ -0,0 +1,334 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +// Copyright (c) 2020, Stephan Gerhold + +#include +#include +#include +#include +#include +#include "q6afe.h" +#include "q6cvp.h" +#include "q6cvs.h" +#include "q6mvm.h" +#include "q6voice-common.h" + +#define VSS_IVOCPROC_TOPOLOGY_ID_NONE 0x00010F70 +#define VSS_IVOCPROC_TOPOLOGY_ID_TX_SM_ECNS 0x00010F71 +#define VSS_IVOCPROC_TOPOLOGY_ID_RX_DEFAULT 0x00010F77 + +struct q6voice_path_runtime { + struct q6voice_session *sessions[Q6VOICE_SERVICE_COUNT]; + unsigned int started; +}; + +struct q6voice_path { + struct q6voice *v; + + enum q6voice_path_type type; + int tx_port, rx_port; + u32 tx_topo, rx_topo; + /* Serialize access to voice path session */ + struct mutex lock; + struct q6voice_path_runtime *runtime; +}; + +struct q6voice { + struct device *dev; + bool cvd_v2_3; + struct q6voice_path paths[Q6VOICE_PATH_COUNT]; +}; + +static inline struct q6voice_session *session_create(enum q6voice_path_type type, + int tx_port, int rx_port, + u32 tx_topo, u32 rx_topo) +{ + return q6cvp_session_create(type, tx_port, rx_port, tx_topo, rx_topo); +} + +static struct q6voice_session *session_create_v3(enum q6voice_path_type type, + int tx_port, int rx_port, + u32 tx_topo, u32 rx_topo) +{ + struct q6voice_session *cvp; + + cvp = q6cvp_session_create_v3(type, tx_port, rx_port, tx_topo, rx_topo); + if (cvp == NULL) + return NULL; + + q6cvp_send_channel_info(cvp, false); + q6cvp_send_channel_info(cvp, true); + + q6cvp_send_media_format(cvp, rx_port, false); + q6cvp_send_media_format(cvp, tx_port, true); + + q6cvp_topology_commit(cvp); + + return cvp; +} + +static int q6voice_path_start(struct q6voice_path *p) +{ + struct device *dev = p->v->dev; + struct q6voice_session *mvm, *cvp; + int ret; + + dev_dbg(dev, "start path %d\n", p->type); + + mvm = p->runtime->sessions[Q6VOICE_SERVICE_MVM]; + if (!mvm) { + mvm = q6mvm_session_create(p->type); + if (IS_ERR(mvm)) + return PTR_ERR(mvm); + p->runtime->sessions[Q6VOICE_SERVICE_MVM] = mvm; + } + + cvp = p->runtime->sessions[Q6VOICE_SERVICE_CVP]; + if (!cvp) { + if (p->v->cvd_v2_3) + cvp = session_create_v3(p->type, + q6afe_get_port_id(p->tx_port), + q6afe_get_port_id(p->rx_port), + p->tx_topo, p->rx_topo); + else + cvp = session_create(p->type, + q6afe_get_port_id(p->tx_port), + q6afe_get_port_id(p->rx_port), + p->tx_topo, p->rx_topo); + + if (IS_ERR(cvp)) + return PTR_ERR(cvp); + p->runtime->sessions[Q6VOICE_SERVICE_CVP] = cvp; + } + + ret = q6cvp_enable(cvp, true); + if (ret) { + dev_err(dev, "failed to enable cvp: %d\n", ret); + goto cvp_err; + } + + ret = q6mvm_attach(mvm, cvp, true); + if (ret) { + dev_err(dev, "failed to attach cvp to mvm: %d\n", ret); + goto attach_err; + } + + ret = q6mvm_start(mvm, true); + if (ret) { + dev_err(dev, "failed to start voice: %d\n", ret); + goto start_err; + } + + return ret; + +start_err: + q6mvm_start(mvm, false); +attach_err: + q6mvm_attach(mvm, cvp, false); +cvp_err: + q6cvp_enable(cvp, false); + return ret; +} + +int q6voice_start(struct q6voice *v, enum q6voice_path_type path, bool capture) +{ + struct q6voice_path *p = &v->paths[path]; + int ret = 0; + + mutex_lock(&p->lock); + if (!p->runtime) { + p->runtime = kzalloc(sizeof(*p), GFP_KERNEL); + if (!p->runtime) { + ret = -ENOMEM; + goto out; + } + } + + if (p->runtime->started & BIT(capture)) { + ret = -EALREADY; + goto out; + } + + p->runtime->started |= BIT(capture); + + /* FIXME: For now we only start if both RX/TX are active */ + if (p->runtime->started != 3) + goto out; + + ret = q6voice_path_start(p); + if (ret) { + p->runtime->started &= ~BIT(capture); + dev_err(v->dev, "failed to start path %d: %d\n", path, ret); + goto out; + } + +out: + mutex_unlock(&p->lock); + return ret; +} +EXPORT_SYMBOL_GPL(q6voice_start); + +static void q6voice_path_stop(struct q6voice_path *p) +{ + struct device *dev = p->v->dev; + struct q6voice_session *mvm = p->runtime->sessions[Q6VOICE_SERVICE_MVM]; + struct q6voice_session *cvp = p->runtime->sessions[Q6VOICE_SERVICE_CVP]; + int ret; + + dev_dbg(dev, "stop path %d\n", p->type); + + ret = q6mvm_start(mvm, false); + if (ret) + dev_err(dev, "failed to stop voice: %d\n", ret); + + ret = q6mvm_attach(mvm, cvp, false); + if (ret) + dev_err(dev, "failed to detach cvp from mvm: %d\n", ret); + + ret = q6cvp_enable(cvp, false); + if (ret) + dev_err(dev, "failed to disable cvp: %d\n", ret); +} + +static void q6voice_path_destroy(struct q6voice_path *p) +{ + struct q6voice_path_runtime *runtime = p->runtime; + enum q6voice_service_type svc; + + for (svc = 0; svc < Q6VOICE_SERVICE_COUNT; ++svc) { + if (runtime->sessions[svc]) + q6voice_session_release(runtime->sessions[svc]); + } + + p->runtime = NULL; + kfree(runtime); +} + +int q6voice_stop(struct q6voice *v, enum q6voice_path_type path, bool capture) +{ + struct q6voice_path *p = &v->paths[path]; + int ret = 0; + + mutex_lock(&p->lock); + if (!p->runtime || !(p->runtime->started & BIT(capture))) + goto out; + + if (p->runtime->started == 3) + q6voice_path_stop(p); + + p->runtime->started &= ~BIT(capture); + + if (p->runtime->started == 0) + q6voice_path_destroy(p); + +out: + mutex_unlock(&p->lock); + return ret; +} +EXPORT_SYMBOL_GPL(q6voice_stop); + +static void q6voice_free(void *data) +{ + struct q6voice *v = data; + enum q6voice_path_type path; + + for (path = 0; path < Q6VOICE_PATH_COUNT; ++path) { + struct q6voice_path *p = &v->paths[path]; + + mutex_lock(&p->lock); + if (p->runtime) { + dev_warn(v->dev, + "q6voice_remove() called while path %d is active\n", + path); + + if (p->runtime->started == 3) + q6voice_path_stop(p); + q6voice_path_destroy(p); + } + mutex_unlock(&p->lock); + mutex_destroy(&p->lock); + } +} + +struct q6voice *q6voice_create(struct device *dev, bool cvd_v2_3) +{ + struct q6voice *v; + enum q6voice_path_type path; + int ret; + + v = devm_kzalloc(dev, sizeof(*v), GFP_KERNEL); + if (!v) + return ERR_PTR(-ENOMEM); + + v->dev = dev; + v->cvd_v2_3 = cvd_v2_3; + + for (path = 0; path < Q6VOICE_PATH_COUNT; ++path) { + struct q6voice_path *p = &v->paths[path]; + + p->v = v; + p->type = path; + p->tx_topo = VSS_IVOCPROC_TOPOLOGY_ID_NONE; + p->rx_topo = VSS_IVOCPROC_TOPOLOGY_ID_RX_DEFAULT; + mutex_init(&p->lock); + } + + ret = devm_add_action(dev, q6voice_free, v); + if (ret) + return ERR_PTR(ret); + + return v; +} +EXPORT_SYMBOL_GPL(q6voice_create); + +int q6voice_get_port(struct q6voice *v, enum q6voice_path_type path, + bool capture) +{ + struct q6voice_path *p = &v->paths[path]; + + if (capture) + return p->tx_port; + else + return p->rx_port; +} +EXPORT_SYMBOL_GPL(q6voice_get_port); + +void q6voice_set_port(struct q6voice *v, enum q6voice_path_type path, + bool capture, int index) +{ + struct q6voice_path *p = &v->paths[path]; + + if (capture) + p->tx_port = index; + else + p->rx_port = index; +} +EXPORT_SYMBOL_GPL(q6voice_set_port); + +u32 q6voice_get_topology(struct q6voice *v, enum q6voice_path_type path, + bool capture) +{ + struct q6voice_path *p = &v->paths[path]; + + if (capture) + return p->tx_topo; + else + return p->rx_topo; +} +EXPORT_SYMBOL_GPL(q6voice_get_topology); + +void q6voice_set_topology(struct q6voice *v, enum q6voice_path_type path, + bool capture, u32 topo) +{ + struct q6voice_path *p = &v->paths[path]; + + if (capture) + p->tx_topo = topo; + else + p->rx_topo = topo; +} +EXPORT_SYMBOL_GPL(q6voice_set_topology); + +MODULE_AUTHOR("Stephan Gerhold "); +MODULE_DESCRIPTION("Q6Voice driver"); +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/qcom/qdsp6/q6voice.h b/sound/soc/qcom/qdsp6/q6voice.h new file mode 100644 index 00000000000000..3d002a9a5a2773 --- /dev/null +++ b/sound/soc/qcom/qdsp6/q6voice.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _Q6_VOICE_H +#define _Q6_VOICE_H + +enum q6voice_path_type { + Q6VOICE_PATH_VOICE = 0, + Q6VOICE_PATH_VOIP = 1, + Q6VOICE_PATH_VOLTE = 2, + Q6VOICE_PATH_VOICE2 = 3, + Q6VOICE_PATH_QCHAT = 4, + Q6VOICE_PATH_VOWLAN = 5, + Q6VOICE_PATH_VOICEMMODE1 = 6, + Q6VOICE_PATH_VOICEMMODE2 = 7, + Q6VOICE_PATH_COUNT +}; + +struct q6voice; + +struct q6voice *q6voice_create(struct device *dev, bool cvd_v2_3); +int q6voice_start(struct q6voice *v, enum q6voice_path_type path, bool capture); +int q6voice_stop(struct q6voice *v, enum q6voice_path_type path, bool capture); + +int q6voice_get_port(struct q6voice *v, enum q6voice_path_type path, + bool capture); +void q6voice_set_port(struct q6voice *v, enum q6voice_path_type path, + bool capture, int index); + +u32 q6voice_get_topology(struct q6voice *v, enum q6voice_path_type path, + bool capture); +void q6voice_set_topology(struct q6voice *v, enum q6voice_path_type path, + bool capture, u32 topo); + +#endif /*_Q6_VOICE_H */ diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c index e732fac9b8ca05..1f69fba6de26d1 100644 --- a/sound/soc/qcom/qdsp6/topology.c +++ b/sound/soc/qcom/qdsp6/topology.c @@ -952,9 +952,6 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp, struct audioreach_container *cont; struct audioreach_module *mod; - mod = dobj->private; - cont = mod->container; - if (w->id == snd_soc_dapm_mixer) { /* virtual widget */ struct snd_ar_control *scontrol = dobj->private; @@ -963,6 +960,11 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp, kfree(scontrol); return 0; } + mod = dobj->private; + if (!mod) + return 0; + + cont = mod->container; mutex_lock(&apm->lock); idr_remove(&apm->modules_idr, mod->instance_id);