Lines Matching full:ch
38 } ch[IDT821034_NB_CHANNEL]; member
44 } ch[IDT821034_NB_CHANNEL]; member
119 static int idt821034_set_channel_power(struct idt821034 *idt821034, u8 ch, u8 power) in idt821034_set_channel_power() argument
124 dev_dbg(&idt821034->spi->dev, "set_channel_power(%u, 0x%x)\n", ch, power); in idt821034_set_channel_power()
126 conf = IDT821034_MODE_CODEC(ch) | idt821034->cache.codec_conf; in idt821034_set_channel_power()
131 idt821034->cache.ch[ch].rx_slot); in idt821034_set_channel_power()
138 idt821034->cache.ch[ch].tx_slot); in idt821034_set_channel_power()
148 idt821034->cache.ch[ch].power = power; in idt821034_set_channel_power()
153 static u8 idt821034_get_channel_power(struct idt821034 *idt821034, u8 ch) in idt821034_get_channel_power() argument
155 return idt821034->cache.ch[ch].power; in idt821034_get_channel_power()
180 if (idt821034->cache.ch[0].power & IDT821034_CONF_PWRUP_RX) { in idt821034_set_codec_conf()
182 ts = idt821034->cache.ch[0].rx_slot; in idt821034_set_codec_conf()
183 } else if (idt821034->cache.ch[0].power & IDT821034_CONF_PWRUP_TX) { in idt821034_set_codec_conf()
185 ts = idt821034->cache.ch[0].tx_slot; in idt821034_set_codec_conf()
208 static int idt821034_set_channel_ts(struct idt821034 *idt821034, u8 ch, u8 ch_dir, u8 ts_num) in idt821034_set_channel_ts() argument
213 dev_dbg(&idt821034->spi->dev, "set_channel_ts(%u, 0x%x, %d)\n", ch, ch_dir, ts_num); in idt821034_set_channel_ts()
215 conf = IDT821034_MODE_CODEC(ch) | idt821034->cache.codec_conf; in idt821034_set_channel_ts()
218 if (idt821034->cache.ch[ch].power & IDT821034_CONF_PWRUP_RX) { in idt821034_set_channel_ts()
225 idt821034->cache.ch[ch].rx_slot = ts_num; in idt821034_set_channel_ts()
228 if (idt821034->cache.ch[ch].power & IDT821034_CONF_PWRUP_TX) { in idt821034_set_channel_ts()
235 idt821034->cache.ch[ch].tx_slot = ts_num; in idt821034_set_channel_ts()
245 static int idt821034_set_slic_conf(struct idt821034 *idt821034, u8 ch, u8 slic_dir) in idt821034_set_slic_conf() argument
250 dev_dbg(&idt821034->spi->dev, "set_slic_conf(%u, 0x%x)\n", ch, slic_dir); in idt821034_set_slic_conf()
252 conf = IDT821034_MODE_SLIC(ch) | slic_dir; in idt821034_set_slic_conf()
253 ret = idt821034_2x8bit_write(idt821034, conf, idt821034->cache.ch[ch].slic_control); in idt821034_set_slic_conf()
257 idt821034->cache.ch[ch].slic_conf = slic_dir; in idt821034_set_slic_conf()
262 static u8 idt821034_get_slic_conf(struct idt821034 *idt821034, u8 ch) in idt821034_get_slic_conf() argument
264 return idt821034->cache.ch[ch].slic_conf; in idt821034_get_slic_conf()
267 static int idt821034_write_slic_raw(struct idt821034 *idt821034, u8 ch, u8 slic_raw) in idt821034_write_slic_raw() argument
272 dev_dbg(&idt821034->spi->dev, "write_slic_raw(%u, 0x%x)\n", ch, slic_raw); in idt821034_write_slic_raw()
283 conf = IDT821034_MODE_SLIC(ch) | idt821034->cache.ch[ch].slic_conf; in idt821034_write_slic_raw()
288 idt821034->cache.ch[ch].slic_control = slic_raw; in idt821034_write_slic_raw()
292 static u8 idt821034_get_written_slic_raw(struct idt821034 *idt821034, u8 ch) in idt821034_get_written_slic_raw() argument
294 return idt821034->cache.ch[ch].slic_control; in idt821034_get_written_slic_raw()
297 static int idt821034_read_slic_raw(struct idt821034 *idt821034, u8 ch, u8 *slic_raw) in idt821034_read_slic_raw() argument
309 * b2: I/O1_0, I/O_0 from channel 1 (no matter ch value) in idt821034_read_slic_raw()
310 * b1: I/O2_0, I/O_0 from channel 2 (no matter ch value) in idt821034_read_slic_raw()
311 * b2: I/O3_0, I/O_0 from channel 3 (no matter ch value) in idt821034_read_slic_raw()
314 val = IDT821034_MODE_SLIC(ch) | idt821034->cache.ch[ch].slic_conf; in idt821034_read_slic_raw()
319 ret = idt821034_8bit_read(idt821034, idt821034->cache.ch[ch].slic_control, slic_raw); in idt821034_read_slic_raw()
323 dev_dbg(&idt821034->spi->dev, "read_slic_raw(%i) 0x%x\n", ch, *slic_raw); in idt821034_read_slic_raw()
332 static int idt821034_set_gain_channel(struct idt821034 *idt821034, u8 ch, in idt821034_set_gain_channel() argument
339 ch, gain_type, gain_val, gain_val); in idt821034_set_gain_channel()
377 conf = IDT821034_MODE_GAIN(ch) | gain_type; in idt821034_set_gain_channel()
412 u8 ch; in idt821034_kctrl_gain_get() local
414 ch = IDT821034_ID_GET_CHAN(mc->reg); in idt821034_kctrl_gain_get()
418 val = idt821034->amps.ch[ch].amp_out.gain; in idt821034_kctrl_gain_get()
420 val = idt821034->amps.ch[ch].amp_in.gain; in idt821034_kctrl_gain_get()
446 u8 ch; in idt821034_kctrl_gain_put() local
457 ch = IDT821034_ID_GET_CHAN(mc->reg); in idt821034_kctrl_gain_put()
462 amp = &idt821034->amps.ch[ch].amp_out; in idt821034_kctrl_gain_put()
465 amp = &idt821034->amps.ch[ch].amp_in; in idt821034_kctrl_gain_put()
475 ret = idt821034_set_gain_channel(idt821034, ch, gain_type, val); in idt821034_kctrl_gain_put()
494 u8 ch; in idt821034_kctrl_mute_get() local
496 ch = IDT821034_ID_GET_CHAN(id); in idt821034_kctrl_mute_get()
500 idt821034->amps.ch[ch].amp_out.is_muted : in idt821034_kctrl_mute_get()
501 idt821034->amps.ch[ch].amp_in.is_muted; in idt821034_kctrl_mute_get()
519 u8 ch; in idt821034_kctrl_mute_put() local
521 ch = IDT821034_ID_GET_CHAN(id); in idt821034_kctrl_mute_put()
527 amp = &idt821034->amps.ch[ch].amp_out; in idt821034_kctrl_mute_put()
530 amp = &idt821034->amps.ch[ch].amp_in; in idt821034_kctrl_mute_put()
539 ret = idt821034_set_gain_channel(idt821034, ch, gain_type, in idt821034_kctrl_mute_put()
627 u8 ch; in idt821034_power_event() local
629 ch = IDT821034_ID_GET_CHAN(id); in idt821034_power_event()
634 power = idt821034_get_channel_power(idt821034, ch); in idt821034_power_event()
639 ret = idt821034_set_channel_power(idt821034, ch, power); in idt821034_power_event()
704 u8 ch; in idt821034_dai_set_tdm_slot() local
717 ch = 0; in idt821034_dai_set_tdm_slot()
718 while (mask && ch < IDT821034_NB_CHANNEL) { in idt821034_dai_set_tdm_slot()
721 ret = idt821034_set_channel_ts(idt821034, ch, IDT821034_CH_RX, slot); in idt821034_dai_set_tdm_slot()
724 dev_err(dai->dev, "ch%u set tx tdm slot failed (%d)\n", in idt821034_dai_set_tdm_slot()
725 ch, ret); in idt821034_dai_set_tdm_slot()
728 ch++; in idt821034_dai_set_tdm_slot()
738 idt821034->max_ch_playback = ch; in idt821034_dai_set_tdm_slot()
742 ch = 0; in idt821034_dai_set_tdm_slot()
743 while (mask && ch < IDT821034_NB_CHANNEL) { in idt821034_dai_set_tdm_slot()
746 ret = idt821034_set_channel_ts(idt821034, ch, IDT821034_CH_TX, slot); in idt821034_dai_set_tdm_slot()
749 dev_err(dai->dev, "ch%u set rx tdm slot failed (%d)\n", in idt821034_dai_set_tdm_slot()
750 ch, ret); in idt821034_dai_set_tdm_slot()
753 ch++; in idt821034_dai_set_tdm_slot()
763 idt821034->max_ch_capture = ch; in idt821034_dai_set_tdm_slot()
908 idt821034->amps.ch[i].amp_out.gain = IDT821034_GAIN_OUT_INIT_RAW; in idt821034_reset_audio()
909 idt821034->amps.ch[i].amp_out.is_muted = false; in idt821034_reset_audio()
911 idt821034->amps.ch[i].amp_out.gain); in idt821034_reset_audio()
915 idt821034->amps.ch[i].amp_in.gain = IDT821034_GAIN_IN_INIT_RAW; in idt821034_reset_audio()
916 idt821034->amps.ch[i].amp_in.is_muted = false; in idt821034_reset_audio()
918 idt821034->amps.ch[i].amp_in.gain); in idt821034_reset_audio()
962 u8 ch = IDT821034_GPIO_OFFSET_TO_SLIC_CHANNEL(offset); in idt821034_chip_gpio_set() local
970 slic_raw = idt821034_get_written_slic_raw(idt821034, ch); in idt821034_chip_gpio_set()
975 ret = idt821034_write_slic_raw(idt821034, ch, slic_raw); in idt821034_chip_gpio_set()
978 offset, ch, mask, ret); in idt821034_chip_gpio_set()
986 u8 ch = IDT821034_GPIO_OFFSET_TO_SLIC_CHANNEL(offset); in idt821034_chip_gpio_get() local
993 ret = idt821034_read_slic_raw(idt821034, ch, &slic_raw); in idt821034_chip_gpio_get()
997 offset, ch, mask, ret); in idt821034_chip_gpio_get()
1011 u8 ch = IDT821034_GPIO_OFFSET_TO_SLIC_CHANNEL(offset); in idt821034_chip_get_direction() local
1017 slic_dir = idt821034_get_slic_conf(idt821034, ch); in idt821034_chip_get_direction()
1025 u8 ch = IDT821034_GPIO_OFFSET_TO_SLIC_CHANNEL(offset); in idt821034_chip_direction_input() local
1037 slic_conf = idt821034_get_slic_conf(idt821034, ch) | mask; in idt821034_chip_direction_input()
1039 ret = idt821034_set_slic_conf(idt821034, ch, slic_conf); in idt821034_chip_direction_input()
1042 offset, ch, mask, ret); in idt821034_chip_direction_input()
1051 u8 ch = IDT821034_GPIO_OFFSET_TO_SLIC_CHANNEL(offset); in idt821034_chip_direction_output() local
1061 slic_conf = idt821034_get_slic_conf(idt821034, ch) & ~mask; in idt821034_chip_direction_output()
1063 ret = idt821034_set_slic_conf(idt821034, ch, slic_conf); in idt821034_chip_direction_output()
1066 offset, ch, mask, ret); in idt821034_chip_direction_output()