Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/fsl-spdif', 'asoc/topic/hd…
Browse files Browse the repository at this point in the history
…mi', 'asoc/topic/maintainers' and 'asoc/topic/max8960' into asoc-next
  • Loading branch information
broonie committed Jul 24, 2016
5 parents dd0111d + d93c506 + efc9194 + 181ad2a + 716540f commit abc026f
Show file tree
Hide file tree
Showing 9 changed files with 976 additions and 13 deletions.
28 changes: 28 additions & 0 deletions Documentation/devicetree/bindings/sound/max9860.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
MAX9860 Mono Audio Voice Codec

Required properties:

- compatible : "maxim,max9860"

- reg : the I2C address of the device

- AVDD-supply, DVDD-supply and DVDDIO-supply : power supplies for
the device, as covered in bindings/regulator/regulator.txt

- clock-names : Required element: "mclk".

- clocks : A clock specifier for the clock connected as MCLK.

Examples:

max9860: max9860@10 {
compatible = "maxim,max9860";
reg = <0x10>;

AVDD-supply = <&reg_1v8>;
DVDD-supply = <&reg_1v8>;
DVDDIO-supply = <&reg_3v0>;

clock-names = "mclk";
clocks = <&pck2>;
};
8 changes: 8 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -7270,6 +7270,13 @@ F: Documentation/devicetree/bindings/i2c/max6697.txt
F: drivers/hwmon/max6697.c
F: include/linux/platform_data/max6697.h

MAX9860 MONO AUDIO VOICE CODEC DRIVER
M: Peter Rosin <[email protected]>
L: [email protected] (moderated for non-subscribers)
S: Maintained
F: Documentation/devicetree/bindings/sound/max9860.txt
F: sound/soc/codecs/max9860.*

MAXIM MUIC CHARGER DRIVERS FOR EXYNOS BASED BOARDS
M: Krzysztof Kozlowski <[email protected]>
L: [email protected]
Expand Down Expand Up @@ -10724,6 +10731,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
L: [email protected] (moderated for non-subscribers)
W: http://alsa-project.org/main/index.php/ASoC
S: Supported
F: Documentation/devicetree/bindings/sound/
F: Documentation/sound/alsa/soc/
F: sound/soc/
F: include/sound/soc*
Expand Down
13 changes: 8 additions & 5 deletions include/sound/hdmi-codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,38 +53,40 @@ struct hdmi_codec_params {
int channels;
};

