Lines Matching +full:clip +full:- +full:x +full:- +full:low
1 // SPDX-License-Identifier: GPL-2.0
53 reg_data[size - i - 1] = (val >> (8 * i)) & 0xff; in mt6660_reg_write()
55 return i2c_smbus_write_i2c_block_data(chip->i2c, reg, size, reg_data); in mt6660_reg_write()
66 ret = i2c_smbus_read_i2c_block_data(chip->i2c, reg, size, data); in mt6660_reg_read()
96 snd_soc_dapm_to_component(w->dapm); in mt6660_codec_classd_event()
101 dev_dbg(component->dev, in mt6660_codec_classd_event()
107 dev_err(component->dev, "config mode adaptive fail\n"); in mt6660_codec_classd_event()
116 dev_err(component->dev, in mt6660_codec_classd_event()
120 dev_dbg(component->dev, "Amp on\n"); in mt6660_codec_classd_event()
123 dev_dbg(component->dev, "Amp off\n"); in mt6660_codec_classd_event()
128 dev_err(component->dev, in mt6660_codec_classd_event()
132 /* pop-noise improvement 1 */ in mt6660_codec_classd_event()
136 dev_err(component->dev, in mt6660_codec_classd_event()
137 "pop-noise improvement 1 fail\n"); in mt6660_codec_classd_event()
142 dev_dbg(component->dev, in mt6660_codec_classd_event()
144 /* pop-noise improvement 2 */ in mt6660_codec_classd_event()
148 dev_err(component->dev, in mt6660_codec_classd_event()
149 "pop-noise improvement 2 fail\n"); in mt6660_codec_classd_event()
156 dev_err(component->dev, "config mode off fail\n"); in mt6660_codec_classd_event()
195 ucontrol->value.integer.value[0] = chip->chip_rev & 0x0f; in mt6660_component_get_volsw()
199 static const DECLARE_TLV_DB_SCALE(vol_ctl_tlv, -1155, 5, 0);
204 SOC_SINGLE("Hard Clip Switch", MT6660_REG_HCLIP_CTRL, 8, 1, 0),
205 SOC_SINGLE("Clip Switch", MT6660_REG_SPS_CTRL, 0, 1, 0),
221 return regmap_write_bits(chip->regmap, MT6660_REG_SYSTEM_CTRL, in _mt6660_chip_power_on()
268 dev_err(component->dev, "%s chip power on failed\n", __func__); in mt6660_component_setting()
278 dev_err(component->dev, "%s update 0x%02x failed\n", in mt6660_component_setting()
286 dev_err(component->dev, "%s chip power off failed\n", __func__); in mt6660_component_setting()
298 dev_dbg(component->dev, "%s\n", __func__); in mt6660_component_probe()
299 snd_soc_component_init_regmap(component, chip->regmap); in mt6660_component_probe()
303 dev_err(chip->dev, "mt6660 component setting failed\n"); in mt6660_component_probe()
310 dev_dbg(component->dev, "%s\n", __func__); in mt6660_component_remove()
337 dev_dbg(dai->dev, "%s: ++\n", __func__); in mt6660_component_aif_hw_params()
338 dev_dbg(dai->dev, "format: 0x%08x\n", params_format(hw_params)); in mt6660_component_aif_hw_params()
339 dev_dbg(dai->dev, "rate: 0x%08x\n", params_rate(hw_params)); in mt6660_component_aif_hw_params()
340 dev_dbg(dai->dev, "word_len: %d, aud_bit: %d\n", word_len, aud_bit); in mt6660_component_aif_hw_params()
342 dev_err(dai->dev, "not supported word length\n"); in mt6660_component_aif_hw_params()
343 return -ENOTSUPP; in mt6660_component_aif_hw_params()
360 return -ENOTSUPP; in mt6660_component_aif_hw_params()
362 ret = snd_soc_component_update_bits(dai->component, in mt6660_component_aif_hw_params()
365 dev_err(dai->dev, "config aud bit fail\n"); in mt6660_component_aif_hw_params()
368 ret = snd_soc_component_update_bits(dai->component, in mt6660_component_aif_hw_params()
371 dev_err(dai->dev, "config word len fail\n"); in mt6660_component_aif_hw_params()
374 dev_dbg(dai->dev, "%s: --\n", __func__); in mt6660_component_aif_hw_params()
391 .name = "mt6660-aif",
419 ret = regmap_read(chip->regmap, MT6660_REG_DEVID, &val); in _mt6660_chip_id_check()
424 dev_err(chip->dev, "%s id(%x) not match\n", __func__, val); in _mt6660_chip_id_check()
425 return -ENODEV; in _mt6660_chip_id_check()
435 ret = regmap_write(chip->regmap, MT6660_REG_SYSTEM_CTRL, 0x00); in _mt6660_chip_sw_reset()
438 ret = regmap_write(chip->regmap, MT6660_REG_SYSTEM_CTRL, 0x80); in _mt6660_chip_sw_reset()
450 ret = regmap_read(chip->regmap, MT6660_REG_DEVID, &val); in _mt6660_read_chip_revision()
452 dev_err(chip->dev, "get chip revision fail\n"); in _mt6660_read_chip_revision()
455 chip->chip_rev = val&0xff; in _mt6660_read_chip_revision()
456 dev_info(chip->dev, "%s chip_rev = %x\n", __func__, chip->chip_rev); in _mt6660_read_chip_revision()
465 dev_dbg(&client->dev, "%s\n", __func__); in mt6660_i2c_probe()
466 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); in mt6660_i2c_probe()
468 return -ENOMEM; in mt6660_i2c_probe()
469 chip->i2c = client; in mt6660_i2c_probe()
470 chip->dev = &client->dev; in mt6660_i2c_probe()
471 mutex_init(&chip->io_lock); in mt6660_i2c_probe()
474 chip->regmap = devm_regmap_init(&client->dev, in mt6660_i2c_probe()
476 if (IS_ERR(chip->regmap)) { in mt6660_i2c_probe()
477 ret = PTR_ERR(chip->regmap); in mt6660_i2c_probe()
478 dev_err(&client->dev, "failed to initialise regmap: %d\n", ret); in mt6660_i2c_probe()
485 dev_err(chip->dev, "chip reset fail\n"); in mt6660_i2c_probe()
491 dev_err(chip->dev, "chip power on 2 fail\n"); in mt6660_i2c_probe()
497 dev_err(chip->dev, "chip id check fail\n"); in mt6660_i2c_probe()
503 dev_err(chip->dev, "read chip revision fail\n"); in mt6660_i2c_probe()
506 pm_runtime_set_active(chip->dev); in mt6660_i2c_probe()
507 pm_runtime_enable(chip->dev); in mt6660_i2c_probe()
509 ret = devm_snd_soc_register_component(chip->dev, in mt6660_i2c_probe()
513 pm_runtime_disable(chip->dev); in mt6660_i2c_probe()
519 mutex_destroy(&chip->io_lock); in mt6660_i2c_probe()
527 pm_runtime_disable(chip->dev); in mt6660_i2c_remove()
528 pm_runtime_set_suspended(chip->dev); in mt6660_i2c_remove()
529 mutex_destroy(&chip->io_lock); in mt6660_i2c_remove()
536 dev_dbg(dev, "enter low power mode\n"); in mt6660_i2c_runtime_suspend()
537 return regmap_update_bits(chip->regmap, in mt6660_i2c_runtime_suspend()
545 dev_dbg(dev, "exit low power mode\n"); in mt6660_i2c_runtime_resume()
546 return regmap_update_bits(chip->regmap, in mt6660_i2c_runtime_resume()