Skip to content

Commit

Permalink
ASoC: rt5682: add default pdata for i2s mode
Browse files Browse the repository at this point in the history
Add a default pdata which can fit most HW design. So we don't need to
add a lot of DMI checking in this driver.

Signed-off-by: Bard liao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
bardliao authored and broonie committed Jan 17, 2019
1 parent 9019ab1 commit 3ac1b2e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sound/soc/codecs/rt5682.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ static const char *rt5682_supply_names[RT5682_NUM_SUPPLIES] = {
"VBAT",
};

static const struct rt5682_platform_data i2s_default_platform_data = {
.dmic1_data_pin = RT5682_DMIC1_DATA_GPIO2,
.dmic1_clk_pin = RT5682_DMIC1_CLK_GPIO3,
.jd_src = RT5682_JD1,
};

struct rt5682_priv {
struct snd_soc_component *component;
struct rt5682_platform_data pdata;
Expand Down Expand Up @@ -2534,6 +2540,8 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,

i2c_set_clientdata(i2c, rt5682);

rt5682->pdata = i2s_default_platform_data;

if (pdata)
rt5682->pdata = *pdata;
else
Expand Down

0 comments on commit 3ac1b2e

Please sign in to comment.