Lines Matching +full:dout +full:- +full:default +full:- +full:2

1 // SPDX-License-Identifier: GPL-2.0-only
3 * max98926.c -- ALSA SoC MAX98926 driver
4 * Copyright 2013-15 Maxim Integrated Products
49 { 0x1B, 0x00 }, /* DAI Clock Mode 2 */
56 { 0x22, 0x00 }, /* DOUT Configuration VMON */
57 { 0x23, 0x00 }, /* DOUT Configuration IMON */
58 { 0x24, 0x00 }, /* DOUT Configuration VBAT */
59 { 0x25, 0x00 }, /* DOUT Configuration VBST */
60 { 0x26, 0x00 }, /* DOUT Configuration FLAG */
61 { 0x27, 0xFF }, /* DOUT HiZ Configuration 1 */
62 { 0x28, 0xFF }, /* DOUT HiZ Configuration 2 */
63 { 0x29, 0xFF }, /* DOUT HiZ Configuration 3 */
64 { 0x2A, 0xFF }, /* DOUT HiZ Configuration 4 */
65 { 0x2B, 0x02 }, /* DOUT Drive Strength */
114 MAX98926_DAC_IN_SEL_SHIFT, 2, 0),
115 SOC_DAPM_SINGLE("(Left+Right)/2 Switch", MAX98926_GAIN,
187 default: in max98926_volatile_register()
200 default: in max98926_readable_register()
205 static DECLARE_TLV_DB_SCALE(max98926_spk_tlv, -600, 100, 0);
222 (1<<MAX98926_SPK_GAIN_WIDTH)-1, 0,
232 (1<<MAX98926_ALC_TH_WIDTH)-1, 0),
236 (1<<MAX98926_BST_ILIM_SHIFT)-1, 0,
261 .sr = 2,
291 regmap_update_bits(max98926->regmap, in max98926_set_sense_data()
295 regmap_update_bits(max98926->regmap, in max98926_set_sense_data()
300 if (!max98926->interleave_mode) { in max98926_set_sense_data()
302 regmap_update_bits(max98926->regmap, in max98926_set_sense_data()
305 max98926->v_slot); in max98926_set_sense_data()
307 regmap_update_bits(max98926->regmap, in max98926_set_sense_data()
310 max98926->i_slot); in max98926_set_sense_data()
313 regmap_update_bits(max98926->regmap, in max98926_set_sense_data()
318 regmap_update_bits(max98926->regmap, in max98926_set_sense_data()
321 max98926->v_slot); in max98926_set_sense_data()
328 struct snd_soc_component *component = codec_dai->component; in max98926_dai_set_fmt()
332 dev_dbg(component->dev, "%s: fmt 0x%08X\n", __func__, fmt); in max98926_dai_set_fmt()
338 default: in max98926_dai_set_fmt()
339 dev_err(component->dev, "DAI clock mode unsupported\n"); in max98926_dai_set_fmt()
340 return -EINVAL; in max98926_dai_set_fmt()
355 default: in max98926_dai_set_fmt()
356 dev_err(component->dev, "DAI invert mode unsupported\n"); in max98926_dai_set_fmt()
357 return -EINVAL; in max98926_dai_set_fmt()
360 regmap_write(max98926->regmap, in max98926_dai_set_fmt()
362 regmap_update_bits(max98926->regmap, MAX98926_FORMAT, in max98926_dai_set_fmt()
371 int dai_sr = -EINVAL; in max98926_dai_hw_params()
373 struct snd_soc_component *component = dai->component; in max98926_dai_hw_params()
379 regmap_update_bits(max98926->regmap, in max98926_dai_hw_params()
383 max98926->ch_size = 16; in max98926_dai_hw_params()
386 regmap_update_bits(max98926->regmap, in max98926_dai_hw_params()
390 max98926->ch_size = 24; in max98926_dai_hw_params()
393 regmap_update_bits(max98926->regmap, in max98926_dai_hw_params()
397 max98926->ch_size = 32; in max98926_dai_hw_params()
399 default: in max98926_dai_hw_params()
400 dev_dbg(component->dev, "format unsupported %d\n", in max98926_dai_hw_params()
402 return -EINVAL; in max98926_dai_hw_params()
406 blr_clk_ratio = params_channels(params) * max98926->ch_size; in max98926_dai_hw_params()
410 regmap_update_bits(max98926->regmap, in max98926_dai_hw_params()
416 regmap_update_bits(max98926->regmap, in max98926_dai_hw_params()
422 regmap_update_bits(max98926->regmap, in max98926_dai_hw_params()
427 default: in max98926_dai_hw_params()
428 return -EINVAL; in max98926_dai_hw_params()
439 return -EINVAL; in max98926_dai_hw_params()
442 regmap_update_bits(max98926->regmap, in max98926_dai_hw_params()
458 .name = "max98926-aif1",
462 .channels_max = 2,
469 .channels_max = 2,
481 max98926->component = component; in max98926_probe()
483 /* Hi-Z all the slots */ in max98926_probe()
484 regmap_write(max98926->regmap, MAX98926_DOUT_HIZ_CFG4, 0xF0); in max98926_probe()
518 max98926 = devm_kzalloc(&i2c->dev, in max98926_i2c_probe()
521 return -ENOMEM; in max98926_i2c_probe()
524 max98926->regmap = devm_regmap_init_i2c(i2c, &max98926_regmap); in max98926_i2c_probe()
525 if (IS_ERR(max98926->regmap)) { in max98926_i2c_probe()
526 ret = PTR_ERR(max98926->regmap); in max98926_i2c_probe()
527 dev_err(&i2c->dev, in max98926_i2c_probe()
531 if (of_property_read_bool(i2c->dev.of_node, "maxim,interleave-mode") || in max98926_i2c_probe()
532 of_property_read_bool(i2c->dev.of_node, "interleave-mode")) in max98926_i2c_probe()
533 max98926->interleave_mode = true; in max98926_i2c_probe()
535 if (!of_property_read_u32(i2c->dev.of_node, "vmon-slot-no", &value)) { in max98926_i2c_probe()
537 dev_err(&i2c->dev, "vmon slot number is wrong:\n"); in max98926_i2c_probe()
538 return -EINVAL; in max98926_i2c_probe()
540 max98926->v_slot = value; in max98926_i2c_probe()
542 if (!of_property_read_u32(i2c->dev.of_node, "imon-slot-no", &value)) { in max98926_i2c_probe()
544 dev_err(&i2c->dev, "imon slot number is wrong:\n"); in max98926_i2c_probe()
545 return -EINVAL; in max98926_i2c_probe()
547 max98926->i_slot = value; in max98926_i2c_probe()
549 ret = regmap_read(max98926->regmap, in max98926_i2c_probe()
552 dev_err(&i2c->dev, "Failed to read: %x\n", reg); in max98926_i2c_probe()
556 ret = devm_snd_soc_register_component(&i2c->dev, in max98926_i2c_probe()
560 dev_err(&i2c->dev, in max98926_i2c_probe()
562 dev_info(&i2c->dev, "device version: %x\n", reg); in max98926_i2c_probe()