#include <linux/module.h>
#include <linux/errno.h>
#include <linux/device.h>
#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <sound/tpa6130a2-plat.h>
#include <sound/soc.h>
#include <sound/tlv.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/regmap.h>
#include "tpa6130a2.h"
enum tpa_model { … };
struct tpa6130a2_data { … };
static int tpa6130a2_power(struct tpa6130a2_data *data, bool enable)
{ … }
static int tpa6130a2_power_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kctrl, int event)
{ … }
static const DECLARE_TLV_DB_RANGE(tpa6130_tlv,
0, 1, TLV_DB_SCALE_ITEM(-5950, 600, 0),
2, 3, TLV_DB_SCALE_ITEM(-5000, 250, 0),
4, 5, TLV_DB_SCALE_ITEM(-4550, 160, 0),
6, 7, TLV_DB_SCALE_ITEM(-4140, 190, 0),
8, 9, TLV_DB_SCALE_ITEM(-3650, 120, 0),
10, 11, TLV_DB_SCALE_ITEM(-3330, 160, 0),
12, 13, TLV_DB_SCALE_ITEM(-3040, 180, 0),
14, 20, TLV_DB_SCALE_ITEM(-2710, 110, 0),
21, 37, TLV_DB_SCALE_ITEM(-1960, 74, 0),
38, 63, TLV_DB_SCALE_ITEM(-720, 45, 0)
);
static const struct snd_kcontrol_new tpa6130a2_controls[] = …;
static const DECLARE_TLV_DB_RANGE(tpa6140_tlv,
0, 8, TLV_DB_SCALE_ITEM(-5900, 400, 0),
9, 16, TLV_DB_SCALE_ITEM(-2500, 200, 0),
17, 31, TLV_DB_SCALE_ITEM(-1000, 100, 0)
);
static const struct snd_kcontrol_new tpa6140a2_controls[] = …;
static int tpa6130a2_component_probe(struct snd_soc_component *component)
{ … }
static const struct snd_soc_dapm_widget tpa6130a2_dapm_widgets[] = …;
static const struct snd_soc_dapm_route tpa6130a2_dapm_routes[] = …;
static const struct snd_soc_component_driver tpa6130a2_component_driver = …;
static const struct reg_default tpa6130a2_reg_defaults[] = …;
static const struct regmap_config tpa6130a2_regmap_config = …;
static const struct i2c_device_id tpa6130a2_id[] = …;
MODULE_DEVICE_TABLE(i2c, tpa6130a2_id);
static int tpa6130a2_probe(struct i2c_client *client)
{ … }
#if IS_ENABLED(CONFIG_OF)
static const struct of_device_id tpa6130a2_of_match[] = …;
MODULE_DEVICE_TABLE(of, tpa6130a2_of_match);
#endif
static struct i2c_driver tpa6130a2_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;