void shooter_u_enable_beats(int en) { pr_aud_info("%s: %d\n", __func__, en); if (en) adie_codec_set_device_analog_volume(NULL, 2, 0x04); else adie_codec_set_device_analog_volume(NULL, 2, 0x14); }
static int snddev_icodec_set_device_volume_impl( struct msm_snddev_info *dev_info, u32 volume) { struct snddev_icodec_state *icodec; int rc = 0; icodec = dev_info->private_data; if (icodec->data->dev_vol_type & SNDDEV_DEV_VOL_DIGITAL) { rc = adie_codec_set_device_digital_volume(icodec->adie_path, icodec->data->channel_mode, volume); if (rc < 0) { pr_err("%s: unable to set_device_digital_volume for" "%s volume in percentage = %u\n", __func__, dev_info->name, volume); return rc; } } else if (icodec->data->dev_vol_type & SNDDEV_DEV_VOL_ANALOG) { rc = adie_codec_set_device_analog_volume(icodec->adie_path, icodec->data->channel_mode, volume); if (rc < 0) { pr_err("%s: unable to set_device_analog_volume for" "%s volume in percentage = %u\n", __func__, dev_info->name, volume); return rc; } } else { pr_err("%s: Invalid device volume control\n", __func__); return -EPERM; } return rc; }
static void audio_work_func(struct work_struct *work) { int en = atomic_read(&beats_enabled); int gain; pr_aud_info("%s: %d\n", __func__, en); if (en) { for (gain = 0x10; gain >= 0x4; gain -= 0x4) { adie_codec_set_device_analog_volume(NULL, 2, gain); if (gain > 0x4) mdelay(50); } } else { for (gain = 0x08; gain <= 0x14; gain += 0x4) { adie_codec_set_device_analog_volume(NULL, 2, gain); if (gain < 0x14) mdelay(30); } } }
static int snddev_icodec_set_device_volume_impl( struct msm_snddev_info *dev_info, u32 volume) { struct snddev_icodec_state *icodec; u8 afe_path_id; int rc = 0; icodec = dev_info->private_data; if (icodec->data->capability & SNDDEV_CAP_RX) { if (support_aic3254) return rc; afe_path_id = AFE_HW_PATH_CODEC_RX; } else afe_path_id = AFE_HW_PATH_CODEC_TX; if (icodec->data->dev_vol_type & SNDDEV_DEV_VOL_DIGITAL) { if (support_adie) { rc = adie_codec_set_device_digital_volume(icodec->adie_path, icodec->data->channel_mode == REAL_STEREO_CHANNEL_MODE ? 2 : icodec->data->channel_mode, volume); if (rc < 0) { MM_AUD_ERR("%s: unable to set_device_digital_volume for" "%s volume in percentage = %u\n", __func__, dev_info->name, volume); return rc; } } } else if (icodec->data->dev_vol_type & SNDDEV_DEV_VOL_ANALOG) { if (support_adie) { rc = adie_codec_set_device_analog_volume(icodec->adie_path, icodec->data->channel_mode == REAL_STEREO_CHANNEL_MODE ? 2 : icodec->data->channel_mode, volume); if (rc < 0) { MM_AUD_ERR("%s: unable to set_device_analog_volume for" "%s volume in percentage = %u\n", __func__, dev_info->name, volume); return rc; } } } else { MM_AUD_ERR("%s: Invalid device volume control\n", __func__); return -EPERM; } return rc; }
static int snddev_icodec_set_device_volume_impl( struct msm_snddev_info *dev_info, u32 volume) { struct snddev_icodec_state *icodec; u8 afe_path_id; int rc = 0; icodec = dev_info->private_data; if (icodec->data->capability & SNDDEV_CAP_RX) afe_path_id = AFE_HW_PATH_CODEC_RX; else afe_path_id = AFE_HW_PATH_CODEC_TX; if (icodec->data->dev_vol_type & SNDDEV_DEV_VOL_DIGITAL) { rc = adie_codec_set_device_digital_volume(icodec->adie_path, icodec->data->channel_mode, volume); if (rc < 0) { MM_ERR("unable to set_device_digital_volume for" "%s volume in percentage = %u\n", dev_info->name, volume); return rc; } } else if (icodec->data->dev_vol_type & SNDDEV_DEV_VOL_ANALOG) { rc = adie_codec_set_device_analog_volume(icodec->adie_path, icodec->data->channel_mode, volume); if (rc < 0) { MM_ERR("unable to set_device_analog_volume for" "%s volume in percentage = %u\n", dev_info->name, volume); return rc; } } else { MM_ERR("Invalid device volume control\n"); return -EPERM; } return rc; }