Skip to content
Snippets Groups Projects
Commit e1a500c8 authored by Oleksii Kutuzov's avatar Oleksii Kutuzov
Browse files

Revert "[DRIVERS][SND] WM8983: port changes from KuK kernel"

This reverts commit 02619d22.
parent 56116d24
No related branches found
No related tags found
No related merge requests found
...@@ -11,13 +11,11 @@ ...@@ -11,13 +11,11 @@
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/of.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/gpio/consumer.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
...@@ -27,24 +25,6 @@ ...@@ -27,24 +25,6 @@
#include "wm8983.h" #include "wm8983.h"
// Trizeps VIII
/*
LIN MIC_GND
LIP MIC_OUT
RIN n.c.
RIP n.c.
L2 LINE_IN_L
R2 LINE_IN_R
LOUT1 HEADPHONE_L
ROUT1 HEADPHONE_R
OUT3 n.c.
OUT4 HEADPHONE_GND
LOUT2 SPEAKER_L
ROUT2 SPEAKER_R
AUXR n.c.
AUXL n.c.
*/
static const struct reg_default wm8983_defaults[] = { static const struct reg_default wm8983_defaults[] = {
{ 0x01, 0x0000 }, /* R1 - Power management 1 */ { 0x01, 0x0000 }, /* R1 - Power management 1 */
{ 0x02, 0x0000 }, /* R2 - Power management 2 */ { 0x02, 0x0000 }, /* R2 - Power management 2 */
...@@ -83,12 +63,12 @@ static const struct reg_default wm8983_defaults[] = { ...@@ -83,12 +63,12 @@ static const struct reg_default wm8983_defaults[] = {
{ 0x27, 0x00E9 }, /* R39 - PLL K 3 */ { 0x27, 0x00E9 }, /* R39 - PLL K 3 */
{ 0x29, 0x0000 }, /* R41 - 3D control */ { 0x29, 0x0000 }, /* R41 - 3D control */
{ 0x2A, 0x0000 }, /* R42 - OUT4 to ADC */ { 0x2A, 0x0000 }, /* R42 - OUT4 to ADC */
{ 0x2B, 0x0010 }, /* R43 - Beep control */ { 0x2B, 0x0000 }, /* R43 - Beep control */
{ 0x2C, 0x0033 }, /* R44 - Input ctrl */ { 0x2C, 0x0033 }, /* R44 - Input ctrl */
{ 0x2D, 0x0010 }, /* R45 - Left INP PGA gain ctrl */ { 0x2D, 0x0010 }, /* R45 - Left INP PGA gain ctrl */
{ 0x2E, 0x0010 }, /* R46 - Right INP PGA gain ctrl */ { 0x2E, 0x0010 }, /* R46 - Right INP PGA gain ctrl */
{ 0x2F, 0x0170 }, /* R47 - Left ADC BOOST ctrl */ { 0x2F, 0x0100 }, /* R47 - Left ADC BOOST ctrl */
{ 0x30, 0x0170 }, /* R48 - Right ADC BOOST ctrl */ { 0x30, 0x0100 }, /* R48 - Right ADC BOOST ctrl */
{ 0x31, 0x0002 }, /* R49 - Output ctrl */ { 0x31, 0x0002 }, /* R49 - Output ctrl */
{ 0x32, 0x0001 }, /* R50 - Left mixer ctrl */ { 0x32, 0x0001 }, /* R50 - Left mixer ctrl */
{ 0x33, 0x0001 }, /* R51 - Right mixer ctrl */ { 0x33, 0x0001 }, /* R51 - Right mixer ctrl */
...@@ -117,7 +97,6 @@ static const int vol_update_regs[] = { ...@@ -117,7 +97,6 @@ static const int vol_update_regs[] = {
struct wm8983_priv { struct wm8983_priv {
struct regmap *regmap; struct regmap *regmap;
struct gpio_desc *mute;
u32 sysclk; u32 sysclk;
u32 bclk; u32 bclk;
}; };
...@@ -126,14 +105,14 @@ static const struct { ...@@ -126,14 +105,14 @@ static const struct {
int div; int div;
int ratio; int ratio;
} fs_ratios[] = { } fs_ratios[] = {
{ 10, 128 }, // *44.100 = 5.644.800 { 10, 128 },
{ 15, 192 }, // *44.100 = 8.467.200 { 15, 192 },
{ 20, 256 }, // *44.100 = 11.289.600 { 20, 256 },
{ 30, 384 }, // *44.100 = 16.934.400 { 30, 384 },
{ 40, 512 }, // *44.100 = 22.579.200 { 40, 512 },
{ 60, 768 }, // *44.100 = 33.868.800 { 60, 768 },
{ 80, 1024 }, // *44.100 = 45.158.400 { 80, 1024 },
{ 120, 1536 } // *44.100 = 67.737.600 { 120, 1536 }
}; };
static const int srates[] = { 48000, 32000, 24000, 16000, 12000, 8000 }; static const int srates[] = { 48000, 32000, 24000, 16000, 12000, 8000 };
...@@ -162,22 +141,6 @@ static const DECLARE_TLV_DB_SCALE(aux_tlv, -1500, 300, 0); ...@@ -162,22 +141,6 @@ static const DECLARE_TLV_DB_SCALE(aux_tlv, -1500, 300, 0);
static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0); static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0);
static const DECLARE_TLV_DB_SCALE(pga_boost_tlv, 0, 2000, 0); static const DECLARE_TLV_DB_SCALE(pga_boost_tlv, 0, 2000, 0);
static const char *bias_sel_mode_text[] = { "0.9AVDD", "0.65AVDD" };
static SOC_ENUM_SINGLE_DECL(bias_sel_mode, WM8983_INPUT_CTRL, 8,
bias_sel_mode_text);
static const char *mono_text[] = { "Stereo", "Mono" };
static SOC_ENUM_SINGLE_DECL(mono_sel_mode, WM8983_AUDIO_INTERFACE, 0,
mono_text);
static const char *adcleft_text[] = { "ADC-Left", "ADC-Right" };
static SOC_ENUM_SINGLE_DECL(adcleft_sel_mode, WM8983_AUDIO_INTERFACE, 1,
adcleft_text);
static const char *dacleft_text[] = { "DAC-Left", "DAC-Right" };
static SOC_ENUM_SINGLE_DECL(dacleft_sel_mode, WM8983_AUDIO_INTERFACE, 2,
dacleft_text);
static const char *alc_sel_text[] = { "Off", "Right", "Left", "Stereo" }; static const char *alc_sel_text[] = { "Off", "Right", "Left", "Stereo" };
static SOC_ENUM_SINGLE_DECL(alc_sel, WM8983_ALC_CONTROL_1, 7, alc_sel_text); static SOC_ENUM_SINGLE_DECL(alc_sel, WM8983_ALC_CONTROL_1, 7, alc_sel_text);
...@@ -250,9 +213,9 @@ static const struct snd_kcontrol_new wm8983_snd_controls[] = { ...@@ -250,9 +213,9 @@ static const struct snd_kcontrol_new wm8983_snd_controls[] = {
0, 7, 0, alc_min_tlv), 0, 7, 0, alc_min_tlv),
SOC_SINGLE_TLV("ALC Capture Target Volume", WM8983_ALC_CONTROL_2, SOC_SINGLE_TLV("ALC Capture Target Volume", WM8983_ALC_CONTROL_2,
0, 15, 0, alc_tar_tlv), 0, 15, 0, alc_tar_tlv),
SOC_SINGLE("ALC Capture Attack", WM8983_ALC_CONTROL_3, 0, 15, 0), SOC_SINGLE("ALC Capture Attack", WM8983_ALC_CONTROL_3, 0, 10, 0),
SOC_SINGLE("ALC Capture Hold", WM8983_ALC_CONTROL_2, 4, 15, 0), SOC_SINGLE("ALC Capture Hold", WM8983_ALC_CONTROL_2, 4, 10, 0),
SOC_SINGLE("ALC Capture Decay", WM8983_ALC_CONTROL_3, 4, 15, 0), SOC_SINGLE("ALC Capture Decay", WM8983_ALC_CONTROL_3, 4, 10, 0),
SOC_ENUM("ALC Mode", alc_mode), SOC_ENUM("ALC Mode", alc_mode),
SOC_SINGLE("ALC Capture NG Switch", WM8983_NOISE_GATE, SOC_SINGLE("ALC Capture NG Switch", WM8983_NOISE_GATE,
3, 1, 0), 3, 1, 0),
...@@ -260,17 +223,18 @@ static const struct snd_kcontrol_new wm8983_snd_controls[] = { ...@@ -260,17 +223,18 @@ static const struct snd_kcontrol_new wm8983_snd_controls[] = {
0, 7, 1), 0, 7, 1),
SOC_DOUBLE_R_TLV("Capture Volume", WM8983_LEFT_ADC_DIGITAL_VOL, SOC_DOUBLE_R_TLV("Capture Volume", WM8983_LEFT_ADC_DIGITAL_VOL,
WM8983_RIGHT_ADC_DIGITAL_VOL, 0, 255,0, adc_tlv), WM8983_RIGHT_ADC_DIGITAL_VOL, 0, 255, 0, adc_tlv),
SOC_DOUBLE_R_TLV("Capture PGA Boost Switch", WM8983_LEFT_ADC_BOOST_CTRL, SOC_DOUBLE_R("Capture PGA ZC Switch", WM8983_LEFT_INP_PGA_GAIN_CTRL,
WM8983_RIGHT_ADC_BOOST_CTRL, 8, 1, 0, pga_boost_tlv), WM8983_RIGHT_INP_PGA_GAIN_CTRL, 7, 1, 0),
SOC_DOUBLE_R_TLV("Capture PGA Volume", WM8983_LEFT_INP_PGA_GAIN_CTRL, SOC_DOUBLE_R_TLV("Capture PGA Volume", WM8983_LEFT_INP_PGA_GAIN_CTRL,
WM8983_RIGHT_INP_PGA_GAIN_CTRL, 0, 63, 0, pga_vol_tlv), WM8983_RIGHT_INP_PGA_GAIN_CTRL, 0, 63, 0, pga_vol_tlv),
SOC_DOUBLE_R("Capture PGA ZC Switch", WM8983_LEFT_INP_PGA_GAIN_CTRL, SOC_DOUBLE_R_TLV("Capture PGA Boost Volume",
WM8983_RIGHT_INP_PGA_GAIN_CTRL, 7, 1, 0), WM8983_LEFT_ADC_BOOST_CTRL, WM8983_RIGHT_ADC_BOOST_CTRL,
8, 1, 0, pga_boost_tlv),
SOC_DOUBLE("ADC Inversion Switch", WM8983_ADC_CONTROL, 0, 1, 1, 0), SOC_DOUBLE("ADC Inversion Switch", WM8983_ADC_CONTROL, 0, 1, 1, 0),
SOC_SINGLE("ADC 128x Oversampling Switch", WM8983_ADC_CONTROL, 3, 1, 0), SOC_SINGLE("ADC 128x Oversampling Switch", WM8983_ADC_CONTROL, 8, 1, 0),
SOC_DOUBLE_R_TLV("Playback Volume", WM8983_LEFT_DAC_DIGITAL_VOL, SOC_DOUBLE_R_TLV("Playback Volume", WM8983_LEFT_DAC_DIGITAL_VOL,
WM8983_RIGHT_DAC_DIGITAL_VOL, 0, 255, 0, dac_tlv), WM8983_RIGHT_DAC_DIGITAL_VOL, 0, 255, 0, dac_tlv),
...@@ -293,12 +257,12 @@ static const struct snd_kcontrol_new wm8983_snd_controls[] = { ...@@ -293,12 +257,12 @@ static const struct snd_kcontrol_new wm8983_snd_controls[] = {
SOC_DOUBLE_R("Headphone Switch", WM8983_LOUT1_HP_VOLUME_CTRL, SOC_DOUBLE_R("Headphone Switch", WM8983_LOUT1_HP_VOLUME_CTRL,
WM8983_ROUT1_HP_VOLUME_CTRL, 6, 1, 1), WM8983_ROUT1_HP_VOLUME_CTRL, 6, 1, 1),
SOC_DOUBLE_R_TLV("Speaker Playback Volume", WM8983_LOUT2_SPK_VOLUME_CTRL,
WM8983_ROUT2_SPK_VOLUME_CTRL, 0, 63, 0, out_tlv),
SOC_DOUBLE_R("Speaker Playback ZC Switch", WM8983_LOUT2_SPK_VOLUME_CTRL, SOC_DOUBLE_R("Speaker Playback ZC Switch", WM8983_LOUT2_SPK_VOLUME_CTRL,
WM8983_ROUT2_SPK_VOLUME_CTRL, 7, 1, 0), WM8983_ROUT2_SPK_VOLUME_CTRL, 7, 1, 0),
SOC_DOUBLE_R("Speaker Switch", WM8983_LOUT2_SPK_VOLUME_CTRL, SOC_DOUBLE_R("Speaker Switch", WM8983_LOUT2_SPK_VOLUME_CTRL,
WM8983_ROUT2_SPK_VOLUME_CTRL, 6, 1, 1), WM8983_ROUT2_SPK_VOLUME_CTRL, 6, 1, 1),
SOC_SINGLE("Speaker Inversion Switch", WM8983_BEEP_CONTROL, 4, 1, 0),
SOC_SINGLE("Speaker Boost Switch", WM8983_OUTPUT_CTRL, 2, 1, 0),
SOC_SINGLE("OUT3 Switch", WM8983_OUT3_MIXER_CTRL, SOC_SINGLE("OUT3 Switch", WM8983_OUT3_MIXER_CTRL,
6, 1, 1), 6, 1, 1),
...@@ -334,24 +298,18 @@ static const struct snd_kcontrol_new wm8983_snd_controls[] = { ...@@ -334,24 +298,18 @@ static const struct snd_kcontrol_new wm8983_snd_controls[] = {
SOC_SINGLE_TLV("EQ5 Volume", WM8983_EQ5_HIGH_SHELF, 0, 24, 1, eq_tlv), SOC_SINGLE_TLV("EQ5 Volume", WM8983_EQ5_HIGH_SHELF, 0, 24, 1, eq_tlv),
SOC_ENUM("3D Depth", depth_3d), SOC_ENUM("3D Depth", depth_3d),
SOC_ENUM("Bias Voltage Select", bias_sel_mode),
SOC_ENUM("Mono", mono_sel_mode),
SOC_ENUM("ADC Mono", adcleft_sel_mode),
SOC_ENUM("DAC Mono", dacleft_sel_mode),
}; };
static const struct snd_kcontrol_new left_out_mixer[] = { static const struct snd_kcontrol_new left_out_mixer[] = {
SOC_DAPM_SINGLE("Line Switch", WM8983_LEFT_MIXER_CTRL, 1, 1, 0), SOC_DAPM_SINGLE("Line Switch", WM8983_LEFT_MIXER_CTRL, 1, 1, 0),
SOC_DAPM_SINGLE("AuxL Switch", WM8983_LEFT_MIXER_CTRL, 5, 1, 0), SOC_DAPM_SINGLE("Aux Switch", WM8983_LEFT_MIXER_CTRL, 5, 1, 0),
SOC_DAPM_SINGLE("LDAC Switch", WM8983_LEFT_MIXER_CTRL, 0, 1, 0), SOC_DAPM_SINGLE("PCM Switch", WM8983_LEFT_MIXER_CTRL, 0, 1, 0),
SOC_DAPM_SINGLE("RDAC Switch", WM8983_OUTPUT_CTRL, 5, 1, 0),
}; };
static const struct snd_kcontrol_new right_out_mixer[] = { static const struct snd_kcontrol_new right_out_mixer[] = {
SOC_DAPM_SINGLE("Line Switch", WM8983_RIGHT_MIXER_CTRL, 1, 1, 0), SOC_DAPM_SINGLE("Line Switch", WM8983_RIGHT_MIXER_CTRL, 1, 1, 0),
SOC_DAPM_SINGLE("AuxR Switch", WM8983_RIGHT_MIXER_CTRL, 5, 1, 0), SOC_DAPM_SINGLE("Aux Switch", WM8983_RIGHT_MIXER_CTRL, 5, 1, 0),
SOC_DAPM_SINGLE("RDAC Switch", WM8983_RIGHT_MIXER_CTRL, 0, 1, 0), SOC_DAPM_SINGLE("PCM Switch", WM8983_RIGHT_MIXER_CTRL, 0, 1, 0),
SOC_DAPM_SINGLE("LDAC Switch", WM8983_OUTPUT_CTRL, 6, 1, 0),
}; };
static const struct snd_kcontrol_new left_input_mixer[] = { static const struct snd_kcontrol_new left_input_mixer[] = {
...@@ -450,7 +408,7 @@ static const struct snd_soc_dapm_widget wm8983_dapm_widgets[] = { ...@@ -450,7 +408,7 @@ static const struct snd_soc_dapm_widget wm8983_dapm_widgets[] = {
SND_SOC_DAPM_PGA("OUT4 Out", WM8983_POWER_MANAGEMENT_3, SND_SOC_DAPM_PGA("OUT4 Out", WM8983_POWER_MANAGEMENT_3,
8, 0, NULL, 0), 8, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("MICBIAS", WM8983_POWER_MANAGEMENT_1, 4, 0, SND_SOC_DAPM_SUPPLY("Mic Bias", WM8983_POWER_MANAGEMENT_1, 4, 0,
NULL, 0), NULL, 0),
SND_SOC_DAPM_INPUT("LIN"), SND_SOC_DAPM_INPUT("LIN"),
...@@ -484,14 +442,12 @@ static const struct snd_soc_dapm_route wm8983_audio_map[] = { ...@@ -484,14 +442,12 @@ static const struct snd_soc_dapm_route wm8983_audio_map[] = {
{ "OUT4 Out", NULL, "OUT4 Mixer" }, { "OUT4 Out", NULL, "OUT4 Mixer" },
{ "OUT4", NULL, "OUT4 Out" }, { "OUT4", NULL, "OUT4 Out" },
{ "Right Output Mixer", "RDAC Switch", "Right DAC" }, { "Right Output Mixer", "PCM Switch", "Right DAC" },
{ "Right Output Mixer", "LDAC Switch", "Left DAC" }, { "Right Output Mixer", "Aux Switch", "AUXR" },
{ "Right Output Mixer", "AuxR Switch", "AUXR" },
{ "Right Output Mixer", "Line Switch", "Right Boost Mixer" }, { "Right Output Mixer", "Line Switch", "Right Boost Mixer" },
{ "Left Output Mixer", "LDAC Switch", "Left DAC" }, { "Left Output Mixer", "PCM Switch", "Left DAC" },
{ "Left Output Mixer", "RDAC Switch", "Right DAC" }, { "Left Output Mixer", "Aux Switch", "AUXL" },
{ "Left Output Mixer", "AuxL Switch", "AUXL" },
{ "Left Output Mixer", "Line Switch", "Left Boost Mixer" }, { "Left Output Mixer", "Line Switch", "Left Boost Mixer" },
{ "Right Headphone Out", NULL, "Right Output Mixer" }, { "Right Headphone Out", NULL, "Right Output Mixer" },
...@@ -604,10 +560,6 @@ static bool wm8983_writeable(struct device *dev, unsigned int reg) ...@@ -604,10 +560,6 @@ static bool wm8983_writeable(struct device *dev, unsigned int reg)
static int wm8983_dac_mute(struct snd_soc_dai *dai, int mute, int direction) static int wm8983_dac_mute(struct snd_soc_dai *dai, int mute, int direction)
{ {
struct snd_soc_component *component = dai->component; struct snd_soc_component *component = dai->component;
struct wm8983_priv *wm8983 = snd_soc_component_get_drvdata(component);
if (wm8983->mute)
gpiod_set_value_cansleep(wm8983->mute, mute);
return snd_soc_component_update_bits(component, WM8983_DAC_CONTROL, return snd_soc_component_update_bits(component, WM8983_DAC_CONTROL,
WM8983_SOFTMUTE_MASK, WM8983_SOFTMUTE_MASK,
...@@ -868,28 +820,6 @@ static int wm8983_set_pll(struct snd_soc_dai *dai, int pll_id, ...@@ -868,28 +820,6 @@ static int wm8983_set_pll(struct snd_soc_dai *dai, int pll_id,
return 0; return 0;
} }
static int wm8983_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct snd_soc_component *component = dai->component;
struct wm8983_priv *wm8983 = snd_soc_component_get_drvdata(component);
if (wm8983->mute)
gpiod_set_value_cansleep(wm8983->mute, 1);
return 0;
}
static void wm8983_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct snd_soc_component *component = dai->component;
struct wm8983_priv *wm8983 = snd_soc_component_get_drvdata(component);
if (wm8983->mute)
gpiod_set_value_cansleep(wm8983->mute, 0);
}
static int wm8983_set_sysclk(struct snd_soc_dai *dai, static int wm8983_set_sysclk(struct snd_soc_dai *dai,
int clk_id, unsigned int freq, int dir) int clk_id, unsigned int freq, int dir)
{ {
...@@ -914,11 +844,6 @@ static int wm8983_set_sysclk(struct snd_soc_dai *dai, ...@@ -914,11 +844,6 @@ static int wm8983_set_sysclk(struct snd_soc_dai *dai,
return 0; return 0;
} }
#define VMIDSEL_OFF 0x0
#define VMIDSEL_500K 0x2
#define VMIDSEL_100K 0x1
#define VMIDSEL_10K 0x3
static int wm8983_set_bias_level(struct snd_soc_component *component, static int wm8983_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level) enum snd_soc_bias_level level)
{ {
...@@ -932,10 +857,6 @@ static int wm8983_set_bias_level(struct snd_soc_component *component, ...@@ -932,10 +857,6 @@ static int wm8983_set_bias_level(struct snd_soc_component *component,
snd_soc_component_update_bits(component, WM8983_POWER_MANAGEMENT_1, snd_soc_component_update_bits(component, WM8983_POWER_MANAGEMENT_1,
WM8983_VMIDSEL_MASK, WM8983_VMIDSEL_MASK,
1 << WM8983_VMIDSEL_SHIFT); 1 << WM8983_VMIDSEL_SHIFT);
/* Microphone BIAS must be enabled too */
snd_soc_component_update_bits(component, WM8983_POWER_MANAGEMENT_1,
WM8983_MICBEN_MASK,
WM8983_MICBEN);
break; break;
case SND_SOC_BIAS_STANDBY: case SND_SOC_BIAS_STANDBY:
if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
...@@ -1022,8 +943,6 @@ static int wm8983_probe(struct snd_soc_component *component) ...@@ -1022,8 +943,6 @@ static int wm8983_probe(struct snd_soc_component *component)
} }
static const struct snd_soc_dai_ops wm8983_dai_ops = { static const struct snd_soc_dai_ops wm8983_dai_ops = {
.startup = wm8983_startup,
.shutdown = wm8983_shutdown,
.mute_stream = wm8983_dac_mute, .mute_stream = wm8983_dac_mute,
.hw_params = wm8983_hw_params, .hw_params = wm8983_hw_params,
.set_fmt = wm8983_set_fmt, .set_fmt = wm8983_set_fmt,
...@@ -1036,19 +955,19 @@ static const struct snd_soc_dai_ops wm8983_dai_ops = { ...@@ -1036,19 +955,19 @@ static const struct snd_soc_dai_ops wm8983_dai_ops = {
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
static struct snd_soc_dai_driver wm8983_dai = { static struct snd_soc_dai_driver wm8983_dai = {
.name = "wm8983", .name = "wm8983-hifi",
.playback = { .playback = {
.stream_name = "Playback", .stream_name = "Playback",
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
.rates = (SNDRV_PCM_RATE_48000), .rates = SNDRV_PCM_RATE_8000_48000,
.formats = WM8983_FORMATS, .formats = WM8983_FORMATS,
}, },
.capture = { .capture = {
.stream_name = "Capture", .stream_name = "Capture",
.channels_min = 2, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
.rates = (SNDRV_PCM_RATE_48000), .rates = SNDRV_PCM_RATE_8000_48000,
.formats = WM8983_FORMATS, .formats = WM8983_FORMATS,
}, },
.ops = &wm8983_dai_ops, .ops = &wm8983_dai_ops,
...@@ -1133,12 +1052,6 @@ static int wm8983_i2c_probe(struct i2c_client *i2c, ...@@ -1133,12 +1052,6 @@ static int wm8983_i2c_probe(struct i2c_client *i2c,
return ret; return ret;
} }
wm8983->mute = devm_gpiod_get_optional(&i2c->dev, "mute", GPIOD_OUT_LOW);
if (IS_ERR(wm8983->mute)) {
dev_err(&i2c->dev, "Failed to request mute GPIO.\n");
return PTR_ERR(wm8983->mute);
}
i2c_set_clientdata(i2c, wm8983); i2c_set_clientdata(i2c, wm8983);
ret = devm_snd_soc_register_component(&i2c->dev, ret = devm_snd_soc_register_component(&i2c->dev,
...@@ -1153,19 +1066,12 @@ static const struct i2c_device_id wm8983_i2c_id[] = { ...@@ -1153,19 +1066,12 @@ static const struct i2c_device_id wm8983_i2c_id[] = {
}; };
MODULE_DEVICE_TABLE(i2c, wm8983_i2c_id); MODULE_DEVICE_TABLE(i2c, wm8983_i2c_id);
static const struct of_device_id wm8983_of_match[] = {
{ .compatible = "seco,wm8983" },
{ }
};
MODULE_DEVICE_TABLE(of, wm8983_of_match);
static struct i2c_driver wm8983_i2c_driver = { static struct i2c_driver wm8983_i2c_driver = {
.driver = { .driver = {
.name = "seco-wm8983", .name = "wm8983",
.of_match_table = wm8983_of_match,
}, },
.probe = wm8983_i2c_probe, .probe = wm8983_i2c_probe,
.id_table = wm8983_i2c_id, .id_table = wm8983_i2c_id
}; };
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment