12874c5fdSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-or-later
20e45cab6SChristian Glindkamp /*
30e45cab6SChristian Glindkamp * max9850.c -- codec driver for max9850
40e45cab6SChristian Glindkamp *
50e45cab6SChristian Glindkamp * Copyright (C) 2011 taskit GmbH
60e45cab6SChristian Glindkamp *
70e45cab6SChristian Glindkamp * Author: Christian Glindkamp <christian.glindkamp@taskit.de>
80e45cab6SChristian Glindkamp *
90e45cab6SChristian Glindkamp * Initial development of this code was funded by
105856d8bdSAlexander A. Klimov * MICRONIC Computer Systeme GmbH, https://www.mcsberlin.de/
110e45cab6SChristian Glindkamp */
120e45cab6SChristian Glindkamp
130e45cab6SChristian Glindkamp #include <linux/module.h>
140e45cab6SChristian Glindkamp #include <linux/init.h>
150e45cab6SChristian Glindkamp #include <linux/i2c.h>
1606841662SMark Brown #include <linux/regmap.h>
170e45cab6SChristian Glindkamp #include <linux/slab.h>
180e45cab6SChristian Glindkamp #include <sound/pcm.h>
190e45cab6SChristian Glindkamp #include <sound/pcm_params.h>
200e45cab6SChristian Glindkamp #include <sound/soc.h>
210e45cab6SChristian Glindkamp #include <sound/tlv.h>
220e45cab6SChristian Glindkamp
230e45cab6SChristian Glindkamp #include "max9850.h"
240e45cab6SChristian Glindkamp
250e45cab6SChristian Glindkamp struct max9850_priv {
2606841662SMark Brown struct regmap *regmap;
270e45cab6SChristian Glindkamp unsigned int sysclk;
280e45cab6SChristian Glindkamp };
290e45cab6SChristian Glindkamp
300e45cab6SChristian Glindkamp /* these registers are not used at the moment but provided for the sake of
310e45cab6SChristian Glindkamp * completeness */
max9850_volatile_register(struct device * dev,unsigned int reg)3206841662SMark Brown static bool max9850_volatile_register(struct device *dev, unsigned int reg)
330e45cab6SChristian Glindkamp {
340e45cab6SChristian Glindkamp switch (reg) {
350e45cab6SChristian Glindkamp case MAX9850_STATUSA:
360e45cab6SChristian Glindkamp case MAX9850_STATUSB:
37038541daSGustavo A. R. Silva return true;
380e45cab6SChristian Glindkamp default:
39038541daSGustavo A. R. Silva return false;
400e45cab6SChristian Glindkamp }
410e45cab6SChristian Glindkamp }
420e45cab6SChristian Glindkamp
4306841662SMark Brown static const struct regmap_config max9850_regmap = {
4406841662SMark Brown .reg_bits = 8,
4506841662SMark Brown .val_bits = 8,
4606841662SMark Brown
4706841662SMark Brown .max_register = MAX9850_DIGITAL_AUDIO,
4806841662SMark Brown .volatile_reg = max9850_volatile_register,
4906841662SMark Brown .cache_type = REGCACHE_RBTREE,
5006841662SMark Brown };
5106841662SMark Brown
52e0340985SLars-Peter Clausen static const DECLARE_TLV_DB_RANGE(max9850_tlv,
530e45cab6SChristian Glindkamp 0x18, 0x1f, TLV_DB_SCALE_ITEM(-7450, 400, 0),
540e45cab6SChristian Glindkamp 0x20, 0x33, TLV_DB_SCALE_ITEM(-4150, 200, 0),
550e45cab6SChristian Glindkamp 0x34, 0x37, TLV_DB_SCALE_ITEM(-150, 100, 0),
56e0340985SLars-Peter Clausen 0x38, 0x3f, TLV_DB_SCALE_ITEM(250, 50, 0)
57e0340985SLars-Peter Clausen );
580e45cab6SChristian Glindkamp
590e45cab6SChristian Glindkamp static const struct snd_kcontrol_new max9850_controls[] = {
600e45cab6SChristian Glindkamp SOC_SINGLE_TLV("Headphone Volume", MAX9850_VOLUME, 0, 0x3f, 1, max9850_tlv),
610e45cab6SChristian Glindkamp SOC_SINGLE("Headphone Switch", MAX9850_VOLUME, 7, 1, 1),
620e45cab6SChristian Glindkamp SOC_SINGLE("Mono Switch", MAX9850_GENERAL_PURPOSE, 2, 1, 0),
630e45cab6SChristian Glindkamp };
640e45cab6SChristian Glindkamp
650e45cab6SChristian Glindkamp static const struct snd_kcontrol_new max9850_mixer_controls[] = {
660e45cab6SChristian Glindkamp SOC_DAPM_SINGLE("Line In Switch", MAX9850_ENABLE, 1, 1, 0),
670e45cab6SChristian Glindkamp };
680e45cab6SChristian Glindkamp
690e45cab6SChristian Glindkamp static const struct snd_soc_dapm_widget max9850_dapm_widgets[] = {
700e45cab6SChristian Glindkamp SND_SOC_DAPM_SUPPLY("Charge Pump 1", MAX9850_ENABLE, 4, 0, NULL, 0),
710e45cab6SChristian Glindkamp SND_SOC_DAPM_SUPPLY("Charge Pump 2", MAX9850_ENABLE, 5, 0, NULL, 0),
720e45cab6SChristian Glindkamp SND_SOC_DAPM_SUPPLY("MCLK", MAX9850_ENABLE, 6, 0, NULL, 0),
730e45cab6SChristian Glindkamp SND_SOC_DAPM_SUPPLY("SHDN", MAX9850_ENABLE, 7, 0, NULL, 0),
740e45cab6SChristian Glindkamp SND_SOC_DAPM_MIXER_NAMED_CTL("Output Mixer", MAX9850_ENABLE, 2, 0,
750e45cab6SChristian Glindkamp &max9850_mixer_controls[0],
760e45cab6SChristian Glindkamp ARRAY_SIZE(max9850_mixer_controls)),
770e45cab6SChristian Glindkamp SND_SOC_DAPM_PGA("Headphone Output", MAX9850_ENABLE, 3, 0, NULL, 0),
780e45cab6SChristian Glindkamp SND_SOC_DAPM_DAC("DAC", "HiFi Playback", MAX9850_ENABLE, 0, 0),
790e45cab6SChristian Glindkamp SND_SOC_DAPM_OUTPUT("OUTL"),
800e45cab6SChristian Glindkamp SND_SOC_DAPM_OUTPUT("HPL"),
810e45cab6SChristian Glindkamp SND_SOC_DAPM_OUTPUT("OUTR"),
820e45cab6SChristian Glindkamp SND_SOC_DAPM_OUTPUT("HPR"),
830e45cab6SChristian Glindkamp SND_SOC_DAPM_MIXER("Line Input", SND_SOC_NOPM, 0, 0, NULL, 0),
840e45cab6SChristian Glindkamp SND_SOC_DAPM_INPUT("INL"),
850e45cab6SChristian Glindkamp SND_SOC_DAPM_INPUT("INR"),
860e45cab6SChristian Glindkamp };
870e45cab6SChristian Glindkamp
885ee65ec6SAxel Lin static const struct snd_soc_dapm_route max9850_dapm_routes[] = {
890e45cab6SChristian Glindkamp /* output mixer */
900e45cab6SChristian Glindkamp {"Output Mixer", NULL, "DAC"},
910e45cab6SChristian Glindkamp {"Output Mixer", "Line In Switch", "Line Input"},
920e45cab6SChristian Glindkamp
930e45cab6SChristian Glindkamp /* outputs */
940e45cab6SChristian Glindkamp {"Headphone Output", NULL, "Output Mixer"},
950e45cab6SChristian Glindkamp {"HPL", NULL, "Headphone Output"},
960e45cab6SChristian Glindkamp {"HPR", NULL, "Headphone Output"},
970e45cab6SChristian Glindkamp {"OUTL", NULL, "Output Mixer"},
980e45cab6SChristian Glindkamp {"OUTR", NULL, "Output Mixer"},
990e45cab6SChristian Glindkamp
1000e45cab6SChristian Glindkamp /* inputs */
1010e45cab6SChristian Glindkamp {"Line Input", NULL, "INL"},
1020e45cab6SChristian Glindkamp {"Line Input", NULL, "INR"},
1030e45cab6SChristian Glindkamp
1040e45cab6SChristian Glindkamp /* supplies */
1050e45cab6SChristian Glindkamp {"Output Mixer", NULL, "Charge Pump 1"},
1060e45cab6SChristian Glindkamp {"Output Mixer", NULL, "Charge Pump 2"},
1070e45cab6SChristian Glindkamp {"Output Mixer", NULL, "SHDN"},
1080e45cab6SChristian Glindkamp {"DAC", NULL, "MCLK"},
1090e45cab6SChristian Glindkamp };
1100e45cab6SChristian Glindkamp
max9850_hw_params(struct snd_pcm_substream * substream,struct snd_pcm_hw_params * params,struct snd_soc_dai * dai)1110e45cab6SChristian Glindkamp static int max9850_hw_params(struct snd_pcm_substream *substream,
1120e45cab6SChristian Glindkamp struct snd_pcm_hw_params *params,
1130e45cab6SChristian Glindkamp struct snd_soc_dai *dai)
1140e45cab6SChristian Glindkamp {
1150b3eda28SKuninori Morimoto struct snd_soc_component *component = dai->component;
1160b3eda28SKuninori Morimoto struct max9850_priv *max9850 = snd_soc_component_get_drvdata(component);
1170e45cab6SChristian Glindkamp u64 lrclk_div;
1180e45cab6SChristian Glindkamp u8 sf, da;
1190e45cab6SChristian Glindkamp
1200e45cab6SChristian Glindkamp if (!max9850->sysclk)
1210e45cab6SChristian Glindkamp return -EINVAL;
1220e45cab6SChristian Glindkamp
1230e45cab6SChristian Glindkamp /* lrclk_div = 2^22 * rate / iclk with iclk = mclk / sf */
1241227f601SKuninori Morimoto sf = (snd_soc_component_read(component, MAX9850_CLOCK) >> 2) + 1;
1250e45cab6SChristian Glindkamp lrclk_div = (1 << 22);
1260e45cab6SChristian Glindkamp lrclk_div *= params_rate(params);
1270e45cab6SChristian Glindkamp lrclk_div *= sf;
1280e45cab6SChristian Glindkamp do_div(lrclk_div, max9850->sysclk);
1290e45cab6SChristian Glindkamp
1300b3eda28SKuninori Morimoto snd_soc_component_write(component, MAX9850_LRCLK_MSB, (lrclk_div >> 8) & 0x7f);
1310b3eda28SKuninori Morimoto snd_soc_component_write(component, MAX9850_LRCLK_LSB, lrclk_div & 0xff);
1320e45cab6SChristian Glindkamp
1330058e459SMark Brown switch (params_width(params)) {
1340058e459SMark Brown case 16:
1350e45cab6SChristian Glindkamp da = 0;
1360e45cab6SChristian Glindkamp break;
1370058e459SMark Brown case 20:
1380e45cab6SChristian Glindkamp da = 0x2;
1390e45cab6SChristian Glindkamp break;
1400058e459SMark Brown case 24:
1410e45cab6SChristian Glindkamp da = 0x3;
1420e45cab6SChristian Glindkamp break;
1430e45cab6SChristian Glindkamp default:
1440e45cab6SChristian Glindkamp return -EINVAL;
1450e45cab6SChristian Glindkamp }
1460b3eda28SKuninori Morimoto snd_soc_component_update_bits(component, MAX9850_DIGITAL_AUDIO, 0x3, da);
1470e45cab6SChristian Glindkamp
1480e45cab6SChristian Glindkamp return 0;
1490e45cab6SChristian Glindkamp }
1500e45cab6SChristian Glindkamp
max9850_set_dai_sysclk(struct snd_soc_dai * codec_dai,int clk_id,unsigned int freq,int dir)1510e45cab6SChristian Glindkamp static int max9850_set_dai_sysclk(struct snd_soc_dai *codec_dai,
1520e45cab6SChristian Glindkamp int clk_id, unsigned int freq, int dir)
1530e45cab6SChristian Glindkamp {
1540b3eda28SKuninori Morimoto struct snd_soc_component *component = codec_dai->component;
1550b3eda28SKuninori Morimoto struct max9850_priv *max9850 = snd_soc_component_get_drvdata(component);
1560e45cab6SChristian Glindkamp
1570e45cab6SChristian Glindkamp /* calculate mclk -> iclk divider */
1580e45cab6SChristian Glindkamp if (freq <= 13000000)
1590b3eda28SKuninori Morimoto snd_soc_component_write(component, MAX9850_CLOCK, 0x0);
1600e45cab6SChristian Glindkamp else if (freq <= 26000000)
1610b3eda28SKuninori Morimoto snd_soc_component_write(component, MAX9850_CLOCK, 0x4);
1620e45cab6SChristian Glindkamp else if (freq <= 40000000)
1630b3eda28SKuninori Morimoto snd_soc_component_write(component, MAX9850_CLOCK, 0x8);
1640e45cab6SChristian Glindkamp else
1650e45cab6SChristian Glindkamp return -EINVAL;
1660e45cab6SChristian Glindkamp
1670e45cab6SChristian Glindkamp max9850->sysclk = freq;
1680e45cab6SChristian Glindkamp return 0;
1690e45cab6SChristian Glindkamp }
1700e45cab6SChristian Glindkamp
max9850_set_dai_fmt(struct snd_soc_dai * codec_dai,unsigned int fmt)1710e45cab6SChristian Glindkamp static int max9850_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
1720e45cab6SChristian Glindkamp {
1730b3eda28SKuninori Morimoto struct snd_soc_component *component = codec_dai->component;
1740e45cab6SChristian Glindkamp u8 da = 0;
1750e45cab6SChristian Glindkamp
1769dcef176SMark Brown /* set clock provider for audio interface */
1779dcef176SMark Brown switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
1789dcef176SMark Brown case SND_SOC_DAIFMT_CBP_CFP:
1790e45cab6SChristian Glindkamp da |= MAX9850_MASTER;
1800e45cab6SChristian Glindkamp break;
1819dcef176SMark Brown case SND_SOC_DAIFMT_CBC_CFC:
1820e45cab6SChristian Glindkamp break;
1830e45cab6SChristian Glindkamp default:
1840e45cab6SChristian Glindkamp return -EINVAL;
1850e45cab6SChristian Glindkamp }
1860e45cab6SChristian Glindkamp
1870e45cab6SChristian Glindkamp /* interface format */
1880e45cab6SChristian Glindkamp switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
1890e45cab6SChristian Glindkamp case SND_SOC_DAIFMT_I2S:
1900e45cab6SChristian Glindkamp da |= MAX9850_DLY;
1910e45cab6SChristian Glindkamp break;
1920e45cab6SChristian Glindkamp case SND_SOC_DAIFMT_RIGHT_J:
1930e45cab6SChristian Glindkamp da |= MAX9850_RTJ;
1940e45cab6SChristian Glindkamp break;
1950e45cab6SChristian Glindkamp case SND_SOC_DAIFMT_LEFT_J:
1960e45cab6SChristian Glindkamp break;
1970e45cab6SChristian Glindkamp default:
1980e45cab6SChristian Glindkamp return -EINVAL;
1990e45cab6SChristian Glindkamp }
2000e45cab6SChristian Glindkamp
2010e45cab6SChristian Glindkamp /* clock inversion */
2020e45cab6SChristian Glindkamp switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
2030e45cab6SChristian Glindkamp case SND_SOC_DAIFMT_NB_NF:
2040e45cab6SChristian Glindkamp break;
2050e45cab6SChristian Glindkamp case SND_SOC_DAIFMT_IB_IF:
2060e45cab6SChristian Glindkamp da |= MAX9850_BCINV | MAX9850_INV;
2070e45cab6SChristian Glindkamp break;
2080e45cab6SChristian Glindkamp case SND_SOC_DAIFMT_IB_NF:
2090e45cab6SChristian Glindkamp da |= MAX9850_BCINV;
2100e45cab6SChristian Glindkamp break;
2110e45cab6SChristian Glindkamp case SND_SOC_DAIFMT_NB_IF:
2120e45cab6SChristian Glindkamp da |= MAX9850_INV;
2130e45cab6SChristian Glindkamp break;
2140e45cab6SChristian Glindkamp default:
2150e45cab6SChristian Glindkamp return -EINVAL;
2160e45cab6SChristian Glindkamp }
2170e45cab6SChristian Glindkamp
2180e45cab6SChristian Glindkamp /* set da */
2190b3eda28SKuninori Morimoto snd_soc_component_write(component, MAX9850_DIGITAL_AUDIO, da);
2200e45cab6SChristian Glindkamp
2210e45cab6SChristian Glindkamp return 0;
2220e45cab6SChristian Glindkamp }
2230e45cab6SChristian Glindkamp
max9850_set_bias_level(struct snd_soc_component * component,enum snd_soc_bias_level level)2240b3eda28SKuninori Morimoto static int max9850_set_bias_level(struct snd_soc_component *component,
2250e45cab6SChristian Glindkamp enum snd_soc_bias_level level)
2260e45cab6SChristian Glindkamp {
2270b3eda28SKuninori Morimoto struct max9850_priv *max9850 = snd_soc_component_get_drvdata(component);
2280e45cab6SChristian Glindkamp int ret;
2290e45cab6SChristian Glindkamp
2300e45cab6SChristian Glindkamp switch (level) {
2310e45cab6SChristian Glindkamp case SND_SOC_BIAS_ON:
2320e45cab6SChristian Glindkamp break;
2330e45cab6SChristian Glindkamp case SND_SOC_BIAS_PREPARE:
2340e45cab6SChristian Glindkamp break;
2350e45cab6SChristian Glindkamp case SND_SOC_BIAS_STANDBY:
2360b3eda28SKuninori Morimoto if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
23706841662SMark Brown ret = regcache_sync(max9850->regmap);
2380e45cab6SChristian Glindkamp if (ret) {
2390b3eda28SKuninori Morimoto dev_err(component->dev,
2400e45cab6SChristian Glindkamp "Failed to sync cache: %d\n", ret);
2410e45cab6SChristian Glindkamp return ret;
2420e45cab6SChristian Glindkamp }
2430e45cab6SChristian Glindkamp }
2440e45cab6SChristian Glindkamp break;
2450e45cab6SChristian Glindkamp case SND_SOC_BIAS_OFF:
2460e45cab6SChristian Glindkamp break;
2470e45cab6SChristian Glindkamp }
2480e45cab6SChristian Glindkamp return 0;
2490e45cab6SChristian Glindkamp }
2500e45cab6SChristian Glindkamp
2510e45cab6SChristian Glindkamp #define MAX9850_RATES SNDRV_PCM_RATE_8000_48000
2520e45cab6SChristian Glindkamp
2530e45cab6SChristian Glindkamp #define MAX9850_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
2540e45cab6SChristian Glindkamp SNDRV_PCM_FMTBIT_S24_LE)
2550e45cab6SChristian Glindkamp
25685e7652dSLars-Peter Clausen static const struct snd_soc_dai_ops max9850_dai_ops = {
2570e45cab6SChristian Glindkamp .hw_params = max9850_hw_params,
2580e45cab6SChristian Glindkamp .set_sysclk = max9850_set_dai_sysclk,
2590e45cab6SChristian Glindkamp .set_fmt = max9850_set_dai_fmt,
2600e45cab6SChristian Glindkamp };
2610e45cab6SChristian Glindkamp
2620e45cab6SChristian Glindkamp static struct snd_soc_dai_driver max9850_dai = {
2630e45cab6SChristian Glindkamp .name = "max9850-hifi",
2640e45cab6SChristian Glindkamp .playback = {
2650e45cab6SChristian Glindkamp .stream_name = "Playback",
2660e45cab6SChristian Glindkamp .channels_min = 1,
2670e45cab6SChristian Glindkamp .channels_max = 2,
2680e45cab6SChristian Glindkamp .rates = MAX9850_RATES,
2690e45cab6SChristian Glindkamp .formats = MAX9850_FORMATS
2700e45cab6SChristian Glindkamp },
2710e45cab6SChristian Glindkamp .ops = &max9850_dai_ops,
2720e45cab6SChristian Glindkamp };
2730e45cab6SChristian Glindkamp
max9850_probe(struct snd_soc_component * component)2740b3eda28SKuninori Morimoto static int max9850_probe(struct snd_soc_component *component)
2750e45cab6SChristian Glindkamp {
2760e45cab6SChristian Glindkamp /* enable zero-detect */
2770b3eda28SKuninori Morimoto snd_soc_component_update_bits(component, MAX9850_GENERAL_PURPOSE, 1, 1);
2780e45cab6SChristian Glindkamp /* enable slew-rate control */
2790b3eda28SKuninori Morimoto snd_soc_component_update_bits(component, MAX9850_VOLUME, 0x40, 0x40);
2800e45cab6SChristian Glindkamp /* set slew-rate 125ms */
2810b3eda28SKuninori Morimoto snd_soc_component_update_bits(component, MAX9850_CHARGE_PUMP, 0xff, 0xc0);
2820e45cab6SChristian Glindkamp
2830e45cab6SChristian Glindkamp return 0;
2840e45cab6SChristian Glindkamp }
2850e45cab6SChristian Glindkamp
2860b3eda28SKuninori Morimoto static const struct snd_soc_component_driver soc_component_dev_max9850 = {
2870e45cab6SChristian Glindkamp .probe = max9850_probe,
2880e45cab6SChristian Glindkamp .set_bias_level = max9850_set_bias_level,
2895ee65ec6SAxel Lin .controls = max9850_controls,
2905ee65ec6SAxel Lin .num_controls = ARRAY_SIZE(max9850_controls),
2915ee65ec6SAxel Lin .dapm_widgets = max9850_dapm_widgets,
2925ee65ec6SAxel Lin .num_dapm_widgets = ARRAY_SIZE(max9850_dapm_widgets),
2935ee65ec6SAxel Lin .dapm_routes = max9850_dapm_routes,
2945ee65ec6SAxel Lin .num_dapm_routes = ARRAY_SIZE(max9850_dapm_routes),
2950b3eda28SKuninori Morimoto .suspend_bias_off = 1,
2960b3eda28SKuninori Morimoto .idle_bias_on = 1,
2970b3eda28SKuninori Morimoto .use_pmdown_time = 1,
2980b3eda28SKuninori Morimoto .endianness = 1,
2990e45cab6SChristian Glindkamp };
3000e45cab6SChristian Glindkamp
max9850_i2c_probe(struct i2c_client * i2c)301fead49e3SStephen Kitt static int max9850_i2c_probe(struct i2c_client *i2c)
3020e45cab6SChristian Glindkamp {
3030e45cab6SChristian Glindkamp struct max9850_priv *max9850;
3040e45cab6SChristian Glindkamp int ret;
3050e45cab6SChristian Glindkamp
306bf791bdbSAxel Lin max9850 = devm_kzalloc(&i2c->dev, sizeof(struct max9850_priv),
307bf791bdbSAxel Lin GFP_KERNEL);
3080e45cab6SChristian Glindkamp if (max9850 == NULL)
3090e45cab6SChristian Glindkamp return -ENOMEM;
3100e45cab6SChristian Glindkamp
31106841662SMark Brown max9850->regmap = devm_regmap_init_i2c(i2c, &max9850_regmap);
31206841662SMark Brown if (IS_ERR(max9850->regmap))
31306841662SMark Brown return PTR_ERR(max9850->regmap);
31406841662SMark Brown
3150e45cab6SChristian Glindkamp i2c_set_clientdata(i2c, max9850);
3160e45cab6SChristian Glindkamp
3170b3eda28SKuninori Morimoto ret = devm_snd_soc_register_component(&i2c->dev,
3180b3eda28SKuninori Morimoto &soc_component_dev_max9850, &max9850_dai, 1);
3190e45cab6SChristian Glindkamp return ret;
3200e45cab6SChristian Glindkamp }
3210e45cab6SChristian Glindkamp
3220e45cab6SChristian Glindkamp static const struct i2c_device_id max9850_i2c_id[] = {
323*ba2a2c37SUwe Kleine-König { "max9850" },
3240e45cab6SChristian Glindkamp { }
3250e45cab6SChristian Glindkamp };
3260e45cab6SChristian Glindkamp MODULE_DEVICE_TABLE(i2c, max9850_i2c_id);
3270e45cab6SChristian Glindkamp
3280e45cab6SChristian Glindkamp static struct i2c_driver max9850_i2c_driver = {
3290e45cab6SChristian Glindkamp .driver = {
3300e45cab6SChristian Glindkamp .name = "max9850",
3310e45cab6SChristian Glindkamp },
3329abcd240SUwe Kleine-König .probe = max9850_i2c_probe,
3330e45cab6SChristian Glindkamp .id_table = max9850_i2c_id,
3340e45cab6SChristian Glindkamp };
3350e45cab6SChristian Glindkamp
3364abdc8c8SSachin Kamat module_i2c_driver(max9850_i2c_driver);
3370e45cab6SChristian Glindkamp
3380e45cab6SChristian Glindkamp MODULE_AUTHOR("Christian Glindkamp <christian.glindkamp@taskit.de>");
3390e45cab6SChristian Glindkamp MODULE_DESCRIPTION("ASoC MAX9850 codec driver");
3400e45cab6SChristian Glindkamp MODULE_LICENSE("GPL");
341