struct hdmi_codec_pdata;
struct hdmi_codec_ops {
/*
* Called when ASoC starts an audio stream setup.
* Optional
*/
int (*audio_startup)(struct device *dev);
int (*audio_startup)(struct device *dev, void *data);

/*
* Configures HDMI-encoder for audio stream.
* Mandatory
*/
int (*hw_params)(struct device *dev,
int (*hw_params)(struct device *dev, void *data,
struct hdmi_codec_daifmt *fmt,
struct hdmi_codec_params *hparms);

/*
* Shuts down the audio stream.
* Mandatory
*/
void (*audio_shutdown)(struct device *dev);
void (*audio_shutdown)(struct device *dev, void *data);

/*
* Mute/unmute HDMI audio stream.
* Optional
*/
int (*digital_mute)(struct device *dev, bool enable);
int (*digital_mute)(struct device *dev, void *data, bool enable);

/*
* Provides EDID-Like-Data from connected HDMI device.
* Optional
*/
int (*get_eld)(struct device *dev, uint8_t *buf, size_t len);
int (*get_eld)(struct device *dev, void *data,
uint8_t *buf, size_t len);
};

/* HDMI codec initalization data */
Expand All @@ -93,6 +95,7 @@ struct hdmi_codec_pdata {
uint i2s:1;
uint spdif:1;
int max_i2s_channels;
void *data;
};

#define HDMI_CODEC_DRV_NAME "hdmi-audio-codec"
Expand Down
6 changes: 6 additions & 0 deletions sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_MAX98925 if I2C
select SND_SOC_MAX98926 if I2C
select SND_SOC_MAX9850 if I2C
select SND_SOC_MAX9860 if I2C
select SND_SOC_MAX9768 if I2C
select SND_SOC_MAX9877 if I2C
select SND_SOC_MC13783 if MFD_MC13XXX
Expand Down Expand Up @@ -568,6 +569,11 @@ config SND_SOC_MAX98926
config SND_SOC_MAX9850
tristate

config SND_SOC_MAX9860
tristate "Maxim MAX9860 Mono Audio Voice Codec"
depends on I2C
select REGMAP_I2C

config SND_SOC_PCM1681
tristate "Texas Instruments PCM1681 CODEC"
depends on I2C
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/codecs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ snd-soc-max9867-objs := max9867.o
snd-soc-max98925-objs := max98925.o
snd-soc-max98926-objs := max98926.o
snd-soc-max9850-objs := max9850.o
snd-soc-max9860-objs := max9860.o
snd-soc-mc13783-objs := mc13783.o
snd-soc-ml26124-objs := ml26124.o
snd-soc-nau8825-objs := nau8825.o
Expand Down Expand Up @@ -301,6 +302,7 @@ obj-$(CONFIG_SND_SOC_MAX9867) += snd-soc-max9867.o
obj-$(CONFIG_SND_SOC_MAX98925) += snd-soc-max98925.o
obj-$(CONFIG_SND_SOC_MAX98926) += snd-soc-max98926.o
obj-$(CONFIG_SND_SOC_MAX9850) += snd-soc-max9850.o
obj-$(CONFIG_SND_SOC_MAX9860) += snd-soc-max9860.o
obj-$(CONFIG_SND_SOC_MC13783) += snd-soc-mc13783.o
obj-$(CONFIG_SND_SOC_ML26124) += snd-soc-ml26124.o
obj-$(CONFIG_SND_SOC_NAU8825) += snd-soc-nau8825.o
Expand Down
15 changes: 8 additions & 7 deletions sound/soc/codecs/hdmi-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
return ret;

if (hcp->hcd.ops->audio_startup) {
ret = hcp->hcd.ops->audio_startup(dai->dev->parent);
ret = hcp->hcd.ops->audio_startup(dai->dev->parent, hcp->hcd.data);
if (ret) {
mutex_lock(&hcp->current_stream_lock);
hcp->current_stream = NULL;
Expand All @@ -122,8 +122,8 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
}

if (hcp->hcd.ops->get_eld) {
ret = hcp->hcd.ops->get_eld(dai->dev->parent, hcp->eld,
sizeof(hcp->eld));
ret = hcp->hcd.ops->get_eld(dai->dev->parent, hcp->hcd.data,
hcp->eld, sizeof(hcp->eld));

if (!ret) {
ret = snd_pcm_hw_constraint_eld(substream->runtime,
Expand All @@ -144,7 +144,7 @@ static void hdmi_codec_shutdown(struct snd_pcm_substream *substream,

WARN_ON(hcp->current_stream != substream);

hcp->hcd.ops->audio_shutdown(dai->dev->parent);
hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data);

mutex_lock(&hcp->current_stream_lock);
hcp->current_stream = NULL;
Expand Down Expand Up @@ -195,8 +195,8 @@ static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
hp.sample_rate = params_rate(params);
hp.channels = params_channels(params);

return hcp->hcd.ops->hw_params(dai->dev->parent, &hcp->daifmt[dai->id],
&hp);
return hcp->hcd.ops->hw_params(dai->dev->parent, hcp->hcd.data,
&hcp->daifmt[dai->id], &hp);
}

static int hdmi_codec_set_fmt(struct snd_soc_dai *dai,
Expand Down Expand Up @@ -280,7 +280,8 @@ static int hdmi_codec_digital_mute(struct snd_soc_dai *dai, int mute)
dev_dbg(dai->dev, "%s()\n", __func__);

if (hcp->hcd.ops->digital_mute)
return hcp->hcd.ops->digital_mute(dai->dev->parent, mute);
return hcp->hcd.ops->digital_mute(dai->dev->parent,
hcp->hcd.data, mute);

return 0;
}
Expand Down
Loading

0 comments on commit abc026f

Please sign in to comment.