static int msm_device_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 1; /* Device */ uinfo->value.integer.min = 0; uinfo->value.integer.max = msm_snddev_devcount(); return 0; }
static int pcm_route_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; /* * First parameter is session id ~ subdevice number * Second parameter is device id. */ uinfo->count = 3; uinfo->value.integer.min = 0; uinfo->value.integer.max = msm_snddev_devcount(); return 0; }
static int msm_new_mixer(struct snd_soc_codec *codec) { unsigned int idx; int err; int dev_cnt; strcpy(codec->card->snd_card->mixername, "MSM Mixer"); for (idx = 0; idx < ARRAY_SIZE(snd_msm_controls); idx++) { err = snd_ctl_add(codec->card->snd_card, snd_ctl_new1(&snd_msm_controls[idx], NULL)); if (err < 0) pr_err("%s:ERR adding ctl\n", __func__); } for (idx = 0; idx < ARRAY_SIZE(snd_msm_secondary_controls); idx++) { err = snd_ctl_add(codec->card->snd_card, snd_ctl_new1(&snd_msm_secondary_controls[idx], NULL)); if (err < 0) pr_err("%s:ERR adding secondary ctl\n", __func__); } dev_cnt = msm_snddev_devcount(); for (idx = 0; idx < dev_cnt; idx++) { if (!snd_dev_ctl_index(idx)) { err = snd_ctl_add(codec->card->snd_card, snd_ctl_new1(&snd_dev_controls[idx], NULL)); if (err < 0) pr_err("%s:ERR adding ctl\n", __func__); } else return 0; } simple_control = ARRAY_SIZE(snd_msm_controls) + ARRAY_SIZE(snd_msm_secondary_controls); device_index = simple_control + 1; return 0; }
static int msm_new_mixer(struct snd_card *card) { unsigned int idx; int err; int dev_cnt; strcpy(card->mixername, "MSM Mixer"); for (idx = 0; idx < ARRAY_SIZE(snd_msm_controls); idx++) { err = snd_ctl_add(card, snd_ctl_new1(&snd_msm_controls[idx], NULL)); if (err < 0) MM_ERR("ERR adding ctl 1\n"); } for(idx=0;idx < ARRAY_SIZE(snd_lb_controls); idx++){ err = snd_ctl_add(card, snd_ctl_new1(&snd_lb_controls[idx], NULL)); if (err < 0) MM_ERR("ERR adding ctl 2\n"); } dev_cnt = msm_snddev_devcount(); for (idx = 0; idx < dev_cnt; idx++) { if (!snd_dev_ctl_index(idx)) { err = snd_ctl_add(card, snd_ctl_new1( &snd_dev_controls[idx], NULL)); if (err < 0) MM_ERR("ERR adding ctl\n"); } else return 0; } simple_control = ARRAY_SIZE(snd_msm_controls)+ARRAY_SIZE(snd_lb_controls); device_index = simple_control + 1; return 0; }