Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/fix/nau8825', 'asoc/fix/ops', 'a…
Browse files Browse the repository at this point in the history
…soc/fix/rcar', 'asoc/fix/rl6231', 'asoc/fix/rockchip' and 'asoc/fix/rt5670' into asoc-linus
  • Loading branch information
broonie committed Nov 25, 2015
7 parents 787b121 + 4454a83 + 9a11ef7 + 7115cb9 + 7336dce + 18a9d74 + e71bf05 commit 642eb06
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 14 deletions.
31 changes: 31 additions & 0 deletions sound/soc/codecs/nau8825.c
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,36 @@ static int nau8825_i2c_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int nau8825_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct nau8825 *nau8825 = dev_get_drvdata(dev);

disable_irq(client->irq);
regcache_cache_only(nau8825->regmap, true);
regcache_mark_dirty(nau8825->regmap);

return 0;
}

static int nau8825_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct nau8825 *nau8825 = dev_get_drvdata(dev);

regcache_cache_only(nau8825->regmap, false);
regcache_sync(nau8825->regmap);
enable_irq(client->irq);

return 0;
}
#endif

static const struct dev_pm_ops nau8825_pm = {
SET_SYSTEM_SLEEP_PM_OPS(nau8825_suspend, nau8825_resume)
};

static const struct i2c_device_id nau8825_i2c_ids[] = {
{ "nau8825", 0 },
{ }
Expand All @@ -1297,6 +1327,7 @@ static struct i2c_driver nau8825_driver = {
.name = "nau8825",
.of_match_table = of_match_ptr(nau8825_of_ids),
.acpi_match_table = ACPI_PTR(nau8825_acpi_match),
.pm = &nau8825_pm,
},
.probe = nau8825_i2c_probe,
.remove = nau8825_i2c_remove,
Expand Down
6 changes: 4 additions & 2 deletions sound/soc/codecs/rl6231.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ int rl6231_calc_dmic_clk(int rate)
}

for (i = 0; i < ARRAY_SIZE(div); i++) {
/* find divider that gives DMIC frequency below 3MHz */
if (3000000 * div[i] >= rate)
if ((div[i] % 3) == 0)
continue;
/* find divider that gives DMIC frequency below 3.072MHz */
if (3072000 * div[i] >= rate)
return i;
}

Expand Down
12 changes: 6 additions & 6 deletions sound/soc/codecs/rt5670.h
Original file line number Diff line number Diff line change
Expand Up @@ -973,12 +973,12 @@
#define RT5670_SCLK_SRC_MCLK (0x0 << 14)
#define RT5670_SCLK_SRC_PLL1 (0x1 << 14)
#define RT5670_SCLK_SRC_RCCLK (0x2 << 14) /* 15MHz */
#define RT5670_PLL1_SRC_MASK (0x3 << 12)
#define RT5670_PLL1_SRC_SFT 12
#define RT5670_PLL1_SRC_MCLK (0x0 << 12)
#define RT5670_PLL1_SRC_BCLK1 (0x1 << 12)
#define RT5670_PLL1_SRC_BCLK2 (0x2 << 12)
#define RT5670_PLL1_SRC_BCLK3 (0x3 << 12)
#define RT5670_PLL1_SRC_MASK (0x7 << 11)
#define RT5670_PLL1_SRC_SFT 11
#define RT5670_PLL1_SRC_MCLK (0x0 << 11)
#define RT5670_PLL1_SRC_BCLK1 (0x1 << 11)
#define RT5670_PLL1_SRC_BCLK2 (0x2 << 11)
#define RT5670_PLL1_SRC_BCLK3 (0x3 << 11)
#define RT5670_PLL1_PD_MASK (0x1 << 3)
#define RT5670_PLL1_PD_SFT 3
#define RT5670_PLL1_PD_1 (0x0 << 3)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/rockchip/rockchip_spdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static int rk_spdif_probe(struct platform_device *pdev)
int ret;

match = of_match_node(rk_spdif_match, np);
if ((int) match->data == RK_SPDIF_RK3288) {
if (match->data == (void *)RK_SPDIF_RK3288) {
struct regmap *grf;

grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/rockchip/rockchip_spdif.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#define SPDIF_CFGR_VDW(x) (x << SPDIF_CFGR_VDW_SHIFT)
#define SDPIF_CFGR_VDW_MASK (0xf << SPDIF_CFGR_VDW_SHIFT)

#define SPDIF_CFGR_VDW_16 SPDIF_CFGR_VDW(0x00)
#define SPDIF_CFGR_VDW_20 SPDIF_CFGR_VDW(0x01)
#define SPDIF_CFGR_VDW_24 SPDIF_CFGR_VDW(0x10)
#define SPDIF_CFGR_VDW_16 SPDIF_CFGR_VDW(0x0)
#define SPDIF_CFGR_VDW_20 SPDIF_CFGR_VDW(0x1)
#define SPDIF_CFGR_VDW_24 SPDIF_CFGR_VDW(0x2)

/*
* DMACR
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sh/rcar/gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static int rsnd_gen2_probe(struct platform_device *pdev,
RSND_GEN_S_REG(SCU_SYS_STATUS0, 0x1c8),
RSND_GEN_S_REG(SCU_SYS_INT_EN0, 0x1cc),
RSND_GEN_S_REG(SCU_SYS_STATUS1, 0x1d0),
RSND_GEN_S_REG(SCU_SYS_INT_EN1, 0x1c4),
RSND_GEN_S_REG(SCU_SYS_INT_EN1, 0x1d4),
RSND_GEN_M_REG(SRC_SWRSR, 0x200, 0x40),
RSND_GEN_M_REG(SRC_SRCIR, 0x204, 0x40),
RSND_GEN_M_REG(SRC_ADINR, 0x214, 0x40),
Expand Down
7 changes: 7 additions & 0 deletions sound/soc/sh/rcar/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ static int rsnd_src_pcm_new_gen2(struct rsnd_mod *mod,
struct snd_soc_pcm_runtime *rtd)
{
struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
struct rsnd_mod *dvc = rsnd_io_to_mod_dvc(io);
struct rsnd_src *src = rsnd_mod_to_src(mod);
int ret;

Expand All @@ -936,6 +937,12 @@ static int rsnd_src_pcm_new_gen2(struct rsnd_mod *mod,
if (!rsnd_rdai_is_clk_master(rdai))
return 0;

/*
* SRC In doesn't work if DVC was enabled
*/
if (dvc && !rsnd_io_is_play(io))
return 0;

/*
* enable sync convert
*/
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/soc-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw_sx);
/**
* snd_soc_put_volsw_sx - double mixer set callback
* @kcontrol: mixer control
* @uinfo: control element information
* @ucontrol: control element information
*
* Callback to set the value of a double mixer control that spans 2 registers.
*
Expand Down

0 comments on commit 642eb06

Please sign in to comment.