Lines Matching defs:cs35l33

3  * cs35l33.c -- CS35L33 ALSA SoC audio driver
26 #include <sound/cs35l33.h>
34 #include "cs35l33.h"
459 * tdm mode in cs35l33 resembles dsp-a mode very
638 struct cs35l33_private *cs35l33 = snd_soc_component_get_drvdata(component);
644 regmap_update_bits(cs35l33->regmap, CS35L33_CLK_CTL,
646 cs35l33->mclk_int = freq;
651 regmap_update_bits(cs35l33->regmap, CS35L33_CLK_CTL,
653 cs35l33->mclk_int = freq/2;
656 cs35l33->mclk_int = 0;
661 freq, cs35l33->mclk_int);
675 .name = "cs35l33-dai",
746 struct cs35l33_private *cs35l33 = snd_soc_component_get_drvdata(component);
768 regmap_write(cs35l33->regmap, CS35L33_BST_PEAK_CTL,
777 struct cs35l33_private *cs35l33 = snd_soc_component_get_drvdata(component);
779 cs35l33->component = component;
782 regmap_update_bits(cs35l33->regmap, CS35L33_PROTECT_CTL,
784 regmap_update_bits(cs35l33->regmap, CS35L33_BST_CTL2,
789 regmap_update_bits(cs35l33->regmap, CS35L33_BST_CTL1,
790 CS35L33_BST_CTL_MASK, cs35l33->pdata.boost_ctl);
791 regmap_update_bits(cs35l33->regmap, CS35L33_CLASSD_CTL,
793 cs35l33->pdata.amp_drv_sel << CS35L33_AMP_DRV_SEL_SHIFT);
795 if (cs35l33->pdata.boost_ipk)
796 cs35l33_set_bst_ipk(component, cs35l33->pdata.boost_ipk);
798 if (cs35l33->enable_soft_ramp) {
802 CS35L33_DSR_RATE, cs35l33->pdata.ramp_rate);
809 if (cs35l33->pdata.imon_adc_scale != 0x8)
811 CS35L33_IMON_SCALE, cs35l33->pdata.imon_adc_scale);
813 cs35l33_set_hg_data(component, &(cs35l33->pdata));
819 regmap_update_bits(cs35l33->regmap, CS35L33_INT_MASK_1,
860 struct cs35l33_private *cs35l33 = dev_get_drvdata(dev);
865 gpiod_set_value_cansleep(cs35l33->reset_gpio, 0);
867 ret = regulator_bulk_enable(cs35l33->num_core_supplies,
868 cs35l33->core_supplies);
874 regcache_cache_only(cs35l33->regmap, false);
876 gpiod_set_value_cansleep(cs35l33->reset_gpio, 1);
880 ret = regcache_sync(cs35l33->regmap);
889 regcache_cache_only(cs35l33->regmap, true);
890 regulator_bulk_disable(cs35l33->num_core_supplies,
891 cs35l33->core_supplies);
898 struct cs35l33_private *cs35l33 = dev_get_drvdata(dev);
903 cs35l33->amp_cal = false;
905 regcache_cache_only(cs35l33->regmap, true);
906 regcache_mark_dirty(cs35l33->regmap);
907 regulator_bulk_disable(cs35l33->num_core_supplies,
908 cs35l33->core_supplies);
962 struct cs35l33_private *cs35l33 = data;
963 struct snd_soc_component *component = cs35l33->component;
966 regmap_read(cs35l33->regmap, CS35L33_INT_STATUS_2,
968 regmap_read(cs35l33->regmap, CS35L33_INT_STATUS_1,
970 regmap_read(cs35l33->regmap, CS35L33_INT_MASK_2, &mask2);
971 regmap_read(cs35l33->regmap, CS35L33_INT_MASK_1, &mask1);
979 regmap_read(cs35l33->regmap, CS35L33_INT_STATUS_1,
989 regmap_update_bits(cs35l33->regmap,
992 regmap_update_bits(cs35l33->regmap,
996 regmap_update_bits(cs35l33->regmap,
1006 cs35l33->amp_cal = false;
1010 regmap_update_bits(cs35l33->regmap,
1013 regmap_update_bits(cs35l33->regmap,
1016 regmap_update_bits(cs35l33->regmap,
1027 regmap_update_bits(cs35l33->regmap,
1029 regmap_update_bits(cs35l33->regmap,
1032 regmap_update_bits(cs35l33->regmap,
1042 regmap_update_bits(cs35l33->regmap,
1044 regmap_update_bits(cs35l33->regmap,
1047 regmap_update_bits(cs35l33->regmap,
1078 struct cs35l33_private *cs35l33)
1081 struct cs35l33_pdata *pdata = &cs35l33->pdata;
1094 cs35l33->enable_soft_ramp = true;
1119 struct cs35l33_private *cs35l33;
1124 cs35l33 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs35l33_private),
1126 if (!cs35l33)
1129 i2c_set_clientdata(i2c_client, cs35l33);
1130 cs35l33->regmap = devm_regmap_init_i2c(i2c_client, &cs35l33_regmap);
1131 if (IS_ERR(cs35l33->regmap)) {
1132 ret = PTR_ERR(cs35l33->regmap);
1137 regcache_cache_only(cs35l33->regmap, true);
1140 cs35l33->core_supplies[i].supply
1142 cs35l33->num_core_supplies = ARRAY_SIZE(cs35l33_core_supplies);
1145 cs35l33->num_core_supplies,
1146 cs35l33->core_supplies);
1155 cs35l33->pdata = *pdata;
1157 cs35l33_of_get_pdata(&i2c_client->dev, cs35l33);
1158 pdata = &cs35l33->pdata;
1163 "cs35l33", cs35l33);
1168 cs35l33->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev,
1170 if (IS_ERR(cs35l33->reset_gpio)) {
1173 return PTR_ERR(cs35l33->reset_gpio);
1176 ret = regulator_bulk_enable(cs35l33->num_core_supplies,
1177 cs35l33->core_supplies);
1185 gpiod_set_value_cansleep(cs35l33->reset_gpio, 1);
1188 regcache_cache_only(cs35l33->regmap, false);
1191 ret = regmap_read(cs35l33->regmap, CS35L33_DEVID_AB, &reg);
1193 ret = regmap_read(cs35l33->regmap, CS35L33_DEVID_CD, &reg);
1195 ret = regmap_read(cs35l33->regmap, CS35L33_DEVID_E, &reg);
1206 ret = regmap_read(cs35l33->regmap, CS35L33_REV_ID, &reg);
1215 ret = regmap_register_patch(cs35l33->regmap,
1224 regmap_update_bits(cs35l33->regmap, CS35L33_CLK_CTL,
1244 regulator_bulk_disable(cs35l33->num_core_supplies,
1245 cs35l33->core_supplies);
1252 struct cs35l33_private *cs35l33 = i2c_get_clientdata(client);
1254 gpiod_set_value_cansleep(cs35l33->reset_gpio, 0);
1257 regulator_bulk_disable(cs35l33->num_core_supplies,
1258 cs35l33->core_supplies);
1264 { .compatible = "cirrus,cs35l33", },
1270 {"cs35l33", 0},
1278 .name = "cs35l33",