Lines Matching refs:cs35l32

349 	struct cs35l32_private *cs35l32;  in cs35l32_i2c_probe()  local
355 cs35l32 = devm_kzalloc(&i2c_client->dev, sizeof(*cs35l32), GFP_KERNEL); in cs35l32_i2c_probe()
356 if (!cs35l32) in cs35l32_i2c_probe()
359 i2c_set_clientdata(i2c_client, cs35l32); in cs35l32_i2c_probe()
361 cs35l32->regmap = devm_regmap_init_i2c(i2c_client, &cs35l32_regmap); in cs35l32_i2c_probe()
362 if (IS_ERR(cs35l32->regmap)) { in cs35l32_i2c_probe()
363 ret = PTR_ERR(cs35l32->regmap); in cs35l32_i2c_probe()
369 cs35l32->pdata = *pdata; in cs35l32_i2c_probe()
378 &cs35l32->pdata); in cs35l32_i2c_probe()
384 for (i = 0; i < ARRAY_SIZE(cs35l32->supplies); i++) in cs35l32_i2c_probe()
385 cs35l32->supplies[i].supply = cs35l32_supply_names[i]; in cs35l32_i2c_probe()
388 ARRAY_SIZE(cs35l32->supplies), in cs35l32_i2c_probe()
389 cs35l32->supplies); in cs35l32_i2c_probe()
396 ret = regulator_bulk_enable(ARRAY_SIZE(cs35l32->supplies), in cs35l32_i2c_probe()
397 cs35l32->supplies); in cs35l32_i2c_probe()
405 cs35l32->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev, in cs35l32_i2c_probe()
407 if (IS_ERR(cs35l32->reset_gpio)) { in cs35l32_i2c_probe()
408 ret = PTR_ERR(cs35l32->reset_gpio); in cs35l32_i2c_probe()
412 gpiod_set_value_cansleep(cs35l32->reset_gpio, 1); in cs35l32_i2c_probe()
415 devid = cirrus_read_device_id(cs35l32->regmap, CS35L32_DEVID_AB); in cs35l32_i2c_probe()
430 ret = regmap_read(cs35l32->regmap, CS35L32_REV_ID, &reg); in cs35l32_i2c_probe()
436 ret = regmap_register_patch(cs35l32->regmap, cs35l32_monitor_patch, in cs35l32_i2c_probe()
447 if (cs35l32->pdata.boost_mng) in cs35l32_i2c_probe()
448 regmap_update_bits(cs35l32->regmap, CS35L32_AUDIO_LED_MNGR, in cs35l32_i2c_probe()
450 cs35l32->pdata.boost_mng); in cs35l32_i2c_probe()
453 if (cs35l32->pdata.sdout_share) in cs35l32_i2c_probe()
454 regmap_update_bits(cs35l32->regmap, CS35L32_ADSP_CTL, in cs35l32_i2c_probe()
456 cs35l32->pdata.sdout_share << 3); in cs35l32_i2c_probe()
459 if (cs35l32->pdata.sdout_datacfg) in cs35l32_i2c_probe()
460 regmap_update_bits(cs35l32->regmap, CS35L32_ADSP_CTL, in cs35l32_i2c_probe()
462 cs35l32->pdata.sdout_datacfg << 4); in cs35l32_i2c_probe()
465 if (cs35l32->pdata.batt_recov) in cs35l32_i2c_probe()
466 regmap_update_bits(cs35l32->regmap, CS35L32_BATT_THRESHOLD, in cs35l32_i2c_probe()
468 cs35l32->pdata.batt_recov << 1); in cs35l32_i2c_probe()
471 if (cs35l32->pdata.batt_thresh) in cs35l32_i2c_probe()
472 regmap_update_bits(cs35l32->regmap, CS35L32_BATT_THRESHOLD, in cs35l32_i2c_probe()
474 cs35l32->pdata.batt_thresh << 4); in cs35l32_i2c_probe()
477 regmap_update_bits(cs35l32->regmap, CS35L32_PWRCTL1, CS35L32_PDN_AMP, in cs35l32_i2c_probe()
481 regmap_read(cs35l32->regmap, CS35L32_INT_STATUS_1, &reg); in cs35l32_i2c_probe()
492 gpiod_set_value_cansleep(cs35l32->reset_gpio, 0); in cs35l32_i2c_probe()
494 regulator_bulk_disable(ARRAY_SIZE(cs35l32->supplies), in cs35l32_i2c_probe()
495 cs35l32->supplies); in cs35l32_i2c_probe()
501 struct cs35l32_private *cs35l32 = i2c_get_clientdata(i2c_client); in cs35l32_i2c_remove() local
504 gpiod_set_value_cansleep(cs35l32->reset_gpio, 0); in cs35l32_i2c_remove()
510 struct cs35l32_private *cs35l32 = dev_get_drvdata(dev); in cs35l32_runtime_suspend() local
512 regcache_cache_only(cs35l32->regmap, true); in cs35l32_runtime_suspend()
513 regcache_mark_dirty(cs35l32->regmap); in cs35l32_runtime_suspend()
516 gpiod_set_value_cansleep(cs35l32->reset_gpio, 0); in cs35l32_runtime_suspend()
519 regulator_bulk_disable(ARRAY_SIZE(cs35l32->supplies), in cs35l32_runtime_suspend()
520 cs35l32->supplies); in cs35l32_runtime_suspend()
527 struct cs35l32_private *cs35l32 = dev_get_drvdata(dev); in cs35l32_runtime_resume() local
531 ret = regulator_bulk_enable(ARRAY_SIZE(cs35l32->supplies), in cs35l32_runtime_resume()
532 cs35l32->supplies); in cs35l32_runtime_resume()
539 gpiod_set_value_cansleep(cs35l32->reset_gpio, 1); in cs35l32_runtime_resume()
541 regcache_cache_only(cs35l32->regmap, false); in cs35l32_runtime_resume()
542 regcache_sync(cs35l32->regmap); in cs35l32_runtime_resume()