Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/drm'…
Browse files Browse the repository at this point in the history
…, 'asoc/topic/dwc' and 'asoc/topic/es8316' into asoc-next
  • Loading branch information
broonie committed Jul 3, 2017
5 parents f83ff1f + e4798d2 + 7204e97 + 286345e + 664d00d commit be60547
Show file tree
Hide file tree
Showing 11 changed files with 845 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ graph bindings specified in Documentation/devicetree/bindings/graph.txt.
remote endpoint phandle should be a reference to a valid mipi_dsi_host device
node.
- Video port 1 for the HDMI output
- Audio port 2 for the HDMI audio input


Example
Expand Down Expand Up @@ -112,5 +113,12 @@ Example
remote-endpoint = <&hdmi_connector_in>;
};
};

port@2 {
reg = <2>;
codec_endpoint: endpoint {
remote-endpoint = <&i2s0_cpu_endpoint>;
};
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Required properties:
- clock-names: Shall contain "iahb" and "isfr" as defined in dw_hdmi.txt.
- ports: See dw_hdmi.txt. The DWC HDMI shall have one port numbered 0
corresponding to the video input of the controller and one port numbered 1
corresponding to its HDMI output. Each port shall have a single endpoint.
corresponding to its HDMI output, and one port numbered 2 corresponding to
sound input of the controller. Each port shall have a single endpoint.

Optional properties:

Expand Down Expand Up @@ -59,6 +60,12 @@ Example:
remote-endpoint = <&hdmi0_con>;
};
};
port@2 {
reg = <2>;
rcar_dw_hdmi0_sound_in: endpoint {
remote-endpoint = <&hdmi_sound_out>;
};
};
};
};

Expand Down
22 changes: 22 additions & 0 deletions drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <sound/hdmi-codec.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <linux/of_graph.h>

#include "adv7511.h"

Expand Down Expand Up @@ -182,10 +183,31 @@ static void audio_shutdown(struct device *dev, void *data)
{
}

static int adv7511_hdmi_i2s_get_dai_id(struct snd_soc_component *component,
struct device_node *endpoint)
{
struct of_endpoint of_ep;
int ret;

ret = of_graph_parse_endpoint(endpoint, &of_ep);
if (ret < 0)
return ret;

/*
* HDMI sound should be located as reg = <2>
* Then, it is sound port 0
*/
if (of_ep.port == 2)
return 0;

return -EINVAL;
}

static const struct hdmi_codec_ops adv7511_codec_ops = {
.hw_params = adv7511_hdmi_hw_params,
.audio_shutdown = audio_shutdown,
.audio_startup = audio_startup,
.get_dai_id = adv7511_hdmi_i2s_get_dai_id,
};

static struct hdmi_codec_pdata codec_data = {
Expand Down
21 changes: 21 additions & 0 deletions drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,30 @@ static void dw_hdmi_i2s_audio_shutdown(struct device *dev, void *data)
hdmi_write(audio, HDMI_AUD_CONF0_SW_RESET, HDMI_AUD_CONF0);
}

static int dw_hdmi_i2s_get_dai_id(struct snd_soc_component *component,
struct device_node *endpoint)
{
struct of_endpoint of_ep;
int ret;

ret = of_graph_parse_endpoint(endpoint, &of_ep);
if (ret < 0)
return ret;

/*
* HDMI sound should be located as reg = <2>
* Then, it is sound port 0
*/
if (of_ep.port == 2)
return 0;

return -EINVAL;
}

static struct hdmi_codec_ops dw_hdmi_i2s_ops = {
.hw_params = dw_hdmi_i2s_hw_params,
.audio_shutdown = dw_hdmi_i2s_audio_shutdown,
.get_dai_id = dw_hdmi_i2s_get_dai_id,
};

static int snd_dw_hdmi_probe(struct platform_device *pdev)
Expand Down
1 change: 1 addition & 0 deletions include/sound/designware_i2s.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ struct i2s_platform_data {

#define DW_I2S_QUIRK_COMP_REG_OFFSET (1 << 0)
#define DW_I2S_QUIRK_COMP_PARAM1 (1 << 1)
#define DW_I2S_QUIRK_16BIT_IDX_OVERRIDE (1 << 2)
unsigned int quirks;
unsigned int i2s_reg_comp1;
unsigned int i2s_reg_comp2;
Expand Down
5 changes: 5 additions & 0 deletions sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_DA9055 if I2C
select SND_SOC_DIO2125
select SND_SOC_DMIC
select SND_SOC_ES8316 if I2C
select SND_SOC_ES8328_SPI if SPI_MASTER
select SND_SOC_ES8328_I2C if I2C
select SND_SOC_ES7134
Expand Down Expand Up @@ -543,6 +544,10 @@ config SND_SOC_HDMI_CODEC
config SND_SOC_ES7134
tristate "Everest Semi ES7134 CODEC"

config SND_SOC_ES8316
tristate "Everest Semi ES8316 CODEC"
depends on I2C

config SND_SOC_ES8328
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-da732x-objs := da732x.o
snd-soc-da9055-objs := da9055.o
snd-soc-dmic-objs := dmic.o
snd-soc-es7134-objs := es7134.o
snd-soc-es8316-objs := es8316.o
snd-soc-es8328-objs := es8328.o
snd-soc-es8328-i2c-objs := es8328-i2c.o
snd-soc-es8328-spi-objs := es8328-spi.o
Expand Down Expand Up @@ -300,6 +301,7 @@ obj-$(CONFIG_SND_SOC_DA732X) += snd-soc-da732x.o
obj-$(CONFIG_SND_SOC_DA9055) += snd-soc-da9055.o
obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.o
obj-$(CONFIG_SND_SOC_ES7134) += snd-soc-es7134.o
obj-$(CONFIG_SND_SOC_ES8316) += snd-soc-es8316.o
obj-$(CONFIG_SND_SOC_ES8328) += snd-soc-es8328.o
obj-$(CONFIG_SND_SOC_ES8328_I2C)+= snd-soc-es8328-i2c.o
obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o
Expand Down
Loading

0 comments on commit be60547

Please sign in to comment.