feat(audio): fix audio pop pro
.. | .. |
---|
38 | 38 | <point>33,-5000</point> |
---|
39 | 39 | <point>66,-3000</point> |
---|
40 | 40 | <point>100,0</point> --> |
---|
41 | | - <point>1,-4000</point> |
---|
42 | | - <point>33,-3000</point> |
---|
43 | | - <point>66,-1700</point> |
---|
| 41 | + <point>1,-3500</point> |
---|
44 | 42 | <point>100,0</point> |
---|
45 | 43 | </reference> |
---|
46 | 44 | <reference name="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"> |
---|
.. | .. |
---|
991 | 991 | lineout_vol = <0x1a>; |
---|
992 | 992 | headphonegain = <0x00>; |
---|
993 | 993 | /* Pa enabled about */ |
---|
994 | | - pa_level = <0x00>; |
---|
| 994 | + pa_level = <0x01>; |
---|
995 | 995 | pa_msleep_time = <0x78>; |
---|
996 | | - //gpio-spk = <&pio PB 7 1 1 1 1>; |
---|
| 996 | + gpio-spk = <&pio PB 7 1 1 1 1>; |
---|
997 | 997 | /* regulator about */ |
---|
998 | 998 | avcc-supply = <®_aldo1>; |
---|
999 | 999 | cpvin-supply = <®_eldo1>; |
---|
.. | .. |
---|
1361 | 1361 | linux,default_trigger = "heartbeat"; |
---|
1362 | 1362 | }; |
---|
1363 | 1363 | |
---|
1364 | | - spk_en { |
---|
1365 | | - label = "spk_en"; |
---|
1366 | | - gpios = <&pio PB 7 1 0 1 0>; |
---|
1367 | | - linux,default_trigger = "default-on"; |
---|
1368 | | - }; |
---|
| 1364 | + // spk_en { |
---|
| 1365 | + // label = "spk_en"; |
---|
| 1366 | + // gpios = <&pio PB 7 1 0 1 0>; |
---|
| 1367 | + // linux,default_trigger = "default-on"; |
---|
| 1368 | + // }; |
---|
1369 | 1369 | |
---|
1370 | 1370 | fan_en { |
---|
1371 | 1371 | label = "fan_en"; |
---|
.. | .. |
---|
972 | 972 | lineout_vol = <0x1a>; |
---|
973 | 973 | headphonegain = <0x00>; |
---|
974 | 974 | /* Pa enabled about */ |
---|
975 | | - pa_level = <0x00>; |
---|
| 975 | + pa_level = <0x01>; |
---|
976 | 976 | pa_msleep_time = <0x78>; |
---|
977 | | - //gpio-spk = <&pio PB 7 1 1 1 1>; |
---|
| 977 | + gpio-spk = <&pio PB 7 1 1 1 1>; |
---|
978 | 978 | /* regulator about */ |
---|
979 | 979 | avcc-supply = <®_aldo1>; |
---|
980 | 980 | cpvin-supply = <®_eldo1>; |
---|
.. | .. |
---|
1346 | 1346 | linux,default_trigger = "heartbeat"; |
---|
1347 | 1347 | }; |
---|
1348 | 1348 | |
---|
1349 | | - spk_en { |
---|
1350 | | - label = "spk_en"; |
---|
1351 | | - gpios = <&pio PB 7 1 0 1 0>; |
---|
1352 | | - linux,default_trigger = "default-on"; |
---|
1353 | | - }; |
---|
| 1349 | + // spk_en { |
---|
| 1350 | + // label = "spk_en"; |
---|
| 1351 | + // gpios = <&pio PB 7 1 0 1 0>; |
---|
| 1352 | + // linux,default_trigger = "default-on"; |
---|
| 1353 | + // }; |
---|
1354 | 1354 | |
---|
1355 | 1355 | fan_en { |
---|
1356 | 1356 | label = "fan_en"; |
---|
.. | .. |
---|
888 | 888 | 0xFF, 0, adc_vol_tlv), |
---|
889 | 889 | /* Headphone Gain */ |
---|
890 | 890 | SOC_SINGLE_TLV("headphone gain", SUNXI_DAC_REG, HEADPHONE_GAIN, |
---|
891 | | - 0x7, 1, headphone_gain_tlv), |
---|
| 891 | + 0x0, 1, headphone_gain_tlv), |
---|
892 | 892 | |
---|
893 | 893 | SOC_SINGLE_BOOL_EXT("audiocodec rx_sync switch", 0, |
---|
894 | 894 | sunxi_codec_rx_sync_get_data, sunxi_codec_rx_sync_put_data), |
---|
.. | .. |
---|
1333 | 1333 | int cmd, struct snd_soc_dai *dai) |
---|
1334 | 1334 | { |
---|
1335 | 1335 | struct sunxi_codec_info *sunxi_codec = snd_soc_codec_get_drvdata(dai->codec); |
---|
| 1336 | + struct codec_spk_config *spk_cfg = &(sunxi_codec->spk_config); |
---|
1336 | 1337 | |
---|
1337 | 1338 | switch (cmd) { |
---|
1338 | 1339 | case SNDRV_PCM_TRIGGER_START: |
---|
.. | .. |
---|
1347 | 1348 | if (sunxi_codec->rx_sync_en) |
---|
1348 | 1349 | sunxi_rx_sync_control(RX_SYNC_AUDIOCODEC, 1); |
---|
1349 | 1350 | } |
---|
| 1351 | + |
---|
| 1352 | + if (spk_cfg->used) { |
---|
| 1353 | + gpio_set_value(spk_cfg->spk_gpio, spk_cfg->pa_level); |
---|
| 1354 | + /* time delay to wait spk pa work fine */ |
---|
| 1355 | + // msleep(spk_cfg->pa_msleep); |
---|
| 1356 | + } |
---|
1350 | 1357 | break; |
---|
1351 | 1358 | case SNDRV_PCM_TRIGGER_STOP: |
---|
1352 | 1359 | case SNDRV_PCM_TRIGGER_SUSPEND: |
---|
1353 | 1360 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
---|
| 1361 | + if (spk_cfg->used) |
---|
| 1362 | + gpio_set_value(spk_cfg->spk_gpio, !(spk_cfg->pa_level)); |
---|
| 1363 | + |
---|
1354 | 1364 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
---|
1355 | 1365 | regmap_update_bits(sunxi_codec->regmap, SUNXI_DAC_FIFOC, |
---|
1356 | 1366 | (1 << DAC_DRQ_EN), (0 << DAC_DRQ_EN)); |
---|