Lines Matching refs:ac97

3 // soc-ac97.c  --  ALSA SoC Audio Layer AC97 support
128 static int snd_soc_ac97_init_gpio(struct snd_ac97 *ac97,
137 ac97->gpio_priv = gpio_priv;
150 static void snd_soc_ac97_free_gpio(struct snd_ac97 *ac97)
152 gpiochip_remove(&ac97->gpio_priv->gpio_chip);
155 static int snd_soc_ac97_init_gpio(struct snd_ac97 *ac97,
161 static void snd_soc_ac97_free_gpio(struct snd_ac97 *ac97)
171 * it. The caller is responsible to either call device_add(&ac97->dev) to
172 * register the device, or to call put_device(&ac97->dev) to free the device.
178 struct snd_ac97 *ac97;
180 ac97 = kzalloc(sizeof(struct snd_ac97), GFP_KERNEL);
181 if (ac97 == NULL)
184 ac97->bus = &soc_ac97_bus;
185 ac97->num = 0;
187 ac97->dev.bus = &ac97_bus_type;
188 ac97->dev.parent = component->card->dev;
189 ac97->dev.release = soc_ac97_device_release;
191 dev_set_name(&ac97->dev, "%d-%d:%s",
195 device_initialize(&ac97->dev);
197 return ac97;
218 struct snd_ac97 *ac97;
221 ac97 = snd_soc_alloc_ac97_component(component);
222 if (IS_ERR(ac97))
223 return ac97;
226 ret = snd_ac97_reset(ac97, false, id, id_mask);
234 ret = device_add(&ac97->dev);
238 ret = snd_soc_ac97_init_gpio(ac97, component);
242 return ac97;
245 put_device(&ac97->dev);
252 * @ac97: snd_ac97 device to be freed
256 void snd_soc_free_ac97_component(struct snd_ac97 *ac97)
258 snd_soc_ac97_free_gpio(ac97);
259 device_del(&ac97->dev);
260 ac97->bus = NULL;
261 put_device(&ac97->dev);
267 static void snd_soc_ac97_warm_reset(struct snd_ac97 *ac97)
283 static void snd_soc_ac97_reset(struct snd_ac97 *ac97)
316 state = pinctrl_lookup_state(p, "ac97-reset");
318 dev_err(dev, "Can't find pinctrl state ac97-reset\n");
323 state = pinctrl_lookup_state(p, "ac97-warm-reset");
325 dev_err(dev, "Can't find pinctrl state ac97-warm-reset\n");
330 state = pinctrl_lookup_state(p, "ac97-running");
332 dev_err(dev, "Can't find pinctrl state ac97-running\n");
337 gpio = of_get_named_gpio(dev->of_node, "ac97-gpios", 0);
339 dev_err(dev, "Can't find ac97-sync gpio\n");
344 dev_err(dev, "Failed requesting ac97-sync gpio\n");
349 gpio = of_get_named_gpio(dev->of_node, "ac97-gpios", 1);
351 dev_err(dev, "Can't find ac97-sdata gpio %d\n", gpio);
356 dev_err(dev, "Failed requesting ac97-sdata gpio\n");
361 gpio = of_get_named_gpio(dev->of_node, "ac97-gpios", 2);
363 dev_err(dev, "Can't find ac97-reset gpio\n");
368 dev_err(dev, "Failed requesting ac97-reset gpio\n");
395 * snd_soc_set_ac97_ops_of_reset - Set ac97 ops with generic ac97 reset functions