Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/link-param', 'asoc/topic/m…
Browse files Browse the repository at this point in the history
…ax98090', 'asoc/topic/max98925' and 'asoc/topic/nuc900' into asoc-next
  • Loading branch information
broonie committed Apr 12, 2015
5 parents 626761a + 46172b6 + c6b424f + 5116ede + fa41181 commit e1f0599
Show file tree
Hide file tree
Showing 12 changed files with 1,704 additions and 41 deletions.
22 changes: 22 additions & 0 deletions Documentation/devicetree/bindings/sound/max98925.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
max98925 audio CODEC

This device supports I2C.

Required properties:

- compatible : "maxim,max98925"

- vmon-slot-no : slot number used to send voltage information

- imon-slot-no : slot number used to send current information

- reg : the I2C address of the device for I2C

Example:

codec: max98925@1a {
compatible = "maxim,max98925";
vmon-slot-no = <0>;
imon-slot-no = <2>;
reg = <0x1a>;
};
3 changes: 3 additions & 0 deletions include/sound/soc-dapm.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);
void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card);
int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
const struct snd_soc_pcm_stream *params,
unsigned int num_params,
struct snd_soc_dapm_widget *source,
struct snd_soc_dapm_widget *sink);

Expand Down Expand Up @@ -530,6 +531,8 @@ struct snd_soc_dapm_widget {
void *priv; /* widget specific data */
struct regulator *regulator; /* attached regulator */
const struct snd_soc_pcm_stream *params; /* params for dai links */
unsigned int num_params; /* number of params for dai links */
unsigned int params_select; /* currently selected param for dai link */

/* dapm control */
int reg; /* negative reg = no direct dapm */
Expand Down
1 change: 1 addition & 0 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ struct snd_soc_dai_link {
int be_id; /* optional ID for machine driver BE identification */

const struct snd_soc_pcm_stream *params;
unsigned int num_params;

unsigned int dai_fmt; /* format to set on init */

Expand Down
4 changes: 4 additions & 0 deletions sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_MAX98090 if I2C
select SND_SOC_MAX98095 if I2C
select SND_SOC_MAX98357A if GPIOLIB
select SND_SOC_MAX98925 if I2C
select SND_SOC_MAX9850 if I2C
select SND_SOC_MAX9768 if I2C
select SND_SOC_MAX9877 if I2C
Expand Down Expand Up @@ -461,6 +462,9 @@ config SND_SOC_MAX98095
config SND_SOC_MAX98357A
tristate

config SND_SOC_MAX98925
tristate

config SND_SOC_MAX9850
tristate

Expand Down
2 changes: 2 additions & 0 deletions sound/soc/codecs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ snd-soc-max98088-objs := max98088.o
snd-soc-max98090-objs := max98090.o
snd-soc-max98095-objs := max98095.o
snd-soc-max98357a-objs := max98357a.o
snd-soc-max98925-objs := max98925.o
snd-soc-max9850-objs := max9850.o
snd-soc-mc13783-objs := mc13783.o
snd-soc-ml26124-objs := ml26124.o
Expand Down Expand Up @@ -249,6 +250,7 @@ obj-$(CONFIG_SND_SOC_MAX98088) += snd-soc-max98088.o
obj-$(CONFIG_SND_SOC_MAX98090) += snd-soc-max98090.o
obj-$(CONFIG_SND_SOC_MAX98095) += snd-soc-max98095.o
obj-$(CONFIG_SND_SOC_MAX98357A) += snd-soc-max98357a.o
obj-$(CONFIG_SND_SOC_MAX98925) += snd-soc-max98925.o
obj-$(CONFIG_SND_SOC_MAX9850) += snd-soc-max9850.o
obj-$(CONFIG_SND_SOC_MC13783) += snd-soc-mc13783.o
obj-$(CONFIG_SND_SOC_ML26124) += snd-soc-ml26124.o
Expand Down
17 changes: 17 additions & 0 deletions sound/soc/codecs/max98090.c
Original file line number Diff line number Diff line change
Expand Up @@ -2605,8 +2605,24 @@ static int max98090_i2c_probe(struct i2c_client *i2c,
return ret;
}

static void max98090_i2c_shutdown(struct i2c_client *i2c)
{
struct max98090_priv *max98090 = dev_get_drvdata(&i2c->dev);

/*
* Enable volume smoothing, disable zero cross. This will cause
* a quick 40ms ramp to mute on shutdown.
*/
regmap_write(max98090->regmap,
M98090_REG_LEVEL_CONTROL, M98090_VSENN_MASK);
regmap_write(max98090->regmap,
M98090_REG_DEVICE_SHUTDOWN, 0x00);
msleep(40);
}

static int max98090_i2c_remove(struct i2c_client *client)
{
max98090_i2c_shutdown(client);
snd_soc_unregister_codec(&client->dev);
return 0;
}
Expand Down Expand Up @@ -2696,6 +2712,7 @@ static struct i2c_driver max98090_i2c_driver = {
.acpi_match_table = ACPI_PTR(max98090_acpi_match),
},
.probe = max98090_i2c_probe,
.shutdown = max98090_i2c_shutdown,
.remove = max98090_i2c_remove,
.id_table = max98090_i2c_id,
};
Expand Down
Loading

0 comments on commit e1f0599

Please sign in to comment.