Lines Matching refs:cs53l30

924 	struct cs53l30_private *cs53l30;  in cs53l30_i2c_probe()  local
929 cs53l30 = devm_kzalloc(dev, sizeof(*cs53l30), GFP_KERNEL); in cs53l30_i2c_probe()
930 if (!cs53l30) in cs53l30_i2c_probe()
933 for (i = 0; i < ARRAY_SIZE(cs53l30->supplies); i++) in cs53l30_i2c_probe()
934 cs53l30->supplies[i].supply = cs53l30_supply_names[i]; in cs53l30_i2c_probe()
936 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(cs53l30->supplies), in cs53l30_i2c_probe()
937 cs53l30->supplies); in cs53l30_i2c_probe()
943 ret = regulator_bulk_enable(ARRAY_SIZE(cs53l30->supplies), in cs53l30_i2c_probe()
944 cs53l30->supplies); in cs53l30_i2c_probe()
951 cs53l30->reset_gpio = devm_gpiod_get_optional(dev, "reset", in cs53l30_i2c_probe()
953 if (IS_ERR(cs53l30->reset_gpio)) { in cs53l30_i2c_probe()
954 ret = PTR_ERR(cs53l30->reset_gpio); in cs53l30_i2c_probe()
958 gpiod_set_value_cansleep(cs53l30->reset_gpio, 1); in cs53l30_i2c_probe()
960 i2c_set_clientdata(client, cs53l30); in cs53l30_i2c_probe()
962 cs53l30->mclk_rate = 0; in cs53l30_i2c_probe()
964 cs53l30->regmap = devm_regmap_init_i2c(client, &cs53l30_regmap); in cs53l30_i2c_probe()
965 if (IS_ERR(cs53l30->regmap)) { in cs53l30_i2c_probe()
966 ret = PTR_ERR(cs53l30->regmap); in cs53l30_i2c_probe()
972 devid = cirrus_read_device_id(cs53l30->regmap, CS53L30_DEVID_AB); in cs53l30_i2c_probe()
986 ret = regmap_read(cs53l30->regmap, CS53L30_REVID, &reg); in cs53l30_i2c_probe()
993 cs53l30->mclk = devm_clk_get(dev, "mclk"); in cs53l30_i2c_probe()
994 if (IS_ERR(cs53l30->mclk)) { in cs53l30_i2c_probe()
995 if (PTR_ERR(cs53l30->mclk) != -ENOENT) { in cs53l30_i2c_probe()
996 ret = PTR_ERR(cs53l30->mclk); in cs53l30_i2c_probe()
1000 cs53l30->mclk = NULL; in cs53l30_i2c_probe()
1004 cs53l30->mute_gpio = devm_gpiod_get_optional(dev, "mute", in cs53l30_i2c_probe()
1006 if (IS_ERR(cs53l30->mute_gpio)) { in cs53l30_i2c_probe()
1007 ret = PTR_ERR(cs53l30->mute_gpio); in cs53l30_i2c_probe()
1011 if (cs53l30->mute_gpio) { in cs53l30_i2c_probe()
1013 regmap_write(cs53l30->regmap, CS53L30_MUTEP_CTL1, in cs53l30_i2c_probe()
1016 if (gpiod_is_active_low(cs53l30->mute_gpio)) in cs53l30_i2c_probe()
1017 regmap_update_bits(cs53l30->regmap, CS53L30_MUTEP_CTL2, in cs53l30_i2c_probe()
1022 regmap_update_bits(cs53l30->regmap, CS53L30_MICBIAS_CTL, in cs53l30_i2c_probe()
1026 cs53l30->use_sdout2 = true; in cs53l30_i2c_probe()
1039 gpiod_set_value_cansleep(cs53l30->reset_gpio, 0); in cs53l30_i2c_probe()
1041 regulator_bulk_disable(ARRAY_SIZE(cs53l30->supplies), in cs53l30_i2c_probe()
1042 cs53l30->supplies); in cs53l30_i2c_probe()
1048 struct cs53l30_private *cs53l30 = i2c_get_clientdata(client); in cs53l30_i2c_remove() local
1051 gpiod_set_value_cansleep(cs53l30->reset_gpio, 0); in cs53l30_i2c_remove()
1053 regulator_bulk_disable(ARRAY_SIZE(cs53l30->supplies), in cs53l30_i2c_remove()
1054 cs53l30->supplies); in cs53l30_i2c_remove()
1060 struct cs53l30_private *cs53l30 = dev_get_drvdata(dev); in cs53l30_runtime_suspend() local
1062 regcache_cache_only(cs53l30->regmap, true); in cs53l30_runtime_suspend()
1065 gpiod_set_value_cansleep(cs53l30->reset_gpio, 0); in cs53l30_runtime_suspend()
1067 regulator_bulk_disable(ARRAY_SIZE(cs53l30->supplies), in cs53l30_runtime_suspend()
1068 cs53l30->supplies); in cs53l30_runtime_suspend()
1075 struct cs53l30_private *cs53l30 = dev_get_drvdata(dev); in cs53l30_runtime_resume() local
1078 ret = regulator_bulk_enable(ARRAY_SIZE(cs53l30->supplies), in cs53l30_runtime_resume()
1079 cs53l30->supplies); in cs53l30_runtime_resume()
1085 gpiod_set_value_cansleep(cs53l30->reset_gpio, 1); in cs53l30_runtime_resume()
1087 regcache_cache_only(cs53l30->regmap, false); in cs53l30_runtime_resume()
1088 ret = regcache_sync(cs53l30->regmap); in cs53l30_runtime_resume()