Lines Matching defs:st

127 	struct adau7118_data *st =
131 dev_dbg(st->dev, "Set channel map, %d", tx_num);
147 struct adau7118_data *st =
152 dev_dbg(st->dev, "Set format, fmt:%d\n", fmt);
168 st->right_j = true;
171 dev_err(st->dev, "Invalid format %d",
193 dev_err(st->dev, "Invalid Inv mask %d",
210 struct adau7118_data *st =
214 dev_dbg(st->dev, "Set tristate, %d\n", tristate);
230 struct adau7118_data *st =
235 dev_dbg(st->dev, "Set tdm, slots:%d width:%d\n", slots, slot_width);
248 dev_err(st->dev, "Invalid slot width:%d\n", slot_width);
258 st->slot_width = slot_width;
259 st->slots = slots;
268 struct adau7118_data *st =
274 if (!st->slots) {
285 slots_width = st->slot_width;
289 dev_err(st->dev, "Invalid data_width:%d, slots_width:%d",
294 if (st->right_j) {
309 dev_err(st->dev,
329 struct adau7118_data *st = snd_soc_component_get_drvdata(component);
332 dev_dbg(st->dev, "Set bias level %d\n", level);
343 ret = regulator_enable(st->iovdd);
348 ret = regulator_enable(st->dvdd);
350 regulator_disable(st->iovdd);
354 if (st->hw_mode)
357 regcache_cache_only(st->map, false);
364 ret = regulator_disable(st->dvdd);
368 ret = regulator_disable(st->iovdd);
372 if (st->hw_mode)
376 regcache_mark_dirty(st->map);
377 regcache_cache_only(st->map, true);
387 struct adau7118_data *st = snd_soc_component_get_drvdata(component);
392 if (st->hw_mode) {
401 snd_soc_component_init_regmap(component, st->map);
447 static int adau7118_regulator_setup(struct adau7118_data *st)
449 st->iovdd = devm_regulator_get(st->dev, "iovdd");
450 if (IS_ERR(st->iovdd)) {
451 dev_err(st->dev, "Could not get iovdd: %ld\n",
452 PTR_ERR(st->iovdd));
453 return PTR_ERR(st->iovdd);
456 st->dvdd = devm_regulator_get(st->dev, "dvdd");
457 if (IS_ERR(st->dvdd)) {
458 dev_err(st->dev, "Could not get dvdd: %ld\n",
459 PTR_ERR(st->dvdd));
460 return PTR_ERR(st->dvdd);
463 if (!st->hw_mode) {
464 regcache_mark_dirty(st->map);
465 regcache_cache_only(st->map, true);
471 static int adau7118_parset_dt(const struct adau7118_data *st)
478 if (st->hw_mode)
481 ret = device_property_read_u32(st->dev, "adi,decimation-ratio",
495 dev_err(st->dev, "Invalid dec ratio: %u", dec_ratio);
499 ret = regmap_update_bits(st->map,
506 ret = device_property_read_u32_array(st->dev, "adi,pdm-clk-map",
515 ret = regmap_update_bits(st->map,
527 struct adau7118_data *st;
530 st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
531 if (!st)
534 st->dev = dev;
535 st->hw_mode = hw_mode;
536 dev_set_drvdata(dev, st);
539 st->map = map;
552 ret = adau7118_parset_dt(st);
556 ret = adau7118_regulator_setup(st);