Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 254d96be authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/drm',...

Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/drm', 'asoc/topic/dwc' and 'asoc/topic/es8316' into asoc-next
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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
@@ -112,5 +113,12 @@ Example
					remote-endpoint = <&hdmi_connector_in>;
				};
			};

			port@2 {
				reg = <2>;
				codec_endpoint: endpoint {
					remote-endpoint = <&i2s0_cpu_endpoint>;
				};
			};
		};
	};
+8 −1
Original line number Diff line number Diff line
@@ -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:

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

+22 −0
Original line number Diff line number Diff line
@@ -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"

@@ -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 = {
+21 −0
Original line number Diff line number Diff line
@@ -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)
+1 −0
Original line number Diff line number Diff line
@@ -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;
Loading