linux/sound/soc/soc-ac97.c

// SPDX-License-Identifier: GPL-2.0+
//
// soc-ac97.c  --  ALSA SoC Audio Layer AC97 support
//
// Copyright 2005 Wolfson Microelectronics PLC.
// Copyright 2005 Openedhand Ltd.
// Copyright (C) 2010 Slimlogic Ltd.
// Copyright (C) 2010 Texas Instruments Inc.
//
// Author: Liam Girdwood <[email protected]>
//         with code, comments and ideas from :-
//         Richard Purdie <[email protected]>

#include <linux/ctype.h>
#include <linux/delay.h>
#include <linux/export.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
#include <linux/init.h>
#include <linux/of.h>
#include <linux/pinctrl/consumer.h>
#include <linux/slab.h>
#include <sound/ac97_codec.h>
#include <sound/soc.h>

struct snd_ac97_reset_cfg {};

static struct snd_ac97_bus soc_ac97_bus =;

static void soc_ac97_device_release(struct device *dev)
{}

#ifdef CONFIG_GPIOLIB
struct snd_ac97_gpio_priv {};

static inline struct snd_soc_component *gpio_to_component(struct gpio_chip *chip)
{}

static int snd_soc_ac97_gpio_request(struct gpio_chip *chip, unsigned int offset)
{}

static int snd_soc_ac97_gpio_direction_in(struct gpio_chip *chip,
					  unsigned int offset)
{}

static int snd_soc_ac97_gpio_get(struct gpio_chip *chip, unsigned int offset)
{}

static void snd_soc_ac97_gpio_set(struct gpio_chip *chip, unsigned int offset,
				  int value)
{}

static int snd_soc_ac97_gpio_direction_out(struct gpio_chip *chip,
				     unsigned offset, int value)
{}

static const struct gpio_chip snd_soc_ac97_gpio_chip =;

static int snd_soc_ac97_init_gpio(struct snd_ac97 *ac97,
				  struct snd_soc_component *component)
{}

static void snd_soc_ac97_free_gpio(struct snd_ac97 *ac97)
{}
#else
static int snd_soc_ac97_init_gpio(struct snd_ac97 *ac97,
				  struct snd_soc_component *component)
{
	return 0;
}

static void snd_soc_ac97_free_gpio(struct snd_ac97 *ac97)
{
}
#endif

/**
 * snd_soc_alloc_ac97_component() - Allocate new a AC'97 device
 * @component: The COMPONENT for which to create the AC'97 device
 *
 * Allocated a new snd_ac97 device and intializes it, but does not yet register
 * it. The caller is responsible to either call device_add(&ac97->dev) to
 * register the device, or to call put_device(&ac97->dev) to free the device.
 *
 * Returns: A snd_ac97 device or a PTR_ERR in case of an error.
 */
struct snd_ac97 *snd_soc_alloc_ac97_component(struct snd_soc_component *component)
{}
EXPORT_SYMBOL();

/**
 * snd_soc_new_ac97_component - initailise AC97 device
 * @component: audio component
 * @id: The expected device ID
 * @id_mask: Mask that is applied to the device ID before comparing with @id
 *
 * Initialises AC97 component resources for use by ad-hoc devices only.
 *
 * If @id is not 0 this function will reset the device, then read the ID from
 * the device and check if it matches the expected ID. If it doesn't match an
 * error will be returned and device will not be registered.
 *
 * Returns: A PTR_ERR() on failure or a valid snd_ac97 struct on success.
 */
struct snd_ac97 *snd_soc_new_ac97_component(struct snd_soc_component *component,
	unsigned int id, unsigned int id_mask)
{}
EXPORT_SYMBOL_GPL();

/**
 * snd_soc_free_ac97_component - free AC97 component device
 * @ac97: snd_ac97 device to be freed
 *
 * Frees AC97 component device resources.
 */
void snd_soc_free_ac97_component(struct snd_ac97 *ac97)
{}
EXPORT_SYMBOL_GPL();

static struct snd_ac97_reset_cfg snd_ac97_rst_cfg;

static void snd_soc_ac97_warm_reset(struct snd_ac97 *ac97)
{}

static void snd_soc_ac97_reset(struct snd_ac97 *ac97)
{}

static int snd_soc_ac97_parse_pinctl(struct device *dev,
		struct snd_ac97_reset_cfg *cfg)
{}

struct snd_ac97_bus_ops *soc_ac97_ops;
EXPORT_SYMBOL_GPL();

int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops)
{}
EXPORT_SYMBOL_GPL();

/**
 * snd_soc_set_ac97_ops_of_reset - Set ac97 ops with generic ac97 reset functions
 * @ops: bus ops
 * @pdev: platform device
 *
 * This function sets the reset and warm_reset properties of ops and parses
 * the device node of pdev to get pinctrl states and gpio numbers to use.
 */
int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops,
		struct platform_device *pdev)
{}
EXPORT_SYMBOL_GPL();