Lines Matching +full:dsp +full:- +full:gpio2
1 // SPDX-License-Identifier: GPL-2.0
3 // cs35l41-lib.c -- CS35L41 Common functions for HDA and ASoC Audio drivers
5 // Copyright 2017-2021 Cirrus Logic, Inc.
826 return -ENOMEM; in cs35l41_otp_unpack()
838 ret = -EINVAL; in cs35l41_otp_unpack()
848 otp_map = otp_map_match->map; in cs35l41_otp_unpack()
850 bit_offset = otp_map_match->bit_offset; in cs35l41_otp_unpack()
851 word_offset = otp_map_match->word_offset; in cs35l41_otp_unpack()
853 for (i = 0; i < otp_map_match->num_elements; i++) { in cs35l41_otp_unpack()
856 if (bit_offset + otp_map[i].size - 1 >= 32) { in cs35l41_otp_unpack()
860 GENMASK(bit_offset + otp_map[i].size - 33, 0)) << in cs35l41_otp_unpack()
861 (32 - bit_offset); in cs35l41_otp_unpack()
862 bit_offset += otp_map[i].size - 32; in cs35l41_otp_unpack()
863 } else if (bit_offset + otp_map[i].size - 1 >= 0) { in cs35l41_otp_unpack()
865 GENMASK(bit_offset + otp_map[i].size - 1, bit_offset) in cs35l41_otp_unpack()
880 GENMASK(otp_map[i].shift + otp_map[i].size - 1, in cs35l41_otp_unpack()
922 ret = -EINVAL; in cs35l41_register_errata_patch()
946 return -EINVAL; in cs35l41_set_channels()
1009 return -EINVAL; in cs35l41_boost_config()
1028 return -EINVAL; in cs35l41_boost_config()
1036 return -EINVAL; in cs35l41_boost_config()
1060 bst_ipk_scaled = ((boost_ipk - 1600) / 50) + 0x10; in cs35l41_boost_config()
1145 switch (hw_cfg->bst_type) { in cs35l41_init_boost()
1150 ret = cs35l41_boost_config(dev, regmap, hw_cfg->bst_ind, in cs35l41_init_boost()
1151 hw_cfg->bst_cap, hw_cfg->bst_ipk); in cs35l41_init_boost()
1172 dev_err(dev, "Boost type %d not supported\n", hw_cfg->bst_type); in cs35l41_init_boost()
1173 ret = -EINVAL; in cs35l41_init_boost()
1213 * solution either, as the trigger is executed in an IRQ-off atomic context.
1219 int enable, struct cs_dsp *dsp) in cs35l41_global_enable() argument
1237 dev_dbg(dev, "Cannot set Global Enable - already set.\n"); in cs35l41_global_enable()
1240 dev_dbg(dev, "Cannot unset Global Enable - not set.\n"); in cs35l41_global_enable()
1314 if (dsp->running && dsp->fw_id_version > CS35L41_FIRMWARE_OLD_VERSION) in cs35l41_global_enable()
1349 ret = -EINVAL; in cs35l41_global_enable()
1370 struct cs35l41_gpio_cfg *gpio1 = &hw_cfg->gpio1; in cs35l41_gpio_config()
1371 struct cs35l41_gpio_cfg *gpio2 = &hw_cfg->gpio2; in cs35l41_gpio_config() local
1376 gpio1->pol_inv << CS35L41_GPIO_POL_SHIFT | in cs35l41_gpio_config()
1377 !gpio1->out_en << CS35L41_GPIO_DIR_SHIFT); in cs35l41_gpio_config()
1381 gpio2->pol_inv << CS35L41_GPIO_POL_SHIFT | in cs35l41_gpio_config()
1382 !gpio2->out_en << CS35L41_GPIO_DIR_SHIFT); in cs35l41_gpio_config()
1384 if (gpio1->valid) in cs35l41_gpio_config()
1386 gpio1->func << CS35L41_GPIO1_CTRL_SHIFT); in cs35l41_gpio_config()
1388 if (gpio2->valid) { in cs35l41_gpio_config()
1390 gpio2->func << CS35L41_GPIO2_CTRL_SHIFT); in cs35l41_gpio_config()
1392 switch (gpio2->func) { in cs35l41_gpio_config()
1417 void cs35l41_configure_cs_dsp(struct device *dev, struct regmap *reg, struct cs_dsp *dsp) in cs35l41_configure_cs_dsp() argument
1419 dsp->num = 1; in cs35l41_configure_cs_dsp()
1420 dsp->type = WMFW_HALO; in cs35l41_configure_cs_dsp()
1421 dsp->rev = 0; in cs35l41_configure_cs_dsp()
1422 dsp->dev = dev; in cs35l41_configure_cs_dsp()
1423 dsp->regmap = reg; in cs35l41_configure_cs_dsp()
1424 dsp->base = CS35L41_DSP1_CTRL_BASE; in cs35l41_configure_cs_dsp()
1425 dsp->base_sysinfo = CS35L41_DSP1_SYS_ID; in cs35l41_configure_cs_dsp()
1426 dsp->mem = cs35l41_dsp1_regions; in cs35l41_configure_cs_dsp()
1427 dsp->num_mems = ARRAY_SIZE(cs35l41_dsp1_regions); in cs35l41_configure_cs_dsp()
1428 dsp->lock_regions = 0xFFFFFFFF; in cs35l41_configure_cs_dsp()
1481 return -EINVAL; in cs35l41_set_cspl_mbox_cmd()
1493 return -ENOMSG; in cs35l41_set_cspl_mbox_cmd()
1515 return -EINVAL; in cs35l41_enter_hibernate()
1571 dev_err(dev, "Wake failed, re-enter hibernate: %d\n", ret); in cs35l41_exit_hibernate()
1585 return -ETIMEDOUT; in cs35l41_exit_hibernate()