Loading include/sound/control.h +6 −1 Original line number Diff line number Diff line Loading @@ -31,10 +31,15 @@ typedef int (snd_kcontrol_info_t) (struct snd_kcontrol * kcontrol, struct snd_ct typedef int (snd_kcontrol_get_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); typedef int (snd_kcontrol_put_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); typedef int (snd_kcontrol_tlv_rw_t)(struct snd_kcontrol *kcontrol, int op_flag, /* 0=read,1=write,-1=command */ int op_flag, /* SNDRV_CTL_TLV_OP_XXX */ unsigned int size, unsigned int __user *tlv); enum { SNDRV_CTL_TLV_OP_READ = 0, SNDRV_CTL_TLV_OP_WRITE = 1, SNDRV_CTL_TLV_OP_CMD = -1, }; struct snd_kcontrol_new { snd_ctl_elem_iface_t iface; /* interface identifier */ Loading include/sound/soc.h +13 −1 Original line number Diff line number Diff line Loading @@ -272,7 +272,14 @@ .get = xhandler_get, .put = xhandler_put, \ .private_value = (unsigned long)&(struct soc_bytes_ext) \ {.max = xcount} } #define SND_SOC_BYTES_TLV(xname, xcount, xhandler_get, xhandler_put) \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ .access = SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE | \ SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, \ .tlv.c = (snd_soc_bytes_tlv_callback), \ .info = snd_soc_info_bytes_ext, \ .private_value = (unsigned long)&(struct soc_bytes_ext) \ {.max = xcount, .get = xhandler_get, .put = xhandler_put, } } #define SOC_SINGLE_XR_SX(xname, xregbase, xregcount, xnbits, \ xmin, xmax, xinvert) \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ Loading Loading @@ -560,6 +567,8 @@ int snd_soc_bytes_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); int snd_soc_bytes_info_ext(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *ucontrol); int snd_soc_bytes_tlv_callback(struct snd_kcontrol *kcontrol, int op_flag, unsigned int size, unsigned int __user *tlv); int snd_soc_info_xr_sx(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo); int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol, Loading Loading @@ -1132,6 +1141,9 @@ struct soc_bytes { struct soc_bytes_ext { int max; /* used for TLV byte control */ int (*get)(unsigned int __user *bytes, unsigned int size); int (*put)(const unsigned int __user *bytes, unsigned int size); }; /* multi register control */ Loading sound/core/control.c +3 −3 Original line number Diff line number Diff line Loading @@ -1406,11 +1406,11 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg case SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS: return snd_ctl_subscribe_events(ctl, ip); case SNDRV_CTL_IOCTL_TLV_READ: return snd_ctl_tlv_ioctl(ctl, argp, 0); return snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_READ); case SNDRV_CTL_IOCTL_TLV_WRITE: return snd_ctl_tlv_ioctl(ctl, argp, 1); return snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_WRITE); case SNDRV_CTL_IOCTL_TLV_COMMAND: return snd_ctl_tlv_ioctl(ctl, argp, -1); return snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_CMD); case SNDRV_CTL_IOCTL_POWER: return -ENOPROTOOPT; case SNDRV_CTL_IOCTL_POWER_STATE: Loading sound/soc/codecs/Kconfig +3 −1 Original line number Diff line number Diff line Loading @@ -564,7 +564,9 @@ config SND_SOC_TLV320AIC26 depends on SPI config SND_SOC_TLV320AIC31XX tristate tristate "Texas Instruments TLV320AIC31xx CODECs" depends on I2C select REGMAP_I2C config SND_SOC_TLV320AIC32X4 tristate Loading sound/soc/codecs/tlv320aic23.c +5 −5 Original line number Diff line number Diff line Loading @@ -364,16 +364,16 @@ static int tlv320aic23_hw_params(struct snd_pcm_substream *substream, iface_reg = snd_soc_read(codec, TLV320AIC23_DIGT_FMT) & ~(0x03 << 2); switch (params_format(params)) { case SNDRV_PCM_FORMAT_S16_LE: switch (params_width(params)) { case 16: break; case SNDRV_PCM_FORMAT_S20_3LE: case 20: iface_reg |= (0x01 << 2); break; case SNDRV_PCM_FORMAT_S24_LE: case 24: iface_reg |= (0x02 << 2); break; case SNDRV_PCM_FORMAT_S32_LE: case 32: iface_reg |= (0x03 << 2); break; } Loading Loading
include/sound/control.h +6 −1 Original line number Diff line number Diff line Loading @@ -31,10 +31,15 @@ typedef int (snd_kcontrol_info_t) (struct snd_kcontrol * kcontrol, struct snd_ct typedef int (snd_kcontrol_get_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); typedef int (snd_kcontrol_put_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); typedef int (snd_kcontrol_tlv_rw_t)(struct snd_kcontrol *kcontrol, int op_flag, /* 0=read,1=write,-1=command */ int op_flag, /* SNDRV_CTL_TLV_OP_XXX */ unsigned int size, unsigned int __user *tlv); enum { SNDRV_CTL_TLV_OP_READ = 0, SNDRV_CTL_TLV_OP_WRITE = 1, SNDRV_CTL_TLV_OP_CMD = -1, }; struct snd_kcontrol_new { snd_ctl_elem_iface_t iface; /* interface identifier */ Loading
include/sound/soc.h +13 −1 Original line number Diff line number Diff line Loading @@ -272,7 +272,14 @@ .get = xhandler_get, .put = xhandler_put, \ .private_value = (unsigned long)&(struct soc_bytes_ext) \ {.max = xcount} } #define SND_SOC_BYTES_TLV(xname, xcount, xhandler_get, xhandler_put) \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ .access = SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE | \ SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, \ .tlv.c = (snd_soc_bytes_tlv_callback), \ .info = snd_soc_info_bytes_ext, \ .private_value = (unsigned long)&(struct soc_bytes_ext) \ {.max = xcount, .get = xhandler_get, .put = xhandler_put, } } #define SOC_SINGLE_XR_SX(xname, xregbase, xregcount, xnbits, \ xmin, xmax, xinvert) \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ Loading Loading @@ -560,6 +567,8 @@ int snd_soc_bytes_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); int snd_soc_bytes_info_ext(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *ucontrol); int snd_soc_bytes_tlv_callback(struct snd_kcontrol *kcontrol, int op_flag, unsigned int size, unsigned int __user *tlv); int snd_soc_info_xr_sx(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo); int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol, Loading Loading @@ -1132,6 +1141,9 @@ struct soc_bytes { struct soc_bytes_ext { int max; /* used for TLV byte control */ int (*get)(unsigned int __user *bytes, unsigned int size); int (*put)(const unsigned int __user *bytes, unsigned int size); }; /* multi register control */ Loading
sound/core/control.c +3 −3 Original line number Diff line number Diff line Loading @@ -1406,11 +1406,11 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg case SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS: return snd_ctl_subscribe_events(ctl, ip); case SNDRV_CTL_IOCTL_TLV_READ: return snd_ctl_tlv_ioctl(ctl, argp, 0); return snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_READ); case SNDRV_CTL_IOCTL_TLV_WRITE: return snd_ctl_tlv_ioctl(ctl, argp, 1); return snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_WRITE); case SNDRV_CTL_IOCTL_TLV_COMMAND: return snd_ctl_tlv_ioctl(ctl, argp, -1); return snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_CMD); case SNDRV_CTL_IOCTL_POWER: return -ENOPROTOOPT; case SNDRV_CTL_IOCTL_POWER_STATE: Loading
sound/soc/codecs/Kconfig +3 −1 Original line number Diff line number Diff line Loading @@ -564,7 +564,9 @@ config SND_SOC_TLV320AIC26 depends on SPI config SND_SOC_TLV320AIC31XX tristate tristate "Texas Instruments TLV320AIC31xx CODECs" depends on I2C select REGMAP_I2C config SND_SOC_TLV320AIC32X4 tristate Loading
sound/soc/codecs/tlv320aic23.c +5 −5 Original line number Diff line number Diff line Loading @@ -364,16 +364,16 @@ static int tlv320aic23_hw_params(struct snd_pcm_substream *substream, iface_reg = snd_soc_read(codec, TLV320AIC23_DIGT_FMT) & ~(0x03 << 2); switch (params_format(params)) { case SNDRV_PCM_FORMAT_S16_LE: switch (params_width(params)) { case 16: break; case SNDRV_PCM_FORMAT_S20_3LE: case 20: iface_reg |= (0x01 << 2); break; case SNDRV_PCM_FORMAT_S24_LE: case 24: iface_reg |= (0x02 << 2); break; case SNDRV_PCM_FORMAT_S32_LE: case 32: iface_reg |= (0x03 << 2); break; } Loading