Lines Matching refs:cs35l33
641 struct cs35l33_private *cs35l33 = snd_soc_component_get_drvdata(component); in cs35l33_component_set_sysclk() local
647 regmap_update_bits(cs35l33->regmap, CS35L33_CLK_CTL, in cs35l33_component_set_sysclk()
649 cs35l33->mclk_int = freq; in cs35l33_component_set_sysclk()
654 regmap_update_bits(cs35l33->regmap, CS35L33_CLK_CTL, in cs35l33_component_set_sysclk()
656 cs35l33->mclk_int = freq/2; in cs35l33_component_set_sysclk()
659 cs35l33->mclk_int = 0; in cs35l33_component_set_sysclk()
664 freq, cs35l33->mclk_int); in cs35l33_component_set_sysclk()
749 struct cs35l33_private *cs35l33 = snd_soc_component_get_drvdata(component); in cs35l33_set_bst_ipk() local
771 regmap_write(cs35l33->regmap, CS35L33_BST_PEAK_CTL, in cs35l33_set_bst_ipk()
780 struct cs35l33_private *cs35l33 = snd_soc_component_get_drvdata(component); in cs35l33_probe() local
782 cs35l33->component = component; in cs35l33_probe()
785 regmap_update_bits(cs35l33->regmap, CS35L33_PROTECT_CTL, in cs35l33_probe()
787 regmap_update_bits(cs35l33->regmap, CS35L33_BST_CTL2, in cs35l33_probe()
792 regmap_update_bits(cs35l33->regmap, CS35L33_BST_CTL1, in cs35l33_probe()
793 CS35L33_BST_CTL_MASK, cs35l33->pdata.boost_ctl); in cs35l33_probe()
794 regmap_update_bits(cs35l33->regmap, CS35L33_CLASSD_CTL, in cs35l33_probe()
796 cs35l33->pdata.amp_drv_sel << CS35L33_AMP_DRV_SEL_SHIFT); in cs35l33_probe()
798 if (cs35l33->pdata.boost_ipk) in cs35l33_probe()
799 cs35l33_set_bst_ipk(component, cs35l33->pdata.boost_ipk); in cs35l33_probe()
801 if (cs35l33->enable_soft_ramp) { in cs35l33_probe()
805 CS35L33_DSR_RATE, cs35l33->pdata.ramp_rate); in cs35l33_probe()
812 if (cs35l33->pdata.imon_adc_scale != 0x8) in cs35l33_probe()
814 CS35L33_IMON_SCALE, cs35l33->pdata.imon_adc_scale); in cs35l33_probe()
816 cs35l33_set_hg_data(component, &(cs35l33->pdata)); in cs35l33_probe()
822 regmap_update_bits(cs35l33->regmap, CS35L33_INT_MASK_1, in cs35l33_probe()
862 struct cs35l33_private *cs35l33 = dev_get_drvdata(dev); in cs35l33_runtime_resume() local
867 gpiod_set_value_cansleep(cs35l33->reset_gpio, 0); in cs35l33_runtime_resume()
869 ret = regulator_bulk_enable(cs35l33->num_core_supplies, in cs35l33_runtime_resume()
870 cs35l33->core_supplies); in cs35l33_runtime_resume()
876 regcache_cache_only(cs35l33->regmap, false); in cs35l33_runtime_resume()
878 gpiod_set_value_cansleep(cs35l33->reset_gpio, 1); in cs35l33_runtime_resume()
882 ret = regcache_sync(cs35l33->regmap); in cs35l33_runtime_resume()
891 regcache_cache_only(cs35l33->regmap, true); in cs35l33_runtime_resume()
892 regulator_bulk_disable(cs35l33->num_core_supplies, in cs35l33_runtime_resume()
893 cs35l33->core_supplies); in cs35l33_runtime_resume()
900 struct cs35l33_private *cs35l33 = dev_get_drvdata(dev); in cs35l33_runtime_suspend() local
905 cs35l33->amp_cal = false; in cs35l33_runtime_suspend()
907 regcache_cache_only(cs35l33->regmap, true); in cs35l33_runtime_suspend()
908 regcache_mark_dirty(cs35l33->regmap); in cs35l33_runtime_suspend()
909 regulator_bulk_disable(cs35l33->num_core_supplies, in cs35l33_runtime_suspend()
910 cs35l33->core_supplies); in cs35l33_runtime_suspend()
964 struct cs35l33_private *cs35l33 = data; in cs35l33_irq_thread() local
965 struct snd_soc_component *component = cs35l33->component; in cs35l33_irq_thread()
968 regmap_read(cs35l33->regmap, CS35L33_INT_STATUS_2, in cs35l33_irq_thread()
970 regmap_read(cs35l33->regmap, CS35L33_INT_STATUS_1, in cs35l33_irq_thread()
972 regmap_read(cs35l33->regmap, CS35L33_INT_MASK_2, &mask2); in cs35l33_irq_thread()
973 regmap_read(cs35l33->regmap, CS35L33_INT_MASK_1, &mask1); in cs35l33_irq_thread()
981 regmap_read(cs35l33->regmap, CS35L33_INT_STATUS_1, in cs35l33_irq_thread()
991 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
994 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
998 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1008 cs35l33->amp_cal = false; in cs35l33_irq_thread()
1012 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1015 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1018 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1029 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1031 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1034 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1044 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1046 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1049 regmap_update_bits(cs35l33->regmap, in cs35l33_irq_thread()
1080 struct cs35l33_private *cs35l33) in cs35l33_of_get_pdata() argument
1083 struct cs35l33_pdata *pdata = &cs35l33->pdata; in cs35l33_of_get_pdata()
1096 cs35l33->enable_soft_ramp = true; in cs35l33_of_get_pdata()
1120 struct cs35l33_private *cs35l33; in cs35l33_i2c_probe() local
1125 cs35l33 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs35l33_private), in cs35l33_i2c_probe()
1127 if (!cs35l33) in cs35l33_i2c_probe()
1130 i2c_set_clientdata(i2c_client, cs35l33); in cs35l33_i2c_probe()
1131 cs35l33->regmap = devm_regmap_init_i2c(i2c_client, &cs35l33_regmap); in cs35l33_i2c_probe()
1132 if (IS_ERR(cs35l33->regmap)) { in cs35l33_i2c_probe()
1133 ret = PTR_ERR(cs35l33->regmap); in cs35l33_i2c_probe()
1138 regcache_cache_only(cs35l33->regmap, true); in cs35l33_i2c_probe()
1141 cs35l33->core_supplies[i].supply in cs35l33_i2c_probe()
1143 cs35l33->num_core_supplies = ARRAY_SIZE(cs35l33_core_supplies); in cs35l33_i2c_probe()
1146 cs35l33->num_core_supplies, in cs35l33_i2c_probe()
1147 cs35l33->core_supplies); in cs35l33_i2c_probe()
1156 cs35l33->pdata = *pdata; in cs35l33_i2c_probe()
1158 cs35l33_of_get_pdata(&i2c_client->dev, cs35l33); in cs35l33_i2c_probe()
1159 pdata = &cs35l33->pdata; in cs35l33_i2c_probe()
1164 "cs35l33", cs35l33); in cs35l33_i2c_probe()
1169 cs35l33->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev, in cs35l33_i2c_probe()
1171 if (IS_ERR(cs35l33->reset_gpio)) { in cs35l33_i2c_probe()
1174 return PTR_ERR(cs35l33->reset_gpio); in cs35l33_i2c_probe()
1177 ret = regulator_bulk_enable(cs35l33->num_core_supplies, in cs35l33_i2c_probe()
1178 cs35l33->core_supplies); in cs35l33_i2c_probe()
1186 gpiod_set_value_cansleep(cs35l33->reset_gpio, 1); in cs35l33_i2c_probe()
1189 regcache_cache_only(cs35l33->regmap, false); in cs35l33_i2c_probe()
1192 devid = cirrus_read_device_id(cs35l33->regmap, CS35L33_DEVID_AB); in cs35l33_i2c_probe()
1207 ret = regmap_read(cs35l33->regmap, CS35L33_REV_ID, ®); in cs35l33_i2c_probe()
1216 ret = regmap_register_patch(cs35l33->regmap, in cs35l33_i2c_probe()
1225 regmap_update_bits(cs35l33->regmap, CS35L33_CLK_CTL, in cs35l33_i2c_probe()
1245 gpiod_set_value_cansleep(cs35l33->reset_gpio, 0); in cs35l33_i2c_probe()
1247 regulator_bulk_disable(cs35l33->num_core_supplies, in cs35l33_i2c_probe()
1248 cs35l33->core_supplies); in cs35l33_i2c_probe()
1255 struct cs35l33_private *cs35l33 = i2c_get_clientdata(client); in cs35l33_i2c_remove() local
1257 gpiod_set_value_cansleep(cs35l33->reset_gpio, 0); in cs35l33_i2c_remove()
1260 regulator_bulk_disable(cs35l33->num_core_supplies, in cs35l33_i2c_remove()
1261 cs35l33->core_supplies); in cs35l33_i2c_remove()