Lines Matching refs:cs35l33

637 	struct cs35l33_private *cs35l33 = snd_soc_component_get_drvdata(component);  in cs35l33_component_set_sysclk()  local
643 regmap_update_bits(cs35l33->regmap, CS35L33_CLK_CTL, in cs35l33_component_set_sysclk()
645 cs35l33->mclk_int = freq; in cs35l33_component_set_sysclk()
650 regmap_update_bits(cs35l33->regmap, CS35L33_CLK_CTL, in cs35l33_component_set_sysclk()
652 cs35l33->mclk_int = freq/2; in cs35l33_component_set_sysclk()
655 cs35l33->mclk_int = 0; in cs35l33_component_set_sysclk()
660 freq, cs35l33->mclk_int); in cs35l33_component_set_sysclk()
745 struct cs35l33_private *cs35l33 = snd_soc_component_get_drvdata(component); in cs35l33_set_bst_ipk() local
767 regmap_write(cs35l33->regmap, CS35L33_BST_PEAK_CTL, in cs35l33_set_bst_ipk()
776 struct cs35l33_private *cs35l33 = snd_soc_component_get_drvdata(component); in cs35l33_probe() local
778 cs35l33->component = component; in cs35l33_probe()
781 regmap_update_bits(cs35l33->regmap, CS35L33_PROTECT_CTL, in cs35l33_probe()
783 regmap_update_bits(cs35l33->regmap, CS35L33_BST_CTL2, in cs35l33_probe()
788 regmap_update_bits(cs35l33->regmap, CS35L33_BST_CTL1, in cs35l33_probe()
789 CS35L33_BST_CTL_MASK, cs35l33->pdata.boost_ctl); in cs35l33_probe()
790 regmap_update_bits(cs35l33->regmap, CS35L33_CLASSD_CTL, in cs35l33_probe()
792 cs35l33->pdata.amp_drv_sel << CS35L33_AMP_DRV_SEL_SHIFT); in cs35l33_probe()
794 if (cs35l33->pdata.boost_ipk) in cs35l33_probe()
795 cs35l33_set_bst_ipk(component, cs35l33->pdata.boost_ipk); in cs35l33_probe()
797 if (cs35l33->enable_soft_ramp) { in cs35l33_probe()
801 CS35L33_DSR_RATE, cs35l33->pdata.ramp_rate); in cs35l33_probe()
808 if (cs35l33->pdata.imon_adc_scale != 0x8) in cs35l33_probe()
810 CS35L33_IMON_SCALE, cs35l33->pdata.imon_adc_scale); in cs35l33_probe()
812 cs35l33_set_hg_data(component, &(cs35l33->pdata)); in cs35l33_probe()
818 regmap_update_bits(cs35l33->regmap, CS35L33_INT_MASK_1, in cs35l33_probe()
858 struct cs35l33_private *cs35l33 = dev_get_drvdata(dev); in cs35l33_runtime_resume() local
863 gpiod_set_value_cansleep(cs35l33->reset_gpio, 0); in cs35l33_runtime_resume()
865 ret = regulator_bulk_enable(cs35l33->num_core_supplies, in cs35l33_runtime_resume()
866 cs35l33->core_supplies); in cs35l33_runtime_resume()
872 regcache_cache_only(cs35l33->regmap, false); in cs35l33_runtime_resume()
874 gpiod_set_value_cansleep(cs35l33->reset_gpio, 1); in cs35l33_runtime_resume()
878 ret = regcache_sync(cs35l33->regmap); in cs35l33_runtime_resume()
887 regcache_cache_only(cs35l33->regmap, true); in cs35l33_runtime_resume()
888 regulator_bulk_disable(cs35l33->num_core_supplies, in cs35l33_runtime_resume()
889 cs35l33->core_supplies); in cs35l33_runtime_resume()
896 struct cs35l33_private *cs35l33 = dev_get_drvdata(dev); in cs35l33_runtime_suspend() local
901 cs35l33->amp_cal = false; in cs35l33_runtime_suspend()
903 regcache_cache_only(cs35l33->regmap, true); in cs35l33_runtime_suspend()
904 regcache_mark_dirty(cs35l33->regmap); in cs35l33_runtime_suspend()
905 regulator_bulk_disable(cs35l33->num_core_supplies, in cs35l33_runtime_suspend()
906 cs35l33->core_supplies); in cs35l33_runtime_suspend()
960 struct cs35l33_private *cs35l33 = data; in cs35l33_irq_thread() local
961 struct snd_soc_component *component = cs35l33->component; in cs35l33_irq_thread()
964 regmap_read(cs35l33->regmap, CS35L33_INT_STATUS_2, in cs35l33_irq_thread()
966 regmap_read(cs35l33->regmap, CS35L33_INT_STATUS_1, in cs35l33_irq_thread()
968 regmap_read(cs35l33->regmap, CS35L33_INT_MASK_2, &mask2); in cs35l33_irq_thread()
969 regmap_read(cs35l33->regmap, CS35L33_INT_MASK_1, &mask1); in cs35l33_irq_thread()
977 regmap_read(cs35l33->regmap, CS35L33_INT_STATUS_1, in cs35l33_irq_thread()
987 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
990 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
994 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1004 cs35l33->amp_cal = false; in cs35l33_irq_thread()
1008 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1011 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1014 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1025 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1027 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1030 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1040 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1042 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1045 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1076 struct cs35l33_private *cs35l33) in cs35l33_of_get_pdata() argument
1079 struct cs35l33_pdata *pdata = &cs35l33->pdata; in cs35l33_of_get_pdata()
1092 cs35l33->enable_soft_ramp = true; in cs35l33_of_get_pdata()
1116 struct cs35l33_private *cs35l33; in cs35l33_i2c_probe() local
1121 cs35l33 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs35l33_private), in cs35l33_i2c_probe()
1123 if (!cs35l33) in cs35l33_i2c_probe()
1126 i2c_set_clientdata(i2c_client, cs35l33); in cs35l33_i2c_probe()
1127 cs35l33->regmap = devm_regmap_init_i2c(i2c_client, &cs35l33_regmap); in cs35l33_i2c_probe()
1128 if (IS_ERR(cs35l33->regmap)) { in cs35l33_i2c_probe()
1129 ret = PTR_ERR(cs35l33->regmap); in cs35l33_i2c_probe()
1134 regcache_cache_only(cs35l33->regmap, true); in cs35l33_i2c_probe()
1137 cs35l33->core_supplies[i].supply in cs35l33_i2c_probe()
1139 cs35l33->num_core_supplies = ARRAY_SIZE(cs35l33_core_supplies); in cs35l33_i2c_probe()
1142 cs35l33->num_core_supplies, in cs35l33_i2c_probe()
1143 cs35l33->core_supplies); in cs35l33_i2c_probe()
1152 cs35l33->pdata = *pdata; in cs35l33_i2c_probe()
1154 cs35l33_of_get_pdata(&i2c_client->dev, cs35l33); in cs35l33_i2c_probe()
1155 pdata = &cs35l33->pdata; in cs35l33_i2c_probe()
1160 "cs35l33", cs35l33); in cs35l33_i2c_probe()
1165 cs35l33->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev, in cs35l33_i2c_probe()
1167 if (IS_ERR(cs35l33->reset_gpio)) { in cs35l33_i2c_probe()
1170 return PTR_ERR(cs35l33->reset_gpio); in cs35l33_i2c_probe()
1173 ret = regulator_bulk_enable(cs35l33->num_core_supplies, in cs35l33_i2c_probe()
1174 cs35l33->core_supplies); in cs35l33_i2c_probe()
1182 gpiod_set_value_cansleep(cs35l33->reset_gpio, 1); in cs35l33_i2c_probe()
1185 regcache_cache_only(cs35l33->regmap, false); in cs35l33_i2c_probe()
1188 devid = cirrus_read_device_id(cs35l33->regmap, CS35L33_DEVID_AB); in cs35l33_i2c_probe()
1203 ret = regmap_read(cs35l33->regmap, CS35L33_REV_ID, &reg); in cs35l33_i2c_probe()
1212 ret = regmap_register_patch(cs35l33->regmap, in cs35l33_i2c_probe()
1221 regmap_update_bits(cs35l33->regmap, CS35L33_CLK_CTL, in cs35l33_i2c_probe()
1241 gpiod_set_value_cansleep(cs35l33->reset_gpio, 0); in cs35l33_i2c_probe()
1243 regulator_bulk_disable(cs35l33->num_core_supplies, in cs35l33_i2c_probe()
1244 cs35l33->core_supplies); in cs35l33_i2c_probe()
1251 struct cs35l33_private *cs35l33 = i2c_get_clientdata(client); in cs35l33_i2c_remove() local
1253 gpiod_set_value_cansleep(cs35l33->reset_gpio, 0); in cs35l33_i2c_remove()
1256 regulator_bulk_disable(cs35l33->num_core_supplies, in cs35l33_i2c_remove()
1257 cs35l33->core_supplies); in cs35l33_i2c_remove()