Skip to content

Commit

Permalink
update for Kernel 5.10.y
Browse files Browse the repository at this point in the history
  • Loading branch information
waveshare committed Feb 23, 2021
1 parent cd5d2e0 commit eb60d91
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions wm8960.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ static int wm8960_configure_clocking(struct snd_soc_component *component)
{
struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component);
int sysclk, bclk, lrclk, freq_out, freq_in;
u16 iface1 = snd_soc_component_read32(component, WM8960_IFACE1);
u16 iface1 = snd_soc_component_read(component, WM8960_IFACE1);
int i, j, k;


Expand Down Expand Up @@ -859,7 +859,7 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream,
{
struct snd_soc_component *component = dai->component;
struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component);
u16 iface = snd_soc_component_read32(component, WM8960_IFACE1) & 0xfff3;
u16 iface = snd_soc_component_read(component, WM8960_IFACE1) & 0xfff3;
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
int i;

Expand Down Expand Up @@ -925,7 +925,7 @@ static int wm8960_hw_free(struct snd_pcm_substream *substream,
return 0;
}

static int wm8960_mute(struct snd_soc_dai *dai, int mute)
static int wm8960_mute(struct snd_soc_dai *dai, int mute, int direction)
{
struct snd_soc_component *component = dai->component;

Expand All @@ -940,7 +940,7 @@ static int wm8960_set_bias_level_out3(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{
struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component);
u16 pm2 = snd_soc_component_read32(component, WM8960_POWER2);
u16 pm2 = snd_soc_component_read(component, WM8960_POWER2);
int ret;

switch (level) {
Expand Down Expand Up @@ -1030,7 +1030,7 @@ static int wm8960_set_bias_level_capless(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{
struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component);
u16 pm2 = snd_soc_component_read32(component, WM8960_POWER2);
u16 pm2 = snd_soc_component_read(component, WM8960_POWER2);
int reg, ret;

switch (level) {
Expand Down Expand Up @@ -1249,7 +1249,7 @@ static int wm8960_set_pll(struct snd_soc_component *component,
if (!freq_in || !freq_out)
return 0;

reg = snd_soc_component_read32(component, WM8960_PLL1) & ~0x3f;
reg = snd_soc_component_read(component, WM8960_PLL1) & ~0x3f;
reg |= pll_div.pre_div << 4;
reg |= pll_div.n;

Expand Down Expand Up @@ -1292,23 +1292,23 @@ static int wm8960_set_dai_clkdiv(struct snd_soc_dai *codec_dai,

switch (div_id) {
case WM8960_SYSCLKDIV:
reg = snd_soc_component_read32(component, WM8960_CLOCK1) & 0x1f9;
reg = snd_soc_component_read(component, WM8960_CLOCK1) & 0x1f9;
snd_soc_component_write(component, WM8960_CLOCK1, reg | div);
break;
case WM8960_DACDIV:
reg = snd_soc_component_read32(component, WM8960_CLOCK1) & 0x1c7;
reg = snd_soc_component_read(component, WM8960_CLOCK1) & 0x1c7;
snd_soc_component_write(component, WM8960_CLOCK1, reg | div);
break;
case WM8960_OPCLKDIV:
reg = snd_soc_component_read32(component, WM8960_PLL1) & 0x03f;
reg = snd_soc_component_read(component, WM8960_PLL1) & 0x03f;
snd_soc_component_write(component, WM8960_PLL1, reg | div);
break;
case WM8960_DCLKDIV:
reg = snd_soc_component_read32(component, WM8960_CLOCK2) & 0x03f;
reg = snd_soc_component_read(component, WM8960_CLOCK2) & 0x03f;
snd_soc_component_write(component, WM8960_CLOCK2, reg | div);
break;
case WM8960_TOCLKSEL:
reg = snd_soc_component_read32(component, WM8960_ADDCTL1) & 0x1fd;
reg = snd_soc_component_read(component, WM8960_ADDCTL1) & 0x1fd;
snd_soc_component_write(component, WM8960_ADDCTL1, reg | div);
break;
default:
Expand Down Expand Up @@ -1364,11 +1364,12 @@ static int wm8960_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
static const struct snd_soc_dai_ops wm8960_dai_ops = {
.hw_params = wm8960_hw_params,
.hw_free = wm8960_hw_free,
.digital_mute = wm8960_mute,
.mute_stream = wm8960_mute,
.set_fmt = wm8960_set_dai_fmt,
.set_clkdiv = wm8960_set_dai_clkdiv,
.set_pll = wm8960_set_dai_pll,
.set_sysclk = wm8960_set_dai_sysclk,
.no_capture_mute = 1,
};

static struct snd_soc_dai_driver wm8960_dai = {
Expand Down

0 comments on commit eb60d91

Please sign in to comment.