diff options
| -rw-r--r-- | sound/soc/codecs/pcm186x.c | 8 | ||||
| -rw-r--r-- | sound/soc/codecs/wm_adsp.c | 38 | ||||
| -rw-r--r-- | sound/soc/sh/rcar/gen.c | 24 | ||||
| -rw-r--r-- | sound/soc/sh/rcar/rsnd.h | 27 | ||||
| -rw-r--r-- | sound/soc/sh/rcar/ssiu.c | 24 |
5 files changed, 87 insertions, 34 deletions
diff --git a/sound/soc/codecs/pcm186x.c b/sound/soc/codecs/pcm186x.c index 809b7e9f03ca..c5fcc632f670 100644 --- a/sound/soc/codecs/pcm186x.c +++ b/sound/soc/codecs/pcm186x.c | |||
| @@ -42,7 +42,7 @@ struct pcm186x_priv { | |||
| 42 | bool is_master_mode; | 42 | bool is_master_mode; |
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | static const DECLARE_TLV_DB_SCALE(pcm186x_pga_tlv, -1200, 4000, 50); | 45 | static const DECLARE_TLV_DB_SCALE(pcm186x_pga_tlv, -1200, 50, 0); |
| 46 | 46 | ||
| 47 | static const struct snd_kcontrol_new pcm1863_snd_controls[] = { | 47 | static const struct snd_kcontrol_new pcm1863_snd_controls[] = { |
| 48 | SOC_DOUBLE_R_S_TLV("ADC Capture Volume", PCM186X_PGA_VAL_CH1_L, | 48 | SOC_DOUBLE_R_S_TLV("ADC Capture Volume", PCM186X_PGA_VAL_CH1_L, |
| @@ -158,7 +158,7 @@ static const struct snd_soc_dapm_widget pcm1863_dapm_widgets[] = { | |||
| 158 | * Put the codec into SLEEP mode when not in use, allowing the | 158 | * Put the codec into SLEEP mode when not in use, allowing the |
| 159 | * Energysense mechanism to operate. | 159 | * Energysense mechanism to operate. |
| 160 | */ | 160 | */ |
| 161 | SND_SOC_DAPM_ADC("ADC", "HiFi Capture", PCM186X_POWER_CTRL, 1, 0), | 161 | SND_SOC_DAPM_ADC("ADC", "HiFi Capture", PCM186X_POWER_CTRL, 1, 1), |
| 162 | }; | 162 | }; |
| 163 | 163 | ||
| 164 | static const struct snd_soc_dapm_widget pcm1865_dapm_widgets[] = { | 164 | static const struct snd_soc_dapm_widget pcm1865_dapm_widgets[] = { |
| @@ -184,8 +184,8 @@ static const struct snd_soc_dapm_widget pcm1865_dapm_widgets[] = { | |||
| 184 | * Put the codec into SLEEP mode when not in use, allowing the | 184 | * Put the codec into SLEEP mode when not in use, allowing the |
| 185 | * Energysense mechanism to operate. | 185 | * Energysense mechanism to operate. |
| 186 | */ | 186 | */ |
| 187 | SND_SOC_DAPM_ADC("ADC1", "HiFi Capture 1", PCM186X_POWER_CTRL, 1, 0), | 187 | SND_SOC_DAPM_ADC("ADC1", "HiFi Capture 1", PCM186X_POWER_CTRL, 1, 1), |
| 188 | SND_SOC_DAPM_ADC("ADC2", "HiFi Capture 2", PCM186X_POWER_CTRL, 1, 0), | 188 | SND_SOC_DAPM_ADC("ADC2", "HiFi Capture 2", PCM186X_POWER_CTRL, 1, 1), |
| 189 | }; | 189 | }; |
| 190 | 190 | ||
| 191 | static const struct snd_soc_dapm_route pcm1863_dapm_routes[] = { | 191 | static const struct snd_soc_dapm_route pcm1863_dapm_routes[] = { |
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 8077c18cbcdf..b93fdc8d2d6f 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c | |||
| @@ -3529,6 +3529,23 @@ static int wm_adsp_buffer_free(struct wm_adsp *dsp) | |||
| 3529 | return 0; | 3529 | return 0; |
| 3530 | } | 3530 | } |
| 3531 | 3531 | ||
| 3532 | static int wm_adsp_buffer_get_error(struct wm_adsp_compr_buf *buf) | ||
| 3533 | { | ||
| 3534 | int ret; | ||
| 3535 | |||
| 3536 | ret = wm_adsp_buffer_read(buf, HOST_BUFFER_FIELD(error), &buf->error); | ||
| 3537 | if (ret < 0) { | ||
| 3538 | adsp_err(buf->dsp, "Failed to check buffer error: %d\n", ret); | ||
| 3539 | return ret; | ||
| 3540 | } | ||
| 3541 | if (buf->error != 0) { | ||
| 3542 | adsp_err(buf->dsp, "Buffer error occurred: %d\n", buf->error); | ||
| 3543 | return -EIO; | ||
| 3544 | } | ||
| 3545 | |||
| 3546 | return 0; | ||
| 3547 | } | ||
| 3548 | |||
| 3532 | int wm_adsp_compr_trigger(struct snd_compr_stream *stream, int cmd) | 3549 | int wm_adsp_compr_trigger(struct snd_compr_stream *stream, int cmd) |
| 3533 | { | 3550 | { |
| 3534 | struct wm_adsp_compr *compr = stream->runtime->private_data; | 3551 | struct wm_adsp_compr *compr = stream->runtime->private_data; |
| @@ -3550,6 +3567,10 @@ int wm_adsp_compr_trigger(struct snd_compr_stream *stream, int cmd) | |||
| 3550 | } | 3567 | } |
| 3551 | } | 3568 | } |
| 3552 | 3569 | ||
| 3570 | ret = wm_adsp_buffer_get_error(compr->buf); | ||
| 3571 | if (ret < 0) | ||
| 3572 | break; | ||
| 3573 | |||
| 3553 | wm_adsp_buffer_clear(compr->buf); | 3574 | wm_adsp_buffer_clear(compr->buf); |
| 3554 | 3575 | ||
| 3555 | /* Trigger the IRQ at one fragment of data */ | 3576 | /* Trigger the IRQ at one fragment of data */ |
| @@ -3625,23 +3646,6 @@ static int wm_adsp_buffer_update_avail(struct wm_adsp_compr_buf *buf) | |||
| 3625 | return 0; | 3646 | return 0; |
| 3626 | } | 3647 | } |
| 3627 | 3648 | ||
| 3628 | static int wm_adsp_buffer_get_error(struct wm_adsp_compr_buf *buf) | ||
| 3629 | { | ||
| 3630 | int ret; | ||
| 3631 | |||
| 3632 | ret = wm_adsp_buffer_read(buf, HOST_BUFFER_FIELD(error), &buf->error); | ||
| 3633 | if (ret < 0) { | ||
| 3634 | compr_err(buf, "Failed to check buffer error: %d\n", ret); | ||
| 3635 | return ret; | ||
| 3636 | } | ||
| 3637 | if (buf->error != 0) { | ||
| 3638 | compr_err(buf, "Buffer error occurred: %d\n", buf->error); | ||
| 3639 | return -EIO; | ||
| 3640 | } | ||
| 3641 | |||
| 3642 | return 0; | ||
| 3643 | } | ||
| 3644 | |||
| 3645 | int wm_adsp_compr_handle_irq(struct wm_adsp *dsp) | 3649 | int wm_adsp_compr_handle_irq(struct wm_adsp *dsp) |
| 3646 | { | 3650 | { |
| 3647 | struct wm_adsp_compr_buf *buf; | 3651 | struct wm_adsp_compr_buf *buf; |
diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index 7cda60188f41..af19010b9d88 100644 --- a/sound/soc/sh/rcar/gen.c +++ b/sound/soc/sh/rcar/gen.c | |||
| @@ -255,6 +255,30 @@ static int rsnd_gen2_probe(struct rsnd_priv *priv) | |||
| 255 | RSND_GEN_M_REG(SSI_MODE, 0xc, 0x80), | 255 | RSND_GEN_M_REG(SSI_MODE, 0xc, 0x80), |
| 256 | RSND_GEN_M_REG(SSI_CTRL, 0x10, 0x80), | 256 | RSND_GEN_M_REG(SSI_CTRL, 0x10, 0x80), |
| 257 | RSND_GEN_M_REG(SSI_INT_ENABLE, 0x18, 0x80), | 257 | RSND_GEN_M_REG(SSI_INT_ENABLE, 0x18, 0x80), |
| 258 | RSND_GEN_S_REG(SSI9_BUSIF0_MODE, 0x48c), | ||
| 259 | RSND_GEN_S_REG(SSI9_BUSIF0_ADINR, 0x484), | ||
| 260 | RSND_GEN_S_REG(SSI9_BUSIF0_DALIGN, 0x488), | ||
| 261 | RSND_GEN_S_REG(SSI9_BUSIF1_MODE, 0x4a0), | ||
| 262 | RSND_GEN_S_REG(SSI9_BUSIF1_ADINR, 0x4a4), | ||
| 263 | RSND_GEN_S_REG(SSI9_BUSIF1_DALIGN, 0x4a8), | ||
| 264 | RSND_GEN_S_REG(SSI9_BUSIF2_MODE, 0x4c0), | ||
| 265 | RSND_GEN_S_REG(SSI9_BUSIF2_ADINR, 0x4c4), | ||
| 266 | RSND_GEN_S_REG(SSI9_BUSIF2_DALIGN, 0x4c8), | ||
| 267 | RSND_GEN_S_REG(SSI9_BUSIF3_MODE, 0x4e0), | ||
| 268 | RSND_GEN_S_REG(SSI9_BUSIF3_ADINR, 0x4e4), | ||
| 269 | RSND_GEN_S_REG(SSI9_BUSIF3_DALIGN, 0x4e8), | ||
| 270 | RSND_GEN_S_REG(SSI9_BUSIF4_MODE, 0xd80), | ||
| 271 | RSND_GEN_S_REG(SSI9_BUSIF4_ADINR, 0xd84), | ||
| 272 | RSND_GEN_S_REG(SSI9_BUSIF4_DALIGN, 0xd88), | ||
| 273 | RSND_GEN_S_REG(SSI9_BUSIF5_MODE, 0xda0), | ||
| 274 | RSND_GEN_S_REG(SSI9_BUSIF5_ADINR, 0xda4), | ||
| 275 | RSND_GEN_S_REG(SSI9_BUSIF5_DALIGN, 0xda8), | ||
| 276 | RSND_GEN_S_REG(SSI9_BUSIF6_MODE, 0xdc0), | ||
| 277 | RSND_GEN_S_REG(SSI9_BUSIF6_ADINR, 0xdc4), | ||
| 278 | RSND_GEN_S_REG(SSI9_BUSIF6_DALIGN, 0xdc8), | ||
| 279 | RSND_GEN_S_REG(SSI9_BUSIF7_MODE, 0xde0), | ||
| 280 | RSND_GEN_S_REG(SSI9_BUSIF7_ADINR, 0xde4), | ||
| 281 | RSND_GEN_S_REG(SSI9_BUSIF7_DALIGN, 0xde8), | ||
| 258 | }; | 282 | }; |
| 259 | 283 | ||
| 260 | static const struct rsnd_regmap_field_conf conf_scu[] = { | 284 | static const struct rsnd_regmap_field_conf conf_scu[] = { |
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 605e4b934982..90625c57847b 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h | |||
| @@ -191,6 +191,30 @@ enum rsnd_reg { | |||
| 191 | SSI_SYS_STATUS7, | 191 | SSI_SYS_STATUS7, |
| 192 | HDMI0_SEL, | 192 | HDMI0_SEL, |
| 193 | HDMI1_SEL, | 193 | HDMI1_SEL, |
| 194 | SSI9_BUSIF0_MODE, | ||
| 195 | SSI9_BUSIF1_MODE, | ||
| 196 | SSI9_BUSIF2_MODE, | ||
| 197 | SSI9_BUSIF3_MODE, | ||
| 198 | SSI9_BUSIF4_MODE, | ||
| 199 | SSI9_BUSIF5_MODE, | ||
| 200 | SSI9_BUSIF6_MODE, | ||
| 201 | SSI9_BUSIF7_MODE, | ||
| 202 | SSI9_BUSIF0_ADINR, | ||
| 203 | SSI9_BUSIF1_ADINR, | ||
| 204 | SSI9_BUSIF2_ADINR, | ||
| 205 | SSI9_BUSIF3_ADINR, | ||
| 206 | SSI9_BUSIF4_ADINR, | ||
| 207 | SSI9_BUSIF5_ADINR, | ||
| 208 | SSI9_BUSIF6_ADINR, | ||
| 209 | SSI9_BUSIF7_ADINR, | ||
| 210 | SSI9_BUSIF0_DALIGN, | ||
| 211 | SSI9_BUSIF1_DALIGN, | ||
| 212 | SSI9_BUSIF2_DALIGN, | ||
| 213 | SSI9_BUSIF3_DALIGN, | ||
| 214 | SSI9_BUSIF4_DALIGN, | ||
| 215 | SSI9_BUSIF5_DALIGN, | ||
| 216 | SSI9_BUSIF6_DALIGN, | ||
| 217 | SSI9_BUSIF7_DALIGN, | ||
| 194 | 218 | ||
| 195 | /* SSI */ | 219 | /* SSI */ |
| 196 | SSICR, | 220 | SSICR, |
| @@ -209,6 +233,9 @@ enum rsnd_reg { | |||
| 209 | #define SSI_BUSIF_MODE(i) (SSI_BUSIF0_MODE + (i)) | 233 | #define SSI_BUSIF_MODE(i) (SSI_BUSIF0_MODE + (i)) |
| 210 | #define SSI_BUSIF_ADINR(i) (SSI_BUSIF0_ADINR + (i)) | 234 | #define SSI_BUSIF_ADINR(i) (SSI_BUSIF0_ADINR + (i)) |
| 211 | #define SSI_BUSIF_DALIGN(i) (SSI_BUSIF0_DALIGN + (i)) | 235 | #define SSI_BUSIF_DALIGN(i) (SSI_BUSIF0_DALIGN + (i)) |
| 236 | #define SSI9_BUSIF_MODE(i) (SSI9_BUSIF0_MODE + (i)) | ||
| 237 | #define SSI9_BUSIF_ADINR(i) (SSI9_BUSIF0_ADINR + (i)) | ||
| 238 | #define SSI9_BUSIF_DALIGN(i) (SSI9_BUSIF0_DALIGN + (i)) | ||
| 212 | #define SSI_SYS_STATUS(i) (SSI_SYS_STATUS0 + (i)) | 239 | #define SSI_SYS_STATUS(i) (SSI_SYS_STATUS0 + (i)) |
| 213 | 240 | ||
| 214 | 241 | ||
diff --git a/sound/soc/sh/rcar/ssiu.c b/sound/soc/sh/rcar/ssiu.c index c74991dd18ab..2347f3404c06 100644 --- a/sound/soc/sh/rcar/ssiu.c +++ b/sound/soc/sh/rcar/ssiu.c | |||
| @@ -181,28 +181,26 @@ static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod, | |||
| 181 | if (rsnd_ssi_use_busif(io)) { | 181 | if (rsnd_ssi_use_busif(io)) { |
| 182 | int id = rsnd_mod_id(mod); | 182 | int id = rsnd_mod_id(mod); |
| 183 | int busif = rsnd_mod_id_sub(mod); | 183 | int busif = rsnd_mod_id_sub(mod); |
| 184 | enum rsnd_reg adinr_reg, mode_reg, dalign_reg; | ||
| 184 | 185 | ||
| 185 | /* | ||
| 186 | * FIXME | ||
| 187 | * | ||
| 188 | * We can't support SSI9-4/5/6/7, because its address is | ||
| 189 | * out of calculation rule | ||
| 190 | */ | ||
| 191 | if ((id == 9) && (busif >= 4)) { | ||
