Lines Matching defs:opts

505 	struct f_uac1_opts *opts = g_audio_to_uac1_opts(audio);
513 if ((FUIN_EN(opts) && (entity_id == USB_IN_FU_ID)) ||
514 (FUOUT_EN(opts) && (entity_id == USB_OUT_FU_ID))) {
517 if (FUIN_EN(opts) && (entity_id == USB_IN_FU_ID))
556 struct f_uac1_opts *opts = g_audio_to_uac1_opts(audio);
564 if ((FUIN_EN(opts) && (entity_id == USB_IN_FU_ID)) ||
565 (FUOUT_EN(opts) && (entity_id == USB_OUT_FU_ID))) {
568 if (FUIN_EN(opts) && (entity_id == USB_IN_FU_ID))
576 min_db = opts->p_volume_min;
578 min_db = opts->c_volume_min;
603 struct f_uac1_opts *opts = g_audio_to_uac1_opts(audio);
611 if ((FUIN_EN(opts) && (entity_id == USB_IN_FU_ID)) ||
612 (FUOUT_EN(opts) && (entity_id == USB_OUT_FU_ID))) {
615 if (FUIN_EN(opts) && (entity_id == USB_IN_FU_ID))
623 max_db = opts->p_volume_max;
625 max_db = opts->c_volume_max;
650 struct f_uac1_opts *opts = g_audio_to_uac1_opts(audio);
658 if ((FUIN_EN(opts) && (entity_id == USB_IN_FU_ID)) ||
659 (FUOUT_EN(opts) && (entity_id == USB_OUT_FU_ID))) {
662 if (FUIN_EN(opts) && (entity_id == USB_IN_FU_ID))
670 res_db = opts->p_volume_res;
672 res_db = opts->c_volume_res;
697 struct f_uac1_opts *opts = g_audio_to_uac1_opts(audio);
710 if ((FUIN_EN(opts) && (entity_id == USB_IN_FU_ID)) ||
711 (FUOUT_EN(opts) && (entity_id == USB_OUT_FU_ID))) {
714 if (FUIN_EN(opts) && (entity_id == USB_IN_FU_ID))
751 struct f_uac1_opts *opts = g_audio_to_uac1_opts(audio);
759 if ((FUIN_EN(opts) && (entity_id == USB_IN_FU_ID)) ||
760 (FUOUT_EN(opts) && (entity_id == USB_OUT_FU_ID))) {
1067 uac1_ac_header_descriptor *build_ac_header_desc(struct f_uac1_opts *opts)
1073 if (EPOUT_EN(opts))
1075 if (EPIN_EN(opts))
1098 static void setup_descriptor(struct f_uac1_opts *opts)
1103 if (EPOUT_EN(opts))
1105 if (EPIN_EN(opts))
1107 if (EPOUT_EN(opts))
1109 if (EPIN_EN(opts))
1111 if (FUOUT_EN(opts))
1113 if (FUIN_EN(opts))
1116 if (FUIN_EN(opts)) {
1122 if (FUOUT_EN(opts)) {
1134 if (EPIN_EN(opts)) {
1139 if (FUIN_EN(opts))
1143 if (EPOUT_EN(opts)) {
1148 if (FUOUT_EN(opts))
1157 if (EPOUT_EN(opts)) {
1160 if (FUOUT_EN(opts))
1164 if (EPIN_EN(opts)) {
1167 if (FUIN_EN(opts))
1171 if (FUOUT_EN(opts) || FUIN_EN(opts))
1174 if (EPOUT_EN(opts)) {
1182 if (EPIN_EN(opts)) {
1195 struct f_uac1_opts *opts = g_audio_to_uac1_opts(audio);
1197 if (!opts->p_chmask && !opts->c_chmask) {
1200 } else if (opts->p_chmask & ~UAC1_CHANNEL_MASK) {
1203 } else if (opts->c_chmask & ~UAC1_CHANNEL_MASK) {
1206 } else if ((opts->p_ssize < 1) || (opts->p_ssize > 4)) {
1209 } else if ((opts->c_ssize < 1) || (opts->c_ssize > 4)) {
1212 } else if (!opts->p_srates[0]) {
1215 } else if (!opts->c_srates[0]) {
1220 if (opts->p_volume_max <= opts->p_volume_min) {
1223 } else if (opts->c_volume_max <= opts->c_volume_min) {
1226 } else if (opts->p_volume_res <= 0) {
1229 } else if (opts->c_volume_res <= 0) {
1234 if ((opts->p_volume_max - opts->p_volume_min) % opts->p_volume_res) {
1237 } else if ((opts->c_volume_max - opts->c_volume_min) % opts->c_volume_res) {
1510 struct f_uac1_opts *opts = to_f_uac1_opts(item);
1512 usb_put_function_instance(&opts->func_inst);
1532 struct f_uac1_opts *opts = to_f_uac1_opts(item); \
1535 mutex_lock(&opts->lock); \
1536 result = sprintf(page, type##_fmt, opts->name); \
1537 mutex_unlock(&opts->lock); \
1546 struct f_uac1_opts *opts = to_f_uac1_opts(item); \
1550 mutex_lock(&opts->lock); \
1551 if (opts->refcnt) { \
1560 opts->name = num; \
1564 mutex_unlock(&opts->lock); \
1574 struct f_uac1_opts *opts = to_f_uac1_opts(item); \
1578 mutex_lock(&opts->lock); \
1581 if (opts->name##s[i] == 0) \
1584 opts->name##s[i]); \
1588 mutex_unlock(&opts->lock); \
1596 struct f_uac1_opts *opts = to_f_uac1_opts(item); \
1603 mutex_lock(&opts->lock); \
1604 if (opts->refcnt) { \
1610 memset(opts->name##s, 0x00, sizeof(opts->name##s)); \
1617 opts->name##s[i++] = num; \
1623 mutex_unlock(&opts->lock); \
1633 struct f_uac1_opts *opts = to_f_uac1_opts(item); \
1636 mutex_lock(&opts->lock); \
1637 result = scnprintf(page, sizeof(opts->name), "%s", opts->name); \
1638 mutex_unlock(&opts->lock); \
1646 struct f_uac1_opts *opts = to_f_uac1_opts(item); \
1649 mutex_lock(&opts->lock); \
1650 if (opts->refcnt) { \
1655 ret = scnprintf(opts->name, min(sizeof(opts->name), len), \
1659 mutex_unlock(&opts->lock); \
1720 struct f_uac1_opts *opts;
1722 opts = container_of(f, struct f_uac1_opts, func_inst);
1723 kfree(opts);
1728 struct f_uac1_opts *opts;
1730 opts = kzalloc(sizeof(*opts), GFP_KERNEL);
1731 if (!opts)
1734 mutex_init(&opts->lock);
1735 opts->func_inst.free_func_inst = f_audio_free_inst;
1737 config_group_init_type_name(&opts->func_inst.group, "",
1740 opts->c_chmask = UAC1_DEF_CCHMASK;
1741 opts->c_srates[0] = UAC1_DEF_CSRATE;
1742 opts->c_ssize = UAC1_DEF_CSSIZE;
1743 opts->p_chmask = UAC1_DEF_PCHMASK;
1744 opts->p_srates[0] = UAC1_DEF_PSRATE;
1745 opts->p_ssize = UAC1_DEF_PSSIZE;
1747 opts->p_mute_present = UAC1_DEF_MUTE_PRESENT;
1748 opts->p_volume_present = UAC1_DEF_VOLUME_PRESENT;
1749 opts->p_volume_min = UAC1_DEF_MIN_DB;
1750 opts->p_volume_max = UAC1_DEF_MAX_DB;
1751 opts->p_volume_res = UAC1_DEF_RES_DB;
1753 opts->c_mute_present = UAC1_DEF_MUTE_PRESENT;
1754 opts->c_volume_present = UAC1_DEF_VOLUME_PRESENT;
1755 opts->c_volume_min = UAC1_DEF_MIN_DB;
1756 opts->c_volume_max = UAC1_DEF_MAX_DB;
1757 opts->c_volume_res = UAC1_DEF_RES_DB;
1759 opts->req_number = UAC1_DEF_REQ_NUM;
1761 scnprintf(opts->function_name, sizeof(opts->function_name), "AC Interface");
1763 return &opts->func_inst;
1769 struct f_uac1_opts *opts;
1772 opts = container_of(f->fi, struct f_uac1_opts, func_inst);
1774 mutex_lock(&opts->lock);
1775 --opts->refcnt;
1776 mutex_unlock(&opts->lock);
1800 struct f_uac1_opts *opts;
1807 opts = container_of(fi, struct f_uac1_opts, func_inst);
1808 mutex_lock(&opts->lock);
1809 ++opts->refcnt;
1810 mutex_unlock(&opts->lock);