Skip to content

Commit b614e38

Browse files
committed
Merge branch 'fix/asoc' into for-linus
2 parents e68d3b3 + 0077ca0 commit b614e38

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

sound/soc/sh/migor.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/firmware.h>
1313
#include <linux/module.h>
1414

15+
#include <asm/clkdev.h>
1516
#include <asm/clock.h>
1617

1718
#include <cpu/sh7722.h>
@@ -40,12 +41,12 @@ static struct clk_ops siumckb_clk_ops = {
4041
};
4142

4243
static struct clk siumckb_clk = {
43-
.name = "siumckb_clk",
44-
.id = -1,
4544
.ops = &siumckb_clk_ops,
4645
.rate = 0, /* initialised at run-time */
4746
};
4847

48+
static struct clk_lookup *siumckb_lookup;
49+
4950
static int migor_hw_params(struct snd_pcm_substream *substream,
5051
struct snd_pcm_hw_params *params)
5152
{
@@ -180,6 +181,13 @@ static int __init migor_init(void)
180181
if (ret < 0)
181182
return ret;
182183

184+
siumckb_lookup = clkdev_alloc(&siumckb_clk, "siumckb_clk", NULL);
185+
if (!siumckb_lookup) {
186+
ret = -ENOMEM;
187+
goto eclkdevalloc;
188+
}
189+
clkdev_add(siumckb_lookup);
190+
183191
/* Port number used on this machine: port B */
184192
migor_snd_device = platform_device_alloc("soc-audio", 1);
185193
if (!migor_snd_device) {
@@ -200,12 +208,15 @@ static int __init migor_init(void)
200208
epdevadd:
201209
platform_device_put(migor_snd_device);
202210
epdevalloc:
211+
clkdev_drop(siumckb_lookup);
212+
eclkdevalloc:
203213
clk_unregister(&siumckb_clk);
204214
return ret;
205215
}
206216

207217
static void __exit migor_exit(void)
208218
{
219+
clkdev_drop(siumckb_lookup);
209220
clk_unregister(&siumckb_clk);
210221
platform_device_unregister(migor_snd_device);
211222
}

sound/soc/soc-cache.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,9 @@ static int snd_soc_8_16_write(struct snd_soc_codec *codec, unsigned int reg,
203203
data[1] = (value >> 8) & 0xff;
204204
data[2] = value & 0xff;
205205

206-
if (!snd_soc_codec_volatile_register(codec, reg))
207-
reg_cache[reg] = value;
206+
if (!snd_soc_codec_volatile_register(codec, reg)
207+
&& reg < codec->reg_cache_size)
208+
reg_cache[reg] = value;
208209

209210
if (codec->cache_only) {
210211
codec->cache_sync = 1;

0 commit comments

Comments
 (0)