Lines Matching refs:cs35l34

605 	struct cs35l34_private *cs35l34 = snd_soc_component_get_drvdata(component);  in cs35l34_dai_set_sysclk()  local
611 cs35l34->mclk_int = freq; in cs35l34_dai_set_sysclk()
615 cs35l34->mclk_int = freq; in cs35l34_dai_set_sysclk()
619 cs35l34->mclk_int = freq; in cs35l34_dai_set_sysclk()
623 cs35l34->mclk_int = freq / 2; in cs35l34_dai_set_sysclk()
627 cs35l34->mclk_int = freq / 2; in cs35l34_dai_set_sysclk()
631 cs35l34->mclk_int = freq / 2; in cs35l34_dai_set_sysclk()
635 cs35l34->mclk_int = 0; in cs35l34_dai_set_sysclk()
638 regmap_update_bits(cs35l34->regmap, CS35L34_MCLK_CTL, in cs35l34_dai_set_sysclk()
673 static int cs35l34_boost_inductor(struct cs35l34_private *cs35l34, in cs35l34_boost_inductor() argument
676 struct snd_soc_component *component = cs35l34->component; in cs35l34_boost_inductor()
680 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_COEF_1, 0x24); in cs35l34_boost_inductor()
681 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_COEF_2, 0x24); in cs35l34_boost_inductor()
682 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_SLOPE_COMP, in cs35l34_boost_inductor()
684 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_SW_FREQ, 0); in cs35l34_boost_inductor()
687 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_COEF_1, 0x20); in cs35l34_boost_inductor()
688 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_COEF_2, 0x20); in cs35l34_boost_inductor()
689 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_SLOPE_COMP, in cs35l34_boost_inductor()
691 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_SW_FREQ, 1); in cs35l34_boost_inductor()
694 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_COEF_1, 0x20); in cs35l34_boost_inductor()
695 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_COEF_2, 0x20); in cs35l34_boost_inductor()
696 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_SLOPE_COMP, in cs35l34_boost_inductor()
698 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_SW_FREQ, 2); in cs35l34_boost_inductor()
701 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_COEF_1, 0x19); in cs35l34_boost_inductor()
702 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_COEF_2, 0x25); in cs35l34_boost_inductor()
703 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_SLOPE_COMP, in cs35l34_boost_inductor()
705 regmap_write(cs35l34->regmap, CS35L34_BST_CONV_SW_FREQ, 3); in cs35l34_boost_inductor()
718 struct cs35l34_private *cs35l34 = snd_soc_component_get_drvdata(component); in cs35l34_probe() local
723 regmap_update_bits(cs35l34->regmap, CS35L34_PROTECT_CTL, in cs35l34_probe()
729 regmap_write(cs35l34->regmap, CS35L34_PWRCTL2, 0xFD); in cs35l34_probe()
730 regmap_write(cs35l34->regmap, CS35L34_PWRCTL3, 0x1F); in cs35l34_probe()
733 regmap_update_bits(cs35l34->regmap, CS35L34_PROTECT_CTL, in cs35l34_probe()
737 if (cs35l34->pdata.boost_peak) in cs35l34_probe()
738 regmap_update_bits(cs35l34->regmap, CS35L34_BST_PEAK_I, in cs35l34_probe()
740 cs35l34->pdata.boost_peak); in cs35l34_probe()
742 if (cs35l34->pdata.gain_zc_disable) in cs35l34_probe()
743 regmap_update_bits(cs35l34->regmap, CS35L34_PROTECT_CTL, in cs35l34_probe()
746 regmap_update_bits(cs35l34->regmap, CS35L34_PROTECT_CTL, in cs35l34_probe()
749 if (cs35l34->pdata.aif_half_drv) in cs35l34_probe()
750 regmap_update_bits(cs35l34->regmap, CS35L34_ADSP_CLK_CTL, in cs35l34_probe()
753 if (cs35l34->pdata.digsft_disable) in cs35l34_probe()
754 regmap_update_bits(cs35l34->regmap, CS35L34_AMP_DIG_VOL_CTL, in cs35l34_probe()
757 if (cs35l34->pdata.amp_inv) in cs35l34_probe()
758 regmap_update_bits(cs35l34->regmap, CS35L34_AMP_DIG_VOL_CTL, in cs35l34_probe()
761 if (cs35l34->pdata.boost_ind) in cs35l34_probe()
762 ret = cs35l34_boost_inductor(cs35l34, cs35l34->pdata.boost_ind); in cs35l34_probe()
764 if (cs35l34->pdata.i2s_sdinloc) in cs35l34_probe()
765 regmap_update_bits(cs35l34->regmap, CS35L34_ADSP_I2S_CTL, in cs35l34_probe()
767 cs35l34->pdata.i2s_sdinloc << CS35L34_I2S_LOC_SHIFT); in cs35l34_probe()
769 if (cs35l34->pdata.tdm_rising_edge) in cs35l34_probe()
770 regmap_update_bits(cs35l34->regmap, CS35L34_ADSP_TDM_CTL, in cs35l34_probe()
867 struct cs35l34_private *cs35l34 = data; in cs35l34_irq_thread() local
868 struct snd_soc_component *component = cs35l34->component; in cs35l34_irq_thread()
874 regmap_read(cs35l34->regmap, CS35L34_INT_STATUS_4, &sticky4); in cs35l34_irq_thread()
875 regmap_read(cs35l34->regmap, CS35L34_INT_STATUS_3, &sticky3); in cs35l34_irq_thread()
876 regmap_read(cs35l34->regmap, CS35L34_INT_STATUS_2, &sticky2); in cs35l34_irq_thread()
877 regmap_read(cs35l34->regmap, CS35L34_INT_STATUS_1, &sticky1); in cs35l34_irq_thread()
879 regmap_read(cs35l34->regmap, CS35L34_INT_MASK_4, &mask4); in cs35l34_irq_thread()
880 regmap_read(cs35l34->regmap, CS35L34_INT_MASK_3, &mask3); in cs35l34_irq_thread()
881 regmap_read(cs35l34->regmap, CS35L34_INT_MASK_2, &mask2); in cs35l34_irq_thread()
882 regmap_read(cs35l34->regmap, CS35L34_INT_MASK_1, &mask1); in cs35l34_irq_thread()
888 regmap_read(cs35l34->regmap, CS35L34_INT_STATUS_1, &current1); in cs35l34_irq_thread()
896 regmap_update_bits(cs35l34->regmap, in cs35l34_irq_thread()
899 regmap_update_bits(cs35l34->regmap, in cs35l34_irq_thread()
903 regmap_update_bits(cs35l34->regmap, in cs35l34_irq_thread()
920 regmap_update_bits(cs35l34->regmap, in cs35l34_irq_thread()
923 regmap_update_bits(cs35l34->regmap, in cs35l34_irq_thread()
927 regmap_update_bits(cs35l34->regmap, in cs35l34_irq_thread()
940 regmap_update_bits(cs35l34->regmap, in cs35l34_irq_thread()
943 regmap_update_bits(cs35l34->regmap, in cs35l34_irq_thread()
947 regmap_update_bits(cs35l34->regmap, in cs35l34_irq_thread()
960 regmap_update_bits(cs35l34->regmap, in cs35l34_irq_thread()
963 regmap_update_bits(cs35l34->regmap, in cs35l34_irq_thread()
967 regmap_update_bits(cs35l34->regmap, in cs35l34_irq_thread()
975 regmap_update_bits(cs35l34->regmap, CS35L34_PWRCTL2, in cs35l34_irq_thread()
977 regmap_update_bits(cs35l34->regmap, CS35L34_PWRCTL1, in cs35l34_irq_thread()
983 regmap_update_bits(cs35l34->regmap, CS35L34_PWRCTL2, in cs35l34_irq_thread()
985 regmap_update_bits(cs35l34->regmap, CS35L34_PWRCTL1, in cs35l34_irq_thread()
999 struct cs35l34_private *cs35l34; in cs35l34_i2c_probe() local
1006 cs35l34 = devm_kzalloc(&i2c_client->dev, sizeof(*cs35l34), GFP_KERNEL); in cs35l34_i2c_probe()
1007 if (!cs35l34) in cs35l34_i2c_probe()
1010 i2c_set_clientdata(i2c_client, cs35l34); in cs35l34_i2c_probe()
1011 cs35l34->regmap = devm_regmap_init_i2c(i2c_client, &cs35l34_regmap); in cs35l34_i2c_probe()
1012 if (IS_ERR(cs35l34->regmap)) { in cs35l34_i2c_probe()
1013 ret = PTR_ERR(cs35l34->regmap); in cs35l34_i2c_probe()
1018 cs35l34->num_core_supplies = ARRAY_SIZE(cs35l34_core_supplies); in cs35l34_i2c_probe()
1020 cs35l34->core_supplies[i].supply = cs35l34_core_supplies[i]; in cs35l34_i2c_probe()
1023 cs35l34->num_core_supplies, in cs35l34_i2c_probe()
1024 cs35l34->core_supplies); in cs35l34_i2c_probe()
1031 ret = regulator_bulk_enable(cs35l34->num_core_supplies, in cs35l34_i2c_probe()
1032 cs35l34->core_supplies); in cs35l34_i2c_probe()
1040 cs35l34->pdata = *pdata; in cs35l34_i2c_probe()
1055 cs35l34->pdata = *pdata; in cs35l34_i2c_probe()
1060 "cs35l34", cs35l34); in cs35l34_i2c_probe()
1064 cs35l34->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev, in cs35l34_i2c_probe()
1066 if (IS_ERR(cs35l34->reset_gpio)) { in cs35l34_i2c_probe()
1067 ret = PTR_ERR(cs35l34->reset_gpio); in cs35l34_i2c_probe()
1071 gpiod_set_value_cansleep(cs35l34->reset_gpio, 1); in cs35l34_i2c_probe()
1075 devid = cirrus_read_device_id(cs35l34->regmap, CS35L34_DEVID_AB); in cs35l34_i2c_probe()
1090 ret = regmap_read(cs35l34->regmap, CS35L34_REV_ID, &reg); in cs35l34_i2c_probe()
1101 regmap_update_bits(cs35l34->regmap, CS35L34_INT_MASK_1, in cs35l34_i2c_probe()
1105 regmap_update_bits(cs35l34->regmap, CS35L34_INT_MASK_3, in cs35l34_i2c_probe()
1124 gpiod_set_value_cansleep(cs35l34->reset_gpio, 0); in cs35l34_i2c_probe()
1126 regulator_bulk_disable(cs35l34->num_core_supplies, in cs35l34_i2c_probe()
1127 cs35l34->core_supplies); in cs35l34_i2c_probe()
1134 struct cs35l34_private *cs35l34 = i2c_get_clientdata(client); in cs35l34_i2c_remove() local
1136 gpiod_set_value_cansleep(cs35l34->reset_gpio, 0); in cs35l34_i2c_remove()
1139 regulator_bulk_disable(cs35l34->num_core_supplies, in cs35l34_i2c_remove()
1140 cs35l34->core_supplies); in cs35l34_i2c_remove()
1147 struct cs35l34_private *cs35l34 = dev_get_drvdata(dev); in cs35l34_runtime_resume() local
1150 ret = regulator_bulk_enable(cs35l34->num_core_supplies, in cs35l34_runtime_resume()
1151 cs35l34->core_supplies); in cs35l34_runtime_resume()
1159 regcache_cache_only(cs35l34->regmap, false); in cs35l34_runtime_resume()
1161 gpiod_set_value_cansleep(cs35l34->reset_gpio, 1); in cs35l34_runtime_resume()
1164 ret = regcache_sync(cs35l34->regmap); in cs35l34_runtime_resume()
1171 regcache_cache_only(cs35l34->regmap, true); in cs35l34_runtime_resume()
1172 regulator_bulk_disable(cs35l34->num_core_supplies, in cs35l34_runtime_resume()
1173 cs35l34->core_supplies); in cs35l34_runtime_resume()
1180 struct cs35l34_private *cs35l34 = dev_get_drvdata(dev); in cs35l34_runtime_suspend() local
1182 regcache_cache_only(cs35l34->regmap, true); in cs35l34_runtime_suspend()
1183 regcache_mark_dirty(cs35l34->regmap); in cs35l34_runtime_suspend()
1185 gpiod_set_value_cansleep(cs35l34->reset_gpio, 0); in cs35l34_runtime_suspend()
1187 regulator_bulk_disable(cs35l34->num_core_supplies, in cs35l34_runtime_suspend()
1188 cs35l34->core_supplies); in cs35l34_runtime_suspend()