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

Commit b7707a8b authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branches 'asoc/topic/atmel', 'asoc/topic/chmap',...

Merge remote-tracking branches 'asoc/topic/atmel', 'asoc/topic/chmap', 'asoc/topic/cq93vc' and 'asoc/topic/da7218' into asoc-next
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ Optional properties:
       this parameter to choose where the clock from.
     - By default the clock is from TK pin, if the clock from RK pin, this
       property is needed.
  - #sound-dai-cells: Should contain <0>.
     - This property makes the SSC into an automatically registered DAI.

Examples:
- PDC transfer:
+8 −3
Original line number Diff line number Diff line
@@ -2,8 +2,7 @@ Devicetree bindings for the Axentia TSE-850 audio complex

Required properties:
  - compatible: "axentia,tse850-pcm5142"
  - axentia,ssc-controller: The phandle of the atmel SSC controller used as
    cpu dai.
  - axentia,cpu-dai: The phandle of the cpu dai.
  - axentia,audio-codec: The phandle of the PCM5142 codec.
  - axentia,add-gpios: gpio specifier that controls the mixer.
  - axentia,loop1-gpios: gpio specifier that controls loop relays on channel 1.
@@ -43,6 +42,12 @@ the PCM5142 codec.

Example:

	&ssc0 {
		#sound-dai-cells = <0>;

		status = "okay";
	};

	&i2c {
		codec: pcm5142@4c {
			compatible = "ti,pcm5142";
@@ -77,7 +82,7 @@ Example:
	sound {
		compatible = "axentia,tse850-pcm5142";

		axentia,ssc-controller = <&ssc0>;
		axentia,cpu-dai = <&ssc0>;
		axentia,audio-codec = <&codec>;

		axentia,add-gpios = <&pioA 8 GPIO_ACTIVE_LOW>;
+50 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@

#include <linux/of.h>

#include "../../sound/soc/atmel/atmel_ssc_dai.h"

/* Serialize access to ssc_list and user count */
static DEFINE_SPINLOCK(user_lock);
static LIST_HEAD(ssc_list);
@@ -145,6 +147,49 @@ static inline const struct atmel_ssc_platform_data * __init
		platform_get_device_id(pdev)->driver_data;
}

#ifdef CONFIG_SND_ATMEL_SOC_SSC
static int ssc_sound_dai_probe(struct ssc_device *ssc)
{
	struct device_node *np = ssc->pdev->dev.of_node;
	int ret;
	int id;

	ssc->sound_dai = false;

	if (!of_property_read_bool(np, "#sound-dai-cells"))
		return 0;

	id = of_alias_get_id(np, "ssc");
	if (id < 0)
		return id;

	ret = atmel_ssc_set_audio(id);
	ssc->sound_dai = !ret;

	return ret;
}

static void ssc_sound_dai_remove(struct ssc_device *ssc)
{
	if (!ssc->sound_dai)
		return;

	atmel_ssc_put_audio(of_alias_get_id(ssc->pdev->dev.of_node, "ssc"));
}
#else
static inline int ssc_sound_dai_probe(struct ssc_device *ssc)
{
	if (of_property_read_bool(ssc->pdev->dev.of_node, "#sound-dai-cells"))
		return -ENOTSUPP;

	return 0;
}

static inline void ssc_sound_dai_remove(struct ssc_device *ssc)
{
}
#endif

static int ssc_probe(struct platform_device *pdev)
{
	struct resource *regs;
@@ -204,6 +249,9 @@ static int ssc_probe(struct platform_device *pdev)
	dev_info(&pdev->dev, "Atmel SSC device at 0x%p (irq %d)\n",
			ssc->regs, ssc->irq);

	if (ssc_sound_dai_probe(ssc))
		dev_err(&pdev->dev, "failed to auto-setup ssc for audio\n");

	return 0;
}

@@ -211,6 +259,8 @@ static int ssc_remove(struct platform_device *pdev)
{
	struct ssc_device *ssc = platform_get_drvdata(pdev);

	ssc_sound_dai_remove(ssc);

	spin_lock(&user_lock);
	list_del(&ssc->list);
	spin_unlock(&user_lock);
+13 −0
Original line number Diff line number Diff line
@@ -248,6 +248,7 @@ struct detailed_timing {
# define DRM_ELD_AUD_SYNCH_DELAY_MAX	0xfa	/* 500 ms */

#define DRM_ELD_SPEAKER			7
# define DRM_ELD_SPEAKER_MASK		0x7f
# define DRM_ELD_SPEAKER_RLRC		(1 << 6)
# define DRM_ELD_SPEAKER_FLRC		(1 << 5)
# define DRM_ELD_SPEAKER_RC		(1 << 4)
@@ -413,6 +414,18 @@ static inline int drm_eld_size(const uint8_t *eld)
	return DRM_ELD_HEADER_BLOCK_SIZE + eld[DRM_ELD_BASELINE_ELD_LEN] * 4;
}

/**
 * drm_eld_get_spk_alloc - Get speaker allocation
 * @eld: pointer to an ELD memory structure
 *
 * The returned value is the speakers mask. User has to use %DRM_ELD_SPEAKER
 * field definitions to identify speakers.
 */
static inline u8 drm_eld_get_spk_alloc(const uint8_t *eld)
{
	return eld[DRM_ELD_SPEAKER] & DRM_ELD_SPEAKER_MASK;
}

/**
 * drm_eld_get_conn_type - Get device type hdmi/dp connected
 * @eld: pointer to an ELD memory structure
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ struct ssc_device {
	int			user;
	int			irq;
	bool			clk_from_rk_pin;
	bool			sound_dai;
};

struct ssc_device * __must_check ssc_request(unsigned int ssc_num);
Loading